Knock Sensing
BMW M102/M106 engines (similar to M30 + turbo) are factory equipped with two knock sensors. I'm trying to utilize them...
- Unfortunately at the moment there's only support for one sensor at-a-time in firmware. I'd definitely like to utilize both of them in the future, but for now I need to stick with the second one which is located between cyl. 5-6. It is the well-known place of knock, more than the first sensor location, since cyl.6 is the hottest one.
PLAN
How to set up the characteristic knock frequency?
Bore is 92mm, so r=46mm.
1. Theory
The expected knocking frequency is around 900/(pi*r) = 900/(3.14*46) = 6.2kHz
See TPIC8101 datasheet (using 4 MHz crystal; for reference, 0x29 = decimal 41 = appr 7 kHz)
2. Experience
* record the knock-sensor output with notebook soundcard while knock sensor is connected (with a 50k series resistor) to the microphone input of a laptop.
- recommended: cling the block with a wrench when engine not running. Record the sound from the knock-sensor with your notebook sound input
counterrecommended:
- adjust the ignition advance (usually upto 36 degrees in 4..5 steps) at idle until slight knock happens.
* note that the MAP should be low, 25..40 kPa (max 55kPa), otherwise the engine is endangered. RPM also low (<1500 RPM).
* play back the sound after the engine stopped. You'll be surprised how well the ping sound can be heard without the loud exhaust sounds.
* just read the characteristic frequency from the FFT diagram.
Config
From TPIC8101 datasheet config value 39 stands for 6.37kHz, which is probably close to current typical knock freqency.
* from global.h: uint8_t knock_conf; // knock, config. bit0 o FF means knock2... ??
o FD means knock1... (DEFAULT!)
# Overall System Settings
# Knock selection
knock_conf = FF # enable knock-detection, will use Channel2!
knock_sampling_window = e2 # ???
# Use knock sensing in this RPM range
# FF for both means no knock sensing/control???
knock_minrpm = 05 # FF=No minimum RPM. 0x01=100rpm
knock_maxrpm = FF # FF=No maximum RPM
knock1_frequency = 27 # dec 39, 6.37kHz
knock1_gain = 40 # ???
knock1_integrator = 14 # ???
knock2_frequency = 27 # dec 39, 6.37kHz
knock2_gain = 40 # ???
knock2_integrator = 14 # ???
# Trigger level
knock_threshold = 50 # ???
knock_noise_scale = 10 # ???
# Ignition effects
#
# Knock getting louder
knock_max_retard = 50 # 20 degreees, 0x01=0.25 crank degrees. knock_default_retard = 10 # *0.25 crank degrees.
knock_retard_step = 08 # 3.2 degrees
knock_retard_delay = 10 # 0x01=15ms Retard delay.
# Knock getting softer
knock_advance_step = 02 # *0.25 crank degrees.
knock_advance_delay = 10 # 0x01=15ms
I'm totally lost with these config values. Couldn't find any usable info for those ??? values. Any idea?
See lcd_display.c for the displayed knock values.
Most importantly: lcd_knock_diff ("d:...") and you'll see that increasing gain increases this. We like to set gain so above d:100 means knock. There are no sharp limits here.