Challenge 1
Ski towards a wall. Stop with a gap of about 12 cm. Slow down as you get there. Do not stop all at once.
Quick Learn — the model, the instructions, the program and the challenges. The theory is in Full Lesson.
EV3 Robotics›Level 1 · Beginner›Lesson 47
Level 1 · Lesson 47 · EV3-L01-4760 minutes · Ages 7+ · Model: Skiing Robot
The Skiing Robot is a figure on skis with two poles. A motor turns each pole. The poles reach forward, dig in, and push back. Then the whole robot slides forward.
Its head is an Ultrasonic Sensor that looks down the track. It has no brakes. On skis, to stop, you stop pushing with the poles. Then you wait for the slide to end.
By the end, your robot will slow down as it gets near things. It will not rush up and stop all at once. It does this with one block, used in a new way.
A cross-country skier moves by digging in their poles and pushing. Between pushes, they glide. It takes no work at all. The ski just slides on a thin layer of melted snow.

Skis slide very easily forwards, but not sideways. That is great for going, and terrible for stopping. A skier has no brakes. To slow down, they point their ski tips together. Or they turn across the hill. Or they stop pushing and let the slide end.
So a skier behind another skier does not wait until the last second. They slow down bit by bit. The closer they get, the more they slow. Watch a queue at the top of a slope. Everybody makes small, smooth changes all the time. Nobody jumps between “full speed” and “stopped”.
A car driver does the same without thinking. They do not race to the corner. They do not stamp on the brake. They press harder the closer they get. The closer the stop, the more they brake.
Picture a robot that runs at full speed. It stops when the wall gets close. It would go too far every time. A machine at full speed cannot stop at once. Arriving slowly is much easier than stopping fast.
Do not go full speed until you must stop. Go slower as the place to stop gets nearer.
This model has no step-by-step guide. The video above is not one. It shows a finished robot skiing. Watch how the poles dig in, and how far they swing. Then build from your teacher’s model. You are not missing a page. There is no page.
The programs below use port letters, not motor names.
So far, most sensor programs asked a yes-or-no question. Is it closer than 25? Is the switch pressed? Two answers, two actions.
set movement speed to ([4 v] distance in [cm v] :: sensors) % :: movement
No question is asked. Nothing is compared. The number just goes straight in. So the robot does not have two speeds. It has a hundred.
| Wall is | Sensor says | Robot moves at |
|---|---|---|
| far off | 90 cm | 90% — nearly full speed |
| getting closer | 50 cm | 50% — already slowing |
| close | 20 cm | 20% — creeping |
| nearly there | 8 cm | 8% — hardly moving, easy to stop |
By the time it needs to stop, it has almost stopped anyway. That is why this is better than full speed, then stop. We did not fix going too far by stopping better. We fixed it by never going fast near the wall.
Speed stops at 100. The Ultrasonic Sensor reads up to 255 cm. But a speed of 255% is not possible. Anything above 100 just becomes 100. That is what you wanted anyway. But know that the EV3 does this, not your program.
Below about 10%, motors stop turning at all. They are not strong enough to beat the robot’s own rubbing. So the robot creeps to a stop a little further away than you expected. Then it sits there humming. The usual fix is to add a small number to the speed. This is a minimum. Step 1 in section 10 helps you find yours.
The Ultrasonic Sensor measures distance. It sends out a burst of sound too high for people to hear, listens for the echo, and works out how far away the surface is from how long the echo took — exactly how a bat finds a moth, and how a submarine uses sonar.
| Block | What it does |
|---|---|
([4 v] distance in [cm v] :: sensors) | Reports how far away the nearest thing in front of the sensor is, as a number in centimetres. |
wait until <([4 v] distance in [cm v] :: sensors) < (15)> | Holds the program until something comes closer than 15 cm. |
This is the important step up from the Touch Sensor. Touch gives you true or false; the Ultrasonic gives you a number, and the deciding is left to you. Pick a threshold below and watch where the robot ends up.
The black line on the bar is the threshold; the blue fill is the reading. The robot stops the instant the fill crosses the line.
Three different robots, and only one number is different between them. That is what having a number rather than a yes-or-no buys you: the behaviour is tuned by editing one slot, not by rebuilding the program. It also means the sensor can never tell you it is “close” — close is a decision you make about a reading.
Car parking sensors, automatic doors at a shopping centre, and the sensor that stops a lift door closing on somebody all work this way. Reacting before contact is what makes a machine feel safe.
The Home/Retail EV3 set (31313) ships an Infrared Sensor and a Beacon in place of the Ultrasonic and Gyro sensors. The Infrared Sensor also measures distance, so the programs in this module work with it — but it reports a rough 0–100 proximity rather than real centimetres, and it is affected by sunlight and by dark surfaces in ways the Ultrasonic is not.
Speed is set separately from movement. You tell the motor how fast it should go, and then you tell it to go — two blocks, in that order.
| Block | What it does |
|---|---|
[A v] set speed to (25) % :: motors | Sets the speed for this motor from now on. Nothing moves — it only changes what the next movement will do. |
[A v] run [clockwise v] for (2) [rotations v] :: motors | Now moves, at whatever speed was last set. |
when program starts :: events hat [A v] set speed to (25) % :: motors [A v] run [clockwise v] for (2) [rotations v] :: motors
Swap those two blocks round and the program still contains a speed of 25 % — it just never gets used. Both shafts below are asked for exactly 2 rotations; watch how long each one takes.
speed first — works
speed last — does nothing
Both shafts turn exactly 2 rotations. Only the time they take is different — and the right-hand program never gets the slow movement it was written to have.
The right-hand movement is over before the left is a third of the way round, because it ran at the default speed. Its set speed to () block does run — you can see it light up — but by then the movement it was meant to slow down has already happened. A speed block only ever affects the movements after it. This catches people out constantly.
A high speed is not a better program. Slow movements are gentler on the gears, easier to watch and debug, and look more like the real machine — a barrier that snaps up in a fraction of a second reads as broken rather than fast.
A sensor reading can answer a question. Or it can be a number you use straight away. The second way is smoother.
A sensor that reports a number cannot be used to make a decision on its own — 23 is neither true nor false. An operator turns that number into an answer by comparing it with something.
| Block | What it does |
|---|---|
<(x) > (50)> | True when the left value is bigger than the right. |
<(x) < (50)> | True when it is smaller. |
<<> and <>> | True only when both conditions are true. |
<<> or <>> | True when at least one of them is. |
Forget the symbols for a moment. A comparison is a question about position on a number line: is x to the left of the other number, or to the right? Left is smaller, right is bigger — and that is the whole of it.
Drag the orange x and the black marker, and change the comparison. The green stretch is every position of x that would make the answer true — so you can see where the answer flips before you get there. Turn not on and watch the green jump to the other side.
Drag either marker, or use the arrow keys.
is x to the LEFT of it?
The lab above asks one question at a time: is this x true? A robot never has just one x, though — a sensor reading slides up and down all the time, so what really matters is which stretch of the line makes the condition true. This one draws the whole answer at once.
Drag the circle to move the number you are comparing against, and change the comparison. Everything shaded green is a value of x that would make it true.
Drag the circle, or use the arrow keys. It moves in steps of 0.2.
Every number to the left of 0.2 — but not 0.2 itself, so the circle is hollow.
Watch the circle, because it carries the part everyone gets wrong:
Now turn not on with x > 2 selected and watch two things happen together. The shading jumps to the other side, and the circle fills in — because “not greater than 2” means 2 or less, and 2 has to be part of it. That pairing is the whole reason a hollow circle is worth drawing.
Why a robot cares. Two conditions that look almost identical — light < 30 and not (light > 30) — differ by exactly one value, the reading of precisely 30. A robot sitting right on its threshold behaves differently under the two, and that is the sort of bug that only shows up occasionally and looks like a broken sensor.
These three join answers together rather than numbers. The trap is that English is looser than a program: “stop if it is close and the bumper is pressed” sounds like it covers both situations, when it covers neither on its own.
Flip the two conditions and watch the table. There are only four possible situations in total, and and and or differ on exactly two of them.
| close | bumper | and | or |
|---|---|---|---|
| true | true | true | true |
| true | false | false | true |
| false | true | false | true |
| false | false | false | false |
and is fussy: it wants both. Three of the four rows are false.
Two sensors are running below: an Ultrasonic reporting a number, and a Touch Sensor reporting true or false. Watch the comparison turn the number into an answer, and watch and and or disagree.
and was true in one row out of four. or was true in three. That is the whole difference, and it is why one of them makes a robot look broken.
The comparison is doing one job: it takes a reading that is neither true nor false and, by holding it against a number you chose, produces something a decision can use. The moment the blue fill crosses the black marker is the moment the answer changes.
The number you compare against is a design decision, not a fact. “Close” for a parking sensor might be 15 cm; for a robot arm it might be 3. Pick it by measuring what the sensor actually reads in the situation you care about, then leave a margin.
and narrows: both must hold, so the robot acts less often but more certainly — stop only if something is close and the bumper is pressed. or widens: either will do, so the robot acts more readily — stop if something is close or the bumper is pressed.
In the four situations above, and was true in one of them and or in three. That is the practical difference: swapping one for the other does not adjust a robot slightly, it changes how often it reacts at all.
Say this back before moving on: “Closer means slower. No question asked.”
Look at your robot. Nothing here is a wheel. How does a machine with no wheels know how fast it is going? (It does not. That matters today.)
| Part | What it is doing here |
|---|---|
| EV3 Intelligent Brick | The skier’s body. Its weight presses the skis down. That gives the poles something to push against. |
| Pole motor ×2 | A matching pair that moves together. If they get out of step, the robot skis in a circle. |
| Ultrasonic Sensor — the head | Looks down the track. Today it does not answer a question. It sends a number, all the time. |
| The skis (no wires) | They slide easily forwards, but not sideways. So each pole push moves the robot forwards. |
| The pole tips (no wires) | Need grip. On a smooth table, they slip and the robot goes nowhere. Try a sheet of paper or a cloth under it. |
The motor counter gets it wrong on this model. That is fine. The motors turn poles, not wheels. So the degrees tell you how much the robot pushed. They do not tell you how far it went. Lesson 42’s wheel maths does not work here at all. That is a good reason to measure with the sensor instead.
Sensors go in ports 1, 2, 3, 4. Motors go in ports A, B, C, D. You cannot swap them. If you do, nothing warns you. The robot just will not work.
| Part | Port | Why this one |
|---|---|---|
| Left pole | B | One of the pair. Two motors, one job. |
| Right pole | C | The other half. This is the pair that the set movement speed to block controls. |
| Head (Ultrasonic) | 4 | The Ultrasonic Sensor always goes here. |
Check your own wiring now:
Two routes, and either is fine. USB is the reliable one and the one to fall back on when a room’s Bluetooth is busy; Bluetooth leaves the robot free to move, which some models need.
Do these in order. Naming the Brick after you go looking for it in the list is how groups end up driving each other’s robots.
EV3 until somebody changes it.EV3.The two failures, every class, every time. The Brick has gone to sleep while you were building — press the centre button to wake it. Or you have paired with the group at the next table, which is why the name matters.
The long version, including Port View and how to read the port tiles, is in the Brick & Bluetooth guide.
Use Bluetooth. This time you must. This machine slides very easily. A USB cable pulls on it harder than the poles can push. The robot just will not move.
Stuck? There is a photo of every screen in the Brick & Bluetooth guide.
One change at a time. Measure the gap at the end with a ruler, every run. Guess the gap before each run.
set movement speed to (20) % and run it. Then 15, then 10. The lowest number that still moves the robot is your minimum. Write it down.repeat until. Run both five times. Measure the gap at the end each time. Which one is closer? Which one stops in the same place every time?Write down what you find in step 4. Bang-bang is faster on a good day, but never the same twice. Proportional is a little slower. But it stops in almost the same place every run. A competition robot must score points every time. So the second one wins. That is why Level 4 spends many lessons on it.
Two answers give you two actions. A number gives you all of them.

Build the model before you read any further. Everything after this is about making it do something, and none of it will make much sense with nothing on the table in front of you.
One page at a time — use Next and Previous, or the ← → keys. Fullscreen makes it big enough to build from.
The same build on Google Drive — sometimes a video, sometimes a scan:
Fullscreen it while you build — you can pause and scrub with the player's own controls.
Check the finished build against the picture before you switch anything on. A motor mounted the wrong way round is far easier to spot now than it is to debug later, when it looks like a program fault.
Ski towards the wall, slowing down all the way, and arrive gently.
when program starts :: events hat set movement motors to [B v] and [C v] :: movement clear display :: display repeat until <([4 v] distance in [cm v] :: sensors) < (12)> set movement speed to ([4 v] distance in [cm v] :: sensors) % :: movement write ([4 v] distance in [cm v]) at line (1) :: display move [forward v] for (0.5) [rotations v] :: movement end stop moving :: movement write [ARRIVED] at line (3) :: display play sound [Communication / Hello v] until done :: sound
move block carries no speed of its own. It uses whatever set movement speed said last. That is how the whole thing works. If you typed a speed into the move block, it would win. Then the lesson breaks, and nothing tells you.What success looks like: the robot sets off fast. Then you hear it slow down. When it is a hand's width from the book, it is hardly moving. It stops with a gap, not a bump.
Stuck a long way out? Then you have found the lowest speed the motors can do. They cannot turn at 15%. Step 1 in section 10 fixes it. Still fast at the wall? Then the head sees something further away. Check tile 4 by hand.
Work through them in order — each is harder than the last. The extra challenge comes after all three, and it is meant to make you plan before you build.
Ski towards a wall. Stop with a gap of about 12 cm. Slow down as you get there. Do not stop all at once.
Find your robot's stall speed. That is the slowest speed where it still moves. Add it on as an offset. Then the robot never gets stuck and stops short of the wall.
Test proportional against bang-bang. Do five runs of each. Measure the gap it ends with every time. Say which one gives the same gap more often.
Make the robot ski up to a wall and stop. Then it must turn round and ski back to a second wall. It must slow down at both ends. It must not touch either wall in ten crossings. Tell us the closest it ever came.