Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

enoder issues on 6023E - urgent!

Hi, I have a NI 6023E and I'm trying to get labview to read velocity (or frequency) from an encoder on a motor.

When I hook the encoder to the DAQ card and program using Labview, I'm getting very strange results. If I use a function generator to send the DAQ card a 80 Hz frequency square wave, the "measure frequency" vi returns 88 Hz. If I input 20 Hz, Labview reads 22 Hz. Unless both the function generator AND oscilloscope estimate are wrong, the NI card/VI I'm using is wrong.

I've tried using Windows 98 + labview to collect the ticks and divide by the elapsed time, but the output chart (over time) is jagged and inconsistant. According to the oscilloscope, the function generator stays consistant.

I have a data and ground wire from the encoder. Where do I hook them up to the card, and how can I get Labview 6.1 to read the correct frequency?

Thank you very much! I need this program to work in 2 days. 😞
0 Kudos
Message 1 of 5
(3,206 Views)

Dear Idbeu,

For fast frequency measurements and wide ranges of frequencies, you want to use two counters to get an accurate frequency. One counter is used to divide down the frequency and the other counter is used to measure it.

For slower frequency measurement, you want to use only one counter. You use this counter to measure the period and then take the reciprocal to get the frequency.

In DAQmx this is really easy because the examples specifically say this. However, LabVIEW 6.1 only works with Traditional (Legacy) DAQ. Traditional (Legacy) DAQ only has one frequency example (Measure Frequency). If you look at the description, it uses two counters for this measurement. There is a Measure Period that only uses one counter. I recommend using this VI and then taking the reciprocal.

Have a great day!

Marni S.

0 Kudos
Message 2 of 5
(3,189 Views)
Sweet! The function generator frequency is measured accurately. Thanks!

I still have a problem with the motor encoder output. The encoder frequency varies much more than the function generator (both vary to some degree), but my program is having a very difficult time measuring quickly. I set the measuring delay to 0.001 second, and it works quite well for the function generator. But when the encoder is hooked up, it pauses every few tenths of a second for a couple seconds. When it measures the frequency, it gets it right. It's just pausing between readings too long.

Is this due to the inconsistency of the encoder, or something more sinister?

EDIT: The signal from the motor is typically around 1kHz. The program can quickly read an accurate signal from the function generator between 10 Hz to about 4 MHz

Message Edited by idbeu on 10-20-2005 10:17 AM

0 Kudos
Message 3 of 5
(3,183 Views)
After a long, long day, I think I can conclude that the signal from the motor encoder is too noisy for the labview vi's to measure. It looks fine on the oscilloscope, but there must be some ringing that I can't detect.

If anyone has suggestions on how to read a rigged encoder with labview 6.1, I'm all ears.
0 Kudos
Message 4 of 5
(3,162 Views)

Dear Idbeu,

It sounds like you are getting noise on your encoder signal. I would analyze the frequency of the noise and create a filter that gets rid of the noise. Have a great day!

Sincerely,

Marni S.

0 Kudos
Message 5 of 5
(3,147 Views)