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:

Knock Sensing

Post by AbeFM »

Does anyone have any advice on how to successfully get the Knock Sensing on the MS3-Pro working?

My issue is a complete lack of feedback from the software people - but still wanting my car to run.

I've done several low-advance pulls to try to develop a baseline noise level for the engine, but the knock timing retard seems to engage even when I'm below that level. I think it has to do with either the gains not being represented correctly or applied at the wrong time (unlikely since I think they are done in hardware?), or because the logging doesn't capture the high points in the history.

Anyway, it seems no matter what I do, I end up getting knock retard when I know I shouldn't - and I have a hard time getting it to work out right on the very low end (off-idle) and still keeping the car drivable without artificially triggering knock.

I've asked in the development forums a few times - but over the course of a year I haven't gotten ONE answer. So I'm hoping someone has some PRACTICAL "just check that box, don't ask why" advice since my trying to understand it has fallen on deaf ears. I know several accomplished tuners who just say "yeah, that doesn't work" and don't use it.
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 »

The noise spikes could very be shorter than the log sampling rate. Have you tried using an SD card log? They sample a good deal faster.
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 »

Matt,
First off - thanks for getting back to me. I'm not kidding when I say I've been talking to a wall for a year on this one. Anyway:

I was thinking that was what I would need to do. All I truly need is a log of RPM vs Knock Count and ideally capture every sample.

Similarly, code which captured the highest even since the last recorded sample would work as well. I'm not really clear on the mechanics of what is recorded when, what is the decision made by? There's a knock level for each channel, and then an overall. Is the actual "knock retard" determination done by looking at one line then another? When are the samples logged - are they the relevant ones?

I'm not sure what numbers to even look at. Similarly with the gains - is it just set in the chip and you can "even" them by doing some logging and applying a gain? I.E. if your average knock was 20,20,22.2, 20 across 4 cylinders, you would then apply gains of 1.0, 1.0, 0.9, 1.0 and get perfectly flat matching knocks on an identical run next time?

That said, I'll try the SD thing. I just feel like there's a lot of unknowns and yet getting this working is high on the list of "you should really do that" stuff. With the old "KnockSenseMS" from the volvo world it twice saved a motor when something went wrong - this should only be better.
-Abe.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
Dennis930
Experienced MS/Extra'er
Posts: 187
Joined: Sun Feb 12, 2006 6:26 pm
Location: Va. Beach, VA

Re: Knock Sensing

Post by Dennis930 »

Abe,
I agree that there is not a lot of tuning info for the MS3 knock sensor. I have attached some posts where others talk about tuning, but this is still not a lot of information.

I have been doing data logs of my installation, trying to equalize the "noise" levels from each of the six cylinders by adjusting the gains. My engine did not have a knock sensor as original equpment, so the knock sensor location may not be optimal. I have one cylinder, #4, which is not as close to the sensor as some of the others, that reads higher levels that all the others. So, I keep turning the gain down on that one while raising the gains on some of the others. The knock levels are shown as %, but I not sure what that means. I have not tried to induce knock, but the highest level I have logged is slighly over 80%, which occured while turning boost control (exceeded safe levels and fuel cut kicked in).
Porsche 930 3.0 Slantnose
MS3/MS3X Sequential Injection & Spark, MS Knock, Dual plug, LS2 coils, Siemens 55 lb/hr HiZ injectors, ALM-ADV Wide Band,
Carrera Intake, Extrude honed, Ford 70mm Throttlebody, GTX3071R Turbo
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 »

Yeah - I always get "knock" on any of my safety cuts. There is an option to stop looking for knock on flatshifts, but not on overboost, etc. Not sure if that's good or not - under overboost, you may well have knock. On rev limit, odds are low you're inducing knock.

That's interesting - in my other thread (it sucks about the repost, but a year in I won't take the blame for it) I was asking about frequency. I am using a harmonic, and I find triggering I can't tell if it's real. I sort of think it's induced or not always there or similar - but since I can't tell if I'm tuning knock right (again, how does one do it?), I don't know if it's fake, or missing stuff. The lowest speed knock - the only stuff I can hear while driving (like, ~1800 rpm in first) - is nearly impossible to get the sensor to pick up.

My gain per cylinder is very flat - something like 1.23 is my largest gain, 0.96 is my lowest. It's flat, but there's a lot of variation. I just saw a debug setting for recording per-cylinder knocks which is awesome... But not super useful since it's not saying why it's triggering. At best, I might be able to peer inside the black box a bit by looking at each cylinder's levels and it's respective retard to look for a correlation. Perhaps it'll be stronger.

Does anyone know where that data logs to?
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Knock Sensing

Post by jsmcortina »

AbeFM wrote:Does anyone know where that data logs to?
SDcard or laptop.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
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 »

James,
Should have been more clear - I mean - what values are set, and what are recorded.

The "DEBUG option to record per-cylinder knock retards" is the thing I was talking about - I think it gets put into "sensors", but How Cyl 1 into Sensor1, etc?

Do you have any input on how I might record the HIGHEST knock level seen on that cylinder since the last record?
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Knock Sensing

Post by jsmcortina »

AbeFM wrote:James,
Should have been more clear - I mean - what values are set, and what are recorded.

The "DEBUG option to record per-cylinder knock retards" is the thing I was talking about - I think it gets put into "sensors", but How Cyl 1 into Sensor1, etc?

Do you have any input on how I might record the HIGHEST knock level seen on that cylinder since the last record?
If you log to the SDcard, you can log faster than the cylinder events, so you'll be able to see the peaks.

The debug code is

Code: Select all

    if (ram5.knock_conf & KNOCK_CONF_DEBUG) {
        /* for debug */
        for (x = 0; x < 16; x++) {
            outpc.sensors[x] = v2.knk_rtd[x];
        }
    }
So cyl#1 -> sensor 1
cyl#2 -> sensor 2 etc.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
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 »

Oh, awesome thanks on both counts. You're totally right, at 8k rpm I should see 3.5 ms between ignition events, and 14 between any individual cylinder firing. That should tell me what KNOCK IN really means. :-)

Er, I think I have fuel pressure as SENSOR 1. When I tried to set up SD Card logging, it said FUEL PRESSURE, SENSOR 02, SENSOR 03, etc.

Would just reassigning the fuel pressure work then?
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
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 »

Quasi-unrelated: Is there something up with my SD card downloads? I'm getting like 36 kBps, so my 111 MB file (I didn't know it allocated all the space even if you don't use it) is going to be like a multi-hour download.

I imagine the best answer is to physically remove the card from the MS3Pro, but if there's some way to set TS to dl faster I'm all ears.

Thanks!
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
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 »

Looking at the data much more closely, I really feel the BEST answer is to change the way the knock values are recorded. The information simply isn't useful (or, it IS useful, and again, I have no way of knowing how it is recorded).

The idea is easy - record the motor NOT knocking, take the highest values, and draw a threshold which just misses the high points in the data, while closely hugging the valleys so you remain sensitive between them.

First, I'd say I'd like more points in the curve. Since that's not even talking to the knock signal processing chip, it shouldn't slow anything down to have more points, just the memory for another 10 1D pts.

Image
That's what I'm trying to cover with the 10 points, and is why (check the blue line) I'd like to have 20 pts instead of 10. I can do a much better job covering the curve. I have these huge areas where I could get an extra 20% knock and not see it since it would be below the threshold.


My other question is more in details, since I think I got the main answer - what number is recorded in Knock In: Is the the last number which fell within a window?
My original thought follows:
But to the core matter. When I look at my logs (there's another issue with getting samples every 3 ms, but every once in a while I get several (about 6?) 150 ms skips, spaced roughly 30 ms apart), I realized that at ~5krpm, that's ~4 samples per rotation. Which means only one or at most two of these fell into my "knock window". Given that I have no idea what's recorded - or where this window is, I cannot figure out which sample is which. Here's an excerpt from my log:
Image
You can see the samples go from 23 to 35 in 4 samples. The samples do have "flat spots" of 2 samples each, consistent with those being the "used" numbers. Is that what is going on? Take any flat spot to mean one cyl's value repeated? At higher RPM I don't see this, but here I do. Since I see 4 samples per at even lower RPM, I assume this to be the case (though still no feedback as to which cyl I'm on, at least it's useful information).

If I could record the highest value knock for a cylinder on each channel (instead of knock retard for each cylinder) it should make both balancing gains and drawing this curve a breeze.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
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 »

Interesting - it's ALWAYS (as best I can tell) 7 samples then a ~150ms jump.

Image
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
TheSilverBuick
Experienced MS/Extra'er
Posts: 357
Joined: Thu Feb 02, 2012 9:08 am

Re: Knock Sensing

Post by TheSilverBuick »

Hmm, interesting, so this is what the knock data looks like. I don't think you are seeing detonation knock, you are seeing simple engine noise. Detonation Knock is a significant spike from noise, like 3-5 times the noise intensity as normal combustion. Putting your limit right at the top of your noise trend may result in spark retard when atmospheric conditions change and your engine is (could be) running better.

I think, just this week, I've been looking at using data like this, but trying to plot it against crank degrees in the high speed logger to more accurately place which cylinders are doing what.
"Hey, at least the Skylark proves that even a messy hack can patch together a reliable EFI system. I can't think of a time the MegaSquirt has left me stranded since installation ~100,000 miles ago."

Drag Week 2011, 2012 & 2015. - BB N/A - 1977 Skylark w/Buick 455 EFI and TKO-600!
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 »

Indeed. I think there's useful logging to be done, but a random sampling of the data isn't useful. If you could see the future and were getting drafted, would you be more interested in knowing that there was a 10% chance you'd get shot, or in knowing for certain if you'd be harmed or not? Perhaps it's a bad analogy. :-)

Anyway, there IS value to knowing the shape of the background noise. drawing a flat line across the highest peak of ~60% means that my lowest noise levels (~9) could have a 6:1 spike which wouldn't show up. The closer (in shape) that line follows what your engine does the better off you are! Some of the quietest spots are RIGHT next to some of the noisiest.

Image
As you can see, I can fit it pretty well EITHER up top or down low, but not both - and that's only picking out useful features along the way which lend themselves to a straight line approximation.

6115 RPM, 59% knock is right next to 5894 RPM, 23% knock. That means I can have a 2:1 knock over the loudest the motor ever is at 5900 RPM and not even see it because my filter is set to some 20 or 50% over 59% knock (I'd probably go with 72% for a buffer of 20%).

Fitting the curve is important. Here you can see my two approaches to fitting over the whole thing. at 4500 RPM my threshold is 40% (plus 20% to become 48% where the loudest recorded background sound is merely 17.
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
TheSilverBuick
Experienced MS/Extra'er
Posts: 357
Joined: Thu Feb 02, 2012 9:08 am

Re: Knock Sensing

Post by TheSilverBuick »

I think your analogy needs work =P But I don't doubt you know what you are talking about, and asking for.

I'm trying to tie it back to a per-cylinder analysis rather than a global average. Hence plotting against crank degrees rather than a time sample interval because with regular time interval sampling the engine will be at different points of compression with little to reference back to other than rpm. In your method there (I am open to education!), how do you know you don't just have one problem cylinder with a bad spark plug or a singular hot spot developed from a one bad spot of a port job? Or a cylinder getting less fuel so making less noise? Conversely more fuel and more noise, and getting lost in the average?

Even sampling on regular time intervals (3ms?), simply logging crank angle/degree at the same time would allow you to at least really relate it to a point in the combustion process to either mess with fueling or ignition timing, or go so far as to re-evaluate the head's chamber or piston top.

I'm on the learning end here, I just had some discussions with someone who correlated engine noise (knock) with cylinder pressure, where he had actual cylinder pressure data. I'm trying to see if MegaSquirt is capable of utilizing that knowledge via the knock sensor.

There is some real interesting MoTec reading regarding knock/engine noise sensing.

This is the thread I started, but need to start a different one to get the variables I want to "high speed log" to be captured. If possible anyways. Scatter plots with x-axis as crank angle I think would be quite interesting.
http://www.msextra.com/forums/viewtopic ... 22&t=57219
"Hey, at least the Skylark proves that even a messy hack can patch together a reliable EFI system. I can't think of a time the MegaSquirt has left me stranded since installation ~100,000 miles ago."

Drag Week 2011, 2012 & 2015. - BB N/A - 1977 Skylark w/Buick 455 EFI and TKO-600!
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 »

Dear Mr. Buick, :-)
I've been saying the same thing - I think. Currently there's a recording of how much spark is pulled from each cyl, which you could use to develop a complex mapping of what's going on: Set the level at 50%, the cylinders which have more spark pulled likely crossed the threshold more... But it is nowhere near as useful as recording the knock from each channel. The problem is, that code has to be written by the devs. I'm hoping to get their attention in this matter through a show of support/interest but I'm not holding my breath.

I believe I'm getting information per-cylinder (just not WHICH cylinder) since the numbers recorded repeat. Anyway, by counting the number of steps, I don't see anything cyclical. I get samples like 45, 45, 38, 38, 42, 42, 39, 39, 48,48, 36, 36, 35, 35, 32, 32, 29 29, 44, 44..... As you can see, those are likely coming from 2 reads per cylinder (why they match I don't know, I don't know much about how this works and since the public code is never the current code you never really know what you're running on your motor - and you can't roll your own without working on old versions which may no longer be representative), but what is apparent is that I'm not seeing one consistently misbehaving chamber. If you look carefully at the data, there's some hopes for it, but if I could get 4 knock values (the highest knock in the window for that engine cycle, per cylinder) I could draw an ideal knock limit AND fine tune things like windows, etc.

It all comes down to "is this the average, a random sampling, etc" and while the question has been read several times, your guess is as good as mine about what's actually happening. The only real feedback I've had is seeing repeated samples with the same values at low speeds.

I'll check out this Motec stuff. I'm always looking to learn more. :-)
2000 VVT Miata turbo, MS3Pro

Contact me if interested in a MS-II 2nd gen NB Miata PnP board.
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 »

For anyone interested, the logging to SD card helped a lot. I still get some reported knock at the high end - both where it's more likely to be real and where I'm also missing enough points for discerning coverage... But it's better, much better.
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 »

Guys I use detonation equipment everyday at work. We run the AVL system and use pressure sensors and accelerometers(knock sensors) to read detonation. You guys are on the right path. If you want to control detonation on a per cylinder basis you need to be able to see what is going on in a window after TDC on each cylinder. Most all OEM's use the same chip that is sold for the MS3 so there are many examples how the code should work. Based on work I have done the easiest way to see knock is to just look at the raw knock sensor output on an O-scope and trigger the scope off TDC for that cylinder. It is pretty blatant when the cylinder starts to knock it can be seen right after TDC. If there was a way to log in this manner with the MS3 then you would be able to calibrate the knock control if it is indeed looking in a window ATDC.
Also many knock control algorithms use something called adaptive gain which adjusts the gains to filters out all the background noise so the output is constant at all RPM's and detonation control is triggered as you go over that threshold.
I would say though that simply being able to see what is going on after TDC on each cylinder would be a very useful start.
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 »

Chuck! Awesome! So cool to have someone who knows what these actually look like.

Any advice on knock windows? Any advice on how far above background a sensible threshold makes (i.e. if background is a "10", do I need to be at 12 to pick up "faint knock", or would 20 or even 50 work?

Most of my issues with setting the thresholds stem from not knowing how close I have to be. If knock is twice as loud as background, it would be easier.

I would LOVE to see the values out of the chip raw - like reading the tooth logger, a dedicated, high speed log of just RPM vs. Knock and Engine Angle would be all I think I'd need. Could record to card or USB, doesn't matter, but some form on INFORMATION based decision making would really help.
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 »

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.
Post Reply