Lesson 08 · 60 minutes
Following the Line
A feedback loop you can see
Today's goal
Explain, while watching the robot, why it wiggles down the line instead of driving straight along it.
Ideas in this lesson
- Feedback: measure, correct, measure again
- Correcting always means overshooting a little
- Two sensors give you four possible situations
- The wiggle is not a bug — it is the loop working
Sense → Think → Do
A tight SENSE-THINK-DO loop running many times a second, right in front of you.
How the session runs
- Lay a black tape line with a gentle curve. Press 4 on the remote or Line tracking in the app.
- Watch the two dots on the phone while the robot drives. Say out loud what it sees and what it does.
- Fill in the table: left black → turn left; right black → turn right; neither → straight; both → stop.
- Make the curve sharper until the robot loses the line. Find the tightest curve it can hold.
- Change the surface or the lighting. Notice the sensors are reading reflection, not colour.
Try this
- Design a track the robot definitely cannot follow, then explain exactly why in sensor terms.
- Add a gap in the line. What does the robot do? What SHOULD it do?
- Could you write the line follower yourself with if-blocks? Try it, then compare with the built-in one.
When it goes wrong
| What you see | What it means |
|---|---|
| The robot runs off a black line on a dark floor | The sensors compare reflection. Dark floor, dark line, no contrast, no chance. |
| It wiggles violently | The correction is strong relative to the speed. Lower the speed and watch the wiggle shrink. |
Notes for the grown-up
The wiggle IS the lesson. Every control system overshoots; a thermostat does it in temperature and you cannot see it. Here it is right there on the floor.