The desire to build an engine management system started in the mid 70's. At that time Bosch mechanical fuel injection systems existed on a few cars. There was also a the D-Jetronic system that was electronic, using solenoid injectors but analog ECU. The Bosch system used mechanical points for ignition and the fuel injection timing. The system had mechanical switches for throttle position, and bi-metallic thermal switch for start enrichment.
At that time I already developed an optical ignition for my own car. I was at a school earning a degree in electrical engineering. I spoke with a professor about my ignition. He was not impressed, he suggested that points, only cost 50 cents, and the car companies would never change. He was a good professor, I learned much about controls and even took a few graduate level classes as an undergrad. I held onto my thoughts of improvements in automotive systems.
The school home work, and class projects and were intense enough, so I curtailed my hobby projects. There were difficult times, but my desire to succeed was strong. I took very heavy class loads and found I did better.
I got married, graduated, bought a house and started a new job in a 3 day period. Life was fast, still is. I did not specialize in just one area, I studied curriculum in Power Systems, Control Systems, Electronics and Computer Science. I took a job with an electric utility in the Planning Department. I employed my computer skills for economic studies, load forecasting and power system simulation. I left there, and took a job where I was immersed in electronics and programming. I also worked with people that shared my skill sets. I learned most of what I needed by developing test equipment for electronic and products. I then got into product development.
I ran across a job that involved developing power meters. It would employ both my power system skills, electronics and programming. I learned to use embedded systems. That was key because working to program and interface PC or single board computers is different.
While I had the necessary skills and experience, I still lacked the time to dive into a large personal project. When my children left home for college, I decided to start development on the system I dreamed about for many years.
I desired to make a combined EFI and Ignition for 4 cylinder cars that would replace carburetors, or upgrade the primitive D-Jetronic systems. I also designed in a few features so it would be possible to use for other applications.
I started with the ignition first. I designed an optical interrupter that would replace the points with optical sensors, the point cam with an interrupter flag. The rotor, mechanical and vacuum advance components were also eliminated. The interrupter flag was driven directly by the distributor shaft. Ignition driver components controlled the quad coil charge and discharge. Electronic advance via RPM and engine manifold pressure along with control tables replaced the mechanical advance systems. The tables are user configurable, they can be adjusted real-time, and are stored in non-volatile memory. There is also communications that is used to interface with the user, presenting real-time operating information, and the ability to read and modify all control settings.
Back to basics on how this is possible. The ECU has inputs for analog inputs, digital inputs and digital outputs. The analog inputs are for measuring varying sensor voltages, samples include manifold pressure, throttle position, temperature sensors, O2, and battery voltage. The digital inputs are timing sensors, that provide position information of the engine rotation. The EMS2 has inputs for two position sensors, this is helpful, since one can be used for CAM or distributor, the other for crank sensing. The digital outputs with drivers control relays, ignition coils, injectors, and idle control valves.
The basic ECU controls are about time management. Measuring time of ignition sensors, then controlling the "ON" and "OFF" times of digital outputs precisely. Micro-controllers have timers that are used to measure and control time intervals. The internal clock speeds operate at high speeds, resulting in high resolution time measurement. The transition of a timing sensor is used to capture the time of the event, as a timer count. The timer counts are used to measure time by subtracting the prior time from the present time. Future events can be controlled with timer compares. A compare is set at a future count, when it is reached, the digital output responds. The programming is done in a way, such that minimal computation power is required. Because an engine runs at various speeds, the operations for ignition timing is re-scaled from time to degrees using simple math. Micro controllers have interrupts, they are a way to jump to specific places in code, when an event happens. When interrupt is being executed the main loop of the program is stopped, in a way that processing may start again, when the interrupt section of code is finished. To make things work well, interrupt code is kept to a minimum, and lengthy calculations are done in main as time permits.
The interrupt code in the EMS is arranged as a state machine. It is much like a mechanical machine, an engine for example, with crank, rods, pistons, gears or chain, and valve train. When the crank spins, other parts are connected in a way to stay in step. The same happens in code, the activity of the timing sensors, sets operations in timing registers, that control activities along a consistent pathway of stepping stones. The changing values that are necessary to modify ignition timing and fuel pulse widths, are calculated in the available free time. The update of values are done in a special shared way, avoiding conflict of resources. The system has fast response, it generates new values for each combustion and fuel event, based on past with prediction for the next future event.
The most time spent on the system was working out the user interface for display of information and settings.
It took about 3 months of spare time to have a running system. I have spent considerable time adding features such as closed loop control, user interface applications, and additional engine applications.