2 SPIKING NEURAL NETWORKS BASED PID LIKE FLC DESIGN FOR AN IDLE SPEED CONTROL OF AN AUTOMOTIVE

10.30772/qjes.v10i4.513 Abstract: Automatic control of automotive engines provides benefits in the engines performance like emission reduction and fuel economy. The drop in idle speed problem can be seen as the disturbance rejection problem in the main engine speed. In this paper, a PID-like Fuzzy Logic Control (PIDFC) with minimum structure for the four strokes, four cylinders, gasoline engine is designed and simulated to maintain the engine speed at nominal value in idle speed mode. The speed performance must satisfy minimize fuel consumption, and as a result reduces the fuel emissions. A spiking Neural Network (SNN) trained by Particle Swarm Optimization (PSO) algorithm is proposed to online-adapt the inputs and output gains of the PID fuzzy controller in order to achieve the required speed performance. A Mean Value Engine Model (MVEM) is used to simulate nonlinear model of engine. .Results of simulation for this controller showed good improvements over the PIDFC in the idle speed response. .The peak overshoot is reduced about (70 %), the undershoot is reduced about (50 %), the settling time is. .reduced about (83%) and the fuel consumed is reduced about reserved. results with improved economic in fuel and emissions reduction. Many of the control methodologies for the problem of idle speed suggested during the past decades. Different papers discussed idle speed control techniques with the corresponding control oriented model used were published. This includes control techniques based on different modern control alternatives such as Linear Quadratic (LQ), Fuzzy Logic techniques and Neural Network. Panse , [1] presented a dynamic-oriented control mean value engine model of a PFI engine. The controller is developed by PID to idle mode which used throttle valve to regulate the speed. The development of successful controller maintained the stable state of the idle speed in the simulation. Santes et al ., [2] presented the ISC as one of problems of calculating a greater group set for a modeling of crossbred system for SI engine. The problem is represented by computing a maximum set of safe for a crossbred system modeling of an SI engine. An algorithm in the discrete time domain was proposed for the determination of the maximal safe set without assuming synchronization between sampling time and switching time for idle control. Simulation results showed increasing efficiency of the proposed approach. Gibson et al. , [3] presented lead reparations analysis, feed-forward and design techniques to monitor disorder for ISC system with minimum reserve spark level. A reduction of 30 per cent in the maximum reduction of the speed of engine was obtained compared with an ISC with no observer compensation disorder lead. The disturbance rejection response is compared with response from conventional idle speed control with high levels of spark reverse. A cylinder by cylinder non-linear engine model and idle speed control simulation were used to prove the results of linear simulation. Ghaffari et al. [4] presented a modeling of a spark ignition engine and demonstrated capabilities of Simulink to full engine model. A PID adapting method which used an adaptive FLC for modeling the relation between gains of the controller and the response of target output, with the specifications set response by required percentage settling time and overshoot, was designed. The adaptive FLC used to tune online the gains of PID for different response of specifications. The results showed that better performances


INTRODUCTION
Most of the automotive machines use in everyday life equipped with gasoline Port Fuel Injection (PFI) engines. Ordinarily these engines are of Spark Ignited (SI), four strokes and Otto cycle based conversion of chemical energy from fuel to mechanical energy [1]. These engines run in different operating conditions during their life cycle such as cold start, idling, cruising…etc. These operating conditions are different fro each other in objectives and performance. At idle operating mode that characterizes by low speed of engine ordinarily between (750-1400) revolution per minute (rpm) [1] valve of the throttle is closed. Idle speed control is represented one of difficult and public problem in engine of automotive, because of nonlinearity, complexity and time delay presented by the system. So, a controller is compensated for error in speed is needed. The [2] presented the ISC as one of problems of calculating a greater group set for a modeling of crossbred system for SI engine. The problem is represented by computing a maximum set of safe for a crossbred system modeling of an SI engine. An algorithm in the discrete time domain was proposed for the determination of the maximal safe set without assuming synchronization between sampling time and switching time for idle control. Simulation results showed increasing efficiency of the proposed approach. Gibson et al., [3] presented lead reparations analysis, feed-forward and design techniques to monitor disorder for ISC system with minimum reserve spark level. A reduction of 30 per cent in the maximum reduction of the speed of engine was obtained compared with an ISC with no observer compensation disorder lead. The disturbance rejection response is compared with response from conventional idle speed control with high levels of spark reverse. A cylinder by cylinder non-linear engine model and idle speed control simulation were used to prove the results of linear simulation. Ghaffari et al. [4] presented a modeling of a spark ignition engine and demonstrated capabilities of Simulink to full engine model. A PID adapting method which used an adaptive FLC for modeling the relation between gains of the controller and the response of target output, with the specifications set response by required percentage settling time and overshoot, was designed. The adaptive FLC used to tune online the gains of PID for different response of specifications. The results showed that better performances achieved with the full controller. Syed et al. [5], presented the process in field of automotive to implement the rule-based fuzzy gain scheduling PI controller to control the engine power required and behavior of speed in the power-split Hybrid Electric Vehicles (HEV). The improvements include elimination of the overshoots as well as approximate by 50% faster response and settling times in comparison with the conventional linear PI control approach. Wong et al. [6] in 2009 presented a non-linear model algorithm of predictive control for AFR organization based the online Neural Networks. The implementation of the control in the real car as a check. The actual result of the test showed that the engine air ratio can be regulated to the stoichiometric value (1.0). Liu and Zhou, [7] in 2010 described a simulation based Fuzzy Neural Network (FNN). The engine model used here is a MVEM that incorporates nonlinearities and time delays exhibited by the system. This model consisted of three important subsystems that represented the behaviors of the fuel, the acceleration of the crankshaft and the intake manifold dynamics. They found that the error of Air Fuel Ratio (AFR) is large under transient conditions, when throttle degree is changed. When using a FNN controller, the AFR errors can be controlled to a tight range. The system has smaller overshoot lower adjust the time. Angel et al. [9] presented a FLC to maintain stoichiometric AFR in the engine for achieving a required ratio for emissions reduction, energetic efficiency improvement and power generation, with a reduction in the temperatures operating of an engine. The control is accomplished with precision devices led by the Electronic Control Unit (ECU). It is essentially a logical device that is responsible for maintaining a stoichiometric air-fuel ratio. Xiaocheng et al. [10] analyzed a PID control, FLC and PID like FLC are designed, by applied these three controllers to ISC of the automotive gas engines. They found that the PID like FLC is of high progress during contrastive analyses in control effect of the three controllers in the process of cooling high idle start, switching high to low idle and low to high idle. Shamekhi et al. [11] proposed a MVEM and ANNs by including them in mean value model. They presented a real-time model with high definition and dedication for the engines of spark ignition, as fully as possible. By incorporating the Neural Networks into the mathematical approximation relationships of the engine, they named the model as Neuro-MVEM, which is able to accurately predict the engine (transient and steady states) outputs such as torque producing, emission and speed engine in real time.

MEAN VALUE ENGINE MODEL OF SI ENGINE
The automotive engine is modeled using a class of models called Mean Value Engine Models (MVEMs).

Engine Modeling
The model is including fuel, air and rotational dynamics also process delay attendant in the engine. In SI engine, it is useful to divide it in separate subsystems [12]. The subsystems are: 1-Intake air dynamics. 2-Fuel dynamics. 3-Crankshaft dynamics.

A-Throttle body:
The mass flow of air in cylinder, and thus power of output engine is controlled by the throttle valve. It is opened depending on the position of pedal. The air mass flow through the throttle valve can be modeled as a gas flow through an orifice. This is calculated as a function of two variables: the area available for the flow (A(t)) and the pressure ratio across the throttle section [12]: .

B-Intake manifold dynamics:
It can be represented by a first order differential equation, the changing rate of manifold pressure is proportionate to the difference between mass of air flow into the manifold and the pumped mass of air into intake port as given below [13]:

C-Air induced in cylinders:
The mass flow rate of the mixtures of exhaust gases and air is calculated using this concept where its mathematical expression is as follow [13]: (3)

2-Fuel Path Dynamics
Fuel dynamic is important for the in cylinders AFR calculation. In general, it is difficult to accurate the fuel dynamics model, because the model parameters depend on the characteristics of fuel and engine temperature during its operation [15]. The injector of fuel is injected fuel as pulses when the valve of intake is close [1]. Part of the injected fuel hits the wall of manifold and forms thin film on it. This fuel film on the intake port evaporates constantly, therefore, the net fuel flow rate entering the cylinders consists of no impinging part of the fuel injection and the fuel evaporated from the intake port walls, Dynamics of fuel may be represented by the equations [15]: The AFR is to remain at (14.673) [7]. The injections of fuel . mfi are adjusted for progress of the charge air. The charged of air to the cylinders is divided by AFR to supply the feed-forward command of fuel flow.

3-Crankshaft Dynamics
The variable crankshaft of important is the speed of revolution express in rpm or rad per second (rad/sec) that depended on the production torque by cylinders through stroke expansion. Three models should dissect distinctly in the dynamic model of crankshaft. These are: torque production, delays of process and dynamics rotation.al of the engine.

A-Torque Production Model
It is depended in a non-linear type on the air mass loaded to the cylinders; AFR is taken during the timing of spark, earlier intake stroke and mass of remaining gases [9]. The model described here is a mean value model uses the notation of mean effective pressure (mep), since it depended on the same variables that effect the torque of engine, as well as, the torque function is just an expansion of the break mean effective pressure (bmep) function. It's expression as follows [9]: ) (

B-Process Delays Model
It is depending on the speed of engine. To add the discrete behavior of the engine to this model, two delays are included in the model, intake and spark to delay the torque production [14]. By incorporation the delays in equation (14) give:

C-Rotational Dynamics Model
It is acquired by applying second law of Newton for rotational motion: [1] Tnet is calculated from the difference between the production torque by the cylinders and the sum of all the load torques placed on the engine. The load torque (Td) value usually varies around (30N.m) for low and medium range of engine speeds [12].
The fuel consumption (F.C) is the consumed fuel by the engine during the period of operation. In this paper this can be calculated by summing the injected fuel (mfi) at each sample time [4].

Parameters Identification
In this paper, the simulation is done for a Mitsubishi motor of engine model No.4G64 .The 4G64 engine is a single overhead camshaft, 4 cylinders, 4 valves per cylinder gasoline powered, four strokes, PFI and SI engine prototype with idle speed equals to 955 RPM. All the physical parameters used in the model are listed in table (1) . The engine geometry Parameters needed in the model is listed in table (2), the coefficients of the curve fitting equations used in the model are listed in table (3).

Simulation Results
The open loop dynamics for the nonlinear engine model has been obtained for step change in the throttle angle without and with applying variable value of the Load Torque (Td) as explained below: (14) . b) Applied about Load Torque: The load of engine during idling is of variable nature and this could be the source of sudden rise or drop in speed of engine [1]. The nonlinear model is loaded with variable values of load torque. The load torque is applied first as a step change form to represent the loads that affect suddenly. Then a trapezoidal signal used to represent the loads is increased gradually [16]. Finally a sine wave signal is also used to represent the load torque .The loads were applied with the same step change in the throttle angle that was used

IDLE SPEED CONTROLLER DESIGN
The design of intelligent controller for automotive engine is considered. The ISC is formalized as a control problem, where the stalling of engine must be prevented despite of load varying and acting. So, the model of engine with the controller designed had to obtain the idle rotational speed with minimum steady state error, minimum undershoot, minimum overshoot and reach as fast as possible to the target rotational speed.
One successful control technique is fuzzy control which originates from the human experiences. The objective of the Fuzzy Logic Control (FLC) systems is to control complex process by experience of human being." The idle speed controller designed in paper is of PID-like FLC to recompense for the descend in the engine rotation speed, it uses the throttle angle only.

Fuzzy Logic Control (FLC) Design
It is a PID like Fuzzy Controller PIDFC is developed. This controller uses the discrete from with minimum structure form of the conventional PID controller equation as follows: where e(k) is the error signal and the index (k) represents the present sampling instant and assumed that the sampling time equals to 1 sec. "It is clear from the equation that the controller has three inputs. If seven fuzzy sets are used for each input, then a (7*7*7=343) rules will be needed for the controller. Also, each rule will have three conditions in its antecedent part, which is very difficult to design such controller and needs too much work [17]. To avoid such problems, the PIDFC is constructed as a parallel structure of PD like Fuzzy Controller PDFC and PI like Fuzzy Controller PIFC. As a result, the equation of the PIDFC will be:

PIDFC=( PDFC+PIFC )Ko
Moreover, all the membership functions of the FLC inputs and output are defined on the common normalized domain [-1, 1],and the triangular and trapezoidal membership are used.
The rule base for computing the output (u(k) (Δu(k)) )is listed in Table (4) . The selection of rules shown is based on the knowledge of the behavior of the error equation. The scaling factors of FLC are tuned manually. The error allowed using this scaling factors, a set of PIDFC gains are (Kp=0.018, Ko=0.15 and Kd=0.008).

PIDFC Simulation Results…………………………………………………………
The closed loop system with PIDFC controller is simulated by applying variable values of the load torque and disturbance discussed below: a) Applying the Load Torque: A variable value of a load torque is applied to the closed loop system in order to check the ability of controller to the reference tracking of idle speed (equals to 955 rpm) in the presence of load torque. The constant load torque of (30 N.m) is applied after 15 seconds to ensure enough time to examine the speed response and it is removed in the 25 th second. Figure (3) shows the engine speed response obtained using PIDFC with applying constant load torque and without disturbance. The overshoot equals to 290 rpm, undershoot equals to 158 rpm, settling time equals to 1.5 sec and fuel consumption equals to 0.0017 kg.

b) Applying Load Torque with Disturbance:
Controller robustness should be achieved with respect to parameter uncertainties and unmolded dynamics, represented by engine load torque and disturbance [4]. So, a random value of disturbance ranging between ±10% of the load torque was applied to test the controller ability to overcome noisy disturbance. Figure (4) shows the engine speed response obtained using PIDFC with applying constant load torque and with disturbance. The overshoot equals to 294 rpm,

SPIKING NEURAL NETWORK (SNN)
In this work, a SNN is used to on-line adapt the inputs and output gains (scaling factors) of the FLC. The SNN weights are trained using PSO algorithm to reach the desired idle speed of the engine with better performances. As a result, fuel emissions are reduced and fuel economy is obtained. Page 639 Copyright  2017 Al-Qadisiyah Journal For Engineering Sciences. All rights reserved.
The structure of the proposed SNN is shown in Figure (5) . As can be seen from this figure, the SNN consists of one node in the input layer which receives the error in engine speed In the output layer of SNN, three nodes are used to represent the gains of the controller (Kp , Kd and Ko).
The simulation of closed loop is shown in Figure (6) .

SNN training using PSO Algorithm
The particle swarm is used as an optimization algorithm to find the best weights of SNNs to obtain accurate speed engine response with minimum undershoot, minimum overshoot and minimum settling time. This minimization gives closer matching between the desired and the actual idle speed. The PSO is initialized randomly. However, the convergence speed is sensitivity to the initialization. The design of control is used the optimal solution supplied by the SNNs based PSO. Page 640 Copyright  2017 Al-Qadisiyah Journal For Engineering Sciences. All rights reserved.
As the fitness function which uses to evaluate the fitness of each particle during tuning process with PSO, the Root Mean Squared Error (RMSE) and the overshoot in speed response are included in the fitness function to reach the required speed specifications. The fitness function is selected as: and M : is the number of samples The general specifications of SNN are presented in the Table (5) . The number of units in Input /Output are 1and 3, respectively. The other specifications of the PSO are the number of birds is 50, the steps of birds is 30, the learning factors (C1,C2) are both equals to 4 and the number of weights to SNN equals to 60. By training the SNN using idle speed response without and with varying load torque, disturbance and changing the ambient temperature to reach the minimum RMSE, it is found that the best number of hidden nodes equals to (5) and the best weights for hidden and output layer equals to 60 weights as listed in Appendix A.

Simulation Results of SNN based PIDFC (SNN-PIDFC)
A SNN-PIDFC has the ability to deal with this nonlinearity and to achieve speed tracking performance with minimum speed error. The input of the spiking is the error which is converted to times of spike. The output signals of SNN are also spike characterized with time of spike. This time of spike is converted to real numbers that enter to the model input as scaling factors of the Fuzzy Controller. In order to test the behavior of the proposed controller, the training algorithms give weights that are used in this SNN as a feed-forward network to generate the required gains during the synthesis of the input signals of the SNN control system. The closed loop system with SNN-PIDFC controller is simulated with applying variable values of the load torque without and with disturbance as discussed below: a) Applying the Load Torque: Figure (7) shows the engine speed response obtained using fuzzy controller by applying constant load torque and without disturbance. It can be show from the results that the overshoot equals to 87 RPM, undershoot equals to 7 RPM, settling time equals to 0.245 sec and fuel consumption equals to 0.000785 Kg. b) Applying Load Torque with Disturbance: Figure (8) shows the engine speed response obtained using the controller with applying constant load torque and with disturbance. It can be show from the results that the overshoot equals to 87 rpm, undershoot equals to 83 rpm, settling time equals to 0.245 sec and fuel consumption equals to 0.000809 Kg.

CONCLUSIONS
To achieve an improvement on the speed response, a SNN based PIDFC (SNN-PIDFC) was designed and good improvement has been obtained. The SNN was used to adapt the inputs and output gains of PIDFC. Simulation results with using SNN-PIDFC showed that the peak overshoot is reduced to about (70%) as compared with using PIDFC only for the same value of the load torque, the undershoot is reduced to about (50%) as compared with using PIDFC. The settling time is