Skip to content
RoboLearn
Not completed

Using data to improve robots

Control & autonomyIntermediate30 minLog and tune ↓Before this: Feedback control and PID, Thinking like an engineer

What you’ll learn

  • What to measure and how to log it
  • How to run a fair test
  • How to turn numbers into decisions

Measure, don’t guess

“It feels faster” isn’t evidence. Measure:

  • Time (lap time, time to goal)
  • Accuracy (distance from target, times it lost the line)
  • Reliability (successes out of 10 runs)
  • Energy (battery drop per run)

Logging

Print data with a timestamp so you can copy it into a spreadsheet:

if (millis() % 500 < 20) print(millis() + "," + linePosition());

On a real Arduino, Serial.println() the values and copy them from the Serial Monitor, or use the Serial Plotter to see graphs live.

Fair tests

  • Change one variable at a time.
  • Keep everything else the same (track, battery level, start position).
  • Repeat each test (3–5 runs) and use the average.
  • Write it down straight away.

Decide with evidence

Compare averages in a table, and pick the setting that best meets your requirements, not just the fastest one. A robot that’s 10% faster but fails 3 times out of 10 usually isn’t better.

Finished this lesson?