PlatoPod Try it now Book a demo

PID line following

Room GFYFYJ. An example of where it fits: ZEIT3222 Control Engineering, at UNSW Canberra. Notebook: pid-line-following.ipynb.

Tape is drawn on the floor: an oval and a course with square corners and sharp bends. Each pod carries a line sensor, five reflectance cells under its nose that read 0 to 1 with noise, and reports where the line is across the pod (offset_m, positive to the left). Students write the controller.

  1. The pod drives itself onto the oval by feedback on its pose, at a place of its own so several students share the course.
  2. P only at 5 cm/s, then the same at 8 cm/s.
  3. D, smoothed: the textbook cure for snaking, and why it does not cure it here.
  4. I, capped against windup: the steady error on the curves.
  5. Your turn: the fastest lap, predicting through the delay, the course with sharp bends, the five raw cells.
Controller (measured on the server)Mean errorLine lost
P, kp = 40, 5 cm/s2.5 mmnever
P, kp = 40, 8 cm/s7.3 mmnever
PD, kp = 40, kd = 0.52.5 mmnever
PI, kp = 40, ki = 102.8 mmnever

The lesson is a real one: a reading is a tenth of a second old when it arrives and commands cross the internet, so the delay, not the gains, limits the speed, and D and I need a better signal than this one to help. A teacher can draw new courses on the console's Mission sheet (Set up activities).

The line-following room in 3D: the oval and the course with bends as tape on the floor, a pod named Line demo on the oval
The room in 3D while a notebook's pod follows the oval: the link the notebook prints.