Author Topic: tests for knock sensor  (Read 57838 times)

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
tests for knock sensor
« on: March 23, 2008, 08:31:48 pm »
well after a few failed attempts to get knock working, i'm wondering if i have a problem with the driver ic.

is there a good way to test this?

so far i've confirmed i have a good signal from the sensors by logging with my scope.

should i scope the outputs of the ic? test the ADC inputs on the avr?

thanks

Offline Sprocket

  • Hero Member
  • *****
  • Posts: 867
  • BHP: 29
Re: tests for knock sensor
« Reply #1 on: March 23, 2008, 10:41:13 pm »
If you built the unit yourself, check you are wired to the primary knock input channel. The secondary channel is missing some components off the board as well so no good enabling this second channel.

Just a thought, while I was looking at this on mine ;)

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #2 on: March 24, 2008, 01:38:14 am »
yeah i'm going to double check all my wiring before i get too far.

i started checking into the knock sensors themselves and was supprised to find they don't show any ohm reading.

they are siemens sensors from a 2000 bmw. i would assume any type of acoustic pickup would have a ohm reading.

could there be something strange with these sensors?  i had at one point recorded sound with these, but at this point i'm second guessing everything

Offline rob@vems.co.uk

  • Hero Member
  • *****
  • Posts: 3115
  • BHP: 49
    • VEMS Forum
Re: tests for knock sensor
« Reply #3 on: March 24, 2008, 09:34:50 am »
The sensor is most likely a Piezo electric, it emits a voltage based on mechanical pressure rather than a moving coil.
If you can record a sound through it then it should be okay.

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #4 on: March 24, 2008, 12:35:49 pm »
good point rob, i didn't think of that

after work i'm going to try a frequency generator as a 'knock input'. and then scope the output from the chip.  hopefully recreate some of the examples they show in the chip doc.


Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #5 on: March 25, 2008, 01:10:57 am »
ok so tonight i hooked up a freq generator to channel one input. i set it at 4k sine wave, and changed the amplitude to hopefully simulate knock.

no changes were seen in megatune or on the lcd.

i scoped the OUT pin from the knock chip and didn't have anything.

I'm wondering if i have a dead knock chip?

megatune always registers a knock diff of ~ .4

in megatune, it shows the knock value around 30 and the noise around 70 (or possibly the other way around)

these values never change, and from the looks of vems.ini are divided to get the knock diff

anything else i should try before i solder in a new chip?

One thing i should note. a while back i discovered my knock sensor wiring was smashed inbetween my head and intake manifold. Not sure if that could have sent any noise back to the chip damanging it?

jay.

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #6 on: March 25, 2008, 02:55:58 am »
ok another thought i had. gonna check the INT line that the AVR toggles during sampling.  see if thats getting the signal. if so, i'd be pretty much convinced its the chip

looks like i can get more from digikey if needed


Offline rob@vems.co.uk

  • Hero Member
  • *****
  • Posts: 3115
  • BHP: 49
    • VEMS Forum
Re: tests for knock sensor
« Reply #7 on: March 25, 2008, 09:54:10 am »
Try PM'ing dnb he made a change to the .ini to show a raw values from the knock signal.

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #8 on: March 25, 2008, 11:34:59 pm »
yeah i have gauges set up in megatune to show the raw numbers for knock window and noise window

i did have some interesting success this afternoon, although still need a bit more information

i hate to say it, but my patience with vems is growing thin. I can 99% of the time to get things to work, but it involves reverse engineering things due to do poor documentation. recently i've been think more and more of AEM.. agh..  ok, rant over

so the main problem i was having is related to knock_conf setting. Megatune wanted to set this to FF for enable / channel 0

looking at the parameters on the lcd, it says F0 should be disable. Megatune was setting it to FE for disable if i recall correctly.  (and a couple other variations depending on what channel i had selected)

So using the keyboard, i set it to F0. 

With my scope hooked up the INT line on the knock chip, i can see that sampling stopped! ok so this is a step in the right direction

I believe i set knock_conf to F1  (assuing that meant channel 0)

Now with my frequency generator set at 4k, i can vary the voltage and see a change in the output from the knock chip during the knock window (and noise window)

moving in the right direction

However it appears as though its only sampling (or getting an output) during 2 out of every 6 window groups  (i'm assuming there is a knock window, followed by a noise window)

so possibly this is so that two channels can be active? but i'm not sure why its sampling 2 and not 3.  I wish i could hook up another freq generator to channel 1, but thats not possible at this point.

So then i try knock_conf = 00.  This disabled all sampling.

Then i tried 01, and i got continuous sampling (verses the 2 out of 6 above)

So my question is, does anyone know the proper settings for knock_conf that relate to firmware 1.1.26 for dual channel?  Is there a reason megatune doesn't cooperate? I am using the vems.ini from 1.1.26

Next is to figure out the thresholds ,etc.

I'm going to post up some pictures so people can see how the knock sampling works (to my understanding)


Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #9 on: March 25, 2008, 11:45:39 pm »
ok so maybe i was able to answer some of my own questions.

doesn't look like this is how megatune sets the values. i'll have to head back to the garage and try this out

From firmware page, reference 1.1.26

knock_chan=F0 disables knock. Other values select bank individually for each ignition event (practical for V8, V6, I6 and even I5 where there are more than 1 knock sensors).
    * knock_chan=00 selects knock channel 0 for all ignition entries
    * knock_chan=FF selects knock channel 1 for all ignition entries
    * knock_chan=AA selects knock channel 1 for every other ignition entries. Bit7 is for entry0 (belongs to the topmost entry in the MegaTune ignition output and reftooth tables). 0x55 is obviously the inverse, bit7=0 so the sensor belonging to the cyl fired by the topmost ignition entry must be connected to knoch channel 0 (the only knock channel normally).

a little confusing, but it looks like just what i need

Offline rob@vems.co.uk

  • Hero Member
  • *****
  • Posts: 3115
  • BHP: 49
    • VEMS Forum
Re: tests for knock sensor
« Reply #10 on: March 26, 2008, 10:03:23 am »
Thanks for posting your findings.
I have to agree with you about your statement about documentation, VEMS is meant to be a community type of project and the answers are meant to all be on the Wiki - but people seem to get things working and run off to enjoy their cars and thats the last we see of them!

At least now you've written something on this subject it should help others.

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #11 on: March 26, 2008, 12:49:51 pm »
After applying the correct knock_conf settings using the keyboard (or terminal), i was able to get the car to read the knock sensors properly.

In my application, the setting I needed was 55. This relates to where the knock sensors are located in relation to the h[2] table, or ignition firing order

So you can either set it to AA, or 55 which translates into binary as such

AA = 10101010
55 = 01010101

so you can see they are basically using that to determine which sensor to poll

In my previous tests, megatune had set this value to FD which may or may not be a valid setting ( i will assume not since it didn't work well)

Through my testing i found that the bandpass filter in the knock chip is pretty wide. Most of my testing was done by altering the frequency of my frequency generator and not the amplitude. It took a considerable change (1k hz) in frequency to change the knock output.  I'll have to check back into the documents to see if they call out what order the filter is

So what i was trying to duplicate in my tests was this graph from the chip doc



At the top is the sine wave used as an input

The green line shows when the chip is polled to convert or integrate the sample (knock window / noise window sampling)

The red is the output which is applied to the analog input of the AVR

This was the best plot i got, but the values are shifted slightly up and down



When the red pulse is high, we are taking the samples. I'm assuming the first window is knock, and the second is noise.

The blue line is the output. You can see its a ramp, as the knock signal is being integrated (finding the area under the curve)

At this point i was pretty happy with the results!  sometimes i have to see things happening to be convinced they are working ;)

Here is a plot showing how VEMS alternates sensors ( i only had one sensor being tested)



I was even able to set the threshold values and simulate knock on the running motor by changing my frequency.

So know with everythign hooked back up properly, i need to hit the road and log the noise and knock valves to be able to properly set the different thresholds





Offline GintsK

  • Hero Member
  • *****
  • Posts: 1257
  • BHP: 50
Re: tests for knock sensor
« Reply #12 on: March 27, 2008, 10:24:29 am »
Thank You a lot for clarifying things! Great work!

Are MT works for changing other knock related values, when knock_chan is changed using other methods?

---
So if I have 5cil engine with firing oder according to h[2]
cyl: 5 3 1 2 4
then something like this:
      1 1 0 0 1 0 0 0
must work (C8)?

For BMW
1 5 3 6 2 4

0 1 0 1 0 1 0 0

(54)

Offline multiplex

  • Full Member
  • ***
  • Posts: 151
  • BHP: 6
Re: tests for knock sensor
« Reply #13 on: March 27, 2008, 12:36:53 pm »
It seemed to stay set for me, even after opening the dialog box in MT. You may want to double check after you are done

Looks like your knock_conf should work.  I think it wraps around and repeats based on your number of cylinders just like H[2]


Offline rob@vems.co.uk

  • Hero Member
  • *****
  • Posts: 3115
  • BHP: 49
    • VEMS Forum
Re: tests for knock sensor
« Reply #14 on: March 27, 2008, 03:44:29 pm »
And for my 4 cylinder SR20 using channel 0:
00