GETTING STARTED

Home Geting Started How it Works Code Overview Program Flow Timing Diagram Photos Original Files Connection Notes SRF Videos

THE FIRST STEPS:

    I initially used the new inexpensive Picaxe 08M microcontroller (~$4) that is easily programmed in Pic-Basic and I used a 3-position dip switch to get a range of adjustability for the SPI output without the need to reprogram the chip.  That concept worked well but it soon proved to be much too limited for expansion.  I thought that since I had already done all of the RPM work why not have a tachometer as well and this of course required a LED display. 

    Subsequently, the project moved to the enhanced Picaxe 18x microcontroller with much more functionality and code space.  This processor should be capable of controlling the full version of the SRF dash and the GPS module.  For the tachometer, I decided to use a 4-digit hi-intensity LED display so 9999 RPM is the maximum that can be displayed.

    My SRF specific application requires an SPI motor turn-on point (open the valves) at 3,000 RPM and a turn-off point of 2,800 RPM.  This provides some hysterisis so when the engine RPM is near the “on” point it will not oscillate.  The Picaxe is capable of outputting a PWM signal which is fed to a FET that has a very low RDSon of .014 so it runs cool to the touch and it requires very little current because of the PWM signal.  

 

SO …. WHERE DO WE START:

    The first big hurdle was the math to calculate the engine RPM which is really the crux of the system.  Something as simple as dividing 24,000,000 / (Number of Cylinders * PulseWidth) is almost impossible with a 16 bit microprocessor although we can do it easily with our $1 calculator!   So .... how to do this became the big question, but first I needed to understand the relationship between engine RPM and spark signal, which, as you will see, varies with the number of cylinders involved and it can vary with the type of ignition system.

    On the PICAXE Forum there was a very good explanation of the Engine v. RPM v. Cylinders and ignition pulses offered up by none less than The-Lab-Wiz  and this is the basis of understanding the tachometer:

"Background - each cylinder of a four cycle engine has one ignition pulse on every other crankshaft rotation (one revolution for intake and compression strokes, one revolution for power and exhaust strokes, ignition pulse at start of power stroke). At 600 RPM, the engine is turning 10 RPS (revolutions per second) and delivering 20 ignition pulses per second on a four cylinder engine (10 RPS * 4 cylinders)/one pulse per cylinder per 2 revolutions [(10 * 4)/2) = 20]. At the same speed, a 6 cylinder engine delivers 30 ignition pulses per second and an 8 cylinder engine delivers 40 ignition pulses per second. This means that the time between pulses is longer on the 4 cylinder engine than on a 6 or 8 cylinder engine for the same engine speed and that the time between pulses *decreases* as the engine speed *increases* (inverse function)."

    There is also some very good reading on ignitions and engines in general available and well worth the reading.  Here is a great page on how ignition systems work at "How Automobile Ignition Systems Work" and here is a great article on how engines work at "How Car Engines Work"

    So with this information I know that since I have a 4 cylinder engine there are two pulses per revolution (one for each cylinder every 2 revolutions).  I also know that I will need a signal from the ignition system to indicate when the cylinders are firing.  Typically that signal will be available at the engine computer (ECU) on modern vehicles as a tachometer output.   On some of the earlier and vintage equipment there will be a signal at either the points by the ignition coil or on the negative terminal of the coil.  On engines with CDI or just plain electronic ignition there should be a signal at the trigger circuit for the individual coil, and in rare cases, like flywheel driven magneto engines, it may be necessary to provide an inductive, signal pickup for a single cylinder at a plug wire.  I have provided some application links on the Connection Notes page at the end.

Copyright © 2006-7 Rex Lantz. All rights reserved
Revised: January 10, 2007