View Single Post
  #19   Spotlight this post!  
Unread 16-01-2005, 16:54
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: Hall Effect Sensor.

Quote:
Originally Posted by Sparks333
Al,
I was looking over the allegra datasheets (links up above... Thanks Caleb Fulton!) and on Page 9, it describes something regarding polarity and direction. I think its internal circuity makes it so when you are facing a tooth going one direction, it's high, but when you are going the other direction, it's low. If your gear teeth are fairly far apart, you would have to measure the duty cycle to see which way it's turning... not sure how it would be done, but it may be possible with a single sensor to tell direction.
Here's what I read. Please correct me if I'm wrong.



http://www.allegromicro.com/datafile/0660.pdf
, pg.9
Well, it's difficult and processor-expensive to do so. You'd have to measure the length of each pulse, by interrupting on rising edge, then having the handler switch to interrupt on falling edge. By using a timer to count the ticks between these two, you can obtain the length of the pulse.

However, the time to pulse also varies with the speed (no direction) of the rotations. You sort of have to know the speed to do much with it.


However, I see little wrong with assuming direction. A PID controller reacts in ~20-30 ms -- it's very unlikely a robot can push yours in the reverse direction at that exact velocity...
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics