Knock sensing ideas and circuit designs

From DIY contraptions to sophisticated FreeEMS-specific designs! Plus general hardware development!
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Knock sensing ideas and circuit designs

Post by jharvey »

MUX chips are a good way to multiplex it. Something like could work,

http://octopart.com/info/Analog+Devices/MUX08EPZ

I'm sure there is a better option, I found the above in less than a minute on octoparts and tossed it up there.

Also when you shield your knock sensor wire, ground the shield only at the EMS end an close to the A/D. Your noise floor will drop by about 15 to 20 db this way.

If you haven't read this book, I might recommend it. Noise Reduction Techniques in Electronic Systems by Henery W. Ott. It's an older book, and can likely be found at your local library. The world below 200 MHz is quite a bit different than the GHz world.
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Knock sensing ideas and circuit designs

Post by jharvey »

Appears the arduino also has a DMX thing, you remember for add-on2 with the disco ball and lasers.

http://arduino.cc/en/Tutorial/DMXMaster
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Re: Knock sensing ideas and circuit designs

Post by davebmw »

I have used the good old 4051 for several MUX / De-MUX projects nice and simple 3 bit binary, enable pin and 8 to 1 switching.

Oh and yes RF becomes more of a feeling and intuition than common sense when you get to microwave territory.

I'm wondering if we actually need to have realtime sensing on the temperature sensors? it could be a future add-on possibility to have the slower acting sensors multiplexed to free up ADC channels for faster stuff, like knock sensing on multiple channels maybe.

hmmm the possibilities are endless :)
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Knock sensing ideas and circuit designs

Post by jharvey »

Hmmm, so what's all this about bias current, and such detections? The claim seems to be, that the bias current indicates if it's connected. And measuring the noise floor indicates a working sensor. So some noise is good, but to much is bad thing.

However the bias current must be very low, because the piezio impedance is around a Mohm, so I would suspect fault detecting the current is quite picky.

The more I think about it, the more I think we want an 6KHz ish energy detector with analog input to the MCU, than let software take care of windowing, and detector.

Hmmm, however, I would like to make it smart enought that we can put the hardware close to the sensor, than run back a digital signal. Hmmm.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Knock sensing ideas and circuit designs

Post by Fred »

I've said it before and I'll say it again, fault detection is, by and large, for OEMs only. Focus on detecting the knock, not figuring out if the sensor is stuffed.

For the medium term if you put the hardware far away and run digital you'll have to go back to analog again when you get home.

If you let the software do the windowing it won't be very accurate as there are no spare timers to do that.

Remember that it is a safety net and not core functionality. Millions upon millions of cars have been built and lasted decades without knock sensors at all. I guess what I mean is that effort may be better spent somewhere other than fault detection or relocation (such as making a basic detector work better)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Re: Knock sensing ideas and circuit designs

Post by davebmw »

I kind of agree with both of you.

I realise that there are a finite number of compute cycles available in the CPU so if we want some form of protection we must remove as much of the burden from the CPU and software guys as possible.

As an engineer though I want everything to be the best it can be or at least to have thought about all possible permutations before coming to a compromise based on all the factors in the equation.
This however is a situation where we have limited resources to play with on a design that hasn't yet got real world basics tried and tested, for the time being as long as we have a way of flagging to the CPU that there has been a knock event and the timing in the current cell can be retarded by a defined amount, that will serve to provide some level of protection to our engines during tuning.

As time goes on the FreeEMS design may evolve to a different Chip or some of the day to day functions may find their way on to XGate which in turn could free up resources in the main S12 to do more complex software based analysis on the knock signals.

As for fault detection it is easy peasy to bias the knock sensors with a DC bias for fault monitoring as the signal is AC coupled and can be treated separately. you could use it to light the check engine light or something similar.

In my ECU there is a separate MCU for OBD that monitors the faults, so even OEM designs keep that away from the CPU that does the running of the engine.
My engine for one, it's quite difficult to hear knock because of all the crap bolted to the side of it and plastic covers. So I really need this protection.

As for having a localised box to transmit info back to the ECU, I wouldn't have to worry about that as my OEM loom is already correctly screened. But if you have to get analogue signals to across any kind of noisy environment the easiest way would be send differential signals this will cancel any collected noise on the receiver circuit using simple op amps.
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Knock sensing ideas and circuit designs

Post by Fred »

davebmw wrote:So I really need this protection or a good tune
Sorry, couldn't help myself! :-)

OEMs know that when they sell that 10.5:1 compression engine that some moron will put 91RON in it and drive it up a hill at 30mph in 5th gear at WOT. That engine was designed for 98RON and intended to be driven up that hill in 3rd at 30% throttle. If you put decent gas in your car, tune it right, and drive it intelligently you do not need a knock sensor. Knock sensors are too little too late for a serious high power application ANYWAY...

The OEM way for extracting max economy is to push the timing constantly up until it knocks, then reduce it a bit. This WILL NOT WORK at 30psi ...

All of these automated feedback mechanisms are for AFTER you have a SOLID tune on your cars. Solid will take you months to achieve working on it daily (just like it takes the OEMs months). Also just like the OEMs once you have your solid tune, only then should you add feedback mechanisms on top of that for the day you pay for 98ron and receive 91ron by accident or similar.

Tune first, fiddle second.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Re: Knock sensing ideas and circuit designs

Post by davebmw »

Don't disagree one bit, but we still need to have the safety net of some kind of feedback once the tune is reasonable so we can push it that last little bit and know where the line is drawn.

The problem is I have to do the majority of my tuning on the road as I have not found one tuning shop that will hire out their rolling road whatsoever (health and safety BS) and there are none that have ever heard of MS and that means that they certainly haven't got the slightest idea of how to use the FreeEMS tuning software either.

So as the majority of the tuning will have to be done on the public highway with a roaring induction and loud but tuneful exhaust knock is impossible to hear over the noise of the mechanics, road, wind etc etc etc.

All it takes is 1 measly ADC pin, which could be reassigned should the user not want knock sensing. The software I have no clue how to achieve this..... (but you do) ;)

First implementation just like MS2 a digital pulse retards the timing a notch, later in the design maybe the PIN could measure an analogue value to indicate how serious it is and use a 1D map to retard by varying degrees.

We really need this Fred, c'mon don't be mean! Jared.... Back me up dude :)
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Knock sensing ideas and circuit designs

Post by Fred »

Dude, relax! I want it too!! But it's not crucial and will be after all sorts of other things. :-)

As for rolling road, if you want a hand I know a noob living in the midlands that is more than willing to help if you are down this way! :-)

BTW, the intelligent safety net is not having too tight a tune. If your tune has a little margin in it under optimal conditions it won't be that much worse (if any) but when things get worse (hot on the track or bad gas) it will be less damaging, possibly not damaging.

Logging it will be easy, and that is all you need for tuning. Aaron can put a red light in the display that says "its knocking" for noobs ;-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Knock sensing ideas and circuit designs

Post by jharvey »

Well time is tight right now, I'm trying to keep up. Any how enough for excuses, see below.

I think we should support two approaches, one being the remote via digital interface, the other being on-board with AN signals running out and about.

I think Dave's start is a great start, but I think it will need some work before it's doable. For example, in terms of interfacing, is the bias voltage only used for fault detection, or is it required for the pezio effect? If it's required, how much bias is required? Than what's a good decoupling size for the AN signal.

I'm trying to find that CAN bus knock sensor, but haven't had luck yet. Right now I think that might be the best solution for far far away, minimizing the noise floor and sending back the digi. If it is good for the digi, than we can mimic that and try to keep a common software interface. The best I've come up with has been SPI interfacing not CAN. Mostly found in this thread

http://www.diyefi.org/forum/viewtopic.p ... ock+sensor

So this chip seems to offer a BPF and signal strength. Windowing, and detecting is taken care of by the CPU. Or at least that's what I'm seeing in the short few minutes I've had with the data sheet. If that is correct, that is a fair part of the reason why I'm thinking the windowing and detection should be in the EMS. However, there may be other chips and solutions, so I'm still hunting around.
Post Reply