LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output frequency is different then the set value

Solved!
Go to solution

I am generating sine wave using "simulate signal" block and sending it to DAQ Assistant to excite a shaker. The settings of Simulate signal and DAQ assistant are shown and the VI is also attached. The frequency being sent to DAQ is same. BUt when I am measuring the output frequency of shakr it is always coming higher. I am using BNC NI 9260 card and the shaker is a pssive device.

Can someone please guide where the problem is?

Thanks and regards

 

 

Download All
0 Kudos
Message 1 of 14
(4,130 Views)

I am generating sine wave using "simulate signal" block and sending it to DAQ Assistant to excite a shaker. The settings of Simulate signal and DAQ assistant are shown and the VI is also attached. The frequency being sent to DAQ is same. BUt when I am measuring the output frequency of shakr it is always coming higher. I am using BNC NI 9260 card and the shaker is a pssive device.

Can someone please guide where the problem is?

Thanks and regards

 

 

0 Kudos
Message 2 of 14
(4,137 Views)

How do you know that the shaker is at a higher frequency?

0 Kudos
Message 3 of 14
(4,114 Views)

I am measuring it using a laser displacemnet sensor and getting voltage through Labview in another computer

0 Kudos
Message 4 of 14
(4,109 Views)

The frequency (samples/second) of the output signal have to match the speed of the hardware device output update rate. Check to see if you can verify the two match-up.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 14
(4,080 Views)

How much off is your measured frequency (in %, ppm or Hz) and is the error within the accuracy of your interferometer and/or DAQ board?

 

... and why is your DAQ Assistant configured to generate 1001 sample blocks?

0 Kudos
Message 6 of 14
(4,032 Views)
Solution
Accepted by topic author MAnees

Looking at the datasheet you will find:

9260 samplerates.png

 

So, if you create samples for a different samplerate, not supported by the device, the resulting frequency will differ 🙂

Your example uses 1k SPS , and I don't know how the driver will coerce this.

Look for the examples, I bet there is a vi 😉

 

Finally, you will always find some differences between the frequencies, because the two units you use (one for generating, another to measure) don't share the same clock.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 7 of 14
(4,029 Views)

My frequency is approx 1.61 times higher and the error is almost negligible. i just kept one sample extra to write to start the new wave with 1st point of new cycle however i m not sure about this. 

0 Kudos
Message 8 of 14
(3,996 Views)
Solution
Accepted by topic author MAnees

As Henrik Volkers pointed out earlier your module can only sample at specific rates and as stated on Henrik's datasheet screenshot, the lowest rate is 51200 / 31 ~= 1.652 kS/s. That is why it is running ~1.65 times too fast.

 

To generate a theoretically perfect 1 Hz you either need to generate (and repeat) 31 periods of signal using 51200 samples or probably easier, 1 period of 51200 samples but change your rate (on both your Create Signal and your DAQ Assistent) to 51.2 kS/s

0 Kudos
Message 9 of 14
(3,990 Views)
Solution
Accepted by topic author MAnees

@MAnees wrote:

My frequency is approx 1.61 times higher and the error is almost negligible. i just kept one sample extra to write to start the new wave with 1st point of new cycle however i m not sure about this. 


According to the spec the lowers possible samplefrequency is 1.652 kHz , your output is a distorted sinewave with 1001 points...(assumed, I can't open your vi ) ...  so I would expect 1.6503 kHz ... almost fits 😄  

How do you measure the frequency?

Try it with a samplerate of 1652 Hz and generate 1652 sample 😉 

(for 1Hz, if you need to generate 0.8Hz you need to recalc the number of samples 😉 )

 

EDIT: LocalDSP... beat me with 5min 😉     

 

MAness: You should really learn some basics on digital signal processing. The hint with a higher samplerate is a good one!

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 10 of 14
(3,989 Views)