First I want to mention, that unfortunately you can t directly see the activities of the adaption with the variables you can log with ECUx, VCDS as the corresponding ones are not included. Easiest would be to have the proper A2l but maybe the software disassembling guys will dig them up some time
I ll again simplify some stuff for better understanding.
What you see in the logs is the variable dwkrz(x) which is the delta ignition angle that is passed on to the ignition module in the software. Depending on operating conditions it can represent different variables.
Most important one is when knock control is active (not meaning that it pulls ignition angle but that it s not inactive due to cold engine(TMKR), low load(LKRN) for example), it s not in idle control and there is no safety retard due to failures for example in the knock sensor ciruit: dwkrz(x) = wkr (x)
wkr(x) is the RAM area where the ignition retards are summed up for each cylinder.
Without adaption knock control retards the ignition angle individualy for every cylinder by KRFKN(KRFKLN in stationary mode) with every recognized knocking cycle and sums it up in wkr(x).
wkr(x) is limited to KRMXN (which is the max value incl. adaption) on retard and 0 on advance of ignition.
For advancing the values in wkr (x) back to 0 the counter zkrvf(x) is used. It is initialized on every knocking cycle with the values out of KRVFN which controls how fast the ignition is phased back to normal. For every non knocking cycle were the ignition angle is limited due to knock control activity, this counter is decremented by 1. When the counter is 0 the ignition angle is advanced by 1 degree and reinitialized with KRVFN.
Now the adaption comes into play. The map for the adaption values in RAM is wkra (x). The axes are load (KRALx) and RPMs (KRANx).
How does the adaption learn the values:
When adaption is active ( TCO>TMKRA + knock control is active) and writing into the adaption map is not forbidden due to rl < LKRAN, TCO<TMKRAS, N<NKRAMIN, N>NKRAMAX, ASR, VMAX,NMAX, then the values of wkr(x)+KRDWKLA (which is 0 on S4/RS4) is written into the adaption map if the value is more retarded than the saved value in wkra(x).
If the current ignition retard in wkr(x) is more than KRDWA earlier than the stored value in wkra(x) and zkrvf(x)=0 the value in the adaption map is advanced by KRDWSA.
How are the adaption values used for ignition angle calculation:
As already mentioned the variable that influences ignition calculation is dwkrz(x) = wkr (x).
The values of wkr (x) are overwritten with the values out of wkra (x) when the adaption is active (conditions see above).
Summed up:
What you see in your logs are applied ignition corrections of the knock control including adaption values. The maximum retard due to knock control is limited to KRMXN! If you learn high adaption values it will take the adaption quite a while to get ign <back to normal>.
The mean value of the last 6 ignition corrections dwkrz(x) due to knock control also influence the max. allowed load in LDRXN. It has a long term adaption which becomes active above RLKRLDA.
The correction factor for LDRXN can be found in KFFLLDE. How fast the adaption works can be influenced by TLKRLDAB and TLKRLDAU.
If there are any specific questions just feel free to ask.