How Fuelino manages electronic fuel injection

This article has the purpose to explain how Fuelino calculates the control signal which is output to the fuel injector. In order to better understand how this simple control works, I decided to create a scheme using Matlab Simulink. The signal flow goes from left to right.

First of all, in order to work, Fuelino needs to receive, as input, the injection command that the original ECU would like to send to the fuel injector. This is the most important input signal, because Fuelino manipulates this signal and outputs a modified injector signal to control the physical injector. In other words, Fuelino, in a similar way to Power Commander and other ECU piggyback units, acts as a "man in the middle" between the original ECU and the injector.

By measuring the "original ECU injector command" signal, Fuelino is capable of calculating 2 important info:

  • Original fuel injection time [us, microseconds]
  • Time between 2 injections [us, microseconds], which basically corresponds to 2 engine rotations. By manipulating this measured time, it is possible to estimate the engine rotation speed [rpm].

fuel_control_simulink_fuelinoThe calculated engine speed, together with the TPS (Throttle Position Sensor) signal, are fed to two 1-D calibration maps, called "incrementi_rpm" and "incrementi_thr". These maps define the fuel injection time increment percentage ("perc_inc"), which is then converted into a time, in microseconds, "extension_time_ticks": this is the extension time, for the injector command. This logic allows the injection command pulse-width to be extended, of a certain amount, depending on engine rotation speed and throttle position.

The complete explanation of the algorithm is inside the source code file "INJmgr.cpp", which is available on GitHub, together with the complete Fuelino open source software. The function below runs at each injector input signal change interrupt (coming from the original ECU). Once the original ECU wants to turn ON the injector, Fuelino does it. On opposite, when the original ECU wants to turn OFF the injector, Fuelino says "wait!": first, it calculates the injection command extension time, and, if it is different than zero, the Arduino ATmega328P "Timer1" is set. After Timer1 expires, the injector is turned OFF.

In order to increase the stability, and safety of the system, I also introduced the concept of "Safety" into Fuelino's software. Can you imagine what happens if, for some reason, the injector is continuously driven "ON", and never deactivated? This is a security issue: not because the motorcycle can produce torque (if you release the gas, no air flows into the throttle body, and the engine does not produce any huge torque), but because a stuck open injector causes a continuous loss of gasoline, that you can stop just by turning OFF the ignition switch (key). This situation is not good. In order to avoid such possibly dangerous (?) situation, there is a "Safety" task which runs inside the Main Program (Arduino "Loop"), and makes sure that the injector is turned OFF. The name of this function is "INJmgr.safety_check()". This supervisory function makes sure that, even in case Fuelino does turn OFF the injector (for example due to a missing OFF interrupt), after a specific number of Loop iterations, the injector will be automatically turned OFF for safety.

Author: Davide Cavaliere

I am an Italian Electrical Engineer graduated at Politecnico di Milano. My interests are motorcycles and cars, electronics, programming, Internet of Things, and Japanese culture.

Leave a Reply

Your email address will not be published. Required fields are marked *