A path planner only says where to go: a list of points (x₁, y₁), (x₂, y₂), and so on. The robot controller has to turn each point into two numbers the motors understand: a left wheel speed and a right wheel speed.
Each control tick, the controller does three things for the current target point.
From the robot’s pose (x, y, θ) and the target, compute the offsets dx and dy, then the distance to the target:

and the heading error, which is the angle the robot must turn to face the target:

Pick a forward speed v and a turn rate ω. The simplest choice is proportional control: go faster when far away, turn harder when pointing the wrong way.

Here kv and kω are gains you choose. This is where a PID controller fits in: it replaces the simple turn rule with

and u is used as the turn command.
A differential-drive robot moves forward at the average of its two wheel speeds:

and it turns at the difference of the wheel speeds divided by L, the distance between the wheels:

These are two equations with two unknowns. Solving them for the wheel speeds gives the conversion the controller actually uses:


The planner’s coordinates become (d, e), then (v, ω), then (vL, vR).
Wheel spacing L = 40 cm. The controller has chosen v = 60 cm/s and ω = 1 rad/s.
Check: the average is (40 + 80) / 2 = 60 cm/s, and the turn rate is (80 − 40) / 40 = 1 rad/s.