Mobile robot kinematics: differential drive and odometry basics
Atlasbot · 4/7/2026 · 11 min read
Most of the cheapest and easiest AMR robots use a two differential drive configuration: two driving wheels with separate motors on both sides, plus a caster wheel to maintain balance. There is no separate steering wheel — all movement, including turning on the spot, comes from independently controlling the speed of the two wheels.
Key concepts
Intuition: if two wheels rotate at the same speed, the robot goes straight. If the right wheel rotates faster than the left wheel, the robot gradually deviates to the left. If two wheels rotate in opposite directions at the same speed, the robot rotates in place around its own center.
Mathematically, these are the two most fundamental formulas in mobile robotics:
v = (v_R + v_L) / 2 # linear velocity at the center of the robot
ω = (v_R − v_L) / L # angular velocity (rotation)
In which v_L, v_R are the long-term speeds of the left/right wheel (m/s), and L is the distance between the centers of the two wheels (m).
Some special cases become very intuitive:
v_L = v_R→ω = 0: go straight, don't turnv_L = −v_R→v = 0,ω ≠ 0: rotate in place, not translatev_L = 0,v_R > 0: robot rotates around the left wheel (rotation radius = L/2)
How it works
The linear speed of a wheel is related to the motor rotation speed through the wheel radius r:
v_banh = ω_dong_co × r
This is the number you actually send to the motor driver in the "Act" step in the control loop — the controller calculates the desired v and ω, then inverts the above two formulas to derive the needed v_L, v_R.
Odometry is a technique to estimate the robot's current position (x, y, θ direction) based on the number of wheel revolutions measured from the encoder, without the need for an absolute localization sensor. Principle: at each small cycle Δt, calculate v and ω from encoder data, then accumulate (integrate) to update the position:
θ_moi = θ_cu + ω × Δt
x_moi = x_cu + v × cos(θ_cu) × Δt
y_moi = y_cu + v × sin(θ_cu) × Δt
Technical details
Formulas
From the 2 formulas v/ω above, we can deduce instantaneous radius of curvature (instantaneous radius of curvature) — useful to know how much radius the robot is following at a time:
R = v / ω = L/2 × (v_R + v_L) / (v_R − v_L)
VD: L = 0.3m, v_L = 0.2 m/s, v_R = 0.4 m/s
R = 0.3/2 × (0.4+0.2)/(0.4−0.2) = 0.15 × 3 = 0.45m
→ the robot is walking in a circular arc with a radius of 0.45m
The case v_L = v_R makes the denominator equal to 0 (R goes to infinity) — in the geometric sense: going straight is following an "infinite radius arc".
Parameters
The typical value of L (distance between 2 wheels) depends on the AMR size, and the encoder resolution directly affects the odometry error (learned in the Encoder lesson in the Motor Control section):
| AMR Size | L typical |
|---|---|
| Small indoor AMR (light cargo) | 0.3 – 0.5m |
| Mid-sized AMR (warehouse, workshop) | 0.5 – 0.8m |
The higher the resolution encoder (the larger the PPR, learned in the Encoder lesson), the smaller the accumulated rounding error per cycle — this is why robots that need long-term accurate localization often invest in higher resolution encoders from the beginning, even though the odometry still needs to be calibrated with SLAM.
Practical applications
Odometry is cheap, simple, can run right on MCU — but has a fatal drawback: cumulative errors over time due to wheel slippage, rounding errors, manufacturing tolerances. This is why AMR cannot actually use odometry alone for localization — it is used as a "short-term, high-frequency" data source (running smoothly between updates), which is then periodically calibrated with "longer-term, more accurate" data from SLAM, often through a Kalman filter (EKF, separate article in the Localization section) that combines both sources — exactly the learned two-layer odom/map architecture in the article Coordinate system.
Practical example
import math
L = 0.3 # distance between 2 wheels (m)
dt = 0.1 # update cycle(s)
x, y, theta = 0, 0, 0
v_L, v_R = 0.2, 0.4 # left/right wheel speed (m/s)
v = (v_R + v_L) / 2
omega = (v_R - v_L) / L
theta += omega * dt
x += v * math.cos(theta) * dt
y += v * math.sin(theta) * dt
print(f"v={v:.2f} m/s, omega={omega:.2f} rad/s")
print(f"Vi tri moi: x={x:.3f}, y={y:.3f}, theta={math.degrees(theta):.1f} do")
Output:
v=0.30 m/s, omega=0.67 rad/s
Vi tri moi: x=0.023, y=0.002, theta=3.8 do
After exactly 1 Δt=0.1s cycle, the robot has translated a small distance and rotated 3.8° — repeating this loop continuously (usually at 20-50Hz) is how odometry "accumulates" the robot's position over time, each very small step adding up.
Common mistakes
- Wrong sign in formula
ω—(v_R − v_L)(notv_L − v_R) determines whether the positive direction ofωrotates left or right — wrong sign causes the robot to rotate in the opposite direction to the desired direction even though the calculated magnitude is correct. - Do not normalize
θto a fixed interval — accumulatingθcontinuously over thousands of cycles causes the value to exceed the interval-π to π(or0-360°) — need to takeθ mod 2πperiodically to avoid too large a number causing loss of floating point precision. - Mixing degrees and radians in an integral formula — a recurring error throughout Math for Robotics problems, the function
cos/sininθ_moialways requires radians. - Consider odometry errors as completely random — systematic wheel slippage (eg, one wheel is more worn than the other, causing the actual radius to be smaller than the calibrated value) creates errors systematic deviation in a fixed direction, not just random noise — need to periodically calibrate the actual wheel radius, not just based on nominal parameters.
Conclusion
The two formulas v/ω from left-right wheel speed are the foundation of every differential drive robot — used for both control (calculating the motor speed to be set) and localization (integrating into position via odometry). Understanding that cumulative error is an inherent limitation, not an error that needs to be "fixed", helps design the correct architecture combining odometry + SLAM from the beginning. The next article in the section is about Forward Kinematics — a more general problem: knowing the speed of each joint/wheel, inferring the motion of the entire robot.
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.