LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Variables Between two Loops

Solved!
Go to solution

Hi all,

 

I use LabView for work and haven't had much formal training in it so I learn as I go. The problem that I believe I'm having is LabView won't let you pass variables from one loop to another to lets say update an input, my understanding is likely flawed. In the code posted below I need to be able to update the input of duty cycle based on the measured power of the laser. This program will ideally  calibrate a CO2 laser for any power you want by adjusting the duty cycle until the power meter is within +-1 watt of the power you would like to be at. This duty cycle than can be used as the input in another program to run the laser at a specific energy. Currently on the block diagram duty cycle will adjust but its not actually changing the input to the function generator. This is where my LabView knowledge comes up short.

 

Any ideas anyone? 

 

Thanks!

0 Kudos
Message 1 of 12
(4,416 Views)

It's dangerous to go alone, take this.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 12
(4,412 Views)

Word of caution- ambient air or chiller setpoint (in the case of a water cooled CO2) changes of a few degrees can account for a few percent drift in beam output power.

Al least with my experience with 50W Synrads and 100W Coherent sealed tubes.

 

You may want to characterize this, lest you start chasing your tail to achieve +/-1W accuracy.

 

-AK2DM

 

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 3 of 12
(4,372 Views)

I dug up this data from 2004, running just 20%PWM for a 100W DEOS, note how chiller setpoint changes affect power level and the time it takes to approach steady state (10+ minutes).

 

YMMV

 

-AK2DM

 

Capture.JPG

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 4 of 12
(4,361 Views)

From your description, it sounds like you want to take a measurement from the laser, then adjust the duty cycle, then take another measurement, and repeat this process until the output power is where you want it.  This measure-adjust cycle should go into a while loop.  Your code has the "close instrument" code in a loop, and you only did the measure and adjust steps once.  Why did you do this?

0 Kudos
Message 5 of 12
(4,345 Views)

So far in my experience with this laser the power is pretty stable with in about 2 watts and it will stay like that for however long you run the laser. This laser is air cooled so maybe the temperature jumps aren't as much. I don't need the power to be perfect but I need a duty cycle that can get it within a range of about 2 watts

0 Kudos
Message 6 of 12
(4,320 Views)

Yes that is what I am looking to do with this code! Are you saying the measure and adjust should be in the same loop as the code that sets the duty cycle for the function generator? 

0 Kudos
Message 7 of 12
(4,315 Views)

Yes, that is what he is saying.  But it sounds (to me) like this would be a good time for you to Write Some Documentation, and to state (for yourself) as clearly as possible what you want to do.  For example:

  • Set an initial Duty Cycle
  • Run the Laser for X amount of time, taking measurements.  We now have a Base Case.
  • In a Loop --
    • Adjust the Duty Cycle (manually, according to some rule, randomly, you decide).
    • Make another Laser Measurement.
    • From the earlier Duty Cycle/Measurement and the current Duty Cycle/Measurement data,
      • Decide if we are done, and can exit this loop.
      • Optionally, if the next Duty Cycle is based on a Rule, use these data in the Rule if appropriate

Since you can't run the Laser without specifying the Duty Cycle, you really do need to set Duty Cycle, then run Laser.  If you put this process in a loop, you can test various settings and decide which you want to use.  You can do this manually or use an algorithm that you specify (that's why it's good to Write it Down).  Similarly, you can control the stopping condition, including "Best" or "Good Enough".

 

Bob Schor

Message 8 of 12
(4,291 Views)

Yes, that is what I mean.  I agree with Bob, you should probably spend some time and carefully write down the steps that you want to perform.  This should help you to design your code.

0 Kudos
Message 9 of 12
(4,247 Views)

And Please:

 

Wear your laser safety eyewear rated for the emission band of the laser!

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 10 of 12
(4,226 Views)