Mazda MX-5 Miata banner

Knock Windowing - Lets Have Some Brainstorming

4K views 34 replies 8 participants last post by  skinny 
#1 ·
MS3 offers full knock windowing. However I haven't the first clue of how to set it up, or how to tune it.

Setting this up properly will hopefully make detonation detection that more reliable on our cars. Also hopefully the settings should be pretty universal engine to engine.

Here is the link to MS3's knock sensors settings / it's manual

http://www.msextra.com/doc/ms3/ignition-settings.html#knock

and this is the knock windowing settings graph.



So what's the best way to go about setting this up? I can log knock noise per cylinder and post up logs if it helps.
 
See less See more
1
#2 ·
I am extremely interested in this too. and it is something I was planning on implementing this spring/summer while i refresh some of my engine / wiring so I'm well up for some research / testing on it.

Are you using / going to be using the Internal variable module? I'm guessing you are seeing as you're wanting to discuss the windowing.
Last I read they weren't available, thats why i put it on the back burner... but thinking about it, that was 12 months ago now!
 
#3 ·
The example they give samples noise from 0° to 20° ATDC. I'm not sure, but it seems that the value it outputs is a peak reading taking into account the integration time you set elsewhere.

I would probably start by measuring typical noise levels when you're confident there's no knock and gradually increase the window size until the values rise because it's picking up valvetrain noise.
 
#4 · (Edited by Moderator)
Thanks Martin.

I partly ask as with no knock present my engine is extremely noisy, on a 0 - 100% scale at peak RPM's the noise is around 90%, this is utterly useless really as knock seems to occour and great a noise spike at about 70% or so.

At the minute I have no windowing occouring and just have a noise threshold, the threshold increases as noise increases, but ideally I'd want the windowing to happen properly, so there is far less background noise. (Unless i'm missunderstanding how this all works).

Yeti, the module is freely available from DIYAutotune now



http://www.diyautotu...-kit-p-522.html

As is the RTC - handy for SDCard logs to be timestamped.
 
#11 ·
Been up 20 long hour's but this has my attention.

Is this the 1st time ms has had filtering then? That ought to quieten downs mr slows background to simple valve train tapping. That would leave windowing as a means to separate knock from valve noise by timing? Or is it more about noise strength and degree's(which is too standard to of got a thread knowing you guys)
 
#12 · (Edited by Moderator)
Yes, I double checked what windowing was in terms of number crunching and I'm most likely on the right track.

What did you want to know though? It's (Edit:probably) a means to tell the knock sensor when to listen. Just when knock occurs will be down to a few variables. It's best to read it. Martin is the kind of man to have a scope? You need to(edit:Could) look at the knock sensor under knock conditions to see the spikes in real time, while a second trace us used to watch something tdc can be calculated from. Perhaps the ms tach signal actually is tdc, I dunno.

Perhaps that's useful, and omg that's my beer timer!!! It's cold


Edit, For half missing words. In my defence, My beer was ready

edit: Det detection? That would be in another window to knock. No reason not to have lots of windows for different reasons I guess
 
#14 · (Edited by Moderator)
In the pic's, They expect that at all rpm's knock will occur between tdc and 20 degree's atdc.
That seems a little unlikely

Edit: I should of looked at the pic's before. This is a much easier explanation, If it's any good to you
 
#18 · (Edited by Moderator)
The green line up the axis is the tail for the green blob. The green blob is a realtime marker, very useful for when you're on a dyno as it tells you where you are when the engine is running, it's not a mistake.

Kpa is Kilopascal an absolute reference of pressure

So Rev is also talking about windowing, he's saying to use my current ignition timing table numbers at 70kpa as the start window time, that's from 7deg BTDC at 1000 rpm to 37degBTDC at 7000rpm.

Rev, I've done this this morning, I'll post up a before/after log of the knock sensor noise and see if there is any improvement
 
#20 ·
I'm glad you know how to set it up now. Chapter closed


70kpa is 10psi, that's what I hadn't worked out. It was a statement about doing things in order. Only now is it time to work that out.

Wont the ms log knock events against position and rpm? Once you have the bandpass filtering in place the logs might look a whole load better. Then you can see what's right.

Thanks for the green blob info. Makes perfect sense don't it. It's just not what I needed at the time.
 
#21 · (Edited by Moderator)
I'm glad you know how to set it up now. Chapter closed
Not really, I sort of new how to set it up, it's tuning it to the correct parameters that this thread is about.

70kpa is 10psi, that's what I hadn't worked out. It was a statement about doing things in order. Only now is it time to work that out.
Kpa is an absolute reference. 70kpa is 4psi below the ambient pressure of 14psi. 100kpa is atmostpheric or WOT with an n/a car. 170kpa is 10psi of boost

etc.

Wont the ms log knock events against position and rpm? Once you have the bandpass filtering in place the logs might look a whole load better. Then you can see what's right.
MS logs look like this, it's a noise level, all the filtering has been done at this point, it's all logged post capture.
Ignore the solid blue line, I pulled the image from Google.
 
#22 ·
Oh my head. I got 5 hours at best. Been up 8 and just want to go back. I will have to look again when I'm feeling fresher. What I need is not there, or not immediately obvious. It's related, but not right.

Oh.. it is there but takes some calculating. The window is positioned in relation to tdc, which is not there, but there is timing information.

It's not like the Emanage blue is it...
I'm going to sit back for a bit.
 
#24 · (Edited by Moderator)
Hi Richy,

not sure if we can help!

The top widow is the settings you use to start the Knock detection (say approx 10-15 degrees after the spark event) and the second window is how many degrees after the start you want the detection to last for.

To work out the correct windowing you need to look at your ignition map - if your engine fires the spark plug at 32 BTDC then start listening a bit later - detonation normally occurs around TDC to a fair few degrees after. I would probably start listening approx 15 degrees after the spark event had occured - so in this scenario say at 3000rpm I wouldlisten from 15 degress BTDC and finish listening at 20 degrees ATDC

Knock normally occurs under high load lower RPM's (NA) - so look at your ignition advance under the high load sites and pick the highest ignition timing event from the 3D ignition table then add a few degress from this to start the window. (eg - 27 deg. BTDC + 15 degrees = 12 deg. BTDC)

You then need to work out the knock frequency for the Mazda block itself - this is the hardest bit to do but like the manual states there are calculators online. Each type of engine block has a different resonant frequency - much like a tuning fork. This is the frequency the controller will listen for and should fillter out extrenuous noise.

You then need to input the knock count before the system activates - I would start with a figure of around 40. There will be 'stray' knock counts even on an engine that is running without knock.
(the larger the knock window the higher this setting will have to be but you need the knock window to cover the crankshaft rotation where knock can occur.

HTH
 
#25 ·
Brilliant reply, many thanks BLiNK!!

For reference this is what my knock output looks like with the settings from a non tuned basemap:



Yesterday I created this from Reverants guidelines:



Which resulted in this rather surprising result..... I was hoping for less on the graph, but literally nothing is very surprising, surely there must be some noise during these windows?



I'll set up a new window curve based on BLiNK's advice tonight and see what happens on my commute tomorrow
 
#30 · (Edited by Moderator)
That's a real shame Richy that the hardware is letting you down at the moment.

I will explain a few things in the following post (Richy I know you will know most of it and will be like teaching my Grandmother to suck eggs but hopefully it will benefit others reading this thread that might not have the same knowledge)

Before I start can I first explain that as engine tuners we have knowledge of what makes an engine work and what doesn't - the theory behind mapping an engine is actually quite simple but it must be appreciated that there are numerous different ECU's on the market and every single one has it's own idiosyncrasies - to have a very in depth knowledge of each one is impossible and to be fair, people like Richy and Reverant know far more about the Megasquirt systems then we will ever know or need to know.

Having said this the tuning theory applies to all after market ECU's - that the main fuel and ignition tables need to be correct before any other tuning can take place - all ECU''s use these tables to calculate the fuel/spark events - all the other corrections are multipliers or subtractors/adders etc.

A vehicle manufacturer will spend over six months correcting Idle, warm up enrichments AE adjustments etc - as engine mapper's it is impossible to spend this much time on these features (unless the customer has vey deep pockets indeed!) - hence you will get correct main tables and generic settings in other tables that are very useable but probably not perfect for each individual instal.

Now I've explained that bit lets move on to the knock windowing:

When mapping a vehicle we use audible knock detection - the human brain is an amazing organ and can detect knock on any engine no matter what frequency - it hears an abnormal sound in amongs all the other engine assosciated noises and recognises it as engine knock - unfortunately the ECU isn't nearly as clever so we need to tell it exactly what to listen for for the knock detection to work.

It is like sitting at home waiting for a delivery of a new MX5 part - if the delivery company tell you it will arrive between 1-2pm you know if the doorbell rings outside these times it is unlikely it will be your MX5 part! (Could be the cute blonde from next door though!)
So, we tell the ECU to 'listen' only when the event is most likely to happen so it can filter out the other 'garbage' that is unlikely to be engine knock.

Abnormal Combustion:

Firstly we need to know what normal combustion is! In a four stroke engine the firing of the spark plug should start the combustion process. The fuel/air mixture does not explode but burns in a controlled manner and propagates across the top of the piston. Whilst this is occurring a boundary layer of gas builds up on top of the piston and all other surfaces, this boundary layer protects the surfaces from the extreme heat of combustion and stops them melting.
As this mixture burns in a controlled fashion cylinder pressure builds to a maximum to drive the piston down the bore. The spark event should happen some time before this to allow the pressure to build to its maximum at the most advantageous point of the crank shaft rotation so maximum torque can be applied to it, as the engine speed increases (revs) the burn process needs to be started earlier (more ignition advance) as the burn process takes roughly the same amount of time no matter what the revs are.

There are two types of abnormal combustion - pre-ignition and detonation. Numerous people think they are the same and quite often they are linked but they are very different!

Pre ignition is exactly what the name states it is - the air/fuel mixture ignites before the spark plug fires. The reasons that this can happen are -

Hot spots in the combustion chamber
Build up of carbon 'glowing red hot' due to previous ignition events
Poor cooling system
Engine detonation
Valves reground incorrectly (margin to thin)

With pre-ignition the timing is to far advanced (fuel/air charge is igniting before spark plug fires) and can actually try to turn the engine backwards or at the very minimum the cylinder pressures are far to high for the design. It is usually catastrophic and melts/blows holes in pistons in no time!


Pre-Ignition is not engine knock.

Detonation is quite different. Detonation is where the fuel/air has been ignited correctly by the spark plug but then due to the increase in pressure of the burning mixture pockets outside the flame front ignite in an uncontrolled manner and cause a sharp momentary spike in the cylinder pressure. This quick increase in pressure then 'punches' through the boundary layer gasses and allows combustion heat to get through to them - this is why pistons that have suffered detonation look like they have been sandblasted. Further to this the components heat up as they are directly subjected to the full combustion tempreatures and can lead to pre-ignition.

Most engines can stand mild detonation for short periods but it is never advisable to run with it. It is the pre-ignition caused by the detonation that destroys them quickly!


Detonation is engine knock

Going back now to the Knock windowing here is my personal opinion:

Because the ECU isn't very clever we need to direct it to look in the right place for detonation to give it the best chance of detecting it.

As stated above' detonation can only happen after the spark plug has fired - we don't want it to listen for pre-ignition as well - it is to hard a task for it IMO and could be detrimental (see later)

Therefore I would always start the knock window after the spark plug has been instructed to fire by the ECU. It is also unlikely that the detonation is going to happen just after the plug has fired but is more likely to occur under peak pressures. I would start the knock window at TDC for low revs then probably build that to 10-15 degrees BTDC as the ignition timing becomes more advanced.

In respect to how long to keep the window open for, we know that detonation can happen well after TDC; in some cases as long as 100 deg. ATDC. The fact is that any time after approx 20 deg ATDC detonation isn't that destructive - the piston is rapidly moving away from TDC at this point and therefore pressure is quickly falling. Any sharp spike in pressure won't damage the engine. Added to this is the fact that the combustion temperatures are falling so even when the boundary layer is penetrated they will not melt the surfaces.


The reasons why we don't want the ECU to pick up pre-ignition:

To control engine knock the ECU will usually 'pull timing' - in other words it will reduce the amount of advance so the spark plug fires later in the engine cycle. This lowers combustion pressures and therefore the chances of Detonation occuring are lessened,

Going back to pre-ignition we know that hot spots within the combustion chamber can cause pre-ignition. Usually the hottest area of the combustion chamber are the exhaust valves themselves, and in particular the exhaust valve margins. If you retard the ignition timing exhaust gas tempreatures rise - this leads to even more heat within the exhaust valves and increasses the chances of pre-ignition even further.

I hope the above post, although very lengthy helps to explain our reasoning?
 
#32 ·
Well I've no idea why I wasn't getting a knock trace, there was no hardware fault I could fine.

In a fit of frustration I rolled back to the original tune I was give by Reverant, bingo knock signal came back. I then went though and changed everything back to how it was and it still worked.

I've compared the tunes and there is nothing untoward so I've no idea why it stopped working.
 
#33 · (Edited by Moderator)
i'm not sure about all you've written there blink...

With pre-ignition the timing is to far advanced (fuel/air charge is igniting before spark plug fires) ...
i agree on the definitions of detonation and pre-ignition, but there's a contradiction what you've written.
Combustion occurs ahead of the spark firing, so it is not due to the spark being too far advanced. The hotspots that cause pre-ignition however, can come from advanced timing but the actual combustion event is not related to the spark timing.

I also don't think that retarding timing during pre-ignition conditions will affect the exhaust temps as the charge will have already ignited by the time the spark fires and so it won't have any impact on this regime of abnormal combustion. once you're in pre-ignition, you're generally f*cked.

detonation is directly affected by spark timing, pre-ignition is not.
 
#34 · (Edited by Moderator)
i'm not sure about all you've written there blink...

With pre-ignition the timing is to far advanced (fuel/air charge is igniting before spark plug fires) ...
i agree on the definitions of detonation and pre-ignition, but there's a contradiction what you've written.
Combustion occurs ahead of the spark firing, so it is not due to the spark being too far advanced. The hotspots that cause pre-ignition however, can come from advanced timing but the actual combustion event is not related to the spark timing.

I also don't think that retarding timing during pre-ignition conditions will affect the exhaust temps as the charge will have already ignited by the time the spark fires and so it won't have any impact on this regime of abnormal combustion. once you're in pre-ignition, you're generally f*cked.

detonation is directly affected by spark timing, pre-ignition is not.
When I stated that the 'timing is to far advanced' - this relates to the timing of the gasses combustion in the engine cycle; not the spark/ignition timing.

Sorry for the confusion.

In relation to retarding the spark during pre-ignition it's a bit of 'the chicken & egg' syndrome - if the retarded spark timing is causing elevated exhaust gas temps and the exhaust valves glowing causing the pre-ignition then you wouldn't want it reatarding any further - if the pre ignition is caused by other factors then it will make no difference.
 
#35 ·
ahh i see what you mean. yeah, severely retarded spark will be turning the exhaust valve(s) into a serious heat source - more heating of the fuel / air charge is equivalent to a lower effective octane hence less resistance to pre-ignition.

i'm still not sure that a knock device pulling timing when it senses pre-ignition will do any more damage to your engine, your timing will be pretty ugly up in the first place. but yeah it certainly won't hurt to implement such a strategy if you're able to through detailed windowing.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top