hexandboost

home / articles / self-learning ignition, per cylinder

Build series · Engine intelligence

An ECU that learns its own ignition timing, one cylinder at a time

An ignition map is a guess made on one day, with one tank of fuel, in one kind of weather. The engine it was written for is slightly different tomorrow. I wanted the car to keep finding the right answer by itself.

What the factory system does

Honda's knock control on this engine is good at one thing. It hears knock in an individual cylinder and pulls ignition timing straight away.

It has two limits. It pulls timing from all four cylinders through a single number, so one cylinder that knocks holds back the other three. And it never remembers where the knock happened. It retards quickly, recovers slowly, and arrives at the same spot the next day just as surprised.

On a turbo engine that costs real performance. A small amount of knock at light throttle leaves the whole engine retarded when you put your foot down a few seconds later.

The layer I added

I did not replace Honda's knock control. It keeps running underneath as the safety net, with its limits untouched. I added a thin layer on top that remembers.

The layer keeps a small correction for each cylinder at each operating point, across a grid of engine speed and load from idle to full boost.

  • When a cylinder is clean, its correction creeps up by a quarter of a degree per visit.
  • When a cylinder knocks, that cylinder alone drops a full degree at once, and that spot is locked for a minute.
  • A spot that has knocked before is trusted less. It climbs more slowly afterwards and eventually stops trying.

Each cylinder finds its own limit. The other three are no longer held back by the worst one.

It only learns when the data can be trusted

Most of the design is about when not to learn. A visit only counts if the engine is warm, sitting steadily in one spot, with no gearshift in progress or just finished, no fuel or spark cut, the mixture on target, and Honda's own knock number not moving. It also checks that the intake air temperature is close to what it was when that spot was last learned.

The limits and fail-safes were written before the learning. A table that teaches itself the wrong thing is worse than one that does not learn at all.

Finding best torque

Where the engine does not knock, more timing is not automatically better. There is a point of best torque, and going past it loses power.

To find it the ECU runs a small experiment at light load. It gives two cylinders a little more timing and two a little less, then swaps them, and watches how hard each pair accelerates the crankshaft. Because both pairs see the same road, the same slope and the same load, those cancel out and what remains is the effect of the timing. A clear difference moves the timing half a degree. Two flat results mean the best point has been found, and that spot is frozen.

Fuel quality

The layer keeps two separate memories for two grades of fuel. If several spots start retarding within a couple of minutes, it concludes the fuel has changed for the worse and halves all of its advances at once.

What it actually learned

The learner first ran on the car on the evening of 11 November 2026. Its first act, at 2,000 rpm and light load, was to pull timing from two cylinders.

That set the pattern. Over the first evening it recorded 51 retards and 2 advances. When I made its findings permanent in the next file, there were 22 corrections, and every one of them took timing out. Most were between half a degree and three degrees. The largest were five and six degrees, at 2,000 to 2,250 rpm on light throttle. Four were one-degree trims under boost.

I had built a system expecting it to find extra timing. What it found first was that my map was too advanced in the part-throttle range, exactly where my logs had been showing most of the knock.

That is a result I am happy with. Removing that part-throttle knock means the engine arrives at full throttle with its timing intact, which is worth more than the degrees it gave up.

It also confirmed something about the engine itself. One cylinder took the deepest cuts every time, the same cylinder my balance tests had already flagged.

The night I took it off

Later that same evening a third-gear pull went badly lean at the top. I put the old file back on the car that night and stopped all learner testing.

The next day I traced it. The lean condition was in calibration shared by every file, and the ignition learner's own code produced identical fuelling to the file without it. It went back on the car on the morning of 12 November and has stayed. The full account is in the speed density article.

What I can and cannot claim

  • It works and it is on the car. It learns, it protects, and what it learns can be read out and written permanently into the next file.
  • I can feel the difference in how the car pulls. I do not yet have a clean before-and-after measurement to publish, and without a dyno I will not put a number on it.
  • The best-torque search is slow. It needs long steady stretches of road, and few of its tests have completed so far.
  • When I make the results permanent, I currently apply the worst cylinder's value to all four. Keeping them separate in the permanent file is the next step.
  • Live tuning from a laptop through the same channel is built in. I have not yet used it on the road.

Why it matters

A tune is normally finished the day the tuner closes the laptop, and from then on it slowly becomes wrong. This engine keeps checking its own timing every time it is driven, one cylinder at a time, and tells me what it found. As far as I know that is not something a factory ECU of this age was ever meant to do.

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.