RPM sensor with directions

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ruba
New user
Posts: 5
Joined: 05 Nov 2021, 00:21

RPM sensor with directions

#1 Post by Ruba » 05 Nov 2021, 01:37

I understand, that for RPM I need a pulse counter and then calculate the rpm, but how would I know the direction?

I found on the internet that if having two sensors with reflectors little shifted we can get the direction. The signal would look like this:

Image

But how do I feed signal from two sensors to Espeasy so that it will give me either positive or negative RPM?

All ideas are appeeciated!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: RPM sensor with directions

#2 Post by TD-er » 05 Nov 2021, 01:45

You can have a look at the rotary encoder plugin, which just does that.
Not sure how fast it can keep up, as it is done in software.

Ruba
New user
Posts: 5
Joined: 05 Nov 2021, 00:21

Re: RPM sensor with directions

#3 Post by Ruba » 05 Nov 2021, 12:09

Thanks TD-er for your reply!

I did think about rotary encoders as well as they are by physical construction very similar sensors, but the data output in ESP Easy is not really what I need. Output will be the number of revolutions in either direction, but I would need a number of revolutions per minute.

Without having a rpm function built in to ESP Easy I think about three approaches:

1) With pulse counter that measures time between current and last transmission, then calculate the RPM. To get the direction I would need need to have some logical rules that will read the second (shifted) sensor and then decide either to multiply rpm value by 1 or -1 to get the direction. I think this is not very good option for high RPMs as the measurement of pulse counter is rounded to 1ms.

2) With pulse counter calculate the difference between counts during a period of 1 second and then calculate the RPM. To get the negative or positive direction I need some logic as described in option 1.

3) Use rotary encoder and calculate the value between readings during a period of 1 second, then multiply it with 60 and I have RPM. This works in case rotary encoder values can go negative. Can they?

My RPM readings range from 100 to 3000. So I am concerned that higher RPMs might be inaccurate because of 1ms resolution for pulse counter (I read it somewhere in the forum). And slow RPMs might be a problem if measuring counts for 1 second.

I hope that someone already came across this problem and figured out what would be the best approach to solve it.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests