Challenge 1
Climb one step straight. Start the machine right in front of the step. Run it. Watch the BACK corners as it goes up. Both should lift at the same moment. Do it three times from the same start.
Quick Learn — the model, the instructions, the program and the challenges. The theory is in Full Lesson.
EV3 Robotics›Level 2 · Intermediate›Lesson 5
Level 2 · Lesson 5 · EV3-L02-0560 minutes · Ages 8+ · Model: Stair Climber Simple
The Stair Climber: two Large Motors, one on each side. They lift the front of the machine up a step. Then they pull the rest of it up after.
A step is not a floor. On a floor, one wheel may run a bit faster than the other. Then the robot just drifts a little to one side. That is annoying, but fine. On a step, one side may get there first. Then the machine goes up at a slant. One corner catches, and it falls off backwards.
Both sides have to move as one. Today you find out why two motor blocks cannot make sure of that. And what to use instead.
Delivery drivers use stair-climbing trolleys. They look like they should not work! Each side has a group of three wheels, fixed on a star shape. The group rolls along the floor. When it meets a step, the whole star turns. That lifts the next wheel up onto the stair.

One axle joins the two sides, right through the trolley. That is on purpose. With one shared axle, the left star cannot turn unless the right one turns too. So the metal keeps the two sides in step, not the person pushing.
Anything that climbs does something like this. A digger on tracks. An escalator. A lift with cables on both sides. They all have something that makes the two sides move together.
If one side gets ahead on a step, the machine twists. Now one side lifts more weight than the other. The side with less weight gets even further ahead. That twists it more. It gets worse and worse on its own, until something gets stuck or the whole thing tips.
On flat ground, if one side is ahead, you drift. On a step, you fall.
There are two ways to run a pair of motors. One is better. It keeps the pair level. The other one just hopes.
[B v] run for (1) [rotations v] at (40) % speed :: motors [C v] run for (1) [rotations v] at (40) % speed :: motors
You could fix the taking-turns part with two stacks side by side. You will learn that in Lesson 38, the Drawing Machine. But they are still two motors, each told the same thing on its own. If one has to push harder, it falls behind. Nothing in the program notices or fixes it.
set movement motors to [B v] and [C v] :: movement move [forward v] for (1) [rotations v] :: movement
The pink Movement blocks treat two motors as one machine. The Brick checks how far each one has really turned. Then it slows down the one that is ahead, so they stay together. It does this all the time. That is the whole reason these blocks are here. Keeping two motors together like this is called synchronised movement.
| Block | What it actually does |
|---|---|
| set movement motors to B and C | Nothing moves. It says which two motors are the pair, and which one is left. It is a setting, like the stop setting in Lesson 3, the Cyclist. |
| move forward for () rotations | Runs both, together and level, for that many turns. Then it stops. |
| set movement speed to () % | Sets the speed for the Movement blocks. It is like the set speed block from Lesson 3, but for the pair. |
A driving base has two Large Motors, one per wheel. You could drive them with two separate motor blocks — but they would never start at quite the same instant, and the robot would curve away. EV3 has a separate family of Movement blocks that treat the pair as a single driving base.
| Block | What it does |
|---|---|
set movement motors to [B v] and [C v] :: movement | Tells the Movement blocks which two ports are the driving wheels. Put it at the top of the program, before any movement. |
move [forward v] for (2) [rotations v] :: movement | Drives both wheels together, so the robot travels in a straight line. |
move for (1) [rotations v] at (75) (25) % speed :: movement | Drives the two wheels at different speeds, which makes the robot curve. |
set movement speed to (50) % :: movement | Sets how fast the driving base travels from now on. |
set movement motors to [B] and [C] is the block that decides which two motors every Movement block after it will drive. It does not look at the robot. It drives the two ports you name, whether or not there is a motor in them — so those two letters have to be the two sockets the cables are actually in.
This is the single commonest reason a driving base does nothing, and it is invisible in the program: every block is spelled correctly and the robot still will not go.
the same program on both robots
The yellow outline marks the two ports the block is driving. A robot only goes straight when both of them have a motor in them.
Both robots run the identical program. The left one has its motors in B and C, so both named ports have a motor and the robot drives straight. The right one is plugged into A and B: the block drives B, finds nothing in C, and never mentions the motor in A at all — so one wheel turns, one wheel sits there, and the robot swings round the dead one instead of driving.
If neither named port has a motor in it — cables in A and D, say, with the block still set to B and C — the robot does not move at all. The program runs happily to the end and the Brick reports nothing wrong, because as far as it is concerned it did exactly what it was told.
So before you look for a bug in the program, look at the cables: read the port letters off the Brick, then make the block say those two. B and C are only the usual choice, not a rule — if your build has the driving motors in A and D, set the block to A and D and everything works.
Everything a driving base can do comes from those two speed numbers. Try each button below and watch the trail the robot leaves.
The path is worked out from the two wheel speeds in the block, not drawn by hand — so changing the preset changes the numbers and the shape together.
Notice there is no steering block anywhere in that program, and no steering part anywhere on the robot. The turn is made entirely by driving the two wheels different amounts.
when program starts :: events hat set movement motors to [B v] and [C v] :: movement move [forward v] for (2) [rotations v] :: movement move for (1) [rotations v] at (50) (-50) % speed :: movement
“Move forward 2 rotations” says nothing about the floor — it says how many times the wheels go round. How far the robot actually travels depends on how big the wheels are, and once round a standard EV3 driving wheel is about 17.5 cm.
Before doing any sums, get a feel for it. Drag the robot along and watch both scales at once — rotations on top, centimetres underneath, the same line. Land on the half marks: there is a number between 1 and 2, and it is 1.5.
Drag the robot, or use the arrow keys — it moves in half rotations. Rotations above the line, centimetres below.
1.5 — a half rotation past 1. Half a turn of the wheels is 8.75 cm, so halves matter.
35 ÷ 17.5 = 2. That is a number you can type straight into the block.
set movement motors to [B v] and [C v] :: movement set movement speed to (30) % :: movement move [forward v] for (2) [rotations v] :: movement
Steering at right 100 or left 100 drives the two wheels in opposite directions, so the base stops travelling and pivots where it stands. The angle it sweeps is a simple doubling of the rotations:
Half a rotation is the one worth remembering: a square corner, 90°.
| Rotations | The robot turns |
|---|---|
| 0.25 | 45° — half a corner |
| 0.5 | 90° — a square corner |
| 1 | 180° — turn round and face back |
| 2 | 360° — all the way round |
The one to memorise is 0.5 rotations = 90°. Everything else follows from doubling or halving it.
set movement speed to (20) % :: movement move [right: 100] for (0.5) [rotations v] :: movement
Turn slowly. The wheels on a driving base are big and the robot carries a lot of weight, so at full speed it keeps going after the motors stop and lands past the angle you asked for. Somewhere between 15% and 30% speed is where turns become repeatable. A turn that overshoots is almost always a turn taken too fast, not a wrong number.
These figures belong to your robot. The distance depends on the wheels and the angle depends on how far apart they are, so a wider base needs a different number for 90°. Test it, measure what actually happened, and adjust — the same discipline as the Gyro Sensor tolerance.
Every wheeled vehicle steers this way — a tank, a digger, an office chair with two driven castors. Cars use a steering rack instead, but a robot that turns by driving its wheels at different speeds needs no steering mechanism at all.
Telling two motors the same thing is not the same as telling one pair once.
This does not undo the Tricycle. In Level 1, Lesson 29, the Tricycle wanted its two motors to be different. That difference was how it steered. On the floor, the wheels could go different distances. A climber has both sides holding the same step. So a difference can only twist the frame. Same blocks, opposite advice. The build decides which one you want.
The Touch Sensor is the simplest input the EV3 has: a button that is either pressed or not. That sounds trivial, but it is how a robot knows it has hit a wall, reached the end of a track, or been told to start by a person.
| Block | What it does |
|---|---|
wait until <[1 v] is pressed? :: sensors> | Holds the program here until somebody presses the sensor. |
<[1 v] is pressed? :: sensors> | Reports true or false. Drop it into a condition to make a decision rather than a wait. |
[1 v] when [bumped v] :: events hat | Starts a whole stack of its own. The dropdown chooses the moment: pressed, released or bumped. |
A button is not only “pressed”. One press is three things: the moment it goes down, the time it stays down, and the moment it comes back up. Watch what a single press does to three programs at once.
versus two hat blocks
The middle counter is the one that surprises people. Nothing is wrong with it — a loop really does check that fast, and every check really is a separate answer.
Nothing there is broken. A loop really does get round hundreds of times a second, and each time it asks is pressed? the honest answer is still yes — so if that loop plays a sound or counts something, it does it hundreds of times from one finger. The two hat blocks each fire once, and they fire at different moments: pressed the instant the button goes down, bumped only when it comes back up.
The three options, and what each is for:
when program starts :: events hat set movement motors to [B v] and [C v] :: movement start moving [straight: 0] :: movement wait until <[1 v] is pressed? :: sensors> stop moving :: movement
The robot drives until something presses the sensor. Note that the movement is started unmeasured on purpose — the sensor decides when to stop, not a distance.
Touch sensors are everywhere in machines you cannot see into: a lift knows the doors are shut, a printer knows the lid is closed, a washing machine will not spin until it is latched. They are safety devices as much as inputs.
Say this back before moving on: “Set movement motors does not move anything.”
| Part | What it is doing here |
|---|---|
| EV3 Intelligent Brick | Checks the two motors many times a second. It slows down whichever one is ahead. That check is the whole point of this lesson. |
| Large Motor ×2 | One on each side, in ports B and C. Both lift the machine’s weight up the step. So both need to be strong. |
| Touch Sensor | Starts the climb. Then you can line the machine up with the step before anything moves. |
| The climbing parts (not electronic) | Whatever lifts the machine: wheels, a leg or a track. Both sides must be built the same. On this model, even one extra small part on one side really shows. |
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 motor | B | B is always left. The Movement blocks expect that. |
| Right motor | C | C is right. Together B and C are the pair the Movement blocks drive. |
| Touch Sensor | 1 | Touch is always port 1 in this course. |
Check your own build 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.
Bluetooth for this one. A cable hanging off one side of a climber pulls that side back. That one-sided pull is just what this lesson is trying to stop.
Make one change at a time. Always start lined up straight, against the same step.
when program starts on top. Then both stacks run at the same time. Same speeds, same turns. Climb the step and watch the back corners.wait (1) seconds between two climbs of 2 rotations each. It gives the robot a pause to settle between steps. Is it better or worse than one long climb?Step 2 is the proof, so do it with care. With two Motor blocks, the side with the weight falls far behind. With a Movement block, it hardly falls behind at all. Only the Movement block is checking.
Movement blocks do not make the motors the same. They notice when the motors stop being the same, and fix it.

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.
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.
Line it up, press the button, climb one step, stop. It is short on purpose. One step done well is better than three done at a slant.
when program starts :: events hat set movement motors to [B v] and [C v] :: movement set movement speed to (30) % :: movement write [Ready ] at line (1) :: display [1 v] wait until [pressed v] :: sensors clear display :: display write [Climbing] at line (1) :: display move [forward v] for (2) [rotations v] :: movement play beep (70) for (0.3) seconds :: sound write [Welcome] at line (3) :: display
What success looks like: the machine goes up straight. Watch the back edge, not the front. Does one back corner lift before the other? Then the two sides are not in step, even if the front looks level.
Does it climb crooked, even with Movement blocks? Then the problem is in the build, not the motors. The Brick can only match how far each motor turns. One side may be stiffer, or have different gears. Then the same turning does not mean the same climbing. Go back to section 5.
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.
Climb one step straight. Start the machine right in front of the step. Run it. Watch the BACK corners as it goes up. Both should lift at the same moment. Do it three times from the same start.
Climb with extra weight on one side. Tape a weight to one side only. Climb the same step with the Movement blocks. Then do it again with two Motor blocks, side by side in two stacks. Say what the back corners did each time.
Climb two steps in a row without ending up crooked. The second step is the hard one. Any twist left from the first step is still there when it starts. Did a pause between the steps help? Say why.
Make a climber that will not try a step that is too big for it. Right now your machine climbs whatever is in front of it. It only finds out afterwards. Your job is to give it a rule and make it follow the rule. First, decide on paper what "too big" means for your build. Find the tallest step it climbs every time, three times out of three. Measure it. Then measure a step it fails. The limit is somewhere in between. Finding it is your experiment. Then make the machine check before it starts. You have the Ultrasonic Sensor. You learned to read it as a number with the Radar Device. Fix it on the front, low down, looking forward. Use the number it gives to decide whether to start the climb at all. When you show it, answer two questions. What does your machine do when the step is too big? Is that safe to walk away from? And you found your limit on one floor. What would change if the floor were carpet, not a table?