work in progress hip9011 integration

It's all about the code!
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

now I need some knock, any ideas?
[video][/video]
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

1.5 years in the making... we have knock detection on a real car! I need to thank everyone involved, guys, this would not happen without you :)

[video][/video]
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

russian wrote:1.5 years in the making... we have knock detection on a real car! I need to thank everyone involved, guys, this would not happen without you :)
Attachments
huzzah.jpg
huzzah.jpg (45.13 KiB) Viewed 21529 times
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post by kb1gtt »

Now that it's working, It's probably a good time to remind people about the stuff found here http://www.ti.com/product/TPIC8101/toolssoftware

It has some things we may have started to forget over the last long battle.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

kb1gtt wrote:Now that it's working, It's probably a good time to remind people about the stuff found here http://www.ti.com/product/TPIC8101/toolssoftware
What exact stuff? too much stuff there!
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post by kb1gtt »

I would say mostly these two PDF's

http://www.ti.com/lit/ug/tidu285/tidu285.pdf
http://www.ti.com/lit/ug/tidu286/tidu286.pdf

Seems there is some math, and process flow notes that might be handy to remember now that things are working reliably.
Welcome to the friendlier side of internet crazy :)
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

kb1gtt wrote:I would say mostly these two PDF's

http://www.ti.com/lit/ug/tidu285/tidu285.pdf
http://www.ti.com/lit/ug/tidu286/tidu286.pdf

Seems there is some math, and process flow notes that might be handy to remember now that things are working reliably.
I believe we have the math part dialed in. Sadly I have the equations burned into the back of my skull from staring at the datasheet for this IC for almost two years.

I'm not sure if this document and research was done before or after TI started producing the TPIC. It is still an interesting read with lots of good info on knock, digital signal processing, and harmonics. http://www.ti.com/lit/an/spra039/spra039.pdf
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

crystal hardware issue sub-thread is now http://rusefi.com/forum/viewtopic.php?f=4&t=903
logic levels hardware issue sub-thread is now http://rusefi.com/forum/viewtopic.php?f=4&t=904
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
RasPL
Posts: 24
Joined: Thu Oct 15, 2015 6:44 pm
Location: Poland

Re: hip9011 integration

Post by RasPL »

The middle frequency of bandpass filter depends from engine geometry and is constant for all the time. You can calculate it Knock frequency (kHz) = 1800/(PI * D) where D is cylinder bore diamater in mm.
Then you need to setup up Gain parameter that You have 2.5-3V knock voltage whitout knock and Integrator value set at about 100-200uSec.
Now next parameters like knock window and knock window start - advance angle ATDC from which You start searching knock for current ignition event and the lenght of this window in Degrees or just end angle
Next thing is to build engine noise table which is just knock voltage(rpm) function
And now You are ready to calculate knock level=knock voltage(rpm) - engine noise(rpm)
From knock level depends all corrections for next ignition event at this cylinder like ignition retard,fuel addition,boost reduction.

Good to start is read MS Mega Manual or just some standalone ECU manual. Here is manual for our polish ecumaster emu standalone ECU, knock sensing pages 80-82
http://ecumasterusa.com/downloads/emu-manual.pdf

With this manual You can very easy add other functions to rusefi ECU ;)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

RasPL wrote:Next thing is to build engine noise table which is just knock voltage(rpm) function
This. This looks to be the part rusEfi is currently missing and this matches my experience while playing with rusEfi - I was getting higher output the higher RPMs were.

Once I add the noiseTable the last remaining part is for rusEfi to end up in hands of somebody who can definitively induce knock and test all this. It looks like rusEfi would happen once I move to nowhere and get a dyno in my 12 car garage...
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
RasPL
Posts: 24
Joined: Thu Oct 15, 2015 6:44 pm
Location: Poland

Re: hip9011 integration

Post by RasPL »

Maybe just connect secound knock sensor to Mic input of PC/Laptop and use headphones or build/use some audio amplifier?
http://home.netcom.com/~bsundahl/knock/listen/listen.htm

here is some sound record of knocking engine
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

russian wrote:
RasPL wrote:Next thing is to build engine noise table which is just knock voltage(rpm) function
This. This looks to be the part rusEfi is currently missing and this matches my experience while playing with rusEfi - I was getting higher output the higher RPMs were.
https://sourceforge.net/p/rusefi/tickets/228/
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
KaxLon
Posts: 5
Joined: Fri Oct 30, 2015 2:54 pm
Location: Alingsås, Sweden

Re: hip9011 integration

Post by KaxLon »

Ok time for my first post on this forum. :)

I have been coding for the stock Mitsubishi ECU that is used in the 1G DSM and GVR4 cars. We have a knock sensor that is connected to a interface board that generates a signal for the processor to use.
The way a "standard" knock scheme works is by detecting abnormal, filtered sound levels at ignition events. The so-called event window.
For a long time there has been dispute over if we have a windowed mode ECU or not. I set out to find out lately and sure enough the knock is windowed.
I used a Arduino to generate the 6-7 kHz noise synced to the ignition event. The signal was set to the weakest possible knock detectable by the ECU.
Here's a video of the results:
Please watch in HD.

So to answer Andrey's question about how to generate knock. You can do this in many ways. Advance timing until the engine knocks, use a signal generator that has a sync trigger or by simply hooking up a Arduino to generate the noise.
.. Kim aka KaxLon ..
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

KaxLon wrote:You can do this in many ways. Advance timing until the engine knocks
Would it knock @ idle? If not, would it knock while revving with no load? If not, would it knock at 20 mph?

At this point I am satisfied with bench testing but still do not trust my results on the vehicle.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
KaxLon
Posts: 5
Joined: Fri Oct 30, 2015 2:54 pm
Location: Alingsås, Sweden

Re: hip9011 integration

Post by KaxLon »

Yes you can get it to knock at idle and very light loads. The degree of timing is different depending on engine. I know there's a MIT paper on this with calculations.
When I wish to provoke knock I play with the timing and fuel settings until I see knock. Give it a shot.
Just keep in mind that if you get knock at idle you can NOT drive the car as load will make the knock even worse with risk for disaster. ;)
.. Kim aka KaxLon ..
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

KaxLon wrote:When I wish to provoke knock I play with the timing and fuel settings until I see knock.
Can you give me at least some examples for some engine, just to know the ballpark. 40 advance & 17 AFR?

MIT paper... Any chance you point me at it? :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
KaxLon
Posts: 5
Joined: Fri Oct 30, 2015 2:54 pm
Location: Alingsås, Sweden

Re: hip9011 integration

Post by KaxLon »

Hmmm I have to look for that document on my harddrives.
In the meanwhile you might enjoy this on knock and ethanol: http://www.kaxlon.com/dsmecu/2015/PDF%20Books/2008-32-0020%20Effect%20of%20Ethanol%20on%20Knock%20in%20Spark%20Ignition%20Gasoline%20Engines.pdf

LoL 40* @ AFR 17 would certainly knock. :)
.. Kim aka KaxLon ..
User avatar
RasPL
Posts: 24
Joined: Thu Oct 15, 2015 6:44 pm
Location: Poland

Re: hip9011 integration

Post by RasPL »

Yes engine can knock at idle without playing with fuel amount only one thing what you need is retard ignition too much. Engine will start knocking. Too much retard will make bum and engine can make revolution in oposit side and stops. This knows all users with normal dizzy.

Knocking depends from engine combustion chamber, some engines knocks easlyer some harder but i dont know engine which can handle 40deg retard at idle speed.

Next thing. My stock ecu (digifant df1) have knock gain(rpm) map not a knock noise(rpm) map. But this gives almost the same final result.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post by kb1gtt »

I believe knock at idle can also be effected partly by carbon build up. My first car used to knock so bad it would diesel when turned off. A friend drove it around the block even though I had the key in my hand. I believe that carbon build up was causing the compression ratio to be much higher than expected, which was acting like a diesel engine. When I turned off the ignition, it would continue to have ignition just like a diesel. So that particular engine would have had very little difference by varying the timing.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

russian wrote:This. This looks to be the part rusEfi is currently missing and this matches my experience while playing with rusEfi - I was getting higher output the higher RPMs were.
Progress:
Image
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

This one in Russia and Celsius. No knock with no load, lean mixture and 50 degree advance :(

[video][/video]
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
sasha.kams
Posts: 33
Joined: Thu Aug 21, 2014 5:30 pm
Location: Russia, Saratov

Re: hip9011 integration

Post by sasha.kams »

No load, not hear the detonation. And impoverish the mixture is not necessary, the sudden opening of the throttle he is depleted.
Translated by Google, Sorry if it is not correct.
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

Perhaps you should try to create an audible knock (you can hear it with your own ears) and then take a look at the TPIC output.

I am doing some on car testing myself today. My hardware and algorithms are a little bit different, but the data should still be relevant. I'll report back when I have more data.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

Spilly wrote:Perhaps you should try to create an audible knock
I think this has been proven good enough for a bench test already, eventually a real test would be needed.

My next step is to try running on gas+diesel mixture and help me god.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

russian wrote: I think this has been proven good enough for a bench test already, eventually a real test would be needed.

My next step is to try running on gas+diesel mixture and help me god.
Take the car for a drive to put a load on it. If your exhaust isn't too loud, do a wide open throttle run and listen for knock. The more cylinder pressure you can generate, the better.
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

I've been pulling my hair out all day trying to figure out what is going on here. Wide open throttle pulls on the road and free revving the engine results in the integrator output increasing with the rpm. I'm about 90% confident that the engine is not knocking. Since the car has no sound deadening, very stiff motor mounts that make everything rattle, and a noisy exhaust, it is difficult to hear knock.

I can't afford to invest in a new ECU at the moment, so my setup is a bit different. I'm running a megasquirt 2 ecu and I am feeding one of its ADC's the output from a sample and hold circuit (holds the previous voltage while INT/HOLD is active and updates to the new voltage when INT/HOLD is inactive) fed by the TPIC's analog output.

I'm using a different microcontroller and RTOS to control the TPIC. However, the algorithms are very similar.

Here's a recent datalog.

Image
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

Spilly wrote:Wide open throttle pulls on the road and free revving the engine results in the integrator output increasing with the rpm. I'm about 90% confident that the engine is not knocking.
I believe that's expected behavior - engine noise increases with increase in RPM so you need your knock detection threshold to be a curve based on RPM, see above? That's assuming this is the part you are pulling you hair about :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

russian wrote:
Spilly wrote:Wide open throttle pulls on the road and free revving the engine results in the integrator output increasing with the rpm. I'm about 90% confident that the engine is not knocking.
I believe that's expected behavior - engine noise increases with increase in RPM so you need your knock detection threshold to be a curve based on RPM, see above? That's assuming this is the part you are pulling you hair about :)
I guess my concern is that the usable RPM range is rather narrow. I believe my integrator's output is maxed when the datalog says 78% (output appears to flatten). I'm going to play with adjusting the gain inversely with RPM in an attempt to widen the usable RPM range.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

I've noticed the same and I am on gain 0.3
You remeber that 6.8 gain divider in older revisions? I believe it was influenced by some OEM schematics
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Rhinoman
contributor
contributor
Posts: 256
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK

Re: hip9011 integration

Post by Rhinoman »

What window are you using? you will need to adjust that to suit your engine. How is the knock sensor mounted? it is very important that the mounting surfaces are flat and the sensor is correctly torqued. In a previous job I used to design this type of sensor and interface circuitry, most of the issues that we had, even on the vibrator, were from the mounting of the sensor; even the weight of the wires can cause a resonance.
Post Reply