ECU Look Up Table
-
Upload
achintya-mehrotra -
Category
Documents
-
view
24 -
download
0
Transcript of ECU Look Up Table
Memory Economy for Electronic Control Units:
Compression of Conventional Look-up Tables
K. KNODLER, J. POLAND, A. MITTERER∗ and A. ZELLWSI-RA Universitat TubingenSand 1, D - 72076 Tubingen
[email protected] http://www-ra.informatik.uni-tuebingen.de
Abstract: - The operation of modern technical systems is often controlled by electronic units. In theautomotive sector lattice-like look-up tables are a common representation of non-linear multi-dimensionalparameter functions of actuators. Regardless of the strongly restricted memory capacity of automo-tive electronic control units, manufacturers need to introduce additional functionalities to meet the newspecifications. With an increasing number of adjustable actuators the number of parameters and thusthe memory requirement within the control unit grows enormously. This work introduces a methodbased on evolutionary and classical optimization algorithms which reduces the memory requirement for2-dimensional look-up tables.
Key-Words: - Automotive Electronic Control Unit, Memory Capacity, Look-up Table, nonlinear Opti-mization, Genetic Algorithm, Evolution Strategy.
1 Introduction
Modern technical systems are often controlledby individual electronic control units (ECU). Inmodern automotive vehicles there are more than50 ECUs to control systems like the combustionengine, active and passive safety systems, etc. Forthe actual base state1 of the system the ECU microcontroller calculates the required parameter set-tings for all adjustable actuators and functions.Over the last years legal restrictions on economyand safety together with customer requests for per-formance have forced the manufacturers to intro-duce additional functionalities. Thereby advancedcontrol systems require exponentially increasingnumbers of parameters controlling the actuators(see e.g. [10] for the development of modern auto-motive combustion engines). Although electroniccontrol units are equipped with high-performancemicro controllers, there are strong restrictions onthe complexity of control strategies. In the au-tomotive sector, e.g. for ECUs of combustion en-
∗A. Mitterer, BMW Group, D-80788 Munchen, Germany.E-mail: [email protected].
1Here a base state is defined by a certain number of base pa-rameters which are filtered and digitalized signals measuredby certain sensors. It’s also called operating point. The pa-rameters completing the description of the total state of thesystem depend on these base parameters.
gines, this is particularly due to relatively low com-putational power (1 − 20 MHz) and small mem-ory capacity (∼ 1 MByte). The latter is justifiedby very high development costs that are causedby hard robustness requirements, relatively smallproduction quantities, and by the demand for longterm availability. Therefore it is not possible toincrease the capacity of memory chips for ECUs asmuch as necessary. Already existing and optimizeddata fields approximating parameter functions ofactuators have to be modified to save memory.
2 Look-up Table Approximation
A common representation of a parameter func-tion is a lattice-like data field with a set of parame-ter values at a full factorial rectangular grid of basestates. This data field is often called look-up table[6]. For the control of high performance combus-tion engines, up to 800 1- and 2-dimensional look-up tables are necessary. The compression methodis formalized for 2-dimensional look-up tables, butalso applicable to other dimensionalities.
Let T define the set of 2-dimensional look-up ta-bles, i.e. with 2 input variables and one outputvariable. For the following considerations inputand output variables are assumed to be scaled to[0, 1]. An element T ∈ T, T := (t, Gt, P t) is given
00.2
0.40.6
0.81
00.2
0.40.6
0.810
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
input 1input 2
outp
ut
Fig. 1. A (5 × 4) look-up table (filled circles) withtwo inputs (base parameters) is compressed to size(4× 3) (circles).
by its grid size t := (t1 × t2), the grid positionsGt := {Gt
1, Gt2}, and the parameter values P t(Gt)
at these positions. Figure 1 visualizes a look-uptable with grid size t = (5 × 4), as an elementaryexample. For a new pair of input variables (a basestate) X := (X1, X2) with Gt
1m ≤ X1 < Gt1(m+1)
and Gt2n ≤ X2 < Gt
2(n+1), the ECU micro con-troller calculates the demanded output P (X) by abi-linear interpolation, i.e. a weighted sum of thesurrounding parameter values P t
ij := P t(Gt1i, G
t2j):
P (X) = A00 · P tm,n + A10 · P t
m,n+1
+ A01 · P tm+1,n + A11 · P t
m+1,n+1.
The terms Aij := Aij/A correspond to the fourareas visualized in figure 2 devided by the totalarea A := A00 + A01 + A10 + A11.
G2(n+1)
X2
G2n
A11
A01
X
X1
A10
G1(m+1)
A00
G1m
Fig. 2. Parameters for the bi-linear interpolation ofP (X) from a given look-up table T := (t, Gt, P t).
Recent studies of more flexible grid forms like the
associative datafield with scattered data suggestedin [14] might be better for the efficient approxi-mation of functions with more than 2 input vari-ables, but at least in two dimensions they often re-quire more memory which is the critical point. Thebenefit of associated datafields concerning the on-line adaptability is ignored here, since associativedatafields could not establish till today, i.e. con-ventional lattice-like look-up tables are still domi-nant especially in the automotive sector.
3 Neural Network Approxima-tion
An alternative way to calculate required param-eters for actuators is to evaluate an artificial neuralnetwork, e.g. a Multi-Layer Perceptron or a RadialBasis Function network, within the ECU ([8], [13],[11]). In this case an ECU micro controller calcu-lates for every new base state X the demandedoutput P (X) by evaluating the neural network:P (X) = net(X). Look-up tables are then replacedby parameters of a neural network, e.g. weightsand biases, which are determined in an offline orsometimes in a continuous online training process.The latter is only possible for very fast learningalgorithms. Today, neural networks are still veryrarely used for the control of automotive systems.
Later a rough comparison of the memory re-quirements for the parameters of a Multi-LayerPerceptron neural network on one side and forlook-up tables on the other side will be shown.
4 Look-up Table Compression
This work concentrates on the number of gridpoints defining the size of a look-up table. Figure1 visualizes the structure of a very small look-uptable for an actuator’s parameter function depend-ing on two base parameters. For demonstrationreasons, the grid size was chosen (5 × 4), the gridpoint positions are highlighted by the solid verti-cal lines. The filled circles mark the parametervalues. The goal is to calculate a compressed look-up table that is sufficiently similar to the origi-nal one. The dashed lines and the circles in fig-ure 1 indicate a possible new compressed look-uptable of size (4 × 3). In the following sections theproblem is formalized and the compression methodis outlined. Consider the following problem: LetU ∈ T with U = (u, Gu, P u) be an original un-compressed look-up table defined at a grid Gu of
size u = (u1 × u2) with a set of u1 · u2 param-eter values P u. How can a compressed look-uptable C ∈ T with C = (c,Gc, P c) be constructedthat approximates the original one sufficiently ac-curately? Assume a predetermined reduced gridsize c = (c1× c2) where at least one of c1 and c2 issmaller than the corresponding original value. Fig-ure 1 displays a simple situation, where an originallook-up table of size u = (5 × 4) has to be com-pressed to one with size c = (4 × 3) indicated bythe dashed lines. Thereby the positions of the gridpoints defining the edge of the base range for theoriginal and the compressed look-up table coincide.The positions of the other grid points fixing the in-terior sampling points are freely placeable for eachdimension. In order to achieve a maximal simi-larity between the original look-up table and thecompressed one, two entangled minimization taskshave to be performed. The following section in-troduces a suitable objective function for the opti-mization algorithms.
4.1 The Objective Function
An original uncompressed look-up table U is de-fined at the grid Gu of size u = (u1×u2). There arei = 1, . . . , u1 grid point positions Gu
1i in the firstdimension and j = 1, . . . , u2 positions Gu
2j in thesecond dimension. The corresponding parametervalues are P u
ij := P u(Gu1i, G
u2j). The compressed
look-up table C is defined at the grid Gc withi = 1, . . . , c1 positions Gc
1i and j = 1, . . . , c2 po-sitions Gc
2j in the first and second dimension. Theparameter values are P c
ij := P c(Gc1i, G
c2j), where
the grid points are partly determined by the fourrelations Gc
11 = Gu11 = 0, Gc
1c1= Gu
1u1= 1,
Gc21 = Gu
21 = 0, and Gc2c1
= Gu2u1
= 1 to fix theedges of the base range. After every new settingof the grid positions Gc the calculation of new pa-rameter values P c at this grid is required. In orderto assess an objective function for the optimizationproblem, the function
Φ(Gc, P c) :=u1,u2∑
i,j=1
(P u
ij(Gc, P c)− P u
ij
)2, (1)
is defined, where P u(Gc, P c) := B(P c(Gc), Gu) de-fines the bi-linear interpolated parameter values atthe original grid Gu. A Levenberg-Marquardt Al-gorithm (see e.g. [3]) is used to calculate the set ofparameter values P c which leads to the best leastsquare curve fit P u
opt(Gc, P c) of the parameter val-
ues P u at the original grid Gu. The parameter val-
ues P c are then defined by the minimum of equa-tion (1) with respect to P c
Φ(Gc, P c) := minP c
Φ(Gc, P c). (2)
The Levenberg-Marquardt Algorithm uses the pa-rameter values P c
ini calculated by a simple inter-polation between the original parameter values P u
that is based on triangulation as starting point forthe least square curve fit.
Using equation (2), an objective function for theproblem of optimal positioning new grid points Gc
can now be defined by
Φ(Gc) := Φ(Gc, P c). (3)
This function is minimized by means of evolution-ary algorithms, i.e. evolution strategies and ge-netic algorithms (see [4], [12], [1]). For comparisonreasons also classical optimization algorithms forconstrained and unconstrained problems are ap-plied (see e.g. [3]).
4.2 Compression Algorithms
Since the points defining the grid edge are al-ready fixed to 0 and 1 respectively, the dimen-sion of the optimization problem is reduced toc1 + c2 − 4. In the sequel different algorithms thatare used to solve the problem of positioning thegrid points Gc of the compressed look-up table Care described. All algorithms need an initial set ofsolutions {Gc
ini} of the problem in order to start theoptimization. For this purpose equidistant gridsGc on the base range are slightly distorted by shift-ing all points that lie on the same grid line by asmall random number in the orthogonal direction(see figure 3).
0 0.25 0.5 0.75 1
0
0.33
0.66
1
input 1
inpu
t 2
Fig. 3. A noisy rectangular grid (circles) derived froman equidistant grid of size (5× 4) (filled circles).
4.2.1 Evolutionary Algorithms.
The problem of finding optimal new grid pointpositions Gc is now defined by the minimum ofequation (3) with respect to Gc
Φ(Gc) := minGc
Φ(Gc), (4)
and can be solved by means of evolutionary al-gorithms. Of course evolution strategies suit wellsince the problem is continuous. An evolutionstrategy with covariance matrix adaptation [5] isused. The parameters are set to the standard val-ues suggested in this work. For comparison reasonsalso a standard evolution strategy without covari-ance matrix adaptation is applied. A parent pop-ulation with µ = 6 individuals and an offspringpopulation with λ = 12 individuals is chosen.
In order to apply genetic algorithms, a codingfunction with application specific bit resolution isintroduced. Here, the grid point positions are en-coded in gray code with a precision of 12 bits.An individual has a 2-dimensional matrix struc-ture with c1 + c2 − 4 rows and 12 columns. Aparent population of size µ = 40 individuals andan offspring population with λ = 40 individualsis used. The algorithm parameters were set toan elite of 4 individuals, a tournament selectionwith the best q = 4 individuals, and either uni-form or 2-point crossover. Uniform crossover on2-dimensional encoded individuals is equivalent touniform crossover for the 1-dimensional case. The2-point crossover uses 2 crossover lines in each di-mension and therefore separates the parents in upto 9 exchangeable sections.
4.2.2 Classical Optimization Algorithms.
Of course also classical optimization algorithmscan be used to minimize the nonlinear multivari-able function Φ(Gc) defined in equation (3). Forexample a Sequential Quadratic Programming algo-rithm (see e.g. [3]) is capable of handling the con-strained optimization problem of positioning thegrid points. The transformation of the search spacefrom [0, 1]2 to ]−∞,∞[2 by means of
G(c) = tan((2 ·Gc − 1) · π/2),
allows to apply optimization algorithms for uncon-strained problems. Here, both a Simplex SearchMethod based on the one suggested by Nelder andMead and a BFGS Quasi Newton Method (see e.g.[3] for this topic) are used.
5 An Application Example
As application example, the ignition timing an-gle as a control parameter for a modern combustionengine is considered. It depends on the base pa-rameters, engine speed and relative air mass flowwhich together define the base state of the engine.An ignition timing angle look-up table of grid sizeu = (24× 16) is compressed to size c = (16× 10),i.e. 186 instead of 424 parameters. The pointsdefining this look-up table are plotted in the up-per part of figure 4. The lower part of figure 4displays this look-up table calculated at a fine gridof size (101 × 103) by bi-linear interpolation (in-cluding the original grid positions).
All evolutionary and classical algorithms are im-plemented in the MATLAB environment. Thelinear interpolation based on triangulation andthe Levenberg-Marquardt Algorithm for the leastsquare curve fit are included in the Matlab Opti-mization Toolbox ([7]). The classical algorithmsused for the positioning of the grid points (Se-quential Quadratic Programming, Simplex Search,BFGS Quasi Newton) are also implemented in thistoolbox. For the following results 30 runs of eachalgorithm were performed. The maximal numberof generations, where the evolutionary algorithmsconverged, were 100 generations. In the case ofthe classical algorithms, the internal terminationcriteria were used.
5.1 Result: Compressed Look-up Table
Figure 6 shows the performance measured byequation (4) of the different algorithms for thecompression of the ignition timing angle look-uptable to size c = (16 × 10). All evolutionary al-gorithms find very good solutions. Note that theoverall best result 0.00121 was found by the ge-netic algorithm with 2-point crossover. The bestresult for the CMA evolution strategy was 0.00125and for the standard evolution strategy 0.00148.There are more significant differences in the meanand maximum values. Here, the genetic algorithmsperform more robust than the evolution strategies.The classical algorithms yield significantly worseresults (0.00189), especially the mean and maxi-mum values are bad. The upper plot in figure 5shows the overall best compressed look-up table,the lower plot the corresponding fine evaluation.The genetic algorithm requires much more compu-tation time because of the high number of functionevaluations, i.e. 4000. The CMA and the standard
00.2
0.40.6
0.81
00.2
0.40.6
0.810
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
engine speedrelative air mass flow
igni
tion
timin
g an
gle
0
0.5
1
00.20.40.60.810
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
engine speedrelative air mass flow
igni
tion
timin
g an
gle
Fig. 4. Top: An ignition timing angle look-up table ofgrid size u = (24× 16). Bottom: The look-up tableevaluated at a fine grid of size (101× 103).
evolution strategy took 1200, and in the mean, theclassical optimization algorithms took 1400 func-tion evaluations. But since the calibration of manytechnical systems requires best parameters for theactuators’ control, computation time is less impor-tant and therefore also genetic algorithms are use-able in practice.
5.2 Result: Neural Network
This section gives a rough comparison of thememory requirement for a compressed look-up ta-ble on one side and for parameters of a neural net-work approximation on the other side. For thispurpose the ignition timing angle look-up tablewith grid size u = (24 × 16) is chosen. The num-ber of parameters for the compressed look-up ta-ble with grid size c = (16 × 10), i.e. 186, andthe number of parameters for a neural networkthat leads to a comparable quality at the originalgrid are considered. A feedforward neural networkwith 2 input neurons for the base parameters, 2hidden layers consisting of 8 tanh neurons each,and with 1 linear output neuron for the actuator
00.2
0.40.6
0.81
00.2
0.40.6
0.810
0.2
0.4
0.6
0.8
1
engine speedrelative air mass flow
igni
tion
timin
g an
gle
0
0.5
1
00.20.40.60.810
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
engine speedrelative air mass flow
igni
tion
timin
g an
gle
Fig. 5. Top: The best compressed look-up table forgrid size c = (16 × 10). Bottom: The compressedlook-up table evaluated at the fine grid.
parameter is used. It takes 105 parameters, i.e.weights and biases, which have to be stored in theECU. As training data set the original look-up ta-ble U is used. The Levenberg-Marquardt learningalgorithm with bayesian regularization ([9], Neu-ral Network Toolbox [2]) leads to a significantlyworse sum of square errors of the original parame-ter values P u than the best result of the presentedmethod, i.e. 0.0042 instead of 0.0012. But thecomparison of the parameter values at a fine gridwith size u = (101×103) (including the original po-sitions) shows that the neural approximation yieldsa better result, i.e. 0.30605 instead of 0.33912 forthe sum of square errors. Therefore the neural net-work approximation of the look-up table yields abetter global match of the original look-up tablethan the compressed look-up table.
6 Conclusions
The memory capacity of electronic control unitscan not stand the growing number of additionalparameters, that have to be introduced in order
0
0.002
0.004
0.006
0.008
0.01
Ignition Timing Angle, c = (16,10)
GA2Point
GAuniform
CMA ES
Standard ES
SQPSimplex Search
Quasi Newton
min meanmax
Fig. 6. The algorithms’ performance for the compres-sion of the ignition timing angle look-up table.
to fulfill new technical specifications. To providememory for new parameters, a method for the op-timal compression of already existing look-up ta-bles was deduced. In the application example theevolutionary algorithms yield better and more ro-bust results than the classical optimization algo-rithms. For higher dimensional search spaces, theevolutinary results were significantly better. Al-though the problem of compressing look-up tablesis a continuous one, for larger grid sizes c in themean genetic algorithms perform better than evo-lution strategies. The alternative method using ar-tificial neural networks takes less memory capacityin order to reach a better global approximationthan the optimized compressed look-up table.
Neural network approximations of look-up tablesare very smooth and therefore optimal for the ac-tuators’ control. The missing physical relationsipbetween the network parameters and the actuatorfunctions, and the low degree of transparency ofneural networks will retain the dominance of con-ventional look-up tables at least for the next years.
Acknowledgments
We thank Thomas Fleischhauer and FrankZuber-Goos for helpful discussions. This researchhas been supported by the BMBF (grant no. 01IB 805 A/1).
References:
[1] T. Back. Evolutionary Algorithms in Theoryand Practice. Oxford University Press, 1996.
[2] H. Demuth and M. Beale. Neural Network
Toolbox User’s Guide, Sixth Printing Revisedfor Version 4. The Math Works Inc., 3 AppleHill Drive, Natick, MA 01760-2098, 2000.
[3] R. Fletcher. Practical Methods of Optimiza-tion. Chichester, Wiley & Sons, 2nd edition,1991.
[4] D. Goldberg. Genetic Algorithms inSearch, Optimization, and Machine Learning.Addison-Wesley, 1989.
[5] N. Hansen and A. Ostermeier. Conver-gence properties of evolution strategies withthe derandomized covariance matrix adapta-tion: The (µ/µi, λ)-cma-es. In 5th EuropeanCongress on Intelligent Techniques and SoftComputing, pages 650–654, 1997.
[6] Robert Bosch GmbH (Hrsg.). Kraft-fahrzeugtechnisches Taschenbuch. Springer-Verlag, New York, 22. auflage edition, 1992.
[7] The Math Works Inc. Optimization Tool-box User’s Guide, Fourth Printing for Version2.1. The Math Works Inc., 3 Apple Hill Drive,Natick, MA 01760-2098, 2000.
[8] U. Lenz and D. Schroder. Artificial intelli-gence for combustion engine control. In SAEInternational Congress and Exposition, De-troit, USA, SAE Technical Paper No. 960328,1996.
[9] D. J. C. McKay. Bayesian interpolation. Neu-ral Computation, 4:415–447, 1992.
[10] A. Mitterer. Optimierung vielparametrigerSysteme in der Antriebsentwicklung, Statis-tische Versuchsplanung und Kunstliche Neu-ronale Netze in der Steuergerateauslegung zurMotorabstimmung. Number 434 in 12. VDI,VDI Verlag GmbH Dusseldorf, 2000. VDIFortschritt-Berichte – Reihe 12: Verkehrstech-nik/Fahrzeugtechnik.
[11] O. Nelles and R. Isermann. Identification ofnonlinear dynamic systems – classical meth-ods versus radial basis function networks. InAmerican Control Conference (ACC), 1995.
[12] I. Rechenberg. Evolutionsstrategie ’94.frommann-holzboog, Stuttgart, 1994.
[13] C. Schaffner, D. Schroder, and U. Lenz. Appli-cation of neural networks to motor control. InInternational Power Electronics Conference,IPEC ’95, Yokohama, Japan. Proceedings pp.46-51, Vol. 1, 1995.
[14] M. Schmitt. Associative datafields in automo-tive control. In 3rd IEEE Conference on Con-trol Applications, Glasgow (UK), pages 1239–1244, 1994.