LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using quad encoder and pci 6250, need velocity

Hi, I'm trying to measure velocity from a quad encoder. I have LV 8.0 and a pci-6250. So far the attempts at this seem to run into problems because of a inconsistent sample time. Has someone acuurately measured velocity of an quad encoder using a DAQ counter? Please let me know.

Thanks

Mike

0 Kudos
Message 1 of 11
(3,639 Views)

Hello,

 

Have you tried using the DAQ assistant to set up one counter to perform a frequency measurement of Pin A of the encoder?

 

If knowing direction is important, then you could set up 1 counter to perform Edge Count on encoder Pin A with external Count Direction connected to PinB, and a second counter to perform frequency measurement of Pin A.

 

I hope this helps.

 

 

0 Kudos
Message 2 of 11
(3,628 Views)
Hi:
I tried the first part of your response to setup a DAQmx task/vi to measure the frequency of the pulses from the A input of the encoder and I wasn't getting a steady value when I kow the encode is running at a constant velocity. Not sure if I'm missing some setup parameters. Thanks
0 Kudos
Message 3 of 11
(3,622 Views)

What is the PPR of your encoder and how fast are you currently trying to read the pulses?

0 Kudos
Message 4 of 11
(3,614 Views)

I've varied the loop delay quite a bit but right now it's at 100ms (1KHz)

Is that the sample rate of the counter?

The pulse per rev of the encoder is 500

0 Kudos
Message 5 of 11
(3,610 Views)
Sorry, meant to also ask what your maximum velocity would be in RPM. This is just to calculate the number of samples per second that you need to sample at.
0 Kudos
Message 6 of 11
(3,608 Views)
no problem, the max running velocity is 500,000 pulses per second
0 Kudos
Message 7 of 11
(3,606 Views)
sorry I gave you the max. velocity in terms of PPS, you have probably done the math but that is 60,000 RPM
0 Kudos
Message 8 of 11
(3,603 Views)

What is your code currently doing? Have you checked out some of the NI examples? Check in the DAQ>Counter Measurements section of the Example Finder. You might prefer to count pulses or instead use the DAQ VIs to measure frequency, etc. You are probably getting an unstable speed measurement because you are not counting/measuring the pulses fast enough. Missing pulses will do that.

0 Kudos
Message 9 of 11
(3,590 Views)

I had been using the examples all along to get this going. I've taken a jpeg snapshot of the test code I have running. I'm trying to use the tick count and the timed loop structure to build the velocity profile. I'm varying the period of the timed loop but mainly leaving at 100ms and that will produce a waveform close to the goal (attached).

The peak value is close as well as the end tiem but I cannot get them to match. Any suggestions will help. Thanks,

0 Kudos
Message 10 of 11
(3,567 Views)