LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure the rotational speed by using rotary encoder and 1 counter?

I want to measure the rotational speed of a shaft, and I have below hardware:

1, a rotary encoder, with A,B,Z signals output;

2, PCI-E6363 card.

 

I do konw how to use such a  encoder to measure the rotational angle by using the function "DAQmxCreateCIAngEncoderChan", but this time I need to measure the speed(rpm), as well as the dirction of the speed, which means a negative speed represent a CCW rotate direction.

 

More detail informations:

for the encoder, the A,B signal is 600ppr, and Z signal is 1ppr

the rotatinal speed is in range: -300 ~ 5000 rpm.

 

some one suggested me that I can use the "DAQmxCreateCIAngEncoderChan" task to measure the angle firstly and then do the differential analysis with the angle. but I have to enable the Z index function, and it's hard to calculate when the shaft speed is fast then 2500rpm.

 

Anyone can help me on this issue?

Thanks in advance!

0 Kudos
Message 1 of 4
(5,713 Views)

To measure the speed from the encoder you can simply follow some of the frequency measurement examples that ship with DAQmx, considering that speed (rpm) is given by frequency (Hz) on one encoder output / 600 (ppr) * 60 (s->min)  = frequency / 10.

Difficult is to add a sign to this measurement: frequency measurement gives you no information about sense of rotation, so I suppose you could perform two angle measurements to get the sense of rotation and then get the speed as above.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(5,702 Views)

 

 


RobertoBozzolo 已写:

To measure the speed from the encoder you can simply follow some of the frequency measurement examples that ship with DAQmx, considering that speed (rpm) is given by frequency (Hz) on one encoder output / 600 (ppr) * 60 (s->min)  = frequency / 10.

Difficult is to add a sign to this measurement: frequency measurement gives you no information about sense of rotation, so I suppose you could perform two angle measurements to get the sense of rotation and then get the speed as above.


0 Kudos
Message 3 of 4
(5,683 Views)

What I was thinking of was to use a single timer with two tasks:

 

1. Start a task for position reading

2. Perform two readings and decide the sense of rotation based on results

3. Stop the task and start a new one (frequency)

4. Loop reading and calculating speed

 

This can work if the sense of rotation does not vary during this process.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(5,667 Views)