Differential kinematics

How is the velocity of a robot described mathematically?

Before the differential kinematics equation, the velocity of a robot in a two dimensional reference frame has to be described mathematically. It starts from the pose of the robot, with its three components. To switch from the position to the velocity, a new variable is needed: the time. The velocity is built from snapshots of the pose at different times. With that, the differential kinematic problem can be written clearly for a robot with two wheels. Each step below has a simulator. All numbers on the page are teaching values.

Words used on this page (open this if a word is new)
poseWhere the robot is and which way it faces on the plane. It has three numbers: x, y and θ.
x and yThe position of the robot in the two dimensional space, along the x axis and the y axis of the world frame.
θ (theta), orientationThe direction the robot faces on the plane, measured as an angle from the x axis of the world frame.
world frame WThe fixed frame of the map. It never moves.
snapshotThe pose of the robot noted at one moment in time.
t0 and t1Two moments in time: the first snapshot at t0 and a later one at t1.
P0 and P1The pose at time t0 and the pose at time t1.
velocityHow much something changes in a given time: space divided by time.
derivative with respect to timeThe rate at which something changes in time. It is the change divided by the time. It is written with a dot above the letter.
ẋ and ẏThe linear velocity of the robot in the plane: how fast x changes and how fast y changes.
θ̇ (theta dot)The angular velocity of the robot: how fast the direction it faces changes.
Ṗ (P dot)The velocity of the robot. It is made of three numbers: ẋ, ẏ and θ̇.
wheel radius rThe distance from the middle of a wheel to its rim.
wheel distance LThe distance between the two wheels.
wheel speedHow fast a wheel turns. The right wheel and the left wheel are controlled independently.
function fA rule that takes some inputs and gives an output. Here the inputs are L, r, θ and the two wheel speeds, and the output is Ṗ.
differential kinematicsThe problem of finding f, and the function that solves it.
01

The pose of the robot

To describe the velocity of a robot, the start is its pose. The pose has three components. The first two, x and y, indicate the position of the robot in the two dimensional space. The third one, θ, indicates its orientation on the plane.

Key idea. The pose P is made of three numbers: x and y for the position, θ for the orientation.
02

The pose at two moments in time

To switch from the position to the velocity, a new variable is needed: the time. The velocity can be considered as a sequence of positions of the robot over time. A snapshot is taken at time t0, giving the pose P0. At a later time t1 a new snapshot is taken: the robot has moved, rotated and translated, and the new pose is P1.

Key idea. Snapshots at two times give two poses, P0 at t0 and P1 at t1.
03

Why does subtracting give a velocity?

The velocity comes from comparing the two poses: new minus old, divided by the time. This lesson shows why, one small step at a time, with the numbers of the x position, the y position and the angle. Press Next to move on and Back to return. Touch or hover a coloured number to see where it is in the picture.

Key idea. A velocity is a change per second. Subtract the old value from the new one to get the change, then divide by the time taken.
04

The velocity: space divided by time

By definition, the velocity is the ratio between space and time. So for each component of the pose, the derivative with respect to time can be calculated. This gives the velocity of the robot, which is also made of three variables: ẋ and ẏ are the linear velocity of the robot in the plane, and θ̇ is its angular velocity.

Key idea. Ṗ has three parts: ẋ and ẏ are the linear velocity, θ̇ is the angular velocity. Each one is a change in the pose divided by the time.
05

The differential kinematic problem

A mobile robot has two wheels with radius r, and the distance between the wheels is L. The wheels are independently controlled, so the right wheel and the left wheel have their own speeds. The velocity of the robot in the world reference frame is Ṗ, made of an angular and a linear velocity. The problem is to find a function f that, from the radius of the wheels, their separation, the orientation θ of the robot and the speed of the wheels, gives the overall velocity of the robot in the two dimensional space.

Key idea. The differential kinematics is the function f from (L, r, θ, wheel speeds) to Ṗ. It is needed to send velocity commands to the robot and move it with a joystick.
06

Why the function f is still needed

The formula with two snapshots does give the velocity, but only after the robot has moved. The function f is different: it starts from the wheel speeds, which are the only thing that can be set on the robot. Press Play and watch when each way of getting the velocity becomes available.

Key idea. Snapshots measure the velocity after the move. The function f gives it from the wheel speeds, before the move, and works backwards too: from a wanted motion to the wheel speeds. That is what a joystick needs.
07

Summary and quiz

Key takeaways

  1. The pose of the robot is P = (x, y, θ): the position and the orientation on the plane.
  2. To get a velocity, the time is needed. Snapshots at t0 and t1 give the poses P0 and P1.
  3. Subtracting the old value from the new one gives the change, and dividing by the time gives the change per second. That is why this gives a velocity.
  4. The velocity Ṗ = (ẋ, ẏ, θ̇) is the change of each component divided by the time. ẋ and ẏ are the linear velocity, θ̇ is the angular velocity.
  5. For a robot with two wheels, the differential kinematic problem is to find f from the radius r, the distance L, the orientation θ and the wheel speeds to Ṗ.
  6. Snapshots give the velocity only after the robot has moved. f starts from the wheel speeds, so it gives the velocity before the move, and it can be used backwards to get the wheel speeds for a wanted motion.
  7. f is what is needed to send velocity commands and move the robot with a joystick.

Quiz