Quote:
|
Originally Posted by Jeff McCune
Forgive me for possibly asking a dumb question but aren't you making this way harder than it needs to be? We've just got an aluminum disk with 30 holes punched in it and the encoder that first gives you. Our interrupt handler is a whopping shaft_encoder++;
|
The wheels on our robot are 12" in diameter. It would be difficult to mount an encoder disk anywhere but on the output shaft, so 30 holes would give us a resolution of 1.25". Not too bad. The down side is that if we get pushed backwards we won't know it. It also takes time to punch 30 holes in a disk, mount the sensors and debug it. We bought a 128 count/rev optical encoder. It gives us a resolution of 3 tenths of an inch, plus direction for free. Its one extra line of code to check the other encoder channel to get the direction. For a tank-drive robot the math is fairly involved to convert the distance measurements to the actual position. We figured that if we're going to do it we should have the best resolution possible.