Knock Level Peak Error with Cylinder Noise Corrections

I have been tuning the knock strategy on my Mini Cooper R53 and have repeatedly observed small knock-threshold crossings produce maximum ignition retard. I have reproduced this on firmware V3.066 and V3.068.

The ECU appears to detect knock against the corrected Knock engine noise cyl # threshold which contains the cylinder noise correction, but then calculates Knock Level Peak using the higher, uncorrected shared Knock engine noise value. If a cylinder peak is above its corrected threshold but below the shared threshold, the subtraction appears to underflow as an unsigned 8-bit value:

(peak_raw − shared_noise_raw) mod 256

This produces a value near 255, which is interpreted as approximately 5 V and can command maximum ignition retard from what was actually a small threshold crossing.

A clear example occurs at approximately 22.40 seconds in the attached cropped log. The triggering cylinder 3 values appear in the preceding frame of the log:

  • C3 peak: raw 75 = 1.471 V
  • Corrected C3 noise threshold: raw 67 = 1.314 V
  • Shared engine-noise threshold: raw 83 = 1.627 V

C3 legitimately exceeded its corrected threshold, but only by:

75 − 67 = 8 counts = 0.157 V

With my configured retard rate of 4°/V, this represents approximately 0.63° of requested retard for that event.

Instead, Knock Level Peak was reported as raw 248, or 4.863 V. That value exactly matches unsigned subtraction against the shared threshold:

(75 − 83) mod 256 = 248

248 × 5/255 = 4.863 V

At 4°/V, this calculates to approximately 19.45° and is therefore clamped to my configured 15° maximum. The log then shows C3 asserted, the knock count incremented, and C3 retard at 15°.

The problem does not appear to be the cylinder assertion itself. The evidence suggests that detection uses the corrected cylinder threshold, while severity is calculated using the uncorrected shared threshold with unsigned 8-bit subtraction.

I might be able to get around this by disabling the cylinder corrections (setting all zero) but there is value is using the corrections because cylinders 2 and 3 and much less noisy than 1 and 4 on my engine.

knockErr3068.emublog3 (65.2 KB)