Just wanted to say that I'm also interested in producing an simple ECU although my goals may differ somewhat from yours. I'm a classic vehicle enthusiast and we may well have to deal with fuel that's incompatible with old cars and bikes in the near future. A small change to the makeup of fuel at the pump will leave many carburated aircooled engines unusable. Some older vehicles have complex engine management requirements and it may be difficult to fit additional sensors. I'm stuck with an inline 6 motorcycle with little chance of fitting a cam sensor for example. There is also a strong cost incentive, Megasquirt is relatively expensive. 300GBP plus for the electronics alone. I would like to see a simpler, smaller and cheaper system out there.
This has been done before Chris Jeffries' MyECU replaced the early Ducati/Guzzi V Twin injection/ignition using a single ATMega32 with just three hardware counters! MyECU started as an open loop EFI although I think it can now use a lambda sensor. John Wilson's Intelligent Ignition System ran from two low spec controllers. Both of these were built for difficult engine configurations. Both Moto Witt's DMC and the Sachse ignition are well established but are expensive and have design compromises I'm not happy with. You can even buy a PIC based ignition for old Velocettes. Kawasaki and BMW produced combined fuel injection and ignition ECUs for sixes and triples in the 80s. Ignitech produce what is probably the most economical system with any sophistication. There is some published code for Arduino ECUs on the web.
I'm listening to the message about the limited resources of Arduino and expect to have to either move onto a more powerful platform and program in low level C. What about the Arduino Due or the ST Nucleo?
It would be great to have a simple open source DIY ECU based on off the shelf open source hardware.
The timing requirements of an engine mean you'd have to use direct control of the hardware counters. You need enough counters and you need enough resolution. If you are going to use interrupts then the response time is critical. Slow response is manageable if it is a constant.
From a personal perspective I'd just like to improve on what I've got. I believe Ignition timing needs to be far more precise than fuel injection timing so I'm starting with ignition timing using a simple custom crank sensor. If I can mimic a simple multiple linear ramp bob weight advance mechanism I'll be improving on the vile Bosch BTZ ignition units fitted to my bike at the moment. The BTZ jumps to full advance at about 2,300rpm and there are three independent mismatched units all doing this at +/- 50rpm which makes for a jerky transition. There are no accelerator pumps in the three worn out slide carbs and no vacuum advance on the ignition. Despite this the 900cc bike returns 50mpg (imperial) and runs quite well when warmed up.
Taking the benchtop demonstration to the bike is going to be hard, noise is going to be a big issue. The hardware may not be rugged enough mechanically either.
Next would be a rev limiter, missing tooth crank sensor decoding, open loop batch fire injection, followed by knock sensors, close loop EFI, idle control, sequential injection and so on. Tackling the project as a progressive task with clear benefits at stages along the way should mean it's not a complete waste of time.
Any comments most welcome