LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inexperienced user needs help with DC signal generation.

Greetings all,

 

I'm working on a project where I need to generate a DC voltage signal that will have an effect on an incoming DC voltage signal. I want to generate a 'neutral' signal, and then two signals at +/- one volt from that 'neutral' signal. As I generate each signal I want to record the incoming DC voltage signal and then compare all three of the recorded signals to see which is greatest. After determining which of the incoming signals is greatest I want to make it so that the generated DC voltage signal that caused that greatest incoming voltage becomes the new 'neutral' signal, and then repeat the process.

 

The problem I'm having is that I don't know how to change where ground is or alternatively generate a signal of “x +/- 1” volts where I determine x by reading off something I've recorded earlier. Or maybe there's some completely different way of doing it that I can't think of. I simply don't know how to make the program flexible enough so that it can loop and generate signals that aren't the first three 'neutral' and 'neutral' +/- 1 signals.

 

I'm a complete novice when it comes to programming, especially in labVIEW, and I've been reading and rereading the help file for the past few weeks, and I'm sure it's telling me what I need to know, but I find I don't understand. I'm hoping someone will be able to communicate in clearer language how it is I can do what I need to do.

 

I'm using labVIEW version 8.6 and an NI USB 6229 device to produce/measure the signals.

 

I hope I've made it clear what I want to do and that someone here is able to help me. Thank you very much for taking the time to read this, I hope this message finds you well.

 

Yours,

 

Will

0 Kudos
Message 1 of 9
(3,200 Views)

Will,

 

I do not understand what you want.  I suspect that it has to do with the terminology you are using.

 

Working backwards a bit: Your DAQ device will have an analog common or ground.  The terminology varies with different devices.  All of the outputs it generates will be with respect to that common.  Unless your system is completely isolated from all ground and commons and has its own internal power source (like batteries), its inputs and outputs will be measured with respect to its common.  Usually the commons are connected together.  In some special cases they can be separated by some voltage, but you need to know what you are doing or you will destroy something!

 

Next: Do you want to generate voltages one at a time or do you want your "neutral" and "+/-1 V signal" to exist simultaneously?  What is the range of "neutral" voltages (measured with respect to common or ground) do you need?  How much current do you need to supply to your system from either of the signals?

 

Can you tell us what you are actually trying to do?

 

Do not worry about LV yet.  First you need to define what you are doing in terms which match those used by the suppliers of the equipment and software.

 

Lynn

0 Kudos
Message 2 of 9
(3,189 Views)

What a convoluted explanation! Smiley Surprised  So far, I understand wanting to generate three DC voltages.  The "neutral" might be 5v.  The other two will be 6v and 4v.  So far so good.  Now an incoming signal is captured.  Lets say it is 7v.  Do you want to now change the neutral to 7v and make the other two 8v adn 6v?

 

If the incoming is 3v, then what?  If the incoming is 5.5v or 4.5v, then what?  Use numbers to describe the action.  The term DC "signal" is a misnomer.  DC is a voltage.  AC is a signal.

 

Do you want to plot all three signals?

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 9
(3,176 Views)

If I understand your question, you want any voltage that exceeds an upper limit that is itself a voltage, to become the new 'input' voltage and the new limits voltages to adjust themselves to become +- 1 volt from what was the upper voltage but is now the voltage to be evaluated.  And then repeat. Interesting problem!

0 Kudos
Message 4 of 9
(3,169 Views)

Hey Lynn,

 

Sorry about being so oblique, I guess I just wanted to excise information that wasn't 'relevant' to my question but, I have no idea what I'm doing so I'll just describe what I'm trying to do and hopefully I'll be guided to a better approach (my current approach doesn't work).

 

The project I'm working on is I'm trying to set up a laser lock from saturation spectroscopy.  The idea is that we have an extended cavity diode laser that has a grating attached to a piezoelectric crystal that changes the angle of the grating relative to the laser head (and therefore the wavelength that leaves the cavity) based on an incoming DC voltage (ie, I send a voltage into the laser and based on that voltage I get out different wavelengths).  We send this laser through a rubidium cell and  catch the light in a photo-diode which generates another dc voltage, based on the frequency of the light going through the cell (ie, the voltage I send into the laser will affect the voltage I get out of the photo diode).

 

What I want to do is create a loop that will generate a dc voltage which will be sent to the peizo and while that voltage is being generated record what I'm getting from the photo-diode.  After I have my photo-diode output recorded I want to generate two different voltages, one after the other, to send to the peizo (so no, I only want one of my generated signals at once) which are close to my original signal (equidistant from the original voltage one at +x volts the other at -x volts, 1V was just an example number that I was planning on scaling myself) and record how that affects the absorption as measured by the photo-diode.  After I have all three recorded I want to see which input voltage gave me the best absorption (ie the laser is closest to resonance with the rubidium) and make that voltage signal the new starting place, so I'd check +/- x from there.  

 

The loop would look something like:

 

1.) Generate 'neutral' signal for peizo

2.) Record photo-diode output

3.) Generate +x signal

4.) Record photo-diode output

5.) Generate -x signal

6.) Record photo-diode output

7.) Compare recorded photo-diode outputs, find out which signal gave best absorption

8.) Call the signal which gave the best absorption the 'neutral' signal

9.) GOTO 1

 

Hopefully that makes it a little clearer what it is I'm trying to accomplish, I notice that since I've started writing this another reply has cropped up saying that I wasn't being very clear, but I think this puts my question in better perspective and I hope it helps the community to help me.

 

Thank you very much for taking the time to read the initial post (especially since it was so poorly worded :P) and to respond thoughtfully and helpfully.

 

Yours,

 

Will

0 Kudos
Message 5 of 9
(3,165 Views)

This sounded like a fun project so I wrote a vi that I think will do the trick.  It is saved in 8.6.  You will have to specify the device name for the AI and AO channels on the front panel.  Also you should enter the starting neutral voltage and the amount of time in milliseconds to wait for the photo-diode to respond after sending the piezo voltage.  The loop does exactly as your instructions describe.  Stop the program by pressing the stop button.

 

Do you want to record the voltages?  I have not put in any provisions for saving or recording data.

 

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 9
(3,151 Views)

I just tried using a simulator to run my vi.  I didn't have the 6229 simulation so I used others.  I had to remove so setup for triggering and sample clock because my AO simulator didn't support those functions..  You may have to fiddle with the code depending on what errors you get.  Also, I had to change the number of samples to read from 1 to 2.  1 gave an error.  If you run into errors, just list the error message (not the error number), and we will help out.

 

- tbob

Inventor of the WORM Global
Message 7 of 9
(3,143 Views)

Will,

 

I have been working with a scientist who does exactly what you are trying to do, except that everything is done in hardware with analog circuits.  It locks (with a bit ofmanaul tuning effort) and typically stays locked for tens of minutes before something drifts out of the lock range.  We are working on improving the circuits so that it will stay locked as long as the power is on.

 

He acquires the lock by sweeping a ramp signal across the range of interest to locate the desired peak, then switches to the feedback mode to maintain lock.

 

Generating a sweep with adjustable amplitude and offset is probably what you really want.

 

Lynn

0 Kudos
Message 8 of 9
(3,123 Views)

Greetings,

 

First of all I'd like to say thank you so much tbob!  I'm just testing out the VI right now and everything seems to be working fine.  With a little calibration (peizo response to DC input and laser response to peizo flexing) I'll probably be able to lock this down to a pretty narrow frequency range.  Thank you so much to everyone else as well, just taking the time to read my question and respond means a lot.  I feel lucky to have found such a nice and welcoming community.

 

Lynn, it's neat to hear that there are other people doing the same thing as us.  We have another laser that we are locking via DAVLL using circuitry we've put together but my supervisor wanted to see if we could make a lock using our saturation spectroscopy set up instead of getting another DAVLL set up going.  He also wanted labVIEW to do data acquisition and felt that it could probably help in making this lock.  I think I read in Hecht's "Optics" that in their early days lasers were called 'a solution looking for a problem' and it's always so cool to me how many applications we've come up with for them.  The ubiquity of lasers never fails to put a smile on my face, and running into someone with a locking set up similar to ours seemingly randomly (selection bias of being on a forum for programming labVIEW notwithstanding) has pretty much made my day.  Thanks for sharing that.

 

In the coming days I'll probably be back with questions but for today I think I'll be working on some hardware issues, thank you once again tbob for all your help and to the community at large for putting up with me.  I wish you all well.

 

Yours,

 

Will

0 Kudos
Message 9 of 9
(3,111 Views)