- knock_act function seems with MAJOR bug "if (kc->cnt){return;}".
So while advance timer count and engine knocking -> no retard applied and knock event skipped. For example advance_delay=100 (1.5sec), checking for knock will be ONCE in 1.5sek, all other events (even with knock_val above threshold) will be skipped. Condition should be moved to branch "if (knock_state == kc->state) {}" (if same state only, else change state and count from begin)
- Separate gain needed for each cyl, not channel, but cyl (h[3] for example)
- I tried intergator constant depended from rpm, data rise rapidly with rpm, so fixed constant works better.
- I think noise window should be dropped and replaced with noise map (same bins as VE table).
- I also tried to add additional condition for knock check. mean_val=mean_val*15/16+knock_val/16; if (knock_val>mean_val*configurable_constant) {KNOCK}
- Also i added separate noise reference values for each cyl (h[4] for example), so threshold value = noise map value * reference value. And selfcalibration for reference values and gain possible, average of knock values when 2000<rpm<2500 and map<30kpa. If too big or too small then change gain.
- I have dropped retard delay, because retard sould be at each knocking event without any delay.