hip9011 - 3v to 5v level issues

Hardware inside and outside of the ECU
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

hip9011 - 3v to 5v level issues

Post by AndreyB »

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

Re: hip9011 integration

Post by kb1gtt »

Hmmm, that int/hold doesn't seem to be working for some reason. The int/hold should periodically reset to 0V, then integrate for some set period of time, then at the end of that time it holds the results. When you have a constant noise like you had with the sound card, that integration period of time will be a constant upward slope. That constant 2V makes me think it registered some noise at one point, then it held it for a very long time.

About the 2.5V thing looks like the output could easily float to VDD/2.

8.3.1.3 Reference Supply (Vref) The Vref is an internally generated supply reference voltage for biasing the amplifier inputs. The terminal is used to decouple any noise in the system by placing an external capacitor of 22 nF (typical).

CH1P is wired to 2.5V, while the input signal has a pull down to 0V. So I expect the output to be 2.5V typically.

How do you have this wired? Is that a 2 wire sensor? I think you have a 3 wire. I wonder if we are getting buggered because we followed the TPIC datasheet. Perhaps we should remove R161 and R162.

I ordered a cheap knock sensor, so perhaps I'll be able to help in a week or so.

Here's a picture of a 3 wire sensor http://www.audizine.com/forum/showthread.php/589289-Knock-sensor-wiring-diagram
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 »

The gain is way too high. What is your hardware and software gain?
Spilly
contributor
contributor
Posts: 64
Joined: Thu Jul 31, 2014 11:30 pm

Re: hip9011 integration

Post by Spilly »

DaWaN wrote: The sound of knock has little to do with a function generator creating a constant tone during the knock watch window.
Of course this will yield different integration results as the window for higher RPM is much smaller compared to lower RPM.

I actually wonder whether there is actually so much of a difference in acoustic energy compared to RPM. I think it is more related to the amount of torque and in general that is kind of flat over RPM.
A knock event is one uncontrolled combustion and will not generate a constant tone during the knock window. Remember the knock frequency is already fixed over RPM!
I think you should base the implementation on either recorded engine knock sounds over a wide RPM range or some sort of paper showing actually measured data and not on a function generator generating a constant tone.
The background noise is also being integrated. Also, knock/detonation is a resonant condition.
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 »

Looks like they GNDed channel 2, with a feedback resistor also to GND. That would help keep noise lower, but it would also make it more obvious if you were looking at the wrong channel. SPI can potentially cause you to look at the wrong channel.

As well they appear to be using the MCU for the XTAL signal.

Hmmm, I see this in section 9.2.5 "The input amplifier gain (AIN) is typically set to 1 by setting R1 = R2. R1 and R2 should be chosen to be greater
than 25 kΩ." I wonder how we got 10k for R163 an R164. It would appear we could have the wrong resistors installed. The noted 100k and 121k would be much closer to an Ain or 1 as suggested. Ours is 6.8, while theirs is 1.21 with a recommended physical gain of 1. Can we replace R163, R164, R167 and R168 with 100k resistors? Or the same resistors as Frankenso's resistors. I seem to recall your working with R0.1, and I forget if those had the same resistors.

I see the HIP9011 datahseet notes the Acl test condition used 47.5k and 475k, which is a gain of 10. So our 6.8 gain is probably not a huge deal. I guess we would need to know the peak voltage of the knock sensor, then run it through the equation to figure Vout. Or we can simply start with close to 1 as suggested in the datasheet. Perhaps the 10k instead of 25k is causing some problems with over driving things a bit.
Welcome to the friendlier side of internet crazy :)
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 »

With the gain being to high, it would likely run you to the 5V rail and never come down.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

Just tried with 100K and 100K physical gain - same exact result, constant 5v.

Image
This says 3.3nF and we have .047uF, why?

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

Re: hip9011 integration

Post by AndreyB »

PS: I've finally removed the 1M pull-down resistor and the output voltage has dropped to about 2v while my test mule vehicle is running. Will try inducing some knock later today.
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 »

The 3.3nF is a DC blocking AC passing cap. It will technically want to vary slightly based on wire length, and internal parameters of the knock sensor, ect. I'm less worried about the .047uF but would start to get concerned if it got smaller or closer to 3.3nF. If you have a 3.3nF you could try changing it.

I can't seem to remember where these values came from. I know they were not just random, they came from some where. I wonder if the datasheet could have changed over the years. Did I make the original knock circuit, or was that copied from one of these little breakout style boards.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
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:Did I make the original knock circuit, or was that copied from one of these little breakout style boards.
Good point. Actually @ made the original board.
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 »

Ah, this is making more sense now. I copied that breakout board, I think to Frankienstien, then to Frankenso. I probably didn't look very closely at the component selection as I assumed it was working and in good order on that breakout board. It appears that breakout board was only bench tested against a sound card, not a real sensor. Russian thread for the original breakout board found here http://rusefi.com/forum/viewtopic.php?f=8&t=357&hilit=dd_hip9011

Hmmm, in the pictures of the breakout board, that chip's marking do not say HIP or TPIC. Was that a OEM chip or could they have found a different supplier? I know my TPIC specifies TPIC as part of the markings, as well that HIP datasheet notes it should be marked with HIP indicator. Was that designed for a different chip?
Capture.PNG
Capture.PNG (8.01 KiB) Viewed 18082 times
I believe this to be originally designed by a young player (good for them for getting into it) who was reading a HIP9011 datasheet which is vague about these components, as well as they were translating to Russian from English, they made their best guess and were able to get it working on the bench with a sound card. The sound card allows you to make a much different signal than the knock will generate, which allowed for some wrong components to be selected.

I'll try to look over the datasheet a bit closer and see if I find any other issues, or potential issues. For now I say 3.3nF and 100k's and no 1meg pull down are good choices. As well I wonder, what chip did they use in that breakout?
Welcome to the friendlier side of internet crazy :)
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 »

It appears SI, SCK, TEST have internal pull ups, so I wonder why we have external pull ups.
Per section 8.3.1.4 Pin 4 (output) should have a 2.2nF to stabilize it.
Per section 8.3.1.7 Looks like R166 (XTAL resistor) should be 1 meg, not 2 meg.
Long term we'll probably get a better signal if we capture it via SPI instead of analog. For now get it working, then get it working better. Once it's working via SPI we can probably free up an AN input.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
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:Per section 8.3.1.4 Pin 4 (output) should have a 2.2nF to stabilize it.
Here's the current output with the engine not running, looks pretty random to me :(

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

Re: hip9011 integration

Post by kb1gtt »

That's probably not caused by the 2.2nF thing. That noise if likely caused by noise on the input with a gain that is likely to high.

Best would be to get another analog channel working, such that we can see the input and the output at the same time.
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 »

Sorry for the delayed response. I have not been able to spend as much time on this as I would have liked to.

My application's knock sensor outputs over 10 volts under certain conditions. For situations like this, a voltage divider will be required to keep the voltage low enough for the TPIC/HIP. I was lucky enough to find a datasheet for my knock sensor that indicated the maximum voltage the sensor would output. If a datasheet is not available, it may be necessary to use an oscilloscope to measure the knock sensor's output and then calculate the necessary voltage divider.

The TPIC/HIP output you are seeing while your engine is running can be replicated by increasing the output amplitude from your bench source (function generator, sound card, etc.) or by increasing the gain. I have two pots on my inputs, so I can play with the gain in real time.
User avatar
AndreyB
Site Admin
Posts: 14323
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:I have two pots on my inputs, so I can play with the gain in real time.
I've ordered a couple of 100K pots and a second oscilloscope probe.

I am really hoping that one day someone more EE-powerful then myself would try it on a real car...
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 »

Can you record and/or measure the amplitude of signal that the knock sensor itself is generating while the engine is running?

Is your sensor wideband/flat response or narrowband/resonant?

I have tested the TPIC on a Toyota 4AGE 20v with a different microcontroller. Getting the gain dialed in is finicky.
User avatar
AndreyB
Site Admin
Posts: 14323
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:Is your sensor wideband/flat response or narrowband/resonant?
No idea :( I am a software developer out of my league.

My test mule is DODGE 2003 NEON 2.0L L4
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
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post by kb1gtt »

The schematic found here http://rusefi.com/wiki/index.php?title=Vehicle:Dodge_Neon_2003#Diagrams makes me think it's non-resonant flat type. I believe the bolt down the center with 2 wires are non-resonant, and the single wire comes with the thread are resonant. This appears to be the bolt down the center style. However that's just a guess, from several states away from the test mule.
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 »

I agree. That appears to be a non-resonant sensor. This means that the sensor is pretty much a microphone. A vibration at pretty much any frequency will produce the same output based on the magnitude of the vibration. This will make setting the gain correctly even more important.

Dialing in the gain for your sensor may be possible by simply adjusting the software gain. Try setting the gain to the lowest setting, 0.111 (3f). If doing so doesn't drop the output from the TPIC/HIP to 2V or less while the engine is running, the external gain needs to be adjusted.
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

what about http://rusefi.com/forum/viewtopic.php?f=5&t=778&p=15870#p15843 ? The output is jumping up and down while the engine is NOT RUNNING!
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:what about http://rusefi.com/forum/viewtopic.php?f=5&t=778&p=15870#p15843 ? The output is jumping up and down while the engine is NOT RUNNING!
Is that the output of the TPIC/HIP or the knock sensor? The INT/HOLD pin shouldn't be changing states when the engine is not running. Thus, the TPIC/HIP should be outputting a constant value.
User avatar
AndreyB
Site Admin
Posts: 14323
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:Is that the output of the TPIC/HIP or the knock sensor? The INT/HOLD pin shouldn't be changing states when the engine is not running. Thus, the TPIC/HIP should be outputting a constant value.
That's TPiC output. I agree that expected behavior is constant value, but that's not what I have :( Waiting for two more probes so that I can look at all three lines at the same time.
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:That's TPiC output. I agree that expected behavior is constant value, but that's not what I have :( Waiting for two more probes so that I can look at all three lines at the same time.
Can you set the scope to trigger on the INT/HOLD pin to see if it is changing states?
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 »

In leu of the scope, can you connect a jumper wire to an unused AN input and take some measurements that way? These are reasonably low bandwidth signals. Perhaps the on-board ADC's will capture fast enough data.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

[video][/video]

[video][/video]

Well, something is really wrong.
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: 14323
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 confirmed continuity between stm#PB11 which is my int/hold and hip#7. Just to reiterate, there is an external 1k pull-up and the stm pin is in PAL_MODE_OUTPUT_PUSHPULL mode.
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: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

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

Re: hip9011 integration

Post by kb1gtt »

The yellow trace seems odd to me. I see it's pulling down to about .1V which make sense as it should pull to near 0V when you start the integration period. However after the integration it's still very close to 0V. Is your signal a very small signal such that there is very little signal after the integration? Did you happen to additional probes? You can put your digital signal on channel C or D and then put your signal and integration trace on A and B and see all three at the same time. However that only works if you have probes.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

Still only two probes, two more should show up soon.

[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
Post Reply