LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Output with frequency within 0~1 Hz in the waveform of sawtooth

Hello, I downloaded the continuous voltage output from LabVIEW example (attached) and tried to output the sawtooth waveform with frequency 0.1Hz and 0.2Hz. But I found it always output the frequency at 1Hz whenever I set the frequency lower than 1Hz. Where can I modify it please?

Thank you very much

0 Kudos
Message 1 of 6
(826 Views)

By default, a continuous sampling AO task will *regenerate* all the data you write to it prior to starting the task.  In your case, your default front panel values are 1000 Hz sampling and you write 1000 samples to the task -- i.e., 1 second worth.

 

You need 10 seconds worth of data to define a 0.1 Hz waveform.  But since you only define 1 second worth of data in the task buffer, you only end up repeatedly regenerating the first 1/10 of your sawtooth.  You may have been fooled because you'd still get a sawtooth, it just wouldn't span the full range of voltage values you intended.  The problem would have shown itself more obviously if you were generating a sine or a triangle.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 6
(812 Views)

Hello, Kevin,

Thank you. I changed the sample number to 10000 and the sampling rate keeps at 1000hz. Then I can set the frequency at 0.1Hz or other value between 0~1Hz. It is true the amplitude is not the full range as I set. It may be 0.8 or so when I set 1. Is there any methods that can solve this?

Thank you

0 Kudos
Message 3 of 6
(787 Views)

The GUI graph looks fine here with 10000 samples, 1000 Hz sampling, 0.1 Hz waveform freq.  How are you checking your amplitude?  Are you checking the real-world signal on a scope?  Might it be getting pulled down by a low impedance load?

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 6
(762 Views)

Hi, Kevin,

I observe the amplitude trough the analog output of mirror scan voltage in the graph. The true value of voltage is -5V~+5V and the amplitude is normalized at 1 as the full range. I did not check the real output voltage from the cable. The voltage output is connected to the SCB-68A box and the mirror servo board.  If the impedance pull down the value, why does not pull down both of the amplitudes?

Thank you

Download All
0 Kudos
Message 5 of 6
(752 Views)

1.  RE: +/- 5V

    Your settings for +/- 5V are only used to define the D/A converter's available voltage range.  (Actually, this range isn't infinitely variable, but DAQmx will know what ranges are actually legal for your device and will choose the smallest one that includes both your min and max.)

 

2. RE: 0.8V vs. 1.0V

    I don't see your waveform max voltage being limited to 0.8V.  It seems to approach (but not actually quite reach) 1.0 V.

    A closer look at the waveform generation function shows that this is a pretty straightforward case of quantization effects.  While it seems unfortunate that a sawtooth or triangle aren't *guaranteed* to hit both the min and max voltages implied by amplitude and offset, it's a bit of an intractable problem for the general case.  It simply can't always work out that way.  The failure to get all the way to 1.0V with your set of parameters is one of the consequences of the general-purpose function generation algorithm.

    Consequently, I'd advise that you switch away from any function generation routines and instead use the Ramp Pattern function.  There you can make sure you include both endpoints while also controlling the # samples in the ramp pattern.   And after all, a sawtooth is just a bunch of ramps appended end to end.

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 6
(744 Views)