Lesson 06 · 60 minutes

Too Much, Too Little, Just Right

Tuning the line follower

Today's goal

Change the line follower's correction strength while it runs, find the wobble point and the drift point, and settle on a value between them.

Ideas in this lesson

Sense → Think → Do

SENSE: the line sensors measure the offset. THINK: multiply the offset by the gain. DO: slide and turn toward the line. Change the gain and the whole personality changes.

How the session runs

  1. Tape a loop with gentle curves and one tight curve.
  2. Sensors tab: check the line sensor is set up. Press Watch (lw) and slide tape under each channel: its raw number should jump by 100 or more.
  3. Put the line under the middle of the sensor and press Calibrate (lc). The robot strafes across the line and back.
  4. Press Follow (lf). It runs until you press STOP.
  5. While it follows, drag the Slide correction slider up a lot. Watch it wobble. Drag it down a lot. Watch it drift off the tight curve.
  6. Do the same with Turn correction. Which one helps on the tight curve?
  7. Find the lowest setting that still takes the tight curve. Then the highest that does not wobble. Pick the middle. Save to robot.

Try this

When it goes wrong

What you seeWhat it means
'never saw the line'The sensors never saw the tape. Press Watch: no change under tape means the emitters are off or the channel is not wired where the robot thinks.
Numbers go the wrong way over tapeFlip 'Over the tape the reading goes' in the Sensors tab.
'lost the line, stopped'It went off the line for longer than the lost-stop time. Slow down or raise the turn correction.
Stops at a wallThe laser's wall stop (120 mm) works during line following too. Move the wall.
Notes for the grown-up

Settings change live, so the robot never has to stop for a re-flash. Let each group own one slider and report what it does. The point is the shape of the search: too much, too little, bracket it.

Ages: K-5: one slider, three settings (low, middle, high), describe the wiggle. 6-12: record offset telemetry (the L line in the console) and graph it for two gains.

Materials: Robot with line sensor array (8-channel, through the ADS1115s or direct), black electrical tape, light floor or poster board, app (Sensors tab).

← Sideways Is a DirectionRoll Call on Two Wires →