PID Robot Playground

The robot must follow the orange line. Click or drag on the road to move the line, then tune the three knobs.

Push harder when the error is bigger
Add up lingering error
Brake when error is shrinking fast
Presets:
P
I
D
Left wheel
Right wheel

Error over time (line at zero = perfect tracking):

Things to try:
  1. P only: the robot reaches the line but weaves forever. P reacts to where you are, not how fast you are moving.
  2. P too high: violent wobbling.
  3. Add D: the wobble dies out, like a shock absorber.
  4. Switch on “Weak wheel” with P + D: the robot settles beside the line, a steady error. Now raise I and watch it creep onto the line.

Wheels: when the controller outputs a turn command ω, the left wheel gets v + ω·L/2 and the right wheel v − ω·L/2 (positive ω = turn right).