Knock sensing Code Update request

Forum for discussing how to install MicroSquirt(TM), choose and troubleshoot sensors, wiring, and communications for MicroSquirt (TM) and MicroSquirt Module(TM).
Forum rules
Read the manual to see if your question is answered there before posting. If you have questions about MS1/Extra or MS2/Extra or other non-B&G code configuration or tuning, please post them at http://www.msextra.com The full forum rules are here: Forum Rules, be sure to read them all regularly.
Post Reply
hwright
MegaSquirt Newbie
Posts: 21
Joined: Sun May 18, 2008 2:43 am

Knock sensing Code Update request

Post by hwright »

Hi,

I am looking to try out the knock sensing algorithum on my motorbike. However the current settings only allow for <6000 RPM in the knock threshold table. And < 10000 RPM in the settings menu.

Can this be reset to something higher (15000 RPM?) My bike revs to 13500 RPM. Searching on the web I think a better result can be obtained by having the thresholds adjustable over load (MAP) aswell as speed, perhaps 4 MAP bins. Also OEM ecu's adjust for knock over the whole rev range, in areas where the engine is knock limited.
Can the signal also be averaged also only at a specific angle after a ignition input has fired? For example, only run the code for this function between 20deg and 60deg after ignition (calibratable). To get technical this could also then be cylinder specifc (sequencer!!) but probabily not nessicarry at first.

Cheers.
grippo
MegaSquirt Guru
Posts: 921
Joined: Mon Feb 16, 2004 6:55 pm

Re: Knock sensing Code Update request

Post by grippo »

What you want is something that will fall out of the sequencer, or more likely what will follow the sequencer, since the current processor is getting overloaded. However, I am wondering how accurate knock sensing is at high rpms where the noise background is horrendous. A system can certainly be designed for a specific engine, but to get it right for any engine requires a lot of work. We haven't decided yet the best way to go on this. Standard knock sensing, ion sensing and time series analysis are among the possible choices to detect knock and misfire.
hwright
MegaSquirt Newbie
Posts: 21
Joined: Sun May 18, 2008 2:43 am

Re: Knock sensing Code Update request

Post by hwright »

I'm not sure how feasable ION sensing would be on a platform like megasquirt as that could be even more engine specific.
I read more on the subject of conventional knock sensing after posting the message and it appears that the way that alot of the knock sensor detection algorithums work is something like this.

1. Use a broadband knock sensor
2. Adjust a bandpass filter to only allow frequencies at the knock frequency of the engine. (calculated from the bore diameter)
1b 2b. If the factory sensor is already tuned for that engine just use that input.
3. For each cylinder define a knock window in crankshaft degrees where the engine is likely to knock. This can be adjustable depending on RPM and load for maximum effect. The maximum knock sensor voltage is captured during this time.
4. Outside the window(s) the knock sensor voltage is averaged.
5. Compare the difference between the maximum and the average to calibrated values to determine knock intensity.
6. Take action depending on the intensity.

The problem I can see is that on multiple cylinder engines there is not much time between firings to average the knock values. Perhpas that's why V8's and some 6's have two knock sensors. However for a 4 cyl or less there should be plenty of time to look for knock and average the signal. Another strategy could be to average the signal in coast conditions where there is no knock.

There are others that use a dignital signal processor to analyse the frequency spectrum from the broadband knock sensor directly, however these are expensive and probabily not an option for mega/microsquirt.

Anyway. Can you make the changes to the range of the calibration values anyway so I can try the existing algorithum?
grippo
MegaSquirt Guru
Posts: 921
Joined: Mon Feb 16, 2004 6:55 pm

Re: Knock sensing Code Update request

Post by grippo »

The knock rpms in the existing program can go as high as you want. To enter the data you need to change the limits in the MT ini file. Each variable has a scale factor and upper and lower limits. If you search for the knock variables (knk_ prefix in the code) you will see the knock rpms and the present limits. Just increase these to what you want. Save the original file before changing it so you can roll back if something goes wrong.
Post Reply