Detecting ignition pulses on motorbike

ldnz

New Member
Hello,
After following the brilliant advice I received on minimizing interference, I made a tragic discovery. My hall effect sensor no longer detected anything once I switched the cable from unshielded extension cord to shielded 12core data cable. I suspect it never was detecting anything, and that the pulses I previously received were purely induction in the wire.

Therefore I need a new reliable way to detect ignition pulses. Is there a better way to make an induction pickup? I hear winding a piece of wire around the HT lead, and then putting diodes across the ends in the hope that that would limit the voltage across them to 0.6v. Does that sound practical? What specifically would be needed in terms of isolation etc?

Cheers
Ben
 

xstamp

Senior Member
I have used the National Semiconductors LM2907 for this type of application. It’s designed for inductance pickups and has AGC circuitry to deal with the wide range in amplitude that you get with such sensors. Use a low value (< 1K) resistor on the open collector output if your driving long cables and you might also like to look at the recent mega discussion on bebounce techniques to use at the receiving end of the cable.

 

ldnz

New Member
Ok thanks, I like the look of that. Whats actually required in making the inductive pickup though? How can I control the voltage in the pickup? If I can somehow turn it into a stable pulse in the 0-5v range I already have op amps and schmitt inverters to turn it into something for a picaxe to count.

My thoughts are tending towards a cable wound around the HT lead a couple of times, with a large multi meg ohm resister in series, and a diode across the ends of the cable. I'd ground one end of the diode, and take the other end as V+?
 

Dippy

Moderator
Would a cheap little inductor work? Or even a little home-made one? Then you could have a 'clip-on' sensor which could be easily removed. Or 'fall-off' depending on your sticky-tape.
Maybe a megohm res might be a bit big? You might get lots of volts but very little I.
Perhaps a zener instead to get a few more volts? Then use your Op-amp as a volt/comp to square up the pulse. With a bit of RC chucked in for shaping and noise reduction. And maybe a cap across the op-amp v. supply too.
This is where a 'scope is SO handy, then you can play with values 'til happiness abounds.
Have a play. And don't forget the potentially nasty v. spikes.
 

xstamp

Senior Member
Although the LM2907 is designed to accept signals from an inductive pickup sensor, these are basically just coils of wire. You can therefore wrap a few turns of wire around an ignition cable (one end to GND and the other to the LM2907) in order to receive a rather noisy pulse of indeterminate amplitude. In addition to a wide range (with AGC) input trigger circuit and voltage regulator, the LM2907 also has a monostable to deal with the multiple spikes per rpm pulse. If you select the RC values for the highest expected pulse rate, plus monostable recovery time, you will get a nice clean output pulse for the PICAXE count input. Search the NS website for application notes and start playing.

 

premelec

Senior Member
Not sure exactly where your signal is being picked up - in some instances I've seen just a small relay coil put _near_ an ignition coil pickup a good signal. The coil has a lot of ringing - output conditioning is required - an oscilloscope is a great help.

I fitted a cruise control and electronic ignition to my 1970 VW Bus... they work well.
 

ldnz

New Member
Yeah thats the concept. Ideally something that can be clipped on. I just got scared when I saw my multimeter meter reading 1-2k volts a/c. I'll try the zener idea and i've read the bits on RC networks, thanks.
 

womai

Senior Member
To clamp those pulses you should use a a fast Schottky diode behind a suitably large resistor. "Normal" diodes may be too slow so the initial part of the high voltage spike will not get clamped and will fry your Picaxe. The resistor R is needed to limit the current to something that won't fry the Schottky diode either. You need an RF type diode, and preferably surface mount (not through-hole) to minimize parasitic inductance that would again prevent fast clamping. Assume your diode can take 100mA, and the spikes are 1kV, then the minimum resistor would be

R = 1000V/0.1A = 10 kOhm.

Having said that, the Picaxe input has such fast diodes built in for ESD protection (for example they are (ab-)used in the standard Pixace download circuit to clamp the RS-232 voltages. You can use the same trick (current limiting series resistor), of course scaled up appropriately for your spiked (RS-232 is below 15V).

Wolfgang

 

Monckton

New Member
The lm2907 works very well for this application.... I found however that the signal MUST swing above and below 0v for the chip to work. I put two resistors across the supply and took the centre feed to give half voltage this is fed into the second input and works very well.
 

ldnz

New Member
Righty, progress!

First up, to anyone contemplating doing this:

http://www.sportdevices.com/rpm_readings/index.htm

...Has an excellent (working) circuit. I built up the inductive rpm sensing version, and it works perfectly. Right now my antenna is a 2m long loop of wire whose bight is about 20cm away from the HT lead on my scooter. On my motorbike it has to be much closer, but im sure sensitivity could be increased by winding the end of this wire into a coil and taping it along the HT lead. I find if the wire is any closer to the scooter, the picaxe goes haywire and/or just crashes.
The output of the 555 is put to pin3 via a 4k7 resister. I hope this is the rightish value?

The display scrambling problem was solved by grounding the shielding in the cable I was using (oops!) so now the picaxe was stable in a simple count for .1s and display results loop. It was counting between 1 and 5 pulses at idle, (4 should be about right) but at least it was counting! Now its a matter of maths poxying and maybe some averaging.
 

Dippy

Moderator
Glad to hear you've got a working device. Good old 555.
Query: You said "whose bight"... what does that mean?
 

ldnz

New Member
Sorry, bad england! I meant the end of the antenna loop (bight, in nautical terms) was taped 20cm from the HT lead.
 

ldnz

New Member
Finally got back to working on this:

scopy shows a 1.5ms ish square pulse every time the ignition fires, so at 2000 rpm I should be counting 33 ish pulses per second. Now im using a shady 2 stroke test vehicle, which seems to have a really noisy coil/ignition system.
My code is as follows:
<code><pre><font size=2 face='Courier'>
checkcount:
count 3,500,w5
w5 = w5 * 12
w5 = w5 / 10
b0 = w5
debug
gosub disprpm
goto checkcount
</font></pre></code>
In practice it displays (disprpm sends the result to an lcd) about 4 to 20 (disprpm adds two zeros). 400 to 2000rpm? This is while the scooter is idling. If I rev the scooter it very quickly loses count and displays 100 to 400rpm (w5 = 1 to 4) on the lcd. I suspect its getting overwhelmed by all the pulses and reading them as 1 continuous pulse?
Why would this be? Im sure im operating within the bounds of the count command. Would overclocking the 28x im using be the answer? What are some other solutions? Has anyone else had similiar issues?
 

ldnz

New Member
Guess im going to have to try the lm2917 thing. Hopefully it will work with my existing induction pickup rig. I assume I could read the output voltage into the picaxe via readadc with reasonable accuracy?
 

xstamp

Senior Member
You mention that your ignition pulse is noisy. I have never seen a clean one! Each spark normally generates a succession of amplitude modulated high frequency bursts. The frequency, amplitude and number of bursts per spark seem to depend on the individual engine.

It&#8217;s these characteristics that make reliable rpm detection very difficult. The LM2907 provides all the circuit elements needed to clean up the noisy signal but I have always fed its output to a count input and would not try to use it in an F-V mode. Also, I mount the LM2907 as near the pick-up as possible.

When you have produced a nice clean pulse from the LM2907, remember that it may still collect noise on the way to the PICAXE. Therefore add a simple RC filter right at the PICAXR count pin. You might consider driving an opto-coupler from the LM2907 pulse output. You can power the LM2907 directly from the vehicle supply using its onboard regulator. The opto approach will protect the PICAXE and help to reduce noise.


 

Dippy

Moderator
I reckon you should persue your Count version. If you can get the input right then surely it must be more accurate.

You'll have read the the PICAXE basic sheet so you'll know the limit of 'Count' already.

Have you scoped your pulses at higher revs?
Do they go mental?

What do your induced pulses look like at lower and higher revs? A great mish-mash (or nasty resonance) may not produce a good signal to trigger a monostable such as a 555.

What circuit are you using to get the 1.5mS pulses? That 'inductive' one from the site you posted?

Is interference the problem? So perhaps check the power supply to your monostable/PICAXE/LCD with the scope as well as any HF nasties getting through could b-up your measurement.

If the signal to the monostable is yukky then you'll also get yukky results from F-V.
 

ldnz

New Member
That induction pickup as seen on
http://www.sportdevices.com/rpm_readings/index.htm
gives very square 1.5ms ish pulses, and next to no noise. From scopy I think they could be about as good as could ever be expected as an input to a picaxe. All the various cables interconnecting components are shielded and interference is no longer corrupting the display or causing the picaxe to crash/reset. Therefore all thats going wrong is that the picaxe is missing pulses. I tried my pickup on a 4 stroke much higher quality bike, and to get a pulse (its either all or nothing, no half way pulses or mess) I had to wind my inductive loop around a finger a couple of times and hold it alongside the spark lead. It seems to display rpm roughly at idle, which I sorta expect, but when revved the picaxe quickly loses count and displays between 100 to 400 rpm, with the occasional 1500 or so. If I let it idle again it goes back to semi accuracy. Therefore it seems it is getting overwhelmed at high frequencies. In terms of what the picaxe should handle though it seems well within bounds.
Scopy suggests that when reved, the pulses from the 555 are still nice and square and the same width, but a lot closer together (as they should be), no hint of the 555 missing pulses. Infact it probably gets it more accurate when there is some load on the engine than when its idling. Maybe I have damaged the particular input pin on the picaxe with my earlier experiments, but then surely it wouldn't count at all?

I was planning on using the lm2917 as f-v, and feeding it the pulses out of my current induction/555 circuit. Then possibly reading it back with readadc or abandoning the picaxe altogether and using an led bargraph or something.

Hrmm just got another thought, I might sneak my board into one of the Massey Uni labs and feed it a square wave to see if its counting properly at all. I wish I could get my bike up there, they've got great LCD scopes with much better triggering than the POS that i've borrowed.
 

Dippy

Moderator
P.S. While you're about it, why don't you do 5V square wave inputs directly from Function generator. Then you can see if particular situations upset - and calibrate it too.
 

bobrayner

Member
I don't know if this is still the case but a few years ago most 2 stroke motorcycles aqctually fired twice in quick succession at every cycle. Maybe something like this is upsetting your set-up
cheers BobR
 

ldnz

New Member
Hrmm I didn't realise that. Haven't seen any sign of that yet. Main test vehicle has been a piaggio zip 50 scooter. But i've also tried this on a brothers GN250 rustbucket (4 stroke) and my Kwaka KR-150K (2 stroke).
Both my bike and my brothers require me to wind my pickup around my finger a couple of times before its sensitive enough to trigger the 555. And thats after removing sheets of rust from the GN! Either way I suspect my circuit is going to stand up to the motorbikes much better than the scooter, in terms of random noise.

I'll report back when i've managed to get this contraption on a function generator. I can just imagine the look on the lab techs face when I unload it all over the place, its not the prettiest looking rig!
 

xstamp

Senior Member
Just had some general thoughts about detecting ignition pulses. Have you placed your circuitry (555 or LM2702 etc) in an adequately screened enclosure? Monostables are inherently sensitive to noise, not just on the trigger input but also around the RC timing pins. If not, try placing the circuitry in a die cast box that is connected to the vehicle ground and feed ALL incoming or outgoing wiring (including the positive supply) via feed-thru capacitors. One source of multiple feed-thru capacitors is a &#8216;filtered&#8217; 9-way D-type connector. Each pin normally has a 1000pF capacitor to the shell. I have even used this technique for operating data loggers within F1 race cars and bikes (how&#8217;s that for name dropping?).

 
Top