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
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 ;)
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
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.
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.
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.
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
Try PM'ing dnb he made a change to the .ini to show a raw values from the knock signal.
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)
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
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.
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
(http://voytilla.com/gallery/albums/userpics/10003/normal_knock_doc.jpg)
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
(http://voytilla.com/gallery/albums/userpics/10003/normal_knock_inverted.jpg)
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)
(http://voytilla.com/gallery/albums/userpics/10003/normal_knock_alt.jpg)
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
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)
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]
And for my 4 cylinder SR20 using channel 0:
00
Quote from: multiplex on March 25, 2008, 10: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
If i understand this correctly, from what Rob said a while ago regarding the knock channel numbering. knock_chan=00 selects knock channel 0 for all ignition entries, only one sensor is in use and samples each knock window. If knock_chan=FF selects knock channel 1 for all ignition entries, would suggest two knock sensors are in use and both simuntainiusly sample each knock window. knock_chan=AA selects knock channel 1 for every other ignition entries, would suggest two knock sensors are in use but, one on each head of a V8, V6 or flat 4 and each knock window is sampled by each sensor alternately as per the ignition sequence in h[2] table
??
Thats pretty much as I understand it. With a straight 6 I think the pattern will be different again as some I've seen have two sensors for three cylinders.
Nice infos guys, but i dont get even the half of it. Could you please tell me if there are any settings for the for the Audi I5 that we could use in MT? My MT shows Channel 0 and channel 1. Nothing else.
with the current config file for megatune, you can't directly set the proper knock value. You will either need to use the terminal console, or the keyboard and LCD display. Hopefully that will be fixed soon. wish i knew how to edit it to that extreme
So your motor has two knock sensors?
Where are they located? Or which cylinders do they cover?
if your firing order is 1-2-4-5-3
Assuming Sensor 1 covered 1,2,3 and sensor 2 covered 4,5
your config in binary would be
0 0 1 1 0 [ 0 0 0] The last three bits don't matter as they don't represent actual cylinders
So changing this into Hex it would be 30h, or in decimal 48
Hope that helps!
Can you plase give me exact instruction on what to write in the terminal. I dont have Keyboard and LCD either and i dont know the commands for terminal. Where should i give the the hex or decimal values?
In fact I5 firing order is 5-3-1-2-4. because first spark after trigger becomes in 5th cylinder.
1-0-0-0-1-0-0-0 in theory must work.
Disappointing aspect is Megatunes incompatibility.
what command should i use in terminal so i can get the knock to work. I dont know nothing about terminal commands.
Sorry for my ignorance and thanks for your help.
I don't know that you have to use Terminal to configure the knock setup, MT should do it fine.
These are the settings i have now but they doesnt seem to work:
(http://img297.imageshack.us/img297/1262/knocksamplingnu5.jpg)
(http://img505.imageshack.us/img505/2614/knockactionwy6.jpg)
So you're getting detonation but not seeing any retardation?
No, i hit the engine and the sensor with a tool and got almost no knock diff.
Is there any new infos on how to set the knock sensors up on the Audi I5 engine? Still dont know what to give on the terminal or what values to put in the config files.
This is so complex that it seems that no one can use it, so i think itÃ,´s junk, so just skip it,
as i have said earlyÃ,´er i have a knocklink mounted on my car, and itÃ,´s showing the big red led, anytime there is knock, this is a really simple device, the only thing that can be changed is the volume on the "noise", that it detects,
I belive for anyone to have any use of the knock settings, it need to be as simple as that,
on a Link ECU that is just the knockthreshold that needs to be definded,
Meaning that on a scale from 0-255, you deside when ever there is knock, and it will then take action, and retard....
also like this....
http://aztecperformance.co.uk/gizzmo_shift_light_dual_stage.aspx
http://www.linkecu.com/products/AncillaryDevices/KnockLink
/Skassa
It's complex, but there are many that use it, and its certainly not junk.
dnb has been doing a lot of work on the knock sensor and has had some good results from what I've seen. It did require a change to the values in the vemsv3.ini file.
Rob
As Rob says, I have been getting half-sensible readings of knock on my TVR. What you need to do is tweak the vems_v3.ini file so that it can report the "knock_signal" and "knock_noise" parameters.
The one you're interested in is the signal - the noise is just an estimate of the background, and it's mostly contamintated with other cylinders, (at least in my case!) so I ignore it.
Once you have the signal parameter being logged, then you have the equivilent of a knock link.
The next stage hasn't happened yet - my young daughter consumes what used to be my programming time at night ;)
Maybe it is working great, there just no info on how to get it to work,
Is like having a Bugatti, but you can only figure out, how to press the speeder 1cm down, it would be really great if you could go to WOT, but itÃ,´s just out of your reach to get it done, when there is none written on the numbers that have to be out in to megatune.
/Skassa
what is the Command for the terminal windows to enter other Knock channels? On the MT config i get Channel 01
i think for the Audi 5 Cyl i should go to AA ! ????
Give us some advice
Quote from: billman on June 30, 2008, 10:30:25 PM
what is the Command for the terminal windows to enter other Knock channels? On the MT config i get Channel 01
i think for the Audi 5 Cyl i should go to AA ! ????
Give us some advice
This is biggest problem. Some time ago I found way change sequence it using terminal. But every time when Megatune used to correct some variable in knock pop-up window, settings resets again.
Gints
That means you change something in MT then go to Terminal and change channel. If you change something else then you must go to terminal and change channel again ect?
Only after opening/editing something in knock sampling window.
OK, what command should we use in the terminal windows for the knock channel?
Even if we have to change it it is a start. I would like to rise the boost a bit but till then i want to have beside my ears an extra help for knock detection and i cant buy an extra gadget now.
Take the knock sensor and connect it to the mic input of your laptop, then run Audacity. You can use the FFT filter as a band pass filter.
This will allow you to listen, record and see the output of the knock sensor.
is there anybody ..who can tell me..
where to find this numbers (for chanel) ..??
or tell me the key for it ..??
fire order is 1342..
in VemsTune is def.values 240 (F0h) to disable Knock and 211 (F1h) to log to SDcard
so .. I must set the Chanel to 0 (00h) or to 101 (65h) ..??
..I'm so confused with this...
EDITED: so Sensor is located near to 3rd cyl.
Quote from: GintsK on March 27, 2008, 09: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)
If you have 1 knock sensor use just 0
It is 0 0 0 0 0 0 0 0 binary.
Thanks... :)
so, how to recognize this bin mask ..?? (dec.val is from 0 to 255)
if I can use another one (second) knock senzor, for 2nd harmonic freq., in future...
Today I have best result on 15kHz, ... but konck is "wisiblle" on 5.5, 12, 17-18Khz also
but is theree too much noises....
BTW: Knock Gauage0-5 take some values, if no knock sensor conected...
what is it ..?? .. it is normal ..?? .. any type of noises from Analog Chanels ..??
I also spent some time trying to bench test the knock function from V1.1.94
(see http://www.vems.hu/wiki/index.php?action=find&find=MembersPage%2FFPhil%2FKnockDetectionTesting).
Yes indeed channel numbering is very confusing. But this could be on my side since the same we I was unable to find out how to write down a SD card log !! ;)
Anyway the knock function seems to be actually disabled until V2.0
"We had some weird side effects of the new code, so currently disabled, but we definitely want to enable it soon, before 2.0.0"
Yeah it's on the firmware page http://www.vems.hu/wiki/index.php?page=GenBoard%2FUnderDevelopment%2FFirmwareChanges
Quote[1.1.88] Withdrawn !
withdrawn because compiled with KNOCK_ALTERNATIVE that seems to cause problems (ign advance different than table) under certain circumstances. Upgrade to latest released version is highly recommended.