Model III: Redox Reactions on the Electrolyte
TWC 1 TWC 2
5.4 Online Adaptation Strategy
5.4.1 Extended Kalman Filter for the TWC
put because of the nonlinear characteristic. With this challenge and the partly significant simplifications in the model in mind, the agreement of the measured and the simulated sensor signals can be considered good. For the purpose of diagnosis and control, the model can therefore be expected to be sufficiently accurate.
Consider a process described by the nonlinear state-space equations
˙
x = f(x,u) +w
y = h(x,u) +v (5.31)
y,x, andudenote the output, the state and the control input vectors, respec- tively. wstands for the process noise,vfor the measurement noise. vandw are uncorrelated, zero-mean white noise processes with covariance matricesQ andR, respectively:
Q = E£ wwT¤
(5.32) R = E£
vvT¤
(5.33) It is assumed that the process and measurement noise processes are additive to the state derivative and the output vectors. A more general approach, where also nonlinear noise models are accounted for, has been presented in [99].
The goal of the Kalman filter is to provide an estimatexˆ of the state vector x, where the covariance matrixPof the estimate error is minimal. Pcan be expressed as follows:
P=E£
(x−xˆ)(x−xˆ)T¤
(5.34) The Kalman filter algorithm basically handles linear models. Therefore, the model has to be linearised around the current state estimate ˆxto obtain the systems dynamics matrixFand the measurement matrixH:
F = ∂f(x,u)
∂x
¯
¯
¯
¯x=ˆx
(5.35) H = ∂h(x,u)
∂x
¯
¯
¯
¯x=ˆx
(5.36) The filter will eventually be required in the discrete form. In the discrete algo- rithm equations, the fundamental matrixΦk3is required instead of the systems dynamics matrix F. Φk can be approximated by the first two terms of the Taylor-series expansion:
Φk =eFhs ≈I+Fhs
µ +F2h2s
2! +F3h3s 3! +· · ·
¶
(5.37)
3A more accurate denotation isΦ((k+ 1)hs, khs), since the progression of the state vector between the two sampleskhsand(k+ 1)hsis addressed. However, for the sake of readability, the simpler formΦkis preferred.
hsdenotes the sample time. A more robust possibility is the bilinear approxi- mation. It should be used, when the model is stiff. The problem is, however, that a matrix inversion is required. The bilinear approximationΦk can be ex- pressed as follows [40]:
Φk≈
· I−hs
2 F
¸−1· I+hs
2 F
¸
(5.38) The extended Kalman filter algorithm basically consists of two steps. In the first step, the “time update” or “extrapolation” step, the state vector estimatexˆ and the covariance matrixPare projected one step ahead:
ˆ
x−k = f(ˆxk−1,uk−1) (5.39) P−k = ΦkPk−1ΦTk +Qk (5.40) Notice that the nonlinear state-space equation is integrated directly without lin- earisation. The discrete process noise matrixQk can be obtained from the continuous matrixQby integration over one time step:
Qk= Z khs
(k−1)hs
Φ(τ)QΦT(τ)dτ (5.41) In the second step, the “measurement update” or “correction” step, the state vector estimatexˆ and the covariance matrix Pare corrected using the error between the projected output vectorh(ˆx−k)and the measured vectorzk, and measurement matrixHk, respectively:
ˆ
xk = ˆx−k +Kk¡
zk−h(ˆx−k,uk)¢
(5.42)
Pk = (I−KkHk)P−k (5.43)
The Kalman gainKkis calculated from the discrete Riccati equation Kk=P−kHTk¡
HkP−kHTk +Rk¢−1
(5.44) The filter algorithm is established with equations (5.39)–(5.40) and (5.42)–
(5.44). Their calculation has to be repeated every time step.
Theoretically, the covariance matricesQandRdescribing the process and measurement noise processes, can be obtained from measurements. However, some of the internal state variables such as the occupancies of O or CO can hardly be measured. In practice, the two matrices are used as tuning parame- ters. To illustrate their influence, consider (5.44). IfRis chosen large andQ small,Kkbecomes rather small. This means that due to the large measurement
error, the model is trusted more. Hence, the estimated state vectorxˆis mainly calculated with the extrapolation step, the correction step only has a weak influ- ence. Accordingly, the opposite is true, ifQis chosen to be large andRsmall.
Since the model errors are in reality somewhat far away from white noise, es- pecially in the example presented here, the two parameters have to be chosen carefully. Generally, the model noise is considered small as compared to the measurement noise, i. e., a relatively slow adaptation is preferred. This choice is based on the intention to filter out high frequency dynamics which are not reflected by the model.
Implementation of the TWC Model
The TWC model is implemented in the form presented in Section5.2. Thereby, the state-space equation contains the raw exhaust and the TWC models. The measurement equation incorporates the switch-type λsensor model. Hence, the input, state, and output vectors are defined as follows:
u=
λ
˙ mexh
Texh
, x=
θO,1
θCO,1
Ts,1
θO,2
... Ts,3
, y= [Uλst]
The model contains nine state variables, which is certainly the upper limit for control-oriented purposes. However, since the measurement vector is actually a scalar, the matrix inversion in the Riccati equation (5.44) reduces to a scalar inversion.
The filter is somewhat simplified by only including the occupancies in the measurement update step. The temperatures are estimated in the extrapolation step. This reduces the covariance matrixPto 6thorder. This choice is based on the fact that the coupling between the temperatures and the sensor output is relatively weak. Tests have shown that significant transients, as they occur e. g.
during a fuel cut-off, may over-excite the temperature correction because of this weak coupling. This destabilising effect could only be partly damped by an adequate choice of the corresponding elements in the model noise covariance matrixQ. The reduction of the problem considerably improved the robustness of the filter against the mentioned sudden transients.
The characteristic of the measurement equationh(x,u)is strongly nonlinear.
This nonlinearity arises from the considerably increased sensitivity of the sen- sor signal around stoichiometry, as compared to the zones, whereλis further
away from one. Basically, one would expect that the measurement covariance Rshould be adjusted to the voltage level. An alternative approach could be to
“invert” the sensor signal according to (5.30) of the model calibration section.
This would considerably “flatten” the sensor characteristic.
In fact, neither has been done. The sensor signal has been used in its original nonlinear form andRhas been kept constant. As already stated in Chapter4, the switch-typeλsensor provides a very accurate information about the posi- tion of the stoichiometric point. This is also the point, where the model should be accurate, since it is directly connected to the estimation of the storage ca- pacity. Further off the stoichiometric point, i. e., where|λ−1|> ǫ, the sensor is less accurate. its signal is distorted by the actual sensor temperature, which is unknown, and by the ageing of the sensor. Hence, choosingRto be con- stant, naturally increases the weight of the measurement update step around stoichiometry, whereas it is decreased substantially, where some sensor inac- curacies might occur.
Identification: State-Space Augmentation
Parameter identification with an extended Kalman filter can be implemented by replacing the estimated parameters by additional state variables. This is permitted, because the filter is not limited to linear state-space models.
The discrete form of the state-space model (5.31) is augmented with the following equation:
SCk+1=SCk+wSC,k (5.45)
wSC,k denotes a zero-mean scalar white noise process.SCis kept constant in the extrapolation step and is only adjusted in the measurement update step.Q andPhave to be augmented accordingly. Notice thatSChas been assumed to be identical for all cells.
Figure5.14shows a sketch of the realised extended Kalman filter in signal flow form. Notice that two different state vectors are used in the extrapola- tion and correction steps. As has been pointed out above, the temperatures are only calculated in the extrapolation step and then handled as model parameters.
Hence, the two state vectorsxKF andxT empconsist of the following elements:
xKF =
θO,1
θCO,1
θO,2
θCO,2
θO,3
θCO,3
SC
, xT emp=
Ts,1
Ts,2
Ts,3
P
z-1
z-1
S
S
S
P
- +
+ +
+ - zk
zk
^ h x ,u(k k-1)
^
f x ,u(k-1 k-1)
^ x^ -k xk,KF
xk,KF ^
^ -
xk,Temp
^ -
-
Kk
Mh MxKF
(x ,uk k-1)
^ -
xk-1
^
Pk-1
Pk
- Q
R uk-1
Pk
FkPk-1FkT+Qk
P H (H P H +R)k k kk k - -1
T T
-
Hk
Correction (Measurement Update) Extrapolation
(Time Update)
Figure 5.14: Sketch of the realised extended Kalman filter.
In the extrapolation step, both vectors are calculated in combination. In the correction step, onlyxKF is updated.
Observability and Excitation
A very important prerequisite for the proper operation of an extended Kalman filter is the observability of the state-space model. For a nonlinear system, the global observability can be defined as follows [12]:
Definition 5.1 The nonlinear systemx˙ =f(x,u),x(0) = x0,y =h(x,u), wherex ∈Dx ⊆ Rn,u∈ Du ⊆ Rm,y ∈ Rq is globally observable if all initial statesx0can be determined uniquely fromy(t)andu(t)in the entire domainx0∈Dx,∀u∈Du.
Less strict are the local and the operating point observabilities:
Definition 5.2 The nonlinear systemx˙ =f(x,u),x(0) = x0,y =h(x,u), wherex ∈ Dx ⊆ Rn,u ∈ Du ⊆ Rm,y ∈ Rq is locally observable in a pointxpif all initial statesx0in the neighbourhoodkx0−xpk< ρofxpcan
be determined uniquely fromy(t)andu(t)in the entire domain∀xp ∈ Dx,
∀u∈Du.
The system is observable in the operating pointxs, if all initial statesx0in the neighbourhood(kx0−xsk< ǫx,ku−usk < ǫu)of the steady-state operat- ing pointxs,uswithf(xs,us) =0can be determined uniquely fromy(t)and u(t).
Notice that all three types are identical for linear systems. The determination of the global observability is difficult and awkward. Procedures concerning this task have been proposed in [12]. The determination of the operating point ob- servability is much easier and can be performed using the tools from the linear theory, see [32]. However, care should be taken, since the eigenvalues of the system do not remain constant when the operating point is changing. Since the system focused on here is “well-tempered”, a more intuitive approach is taken to demonstrate the operability of the observer. “Well-tempered” means that the system is inherently stable. For exact definitions and concepts regarding stability, refer to [92]. To determine BIBO (bounded-input/bounded-output) stability, no mathematical analysis is required. Notice that the occupancies are physically limited. They cannot become negative and their sum cannot exceed 1. The temperature can never decrease below the ambient temperature. The heat production is dependent on the occupancies and therefore cannot increase indefinitely. Thus, all state variables remain bounded. Actually, the linearised system is asymptotically stable in any steady-state operating point.
For an intuitive approach to the observability of the TWC model, an equiva- lent system shall be derived, which is somewhat easier to understand. Consider three tanks in a row, which are filled with water. Each tank leaks water to the next tank, dependent on the water level. The size and geometry of the tanks as well as the correlation of the storage levels and the leakage are known. It is intuitively obvious that the levels of the three tanks can be determined, if the amount of water leaving the last tank is known. If oil is added to the water, and if the oil/water ratio is measured at the outlet, both the water and oil levels of each tank can be determined. This corresponds roughly to the oxygen and carbon monoxide storage levels in the three different cells. Notice that this is only the case because the concentrations of O2, CO, and H2are calculated stat- ically from the occupancies in the cells and the concentrations of the preceding cells. These considerations shall suffice to demonstrate the observability of the model. For future work, a more profound analysis is certainly recommended.
To guarantee convergence of the Kalman filter states to the “true” values, the model should be excited accordingly. The prerequisite of persistent excitation is described in [60] or [94]. Here, it shall be explained with a simple example for the reader who is not familiar with the concepts of parameter identification.
Consider a volume with entering and leaving mass flows. For example the intake manifold of an engine can be considered as such a volume. An identifi- cation algorithm shall now be developed, where the volume of the manifold is to be estimated. It is intuitively clear that under steady-state conditions, i. e., as long as the input and output mass flows are identical and constant, the volume cannot be determined. Only when at least one of the mass flows are excited, the volume can be determined from the relation of the two mass flows. This is a fundamentally valid, physically founded problem, independent of the identi- fication algorithm. Hence, a system, where the input-output relation cannot be determined by steady-state considerations, has to be excited accordingly.
In the present model, the storage capacity can theoretically be determined from steady-state considerations, since the reaction rates and thus both the heat production and the tailpipe concentrations are dependent onSC. Even if this input-output link is too weak, excitation is not a problem, since the distur- bances of the air-to-fuel ratioλat the TWC inlet and the usually considerable transients of the exhaust gas mass flow are sufficient in most cases. On a high- way, however, where driving may be constant during longer periods (which is not expected in central Europe considering the topography and the general traffic situation), these excitations can become very weak. Here, the steady- state input-output relation includingSChas at least a stabilising effect in the sense that the identification process does not diverge. Concepts, where λis permanently excited, i. e., where the so called “wobbling” is applied [97], are favourable, because they provide excellent excitation, which guarantees con- vergence within a few seconds. The concept presented in this thesis does not make use of any extraλexcitation.
Aspects of the Numerics
The extended Kalman filter presented here has been tested with a sample rate of 1 kHz. With this rate, no major numerical problems occurred. The state vector in the extrapolation step was calculated using an Euler forward scheme.
The Jacobians Fand H were calculated numerically. For the fundamental matrix Φ, the approximation from the Taylor series according to (5.37) was used. Hence, for every step, which might be numerically delicate, the simplest method provided stable and accurate results. This was possible for two reasons.
First, the sample rate was about one order of magnitude higher as compared to what can be expected in a present production-type control unit. Second, with the steady-state implementation of the mass balances, the inherent stiffness of the system could be eliminated. If slower sampling rates are a premise and/or if for some reasons, the model is extended to dynamical mass balance equations, measures can be taken, which are described in the following. As a rule of
thumb, it can be generally stated that an improvement of the accuracy is more effective when applied in the extrapolation step [102].
The Jacobians ofFandHcan alternatively be calculated analytically. This is a somewhat awkward task, but certainly improves the accuracy and most probably reduces the consumption of CPU power.
The fundamental matrixΦ can alternatively be calculated using the bilin- ear approximation according to (5.38). This involves a matrix inversion of the dimension of the state vector in the correction step. Here, this vector has dimension 7. Notice that the Gauss algorithm provides numerically more sta- ble results than the LU decomposition, see [83], especially when the matrix is badly conditioned. Unfortunately, this is often the case, when stiff systems are linearised.
Instead of the Euler forward scheme, a semi-implicit Euler scheme can be ap- plied for the integration of the nonlinear state-space system in the extrapolation step. This scheme can be derived from the implicit Euler backward integration.
It is usually almost as stable as implicit schemes and therefore very suitable for stiff systems. Here, only a short derivation shall be given, details can be found in [83].
Consider an ordinary differential equation inx. If the time step size hs
is assumed, the integration with the implicit Euler backward scheme can be expressed as follows:
xk+1=xk+hs·f(xk+1) (5.46) This is a nonlinear equation system forxk+1. Such a system can be solved using an iterative method, which is not suitable for a real-time control system.
Therefore, a linearised Ansatz forf(xk+1)following Newton is applied:
f(xk+1)≈f(xk) + ∂f
∂x
¯
¯
¯
¯x
k
(xk+1−xk) (5.47) Solving forxk+1, leads to
xk+1=xk+hs
à I−hs
∂f
∂x
¯
¯
¯
¯x
k
!−1
·f(xk) (5.48) This solution can be explicitly calculated, i. e., no iterative method is neces- sary. However, a matrix inversion is required, which leads to a significantly increased consumption of CPU power, as compared to the Euler forward inte- gration scheme.
λSensor Offset
Both the wide-range and the switch-type λsensor signals may be subject to offsets. As for the switch-typeλsensor, this is a problem, when the position of the switch is shifted. It is assumed that the position remains sufficiently stable, as long as the sensor is used downstream of the TWC. The influence of the sensor ageing has not been investigated in this thesis. This is certainly recommended for future work.
The wide-range λ sensor may exhibit a considerable offset, as has been shown in Chapter 4. This offset leads to a different estimated oxygen stor- age level as compared to the one calculated from an accurate sensor signal.
The erroneous oxygen storage level in turn leads to a modified voltage output of the estimated switch-typeλsensor signal.
The extended Kalman filter forces the estimated and the measured switch- typeλsensor signals to converge to the same value. This can only be achieved by a modification of the estimated oxygen storage levels. If the estimated oxy- gen storage level is controlled to a constant value, a steady-state offset of the control signalλis necessary to compensate for the sensor offset. This compen- sation can only be achieved by an I-controller. Thus, it can be concluded that if an I-controller is used, its steady-state output provides a signal which is pro- portional to the sensor offset at the inlet of the TWC. Hence, the controller can be used for the diagnosis of the wide-rangeλsensor at the inlet of the TWC.
This will be demonstrated in the next chapter.
Basically, the sensor offset could also be estimated directly with the filter by identification. Tests have shown that the tuning of the filter then becomes very delicate since the sensor offset and the storage capacity are not entirely inde- pendent. The separation of the sensor error and the storage capacity estimations has been found to be more robust with the proposed method.