LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring speed with incremental encoder in Labview using arduino and Linx

Hello, I'm struggling to find a way to measure speed from encoder using linx and arduino.

I have connected encoder and I can detect both A and B encoder signals (no need in Z index)

Using Linx on arduino nano i'm getting on/off signals, but cannot figure out how to convert to speed 

The task is simple, but cannot figure out the proper way.

 

Please advice.

Thanks a lot

 

 

alexela_0-1639180764226.png

 

0 Kudos
Message 1 of 4
(2,385 Views)

If you know how many pulses there are in one revolution of the shaft.

 

Try counting the number of pulses during a defined time period and use some math to calculate RPM.

 

Also I think the Z (index) on an encoder like this would give you one pulse per revolution.

 

Try counting the number of Index pulses during a defined time period and use some math to calculate RPM.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 4
(2,333 Views)

Thought about, but my problem is the speed is crazy low. I will not get a full turn every time. 

But i'm working now on calculating RPM

Going to use elapse time for one sec with reset and calculate pulses I got during this time. 

I thought there an easy way to do it, without building own counter. Something like DAQ frequency measurement. 

 

Again, thanks.

 

0 Kudos
Message 3 of 4
(2,328 Views)

@alexela wrote:

Thought about, but my problem is the speed is crazy low. I will not get a full turn every time. 

But i'm working now on calculating RPM

Going to use elapse time for one sec with reset and calculate pulses I got during this time. 

I thought there an easy way to do it, without building own counter. Something like DAQ frequency measurement. 

 

Again, thanks.

 


Well you are basically making a frequency counter and you could start with an example program that does that. But the math will still have to change because you have to relate the number of pulses to rotational angle to know if you have made a complete revolution.

 

I just ran across this: How are encoders used for speed measurement?

 

Pulse counting

 

Pulse counting uses a sampling period (t) and the number of pulses (n) that are counted over the sampling period to determine the average time for one pulse (t/n). Knowing the number of pulses per revolution (N) for the encoder, the speed can be calculated.

 

ω = 2πn/Nt

 

Where:

ω = angular speed (rad/s)
n = number of pulses
t = sampling period (s)
N = pulses per rotation

 

Pulse timing

 

With the pulse timing method, a high-frequency clock signal is counted during one encoder period (the pitch, or interval between two adjacent lines or windows). The number of cycles of the clock signal (m), divided by the clock frequency (f), gives the time for the encoder period (the time for the encoder to rotate through one pitch). If the encoder PPR is denoted by N, the angular speed of the encoder is given by:

 

ω = 2πf/Nm

 

Where:

ω = angular speed (rad/s)

f = clock frequency (Hz)

m = number of clock cycles

N = pulses per rotation

 

At high speeds, there may be too little time between pulses for pulse timing (also referred to as pulse frequency) to accurately measure clock cycles, so this method is best for low speed applications.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 4
(2,324 Views)