by Robert Doerr
One of the joys of the robotics hobby is mastering the art of interfacing. A lot of the parts are
already in front of us and we just need to make them work together. Recently, I ran into a
problem with a pair of quadrature encoders for the drive train on one of my robots. The
encoders themselves worked fine and were generating perfect quadrature outputs. However,
they were sending out data faster than the controller could handle at higher speeds. As a
result, the encoder readings were worthless and could not be trusted.
Getting a valid lower resolution reading of the encoder
is certainly better than high resolution unreliable data.
I needed to know how far the motors really moved but
didn’t necessarily need to know with as high of a resolution
as the encoders were providing. So, the task at hand was
a way to lower the resolution enough so that I could
always count on the readings and help keep track of the
movements. A bit of encoder resolution may be lost but it
should still be close enough for this particular project.
Symptoms of the Problem
the counts started going backwards! As it sped up some
more, it counted forward again. This cycle continued back
and forth a bit and then the counts were completely erratic.
It appears that the encoder was exceeding the polling time
used by the controller and would start missing pulses at
higher speeds. Obviously, the encoders were not matched
up well with the controller. I’ve seen this happen with my
robot drive base and also when I was using some salvaged
encoders from HP scanners and DeskJet printers. Whenever
you see symptoms like this, it should throw up a red flag and
make you take a look to see if this may be the problem.
I was watching the
encoder counts while running
some robot drive motors.
During the initial bench
testing, the motors weren’t
running at full speed and the
results I saw were just as
expected. However, things
got interesting when I started
ramping up the speed. A very
peculiar thing started happening. The encoder counts
started to rise as expected
but as the motors sped up,
Encoder processor board (component side).
Encoder processor board (solder side).
SERVO 07.2008 39