SERVO 02.2017 37
Post comments on this section and find any associated files and/or downloads at
• Sudden drop-offs (stairs,
table/platform edge, etc.)
After I find the “perfect” angle,
I’ll make a better holder for the IR
sensor. For now, I used (wait for it)
double-sided foam tape again (Figure
Odometry is simply measuring
how far your robot has travelled. Go
wiki/Odometry to get more details.
The odometer in your car keeps
track of how far you have travelled,
based on how many times your drive
wheel has rotated and the diameter of
the tire. We can pretty much do the
same thing for Berry by using sensors
to figure out how many times one of
Berry’s tires has turned.
Looking at a photo of Berry, you
can see that his tires have five thin spokes separated by five
empty spaces (Figure 5). By using a simple reflective light
sensor mounted in such a way that it can “see” the spokes,
we will be able to count the spokes as the wheel turns.
Every five spokes, the wheel has turned a full 360 degrees.
The circumference of the tire is pi times the diameter
(i.e., pi times twice the radius), so once we know how
many revolutions Berry has travelled, we can multiply it by
the wheel’s circumference, giving us the total distance
As the wheel’s diameter is 64
mm, one revolution of the wheel
travels pi* 64 mm, which is 201.06 mm
(or 7.91 inches).
Of course, this measure will be a
little misleading, as it does not
account for going backwards or
spinning in place. Not to mention a
wheel travelling on the outside of a
turn will travel farther than the wheel
on the inside of the turn. Fortunately,
we can account for these issues!
The easiest way to NOT count the
distance the robot spins in place is to
simply stop accumulating the distance
travelled until the robot stops spinning.
To account for the different turn
radius per wheel, we have to
accumulate the distance for a wheel
on each side of Berry, then correct for
I tried to use two of my SirMorph reflective sensors. I
attempted to attach them to Berry in such a way that they
would get a good reading of the wheel spokes.
Unfortunately, there was not enough room to mount them
successfully on this chassis.
Since I did not want to mount the sensors on the
outside of the wheels (thus increasing Berry’s girth), I
decided to make two smaller sensors that I could attach to
the “bottom” of the motors and push into the empty space
in the wheel (Figure 6).
Giving Berry a Better Servo Mount