The AH-64 Apache. It is an army helicopter with a long nose. It has a big rotor with four blades on top. A small rotor stands up at the tail. A gun hangs under the nose. Switch it on, and all three move at once.
It is a big build. It has seventy-four steps, and most of them are gears. Under the body there is a line of gears. It runs the whole length of the helicopter.
By the end, one Medium Motor will turn all three parts together. That is the main rotor, the tail rotor and the gun. The Brick screen will say what the helicopter is doing. And you will know why you cannot make the tail rotor spin faster than the main one.
In the real world 5 min
Where you have seen it
A helicopter can do something no plane can. It goes straight up. It can stop in the air and stay there. That is called hovering. So helicopters save people on mountains. They land on hospital roofs. They drop water on forest fires. They do not need a runway. Their wings spin round, so the helicopter does not have to rush forward.
An AH-64 Apache. You can see the main rotor with four blades, and the tail rotor. Photo: Wikimedia Commons (public domain).
Why it is built that way
The main rotor blades are wings that go round. They push air down. The air pushes back up. That push is called lift. Lift holds the helicopter up in the sky.
But when the big rotor spins one way, it pushes the body the other way. Left alone, the body would spin under the blades, like a teacup ride at a fair. The small tail rotor has one job. It pushes sideways against that spin, so the nose stays still.
Here is the part that matters today. In a real Apache, the tail rotor does not have its own engine. It runs off the same engine as the main rotor. A long rod inside the tail joins them. The two are geared together on purpose.
What would go wrong without it
Say the tail rotor could slow down by itself, while the main rotor kept going. The helicopter would start to spin. The pilot would have one more thing to fix, at the worst time. Joining them means the tail always pushes the right amount, whatever the engine does.
Losing the tail rotor is one of the worst things that can happen to a helicopter. That shows how much work the little rotor does.
One engine, geared to everything. So nothing can get out of step.
The main concept — one motor, many moving parts 6 min
A line of gears that turn each other is called a gear train. It can share one motor’s turn with many moving parts. Then all of them are tied to that one motor.
Every model so far had one motor for each moving part. Or it had two motors sharing one job. The Apache is the other way round: one motor, three moving parts. The gears carry its turn up to the main rotor. They carry it back along the tail to the tail rotor. And they carry it forward to the gun.
One Medium Motor on port A. The dashed line is the gear train. The same turn goes to three places.
This is the big thing to remember. All three parts are on one gear train. So they always turn at the same speeds compared with each other. Say the gears make the tail rotor spin four times for each main rotor turn. Then it is always four. Change the motor speed, and all three change together, by the same amount.
What you want to change
Where you change it
How fast everything turns
In the program: [A v] set speed to (30) %
Which way everything turns
In the program: the [clockwise v] dropdown
How fast the tail rotor turns compared with the main rotor
Nowhere in the program. The gears set that. Only a rebuild changes it.
That last row is the EV3 Fan coming back, from Level 1, Lesson 9. Some problems are in the program. Some problems are in the build. Learn to tell them apart. Then you will not waste an hour on blocks that could never help.
One motor on a gear train sets how fast everything goes. The build sets how fast each part goes compared with the others.
▶The Medium Motor, speed, and gearsAll about the motor, the speed setting and gear ratios. Open it if any of the three is not clear yet.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.
ComponentMechanics5 min
Gearing up and gearing down
Two meshed gears are a bargain. Whatever one of them gains in turns it loses in force, and whatever it loses in turns it gains in force. There is no arrangement of gears that gives you more of both, and no amount of building will find one.
The ratio is the teeth
Count the teeth on the gear you are turning (the driver) and the teeth on the one being turned (the follower). That is the whole calculation:
turns out = turns in × driver teeth ÷ follower teeth
An 8-tooth gear driving a 24 gives ⅓ of a turn out for every turn in — and three times the turning force. Turn the pair round and you get three turns out and a third of the force. Count the turns yourself below.
0.00turns in0.00turns out×3turning force
strongerslowerslow and strong — a lifting winch
Two gears, meshed. The one on the left is being turned; the one on the right is along for the ride.Watch the two counters. They are not climbing at the same rate.Whatever the follower loses in turns, it gains in force — and whatever it gains in turns, it loses in force. There is no setting that gives you both.Finished. Count the turns again with a different pair and the trade goes the other way.
stopped
The number of teeth is the whole story. 8 teeth driving 24 means 8 ÷ 24 of a turn out for every turn in — and the force changes by exactly the opposite amount.
Gearing down, gearing up
Arrangement
Turns
Force
What it is for
Gearing down — small driving large
fewer
more
winches, lifts, robot arms, anything that has to move a weight
Gearing up — large driving small
more
less
fans, spinners, launchers, wheels on a light fast robot
1 : 1 — same size
same
same
moving the drive to a different axle, or fixing a direction
The names are worth getting right because they are backwards from what people expect: gearing down makes the output slower, not smaller, and it is the setting that makes a weak motor able to lift things.
Gear trains
Put several pairs in a row and the ratios multiply. Two 1:3 reductions in series give 1:9 — which is how a Medium Motor ends up able to raise something it could never shift directly. This is also how a gearbox with a sensible number of parts reaches a ratio that a single pair never could: a 40-tooth gear driven by an 8 is 1:5, and doing it twice is 1:25.
Only the first and last gear affect the ratio. Anything in the middle passes the motion along and changes nothing but the direction — which is a whole idea of its own, in Changing the direction of a turn.
What it costs
Every mesh loses a little to friction, so a long train is less efficient than a short one. Gearing down far enough to lift a heavy load also makes the mechanism slow, and slow is not always acceptable. And a gear train that is geared down hard is very hard to turn backwards by hand, which is either a useful brake or a nuisance depending on what you are building.
Why it matters
A bicycle is the same idea with a chain instead of teeth in mesh: the low gear that gets you up a hill is turning the back wheel slowly and pushing hard, and the high gear you use going downhill does the opposite. Cars, drills, cranes and clocks are all making the same trade.
Say this back before you move on: “Everything on one gear train shares one motor. I can change how fast they all go, but not how fast one goes compared with another.”
What’s in this build 4 min
Look at your finished Apache. Which parts have a cable? For such a big model, the list is very short.
Medium — in this build
Large — not used here
One motor for the whole helicopter. It is the Medium Motor: the flat one with slots along the top. 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. It is also the body of the helicopter. The screen faces the side. It is like the pilot’s dials.
Medium Motor, port A
Moves everything. It is fast, not strong. That suits rotors. They need lots of turns, not a big push.
Sensors
None. The Apache cannot tell if its rotors are really turning. It only knows what it was told to do.
Turn the main rotor by hand before you plug anything in. The tail rotor and the gun should move too. Do they stay still? Then a gear has slipped apart from the next one, somewhere along the tail. Find it now. Later, it will look just like a program 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 whole Apache. But it never shows you where to plug in the cable. Do not worry about that. It is your choice. And this course has a habit for it.
Part
Port
Why this one
Medium Motor (moves everything)
A
One motor with a job of its own goes in A. B and C are kept for a matched pair. This model has no pair.
Sensors
none
No number ports are used. Ports 1–4 stay empty. An empty port is a fine answer.
Check your own build now:
One cable, from the Medium Motor to port A. A letter, not a number.
Run the cable under the tail, not across the rotor. A cable caught in the main rotor stops it dead. It can pull the gears apart.
Spin the main rotor one whole turn by hand. Watch the tail rotor. About how many turns does it make? You will need that number in section 10.
Stand the model where there is space around the blades. They are long, and soon they will really spin.
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.
Bluetooth is the better choice for this model. The Apache is tall, and the rotor sweeps a wide circle. A USB cable to a laptop is one more thing for a blade to catch.
Confirm the connection 2 min
Check the Brick icon. Is it connected, or not? A cable plugged in does not mean the Brick is connected.
Port A shows a Medium Motor. Nothing on B, C or D, and nothing on 1 to 4.
Does A show a Large Motor? Then you built the wrong motor into the helicopter. Go back to step 13 of the manual.
Does A show nothing at all? Then the problem is the cable, not the program. Unplug both ends and push them back in.
Turn the main rotor slowly by hand. Watch tile A count. If the number moves, the whole gear train reaches the motor.
Change it and test 8 min
Make one change at a time. Guess before each run. Write your guess down before you press play. If your guess is wrong on paper, you learn what you really thought.
Change set speed to (30) % to 60 %. Guess what happens to the tail rotor. It goes twice as fast too. Everything on the gear train doubles, because it all comes from one motor.
Now try 100 %. Guess: will the model stay in place? A long rotor at full speed can make the whole helicopter walk across the table. That is worth seeing once.
Change wait (5) seconds to wait (1) seconds. Watch how long the rotor keeps turning after the stop block. It keeps going because it is already moving. That is called momentum. A real rotor keeps going for much longer.
Change [clockwise v] to [counterclockwise v]. Guess which of the three parts turn the other way. All of them do.
Try to make only the tail rotor go faster, using the program. Try for two minutes, then stop. There is no block that does it. Finding that out for yourself is the point.
Add write [ENGINE OFF] at line (3) after the stop block. Now the screen shows the stop as well as the start.
Step 5 is the lesson. The program can set how fast the whole helicopter runs. It cannot do anything else. The gears decide how fast each part turns compared with the others. A person chose them. The only way to change that is to take the tail apart.
If a change is not possible in the program, stop looking for a block. Go and look at the build.
This is what you are building: the AH-64 Apache Helicopter.
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.
Make it move 10 min
Eight blocks. First a message on the screen. Then the rotors spin for five seconds and stop.
when program starts :: events hat
clear display :: display
write [ROTORS TURNING] at line (1) :: display
play sound [Mechanical / Motor start v] until done :: sound
[A v] set speed to (30) % :: motors
[A v] start motor [clockwise v] :: motors
wait (5) seconds
[A v] stop motor :: motors
The screen says what the helicopter is doing. The motor runs all the gears for five seconds. Then everything stops together.
Go through it in the order the Brick runs it:
clear display: wipes off what the last program left. Without it, today's message is written on top of yesterday's.
write [ROTORS TURNING] at line (1): the pilot's dials. The helicopter has no sensors. Only the screen shows a person what it thinks it is doing.
play sound … until done: until done means the program waits here. The engine sound ends before the blades move. A real helicopter sounds like that when it starts.
[A] set speed to 30 %: this sets the speed. It does not move anything. Nothing turns yet. Start low. The rotor is long, and the model is not heavy.
[A] start motor clockwise: it starts and keeps going. The program goes straight on to the next block.
wait (5) seconds: this is why the rotors spin for five seconds. The motor block did not say five. The wait did.
[A] stop motor: all three parts stop together. There is only one motor to stop.
Remember the difference from Lesson 3, the Cyclist:[A v] start motor runs until something stops it. So it needs a wait and a stop. A [A v] run [clockwise v] for (2) [rotations v] block knows when to stop by itself. Today the first one is right. A rotor spins for a length of time, not a number of turns.
What success looks like: the screen says ROTORS TURNING. The engine sound plays. Then the main rotor, tail rotor and gun all turn together for five seconds. They all stop at the same moment. Is one of the three still? Then a gear has slipped. It is not a block problem.
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
Make the Apache start up and shut down properly. The screen must say what the helicopter is doing at each stage. The rotors must speed up gently, not jump to full speed. Everything must stop by itself. Someone watching should be able to follow what is happening without being told.
Challenge 2
Fly a mission in three parts: idle, cruise and full power. Each part must run at a different speed. Each must last a different time. Each must show its name on the Brick screen. Write down the speed and time of each part before you build it. Then check that the helicopter does what you planned.
Challenge 3
Work out the gears yourself, and prove it. How many turns does the tail rotor make for each turn of the main rotor? Find out with only the port A reading and your own eyes. Then use that number. Run the helicopter for an exact number of main rotor turns. Report the ratio and how you measured it.
Extra challenge
Build a start-up plan a pilot could really use.
A real helicopter is not just switched on. It is started in a fixed order, with a check at each stage. Doing it in the wrong order breaks things. Your job is to plan that order for your Apache. Then make the Brick run it.
Plan on paper first. Decide what the stages are. Decide what the screen says at each one, and how long each one lasts. At least one stage must give a person time to do something. They might stand clear, or check that the rotor is free. The helicopter must not move during that stage.
Then add a shutdown. It must not just be the start-up done backwards. A spinning rotor has momentum, so it keeps on going. What does it need that a still rotor does not?
When you show it, answer two questions. Why did you put your stages in that order? And what would go wrong if someone skipped one?