Go Down

Topic: Rotary encoder for using tachometer(RPM meter) (Read 200 times) previous topic - next topic

Irvanmustofs55

dear All ,
I have a rotary encoder,
can the rotary encoder be used as an RPM meter, my hope is to be able to know the number of revolutions to the left or right in the form of RPM which shows the number minus if the rotation to the left and plus if the right rotation.
thanks before

pylon

Usually that can be made. It depends how fast your object is rotating and what resolution the rotary encoder has. A rotary encoder with a resolution of 400 steps per rotation measuring a motor with 100'000 rpms won't work. As you failed to provide a link to the hardware you're using (the rotary encoder) and also didn't specify the RPM range we're talking about, we cannot give any further help.

zhomeslice

#2
Aug 06, 2019, 09:33 pm Last Edit: Aug 06, 2019, 09:33 pm by zhomeslice
Here are a couple of sketch examples I've used to handle tachometer control with an encoder (400 pulses per revolution)

Z
HC

dougp

I have a rotary encoder,
can the rotary encoder be used as an RPM meter, my hope is to be able to know the number of revolutions to the left or right in the form of RPM which shows the number minus if the rotation to the left and plus if the right rotation.

As with many things, encoders come in a vast variety of types, etc.  One like that pictured in post #2 will probably last a long time reading RPM.

Ones like this, for human-driven front panel use, not so much.  You could use it to prove the theory and get some code running but it's not made for high, continuous turning rates.
Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

Irvanmustofs55

Usually that can be made. It depends how fast your object is rotating and what resolution the rotary encoder has. A rotary encoder with a resolution of 400 steps per rotation measuring a motor with 100'000 rpms won't work. As you failed to provide a link to the hardware you're using (the rotary encoder) and also didn't specify the RPM range we're talking about, we cannot give any further help.
here i try with proximity sensor that
Here are a couple of sketch examples I've used to handle tachometer control with an encoder (400 pulses per revolution)

Z
thank you for sharing knowledge,
here I am trying with a proximity sensor instead of the encoder,
I tried it based on references from the website

http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder

from this source the pulse signal is generated if each time the A signal pulse changes from positive to zero, we read the value of pulse B. We see that when the encoder is rotated clockwise, pulse B is always positive. When the encoder is rotated counterclockwise, pulse B is negative. By testing both outputs with a microcontroller we can determine the direction of rotation and by counting the number of pulses A to what extent it has changed.

Is this working pattern the same as the one you made?




zhomeslice

#5
Aug 09, 2019, 01:34 am Last Edit: Aug 09, 2019, 01:45 am by zhomeslice
Origional question:
Quote
can the rotary encoder be used as an RPM meter
Yes, it can. The code I provided earlier does that. The code you provide is for the encoder part.

A Tachometer only needs one pulse source from the Data OR Clock pin of the encoder. The code  you provided below is for an Encoder.
My Tachometer code provided doesn't check both Data and Clock pins and so it doesn't need to check direction just the rate of rotation.

here i try with proximity sensor that
thank you for sharing knowledge,
here I am trying with a proximity sensor instead of the encoder,
I tried it based on references from the website

http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder

from this source the pulse signal is generated if each time the A signal pulse changes from positive to zero, we read the value of pulse B. We see that when the encoder is rotated clockwise, pulse B is always positive. When the encoder is rotated counterclockwise, pulse B is negative. By testing both outputs with a microcontroller we can determine the direction of rotation and by counting the number of pulses A to what extent it has changed.

Is this working pattern the same as the one you made?
The Tachometer only needs to know the time between pulses and the number of pulses per revolution. It doesn't need to determine what state the other pin is in.

I am not sure what you are looking for. an Encoder or a Tachometer or both.

Z
HC

Go Up