Engine management: how an ECU works
An ECU measures, calculates and actuates continuously. Once you understand which sensors it reads, which tables it uses and where it corrects itself, it becomes clear why a calibration follows a fixed order and why a datalog tells you more than any power figure.
What is inside the ECU
A modern ECU is a computer with a microcontroller, memory and many inputs and outputs. Factory ECUs can have more than 200 connections. Some routines run on a timer, others in step with crankshaft position, for example the ignition timing calculation.
On the input side there are circuits that condition sensor signals: analogue inputs for pressure and position sensors, temperature inputs with a pull-up resistor, digital inputs for frequency signals and dedicated trigger inputs for crank and cam. On the output side there are drivers for injectors, ignition coils and auxiliary outputs, and on newer units also H-bridges for electronic throttles. The Link G5 Voodoo Neo 4, for example, has 8 injection and 6 ignition drives, 2 trigger inputs, 2 knock inputs, 2 CAN buses and two H-bridges for the throttle and an electronic wastegate.
This specification decides what a build can do at all: whether injection is sequential, whether every coil is fired individually, whether two knock sensors are evaluated separately and how many extra devices can be connected over CAN.
Sensors and actuators
The ECU sees the engine only through its sensors. The main groups:
- Position and speed: crank and cam sensors.
- Load: manifold pressure, air mass or throttle position.
- Condition: intake air, coolant and oil temperature, oil and fuel pressure, system voltage.
- Feedback: lambda sensor, knock sensor, boost pressure, wheel speeds.
- Driver demand: pedal or throttle position, switches for clutch, brake and map selection.
On the other side are the actuators: injectors, ignition coils, throttle motor or idle valve, the wastegate solenoid or motor, the cam phasing solenoids and the fuel pump. To drive an actuator accurately, the ECU needs its characteristics: flow and dead time for injectors, the curves of its position sensors for a throttle body.
From air quantity to injector pulse width
To hit a given mixture, the ECU has to know how much air is entering the cylinder. HP Academy describes the calculation in four steps: determine the air mass, derive the fuel mass needed for the target lambda, determine the time available in the engine cycle and finally calculate the injector pulse width.
There are three ways to handle the first step. Factory ECUs usually measure air mass directly with a mass airflow sensor. According to HP Academy, standalone ECUs usually calculate it using the speed density principle from manifold pressure, intake air temperature, rpm and volumetric efficiency. With individual throttle bodies, throttle position serves as the load signal, which is called alpha-N.
An example: on a turbo engine with a common plenum, manifold pressure follows load and speed density suits it. On a naturally aspirated engine with individual throttle bodies, according to HP Academy, pressure after the throttles can reach atmospheric from as little as 30 per cent throttle. Above that, pressure says little about load, and throttle position takes over.
Tables and corrections
The core of every calibration is the table: rpm on one axis and load on the other. The most important ones are the VE table, the ignition table and the target lambda table. The ECU interpolates between breakpoints. HP Academy therefore recommends a few well-placed breakpoints rather than a very fine grid that only creates more work.
On top of these base values the ECU applies corrections. Intake air temperature corrects for air density, coolant temperature controls cranking fuel, post-start enrichment and warm-up. Then there are corrections for system voltage, fuel pressure, ethanol content and acceleration. Every correction is a small table of its own, and each one can cause a deviation that looks like an error in the main table.
This leads to a fixed order: first sensors and component data have to be right, then the main tables, and only then the corrections. If you tune out a deviation in the VE table that really comes from wrong injector data, you will have a problem somewhere else later.
Open-loop and closed-loop control
Open-loop control means the ECU outputs a value from a table and does not check the result. Closed-loop control means it compares a target with a measured value and corrects. Almost every control loop in an ECU uses both. A base value from a table brings the output close to the target, and a PID controller deals with the rest.
Typical loops are lambda control through injector pulse width, idle control through airflow and ignition timing, boost control through the wastegate, position control of the electronic throttle and cam phasing. According to HP Academy, the cam phasing solenoid is driven at around 200 to 300 Hz, aiming for about half a degree of accuracy.
The same principle applies to all of them: according to HP Academy, the less work the controller has to do, the better the result. If a wastegate works poorly or the base table is wrong, the controller has to correct large errors and reaches its limits.
Protection and motorsport functions
A standalone ECU can protect the engine: rev limiter, manifold pressure limit, limits for oil pressure, fuel pressure, lambda and temperatures, and a limp mode when a sensor fails. Link also lists a shutdown on excessive system voltage, which protects the ECU and electronics against a faulty charging system or an incorrect jump start.
Then there are motorsport functions: launch control, anti-lag, traction control and flat shift. They all use the same tools, namely ignition or fuel cut, ignition retard, throttle and boost. They put much more stress on the engine and driveline than normal operation and are not intended for road use.
OEM flash or standalone
With flash tuning the factory ECU stays in the car and its software is modified. Factory functions are retained, but the software structure is set by the manufacturer. On the B58 in the GR Supra, for example, the software is torque-based: EcuTek describes tables for maximum desired torque per gear and rpm and load limits per gear. RaceROM adds map switching, freely assignable custom maps and the import of CAN sensors. I develop EcuTek software myself. By design, an EcuTek calibration can only be read by the tuner who created it.
A standalone ECU replaces the factory unit, either as a plug-in on the factory loom or as a wire-in with its own loom. The software is open, and functions such as launch control or traction control can be set up independently of the factory system. In return, everything the factory ECU used to handle has to be set up again, from the trigger to idle control. I always hand over calibrations for standalone ECUs unlocked.
How a calibration is structured
For standalone ECUs, HP Academy describes a process that starts with testing all inputs and outputs. Then come trigger setup, base table configuration, base ignition timing and fuel pressure, the first start, idle tuning, steady-state tuning of fuel and ignition, full-power tuning and finally a check on the road or track.
With me it starts one step earlier. In the component check we go through the installed parts using the enquiry form and resolve bottlenecks. From that a base map is built, with which the engine is started remotely or on site. Then come iterations of datalog and corrected calibration, ideally with the final fine-tuning on the dyno.
The order has a reason. Each stage assumes the previous one is right. Ignition timing cannot be calibrated properly while the mixture is wrong, and closed-loop lambda control cannot permanently rescue a poor VE table.
Terms: Engine management
- Anti-lag
- Anti-lag keeps the turbo spinning without load by heavily retarding ignition and adding extra fuel and often air. Anti-lag is purely a motorsport function and not intended for road use.
- Cam sensor and synchronisation
- The cam sensor tells the ECU which stroke a cylinder is on. Only with this signal are fully sequential injection and individual ignition without wasted spark possible.
- CAN bus
- CAN bus is a serial bus over which ECUs, dashes, sensors and modules exchange data. Two twisted wires replace many individual signal wires.
- Closed-loop lambda control
- Closed-loop lambda control compares measured lambda with target lambda and corrects the fuel quantity. Short-term trims correct immediately, long-term trims are learned permanently by the ECU.
- Crank sensor and trigger wheel
- The crank sensor reads a trigger wheel and gives the ECU engine speed and crank angle. Without this signal it can neither inject nor fire the coils.
- Data logging
- In data logging, the ECU or a logger records measured and calculated values over time. The datalog is the basis of every correction, especially in remote tuning.
- Drive-by-wire
- With drive-by-wire there is no mechanical link between pedal and throttle. The ECU reads the pedal sensor and positions the throttle with an electric motor in a closed loop.
- Flat shift
- Flat shift briefly removes engine torque on an upshift so the gear can be changed with the pedal held down. It is a motorsport function and not intended for road use.
- Idle speed control
- Idle speed control holds engine speed at a target with the pedal released. It controls airflow through an idle valve or the electronic throttle and adds a correction through ignition timing.
- Intake air temperature (IAT) and coolant temperature (ECT)
- The intake air temperature sensor provides the basis for air density, the coolant temperature sensor shows the engine’s operating state. Both are usually NTC thermistors whose resistance falls as temperature rises.
- Launch control
- Launch control holds a set engine speed during a standing start while the pedal is fully pressed, so every launch starts under the same conditions. It is a motorsport function and not intended for road use.
- Limp mode and engine protection
- Engine protection functions monitor values such as oil pressure, fuel pressure, lambda and temperatures and intervene when a limit is breached. Limp mode is a reduced-power operating state intended to prevent further damage.
- Load calculation
- Load calculation determines how much air enters the cylinder. There are three methods: speed density from manifold pressure, direct measurement with a mass airflow sensor and alpha-N from throttle position.
- Manifold absolute pressure sensor (MAP)
- The MAP sensor measures absolute pressure in the intake manifold. With speed density it is the main load signal, and on turbo engines it is also the feedback for boost control.
- Open loop and closed loop
- Open loop means the ECU outputs a value from a table without checking the result. Closed loop means it measures the result, compares it with a target and corrects.
- PID control
- PID control compares a target with a measured value and calculates a correction from three terms: proportional, integral and derivative. In an ECU it controls idle, boost, throttle and lambda, among other things.
- Plug-in and wire-in ECU
- A plug-in ECU connects to the existing loom in place of the factory ECU. A wire-in ECU gets its own or a modified loom.
- Rev limiter
- The rev limiter keeps engine speed below a limit by cutting ignition, fuel or both. According to Link, it protects against valve float and con rod failure.
- Tables and interpolation
- A table is a lookup in which the ECU reads a value against one or two axes, for example rpm and load. Between breakpoints it calculates intermediate values by interpolation.
- Traction control
- Traction control compares the speeds of driven and undriven wheels and reduces engine torque when slip exceeds a target. In a standalone ECU it is a motorsport function for track use and not intended for road use.
- VE table
- The VE table stores the engine’s volumetric efficiency against rpm and load. Together with manifold pressure and intake air temperature, the ECU uses it to calculate the air mass per cylinder.
More topics
- Fuel system
- Fuels & special systems
- Forced induction
- Ignition
- Block & bottom end
- Valvetrain & head
- Cooling & lubrication
- Intake & exhaust
- System design
Sources
- https://de.wikipedia.org/wiki/Motorsteuerung
- https://dealers.linkecu.com/G5-Voodoo-Neo-4
- https://hpacademy.com/courses/efi-tuning-fundamentals/how-the-ecu-works-the-speed-density-principle
- https://www.hpacademy.com/courses/efi-tuning-fundamentals/engine-principles-mass-flow-vs-air-flow/
- https://hpacademy.com/courses/efi-tuning-fundamentals/efi-components-load-calculation
- https://www.hpacademy.com/technical-articles/throttle-positionalpha-n-tuning-with-a-turbo-and-individual-throttle-bodies
- https://www.hpacademy.com/courses/efi-tuning-fundamentals/engine-management-system-tables-table-resolution
- https://www.hpacademy.com/previous-webinars/269-pid-tuning-explained/
- https://hpacademy.com/courses/boost-control/pid-control-explained-pid-control
- https://support.linkecu.com/learn/latest/product-features/features-engine-protection
- https://support.linkecu.com/learn/latest/product-features/motorsport-features
- https://ecutek.atlassian.net/wiki/spaces/SUPPORT/pages/382468112/B58+A90+Supra+RaceROM+Supplement
- https://linkecu.com/gt86-g5-ecu/
- https://www.hpacademy.com/courses/practical-standalone-tuning/getting-started-the-hpa-10-step-process