rAs Kids All courses
Robotics with Python ยท Module 5 of 8
๐Ÿ“ฑ Shared phone

Simulate the Robot

A simulator lets you crash a thousand times for free before you touch real hardware.

๐Ÿ“ฑ ๐Ÿค– โ”โ”โ”โ”โ•ฑ โœ…
A simulated robot following a black line around a curve on a phone screen.

๐ŸŽ’ What you need

โœ‹ Do this

  1. Set up a line-following task. Before writing anything, name your sensor, your decision and your action out loud.
  2. Write the crudest possible controller: if the sensor sees dark, turn one way; otherwise turn the other. Run it.
  3. Watch it wobble violently down the line. That wobble is the signature of on-off control โ€” point at it, it is important.
  4. Log the time to complete the course. Then double the turn amount and log again. Then halve it. Three numbers, one table.
  5. Add a straight-ahead zone: only turn if the sensor is strongly one way. The wobble should shrink. Log the time again.
  6. Now break it on purpose: add a sharp corner it cannot handle, and write down exactly why it fails.

๐Ÿ’ก Why it works

On-off control, also called bang-bang control, is the simplest thing that works and it is genuinely used where the wobble does not matter โ€” a fridge thermostat, for instance. But on a moving robot it wastes energy and overshoots constantly. Feeling that limitation yourself is what makes the next module land.

๐Ÿ”ฅ Challenge

Beat your best lap time by changing only ONE number per run, logging every attempt. Bring your table to module 6 โ€” you will need it.

๐Ÿ“– New words

bang-bang controla controller with only full-on and full-off outputs
overshootgoing past the target before correcting back
simulationa model of the real system you can test against safely
๐Ÿ•น๏ธ
Sim Runner

Tap when you have finished this module.