[info] VR + knock module

Hardware inside and outside of the ECU
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: VR + knock module

Post by kb1gtt »

If IO isn't the real concern, we can do the SSR thing. Would both be tied together? I have seen one use hall and one use VR, so I think we need to keep them separated. So that's 2 IO lines not 1 IO line.
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: VR + knock module

Post by AndreyB »

I am sure there are setups where one signal is VR and another is Hall.
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: VR + knock module

Post by AndreyB »

historically we have MAX9926 here with an op-amp on the same board. We need a smaller add-on board for prototyping are for just MAX9926 I guess we can just cu t the op-amp off?
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: VR + knock module

Post by kb1gtt »

The MAX9939 opamp is a potential alternative to the HIP or TPIC knock chip. The MAX9939 costs about $3 for 2 channels while the TPIC and HIP cost about $5. The MAX9939 also allows one knock, if you desire only one knock instead of paying for 2 knock's. The MAX9939 offers differential inputs while the HIP and TPIC are single sided. This allows the MAX chip to have a better noise rejection. However to use this chip you need consume more CPU cycles, as you need to do some FIR filtering stuff in software. Should I ping you about how to do the knock filtering in software? I know you have been fighting with the TPIC/HIP option, but I also believe that's probably working now.
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: VR + knock module

Post by AndreyB »

low chance of software knock in the near or midbterms future but a higher chance of third or fouth input, that why i am looking for a smaller expansion board with vr separated from op-amp
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: VR + knock module

Post by kb1gtt »

It should be easy enough to trim the board, such that it's only VR. Should I add it to my plate?
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: VR + knock module

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
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: VR + knock module

Post by kb1gtt »

A reminder about software knock. This proto board used the MAX9939. Files found here.
https://github.com/rusefi/rusefi/tree/master/hardware/knock_VR_Art_ELectro
Welcome to the friendlier side of internet crazy :)
User avatar
sepp2gl
Posts: 34
Joined: Sat Jan 01, 2022 3:47 pm
Location: Germany
Github Username: sepp2gl

Re: [help needed] VR + knock module

Post by sepp2gl »

Hi guys,
looking through this thread, this one seems to be quite controversal. And I would like to learn about the experience, that you made with the different approaches.
kb1gtt wrote:
Thu Nov 14, 2013 9:59 am
[edit] Most knock sensor chips are reasonably blah. The bandpass filters are poor and the energy detection circuits are limited. [/edit] The HIP9011 is better but still blah. It claims a Q of 2.4, and we are typically looking for a frequency of 5 to 6 kHz. From here http://www.sengpielaudio.com/calculator-cutoffFrequencies.htm I see that with a center frequency of 5600 Hz, and a Q of 2.4 we get a lower cut off of 4553.57 Hz and a higher cut off of 6886.904 Hz. Note that's the 3db point, in reality you're energy detector is going to pickup energy from beyond the 3db points, so a more realistic range of frequencies that would likely be picked up will probably start around 3500 Hz and up to 8500 Hz. Then you have a lack of control over the energy detection level. Such a filter is blah. A much better filter can be cone in software, as well as control over the energy detection level is handy. Basically you want something that will actively establish the noise floor, then look for the peak at a specific windowed time. To get that data from this 9011 chip is reasonably hard and convoluted, so I suggest the MAX9939 if we can convince the software folks that the software is manageable.
I would agree with your statement about filter-Q, which is not very impressing indeed, if you exactly knew the characteristic knock-frequency of an engine.
And I think you do not. The knock frequency slightly varies from engine to engine and also depends on the engine operating point. The basic oscillation normally is somewhere between 6 to 8kHz. In severe cases 2nd order and even 3rd order are also used for knock detection depending on engine op-point (whereever discrimination is better).
So trying to be too sharp with the filter-Q might degrade the discrimination of knock-oscillation rather than supporting it, if it is outside a too narrow filter characteristic.
Doing the filtering by software would need a sample-frequency of ~40kHz. I am not sure, this is what you intend to do.
kb1gtt wrote:
Thu Nov 14, 2013 9:59 am
I understand that generic filter libraries can be found, so I see the key software to be developed as the energy detector, which I don't see as very hard. Basically you simply look at the amplitude after the filter and if above a threshold, in a window of time, it's a detected knock. I like this approach as you'll also have access to low level information that can be handy for diagnostics, which is lost with any of these knock chips.
This concept was in production by a big EMS-supplier in 1992. It was not competitive versus the windowed integrator those days.
To me the TPIC- and HIP-Chips provide a pretty good analog pre-conditioning of the knock-signal with very few external components.
I developed a Op-Amp-based knock-signal discriminator between 1984 and 1989 for series-production. It was less effective, more space-consuming on the board and more expensive than the TPIC/HIP-Chip. If those had been available at that time, I wouldn't have thought twice. Nevertheless this discrimnation concept is now proven in millions of engines.
Today with much higher digital processing performance, digital filters are quite attractive. But you might need a dedicated processor to take care for the filtering and windowing, and this is exactly what the TPIC does. That's why I tend to disagree with your assessment.

Looking forward to an interesting discussion
sepp2gl
Everything keeps being better ... ;)
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: VR + knock module

Post by mck1117 »

This thread is stale at this point - we have fully working knock detection without an ASIC. Samples at ~220khz, selectable filter center frequency. Works pretty well on the second harmonic. Detected real knock that was enough to push out my head gasket, but light enough to not pit the cylinder head.

See: https://rusefi.com/forum/viewtopic.php?t=1469
User avatar
sepp2gl
Posts: 34
Joined: Sat Jan 01, 2022 3:47 pm
Location: Germany
Github Username: sepp2gl

Re: VR + knock module

Post by sepp2gl »

@mck1117:
Where are those findings posted?
mck1117 wrote:
Sun Jan 02, 2022 8:17 pm
Detected real knock that was enough to push out my head gasket, but light enough to not pit the cylinder head.
See: https://rusefi.com/forum/viewtopic.php?t=1469
What do you mean by that statement?
Your detection was capable detecting knock, that damaged your engine gasket? How about lower knock occurrences?

Following above link:
I wonder about 30-35% CPU load-coverage due to knock detection?
What is the benefit of the software approach? Better functionality? Lower cost? Smaller PCB-space?

From here I will continue on the "software knock detection" thread.
kr, sepp2gl
Everything keeps being better ... ;)
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

Maybe someone want to try this schematic of VR sensor amplifier and conditioner

VR - red,
V5 - purple.

Best regards, Luk
Attachments
obraz.png
obraz.png (268.5 KiB) Viewed 50026 times
sim.png
sim.png (41.1 KiB) Viewed 50026 times
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: VR + knock module

Post by AndreyB »

Smoczy wrote:
Sun Sep 10, 2023 11:47 am
Maybe someone want to try
Exciting to see kicad and simulation can you please publish kicad and simulation raw files?

Any chance you could comment key ideas of this schematics right on the kicad page?
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
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

As You wish... :)
The main idea is like in MAX992x or LM1815, so that the offset voltage follows the amplitude of the VR signal. Input amp reject common signal (as most noise from ignition etc.), and the main is to trigger on the rising edge in 0V, and falling edge below 0V. Following the amplitude of the VR signal allows for the rejection of much smaller interfering signals (as seen in the simulation shown).
This is just an idea and requires refinement of details, such as the useful signal is a falling edge at the output of the system, because it is generated by the R14 - C3 circuit (the rising edge is R13 + R14 - C3). The circuit should respond to the falling edge of the VR signal, because then we are in the "middle" of the tooth, although it is enough to connect the signal from the VR sensor in reverse and the effect will be almost identical.
Components are quite chip, below 1USD (1 pcs LM324, 1pcs. LM393 and few R and C components).
Best regards, Lukasz
Attachments
VR.ZIP
(109.92 KiB) Downloaded 405 times
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

Please let me know if anyone has done it, and let me know your comments and observations
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: VR + knock module

Post by AndreyB »

Smoczy wrote:
Thu Sep 14, 2023 7:58 am
Please let me know if anyone has done it, and let me know your comments and observations
what problem does this solve on top of existing https://github.com/mck1117/vr-interface?

The open problem I am aware of would be a single-wire VR/Hall hybrid solution https://github.com/andreika-git/hellen-one/issues/285
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
sepp2gl
Posts: 34
Joined: Sat Jan 01, 2022 3:47 pm
Location: Germany
Github Username: sepp2gl

Re: VR + knock module

Post by sepp2gl »

@AndrejB:
...without being involved in the creation of either of both circuits...
TMHO Smoczy's circuit provides following advantages compared to the VR-module, that you show:
1. It is simpler and involves less circuitry, which leads to...
...lower cost
...smaller space
2. It has an adaptive functionality, that allows for automatic adaptation to...
... very small signal-levels, that you might suffer @very low engine-speeds during engine start with low battery
... very high signal-levels, that you will have @high engine speeds

Two questions of understanding from my side:
1. what is the VR-module intended to be applied for?
- engine-speed (in case which crankshaft coding?)?
- whee-speed?
- any other?
2. why don't you use a custom-chip instead, rather than discrete circuitry?

kr, sepp2gl
Everything keeps being better ... ;)
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: VR + knock module

Post by AndreyB »

sepp2gl wrote:
Thu Sep 14, 2023 3:29 pm
why don't you use a custom-chip instead, rather than discrete circuitry?
Reasons change over the time for sure.

Main focus is still universal crank/cam decoding, i.e. from 60/2 on the crank to only couple of teeth on cam.

At some point we needed 100% assembly specifically at JLCPCB while JLCPCB was only working with a limited library. Quite many things have changed since then - JLC is now happy to purchase any components for us, so MAX992x is assembled is now assembled at JLCPBC.

Second reason is the MAX992x 80ms timeout - Subaru 6/7 is a typical example where MAX992x with 80ms timeout fails.

Latest motivation to keep improving is https://github.com/andreika-git/hellen-one/issues/285 - we really want universal hardware with same single pin working both for VR and Hall without hardware mods.

I am freaking out a bit about the complexity of proper testing of the whole VR area. Right now I do not have enough motivation to be involved in a two wire VR-only development, it would take a promise of single-wire VR+Hall for me to be trying things.

By the way yes https://github.com/mck1117/vr-interface lacking adaptive functionality is a huge usability problem thus latest https://github.com/rusefi/alphax-2chan went back to MAX and alphax-8chan is probably mixing some MAX with some discrete!
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
sepp2gl
Posts: 34
Joined: Sat Jan 01, 2022 3:47 pm
Location: Germany
Github Username: sepp2gl

Re: VR + knock module

Post by sepp2gl »

@AndrejB:
...well, priorities change over time, too...
I would never try to sense the Cam-Teeth wit VR; there are good reasons why most of the OEMs don't do.

For the commonality between VR-1wire and Hall, I guess a circuitry with 1 Opamp should do (incl. adaptive thresh).
For VR-2wire maybe 3 Opamps might be necessairy.
All together on one board could be achieved by assembly options of passive components.

I really wonder about the high hardware content just for a VR interface commodity, that is state-of-the-art for more than 40 years.
There should be tons of literature around incl. finished patents to cover that effectively (and quite more efficient).

kr, sepp2gl
Everything keeps being better ... ;)
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

obraz.png
obraz.png (269.43 KiB) Viewed 49791 times
It look like it will be good even for single wire VR sensor.
Attachments
sim1.png
sim1.png (35.06 KiB) Viewed 49791 times
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

AndreyB wrote:
Thu Sep 14, 2023 11:54 am
Smoczy wrote:
Thu Sep 14, 2023 7:58 am
Please let me know if anyone has done it, and let me know your comments and observations
what problem does this solve on top of existing https://github.com/mck1117/vr-interface?

The open problem I am aware of would be a single-wire VR/Hall hybrid solution https://github.com/andreika-git/hellen-one/issues/285
It solve some diferent problems:
1. It have less IC (only 2),
2. It is autoadaptive, and a point of edge always at 0V, even if amplitude rises or falls, (second edge id not important, and should have different voltage comparation than first edge)
3. It can be used as 1 wire VR (I'm not sure, but I have to test it),
4. In solution with Hall input, we don't need any amplifier, only comparator with Vref point in the middle of signal amplitude.

These were the basic assumptions of the project. I haven't made the layout yet, but when I do, I will try to make tests and present them here. Unless someone does it first?
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: VR + knock module

Post by AndreyB »

Smoczy wrote:
Thu Sep 14, 2023 8:28 pm
I haven't made the layout yet, but when I do, I will try to make tests and present them here. Unless someone does it first?
yes please yes!!!

thank you for sweet content :)
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
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

obraz.png
obraz.png (289.68 KiB) Viewed 49373 times
Take a look,
1. In 2 wire VR all jumpers are open, no R11.
2. In 1 wire VR JP1 short, no R11, no D2 - D4.
3. In HALL sensor, all jumpers short, no U2, no R2 - R3, no C1, no D3 - D6 , no R4 - R10, no C2. VCC is the same voltage for power Hall sensor.
Any comment and I'm waiting for criticism :)
Lukasz
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: VR + knock module

Post by AndreyB »

Do you have a URL for your github repo or something similar? :)
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
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

no i haven't.
Why do You ask?
Best regards, Lukasz
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: VR + knock module

Post by AndreyB »

Smoczy wrote:
Thu Sep 28, 2023 8:31 pm
Why do You ask?
I believe that screenshots are not the best way to share schematics. I guess a combination of PDF + kicad source file are the best combo? And ideally those have a URL?

Another part of the question is if you went as far as making a test PCB with test points and JLCPCB BOM/gerber/placement. Overall I am trying to weight if and how I should get involved. What's the proper way to design a VR conditioner? Would just great simulation be sufficient or would we need some real vehicle signal recording? What would one use to play back a real signal? Meaning again same thing: what would be needed to get better than MAX992x.
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
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: VR + knock module

Post by mck1117 »

AndreyB wrote:
Thu Sep 28, 2023 8:45 pm
Meaning again same thing: what would be needed to get better than MAX992x.
Or to be better than the existing discrete VR designs that don't use an expensive chip like the MAX992x.
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: VR + knock module

Post by AndreyB »

mck1117 wrote:
Thu Sep 28, 2023 8:47 pm
Or to be better than the existing discrete VR designs that don't use an expensive chip like the MAX992x.
At the moment the $2 MAX9924 wins by removing the requirement for skilled threshold tuning.

My priority list is
1-2) same SINGLE pin VR/Hall input
1-2) auto-threshold
3) price does not matter as long as under $10 per channel
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
Smoczy
Posts: 12
Joined: Sun Sep 10, 2023 11:21 am
Github Username: Smoczy

Re: VR + knock module

Post by Smoczy »

In my opinion, we don't have to be better than MAX992x, it's enough if we are the same (which will make us better because we will do it cheaper, and no 80ms trigger lock). I'm now working on a prototype of the system that I can test on a single-cylinder motorcycle engine. So I don't have to artificially create a VR signal, I will actually have it.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: VR + knock module

Post by mck1117 »

AndreyB wrote:
Thu Sep 28, 2023 9:01 pm
1-2) same SINGLE pin VR/Hall input
The discrete VR design I did works as "single pin" if you delete the steering diodes and ground the VR- input.
Post Reply