Dead reckoning estimates a robot’s position by adding up its own motion, and its error never shrinks: small errors in wheel size or heading keep adding up, so the position drifts further the longer you drive. The heading error is the worst, because a small angle turns into a sideways error that grows in proportion to distance.
Key takeaways
- Dead reckoning computes position from wheel motion only, with no outside reference, so errors accumulate.
- A heading error of angle theta over distance d gives a sideways error of about d x sin(theta).
- A 1 degree heading error over 5 m gives about 8.7 cm of sideways error.
- A 1 percent difference in effective wheel diameter can bend a 5 m straight run into an arc about 0.8 m off line.
What Dead Reckoning Does
Dead reckoning is the method of estimating where you are from where you started plus the motion you have made since. On a wheeled robot, the encoders count wheel rotation, the firmware converts counts to distance travelled by each wheel, and from the two distances it updates x, y and heading. The method is explained in the differential drive odometry guide, and a working version is in differential drive odometry on Arduino.
It is cheap, fast and needs no external hardware, which is why almost every wheeled robot uses it for short-term motion. Its weakness is that it has no way of noticing it is wrong. Nothing in the calculation looks at the real world, so each small mistake is added to the previous ones and stays.
Sources of Error
The errors fall into two groups. Systematic errors repeat the same way every run. Examples are a wheel diameter that is not exactly what the code assumes, two wheels of slightly different size, and a wheelbase value that is off. These can be reduced by calibration. Random errors change from run to run: wheel slip on dust or a smooth floor, uneven floors, backlash in the gearbox, and missed encoder counts, as described in the robot wheel encoder guide.
Resolution of the encoder is usually the smallest of these. For example, a count of 0.15 mm of wheel travel is tiny next to a centimetre of slip. The calculation of that resolution is in encoder counts and distance calculator. Most of the real error comes from wheel and floor effects.
Heading Error Amplifies
Heading error is the difference between the angle the robot thinks it faces and the angle it actually faces. It matters more than distance error because of geometry. If the robot drives a distance d while pointing theta degrees off, the sideways error is d x sin(theta). The error grows in proportion to distance, and every metre driven in the wrong direction adds more.
| Heading error | sin(theta) | Sideways error after 5 m |
|---|---|---|
| 0.5 degrees | 0.00873 | 5 x 0.00873 = 4.4 cm |
| 1 degree | 0.01745 | 5 x 0.01745 = 8.7 cm |
| 2 degrees | 0.03490 | 5 x 0.03490 = 17.4 cm |
| 5 degrees | 0.08716 | 5 x 0.08716 = 43.6 cm |
Position error across the same distance is only whatever the encoders mis-measure along the path, for example 1 percent of 5 m is 5 cm. A 1 degree heading error already costs more sideways than a 1 percent distance error costs along the path. This is why heading sensing, for instance with a gyro, is so valuable.
Error Growth Estimate
Here is a worked example of a systematic error. Assume the two wheels are physically 1 percent different in effective diameter, but the code treats them as equal. The wheelbase is b = 0.15 m and the robot is commanded to drive straight for d = 5 m, with equal encoder counts on both sides.
- The larger wheel travels 1 percent further than the smaller, so the difference in distance is
5 x 0.01 = 0.05 m. - The heading change is the distance difference divided by the wheelbase:
0.05 / 0.15 = 0.333 rad, which is0.333 x 57.3 = 19.1 degrees. - The robot follows an arc of radius about
R = b / 0.01 = 0.15 / 0.01 = 15 m. - The sideways error after 5 m of arc is
R x (1 - cos(5 / 15)) = 15 x (1 - cos 0.333) = 15 x (1 - 0.945) = 0.83 m.
Check step 4: cos(0.333) = 1 - 0.333^2 / 2 + 0.333^4 / 24 = 1 - 0.0556 + 0.0005 = 0.945, so 1 - 0.945 = 0.055 and 15 x 0.055 = 0.83 m. The robot’s odometry, which assumes equal wheels, would report that it drove straight, so the displayed position and the real position separate by almost a metre. The example is an exaggeration for illustration, since you can usually calibrate wheel sizes far better than 1 percent. The lesson is the sensitivity: a small, constant mismatch gives a large drift.
Reducing Drift
You cannot remove drift completely, but you can slow it. First, calibrate: measure the real wheel diameters and wheelbase, and adjust the constants in code. Second, use a heading sensor such as a gyro or an IMU to correct the angle, which attacks the biggest error source. Third, use gentle acceleration so the wheels do not slip, and drive on a surface with good grip.
Fourth, correct the position with an outside reference when you can: a wall, a line, a marker or a known landmark. Combining several sources is the idea behind Kalman filter localisation, and a simple encoder-only drive you can use for the square test is the one-metre square path project. For a longer view of robotics topics, the robots hub collects the related guides. A reasonable expectation is that dead reckoning is trustworthy for a few metres and untrustworthy for a whole building without correction.
Testing a Square Path
A square test shows your robot’s drift in a form you can measure. Mark a start point and orientation with tape. Command the robot to drive four sides of a 1 m square with four 90 degree turns, then stop. If dead reckoning were perfect, the robot would stop exactly on the start mark facing the start direction. Measure how far it is from the mark, and how many degrees it is off.
Run it clockwise and anticlockwise, several times each. Errors that flip sign between directions point to wheel-size or wheelbase mismatch; errors that stay the same direction point to something like a consistent turn under-rotation. Change one constant at a time, and repeat. Keep a record in a table so you can see whether each change helped.
How to check this yourself
- Mark a straight 3 m line on the floor and drive the robot along it with equal motor commands.
- Measure the sideways offset at the end and compute the heading error as the inverse sine of offset divided by distance.
- Measure each wheel’s diameter with calipers and compare them; a few tenths of a millimetre matters.
- Run the 1 m square test clockwise and anticlockwise and record the end-point error each time.
Common mistakes
- Trusting the printed wheel diameter without measuring the real, loaded wheel.
- Calibrating distance but ignoring the wheelbase, which controls turning angle.
- Judging drift from a single run instead of several.
- Accelerating hard, so the wheels slip and the encoders over-report.
Quick checklist
- Measure wheel diameters and wheelbase.
- Add a gyro or IMU for heading if accuracy matters.
- Accelerate gently.
- Run the square test both ways, several times.
- Correct against a landmark when you can.
Frequently asked questions
What is dead reckoning in robotics?
Dead reckoning estimates a robot’s position by adding up its own motion from a known start, usually from wheel encoders. It needs no outside sensors, but it has no way to correct itself, so small errors accumulate and the estimated position drifts away from the real one over distance and time.
Why does heading error matter more than distance error?
A heading error sends every following metre in the wrong direction, so the sideways error equals distance times the sine of the angle. One degree over 5 m gives about 8.7 cm. A distance error of the same percentage only shifts the position along the path.
How can I reduce odometry drift on my robot?
Measure the wheel diameters and wheelbase and put the real values in your code, add a gyro or IMU for heading, accelerate gently to limit slip, and correct against landmarks such as walls or lines. Check the result with a repeated square-path test in both directions.
Related reading
- Learn hub: more navigation and sensing explainers.
About the author and how this is kept accurate
Written, checked and maintained by Jignesh Panchal of Jaadu Digital. Figures in worked examples come from the stated assumptions, not from a bench test of our own. Read the editorial standard, follow the author on LinkedIn, or send a correction. Last reviewed: November 2026.



