Making a quarature encoder

This is a photo of the encoder disk that I'm working on for the Hitari Tumbler robot chassis modification.

AUT_1404_small_levels.jpg

The gear wheel is driven, in the car/robot chassis, directly from an 8-tooth pinion on the motor shaft. It then transmits the drive to the front and rear wheels on one side of the chassis.I want to accurately measure the speed of this gear wheel, so that I can write a PID speed control program for the motor(s). Then, I'll have accurate odometry (distance measuring) as well as a kind of "cruise control" for the whole robot. I'll fit two IR LED/photodiode sensors in the holes in the white plastic panel, at 90 degrees to each other, relative to the gear axle. Then, using an encoder disk with an odd number of spokes, I should get quadrature signals (90 degrees out of phase). This mock-up will let me test sensor alignment and circuitry before drilling holes in the real chassis!

 

90 being 90?
It was odd to think about, but it does look like the sensors will be 90 degrees out of phase! I had to picture that you had 18 stripes, 9 black and 9 white, that represent 20 degrees of rotation each, and the sensors would be 4.5 stripes from each other. Putting one sensor on a line between stripes while the other was in the middle of a stripe, exactly 90 degrees out of phase, perfect.

Quadrature

It does sem a little odd, but I think it’ll work! I got the basic idea from this web page, by David Anderson and published by the Seattle Robotics Society:

http://www.seattlerobotics.org/encoder/200109/dpa.html

If you scroll down the Section V, he talks about any encoder disk with an odd number of black segments giving quadrature signals. You just have to place the detectors accurately at 90 degrees. In my case, I think the accuracy problem will be to get an accurate location for the centre of the disk. That’ll be on the other side of the chassis from the sensors! Anyway, I’ll press on and post an update to LMR.

PS. I have an updated version of the PostScript program from that web page, modified for metric measurements, amongst other things.