MODELING AND CONTROL OF AN ENGINE FUEL INJECTION SYSTEM TAN CHEE WEI A project report submitted in partial fulfilment of the requirements for the award of the degree of Master of Engineering (Electrical – Mechatronic and Automatic Control) Faculty of Electrical Engineering University Teknologi Malaysia NOVEMBER 2009 iii To my beloved father, mother and brothers. iv ACKNOWLEDGEMENT I would like to express my sincere appreciation and thankfulness to my final year project supervisor, Dr. Hazlina Binti Selamat, regarding his guidance, support and willingness to help throughout my final year project progress. She has provided me with her valuable advice and suggestion so that I can follow the right track in performing all necessary tasks and complete the project as well. Besides, she also acts as language supervisor to check on my documentation. I believe that without her assistance, my project will not be able to operate smoothly and complete on time. I am also indebted to librarians for their assistance in supplying the relevant literatures. My sincere appreciation also extends to my friends who have provided assistance at various occasions. Their views and tips are useful indeed. Finally, I would like to thank my parents and brothers for their encouragement and support who had helped me go through all the difficulties that I faced throughout my project. v ABSTRACT Control of automotive exhaust emission has become an important research area to meet the more stringent automotive emission regulations. Beside the modification on internal combustion engine, control engineering is seen as another approach to improve and meet these requirements. This project focuses on the design and development of a control system to reduce the harmful waste of automotive exhaust emission. The control system aims to regulate the amount of fuel injected into the combustion chamber such that the air to fuel ratio (AFR) is maintained within the allowable range. The control process in this project is demonstrated based on an analytical engine model that clearly describe engine’s air and fuel dynamic with no loss of engine system performance. Since the dynamics of the internal combustion engine and fuel injection systems are highly nonlinear, a linear model is obtained in this project, based on a system identification approach to allow methodical application of linear control theories. Two types of control strategy are employed – the linear quadratic Gaussian (LQG) controller and the fuzzy logic controller (FLC). The LQG controller, designed based on the linear model of the engine system, results in good controlled output response but with large controller signal variation. The FLC, however, provides better controlled output response by reducing overshoot gain and transient effect occurred in LQG controller design. vi ABSTRAK Kajian dalam mengurangkan lepasan toksik dari ekzos semakin penting pada masa kini demi memenuhi peraturan yang semakin ketat. Pada hari ini, melibatkan sistem kawalan dalam enjin telah menjadi salah satu jalan penting dalam mengurangkan lepasan toksik selain menjalankan modifikasi pada enjin. Projek ini akan fokus pada penghasilan dan penciptaan system kawalan yang mampu mengurangkan pelepasan gas toksik dari enjin ekzos ke udara. Sistem kawalan yang dicipta bertujuan untuk mengawal jumlah kuantiti petrol yang dibenarkan untuk menyembuh ke dalam chamber enjin dan menetapkan AFR pada jumlah yang dibenarkan. Dalam projek ini, penghasilan sistem kawalan akan bergantung pada simulasi enjin model. Projek ini telah memilih enjin model berasaskan cara analisasi yang mampu menterjemaahkan petrol dan udara proses dalam enjin dengan kejituan yang tinggi. Akan tetapi, ciptatan sistem kawalan dalam simulasi gagal diterima disebabkan oleh enjin proses yang tidak linear. Oleh itu, teknik berasaskan sistem identification dipakai demi menghasilkan enjin model yang linear. Dua jenis sistem kawalan akan dibincang dalam projek ini iaitu Linear Quadratic Gaussian (LQG) dan Fuzzy Logic Controller (FLC). Sistem kawalan LQG dihasil berasaskan enjin model yang linear manakala FLC dihasil berasaskan model enjin yang tidak linear. Keseluruhnya, LQG mampu memberi bacaan AFR yang bagus. Akan tetapi, ia menyebabkan signal kawalan yang berulang alik. Sistem kawalan FLC pula, mampu member bacaan AFR yang lebih bagus daripada LQG. Kelemahan sistem kawalan LQG telah dibaiki sepenuhnya dalam implikasi sistem kawalan FLC. vii TABLE OF CONTENTS CHAPTER 1 2 TITLE PAGE DECLARATION ii DEDICATION iii ACKNOWLEDGEMENTS iv ABSTRACT v ABSTRAK vi TABLE OF CONTENTS vii LIST OF TABLES x LIST OF FIGURES xi LIST OF ABBREVIATIONS xiv LIST OF SYMBOLS xvi LIST OF APPENDICES xviii INTRODUCTION 1 1.1 1.2 1.3 1.4 1 2 6 7 Control System Overview Background of the Study Objectives of the Research Organization of the Report LITERATURE REVIEW 9 2.1 Introduction 9 2.2 Engine Model 10 viii 2.2.1 Engine Parts Description 2.2.1.1 Inlet Manifold 11 2.2.1.2 Exhaust Manifold 12 2.2.1.3 The Intercooler, Compressor and Turbine 12 2.2.1.4 The Turbocharger 13 2.2.1.5 The Exhaust Gas Recirculation (EGR) 13 2.2.2 Review of Engine Modeling Method 13 2.2.3 Analytical Models 15 2.2.3.1 Filling and Emptying Model 15 2.2.3.2 CFD Approach 16 2.2.3.3 Mean Value Model 17 Empirical Models 17 2.2.4.1 Neural Network 18 2.2.4.2 Polynomial Method 20 2.2.4.3 Interpolation from Steady State Maps 21 2.3 Review of Control System Applied to Engine Model 21 2.4 Conclusion 24 2.2.4 3 11 METHODOLOGY 26 3.1 Introduction 26 3.2 Engine Mathematic Model 27 3.2.1 The Air Dynamic 28 3.2.2 The Fuel Dynamic 32 3.2.3 The Rotation Torque Dynamic 35 3.3 Engine System Identification Theory 38 3.3.1 Experiment Design 40 3.3.2 Data Preprocessing 40 3.3.3 Model Estimation 41 3.3.3.1 State Space Model Using a Subspace 3.3.4 Method 42 Model Validation 45 ix 3.4 Linear Quadratic Gaussian (LQG) Controller 45 3.5 Fuzzy Logic Controller (FLC) 49 3.5.1 Fuzzification 50 3.5.2 Rule Base 52 3.5.3 Defuzzification 54 Conclusion 57 3.6 4 5 RESULT AND DISCUSSION 58 4.1 Introduction 58 4.2 Engine Model Using System Identification Technique 62 4.2.1 Import Data, Select Range and Data Preprocessing 63 4.2.2 Estimat Model Structure 67 4.2.3 Validation Estimated Model Performance 68 4.3 Linear Quadratic Gaussian (LQG) Controller 69 4.4 Fuzzy Logic Controller (FLC) 78 CONCLUSION AND FUTUREWORK 85 5.1 Conclusion 85 5.2 Futurework 86 REFERENCES 87 Appendices A-D 92-97 x LIST OF TABLES TABLE NO. 1.1 TITLE Fuzzy Rules PAGE 53 xi LIST OF FIGURES FIGURE NO. TITLE 1.1 Historical view of emission legislation for vehicle 1.2 Percentage of pollutant conversion due to engine PAGE 4 air fuel ratio 6 2.1 Conventional engine model types 10 2.2 Schematic representation of the diesel engine 11 2.3(a) Analytical engine model types 14 2.3(b) Empirical engine model types 14 2.4 Typical multi layer perception neural network structure 18 3.1 Diesel engine model implement in MATLAB-SIMULINK 28 3.2 Schematic of the air system 29 3.3 Schematic of fuel injection system 32 3.4 Piston engine model 35 3.5 Cycle of system identification function 39 3.6 State space structure model 42 3.7 LQG controller structure model 46 3.8 Fuzzy logic controller block diagram 49 3.9 Inputs membership function of error (a) and change in error(b) contain in fuzzification process 3.10 51 Fuzzy output membership function with participation of 5 fuzzy set ZO, ML, MM, MH. 54 xii 3.11 Graphical construction of the control system in a fuzzy controller 55 3.12 defuzzification process 56 3.13 Fuzzy logic controller structure model 57 4.1 Variation of engine air throttle 59 4.2 Engine’s Air fuel ratio 59 4.3 Effect of air-fuel ratio on power, fuel consumption, and emission 4.4 Engine output torque due to variation of input air throttle angle value. 4.5 60 61 Engine’s acceleration reading due to variation of input air throttle angle value. 61 4.6 System identification toolbox in MATLAB software 62 4.7 Engine model with assigned random signal into engine’s input signals of beta and Alfa. 4.8 63 (a) and (b) shows output and input response from engine model due to assigning of random signal as model input and work for system identification purpose. 64 4.9 Estimate and validate data for randomness input Beta, u1, Alfa, u2 and output AFR, y1. 4.10 66 System identification toolbox with linear parametric model window 66 4.11 Actual and estimated plant output response 69 4.12 Output response and controller gain performance under large and small weighting gain 4.13 Air fuel ratio response with LQG compensator (blue) and without LQG compensator (green) 4.14 73 75 Air fuel ratio response with modified LQG compensator (blue)and without LQG compensator (green) 76 xiii 4.15 Air fuel ratio response with modified LQG compensator (blue)and without LQG compensator (green) at time 350s to 550s 76 4.16 LQG controller output response 77 4.17 LQG controller output response display at time 350 s to 550s 4.18 77 AFR response from engine model with fuzzy logic controller (green) and without fuzzy logic controller (blue) 78 4.19 AFR response from engine model with fuzzy logic controller (green) and without fuzzy logic controller (blue) crop from time in between 350s to 550s 4.20 Square error value from engine AFR without fuzzy logic controller (blue) and with fuzzy logic controller (green) 4.21 80 Square error value from engine AFR without LQG controller (blue) and with LQG controller (green) 4.22 79 80 Close view of Square error response from engine AFR without controller and with controller of (a)LQG and (b) FLC 81 4.23 FLC controller output response 82 4.24 FLC controller output response display at time 350 s to 550s 82 4.25 Effective fueling time constant 84 4.26 Engine rotational torque 84 xiv LIST OF ABBREVIATIONS AFR - Air Fuel Ratio FLC - Fuzzy Logic Control CO - carbon monoxide HC - Hydrocarbons NOx - Nitrogen Oxides CFD - Computational Fluid Dynamic PI - Proportional Integral LQG - Linear Quadratic Gaussian LQR - Linear Quadratic Regulator ze - estimated model zv - validated model A - an n-by-n system matrix B - an n-by-m input matrix C - an r-by-n output matrix D - an r-by-m transmission matrix Co - controllability Ob - observability H,Q, R - weighting matrix Rk,Qk - noise covariance data v - measurement noise w - process noise e - system error xv ECU - Electronic control units K - LQG controller gain xvi LIST OF SYMBOLS - mass rate of air in the intake manifold - mass of air in the intake manifold - mass rate air entering the intake manifold - mass rate of air leaving the intake manifold and entering the combustion MAX - the maximum flow rate corresponding to full open throttle TC - Normalized throttle characteristic PRI - Normalized pressure influence function α - the throttle angle - intake manifold pressure - atmosphere pressure - constant value - gas constant - gas temperature - intake manifold volume - engine angular velocity - volumetric efficiency - fuel rate entering the combustion chamber - command fuel rate - effective fueling time constant - desired air fuel ratio ∆ - intake to torque production delay ∆ - compression to torque production delay xvii AFI - normalized air fuel ratio influence function CI - normalized compression influence function - the maximum torque production capacity of an engine given that AFI=CI=1 A/F - actual air fuel ratio of the mixture in the combustion chamber CA - tuning parameter of cylinder advance at the Top Dead Center MTB - minimum tuning such that best torque acquire - effective inertia of the engine - engine indicated torque - engine friction torque - accessories torque - Cost funtion - Ricatti gain - expected states xviii LIST OF APPENDICES APPENDIX A1 TITLE Engine’s air flow dynamic represent in MATLAB-SIMULINK A2 95 LQG compensator with engine model in MATLAB-SIMULINK D 94 The Fuzzy Logic controller and engine model in MATLAB-SIMULINK. C 93 Engine’s rotational torque dynamic represent in MATLAB SIMULINK. B 92 Engine’s fuel injection dynamic represent in MATLAB-SIMULINK A3 PAGE 96 Performance enhancement to LQG compensator with extra derivative block 97 CHAPTER 1 INTRODUCTION 1.1 Control System Overview Control is defined as maintaining desired conditions in a physical system by adjusting selected variable in the system (Stewart, 1995). There exist several reasons why control system is necessary to implement in human life. The major reason of control system application is to maintain desired output even when external disturbance is occurred. For example control of temperature in a room, water level in a tank, power supply of control room and etc while the second reason for control is to respond to change in the desired value. For example, if the fluid level in a tank is increased, percentage opening of control valve will be decreased in order to maintain desired value of fluid level (Stewart, 1995). In general, there are two types of control system structure- open loop control and close loop control. For systems in which the output has no effect on the control action they are called open loop control systems. In this case, output of open loop control system is neither measured nor fedback for comparison with the input. On the other hand, a closed loop control system or commonly called feedback control is capable in 2 feeding in an actuating error signal, which is the difference between the input signal and the feedback signal( from output) to a controller so as to reduce the error and bring output of the system to desired value (Lukáš, 2008). As a result, the controller design become an important part yet critical in control system since it determines whether performance of a system is good or poor. 1.2 Background of the Study In the past decades, development of earth moving vehicle’s engine was mainly focused on fuel efficiency and performance increment such as torque, horse power and revolution of vehicle without worry on emission legislation. However in today situation, emission legislation is no longer an easy challenge for vehicle manufacturer to pass through when the numbers of vehicle all around the world has reached 50 millions in 2007 and expected to increase by 5% every year and reach approximate 60 million at year 2010(Chang, 2007). The development of automotive market would bring many negative effects that require serious consideration by automotive industrial. For example, today, large quantity of earth moving vehicles has turned internal combustion engine exhaust emission one of the main contributors to environment pollution with harmful gases such as • carbon monoxide(CO) • Hydrocarbons(HC) • Nitrogen Oxides(NOx) • Particulate emission. Carbon monoxide is a very toxic, colorless and odorless gas, which is generated in the exhaust gas, as the result of incomplete combustion of fuel. As engines operate at enclose spaces such as car park or tunnel, it can accumulate very quickly and reach 3 concentration which could harm humans health by causing headaches, lethargy or dizziness. As well as carbon monoxide, hydrocarbons are also produced due to the incomplete combustion of fuel. Generally, it causes bad impact to environment by influencing earth ozone reactivity with contribution of smoke and has characteristic of nuisance smell. Nitrogen oxides on the other hand are generated from nitrogen and oxygen from air intake manifold of engine when air flow through the engine cylinder under high pressure and temperature. Nitrogen oxides is a reactive gas and very toxic to human. Emission of nitrogen oxides will also deteriorate ozone reactivity and cause smog formation, which is a serious environment concern in today situation. Therefore, due to global warming effect and environment protection, a lot of attention has been focused on automotive industry and it started to become a hot topic in climate discussion. These has force cars manufacturer and their supplier to develop new engine control strategies within short time period instead of using traditional technology to meet strict and stricter emission legislation from government(Ericson, 2007). There are different control methods available for reducing pollutant components, such as control of engine speed, engine torque, fuel injection timing, AFR and so on. Among all, control of AFR is related to fuel efficiency, emission reduction and drivability improvement, furthermore maintaining AFR at stoichiometric level can obtain best balance between power output and fuel consumption (Muske, 2008). Control of AFR also guarantee reduction of pollutant emission to atmosphere since variation of AFR greater than 1% below 14.7 can result in significant increase of CO and HC emission. An increase of more than 1% will produce more NOx up to 50% (Kenneth, 2006). Figure 1.1 shows historical view of worldwide emission legislation. It shows that the allowable nitrogen oxide emission was reduce from 7 g/kWh in the year 1996 to less than 1 g/kWh in the year 2010. Emission legislation Euro III at year 2000 shows limits on allowable vehicle NOx emission, which reduce to less than 5 g /kWh, and this, has been achieved through application of higher injection pressure to result in low 4 particulate emission and retarded injection. However, emission legislation Euro IV and Euro V are no longer achievable by using the technology applied in Euro III. Therefore, car manufacturers have introduced new technologies such as cooled Emission Gas Recirculation (EGR) and Selective Catalytic Reduction to reduce NOx emission in order to meet legislation requirement. Today, the technology of Selective Catalytic Reduction is still applied in most vehicles due to its simple, practical and cost effective benefits. Figure 1.1: Historical view of emission legislation for vehicle (Ericson, 2007) In general, Selective Catalytic Reduction can be divided into two types-: Oxidation catalyst system and 3-way catalyst system. In this case, oxidation catalyst system is effective in reducing two major exhaust pollutants of carbon monoxide and hydrocarbons, through oxidation to carbon dioxide and water vapor (Tetsuji, 2004) as shown in Equation (1) and Equation (2). 1 2 (1) (2) 5 However, this method is not longer used for emission control due to its low performance on reducing NOx components and meet stricter emission registration. Therefore, a newer catalyst technology, which is known as 3-way catalyst, was introduced (Tetsuji, 2004). In 3-way catalyst, three major pollutants, carbon monoxides, hydrocarbons and nitrogen oxides are simultaneously convert to carbon dioxide, oxygen and nitrogen. Equation 3 shows chemical conversion of pollutant within 3-way catalyst into environment friendly components. (3) The fundamental reaction in 3-way catalyst is between CO, HC and NOx. Therefore in order to achieve high percentage of conversions from all three environment pollutants- HC, CO and NOx into environmental friendly components, their concentration must be in stoischiometric ratio (Ali, 2008). This means that total amount of HC and CO should match the amount of NOx present in the system, in such a way exact equations of chemical reaction can be occurred in catalyst. However, there is no way both of the components can meet stoichiometric ratio all the time, since concentrations of pollutants in the exhaust gas are highly depend on the fuel mixture composition. For example, at lean fuel mixtures the exhaust gases contain little carbon monoxide and hydrocarbons but high concentrations of NOx. On the other hand, at rich fuel mixtures the exhaust gas contains high concentrations of carbon monoxide and hydrocarbons but low concentration of NOx. Therefore, amount of engine’s fuel injection should be controlled in such a way so that engine’s air fuel ratio (AFR) is at the stoischiometric value of 14.7 and achieve full conversion of pollutant components as shown in Figure 1.2. 6 lean rich Figure 1.2 Percentage of pollutant conversion due to engine air fuel ratio (Ali Ghaffari, 2008) As a result, a compatible and suitable controller is required to be applied into engine’s system such that engine’s AFR can be maintained at stoischiometric range, thus resulting in high conversion efficiency of pollutant components. 1.3 Objectives of the Research Based on the issue that variation of AFR deviating away from stoichimetric ratio can result in high concentration of pollutant from exhaust emission as discussed in the previous section (section 1.2), the project objective is therefore to maintain the engine’s Air Fuel Ratio at stoischiometric level. This objective can be achieved through the following efforts: 7 i) To identified suitable mathematical engine model for AFR controller design purpose. ii) To design and develop FLC and LQG control system for AFR control purpose in MATLAB-SIMULINK iii) 1.4 To ascertain the performance of the developed control system Organization of the Report The scope of work in this project concentrates on the engine and control system modeling follows by ascertain of control system performance using MATLABSIMULINK. This report will be build up by five chapters, which are introduction in chapter one, methodology in chapter two, literature review in chapter three, result and discussion in chapter four, last but not least conclusion and future work in chapter five. Following are important content and description of each chapter. Chapter two will concentrate on literature review of engine and controller modeling method. In this project, mean value method been applied for engine modeling. Besides that, there are several available engine modeling method existed. For example, CFD method, Filling and Emptying method, Polynomial method and so on. Advantages and disadvantages of each method also application method of each method will be explained in this chapter. For controller modeling, several types of controller shall be reviewed. Performance and advantages of each controller will be discussed for decide and decision making purpose on suitable controller. Chapter three is descript the methodology of engine plant and control system modeling. The simulated engine model is modeled by three blocks: Fuel dynamic, Air dynamic and rotation torque dynamic. Each block is correlating between each other. 8 Sets of model equation and formula which contribute to each block will be explain and descript in this chapter. Two types of controller will be discussed in this report:-fuzzy logic controller (FLC) and linear quadratic Gaussian (LQG) controller. In chapter three, the control algorithm and theory from each controller will be explained. Chapter four will discuss FLC and LQG controller performance in controlling engine model’s AFR. Simulation result from FLC and LQG controller will be compared and investigated to determine suitable controller, which work well with engine plant. Last but not least, chapter five is the project conclusion and future work description. 9 CHAPTER 2 LITERATURE REVIEW 2.1 Introduction Design and modeling of engine and controller structure, which use for simulation purpose been popular since past decade. In this case, modeling of engine model is important for research and development purpose, such as development in design of engine control system, without damaging real engine during test bed. Over the past decade, a vast number of engine and controller models have been developed by researchers in many fields. The developed engine and its control system model are employing diverse technique between each other depend on the application requirement. Therefore, design of any engine model needs to be done carefully and validated in order to suit the particular characteristics of the engine for intended control application. 10 2.2 Engine Model During modeling of engine parts, it is generally not possible to use another research’s work verbatim, as the context will be different depend on someone’s work objective. As such perhaps the most useful aspect is to review of previous work then identify and evaluate most suitable structure of the models to be considered (ANDERSSON, 2008). In most of the developed engine models, they are tends to use a combination of analytical and empirical methods to represent the engine components, but it may be classified according to their majority content. ENGINE MODEL ANALYTICAL EMPIRICAL METHOD METHOD Figure 2.1: Conventional engine model types According to Figure 2.1, show two of the most popular engine modeling method of empirical and analytical method. In this case, analytically based models tend to focus on degree by degree detail variation of engine variables in some considerable detail and are hence generally has slow running speed during simulation. On the other hand, empirically based models tend to take a wider view on engine components and predicting the mean values or trends of the major engine variables with a subsequent loss of resolution in the limit compare to analytically based method (.Lukáš ,2008). However, empirically based model usually allows much shorter simulation run times due to ignore of particular engine variable. 11 2.2.1 Engine Parts Description An engine model is developed and make up by numbers of components such as inlet and exhaust manifolds, the pumping action in engine, the turbocharger, intercooler and EGR circuit. Figure 2.2: Schematic representation of the diesel engine (Stefanopoulou, 1999) 2.2.1.1 Inlet Manifold Inlet manifold is the most important part of engine model. In this case, the manifold is filled with air from the intercooler. And yet the gas flow out of the manifold 12 is dependent on the pumping action of the engine which in turn is affected by the volumetric efficiency. 2.2.1.2 Exhaust Manifold The exhaust manifold is function to transporting the incoming exhaust mass flow come from engine cylinder. In this case, the outgoing mass flow rate from exhaust manifold is coupled to the action of the exhaust turbine. The mass of gas in the exhaust manifold gives the manifold gas pressure which then act on the turbine. Therefore, the pressure and mass flow gives the operating point of the turbine (Stewart, 1995). However, some developed engine models are neglecting the exhaust manifold modeling since its time constant is so small that does not affect the accuracy of the simulation. This is so because of the high exhaust temperature which causes the volume flow to be high and directly reduce value of time constant yet exhaust manifold is still useful to improve turbine model stability (Stewart, 1995) 2.2.1.3 The Intercooler, Compressor and Turbine Intercooler is function to cool the compressed hot gas from the compressor. The lower the inlet temperatures of the air entering the engine, the higher the density, which mean more air mass will enter the engine. This has directly reduced the NOx emission due to low temperature in engine cylinder. The model of intercooler is implementing between the compressor and the inlet manifold within engine model. Therefore, the intercooler is assumed to lower the temperature to a constant level without heat transfer calculations on it. On the other hand, the influence of the turbine shaft speed on the mass flow rate and pressure ratio is very small. Hence it is excluded from the engine modeling, where the only pressure ratio is used to give the mass flow and efficiency. 13 2.2.1.4 The Turbocharger Turbocharger is another important component of diesel engine. It is function to increases the output power by allowing more fuel to be injected in to engine cylinder through use of exhaust energy that supercharge the engine. In this case, the transient responsiveness of the diesel engine can reach to a great extent due to ability of the turbocharger to deliver sufficient air so that the air fuel ratio isn’t too low(RACHID, 1994). 2.2.1.5 The Exhaust Gas Recirculation (EGR) EGR is function to lower NOx emissions by diluting the inlet air with inert gas which lowers the combustion temperature. In this case, the EGR flow which replacing part of the air that goes into the engine cylinder is driven by the pressure different between the inlet and exhaust manifolds. Therefore, the EGR rate can be control through the valve placing between inlet and exhaust manifolds (RACHID, 1994). However, the EGR will reduce the air mixture into cylinder that can cause power reduction to engine. So, the EGR flow is shut off to allow a faster response of the turbocharger during transients process occurred. 2.2.2 Review of Engine Modeling Method Mathematical model of each engine component as discussed in previous sub chapter (2.2.1.1-2.2.1.5) will be combined to result a complete engine model with 14 reliable performance as well as real engine. However, there are different types of engine models available that applying different mathematical function based on design needs and requirement. Figure 2.3(a) and Figure 2.3(b) shows six popular engine models applied in development and research work. ANALYTICAL MODELS Mean value models CFD approach Filling and emptying model Figure 2.3(a): Analytical engine model types EMPIRICAL MODELS Interpolation from steady state maps Neural network Polynomial methods Figure 2.3(b): Empirical engine model types 15 2.2.3 Analytical Models The analytical models is describing engine model through detail mathematical model and function with inclusion of physic laws. In this chapter, three most popular analytical models of filling and emptying model, CFD approach and mean value model will be reviewed. 2.2.3.1 Filling and Emptying Model Filling and emptying engine modeling method is represented as a series of control volumes linked by nodes or valves. In this case, it is applying the principles of mass and energy conservation to predict engine’s performance. For example, the turbocharger performance is predicted by an empirical sub model, and engine’s emission is predicted through complementary multi zone models that run alongside of single zone model with inclusion of some input from the single zone model. On the other hand, this model is also considered on engine’s rate of heat transfer. In this case, the rate of heat release is determine through experimental data or simulated using a homogeneous heat release function based on fuel burning rate. Therefore, this treatment achieves faster simulation running time compare to those detailed simulations whilst retaining sufficient complexity to make accurate predictions. The filling and emptying model is useful as engine design tool since it predicts the effects of varying engine parameters on the performance. Besides that, a high level of analytical understanding of the engine operation is encapsulated within the code which helps and assists people to appreciate the workings of the system. However, it has a disadvantage of having long simulation time that might too long to be viable for control system design or online predictions. 16 2.2.3.2 CFD Approach The computational fluid dynamic (CFD) engine modeling is providing the most detailed approach among all engines modeling approach. This technique is employed to predict fluid flow properties within the engine. In this case, the engine combustion chamber is split into many discrete volume, typically as 40000 element are used (Ericson, 2007). Differential equations governing the behavior of each element are then solved to acquire desire result. The simulated result may be validated by comparing them to measured results using laser Doppler or hot wire anemometry. CFD approach is requiring extremely large computing overheads. This is directly caused the overall computation technique difficult to handle moreover time consuming. However, the CFD approach provides a great understanding and knowledge of the air flow pattern within the engine. In practical example, Somerville (1993) has used this technique to investigate the air motion in a diesel engine to compare the predicted result with experimental measurement. Besides concentrate on calculating engine air flow process, Payri(1988) has applying the same method to model the complete combustion process which include the evolution of fuel from start of injection until end of combustion. In this case, the fuel is split into many ‘packet’, one release at each degree of crank rotation in such a case to predicting the evolution at each time step. Therefore, the resulted engine model can be used to predict engine performance and emission through further correlations and analytical steps. But, it is unlikely that all CFD based engine structure could make to run at fast simulation time which makes it impractical if many tests are to be simulated. 17 2.2.3.3 Mean Value Model In order to cope with problem of long simulation running time, Hendrick (1990) has developed a new engine model of mean value engine model (Eko, 2001). Engine model with mean value approach is function to speed up a simulation dramatically which useful for test and simulation purpose. In this case, the mean value approach is neglect the cycle variation of engine parameters and to use instead the mean value. Here, the time scale is shorter compare to previous method such that mean value method just adequate to describe accurately the changing mean value of the most rapidly changing engine variable. Hedrick (1990) has work out the mean value engine model with three differential equations and a number of instantaneous expressions to represent the main engine sub models, fuel dynamics, crankshaft dynamic and manifold air flow. On the other hand, the model calibration constants are calculated from experimental data. In order to improve the engine simulation running time, the experimental data is expressed as relatively few constants to allow for quick running whilst retaining considerable complexity and accuracy. Therefore, the improved simulation running time range has make mean value model useful for control system design and possibly for a model based controller. 2.2.4 Empirical Models Empirical models are employing the experimental data for most of the predictive engine process. There are many forms of empirical model available such as neural 18 network; polynomial and interpolation of steady state map depend on desire aims and attributes. 2.2.4.1 Neural network A neural network is useful for constructing nonlinear empirical models. In a neural network, the engine model is constructed by large number of very simple units which combine to represent any given relationship of input and outputs. Engine model can be represented in various forms which typically design in term of multi layer perception (MLP). Figure 2.4 shows the structure of typical network. Figure 2.4: Typical multi layer perception neural network structure A neural network consists of three groups of nodes or neurons: the input layer, one or more hidden layers and an output layer. Each layer is fully interconnected to the next via a series of connections, called synapses. The number of hidden layers and the number of neurons in each is optional. Generally, accuracy will increase with the complexity of the network until an optimum is reached. Thereafter accuracy will reduce. The aim for this is to obtain the required accuracy with the most simple and therefore quickest running network possible. 19 To make a network represent a real engine model, the weights and biases of neural network must optimized by an iterative training process. Here, the training data are presented many times and the network parameters incremented until the output values converge to be the same as the desired output with an acceptably small error. In this case, there are a number of algorithms available to perform the task of minimize system error. The technique most commonly used for modeling applications is called Stochastic Back Propagation. The code generates a rate of change of error and moves across the error surface at a speed proportional to this slope. If the error gradient is steep; large steps are taken. When the surface is flatter; smaller steps are more appropriate. Stochastic back propagation differs in two important respects. The weights are changed after each pattern is presented rather than after each epoch as for standard back propagation. An epoch is the name given to one complete pass through all the training data patterns. The other variation is that the patterns are presented in a random order to prevent cyclic variations in the data affecting the learning process. Both of these changes are designed to cope better with the scattered and noisy data often encountered in modeling applications (Huang, 2006). Once trained, the resulting structure can predict the outcome to scenarios it has not previously encountered. Like any interpolation technique it is more accurate when working within the boundaries of the training data, accuracy is also enhanced by increasing the amount of training data presented. If highly non-linear behavior is being modeled there must be enough data to define the relationship adequately. It is also important that the inputs are sufficient to describe the behavior of the outputs. If this is not the case there will be ambiguity in the data, leading to a failure to converge. Furthermore, Inputs which do not have an influence on the output should be avoided as the network may learn a coincidental relationship between two unrelated variables. Once trained, the network is treated as a black box. Input values are presented and the outputs are collected. A network can represent a huge volume of data in only a few lines of code and runs very quickly once trained (Huang, 2006). For example, O’Reilly (1994) has applied a neural network based air fuel ratio predictor for use in 20 engine control such that network models the complex behavior of the inlet manifold using a time history of previous inputs to predict the future air fuel ratio. Shayler et al (1995) has applied neural networks to the fuel consumption prediction of an engine with varying operating temperatures. 2.2.4.2 Polynomial Method First engine modeling uses of polynomial fit method was done by Stonach (1988). This method is uses to predict engine torque from a turbocharger. In this case, two pair of polynomials are used to predict the ratio of indicated torque to fuel rack position and predict the ratio of net torque to fuel rack position. This model is useful for control system design as it is compact and simulation of experimental data with polynomial coefficient further reduce the simulation running time. The new generation of polynomial engine modeling method is described by Jiang (1992). This is a method combining analytical and empirical methods to model a diesel engine. In this case, models of combustion and the turbocharger assembly are used to predict an instantaneous equivalent ratio and engine speed. Then, the experimental data of equivalent ratio and engine speed is used to predict the engine particle exhaust emission through forth order polynomial curve fit. From the experimental data, different polynomial coefficients are used for each of engine speeds spaced over the operating range. The polynomial method has advantage of result a compact model due to used of polynomial to replace a look up table. However the model is not account for the effects of varying engine temperatures or injection timing since both of these factors will also affect the emission particle production. Therefore, it is not attempt to make an emission prediction. 21 2.2.4.3 Interpolation from Steady State Maps Interpolation from steady state maps is perhaps the simplest approach from empirical engine modeling. In this case, experimental data of exhaust emission level at a series of speeds and loads are captures from an engine running at steady state condition. These data are then interpolated for speed and load to locate the instantaneous operating point of the engine during a transient test. The resulting map has a limitation of not account for transient accuracy. But the emissions of a diesel engine are critically dependent on the turbocharger and intercooler performance during transient and steady state condition. Therefore, extensions of the mapping method are needed to include the effect of transient model. One such engine modeling which included the steady state mapping and transient mapping is developed by Watson (1989). In this case, the conventional engine map of emission with data of torque and speed is extended to include speed and torque derivative axes. Here it is requires the collection of transient data. Therefore, it shows improvement in accuracy over the steady state method when used to predict transient emissions. However, this technique may cause large error due to wide scattering of experimental data points. As a result, a higher density of data would needs to improve the model accuracy. 2.3 Review of Control System Applied to Engine Model Now a day, development of automotive engine has indirectly brings to evolution of control system, which work for control and improve efficiency of exhaust emission. 22 Initially, control effort is mainly concentrating on mechanical modification of engine system. However, it is time consuming and cost large amount of money for investment purpose. This approach is soon replaced by modern control with estimation algorithm as the electronics transitioned to increasingly use in microprocessor in the 90s (Powell, 1998). Over the past, there are numbers of researcher who have simulation or practically implement engine microprocessor control and experimental evaluation for exhaust emission control purpose. A team led by Hendricks, 1990 at the Technical University of Denmark has become pioneer who introduced AFR control based on measurements in the intake manifold. On the other hand, another approach which developed by ETH in Zurich, Stanford University is to base the observer on measurements of oxygen quantity from exhaust through oxygen sensor and on the throttle position. Furthermore, the University of California at Berkeley has addressed the engine exhaust quality which use for control purpose using a nonlinear, sliding mode approach (Powell, 1998). Today, design and research of engine’s emission controllers are mostly aims for AFR control, and exhaust quality control through sliding mode approach or through oxygen sensor observer. For example, Kenneth R. Muske and et al, (2008) from Villanova University has introduced a classical way of PI controller which is developed and applied for air fuel ratio control of engine. Here, an additional adaptive delay compensator is introduced to overcome significant variation in the air fuel ratio dynamic response as a function of engine operating condition. Whenever the engine is operated lean or rich oxygen, PI compensator will result an output and accomplished AFR control through adjusting the mass of fuel injected into the engine. The engine control computer calculates a base fuel rate required to maintain stoischiometric combustion using an estimate of the engine air flow. A multiplicative correction to this base fuel rate, referred to as the base fuel multiplier, is then used as the manipulated variable for air fuel ratio control. The actual air fuel ratio is measured by an exhaust gas oxygen sensor placed in the exhaust pipe upstream of the catalytic 23 converter. However, PI compensator in this case face difficulty in achieving good AFR control with rather long and time varying delay in the AFR output response due to insensitive change in fueling. On the other hand, Yildiz, Y. (2008) has introduced a conventional AFR control system with inclusion of two nested controller:-adaptive controller. An adaptive control system is divided into two loops. The outer loop controller is work to generates a reference AFR for inner loop controller based; for instant, on the deviation of the estimated three way catalyst, stored oxygen state that is only operate effectively when the stored oxygen level was regulated at a range to accommodate further release or storage during transient conditions is available. The inner loop controller is assigned to maintain the AFR upstream of the three way catalyst at reference air fuel ratio, by using the measurements of the feed gas air to fuel ratio with a linear Universal Exhaust Gas Oxygen sensor to appropriate engine fueling rate. The design of the inner loop consists of a feed-forward component which is fast but may not be always accurate and a feedback component that is slower but eliminates steady state error. The feed-forward component consists of estimation of the air and fuel path dynamics combined with appropriate compensations. These air and fuel dynamics correspond, mainly, to the intake manifold lag that affects the air charge, and the wallwetting that determines the amount of fuel inducted into the cylinder for each fuel injection event during transient operation. Previous section shows design of PI controller and adaptive controller, that are simulated based on a linearized engine model. Here, Yao Ju-Bian (2009) and his team from Beijing University of Technology have work on a simulation of AFR control based on neural network that is work well in nonlinear engine plant. In this case, the traditional PI controller is combined with modern artificial intelligent control of neural network. Neural network is performed to estimate the AFR signal without occurrence of transportation delay. This effort in turn enhances performance of classical PI controller through control of the transient air fuel ratio by using the estimated signal from neural 24 network but not maladjustment AFR signal that cause by transportation delay from feedback oxygen sensor. J.K.Pieper (1999) from University of Calgary, Canada has performed a simulation for controlling AFR in nonlinear engine model using sliding model control method. Sliding mode control is a technique to achieve perfect robust performance with magnitude limited uncertainly due to the uncertain and nonlinear natural of the dynamic of engine, which is in the range space of the control derivative of the plant. Control efficiency is achieved by using state feedback and theoretically infinity high gain actuation. Generally, a sliding surface, S is needed to achieve sliding mode control effort. Sliding surface, S is defined as the difference between the actual and the desired AFR: S= , , , , (4) (5) S= For AFR control problem, this surface is used to design the sliding mode and adaptive controller. 2.4 Conclusion Mean value engine modeling method has been chosen to perform in this project due to its capability to present in compact manner and fast running simulation time without lost of actual engine performance. Detail development of engine sub models will be described in chapter 3. On the other hand as mention in section 2.3, several types of controller has been designed for engine exhaust emission control, so to cope with air fuel ratio output 25 response from deviate away from stoischiometric ratio, which is cause by imperfect fuel control during vehicle acceleration and deceleration, thus results in increased of pollutant emissions. In this case, the designed controller may perform well during steady state condition but maintaining AFR during transient condition can become difficult to them. Therefore, two different types of nonlinear controller:-fuzzy logic controller (FLC) and linear quadratic Gaussian (LQG) controller will be designed and their performance in transient conditions is evaluated. 26 CHAPTER 3 METHODOLOGY 3.1 Introduction Since vehicle’s exhaust emission could harm human life by bringing pollution and become the main source supply to global warming in the earth. Therefore, an immediate and hurry step needs to be taken, in order to cope with this problem. In this case, a controller with high effective and high capability thus is needed. The designed controller is playing an important role to observe and interpret the controller input signal, which come from exhaust emission quality, and fire suitable controller output such to reduce harmful components from engine exhaust emission. In this case, simulation models of internal combustion engine and control system are thus needed. But, why simulation is needed? This is the question one always asks oneself before starting of design. Answer: To get a better understanding of how things work and, when dealing with large complex machines such as engine dynamic, it is the only possibility for understanding how their components interact, how to foresee and how a machine is going to react to the desire setpoint when being run in a new way can preferably be obtained with the use of simulation (Chen, 2008). 27 When a model could describe reality plant in a correct manner, it is possible to determine how an actual plant is going to operate in different configurations. Here, model can be used for optimization of the actual plant, where trying all the possible configurations in practice is too expensive and time consuming. Moreover, simulation models is useful for controller training purposes yet enable troubleshooting of control concept in computer instead of using a real engine test bed, so that mistakes can be made without causing damage to hardware. 3.2 Engine Mathematical Model The internal combustion engine model in this project is developed in MATLABSIMULINK software. In this case, engine model is grouped by three sub models corresponding to the intake manifold of air dynamic, fuel injection dynamic and rotation torque dynamic equipped with engine’s crankshaft speed. The simulation engine model is a model based on the generic mean value engine model developed by Hendricks, a well-known and widely used benchmark of engine modeling and control purpose (Eko, 2001). The engine model has an input signal of percentage opening of air throttle valve and an output signal of engine’s air fuel ratio which include with controller signal of total fuel flow rate that results to three engine’s state variables. Figure 3.1 shows the resulted mean value model of diesel engine based on engine model developed by Hendricks. In this case, the engine model is form by three important sub models that functioned to generate engine air fuel ratio at the engine’s output. 28 Figure 3.1: Diesel engine model implement in MATLAB-SIMULINK According to Figure 3.1, engine’s air fuel ratio will become the system controlled variable while input air throttle valve opening is the system disturbance that tend to disturbing engine’s AFR by causing AFR signal deviate away from setpoint value of 14.7. The basis for this model is data collected during stationary measurement and particular implementation of physic law. Therefore, certain required data such as torque, air flow, fuel flow and emissions is needed to compiling the engine model with equation which able to react in similar manner as well as actual plant. 3.2.1 The Air Dynamic The air flow dynamic in engine’s inlet manifold is the main part of mean value engine modeling. In an internal combustion engine, air is induced into the cylinders. The airflow is first passes through an air filter to get the qualified fresh air. Then it 29 flows into the compressor, during which the air pressure is increased to be higher than the atmospheric pressure. The charge air then flow through an intercooler to decrease the intake air temperature. Hence the air density is increased again prior to the cylinder. Finally, the manifold is filled with air from the intercooler. The gas flow out of the manifold into the cylinder through inlet valve is depending on the pumping action of the engine which in turn is affected by the volumetric efficiency, . FRESH AIR Figure 3.2: Schematic of the air system Air mass balance in the inlet manifold is described by Equation (6): (6) Where = mass rate of air in the intake manifold = mass of air in the intake manifold = mass rate air entering the intake manifold = mass rate of air leaving the intake manifold and entering the combustion 30 In this case, the mass flow rate of air entering the intake manifold will be described by Equation (7), which is close related to the engine’s throttle body that describing energy transformation process from throttle angle inputs to mass rates of air entering the intake manifold, · . · (7) Where MAX= the maximum flow rate corresponding to full open throttle TC= Normalized throttle characteristic PRI= Normalized pressure influence function From the normalized throttle characteristic, it is represented by a function of throttle angle α as shown in Equation (8) that determined by an experiment with a data table for simulation purpose. 1 1 cos 1.14459 · 1.06 79.46 79.46 (8) Where α = the throttle angle While PRI, the normalized pressure ratio influence is represented by Equation (9). 1 Where exp 9 1 (9) = intake manifold pressure = atmosphere pressure The pressure in the manifold, · · is calculated by Equation (10) of ideal gas law, (10) 31 · · (11) · = constant value Where = gas constant =gas temperature = intake manifold volume From mass balance at Equation 6, the mass flow rate that exiting the manifold, thus entering the engine body of cylinder chamber is descript by following Equation (12): · · · (12) = engine angular velocity Where =volumetric efficiency In this case, mass of air flow rate leaving the manifold is dependent upon engine characteristic such as volumetric efficiency and engine angular velocity volume , displacement , such that , intake manifold is represented by Equation (13) as below: (13) · The volumetric efficiency from mass flow rate of air, which exiting the manifold, is determined by a non-linear empirical relation as shown in Equation (14). It is work to represent the effectiveness of engine’s induction process. In this case, it is form up by a complex function of engine geometry and model engine parameter through experimental data. 24.5 · 0.352 3.1 · 10 · 0.167 · 222 · 8.1 · 10 · (14) 32 3.2.2 The Fuel Dynamic In an internal combustion engine, fuel is injected directly into the engine cylinder, just before the combustion process is required to start. Load control which is one of the engine’s model state variable is achieved by varying the amount of fuel injected at each cycle. Here, the engine’s AFR can be maintained through control of quantity of injected fuel. In a large size engine such as vehicle engine, direct-injection systems are used. In this case, the diesel fuel-injection system consists of an injection high pressure pump, delivery pipes and fuel injector nozzles; the governor is used to control the injected fuel pressure and a timing device. The injection high pressure pump generates the pressure required for fuel injection. The fuel under pressure is forced through the high-pressure fuel-injection tubing to the injection nozzle, which then injects it into the combustion chamber. Figure 3.3: Schematic of fuel injection system 33 Amount of fuel injected is determined by the injection pump cam design and the position of the helical groove. As the pump plunger arrives at the bottom dead center (BDC), the pump-barrel inlet ports are open. Through them, the fuel, which is under supply-pump pressure, flows from the pumps fuel gallery into the high-pressure chamber of the plunger and barrel assembly. Then during pre-stroke process, it will cause the retraction stroke and make the fuel pressure increases even higher. During the effective stroke, fuel is forced through the high-pressure line to the nozzle. The effective stroke is terminated as soon as the plungers helix opens the spill port. In this case, changing the plungers of effective stroke will vary the injected fuel quantity. To do so, the control rack turns the pump plunger in the barrel so that helix, which runs diagonally around the plunger circumference, can open the inlet port sooner or later and in doing so change the end-of-delivery point and thus the injected fuel quantity (RACHID, 1995). The plunger speed, and therefore the duration of injection, depends upon the plunger actuating cams lift relative to the angle of cam rotation. This is why a wide variety of different cam contours are required for everyday operations. Mathematical modeling of the cam contour and helix groove is up to specific components used in real engine work. Besides, the fuel spay condition is difficult to model either. Therefore, here the fuel injection system is assumed as a linear system with the signal input from the governor, which is up to the load condition as shown in Equation (15). · Where (15) = fuel rate entering the combustion chamber = command fuel rate = effective fueling time constant 34 Equation (15) describes the relationship between fueling commands and fuel flow rate into the cylinder, which is characterized by a combination of lag and transport delays due to the discrete nature of the intake process. For a sequential-fire port fuelinjection system, the fueling model is simplified as a first order equation in term of the actual fuel rate entering the combustion chamber fueling time constant 0.05 Where . · · . On the other hand, the effective is modeled as show in Equation (16): · = desired air fuel ratio MAX= maximum torque capacity (16) 35 3.2.3 The Rotation Torque Dynamic Figure 3.4: Piston engine model Engine’s piston model show in Figure 3.4 functions to comprises the air flow through the inlet valve and the combustion torque calculation. In this case, the effect of AFR on combustion torque is included as torque efficiencies measurement. Besides that, the friction torque is taken into account too for effective torque calculation. The torque built up in the engine is a function of engine speed, fuel flow and air flow. The combustion and torque production subsystem contain delays associated with the four combustion processes as modeled in the engine’s indicated torque (17). Equation 36 ∆ · ∆ · ∆ · ∆ (17) Where ∆ = intake to torque production delay ∆ = compression to torque production delay AFI= normalized air fuel ratio influence function CI= normalized compression influence function = the maximum torque production capacity of an engine given that AFI=CI=1 From Equation (17), the normalized AFR influence function is described as: cos 7.3834 · / 13.5 (18) Where A/F = actual air fuel ratio of the mixture in the combustion chamber (19) While the normalized compression influence CI is described as: cos . (20) Where CA= tuning parameter of cylinder advance at the Top Dead Center MTB= minimum tuning such that best torque acquire Finally, the crankshaft rotation which follows the torque balance relationship about a rigid shaft is described as: · (21) 37 Where = effective inertia of the engine = engine indicated torque = engine friction torque = accessories torque In this case, the engine friction torque is resulted from coulomb and viscous friction torque such that friction torque results to: 0.1056 · 15.10 Where 0.1056 denote viscous friction coefficient 15.10 denote coulomb friction coefficient (22) 38 3.3 Engine System Identification Theory System identification technique is defined as deriving a mathematical model of certain system dynamic from measured data (Hespanha, 2007). In this project, system identification technique is performed to determine linear engine model, which represented by parametric state space equation. The state space dynamic is needed for design and implementing high accuracy of LQG controller parameters, which performing control algorithm using Kalman filter theory through estimation of states from engine’s state space model. A system identification technique requires application to the engine model with some specific input signal since it relies on the analysis of input and output signal to identify the relationship between them. Here, engine model is assumed as gray box problem providing some basic characteristics of the model. State space model is then estimated from experiment data of stochastic steady state information with use of natural source of randomness value as input to engine model. There are four main steps to determine dynamic model of engine system and Figure 3.5 shows cycle of system identification steps. 39 Data Experiment design and data collection Data Data processing Model estimation Model Model validation Model Model structure selection Correction model needed Model acceptance? Yes Correction data needed Filtering required? Figure 3.5: Cycle of system identification function 40 3.3.1 Experiment Design The design of a system identification experiment includes many important choices. First of all, the engine system is subjecting to step, ramp, pulse or sinusoidal input variables. This procedure can produces input output data from the system to be modeled. Then, the designer has to decide what signals to be measure and when to measure them such that maximum information regarding the system response is contained in the input output data. When these have been defined the next issue is to decide the sampling frequency. The rate is determined from the dynamic properties in the input and output signals. To be able to identify this behavior, the sampling rate has to be fast enough to get all the wanted dynamics, but not so fast as to generate unnecessarily large amounts of data. 3.3.2 Data Preprocessing When data is collected from experiment, immediate usages in identification algorithms are often not possible. First the data has to be pre-processed in several ways in order to eliminate low- and high-frequency disturbances, outliers, missing data, drifts and offsets etc. Removal of offsets such as drifts and trends are especially important when output error models are used as estimation output. If this is not considered, difference in amplitude will dominate the fit criterion and the dynamic behavior will be of less importance. For methods that use flexible noise models, removal of offsets is not as crucial, since this approach, by design, means de-emphasis of drifts and trends. One such method is the least-squares method,( Ljung, 1999). 41 The data measurement equipment is not faultless. Therefore, the data will most likely include bad values due to obvious measurement error. Such data are called outliers. These types of values may have negative effect on the estimate and it is recommended to remove such data from the experiment. Undoubtedly, residual analysis is good for identifying outliers and bad data ( Ljung 1999). Furthermore, bad data might be included in measurements and other data might be missing for any reason. Therefore, data set can be corrected by merging data sets from experiment that has been repeated for a number of times and it is desired to design only one model, based on the data from all experiments. Whatever the reason might be, it is desired to exclude parts of bad data and concatenate other parts. As good as it might sound; it is not possible to simply connect data segments together, since the joining points would cause transient behaviour that might destroy the estimate. Therefore merging data sets can be done with statistical methods, using covariance matrices (Ljung, 1999). 3.3.3 Model Estimation There are a number of different model structures to choose between when describing a system. First the user has to decide upon whether to use linear or nonlinear models, black-box or physically parameterized state-space models etc. In this project, the focus is to design linear models for MIMO systems. Not all model structures can handle multivariable systems. State-space models using a subspace method is one of the models useful for this purpose. 42 3.3.3.1 State Space Model Using a Subspace Method A discrete state-space model is described in Equation (23) and Equation (24). Measured inputs sampled at time k are denoted as u and outputs as y. The number of inputs is nu and the number of outputs is ny. The vector x is the state vector and contains numerical values of n states. w=Ke(t) and v=e(t) are immeasurable signals, assumed to be white noise. State transition equation: (23) Observations equation: (24) In Equation (23) and (24), A is an n-by-n matrix, which describes the dynamics of the system. B is an n-by nu matrix and it describes the linear transformation by which the inputs influence the next state. C is an ny-by-n matrix, which represents how the internal state is transferred to the output y. D is an ny-by-nu matrix, which is the direct feed through term. Complex behaviour in the measured outputs can be captured by choosing n high enough in the model estimation. Figure 3.6 show a graphical representation of a state-space model is made. v w x u B 1/z y C A D Figure 3.6: State space structure model 43 A subspace identification algorithm is performed to identify input-state-and output model of engine system. In this case, if the states of the system are known and input and output data are measured, it would be possible to solve state space model in Equation (23) and (24) for the four matrices. The equation would be a linear regression and the C and D matrices can be found by applying the least squares method. Hence, the other unknown matrices in the equation can then be determined. The problem is thus to find the states in Equation (23) and (24). The states can be described as linear combinations of the k-step-ahead predicted output. Once these predictors are found, the problem is solved. Finding of state can be achieved by using a subspace method. This method determines the predictors by projections directly on the measured data sequences in a satisfactory way, and subspace models have full freedom in the noise model. Therefore, a lower order system can be used for subspace models. Subspace models are also very easy to implement in control algorithms, since the system matrices are directly known. The use of subspace algorithms to carry out state space based system identification in a stationary framework has been widely explored since 80’s (Segismundo et al, 2004). There are two main ideas exploited in subspace algorithms: 1) A sequence of (Kalman filter like) states can be estimated directly from observations. 2) All system matrices can be estimated via least squares (provided that observations and a sequence of states are known). In this case, estimation of a sequence of states from observations is possible by combining two facts: a) Consider the set observations , made up by observation y(t) plus next f-1 as future 44 = [y(t)’, y(t+1)’, ..., y(t+f -1)’]’ 1 and the set 1 (25) of p as past observations = [y(t-1)’, y(t-2)’, ..., y(t-p) ’]’ An expected value of (26) 1 can be calculated by the linear based on projection theorem: The orthogonal projection ( observations ( ) into p past observations ( 1 / 1 ’) E = E( 1 where the projection E( ) of f future 1 ) is 1 ’) E 1 / 1 1 1 1 (27) can be, for stationary processes, consistently estimated directly from data. b) Let ŷ(t|t-1) be the expected value of y(t)based on past values (up to time t-1). Consider a system that evolves according to state space Equations (23) and (24). At time t, the expected value (ŷ t|t 1 ) of conditional on past observations is the product of an (extended) observability matrix by the expected value (ž(t|t-1)) of the state vector at time t conditional on past observations. This fact can be seen by recursive substitution in the state space system equations: ŷ(t|t-1) = C ž (t|t-1) (28) ŷ(t+1|t-1) = CA ž (t|t-1) (29) ž t|t-1 (30) … Ŷ(t+f-1|t-1) = C which can be expressed as ŷ t|t where 1 = ž (t|t-1) is the (extended) observability matrix (31) = [C’ (C A)’ … (C )’ ]’. 45 Combining the two previous facts of (a) and (b), subspace algorithms decompose a matrix of estimated orthogonal projections (predictions) into the product of an (estimated) observability matrix plus an (estimated) “sequence of states” matrix. 3.3.4 Model Validation Last but not least, the resulted model output from system identification technique needs to validate and compare from original system (Ljung, L., 1999). The purpose of model validation is to verify the identified state space model such that it is represents the engine model under consideration adequately. This normally involves statistical analysis of the residuals and predictive capabilities of the model (Hepanha, 1997). 3.4 Linear Quadratic Gaussian (LQG) Controller Linear quadratic Gaussian (LQG) controller, which is a linear quadratic regulator (LQR) combined with Kalman filter, has been widely used in active control of building structures. A general LQG model is shows in Figure 3.7. It is designed in the time domain in such a way to enhance performance from linear quadratic regulator. And it has proven to be effective in reducing the dynamic response of structures (Gawronski,1994). 46 Process noise, v Controller signal, u Kalman Filter Model output, y Reference setpoint, r Optimum Gain Matrix,-K Integrator Plant Air throttle angle, Figure 3.7: LQG controller structure model However, it requires an iterative procedure to obtain LQR weighting matrix, K that used as a performance index, because there is no definite criterion for selecting a weighting matrix. And the improvement in performance and robustness comes at the prices of increased parameters tuning. Linear quadratic Gaussian is one of the several optimal control strategies which have been used for control purpose (Hespanha, 2007). Generally, optimal control system requires a performance measure with a maximization or minimization algorithm that provides an optimal result in some sense, such as minimize the process time, system error and so on. Involvement of Kalman filter in linear quadratic regulator to result a linear quadratic Gaussian compensator has made it different compare to state feedback regulator such as fuzzy logic controller. In this case, presence of Kalman filter works to estimate of all unmeasured state in the engine system. Initially, the linear quadratic regulator should be work well with excellent stability margins. However, the presence of process noise and the unavailability of an onboard sensor have made it fail to present perfectly thus result to use of the LQG compensator. 47 Linear quadratic regulator is a static state feedback controller represented by a constant gain matrix K. To close the loop with K in the feedback, Kalman filter therefore is needed such that all states of the engine model are available for measurement. The control objective of the LQG is to minimize a criterion, which is a quadratic function of the system states and control signals (Åström & Wittenmark, 1990), when the system is subject to certain initial conditions. When designing an optimal controller, the system is assumed to be linear or a linearised system model is used, and has a state space equation such as given in Equations (23) and (24). The control law is chosen such that it minimizes the cost function, tf ( ) J LQ = x (t f ) H x (t f ) + ∫ x (t )Q x (t ) + u T (t ) Ru (t ) dt T T (32) 0 where H, Q and R are weighting matrices. H and Q are at least positive semidefinite and R is positive definite. tf is the final time that the control is required. For a control system that is designed to operate for a long time period, the following cost is used (Burl, 1999). ∞ ( ) J LQ = ∫ x (t )Q x(t ) + u T (t ) Ru (t ) dt T (33) 0 The control law is given by Equations (34) and (35), u(t ) = −K (t ) xˆ(t ) (34) K = −R −1 B T Pr (35) where K is the feedback gain matrix, xˆ(t) is the state estimated using the Kalman filter and Pr is obtained by solving the Ricatti equation given in Equation (36). P&r = −Pr A − AT Pr − Q + Pr BR−1 BT Pr (36) The Ricatti equation has only final condition, Pr (t f ) = H , and the values of Pr corresponding to the optimal trajectory can therefore be found by solving it backward in 48 time using any numerical integration method. In MATLAB®, Pr can be obtained using the function, care(A,B,Q). For the scalar case of Q and R, the cost function, JLQ, can be interpreted as the weighted sum of the state and control. The choices of Q and R matrices allow the respective weighting of the energies of different signals and through that, increases the importance of keeping certain signals small in expense of the others. Generally speaking, selecting Q large means that, to keep cost function JLQ, small, the state x(t) must be smaller. On the other hand selecting R large means that the control input u(t) must be smaller to keep JLQ small. Choices of these matrices follow no particular rules. They depend on the designer’s understanding of the behaviour of the system to be controlled, followed by some tuning by trial and error, until satisfactory performance is achieved. However, as a guideline, Q can be chosen such that it results in the contribution of each state being roughly equal (Burl, 1999). To solve the LQR problem described so far, the system in Equation (33) must be completely controllable so that JLQ in Equation (33) is finite LQG controller then uses the estimate state in the feedback to result a control signal of u=-K . In this case, an accuracy of the estimate state greatly depends upon the accuracy of the linear state space model used for design. Generally, there are four important parameters require to present a LQG compensator that participate by Kalman filter and LQ-optimal gain. They are state weighting matrix Q, input weighting matrix R, process noise and measurement noise covariance matrices, and . By using the developed state space engine model, four main parameters of Q, R, and can be assigned. To design LQG regulators and set point trackers, following steps have to be performed: 1. Construct a Kalman filter (state estimator). 2. Construct the LQ-optimal gain. 49 3. Form the LQG design by connecting the LQ-optimal gain and the Kalman filter. (MATLAB, 2009) 3.5 Fuzzy Logic Controller (FLC) Fuzzy logic controller can be viewed as an artificial brain that applying a “soft computing” technique, which aims to mimic the ability of human mind to learn and make rational decision in an uncertain and imprecise environment (Jantzen, 1998). In case of traditional engine AFR control system, conventional ECUs is work to determine suitable control output value by loading saved data from 3-D maps. Therefore, by replacing 3-D maps with fuzzy logic controller into engine’s control system has the potential to decrease time and effort required in calibration of engine 3-D maps control system. In general, fuzzy logic controller involve of three process of fuzzification, design of rule base and defuzzification (Jantzen, 1998). The controller is between preprocessing and post processing block as show in Figure 3.8. Here, fuzzy logic controller design is accomplished by using fuzzy logic toolbox, which available in MATLAB software. Fuzzy logic controller Rule base preprocessing fuzzification Inference engine defuzification Figure 3.8: Fuzzy logic controller block diagram postprocessing 50 In this project, error values, which result from difference between desire AFR and actual AFR, is assigned as fuzzy controller input. The control strategy is a static mapping between input and control signal. To enhance performance of FLC, an additional input of derivative of error, which is an error measurement backwards in time, is assigned. These are created in the preprocessor thus making the controller multi dimension. 3.5.1 Fuzzification Fuzzification works to converts each piece of input data to degrees of membership by a lookup in one or several membership functions. The fuzzification block thus matches the input data with the conditions of the rules to determine how well the condition of each rule matches that particular input instance. There is a degree of membership for each linguistic term that applies to input variables. Figure 3.9 shows two input funzzification membership function of engine model. The input variable of ‘e’ has universe of discourse, range from -1 to 1 while input variable of ‘ce’ has universe of discourse, range from -2 to 2. 51 (a) (b) Figure 3.9: Inputs membership function of error (a) and change in error(b) contain in fuzzification process. 52 Engine’s fuzzy input variables are participated by error of FLC and change in error of FLC. Each of them form a membership function and participate by five fuzzy set with linguistic term of: NH(negative high) -large negative error value, NL(negative low) -small negative error value, ZO(zero) -zero error value, PH(positive high) - large positive error value, PL(positive low) -small positive error value. During fuzzification process, crisp value of AFR error and change in error, which participated in fuzzy input variable, are mapped into sets of membership function of fuzzy sets. Every element in the universe of discourse is a member of a fuzzy set to some grade, maybe even zero. The grade of membership for all its members describes a fuzzy set. In fuzzy sets elements are assigned a grade of membership such that the transition from membership crisp value to non-membership is gradual rather than abrupt. The set of elements that have a non-zero membership is called the support of the fuzzy set. The function that ties a number to each element x of the universe is called the Membership function,µ(x) 3.5.2 Rule base After fuzzification process, these membership function values are ready to process in rule base through conditional “if-then” statements. Rule base is function as human brain of thinking in such a way to process fuzzified input variables and fire suitable controller signal, thus regulate engine’s air fuel ratio around a prescribed setpoint. Table 1 shows total of 25 rules implemented for AFR control purpose. 53 Table1.1: Fuzzy rules Error Change in error ce e NH NL ZO PL PH NH MH MM ML ML MM NL MH MM ML ML MM ZO MH ML ZO ML MH PL MM ML ML MM MH PH MM ML ML MM MH There is no specific theorem available for designing a complete fuzzy rule. Therefore, a full understanding of plant behavior is needed, in order to result a suitable fuzzy rule base. Error value which is the difference of air fuel stoischiometric ratio and actual air fuel ratio have to be regulated around zero value. So, whenever percentage of input air throttle, which influencing the flow rate of air mass, is increasing, input fuel flow rate, which is control by fuzzy output, need to increase too so that error is always close to zero. For example, during controlling engine’s AFR, if error value is a large negative value, NH and change in error is a large negative value, NH too; which result in large and larger model output error, then fuzzy controller will fire a large control gain value to bring error value back to zero state. On the other hand, if error value is zero value, ZO and change in error is a small positive value, PL; which descript a condition during error signal start to vary away from zero state with small deviation. Therefore, fuzzy controller will result a small control gain value, in order to bring back error value to zero state without causing overshoot to output response, which is cause by overload of controller signal. 54 Figure 3.10 shows membership function of fuzzy output that participated by 5 fuzzy set of ZO(zero) -zero gain value ML(medium low) -small gain value MM(medium medium) -medium gain value MH(medium high) -medium large gain value Figure 3.10: Fuzzy output membership function with participation of 5 fuzzy set ZO, ML, MM, MH. 3.5.3: Defuzzification During defuzzification process, 25 fuzzy controller output will be fired respectively. Each rule from rule base will fire an output based on received error and change in error signal value. Controller output gains from 25 rules are then summed and defuzzified into a crisp analogue output value through an inference engine. 55 Figure 3.11 shows graphical construction of the algorithm in the core of controller. In this case, each of the 25 rows refers to one rule. The rule reflects the strategy that the control signal should be a combination of the reference error and the change in error of fuzzy logic controller. Figure 3.11: Graphical construction of the control system in a fuzzy controller (generated in the Matlab Fuzzy Logic Toolbox) Generally, there are several ways to define the result from a rule, but one of the most common and simplest is the “min-max” inference method. The inference engine looks up the membership values in the condition of the rule. conclusion are accumulated, using the max operation. Then all activated 56 For example by refer to Figure 3.11, only rule number 1, 2, 6 and 7 have fired an output signal, where each of the output signals is result from min operation between fuzzy set of “error” and fuzzy set of “change in error” as show in Figure 3.12. Then, output signals will be accumulative using max operation and fire only a crisp value through centroid defuzzification method. Min operation Max operation Figure 3.12: Defuzzification process The final graph of defuzzification process is shows in bottom right of Figure 3.12. The resulting fuzzy set from final graph must be converted to a number that can be sent to the process as a control signal. This process is so called defuzzification. The crisp output value is the abscissa under the center of gravity of the fuzzy set, ∑ (37) ∑ , is a running point in a discrete universe, and μ is its membership value in the membership function (Yao Ju-Biao et al, 2009). Following the evaluation of rules, the defuzzification process that transforms the fuzzy membership values into a crisp output value can be the fuel pulse width or fuel injection valve opening. Figure 3.13 shows the simulation model of engine system with fuzzy logic controller. 57 Reference setpoint, r u Error ,e y Fuzzy logic controller Plant Output ,y ∆ Figure 3.13: Fuzzy logic controller structure model 3.6 Conclusion A simulation of engine model is work through applying all equation and formula as stated in chapter 3. In this case, it is useful to represent and perform well as a real engine for specific purpose such as control system design. FLC and LQG controller therefore implement into engine model for AFR control purpose thus evaluation made on the controller performance. 58 CHAPTER 4 RESULT AND DISCUSSION 4.1 Introduction The simulated engine model is assumed to perform under steady state condition, with percentage variation of engine’s air throttle angle as shown in Figure 4.1. Here, percentage opening of input air throttle is proportional to automotive acceleration. Therefore, variation of air throttle opening in Figure 4.1 is assumed as accelerate or decelerate of automotive in real time through change of input air flow. With this, engine’s AFR response and controller performance will be evaluated using MATLABSIMULINK software. 59 0.75 0.7 trottle angle percentage/100 Percentage of air throttle variation/100 0.8 0.65 0.6 0.55 0.5 0.45 0.4 0 100 200 300 400 500 sampling time,s 600 700 800 900 1000 Time (sec) Figure 4.1: Variation of engine air throttle Figure 4.2 shows output response of engine AFR due to variation of input air throttle angle in Figure 4.1. In this case, AFR is no longer maintained at stoischiometric value of 14.7 but vary away from it when engines try to accelerate or decelerate. 17 16.5 16 15 air fuel ratio Air fuel ratio 15.5 14.5 14 13.5 13 12.5 12 0 100 200 300 400 500 sampling itme,s 600 700 Time(sec) Figure 4.2: Engine’s Air fuel ratio 800 900 1000 60 Figure 4.3 shows uncontrolled condition of engine at lean and rich oxygen (air throttle variation), which could bring bad effect to engine power reduction and fuel consumption. For example, variation of input air throttle during accelerating or decelerating engine can cause transient effect to engine torque and acceleration response as shown in Figure 4.4 and Figure 4.5. In this case, engine torque response is fail to reach desire value immediately during engine is accelerating or decelerating but result to a delay period before reaching target value. Furthermore, variation of AFR around stoischiometric ratio can influence the exhaust emission control in engine model due to its stoischiometric value of 14.7 can ensure maximum efficiency of conversion of harmful components in catalyst converter. In this case, variations of AFR greater than 1 percent below stoischiometric ratio can result in significant increase of CO and HC emission and increase of more than 1 percent above stoischiometric ratio will produce more NOx up to 50 percent( Ali, 2008). This is then degrades the control quality. To avoid this deficiency, two different type of control strategy are introduced to improve the control quality and to reduce the workload of calibration process thus survive this ratio in an acceptable region. The model of control system was built with MATLAB-SIMULINK. Based on this, AFR control strategy that works with fuzzy logic controller and linear quadratic Gaussian controller was studied. Figure 4.3: Effect of air-fuel ratio on power, fuel consumption, and emission 61 90 70 engine output torque Engine output torque 80 60 50 40 30 20 0 100 200 300 400 500 600 sampling time,s 700 800 900 1000 Time(sec) Figure 4.4: Engine output torque due to variation of input air throttle angle value. 300 engine output acceleration Engine acceleration 200 100 0 -100 -200 -300 0 100 200 300 400 500 600 sampling time,s 700 800 900 1000 Time(sec) Figure 4.5: Engine’s acceleration reading due to variation of input air throttle angle value. 62 4.2 Engine Model Using System Identification Technique Section 3.3 has described theory of system identification technique in determining of linearize state space engine model, which use for LQG controller design purpose. However, working steps and procedure for determining of engine state space model seen to be complicated for implementation purpose. Therefore, MATLAB system identification toolbox is used to simplify the work effort. Figure 4.6 shows available system identification window, which included the process of data preprocessing, model estimation and model validation within a single window. Figure 4.6: System identification toolbox in MATLAB software. To design state space engine model, following steps have to be performed. 1) Import data from input and output of engine model. 2) Select estimate and validate data range 3) Preprocessing imported data 63 4) Estimate model structure 5) Validate estimated model performance 4.2.1 Import Data, Select Range and Data Preprocessing First of all, a random signal was appointed as input of engine model as shown in Figure 4.7. Then, the resulted model input and output data is loaded to MATLAB work space for further process. Random signal to beta Random signal to alfa Figure 4.7: Engine model with assigned random signal into engine’s input signals of beta and Alfa. 64 Input noise responsenoresponse AFR 25 20 15 10 5 0 100 200 300 400 500 time,s 600 700 800 900 1000 700 800 900 1000 Time(sec) (a) Output noise responsenoresponse Model output beta 30 25 20 15 10 5 0 0 100 200 300 400 500 time,s 600 Time(sec) (b) Figure 4.8: (a) and (b) shows output and input response from engine model due to assigning of random signal as model input and work for system identification purpose. 65 In workspace, properties of input output data values in time domain are encapsulated into a single entity through creating of iddata data object with MATLAB command of: z=iddata(output, inputs, sampling time); where z is a data object with model input and output properties. “z” is then separated to create two data objects, “ze” and “zv”, which “ze” contains data for model estimation purpose and “zv” contains data for model validation purpose. In this case, 2000 samples from input and output engine model has been captured. Therefore, first 1000 samples are used for system model estimation with MATLAB command: ze= z(1:1000); Whilst the remaining samples are used for model validation purpose with MATLAB command: zv=z(1001:2000); The working data object, “ze” and validated data object, “zv” are ready to import into system identification toolbox for system identification process. Figure 4.9 shows time domain data of engine model’s inputs: desired fuel flow rate, u1 and flow rate of air mass, u2 and engine model’s output: AFR, y1 after preprocess of removing mean values in system identification toolbox. Typically, aims of building a engine model is to described the responses for deviations from a physical equilibrium. Therefore,with steady-state data, it is reasonable to assume that the mean levels of the signals correspond to such an equilibrium. Thus, models can be seek around zero without modeling the absolute equilibrium levels in physical units yet having initial value of zero at t=0. 66 Estimation data Validation data Figure 4.9: Estimate and validate data for randomness input Beta, u1, Alfa, u2 and output AFR, y1. 67 4.2.2 Estimate Model Structure After all, working data in system identification toolbox which load from data object “ze” and validation data from data object “zv” are ready for estimation of state space mathematic model. Figure 4.10 shows system identification window, which data objects are place at left corner of toolbox window. Data Object Working data Validation Data Figure 4.10: System identification toolbox with linear parametric model window State space model, which categorized under linear parametric model been chosen for estimating actual engine model. Following shows state space transfer matrix A, B, C and D, which reflects physical characteristics of engine model, is resulted from estimated state space using system identification toolbox. Estimated state space: (38) (39) 68 0.18734 0.13306 0.10468 A= 0.08183 0.78614 0.54529 0.00054 0.10877 0.26882 0.00516 0.01720 B= 0.00073 0.09841 0.00011 0.13589 C= 158.16 8.4277 0.44246 D= 0 0 4.2.3 Validate Estimated Model Performance Engine system is estimated as a third order state space equation with three state variables. Here, the estimated engine model is required to validate its performance, such that estimated engine model capable to represent actual engine model and work well for controller design purpose. Therefore, a random signal is injected into input of estimated state space model and work for validation purpose. Figure 4.11 shows actual plant model output (black) response and estimated model output (blue) response displayed at time 1450s to 1550s by sharing identical input signal. In this case, engine’s estimated state space model is validated enable to track actual plant response with best fit up to 90.69 percent through use of MATLAB system identification toolbox. Therefore, a third order state space equation from Equation (38) and (39) with transfer matrix A,B,C and D are validated to represent linear engine plant model, with smallest loss function value of 0.0641 and smallest final prediction error of 0.0643 compare to any other order of estimated engine model. 69 Measured and simulated model output Estimated model output 10 8 Actual model output Model output Model output 6 4 2 0 -2 -4 -6 1450 1460 1470 1480 1490 1500 1510 1520 1530 1540 1550 Time Time(sec) Figure 4.11: Actual and estimated plant output response 4.3 Linear Quadratic Gaussian (LQG) Controller To design LQG regulators and set point trackers, following steps have to be performed as such descript in section 3.4 Design steps of LQG controller: 1. Construct a Kalman filter (state estimator). 2. Construct the LQ-optimal gain, K. 3. Form the LQG design by connecting the LQ-optimal gain and the Kalman filter. (MATLAB, 2009) 70 First and foremost, linear state space model, which acquired from section 4.2, needs to verify its observability and controllability such that estimated state space engine model is valid for control purpose. In this case, controllability and observability matrix from estimated state space engine model needs to be full rank. To determine if a system is controllable, one can compute the controllability matrix, which is defined as: ··· (40) In this case, controllability can be easily defined through MATLAB command: Co=ctrb(A,B); where A and B are n by n system matrix and n by m input matrix from estimated engine state space model. Result shows the system has full rank of 3. Thus it is proved to be controllable. Next, one can compute the observability using observability matrix, which is defined as: Ob= · · · (41) In this case, observability can be easily defined through MATLAB command: Ob=obsv(A,C); where C is a p by n output matrix from engine state space model. Result shows the system has full rank of 3. Therefore, it is proved to be observable. Now, engine’s state space model is validated for control purpose with full rank of observability and controllability matrix Next, Kalman filter strategy that providing model’s estimated state parameter is to be determined. In MATLAB software, estimated state can be determined through following command: Kest=kalman(plant,Qn,Rn); 71 where plant=ss(A,B,C,D,0.1); as state space transfer matrices of engine model and Qn=0;Rn=0.002; is noise covariance data from engine model. Here, value of noise covariance data Qn and Rn are defined as: Qn= (42) and Rn= (43) with defined as process noise and defined as system measurement noise. Therefore, by having complete data of Qn, Rn and plant, estimated state matrix can be determined using Kalman’s filter theorem and following shows transfer matrix of estimated states. Kalman ‘estimated states: Ae= 0.1873 0.1331 0.08183 0.7861 0.00054 0.1088 Be= 0.005164 0 0.0007339 0 0.0001151 0 158.2 8.428 1 0 Ce= 0 1 0 0 0 0 De= 0 0 0.1047 0.5453 0.2688 0.4425 0 0 1 0 0 0 0 Following step is therefore to construct the LQ-optimal gain, K. By using MATLAB command, LQ-optimal gain can be acquired by following command: K=lqi(plant, Q, R); 72 In this case, value of weighting matrix Q and weighting matrix R should be selected in such a case of Q to be positive semi-definite and R to be positive definite. This means that scalar quantity Qx from cost function J is always positive or zero at each time t for all functions x(t), and scalar quantity u Ru from cost function J is always positive at each time t for all values of u(t). These guarantee that cost function J is well-defined. Here, value of Q is assigned as diagonal matrix and acquired through MATLAB command: Q=blkdiag(0.1*eye(nx),eye(ny)); 0.1 0 Q= 0 0.1 0 0 0 0 0 0 0.1 0 0 0 0 1 and weighting gain R=500. In this case, weighting gain R should be choose carefully, where it may cause oscillation and unstable output response under small weighting gain value such that controller gain is too small for regulating error signal; on the other hand, it may cause agitated and oscillated output response but fast AFR converging effect under large weighting gain result. Figure 4.12 shows detail graphical response of controller signal and output response at over large and small weighting gain. The estimated states, from Kalman filter and optimum gain, K are form up together as LQG controller and its model structure is shown in Figure 3.10. Figure 4.12 shows simulated response of engine’s AFR with apply of LQG controller. In this case, LQG controller gain shows lagging effect in such a way fail to bring AFR back to steady state of 14.7 within short period. However, it still showing control afford by trying to reduce the overshoot and transient effect on engine’s AFR due to variation of air throttle, Alfa. 73 Weighting gain, R=250 16 16 15.5 15.5 15 15 AFR AFR controller output Weighting gain, R=600 14.5 14.5 14 14 13.5 13.5 13 350 • 400 450 time,s 500 13 350 550 400 450 time,s Time(sec) Time(sec) AFR response AFR response • Agitated and oscilated response 500 550 Slow and transient response 16 16 15.5 14.5 14 controller output Controller output controller output Controller output 15.5 15 15 14.5 14 13.5 13 350 400 450 time,s 500 550 13.5 350 400 Time(sec) Controller output • 450 time,s 500 550 Time(sec) Controller output Large and oscilated gain • Small and slow gain Figure 4.12: Output response and controller gain performance under large and small weighting gain The delayed control afford from LQG in contrast result to overshooting of AFR response (Figure 4,13) when lagging controller gain has react slow and not giving immediate feedback to variation of AFR on time. Therefore, LQG controller is work on structure modification to improve its performance. Figure 4.14 and 4.15 shows simulation result of AFR response after modification on LQG compensator model with extra derivative block. The derivative block is function to speed up controller gains, 74 which try to regulate AFR error on time and eliminate lagging effect as occur in previous control model. Simulation result shows good and acceptable AFR response from modified LQG controller signals that success to reduce AFR transient effect yet result to shorter settling time. Furthermore, controller output response is showing small variation gain. In this case, controller signal with large variation and agitation condition is in proportion to controller actuator action, which may cause defect to actuator hardware. Therefore, smooth and small controller signal as performed in modified LQG controller is needed in most of the plant controlling cases for prolong controller life time and protection purpose. However, it is weak in overcome overshooting effect by causing overshooting effect to AFR response whenever engine model is accelerating or decelerating. Through overall performance, LQG controller with extra derivative block shows stable and acceptable performance at model output response also in response to controller signal (Figure 4.16, 4.17) in such a way trying to regulate AFR as close as possible to setpoint value. 75 16 15.5 AFR Air Fuel Ratio 15 14.5 14 13.5 13 0 100 200 300 400 500 600 sampling time,s 700 800 900 1000 Time(sec) Figure 4.13: Air fuel ratio response with LQG compensator (blue) and without LQG compensator (green) 76 16 15.5 AFR Air Fuel Ratio 15 14.5 14 13.5 13 0 100 200 300 400 500 600 sampling time's 700 800 900 1000 Time(sec) Figure 4.14: Air fuel ratio response with modified LQG compensator (blue) and without LQG compensator (green) 16 15.5 AFR Air Fuel Ratio 15 14.5 14 13.5 350 400 450 sampling time's 500 550 Time(sec) Figure 4.15: Air fuel ratio response with modified LQG compensator (blue)and without LQG compensator (green)at time 350s to 550s 77 16 15.5 controller output Controller output 15 14.5 14 13.5 13 0 100 200 300 400 500 time,s 600 700 800 900 1000 Time(sec) Figure 4.16: LQG controller output response 16 controller output Controller output 15.5 15 14.5 14 13.5 350 400 450 time,s 500 550 Time(sec) Figure 4.17: LQG controller output response display at time 350 s to 550s 78 4.4 Fuzzy Logic Controller (FLC) Fuzzy logic controller modeled in Figure 3.16 is simulated at time period 100s under condition of engine air throttle variation as shown in Figure 4.1. In this case, 3-D maps, which assigning suitable AFR through ECUs signal has been replaced by a fuzzy logic controller. Here, simulation result will showing how well performance of fuzzy logic controller in regulating AFR to desire ratio under condition of accelerate and decelerate of engine model. Figure 4.18 shows engine’s AFR response with apply of fuzzy controller. In this case, AFR response of engine model is perform well under FLC controller, which trying to return back to stoischiometric ratio of 14.7 after change of engine’s air throttle angle that causing AFR vary away from stoischiometric ratio. 16 15.5 AFR Air Fuel Ratio 15 14.5 14 13.5 13 0 100 200 300 400 500 600 sampling time's 700 800 900 1000 Time(sec) Figure 4.18: AFR response from engine model with fuzzy logic controller (green) and without fuzzy logic controller (blue) 79 15.5 Air Fuel Ratio AFR 15 14.5 14 13.5 350 400 450 sampling time's 500 550 Time(sec) Figure 4.19: AFR response from engine model with fuzzy logic controller (green) and without fuzzy logic controller (blue) crop from time in between 350s to 550s Furthermore, Figure 4.18 and 4.20 shows clear view of controlled AFR response (green) and square error performance (green). In this case, its overshoot effect is completely reduced with percentage higher than 50% compare to uncontrolled AFR response without causing large transient effect to engine’s AFR response (zoom in view in figure 4.19). Engine’s AFR square error response under FLC shows obvious reduction compare to AFR error signal in actual engine plant without implementation of FLC(blue), and the output response show large improvement compare to LQG control afford (Figure 4.22). Here, square error response from LQG controller shows fast converging effort in forcing plant error reduce to zero value in short time. However, LQG controller, which showing fast converging effort, has result to large controller gain (Figure 4.16). This effort on the other hand causes large overshooting and oscillating effect at plant output response as show in Figure 4.14. 80 3 2.5 square error value Square error 2 1.5 1 0.5 0 0 100 200 300 400 500 sampling time's 600 700 800 900 1000 Time(sec) Figure 4.20: Square error value from engine AFR without fuzzy logic controller (blue) and with fuzzy logic controller (green) 3 2.5 square error 2 1.5 1 0.5 0 0 100 200 300 400 500 600 time(sec) 700 800 900 1000 Figure 4.21: Square error value from engine AFR without LQG controller (blue) and with LQG controller (green) 81 Response without controller Response with controller (a) Response without controller Response with controller (b) Figure 4.22 : Close view of Square error response from engine AFR without controller and with controller of (a)LQG and (b) FLC Besides inspect on AFR response of engine model, controller gain response is no doubt another option in determine of suitable controller, so that simulation model practically can be implemented into actual engine system. Figure 4.23 and 4.24 shows FLC controller gain effort in regulating error signal of engine’s AFR. Response shows smooth and small controller signal variation. In this case, performance of FLC controller gain is improved compare to response of LQG controller gain as shows in Figure 4.17. Here, agitated and oscillated controller gain, which occurs in LQG control system, has been recover through implementation of FLC control system. 82 16 Controller output controller output 15.5 15 14.5 14 13.5 0 100 200 300 400 500 time,s 600 700 800 900 1000 Time(sec) Figure 4.23: FLC controller output response 16 controller output Controller output 15.5 15 14.5 14 13.5 350 400 450 time,s 500 550 Time(sec) Figure 4.24: FLC controller output response display at time 350 s to 550s 83 Controller gain response from FLC is therefore igniting the fuelling actuator with time constant as show in Figure 4.25. The filling time constant is showing proportional response compare to flow rate of engine air throttle (Figure 4.1), which is actually make sense, since increase of air flow to cylinder needs increase of fuel flow to cylinder either, so that stoischiometric air to fuel ratio of 14.7 can be resulted. In real engine test bed, an engine torque production is important such that any changes in engine system will not affect or weaken total toque production. Figure 4.26 show simulated engine torque response with FLC as control system. In this case, comparison between actual engine torque responses (Figure 4.6) and engine torque response with FLC shows almost no different between each other. The result shows an FLC controller is working well in regulating error of AFR while maintaining desire torque response from engine system. In general, the overall performance of engine’s AFR with FLC is performed better than original engine system with conventional 3-D mappings. Besides earning good performance from fuzzy logic controller, fuzzy methods in the application of engine control also result to relatively small number of parameters needed to describe the equivalent 3-D map. The time needed in tuning a FLC compared to the same equivalent level of 3-D map look-up control can be significantly reduced. 84 effective fueling time constant 0.054 0.0535 0.053 0.0525 0.052 0.0515 0.051 0 100 200 300 400 500 time,s 600 700 800 900 1000 Time(sec) Figure 4.25: Effective fueling time constant 90 80 enigne rotation torque 70 torque Effective fuelling tiime constant 0.0545 60 50 40 30 20 0 100 200 300 400 500 time,s 600 700 800 Time(sec) Figure 4.26: Engine rotational torque 900 1000 85 CHAPTER 5 CONCLUSION AND FUTURE WORK 5.1 Conclusion In this project, the nonlinear engine model was developed; also the linear engine model has been built from nonlinear engine model through system identification technique. Once the model was obtained, fuzzy logic controller and LQG controller are design to regulate the AFR response, which try to run away from stoischiometric value whenever engine is accelerating or decelerating. The complexity of a fuzzy logic system with a fixed input output structure is determined by the number of membership functions used for the fuzzification and defuzzification and by the number of inference levels. On the other hand, a LQG controller shows its robustness, where Kalman filter is made adaptive and integrated with the standard LQR to obtain a novel control scheme. LQG control provides very good results in high speed control. It is shown that the proposed strategy provides improved performance in terms of generating control effort and following the desired trajectory. In addition, the proposed controller copes well with external disturbances and modeling uncertainty. On the other hand, FLC 86 controller, which performing artificial intelligent technique shows improvement compare to engine AFR response from LQG control system based on system robustness, speed and overshooting effect. In a nutshell, simulation result shows both control strategy of FLC and LQG, which replacing 3D-maps in ECU, are perform well in regulating AFR thus reduce quantity of pollutant release to atmosphere without loss of engine desire torque performance. Each controller has their own benefits as well as weakness and the control performance is highly depending on model behavior. With the contemporary software tools for design and simulation, the above systematic approach can be very well guided by design template files and graphical user interface. A total development environment for rapid prototyping and experimentation allows for a seamless transition to the experiment and concept proving. With the knowledge of the basic theory one can easily develop advanced control concepts in a minimum of time. 5.2 Future Work In this project, a mean value engine model been applied for controller design purpose. However, it is tends to neglect some cycle variation of engine parameter. Therefore in the future, project efforts will be emphasized on design of engine model with detail components performance description and inclusion of transient, steady and ideal engine state. Robustness of designed FLC and LQG controller shall be tested in developed engine model, such that they are capable to withstand controlled output in allowable range. Finally, with the knowledge of controller design, one can develop control system in hardware yet implant to automotive engine and to achieve the project objective. 87 REFERENCE Ali, G, Shamekhi, A. H, Saki, A and Kamrani, E (2008), Adaptive Fuzzy Control for Air-Fuel Ratio of Automobile Spark Ignition Engine, proceedings of world academy of science, engineering and technology ,volume 36, December 2008,1064-1072 ANDERSSON, H. (2008). Model based control of air and EGR into a diesel engine. Master Thesis. Chalmers University Of Technology. Burl, J.B. (1999). Linear optimal control H2 and H∝ methods. Menlo Park, California: Addison Wesley Longman Inc. Chang, I. P.,Lin,G. Y. (2007), Fuzzy Logic Design of the SI Engine Air-Fuel Ratio Controller, Proceedings of 2007 CACS International Automatic Control Conference , Nov. 9-11, 2007, 1072-1078 Chen, L. L. & Wei, M. X. (2008). On transient air/fuel ratio control for gasoline engine on the basis of model identification. Proceedings of the 27th Chinese Control Conference. Nanjing University of Aeronautics and Astronautics, China, July 16-18, 2008. 355-359 Copp, D.G. , Burnham, K.J. and Lockett, F.P. (1998). Fuzzy modelling techniques applied to an air/euel ratio control system. , 1998 The Institution of Electrical Engineers Control Theory and Applications Centre (CTAC). Coventry University..3/1-3/7 Eko, A. P.(2001), Modeling and control design of a powertrain simulation testbed for earthmoving vehicles, the degree of master of science in Mechanical and Industrial Engineering Department, B.S., Texas A&M University 88 Ericson, C. (2007), NOx Modeling of a Complete Diesel Engine/SCR System, Licentiate Thesis, Lund Institute of Technology, Lund University Gawronski, W. K., Racho, C. S. and Mellstrom, J. A. (1994). Linear quadratic gaussian and feedforward controllers for the dss-13 antenna. TDA Progress Report 42-118, August 15, 1994.37-56 HOU, Z. X. & WU,Y. H.(2007). The research on air fuel ratio predictive model of gasoline engine during transient condition. Proceedings of the 2007 IEEE. International Conference on Mechatronics and Automation.932-937 Hou, Z. X.& Wu, Y.H. (2006). Air fuel ratio identification of gasoline engine during transient conditions based on Elman neural networks.1 Proceedings of the sixth international conference on intelligent systems design and applications (isda'06), IEEE.932-936 HOU, Z.X., WU, Y.H (2007), Multi-step predictive model of air fuel ratio for gasoline engine based on neural network, International Technology and Innovation Conference 2007,2028-2030 Huang, T. (2006). Neural Network modeling and feedback Error Learning Control for Automotive Fuel injection System. Master Thesis. University of Illinois at Chicago. Jan Jantzen, (1998) Design Of Fuzzy Controllers,. Tech. report no 98-E 864 (design), Technical University of Denmark, Department of Automation, DENMARK, 19 Aug 1998. Jan Jantzen, (1998) Tutorial Of Fuzzy Controllers,. Tech. report no 98-E 864 (design), Technical University of Denmark, Department of Automation, DENMARK, 19 Aug 1998. 89 Jiang, J. (1994). Optimal gain scheduling controller for a diesel engine. Procs of IEEE Control Systems. The University of New Brunswick,, Canada. August 1994.42-49 Joao P. Hespanha (2007). Undergraduate Lecture Notes on LQG/LQR controller design, Copyright to Joao Hespanha. April 1, 2007 Kenneth, R. M. & James, C. P. J. A (2006). Model-based SI engine air fuel ratio controller. Proceedings of the 2006 American Control Conference. Minneapolis, Minnesota, USA, June 14-16, 2006. 3284-3289 Kyung, W. M. , Lan, C. (2004). Design of frequency- dependent weighting function for H2 control of seismic-excited structures. Journel of vibration and control, 112005. 137-157 Li, Y. C., Liu, G. J. and Zhou, X. (2003). Fuel-injection control system design and experiments of a diesel engine. IEEE transactions on control systems technology, vol. 11, no. 4, july 2003.565-570 Liu, L. H., Wei, X. K., Liu, X. H.(2007). LPV control for the air path system of diesel engines. IEEE International Conference on Control and Automation ThA3-4. Guangzhou, CHINA - May 30 to June 1, 2007.1345-1351 Ljung, L. (1999). System Identification : Theory for the User, Prentice Hall, Upper Saddle River, N.J. Lukáš Lanský (2008). Diesel engine modeling and control. Master Thesis. Czech Technical University in Prague Muske, K. R., Jones, J. C., & Schallock, R. W. (2008). Application of an adaptive delaycompensated PI controller. Proc. 17th IEEE International Conference on Control Applications, San Antonio, Texas, USA, September 3-5, 781-785 90 Pieper, J. K. and Mehrotra, R (1999), Airfuel ratio control using sliding mode methods, Proc. of the American Control Conference, San Diego, California, June 1999, 10271031 Powell, J. D., Fekete, N. P. and Chang, C. F. (1998). Observer-based air fuel ratio control, IEEE control system, SAE Paper 0272-1708/98, Octorber 1998, 72-83 RACHID, A., LIAZID, A. & CHAMPOUSSIN, J. C.(1994). Nonlinear Modelling of a Turbocharged Diesel Engiric. Procs of control system IEEE France 1994.133-136 Segismundo, I. M., Cesáreo, H. I., Javier, P. G. (2004) State space modelling of cointegrated systems using subspace algorithms, the International Conference on Modelling & Simulation - ICMS’04 Valladolid (Spain), s/n. 47011 , 22, 23 and 24 September 2004 Stewart, P. P.(1995).Development of a Transient Air Fuel Controller for an Internal Combustion Engine. Master Thesis California State University, Northridge Northridge, CA Sun, J. S. & Liu, L. P.(2007) Determination of optimal air/fuel ratio and its control using CBR methodology. The Eighth International Conference on Electronic Measurement and Instruments, ICEMI’2007. 1-209-214 System Identification Toolbox User’s Guide © COPYRIGHT 1988 – 2009 by The MathWorks, Inc . Tetsuji Watanabe, Takashi Watanabe, Kenichi Abe Hidekazu Yoshizawa (2004). Parameter identification of 3-way catalytic converter for use in air fuel ratio control. SICE Annual Conference in Sapporo, August 4-6,2004.1134-1138 91 Yao, J. B.,Wu, B., Zhou, D. S. (2009), Simulation on air fuel ratio control based on neural network, SAEPaper 200500244, College of Environmental and Energy Engineering Beijing, University of Technology, ,2009 Yazdanpanah, M. J. & Kalhor, A. (2003). Air/Fuel Ratio control in SI1 engines using a combined neural network & estimator. Procs of 2007 Intelligent Control & Processing Center of Excellence. University Of Tehran,2003 IEEE. 347-353 Yildiz, Y., Student Member, IEEE, Annaswamy, A. Fellow, IEEE, Yanakiev, D. Member, IEEE, Kolmanovsky, I. Fellow, IEEE. (2008). Adaptive Air Fuel Ratio Control for Internal Combustion Engines. American Control Conference Westin Seattle Hotel, Seattle, Washington, USA June 11-13. 2058-2063 Zhang, W. G., Jiang, J. H., Xia, Y., Zhou, X. D.(2002). CNG engine air-fuel ratio control using fuzzy neural networks. Proceedings of the 2nd International Workshop on Autonomous Decentralized System,2002 IEEE.156-162 92 APPENDIX A1 Engine’s air flow dynamic represent in MATLAB-SIMULINK 93 APPENDIX A2 Engine’s fuel injection dynamic represent in MATLAB-SIMULINK 94 APPENDIX A3 Engine’s rotational torque dynamic represent in MATLAB SIMULINK. 95 APPENDIX B The Fuzzy Logic controller and engine model in MATLAB-SIMULINK. 96 APPENDIX C LQG compensator with engine model in MATLAB-SIMULINK 97 APPENDIX D Performance enhancement to LQG compensator with extra derivative block