OK first of all I strongly advise you to leave all the maps I will mention alone because you can cause serious damage to your engine if you change something and you don t know what you are doing !!!!
What I have read so far on Audi forums implies that hardly anyone knows how knock control works in a modern ECU so I will start with some basics first and then describe it based on a calibration workflow.
For a better understanding I will do some simplifications but if anyone has some deeper questions feel free to ask.
What is knock: When talking about knocking combustion you refer to the phenomenon that parts of the fuel/air mixture, that has not been reached by the flame front that was initialized by the spark plug, self-ignites due to the rising pressure/temperature in the combustion chamber. This causes pressure vibrations in the combustion chamber which leads to the characteristic pinging noise. The shockwaves (as well as normal engine noise) induce structure-borne acoustic oscillations that can be measured with a knock sensor.
How does knock detection work:
Main problem is to distinguish normal engine noise from knocking noise.
To do that the signal from the knock sensor is amplified, filtered and then integrated over a certain range after tdc (knock window) for each cylinder on each combustion cycle.
For calibration the engine is equipped with cylinder pressure sensors and an indication system to monitor knock while operated on an engine dyno.
As a first step you usually determine the knock windows which are KFMAKR and KEMLN in ME7 by letting the engine knock and log the cylinder pressures and Knock sensor signal.
The next step is to find a proper frequency for filtering the knock sensor signal that is least impacted by general engine noise. You identify this by a frequency analysis of knocking combustion cycles with 3D graphs that have the knock intensity and frequency as x and y and the knock sensor voltage as z (sorry can t upload an example for that). You can calibrate 4 frequencies (FMFKRBx) depending on rpm (NKRFMx) on ME7. On S4/RS4 files only one is used (12kHz).
When you have your knock windows and frequencies you can calibrate the noise levels that define the threshold between normal noise and knock. The values are calibrated for each cylinder separately in KFKEx depending on RPM and LOAD. They represent the quotient of the current integrator value to the reference level (ikr(x)/rkrmx).
The reference level for each cylinder is limited to the values in RKRMX1N and RKRMX2N. This two maps group the cylinders in quiet and noisy cylinders by a bitmask. The limit is used to ensure a good recognition under noisy engine conditions.
What is also taken into consideration is rate of change in load (KFELDY) and rpms (KFENDY) which is multiplied with the values out of KFKEx.
When Knock is detected the ECU retards the ignition angle with every knock even by the values in KRFKN/KRFKLN on the affected cylinder. When knock isn t present any more the ignition angle is phased back to normal with KRVFN/KRVFSN.
As you can see there is no easy way to link the knock voltage to how close you are to the knock limit as first of all it is dependent on the general noise level of every individual engine and second highly relative to the engine operation point and transient condition.