For the day when the bots never touch the ball. You do not need a working match to do real mathematical modeling — you need a bot that moves, a tape measure, and a prediction. Everything the project asks for can be done right here.
Why this lab exists. Zero ball touches does not mean the students failed. It means the bots cannot yet reach the ball — which is a distance-and-direction problem, not a soccer problem. This lab attacks that problem directly and produces the prediction data the week needs at the same time. Fix the bots by doing the math on them.
The one thing that can never be zero. Goals can be zero. Ball touches can be zero. But any bot whose wheels turn at all travels some distance, and a tape measure will always give you a number. That number is all the mathematics needs.
Setup — ten minutes
One long strip of tape on the floor per team, as a start line. Bots always start with wheels behind it.
One tape measure or meter stick per team. This is the most important object in the room today.
Measure in centimeters. Written down.
Each team needs their MakeCode project open.
The lab — run this loop for the whole block
Trial 1 is calibration: drive for exactly 1 second.Run it, and measure how far the bot traveled in centimeters.Write it down. This number is the bot's speed in cm per second. Every team's will be different — that is the point.
Now predict, before touching anything. "If our bot drives for 3 seconds, it will travel ______ cm."They get this by multiplying: cm per second × 3. Written down before the bot moves.
Run it for 3 seconds. Measure the actual distance in cm.
Gap sentence, out loud and written: "We predicted ___ cm. We got ___ cm. The gap was ___ cm. Because ___."Almost every team will travel further than predicted, and the miss grows the longer they drive. That is real, and it is the discovery of the whole lab — let them find it, do not tell them.
Change exactly ONE number in their model or their code, and write down which one.Usually: subtract a start-up lag from the prediction, or adjust the cm-per-second figure.
Predict a new distance for a new time (try 3 s, then 4 s, then 5 s), run, measure, gap sentence again.Aim for five trials per team. Five predicted-vs-actual pairs is plenty of data for Tuesday.
Pacing — budget 30–40 minutes for five trials, plus about 15 minutes at the start to paste the code and download it once. Each trial is roughly: predict (1 min), run (30 sec), measure (1 min), gap sentence (2 min).
Because button B changes the drive time, there is no re-downloading between trials — that is what keeps this inside a single block. If you are running short, stop at three trials; three well-measured rows are enough.
It deliberately does not tell them why their first predictions come up short. Steps 3 and 4 ask the questions and leave space; the discovery has to be theirs.
Grading it: every bot is different, so there is no single key. The Answer Key → gives one worked bot plus a check-rule per step that works for any team's numbers.
The code — paste this once, then never re-download
Open MakeCode, add the Cutebot Pro extension, switch to JavaScript, select all and delete, then paste this in. It is the whole program.
// ═══════════════════════════════════════════════════════
// DISTANCE LAB
// A = run one trial
// B = add 0.5 s to the drive time
// A+B = reset to 1.0 s
// ═══════════════════════════════════════════════════════
let SPEED = 5 // <-- your team's Speed stat
let motorPower = SPEED * 100 / 20 // same formula as your match code
let driveMs = 1000 // start at 1.0 second
// The display shows TENTHS of a second: 10 = 1.0s, 25 = 2.5s
basic.showNumber(driveMs / 100)
// A -- run one trial
input.onButtonPressed(Button.A, function () {
basic.showString("GO")
CutebotPro.pwmCruiseControl(motorPower, motorPower)
basic.pause(driveMs)
CutebotPro.stopImmediately(CutebotProMotors.ALL)
basic.showNumber(driveMs / 100)
})
// B -- add half a second. No re-download needed.
input.onButtonPressed(Button.B, function () {
driveMs += 500
basic.showNumber(driveMs / 100)
})
// A+B -- back to 1.0 second
input.onButtonPressed(Button.AB, function () {
driveMs = 1000
basic.showNumber(driveMs / 100)
})
Why it is built this way.Button B changes the drive time, so teams step through 1.0 s → 1.5 s → 2.0 s and so on without re-downloading to the micro:bit. One download at the start of the block and that is it. Everything else is prediction, driving and measuring.
The only line a team edits is let SPEED = 5 — their own Speed stat, so their bot drives at the same power it would in a match. Change it, download once.
Reading the display: it shows tenths of a second, so 10 means 1.0 s and 25 means 2.5 s. Have teams read it aloud before every run — it is how they know which trial they are on.
The mathematics they are actually doing
This is not a consolation activity. It is an alternative version of the same modeling the matches were supposed to produce — and the relationship here is linear, so the equation behaves:
Their model
distance = speed × time + start-up
which is slope-intercept form
y = m x + b
Start-up is a negative number, so + start-up reads as a subtraction — e.g. 38 × time + (−7) = 38 × time − 7. And speed here is the bot's cm per second from Trial 1, not the 1–17 Speed stat set in the code.
m (the slope) is the bot's speed in cm per second — a number with a real physical meaning they measured themselves.
b (the intercept) is the start-up lag and it comes out negative — the bot loses a few centimeters while it accelerates. Here is the trap, and it is a good one: a team that calibrates on the 1-second run bakes that lag into their rate, so their cm-per-second figure is too low. They then under-predict every longer drive, and the miss gets bigger the further they go. Finding that — and fixing it by taking the rate from the difference between two runs instead — is the strongest thing that can happen in this lab.
x is drive time in seconds; y is predicted distance in cm.
Goals can be noisy, low-numbered, and depend on the opponent. Distance is a clean linear function of time that every team can measure to the centimeter, and the parameters are numbers they control in their own code. When they change SPEED and the line moves, they are seeing a parameter change a model. That is Goal 1 exactly.
Data sheet — one per team, print and hand out
Team: _______________________ · Our bot's speed: _______ cm per second For each trial, circle what you saw: too far / too short / not straight / different every time
Trial
Drive time (seconds)
Predicted (cm)
Actual (cm)
Gap (pred − actual)
The one thing we changed
1
1.0
—
—
calibration trial
2
2.0
3
4
5
The sentence that ends the block
"Our gap on Trial 2 was ______ cm.
Our gap on our last trial was ______ cm.
The change that helped most was ____________________."
Exactly what goes in those blanks — teams will ask, so settle it before they start:
Start from Trial 2, not Trial 1. Trial 1 is the calibration run — there is no prediction, so there is no gap. The first real gap is Trial 2.
Write the gap as a plain positive number — how many centimeters off, ignoring whether it was too far or too short. A team that swings from +15 to −14 has not improved, and dropping the sign is what makes that visible.
Name the change with numbers. "We changed the speed" is not an answer. "We changed our speed from 30 to 26 cm per second" is.
Worked example — real numbers from a Gotham bot
Every number in this table was actually measured. Use it as your reference for what a good sheet looks like.
Trial
Drive time (seconds)
Predicted (cm)
Actual (cm)
Gap (pred − actual)
The one thing we changed
1
1.0
—
31
—
calibration → “we do 31 cm/sec”
2
2.0
62
69
−7
nothing yet — first prediction
3
3.0
93
107
−14
nothing — and the gap doubled
4
4.0
145
145
0
rate from the difference (38 cm/sec), minus 7 cm lag
5
5.0
183
183
0
predicted a time they never drove — spot on (38 × 5 − 7)
So this team writes
"Our gap on Trial 2 was 7 cm. Our gap on our last trial was 0 cm. The change that helped most was using 38 cm/sec — the difference between two runs — instead of 31, and subtracting 7 cm of start-up lag."
The most valuable moment is Trial 3, where the gap gets WORSE. It goes −7, then −14: the bot keeps going further than predicted and the miss doubles. Do not rescue them — ask "your gap doubled when you doubled the time, what does that tell you?"
The answer: the 1-second run is the slowest second the bot ever has, because part of it is spent speeding up. Calibrating on it makes the bot look slower than it really is. The fix is to take the rate from the difference between two runs — 107 − 69 = 38 cm per extra second — and treat the leftover 7 cm as start-up lag. That gives distance = 38 × time − 7, which then predicted the 4-second run exactly.
Why subtracting works — have this ready, because students will ask. Both runs start from a standstill, so both pay the same start-up cost. Subtracting makes that cost cancel, leaving one clean second of driving:
That is eliminating a constant term, and it is a real technique they will meet again. Without it students will subtract because they were told to, which is exactly the "procedure, not model" habit the program is trying to break.
Watch for this: the subtraction gives cm per second only because the two runs are 1 second apart. A team that drove 2 s and 4 s must divide their difference by 2. The worksheet times avoid this, but teams improvise.
A team missing by 2 or 3 cm has done well, and their model is good. What you are looking for is the gap shrinking after a change they can name, not a perfect number.
If a team's measurement disagrees with a model that has been working, have them measure again. Once an equation has predicted several runs correctly, a single surprising result is more often the tape measure than the bot. Re-measuring costs fifteen seconds.
Worth saying out loud when it happens, because it is a genuinely sophisticated idea: a trustworthy model is a tool for checking your data, not only for making predictions.
Sanity-check numbers for you. The differences here are 38, 38, 38 — rock steady, so the data is good. If a team's differences jump around (38, then 25, then 44), that is the "different every run" failure: check batteries and the start line before doing any more math.
For a team that finishes early: have them predict a time they have never driven — 5 seconds is 38 × 5 − 7 = 183 cm — write it down, then run it. A correct prediction for a time they never tested is the strongest evidence a model can give.
What success looks like today
Every team has five rows filled in. That is the whole target.
The gap column gets smaller down the page. Not perfectly, not for everyone — but the trend should be visible and they should be able to say why.
Every team can state their bot's cm per second and that it differs from the team next to them.
Nobody is troubleshooting a soccer match. If a bot drives straight for 5 seconds and lands where predicted.
How this feeds Tuesday exactly like matches would have
Tuesday's lesson needs a scatter plot, two points, a slope, an intercept and a residual. This lab gives all five:
Tuesday needs…
The lab provides…
x-axis
Drive time in seconds (or their Speed stat, if comparing across teams)
y-axis
Distance traveled in cm
Two points to build a line
Any two of their five trials
Slope with real meaning
cm per second — their bot's speed
A residual
The Gap column, already computed on the sheet
A never-tried distance (Target Challenge)
Predict a distance they have never tried (say 6 s), then run it. Gap should be small if the model is good.
Model Swap (Goal 2)
Every team's cm-per-second differs, so their lines genuinely differ — compare and defend
Nothing downstream changes. The equation, the Model Swap, the Percent Change step, the poster and the teach-back all run exactly as written in the plan. Only the quantity on the y-axis is different.
If the bots will not move at all
Then it is a technical fault, not a math problem. Work down this list, fastest check first:
Do the LEDs show a number? If not, the program did not flash. Re-copy the file to the micro:bit.
Fresh batteries, and the Cutebot's own power switch ON. This is the single most common cause.
Is the Cutebot Pro extension in the project? Without it the drive blocks do nothing.
And if only one or two bots work: run the lab on shared bots, rotating teams through. Each team still writes their own prediction before their turn and measures their own trial, so every team keeps its own data and its own model. Sharing hardware does not mean sharing an equation. If no bot moves, teach Tuesday's method on the answer key's worked bot (distance = 38t − 7) and be honest with students that the numbers are stand-ins.