Capability:Differential Drive

From Bespoke Robot Society
Jump to navigation Jump to search
Differential Drive
Type Actuation
Measures/Controls Two-wheeled locomotion with independent left/right control
Common Hardware 2× DC motors + TB6612FNG H-bridge (or similar), passive caster or ball wheel
Enables Activities Activity:Line Following, Activity:Dead Reckoning Navigation, Activity:Maze Solving
Used In SimpleBot
Status Fully Documented

Differential drive is a method of locomotion where a mobile robot uses two independently controlled wheels mounted on a common axis, with a third passive support point (typically a caster wheel or ball wheel) to maintain balance. This is one of the most common drive configurations for small mobile robots due to its mechanical simplicity and intuitive control.

Overview

In a differential drive system, the robot's motion is determined entirely by the velocities of the left and right drive wheels. By varying the speed and direction of each wheel independently, the robot can move forward, backward, turn while moving, or rotate in place. The passive third support point (caster or ball wheel) provides stability without constraining the robot's motion.

This drive configuration is particularly well-suited for indoor navigation, maze solving, and line following tasks where the ability to rotate in place and make sharp turns is valuable.

How It Works

Differential drive enables three fundamental motion primitives by controlling the two drive wheels independently:

Straight Line Motion

When both wheels rotate at the same speed in the same direction, the robot moves in a straight line:

  • Both wheels forward → robot moves forward
  • Both wheels backward → robot moves backward
  • The robot's linear velocity is equal to the wheel velocity

Turning While Moving

When the wheels rotate at different speeds in the same direction, the robot follows a curved path:

  • Left wheel faster than right → robot curves to the right
  • Right wheel faster than left → robot curves to the left
  • The turn radius depends on the speed ratio between the wheels
  • Larger speed difference → tighter turn radius

Rotation In Place

When both wheels rotate at the same speed in opposite directions, the robot rotates around its center point:

  • Left wheel forward, right wheel backward → robot rotates clockwise
  • Right wheel forward, left wheel backward → robot rotates counterclockwise
  • This produces a zero turn radius, allowing omnidirectional orientation

Kinematics

The key concept in differential drive kinematics is the Instantaneous Center of Rotation (ICR). The ICR is the point in space around which the robot is rotating at any given moment.

  • When moving straight, the ICR is at infinity (infinite radius curve = straight line)
  • When turning, the ICR lies on the extension of the common wheel axis
  • When rotating in place, the ICR is at the robot's center point (midway between the wheels)

The position of the ICR is determined by the ratio of the left and right wheel velocities. By adjusting this ratio, the robot can follow any desired curved path.

Mathematical Model

For a differential drive robot with wheel separation L (distance between the left and right wheel contact points), left wheel velocity v_L, and right wheel velocity v_R:

Linear Velocity

The robot's forward velocity v is the average of the two wheel velocities:

v=vL+vR2

Angular Velocity

The robot's angular velocity ω (rotation rate) is proportional to the difference in wheel velocities:

ω=vRvLL

Where:

  • v_L = left wheel velocity (positive = forward)
  • v_R = right wheel velocity (positive = forward)
  • L = wheelbase (distance between left and right wheels)
  • v = robot linear velocity (forward speed)
  • ω = robot angular velocity (rotation rate, positive = counterclockwise)

These simple equations allow conversion between desired robot motion (v, ω) and required wheel velocities (v_L, v_R).

Turn Radius

When the robot is following a curved path (both wheels moving forward at different speeds), the radius of curvature R is:

R=L2vL+vRvRvL

Advantages

  • Mechanical Simplicity: Minimal mechanical complexity with only two driven wheels and one passive support
  • Zero Turn Radius: Can rotate in place, making it excellent for confined spaces and maze navigation
  • Intuitive Control: Motion can be controlled with straightforward motor commands
  • Low Cost: Requires only two motors and a simple motor driver
  • Omnidirectional Orientation: Can point in any direction without forward/backward movement
  • Easy Implementation: Well-understood algorithms for path planning and control

Disadvantages

  • No Lateral Motion: Cannot move sideways (strafe) without first rotating
  • Third Support Required: Needs a caster or ball wheel for stability, which can introduce friction and drag
  • Wheel Matching Sensitivity: Differences in wheel diameter or motor speed cause drift when attempting straight-line motion
  • Caster Lag: Passive caster wheels can create lag and oscillation during direction changes
  • Traction Dependency: Performance degrades on slippery surfaces or uneven terrain
  • Encoder Requirements: Accurate dead reckoning requires wheel encoders to compensate for motor variations

Control Methods

Open-Loop Control

In open-loop control, motor speeds are set directly using PWM (Pulse Width Modulation) duty cycles without feedback:

  • Simple to implement
  • No additional sensors required
  • Prone to drift and inaccuracy
  • Motor speed varies with battery voltage and load
  • Suitable for basic behaviors and short movements

Closed-Loop Control

In closed-loop control, wheel encoders provide velocity feedback to maintain accurate motor speeds:

  • Requires encoders on both motors
  • PID controllers adjust PWM to maintain target velocities
  • Compensates for battery voltage, friction, and motor differences
  • Enables accurate dead reckoning navigation
  • Essential for precise autonomous behaviors

Common Hardware

A typical differential drive implementation requires:

Motors

  • DC gear motors (commonly TT motors for small robots)
  • Stepper motors (for applications requiring precise positioning)
  • Matched motor pairs for better straight-line performance
  • Optional: Motors with integrated encoders

Motor Driver

  • Dual H-bridge motor driver IC: TB6612FNG, L298N, DRV8833
  • Capability to drive two motors independently
  • Bidirectional control (forward and reverse)
  • PWM speed control inputs
  • Sufficient current capacity for the motors

Microcontroller

  • At least 2 PWM outputs for motor speed control
  • Digital outputs for direction control (typically 4 pins total)
  • Optional: Interrupt-capable pins for encoder inputs
  • Examples: Arduino, ESP32, Raspberry Pi Pico

Support Wheel

  • Ball caster: Low friction, omnidirectional
  • Swivel caster: Simple but can have directional lag
  • Ball wheel: Smooth motion but may require multiple support points

SimpleBot Implementation

SimpleBot uses a differential drive configuration with:

  • Motors: 2× TT gear motors (plastic gearbox, 6V DC motors)
  • Motor Driver: TB6612FNG dual H-bridge driver
  • Support: Single front caster wheel (passive)
  • Wheelbase: Approximately 100mm between drive wheels
  • Wheels: 65mm diameter plastic wheels with rubber tires
  • Control: PWM-based open-loop speed control via microcontroller

The drive system enables SimpleBot to perform:

Comparison to Other Drive Types

Omni Drive / Mecanum Drive

Uses omnidirectional wheels (omni or mecanum) to enable lateral motion:

  • Advantages: Can strafe sideways, move in any direction without rotating
  • Disadvantages: More complex, more expensive, reduced traction
  • Use case: Applications requiring holonomic motion (translation + rotation simultaneously)

Ackermann Steering

Uses front wheel steering like a car:

  • Advantages: Efficient for high-speed straight-line motion
  • Disadvantages: Cannot rotate in place, larger minimum turn radius
  • Use case: Larger outdoor robots, car-like vehicles

Skid Steering

Similar to differential drive but with 4+ wheels (no passive caster):

  • Advantages: Better traction, can handle rough terrain
  • Disadvantages: High wheel scrubbing during turns, requires more torque
  • Use case: Heavy-duty robots, outdoor terrain

Synchro Drive

All wheels steer and drive together:

  • Advantages: True omnidirectional motion, robot orientation independent of travel direction
  • Disadvantages: Complex mechanical design
  • Use case: Specialized research robots

See Also