Software knock processing

It's all about the code!
Hmelik
Posts: 14
Joined: Sun Jan 16, 2022 5:07 pm

Re: Software knock processing

Post by Hmelik »

neongreen
Posts: 44
Joined: Fri Apr 10, 2020 12:17 pm

Re: Software knock processing

Post by neongreen »

I'd really like to use knock logic in my project, but I have Frankenso. I understand it's currently only on some boards (Proteus and hellen?). Is there a reason we can't activate the logic on other boards? I have no issue repinning the harness to put knock on ADC03.
1962 Ford Falcon 5.0L V8 / T5
User avatar
AndreyB
Site Admin
Posts: 14583
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Software knock processing

Post by AndreyB »

neongreen wrote:
Mon Apr 24, 2023 1:26 am
it's currently only on some boards (Proteus and hellen?)
Frankenso has totally different electronics for knock, the not-software but ASIC approach which did not work out for us.

This thread saying "Software knock" means "not ASIC like on Frankenso"
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
neongreen
Posts: 44
Joined: Fri Apr 10, 2020 12:17 pm

Re: Software knock processing

Post by neongreen »

AndreyB wrote:
Mon Apr 24, 2023 4:27 am
neongreen wrote:
Mon Apr 24, 2023 1:26 am
it's currently only on some boards (Proteus and hellen?)
Frankenso has totally different electronics for knock, the not-software but ASIC approach which did not work out for us.

This thread saying "Software knock" means "not ASIC like on Frankenso"
Understood, but what I'm asking is why can software knock not be used on Frankenso? It has an ADC03.

I also realize that the frankenso doesn't have a knock amp, which is why I copied the proteus amp and had it built as an add on board.

Image

There is no access to the software knock in the F407 Discovery firmware version. Could that be activated?
1962 Ford Falcon 5.0L V8 / T5
User avatar
AndreyB
Site Admin
Posts: 14583
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Software knock processing

Post by AndreyB »

Ohhh now I understand the ask.

It could be possible, it could be pretty small effort but I am very overloaded on software side I can really use help from other software people.

https://github.com/rusefi/rusefi/issues/5254

First like of progress https://github.com/rusefi/rusefi/commit/75d14a0cea44c4aa325dd61058353eb8e85946fe
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
neongreen
Posts: 44
Joined: Fri Apr 10, 2020 12:17 pm

Re: Software knock processing

Post by neongreen »

Thanks Andrey. I wish I were more help on software, but looking at the code I feel like a six year old attempting to figure out how an Airbus A320 works.
1962 Ford Falcon 5.0L V8 / T5
User avatar
AndreyB
Site Admin
Posts: 14583
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Software knock processing

Post by AndreyB »

vag0dr04er is teasing me so let me tease everyone else
WhatsApp Image 2024-03-23 at 06.08.18_348ef01d.jpg
WhatsApp Image 2024-03-23 at 06.08.18_348ef01d.jpg (347.64 KiB) Viewed 12455 times
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: 14583
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Software knock processing

Post by AndreyB »

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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: Software knock processing

Post by tmbryhn »

Great demo video 👍🏼

I've been playing around with knock in RusEFi for some time, and come across a limitation in flexibility that sets it apart from eg. MS3 that uses the dedicated TI knock DSP chip.

Particularly on setups that utilises one knock sensor, there's sometimes a non-trivial delta in peak noise level generated by the individual cylinders. On systems using a global knock threshold (like RusEFi and MS3), this can be problematic to fine tune unless a sound gain can be defined on a per-cylinder basis. MS3 has this feature as a part of the DSP stage which allows for a more or less equal amplitude between the different cylinders.

As I understand it, RusEFi operates with a fixed gain analog filter input feeding directly into the dedicated knock DSP ADC. To implement a variable gain feature; could instead the digital value generated by the ADC be scaled by a variable factor associated with each cylinder as a type of "software gain" feature?
User avatar
AndreyB
Site Admin
Posts: 14583
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Software knock processing

Post by AndreyB »

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: 14583
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Software knock processing

Post by AndreyB »

Alexey @vag0dr04er has contributed _something_ - right now it's available in Proteus firmware, let me see if I can also enable it for 4chan and uaefi

https://github.com/rusefi/rusefi/pull/6467
image.png
image.png (753.07 KiB) Viewed 10532 times
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
vag0dr04er
Posts: 4
Joined: Sat May 04, 2024 9:51 am
Github Username: 3eR0.1ive

Re: Software knock processing

Post by vag0dr04er »

While studying detonation on a real car, I found some discrepancy between theory and practice.

I recorded real detonation on a sound card and analyzed it with spectral analysis.
1. light detonation
2. strong detonation
photo_2024-09-08_15-04-47.jpg
photo_2024-09-08_15-04-47.jpg (207.46 KiB) Viewed 5973 times
VID-20240902-WA0001.mp4
(7.95 MiB) Downloaded 169 times
Given:
4g63 turbo, garrett2871, boost 1 bar, fuel euro RON 95.
Cylinder diameter 85 mm.

Using a simple but widely used formula for calculating detonation frequency, we calculate the estimated frequency:

f (Hz) = 900 / (PI * r)
6744 Hz = 900 / (3.14 * 0.0425)

The estimated detonation frequency is expected at 6.7 kHz, but in a real car it is best heard at about 5.6 kHz.

The worst thing is that detonation is least audible at the estimated frequency!

knock_real_freq.jpg
knock_real_freq.jpg (292.63 KiB) Viewed 5973 times
Perhaps this is specific to this car.
Perhaps the calculation formula is too simple or incorrect, I have not found another.
This requires research.

I'll try to set up software detonation detection better with this reference.
vag0dr04er
Posts: 4
Joined: Sat May 04, 2024 9:51 am
Github Username: 3eR0.1ive

Re: Software knock processing

Post by vag0dr04er »

rusefi plugin knock analyzer
rusefi plugin knock analyzer
2024-11-05-172216_1920x1200_scrot.png (219.56 KiB) Viewed 3282 times



I transferred the detonation spectrum analysis from the console to TunerStudio.
An analysis of each sensor or cylinder was also added.

The plugin is available for bundle proteus f7, f4. Technically, it will compile on uaefi and Alphax-4chan, but the bundle is not available yet.


knock_parameters.png
knock_parameters.png (106.85 KiB) Viewed 3282 times

1. Enabling analysis, sensitivity and
display of a signal filtered at a given frequency.

2. As well as correction of fuel for detonation.

3. Suppression of all corrections by knock (angle retard, fuel) when theTPS is released. (When changing gears, the engine may make noise like detonation or just when coasting)
mk e
Posts: 546
Joined: Tue Dec 06, 2016 7:32 pm

Re: Software knock processing

Post by mk e »

vag0dr04er wrote:
Sun Sep 08, 2024 12:20 pm


Given:
4g63 turbo, garrett2871, boost 1 bar, fuel euro RON 95.
Cylinder diameter 85 mm.

Using a simple but widely used formula for calculating detonation frequency, we calculate the estimated frequency:

f (Hz) = 900 / (PI * r)
6744 Hz = 900 / (3.14 * 0.0425)

The estimated detonation frequency is expected at 6.7 kHz, but in a real car it is best heard at about 5.6 kHz.

The worst thing is that detonation is least audible at the estimated frequency!


Perhaps this is specific to this car.
Perhaps the calculation formula is too simple or incorrect, I have not found another.
This requires research.
The formula really only applies to engines with open combustion chamber heads found on older engine designs. Simple shape, simple math.

Newer combustion chambers (and pistons) are specifically designed to prevent and disrupt detonation. Also any way to reduce engine noise is a concern so castings and mounts designed to damp the loudest frequencies like the primary detonation frequency) which makes the math to predict where you'll get the best indication of detonation a starting point at best so A+ for measuring it.

Forgot, the harmonics tend to be more predictable so you might want to take a listen around 13.5khz
User avatar
kneelo
Posts: 45
Joined: Sun Jun 10, 2018 6:36 am
Location: Western Australia

Re: Software knock processing

Post by kneelo »

I have been slowly working my way through the back catalogue of HPA podcasts and came across this interview with a guy from plex tuning. It almost 2 hrs long but theres a lot of really interesting info regarding DSP strategies to detect knock to target frequencies and how to validate on the car.

https://www.hpacademy.com/blog/081-properly-understand-knock-and-become-a-better-tuner-podcast/
Post Reply