Knock Detection with variable sensitivity over RPM

A forum for discussing the MegaSquirt related (but non-B&G) board development, assembly, installation, and testing.

Moderators: jsmcortina, muythaibxr

Locked
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Multi-processor technology awesome. :D
One of those CPUs is the master. Or you using spi . I would have thought that with all those CPUs multitasking
speed would be your last area of concern. CPU for calculations,CPU for I/O . Great idea
Last edited by HOODEY on Sun Nov 13, 2011 8:57 am, edited 1 time in total.
420aRaf
Helpful MS/Extra'er
Posts: 59
Joined: Thu Feb 19, 2009 4:33 pm
Location: Staunton, VA

Re: Knock Detection with variable sensitivity over RPM

Post by 420aRaf »

HOODEY wrote:When you say count frequency are you refering to measuring rpm? Are you using DSp to process the knock signal. FFT etc?
RPM and knock sensor KHz, the opamp converts the signal into a workable signal for the 16f PIC.

I know that you read/write values from the tpic using a computer(?), but why not let the PIC do it all?
Curious about how you connect 4n25s to cam sensors. Do you a resistor?
All my resistors and capacitors are surface mount.
I have used a recording with knock to verify. I am Still testing like you as well.
Keep us updated and don’t be afraid to put your pictures back up, your posts look blank without them. It will inspire others to make something like it. (Like me)
Good work guy seems like you are well versed with PICs
Thanks. I am, I have so many of them. The 18f is twice as fast as the 16f series; I may go this route as well. I have several 18fs lying around along with several dspics, but i don't need the speed. (still looking into the dspic)
-Rafiel
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Having difficult reading TDC and POSTION signalS. If I read TDC signal as soon as I hook up the POSITION signal
engine starts to idle poorly. Any idea how to read the signal without affecting the ECU?
420aRaf
Helpful MS/Extra'er
Posts: 59
Joined: Thu Feb 19, 2009 4:33 pm
Location: Staunton, VA

Re: Knock Detection with variable sensitivity over RPM

Post by 420aRaf »

The PICs input pin should be high impedance; I’ve measured low, sensitive voltages with no problem many times. I used the 4n25(s) just to be on the safe side of things. (I know my cam sensor outputs like 20-60mv)
-Rafiel
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Solved the problem by using a resitor to feedthe pin.

I was datalogging to flash memory but realised it can be very slow to write 8bytes of flash. So I write the data to the ram and then copy it to the flash memory.

The flash is full in about a second. :shock:

I think I wille be upgrading one more time to the pic18f2452 which has a faster ADC. Time is precious escpecially when a cylinder is firing every 120degress.
h22
Helpful MS/Extra'er
Posts: 107
Joined: Wed May 27, 2009 12:05 pm

Re: Knock Detection with variable sensitivity over RPM

Post by h22 »

survey
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

420aRaf can you show us what is displayed on your LCD.

I guess you are using the op amp connected to the pic as an integrator to integrate the knock signal.

Send me some 18f4520 man!!!! :D

Currently determing the time of various calcualtion subroutines. I have 990us to play with before the next cylinder fires(wrose case scenario).
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Thanks hardware multiplier. :mrgreen:

Just shaved 100us off the time.Major calculations are now down to 225us
420aRaf
Helpful MS/Extra'er
Posts: 59
Joined: Thu Feb 19, 2009 4:33 pm
Location: Staunton, VA

Re: Knock Detection with variable sensitivity over RPM

Post by 420aRaf »

HOODEY wrote:420aRaf can you show us what is displayed on your LCD.
Here are my old pictures I have from my first box, I don’t have any recent pictures of my 2nd box but it was a similar approach.

Image

Image

Image

Image

KHZ = Frequency in KHz from knock sensor

LKCK = Last knock percentage tied in which uses an algorithm for ADC and KHZ multi oversampled in TDC; was just based on ADC.

WDO = Current rpm window, I also had a last knocking window

LCAM = Last cam experience knock – getting rid of this approach

Problem with this is that you would need a datalogg to find useful patterns, but other than that it worked well.

When all conditions are true:

Image

If I tell you too much your project will be looking like mine. :lol: I have made progress myself between working on other projects. My current one focuses on knock counts and differences between samples. I now am using only one chip dedicated to processing and one for LCD. I could squeeze it all on one chip (18f2455) but I’m just too lazy. You may be able to process calculations fast but when working on one chip the major thing that eats up time is the live serial communication after every TDC samples. But I managed to do everything on the 16f887 so I’m going to move everything to the 18f. I am also going smaller with an 8x2 LCD. Keeping it as portable and simple as possible, so in other words I’m getting rid of the bling and displaying only numbers. Yeah, stuff gets tight at high rpm where I have to complete everything under 2 milliseconds. At the end of the day it comes down to how well it works on your engine not how fast you can process data although it's a small feat.

I don’t want this thread to be a HOODEY, 420aRaf knock detection thread. I just wanted to share what I made because of it.

EDIT: Nvm, if using hardware serial Uart it wont eat up time, and multiplying is indeed awesome!
-Rafiel
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Cool. Completely different approach to me. I am about the bling and generic application factor.

Some of the terms used are bit confusing though. Why not use the term Cylinder? Also THD?

Wondering how you measure knock frequency as the signal from the knock sensor is packed with multiple frequencies.

Looking good though.
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Estimating Knock frequency based on cylinder bore diameter..


http://bajanchameleon.com/knockfreq.wmv
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Trying to inpsire...
Last edited by HOODEY on Sun Nov 13, 2011 8:58 am, edited 1 time in total.
a73camaro
Experienced MS/Extra'er
Posts: 231
Joined: Fri Oct 08, 2004 6:44 am
Location: Dillon, CO

Re: Knock Detection with variable sensitivity over RPM

Post by a73camaro »

This goes back a little bit. How come the output of the 555 timer circuit is set for 0.4 of a second (1.1 * 39,000 * 0.000010)? There could be up to a hundred ignition events in that time frame.

Image
MSII v3.0, Extra 3.0.3s
masterx81
Master MS/Extra'er
Posts: 776
Joined: Mon Oct 25, 2004 7:36 am
Location: Asti - Italy

Re: Knock Detection with variable sensitivity over RPM

Post by masterx81 »

This products would be intended to use in a stand alone configuration, or maybe only work with the megasquirt?

In those mcu applications with external dsp's, are all decoding directly the trigger wheels?
This can be a quite difficult task, especially taking in account the there are a lot of trigger wheels around...

And add something to talk with megasquirt? Maybe using the tach output for AT LEAST the TDC and REV signal?
The tach output is fired at a fixed angle vs the TDC?
Reamain to decode the cam signal, for know what cylinder had det. Maybe this can be done directly in the ms3 firmware?
Enrico
Opel/Vauxhall Corsa GSi MS2
Subaru v4 EJ20 MS3
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

In those mcu applications with external dsp's, are all decoding directly the trigger wheels?
This can be a quite difficult task, especially taking in account the there are a lot of trigger wheels around...

Correct..The sensible thing to do is to focus on the known well establisehd high performance vehicles.
dirtytorque
Helpful MS/Extra'er
Posts: 50
Joined: Thu Mar 12, 2009 11:01 am
Location: Berkshire UK

Re: Knock Detection with variable sensitivity over RPM

Post by dirtytorque »

well while you guys develop your own solutions i think it is only fair to test the already available and developed knocksense units that can be bought at a reasonable price.
I simply gave it power and connected it to my knock sensor.While revving my engine it indicated no knock events which I was happy with,but with the engine running if I hit the side of the engine block with a hammer it did indeed register this as knock,so it has passed this somewhat crude first test. 8) :RTFM:
More testing to be done shortly.
paulpug
Helpful MS/Extra'er
Posts: 131
Joined: Wed Nov 11, 2009 9:12 am

Re: Knock Detection with variable sensitivity over RPM

Post by paulpug »

Hi ,

where can the relatively cheap completed knock systems be purchased ,i have been trying to follow these post ,but is not able to get any information about any of these units.

Paul
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Knock Detection with variable sensitivity over RPM

Post by jsmcortina »

Try this:
http://www.viatrack.ca/

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".
HOODEY
Helpful MS/Extra'er
Posts: 115
Joined: Sat Feb 21, 2009 5:18 pm

Re: Knock Detection with variable sensitivity over RPM

Post by HOODEY »

Be pateint testing takes a lot of time.Especially in an automitive environment.
Last edited by HOODEY on Sun Nov 13, 2011 8:58 am, edited 2 times in total.
dirtytorque
Helpful MS/Extra'er
Posts: 50
Joined: Thu Mar 12, 2009 11:01 am
Location: Berkshire UK

Re: Knock Detection with variable sensitivity over RPM

Post by dirtytorque »

So ...the red line is the amount of spark retard at a given moment in time.
For every knock event the system is set to retard the timing by 3 degrees so at the point where i have the log set you can see i hit the engine three times in short sucession as the amount of overall ignition retard is nine degrees.You can see the rpm dropped slightly when the igniton timing was pulled along with the engine pulling slightly less vacuum(The blue line).As you can see the green line represents the actual amount of ignition timing seen at the flywheel.I want to just use the logging facilities already built into MS to analyse the data.


I am interested to see if there is a correlation between EGT's and det when i do some real driving testing once I get the car taxed this week.
Locked