hexandboost

home / articles / self-learning fuelling

Build series ยท Engine intelligence

Self-learning fuelling

After six weeks of refitting the fuel table by hand from logs, I noticed a pattern. Every time I got it right, something changed: the weather, a fuel pump, the fuel itself. The table needed to look after itself.

Why hand-fitting was not enough

My speed density model depends on a table of how well the engine fills at each speed and pressure. I fitted that table from logged drives, and my own notes admit the result: the boosted part never settled. It ran lean, then rich after a new fuel pump, then close, with each correction resting on one or two drives.

There was also a day-to-day drift of 4 to 8 % that I could not explain. No fixed table can follow that.

How it learns

The ECU already knows the mixture it asked for. The car's own mixture sensor in the exhaust tells it what it got. The difference between the two, allowing for the time the exhaust takes to reach the sensor, is the error in the table at that operating point.

The same comparison works whether the engine is cruising under closed-loop control or at full boost in open loop, which matters because full boost is exactly where a normal fuel trim does nothing.

It learns two things:

  • A global correction, for errors that affect everything, such as fuel quality or pressure.
  • A correction for each operating point, applied to the fuel table itself.

Built to be biased toward rich

A lean mistake under boost can end an engine. A rich mistake costs a little power. So the learner is deliberately lopsided.

  • In one step it may add up to 5 % of fuel, and remove at most half of that.
  • Under boost it may remove only 1 % at a time, and only after three separate visits agree.
  • It only learns on a warm engine, with a steady pedal, away from gearshifts and fuel cuts, and only when the mixture sensor is reading inside its trustworthy range.
  • Once a spot stops changing by more than a percent, it is frozen.
  • If the underlying fuel table is changed, everything learned on top of it is thrown away.

It can also be switched between off, learning, and holding what it has.

What it has learned so far

It went on the car on 11 November 2026. From the first evening:

  • A global correction of about 2 % less fuel.
  • Three spots corrected and made permanent: two at idle, 5 % and 6 % rich, and one at light cruise, under 2 % rich.

That agrees with what I already suspected from the logs, that my table was 3 to 7 % rich at idle and cruise.

It has not yet learned any boosted cells. Given the rules above, it needs repeated, steady, clean visits to the same boosted spot before it will touch one, and that takes a lot of driving.

A mistake worth admitting

On the first evening the global correction was learned at idle and then applied everywhere, including under boost. Taking 2 % of fuel out at full boost because the idle was rich is the wrong conclusion.

That same night the car ran lean at the top. The main causes were elsewhere in the calibration, but my own analysis put 2 to 4 % of it on this. I did not make that global correction permanent, and the boosted cells were made richer the next day.

I include this because it is the real risk of any self-learning system. It will faithfully learn the wrong lesson if you let it generalise too far.

Where it stands

The fuel learner is on the car and running alongside the ignition learner. Idle and cruise are noticeably cleaner. For the boosted range, the honest position is that it is in place, it is cautious by design, and I do not yet have enough driving on it to show what it has achieved there.

By Haris, Hex and Boost.

Have a car the usual tools cannot touch?

Tell me the car, the engine, the gearbox and what you want it to do. I reply to every serious enquiry.