The AH-64 Apache: a long-nosed attack helicopter with a four-bladed rotor on top, a small rotor standing upright at the tail, and a gun slung under the nose. Switch it on and all three move at once.
It is the biggest build of the level so far — seventy-four steps — and almost all of that is gears. Underneath the body panels is a chain of them running the whole length of the aircraft.
By the end of the lesson one Medium Motor will be turning the main rotor, the tail rotor and the gun together, with the Brick screen reporting what the aircraft is doing. And you will be able to explain 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 does something no aeroplane can: it rises straight up, stops in mid-air and hovers. That is why they fly mountain rescues, land on hospital roofs and drop water on wildfires. A runway is not needed, because the wing is spinning instead of the aircraft moving.
An AH-64 Apache, showing the four-bladed main rotor 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 throw air downwards, and the air pushes back up — that push is the lift holding the machine in the sky.
But throwing a heavy rotor round one way shoves the body of the helicopter the other way. Left alone, the cabin would spin under the blades like a fairground teacup. The small tail rotor exists only to push sideways against that spin and hold the nose still.
Here is the part that matters today. In a real Apache the tail rotor is not a separate engine with its own throttle. It is driven off the same engine as the main rotor, through a long shaft down the tail boom. The two are geared together on purpose.
What would go wrong without it
If the tail rotor could slow down on its own while the main rotor kept going, the aircraft would begin to spin — and the pilot would have a second thing to control at the worst possible moment. Locking them together means that whatever the engine does, the tail is always pushing in the right proportion.
Losing the tail drive is one of the most serious failures a helicopter can have, which tells you how much work that little rotor is doing.
One engine, geared to everything, so nothing can drift out of step with anything else.
The main concept — one motor, many moving parts 6 min
A gear train can split one motor’s turn between several mechanisms — and everything on that train is then locked to the same source.
Every model you have built so far had one motor per moving thing, or two motors sharing one job. The Apache is the other arrangement: one motor, three moving things. The gears carry its turn up to the main rotor, back along the tail boom to the tail rotor, and forward to the gun.
One Medium Motor on port A. The dashed line is the gear train — the same turn, delivered to three places.
The consequence is the thing to take away. Because they are all on one train, the three mechanisms have fixed proportions. The gearing may make the tail rotor spin four times for every one turn of the main rotor — but it is always four. Change the motor speed and all three change together, in step, by the same factor.
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. That is set by the gears, and only a rebuild changes it.
That last row is Lesson 18 coming back. Some things are program problems and some things are build problems, and telling them apart saves you an hour of editing blocks that were never going to help.
One motor on a shared gear train sets the speed of everything. The build sets the proportions between them.
▶The Medium Motor, speed, and gearingThe full reference for 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 moving 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 a model this size the answer is surprisingly short.
Medium — in this build
Large — not used here
One motor for the whole aircraft. It is the Medium Motor — the flat one with cooling slots along the top, not the Large Motor with the big red drum on its end.
Part
What it is doing here
EV3 Intelligent Brick
Runs the program, and is the fuselage. The screen faces the side and is the aircraft’s instrument panel.
Medium Motor, port A
Drives everything. Fast rather than strong, which suits rotors — they need turns, not force.
Sensors
None. The Apache cannot tell whether its rotors are actually 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. If they do not, a gear has come out of mesh somewhere along the boom — find it now, because from here on it will look exactly like a program fault.
Ports — and the rule 4 min
Sensors go in ports 1, 2, 3, 4. Motors go in ports A, B, C, D. They are not interchangeable, and nothing will tell you politely if you swap them.
The manual builds the Apache all the way to the finished aircraft and never once shows you where to plug the cable. That is not an oversight to worry about — it is your decision, and the course has a habit for it.
Part
Port
Why this one
Medium Motor (the whole drivetrain)
A
A single motor with a job of its own takes A. B and C are kept for a matched pair, and this model has no pair.
Sensors
none
Nothing numbered is used. Ports 1–4 stay empty, and an empty port is a perfectly good 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 boom rather than across the rotor. A cable caught in the main rotor stops the aircraft dead and can pull the gear train apart.
Spin the main rotor one full turn by hand and watch the tail rotor. Count roughly how many turns it makes — you will want that number in section 10.
Stand the model somewhere with clear air around the blades. They are long, and they are about to move properly.
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 kinder choice for this model. The Apache is tall and the rotor sweeps a wide circle; a USB cable running to a laptop is one more thing for a blade to catch.
Confirm the connection 2 min
Check the Brick icon: connected, or not. A plugged-in cable is not a connected Brick.
Port A shows a Medium Motor. Nothing on B, C or D, and nothing on 1 to 4.
If A shows a Large Motor, you have built the wrong motor into the aircraft — go back to step 13 of the manual.
If A shows nothing at all, the problem is the cable, not the program. Reseat both ends.
Turn the main rotor slowly by hand and watch tile A count. The number moving proves the whole gear train reaches the motor.
Make it move 10 min
Eight blocks: a start-up announcement 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 aircraft is doing, the motor runs the whole drivetrain for five seconds, then everything stops together.
Walk it in the order the Brick runs it:
clear display — wipe whatever the last program left behind. Without it you get today’s message printed over yesterday’s.
write [ROTORS TURNING] at line (1) — the instrument panel. The aircraft has no sensors, so the screen is the only thing telling a person what it thinks it is doing.
play sound … until done — until done means the program waits here. The engine noise finishes before the blades move, exactly as a real start-up sounds.
[A] set speed to 30 % — a setting, not a movement. Nothing turns yet. Start low: the rotor is long and the model is not heavy.
[A] start motor clockwise — unregulated. It starts and keeps going, and the program moves straight on to the next block.
wait (5) seconds — the only reason the rotors spin for five seconds. The motor block did not say five; the wait did.
[A] stop motor — and all three mechanisms stop together, because there is only one motor to stop.
Remember the difference from lesson 2:[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 measures its own ending. Here the first is right: a rotor spins for a length of time, not for a number of turns.
What success looks like: the screen reads ROTORS TURNING, the engine sound plays, and then the main rotor, tail rotor and gun all turn together for five seconds and stop at the same instant. If one of the three is still, that is a gear out of mesh — not a block.
Change it and test 8 min
One change at a time, and predict before each run. Write your prediction down before you press play — being wrong on paper is how you find out what you actually believed.
Change set speed to (30) % to 60 %. Predict what happens to the tail rotor. It doubles too — everything on the train doubles, because there is only one source.
Now try 100 %. Predict whether the model stays put. A long rotor at full speed can walk the whole aircraft across the table, and that is worth seeing once.
Change wait (5) seconds to wait (1) seconds. Watch how long the rotor keeps turning after the stop block. That coasting is momentum, and a real rotor does far more of it.
Change [clockwise v] to [counterclockwise v]. Predict which of the three mechanisms reverses. All of them do.
Try to make only the tail rotor go faster, using the program. Spend two minutes on it, then stop. There is no block that does it, and finding that out yourself is the point of the exercise.
Add write [ENGINE OFF] at line (3) after the stop block, so the panel reports the shutdown as well as the start.
Step 5 is the lesson. The program can set how fast the whole aircraft runs, and nothing else. The proportions between the three mechanisms were decided by whoever chose the gears, and the only way to change them is to take the tail boom apart.
If a change is not possible in the program, stop looking for a block and 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.
Use the viewer's own controls to zoom and turn pages. 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.
Challenges & mission 27 min
Work through the challenges in order — each is harder than the last. The mission comes after all three, and it is meant to make you plan before you build.
Challenge 1
Make the Apache run a proper start-up and shutdown. The screen must say what the aircraft is doing at each stage, the rotors must spin up gently rather than jumping to full speed, and everything must come to a stop on its own. Somebody watching should be able to follow what is happening without being told.
Challenge 2
Fly a mission with three phases: idle, cruise, and full power. Each phase must run at a different speed, last a different length of time, and announce itself on the Brick screen. Write down the speed and the duration of each phase before you build it, then check that what the aircraft does matches your plan.
Challenge 3
Count the gearing yourself and prove it. Work out how many turns the tail rotor makes for every one turn of the main rotor, using nothing but the port A reading and your own eyes. Then use that number to run the aircraft for an exact number of main-rotor turns. Report the ratio and how you measured it.
Mission
Build a start-up sequence a pilot could actually use.
A real aircraft is not switched on. It is brought to life in a fixed order, with a check at each stage, because doing it in the wrong order breaks things. Your job is to design that sequence for your Apache and make the Brick run it.
Plan on paper first. Decide what the stages are, what the screen says at each one, and how long each lasts. At least one stage must give a person time to do something — stand clear, confirm the rotor is free — and the aircraft must not move during it.
Then build in a shutdown that is not simply the reverse. Ask yourself what a rotor with momentum needs that a stationary one does not.
Two questions when you demonstrate it. Why did you put your stages in that order? And what would go wrong if somebody skipped one?