Knock Sensing

Tuning concepts, methods, tips etc.

Moderators: jsmcortina, muythaibxr

AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

vw_chuck wrote:Here is a look at what detonation looks like on my system. As I said it has adaptive gains so the level is very constant. The detonation control is turned on and then turned off and you can see the voltage go up when off. This is a 6 cylinder engine so I plotted all 6 cylinders.
Awesome pic, thanks!

I guess I'm having trouble deciding what's "knock". If everything's sitting between 15 and 20%, then you see 25%, is that knock? If so, you want your gains high to exaggerate a weak signal, perhaps bring it out of the noise.

On the other hand, is 15-20 is your background, and 50% is still just more random noise, then you could keep the low gain or even further reduce it, being confident a threshold of 60 will catch noise.


This directly relates to how many points are needed to follow the curve, the level you'd use (adaptive or otherwise), and in general how sensitive to tuning you are.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Knock Sensing

Post by vw_chuck »

Abe,
The screen shot I put up has two thresholds. The first threshold is what sets the 0 point on the screenshot to which is set to .65volts. Then there is a detonation threshold which is .75 volts. So basically you are only seeing the detonation threshold on my screenshot. There is .65volts below the 0 point that is not shown. So at 1.4 volts total you are triggering your detonation control to on.
So I guess I am saying that a little over double the baseline voltage you count as detonation in my case.
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

Ah! If that applies, I have a ton more margin than I thought I've been trying to keep things in the 20% of baseline range.

What's odd is how I see it in conditions which would suggest knock - i.e. long pulls at high boost will give me knock where a quick run through it will not - but not at high levels like you're seeing.

Either way, thanks!
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Knock Sensing

Post by vw_chuck »

Another way to tell what is going on is with your ears. If you can hear it you are in the danger zone. This knock control should be able to keep you out of the audible range.
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

I've always had the hardest time with that. Quite likely I should get a det can and set it up that way. I certainly have issues listening at high speed under way.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
xr4x4ti
MS/Extra Newbie
Posts: 4
Joined: Thu Jan 08, 2015 11:40 am

Re: Knock Sensing

Post by xr4x4ti »

Here is a look at what detonation looks like on my system. As I said it has adaptive gains so the level is very constant. The detonation control is turned on and then turned off and you can see the voltage go up when off. This is a 6 cylinder engine so I plotted all 6 cylinders.
VW_Chuck, do you have any more information on this? I have been researching (obsessed) with knock control lately and this seems like it would really help the average Joe tune the knock system. The documentation for the knock chip used in the MS3/Pro even mentions using the chip to measure a baseline or background noise before TDC to normalize the magnitude a bit. Here is a link to a pretty interesting document intended for the Motohawk engine controllers that goes into great detail on this idea.

http://www.neweagle.net/support/wiki/do ... 040708.pdf

If this could be incorporated into the MS code, it might really help tuning.
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Knock Sensing

Post by vw_chuck »

XR4x4ti
Not sure what else you are looking for? That document about sums up how to use the Intersil knock chip that everyone uses. The only thing that changes is the software user interface and that is where all the confusion comes in with knock control. Basically during calibration you need to know when the engine is knocking or not knocking. There is a very simple way to do this and it is shown in figure 3 on that document you posted. It shows an in cylinder pressure measurement and accelerometer (knock sensor) raw output during a knock event. You can easily do this with an O-scope. One channel on the o-scope is a TDC trigger for that cylinder and the other will be the raw voltage coming from the knock sensor. By looking at this on a scope you can easily see when the engine is knocking or not knocking. That is how I do it on the dyno and I am sure it can be done in the car with a portable USB scope or the like. It would be really nice if you could log this with the MS3 at a high rate (1ms) as it would make calibrating the knock control very easy.
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

RANT:
Unfortunately, it's been made obvious this is absolutely NOT a priority for any of the people involved in writing the code. They aren't open to suggestions and won't answer simple questions. So "getting it into the code" means what it's meant for a long time - write it yourself, and be prepared to fix your patch every time a new release comes out. Unfortunately, it means you'll always be behind by a year or more - so their plan to kill outside development, help, and insight is entirely successful. If you make it nearly impossible for people to see the current code, and punish them by preventing them access to the latest, as well as forcing someone to take on a development project just so they'll have to do another to fix it when the current code source gets released again....

Well, anyway.

That said, as this is not the only ECU I work with (nor, given the current treatment of people who genuinely want to see the Megasquirt project improve and continue to grow/adapt), I DO want to understand it. And if I can develop a knock baseline with another ECU then apply those settings to make my MS work better, I'd be happy about it.


To that end: When you say monitor cylinder pressure... How do you do that on a stock car? I mean, I have no pressure transducer.. :-( Or do you just mean to look compare the knock sensor output as a function of engine angle? If that's the case, I asked for it before (also ignored)... But I could probably do it with one of the LibreEMS/FreeEMS variants at minimum... Though it would be simple and awesome to log it in the MS, even allowing you to set your baseline in a meaningful way.

I guess the only answer is to get some old code (whatever's released, 1.3.x I hope but I dunno) and get it to just record all four channels and engine position, then drive around. It's just such a waste to write it then have it laughed at then very quietly it gets implemented later.... Whatever, I'm not trying to turn this into a bitch-fest, I just get pretty ticked off that no matter how much I try to help the best I get is ignored. This is a real problem and a key feature for any modern ECU.

If anyone's interested in seriously working on this we could probably get a discussion going and figure out how to either code it or otherwise make it possible for people to get the information the MS is throwing away so all our cars can work right.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
Matt Cramer
Super MS/Extra'er
Posts: 17507
Joined: Thu Apr 16, 2009 8:08 pm

Re: Knock Sensing

Post by Matt Cramer »

At this point, the code team is trying to get the 1.4 code to a stable release before adding new features, so it may be a while before they can give this the attention it needs. Also, in the short term, I believe James has been out of the country for the past week.
Matt Cramer -1966 Dodge Dart slant six running on MS3X
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

Thanks Matt. I'm not trying to be a pain here. This thread is... old. And it's only here to replace the last thread that died.

Adding more points, and logging more data has two questions:
1) CAN we do it?
2) WILL we do it?

Answering the first question would already be a huge benefit. Of course, the same thing goes for adaptive filtering (auto tuning, etc), but all I (we?) are looking for at this point is the ability to better understand what's going on inside the box - how does it work and what can be done. We can worry about how or actually doing it later... But a bunch of folks hoping it was better is like talking politics with your neighbor - you have so little idea what's going on you'll eventually run out of genuine facts, and even if you get a good answer, it'll die with you if no one is interested in picking it up. Time constraints are very real, but "there's absolutely no way this will happen" is a lot better than dead silence.

I really like what you've done with the hardware, it's kept me in the MS fold (and still recommending it to others) when I'd otherwise long ago have left.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Knock Sensing

Post by vw_chuck »

What I was saying is that when the pressure sensor is showing knocking your accelerometer output will look like what is shown on in the figure. I was not saying to measure cylinder pressure on the car. That is out of the question due to costs.
If you had basically an O-scope type feature in MS you could sample at a high rate a few signals and definitely see what is going on per cylinder with detonation. I would say that an O-scope is a pretty critical tool for hardcore electronic engine development and super useful for seeing detonation per cylinder.
Matt Cramer
Super MS/Extra'er
Posts: 17507
Joined: Thu Apr 16, 2009 8:08 pm

Re: Knock Sensing

Post by Matt Cramer »

AbeFM wrote:Thanks Matt. I'm not trying to be a pain here. This thread is... old. And it's only here to replace the last thread that died.

Adding more points, and logging more data has two questions:
1) CAN we do it?
2) WILL we do it?
I am not one of the code guys. I can say that expanding the number of data points on the curve can be done, but I am unsure if it will. If you're familiar with C, it probably wouldn't be too hard to alter the source code to have more points on the curve yourself, although I haven't looked too closely.

If you want to get it added to an official code release, your best bet may be to collect more data from a variety of users to build your case that this is something a large number of users will have a need for.

I have been discussing incorporating a moving average based knock control with them for the 1.5.0 code revision.
Matt Cramer -1966 Dodge Dart slant six running on MS3X
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Knock Sensing

Post by muythaibxr »

Abe: We're discussing ideas that will avoid having to give the curve more points. We're not ignoring you we just have not been vocal about what we're doing.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

Ah! That's just what I wanted to know, what direction are things potentially going - so I invest what community resources there are into the most useful areas - ie gathering more evidence for the adding more points versus finding info on adaptive thresholds.

A word that there is official interest in one, or the other, is super useful.

I'm assuming that higher speed logging of raw, timed knock values is not going to happen? It'd be useful as a diagnostic whatever method ends up being used, but it's nice to have some idea of where things are going so I can align myself with it.

Thanks again everyone -the barest hint of feedback goes a long, long ways. :-)
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
xr4x4ti
MS/Extra Newbie
Posts: 4
Joined: Thu Jan 08, 2015 11:40 am

Re: Knock Sensing

Post by xr4x4ti »

vw_chuck wrote:XR4x4ti
Not sure what else you are looking for?
vw_chuck, I was mostly referring to fact they use the separate window for each cycle to measure a background noise level. This helps normalize the data, the determination if there is knock or not is then the ratio of the knock window to the noise window. Unless I don't properly understand what is going on, the MS code currently just uses a knock window and threshold. This makes it much harder to tune IMHO and I think is one of the issues that AbeFM is having because his background noise varies so much over RPM.
muythaibxr wrote:Abe: We're discussing ideas that will avoid having to give the curve more points. We're not ignoring you we just have not been vocal about what we're doing.

Ken


Anymore details, is it closer to what I am describing?
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

vw_chuck wrote:XR4x4ti
You can easily do this with an O-scope. One channel on the o-scope is a TDC trigger for that cylinder and the other will be the raw voltage coming from the knock sensor. By looking at this on a scope you can easily see when the engine is knocking or not knocking. That is how I do it on the dyno and I am sure it can be done in the car with a portable USB scope or the like. It would be really nice if you could log this with the MS3 at a high rate (1ms) as it would make calibrating the knock control very easy.
Hmmm, perhaps as an intermediate solution, is there a way to get MS to put out a TDC pulse somewhere, accurately timed? One COULD set timing to fixed and do some pulls, or perhaps use fuel phasing and watch when it injects... But if one of the extra spark outs or something else could be used, that would be awesome. Any thoughts? Or build another readout and watch the crank like everyone else, just more work (for me) that watching an output pin on the MS. :-)
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Knock Sensing

Post by vw_chuck »

XR4x4ti
The problem with a noise window to knock window as you describe is knowing what is just a noise window. Also when you say window that is usually referred to the degrees of crank rotation after TDC where you are actually looking for knock.
Alot of detonation control systems use a moving average on the knock voltage which it always compares the current voltage to. So you will be running and not detonating and creating a moving average knock voltage for that cylinder. Then if the engine knocks the voltage will be a calibratable amount higher than that average. This is counted as a knock event. Then if you get x knock events out of Y TDC cycles then it will apply detonation correction to that cylinder for X amount of time and then slowly bring the fuel and spark back to normal and the whole thing repeats.
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

I'd love to see some representative numbers - the biggest question is how much louder than not-knocking is the lightest knocking? Is this variable over RPM - either as an absolute or a percentage. The issue is how steep is that compared to the slope of the background noise - if it's 20% above to be considered knock, will the background rise 20% over one engine cycle? Likely not, but that's the number you need to know.

I'm a little concerned about putting the cart before the horse - a closed doors development could easily miss something like that... or well be taking it into account. It could add a year of testing and rewrites to put it in after the fact once it's established when a short amount of data collection now could answer the question conclusively.


The nice part is, any system (well, even the current system COULD) that records knock and stores it could easily self calibrate - or at least record a log a user could go back and set limits with - and be used as mentioned above to pick sane numbers.

Personally, I think "adaptive" is just a cheesy cop out for not setting stuff right in the first place - which you can do with data. If it works, though, I'm happy with it.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
vw_chuck
Master MS/Extra'er
Posts: 633
Joined: Wed Dec 11, 2013 1:16 pm

Re: Knock Sensing

Post by vw_chuck »

Adaptive gain is used in virtually all OEM automotive applications. The background noise changes significantly with different environmental conditions that the engine is put into so your calibration that works today may not necessarily work tomorrow. That is why adaptive gain is used.
AbeFM
Super MS/Extra'er
Posts: 875
Joined: Wed Dec 05, 2007 1:40 pm
Location: San Diego, CA
Contact:

Re: Knock Sensing

Post by AbeFM »

It's reasonable, for sure. It's more, you can't just arbitrarily say "10%" - there's an optimal slope. But, this is beating a dead horse.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
Post Reply