06-15-2011 03:53 PM
Hello,
I'm using a rotary encoder with phase A and phase B and a ground output attached to an M-series SCB-68 which is attached to an NI PCI-6221.
I'm using the Meas Dig Frequency-Low Freq 1 Ctr.vi which I added a while loop to and is attached below.
I have phase A attached to PFI 9 for frequency measurement. (I attached ground to D GND and phase B to PFI 10).
When I run the VI I obtain a frequency that fluctuates wildly reaching frequencies as high as 2285714 Hz.
I have used a multimeter between the phase A and ground wires and obtained a frequency of 118~122 Hz which is the number I expect.
What steps do I need to take to get the correct frequency in LabVIEW?
My ultimate goal is to find the RPM of the encoder which has 64 PPR.
Thank you for any assistance you can provide.
Solved! Go to Solution.
06-15-2011 05:38 PM
Hi pd1234,
You are probably picking up glitches on the transitions (encoders tend to be pretty noisy signal sources). These glitches would register as very short pulses, which would in turn be calculated to represent very large frequencies. To fix the problem, you should enable digital filtering (see M Series User Manual😞
The above will pass through any pulses larger than 6.425 us, but will ignore the small glitches that you are likely seeing.
Best Regards,
06-20-2011 07:57 AM
I am interested in doing something similar but with a buffered freq measurement. The problem is that I need to sync my sample rate with another AI task and am using the ai scan clock for this purpose. If I attempt to sample the freq measurement faster than the encoder counts are coming in then DAQmx driver throws an error. If my shaft is stopped or is running very slowly then this measurement technique fails. I am wondering if there is a way to configure that DAQmx driver to overlook such conditions and just pass the previous measurement to the buffer under such conditions.
06-20-2011 10:50 AM - edited 06-20-2011 10:52 AM