Chapter 60: wheel odometry

Wheel Odometry and Encoders From wheel turns to position, and where it goes wrong

A robot on wheels can estimate its position and speed from the turns of its wheels. This page shows what that needs: the wheel radius, and a sensor that counts the turns, the encoder. It ends with the two errors that make wheel odometry drift, and the two ways to fight them.

Words used on this page (open this if a word is new)
wheel radius rFrom the centre of a wheel to its edge.
calibrationMeasuring a value carefully on the real robot.
wearMaterial rubbed off a wheel, so it slowly gets smaller.
encoderA cheap sensor that counts how much a wheel turned.
LEDA small light.
receiverGives 1 when light reaches it, 0 when it does not.
waveformThe 1 and 0 of the receiver drawn over time.
frequencyHow many times something happens in one second (Hz).
absolute encoderAn encoder that reads a unique code for every part of its disc.
channelOne light with its receiver, reading one ring.
binary numberA number written with 0 and 1; places are worth 1, 2, 4, 8.
resolutionThe smallest turn an encoder can notice.
slippageThe wheel turns but slides, so the robot moves less.
sensor fusionMerging several odometry sources into one estimate.
01

The wheel radius

Wheel odometry turns wheel turns into distance. For that it needs one number above all: the wheel radius. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. Every wheel turn moves the robot by 2 × π × r, so the radius decides how accurate the odometry is. Good systems calibrate it, because even wheels of the same model differ slightly and wear makes them smaller. Turns and time per turn then give the position and the speed.

Quick check

02

The incremental encoder

The turns are counted by a small, cheap sensor: the encoder. Its simplest form is the incremental encoder. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. A light, a disc with holes and a receiver give a wave of 1 and 0. The frequency of the wave (pulses per second) gives the speed of the wheel, but not the direction and not the absolute position.

Quick check

03

The absolute encoder

Absolute encoders fix those limits with more lights, more receivers and a disc where every part has its own code. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. Several channels read a binary code that is different for every part of the disc. The code gives the absolute position, the order of the codes gives the direction, and more channels give a finer resolution.

Quick check

04

When odometry goes wrong

Simple and cheap does not mean perfect. Two problems make wheel odometry drift away from the truth. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. A radius off by only 1 mm (3 cm measured, 2.9 cm real) gives a 6.28 m error after 1000 turns, enough to place the robot in the wrong room. Slipping wheels make the robot move less than the turns say.

Quick check

05

How to fix it

Two strategies make localization better: combining sensors, and using a map. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. Sensor fusion merges several odometry sources into a better estimate, but it still drifts over time. Using a map of the world to correct the position is global localization.

Quick check

06

Summary and quiz

Key takeaways

  1. Wheel odometry turns wheel turns into position and speed. One full turn moves the robot by 2 × π × r.
  2. The wheel radius matters most: good systems calibrate it, since wheels of the same model differ slightly and wear makes them smaller.
  3. An incremental encoder is a light, a disc with holes and a receiver. It gives a wave of 1 and 0.
  4. The frequency of that wave (pulses per second) divided by the number of holes gives the turns per second.
  5. An incremental encoder cannot tell the direction or the absolute position.
  6. An absolute encoder reads a binary code that is unique for every part of the disc: it knows the position and the direction. More channels give a finer resolution.
  7. A radius error of 1 mm (3 cm against 2.9 cm) gives 6.28 m of error after 1000 turns. Slipping wheels add more error.
  8. Sensor fusion reduces the error but cannot stop it from growing. A map, used for global localization, can.

Quiz