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:
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!
RPM sensor with directions
Moderators: grovkillen, Stuntteam, TD-er
Re: RPM sensor with directions
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.
Not sure how fast it can keep up, as it is done in software.
Re: RPM sensor with directions
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.
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.
Who is online
Users browsing this forum: No registered users and 66 guests