opticaltrigger wrote:For anyone whos interested as to what it was that did'nt work with the optical set up well after a little bit of head scratching and a bit of time on the scope,it was the width of the blades on my choper wheel.
It sounds like you found the pulses where becoming rounded or flat lining when you approached higher RPMs. I can see how this can happen if you do not have proper impedance matching between your sensor and your control unit. Also when you had the scope on it, did you have the processor attached? Can you log direct from the processor like OLV allows with FreeEMS? Can you make a quick sketch showing the components and how they where wired to each other including where the scope was attached? Perhaps we can offer advice on how you can get a clean signal back to the control unit. Here are some thoughts that might be worth considering.
I don't think you did this, but this would likely be a bad place for coax, as the ADC input is typically a high impedance, and coax is typically 50ohm to 300ohm. That impedance mismatch can prevent the energy from your sensor from getting to the ADC and into the processor logic. Also most coax is not rated for the temperatures under the hood. When it gets warm, the impedance changes which can induce errors in you signal. A slightly twisted pair of wire would likely allow for a good transmission line impedance match. Do you know the impedance of you sensor, or processor unit's input?
I'm guessing you provide gnd and +5 to the sensor, and it has a pulsed digital signal that returns to the processor with common ground. A couple small bulk caps at the sensor can help allow the sensor to have the energy it needs when it tries to push. I'm not sure how much energy it needs, but you might find benefit from a small-ish 1uF/.1uF ceramic or a small 10uF cap at the power leads of the sensor. Basically the digital edges of the sensors output can draw large spikes of current. If you have slightly small power wires, or if you have low capacitance on the supply wires, when the raising edge happens the power supply is soggy, and it makes it kind of hard for the sensor to push the electrons. If a cap at the sensor helps, you can probably move the cap to a better location. However it's simpler for test purposes if you put it at the sensor.
If I'm correct in that you have a three lead sensor. I would suggest the signal wire and ground wire be twisted perhaps 10 to 20 times before returning to the processor. The twisting helps prevent noise from coupling into the signal. By putting two wires next to each other with a potential, you have created a capacitor. The wire insulation is the dielectric, and the wire is plate. It's not much, but it exists. By twisting, you create some inductance that counter acts the capacitance. Which allows for a more clean signal to pass the wires. Having only a couple turns prevents from creating extra inductance that can create a low pass filter. Also use something like 18 awg wire, perhaps bigger if you can, even though the signals are likely in the mA range, and check if you have a highly capacitive supply for your + side of you sensor. Notice that the phone company usually uses 22 awg, with many turns per inch. That's for voice signals, you want larger wires and less turns for you higher power and higher frequency signals.
Oh, also ground the sensor at the process unit if you can. Do not ground at the battery.
To ball park the desired frequency response, I'll assume an engine that rev's up to 12kRPM, so 200 R/S. I'll guess your sensor has 100 teeth per rotation, so that's 20,000 pulses per second. To get a semi clean pulse edge, you really want at least the 4th to 5th harmonic. The 5th harmonic means your transmission line needs to pass 100kHz. At the low limit, say 500 RPM, that frequency needs to pass about 4kHz. This frequency range puts the signals in a bit of an odd range.
http://www.generalcable.co.nz/Technical/10.4.1.1.pdf
Hope it goes, well, and when you get this up the hill, post pictures/videos.