Robot turns the wrong angle: encoder, gyro and wheel slip

Use a gyro for the turn angle and slow down before the target. Encoders alone trust the wheels not to slip.

What the message means

On a slippery floor wheels turn more than the robot does. A gyro measures the real rotation, although it needs offset calibration.

Fix it in this order

  1. Measure the real turn with a gyro and compare it with the encoder count.
  2. Calibrate the gyro offset at rest before the run.
  3. Slow the motors near the target angle to cut overshoot.
  4. Improve grip with better tyres or a softer surface.
  5. Use a small dead band so the robot does not hunt around the target.
  6. Check the battery level, since the same command gives different motion on a low battery.

Why it happens

Wheel encoders count rotation, but wheel slip and a wrong track-width value make the calculated turn differ from the real one. A gyroscope measures turning directly but drifts over time.

Use the gyro for short turns, calibrate its offset at rest, check the track width and wheel diameter used in the maths, and combine both if you need accuracy over a long run.

If you see this, do this

You seeDo this
Over-turns on slippery floorWheel slip. Add a gyro.
Different results each runBattery level or speed.

gyro drift, wheel traction.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.