The Lifting Flying Chair: a fairground ride on a tall pole. Seats hang from chains around the top. Turn it slowly, and the seats hang straight down. Turn it faster, and they swing out and rise.
Nothing lifts them. There is no second motor and no arm. Only one thing changes: how fast the pole turns. And that changes the shape of the ride!
By the end of the lesson, your ride will start gently. It will speed up to full speed and stay there. Then it will slow down again, just like a real ride.
In the real world 5 min
Where you have seen it
Every funfair has one: the chair swing, the wave swinger, the chair-o-plane. Riders sit in seats that hang on chains from a spinning roof. As it speeds up, the seats swing out. Soon they fly almost flat, high above the ground.
A fairground chair swing at full speed. The seats have swung out and up. Photo: Wikimedia Commons.
Why it is built that way
A seat on a chain wants to go in a straight line. To keep it going round, the chain must pull it towards the middle all the time. That pull to the middle is called the centripetal force.
A chain can only pull along its own length. To pull in and hold the seat up, it must lean. The faster the ride spins, the harder it must pull in. So the chain leans more. That swings the seat out and lifts it up.
So you do not set the height of the seats. The height shows you the speed. Look at a chair swing from far away. You can tell how fast it is going without seeing the motor.
What would go wrong without it
Now think about starting one. What if the ride jumped straight to full speed? The seats would fly out all at once. The riders would be thrown hard against their safety bars. So real rides speed up slowly, over many seconds.
Stopping matters just as much. Turn the power off all at once, and the seats swing back in. They bump into each other, and their chains get tangled. The ride must slow down as carefully as it sped up.
A ride is not just on or off. Speeding up and slowing down are part of the machine.
The main concept — changing speed while it runs 6 min
You can change the speed while the motor is running, not only before it starts.
You met the speed setting back in Lesson 3. You have used it in almost every lesson since. But always the same way: set the speed, then start the motor. One speed, from start to end.
[A v] set speed to (50) % does not have to come first. Put it after the motor has started. It changes the speed straight away, while the motor is still turning. Put several in a row, with waits between them. That is called a ramp.
The same machine at three speeds. Nothing lifts the seats. The speed does!
Where the speed block sits
What it does
Before the motor starts
Picks the speed it will start at. Nothing moves yet. It is a setting, not an action.
After the motor has started
Changes the speed of the motor that is already turning, right now. The ride speeds up without stopping.
Several of them, with wait (1) seconds between
A ramp. The wait gives the ride time to reach each speed before the next one comes.
The waits really matter. A speed block changes the instruction at once. But the ride is heavy, and it takes a moment to catch up. Without waits, all your speed blocks run in a blink. The ride just jumps to the last one.
Set speed before starting, to choose a speed. Set speed after starting, to change it. A ramp is several of those, with time in between.
▶The Medium Motor and motor speedAll about the motor and the speed setting. Open it if you are not sure about either one.Show meHide
ComponentMotion5 min
The Medium Motor
The Medium Motor is the smaller of the two EV3 motors. It is quick and light rather than strong, which makes it the right choice for anything that has to move a part of the robot rather than the whole robot — a gate arm, a pair of jaws, a winch, a pointer.
side
from above
The Medium Motor. The output shaft is the part that turns — everything the motor drives is attached to it, and every rotation you ask for is a rotation of that shaft.
Blocks reference
Block
What it does
[A v] run [clockwise v] for (1) [rotations v] :: motors
Turns the motor a measured amount, then stops. One rotation is one full turn of the motor shaft.
[A v] run [clockwise v] for (90) [degrees v] :: motors
The same idea, but in degrees — useful when a quarter or a half turn is what the mechanism needs. 360 degrees is one rotation.
[A v] run [clockwise v] for (2) [seconds v] :: motors
Turns the motor for a length of time and then stops, whatever the shaft managed to do in it. The one measurement that always finishes.
[A v] set speed to (50) % :: motors
Sets how fast the motor will run from now on. It does not start the motor by itself.
[A v] start motor [clockwise v] :: motors
Starts the motor turning and moves straight on to the next block. It keeps going until something stops it.
[A v] stop motor :: motors
Stops the motor.
Measured, or not measured
These two look similar and behave completely differently, and almost every early EV3 bug comes from picking the wrong one. Watch both run the same job, over and over.
when program starts
A run clockwise for 1rotations
versus
A start motor clockwise
wait 1 seconds
A stop motor
0°measured0°timed1run
Measured: on the mark, againTimed: 48° off the mark
Both programs begin. Both shafts are on the black target mark.Both motors are turning, and they look much the same.Stopped. The measured motor is back on the target; the timed one is wherever a second happened to take it.Finished — it will run again in a moment.
both stopped
Let it loop a few times. The left dial keeps landing on the same mark; the right one leaves a new mark almost every run — that scatter is what “not repeatable” means.
The black mark is where the shaft should finish. The measured motor hits it every single run, because the program waits at that block until the motor has turned exactly that far. The timed motor is only running for a second — and a second covers a different amount depending on the battery, the friction and whatever the mechanism is carrying. Each orange dash is a run that finished somewhere it was not asked to.
run for () rotations is measured. Run it twice and you get the same movement twice.
start motor is not measured. It hands the motor its instruction and moves straight on, so how far the motor gets depends on how long it happens to be left running.
If a mechanism has to end up in a particular place — a gate that must finish upright, a jaw that must close fully — use the measured block.
The third one: run for () seconds
The dropdown at the end of the run block has a third setting, and it is the one that saves lifting mechanisms. for () seconds switches the block off a distance and onto a duration: it drives the motor for that long and then stops, whatever the shaft managed to do in the time.
That sounds strictly worse than a measured turn, and for most jobs it is. It matters because of what the measured block actually waits for. run for (90) degrees does not finish when 90 degrees’ worth of time has passed. It finishes when the shaft has turned 90 degrees — and if the mechanism runs out of travel first, the shaft never will.
Stalling, and the program that never moves on
Every arm, jaw and lift has a physical limit: a point where the mechanism reaches the top of its travel, or something in the build gets in the way. Push a motor into that limit and it stalls — the shaft stops turning and the motor sits there straining. The motor is fine and the program is spelled correctly. But the encoder has stopped counting, so a measured block that was told a bigger number is still waiting, and it will wait until the Brick is switched off.
Nothing after that block ever runs. Not the next motor block, not the sound, not the display, not the rest of the program. That is the whole failure, and it looks like a crash even though nothing has crashed.
when program starts :: events hat
[A v] set speed to (30) % :: motors
[A v] run [clockwise v] for (90) [degrees v] :: motors
[A v] reset degrees counted :: motors
write [HOME SET] at line (1) :: display
0°degrees counted90°what the block asked for0.0swaiting at that block
60° reached, 90° asked — waits for everrest of the program never runs
Same arm, same end stop at 60°. One number is different: this program asks for 90.It lifts, and at 60° the arm meets its stop. The shaft cannot turn any further, however hard the motor pushes.Stalled. The block was told 90 and the shaft says 60, so it is still waiting — and it will wait for as long as the Brick is switched on.The screen is still blank. Every block after the motor block is unreachable — the program has not crashed, it is waiting.Finished. One arm, one end stop, and three programs — only one of which is safe to leave running.
lifting
Watch the Brick screen, not the arm. HOME SET is the block after the motor block, so a blank screen means the program never got past it.
Compare the first two. The only difference between them is 45 and 90, the mechanism is identical, and one of them is a working program while the other locks up on the third block. Nothing in the listing distinguishes them — the end stop is a fact about the build, and the program has never heard of it.
This is the mistake almost every student makes the first time a Medium Motor lifts something. A lifting arm has a lowest position and a highest one; ask it to turn past either and the program hangs. It is worse than an ordinary bug, because the robot looks alive — the motor is still being driven, still buzzing, still hot — and the next block never comes.
Finding a home position by stalling on purpose
The fix turns the problem into the technique. You often do not know how many degrees it is to the top of an arm’s travel — it depends on the build, and it changes the moment somebody rebuilds it. So do not measure it. Drive the arm gently into its own end stop for a couple of seconds, and then declare that position to be zero:
when program starts :: events hat
[A v] set speed to (30) % :: motors
[A v] run [counterclockwise v] for (2) [seconds v] :: motors
[A v] reset degrees counted :: motors
write [HOME SET] at line (1) :: display
Three things make that work, and all three are deliberate:
Slowly. 20–30% is enough to reach the stop and gentle enough not to strain the gears or shake the build apart while it sits there.
Long enough. Pick a time comfortably longer than the arm needs — one to three seconds for most mechanisms. It stalls partway through and spends the remainder pressed against the stop, which is exactly what you want.
Then reset.reset degrees counted makes this position 0, so every measured move afterwards is measured from a place you know. Now run for (120) degrees is safe, because you know where it is starting from.
After that, use measured blocks for everything inside the travel and timed blocks whenever you are driving to a limit. The rule of thumb: if the movement ends against something solid, run for seconds.
Ports
A Medium Motor is normally plugged into port A or D, which leaves B and C free for the Large Motors that drive wheels. The letter in the block must match the port the cable is actually in — this is the single most common reason a program appears to do nothing at all.
ComponentMotion4 min
Speed and power
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.
Speed is a percentage of what this motor can do, not a real-world unit — the same 50 % moves a light arm quickly and a heavy one slowly.
Blocks reference
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.
Set it first
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
A set speed to 25 %
A run clockwise for 2rotations
speed last — does nothing
A run clockwise for 2rotations
A set speed to 25 %
0.00rotations · slow0.00rotations · fast
Speed first: the movement was slowSpeed last: it only affects the NEXT movement
Two programs. Same two blocks in each — only the order is different.Both are running — and the right-hand one is already finished. The left is barely a third of the way.Its speed block runs now, far too late to affect the movement above it. The left motor is still going, slowly, as it was told to.Both turned exactly 2 rotations. Only one of them did it at the speed the program asked for.Finished — it will run again in a moment.
stopped
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.
Slow is often better
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.
Say this back before moving on: “A speed block after the motor starts changes the speed while it turns.”
What’s in this build 4 min
Look at your ride. Which parts have a cable going to the Brick? There is only one.
Medium — in this build
Large — not used here
One Medium Motor at the bottom turns the pole, using a worm gear. It is the flat one with air slots. It is not the Large Motor, with the big red drum on its end.
Part
What it is doing here
EV3 Intelligent Brick
Runs the program. The whole pole stands on it. It is also the heaviest part, so it stops the ride wobbling off the table.
Medium Motor, port A
Turns the pole. It is fast more than strong, and a ride needs to turn fast.
Sensors
None. The ride cannot tell how high its seats are. Only you can see that.
Check the seats hang free before you go on. Lift each one and let it drop. It should swing without touching the pole, the roof or the next seat. If a seat catches on something, it will not rise at any speed. Then you might blame the program by mistake!
Ports — and the rule 4 min
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.
The manual builds the ride right to the last seat. But it never shows you where the cable goes. You choose, and this course has a rule for that.
Part
Port
Why this one
Medium Motor (the mast)
A
A motor working on its own goes in A. B and C stay free for a pair of motors. This ride has no pair.
Sensors
none
Ports 1–4 stay empty. That is fine!
Check your own build now:
One cable, from the Medium Motor to port A. A letter, not a number.
Keep the cable away from the pole, and tape it down if you can. A cable can wrap round a spinning pole. Then it stops the ride, and it can pull the motor off.
Turn the pole by hand, one full turn. The seats should swing out a little, then settle back. If they shake, something is rubbing.
Clear a big circle of table round the ride. At full speed, the seats reach further than you think!
Connect the Brick 4 min
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.
▶How to connect the BrickUSB and Bluetooth, step by step, with a photograph of every screen. Open it if you have not done this before — or if pairing is not working.Show meHide
USB — the reliable one
Switch the Brick on with the dark grey centre button.
Cable into the Brick’s PC port — the small square socket beside the numbered ports, not one of the numbered ones.
Other end into the computer.
Bluetooth — name it first
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.
Name your Brick. On the Brick: Settings (the spanner) → Brick Name. Type something nobody else will pick, then press the tick. Every Brick is called EV3 until somebody changes it.
Turn Bluetooth on. Settings → Bluetooth. Tick Bluetooth and Visibility. Leave iPhone/iPad/iPod unticked.
Connect from EV3 Classroom. Click the Brick icon at the top of the programming area, find your Brick by name, and click Connect.
Say yes on the Brick. It asks “Connect?” with the computer’s name — choose the tick, then accept the passkey, which is already 1234.
Where to read it. The name sits in the bar across the very top of the screen, on every screen — so you can check which Brick you are holding at any moment without going into a menu. This one is EV3VE. A Brick nobody has renamed says EV3.Step 3, and the reason step 1 exists. Three Bricks in range — read the name before you click Connect. Pairing with the wrong one is not an error: it works perfectly, on somebody else’s robot.
Step 2.Bluetooth switches the radio on; Visibility is what lets the computer find you. With Visibility off your Brick works perfectly and simply never appears in the list.Step 4. Look at the Brick. It asks whether to accept and names the computer. Choose the tick.Then the passkey, already 1234. Press the tick again and you are connected.
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.
Confirm the connection 2 min
Check the Brick icon: is it connected? A plugged-in cable does not always mean the Brick is connected.
Port A shows a Medium Motor. Nothing on B, C or D, and nothing on 1 to 4.
If A shows nothing, check the cable, not the program. Unplug both ends and push them back in. Do this before you add any blocks.
Turn the pole by hand and watch the number on tile A. Does it hardly move for a whole turn of the pole? Then the worm gear slows the motor down a lot. You will need a high speed number later.
Change it and test 8 min
Make one change at a time, and guess what will happen before each run. Watch the seats, not the numbers on your screen.
Delete both wait blocks. Guess what the ride does. It jumps to 20 % and stays there. Every speed block ran in a blink, so only the last one counts.
Put them back and change the first wait (3) seconds to wait (0.2) seconds. Does the ride ever really reach half speed? Watch the seats to find out, not the program.
Change the top speed from 90 % to 40 %. Guess how high the seats will fly. Then measure it. Hold a ruler next to the pole, and write down the height at each speed.
Add a [A v] stop motor at the very end. Guess what the seats do as it stops. Real rides are made to stop this tangle.
Add set status light to [red v] at the start and set status light to [green v] at the end. The status light is the light round the Brick’s buttons. You will learn more about it in Lesson 23. Now the ride tells everyone if it is safe to come close.
Write down what you find in Step 3. Now you have a table of speed and height. This machine has no sensor to measure height. The seats did the measuring!
Speed is not just a number in a program. On the right machine, you can see it from across the room.
This is what you are building: the Lifting Flying Chair.
Build it 15 min
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.
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.
Fullscreen it while you build — you can pause and scrub with the player's own controls.
The program, block by block
Motor A (medium) · Speed 20% · Sensors none
What it does
The ride turns only while the centre button is held. Pressing it sets the speed to
20% and starts motor A clockwise; letting go stops it.
Worth noticing
Two stacks, one button. Both hats watch centre. The first says pressed, the second
says released. That last dropdown is the whole difference.
Speed first. The 20% block comes before start motor, so the ride never starts at
some other speed.
Start, not run for.Start motor keeps turning until something stops it. The
release stack is that something.
20% is gentle on purpose. At this speed the chairs only just begin to swing out.
Challenges 27 min
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.
Challenge 1
Set the motor speed to 20%
- When Up Button is pressed, the motor turns clockwise.
- When Down Button is pressed, the motor turns counterclockwise.
- When Center Button is pressed, the motor stops.
Fullscreen it while you build — you can pause and scrub with the player's own controls.
Log in to see hints.
Challenge 2
Create a variable named "speed"
- Set speed to 0.
- When Left Button is pressed, clear display, decrease speed by 5, play "Speed down" sound, limit minimum speed to -100, and display current speed.
- When Right Button is pressed, clear display, increase speed by 5, play "Speed up" sound, limit maximum speed to 100, and display current speed.
- When Center Button is pressed, start motor using "speed" as the motor speed.
- When Center Button is released, stop motor.
Fullscreen it while you build — you can pause and scrub with the player's own controls.
Log in to see hints.
Challenge 3
Create a variable named "speed"
- set the speed to 10 (start from the speed 10%)
When the center button is pressed, clear display and start a continuous loop:
- start motor using speed as the motor speed.
- display current speed on screen
- increase speed by 10 and play a beep sound every 1 second.
- if speed goes above 100, it will play a sound "three", "two", "one", stop motor and stop and exit the program.
Fullscreen it while you build — you can pause and scrub with the player's own controls.
Log in to see hints.
Extra challenge
Design a ride that is safe for its riders.
Real fairground rides are built around what a human body can take, not around what a motor can do. Your job is to design and program a ride cycle that would be safe if the seats held people.
Plan on paper before you touch the program. Decide the fastest speed you will allow and why, how long the ride takes to reach it, and how long it takes to come back down. A rider must never be flung outwards suddenly, and must never be stopped suddenly either.
Build in one more thing: a way for a person standing beside the ride to see at a glance whether it is safe to approach. The Brick has more than one way to do this.
Two questions when you demonstrate it. What is the fastest your ride goes, and how did you decide that was the limit? And how would somebody who had never seen your ride know when to step forward?