TL;DR:
A differential-drive robot steers only by driving its two wheels at different speeds.
Forward speed is
v = (vL + vR) / 2and turn rate isω = (vR − vL) / W, with W the distance between the wheels.Equal speeds go straight, opposite speeds spin in place, and anything else drives an arc of radius
R = v / ω.
Most small robots have two driven wheels and a caster or ball at the back. There is no steering wheel and no steering motor. To turn, the robot simply makes one wheel go faster than the other. Two numbers, the speed of each wheel, are enough to describe every motion the robot can make on a flat floor.
What it does on a robot
Each wheel has a speed along the ground, vL for the left wheel and vR for the right wheel, in meters per second. If a wheel has radius r and turns at angular speed ω_wheel, then v = r × ω_wheel. The robot's body has two speeds of its own: v, how fast the center moves forward, and ω (omega), how fast the robot turns, in radians per second, positive counterclockwise.
The distance between the two wheel contact points is the track width W. Measure it from the middle of one tire's contact patch to the middle of the other.
The math behind it
The center of the robot moves at the average of the two wheel speeds:
v = (vL + vR) / 2
The difference in the wheel speeds makes it turn. The faster wheel travels farther than the slower one over a short time, and the difference is spread across the width of the robot:
ω = (vR − vL) / W
When the right wheel is faster the robot turns left (counterclockwise, positive). The robot moves along a circle with radius, measured to the center:
R = v / ω = (W / 2) × (vR + vL) / (vR − vL)
Special cases:
vL = vR: ω = 0, straight line (infinite radius).vL = −vR: v = 0, the robot spins in place about its center.vL = 0: the robot pivots about the left wheel, withR = W / 2.
Worked example: wheel speeds 0.4 and 0.6 m/s on a 0.3 m wide robot
The left wheel goes at vL = 0.4 m/s and the right wheel at vR = 0.6 m/s. The track width is W = 0.3 m.
Forward speed:
v = (0.4 + 0.6) / 2 = 0.5 m/s.Turn rate:
ω = (0.6 − 0.4) / 0.3 = 0.667 rad/s, which is about0.667 × 180 / π = 38.2°per second. The right wheel is faster, so the turn is counterclockwise.Turning radius:
R = v / ω = 0.5 / 0.667 = 0.75 m.Time for a full circle:
2π / 0.667 = 9.42 s.
Check: the wheels sit 0.15 m either side of the center, so the left wheel's circle has radius 0.75 − 0.15 = 0.60 m and the right wheel's has 0.75 + 0.15 = 0.90 m. Wheel speed is the radius times ω: 0.60 × 0.667 = 0.40 m/s (left) and 0.90 × 0.667 = 0.60 m/s (right). Both match what we started with.
To go the other way, from a desired motion to wheel speeds, rearrange: vR = v + ω W / 2 and vL = v − ω W / 2. For v = 0.5 and ω = 0.667: vR = 0.5 + 0.667 × 0.15 = 0.6 and vL = 0.4. A navigation program typically outputs v and ω, and this step converts them into wheel commands.
Where it goes wrong
Wheel slip. The model assumes the wheels roll without slipping. On a slippery floor or in a sharp turn they slide, and the real motion differs from the prediction.
Unequal wheels. A small difference in the two wheel radii makes the robot curve even when both are commanded the same speed. This is a main source of drift in odometry.
Wrong track width. The effective W is not always the measured distance, especially with wide, soft tires. Calibrate by commanding a spin of 360° and measuring the real angle.
Motor mismatch. Two motors rarely run at the same speed at the same command. Use encoders and feedback on each wheel, as in tuning a PID controller.
The caster. A passive caster wheel can catch and swing when the robot reverses direction.
Tipping. Sharp turns at speed create sideways force at the wheels. A tall, narrow robot can tip over.
Safety: Spinning in place at speed can throw a payload or hit a bystander at the edge of the robot. Limit the maximum v and ω, keep the robot's path away from people, and test with the wheels lifted. Keep fingers away from wheels and drive belts, which can pull things in.
How real robots use it
Differential drive is used on robot vacuums, many classroom robots and small delivery robots because it is mechanically simple, can spin in place and has a small turning footprint. Position tracking uses the same equations in reverse: from wheel encoder counts, the robot estimates how far it traveled and how much it turned. For robots that need to slide sideways, look at mecanum wheels. Car-like robots use a different method, described in the article on Ackermann steering.
Try it yourself
Put a marker on the robot and drive it with vL = 0.4, vR = 0.6 (or the nearest your motors allow). Time one full circle and measure its diameter on the floor. Compare with 9.42 s and a center radius of 0.75 m. If they differ, check W and the wheel radius. Then spin in place with vL = −vR and count how long a full turn takes.
Frequently asked questions
How does a differential-drive robot go backward?
Give both wheels negative speeds. The formulas work as they are, with a negative v.
Why does my robot drift when I command both wheels the same?
Real wheels differ slightly in size, friction and motor speed. Feedback from encoders, or a gyroscope to hold the heading, can correct it.
