Robotic Car Controller 1.0
Library to manage a two wheeled robotic vehicle (Stepper Motors)
Unicycle Control Model

Working out the displacement and velocities of each wheel on a differential drive robot can be messy.

The unicycle model of an autonomous robot is a kinematic model that allows modeling the movement of the vehicle as if it was a unicycle, using a linear velocity vector (V) and a rotational velocity (ω) about a point within the vehicle. Taking this point to be midway between axis joining the 2 wheels simplifies the calculation.

We can derive equations that translate between the unicycle model and our wheel velocities. Steering requires each of the independent wheels to rotated at different speeds (VL and VR for the left and right side) to travel the equivalent unicycle path.

So specifying a movement path using this abstraction becomes much easier as we need to just specify "How fast do we want to move forward and how fast do we want to turn", letting the mathematics work out the wheel rotations.

V and ω are transformed into independent motor speeds for the left and right motor (VL, VR) using the following formulas:

  • VL = (2V + ωB) / 2r
  • VR = (2V - ωB) / 2r

where B is the vehicle base length (ie, the distance between the wheel centerlines) and r is the radius of the wheel.

The convention used in this library is:

  • Linear velocity V is positive for forward motion, negative backwards.
  • Angular velocity ω is positive for right rotation, negative for left.


For more details