Course contents

What an ECU does

Not started

7 minutes

Estimated lesson time

Beginner

No experience needed

The small computer that runs your engine, a hundred decisions a second

Builds on: What happens when you press the accelerator

What it is

The ECU, short for engine control unit, is a small computer that runs the engine. It’s a sealed metal box, usually in the engine bay or behind the dashboard, wired to dozens of sensors and to the parts that make the engine go. In the US it’s often called the ECM or PCM.

It does the same three things over and over, many times a second:

  • Sense. Sensors tell it what’s happening: how far you’ve pressed the accelerator, how much air is coming in, how fast the crankshaft is turning, how warm the engine is and how clean the last burn was.
  • Decide. It looks up its maps, tables of numbers set by the engine’s makers, to work out what the engine needs right now.
  • Act. It opens the throttle, holds each injector open for just the right time and fires each spark plug at just the right moment.

Before ECUs, all of this was done mechanically, with carburettors, springs and weights. A computer can do it far more precisely, which is why modern engines make more power from less fuel and give out far cleaner exhaust.

How it works

ECUMapInjectorSpark

Sensors report to the ECU many times a second: the pedal is 20% down, 19 grams of air a second are coming in, the crankshaft is turning at 3,000 rpm and the coolant is at 90°C.

Injector open
5.9 ms
Spark before the top
33°
Coolant
90°C (194°F)
20% pressed

Step round the loop with the numbered buttons. Move the pedal, then try the Cold engine button to see the ECU change its mind.

  1. Sensors. The airflow sensor, crankshaft sensor, coolant temperature sensor and oxygen sensor all report in, along with the pedal. The crankshaft sensor matters most: it tells the ECU exactly where each piston is, so it knows when to inject and when to spark.
  2. Map. The ECU uses two numbers, engine speed and load (how hard the engine is working), to find the right cell in its maps. There’s one map for fuel, another for spark timing, and many more for everything else.
  3. Fuel. It holds each injector open for a few thousandths of a second, matching the fuel to the air. When the engine is cold it adds extra, because cold fuel doesn’t turn to vapour easily and some settles on the cold metal.
  4. Spark. It fires each spark plug a little before the piston reaches the top. The fuel takes a moment to burn, so lighting it early means the push builds just as the piston starts down. A light-load mixture is thin and burns slowly, so it’s lit earlier; a full-load mixture burns fast and would knock, a harmful rattle, if lit too early.
  5. Check. An oxygen sensor in the exhaust tells the ECU whether the last burns had a little too much fuel or too little. The ECU trims the next injections to suit, so the mixture stays right even as the engine wears or the weather changes.

At 3,000 rpm a four-cylinder engine needs 100 injections and 100 sparks every second. One degree of crankshaft turn lasts about 56 millionths of a second, and the ECU times every spark to within a fraction of that.

The ECU also does jobs you might not notice: it keeps the idle steady when the air conditioning switches on, cuts the fuel when you lift off at speed, and stops the engine going past its red line by briefly cutting fuel or spark. That’s the rev limiter.

One computer among many

The engine’s ECU isn’t alone. A modern car has dozens of control units, often more than 50: one each for the gearbox, the anti-lock brakes, the airbags, the lights and the windows, among others.

They talk to each other over a shared wiring network called CAN bus. When you press the accelerator hard in an automatic, the engine ECU and the gearbox controller agree on a change down; if a wheel spins, the traction control asks the engine ECU to cut power.

What goes wrong

The ECU itself rarely fails. What goes wrong is usually a sensor or wire feeding it bad information.

  • The warning light. The ECU constantly checks its sensors. If a reading is impossible or out of range, it stores a fault code and lights the engine management light on the dashboard.
  • Reading the codes. Every car sold new in the US since 1996, and in the UK and Europe since 2001 (2004 for diesels), has a diagnostic socket, called the OBD port, under the dashboard. A cheap code reader plugs in and shows which sensor or system is complaining.
  • Limp mode. If a fault could harm the engine, the ECU limits the revs and power so you can get home or to a garage safely without causing more damage.
  • Running on guesses. If a sensor fails completely, the ECU falls back on safe default values from its maps. The engine still runs, but it may use more fuel, idle roughly or feel flat.

Modifications

Because the ECU decides how much fuel, spark and boost the engine gets, changing its maps changes how the engine behaves. This is called remapping or tuning.

  • A remap rewrites the numbers in the ECU’s maps. On a turbocharged engine it can add 20 to 30 per cent more power, mostly by raising the boost and adding fuel and spark to match, without touching any parts.
  • Why makers leave power on the table. A car is built to survive bad fuel, extreme heat, poor servicing and years of use, and to pass emissions tests everywhere it’s sold. A remap uses up some of that safety margin.
  • Changing parts needs a new map. A bigger turbo, larger injectors or a freer-flowing exhaust only work properly once the ECU’s maps are changed to suit them.

A careless remap can make an engine knock, run too hot or fail its emissions test. Level 9 covers remapping in detail.