I've fiddled all night with Excel and the lot becomes more and more complex. And I seem to forget that the object of the excersize is to control the ignition timing, not necessarely make a very complex Arduino project. So, time to change the direction of thought.
Basic timing would be very simple:
If the starter button is activated, ignition should be at TDC.
Running rpm below 1650 rpm there is 20 degree static advance.
Running rpm between 1650 to 3500 rpm, static advance should increase from 20 to 40 degrees, linear with the rpm increase.
Above 3500 it should stay at 40 degree.
In addition, I want to advance extra due to part load, manifold pressure measured with a 555 sensor. Say 0V gives 0 advance, 5V gives 20 degrees advance.
So measuring rpm and pressure sensor value gives me an advance number.
Dwell time is 4ms.
All in all, not a lot of variables.
So what makes it difficult? Well, the accelleration does. And the high number of pulses to get an accurate rpm variance reading. Measuring only at TDC to estimate what to do in the next revolution is not enough. Measuring 32 times per revolution at 12k RPM gives a very small time between pulses to calculate anything.
But there are cars from way before the age of digital electronics with decent advance curves, arranged mechanically. But those curves are difficult to change / tune.
So, if I put a disc on the engine's crank with only one tooth and a sensor at TDC, I can register RPM. If I fit a second sensor on a (RC car) servo, which triggers the spark, I have a system which I can change.
What's the problem? Well, very little, as far as I can tell now. The only thing would be dwell time, as I should actually start charging the coil 4ms before sparking. This could be recalculated into the equasion, as 4ms at 1000rpm is 24 degrees, at 12k 4ms is 288 degrees. And that is linear through the rev range.
Mechanically I can fit the sensors, wheel and servo fairly easely. The system could be fairly simple and wouldn't require a lot of programming, I think.
Feel free to shoot at the idea.
Cheers,
Hugo