# Patent

## Title
Simple engine fuel controller

## Abstract

An electronic engine fuel controller that is simple, cheap, easily installed, and configurable for any internal combustion engine. The system is intended for upgrading older carbureted vehicles or vehicles that have been modified beyond the limits of the OEM controller. It takes advantage of micro controller technology with integrated memory, digital inputloutput, sensor and timer channels to produce a low parts count, as well as reliable operation in a variety of vehicles, even when installed by people with little experience in this area. Operation is by sensing a tachometer signal from the existing distributor, or similar device that produces one pulse per cylinder cycle. When a pulse is received, software in the micro measures engine parameters, calculates fuel parameters, and fires one or more injectors. Software on an external computer communicates with the micro, allowing the user to modify any of the controller parameters.

## Background
This application claims the benefit of U.S. Provisional Application No. 60/362,475 filed Mar. 7, 2002.


BACKGROUND OF THE INVENTION
During the early to mid-1980s, car manufacturers, under pressure to increase fuel economy and simultaneously reduce emissions, switched to electronic fuel injection to obtain more precise control of engine fuel under all operating conditions. When the automotive aftermarket saw the trend, it entered the field, first with PROM chips that allowed the buyer to modify the constants programmed into the electronic controller unit at the factory by simply switching chips. This allowed one to increase performance somewhat, generally at the expense of gas mileage, and to make engine modifications for which changes in program parameters were needed. Gradually, conversion kits were developed to allow hobbyists and racers to upgrade carbureted engines to Electronic Fuel Injection (EFI) or to replace OEM Electronic Control Units (ECUs) to obtain much more control over the system than the re-programmed PROM chips allowed. One of the first of these was U.S. Pat. No. 4,494,509 (1985) to Long. Although now plentiful, these kits are quite costly and difficult to install and configure. Numerous drivability problems whose solutions are beyond the capabilities of the users are also often reported after the installation. Furthermore, the price of these systems places them well beyond the reach of most hobbyists and enthusiasts.
The present invention provides an engine controller that is: more cost effective because of its low parts count due to integrated technology; simpler to install because of its generic design and flexible software, allowing it to be used with all models and makes of engines from motorcycles to trucks, even or odd number of cylinders, and regardless of the experience of the end user. The design is also more reliable because of several software algorithms that will be described.
OBJECTS AND SUMMARY OF THE INVENTION
A general object of an embodiment of the present invention is to provide a simple, reliable, user configurable system (electronic circuit and software) for electronic fuel injection control.
An object of an embodiment of the present invention is to provide an aftermarket EFI system that can be manufactured at low cost.
Another object of an embodiment of the present invention is to provide a generic EFI system that can be used with a large variety of engines of different sizes, numbers of cylinders, types and sizes of fuel injectors, and types of ignition systems.
A further object of an embodiment of the present invention is to provide an EFI system that can be easily installed by hobbyists and non-professional users with only a limited knowledge of electronics, computers, and the principles of electronic fuel control.
Another object of an embodiment of the present invention is to provide an EFI system with reduced susceptibility to electronic noise.
Briefly, and in accordance with at least one of the foregoing objects, an embodiment of the invention provides an integrated microprocessor based electronic circuit and software that uses an external tachometer signal and various sensor inputs to calculate combustion engine fuel requirements, and provides corresponding electronic control signals to open and close the engine mounted fuel injectors. Parameters for the calculation of these signals are user configurable.



BRIEF DESCRIPTION OF THE DRAWINGS
The present invention may best be described with reference to the accompanying drawings in which:
FIG. 1 is a block diagram providing an overview of the system.
FIG. 2 shows specifics of the integrated microprocessor and its regulated power supply.
FIG. 3 provides circuit diagrams of the conditioning and filtering of the sensor inputs.
FIG. 4 provides circuit diagrams for the fuel injector drivers, auxiliary outputs, and status LED lights.
FIG. 5 provides a block diagram of the software logic.
FIGS. 6A to 6H provide a software assembler listing for the ECU in the form of s-records that can be downloaded to a suitable micro controller.



DETAILED DESCRIPTION OF THE INVENTION
While the invention may be susceptible to embodiment in different forms, there is shown in the drawings, and herein will be described in detail, a specific embodiment with the understanding that the present disclosure is to be considered an exemplification of the principles of the invention, and is not intended to limit the invention to that as described herein.
1. Circuit Description
The overall hardware system is shown in FIG. 1 and is detailed in the following figures. We start the circuit description with the power supply (U5 in FIG. 2). This is an automotive grade linear 5-volt regulator that can, by itself, handle reverse and over-voltages. To this has been added the combination of diodes D14 and D16, which clamp reverse voltage spikes to −12 volts. D13 only permits positive polarity voltage to pass to DIS, which clamps this voltage to 22 volts eliminating the over-voltage effects of switched loads. The total combination provides an extremely robust power supply. Also, there are two power supply filter circuits—one consists of capacitor C18 and inductor L1, providing power to the internal Phase Lock Loop (PLL) clock, and L2, C21, and C22, which filter the analog power supply for the analog-to-digital converter.
The CPU of choice for this application is the Motorola MC68HC908GP32 (U1). This CPU is a member of Motorola's HC08 family of micro controllers, providing a rich integration of features, and hence allows a low system parts count. The CPU core runs at an internal bus speed of 8 MHz, which is derived from an internal phase-locked loop clocked from a 32.768 KHz crystal (Y1). The GP32 version has 32 Kbytes of on-chip flash ROM memory with direct in-circuit programming, which allows for the storage and runtime re-programming of constants that is extremely desirable in this application. There are 512 bytes of on-chip RAM memory—more than adequate for this application. Other features include two 16-bit, 2-channel timers, serial communication channels, and an 8-channel, 8-bit Analog to Digital Converter (ADC) for measuring sensor inputs.
The CPU oscillator circuit is comprised of a 32.768 watch crystal (Y1), two capacitors (C23 and C24), and two resistors (R21 and R22). The on-chip PLL clock circuit requires the external loop filter network C19, C20, and R20. The microprocessor has an internal power-on reset circuit, so no external circuitry is required.
Tuning of system configuration parameters while the engine is running is key to a successful injector control unit. This system uses a standard RS-232 communication interface chip (U6) to talk to a host PC, which is running a custom application that allows the download and tuning of the relevant parameters.
The sensor inputs to the system are shown in FIG. 3. The driving input for the system is the tachometer or timing signal, which is generally taken from the ignition circuit (ignition coil primary circuit or tachometer drive). This signal is clipped to +5V by Zener diode D8, and applied to a 4N25 opto isolator (U4) providing immunity to damage from over-voltage. The phototransistor in the opto isolator is biased by R11 and fed into the interrupt pin IRQ1 of the micro controller. By timing the interrupts and knowing that each one represents a cylinder firing, the RPM can be calculated by the micro controller. Furthermore, to significantly reduce the probability of a false tach trigger, a software time-adaptive filter is used on the interrupt such that it is only re-enabled for future triggers after some point in the RPM period is reached, for example the 1⁄2 way point.
The other critical input to the system comes from the manifold absolute pressure (MAP) sensor (U3) that monitors intake manifold vacuum. The sensor used here is the Motorola MPX4250 which is an integrated pressure sensor containing the sensing element, coupled to the engine manifold by a flexible tube, and an amplifier and temperature compensation circuitry all in one package, yielding an analog output which is proportional to applied pressure (absolute, not gauge). The output of the MAP sensor is filtered by R2 and C4, clamped by diode D1, and is supplied to channel 0 of the ADC in the micro controller. Using this sensor allows the system to handle normally aspirated and turbo engines to 2.5 Bar. Also, the MAP sensor ADC is sampled in the CPU at a fixed time after receipt of the tach signal; doing this eliminates fluctuation of the pressure due to piston motion during the engine cycle, and hence provides a consistent fuel mixture and a smoother running engine.
This fuel injection system is of the “speed-density” variety, meaning that the amount of air consumed (and required fuel) is deduced from the manifold absolute pressure and the RPM at which the engine is operating. Hence, with just these inputs, the engine can be run; the other inputs that follow provide more optimal control under different load and environmental conditions.
Engine temperature measurements are sensed by negative-coefficient thermistors mounted in the intake air stream (MAT) and engine coolant liquid (CLT). In order to sense the resistance of the sensors, they are configured as part of a voltage divider circuit—R4 for the MAT sensor and R7 for the CLT sensor. One side of each sensor is tied to ground. The resultant divider voltage is filtered by R5 and C5, C6 for the MAT sensor and R8 and C8, C7 for the CLT sensor, and protected from over-voltage by D2 and D3.
Real-time sensing of throttle position is required by the CPU in order to provide more fuel during periods of rapid throttle opening. The standard throttle position sensor (TPS) is a simple 10K potentiometer attached to the engine throttle shaft with a constant voltage (5 volts in this case) across the potentiometer. The wiper terminal of the pot will therefore provide a variable voltage between 0 to 5 volts. This voltage is filtered by C10 and R9 and clamped by diode D4, and then applied to ADC channel 3.
Other input sensors include battery voltage (needed to adjust the injector opening time), derived by the resistor divider consisting of R3 and R6, and the exhaust gas oxygen content sensor (O2). The O2 sensor is a special device that generates a small voltage (approx. 0.6 volts) when the ratio of gas to air is less than 14.7. Once again, the common theme of filtering (R1 and C2) and limiting (D11) is utilized.
The boot loader header (H1) allows a user to pull the battery voltage terminal (AD4) on the CPU down to ground. This is sensed in the CPU software and is recognized as the signal to cease normal operation and load new software in the CPU ROM memory using the RS232 port.
FIG. 4 is the schematic for the various output drivers for fuel injectors and relays. Starting with the fuel injectors, there are two separate but identical fuel injector drivers (only the first of them will be described). A timer output compare/PWM channel in the CPU is fed into one of the two input channels of the transistor driver chip (U7), which provides fast gate drive (via R12) to the Field Effect Transistor (FET) Q2. This is important because the injector needs to be opened as rapidly as possible if fuel metering is to be precise. The fuel injectors are pulled low by Q2, and over-voltage and inductive kickback from them are handled by the combination of Zener diode D21 and the Darlington transistor (Q1). The two FET injector drivers may be connected to two banks of as many injectors as the drivers can handle. This must be determined by the injector current requirements, but 4 injectors per bank is easily achievable. The user can specify through the configuration software how often to fire each bank of injectors relative to the tach input, and whether to fire them sequentially, so that each injector fires once every engine cylinder cycle of two crank revolutions, or simultaneously, such that each injector fires every crank revolution. This allows the system to be used with throttle body injectors (one or two central injectors) or multiport (one injector per cylinder).
To be truly generic it is required that the system handle the two common electrical impedances for fuel injectors: high impedance (roughly 12–16 ohms) and low impedance (1.2 to 2.5 ohms). The high impedance type (also known as saturated) provides its own current limiting, due to its comparably high resistance, and can be driven directly by Q2. The low-impedance types, known as peak-and-hold injectors, require a different drive strategy. These injectors like to have higher “peak” current applied, say 4 amps, while they are opening, and a lower “hold” current (like 1 amp or so) to keep them open. To provide this relative current control, Q2 is driven fully on during the time the injector is opening. When a predetermined time has elapsed which is sufficient to ensure that the injector is open (based on injector impedance and supply voltage), the drive to Q2 is switched to a pulse-width modulation mode (using the PWM mode of the timer channel), with a frequency of 15 KHz and a duty cycle which keeps the average current through the injector at the desired “hold” value. Both the duration of the “peak” current and the amount of reduction in amplitude during the “hold” portion are configurable by the user in the software.
Direct control of a fast-idle solenoid is provided by Q5 (spikes limited by D9), which is opened when the engine is first started and not at a fully warmed temperature. The fast idle solenoid provides an air bypass around the throttle plates to provide additional air in the intake manifold. The operation of the electric fuel pump is also controlled in the micro controller (via a relay) using Q3.
Finally, three LED lights are switched by transistors Q9–Q11. The first tells the user that the injectors are being driven, the other two tell the user when extra fuel enrichment is being supplied to compensate for cold engine warm up, and for acceleration, as indicated by a large throttle opening rate.
2. Software Description
A summary of the software flow is provided in FIG. 5, and a complete listing of the embedded code is provided in FIG. 6 in the form of s-records which can be downloaded into Motorola HC08 series micro controllers through a serial port with commercially available software for this purpose installed on a host computer. As can be seen from the flowchart, the main loop of the program performs calculations on a continuing basis, as long as there are no interrupts. The latter, shown in the right column of FIG. 5, are used for time critical operations and for a 100 microsecond clock.
The primary control algorithm, performed in the main loop of the embedded program, is the calculation of injector on time or pulse width. For this simple fuel injection system, the equations used for this have been optimized as follows:

air_density=0.3916*MAP/(MAT+459.7)

mass_air=air_density*cylinder_volume

mass_fuel=mass_air/AFR

Inj_PW=mass_fuel/Inj_Flow_Rate

The injector flow rate is a constant measured at the factory by flowing the injector at the line pressure specified for the car. The fuel required in the above equation depends on the amount (in mass) of air entering the engine and the desired air/fuel ratio (AFR). In the above, air density is in pounds per cubic foot, MAP in kilopascals, MAT is the intake manifold air temperature in degrees Fahrenheit, and the 459.7 converts to degrees Kelvin. The volume of the cylinder is in cubic feet.
To simplify the calculations required by the microprocessor, one can define a quantity at a specific set of input values. In this system, we define the variable Req_fuel which is the amount of injector open time required for a MAP value of 100 Kpa (essentially wide-open throttle), MAT value of 70 degrees F., and assign values for AFR and cylinder volume which relate to the application. Req_fuel is a constant inside of the program. With this definition, the code is simplified by the use of direct units for the calculations, for example, MAP readings in Kpa/100 can be directly multiplied by Req_fuel to yield the change in pulse width time. Also, quantities, like volumetric efficiency (VE), which is the efficiency of the engine in pumping air at a specific RPM and load, can also be directly multiplied to the Req_fuel value. Likewise, acceleration and warm up enrichment values are directly multiplied in normalized percentages, as well as feedback settings for closed loop operation (O2). Lookup tables for percent changes from the defined baseline value for Req_fuel is also used for temperature correction and barometric pressure correction, and are multiplied in a similar manner. This approach is very intuitive for users and yields:

Inj_PW=Req_fuel*(MAP/100)*(VE/100)*(O2/100)*(Warm/100)*(Accel/100)*(Baro/100)*(Air/100).

The preceding description covers the basic requirements, but there are several other corrections that need to be made. The first of these is enrichment for a cold start. During the cranking period and for at least a minute or more thereafter, an extremely rich fuel mixture is required for the engine to fire and run properly. How rich depends on the coolant temperature as measured by the coolant sensor. Hence, a user-configurable table is provided in flash memory for fuel enrichment vs temperature, and this is factored into the injector pulse width equation. As the engine warms up, the enrichment tapers off.
During the cranking phase, more sophisticated strategies employ asynchronous injection, in which the injector is made to pulse several short bursts of fuel rather than a single long shot. This produces better mixing of the fuel and air. This is needed during cranking, because there is very little engine vacuum generated at the slow cranking speeds. Hence, the air moves very slowly through the intake tract and does not mix well with the fuel, thereby producing a weaker and rougher combustion event.
A second area requiring special enrichment is acceleration. When the throttle is depressed rapidly for acceleration, a very rich mixture is required for a short period to keep the engine, from stumbling. To do this the ECU must first sense that acceleration is occurring. It does this by polling for a TPS and/or MAP sensor rate of change that is above a fixed threshold. When this occurs, the mixture is enriched by an amount, and for a time period, which is a function of the rate of change.
Another fuel correction commonly used is for barometric pressure. This affects the airflow and air density, and hence the fuel must be corrected to maintain a desired AFR. In the present system the intake MAP reading just before starting the engine is used as the barometric pressure, and a correction table is applied.
A stoichiometric air/fuel ratio of 14.7 is generally considered optimal for all around driving, economy and emissions, and this is what is strived for in closed loop mode using oxygen sensor feedback. This sensor, as the name implies, sends back to the ECU a voltage proportional to the amount of free oxygen in the exhaust. Too much means a lean mixture requiring more fuel be added; too little, just the opposite. Thus, in closed loop mode a PID loop is used to modify the basic fuel equation so as to maintain a just right fuel mix regardless of the type of gas used or the amount of wear in the engine. This mode is used off idle during cruise conditions when such a stoichiometric mixture is desired.
The fuel injector is a solenoid tied to battery voltage on one end, and is grounded by the ECU at the other end when it is desired to turn on the injector. Now the specification injector flow rate is for steady state conditions, but the injector in the engine is not run at steady state, it is constantly pulsed on and off, and requires about 1–2 ms to fully open, and 1 ms to fully close. (During opening it is fighting spring pressure, while the spring assists in closing.) This fact requires two more corrections for fuel regulation. One is for the fact that the flow rate is not constant during the open/close ramps, and the other is a compensation for battery voltage, which has an effect on the open time. If the battery is weak, the injector will take longer to open. Hence, battery voltage is measured as shown in FIG. 3, and the injector open time is modified either linearly or from a table according to the deviation of battery voltage from 12 volts.
A practical feature of the software not directly related to engine control is the provision for a bootloader program. This feature allows corrections and upgrades to the software to be easily downloaded by the users when they are developed.

## Claims

1. A system for controlling fuel injection of an internal combustion engine, the system comprising:
an integrated microcontroller;
an external tachometer configured to provide trigger pulses to the microcontroller;
analog sensors configured to measure engine operating parameters and output corresponding analog signals;
at least one analog to digital converter configured to input the analog signals from the analog sensors and output corresponding digital data signals to the microcontroller;
at least one memory configured to store user configurable tables and constants for calculating engine fuel requirements; and
fuel injector electronic drive circuits operable with electrical current pulses, wherein the microcontroller controls on-time and off-time of each fuel injector using pulse width modulation of the electrical currents capable of opening and closing each fuel injector, and within the fuel injector on-time the microcontroller provides a steady electrical current capable of opening the fuel injector for a first time period within the fuel injector on-time and a pulse width modulated electrical current capable of maintaining the fuel injector in an open state for a second time period comprising a remaining portion of the fuel injector on-time, thereby controlling peak current duration to open the fuel injector and reducing holding current to maintain the fuel injector in an open state,
wherein the microcontroller controls the fuel injector electronic drive circuits according to the user configurable tables and constants and based on the digital data signals converted from the analog sensor signals.

2. The engine fuel control system as defined in claim 1, wherein a software filter for the tachometer trigger pulse inhibits detection of additional tachometer trigger pulses until a portion of an RPM period elapses.

3. The engine fuel control system as defined in claim 1, wherein a start of acquisition of sensor data by the analog to digital converter is synchronized to the tachometer trigger pulses, cuasing sampling of a Manifold Absolute Pressure sensor to occur at a same point in each intake cycle.

4. The engine fuel control system as defined in claim 1 further comprising indicator lights configured to visually indicate occurrences of fuel injector firing signals, and variations in drive current pulse width durations for all fuel injector.

5. The engine fuel control system as defined in claim 1, further comprising a boot loader to download computer programs for the microcontroller.

6. The engine fuel control system as defined in claim 1, further comprising a graphical user interface configured to set fuel requirements for an engine using an algorithm based on user-provided fuel requirements at a wide-open throttle condition and percentage modifications of the fuel requirements for operation at other than the wide-open throttle condition.

7. The engine fuel control system as defined in claim 1, wherein the microcontroller comprises at least one analog to digital converter.

8. The engine fuel control system as defined in claim 1, wherein the analog sensors comprise at least one of a manifold air pressure sensor, a manifold air temperature sensor, a coolant temperature sensor, a throttle position sensor, an engine speed sensor and an exhaust oxygen concentration sensor.

9. The engine fuel control system as defined in claim 1, wherein the microcontroller further comprises the memory.

10. The engine fuel control system as defined in claim 1, wherein the memory is external to the microcontroller.

11. The engine fuel control system as defined in claim 1, wherein the microcontroller is a microprocessor.

12. A method for controlling fuel injection of an internal combustion engine, the method comprising:
measuring engine speed;
measuring engine operating parameters;
reading previously stored user configurable tables and constants for calculating engine fuel requirements from a memory;
controlling on-time and off-time of fuel injectors using pulse width modulation of electrical currents capable of opening and closing each fuel injector, and within the fuel injector on-time providing a steady electrical current capable of opening the fuel injectors for a first time period within the fuel injector on-time and a pulse width modulated electrical current capable of maintaining the fuel injectors in an open state for a second time period comprising a remaining portion of the fuel injector on-time; and
controlling on-time and off-time of the fuel injectors according to the user configurable tables and constants and based on the measured engine operating parameters.

13. A computer readable medium having stored therein a program for making a computer execute a program for controlling fuel injection of an internal combustion engine, said program including computer executable instructions for performing steps comprising:
measuring engine speed;
measuring engine operating parameters;
reading previously stored user configurable tables and constants for calculating engine fuel requirements from a memory;
controlling on-time and off-time of fuel injectors using pulse width modulation of electrical currents capable of opening and closing each fuel injector, and within the fuel injector on-time providing a steady electrical current capable of opening the fuel injectors for a first time period within the fuel injector on-time and a pulse width modulated electrical current capable of maintaining the fuel injectors in an open state for a second time period comprising a remaining portion of the fuel injector on-time;
controlling on-time and off-time of the fuel injectors according to the user configurable tables and constants and based on the measured engine operating parameters; and
controlling indicator lights configured to visually indicate occurrences of fuel injector firing signals, and variations in drive current pulse width durations for all fuel injectors.