Counting Revolutions and Determining Direction w/Melexis 90217
Bill Chennault
Posts: 1,198
All--
I have a rotating shaft turning somewhere between 100 rpm and (maybe as much as) 300 rpm. I do not care about the speed of rotation. What I want to know is how many revolutions it makes and in which direction. (It is a screw drive.) My thought is to use two Melexis 90217 Hall Effect sensors placed on each side of the shaft with a single magnet fixed to the shaft. One 90217 would count rotations and use a single Stamp input pin. A comparison of the two 90217 outputs·(using another Stamp input pin) would allow me to determine rotation direction as long as I knew which direction the shaft began rotating upon startup.
Of course, (I think) if I used three 90217 sensors, then I would not need to know the direction of shaft rotation upon startup.
What do you think of this idea? (The reason I would use multiple Melexis 90217 devices is solely due to Parallax's support of things they sell. A dual Hall-Effect sensor designed to provide both count (or RPM) and direction would doubtless make more sense if I knew anything about electronics.)
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
I have a rotating shaft turning somewhere between 100 rpm and (maybe as much as) 300 rpm. I do not care about the speed of rotation. What I want to know is how many revolutions it makes and in which direction. (It is a screw drive.) My thought is to use two Melexis 90217 Hall Effect sensors placed on each side of the shaft with a single magnet fixed to the shaft. One 90217 would count rotations and use a single Stamp input pin. A comparison of the two 90217 outputs·(using another Stamp input pin) would allow me to determine rotation direction as long as I knew which direction the shaft began rotating upon startup.
Of course, (I think) if I used three 90217 sensors, then I would not need to know the direction of shaft rotation upon startup.
What do you think of this idea? (The reason I would use multiple Melexis 90217 devices is solely due to Parallax's support of things they sell. A dual Hall-Effect sensor designed to provide both count (or RPM) and direction would doubtless make more sense if I knew anything about electronics.)
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Comments
Going clockwise 1....1........1....................1....1........1.......................
Going countercw 1........1....1....................1........1....1.......................
So counting the space between the pulses you would know the direction
counting 1 for every 3 pulses you would know the revolution count.
At 300 RPM you have 200ms per revolution.
200 ms / 360 degrees = .55 ms per degree
Spacing magnets at 0, 45 and 135 degrees
gives you (45*.55) ms (90*.55)ms and the balance of the 360 degree rotation ((360-135)*.55)ms
25ms, 50ms, 125ms
so you have a short, medium and long pause between pulses
short,medium,long is one direction
short long medium is the other direction
A bit of math to calculate the lengths of the pauses as they relate to each other and you have it done with one sensor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
···· Use your two sensors and one magnet as you described. Then set up a quadrature counter in your stamp·program. You'll be able to both count number of revolutions AND determine· the direction.
·· I put a piece of sample code on my website:
··http://siskconsult.com/quadhicount.bs2
Regards,
·Tom Sisk
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
AND the shaft would be balanced better, hence no vibrations!!!!!
Bob
Thanks for the ideas! They were all better than mine.
Tom, I saved your code. Thanks.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Justin
sculpture and ceramics major
UMD
Duluth MN