LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency sweep input output

Hi
Using Labview 7.1 and PCI 6071 DAQmx card i want to design a frequency sweep application. I mean  that i need my analogue output channel to give a sine wave with incremental frequency of 100 Hz step, starting from 10000 Hz untli  100000 Hz (10000 Hz, 10100 Hz...100000 Hz). This wave is applied on a kind of a transformer, and each time the frequency changes, i need an input channel to acquire another also sinus wave coming from this transformer and measure its amplitude, in order to examine its frequency response. So, i came up with the attached vi.
The problem is, that when "sweeping" takes place ,i get amplitude values between 2 and 6 or even 7 volts something that  can't be happening. I know that the amplitude values i should get are around 2 volts  (+/- 500 mV maximum).
I think, that the problem should be in some kind of "non-synchronization" of the input-output channels when the vi enters the loop to start changing the frequency.
Just to be more clear, i need my vi to do these steps in order:1. constantly output the 10000 Hz wave 2. acquire the input wave 3. measure its amplitude 4.transform the frequency into 10100 Hz 5. acquire the input wave 6. measure amplitude  etc... 
The odd thing is that when i physically connected the output channel with the input one to see if the frequency sweep is done, it worked fine. I mean that i did get in the input channel almost exactly the signal i generated.
 
Thanks in advance, and i hope i was not tiringly analytical..
0 Kudos
Message 1 of 7
(4,352 Views)
I think the clue is when you connected the output to the input and everything worked fine. This suggests that the program is OK. I have seen many tranformers in that frequency range which have resonances due to internal capacitances. A 6 or 7 volt output at resonance compared to 2 volts off resonance seems quite reasonable. Can you check the transformer with a signal generator and an oscilloscope to see if it behaves the same way?

Lynn
0 Kudos
Message 2 of 7
(4,348 Views)
I just used an oscilloscope and connected it to the output of the transformer, where the input channel of the DAQ card is connected, and ran the vi. I noticed that except from the sine wave that as i expected has an amplitude of about 2 volts, there is also a kind of "noisy wave" arising in the screen of the oscilloscope, coming and going very quickly. Indeed, when this signal arouse, even the oscilloscope was confused and delivered 5 and 6 Volts ampilitude values. It seems, that i have to deal with some kind of noise coming either from the transformer, or even from the wave generation from the card.
 
Thanks a lot for your help
0 Kudos
Message 3 of 7
(4,343 Views)
Try modifying your program so that you can manually sweep the frequency and see what happens if you hold the frequency constant at a value where the unusual signals occur. Then adjust the scope triggering for a stable display and see what you have. Scope displays can be tricky to interpret with swept signals.

Lynn
0 Kudos
Message 4 of 7
(4,342 Views)

Hi

Please take a glance at the two attached vi's.

The first is the one i use in order to generate a steady frequency sinus wave,feed it to my transformer and acquire the also sinus output of the transformer  through my input channel. Using two channels of an external oscilloscope i check and notice that for many frequency values, both sinus waves are steady and noiseless, with the expected amplitude voltages.

Now, using the second vi, in order to "sweep" the wave and check my transformers amplitude response, then these impossible amplitude "up's and down's" again came up.Again by looking at the oscilloscope's screen i can see the noisy waves tha "confuse" and the oscilloscope and my input channel, and so result in wrong amplitudes.

Based on the above, i have to assume, that the problem lies in the sweep mechanism design i use. Also, after trying several different ways to sweep, i came to the conclusion, that the problem comes up whenever i use the second Basic Function Generator.vi inside the loop. Could it be that it needs triggering again?

I'd really use some help, or maybe even ideas for different design approaches for the frequency sweep.

Thanks in advance

Download All
0 Kudos
Message 5 of 7
(4,321 Views)
I do not have any hardware which will run your program. I took out all the DAQmx stuff and just looked at the sweep. It seems to work fine.

I notice that you have the DAQ sampling rate set at 1.5 MHz and the function generator (outside the loop) sampling rate set at 1.0 MHz. I would set the rate one place and connect the same constant or control to all places where a rate is required.

Also, you are generating 1000 samples at 1.5 MHz. That set of data lasts .67 ms. Then you wait 500 ms before generating the next set. So is seems that rather than sweeping a continuous signal you are sending short bursts with long pauses between them. This my be what is causing the strange appearances on the scope. Even though you are set up for continuous samples, you are not sending enough data. Your bursts do not have complete cycles of the sine wave. I do not know what the AO generates if no data is written to it. Does it repeat the last value or the last buffer or do nothing?

Lynn
0 Kudos
Message 6 of 7
(4,301 Views)
I did the calculations and i think i understand what you told me. So, you mean that each "1000 samples" reading from the output buffer lasted for 67 ms (with  sampling rate 1.5 Ms/s), when even one cycle (one period) of the sine wave of i.e 50 kHz i asked it to give while sweeping needed at least 200 ms to be accomplished. (Did i understand well?)
On the other hand, constantly checking the output channel with the oscilloscope whenever i ran the vi (the one with the constant frequency), the generated sine wave seemed ok even though the sampling rate was stable at 1,5 Ms/s.
Do you think i should design a "varying sampling rate" mechanism for the Function generator.vi, this sampling rate depending on the frequency of the sine i want to generate each time while sweeping?
Thanks
Labros
 
0 Kudos
Message 7 of 7
(4,271 Views)