Differential Drive Mobile Robots: Forward Kinematics & Odometry
Unicycle mobile robot kinematic model, wheel radius and track baseline, forward kinematics from encoder ticks to Cartesian pose (x, y, theta), and dead reckoning drift.
1. Overview & Concept Definition
A mathematical kinematic framework describing non-holonomic mobile robots propelled by two independently driven wheels sharing a common axis of rotation.
2. Engineering & Industrial Significance
Standard locomotion topology for indoor mobile service robots, robotic vacuum cleaners, warehouse automated guided vehicles (AGVs), and research platforms (TurtleBot).
3. Physical Working Principle & Transducer Dynamics
Robot linear velocity $v$ is the arithmetic average of left and right wheel velocities. Angular velocity $\omega$ is proportional to the difference between wheel velocities divided by track width $L$. By integrating encoder measurements over time, the robot continuously tracks its Cartesian position $(x, y)$ and heading $\theta$.
4. Governing Equations & Mathematical Models
5. Practical Implementation
// C++: Differential Drive Odometry Accumulator
#include <math.h>
struct Pose2D { float x; float y; float theta; };
Pose2D updateOdometry(Pose2D current, float dLeftMeters, float dRightMeters, float trackWidthMeters) {
float dCenter = (dRightMeters + dLeftMeters) / 2.0f;
float dTheta = (dRightMeters - dLeftMeters) / trackWidthMeters;
Pose2D next;
next.theta = current.theta + dTheta;
// Normalize theta to [-pi, pi]
next.theta = atan2f(sinf(next.theta), cosf(next.theta));
float avgTheta = current.theta + (dTheta / 2.0f);
next.x = current.x + dCenter * cosf(avgTheta);
next.y = current.y + dCenter * sinf(avgTheta);
return next;
}
6. Common Engineering Pitfalls & Troubleshooting
Frequent Engineering Pitfalls
- Ignoring wheel slip: Odometry relies on the assumption of rolling without slipping. Rapid accelerations or slick floors cause severe positional drift.
- Incorrect wheelbase measurement: An error of 2mm in measured track width $L$ causes systemic angular drift that rotates calculated trajectory away from actual trajectory.
Diagnostic & Troubleshooting Checklist
- Calibrate track width: Command robot to rotate precisely 360° on the spot 10 times. Compare encoder estimated angle with true physical rotation to calculate effective wheelbase factor.
- Fuse odometry with a yaw gyroscope using a Kalman Filter to eliminate rotational drift.
7. Applications & Physical Constraints
TYPICAL APPLICATIONS
- Warehouse automated guided vehicles (AGVs)
- SLAM (Simultaneous Localization and Mapping) mapping robots
- Agricultural ground scouting robots
PHYSICAL LIMITATIONS
- Non-holonomic constraint: Cannot move sideways directly ($\dot{y}_{robot} = 0$ in robot body frame); requires turning maneuvers.
Pinout & Interface Specs
| PIN / SIGNAL | FUNCTION / ELECTRICAL SPEC |
|---|---|
| LEFT_PWM | Left motor H-bridge speed signal |
| LEFT_DIR | Left motor direction signal |
| RIGHT_PWM | Right motor H-bridge speed signal |
| RIGHT_DIR | Right motor direction signal |
| ENC_L_A / ENC_L_B | Left wheel quadrature encoder lines |
| ENC_R_A / ENC_R_B | Right wheel quadrature encoder lines |
Have questions on this topic?
Ask LUNA to calculate component values or explain alternative control methods for Differential Drive Mobile Robots: Forward Kinematics & Odometry.