Success! I have started and run the engine on my own electronic ignition. The problem was in the end quite simple, it turns out that the missing tooth wheel on the crank was aligned differently to what I expected. I thought that the missing tooth occurred 240 degrees after TDC, but in fact it appears to be aligned almost exactly at TDC. This meant that my spark was happening around Bottom Dead Centre, which is no use at all!
So, all I did was adjusted my #define for the Tooth Offset to be 360 degrees, and the engine fired up straight away! It still it a little difficult to start because it needs high cranking speeds > ~500 RPM before it begins to trigger the ignition. I can adjust this down to get it a bit more reasonable perhaps around 100 RPM which is easier to produce with the pull chord.
I then played around with the spark timing in a range of about ±30 degrees around the missing tooth, and found that under no load, at idle speeds, it didn’t make a great deal of difference, but did start to run rough and cut out closer to the -20 degrees, so I suspect that this is beginning to get after TDC. I need to spend more time mapping the ignition with different loads and engine speeds, and try to tune for maximum torque. For now, I’m happy that it works, and am moving on to the fuel injection side, to confirm that works before combining them together and adding lambda feedback.
The code is available here:
Please comment or email me with any similar projects!