Symposium on Automotive/Avionics Avionics Systems Engineering (SAASE) 2009, UC San Diego Model-based Parameter Optimization of an Engine Control Unit using Genetic Algorithms Dipl.-Inform. Malte Lochau M.Sc. Bo Sun Prof. Dr. Ursula Goltz Dr. Petra Huhn Institute for Programming and Reactive Systems 1
Contents 1. Constraint Multi-objective Optimization, Pareto-Optimality, and Genetic Algorithms (GA) 2. Case Study: 4-stroke Internal Combustion Engine 3. Design of Experiments and GA Application 4. Results and Observations 2
Motivation Combustion engine callibration/regulation Multitude of electronically influenced controlling parameters Growing number of requirements Conflicting optimization goals for objective values Maximization: engine performance Minimization: fuel consumption Constraints Depends on working point Parameterization (Design Variables) Working Point Working Point Optimization Goals (Objective Values) Engine Engine Control Control Unit Unit Engine Constraints Constraints 3
Engine Control Unit Central part of modern automotive engines High computational complexity 4
Optimization Approach (Constrained) Multi-Objective Optimization Problem (MOP) Large, nonconvex search space High inner complexity with interdisciplinary influences Conventional analytical optimization approaches inapplicable Blind optimization Random search techniques Continuous validation of possible solutions on the engine test bed costly and impracticable Engine model simulation as objective function 5
(Constraint) Multi-objective Optimization minimize Z = (z 1 (x), z 2 (x),, z m (x)) (objective functions) subject to h j (x) = 0, j = 1, 2,, p (constraint functions) g k (x) 0, k = 1, 2,, q where x S (decision variables) and S R n (search space) 6
Pareto-Optimality Contradicting objectives: Min. fuel consumption Max. power values Selection of a solution from a set of best rated value combinations: Domination relation on decision vectors: x 1 x 2 Pareto-optimal set: non-dominated set of objectives in S Pareto-Front: corresponding set in the objective space Set of optimal solutions constitute different possible tradeoffs between objectives 7
Non Dominance and Pareto-Front Pareto-optimal set: non-dominated set of the entire feasible region of the search space Pareto-Front: corresponding set in the objective space 8
Genetic Algorithms (GA) Random, stochastic search technique for a defined MOP search space Evolutionary optimization approach inspired by natural selection ( survival of the fittest ) A population of abstract representations of candidate solutions (individuals) to an optimization problem evolves towards better solutions Independent of the complexity and internal structure of the optimization problem 9
Principles of GA Initialization: Population composed of random/preselected individuals in the search space Iteration: chain of generations Fitness of each individual in the population is evaluated according to optimization goals Multiple individuals are stochastically selected from the current population based on their fitness Selected individuals are modified, recombined, and possibly randomly mutated to form a new population (genetic operators) Infeasible individuals are refused Termination: A specified number of generations has been met, or A satisfactory fitness level has been reached for the population 10
GA Flow 11
Individual Encoding Representation of decision variables Components encoded as genes 12
Population Encoding Population of generations: set of individuals 13
Genetic Operators (1/4) Selection: choose individuals in a population to produce the next generation Individuals are selected mainly based on their fitness value expressing their survivability in the population Examples: Elitist selection Roulette-Wheel selection Tournament selection Rank selection 14
Genetic Operators (2/4) Crossover (recombination): mates two individuals to produce two offsprings 15
Genetic Operators (3/4) Crossover with multiple crossover points 16
Genetic Operators (4/4) Mutation: spontaneous changes on individuals 17
Evolutionary Process Further GA Settings: Population Size N Crossover probability P c Mutation probability P m 18
Case Study: : 4-stroke 4 Internal Combustion Engine Cycle process: 4 movements (strokes) Crankshaft rotates 720 Angle of crankshaft: Point in time for operations of the strokes Controlled by ECU 19
4 Movements 1. Intake / induction stroke fuel / air injection 2. Compression stroke ignition 3. Power / combustion stroke engine gives power 4. Exhaust stroke gas leaves combustion chamber 20
Engine Model WAVE model (http://www.ricardo.com) Parameterized simulation performance values parameterization simulation 21
Design Variables Engine Parameters Optimization: adjusting parameters by the ECU Variable Description Unit Scope x 1 Fuel/Air ratio - [0.5, 0.1111] x 2 Diameter of throttle millimeter [mm] [40, 51.7] x 3 Fuel pressure bar [bar] [20, 110] x 4 Injection start degree [deg] [-360, 60] x 5 Injection duration degree [deg] [0, 240] x 6 Combustion start degree [deg] [-30, 30] x 7 Intake valve open degree [deg] [326, 386] Constraint: x 4 + x 5 < x 6 22
Objective Values Requirements f i Description Unit Objective / Constraint y 1 Brake specific fuel consumption kg/kw /h y 2 Net indicated mean effective pressure bar Minimum in [0,1] Maximum in (0, ) y 3 Brake mean effective pressure bar Maximum in (0, ) y 4 Air/Fuel ratio trapped, multi-cylinder average - y 5 Maximum cylinder pressure of cylinder 1 bar 14.5 ([10.5,18.5] acceptable) 130 (mechanical pressure) y 6 Maximum rate of pressure rise in cylinder bar/ KW 8 Speed of turbine rpm 180000 y 7 Area of waste-gate attached to turbine in [0,400] mm 2 y 8 y10 y 9 Temperature of thermocouple in duct of inlet K y9 180 y 10 Temperature of thermocouple in exhaust of duct K y 11 Temperature of thermoelement of turbine inlet K 1323.15 K y 12 Temperature of thermoelement of turbine outlet = 0 K 1223.15 K y 13 Normalized stall magnitude of compressor - 23
Optimization Approach minimize y = f(x) = (f 1 (x), -f 2 (x), -f 3 (x)) subject to x 1 + x 5 < x 6 0 f 1 (x) 1 f 2 (x) > 0 f 3 (x) > 0 f 4 (x) 14.5 4 f 5 (x) 130 f 6 (x) 8 f 7 (x) 180000 0 f 8 (x) 400 f 10 (x) f 9 (x) 180 f 11 (x) 1323.15 f 12 (x) 1223.15 f 13 (x) = 0 where x S R 7 24
Tool-based Framework for GA Application Design Variables, Simulation Settings WAVE Engine Model Simulation Performance Values, Constraints Model File Individual Encoding GA Optimization Tool Interface Simulation Output File Individual Fitness Archived Individuals GA GA Settings Pareto Optimal Solutions 25
Experiments Case 1 Case 2 Case 3 discretized decision variables yes yes no preselection no yes no replacement Elitist Elitist Elitist selection scheme Roulette Wheel Roulette Wheel Rank crossover Uniform Uniform Blend mutation Gaussian Gaussian Gaussian population size 200 200 100 generations 40 40 80 crossover probability 0.8 0.8 0.9 mutation probability 0.2 0.2 0.1 26
Observations (1/2) Collecting individual data during GA application Deriving further relations between design variables and objectives values Simplified engine model 27
Observations (2/2) y 2 and y 3 : linear increasing dependency neglecting y 3 y 1 and y 2 : competitive 2-dimensional objective space 28
Initialization 29
1st Generation 30
2nd Generation 31
3rd Generation 32
4th Generation 33
5th Generation 34
Final Generation 35
Dominated Space Measering size of dominated space final Pareto-Front 36
Pareto-Front for Case 1 Comprehensive coverage of the search space Selection of a solution: Further analyses Ranking Validation on the real engine test best: Plausibility of optimization results Ensuring correctness of the model 37
Observations Final Pareto sets stable Clear and consistent solution identification in all 3 Cases Validation on the engine test bed But: convergence speed depends on GA settings Speed vs. Accuracy 38
Convergence Case 2: preselection Case 1 and 2: discretized decision variables Total simulations Simulation duration Overall duration Case 1 5555 ca. 180 sec ca. 12 d, 17 h Case 2 5760 ca. 120 sec ca. 8 d, 19 h 39
Some Statistics Case 1 Case 2 Case 3 Total created individuals 8199 8197 7716 Total feasible individuals 2703 2885 5412 Average feasible individuals of generation 68 72 68 Total infeasible individuals 5496 5312 2304 Total simulated individuals 5555 5760 7653 Individuals in Pareto-front of initial generation 4 4 2 Individuals in Pareto-front of final generation 53 71 78 Average individuals in Pareto-front of generations 36 43 60 40
Scalability of GA Independent of inner complexity Supplying no further information on system under optimization Adaptable optimization framework: Engine Model Optimization goals und constraints GA Settings Adaptive GA: Adjustable object function (working point) Integration of learning approaches 41
Future Work Improving efficiency of GA: Enhanced genetic operators Punishment for constraint violations Parallel computation of individuals Improving accuracy of GA: Hybrid approaches Domain knowledge for different engine classes Improving usability of GA: Engineering workflow integration Result selection, statistics capabilities 42