Air fuel ratio detector corrector for combustion engines using adaptive neuro-fuzzy networks

A perfect mix of the air and fuel in internal combustion engines is desirable for proper combustion of fuel with air. The vehicles running on road emit harmful gases due to improper combustion. This problem is severe in heavy vehicles like locomotive engines. To overcome this problem, generally an operator opens or closes the valve of fuel injection pump of locomotive engines to control amount of air going inside the combustion chamber, which requires constant monitoring. A model is proposed in this paper to alleviate combustion process. The method involves recording the time-varying flow of fuel components in combustion chamber. A Fuzzy Neural Network is trained for around 40 fuels to ascertain the required amount of air to form a standard mix to produce non-harmful gases and about 12 fuels are used for testing the network’s performance. The network then adaptively determines the additional/subtractive amount of air required for proper combustion. Mean square error calculation ensures the effectiveness of the network’s performance.


Introduction
The air-fuel ratio control problem has been extensively investigated over many years.PI-feed forward control is commonly used to control the fueling and maintain a desired air-fuel ratio.According to Astrom and Wittenmark [1] gain scheduling can be used to improve the performance.However, the control gains are engine-specific and difficult to tune.Cho and Hedrick [2] derived a nonlinear controller for fuel-injected automotive engines while Cho and Oh [3] designed a control law applicable to a wide range of conditions.Choi and Hedrick [4] designed an observer-based controller for spark-ignited engines and Kaidantzis et al. [5] described a robust, self-calibrating feedback for air-fuel ratio control.Won et al. [6] detailed airfuel ratio control using a Gaussian network.Yoon and Sunwoo [7] derived an adaptive sliding model control algorithm based on the measurement of a binary oxygen sensor to reduce the exhaust gas emissions.Raghuram et al. [8] proposed a model for estimating the AFR from cylinder pressure data.Yinhua et al. [9] presented a modeling approach from individual cylinder fuel injection to the output of the sensor and thus determining air-fuel ratio for internal combustion engines with multi-cylinders.
In terms of advanced approaches, here we mention the use of adaptive controllers by Turin and Geering [10], observer based controllers by Powell et al. [11], H∞ controllers by Mianzo et al. [12] and Model Predictive Controllers by Muske and Jones [13].The use of an electronic throttle as an additional control actuator by Chang et al. [14] and secondary/port throttles Stefanopoulou et al. [15] have been also explored.Apart from stoichiometric air-to-fuel ratio controllers, Zhang et al. [16] have described control of air-to-fuel ratio in a lean burn engine using linear parameter-varying controllers.The motivation for these and related studies has been to achieve improved performance and robustness of the air-to-fuel ratio control thereby enabling emission, fuel economy and drivability improvements.
Previous papers have described the use of neural networks to correlate the signatures formed by the spark plug voltage waveforms with specific values of air-fuel ratio [17,18].Some of the practical problems, due to electrical noise, the high voltages encountered and lack of stability in the engine, have also been reported by Howlett [19,20].Powell

et al. & Muske and
Jones [11,13] found that the neural network can differentiate between various categories of airfuel ratio with a success rate of up to approximately 90% provided load, speed etc., were held constant.A number of neural network architectures have been investigated in this application, including the Multi-Layer Perceptron (MLP) and the Radial Basis Function (RBF) network.
Neural network models have been described in the literature by [21][22][23].The MLP network has proven useful in a range of applications, providing a compact representation of the problem space.A Cerebellar Model Articulation Controller (CMAC) Neural Network have been used by Arora [24] for adaptively regulating the air-fuel balance in combustion engines.With the use of large amounts of training data, the standard MLP network executing a backpropagation algorithm gives the desired results and the CMAC Neural Network learns adaptively and converges quickly enough.But due to vagueness in the type and quantity of fuel along with the uncertainty in amount of air, pure neural networks fail to give generalized result.Hence, a robust, low-cost method of monitoring and controlling combustion process may be of great interest to engine manufacturers.Such a system must have the capability of handling uncertainty with trainability mechanism to maintain a balance between the quantity of air and fuel.Heading in the same direction, an effort is made to develop a model which not only smoothly handles vagueness, but also identifies the imbalance in amount of air and fuel for proper combustion.
In recent years, techniques coupled with fuzzy control are becoming popular in the automotive field.Assuming that the load and speed of engine are constant, an adaptive learning system based on Neural Network has been introduced to deal with fuzzy environment.The novelty in the proposed model lies in its approach.A neurofuzzy model is developed in MATLAB with two parts: detector and corrector.Once trained, the network first adaptively determines the additional/subtractive amount of air required for proper combustion and then absorbs/releases the required amount of air.Capability to deal with fuzziness or uncertainty in the amount of air and fuel is its strength.The rest of the paper is organized as follows.Section II discusses the combustion process taking place in combustion chamber.Section III discusses the architecture of adaptive neuro-fuzzy inference system and give details on data generation and selection.Section IV presents the methodology used and discusses the test results.Finally, Section V summarizes findings and conclusion of this study.

Combustion Process
All fuels consist mostly of atomic Carbon (C), Hydrogen (H), Oxygen (O), Nitrogen (N), Sulphur (S), minerals (ash) and water (H 2 O).In the process of fuel combustion, the molecular Oxygen (O 2 ) in air reacts with the combustible components of fuel.As an example, the fuel Carbon (C) reacts with oxygen (O 2 ) of the air to generate Carbon Dioxide (CO 2 ).If the reaction is incomplete, Carbon Monoxide (CO), a deadly gas is generated.It is worthwhile to point out that all combustion products such as CO 2 , CO, NOx, C n H m , SO 2 , SO 3 , except for the water generated by combustion of H to H 2 O, are harmful, out of which CO 2 is absorbed by plants to produce O 2 .
Theoretically, the air-fuel ratio necessary for complete combustion depends only upon the complete composition of the fuel; practically it also depends upon how thoroughly the air and fuel are mixed so that their particles can combine properly.Improving combustion means burning the fuel completely and minimizing harmful emission.

Internal combustion engine
An engine in which both the heat energy and the ensuing mechanical energy are produced inside the engine is called Internal Combustion Engine.One of the problems the engine faces is that the fuel system might be supplying too much or too little fuel and air mixture, making the combustion to be improper.This may result in emission of harmful gases like CO, NOx, etc.
In internal combustion engines, the combustion of fuel takes place in the presence of air, not pure oxygen.Air contains many constituents, particularly oxygen, nitrogen, argon and other vapors and inert gases.Its volumetric composition is approximately 21% oxygen, 78% nitrogen and 1% argon.Since neither nitrogen nor argon enters into chemical reaction, it is sufficiently accurate to assume that volumetric air proportions are 21% oxygen and 79% nitrogen and that for 100 moles of air, that are 21 moles of oxygen and 79 moles of nitrogen.That is: Therefore, for each mole of oxygen in air, there are 3.76 moles of nitrogen.The internal combustion engine uses a control scheme that monitors outputs of a system to control the inputs to a system, thereby managing the emissions and fuel economy of the engine.The model proposed in this paper, can be incorporated into combustion unit to determine when and how long the air injector should be open.This can be done to ensure the lowest emissions and best mileage.This would lead to two cases: • Case 1: If the air intake valve stays open for long, chances are there that more air than needed is sucked in, which may result into injection of more fuel than required.This results into burning of more fuel giving less mileage.• Case 2: If the air intake valve opens for less time, the less amount of air will be sucked in than the desired quantity, which may result into imbalance in combustion process.This results into improper burning of fuel emitting harmful gases.
In order to reduce the emission of carbon monoxide (CO) and other toxic gases and to carry out efficient combustion in internal combustion engines and giving adequate mileage, the application determines the proper amount of air-fuel mixture required.The model consists of two parts: • Detector: Depending upon the type of the fuel and the quantity of the fuel, the model determines the amount of air required for most efficient combustion • Corrector: Depending upon the type of the fuel, the quantity of the fuel and the air intake, the model determines the quantity of air to be added or reduced for efficient combustion.shows the proposed phases to be incorporated into combustion engine for maintaining a proper balance between air and fuel going inside the combustion chamber.For more details on the parts and working of internal combustion engines, readers are referred to [25].
There are a number of factors that restrict the flow of air into the input valve leading to inefficient combustion like a slight pressure drop through a throttle body.The fuel injection throttle bodies restrict air flow producing a pressure drop when the throttle blade is partially closed.Intake valves and ports offer some restriction at some engine speeds.The exhaust stroke does not expel all the burnt gases because some exhaust is trapped in the clearance volume, the exhaust valves and exhaust pipes offering some restrictions.So, the model suggests to sense the amount of fuel and the amount of air entering the combustion chamber and decide whether the air entering the chamber is sufficient or not so as to make necessary increment or decrement in the amount of air by controlling the input valve or the exhaust valve as the part of the variable valve technology.The fuel flow rate is bounded between 0 to 0.004 kg s .This restriction is important when simulating the performance because it is unrealistic to allow the controller to command negative or infinite fuel.

Proposed Neuro-Fuzzy Model
The neuro-fuzzy models try to link the basic concepts of fuzzy logic and neural network theory.The peculiar concept of fuzzy logic is that an element of the world belongs to a set, specifying a feature of the element called linguistic variable, with a value ranging from 0 to 1 according to a function called membership function.Following the conventional logic, an inference system based on rules in the form ''IF-THEN'' is formulated for the fuzzy logic.
The computation of the rule consequences starting from the value of its antecedent is computed by means of different functions (minimum, maximum, and weighted mean).In neuro-fuzzy models, neural networks are used to tune the membership functions of a fuzzy system, and to extract fuzzy rules from numerical data.To enable a system to deal with cognitive uncertainties in a manner more like humans, the concept of fuzzy logic is incorporated into the neural networks.

Adaptive neuro-fuzzy inference system
As suggested by Shing and Jang [26], Adaptive Neuro-Fuzzy Inference System (ANFIS) can serve as a basis for constructing a set of if-then rules with proper membership functions to generate input-output pairs.In this work, a 6layered neuro-fuzzy inference system as shown in figure 2 has been used.( where, (1)   i x is the input and (1) i y is the output of the neuron i in the layer 1.The input and output of this layer are shown as follows: Where, (2)   i x is the input (same as (1) i y ) and (2) i y is the output of the neuron i in the layer 2.
Layer 3 is the rule layer in which each neuron corresponds to a single Sugeno-type fuzzy rule.A rule neuron receives inputs from respective fuzzification neurons and calculates the firing strength of the rule it represents.In an ANFIS, the conjunction of rule antecedents is evaluated by operator product. (3) (3) Where, (3)   i x is the input and (3) i y is the output of the neuron i in the layer 3. Layer 4 is the normalization layer in which each neuron receives inputs from all the neurons in the rule layer and calculates the normalized strength of a given rule.The normalized firing strength is the ratio of the firing strength of a given rule to the sum of firing strengths of all rules.It represents the contribution of a given rule to the final result.Thus, the output of the neuron i in layer4 is determined as Where, (4)   i x is the input and (4) i y is the output of the neuron i in the layer 4.
For the next layer first we have to estimate the consequent parameters for each neuron in layer 5.
The equation for estimating consequent parameters is, where d y is the desired output for the given input- output pair and A, Considering the same values of  Layer 6 is represented by a single summation neuron.This neuron calculates the sum of the outputs of all defuzzification neurons and produces the overall ANFIS output y.
 

Generating training and test data
The general formula of fuel used in combustion engines can be taken as m n p C H O where m, n and p represent the number of moles of carbon, hydrogen and oxygen atoms in a mole of fuel.The basic equation for combustion of fuel in presence of air is:  where Y cc is the moles of oxygen per mole of fuel.The nitrogen does not take part in reaction.
On balancing the number of moles of oxygen on both sides: The stoichiometric equation now becomes: For complete combustion of fuel of finite size, some additional amount of oxygen is required.Each droplet of fuel should be surrounded by excess air to assure oxidation of all the fuel molecules.Thus, practically depending on engine and fuel type, 1.5 times as much as air is actually used than is theoretically required.This is called excess air factor.Consider the following example equation to determine the amount of air required for combustion on the basis of quantity of fuel: Step1: Estimate the Quantity of fuel coming in Considering 5 mg of

Experiments and Results
The training data consisted of almost various types of fuels.Separate experiments have been carried out for "detector" and "corrector" part of the model.A flowchart representing the steps of proposed ANFIS model is shown in figure 4.
Supervised training method has been used to train the ANFIS to detect the amount of air required to burn the fuel flowing in the combustion chamber.After the training, the network has been tested using the test set to check the validity of the model.Validation data is used to test the data not utilized to develop the model.Fuzzy logic Toolbox of MATLAB have been used develop the ANFIS model.The network also determines the surplus/deficit amount of air required to completely burn the fuel.For both detector and corrector, gbell nonlinear membership function having parameters a, b, c is used to adjust the overall form of μ(x).Parameter a is width of the membership function, parameter c is location of the peak of membership function and parameter b determines the extent of fuzziness [27].Gbell follows a smooth curve at the extreme points and achieves more accurate results than triangular membership function [28].
After rigorous training of ANFIS for selected fuels the network performance error is measured.The calculations shown in table 3 depicts actual overall outcome y produced by ANFIS in detection phase which agrees with expected output d y (refer equation 7).This validates the effectiveness and accuracy of the proposed airfuel ratio model.

Detector
The model for the detector considers 2 fuzzy inputs for Carbon (C) and Hydrogen (H) as the major constituents of fuel with 'gbell' membership function as shown in figure 5.
Figure 6 represents that the error curve plotted on the training data after 10 epochs was found to be 9.2726e-0005.This action plots the test data against the FIS output (shown in red) in the plot.Figure 7 shows the comparison between expected actual output (FIS output) and the output produced by ANFIS on 200 training data pairs.It can be observed that both the actual and expected outcomes almost overlap each other.
MATLAB has been used to model the detection and correction of the amount of air required for proper combustion inside the combustion chamber.As discussed above, the structure of six layered Neuro-fuzzy Inference System with two inputs and single output is shown in figure 8.The inputs are the amount of Carbon and Hydrogen and the output is generated in terms of amount of air required for full combustion.
Figure 9 shows the non-linear surface of the Sugeno Fuzzy model.With five membership functions for each of the two inputs, the ANFIS model considers 25 rules.

Corrector
For implementation of "corrector" ANFIS in the model is provided with 3 inputs, fuel constituents Carbon (C) and Hydrogen (H) and air with same 'gbell' membership function as shown in figure 10.
The ANFIS structure with three inputs and single output is shown in figure 11 whereas figure 12 demonstrates the non-linear error surface of the model.

Findings and Conclusion
A model has been proposed with an improved technique for adaptive control of the air supply to an internal combustion engine.The technique provides a convenient and quick method of achieving good fuel regulation and consequently improved control of exhaust emissions.The fuzzy fuel-injection Neural Network incorporated into combustion system can result into increased engine power with better fuel usage.In addition, the system is capable of maintaining the balance between air and fuel, leading to reduced emissions.Constant monitoring and control of the air suction by combustion chamber for burning of fuel is effective way to achieve improved combustion efficiency and performance, as well as the reduction of exhaust emissions.Thus, maintaining air-fuel ratio is important in the combustion and calibration processes.If there is too much fuel, not all of it is burnt, causing high fuel consumption and increased emissions of HC and CO; too little fuel can result in overheating and engine damage such as burnt exhaust valves.
The fuzzy neural network is capable of autonomously learning the amount of air required to burn completely a given amount of fuel through the use of adaptive learning method.Besides controlling the emission of harmful gases, the air-to-fuel ratio control also aids fuel economy.Experimental results demonstrate the improved air-fuel regulation thereby assuring that the approach is found to be extremely effective in identifying imbalance in combustion, detecting previously learnt air-fuel combination, and autonomously improving its performance over time by self-learning.Air-to-fuel ratio control performance can strongly impact key vehicle attributes such as emissions, fuel economy and drivability.Together with the fuzzy sets and rules, the proposed model can be considered as a monitoring and control system, which helps to regulate the proportion of air and fuel in vehicles to increase combustion engine efficiency and to reduce the amount of harmful gases thus emitted.This aided the optimization process and resulted in quick and convenient tuning.

Figure 2 .
Figure 2. Six-layered ANFIS architecture For the explanation of layer-wise implementation of ANFIS using the above structure, let us consider the Detector part of the model with the example of a simplest fuel CH 4 .Around 200 samples consisting of different combinations of C and H for each of the 40 fuels were used for training the ANFIS.Figure 3 shows a sample dataset for ANFIS training.

Figure 3 .
Figure 3. Sample training data for ANFIS (Detector) from Layer 5 is as follows:

4 CH 5 .:
Compute air with safety factor (i.e.Lambdaexcess air factor) safety factor ranges from 0.7 to 1.5, we have considered safety factor to be 1.Step5Figure out the air required in terms of mg of air= 28.84 4.446428575 28.

Table 1 .
Sample input to the first layer of ANFIS

Table 2 .
Fifth layer computation in ANFIS

Table 3 .
Sixth layer computation in ANFIS