How fuel trim works: the engine model
Every case comes from one engine model. Nothing is a lookup table of trim numbers: a fault changes one physical quantity, and every reading follows from it. This page writes the model out so an instructor or a reviewer can check each step.
What a fuel trim is
The module works out the fuel it thinks the engine needs, then corrects it. The correction is the trim. Short term trim (STFT) reacts within a second to the upstream sensor; long term trim (LTFT) learns whatever STFT keeps having to do, so STFT can return towards zero. What matters for diagnosis is the total, STFT plus LTFT, per bank and per load cell. Positive means the module is adding fuel because the sensor says lean; negative means it is taking fuel away.
A trim never says what is wrong. It says the module's arithmetic and the engine disagree, and by how much, in each cell. The shape of that disagreement across idle, 2,500 rpm and cruise, and what the MAF, the sensors and the coolant reading say alongside it, is what points to a fault.
Step 1: how much air the engine draws
A four stroke engine fills each cylinder once every two revolutions. The mass of air it draws is:
air (g/s) = VE x displacement (L) x rpm / 120 x MAP (kPa) / (0.287 x IAT in kelvin)
VE is volumetric efficiency relative to manifold density. The units fall out in grams per second directly, because a litre times a kilopascal divided by kilojoules per kilogram is one gram. A warm 2.0 L at 750 rpm and 30 kPa draws about 3 g/s. This is the speed density estimate, and the airflow check in every case divides the MAF reading by it, using the reference VE below, so you can redo it with a calculator.
| Cell | Reference VE | IAT (C) | Speed (mph) | Purge command (%) |
|---|---|---|---|---|
| Idle | 0.72 | 38 | 0 | 0 |
| 2,500 rpm, no load | 0.74 | 35 | 0 | 20 |
| Cruise | 0.84 | 30 | 60 | 35 |
| WOT snapshot | 0.9 | 29 | 45 | 0 |
| Engine family | rpm idle / 2500 / cruise / WOT | MAP kPa | Healthy air g/s |
|---|---|---|---|
| 2.0 L inline four, narrowband upstream sensor | 750 / 2500 / 2100 / 5000 | 30 / 22 / 42 / 97 | 3.0 / 7.7 / 14.2 / 83.9 |
| 2.5 L inline four, wideband air fuel sensor | 700 / 2500 / 2000 / 5000 | 29 / 22 / 40 / 97 | 3.4 / 9.6 / 16.1 / 104.9 |
| 3.5 L V6, dual bank, wideband air fuel sensors | 650 / 2500 / 1800 / 5000 | 30 / 21 / 38 / 97 | 4.6 / 12.8 / 19.3 / 146.8 |
| 5.3 L V8, dual bank, narrowband upstream sensors | 600 / 2500 / 1600 / 4500 | 28 / 18 / 34 / 97 | 6.0 / 16.6 / 23.2 / 200.1 |
Step 2: the fuel the module meters, and what arrives
fuel commanded = (MAF + expected purge air) / 14.7 x enrichment x (1 + trim) - expected purge vapour fuel delivered = fuel commanded x sqrt(rail pressure / rated) + injector drip + purge vapour
The module meters from the air it measured, at the stoichiometric ratio of 14.7 to 1. Enrichment is 1 on a warm engine and rises by 0.0022 for each degree C the coolant reading sits below 80 C. The square root is how an injector behaves: flow through a fixed opening goes with the square root of the pressure across it. Unmetered air, a leak or the purge stream, is part of the true air but never part of the MAF reading.
Step 3: trim is the correction closed loop finds
actual lambda = true air / (14.7 x fuel delivered) gas lambda = actual lambda x (1 + exhaust leak air share) sensor lambda = gas lambda x (1 + misfire share) x sensor bias
In closed loop the module moves the trim until the upstream sensor reads lambda 1, so the model solves for that trim directly. The total is limited to plus or minus 25 percent; beyond that the module runs out of authority and the sensor is left reading lean or rich. At WOT the module runs open loop, commands lambda 0.85, applies the long term trim it learned at cruise, and the sensor reports whatever it sees.
The downstream sensor reads the gas after the converter. With the engine held at stoichiometry the converter flattens it to a steady 0.6 to 0.7 V. If the engine is rich overall, as it is when a biased sensor or a misfire fools closed loop, it sits near 0.85 V. An exhaust leak mixes its air in before both sensors, so the downstream sensor sees the same stoichiometric gas the upstream sensor was driven to.
Codes follow simple rules: a lean or rich code when a bank's total trim reaches plus or minus 20 percent, a misfire code for a cylinder with 20 or more misfires per 1,000 revolutions, and a cold running code when the coolant is below 80 C at cruise. The freeze frame is the cell where the first code set, or warm idle when there is none.
Reading the cells: fuel trim against load and airflow
Fuel trim only means something when you know which operating point it was taken at, so every case reports it in cells: idle, 2,500 rpm with no load, and a steady cruise, plus a WOT snapshot in open loop. The cells are ordered by airflow, the grams per second the engine draws, because that is what decides how big a fixed error looks. Calculated load does not follow the same order: at 2,500 rpm with no load the throttle is nearly shut, manifold pressure is lower than at idle, and calculated load is lower too, even though airflow is more than twice as high.
| Cell | rpm | MAP (kPa) | Calculated load (%) | MAF (g/s) | Vacuum leak total trim (%) |
|---|---|---|---|---|---|
| Idle | 750 | 30 | 20.7 | 3.02 | +14.9 |
| 2,500 rpm, no load | 2500 | 22 | 15.6 | 7.61 | +5.4 |
| Cruise | 2100 | 42 | 34.4 | 14.09 | +2.8 |
Read the last column against the MAF column, not the load column. The leak adds +14.9 at 3.02 g/s, +5.4 at 7.61 g/s and +2.8 at 14.09 g/s: it shrinks steadily as airflow rises. Sorted by calculated load instead, 2,500 rpm would come first and the pattern would look broken. A fault whose error is a fixed mass (a leak, a drip) falls with airflow; a fault whose error grows with flow (a weak fuel supply, a MAF losing signal) rises with it; a fault that scales everything (fuel pressure, a MAF gain error, a coolant reading) stays flat.
- Common mistake: comparing trims from two cells taken at different engine temperatures. Only warm, closed loop cells compare.
- Common mistake: treating 2,500 rpm with no load as a loaded cell. It is a higher airflow cell with a lower load, and the drill's chart plots it between idle and cruise for that reason.
- Common mistake: reading one cell. A trim at idle alone cannot separate a leak from a sensor bias; the second and third cells can.
- More on the arithmetic: MAF grams per second per litre and long term vs short term fuel trim.
Step 4: what each fault changes
One physical quantity per fault, at its clean reference size. Everything else in a case follows from the steps above.
| Fault | What changes in the model |
|---|---|
| Vacuum leak | An orifice from the atmosphere into the manifold, sized so it flows 13 percent of healthy idle air. Choked below the critical pressure ratio, so the same mass at idle, 2,500 and cruise. |
| EVAP purge valve stuck open | The purge valve open all the time. Its full flow is 10 percent of healthy idle air, carrying 0.123 g of fuel vapour per gram of air (a loaded canister). Only flow beyond the commanded duty is a surprise to the module. |
| MAF under reporting | The MAF reports metered air times (1 minus (0 + 0.26 x square root of flow over healthy WOT flow)). |
| MAF over reporting | The MAF reports metered air times 1.1. |
| Restricted exhaust | Volumetric efficiency falls by 0.25 x (flow over WOT flow) squared x (baro over MAP). Off WOT the throttle opens to hold airflow, so MAP rises; at WOT airflow falls. |
| Restricted fuel filter or weak pump | Rail pressure over rated = 1 minus k x fuel demand squared, with k set so the drop at healthy cruise demand is 12 percent, and a floor of 0.4. |
| Fuel pressure too high (regulator stuck closed) | Rail pressure 25 percent above rated in every cell. |
| Leaking injector | One injector passes a constant drip while shut, sized so its bank's idle trim moves 12 percent. The drip only flows for the part of each cycle the injector is closed. |
| Exhaust leak upstream of the upstream sensor | Air drawn into the exhaust ahead of the upstream sensor: 12 percent of the bank's flow at idle, scaled by (idle flow over flow) to the power 0.8, and none at WOT. |
| Upstream O2 or A/F sensor biased lean | The upstream sensor on one bank reports lambda 1.07 times the gas it sits in. |
| Single cylinder misfire | One cylinder fails to burn 24 percent, 12 percent, 18 percent, 20 percent of its events in the four cells. The unburned charge reads as oxygen at the upstream sensor. |
| ECT sensor stuck cold | The coolant reading is frozen at about 38 C (the noisy tier draws 28 to 48 C). The coolant itself is at 90 C. |
| Thermostat stuck open | The coolant runs 16 C, 17 C, 26 C, 24 C below 90 C in the four cells. |
The tiers, and how a case is made
A case code such as C-XX-1A2B3C names the tier, the fault family and a seed. The seed fixes the answer, the engine, the fault size and the noise, so a code gives the same case on every screen.
- Clean: fault size 0.9 to 1.1 times reference, short term trim noise of 0.5 percent, engine to engine VE spread of 1.2 percent.
- Noisy: fault size 0.6 to 1 times reference, trim noise of 1.8 percent, VE spread of 3.5 percent, long term trim only partly learned, stray single misfire counts. A draw whose fingerprint the noise erased is redrawn, so a noisy case is always answerable.
- Two faults: one mixture fault plus one with its own signature (misfire, a coolant fault, or a restriction). Judged on the combined data you see: the mixture fault's whole fingerprint must hold, the second fault's signature must show, and no single fault outside the pair may fit the data. A draw that fails is redrawn. Pairs where one fault always hides the other are left out of the tier.
Noise goes into the operating point (rpm, MAP, IAT), so the MAF follows it the way it would on a running engine, and a little measurement noise sits on the MAF itself. Engines run at sea level, 100 kPa barometric pressure, fully warm unless a coolant fault says otherwise.
What the model leaves out
- Long term trim is learned per load cell. Some strategies learn one value for the whole range.
- There is no downstream fuel trim correcting the upstream sensor.
- Healthy purge is accounted for exactly. On a real engine purge moves the trims a few percent on its own.
- A vacuum leak and the PCV path are treated as one fault. A leak in the PCV hose, a cracked grommet or an open oil filler is unmetered air and gives the same data as any other vacuum leak, so they are not separate cases.
- No altitude, no fuel with ethanol, no transient tip in enrichment, no cold start.
- Bank 1 holds the odd cylinders and bank 2 the even ones. Real engines number their cylinders in several ways.
TrimCase is a training aid built on a simulated engine model. It is not a diagnostic instruction for any real vehicle. The model has 13 faults and a control, and a test proves that at the clean tier each fault's fingerprint matches its own cases and no other on 500 seeded cases. Rated coolant temperature in the model is 90 C and barometric pressure 100 kPa.
Frequently asked questions
Why is calculated load lower at 2,500 rpm with no load than at idle?
Calculated load compares the air per intake stroke with the most the engine could draw. With no load the throttle is nearly shut at 2,500 rpm, manifold pressure drops below its idle value, and each stroke draws less air, even though more strokes per second mean more airflow overall.
Should fuel trim be read against load or airflow?
Against airflow when you are judging how a fixed error scales. A leak or a dripping injector is a fixed mass, so its share of the total, and the trim that corrects it, falls as airflow rises.