**The Error Covariance Matrix Inflation in Ensemble Kalman Filter** The Error Covariance Matrix Inflation in Ensemble

DOI: 10.5772/intechopen.71960

Guocan Wu and Xiaogu Zheng

Additional information is available at the end of the chapter Guocan Wu and Xiaogu Zheng Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.71960

#### Abstract

Kalman Filter

[51] Ljung L. Asymptotic behaviour of the EKF as a parameter estimator for linear systems.

[52] Mehra R. Approaches to adaptive filtering. IEEE Transactions on Automatic Control.

[53] Myers KA, Tapley BD. Adaptive sequential estimation with unknown noise statistics.

[54] Ananthasayanam MR, Shyam MM, Naik N, Gemson RMO. A heuristic reference recursive recipe for adaptively tuning the Kalman filter statistics part-1: Formulation and

[55] Shyam MM, Naik N, Gemson RMO, Ananthasayanam MR. A heuristic reference recursive recipe for adaptively tuning the Kalman filter statistics part-2: Real data studies.

[56] Ananthasayanam MR, Suresh HS, Muralidharan MR. GUI Based Software for Teaching Parameter Estimation Technique Using MMLE. Report 2001 FM 1, Dept. of Aerospace

[57] Bavdekar VA, Deshpande AP, Patwardhan SC. Identification of process and measurement noise covariance for state and parameter estimation using extended Kalman filter.

[58] Mohamed AH, Schwarz KP. Adaptive Kalman filtering for INS/GPS. Journal of Geodesy.

[59] Maine RE and Iliff KW. Programmer's Manual for MMLE3, A General Fortran Program

for Maximum Likelihood Parameter Estimation. NASA TP-1690; 1981

IEEE Transactions on Automatic Control. 1979;24:36-50

IEEE Transactions on Automatic Control. 1976;21:520-525

simulation studies. Sadhana. 2016;41(12):1473-1490

Engineering. Bangalore: Indian Institute of Science; 2001

Journal of Process Control. 2011;21:585-601

Sadhana. 2016;41(12):1491-1507

1999;73(4):193-203

1972;17:903-908

32 Kalman Filters - Theory for Advanced Applications

The estimation accuracy of ensemble forecast errors is crucial to the assimilation results for all ensemble-based schemes. The ensemble Kalman filter (EnKF) is a widely used scheme in land surface data assimilation, without using the adjoint of a dynamical model. In EnKF, the forecast error covariance matrix is estimated as the sampling covariance matrix of the ensemble forecast states. However, past researches on EnKF have found that it can generally lead to an underestimate of the forecast error covariance matrix, due to the limited ensemble size, as well as the poor initial perturbations and model error. This can eventually result in filter divergence. Therefore, using inflation to further adjust the forecast error covariance matrix becomes increasingly important. In this chapter, a new structure of the forecast error covariance matrix is proposed to mitigate the problems with limited ensemble size and model error. An adaptive procedure equipped with a second-order least squares method is applied to estimate the inflation factors of forecast and observational error covariance matrices. The proposed method is tested on the well-known atmosphere-like Lorenz-96 model with spatially correlated observational systems. The experiment results show that the new structure of the forecast error covariance matrix and the adaptive estimation procedure lead to improvement of the analysis states.

Keywords: data assimilation, ensemble Kalman filter, error covariance inflation, observation-minus-forecast residual, least squares

### 1. Introduction

For state variables in geophysical research fields, a common assumption is that systems have "true" underlying states. Data assimilation is a powerful mechanism for estimating the true trajectory based on the effective combination of a dynamic forecast system (such as a numerical

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

model) and observations [1]. It can produce an optimal combination of model outputs and observations [2]. The combined result is called analysis state, which should be closer to the true state than either the model forecast or the observation is. In fact, the analysis state can generally be treated as the weighted average of the model forecasts and observations, while the weights are approximately proportional to the inverse of the corresponding covariance matrices [3]. Therefore, the results of any data assimilation depend crucially on the estimation accuracy of the forecast and observational error covariance matrices [4]. If these matrices are estimated correctly, then the analysis states can be generated by minimizing an objective function which is technically straightforward and can be accomplished using existing engineering solutions [5], although finding the appropriate analysis state is still a quite difficult problem when the models are nonlinear [6, 7].

parameter by minimizing the predictive data errors with rotation invariant in a least squares

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

35

In practice, the observational error covariance matrix may also need to be adjusted, and an approach can be used to simultaneously optimize inflation factors of both forecast and observational error covariance matrices [21]. This approach is based on the optimization of the likelihood function of observation-minus-forecast residual. However, the likelihood function of observation-minus-forecast residual is nonlinear and involves the computationally expensive determinant and inverse of the residual covariance matrix. As compensation, the secondorder least squares statistic of the squared observation-minus-forecast residual can be used as the cost function instead. The main advantage of the SLS cost function is that it is a quadratic function of the inflation factors, and therefore, the analytic forms of the estimators of the inflation factors can be easily obtained. Compared with the method based on maximum

Furthermore, unlike the sampling covariance matrix of the ensemble forecast states used in the conventional EnKF, a new structure of the forecast error covariance matrix is proposed in this chapter. In ideal situation, an ensemble forecast state is assumed as a random vector with the true state as its ensemble mean. Hence, it is should be defined that the ensemble forecast error is the ensemble forecast states minus true state rather than minus their ensemble mean [34]. This is because in a forecast model with large error and limited ensemble size, the ensemble mean of the forecast states can be very far from the true state. Therefore, the sampling covariance matrix of the ensemble forecast states can be very different from the true forecast error covariance matrix. As a result, the estimated analysis state can be substantially inaccurate. However, in reality, the true state is unknown, but the analysis state is a better estimate of the true state than the forecast state. Therefore, the information feedback from the analysis state can be used to revise the forecast error covariance matrix. In fact, the proposed forecast error covariance matrix is a combination of multiplicative and additive inflation. Bai and Li [14] also used the feedback from the analysis state to improve assimilation but in a different way.

This chapter consists of four sections. The EnKF scheme with a new structure of the forecast error covariance matrix and the adaptive estimation procedure is proposed in Section 2. The assimilation results on Lorenz model with a correlated observational system are presented in

Using the uniform notations for consistency, a nonlinear discrete-time forecast and linear obser-

i�1 <sup>þ</sup> <sup>η</sup><sup>i</sup>

, (1)

<sup>i</sup> þ εi, (2)

<sup>i</sup> <sup>¼</sup> Mi�<sup>1</sup> <sup>x</sup><sup>a</sup>

yo <sup>i</sup> <sup>¼</sup> <sup>H</sup>ix<sup>t</sup>

xt

Section 3. Conclusions and discussion are given in Section 4.

2. Methodology

2.1. EnKF with SLS inflation scheme

vational system is written as [35]

likelihood estimation method, the computational cost is significantly reduced.

solution [33].

The ensemble Kalman filter (EnKF) is a widely used sequential data assimilation approach, which has been studied and applied since it is proposed by Evensen [8]. It is a practical ensemble-based assimilation scheme that estimates the forecast error covariance matrix using a Monte Carlo method with the short-term ensemble forecast states [9]. In EnKF, the forecast error covariance matrix is estimated as the sampling covariance matrix of the ensemble forecast states, which is usually underestimated due to the limited ensemble size and model error [10]. This finding indicates that the filter is over reliant on the model forecasts and excludes the observations. It may eventually lead to the divergence of the EnKF assimilation scheme [11, 12].

Therefore, the forecast error covariance inflation technique to address this problem becomes increasingly important. One of the error covariance matrix inflation techniques is additive inflation, in which a noise is added to the ensemble forecast states that sample the probability distribution of model error [13, 14]. Another widely used error covariance matrix inflation technique is multiplicative inflation, that is, to multiply the matrix by an appropriate factor. It can be used to mitigate filter divergence by inflating the empirical covariance and increasing the robustness of the filter [15].

In early studies of multiplicative inflation, researchers determine the inflation factor by repeated experimentation and choose a value according to their prior knowledge [11]. Hence, such experimental tuning is rather empirical and subjective. It is not appropriate to use the same inflation factor during all the assimilation procedure. Too small or too large an inflation factor will cause the analysis state to over rely on the model forecasts or observations and can seriously undermine the accuracy and stability of the filter. In later studies, the inflation factor is estimated online based on the observation-minus-forecast residual (innovation statistic) [16, 17] with different conditions.

Past work shows that moment estimation can facilitate the calculation by solving an equation of the observation-minus-forecast residual and its realization [18–20]. Maximum likelihood approach can obtain a better estimate of the inflation factor than moment approach, although it must calculate a high-dimensional matrix determinant [21–24]. Bayesian approach assumes a prior distribution for the inflation factor but is limited by spatially independent observational errors [25, 26]. Second-order least square estimation focus on minimizing the second-order least squares (SLS) [27] statistic of the squared observation-minus-forecast residual, which is not very expensive [28–30]. Generalized Cross Validation (GCV) [31, 32] can select a regularization parameter by minimizing the predictive data errors with rotation invariant in a least squares solution [33].

In practice, the observational error covariance matrix may also need to be adjusted, and an approach can be used to simultaneously optimize inflation factors of both forecast and observational error covariance matrices [21]. This approach is based on the optimization of the likelihood function of observation-minus-forecast residual. However, the likelihood function of observation-minus-forecast residual is nonlinear and involves the computationally expensive determinant and inverse of the residual covariance matrix. As compensation, the secondorder least squares statistic of the squared observation-minus-forecast residual can be used as the cost function instead. The main advantage of the SLS cost function is that it is a quadratic function of the inflation factors, and therefore, the analytic forms of the estimators of the inflation factors can be easily obtained. Compared with the method based on maximum likelihood estimation method, the computational cost is significantly reduced.

Furthermore, unlike the sampling covariance matrix of the ensemble forecast states used in the conventional EnKF, a new structure of the forecast error covariance matrix is proposed in this chapter. In ideal situation, an ensemble forecast state is assumed as a random vector with the true state as its ensemble mean. Hence, it is should be defined that the ensemble forecast error is the ensemble forecast states minus true state rather than minus their ensemble mean [34]. This is because in a forecast model with large error and limited ensemble size, the ensemble mean of the forecast states can be very far from the true state. Therefore, the sampling covariance matrix of the ensemble forecast states can be very different from the true forecast error covariance matrix. As a result, the estimated analysis state can be substantially inaccurate. However, in reality, the true state is unknown, but the analysis state is a better estimate of the true state than the forecast state. Therefore, the information feedback from the analysis state can be used to revise the forecast error covariance matrix. In fact, the proposed forecast error covariance matrix is a combination of multiplicative and additive inflation. Bai and Li [14] also used the feedback from the analysis state to improve assimilation but in a different way.

This chapter consists of four sections. The EnKF scheme with a new structure of the forecast error covariance matrix and the adaptive estimation procedure is proposed in Section 2. The assimilation results on Lorenz model with a correlated observational system are presented in Section 3. Conclusions and discussion are given in Section 4.

### 2. Methodology

model) and observations [1]. It can produce an optimal combination of model outputs and observations [2]. The combined result is called analysis state, which should be closer to the true state than either the model forecast or the observation is. In fact, the analysis state can generally be treated as the weighted average of the model forecasts and observations, while the weights are approximately proportional to the inverse of the corresponding covariance matrices [3]. Therefore, the results of any data assimilation depend crucially on the estimation accuracy of the forecast and observational error covariance matrices [4]. If these matrices are estimated correctly, then the analysis states can be generated by minimizing an objective function which is technically straightforward and can be accomplished using existing engineering solutions [5], although finding the appropriate analysis state is still a quite difficult

The ensemble Kalman filter (EnKF) is a widely used sequential data assimilation approach, which has been studied and applied since it is proposed by Evensen [8]. It is a practical ensemble-based assimilation scheme that estimates the forecast error covariance matrix using a Monte Carlo method with the short-term ensemble forecast states [9]. In EnKF, the forecast error covariance matrix is estimated as the sampling covariance matrix of the ensemble forecast states, which is usually underestimated due to the limited ensemble size and model error [10]. This finding indicates that the filter is over reliant on the model forecasts and excludes the observations. It may eventually lead to the divergence of the EnKF assimilation scheme [11, 12]. Therefore, the forecast error covariance inflation technique to address this problem becomes increasingly important. One of the error covariance matrix inflation techniques is additive inflation, in which a noise is added to the ensemble forecast states that sample the probability distribution of model error [13, 14]. Another widely used error covariance matrix inflation technique is multiplicative inflation, that is, to multiply the matrix by an appropriate factor. It can be used to mitigate filter divergence by inflating the empirical covariance and increasing

In early studies of multiplicative inflation, researchers determine the inflation factor by repeated experimentation and choose a value according to their prior knowledge [11]. Hence, such experimental tuning is rather empirical and subjective. It is not appropriate to use the same inflation factor during all the assimilation procedure. Too small or too large an inflation factor will cause the analysis state to over rely on the model forecasts or observations and can seriously undermine the accuracy and stability of the filter. In later studies, the inflation factor is estimated online based on the observation-minus-forecast residual (innovation statistic) [16, 17]

Past work shows that moment estimation can facilitate the calculation by solving an equation of the observation-minus-forecast residual and its realization [18–20]. Maximum likelihood approach can obtain a better estimate of the inflation factor than moment approach, although it must calculate a high-dimensional matrix determinant [21–24]. Bayesian approach assumes a prior distribution for the inflation factor but is limited by spatially independent observational errors [25, 26]. Second-order least square estimation focus on minimizing the second-order least squares (SLS) [27] statistic of the squared observation-minus-forecast residual, which is not very expensive [28–30]. Generalized Cross Validation (GCV) [31, 32] can select a regularization

problem when the models are nonlinear [6, 7].

34 Kalman Filters - Theory for Advanced Applications

the robustness of the filter [15].

with different conditions.

#### 2.1. EnKF with SLS inflation scheme

Using the uniform notations for consistency, a nonlinear discrete-time forecast and linear observational system is written as [35]

$$\mathbf{x}\_{i}^{\mathbf{t}} = M\_{i-1} \left( \mathbf{x}\_{i-1}^{\mathbf{a}} \right) + \eta\_{i\prime} \tag{1}$$

$$\mathbf{y}\_i^\diamond = \mathbf{H}\_i \mathbf{x}\_i^\dagger + \mathbf{c}\_{i\prime} \tag{2}$$

where i is the time index; x<sup>t</sup> <sup>i</sup> <sup>¼</sup> <sup>x</sup><sup>t</sup> i ð Þ<sup>1</sup> ; <sup>x</sup><sup>t</sup> i ð Þ<sup>2</sup> ;…; xt i ð Þ <sup>n</sup> � �<sup>T</sup> is the <sup>n</sup>-dimensional true state vector at time step i; x<sup>a</sup> <sup>i</sup>�<sup>1</sup> <sup>¼</sup> <sup>x</sup><sup>a</sup> <sup>i</sup>�<sup>1</sup>ð Þ<sup>1</sup> ; <sup>x</sup><sup>a</sup> <sup>i</sup>�<sup>1</sup>ð Þ<sup>2</sup> ;…; <sup>x</sup><sup>a</sup> <sup>i</sup>�<sup>1</sup>ð Þ <sup>n</sup> � �<sup>T</sup> is the <sup>n</sup>-dimensional analysis state vector which is an estimate of x<sup>t</sup> <sup>i</sup>�<sup>1</sup>, Mi�<sup>1</sup> is a nonlinear forecast operator such as a weather forecast model; <sup>y</sup><sup>o</sup> <sup>i</sup> is an observational vector with dimension pi ; H<sup>i</sup> is an observational matrix of dimension pi � n that maps model states to the observational space; η<sup>i</sup> and ε<sup>i</sup> are the forecast error vector and the observational error vector respectively, which are assumed to be statistically independent of each other, time-uncorrelated, and have mean zero and covariance matrices P<sup>i</sup> and Ri, respectively. The goal of the EnKF assimilation is to find a series of analysis states x<sup>a</sup> <sup>i</sup> that are sufficiently close to the corresponding true states x<sup>t</sup> i , using the information provided by Mi and y<sup>o</sup> i .

It is well-known that any EnKF assimilation scheme should include a forecast error inflation scheme. Otherwise, the EnKF may diverge [11]. A procedure for estimating multiplicative inflation factor of P<sup>i</sup> and adjustment factor of R<sup>i</sup> can be carried out based on the SLS principle. The basic filter algorithm uses perturbed observations [9], but without localization [36]. The estimation steps of this algorithm equipped with SLS inflation are as follows.

Step 1. Calculate the perturbed forecast states

$$\mathbf{x}\_{i,j}^{\mathbf{f}} = M\_{i-1} \left( \mathbf{x}\_{i-1,j}^{\mathbf{a}} \right) \tag{3}$$

λb<sup>i</sup> ¼

Tr <sup>H</sup>iPbiH<sup>T</sup>

Step 3. Compute the perturbed analysis states.

xa i,j <sup>¼</sup> <sup>x</sup><sup>f</sup>

where ε<sup>0</sup>

xa i,j

<sup>H</sup>iλbiPbiH<sup>T</sup>

estimate of x<sup>t</sup>

i,j � <sup>x</sup><sup>f</sup>

estimate of x<sup>t</sup>

as x<sup>f</sup>

xf i,j � <sup>x</sup><sup>f</sup> <sup>i</sup> <sup>þ</sup> <sup>μ</sup>b<sup>i</sup> Ri

� ��<sup>1</sup>

<sup>μ</sup>b<sup>i</sup> <sup>¼</sup>

Tr d<sup>T</sup>

<sup>i</sup> <sup>H</sup>iPbiH<sup>T</sup> <sup>i</sup> d<sup>i</sup> � �Tr <sup>R</sup><sup>2</sup>

Tr <sup>H</sup>iPbiH<sup>T</sup>

<sup>i</sup> <sup>H</sup>iPbiH<sup>T</sup> i � �Tr <sup>d</sup><sup>T</sup>

Tr <sup>H</sup>iPbiH<sup>T</sup>

this procedure does not use Bayesian approach [20, 25, 26].

i,j <sup>þ</sup> <sup>λ</sup>biPbiH<sup>T</sup>

formula [21, 37, 38]. Furthermore, the analysis state x<sup>a</sup>

By Eqs. (1) and (3), the ensemble forecast error is defined as x<sup>f</sup>

However, due to limited sample size and model error, x<sup>f</sup>

error. The basic sense is as follows: After the analysis state x<sup>a</sup>

and adjust initial observational error covariance matrix to <sup>0</sup>μb<sup>i</sup>

Step 2b. Update the forecast error covariance matrix as

<sup>i</sup> than the forecast state x<sup>f</sup>

<sup>i</sup> can be a biased estimate of x<sup>f</sup>

to estimate the initial analysis state <sup>0</sup>x<sup>a</sup>

i � � � Tr <sup>d</sup><sup>T</sup>

<sup>i</sup> Rid<sup>i</sup> � � � Tr <sup>d</sup><sup>T</sup>

(See Appendix A for detailed derivation). Similar to Wang and Bishop [19] and Li et al. [18],

<sup>i</sup> <sup>þ</sup> <sup>μ</sup>b<sup>i</sup> Ri

� ��<sup>1</sup>

i,j is a normal random variable with mean zero and covariance matrix <sup>μ</sup>b<sup>i</sup>

<sup>i</sup> <sup>H</sup>iPbiH<sup>T</sup> i � �Tr <sup>R</sup><sup>2</sup>

<sup>i</sup> <sup>H</sup>iPbiH<sup>T</sup> i � �Tr <sup>R</sup><sup>2</sup>

<sup>i</sup> <sup>H</sup>iλbiPbiH<sup>T</sup>

. Finally, set i ¼ i þ 1 and return to Step 1 for the assimilation at next time step.

2.2. EnKF with SLS inflation and new structure of forecast error covariance matrix

i,j � <sup>x</sup><sup>t</sup> i .

details, Step 2 in Section 2.1 is modified to the following adaptive procedure:

<sup>i</sup> Rid<sup>i</sup>

� � � Tr <sup>H</sup>iPbiH<sup>T</sup>

<sup>i</sup> HiPiH<sup>T</sup> <sup>i</sup> d<sup>i</sup> � �Tr <sup>H</sup>iPbiH<sup>T</sup>

> yo <sup>i</sup> þ ε<sup>0</sup>

can be effectively computed using the Sherman-Morrison-Woodbury

<sup>i</sup> without knowing observations. The ensemble forecast error is initially estimated

<sup>i</sup> , which is used to construct the forecast error covariance matrix in Section 2.1.

Here, the observations can be used for improving the estimation accuracy of ensemble forecast

generating a revised forecast error covariance matrix. This procedure can be repeated iteratively until the corresponding objective function (Eq. (5)) converges. For the computational

Step 2a. Use Step 2 in Section 2.1 to inflate the initial forecast error covariance matrix to <sup>0</sup>λb<sup>i</sup> <sup>0</sup>Pb<sup>i</sup>

<sup>i</sup> and set k = 1.

<sup>i</sup> . Therefore, x<sup>f</sup>

i,j � <sup>x</sup><sup>t</sup> i

� � � Tr <sup>H</sup>iPbiH<sup>T</sup>

i

i

� �Tr <sup>H</sup>iPbiH<sup>T</sup>

<sup>i</sup> R<sup>i</sup> � �

� �<sup>2</sup> , (6)

http://dx.doi.org/10.5772/intechopen.71960

37

<sup>i</sup> R<sup>i</sup> � �

R<sup>i</sup> [9]. Here

<sup>i</sup> is an

<sup>i</sup> for

. Therefore,

� �<sup>2</sup> : (7)

<sup>i</sup> R<sup>i</sup>

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

<sup>i</sup> R<sup>i</sup>

i,j � <sup>H</sup>ix<sup>f</sup> i � �, (8)

<sup>i</sup> is estimated as the ensemble mean of

<sup>i</sup> can be far from x<sup>t</sup>

<sup>i</sup> in Eq. (4) is substituted by x<sup>a</sup>

. On the other hand, x<sup>f</sup>

<sup>i</sup> is derived, it should be a better

Ri. Then use Step 3 in Section 2.1

i

where x<sup>a</sup> <sup>i</sup>�1,j is the perturbed analysis states derived from the previous time step (1 <sup>≤</sup> <sup>j</sup> <sup>≤</sup> <sup>m</sup> and <sup>m</sup> is the ensemble size).

Step 2. Estimate the improved forecast and observational error covariance matrices.

The forecast state x<sup>f</sup> <sup>i</sup> is defined as the ensemble mean of x<sup>f</sup> i,j and the initial forecast error covariance matrix is expressed as

$$\widehat{\mathbf{P}}\_{i} = \frac{1}{m-1} \sum\_{j=1}^{m} \left( \mathbf{x}\_{i,j}^{\mathbf{f}} - \mathbf{x}\_{i}^{\mathbf{f}} \right) \cdot \left( \mathbf{x}\_{i,j}^{\mathbf{f}} - \mathbf{x}\_{i}^{\mathbf{f}} \right)^{\mathrm{T}},\tag{4}$$

and the initial observational error covariance matrix is Ri. Then, the adjusted forms of forecast and observational error covariance matrices are λiPb<sup>i</sup> and μ<sup>i</sup> Ri, respectively.

There are several approaches for estimating the inflation factors λ<sup>i</sup> and μ<sup>i</sup> . Wang and Bishop [19], Li et al. [18], and Miyoshi [20] use the first-order least square of the squared observationminus-forecast residual <sup>d</sup><sup>i</sup> � <sup>y</sup><sup>o</sup> <sup>i</sup> � <sup>H</sup>ix<sup>f</sup> <sup>i</sup> to estimate λi; Liang et al. [21] maximizes the likelihood of d<sup>i</sup> to estimate λ<sup>i</sup> and μ<sup>i</sup> . Here, the SLS approach is applied for estimating λ<sup>i</sup> and μ<sup>i</sup> . That is, λ<sup>i</sup> and μ<sup>i</sup> are estimated by minimizing the objective function

$$L\_i(\lambda, \mu) = \text{Tr}\left[\left(\mathbf{d}\_i \mathbf{d}\_i^T - \lambda \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T - \mu \mathbf{R}\_i\right) \left(\mathbf{d}\_i \mathbf{d}\_i^T - \lambda \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T - \mu \mathbf{R}\_i\right)^T\right].\tag{5}$$

This leads to

The Error Covariance Matrix Inflation in Ensemble Kalman Filter http://dx.doi.org/10.5772/intechopen.71960 37

$$\widehat{\lambda\_{i}} = \frac{\operatorname{Tr}\left(\mathbf{d}\_{i}^{\mathrm{T}} \mathbf{H}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{\mathrm{T}} \mathbf{d}\_{i}\right) \operatorname{Tr}\left(\mathbf{R}\_{i}^{2}\right) - \operatorname{Tr}\left(\mathbf{d}\_{i}^{\mathrm{T}} \mathbf{R}\_{i} \mathbf{d}\_{i}\right) \operatorname{Tr}\left(\mathbf{H}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{\mathrm{T}} \mathbf{R}\_{i}\right)}{\operatorname{Tr}\left(\mathbf{H}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{\mathrm{T}} \mathbf{H}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{\mathrm{T}}\right) \operatorname{Tr}\left(\mathbf{R}\_{i}^{2}\right) - \operatorname{Tr}\left(\mathbf{H}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{\mathrm{T}} \mathbf{R}\_{i}\right)^{2}},\tag{6}$$

$$\hat{\mu}\_{i} = \frac{\text{Tr}\left(\mathbf{H}\_{i}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{H}\_{i}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\right)\text{Tr}\left(\mathbf{d}\_{i}^{\text{T}}\mathbf{R}\_{i}\mathbf{d}\_{i}\right) - \text{Tr}\left(\mathbf{d}\_{i}^{\text{T}}\mathbf{H}\_{i}\mathbf{P}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{d}\_{i}\right)\text{Tr}\left(\mathbf{H}\_{i}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{R}\_{i}\right)}{\text{Tr}\left(\mathbf{H}\_{i}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{H}\_{i}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\right)\text{Tr}\left(\mathbf{R}\_{i}^{2}\right) - \text{Tr}\left(\mathbf{H}\_{i}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{R}\_{i}\right)^{2}}.\tag{7}$$

(See Appendix A for detailed derivation). Similar to Wang and Bishop [19] and Li et al. [18], this procedure does not use Bayesian approach [20, 25, 26].

Step 3. Compute the perturbed analysis states.

where i is the time index; x<sup>t</sup>

<sup>i</sup>�<sup>1</sup> <sup>¼</sup> <sup>x</sup><sup>a</sup>

36 Kalman Filters - Theory for Advanced Applications

to the corresponding true states x<sup>t</sup>

an observational vector with dimension pi

Step 1. Calculate the perturbed forecast states

time step i; x<sup>a</sup>

where x<sup>a</sup>

is the ensemble size).

The forecast state x<sup>f</sup>

covariance matrix is expressed as

minus-forecast residual <sup>d</sup><sup>i</sup> � <sup>y</sup><sup>o</sup>

of d<sup>i</sup> to estimate λ<sup>i</sup> and μ<sup>i</sup>

This leads to

is an estimate of x<sup>t</sup>

<sup>i</sup> <sup>¼</sup> <sup>x</sup><sup>t</sup> i ð Þ<sup>1</sup> ; <sup>x</sup><sup>t</sup> i

<sup>i</sup>�<sup>1</sup>ð Þ<sup>2</sup> ;…; <sup>x</sup><sup>a</sup>

The goal of the EnKF assimilation is to find a series of analysis states x<sup>a</sup>

estimation steps of this algorithm equipped with SLS inflation are as follows.

xf

i

<sup>i</sup>�<sup>1</sup>ð Þ<sup>1</sup> ; <sup>x</sup><sup>a</sup>

ð Þ<sup>2</sup> ;…; xt i

maps model states to the observational space; η<sup>i</sup> and ε<sup>i</sup> are the forecast error vector and the observational error vector respectively, which are assumed to be statistically independent of each other, time-uncorrelated, and have mean zero and covariance matrices P<sup>i</sup> and Ri, respectively.

It is well-known that any EnKF assimilation scheme should include a forecast error inflation scheme. Otherwise, the EnKF may diverge [11]. A procedure for estimating multiplicative inflation factor of P<sup>i</sup> and adjustment factor of R<sup>i</sup> can be carried out based on the SLS principle. The basic filter algorithm uses perturbed observations [9], but without localization [36]. The

i,j <sup>¼</sup> Mi�<sup>1</sup> <sup>x</sup><sup>a</sup>

Step 2. Estimate the improved forecast and observational error covariance matrices.

<sup>i</sup> is defined as the ensemble mean of x<sup>f</sup>

Xm j¼1

There are several approaches for estimating the inflation factors λ<sup>i</sup> and μ<sup>i</sup>

<sup>i</sup> � λHiPb<sup>i</sup>

� �

H<sup>T</sup> <sup>i</sup> � μR<sup>i</sup>

<sup>i</sup> � <sup>H</sup>ix<sup>f</sup>

xf i,j � <sup>x</sup><sup>f</sup> i � �

and the initial observational error covariance matrix is Ri. Then, the adjusted forms of forecast

[19], Li et al. [18], and Miyoshi [20] use the first-order least square of the squared observation-

<sup>P</sup>b<sup>i</sup> <sup>¼</sup> <sup>1</sup> m � 1

and observational error covariance matrices are λiPb<sup>i</sup> and μ<sup>i</sup>

λ<sup>i</sup> and μ<sup>i</sup> are estimated by minimizing the objective function

Li <sup>λ</sup>; <sup>μ</sup> � � <sup>¼</sup> Tr <sup>d</sup>id<sup>T</sup>

i�1,j � �

> � <sup>x</sup><sup>f</sup> i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

. Here, the SLS approach is applied for estimating λ<sup>i</sup> and μ<sup>i</sup>

did<sup>T</sup>

� �<sup>T</sup> � �

<sup>i</sup> � λHiPb<sup>i</sup>

Ri, respectively.

<sup>i</sup> to estimate λi; Liang et al. [21] maximizes the likelihood

H<sup>T</sup> <sup>i</sup> � μR<sup>i</sup>

<sup>i</sup>�1,j is the perturbed analysis states derived from the previous time step (1 <sup>≤</sup> <sup>j</sup> <sup>≤</sup> <sup>m</sup> and <sup>m</sup>

ð Þ <sup>n</sup> � �<sup>T</sup> is the <sup>n</sup>-dimensional true state vector at

; H<sup>i</sup> is an observational matrix of dimension pi � n that

<sup>i</sup> is

<sup>i</sup> that are sufficiently close

i .

, (3)

i,j and the initial forecast error

, (4)

. Wang and Bishop

. That is,

: (5)

<sup>i</sup>�<sup>1</sup>ð Þ <sup>n</sup> � �<sup>T</sup> is the <sup>n</sup>-dimensional analysis state vector which

, using the information provided by Mi and y<sup>o</sup>

<sup>i</sup>�<sup>1</sup>, Mi�<sup>1</sup> is a nonlinear forecast operator such as a weather forecast model; <sup>y</sup><sup>o</sup>

$$\mathbf{x}\_{i,j}^{a} = \mathbf{x}\_{i,j}^{f} + \widehat{\lambda}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{T} \left( \mathbf{H}\_{i} \widehat{\lambda}\_{i} \widehat{\mathbf{P}}\_{i} \mathbf{H}\_{i}^{T} + \widehat{\mu}\_{i} \mathbf{R}\_{i} \right)^{-1} \left( \mathbf{y}\_{i}^{o} + \mathbf{z}\_{i,j}^{\prime} - \mathbf{H}\_{i} \mathbf{x}\_{i}^{f} \right), \tag{8}$$

where ε<sup>0</sup> i,j is a normal random variable with mean zero and covariance matrix <sup>μ</sup>b<sup>i</sup> R<sup>i</sup> [9]. Here <sup>H</sup>iλbiPbiH<sup>T</sup> <sup>i</sup> <sup>þ</sup> <sup>μ</sup>b<sup>i</sup> Ri � ��<sup>1</sup> can be effectively computed using the Sherman-Morrison-Woodbury formula [21, 37, 38]. Furthermore, the analysis state x<sup>a</sup> <sup>i</sup> is estimated as the ensemble mean of xa i,j . Finally, set i ¼ i þ 1 and return to Step 1 for the assimilation at next time step.

#### 2.2. EnKF with SLS inflation and new structure of forecast error covariance matrix

By Eqs. (1) and (3), the ensemble forecast error is defined as x<sup>f</sup> i,j � <sup>x</sup><sup>t</sup> i . On the other hand, x<sup>f</sup> <sup>i</sup> is an estimate of x<sup>t</sup> <sup>i</sup> without knowing observations. The ensemble forecast error is initially estimated as x<sup>f</sup> i,j � <sup>x</sup><sup>f</sup> <sup>i</sup> , which is used to construct the forecast error covariance matrix in Section 2.1. However, due to limited sample size and model error, x<sup>f</sup> <sup>i</sup> can be far from x<sup>t</sup> i . Therefore, xf i,j � <sup>x</sup><sup>f</sup> <sup>i</sup> can be a biased estimate of x<sup>f</sup> i,j � <sup>x</sup><sup>t</sup> i .

Here, the observations can be used for improving the estimation accuracy of ensemble forecast error. The basic sense is as follows: After the analysis state x<sup>a</sup> <sup>i</sup> is derived, it should be a better estimate of x<sup>t</sup> <sup>i</sup> than the forecast state x<sup>f</sup> <sup>i</sup> . Therefore, x<sup>f</sup> <sup>i</sup> in Eq. (4) is substituted by x<sup>a</sup> <sup>i</sup> for generating a revised forecast error covariance matrix. This procedure can be repeated iteratively until the corresponding objective function (Eq. (5)) converges. For the computational details, Step 2 in Section 2.1 is modified to the following adaptive procedure:

Step 2a. Use Step 2 in Section 2.1 to inflate the initial forecast error covariance matrix to <sup>0</sup>λb<sup>i</sup> <sup>0</sup>Pb<sup>i</sup> and adjust initial observational error covariance matrix to <sup>0</sup>μb<sup>i</sup> Ri. Then use Step 3 in Section 2.1 to estimate the initial analysis state <sup>0</sup>x<sup>a</sup> <sup>i</sup> and set k = 1.

Step 2b. Update the forecast error covariance matrix as

$$\hat{\mathbf{P}}\_{i} = \frac{1}{m-1} \sum\_{j=1}^{m} \left( \mathbf{x}\_{i,j}^{\mathbf{f}} - {}\_{k-1} \mathbf{x}\_{i}^{\mathbf{a}} \right) \cdot \left( \mathbf{x}\_{i,j}^{\mathbf{f}} - {}\_{k-1} \mathbf{x}\_{i}^{\mathbf{a}} \right)^{\mathrm{T}}.\tag{9}$$

Then, adjust the forecast and observational error covariance matrices to <sup>k</sup>λbikPb<sup>i</sup> and <sup>k</sup>μb<sup>i</sup>Ri, where

$$\hat{\lambda}\_{k}\hat{\lambda}\_{i} = \frac{\text{Tr}\left(\mathbf{d}\_{i}^{\text{T}}\mathbf{H}\_{ik}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{d}\_{i}\right)\text{Tr}\left(\mathbf{R}\_{i}^{2}\right) - \text{Tr}\left(\mathbf{d}\_{i}^{\text{T}}\mathbf{R}\_{i}\mathbf{d}\_{i}\right)\text{Tr}\left(\mathbf{H}\_{ik}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{R}\_{i}\right)}{\text{Tr}\left(\mathbf{H}\_{ik}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{H}\_{ik}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\right)\text{Tr}\left(\mathbf{R}\_{i}^{2}\right) - \text{Tr}\left(\mathbf{H}\_{ik}\hat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\text{T}}\mathbf{R}\_{i}\right)^{2}},\tag{10}$$

and

$$\hat{\mu}\_{k}\hat{\mu}\_{i} = \frac{\mathrm{Tr}\left(\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\right)\mathrm{Tr}\left(\mathbf{d}\_{i}^{\mathrm{T}}\mathbf{R}\_{i}\mathbf{d}\_{i}\right) - \mathrm{Tr}\left(\mathbf{d}\_{i}^{\mathrm{T}}\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\mathbf{d}\_{i}\right)\mathrm{Tr}\left(\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\mathbf{R}\_{i}\right)}{\mathrm{Tr}\left(\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\mathbf{H}\_{i}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\right)\mathrm{Tr}\left(\mathbf{R}\_{i}^{2}\right) - \mathrm{Tr}\left(\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\mathbf{R}\_{i}\right)^{2}},\tag{11}$$

are estimated by minimizing the objective function.

$$\hat{\mathbf{L}}\_{k}L\_{i}(\lambda,\mu) = \text{Tr}\left[\left(\mathbf{d}\_{i}\mathbf{d}\_{i}^{\mathrm{T}} - \lambda\mathbf{H}\_{lk}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}} - \mu\mathbf{R}\_{i}\right)\left(\mathbf{d}\_{i}\mathbf{d}\_{i}^{\mathrm{T}} - \lambda\mathbf{H}\_{lk}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}} - \mu\mathbf{R}\_{i}\right)^{\mathrm{T}}\right].\tag{12}$$

If <sup>k</sup>L<sup>i</sup> <sup>k</sup>λb<sup>i</sup> ; <sup>k</sup>μb<sup>i</sup> � � <sup>&</sup>lt; <sup>k</sup>�<sup>1</sup>L<sup>i</sup> <sup>k</sup>�<sup>1</sup>λb<sup>i</sup> ; <sup>k</sup>�<sup>1</sup>μb<sup>i</sup> � � � <sup>δ</sup>, where <sup>δ</sup> is a pre-determined threshold to control the convergence of Eq. (12) and then estimate the k-th updated analysis state as

$$\mathbf{x}\_k \mathbf{x}\_i^a = \mathbf{x}\_i^f + {}\_k \widehat{\lambda}\_{ik} \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \left( \mathbf{H}\_{ik} \widehat{\lambda}\_{jk} \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T + {}\_k \widehat{\mu}\_{ik} \mathbf{R}\_i \right)^{-1} \left( \mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^f \right), \tag{13}$$

Lið Þ¼ <sup>λ</sup> Tr <sup>d</sup>id<sup>T</sup>

Figure 1. Flowchart of EnKF with SLS inflation scheme.

This leads to a simpler estimate

In any toy model, the "true" state x<sup>t</sup>

2.3.2. Validation statistics

ik and x<sup>t</sup>

where x<sup>a</sup>

<sup>i</sup> � λHikPb<sup>i</sup>

<sup>k</sup>λb<sup>i</sup> ¼

RMSE ¼

assimilation results. The RMSE at i-th step is defined as

H<sup>T</sup> <sup>i</sup> � R<sup>i</sup>

<sup>i</sup> � λHikPb<sup>i</sup>

� �<sup>T</sup> � �: (15)

<sup>i</sup> � R<sup>i</sup>

<sup>i</sup> <sup>H</sup>ikPbiH<sup>T</sup> i

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

ik are the k-th components of the analysis state and true state at the i-th time

xa ik � <sup>x</sup><sup>t</sup> ik � �<sup>2</sup> H<sup>T</sup> <sup>i</sup> � R<sup>i</sup>

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

39

h i : (16)

<sup>i</sup> is known by experimental design. In this case, the root-

: (17)

� � <sup>d</sup>id<sup>T</sup>

Tr HikPb<sup>i</sup>

Tr HikPb<sup>i</sup>

H<sup>T</sup> <sup>i</sup> <sup>d</sup>id<sup>T</sup>

mean-square error (RMSE) of the analysis state can be used to evaluate the accuracy of the

1 n Xn k¼1

step. In principle, a smaller RMSE indicates a better performance of the assimilation scheme.

s

H<sup>T</sup>

� � h i

set <sup>k</sup> <sup>=</sup> <sup>k</sup> + 1 and return back to Eq. (9); otherwise, take <sup>k</sup>�<sup>1</sup>λbik�<sup>1</sup>Pb<sup>i</sup> and <sup>k</sup>�<sup>1</sup>μb<sup>i</sup> R<sup>i</sup> as the estimated forecast and observational error covariance matrices at i-th time step and go to Step 3 in Section 2.1.

A general flowchart of the proposed assimilation scheme is shown in Figure 1. Moreover, the proposed forecast error covariance matrix (Eq. (9)) can be expressed as.

$${}\_{k}\\\lambda\_{ik}\\\widehat{\mathbf{P}}\_{i} = \frac{{}^{k}\\\lambda\_{i}}{m-1} \sum\_{j=1}^{m} \left(\mathbf{x}\_{i,j}^{\boldsymbol{\ell}} - \mathbf{x}\_{i}^{\boldsymbol{\ell}}\right) \left(\mathbf{x}\_{i,j}^{\boldsymbol{\ell}} - \mathbf{x}\_{i}^{\boldsymbol{\ell}}\right)^{\mathrm{T}} + \frac{{}\_{k}\\\lambda\_{i}m}{m-1} \left(\mathbf{x}\_{i}^{\boldsymbol{\ell}} - {}\_{k-1}\mathbf{x}\_{i}^{\mathbf{a}}\right) \left(\mathbf{x}\_{i}^{\boldsymbol{\ell}} - {}\_{k-1}\mathbf{x}\_{i}^{\mathbf{a}}\right)^{\mathrm{T}},\tag{14}$$

which is a multiplicatively inflated sampling error covariance matrix plus an additive inflation matrix (see Appendix B for the proof).

#### 2.3. Notes

#### 2.3.1. Correctly specified observational error covariance matrix

If the observational error covariance matrix R<sup>i</sup> is correctly known, then its adjustment is no longer required. In this case, the inflation factor <sup>k</sup>λb<sup>i</sup> can be estimated by minimizing the following objective function

Figure 1. Flowchart of EnKF with SLS inflation scheme.

$$L\_i(\lambda) = \operatorname{Tr}\left[\left(\mathbf{d}\_i \mathbf{d}\_i^T - \lambda \mathbf{H}\_{ik} \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T - \mathbf{R}\_i\right) \left(\mathbf{d}\_i \mathbf{d}\_i^T - \lambda \mathbf{H}\_{ik} \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T - \mathbf{R}\_i\right)^T\right].\tag{15}$$

This leads to a simpler estimate

$$\hat{\lambda}\_{i}\hat{\lambda}\_{i} = \frac{\mathrm{Tr}\left[\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{T}\left(\mathbf{d}\_{i}\mathbf{d}\_{i}^{T} - \mathbf{R}\_{i}\right)\right]}{\mathrm{Tr}\left[\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{T}\mathbf{H}\_{ik}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{T}\right]}.\tag{16}$$

#### 2.3.2. Validation statistics

<sup>k</sup>Pb<sup>i</sup> <sup>¼</sup> <sup>1</sup> m � 1

<sup>k</sup>λb<sup>i</sup> ¼

38 Kalman Filters - Theory for Advanced Applications

Tr HikPb<sup>i</sup>

<sup>k</sup>μb<sup>i</sup> <sup>¼</sup>

; <sup>k</sup>μb<sup>i</sup> � � Tr d<sup>T</sup>

H<sup>T</sup>

are estimated by minimizing the objective function.

<sup>k</sup>Li <sup>λ</sup>; <sup>μ</sup> � � <sup>¼</sup> Tr <sup>d</sup>id<sup>T</sup>

<sup>&</sup>lt; <sup>k</sup>�<sup>1</sup>L<sup>i</sup> <sup>k</sup>�<sup>1</sup>λb<sup>i</sup>

kxa <sup>i</sup> <sup>¼</sup> <sup>x</sup><sup>f</sup>

<sup>k</sup>λikPb<sup>i</sup> <sup>¼</sup> <sup>k</sup>λ<sup>i</sup>

following objective function

m � 1

matrix (see Appendix B for the proof).

Xm j¼1

xf i,j � <sup>x</sup><sup>f</sup> i � �

2.3.1. Correctly specified observational error covariance matrix

� �

<sup>i</sup> HikPb<sup>i</sup> H<sup>T</sup> <sup>i</sup> d<sup>i</sup>

Tr HikPb<sup>i</sup>

<sup>i</sup> <sup>H</sup>ikPbiH<sup>T</sup> i

Tr HikPb<sup>i</sup>

; <sup>k</sup>�<sup>1</sup>μb<sup>i</sup> � �

<sup>i</sup> <sup>þ</sup> <sup>k</sup>λbikPbiH<sup>T</sup>

� �

H<sup>T</sup>

H<sup>T</sup>

� �

<sup>i</sup> � λHikPb<sup>i</sup>

convergence of Eq. (12) and then estimate the k-th updated analysis state as

set <sup>k</sup> <sup>=</sup> <sup>k</sup> + 1 and return back to Eq. (9); otherwise, take <sup>k</sup>�<sup>1</sup>λbik�<sup>1</sup>Pb<sup>i</sup> and <sup>k</sup>�<sup>1</sup>μb<sup>i</sup>

proposed forecast error covariance matrix (Eq. (9)) can be expressed as.

xf i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

� �

where

and

If <sup>k</sup>L<sup>i</sup> <sup>k</sup>λb<sup>i</sup>

Section 2.1.

2.3. Notes

Xm j¼1

xf

Tr R<sup>2</sup> i � � � Tr <sup>d</sup><sup>T</sup>

<sup>i</sup> <sup>H</sup>ikPbiH<sup>T</sup> i

Tr d<sup>T</sup> <sup>i</sup> Rid<sup>i</sup> � � � Tr <sup>d</sup><sup>T</sup>

<sup>i</sup> <sup>H</sup>ikPbiH<sup>T</sup> i

� �

H<sup>T</sup> <sup>i</sup> � μR<sup>i</sup>

<sup>i</sup> <sup>H</sup>ikλbikPbiH<sup>T</sup>

forecast and observational error covariance matrices at i-th time step and go to Step 3 in

A general flowchart of the proposed assimilation scheme is shown in Figure 1. Moreover, the

which is a multiplicatively inflated sampling error covariance matrix plus an additive inflation

If the observational error covariance matrix R<sup>i</sup> is correctly known, then its adjustment is no longer required. In this case, the inflation factor <sup>k</sup>λb<sup>i</sup> can be estimated by minimizing the

i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i

Then, adjust the forecast and observational error covariance matrices to <sup>k</sup>λbikPb<sup>i</sup> and <sup>k</sup>μb<sup>i</sup>Ri,

Tr R<sup>2</sup> i

Tr R<sup>2</sup> i

� <sup>x</sup><sup>f</sup>

<sup>i</sup> Rid<sup>i</sup> � �Tr <sup>H</sup>ikPb<sup>i</sup>

� � � Tr <sup>H</sup>ikPb<sup>i</sup>

<sup>i</sup> HikPb<sup>i</sup> H<sup>T</sup> <sup>i</sup> d<sup>i</sup>

� � � Tr <sup>H</sup>ikPb<sup>i</sup>

did<sup>T</sup>

� �<sup>T</sup> � �

<sup>i</sup> <sup>þ</sup> <sup>k</sup>μbikR<sup>i</sup> � ��<sup>1</sup>

> <sup>þ</sup> <sup>k</sup>λ<sup>i</sup> m <sup>m</sup> � <sup>1</sup> <sup>x</sup><sup>f</sup>

<sup>i</sup> � λHikPb<sup>i</sup>

� δ, where δ is a pre-determined threshold to control the

yo <sup>i</sup> � <sup>H</sup>ix<sup>f</sup> i

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup>

� �

i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

> H<sup>T</sup> <sup>i</sup> R<sup>i</sup> � �

> > Tr HikPb<sup>i</sup>

� �<sup>2</sup> , (10)

H<sup>T</sup> <sup>i</sup> R<sup>i</sup> � �

� �, (13)

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

R<sup>i</sup> as the estimated

, (14)

: (12)

� �<sup>2</sup> , (11)

H<sup>T</sup> <sup>i</sup> R<sup>i</sup>

H<sup>T</sup> <sup>i</sup> R<sup>i</sup>

> H<sup>T</sup> <sup>i</sup> � μR<sup>i</sup>

: (9)

� �

In any toy model, the "true" state x<sup>t</sup> <sup>i</sup> is known by experimental design. In this case, the rootmean-square error (RMSE) of the analysis state can be used to evaluate the accuracy of the assimilation results. The RMSE at i-th step is defined as

$$\text{RMSE} = \sqrt{\frac{1}{n} \sum\_{k=1}^{n} \left(\mathbf{x}\_{ik}^{\mathbf{a}} - \mathbf{x}\_{ik}^{\mathbf{t}}\right)^{2}}.\tag{17}$$

where x<sup>a</sup> ik and x<sup>t</sup> ik are the k-th components of the analysis state and true state at the i-th time step. In principle, a smaller RMSE indicates a better performance of the assimilation scheme.

### 3. Experiment on Lorenz 96 model

In this section, the EnKF with SLS inflation assimilation scheme is applied to a nonlinear dynamical system, which has properties relevant to realistic forecast problems: the Lorenz-96 model [39] with model error and a linear observational system. The performances of the assimilation schemes in Section 2 are evaluated through the following experiments.

#### 3.1. Description of forecast and observational systems

The Lorenz-96 model [39] is a strongly nonlinear dynamical system with quadratic nonlinearity, which is governed by the equation.

$$\frac{d\mathbf{X}\_k}{dt} = (\mathbf{X}\_{k+1} - \mathbf{X}\_{k-2})\mathbf{X}\_{k-1} - \mathbf{X}\_k + F \tag{18}$$

The model errors by changing the forcing term are added in the forecast model because it is inevitable in real dynamic systems. Thus, different values of F are chose in the assimilation schemes while retaining F = 8 when generating the "true" state. The observations are simulated every four time steps analogizing 1 day in realistic problem for 2000 steps to ensure robust results. The ensemble size is used as 30. The pre-determined threshold δ to control the convergence of Eq. (12) is set to be 1, because the values of objective functions are in the order of 105

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

In most cases of the following experiment, the objective functions converge after 3–4 iterations,

In Section 2.1, the EnKF assimilation scheme with SLS error covariance matrix inflation is outlined. In Section 2.2, the improved EnKF assimilation scheme with the SLS error covariance matrix inflation and the new structure of the forecast error covariance matrix are summarized. In the following, the influences of these estimation methods on EnKF data assimilation

Lorenz-96 model is a forced dissipative model with a parameter F that controls the strength of the forcing (Eq. (18)). The model behaviors are quite different with different values of F, and chaotic systems are produced with integer values of F larger than 3. Therefore, several values of F are used to simulate a wide range of model errors. In all cases, the true states were generated by a model with F = 8. These observations were then assimilated into models with

Suppose the observational error covariance matrix R<sup>i</sup> is correctly specified, the inflation adjustment on Pb<sup>i</sup> is taken in each assimilation cycle and estimate the inflation factors λ<sup>i</sup> by the methods described in Section 2.1. Then, the adaptive assimilation schemes with the new structure of the forecast error covariance matrix proposed in Section 2.2 are conducted.

Figure 2 shows the time-mean analysis RMSE of the two assimilation schemes averaged over 2000 time steps, as a function of F. Overall, the analysis RMSE of the two assimilation schemes gradually grows as increasing model error. When F is near the true value 8, the two assimilation schemes have almost indistinguishable values of the analysis RMSE. However, when F becomes increasingly distant from 8, the analysis RMSE of the assimilation scheme with the new structure of the forecast error covariance matrix becomes progressively smaller than that

For the Lorenz-96 model with large error (such as, the case with F = 12), the time-mean analysis RMSE of the two assimilation schemes is listed in Table 1, as well as the time-mean values of the objective functions. The conventional EnKF assimilation scheme is also included for comparison. These results show clearly that our two schemes have significantly smaller RMSE than

of the assimilation scheme with the forecast error covariance matrix inflation only.

and the estimated analysis states also converge.

3.2. Comparison of assimilation schemes

schemes are assessed using Lorenz-96 model.

3.2.1. Correctly specified observational error covariance matrix

F = 4, 5, …, 12.

.

41

where k ¼ 1, 2, ⋯, K (K ¼ 40; hence, there are 40 variables). For Eq. (18) to be well-defined for all values of k, it is defined that X�<sup>1</sup> ¼ X<sup>K</sup>�<sup>1</sup>, X<sup>0</sup> ¼ XK, X<sup>K</sup>þ<sup>1</sup> ¼ X1. The dynamics of Eq. (18) are "atmosphere-like" in that the three terms on the right-hand side consist of a nonlinear advection-like term, a damping term, and an external forcing term respectively. These three terms can be thought of as some atmospheric quantity (e.g., zonal wind speed) distributed on a latitude circle. Therefore, the Lorenz-96 model has been widely used as a test bed to evaluate the performance of assimilation schemes in many studies [30].

The true state is derived by a fourth-order Runge–Kutta time integration scheme [40]. The time step for generating the numerical solution was set at 0.05 nondimensional units, which is roughly equivalent to 6 hours in real time, assuming that the characteristic time-scale of the dissipation in the atmosphere is 5 days [39]. The forcing term was set as F = 8, so that the leading Lyapunov exponent implies an error-doubling time of approximately 8 time steps, and the fractal dimension of the attractor was 27.1 [41]. The initial value was chosen to be X<sup>k</sup> ¼ F when k 6¼ 20 and X<sup>20</sup> ¼ 1:001F.

In this study, the synthetic observations were assumed to be generated by adding random noises that were multivariate-normally distributed with mean zero and covariance matrix R<sup>i</sup> to the true states. The frequency was four time steps, which can be used to mimic daily observations in practical problems, such as satellite data. The observation errors were assumed to be spatially correlated, which is common in applications involving remote sensing and radiance data. The variance of the observation at each grid point was set to σ<sup>2</sup> <sup>o</sup> ¼ 1, and the covariance of the observations between the j-th and k-th grid points was as follows:

$$\mathbf{R}\_{i}(j,k) = \sigma\_{\mathbf{o}}^{2} \times \mathbf{0}.\mathbf{5}^{\min\{|j-k|,40-|j-k|\}}.\tag{19}$$

Since it can deal with spatially correlated observational errors, the scheme may potentially be applied for assimilating remote sensing observations and radiances data.

The model errors by changing the forcing term are added in the forecast model because it is inevitable in real dynamic systems. Thus, different values of F are chose in the assimilation schemes while retaining F = 8 when generating the "true" state. The observations are simulated every four time steps analogizing 1 day in realistic problem for 2000 steps to ensure robust results. The ensemble size is used as 30. The pre-determined threshold δ to control the convergence of Eq. (12) is set to be 1, because the values of objective functions are in the order of 105 . In most cases of the following experiment, the objective functions converge after 3–4 iterations, and the estimated analysis states also converge.

#### 3.2. Comparison of assimilation schemes

3. Experiment on Lorenz 96 model

40 Kalman Filters - Theory for Advanced Applications

which is governed by the equation.

when k 6¼ 20 and X<sup>20</sup> ¼ 1:001F.

3.1. Description of forecast and observational systems

dX<sup>k</sup>

the performance of assimilation schemes in many studies [30].

data. The variance of the observation at each grid point was set to σ<sup>2</sup>

the observations between the j-th and k-th grid points was as follows:

<sup>R</sup>ið Þ¼ <sup>j</sup>; <sup>k</sup> <sup>σ</sup><sup>2</sup>

applied for assimilating remote sensing observations and radiances data.

In this section, the EnKF with SLS inflation assimilation scheme is applied to a nonlinear dynamical system, which has properties relevant to realistic forecast problems: the Lorenz-96 model [39] with model error and a linear observational system. The performances of the

The Lorenz-96 model [39] is a strongly nonlinear dynamical system with quadratic nonlinearity,

where k ¼ 1, 2, ⋯, K (K ¼ 40; hence, there are 40 variables). For Eq. (18) to be well-defined for all values of k, it is defined that X�<sup>1</sup> ¼ X<sup>K</sup>�<sup>1</sup>, X<sup>0</sup> ¼ XK, X<sup>K</sup>þ<sup>1</sup> ¼ X1. The dynamics of Eq. (18) are "atmosphere-like" in that the three terms on the right-hand side consist of a nonlinear advection-like term, a damping term, and an external forcing term respectively. These three terms can be thought of as some atmospheric quantity (e.g., zonal wind speed) distributed on a latitude circle. Therefore, the Lorenz-96 model has been widely used as a test bed to evaluate

The true state is derived by a fourth-order Runge–Kutta time integration scheme [40]. The time step for generating the numerical solution was set at 0.05 nondimensional units, which is roughly equivalent to 6 hours in real time, assuming that the characteristic time-scale of the dissipation in the atmosphere is 5 days [39]. The forcing term was set as F = 8, so that the leading Lyapunov exponent implies an error-doubling time of approximately 8 time steps, and the fractal dimension of the attractor was 27.1 [41]. The initial value was chosen to be X<sup>k</sup> ¼ F

In this study, the synthetic observations were assumed to be generated by adding random noises that were multivariate-normally distributed with mean zero and covariance matrix R<sup>i</sup> to the true states. The frequency was four time steps, which can be used to mimic daily observations in practical problems, such as satellite data. The observation errors were assumed to be spatially correlated, which is common in applications involving remote sensing and radiance

Since it can deal with spatially correlated observational errors, the scheme may potentially be

dt <sup>¼</sup> ð Þ <sup>X</sup><sup>k</sup>þ<sup>1</sup> � <sup>X</sup><sup>k</sup>�<sup>2</sup> <sup>X</sup><sup>k</sup>�<sup>1</sup> � <sup>X</sup><sup>k</sup> <sup>þ</sup> <sup>F</sup> (18)

<sup>o</sup> ¼ 1, and the covariance of

<sup>o</sup> � <sup>0</sup>:5minf g j j <sup>j</sup>�<sup>k</sup> ;40�j j <sup>j</sup>�<sup>k</sup> : (19)

assimilation schemes in Section 2 are evaluated through the following experiments.

In Section 2.1, the EnKF assimilation scheme with SLS error covariance matrix inflation is outlined. In Section 2.2, the improved EnKF assimilation scheme with the SLS error covariance matrix inflation and the new structure of the forecast error covariance matrix are summarized. In the following, the influences of these estimation methods on EnKF data assimilation schemes are assessed using Lorenz-96 model.

Lorenz-96 model is a forced dissipative model with a parameter F that controls the strength of the forcing (Eq. (18)). The model behaviors are quite different with different values of F, and chaotic systems are produced with integer values of F larger than 3. Therefore, several values of F are used to simulate a wide range of model errors. In all cases, the true states were generated by a model with F = 8. These observations were then assimilated into models with F = 4, 5, …, 12.

### 3.2.1. Correctly specified observational error covariance matrix

Suppose the observational error covariance matrix R<sup>i</sup> is correctly specified, the inflation adjustment on Pb<sup>i</sup> is taken in each assimilation cycle and estimate the inflation factors λ<sup>i</sup> by the methods described in Section 2.1. Then, the adaptive assimilation schemes with the new structure of the forecast error covariance matrix proposed in Section 2.2 are conducted.

Figure 2 shows the time-mean analysis RMSE of the two assimilation schemes averaged over 2000 time steps, as a function of F. Overall, the analysis RMSE of the two assimilation schemes gradually grows as increasing model error. When F is near the true value 8, the two assimilation schemes have almost indistinguishable values of the analysis RMSE. However, when F becomes increasingly distant from 8, the analysis RMSE of the assimilation scheme with the new structure of the forecast error covariance matrix becomes progressively smaller than that of the assimilation scheme with the forecast error covariance matrix inflation only.

For the Lorenz-96 model with large error (such as, the case with F = 12), the time-mean analysis RMSE of the two assimilation schemes is listed in Table 1, as well as the time-mean values of the objective functions. The conventional EnKF assimilation scheme is also included for comparison. These results show clearly that our two schemes have significantly smaller RMSE than

Figure 2. Time-mean values of the analysis RMSE as a function of forcing F when observational errors are spatially correlated and their covariance matrix is correctly specified, by using 3 EnKF schemes. 1) SLS only (solid line, described in Section 2.1); 2) SLS and new structure (dashed line, described in Section 2.2); and 3) SLS and true ensemble forecast error (dotted line, described in Section 5).

The observational error covariance matrix R<sup>i</sup> is set as four times of the true matrix and introduces another factor μ<sup>i</sup> to adjust Ri. The assimilation schemes are conducted in two cases: (1) inflate the forecast and observational error covariance matrices only (Section 2.1); (2) inflate the forecast and observational error covariance matrices and use the new structure of the forecast error covariance matrix (Section 2.2). Again, the forcing term F takes values 4, 5, …, 12 when assimilating observations, but F = 8 is used when generating the true states in

Figure 3. Time-mean values of the analysis RMSE as a function of forcing F when observational errors are spatially correlated and their covariance matrix is incorrectly specified, by using 3 EnKF schemes. 1) SLS only (solid line); 2) SLS

and new structure (dashed line); and 3) SLS and true ensemble forecast error (dotted line).

Figure 3 shows the time-mean analysis RMSE of the two cases averaged over 2000 time steps, as a function of forcing term. Generally speaking, the analysis RMSE of the two cases gradually

SLS 2.43 1,426,541 3.51 1,492,685 SLS and new structure 1.35 41,326 1.45 95,685 SLS and true ensemble forecast error 0.58 21,585 0.60 21,355

Table 2. The time-mean analysis RMSE and the time-mean objective function values in EnKF schemes for Lorenz-96 model when observational errors are spatially correlated and their covariance matrix is incorrectly specified: (1) SLS; (2)

Time-mean RMSE Time-mean L Time-mean RMSE Time-mean L

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

43

EnKF schemes Ensemble size 30 Ensemble size 20

SLS and new structure; (4) SLS and true ensemble forecast error. The forcing term F = 12.

all cases.


Table 1. The time-mean analysis RMSE and the time-mean objective function values in 4 EnKF schemes for Lorenz-96 model when observational errors are spatially correlated and their covariance matrix is correctly specified: (1) EnKF (noninflation); (2) the SLS scheme in Section 2.1 (SLS); (3) the SLS scheme in Section 2.2 (SLS and new structure); (4) the SLS scheme in the discussion (SLS and true ensemble forecast error). The forcing term F = 12.

the EnKF assimilation scheme. Moreover, the assimilation scheme with the new structure of the forecast error covariance matrix performs much better than assimilation scheme with forecast error covariance matrix inflation only.

#### 3.2.2. Incorrectly specified observational error covariance matrix

In this section, the observational error covariance matrix is supposed to be correct only up to a constant factor. The factor is estimated using different estimation methods, and the corresponding assimilation results are evaluated.

Figure 3. Time-mean values of the analysis RMSE as a function of forcing F when observational errors are spatially correlated and their covariance matrix is incorrectly specified, by using 3 EnKF schemes. 1) SLS only (solid line); 2) SLS and new structure (dashed line); and 3) SLS and true ensemble forecast error (dotted line).

The observational error covariance matrix R<sup>i</sup> is set as four times of the true matrix and introduces another factor μ<sup>i</sup> to adjust Ri. The assimilation schemes are conducted in two cases: (1) inflate the forecast and observational error covariance matrices only (Section 2.1); (2) inflate the forecast and observational error covariance matrices and use the new structure of the forecast error covariance matrix (Section 2.2). Again, the forcing term F takes values 4, 5, …, 12 when assimilating observations, but F = 8 is used when generating the true states in all cases.

Figure 3 shows the time-mean analysis RMSE of the two cases averaged over 2000 time steps, as a function of forcing term. Generally speaking, the analysis RMSE of the two cases gradually


the EnKF assimilation scheme. Moreover, the assimilation scheme with the new structure of the forecast error covariance matrix performs much better than assimilation scheme with

Table 1. The time-mean analysis RMSE and the time-mean objective function values in 4 EnKF schemes for Lorenz-96 model when observational errors are spatially correlated and their covariance matrix is correctly specified: (1) EnKF (noninflation); (2) the SLS scheme in Section 2.1 (SLS); (3) the SLS scheme in Section 2.2 (SLS and new structure); (4) the SLS

Figure 2. Time-mean values of the analysis RMSE as a function of forcing F when observational errors are spatially correlated and their covariance matrix is correctly specified, by using 3 EnKF schemes. 1) SLS only (solid line, described in Section 2.1); 2) SLS and new structure (dashed line, described in Section 2.2); and 3) SLS and true ensemble forecast error

EnKF schemes Time-mean RMSE Time-mean L Non-inflation 5.65 2,298,754 SLS 1.89 148,468 SLS and new structure 1.22 38,125 SLS and true ensemble forecast error 0.48 19,652

In this section, the observational error covariance matrix is supposed to be correct only up to a constant factor. The factor is estimated using different estimation methods, and the corresponding

forecast error covariance matrix inflation only.

assimilation results are evaluated.

(dotted line, described in Section 5).

42 Kalman Filters - Theory for Advanced Applications

3.2.2. Incorrectly specified observational error covariance matrix

scheme in the discussion (SLS and true ensemble forecast error). The forcing term F = 12.

Table 2. The time-mean analysis RMSE and the time-mean objective function values in EnKF schemes for Lorenz-96 model when observational errors are spatially correlated and their covariance matrix is incorrectly specified: (1) SLS; (2) SLS and new structure; (4) SLS and true ensemble forecast error. The forcing term F = 12.

results clearly show that when the observational error covariance matrix is incorrectly specified, the assimilation result is much better if the new structure of the forecast error covariance

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

45

The estimated <sup>μ</sup>b<sup>i</sup> over 2000 time steps in the two cases of using the new structure of the forecast error covariance matrix (cases 2) are plotted in Figure 4. It can be seen that the time-mean value of estimated <sup>μ</sup>b<sup>i</sup> is 0.45, which is very close to the reciprocal of the constant that is multiplied to

To further investigate the effect of ensemble size on the assimilation result, Figure 3 is reproduced with the ensemble size 20. The results are shown in Figure 5, as well as in Table 2. Generally speaking, Figures 5 is quite similar to Figure 3 but with larger analysis error. This indicates that the smaller ensemble size can lead to the larger forecast error and analysis error. The analysis is also repeated with the ensemble size 10. However in this case, both the inflation and new structure are not effective. This could be due to that the ensemble size 10 is too small

It is well-known that accurately estimating the error covariance matrix is one of the most key steps in any ensemble-based data assimilation. In EnKF assimilation scheme, the forecast error covariance matrix is initially estimated as the sampling covariance matrix of the ensemble forecast states. But due to limited ensemble size and model error, the forecast error covariance matrix is usually an underestimation, which may lead to the divergence of the filter. Therefore, the initially estimated forecast error covariance matrix is multiplied by an inflation factor λi,

In fact, the true forecast error should be represented as the ensemble forecast states minus the true state. However, since in real problems, the true state is not available, the ensemble mean of the forecast states is used instead. Consequently, the forecast error covariance matrix is initially represented as the sampling covariance matrix of the ensemble forecast states. However, for the model with large error, the ensemble mean of the forecast states may be far from the true state. In this case, the estimated forecast error covariance matrix will also remain far from the

To verify this point, a number of EnKF assimilation schemes with necessary error covariance

shown in Figures 2–5 and Tables 1 and 2. All the figures and tables show that the analysis

<sup>i</sup> is unknown, the analysis state x<sup>a</sup>

i

<sup>i</sup> . To achieve this goal, a new structure of the forecast

<sup>i</sup> in the forecast

. The corresponding RMSE are

<sup>i</sup> is used to replace the forecast

matrix inflation are applied to the Lorenz-96 model but with the forecast state x<sup>f</sup>

<sup>i</sup> than x<sup>f</sup>

matrix is used (cases 2).

the observational error covariance matrix (0.25).

to generate robust covariance estimation.

4. Discussion and conclusions

and the SLS estimation is proposed to estimate this factor.

truth, no matter which inflation technique is used.

<sup>i</sup> is closer to x<sup>t</sup>

RMSE is significantly reduced. However, since the true state x<sup>t</sup>

<sup>i</sup> , because x<sup>a</sup>

state x<sup>f</sup>

error covariance matrix (Eq. (4)) substituted by the true state x<sup>t</sup>

Figure 4. The times series of estimated <sup>μ</sup>b<sup>i</sup> when observational error covariance matrix is incorrectly specified.

grows as the increasing the model error. However, the analysis RMSE generated by using new structure of the forecast error covariance matrix (cases 2) is smaller than those by using the error covariance matrices inflation technique only (cases 1).

For the Lorenz-96 model with forcing term F = 12, the time-mean analysis RMSE of the two cases is listed in Table 2, along with the time-mean values of the objective functions. These

Figure 5. Similar to Figure 3, but ensemble size is 20.

results clearly show that when the observational error covariance matrix is incorrectly specified, the assimilation result is much better if the new structure of the forecast error covariance matrix is used (cases 2).

The estimated <sup>μ</sup>b<sup>i</sup> over 2000 time steps in the two cases of using the new structure of the forecast error covariance matrix (cases 2) are plotted in Figure 4. It can be seen that the time-mean value of estimated <sup>μ</sup>b<sup>i</sup> is 0.45, which is very close to the reciprocal of the constant that is multiplied to the observational error covariance matrix (0.25).

To further investigate the effect of ensemble size on the assimilation result, Figure 3 is reproduced with the ensemble size 20. The results are shown in Figure 5, as well as in Table 2. Generally speaking, Figures 5 is quite similar to Figure 3 but with larger analysis error. This indicates that the smaller ensemble size can lead to the larger forecast error and analysis error. The analysis is also repeated with the ensemble size 10. However in this case, both the inflation and new structure are not effective. This could be due to that the ensemble size 10 is too small to generate robust covariance estimation.

### 4. Discussion and conclusions

grows as the increasing the model error. However, the analysis RMSE generated by using new structure of the forecast error covariance matrix (cases 2) is smaller than those by using the error

Figure 4. The times series of estimated <sup>μ</sup>b<sup>i</sup> when observational error covariance matrix is incorrectly specified.

For the Lorenz-96 model with forcing term F = 12, the time-mean analysis RMSE of the two cases is listed in Table 2, along with the time-mean values of the objective functions. These

covariance matrices inflation technique only (cases 1).

44 Kalman Filters - Theory for Advanced Applications

Figure 5. Similar to Figure 3, but ensemble size is 20.

It is well-known that accurately estimating the error covariance matrix is one of the most key steps in any ensemble-based data assimilation. In EnKF assimilation scheme, the forecast error covariance matrix is initially estimated as the sampling covariance matrix of the ensemble forecast states. But due to limited ensemble size and model error, the forecast error covariance matrix is usually an underestimation, which may lead to the divergence of the filter. Therefore, the initially estimated forecast error covariance matrix is multiplied by an inflation factor λi, and the SLS estimation is proposed to estimate this factor.

In fact, the true forecast error should be represented as the ensemble forecast states minus the true state. However, since in real problems, the true state is not available, the ensemble mean of the forecast states is used instead. Consequently, the forecast error covariance matrix is initially represented as the sampling covariance matrix of the ensemble forecast states. However, for the model with large error, the ensemble mean of the forecast states may be far from the true state. In this case, the estimated forecast error covariance matrix will also remain far from the truth, no matter which inflation technique is used.

To verify this point, a number of EnKF assimilation schemes with necessary error covariance matrix inflation are applied to the Lorenz-96 model but with the forecast state x<sup>f</sup> <sup>i</sup> in the forecast error covariance matrix (Eq. (4)) substituted by the true state x<sup>t</sup> i . The corresponding RMSE are shown in Figures 2–5 and Tables 1 and 2. All the figures and tables show that the analysis RMSE is significantly reduced.

However, since the true state x<sup>t</sup> <sup>i</sup> is unknown, the analysis state x<sup>a</sup> <sup>i</sup> is used to replace the forecast state x<sup>f</sup> <sup>i</sup> , because x<sup>a</sup> <sup>i</sup> is closer to x<sup>t</sup> <sup>i</sup> than x<sup>f</sup> <sup>i</sup> . To achieve this goal, a new structure of the forecast error covariance matrix and an adaptive procedure for estimating the new structure are proposed here to iteratively improve the estimation. As shown in this chapter, the RMSE of the corresponding analysis states are indeed smaller than those of the EnKF assimilation scheme with the error covariance matrix inflation only. For instance, in the experiment in Section 3.1, when the error covariance matrix inflation technique is applied, the RMSE is 1.89 which is much smaller than that for the original EnKF. When the new structure of the forecast error covariance matrix is used in addition to the inflation, the RMSE is reduced to 1.22 (see Table 1).

practical applications, especially for the cases that the observations are unevenly distributed. Persistently applying the same inflation values that are reasonably large to address problems in densely observed areas to all state variables can systematically overinflate the ensemble variances in sparsely observed areas [13, 26, 42]. Even when the adaptive procedure for estimating the error covariance matrix is applied, the problem may still exist in some extent. In the two case studies conducted here, the observational systems are relatively evenly

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

47

In the future study, we will investigate how to modify the adaptive procedure to suit the system with unevenly distributed observations. We also plan to apply our methodology to error covariance localization [43, 44] and to validate the proposed methodologies using more

This work is supported by the National Natural Science Foundation of China (grant no. 91647202), the National Basic Research Program of China (grant no. 2015CB953703), the National Natural Science Foundation of China (grant no. 41405098) and the Fundamental Research Funds for the Central Universities. The authors gratefully acknowledge the anonymous reviewers for their constructive and relevant comments, which helped greatly in improving the quality of this manuscript. The authors are also grateful to the editors for their hard work and suggestions on this manuscript. Parts of this chapter are reproduced from the authors' previous publications [29, 30].

The forecast error covariance matrix Pb<sup>i</sup> is inflated to λPbi. The estimation of the inflation factors

The covariance matrix of the random vector d<sup>i</sup> can be expressed as a second-order regression

<sup>i</sup> � <sup>H</sup>ix<sup>t</sup> i � � <sup>þ</sup> <sup>H</sup><sup>i</sup> <sup>x</sup><sup>t</sup>

where E is the expectation operator and Ξ is the error matrix. The left-hand side of (A2) can be

� � � � <sup>T</sup> h i <sup>¼</sup> <sup>d</sup>id<sup>T</sup>

<sup>i</sup> � <sup>x</sup><sup>f</sup> i

> <sup>i</sup> � <sup>x</sup><sup>f</sup> i

� � (A1)

<sup>i</sup> þ Ξ (A2)

<sup>i</sup> � <sup>H</sup>ix<sup>f</sup> i

<sup>i</sup> � <sup>H</sup>ix<sup>t</sup> i � � <sup>þ</sup> <sup>H</sup><sup>i</sup> <sup>x</sup><sup>t</sup>

distributed.

Acknowledgements

Appendix A

equation [27]:

decomposed as

E y<sup>o</sup>

<sup>i</sup> � <sup>H</sup>ix<sup>t</sup> i � � <sup>þ</sup> <sup>H</sup><sup>i</sup> <sup>x</sup><sup>t</sup>

sophisticated dynamic and observational systems.

λ is based on the observation-minus-forecast residual

<sup>d</sup><sup>i</sup> <sup>¼</sup> <sup>y</sup><sup>o</sup>

<sup>i</sup> � <sup>x</sup><sup>f</sup> i

� � � � y<sup>o</sup>

<sup>¼</sup> <sup>y</sup><sup>o</sup>

In the realistic problems, the observational error covariance matrix is not always correctly known, and hence it also needs to be adjusted too. Another factor μ<sup>i</sup> is introduced to adjust the observational error covariance matrix in this chapter, which can be estimated simultaneously with λ<sup>i</sup> by minimizing the second-order least squares function of the squared observation-minus-forecast residual.

The second-order least squares function of the squared observation-minus-forecast residual can be a good objective function to quantify the goodness of fit of the error covariance matrix. The SLS method proposed in this chapter can be used to estimate the factors for adjusting both the forecast and observational error covariance matrices, while the first order method can only estimate the inflation factor of the forecast error covariance matrix. The SLS can also provide a criterion for stopping the iteration in the adaptive estimation procedure when the new structure of the forecast error covariance matrix is used. This is important for preventing the proposed forecast error covariance matrix to depart from the truth in the iteration. In most cases in this study, the minimization algorithms converge after several iterations, and the objective function decreases sharply. On the other hand, the improved forecast error covariance matrix indeed leads to the improvement of analysis state. In fact, as shown in Tables 1-2, a small objective function value always corresponds to a small RMSE of the analysis state.

The difference of the EnKF assimilation scheme with SLS inflation is compared to that with maximum likelihood estimation (MLE) inflation [21]. Generally speaking, the RMSE of the analysis state derived using the MLE inflation scheme is a little smaller than that derived using the SLS inflation scheme only but is larger than that derived using the SLS inflation with the new structure of forecast error covariance matrix. For instance, for Lorenz-96 model with forcing term F = 12, the RMSE is 1.69 for MLE inflation, 1.89 for SLS inflation only, and 1.22 for SLS inflation and new structure (Table 1). Whether this is a general rule or not is still unclear and is subject to further investigation. However, in MLE inflation scheme, the objective function is nonlinear and especially involves the determinant of the observation-minus-forecast residual's covariance matrix, which is quite computationally expensive. The SLS objective function proposed in this chapter is quadratic, so its minimizer is analytic and can be easily calculated.

On the other hand, similar to other inflation schemes with single factor, this study also assumes the inflation factor to be constant in space. Apparently, this is not the case in many practical applications, especially for the cases that the observations are unevenly distributed. Persistently applying the same inflation values that are reasonably large to address problems in densely observed areas to all state variables can systematically overinflate the ensemble variances in sparsely observed areas [13, 26, 42]. Even when the adaptive procedure for estimating the error covariance matrix is applied, the problem may still exist in some extent. In the two case studies conducted here, the observational systems are relatively evenly distributed.

In the future study, we will investigate how to modify the adaptive procedure to suit the system with unevenly distributed observations. We also plan to apply our methodology to error covariance localization [43, 44] and to validate the proposed methodologies using more sophisticated dynamic and observational systems.

### Acknowledgements

error covariance matrix and an adaptive procedure for estimating the new structure are proposed here to iteratively improve the estimation. As shown in this chapter, the RMSE of the corresponding analysis states are indeed smaller than those of the EnKF assimilation scheme with the error covariance matrix inflation only. For instance, in the experiment in Section 3.1, when the error covariance matrix inflation technique is applied, the RMSE is 1.89 which is much smaller than that for the original EnKF. When the new structure of the forecast error covariance matrix is used in addition to the inflation, the RMSE is reduced to 1.22 (see

In the realistic problems, the observational error covariance matrix is not always correctly known, and hence it also needs to be adjusted too. Another factor μ<sup>i</sup> is introduced to adjust the observational error covariance matrix in this chapter, which can be estimated simultaneously with λ<sup>i</sup> by minimizing the second-order least squares function of the squared

The second-order least squares function of the squared observation-minus-forecast residual can be a good objective function to quantify the goodness of fit of the error covariance matrix. The SLS method proposed in this chapter can be used to estimate the factors for adjusting both the forecast and observational error covariance matrices, while the first order method can only estimate the inflation factor of the forecast error covariance matrix. The SLS can also provide a criterion for stopping the iteration in the adaptive estimation procedure when the new structure of the forecast error covariance matrix is used. This is important for preventing the proposed forecast error covariance matrix to depart from the truth in the iteration. In most cases in this study, the minimization algorithms converge after several iterations, and the objective function decreases sharply. On the other hand, the improved forecast error covariance matrix indeed leads to the improvement of analysis state. In fact, as shown in Tables 1-2, a small objective function value always corresponds to a small RMSE of

The difference of the EnKF assimilation scheme with SLS inflation is compared to that with maximum likelihood estimation (MLE) inflation [21]. Generally speaking, the RMSE of the analysis state derived using the MLE inflation scheme is a little smaller than that derived using the SLS inflation scheme only but is larger than that derived using the SLS inflation with the new structure of forecast error covariance matrix. For instance, for Lorenz-96 model with forcing term F = 12, the RMSE is 1.69 for MLE inflation, 1.89 for SLS inflation only, and 1.22 for SLS inflation and new structure (Table 1). Whether this is a general rule or not is still unclear and is subject to further investigation. However, in MLE inflation scheme, the objective function is nonlinear and especially involves the determinant of the observation-minus-forecast residual's covariance matrix, which is quite computationally expensive. The SLS objective function proposed in this chapter is quadratic, so its minimizer is analytic and can be easily

On the other hand, similar to other inflation schemes with single factor, this study also assumes the inflation factor to be constant in space. Apparently, this is not the case in many

Table 1).

the analysis state.

calculated.

observation-minus-forecast residual.

46 Kalman Filters - Theory for Advanced Applications

This work is supported by the National Natural Science Foundation of China (grant no. 91647202), the National Basic Research Program of China (grant no. 2015CB953703), the National Natural Science Foundation of China (grant no. 41405098) and the Fundamental Research Funds for the Central Universities. The authors gratefully acknowledge the anonymous reviewers for their constructive and relevant comments, which helped greatly in improving the quality of this manuscript. The authors are also grateful to the editors for their hard work and suggestions on this manuscript. Parts of this chapter are reproduced from the authors' previous publications [29, 30].

## Appendix A

The forecast error covariance matrix Pb<sup>i</sup> is inflated to λPbi. The estimation of the inflation factors λ is based on the observation-minus-forecast residual

$$\begin{aligned} \mathbf{d}\_i &= \mathbf{y}\_i^\diamond - \mathbf{H}\_i \mathbf{x}\_i^\sharp \\ &= \left( \mathbf{y}\_i^\diamond - \mathbf{H}\_i \mathbf{x}\_i^\sharp \right) + \mathbf{H}\_i \left( \mathbf{x}\_i^\sharp - \mathbf{x}\_i^\sharp \right) \end{aligned} \tag{A1}$$

The covariance matrix of the random vector d<sup>i</sup> can be expressed as a second-order regression equation [27]:

$$E\left[\left(\left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right) + \mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right) \left(\left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right) + \mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right)^T\right] = \mathbf{d}\_i \mathbf{d}\_i^T + \boldsymbol{\Xi} \tag{A2}$$

where E is the expectation operator and Ξ is the error matrix. The left-hand side of (A2) can be decomposed as

$$\begin{aligned} &E\left[\left(\left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right) + \mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right) \left(\left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right) + \mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right)^\mathrm{T}\right] \\ &= E\left[\left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right) \left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right)^\mathrm{T}\right] + E\left[\left(\mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right) \left(\mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right)^\mathrm{T}\right] \\ &+ E\left[\left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right) \left(\mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right)^\mathrm{T}\right] + E\left[\left(\mathbf{H}\_i \left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right) \left(\mathbf{y}\_i^o - \mathbf{H}\_i \mathbf{x}\_i^t\right)^\mathrm{T}\right] \end{aligned} \tag{A3}$$

$$E\left[\left(\mathbf{H}\_i(\mathbf{x}\_i^t - \mathbf{x}\_i^\ell)\right)\left(\mathbf{y}\_i^o - \mathbf{H}\_i\mathbf{x}\_i^\ell\right)^T\right] = \mathbf{H}\_i E\left[\left(\mathbf{x}\_i^t - \mathbf{x}\_i^\ell\right)\left(\mathbf{y}\_i^o - \mathbf{H}\_i\mathbf{x}\_i^\ell\right)^T\right] = \mathbf{0},\tag{A4}$$

$$E\left[\left(\mathbf{y}\_i^o - \mathbf{H}\_i\mathbf{x}\_i^t\right)\left(\mathbf{H}\_i\left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\right)^T\right] = E\left[\left(\mathbf{y}\_i^o - \mathbf{H}\_i\mathbf{x}\_i^t\right)\left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)^T\right]\mathbf{H}\_i^T = \mathbf{0}.\tag{A5}$$

$$E\left[\left(\mathbf{y}\_i^o - \mathbf{H}\_i\mathbf{x}\_i^t\right)\left(\mathbf{y}\_i^o - \mathbf{H}\_i\mathbf{x}\_i^t\right)^T\right] = \mathbf{R}\_i \tag{A6}$$

$$\begin{aligned} &E\left[\left(\mathbf{H}\_i(\mathbf{x}\_i^t - \mathbf{x}\_i^t)\right)\left(\mathbf{H}\_i(\mathbf{x}\_i^t - \mathbf{x}\_i^t)\right)^T\right] \\ &= \mathbf{H}\_i E\left[\left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)\left(\mathbf{x}\_i^t - \mathbf{x}\_i^t\right)^T\right] \mathbf{H}\_i^T \\ &= \mathbf{H}\_i \frac{\lambda}{m-1} \sum\_{j=1}^n \left(\mathbf{x}\_{i,j}^t - \mathbf{x}\_i^t\right) \left(\mathbf{x}\_{i,j}^t - \mathbf{x}\_i^t\right)^T \mathbf{H}\_i^T \\ &= \lambda \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \end{aligned} \tag{A7}$$

$$\mathbf{R}\_i + \lambda \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \approx \mathbf{d}\_i \mathbf{d}\_i^T + \boldsymbol{\Xi} \tag{A8}$$

$$\begin{aligned} \text{Tr}\left[\boldsymbol{\Xi}\boldsymbol{\Xi}\boldsymbol{\Xi}^{\top}\right] & \approx \text{Tr}\left[\left(\mathbf{d}\_{i}\mathbf{d}\_{i}^{\mathrm{T}} - \mathbf{R}\_{i} - \lambda\mathbf{H}\_{i}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\right)\left(\mathbf{d}\_{i}\mathbf{d}\_{i}^{\mathrm{T}} - \mathbf{R}\_{i} - \lambda\mathbf{H}\_{i}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{\mathrm{T}}\right)^{\mathrm{T}}\right] \\ \equiv L\_{i}(\lambda) \end{aligned} \tag{A9}$$

$$\widehat{\lambda}\_{i} = \frac{\operatorname{Tr}\Big[\mathbf{H}\_{i}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{T}\Big(\mathbf{d}\_{i}\mathbf{d}\_{i}^{T} - \mathbf{R}\_{i}\Big)\Big]}{\operatorname{Tr}\Big[\mathbf{H}\_{i}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{T}\mathbf{H}\_{i}\widehat{\mathbf{P}}\_{i}\mathbf{H}\_{i}^{T}\Big]}\tag{A10}$$

$$L\_i(\lambda, \mu) = \text{Tr}\left[\left(\mathbf{d}\_i \mathbf{d}\_i^T - \mu \mathbf{R}\_i - \lambda \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T\right) \left(\mathbf{d}\_i \mathbf{d}\_i^T - \mu \mathbf{R}\_i - \lambda \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T\right)^T\right] \tag{A11}$$

$$\lambda \operatorname{Tr} \left( \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \right) + \mu \operatorname{Tr} \left( \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \mathbf{R}\_i \right) \cdot \operatorname{Tr} \left( \mathbf{d}\_i \mathbf{d}\_i^T \mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \right) \tag{A12}$$

$$
\mu\lambda \text{Tr}\left(\mathbf{H}\_i \widehat{\mathbf{P}}\_i \mathbf{H}\_i^T \mathbf{R}\_i\right) + \mu \text{Tr}\left(\mathbf{R}\_i^T \mathbf{R}\_i\right) \text{-Tr}\left(\mathbf{d}\_i \mathbf{d}\_i^T \mathbf{R}\_i\right) \tag{A13}
$$

### Appendix B

In fact,

kλi m�1 Xm j¼1 xf i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � <sup>x</sup><sup>f</sup> i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup> <sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup> Xm j¼1 xf i,j � <sup>x</sup><sup>f</sup> <sup>i</sup> <sup>þ</sup> <sup>x</sup><sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � <sup>x</sup><sup>f</sup> i,j � <sup>x</sup><sup>f</sup> <sup>i</sup> <sup>þ</sup> <sup>x</sup><sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup> <sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup> Xm j¼1 xf i,j � <sup>x</sup><sup>f</sup> i � � <sup>x</sup><sup>f</sup> i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup> þX<sup>m</sup> j¼1 xf <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup> 8 < : þ Xm j¼1 xf i,j � <sup>x</sup><sup>f</sup> i � � <sup>x</sup><sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>k</sup>�<sup>1</sup> <sup>i</sup> <sup>a</sup> � �<sup>T</sup> þX<sup>m</sup> j¼1 xf <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>k</sup>�<sup>1</sup> <sup>i</sup> <sup>a</sup> � � <sup>x</sup><sup>f</sup> i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup> 9 = ; (B1)

Author details

China

References

2645

Guocan Wu1,2\* and Xiaogu Zheng3

\*Address all correspondence to: gcwu@bnu.edu.cn

2 Joint Center for Global Change Studies, Beijing, China

Atmospheric Physics, Chinese Academy of Sciences, Beijing, China

1 College of Global Change and Earth System Science, Beijing Normal University, Beijing,

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

51

3 Key Laboratory of Regional Climate-Environment Research for East Asia, Institute of

[1] Miller RN, Ghil M, Gauthiez F. Advanced data assimilation in strongly nonlinear dynam-

[2] Ravazzani G et al. Potentialities of ensemble strategies for flood forecasting over the

[3] Talagrand O. Assimilation of observations, an introduction. Journal of the Meteorological

[4] Wang Y et al. Improving precipitation forecast with hybrid 3DVar and time-lagged

[5] Reichle RH. Data assimilation methods in the earth sciences. Advances in Water

[6] Yang SC, Kalnay E, Hunt B. Handling nonlinearity in an ensemble Kalman filter experiments with the three-variable Lorenz model. Monthly Weather Review. 2012;140:2628-

[7] Sakov P, Oliver DS, Bertino L. An iterative EnKF for strongly nonlinear systems. Monthly

[8] Evensen G. Sequential data assimilation with a nonlinear quasi-geostrophic model using Monte Carlo methods to forecast error statistics. Journal of Geophysical Research.

[9] Burgers G, Leeuwen PJ, Evensen G. Analysis scheme in the ensemble kalman filter.

[10] Luo X, Hoteit I. Ensemble Kalman filtering with residual nudging: An extension to state estimation problems with nonlinear observation operators. Monthly Weather Review.

ensembles in a heavy rainfall event. Atmospheric Research. 2017;183:1-16

ical systems. Journal of the Atmospheric Sciences. 1994;51:1037-1056

Milano urban area. Journal of Hydrology. 2016;539:237-253

Society of Japan. 1997;75:191-209

Resources. 2008;31:1411-1418

Weather Review. 2012;140:1988-2004

Monthly Weather Review. 1998;126:1719-1724

1994;99:10143-10162

2014;142:3696-3712

Since x<sup>f</sup> <sup>i</sup> is the ensemble mean forecast, we have

$$\begin{aligned} &\sum\_{j=1}^{m} \left(\mathbf{x}\_{i,j}^{\boldsymbol{\ell}} - \mathbf{x}\_{i}^{\boldsymbol{\ell}}\right) \left(\mathbf{x}\_{i}^{\boldsymbol{\ell}} - \_{k-1} \mathbf{x}\_{i}^{\boldsymbol{\mathsf{a}}}\right)^{\mathrm{T}} \\ &= \left[\sum\_{j=1}^{m} \left(\mathbf{x}\_{i,j}^{\boldsymbol{\ell}} - \mathbf{x}\_{i}^{\boldsymbol{\ell}}\right)\right] \left(\mathbf{x}\_{i}^{\boldsymbol{\ell}} - \_{k-1} \mathbf{x}\_{i}^{\boldsymbol{\mathsf{a}}}\right)^{\mathrm{T}} \boldsymbol{c} \\ &= \left[\sum\_{j=1}^{m} \mathbf{x}\_{i,j}^{\boldsymbol{\ell}} - m \frac{1}{m} \sum\_{j=1}^{m} \mathbf{x}\_{i,j}^{\boldsymbol{\ell}}\right] \left(\mathbf{x}\_{i}^{\boldsymbol{\ell}} - \_{k-1} \mathbf{x}\_{i}^{\boldsymbol{\mathsf{a}}}\right)^{\mathrm{T}} \\ &= \mathbf{0} \end{aligned} \tag{B2}$$

and similarly.

$$\sum\_{j=1}^{m} \left( \mathbf{x}\_{i}^{\ell} -\_{k-1} \mathbf{x}\_{i}^{\mathbf{a}} \right) \left( \mathbf{x}\_{i,j}^{\ell} - \mathbf{x}\_{i}^{\ell} \right)^{\mathrm{T}} = \mathbf{0} \tag{\text{B3}}$$

That is, the last two terms of Eq. (B1) vanish. Therefore, the proposed forecast error covariance matrix can be expressed as

kλi m�1 Xm j¼1 xf i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � <sup>x</sup><sup>f</sup> i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup> <sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup> Xm j¼1 xf i,j � <sup>x</sup><sup>f</sup> i � � <sup>x</sup><sup>f</sup> i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup> <sup>þ</sup> <sup>m</sup> <sup>x</sup><sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup> 8 < : 9 = ; <sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup> Xm j¼1 xf i,j � <sup>x</sup><sup>f</sup> i � � <sup>x</sup><sup>f</sup> i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup> <sup>þ</sup> <sup>k</sup>λ<sup>i</sup> m <sup>m</sup> � <sup>1</sup> <sup>x</sup><sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup> (B4)

### Author details

Appendix B

kλi m�1 Xm j¼1

50 Kalman Filters - Theory for Advanced Applications

<sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup>

<sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup>

þ Xm j¼1

xf

Xm j¼1

> 8 < :

xf i,j � <sup>x</sup><sup>f</sup> i � �

i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i

> xf i,j � <sup>x</sup><sup>f</sup> i � �

<sup>i</sup> is the ensemble mean forecast, we have

Xm j¼1

xf i,j � <sup>x</sup><sup>f</sup> i � �

> xf i,j � <sup>x</sup><sup>f</sup> i

� � <sup>2</sup>

<sup>¼</sup> <sup>X</sup><sup>m</sup> j¼1

<sup>¼</sup> <sup>X</sup><sup>m</sup> j¼1 xf i,j � m 1 m Xm j¼1 xf i,j

> Xm j¼1

xf <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup>

xf

xf i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

xf i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

¼ 0

2 4

4

xf

xf

<sup>i</sup> <sup>þ</sup> <sup>x</sup><sup>f</sup>

� �

i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i

xf i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>k</sup>�<sup>1</sup> <sup>i</sup> <sup>a</sup> � �<sup>T</sup> xf i,j � <sup>x</sup><sup>f</sup>

þX<sup>m</sup> j¼1 xf

xf <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

> 3 <sup>5</sup> <sup>x</sup><sup>f</sup>

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

> 3 <sup>5</sup> <sup>x</sup><sup>f</sup>

i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

<sup>þ</sup> <sup>m</sup> <sup>x</sup><sup>f</sup>

<sup>þ</sup> <sup>k</sup>λ<sup>i</sup> m <sup>m</sup> � <sup>1</sup> <sup>x</sup><sup>f</sup>

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup>

> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup>

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

That is, the last two terms of Eq. (B1) vanish. Therefore, the proposed forecast error covariance

þX<sup>m</sup> j¼1 xf <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � � x<sup>f</sup>

<sup>i</sup> <sup>þ</sup> <sup>x</sup><sup>f</sup>

� �<sup>T</sup>

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>k</sup>�<sup>1</sup> <sup>i</sup> <sup>a</sup> � � <sup>x</sup><sup>f</sup>

c

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

<sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i

> <sup>i</sup> � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i � �<sup>T</sup>

i,j � <sup>x</sup><sup>f</sup> i � �<sup>T</sup>

9 = ;

¼ 0 (B3)

9 = ; (B1)

(B2)

(B4)

� �

xf i,j � <sup>x</sup><sup>f</sup>

Xm j¼1

In fact,

Since x<sup>f</sup>

and similarly.

matrix can be expressed as

kλi m�1 Xm j¼1

<sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup>

<sup>¼</sup> <sup>k</sup>λ<sup>i</sup> <sup>m</sup>�<sup>1</sup>

xf

Xm j¼1

8 < :

Xm j¼1

i,j � <sup>k</sup>�<sup>1</sup>x<sup>a</sup> i

� �

xf i,j � <sup>x</sup><sup>f</sup> i � �

xf i,j � <sup>x</sup><sup>f</sup> i � � Guocan Wu1,2\* and Xiaogu Zheng3

\*Address all correspondence to: gcwu@bnu.edu.cn

1 College of Global Change and Earth System Science, Beijing Normal University, Beijing, China

2 Joint Center for Global Change Studies, Beijing, China

3 Key Laboratory of Regional Climate-Environment Research for East Asia, Institute of Atmospheric Physics, Chinese Academy of Sciences, Beijing, China

### References


[11] Anderson JL, Anderson SL. A Monte Carlo implementation of the nonlinear fltering problem to produce ensemble assimilations and forecasts. Monthly Weather Review. 1999;127:2741-2758

[25] Anderson JL. An adaptive covariance inflation error correction algorithm for ensemble

The Error Covariance Matrix Inflation in Ensemble Kalman Filter

http://dx.doi.org/10.5772/intechopen.71960

53

[26] Anderson JL. Spatially and temporally varying adaptive covariance inflation for ensem-

[27] Wang L, Leblanc A. Second-order nonlinear least squares estimation. Annals of the

[28] Huang C, Wu G, Zheng X. A new estimation method of ensemble forecast error in ETKF

[29] Wu G et al. Improving the ensemble transform Kalman filter using a second-order Taylor approximation of the nonlinear observation operator. Nonlinear Processes in Geophysics.

[30] Wu G et al. A new structure for error covariance matrices and their adaptive estimation in EnKF assimilation. Quarterly Journal of the Royal Meteorological Society. 2013;139:795-804

[31] Craven P, Wahba G. Smoothing noisy data with spline functions. Numerische Mathematik.

[32] Wahba G et al. Adaptive tuning of numerical weather prediction models randomized GCV in three- and four-dimensional data assimilation. Monthly Weather Review.

[33] Wu G, Zheng X. An estimate of the inflation factor and analysis sensitivity in the ensem-

[34] Evensen G. The ensemble Kalman filter theoretical formulation and practical implemen-

[35] Ide K et al. Unified notation for data assimilation operational sequential and variational.

[36] Houtekamer PL, Mitchell HL. A sequential ensemble Kalman filter for atmospheric data

[37] Golub GH, Loan CFV. Matrix Computations. Baltimore: The Johns Hopkins University

[38] Tippett MK et al. Notes and correspondence ensemble square root filter. Monthly

[39] Lorenz EN. Predictability a problem partly solved Paper presented at seminar on predict-

[40] Butcher JC. Numerical methods for ordinary differential equations. JohnWiley & Sons.

ble Kalman filter. Nonlinear Processes in Geophysics. 2017;24:329-341

Journal of the Meteorological Society of Japan. 1997;75:181-189

assimilation. Monthly Weather Review. 2001;129:123-137

assimilation with nonlinear observation operator. SOLA. 2017;13:63-68

filters. Tellus. 2007;59A:210-224

ble filters. Tellus. 2009;61A:72-83

2014;21:955-970

1979;31:377-403

1995;123:3358-3369

Press; 1996

2003:425

tation. Ocean Dynamics. 2003;53:343-367

Weather Review. 2003;131:1485-1490

ability. ECMWF: Reading UK; 1996

Institute of Statistical Mathematics. 2008;60:883-900


[25] Anderson JL. An adaptive covariance inflation error correction algorithm for ensemble filters. Tellus. 2007;59A:210-224

[11] Anderson JL, Anderson SL. A Monte Carlo implementation of the nonlinear fltering problem to produce ensemble assimilations and forecasts. Monthly Weather Review.

[12] Constantinescu EM et al. Ensemble-based chemical data assimilation I: General approach. Quarterly Journal of the Royal Meteorological Society. 2007;133:1229-1243 [13] Hamill TM, Whitaker JS. Accounting for the error due to unresolved scales in ensemble data assimilation: A comparison of different approaches. Monthly Weather Review.

[14] Bai Y, Li X. Evolutionary algorithm-based error parameterization methods for data

[15] Luo X, Hoteit I. Robust ensemble filtering and its relation to covariance inflation in the

[16] Dee DP. On-line estimation of error covariance parameters for atmospheric data assimi-

[17] Dee DP, Silva AM. Maximum-likelihood estimation of forecast and observation error covariance parameters part I: Methodology. Monthly Weather Review. 1999;127:1822-

[18] Li H, Kalnay E, Miyoshi T. Simultaneous estimation of covariance inflatioin and observation errors within an ensemble Kalman filter. Quarterly Journal of the Royal Meteorolog-

[19] Wang X, Bishop CH. A comparison of breeding and ensemble transform kalman filter ensemble forecast schemes. Journal of the Atmospheric Sciences. 2003;60:1140-1158 [20] Miyoshi T. The Gaussian approach to adaptive covariance inflation and its implementation with the local ensemble transform Kalman filter. Monthly Weather Review.

[21] Liang X et al. Maximum likelihood estimation of inflation factors on error covariance matrices for ensemble Kalman filter assimilation. Quarterly Journal of the Royal Meteo-

[22] Zheng X. An adaptive estimation of forecast error statistic for Kalman filtering data

[23] Zheng X et al. Using analysis state to construct forecast error covariance matrix in EnKF

[24] Wu G, Dan B, Zheng X. Soil moisture assimilation using a modified ensemble transform Kalman filter based on station observations in the Hai River basin. Advances in Meteo-

assimilation. Advances in Atmospheric Sciences. 2009;26:154-160

assimilation. Advances in Atmospheric Sciences. 2013;30:1303-1312

assimilation. Monthly Weather Review. 2011;139:2668-2685

lation. Monthly Weather Review. 1995;123:1128-1145

ensemble Kalman filter. Monthly Weather Review. 2011;139:3938-3953

1999;127:2741-2758

52 Kalman Filters - Theory for Advanced Applications

2005;133:3132-3147

ical Society. 2009;135:523-533

rological Society. 2012;138:263-273

2011;139:1519-1534

rology. 2016

1834


[41] Lorenz EN, Emanuel KA. Optimal sites for supplementary weather observations simulation with a small model. Journal of the Atmospheric Sciences. 1998;55:399-414

**Chapter 3**

Provisional chapter

**Unscented Kalman Filter for State and Parameter**

DOI: 10.5772/intechopen.71900

Automotive research and development passed through a vast evolution during past decades. Many passive and active driver assistance systems were developed, increasing the passengers' safety and comfort. This ongoing process is a main focus in current research and offers great potential for further systems, especially focusing on the task of autonomous and cooperative driving in the future. For that reason, information about the current stability in terms of dynamic behavior and vehicle environment are necessary for the systems to perform properly. Thus, model-based online state and parameter estimation have become important throughout the last years using a detailed vehicle model and standard sensors, gathering this information. In this chapter, state and parameter estimation in vehicle dynamics utilizing the unscented Kalman filter is presented. The estimation runs in real time based on a detailed vehicle model and standard measurements taken within the car. The results are validated using a Volkswagen Golf GTE Plug-In Hybrid for various dynamic test maneuvers and a Genesys Automotive Dynamic Motion Analyzer (ADMA) measurement unit for highprecision measurements of the vehicle's states. Online parameter estimation is shown for

friction coefficient estimation performing maneuvers on different road surfaces.

Keywords: vehicle dynamics, state estimation, parameter estimation, unscented

In the past decades, enormous developments in automotive research were achieved. Since the beginning of the twentieth century, a consistent search for solutions increasing vehicle's safety and comfort took place. Starting with passive safety systems in the early twentieth century, e.g., airbag, safety belt, and deformable zone, a vast improvement of the passenger's safety was accomplished. These systems reduce passenger injuries and or even death due to accidents.

> © The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Unscented Kalman Filter for State and Parameter

**Estimation in Vehicle Dynamics**

Estimation in Vehicle Dynamics

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

Mark Wielitzka, Alexander Busch, Matthias Dagen and Tobias Ortmaier

Mark Wielitzka, Alexander Busch, Matthias Dagen and Tobias Ortmaier

http://dx.doi.org/10.5772/intechopen.71900

Kalman filter, dead-time compensation

Abstract

1. Introduction


### **Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics** Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

DOI: 10.5772/intechopen.71900

Mark Wielitzka, Alexander Busch, Matthias Dagen and Tobias Ortmaier Mark Wielitzka, Alexander Busch,

Matthias Dagen and Tobias Ortmaier

Additional information is available at the end of the chapter Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.71900

#### Abstract

[41] Lorenz EN, Emanuel KA. Optimal sites for supplementary weather observations simulation with a small model. Journal of the Atmospheric Sciences. 1998;55:399-414

[42] Yang S-C, Kalnay E, Enomoto T. Ensemble singular vectors and their use as additive

[43] Desroziers G, Arbogast E, Berre L. Improving spatial localization in 4DEnVar. Quarterly

[44] Kirchgessner P, Berger L, Gerstner AB. On the choice of an optimal localization radius in ensemble Kalman filter methods. Monthly Weather Review. 2014;142:2165-2175

Journal of the Royal Meteorological Society. 2016;142:3171-3185

inflation in EnKF. Tellus A. 2015;67

54 Kalman Filters - Theory for Advanced Applications

Automotive research and development passed through a vast evolution during past decades. Many passive and active driver assistance systems were developed, increasing the passengers' safety and comfort. This ongoing process is a main focus in current research and offers great potential for further systems, especially focusing on the task of autonomous and cooperative driving in the future. For that reason, information about the current stability in terms of dynamic behavior and vehicle environment are necessary for the systems to perform properly. Thus, model-based online state and parameter estimation have become important throughout the last years using a detailed vehicle model and standard sensors, gathering this information. In this chapter, state and parameter estimation in vehicle dynamics utilizing the unscented Kalman filter is presented. The estimation runs in real time based on a detailed vehicle model and standard measurements taken within the car. The results are validated using a Volkswagen Golf GTE Plug-In Hybrid for various dynamic test maneuvers and a Genesys Automotive Dynamic Motion Analyzer (ADMA) measurement unit for highprecision measurements of the vehicle's states. Online parameter estimation is shown for friction coefficient estimation performing maneuvers on different road surfaces.

Keywords: vehicle dynamics, state estimation, parameter estimation, unscented Kalman filter, dead-time compensation

### 1. Introduction

In the past decades, enormous developments in automotive research were achieved. Since the beginning of the twentieth century, a consistent search for solutions increasing vehicle's safety and comfort took place. Starting with passive safety systems in the early twentieth century, e.g., airbag, safety belt, and deformable zone, a vast improvement of the passenger's safety was accomplished. These systems reduce passenger injuries and or even death due to accidents.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

Later, starting in the 1960th and 1970th active safety systems or advanced driver assistance systems (ADAS), preventing the vehicle from accidents by actively influencing the vehicle was developed. First implementations were traction control (TCS) and antilock braking systems (ABS), stabilizing the vehicle during longitudinal dynamic maneuvers. In 1995, the superordinate electronic stability control (ESC) was developed, combining stabilization during longitudinal and lateral dynamic maneuvers. Because of its success, ESC is mandatory in modern vehicles in Europe since the end of 2014. Other ADAS, e.g., adaptive cruise control (ACC), autonomous emergency braking (AEB), or lane detection system, have been developed in the meantime, further increasing safety and comfort. Future trends show an enormous potential for advanced systems, finally leading to the objective of autonomous and cooperative driving.

Similarly, various methods considering the estimation algorithm are utilized. For linear models, the Kalman filter serves as an optimal filter. Considering nonlinear models, Kalman filter derivatives, such as extended and unscented Kalman filters (EKF/UKF), are used. The EKF is used for tire road force and sideslip angle estimation in Ref. [9] and for sideslip angle estimation of low friction roads in Ref. [6]. The UKF for vehicle state estimation is presented

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

57

Simultaneous state and parameter estimation with dual extended Kalman filter is presented in Ref. [10], estimating the vehicle mass and moment of inertia around the vertical axis. The same parameters are estimated in Ref. [11] using a joint UKF. Friction coefficient estimation using a

In this chapter, state estimation in vehicle dynamics utilizing an UKF is presented. The estimation is based on measurements taken with standard sensors, which are implemented in modern vehicles. Therefore, a nonlinear process and measurement model are introduced. Furthermore, dead times, due to CAN communication, are considered and compensated using model-based methods. Additionally, simultaneous state and parameter estimation considering the friction coefficient between tires and road is presented. All methods are validated online using a Volkswagen Golf GTE Plug-In Hybrid as the test vehicle, equipped with a Genesys ADMA inertial platform for precise reference measurements. The friction

The chapter is organized as follows: in Section 2, the nonlinear process and measurement models of the vehicle's longitudinal and lateral dynamics are introduced. Based on this, Section 3 addresses the state and parameter estimation utilizing the unscented Kalman filter. Furthermore, dead-time compensation and bounded parameter estimation are introduced. In Section 4, the estimation results, using this method, are presented. Thus, measurements taken on a test vehicle using a precise initial measurement unit are presented and discussed. The

In this section, a detailed parametric model of the vehicle's dynamics is presented. Deriving this model for online application, a trade-off between accuracy and computational effort has to be faced. Starting from the contact patch of tires and road as a predominant source of forces acting on the vehicle, the full dynamics of the vehicle will be derived. Furthermore, a measurement model describing certain measurements, representing the vehicle's dynamics taken with standard sensors is presented. The resulting models form the basis for the later state and

First, the vehicle's tires are considered, representing the contact patch between vehicle and road, consequently providing forces substantially influencing the vehicle's dynamics. These forces arise due to differences in relative motion between tire and road and therefore lead to a

coefficient estimation is validated on a test track with two different surfaces.

chapter is recapped with a Conclusion in Section 5.

parameter estimation algorithm using the UKF.

in [7, 8].

2. Modeling

2.1. Tire model

joint UKF is realized in [12–14].

Many of these ADAS rely on parametric models, describing and predicting the vehicle's (future) behavior. Especially information about the vehicle's stability, characterized by dynamic states, is necessary. Furthermore, information about the vehicle's environment, e.g., by changing weather conditions and therefore changing friction conditions may influence the systems' performance drastically. Thus, online estimation of the vehicle's stability in terms of its dynamic behavior and online estimation of influential parameters, such as the friction coefficient, are challenging fields in modern automotive research.

Many methods for state estimation use simple models of vehicle dynamics to reduce the computational effort, e.g., considering a linear bicycle model [1–3] or a linear planar twotrack model [4]. A further detailed description of the forces acting on the vehicle's tire is developed in Ref. [5] and utilized in Ref. [6]. A more detailed model, considering roll dynamics (cf. Figure 1), is utilized in [7, 8].

Figure 1. Two-track model including roll dynamics of a vehicle performing a left turn.

Similarly, various methods considering the estimation algorithm are utilized. For linear models, the Kalman filter serves as an optimal filter. Considering nonlinear models, Kalman filter derivatives, such as extended and unscented Kalman filters (EKF/UKF), are used. The EKF is used for tire road force and sideslip angle estimation in Ref. [9] and for sideslip angle estimation of low friction roads in Ref. [6]. The UKF for vehicle state estimation is presented in [7, 8].

Simultaneous state and parameter estimation with dual extended Kalman filter is presented in Ref. [10], estimating the vehicle mass and moment of inertia around the vertical axis. The same parameters are estimated in Ref. [11] using a joint UKF. Friction coefficient estimation using a joint UKF is realized in [12–14].

In this chapter, state estimation in vehicle dynamics utilizing an UKF is presented. The estimation is based on measurements taken with standard sensors, which are implemented in modern vehicles. Therefore, a nonlinear process and measurement model are introduced. Furthermore, dead times, due to CAN communication, are considered and compensated using model-based methods. Additionally, simultaneous state and parameter estimation considering the friction coefficient between tires and road is presented. All methods are validated online using a Volkswagen Golf GTE Plug-In Hybrid as the test vehicle, equipped with a Genesys ADMA inertial platform for precise reference measurements. The friction coefficient estimation is validated on a test track with two different surfaces.

The chapter is organized as follows: in Section 2, the nonlinear process and measurement models of the vehicle's longitudinal and lateral dynamics are introduced. Based on this, Section 3 addresses the state and parameter estimation utilizing the unscented Kalman filter. Furthermore, dead-time compensation and bounded parameter estimation are introduced. In Section 4, the estimation results, using this method, are presented. Thus, measurements taken on a test vehicle using a precise initial measurement unit are presented and discussed. The chapter is recapped with a Conclusion in Section 5.

### 2. Modeling

Later, starting in the 1960th and 1970th active safety systems or advanced driver assistance systems (ADAS), preventing the vehicle from accidents by actively influencing the vehicle was developed. First implementations were traction control (TCS) and antilock braking systems (ABS), stabilizing the vehicle during longitudinal dynamic maneuvers. In 1995, the superordinate electronic stability control (ESC) was developed, combining stabilization during longitudinal and lateral dynamic maneuvers. Because of its success, ESC is mandatory in modern vehicles in Europe since the end of 2014. Other ADAS, e.g., adaptive cruise control (ACC), autonomous emergency braking (AEB), or lane detection system, have been developed in the meantime, further increasing safety and comfort. Future trends show an enormous potential for advanced

Many of these ADAS rely on parametric models, describing and predicting the vehicle's (future) behavior. Especially information about the vehicle's stability, characterized by dynamic states, is necessary. Furthermore, information about the vehicle's environment, e.g., by changing weather conditions and therefore changing friction conditions may influence the systems' performance drastically. Thus, online estimation of the vehicle's stability in terms of its dynamic behavior and online estimation of influential parameters, such as the friction coefficient, are challenging fields

Many methods for state estimation use simple models of vehicle dynamics to reduce the computational effort, e.g., considering a linear bicycle model [1–3] or a linear planar twotrack model [4]. A further detailed description of the forces acting on the vehicle's tire is developed in Ref. [5] and utilized in Ref. [6]. A more detailed model, considering roll dynamics

systems, finally leading to the objective of autonomous and cooperative driving.

Figure 1. Two-track model including roll dynamics of a vehicle performing a left turn.

in modern automotive research.

56 Kalman Filters - Theory for Advanced Applications

(cf. Figure 1), is utilized in [7, 8].

In this section, a detailed parametric model of the vehicle's dynamics is presented. Deriving this model for online application, a trade-off between accuracy and computational effort has to be faced. Starting from the contact patch of tires and road as a predominant source of forces acting on the vehicle, the full dynamics of the vehicle will be derived. Furthermore, a measurement model describing certain measurements, representing the vehicle's dynamics taken with standard sensors is presented. The resulting models form the basis for the later state and parameter estimation algorithm using the UKF.

### 2.1. Tire model

First, the vehicle's tires are considered, representing the contact patch between vehicle and road, consequently providing forces substantially influencing the vehicle's dynamics. These forces arise due to differences in relative motion between tire and road and therefore lead to a deformation of the tire due to friction, described by the friction coefficient μ. These differences in velocity can be expressed as tire slip

$$
\lambda = \frac{\omega\_{\text{t}} r\_{\text{t}} - v\_{\text{t},x}}{\max(\omega\_{\text{t}} r\_{\text{t}}, v\_{\text{t},x})},
\tag{1}
$$

for longitudinal and tire sideslip angle

$$\alpha = \delta\_{\mathbf{t}} - \arctan\left(\frac{v\_{\mathbf{t},\mathbf{y}}}{v\_{\mathbf{t},x}}\right) \tag{2}$$

for lateral motion, respectively, where ω<sup>t</sup> represents the rotational velocity of the tire, δ<sup>t</sup> is the tire steering angle, vt, x, <sup>y</sup> is the components of the wheel's velocity vt, and r<sup>t</sup> is the effective tire radius, which is considered a constant. The tire steering angle results from the steering wheel angle δ as δ ¼ istδt, with the assumption of constant steering transition ist. Coming from the well-known Coulomb friction Ffric ¼ μFz, with normal force Fz, the associated stationary tire forces in longitudinal and lateral direction, F<sup>S</sup> <sup>x</sup> and F<sup>S</sup> <sup>y</sup>, are functions of the tire slip and sideslip angle, respectively, given as

$$F\_x^\mathbb{S} = f\_x\left(\lambda, \mu\_{\text{max}}, F\_z\right) h(F\_y),\tag{3}$$

The inputs to the system are the drive and break torques M<sup>d</sup> and Mb, and the steering angle δ (cf. Figure 3). This leads to the equation of motion for the rotational velocity of one tire ω<sup>t</sup>

with the tire's moment of inertia Jt, and a moment due to rolling resistance

Figure 2. Schematic visualization of the used vehicle dynamics model.

2.2. Vehicle body dynamics

Figure 3. Torques and forces acting on the tire.

with constant and velocity dependent part, represented by cres, <sup>1</sup> and cres, 2, respectively.

Considering a two-track model with additional roll dynamics as displayed in Figures 1 and 4, the vehicle's dynamics under disregard of vertical dynamics can be described by the vehicle's yaw-rate ψ\_ , its sideslip angle β, the roll angle and rate κ and κ\_, and its center of gravity (c.o.g.)

Jtω\_ <sup>t</sup> ¼ M<sup>d</sup> � M<sup>b</sup> � Mres � Fxrt, (7)

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

59

Mres ¼ Fzð Þ cres, <sup>1</sup> þ cres,2ω<sup>t</sup> , (8)

$$F\_y^S = f\_y\left(\alpha, \mu\_{\text{max}}, F\_z\right) h(F\_x),\tag{4}$$

assuming identical maximum friction coefficient for longitudinal and lateral forces. The nonlinear functions f x,y represent the (side)slip dependency of the tire forces by the magic formula tire model described by

$$f\_{x,y}(\chi, \mu\_{\text{max}}, F\_z) = D \sin \left( \text{Corctan} \left( B \frac{X}{\mu\_{\text{max}}} - E \left( B \frac{X}{\mu\_{\text{max}}} - \arctan \left( B \frac{X}{\mu\_{\text{max}}} \right) \right) \right) \right), \tag{5}$$

with individual parameters for longitudinal and lateral dynamics D ¼ μmaxFz, B ¼ CF=CD, and C<sup>F</sup> ¼ c<sup>1</sup> sin 2arctan ð Þ ð Þ Fz=c<sup>2</sup> , while χ represents the slip λ or sideslip α [5]. Using this representation, the function maximum varies linearly over the (side)slip with changing maximum friction coefficient (cf. dashed black line in Figure 2). The function f <sup>y</sup> λ; μmax; Fz for one set of parameters C, E, c1, and c2, constant wheel load Fz and changing maximum friction coefficient μmax, representing dry, wet, and icy conditions can be seen in Figure 2.

The function h Fx,y <sup>¼</sup> cos arctan BxyFy,x accounts for the reduced forces in the presence of both lateral and longitudinal forces, with scaling factor Bxy [15]. Furthermore, the lateral forces Fy are modeled as PT1-element as

$$F\_y + \frac{l\_t}{\sigma\_{\text{t,x}}} \dot{F}\_y = f\_y(\alpha, \mu\_{\text{max}}, F\_z) h(F\_x), \tag{6}$$

with tire-delay constant l<sup>t</sup> [16].

Figure 2. Schematic visualization of the used vehicle dynamics model.

The inputs to the system are the drive and break torques M<sup>d</sup> and Mb, and the steering angle δ (cf. Figure 3). This leads to the equation of motion for the rotational velocity of one tire ω<sup>t</sup>

$$J\_t \dot{\omega}\_t = M\_\text{d} - M\_\text{b} - M\_\text{res} - F\_\text{x} r\_\text{tv} \tag{7}$$

with the tire's moment of inertia Jt, and a moment due to rolling resistance

$$M\_{\text{res}} = F\_z(c\_{\text{res, 1}} + c\_{\text{res, 2}}\omega\_{\text{t}}),\tag{8}$$

with constant and velocity dependent part, represented by cres, <sup>1</sup> and cres, 2, respectively.

#### 2.2. Vehicle body dynamics

deformation of the tire due to friction, described by the friction coefficient μ. These differences

, (1)

, (2)

<sup>y</sup>, are functions of the tire slip and sideslip

, (3)

h Fð Þ<sup>x</sup> , (4)

� arctan <sup>B</sup> <sup>χ</sup>

h Fð Þ<sup>x</sup> , (6)

μmax

for one set of

, (5)

<sup>λ</sup> <sup>¼</sup> <sup>ω</sup>tr<sup>t</sup> � <sup>v</sup>t,x max ωtr<sup>t</sup> ð Þ ; vt, <sup>x</sup>

α ¼ δ<sup>t</sup> � arctan

for lateral motion, respectively, where ω<sup>t</sup> represents the rotational velocity of the tire, δ<sup>t</sup> is the tire steering angle, vt, x, <sup>y</sup> is the components of the wheel's velocity vt, and r<sup>t</sup> is the effective tire radius, which is considered a constant. The tire steering angle results from the steering wheel angle δ as δ ¼ istδt, with the assumption of constant steering transition ist. Coming from the well-known Coulomb friction Ffric ¼ μFz, with normal force Fz, the associated stationary tire

<sup>x</sup> and F<sup>S</sup>

h Fy

<sup>x</sup> ¼ f <sup>x</sup> λ; μmax; Fz

<sup>y</sup> ¼ f <sup>y</sup> α; μmax; Fz

assuming identical maximum friction coefficient for longitudinal and lateral forces. The nonlinear functions f x,y represent the (side)slip dependency of the tire forces by the magic

μmax

with individual parameters for longitudinal and lateral dynamics D ¼ μmaxFz, B ¼ CF=CD, and C<sup>F</sup> ¼ c<sup>1</sup> sin 2arctan ð Þ ð Þ Fz=c<sup>2</sup> , while χ represents the slip λ or sideslip α [5]. Using this representation, the function maximum varies linearly over the (side)slip with changing maximum

parameters C, E, c1, and c2, constant wheel load Fz and changing maximum friction coefficient

both lateral and longitudinal forces, with scaling factor Bxy [15]. Furthermore, the lateral forces

<sup>y</sup> ¼ f <sup>y</sup> α; μmax; Fz

friction coefficient (cf. dashed black line in Figure 2). The function f <sup>y</sup> λ; μmax; Fz

μmax, representing dry, wet, and icy conditions can be seen in Figure 2.

Fy þ lt vt, <sup>x</sup> F\_ � E B <sup>χ</sup>

μmax

accounts for the reduced forces in the presence of

vt, <sup>y</sup> vt, <sup>x</sup> 

in velocity can be expressed as tire slip

58 Kalman Filters - Theory for Advanced Applications

for longitudinal and tire sideslip angle

forces in longitudinal and lateral direction, F<sup>S</sup>

FS

FS

<sup>¼</sup> <sup>D</sup> sin <sup>C</sup>arctan <sup>B</sup> <sup>χ</sup>

<sup>¼</sup> cos arctan BxyFy,x

angle, respectively, given as

formula tire model described by

f x, <sup>y</sup> χ; μmax; Fz

The function h Fx,y

Fy are modeled as PT1-element as

with tire-delay constant l<sup>t</sup> [16].

Considering a two-track model with additional roll dynamics as displayed in Figures 1 and 4, the vehicle's dynamics under disregard of vertical dynamics can be described by the vehicle's yaw-rate ψ\_ , its sideslip angle β, the roll angle and rate κ and κ\_, and its center of gravity (c.o.g.)

Figure 3. Torques and forces acting on the tire.

Figure 4. Top view of a two-track model including geometrical parameters.

velocity v. These quantities represent the angular velocity of rotation around the vertical axis, the angle between the vehicle's longitudinal axis and its velocity vector, the angle and rate between the vehicle's vertical axis and the stationary vertical axis, and the velocity of the center of gravity, respectively. This leads to the following equations of motion

$$J\_z \ddot{\psi} = l\_t \left( F\_{y1} + F\_{y2} \right) \cos \left( \delta\_t \right) - l\_t \left( F\_{y3} + F\_{y4} \right) - \sum\_{i=1}^{4} M\_{z,i\nu} \tag{9}$$

2.3. Measurement model

using first-order Euler discretization.

tation. Further details can be found in Ref. [15].

3. State and parameter estimation

system state and y∈ R<sup>7</sup>�<sup>1</sup> represents the measurement vector.

ment vector

Inside the vehicle, standard sensors are implemented to obtain information about the current driving state. These sensors measure the yaw-rate ψ\_ , longitudinal and lateral acceleration ax, <sup>s</sup> and ay, s, and the four rotational velocities of the vehicle's tires ωi. This leads to the measure-

> <sup>y</sup> <sup>¼</sup> <sup>ψ</sup>\_ ; ax, <sup>s</sup>; ay, <sup>s</sup>; <sup>ω</sup>t,i <sup>T</sup>

tions in the sensor position ax, <sup>s</sup> and ay, s, respectively, can be described by

A measurement model representing these sensors is needed for the later implementation of KF derivatives. Since the measured yaw-rate and wheel velocities are states within the model, they are obtained directly and no further model is needed. The longitudinal and lateral accelera-

ay, <sup>s</sup> <sup>¼</sup> <sup>v</sup>\_ sin <sup>β</sup> <sup>þ</sup> <sup>v</sup> <sup>β</sup>\_ <sup>þ</sup> <sup>ψ</sup>\_ cos <sup>β</sup> � lzκ€ <sup>þ</sup> lxψ€ � lyκ\_ <sup>2</sup> � lyψ\_ <sup>2</sup>

with lx, ly, and lz being the components of the distances from the c.o.g. to the sensor position.

Due to the sensors' sampling rate of 100Hz, all later implementations on the control unit will be running at this frequency. Therefore, the continuous time differential Eqs. (1)–(18) are discretized

Within the model, numerous parameters are utilized. These parameters can either be measured directly, e.g., geometrical parameters, or need to be identified using an offline identification algorithm. Since the model is strongly nonlinear, a particle swarm algorithm (PSO) is used. Therefore, measurements representing longitudinal and lateral dynamics, driven by a test vehicle, have to be performed. Hence, a sequential identification can be realized, first considering longitudinal excitation, neglecting lateral dynamics and subsequently lateral exci-

In summary, the vehicle's dynamics can be expressed by the discrete time state space representation

at discrete time step k with all parameters included in p. Thereby, x∈ R<sup>13</sup>�<sup>1</sup> represents the

In this section, a brief overview over the used Kalman filter derivative will be given. At first, the algorithm for state estimation will be presented. Furthermore, a model-based dead-time

ax, <sup>s</sup> <sup>¼</sup> <sup>v</sup>\_ cos <sup>β</sup> � <sup>v</sup> <sup>β</sup>\_ <sup>þ</sup> <sup>ψ</sup>\_ sin <sup>β</sup> � lyψ€ <sup>þ</sup> <sup>ψ</sup>\_ lzκ\_ � lxψ\_ , (17)

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

x<sup>k</sup>þ<sup>1</sup> ¼ f xk; u<sup>k</sup> ð Þ ; p , (19)

<sup>y</sup><sup>k</sup>þ<sup>1</sup> <sup>¼</sup> g xð Þ <sup>k</sup>þ<sup>1</sup>; <sup>u</sup><sup>k</sup>þ<sup>1</sup>; <sup>p</sup> , (20)

: (16)

http://dx.doi.org/10.5772/intechopen.71900

61

, (18)

$$
\hbar m \upsilon \left(\dot{\beta} + \dot{\psi}\right) = \left(F\_{y1} + F\_{y2}\right) \cos\left(\beta - \delta\_t\right) + \left(F\_{y3} + F\_{y4}\right) \cos\left(\beta\right),
\tag{10}
$$

$$m\dot{v} = (F\_{x1} + F\_{x2})\cos\left(\beta - \delta\_t\right) + (F\_{x3} + F\_{x4})\cos\left(\beta\right) - F\_{\text{air}} \tag{11}$$

$$m\_{\mathbf{a}}h\_{\mathbf{r}}a\_{\mathbf{y}} = f\_{\mathbf{x}}\ddot{\mathbf{x}} + d\_{\mathbf{x}}(\dot{\mathbf{x}}) - c\_{\mathbf{x}}(\kappa) - m\_{\mathbf{a}}gh\_{\mathbf{r}}\sin\kappa,\tag{12}$$

with lf, l<sup>r</sup> being the distance between front and rear axes to the c.o.g., respectively, mass m being moment of inertia with respect to the vertical axis Jz, velocity and acceleration of the c.o. g. v, v\_, forces due to air resistance Fair, and self-aligning torques Mz,i.

Roll dynamics are represented in analogy to a spring-damper system with gravitational influence with chassis mass ma, distance between roll axis and c.o.g. hr, moment of inertia with respect to the roll axis Jκ, gravitational acceleration g, and nonlinear spring and damper coefficients cκð Þ κ and dκ\_ð Þ κ\_ , respectively. These characteristics are represented by

$$\mathfrak{c}\_{\mathfrak{k}}(\mathfrak{k}) = \mathfrak{c}\_{\mathfrak{k},1}\mathfrak{k} + \mathfrak{c}\_{\mathfrak{k},2}\mathfrak{k}^3,\tag{13}$$

$$d\_{\dot{\kappa}}(\dot{\kappa}) = d\_{\dot{\kappa},1}\dot{\kappa} + d\_{\dot{\kappa},2} \tanh(\dot{\kappa}). \tag{14}$$

These constants result from combinations of suspension and stabilization constants cf,r, df,r, and cst,f,r, respectively (cf. Figure 1). In conclusion, the resulting system state vector can be expressed as

$$\mathbf{x} = \begin{bmatrix} \dot{\psi}, \boldsymbol{\beta}, \kappa, \dot{\kappa}, F\_{\mathbf{y},i}, \boldsymbol{\omega}\_i, \boldsymbol{\upsilon} \end{bmatrix}^{\mathrm{T}}. \tag{15}$$

#### 2.3. Measurement model

velocity v. These quantities represent the angular velocity of rotation around the vertical axis, the angle between the vehicle's longitudinal axis and its velocity vector, the angle and rate between the vehicle's vertical axis and the stationary vertical axis, and the velocity of the center

with lf, l<sup>r</sup> being the distance between front and rear axes to the c.o.g., respectively, mass m being moment of inertia with respect to the vertical axis Jz, velocity and acceleration of the c.o.

Roll dynamics are represented in analogy to a spring-damper system with gravitational influence with chassis mass ma, distance between roll axis and c.o.g. hr, moment of inertia with respect to the roll axis Jκ, gravitational acceleration g, and nonlinear spring and damper

<sup>c</sup>κð Þ¼ <sup>κ</sup> <sup>c</sup>κ, <sup>1</sup><sup>κ</sup> <sup>þ</sup> <sup>c</sup>κ,2κ<sup>3</sup>

These constants result from combinations of suspension and stabilization constants cf,r, df,r, and cst,f,r, respectively (cf. Figure 1). In conclusion, the resulting system state vector can be

<sup>x</sup> <sup>¼</sup> <sup>ψ</sup>\_ ; <sup>β</sup>; <sup>κ</sup>; <sup>κ</sup>\_; Fy,i; <sup>ω</sup>i; <sup>v</sup> � �<sup>T</sup>

coefficients cκð Þ κ and dκ\_ð Þ κ\_ , respectively. These characteristics are represented by

� � �X<sup>4</sup>

mahra<sup>y</sup> ¼ Jκκ€ þ dκð Þ� κ\_ cκð Þ� κ magh<sup>r</sup> sin κ, (12)

dκ\_ð Þ¼ κ\_ dκ\_,1κ\_ þ dκ\_, 2tanhð Þ κ\_ : (14)

� � cos β

� � <sup>þ</sup> Fy<sup>3</sup> <sup>þ</sup> Fy<sup>4</sup>

� � <sup>þ</sup> ð Þ Fx<sup>3</sup> <sup>þ</sup> Fx<sup>4</sup> cos <sup>β</sup>

<sup>i</sup>¼<sup>1</sup> Mz,i, (9)

� � � <sup>F</sup>air, (11)

, (13)

: (15)

� �, (10)

� � cos ð Þ� <sup>δ</sup><sup>t</sup> <sup>l</sup><sup>r</sup> Fy<sup>3</sup> <sup>þ</sup> Fy<sup>4</sup>

� � cos <sup>β</sup> � <sup>δ</sup><sup>t</sup>

of gravity, respectively. This leads to the following equations of motion

Jzψ€ <sup>¼</sup> <sup>l</sup><sup>f</sup> Fy<sup>1</sup> <sup>þ</sup> Fy<sup>2</sup>

Figure 4. Top view of a two-track model including geometrical parameters.

60 Kalman Filters - Theory for Advanced Applications

expressed as

mv <sup>β</sup>\_ <sup>þ</sup> <sup>ψ</sup>\_ � � <sup>¼</sup> Fy<sup>1</sup> <sup>þ</sup> Fy<sup>2</sup>

mv\_ ¼ ð Þ Fx<sup>1</sup> þ Fx<sup>2</sup> cos β � δ<sup>t</sup>

g. v, v\_, forces due to air resistance Fair, and self-aligning torques Mz,i.

Inside the vehicle, standard sensors are implemented to obtain information about the current driving state. These sensors measure the yaw-rate ψ\_ , longitudinal and lateral acceleration ax, <sup>s</sup> and ay, s, and the four rotational velocities of the vehicle's tires ωi. This leads to the measurement vector

$$y = \begin{bmatrix} \dot{\psi}, a\_{x,s}, a\_{y,s}, a\_{\mathbf{t},i} \end{bmatrix}^{\mathrm{T}}.\tag{16}$$

A measurement model representing these sensors is needed for the later implementation of KF derivatives. Since the measured yaw-rate and wheel velocities are states within the model, they are obtained directly and no further model is needed. The longitudinal and lateral accelerations in the sensor position ax, <sup>s</sup> and ay, s, respectively, can be described by

$$a\_{\mathbf{x},s} = \dot{\upsilon}\cos\beta - \upsilon(\dot{\beta} + \dot{\psi})\sin\beta - l\_y\ddot{\psi} + \dot{\psi}(l\_z\dot{\kappa} - l\_x\dot{\psi}),\tag{17}$$

$$a\_{y,s} = \dot{\upsilon}\sin\beta + \upsilon(\dot{\beta} + \dot{\psi})\cos\beta - l\_z\ddot{\kappa} + l\_x\ddot{\psi} - l\_y\dot{\kappa}^2 - l\_y\dot{\psi}^2. \tag{18}$$

with lx, ly, and lz being the components of the distances from the c.o.g. to the sensor position.

Due to the sensors' sampling rate of 100Hz, all later implementations on the control unit will be running at this frequency. Therefore, the continuous time differential Eqs. (1)–(18) are discretized using first-order Euler discretization.

Within the model, numerous parameters are utilized. These parameters can either be measured directly, e.g., geometrical parameters, or need to be identified using an offline identification algorithm. Since the model is strongly nonlinear, a particle swarm algorithm (PSO) is used. Therefore, measurements representing longitudinal and lateral dynamics, driven by a test vehicle, have to be performed. Hence, a sequential identification can be realized, first considering longitudinal excitation, neglecting lateral dynamics and subsequently lateral excitation. Further details can be found in Ref. [15].

In summary, the vehicle's dynamics can be expressed by the discrete time state space representation

$$\mathbf{x}\_{k+1} = f(\mathbf{x}\_k, \mathbf{u}\_k; \mathbf{p}), \tag{19}$$

$$\mathfrak{g}\_{k+1} = \mathfrak{g}(\mathfrak{x}\_{k+1}, \mathfrak{u}\_{k+1}; p), \tag{20}$$

at discrete time step k with all parameters included in p. Thereby, x∈ R<sup>13</sup>�<sup>1</sup> represents the system state and y∈ R<sup>7</sup>�<sup>1</sup> represents the measurement vector.

#### 3. State and parameter estimation

In this section, a brief overview over the used Kalman filter derivative will be given. At first, the algorithm for state estimation will be presented. Furthermore, a model-based dead-time compensation will be introduced. Secondly, the joint UKF for state and parameter estimation will be presented. Subsequently, an extension for the estimation of bounded parameters is introduced.

#### 3.1. The unscented Kalman filter for state estimation

The process and measurement model presented in Section 2 are strongly nonlinear, especially considering the forces acting on the vehicle's tires (cf. Eq. (5)). Therefore, a Kalman filter derivative, capable of estimating nonlinear systems, the UKF is utilized. Since no information about the covariance is available, the additive form of the process and measurement equations

$$\mathbf{x}\_{k+1} = f(\mathbf{x}\_k, \mathbf{u}\_k; \mathbf{p}) + \mathbf{w}\_{k\prime} \tag{21}$$

y�

y�

Pxy, <sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>X</sup><sup>2</sup>nx

Pyy, <sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>X</sup><sup>2</sup>nx

state and covariance, <sup>b</sup>x<sup>k</sup>þ<sup>1</sup> and <sup>P</sup>b<sup>k</sup>þ1, respectively [18].

<sup>x</sup><sup>k</sup>þj�1,i <sup>¼</sup> <sup>b</sup><sup>x</sup> <sup>k</sup>þj�<sup>1</sup> <sup>þ</sup>

<sup>x</sup><sup>k</sup>þj�1,i <sup>¼</sup> <sup>b</sup><sup>x</sup> <sup>k</sup>þj�<sup>1</sup> �

with weighting factors W<sup>m</sup>, <sup>c</sup>

3.2. Dead-time compensation

estimation is presented.

dead time is

for j = 1 to nt<sup>d</sup> do

Following this, a measurement <sup>y</sup><sup>k</sup>þ<sup>1</sup> is received and the measurement update

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>c</sup> <sup>i</sup> x�

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>c</sup> <sup>i</sup> x�

<sup>b</sup>x<sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>x</sup>�

Pb<sup>k</sup>þ<sup>1</sup> ¼ P�

<sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>X</sup><sup>2</sup>nx

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>m</sup> <sup>i</sup> y� kþ1,i

<sup>k</sup>þ1,i � <sup>x</sup>� kþ1 � � <sup>y</sup>�

<sup>k</sup>þ1,i � <sup>x</sup>� kþ1 � � <sup>y</sup>�

<sup>k</sup>þ<sup>1</sup> <sup>þ</sup> <sup>K</sup><sup>k</sup>þ<sup>1</sup> <sup>y</sup><sup>k</sup>þ<sup>1</sup> � <sup>y</sup>�

<sup>k</sup>þ<sup>1</sup> � Kkþ<sup>1</sup>Pyy, <sup>k</sup>þ<sup>1</sup>K<sup>T</sup>

When designing online methods for real-time applications, dead times are frequently to face. Especially, considering vehicular applications, the communication is realized via CAN-Bus, leading to dead times. In the following, a method to compensate for dead times within state

Since the measurement update (Eqs. (31)–(35)) can only be processed, as soon as a measurement yk is received, dead times t<sup>d</sup> corrupt the UKF severely. Ignoring this dead time may lead to poor filter performance or even divergence. One solution is to accept the dead time and delay the estimation by exact this time. Alternatively, the system's state and covariance can be estimated by performing the process update (Eqs. (26)–(28)) during the dead time without doing the measurement update, based on the delayed filter estimation up to time step k, so that the state estimation at discrete time step k þ nt<sup>d</sup> , where nt<sup>d</sup> is the number of discrete time steps due to the

> ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð Þ n þ λukf Pb

� �

kþj�1

i�nx

kþj�1

i

q

q

x�

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð Þ n þ λukf Pb

� �

<sup>K</sup><sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>P</sup>xy, <sup>k</sup>þ<sup>1</sup>P�<sup>1</sup>

<sup>k</sup>þ1,i <sup>¼</sup> h x<sup>k</sup>þ1,i ð Þ ; <sup>u</sup><sup>k</sup>þ<sup>1</sup>; <sup>p</sup> , (29)

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

<sup>k</sup>þ1,i � <sup>y</sup>� kþ1 � �<sup>T</sup>

<sup>k</sup>þ1,i � <sup>y</sup>� kþ1 � �<sup>T</sup>

kþ1

<sup>i</sup> can be executed. This leads to the a posteriori estimations of the

<sup>x</sup><sup>k</sup>þj�1,<sup>0</sup> <sup>¼</sup> <sup>b</sup>x<sup>k</sup>þj�<sup>1</sup> (36)

<sup>k</sup>þj,i <sup>¼</sup> f x<sup>k</sup>þj�<sup>1</sup>; <sup>u</sup><sup>k</sup>�<sup>1</sup>; <sup>p</sup> � � (39)

for i ¼ 1, …, nx (37)

for i ¼ i þ 1, …, 2nx (38)

: (30)

http://dx.doi.org/10.5772/intechopen.71900

yy, <sup>k</sup>þ1, (33)

<sup>k</sup>þ<sup>1</sup>, (35)

� �, (34)

, (31)

63

, (32)

$$\mathbf{y}\_{k+1} = \mathbf{g}(\mathbf{x}\_{k+1}, \mathbf{u}\_{k+1}; \mathbf{p}) + \mathbf{v}\_{k+1} \tag{22}$$

with <sup>w</sup><sup>k</sup> <sup>∝</sup> <sup>N</sup> ð Þ <sup>0</sup>; <sup>Q</sup> , <sup>Q</sup> <sup>∈</sup> <sup>R</sup>nx�nx and <sup>v</sup><sup>k</sup> <sup>∝</sup> <sup>N</sup> ð Þ <sup>0</sup>; <sup>R</sup> , <sup>R</sup> <sup>∈</sup> <sup>R</sup>ny�ny representing the process and measurement uncertainties by uncorrelated Gaussian random numbers, is assumed. The system state and measurement are described by the state and measurement vectors x<sup>k</sup> ∈ Rnx and <sup>y</sup><sup>k</sup> <sup>∈</sup> <sup>R</sup>ny with state dimension nx and measurement dimension ny. To initialize the filter, initial values for the state and covariance estimation, <sup>b</sup>x<sup>0</sup> <sup>∈</sup> <sup>R</sup>nx and <sup>P</sup>b<sup>0</sup> <sup>∈</sup> <sup>R</sup>nx�nx , respectively, have to be set. Following this, the recursive estimation divided in two steps, i.e., the process and measurement update can be realized. Within the process update, an a priori state and covariance estimation utilizing the process model is executed. Using the unscented transformation [17], a carefully chosen set of 2nx þ 1 sigma points for time step k ∈f g 0;…; ∞

$$
\mathfrak{x}\_{k,0} = \widehat{\mathfrak{x}}\_{k\prime} \tag{23}
$$

$$\mathbf{x}\_{k,i} = \widehat{\mathbf{x}}\_k + \left(\sqrt{(\mathbf{u} + \lambda\_{\text{ukf}})} \widehat{\boldsymbol{P}}\_k\right)\_i \text{ for } i = 1, \dots, n\_{\text{x}} \tag{24}$$

$$\mathbf{x}\_{k,i} = \widehat{\mathbf{x}}\_{k} - \left(\sqrt{(n + \lambda\_{\text{ukf}})} \widehat{\boldsymbol{P}}\_{k}\right)\_{i - n\_{\text{x}}} \quad \text{for} \quad i = i + 1, \ldots, 2n\_{\text{x}} \tag{25}$$

with <sup>b</sup>xk and <sup>P</sup>b<sup>k</sup> representing the current state and covariance estimation, respectively, are calculated. Thereby, λukf ¼ αukfnx þ κukf � nx, with scaling parameters αukf and κukf. Furthermore, ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð Þ n þ λukf Pb q k � � i is the ith column of the matrix square root, e.g., using Cholesky decomposition. These sigma points characterize the current probability density function and undergo the real nonlinear transformation utilizing Eq. (21) to calculate the a priori estimation as

$$\mathbf{x}\_{k+1,i}^{-} = f(\mathbf{x}\_{k,i}, \mathbf{u}\_k; \mathbf{p})\_{\prime} \tag{26}$$

$$\mathbf{x}\_{k+1}^{-} = \sum\_{i=0}^{2n\_{\mathbf{r}}} \mathcal{W}\_{i}^{\mathbf{m}} \mathbf{x}\_{k+1,i'}^{-} \tag{27}$$

$$P\_k^- - = \sum\_{i=0}^{2n\_\pi} W\_i^\p \left( \mathbf{x}\_{k+1,i}^- - \mathbf{x}\_{k+1}^- \right) \left( \mathbf{x}\_{k+1,i}^- - \mathbf{x}\_{k+1}^- \right)^\top,\tag{28}$$

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics http://dx.doi.org/10.5772/intechopen.71900 63

$$y\_{k+1,i}^{-}=h(\mathbf{x}\_{k+1,i}, \mathbf{u}\_{k+1}; p)\_{\prime} \tag{29}$$

$$\boldsymbol{y}\_{k+1}^{-}=\sum\_{i=0}^{2n\_x}\boldsymbol{W}\_i^{\mathrm{m}}\boldsymbol{y}\_{k+1,i}^{-}.\tag{30}$$

Following this, a measurement <sup>y</sup><sup>k</sup>þ<sup>1</sup> is received and the measurement update

$$P\_{xy,k+1} = \sum\_{i=0}^{2n\_x} \mathcal{W}\_i^c \left(\mathbf{x}\_{k+1,i}^- - \mathbf{x}\_{k+1}^-\right) \left(\mathbf{y}\_{k+1,i}^- - \mathbf{y}\_{k+1}^-\right)^T,\tag{31}$$

$$P\_{yy,k+1} = \sum\_{i=0}^{2u\_x} W\_i^c \left(\mathbf{x}\_{k+1,i}^- - \mathbf{x}\_{k+1}^-\right) \left(\mathbf{y}\_{k+1,i}^- - \mathbf{y}\_{k+1}^-\right)^T,\tag{32}$$

$$\mathbf{K}\_{k+1} = \mathbf{P}\_{xy,k+1} \mathbf{P}\_{yy,k+1}^{-1} \tag{33}$$

$$
\widehat{\mathbf{x}}\_{k+1} = \mathbf{x}\_{k+1}^{-} + \mathbf{K}\_{k+1} (\mathbf{y}\_{k+1} - \mathbf{y}\_{k+1}^{-})\_{\prime} \tag{34}
$$

$$
\widehat{\mathbf{P}}\_{k+1} = \mathbf{P}\_{k+1}^{-} - \mathbf{K}\_{k+1} \mathbf{P}\_{yy,k+1} \mathbf{K}\_{k+1'}^{\mathrm{T}} \tag{35}
$$

with weighting factors W<sup>m</sup>, <sup>c</sup> <sup>i</sup> can be executed. This leads to the a posteriori estimations of the state and covariance, <sup>b</sup>x<sup>k</sup>þ<sup>1</sup> and <sup>P</sup>b<sup>k</sup>þ1, respectively [18].

#### 3.2. Dead-time compensation

compensation will be introduced. Secondly, the joint UKF for state and parameter estimation will be presented. Subsequently, an extension for the estimation of bounded parameters is introduced.

The process and measurement model presented in Section 2 are strongly nonlinear, especially considering the forces acting on the vehicle's tires (cf. Eq. (5)). Therefore, a Kalman filter derivative, capable of estimating nonlinear systems, the UKF is utilized. Since no information about the covariance is available, the additive form of the process and measure-

with <sup>w</sup><sup>k</sup> <sup>∝</sup> <sup>N</sup> ð Þ <sup>0</sup>; <sup>Q</sup> , <sup>Q</sup> <sup>∈</sup> <sup>R</sup>nx�nx and <sup>v</sup><sup>k</sup> <sup>∝</sup> <sup>N</sup> ð Þ <sup>0</sup>; <sup>R</sup> , <sup>R</sup> <sup>∈</sup> <sup>R</sup>ny�ny representing the process and measurement uncertainties by uncorrelated Gaussian random numbers, is assumed. The system state and measurement are described by the state and measurement vectors x<sup>k</sup> ∈ Rnx and <sup>y</sup><sup>k</sup> <sup>∈</sup> <sup>R</sup>ny with state dimension nx and measurement dimension ny. To initialize the filter, initial values for the state and covariance estimation, <sup>b</sup>x<sup>0</sup> <sup>∈</sup> <sup>R</sup>nx and <sup>P</sup>b<sup>0</sup> <sup>∈</sup> <sup>R</sup>nx�nx , respectively, have to be set. Following this, the recursive estimation divided in two steps, i.e., the process and measurement update can be realized. Within the process update, an a priori state and covariance estimation utilizing the process model is executed. Using the unscented transformation [17], a

> ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð Þ n þ λukf Pb

� �

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð Þ n þ λukf Pb

� �

real nonlinear transformation utilizing Eq. (21) to calculate the a priori estimation as

<sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>X</sup><sup>2</sup>nx

x�

x�

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>c</sup> <sup>i</sup> x� k

i�nx

is the ith column of the matrix square root, e.g., using Cholesky decomposi-

x� <sup>k</sup>þ1,i � <sup>x</sup>� kþ1 � �<sup>T</sup>

k

with <sup>b</sup>xk and <sup>P</sup>b<sup>k</sup> representing the current state and covariance estimation, respectively, are calculated. Thereby, λukf ¼ αukfnx þ κukf � nx, with scaling parameters αukf and κukf. Furthermore,

tion. These sigma points characterize the current probability density function and undergo the

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>m</sup> <sup>i</sup> x� kþ1,i

<sup>k</sup>þ1,i � <sup>x</sup>� kþ1

� �

i

carefully chosen set of 2nx þ 1 sigma points for time step k ∈f g 0;…; ∞

q

q

xk,i <sup>¼</sup> <sup>b</sup>xk <sup>þ</sup>

xk,i <sup>¼</sup> <sup>b</sup><sup>x</sup> <sup>k</sup> �

P�

<sup>k</sup> � ¼ <sup>X</sup><sup>2</sup>nx

x<sup>k</sup>þ<sup>1</sup> ¼ f xk; u<sup>k</sup> ð Þþ ; p wk, (21)

xk,<sup>0</sup> <sup>¼</sup> <sup>b</sup>xk, (23)

<sup>k</sup>þ1,i <sup>¼</sup> f xk,i; <sup>u</sup><sup>k</sup> ð Þ ; <sup>p</sup> , (26)

for i ¼ 1, …, nx, (24)

for i ¼ i þ 1, …, 2nx, (25)

, (27)

, (28)

<sup>y</sup><sup>k</sup>þ<sup>1</sup> <sup>¼</sup> g xð Þþ <sup>k</sup>þ<sup>1</sup>; <sup>u</sup><sup>k</sup>þ<sup>1</sup>; <sup>p</sup> <sup>v</sup><sup>k</sup>þ<sup>1</sup>, (22)

3.1. The unscented Kalman filter for state estimation

62 Kalman Filters - Theory for Advanced Applications

ment equations

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð Þ n þ λukf Pb

� �

k

i

q

When designing online methods for real-time applications, dead times are frequently to face. Especially, considering vehicular applications, the communication is realized via CAN-Bus, leading to dead times. In the following, a method to compensate for dead times within state estimation is presented.

Since the measurement update (Eqs. (31)–(35)) can only be processed, as soon as a measurement yk is received, dead times t<sup>d</sup> corrupt the UKF severely. Ignoring this dead time may lead to poor filter performance or even divergence. One solution is to accept the dead time and delay the estimation by exact this time. Alternatively, the system's state and covariance can be estimated by performing the process update (Eqs. (26)–(28)) during the dead time without doing the measurement update, based on the delayed filter estimation up to time step k, so that the state estimation at discrete time step k þ nt<sup>d</sup> , where nt<sup>d</sup> is the number of discrete time steps due to the dead time is

for j = 1 to nt<sup>d</sup> do

$$\mathfrak{X}\_{k+j-1,0} = \widehat{\mathfrak{X}}\_{k+j-1} \tag{36}$$

$$\mathfrak{x}\_{k+j-1,i} = \widehat{\mathfrak{x}}\_{k+j-1} + \left(\sqrt{(n+\lambda\_{\text{ukf}})} \widehat{\mathbf{P}}\_{k+j-1}\right)\_i \text{ for } i = 1, \ldots, n\_x \tag{37}$$

$$\mathbf{x}\_{k+j-1,i} = \widehat{\mathbf{x}}\_{k+j-1} - \left(\sqrt{(n+\lambda\_{\text{ukf}})\widehat{\mathbf{P}}\_{k+j-1}}\right)\_{i-n\_x} \text{ for } i = i+1,\ldots,2n\_x \tag{38}$$

$$\mathfrak{x}\_{k+j,i}^{-} = f(\mathfrak{x}\_{k+j-1}, \mathfrak{u}\_{k-1}; \mathfrak{p}) \tag{39}$$

$$
\widehat{\mathfrak{X}}\_{k+j} = \sum\_{i=0}^{2n\_{\mathfrak{x}}} \mathcal{W}\_i^{\mathfrak{m}} \mathfrak{x}\_{k++j,i}^{-} \tag{40}
$$

first, the test vehicle and the measurement equipment that is necessary for the validation are introduced. Secondly, the results of the vehicle state estimation and the results by considering dead time within the estimation are shown. Furthermore, a simultaneous state and friction estimation are presented that exhibit improved estimation results for varying

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

65

The estimation results are verified by using a Volkswagen Golf GTE Plug-In Hybrid (Figure 5(a)) equipped with a Genesys ADMA-G-Eco + (Figure 5(b)). This system is developed especially for vehicle dynamics testing in the automotive sector. This inertial measurement unit (IMU) corrected by global positioning system (GPS) enables precise measurement of acceleration, speed, and position of the moving test vehicle in all three-dimensional axes. Furthermore, the pitch, roll and yaw angles, angular velocities as well as sideslip angle can be obtained. The GPS antenna is mounted on the roof of the test vehicle, whereas the IMU is placed in the footwell of the passenger seat. Ideally, the two sensors are placed in the center of gravity; unfortunately, in praxis, this requirement usually either cannot or can only be fulfilled with very high effort. Furthermore, it is hardly possible to exactly align the ADMA's measurement axes with the vehicle's axes. The errors caused by the distance between the installation position and the c.o.g as well as by misalignment angle can be mathematically compensated considering the lever arms and the angle offsets, respectively. The IMU's measurements are exclusively provided for the validation of the Kalman filter application. Additional measurements of the wheel speeds, accelerations and yaw rate as well as system inputs, i.e., steering angle, engine, and breaking torque, are taken from the vehicle's bus system. The onboard measurements are provided for the measurement update of the real-time Kalman filter application. Furthermore, an ES910 prototyping and interface module provides the connection to the vehicle bus and the computa-

The UKF utilizes a two-track model including roll dynamics as described in Section 2. The

road conditions.

4.1. Measurement setup

tion of the filter application with system-level behavior.

estimator's state and measurement vector were therefore

4.2. Unscented Kalman filter setup

Figure 5. Test vehicle and measurement equipment.

$$\hat{\mathbf{P}}\_{k+j} = \sum\_{i=0}^{2n\_x} W\_i^{\mathbf{c}} \left( \mathbf{x}\_{k+j,i}^- - \hat{\mathbf{x}}\_{k+j} \right) \left( \mathbf{x}\_{k+j,i}^- - \hat{\mathbf{x}}\_{k+j} \right)^{\mathrm{T}} \tag{41}$$

end

To reduce computational cost, the update steps can be reduced, so that only the mean is transformed and therefore no further sigma point needs to be calculated and transformed as

for j=1 to nt<sup>d</sup> do

$$
\hat{\mathfrak{X}}\_{k+j} = f(\hat{\mathfrak{X}}\_{k+j-1}, \mathfrak{u}\_{k-1}; p) \tag{42}
$$

end

This may lead to reduced performance, depending on the length of the dead time, the process model complexity, and the uncertainties within the process.

#### 3.3. Parameter estimation

Since parameters may vary within dynamic systems, simultaneous state and parameter estimation is considered. Various methods to solve this task have been developed in the past decades. In the following, the approach of joint state and parameter estimation is presented. Therefore, states and parameters are concentrated into one joint state vector as

$$\mathbf{x}\_k = \begin{bmatrix} \mathbf{x}\_k \\ \mathbf{p}\_{\text{est},k} \end{bmatrix}' \tag{43}$$

with primary state <sup>x</sup><sup>k</sup> <sup>∈</sup> <sup>R</sup>nx and parameters to be estimated <sup>p</sup>est, <sup>k</sup> <sup>∈</sup> <sup>R</sup>np . The model within the process update assumes constant parameters, i.e., <sup>p</sup>est, <sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>p</sup>est, <sup>k</sup>. The remaining UKF algorithm stays the same, with only the dimension of the estimated state ~x <sup>b</sup><sup>k</sup> <sup>∈</sup> <sup>R</sup>nxþnp changing.

If some parameters are bounded as ai ≤ pest,i ≤ bi, these are not estimated directly, but using a substitute parameter psub,i as

$$p\_{\text{est,}i} = \frac{b\_i - a\_i}{2} \tanh\left(p\_{\text{sub,}i}\right) + \frac{a\_i + b\_i}{2}.\tag{44}$$

Using this substitution, the estimated parameter psub,i is not bounded and leads to the real parameters for pest,i in the intended range.

#### 4. Estimation results

In this section, the results of the vehicle's states and parameter estimation using an unscented Kalman filter and the two-track model described Section 2 are presented. At first, the test vehicle and the measurement equipment that is necessary for the validation are introduced. Secondly, the results of the vehicle state estimation and the results by considering dead time within the estimation are shown. Furthermore, a simultaneous state and friction estimation are presented that exhibit improved estimation results for varying road conditions.

#### 4.1. Measurement setup

<sup>b</sup>x<sup>k</sup>þ<sup>j</sup> <sup>¼</sup> <sup>X</sup><sup>2</sup>nx

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>c</sup> <sup>i</sup> x�

<sup>P</sup>b<sup>k</sup>þ<sup>j</sup> <sup>¼</sup> <sup>X</sup><sup>2</sup>nx

64 Kalman Filters - Theory for Advanced Applications

model complexity, and the uncertainties within the process.

end

end

for j=1 to nt<sup>d</sup> do

3.3. Parameter estimation

substitute parameter psub,i as

4. Estimation results

parameters for pest,i in the intended range.

<sup>i</sup>¼<sup>0</sup> <sup>W</sup><sup>m</sup> <sup>i</sup> x�

<sup>k</sup>þj,i � <sup>b</sup>x<sup>k</sup>þ<sup>j</sup> � �

To reduce computational cost, the update steps can be reduced, so that only the mean is transformed and therefore no further sigma point needs to be calculated and transformed as

This may lead to reduced performance, depending on the length of the dead time, the process

Since parameters may vary within dynamic systems, simultaneous state and parameter estimation is considered. Various methods to solve this task have been developed in the past decades. In the following, the approach of joint state and parameter estimation is presented.

xk <sup>¼</sup> <sup>x</sup><sup>k</sup>

pest, <sup>k</sup> " #

with primary state <sup>x</sup><sup>k</sup> <sup>∈</sup> <sup>R</sup>nx and parameters to be estimated <sup>p</sup>est, <sup>k</sup> <sup>∈</sup> <sup>R</sup>np . The model within the process update assumes constant parameters, i.e., <sup>p</sup>est, <sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>p</sup>est, <sup>k</sup>. The remaining UKF algo-

If some parameters are bounded as ai ≤ pest,i ≤ bi, these are not estimated directly, but using a

<sup>2</sup> tanh <sup>p</sup>sub,i

Using this substitution, the estimated parameter psub,i is not bounded and leads to the real

In this section, the results of the vehicle's states and parameter estimation using an unscented Kalman filter and the two-track model described Section 2 are presented. At

� �

þ ai þ bi

Therefore, states and parameters are concentrated into one joint state vector as

rithm stays the same, with only the dimension of the estimated state ~x

<sup>p</sup>est,i <sup>¼</sup> bi � ai

x�

<sup>k</sup>þj,i � <sup>b</sup>x<sup>k</sup>þ<sup>j</sup> � �<sup>T</sup>

<sup>b</sup>x<sup>k</sup>þ<sup>j</sup> <sup>¼</sup> <sup>f</sup> <sup>b</sup>x<sup>k</sup>þj�<sup>1</sup>; <sup>u</sup><sup>k</sup>�<sup>1</sup>; <sup>p</sup> � � (42)

<sup>k</sup>þþj,i (40)

, (43)

<sup>b</sup><sup>k</sup> <sup>∈</sup> <sup>R</sup>nxþnp changing.

<sup>2</sup> : (44)

(41)

The estimation results are verified by using a Volkswagen Golf GTE Plug-In Hybrid (Figure 5(a)) equipped with a Genesys ADMA-G-Eco + (Figure 5(b)). This system is developed especially for vehicle dynamics testing in the automotive sector. This inertial measurement unit (IMU) corrected by global positioning system (GPS) enables precise measurement of acceleration, speed, and position of the moving test vehicle in all three-dimensional axes. Furthermore, the pitch, roll and yaw angles, angular velocities as well as sideslip angle can be obtained. The GPS antenna is mounted on the roof of the test vehicle, whereas the IMU is placed in the footwell of the passenger seat. Ideally, the two sensors are placed in the center of gravity; unfortunately, in praxis, this requirement usually either cannot or can only be fulfilled with very high effort. Furthermore, it is hardly possible to exactly align the ADMA's measurement axes with the vehicle's axes. The errors caused by the distance between the installation position and the c.o.g as well as by misalignment angle can be mathematically compensated considering the lever arms and the angle offsets, respectively. The IMU's measurements are exclusively provided for the validation of the Kalman filter application. Additional measurements of the wheel speeds, accelerations and yaw rate as well as system inputs, i.e., steering angle, engine, and breaking torque, are taken from the vehicle's bus system. The onboard measurements are provided for the measurement update of the real-time Kalman filter application. Furthermore, an ES910 prototyping and interface module provides the connection to the vehicle bus and the computation of the filter application with system-level behavior.

#### 4.2. Unscented Kalman filter setup

The UKF utilizes a two-track model including roll dynamics as described in Section 2. The estimator's state and measurement vector were therefore

$$\mathbf{x} = \left(\dot{\psi}, \beta, \kappa, \dot{\kappa}, F\_{y\_i}, \omega\_i, \upsilon\_{\text{cog}}\right)^{\text{T}},\tag{45}$$

$$\mathbf{y} = \begin{pmatrix} \dot{\psi}, a\_{\mathbf{y},s}, a\_{\mathbf{x},s}, a\_{i} \end{pmatrix}^{\mathrm{T}}.\tag{46}$$

A double-lane change maneuver with moderate lateral acceleration represents a typical maneuver on highways or freeways occurring by overtaking another slower moving vehicle. However, a double-lane change maneuver with high lateral acceleration represents obstacle avoidance maneuver. This kind of maneuver is displayed with a high lateral acceleration up to <sup>a</sup><sup>y</sup> <sup>¼</sup> 7 m=s2 and with nearly constant velocity of <sup>v</sup> <sup>¼</sup> 37 km=h in Figure 7. It can be stated that also an accurate estimation of all relevant states can be seen over the whole maneuver, and again particularly an improved velocity estimation compared to onboard measurement can be emphasized. The higher estimation performance of the velocity can be advantageous for some

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

67

control applications, such as collision avoidance.

Figure 6. Vehicle state estimation during steering sweep maneuver.

<sup>α</sup>UKF determines the spread of the sigma points around the mean <sup>b</sup><sup>x</sup> and is set to 1, the scaling parameter κUKF is usually set to 0, and βUKF ¼ 2 is an optimal value to approximate distribution of x as Gaussian distribution. The process and measurement covariances are empirically determined and set up to

$$\mathbf{Q} = \text{diag}\{10^4, 1, 1, 1, 1, 1, 1, 1, 10^{10}, 10^{10}, 10^{10}, 10^{10}, 1\} 10^{-15} \tag{47}$$

$$\mathbf{R} = \text{diag}\{10^{-6}, 10^{-3}, 10^{-2}, 10^{-3}, 10^{-3}, 10^{-3}, 10^{-3}\}. \tag{48}$$

The initial covariance matrix of the state distribution is initialized with P<sup>0</sup> ¼ Q.

#### 4.3. State estimation

In this section, the results of vehicle state estimation are shown. The UKF estimation results are displayed in light grey, while the reference measurements of the ADMA-G-Eco +are displayed in black and the vehicle`s onboard measurements are displayed in grey. Each displayed maneuver is subdivided into eight diagrams. The top line shows yaw-rate and sideslip angle representing lateral dynamics, and the second line shows roll angle and roll rate representing roll dynamics. Furthermore, the velocity in the c.o.g. and the wheel speeds representing longitudinal dynamics are displayed in the third line and at last longitudinal and lateral acceleration in the bottom line. The accelerations in the c.o.g are displayed with continuous lines and the accelerations measured with onboard acceleration sensor that is not mounted in the c.o.g. in the dashed lines. The distances of the sensor position from the c.o.g. are identified with lx ¼ 1:07 m, ly ¼ �0:39 m, and lz ¼ 0:55 m. In order to demonstrate the estimation quality, Figure 6 shows a steering sweep maneuver with periodical steering angle input at nearly constant amplitude and increasing frequency and at a constant velocity of 37 km/h Despite the varying frequency, an accurate estimation of all dynamic states is evident, accompanied by improved estimation of the vehicles velocity compared to the onboard measurement of the vehicles' velocity. Only for the roll angle, a higher deviation can be recognized. This results from varying lateral inclination of the test road.

A steering sweep maneuver is optimal to validate the filter application and the integrated vehicle dynamic models, but it is not a practical example, whereas, for example, lane change maneuvers often occur. In addition, lane change maneuvers enable high lateral acceleration and high values of tire sideslip angles, which may lead, under certain conditions, to loss of stability due to nonlinear tire characteristics. Therefore, lane change maneuvers are suitable as practical driving situation.

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics http://dx.doi.org/10.5772/intechopen.71900 67

Figure 6. Vehicle state estimation during steering sweep maneuver.

<sup>x</sup> <sup>¼</sup> <sup>ψ</sup>\_ ; <sup>β</sup>; <sup>κ</sup>; <sup>κ</sup>\_; Fyi

; 10�<sup>3</sup>

The initial covariance matrix of the state distribution is initialized with P<sup>0</sup> ¼ Q.

; 10�<sup>2</sup>

In this section, the results of vehicle state estimation are shown. The UKF estimation results are displayed in light grey, while the reference measurements of the ADMA-G-Eco +are displayed in black and the vehicle`s onboard measurements are displayed in grey. Each displayed maneuver is subdivided into eight diagrams. The top line shows yaw-rate and sideslip angle representing lateral dynamics, and the second line shows roll angle and roll rate representing roll dynamics. Furthermore, the velocity in the c.o.g. and the wheel speeds representing longitudinal dynamics are displayed in the third line and at last longitudinal and lateral acceleration in the bottom line. The accelerations in the c.o.g are displayed with continuous lines and the accelerations measured with onboard acceleration sensor that is not mounted in the c.o.g. in the dashed lines. The distances of the sensor position from the c.o.g. are identified with lx ¼ 1:07 m, ly ¼ �0:39 m, and lz ¼ 0:55 m. In order to demonstrate the estimation quality, Figure 6 shows a steering sweep maneuver with periodical steering angle input at nearly constant amplitude and increasing frequency and at a constant velocity of 37 km/h Despite the varying frequency, an accurate estimation of all dynamic states is evident, accompanied by improved estimation of the vehicles velocity compared to the onboard measurement of the vehicles' velocity. Only for the roll angle, a higher deviation can be recognized. This results from varying lateral

A steering sweep maneuver is optimal to validate the filter application and the integrated vehicle dynamic models, but it is not a practical example, whereas, for example, lane change maneuvers often occur. In addition, lane change maneuvers enable high lateral acceleration and high values of tire sideslip angles, which may lead, under certain conditions, to loss of stability due to nonlinear tire characteristics. Therefore, lane change maneuvers are suitable as

; 10�<sup>3</sup>

; 10�<sup>3</sup>

determined and set up to

66 Kalman Filters - Theory for Advanced Applications

4.3. State estimation

inclination of the test road.

practical driving situation.

<sup>Q</sup> <sup>¼</sup> diag 104

<sup>R</sup> <sup>¼</sup> diag 10�<sup>6</sup>

; ωi; vcog

; 1; 1; 1; 1; 1; 1; 1; 1010; 1010; 1010; 1010; 1 � �10�<sup>15</sup> (47)

; 10�<sup>3</sup> ; 10�<sup>3</sup> � �: (48)

, (45)

: (46)

� �<sup>T</sup>

<sup>y</sup> <sup>¼</sup> <sup>ψ</sup>\_ ; ay, <sup>s</sup>; ax, <sup>s</sup>; <sup>ω</sup><sup>i</sup> � �<sup>T</sup>

<sup>α</sup>UKF determines the spread of the sigma points around the mean <sup>b</sup><sup>x</sup> and is set to 1, the scaling parameter κUKF is usually set to 0, and βUKF ¼ 2 is an optimal value to approximate distribution of x as Gaussian distribution. The process and measurement covariances are empirically

> A double-lane change maneuver with moderate lateral acceleration represents a typical maneuver on highways or freeways occurring by overtaking another slower moving vehicle. However, a double-lane change maneuver with high lateral acceleration represents obstacle avoidance maneuver. This kind of maneuver is displayed with a high lateral acceleration up to <sup>a</sup><sup>y</sup> <sup>¼</sup> 7 m=s<sup>2</sup> and with nearly constant velocity of <sup>v</sup> <sup>¼</sup> 37 km=h in Figure 7. It can be stated that also an accurate estimation of all relevant states can be seen over the whole maneuver, and again particularly an improved velocity estimation compared to onboard measurement can be emphasized. The higher estimation performance of the velocity can be advantageous for some control applications, such as collision avoidance.

the dead time in the controller designing, a further possibility is model-based dead-time compensation within state estimation. A simple method to predict the system's state and covariance during the dead time is to execute only the filter process update without doing the measurement update as defined in Section 3.2. Alternatively, to reduce computational cost, the prediction can be executed only considering the mean of the system states by neglecting further sigma points. During the prediction from time step k to k þ nt<sup>d</sup> , there are no further information of the system input. Therefore, the last known system input is used for the prediction. From this follows a prediction error that decreases with less dynamics of the system input. A comparison of both possibilities and the quality of the dead-time compensation within the vehicle state estimation is shown in Figure 8. A step steering maneuver on dry asphalt at a velocity of approximately 50 km/h with maximum lateral acceleration of almost <sup>a</sup><sup>y</sup> <sup>¼</sup> 7m=s<sup>2</sup> is considered. The top diagram shows the yaw rate and the next diagram the sideslip angle, while measurements are displayed in black, the UKF's state estimation without dead-time compensation in grey, the dead-time compensated state estimation by using all sigma points in dashed light grey, and the dead-time compensated state estimation by using only the mean in dash-dotted grey. In the present case, the predominant dead time amounts about 30 ms that corresponds to nt<sup>d</sup> ¼ 3. The dead time is determined by comparing redundant measurements that are obtained from

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

69

It is quite obvious that both methods for dead-time compensation do not really differ in the application of vehicle dynamics; thus, it is at an advantage due to reduced computational costs only to consider the mean of the state. Furthermore, the UKF results with dead-time-compensated

the IMU of the ADMA and the vehicle's onboard CAN bus.

Figure 8. Dead-time-compensated vehicle state estimation during step steering maneuver.

Figure 7. Vehicle state estimation during double-lane change maneuver.

#### 4.4. Dead-time compensation

A major problem in control systems is dead time. Dead time may lead either to poor control results or to unstable control. In case of stability control systems and therefore for robust car steering, the real-time information of sideslip angle and yaw rate is very important. As pointed previously, an accurate estimation of this vehicle states can be realized using UKF with nonlinear two-track model even if vehicles move at its stability limits. However, the estimated states are not the true vehicle states at this particular time. They are delayed due to the dead-time-shifted measurement update, which occurs particularly of the communication on the CAN network. In dependence on the length of dead time, different arrangements exist for dead-time compensation. In addition, to consider the dead time in the controller designing, a further possibility is model-based dead-time compensation within state estimation. A simple method to predict the system's state and covariance during the dead time is to execute only the filter process update without doing the measurement update as defined in Section 3.2. Alternatively, to reduce computational cost, the prediction can be executed only considering the mean of the system states by neglecting further sigma points. During the prediction from time step k to k þ nt<sup>d</sup> , there are no further information of the system input. Therefore, the last known system input is used for the prediction. From this follows a prediction error that decreases with less dynamics of the system input. A comparison of both possibilities and the quality of the dead-time compensation within the vehicle state estimation is shown in Figure 8. A step steering maneuver on dry asphalt at a velocity of approximately 50 km/h with maximum lateral acceleration of almost <sup>a</sup><sup>y</sup> <sup>¼</sup> 7m=s<sup>2</sup> is considered. The top diagram shows the yaw rate and the next diagram the sideslip angle, while measurements are displayed in black, the UKF's state estimation without dead-time compensation in grey, the dead-time compensated state estimation by using all sigma points in dashed light grey, and the dead-time compensated state estimation by using only the mean in dash-dotted grey. In the present case, the predominant dead time amounts about 30 ms that corresponds to nt<sup>d</sup> ¼ 3. The dead time is determined by comparing redundant measurements that are obtained from the IMU of the ADMA and the vehicle's onboard CAN bus.

It is quite obvious that both methods for dead-time compensation do not really differ in the application of vehicle dynamics; thus, it is at an advantage due to reduced computational costs only to consider the mean of the state. Furthermore, the UKF results with dead-time-compensated

Figure 8. Dead-time-compensated vehicle state estimation during step steering maneuver.

4.4. Dead-time compensation

68 Kalman Filters - Theory for Advanced Applications

Figure 7. Vehicle state estimation during double-lane change maneuver.

A major problem in control systems is dead time. Dead time may lead either to poor control results or to unstable control. In case of stability control systems and therefore for robust car steering, the real-time information of sideslip angle and yaw rate is very important. As pointed previously, an accurate estimation of this vehicle states can be realized using UKF with nonlinear two-track model even if vehicles move at its stability limits. However, the estimated states are not the true vehicle states at this particular time. They are delayed due to the dead-time-shifted measurement update, which occurs particularly of the communication on the CAN network. In dependence on the length of dead time, different arrangements exist for dead-time compensation. In addition, to consider states also do not differ from the time-shifted UKF prediction without dead time displayed in light grey. Therefore, it is possible to include dead-time compensation in the state estimation in a simple manner and to obtain precise estimation results. However, this method for dead-time compensation has the restriction that the system does not contain varying dead time and the dead time is well known.

All previously presented test maneuvers are executed on dry asphalt. Thus, the maximum friction coefficient between road and tire is well known. Under different road conditions, for example, wet, snow, and ice and without adaption of the friction coefficient, the accuracy of the state estimation decreases highly. Hence, for precise state estimation, it is essential to estimate the maximum friction coefficient as well.

#### 4.5. Maximum friction coefficient estimation

However, not only for improved vehicle state estimation a simultaneous estimation of the maximum friction coefficient between road and tire is of paricular importance. To ensure a proper functionality of safety functions not only the knowledge of the driving situation but also of the driving environment, in particular the road condition, is required. This section focuses on the road condition classification using a joint unscented Kalman filter approach as described in Section 3.3. The extended process, covariance matrix Qp, for the maximum friction coefficient estimation is empirically determined and set up to

$$\mathbf{Q}\_{\mathbf{p}} = \text{diag}\{\text{diag}(\mathbf{Q}), 10^{-8}\}. \tag{49}$$

When sufficient excitation exists, the maximum friction coefficient can be estimated within

Figure 9. Vehicle state and maximum friction coefficient estimation during double-lane change maneuver on dry asphalt.

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

71

In Figure 10, the estimation of the maximum friction coefficient on different roads is displayed. Beginning on dry asphalt, the test vehicle drives a sine steering maneuver and changes over to wet steel. Wet steel exhibits similar properties regarding traction potential as an icy road. Because it is much easier to build up a road composed of wet steel than of ice to carry out a test, in this test, the wet steel represents a road with low traction potential. Over the entire period of the sine maneuver, a sufficient excitation is existent. Hence, the unscented Kalman

few seconds.

Furthermore, the maximum friction coefficient is bounded according to Eq. (37) with a upper bound of 1.1 and a lower bound of 0.1. The upper bound corresponds to the best traction potential that may occur when the roads are dry and the tires are in good condition. The lower bound corresponds to the lowest traction potential that may occur when the roads are icy and the tires have a low tire profile.

In Figure 9, again a double-lane change maneuver on dry asphalt at a velocity of approximately 43km=h with maximum lateral acceleration of almost <sup>a</sup><sup>y</sup> <sup>¼</sup> 9 m=s2 is considered. The top diagram shows the measured system input namely the steering angle. The following diagrams show the yaw rate, the lateral acceleration, and the sideslip angle, while the IMU's measurements are displayed in black and the onboard measurements in grey, and the UKF's estimations in light grey. The bottom diagram shows the estimated maximum friction coefficient, while the initial value is wrongly set to μmax ¼ 0:4. By using offline identification algorithms, the reference value for the maximum friction coefficient was determined at approximately 1. The light red lines show the state estimation without adaptation of friction coefficient. Obviously, an accurate sideslip and yaw-rate estimation can only be guaranteed with adaptation of the friction coefficient. However, an adaption of the friction coefficient is only possible during phases of sufficient excitation. At the beginning and at the end of the maneuver without steering, no adaption may take place. Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics http://dx.doi.org/10.5772/intechopen.71900 71

states also do not differ from the time-shifted UKF prediction without dead time displayed in light grey. Therefore, it is possible to include dead-time compensation in the state estimation in a simple manner and to obtain precise estimation results. However, this method for dead-time compensation has the restriction that the system does not contain varying dead time and the dead

All previously presented test maneuvers are executed on dry asphalt. Thus, the maximum friction coefficient between road and tire is well known. Under different road conditions, for example, wet, snow, and ice and without adaption of the friction coefficient, the accuracy of the state estimation decreases highly. Hence, for precise state estimation, it is essential to estimate

However, not only for improved vehicle state estimation a simultaneous estimation of the maximum friction coefficient between road and tire is of paricular importance. To ensure a proper functionality of safety functions not only the knowledge of the driving situation but also of the driving environment, in particular the road condition, is required. This section focuses on the road condition classification using a joint unscented Kalman filter approach as described in Section 3.3. The extended process, covariance matrix Qp, for the maximum friction

Furthermore, the maximum friction coefficient is bounded according to Eq. (37) with a upper bound of 1.1 and a lower bound of 0.1. The upper bound corresponds to the best traction potential that may occur when the roads are dry and the tires are in good condition. The lower bound corresponds to the lowest traction potential that may occur when the roads are icy and

In Figure 9, again a double-lane change maneuver on dry asphalt at a velocity of approximately 43km=h with maximum lateral acceleration of almost <sup>a</sup><sup>y</sup> <sup>¼</sup> 9 m=s2 is considered. The top diagram shows the measured system input namely the steering angle. The following diagrams show the yaw rate, the lateral acceleration, and the sideslip angle, while the IMU's measurements are displayed in black and the onboard measurements in grey, and the UKF's estimations in light grey. The bottom diagram shows the estimated maximum friction coefficient, while the initial value is wrongly set to μmax ¼ 0:4. By using offline identification algorithms, the reference value for the maximum friction coefficient was determined at approximately 1. The light red lines show the state estimation without adaptation of friction coefficient. Obviously, an accurate sideslip and yaw-rate estimation can only be guaranteed with adaptation of the friction coefficient. However, an adaption of the friction coefficient is only possible during phases of sufficient excitation. At the beginning and at the end of the maneuver without steering, no adaption may take place.

<sup>Q</sup><sup>p</sup> <sup>¼</sup> diag diagð Þ <sup>Q</sup> ; <sup>10</sup>�<sup>8</sup> : (49)

time is well known.

the maximum friction coefficient as well.

70 Kalman Filters - Theory for Advanced Applications

the tires have a low tire profile.

4.5. Maximum friction coefficient estimation

coefficient estimation is empirically determined and set up to

Figure 9. Vehicle state and maximum friction coefficient estimation during double-lane change maneuver on dry asphalt.

When sufficient excitation exists, the maximum friction coefficient can be estimated within few seconds.

In Figure 10, the estimation of the maximum friction coefficient on different roads is displayed. Beginning on dry asphalt, the test vehicle drives a sine steering maneuver and changes over to wet steel. Wet steel exhibits similar properties regarding traction potential as an icy road. Because it is much easier to build up a road composed of wet steel than of ice to carry out a test, in this test, the wet steel represents a road with low traction potential. Over the entire period of the sine maneuver, a sufficient excitation is existent. Hence, the unscented Kalman

A promising approach to solving this problem is to use further source of information, for example, optical sensors and to do an information fusion, so that disadvantages of one information can be compensated by advantages of other information. Information fusion is the next step for improved

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

73

In this chapter, state and parameter estimation in vehicle dynamics using the unscented Kalman filter is presented. Therefore, a detailed nonlinear process and measurement model of the vehicle are introduced, representing the vehicle's stability and the measurements taken with standard sensors. Dead times, due to CAN communication, are faced and compensated using model-based prediction. The validation of the introduced methods is realized by using a Volkswagen Golf GTE Plug-In Hybrid for high dynamic test maneuvers, e.g., double-lane change. The estimation results are compared with high-precision measurements using a Genesys ADMA inertial measurement unit. Accurate estimation even in situations with lateral acceleration above 7 m=s<sup>2</sup> can be achieved. Furthermore, real-time estimation, compensated

The parameter estimation is presented using the example of friction coefficient estimation utilizing the joint unscented Kalman filter. Thus, maneuvers with different excitation on different road surfaces are executed. Again, precise estimation in the presence of sufficient

[1] Best MC, Gordon TJ, Dixon PJ. An extended adaptive Kalman filter for real-time state estimation of vehicle handling dynamics. Vehicle System Dynamics. 2000;34(1):57-75.

[2] Cheli F, Sabbioni E, Pesce M, Melzi S. A methodology for vehicle sideslip angle identification: Comparison with experimental data. Vehicle System Dynamics. 2007;45(6):549-

friction estimation and current research.

for dead times can be realized using model-based prediction.

Mark Wielitzka\*, Alexander Busch, Matthias Dagen and Tobias Ortmaier \*Address all correspondence to: mark.wielitzka@imes.uni-hannover.de

Institute of Mechatronic Systems, Leibniz Universität Hannover, Germany

DOI: 10.1076/0042-3114(200008)34:1;1-K;FT057

563. DOI: 10.1080/00423110601059112

5. Conclusion

excitation can be shown.

Author details

References

Figure 10. Vehicle state and maximum friction coefficient estimation during sine steering maneuver on dry asphalt and wet steel.

filter estimates while driving over the dry asphalt a maximum friction coefficient of approximately 1. After changing to wet steel, clearly, a lower friction level with a maximum friction coefficient of approximately 0.3 is detected. It can be spotted that while sufficient excitation is existent, different friction levels according to different road conditions can also be clearly recognized. The last 5 s of the maneuver is without steering and acceleration, and the estimated maximum friction coefficient remains constant. Therefore, due to missing excitation, it would not be possible to distinguish between dry asphalt and wet steel. Nonsufficient excitation is a major disadvantage of Kalman filter-based approaches for parameter estimation in general and thus also for friction estimation.

A promising approach to solving this problem is to use further source of information, for example, optical sensors and to do an information fusion, so that disadvantages of one information can be compensated by advantages of other information. Information fusion is the next step for improved friction estimation and current research.

### 5. Conclusion

In this chapter, state and parameter estimation in vehicle dynamics using the unscented Kalman filter is presented. Therefore, a detailed nonlinear process and measurement model of the vehicle are introduced, representing the vehicle's stability and the measurements taken with standard sensors. Dead times, due to CAN communication, are faced and compensated using model-based prediction. The validation of the introduced methods is realized by using a Volkswagen Golf GTE Plug-In Hybrid for high dynamic test maneuvers, e.g., double-lane change. The estimation results are compared with high-precision measurements using a Genesys ADMA inertial measurement unit. Accurate estimation even in situations with lateral acceleration above 7 m=s<sup>2</sup> can be achieved. Furthermore, real-time estimation, compensated for dead times can be realized using model-based prediction.

The parameter estimation is presented using the example of friction coefficient estimation utilizing the joint unscented Kalman filter. Thus, maneuvers with different excitation on different road surfaces are executed. Again, precise estimation in the presence of sufficient excitation can be shown.

### Author details

Mark Wielitzka\*, Alexander Busch, Matthias Dagen and Tobias Ortmaier

\*Address all correspondence to: mark.wielitzka@imes.uni-hannover.de

Institute of Mechatronic Systems, Leibniz Universität Hannover, Germany

### References

filter estimates while driving over the dry asphalt a maximum friction coefficient of approximately 1. After changing to wet steel, clearly, a lower friction level with a maximum friction coefficient of approximately 0.3 is detected. It can be spotted that while sufficient excitation is existent, different friction levels according to different road conditions can also be clearly recognized. The last 5 s of the maneuver is without steering and acceleration, and the estimated maximum friction coefficient remains constant. Therefore, due to missing excitation, it would not be possible to distinguish between dry asphalt and wet steel. Nonsufficient excitation is a major disadvantage of Kalman filter-based approaches for parameter estimation in

Figure 10. Vehicle state and maximum friction coefficient estimation during sine steering maneuver on dry asphalt and

general and thus also for friction estimation.

72 Kalman Filters - Theory for Advanced Applications

wet steel.


[3] Chen BC, Hsieh F-C. Sideslip angle estimation using extended Kalman filter. Vehicle System Dynamics. 2009;46(S1):353-364. DOI: 10.1080/00423110801958550

[17] Julier SJ. The Scaled Unscented Transformation. 2002: American Control Conference

Unscented Kalman Filter for State and Parameter Estimation in Vehicle Dynamics

http://dx.doi.org/10.5772/intechopen.71900

75

[18] Wan EA, Van der Merwe R. The unscented Kalman filter for nonlinear estimation. Alberta, Canada: Adaptive Systems for Signal Processing, Communications, and Control

(ACC); 08-10 May 2002. USA: Anchorage; 2012. pp. 4555-4559

Symposium (AS-SPCC); 04 October 2000. p. 153-158


[17] Julier SJ. The Scaled Unscented Transformation. 2002: American Control Conference (ACC); 08-10 May 2002. USA: Anchorage; 2012. pp. 4555-4559

[3] Chen BC, Hsieh F-C. Sideslip angle estimation using extended Kalman filter. Vehicle

[4] Doumiati M, Victorino AC, Charara A, Lechner D. Onboard real-time estimation of vehicle lateral tire–road forces and sideslip angle. IEEE Transactions on Mechatronics.

[5] Pacejka HB, Bakker E. The magic formula tire model. Vehicle System Dynamics. 1992;21

[6] Li L, Jia G, Ran X, Song J, Wu K. A variable structure extended Kalman filter for vehicle sideslip angle estimation on a low friction road. International Journal of Vehicle Mechan-

[7] Antonov S, Fehn A, Kugi A. Unscented Kalman filter for vehicle state estimation. Vehicle

[8] Wielitzka M, Dagen M, Ortmaier T. State estimation of vehicle's lateral dynamics using unscented Kalman filter. Los Angeles, USA: IEEE 53rd Annual Conference on Decision

[9] J Dakhlallah J, Glaser S, Mammar S, Sebsadji Y. Tire-Road Forces Estimation Using Extended Kalman Filter and Sideslip Angle Evaluation. Seattle, USA: 2008 American

[10] Wenzel TA, Burnham KJ, Blundell MV, Williams RA. Dual extended Kalman filter for vehicle state and parameter estimation. Vehicle System Dynamics. 2006;44(2):153-171.

[11] Wielitzka M., Dagen M., Ortmaier T.: Joint unscented Kalman filter for state and parameter estimation in vehicle dynamics. Sydney, Australia: IEEE Conference On Control

[12] Ahn C, Peng H, Tseng HE. Robust estimation of road friction coefficient using lateral and longitudinal vehicle dynamics. Vehicle System Dynamics. 2012;50(6):961-985. DOI: 10.1080/

[13] Ahn C, Peng H, Tseng HE. Robust estimation of road friction. IEEE Transactions on Control Systems Technology. 2013;521(1):1-13. DOI: 10.1109/TCST.2011.2170838

[14] Wielitzka M, Dagen M, Ortmaier T. State and maximum friction coefficient estimation in vehicle dynamics using UKF. Seattle, USA: American Control Conference (ACC); 24-26

[15] Wielitzka M, Dagen M, Ortmaier T. Nonlinear modeling and parameter identification of Vehicle's lateral dynamics. Tokio, Japan: 12thth International Symposium on Advanced

[16] Rajamani, Rajesh. Vehicle dynamics and control; Springer Science & Business Media;

System Dynamics. 2009;46(S1):353-364. DOI: 10.1080/00423110801958550

ics and Mobility. 2014;52(2):280-308. DOI: 10.1080/00423114.2013.877148

and Control (CDC); 15-17 December 2014; 2015. pp. 5015-5020

Control Conference (ACC); 11–13 June 2008; 2008. pp. 4597-4602

Applications (CCA); 21-23 September 2015. pp. 1945-1950

Vehicle Control (AVEC); 22–16 September 2014

System Dynamics. 2011;49(9):1497-1520. DOI: 10.1080/00423114.2010.527994

2011;16(4):601-614. DOI: 10.1109/TMECH.2010.2048118

(S1):1-18. DOI: 10.1080/00423119208969994

74 Kalman Filters - Theory for Advanced Applications

DOI: 10.1080/00423110500385949

00423114.2012.659740

May 2017. pp. 4322-4327

2011

[18] Wan EA, Van der Merwe R. The unscented Kalman filter for nonlinear estimation. Alberta, Canada: Adaptive Systems for Signal Processing, Communications, and Control Symposium (AS-SPCC); 04 October 2000. p. 153-158

**Chapter 4**

Provisional chapter

**Sensitivity-Based Adaptive SRUKF for State, Parameter,**

DOI: 10.5772/intechopen.72470

**and Covariance Estimation on Mechatronic Systems**

Since the initial developments in the state-space theory in the 1950s and 1960s, the state estimation has become an extensively researched and applied discipline. All systems that can be modelled mathematically are candidates for state estimators. The state estimators reconstruct the states that represent internal conditions and status of a system at a specific instant of time using a mathematical model and the information received from the system sensors. Moreover, the estimator can be extended for system parameter estimation. The resulting Kalman filter (KF) derivatives for state and parameter estimation also require knowledge about the noise statistics of measurements and the uncertainties of the system model. These are often unknown, and an inaccurate parameterization may lead to decreased filter performance or even divergence. Additionally, insufficient system excitation can cause parameter estimation drifts. In this chapter, a sensitivity-based adaptive square-root unscented KF (SRUKF) is presented. This filter combines a SRUKF and the recursive prediction-error method to estimate system states, parameters and covariances online. Moreover, local sensitivity analysis is performed to prevent parameter estimation drifts, while the system is not sufficiently excited. The filter is evaluated on two testbeds based on an axis serial mechanism and compared with the joint state and parameter UKF.

Keywords: Unscented Kalman, filter, recursive prediction-error method, state estimation, parameter estimation, covariance estimation, sensitivity analysis

State estimation is applicable to almost all areas of engineering and science. It is interesting to engineers for different reasons such as the control of a system using a state-feedback controller or

> © The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Sensitivity-Based Adaptive SRUKF for State,

Parameter, and Covariance Estimation

Mauro Hernán Riva, Mark Wielitzka and

Mauro Hernán Riva, Mark Wielitzka and

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.72470

on Mechatronic Systems

Tobias Ortmaier

Tobias Ortmaier

Abstract

1. Introduction

Provisional chapter

### **Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems** Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation

DOI: 10.5772/intechopen.72470

Mauro Hernán Riva, Mark Wielitzka and

Tobias Ortmaier Mauro Hernán Riva, Mark Wielitzka and

Additional information is available at the end of the chapter Tobias Ortmaier

http://dx.doi.org/10.5772/intechopen.72470 Additional information is available at the end of the chapter

on Mechatronic Systems

#### Abstract

Since the initial developments in the state-space theory in the 1950s and 1960s, the state estimation has become an extensively researched and applied discipline. All systems that can be modelled mathematically are candidates for state estimators. The state estimators reconstruct the states that represent internal conditions and status of a system at a specific instant of time using a mathematical model and the information received from the system sensors. Moreover, the estimator can be extended for system parameter estimation. The resulting Kalman filter (KF) derivatives for state and parameter estimation also require knowledge about the noise statistics of measurements and the uncertainties of the system model. These are often unknown, and an inaccurate parameterization may lead to decreased filter performance or even divergence. Additionally, insufficient system excitation can cause parameter estimation drifts. In this chapter, a sensitivity-based adaptive square-root unscented KF (SRUKF) is presented. This filter combines a SRUKF and the recursive prediction-error method to estimate system states, parameters and covariances online. Moreover, local sensitivity analysis is performed to prevent parameter estimation drifts, while the system is not sufficiently excited. The filter is evaluated on two testbeds based on an axis serial mechanism and compared with the joint state and parameter UKF.

Keywords: Unscented Kalman, filter, recursive prediction-error method, state estimation, parameter estimation, covariance estimation, sensitivity analysis

### 1. Introduction

State estimation is applicable to almost all areas of engineering and science. It is interesting to engineers for different reasons such as the control of a system using a state-feedback controller or

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

monitoring the system states that are not measureable with sensors, or the sensors are too expensive or too difficult to install. The system states can be defined as variables, which provide a representation of internal conditions and status of a system at a specific instant of time. Applications that include a mathematical model of any system are candidates for state estimation. The estimations can be useful, for example, car assistance systems [1], predictive maintenance [2], structure health estimation [3], and many other applications (see [4] and references therein).

derivative and a recursive prediction-error method (RPEM) to estimate covariances online. In

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

http://dx.doi.org/10.5772/intechopen.72470

79

In this chapter, a sensitivity-based adaptive square-root unscented Kalman filter (SB-aSRUKF) is presented. This filter estimates system states, parameters and covariances online. Using local state sensitivity models (SMs), this filter prevents parameter and covariance estimation drifts, while the system is not sufficiently excited. Sensitivity analysis (SA) for the UKF is also presented. The performance of this filter is validated in simulations on two testbeds and

Section 2 covers some algorithms for recursive estimation of states, parameters, and covariances. The SB-aSRUKF is the main topic of this chapter. This filter uses a KF derivative for state estimation. In Section 2.1, the KF for state estimation in linear dynamic systems is presented. The UKF, a nonlinear extension of the KF, is described in Section 2.2 and also extended for estimating system parameters. Section 2.3 covers parameter estimation using the RPEM. The UKF and the RPEM are combined in Section 2.4 to obtain the aSRUKF. In order to identify unknown parameters, the system inputs should be persistently exciting. Sensitivity models (SMs) are presented in this section and are used to evaluate the system excitation and prevent

Section 3 covers the testbed used for the filter evaluations. A planar one-link robot system is described in Section 3.1, and a pendulum robot (pedubot) is mathematically modelled in Section 3.2. The first testbed is used for the SM analysis, and the chaotic system is used to compare the filter performance with the joint SRUKF. The evaluation results of the SB-aSRUKF are presented in Section 4. The SMs are analysed with different system inputs on the first testbed in Section 4.1, and the filter performance for state and parameter estimation is compared with the joint SRUKF in Section 4.2. Section 5 completes the chapter with conclusions.

This section discusses some recursive approaches to estimate states, parameters and covariances of a general system. The KF as the optimal linear estimator for linear dynamic systems is presented. Nonlinear extensions of the KF are discussed, as well as an extension for parameter estimation. A recursive Gauss-Newton method for parameter estimation is also presented in this section. Finally, the last subsection discusses the SB-aSRUKF, which is the main topic of

The KF is the most widely applied algorithm for state estimation on linear dynamic systems that are corrupted by stochastic noises (e.g. Gaussian noise). It uses a parametric mathematical model of the system and a series of (noisy) measurements from, for example, sensors to estimate the system states online [4]. In general, the state distribution of a system can be approximated by random variables (RVs). The main operation of the KF is the propagation of

[23], an adaptive UKF was presented to estimate only covariances online.

compared with the joint UKF for parameter and state estimation.

parameter estimation drifts while the system is not sufficiently excited.

this chapter, and the SMs that are used for excitation monitoring.

2. Recursive estimation

2.1. Kalman filter (KF)

Different algorithms were proposed for online state estimation. A historical survey of the filtering algorithms can be found in [5]. The Kalman filter (KF) was presented in [6] and nowadays is the most widely applied algorithm for state estimation on linear systems. The KF is a linear optimal estimator [7]. This means that the KF is the best filter that uses a linear combination of the system measurements and states in order to estimate the last ones. The main operation of the KF is the propagation of the mean and covariance of the (Gaussian) random variables (RVs) through time. The KF assumes that the model and the noise statistics affecting the system are known. Otherwise, the estimates can degrade.

Different derivatives of the KF have been developed for nonlinear systems during the last decades. The extended Kalman filter (EKF) presented in [8] is the most commonly used estimator for nonlinear system. This filter linearizes the system and measurement equations at the current estimate. This may lead to poor performances for highly nonlinear or highly noisy systems [9]. To address the linearization errors of the EKF, the unscented Kalman filter (UKF) was presented in [10]. This filter uses the unscented transformation (UT) to pick a minimal set of points around the mean of the GRV. These points capture the true mean and covariance of the GRV, and they are then propagated through the true nonlinear function capturing the a posteriori mean and covariance more accurately.

The mathematical models usually describe the behaviour of the systems, and generally the structure and the parameters need to be determined. Once the structure is defined, system inputs and measurements can be used to identify the model parameters. This can be performed offline [11, 12]. However, the parameters usually may vary during operations. In order to monitor these variations online, the nonlinear extensions of the KF can be extended for parameter estimation [9].

The KF derivatives can only achieve good performances under a priori assumptions, for example, accurate system models, noise statistics knowledge, and proper initial conditions [7, 9, 13]. If one of these assumptions is not guaranteed, the KF derivative can potentially become unstable and the estimations can be diverged [14–16]. Moreover, tuning the performance of these filters implies primarily adjusting the process and measurement noise covariances to match the (unknown) real-system noise statistics. In the last decades, numerous methods were presented to estimate these unknown covariances. The autocovariance least-square method was presented in [17, 18], and it was extended (and simplified) in [19], and diagonal process and noise covariances were considered in [20]. This method estimates the noise covariances using least squares and it can only be used with KF. The method was extended for nonlinear or time-varying systems using an EKF in [21]. Online covariance estimation for EKF and square-root cubature Kalman filter (SRCuKF) was presented in [22]. These methods implement a combination of a KF derivative and a recursive prediction-error method (RPEM) to estimate covariances online. In [23], an adaptive UKF was presented to estimate only covariances online.

In this chapter, a sensitivity-based adaptive square-root unscented Kalman filter (SB-aSRUKF) is presented. This filter estimates system states, parameters and covariances online. Using local state sensitivity models (SMs), this filter prevents parameter and covariance estimation drifts, while the system is not sufficiently excited. Sensitivity analysis (SA) for the UKF is also presented. The performance of this filter is validated in simulations on two testbeds and compared with the joint UKF for parameter and state estimation.

Section 2 covers some algorithms for recursive estimation of states, parameters, and covariances. The SB-aSRUKF is the main topic of this chapter. This filter uses a KF derivative for state estimation. In Section 2.1, the KF for state estimation in linear dynamic systems is presented. The UKF, a nonlinear extension of the KF, is described in Section 2.2 and also extended for estimating system parameters. Section 2.3 covers parameter estimation using the RPEM. The UKF and the RPEM are combined in Section 2.4 to obtain the aSRUKF. In order to identify unknown parameters, the system inputs should be persistently exciting. Sensitivity models (SMs) are presented in this section and are used to evaluate the system excitation and prevent parameter estimation drifts while the system is not sufficiently excited.

Section 3 covers the testbed used for the filter evaluations. A planar one-link robot system is described in Section 3.1, and a pendulum robot (pedubot) is mathematically modelled in Section 3.2. The first testbed is used for the SM analysis, and the chaotic system is used to compare the filter performance with the joint SRUKF. The evaluation results of the SB-aSRUKF are presented in Section 4. The SMs are analysed with different system inputs on the first testbed in Section 4.1, and the filter performance for state and parameter estimation is compared with the joint SRUKF in Section 4.2. Section 5 completes the chapter with conclusions.

## 2. Recursive estimation

monitoring the system states that are not measureable with sensors, or the sensors are too expensive or too difficult to install. The system states can be defined as variables, which provide a representation of internal conditions and status of a system at a specific instant of time. Applications that include a mathematical model of any system are candidates for state estimation. The estimations can be useful, for example, car assistance systems [1], predictive maintenance [2], structure health estimation [3], and many other applications (see [4] and references therein).

Different algorithms were proposed for online state estimation. A historical survey of the filtering algorithms can be found in [5]. The Kalman filter (KF) was presented in [6] and nowadays is the most widely applied algorithm for state estimation on linear systems. The KF is a linear optimal estimator [7]. This means that the KF is the best filter that uses a linear combination of the system measurements and states in order to estimate the last ones. The main operation of the KF is the propagation of the mean and covariance of the (Gaussian) random variables (RVs) through time. The KF assumes that the model and the noise statistics

Different derivatives of the KF have been developed for nonlinear systems during the last decades. The extended Kalman filter (EKF) presented in [8] is the most commonly used estimator for nonlinear system. This filter linearizes the system and measurement equations at the current estimate. This may lead to poor performances for highly nonlinear or highly noisy systems [9]. To address the linearization errors of the EKF, the unscented Kalman filter (UKF) was presented in [10]. This filter uses the unscented transformation (UT) to pick a minimal set of points around the mean of the GRV. These points capture the true mean and covariance of the GRV, and they are then propagated through the true nonlinear function

The mathematical models usually describe the behaviour of the systems, and generally the structure and the parameters need to be determined. Once the structure is defined, system inputs and measurements can be used to identify the model parameters. This can be performed offline [11, 12]. However, the parameters usually may vary during operations. In order to monitor these variations online, the nonlinear extensions of the KF can be extended for

The KF derivatives can only achieve good performances under a priori assumptions, for example, accurate system models, noise statistics knowledge, and proper initial conditions [7, 9, 13]. If one of these assumptions is not guaranteed, the KF derivative can potentially become unstable and the estimations can be diverged [14–16]. Moreover, tuning the performance of these filters implies primarily adjusting the process and measurement noise covariances to match the (unknown) real-system noise statistics. In the last decades, numerous methods were presented to estimate these unknown covariances. The autocovariance least-square method was presented in [17, 18], and it was extended (and simplified) in [19], and diagonal process and noise covariances were considered in [20]. This method estimates the noise covariances using least squares and it can only be used with KF. The method was extended for nonlinear or time-varying systems using an EKF in [21]. Online covariance estimation for EKF and square-root cubature Kalman filter (SRCuKF) was presented in [22]. These methods implement a combination of a KF

affecting the system are known. Otherwise, the estimates can degrade.

capturing the a posteriori mean and covariance more accurately.

parameter estimation [9].

78 Kalman Filters - Theory for Advanced Applications

This section discusses some recursive approaches to estimate states, parameters and covariances of a general system. The KF as the optimal linear estimator for linear dynamic systems is presented. Nonlinear extensions of the KF are discussed, as well as an extension for parameter estimation. A recursive Gauss-Newton method for parameter estimation is also presented in this section. Finally, the last subsection discusses the SB-aSRUKF, which is the main topic of this chapter, and the SMs that are used for excitation monitoring.

### 2.1. Kalman filter (KF)

The KF is the most widely applied algorithm for state estimation on linear dynamic systems that are corrupted by stochastic noises (e.g. Gaussian noise). It uses a parametric mathematical model of the system and a series of (noisy) measurements from, for example, sensors to estimate the system states online [4]. In general, the state distribution of a system can be approximated by random variables (RVs). The main operation of the KF is the propagation of the mean and covariance of these (Gaussian) RVs through time. The KF is an optimal linear filter for these types of systems [7, 9]. It is a recursive algorithm, which enables new measurements to be processed as they arrive to correct and update the state and measurement estimates.

In general, a linear discrete-time system corrupted by additive noises can be written as follows:

$$\begin{aligned} \mathbf{x}\_k &= A\mathbf{x}\_{k-1} + B\boldsymbol{\mu}\_{k-1} + \mathbf{w}\_{k\prime} \\ \mathbf{y}\_k &= \mathbf{C}\mathbf{x}\_k + \mathbf{D}\boldsymbol{\mu}\_k + \mathbf{v}\_{k\prime} \end{aligned} \tag{1}$$

acceptable results, all systems are ultimately nonlinear. Extensions of the KF have been presented in the last decades to deal with nonlinear systems. Some examples are the EKF and

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

The EKF and the UKF (a SPKF type) are derivatives of the KF for nonlinear systems. The EKF was originally proposed in [8] and is the most commonly applied state estimator for nonlinear systems. However, if the system nonlinearities are severe or the noises affecting the system are high, the EKF can be difficult to tune, often gives wrong estimates and can lead to filter divergence easily. This is because the EKF uses linearized system and measurement models at the current estimate and propagates the mean and covariance of the GRVs through these linearizations. The UKF was presented in [10] and addresses the deficiencies of the EKF linearization providing a direct and explicit mechanism for approximating and transforming the mean and covariance of the GRVs.

In general, a discrete-time state-space model of a nonlinear system can be described by

and higher meaning that the resulting error should be smaller [7, 9].

remaining θ<sup>k</sup> ¼ θ<sup>k</sup>�<sup>1</sup> during the process update.

x<sup>k</sup> ¼ f xð <sup>k</sup>�<sup>1</sup>; θ<sup>k</sup>�<sup>1</sup>; u<sup>k</sup>�<sup>1</sup>Þ þ w<sup>k</sup>�<sup>1</sup>,

where θ<sup>k</sup> ∈ Rnp is the (unknown) parameter vector and f and h are arbitrary vector-valued functions usually called system and measurement functions. As a KF derivative, the UKF aim is to minimize the covariance of the state estimation error to find an optimal estimation of the state true dynamic probability density function (pdf). The main component of this filter is the UT. This transformation uses a set of appropriately selected weighted points to parameterize the mean and covariance of the pdf. Two steps characterize also the UKF. In the process update, the sigma points are calculated and then propagated through the nonlinear system functions to recover the mean and covariance of the new a priori estimates. The estimated measurement (byk) is calculated in the correction step and together with the actual measurement are used to correct the a priori estimate. This results in the a posteriori state estimate. While the UKF matches the true mean of x<sup>k</sup> correctly up to the third order, the EKF only matches up to the first order. Both filters approximate the true covariance of x<sup>k</sup> up to the third order. However, the UKF correctly approximates the signed of the terms to the fourth power

The nonlinear extensions of the KF can also estimate the unknown parameters of a system. The UKF was extended for joint state and parameter estimation in [24]. In this case, the system state vector x<sup>k</sup> was extended by including the unknown parameters θ<sup>k</sup> to obtain a joint state and

> <sup>~</sup>x<sup>k</sup> <sup>¼</sup> <sup>x</sup><sup>k</sup> θk

Square-root (SR) filtering increases mathematically the precision of the KF when hardware precision is not available. In [25], an SR version of the UKF was presented, which uses linear

<sup>y</sup><sup>k</sup> <sup>¼</sup> h xk; <sup>θ</sup><sup>k</sup> ð Þþ ; <sup>u</sup><sup>k</sup> <sup>v</sup>k, (3)

http://dx.doi.org/10.5772/intechopen.72470

81

� �, (4)

the sigma-point Kalman filters (SPKFs).

2.2. Nonlinear filtering

parameter vector as

where x<sup>k</sup> ∈ Rnx is the system state vector at discrete time k, and u<sup>k</sup> ∈ Rnu and y<sup>k</sup> ∈ Rny correspond to the system input and measurement vectors, respectively. The matrices A ∈ Rnx�nx , B∈ Rnx�nu , C ∈ Rny�nx and D ∈ Rny�nu are often called system, input, output and feedforward matrices, respectively, and describe the system behaviour. The random variable vectors w<sup>k</sup> and v<sup>k</sup> represent the process and measurement noises. These are considered white Gaussian, zero mean, and uncorrelated and have covariance matrices Q<sup>k</sup> and Rk, respectively, as

$$\begin{aligned} \omega\_k &\sim \mathcal{N}(\mathbf{0}, \mathbf{Q}\_k), \\ \sigma\_k &\sim \mathcal{N}(\mathbf{0}, \mathbf{R}\_k). \end{aligned} \tag{2}$$

The KF iterative nature can be separated in two main steps: the process update and the correction step. In the process update, based on the knowledge of the system dynamics, the state estimate (x bþ <sup>k</sup>�<sup>1</sup>) <sup>1</sup> from the previous time step (<sup>k</sup> � 1) is used to calculate a new estimate at the current time (k). This step does not include any information of the system measurements and the resulting state estimate is called a priori estimate (bx� <sup>k</sup> ). In the correction step, the a priori estimate is combined with the current system measurement (yk) to improve the state estimate. This estimate is called the a posteriori state estimate (bx<sup>þ</sup> <sup>k</sup> ). The vectors x b� <sup>k</sup> and <sup>b</sup>x<sup>þ</sup> <sup>k</sup> estimate both the same quantity, but the difference between them is that the last one takes the measurement (yk) into account. A Kalman gain matrix (KkÞ is calculated at every discrete step and weights the influence of the model and the measurements on the current state estimate. This gain is calculated using the system matrices and the process (Qk) and measurement (Rk) covariances. More information about the KF equations and generalizations can be found in [4, 7, 9].

The KF is a linear optimal estimator, but it assumes that the system model and noise statistics are known. Otherwise, the filter estimates can degrade. Tuning the performance of the filter implies primarily adjusting the process and measurement covariance matrices to match the (unknown) real-system noise statistics. In practical implementations of the KF, the filter tuning is performed online, and empirical values are normally used. Extensive research has been done in this field to estimate the noise covariances from data (see [17–20] and references therein).

As mentioned before, the KF is the optimal linear estimator, which estimates states of a linear dynamic system using the inputs, measurements and a parametric mathematical model of the system. Even though many systems are close enough to linear and linear estimators give

<sup>1</sup> The hatbover a vector represents the estimate of the vector, for example, <sup>b</sup><sup>x</sup> describes the estimate of the state vector <sup>x</sup>.

acceptable results, all systems are ultimately nonlinear. Extensions of the KF have been presented in the last decades to deal with nonlinear systems. Some examples are the EKF and the sigma-point Kalman filters (SPKFs).

### 2.2. Nonlinear filtering

the mean and covariance of these (Gaussian) RVs through time. The KF is an optimal linear filter for these types of systems [7, 9]. It is a recursive algorithm, which enables new measurements to be processed as they arrive to correct and update the state and measurement esti-

In general, a linear discrete-time system corrupted by additive noises can be written as follows:

x<sup>k</sup> ¼ Ax<sup>k</sup>�<sup>1</sup> þ Bu<sup>k</sup>�<sup>1</sup> þ wk,

where x<sup>k</sup> ∈ Rnx is the system state vector at discrete time k, and u<sup>k</sup> ∈ Rnu and y<sup>k</sup> ∈ Rny correspond to the system input and measurement vectors, respectively. The matrices A ∈ Rnx�nx , B∈ Rnx�nu , C ∈ Rny�nx and D ∈ Rny�nu are often called system, input, output and feedforward matrices, respectively, and describe the system behaviour. The random variable vectors w<sup>k</sup> and v<sup>k</sup> represent the process and measurement noises. These are considered white Gaussian, zero

w<sup>k</sup> ∽ N 0; Q<sup>k</sup> ð Þ,

The KF iterative nature can be separated in two main steps: the process update and the correction step. In the process update, based on the knowledge of the system dynamics, the state estimate

combined with the current system measurement (yk) to improve the state estimate. This estimate

quantity, but the difference between them is that the last one takes the measurement (yk) into account. A Kalman gain matrix (KkÞ is calculated at every discrete step and weights the influence of the model and the measurements on the current state estimate. This gain is calculated using the system matrices and the process (Qk) and measurement (Rk) covariances. More information

The KF is a linear optimal estimator, but it assumes that the system model and noise statistics are known. Otherwise, the filter estimates can degrade. Tuning the performance of the filter implies primarily adjusting the process and measurement covariance matrices to match the (unknown) real-system noise statistics. In practical implementations of the KF, the filter tuning is performed online, and empirical values are normally used. Extensive research has been done in this field to estimate the noise covariances from data (see [17–20] and references therein).

As mentioned before, the KF is the optimal linear estimator, which estimates states of a linear dynamic system using the inputs, measurements and a parametric mathematical model of the system. Even though many systems are close enough to linear and linear estimators give

The hatbover a vector represents the estimate of the vector, for example, <sup>b</sup><sup>x</sup> describes the estimate of the state vector <sup>x</sup>.

<sup>1</sup> from the previous time step (<sup>k</sup> � 1) is used to calculate a new estimate at the current time (k). This step does not include any information of the system measurements and the resulting

<sup>k</sup> ). The vectors x

b� <sup>k</sup> and <sup>b</sup>x<sup>þ</sup>

mean, and uncorrelated and have covariance matrices Q<sup>k</sup> and Rk, respectively, as

<sup>y</sup><sup>k</sup> <sup>¼</sup> Cx<sup>k</sup> <sup>þ</sup> Du<sup>k</sup> <sup>þ</sup> <sup>v</sup>k, (1)

<sup>v</sup><sup>k</sup> <sup>∽</sup> <sup>N</sup>ð Þ <sup>0</sup>; <sup>R</sup><sup>k</sup> : (2)

<sup>k</sup> ). In the correction step, the a priori estimate is

<sup>k</sup> estimate both the same

mates.

80 Kalman Filters - Theory for Advanced Applications

(x bþ <sup>k</sup>�<sup>1</sup>)

1

state estimate is called a priori estimate (bx�

is called the a posteriori state estimate (bx<sup>þ</sup>

about the KF equations and generalizations can be found in [4, 7, 9].

The EKF and the UKF (a SPKF type) are derivatives of the KF for nonlinear systems. The EKF was originally proposed in [8] and is the most commonly applied state estimator for nonlinear systems. However, if the system nonlinearities are severe or the noises affecting the system are high, the EKF can be difficult to tune, often gives wrong estimates and can lead to filter divergence easily. This is because the EKF uses linearized system and measurement models at the current estimate and propagates the mean and covariance of the GRVs through these linearizations. The UKF was presented in [10] and addresses the deficiencies of the EKF linearization providing a direct and explicit mechanism for approximating and transforming the mean and covariance of the GRVs.

In general, a discrete-time state-space model of a nonlinear system can be described by

$$\begin{aligned} \mathbf{x}\_k &= f(\mathbf{x}\_{k-1}, \theta\_{k-1}, \mathbf{u}\_{k-1}) + \mathbf{w}\_{k-1}, \\ \mathbf{y}\_k &= \mathbf{h}(\mathbf{x}\_k, \theta\_k, \mathbf{u}\_k) + \mathbf{v}\_{k\prime} \end{aligned} \tag{3}$$

where θ<sup>k</sup> ∈ Rnp is the (unknown) parameter vector and f and h are arbitrary vector-valued functions usually called system and measurement functions. As a KF derivative, the UKF aim is to minimize the covariance of the state estimation error to find an optimal estimation of the state true dynamic probability density function (pdf). The main component of this filter is the UT. This transformation uses a set of appropriately selected weighted points to parameterize the mean and covariance of the pdf. Two steps characterize also the UKF. In the process update, the sigma points are calculated and then propagated through the nonlinear system functions to recover the mean and covariance of the new a priori estimates. The estimated measurement (byk) is calculated in the correction step and together with the actual measurement are used to correct the a priori estimate. This results in the a posteriori state estimate. While the UKF matches the true mean of x<sup>k</sup> correctly up to the third order, the EKF only matches up to the first order. Both filters approximate the true covariance of x<sup>k</sup> up to the third order. However, the UKF correctly approximates the signed of the terms to the fourth power and higher meaning that the resulting error should be smaller [7, 9].

The nonlinear extensions of the KF can also estimate the unknown parameters of a system. The UKF was extended for joint state and parameter estimation in [24]. In this case, the system state vector x<sup>k</sup> was extended by including the unknown parameters θ<sup>k</sup> to obtain a joint state and parameter vector as

$$
\tilde{\mathbf{x}}\_k = \begin{pmatrix} \mathbf{x}\_k \\ \mathbf{e}\_k \end{pmatrix},\tag{4}
$$

remaining θ<sup>k</sup> ¼ θ<sup>k</sup>�<sup>1</sup> during the process update.

Square-root (SR) filtering increases mathematically the precision of the KF when hardware precision is not available. In [25], an SR version of the UKF was presented, which uses linear algebra techniques such as the QR decomposition and the Cholesky factor [26] to calculate the SR of the estimation error covariance. The SR form improves the numerical stability of the filter and guarantees positive semi-definiteness of this covariance. Additionally, the computational complexity for state and parameter estimation is reduced [25].

#### 2.3. Recursive prediction-error method

In this section, the recursive prediction-error method (RPEM) is briefly discussed. This method is extensively analysed in [11, 12] and uses a parameterized predictor that estimates the system outputs at the current time step. The resulting predicted system output is then compared to the actual system measurement, and the predictor parameters are corrected such as that the prediction error is minimized.

The quadratic criterion function defined as

$$V\_k(\boldsymbol{\theta}\_k) = \frac{1}{2} \boldsymbol{e}\_k^{\mathrm{T}}(\boldsymbol{\theta}\_k) \boldsymbol{\Lambda}^{-1} \boldsymbol{e}\_k(\boldsymbol{\theta}\_k)\_\prime \tag{5}$$

The selection of the forgetting factor essentially defines the measurements that are relevant for the current estimation of the parameter predictor. The most common choice is to take a constant forgetting factor for systems that change gradually. Other criterions for selection of

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

This is the main section of this chapter. The earlier sections were written to provide the needed methods for this section, and the later sections are written to analyse and test the performance

The aSRUKF is discussed in this section. This filter combines the SRUKF and the RPEM. While the KF derivative estimates the system states and measurements, the RPEM calculates the

In this filter, the innovation error in Eq. (6) is calculated and minimized using the recursive scheme presented in Eq. (7) in order to estimate the unknown system parameters and covariances. Besides the matrix <sup>b</sup>yk, all parameters, vectors, and matrices of the recursive scheme are defined. The derivative of the estimated measurement (byk<sup>Þ</sup> w.r.t. the vector (θb<sup>k</sup>�<sup>1</sup><sup>Þ</sup> containing the unknown values of parameters and covariances needs to be calculated. This matrix is also called the output sensitivity and describes the influence of a variation of a parameter on the

The equations of a SRUKF are then extended in order to calculate the output sensitivity. To

ð Þ nx þ κ ,

kr <sup>¼</sup> <sup>w</sup><sup>c</sup> <sup>⨂</sup> <sup>m</sup><sup>T</sup>

nx þ λ<sup>f</sup> p ,

http://dx.doi.org/10.5772/intechopen.72470

83

(8)

1 ,

<sup>k</sup> ) and the a priori state estimate sensitivity

<sup>0</sup> <sup>þ</sup> <sup>1</sup> � <sup>α</sup><sup>2</sup> <sup>þ</sup> <sup>β</sup> � �, <sup>η</sup> <sup>¼</sup> ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

� � , i <sup>¼</sup> <sup>1</sup>, …, m <sup>¼</sup> <sup>2</sup>nx, <sup>λ</sup><sup>f</sup> <sup>¼</sup> <sup>α</sup><sup>2</sup>

<sup>0</sup> <sup>¼</sup> <sup>w</sup><sup>m</sup>

m<sup>1</sup> ¼ 11,nx , m<sup>2</sup> ¼ 11,l, l ¼ 2nx þ 1,

<sup>0</sup> ;…; w<sup>m</sup> m � �, W<sup>c</sup>

estimated state <sup>b</sup>xk, <sup>β</sup> incorporates information about the noise distribution (e.g. <sup>β</sup> <sup>¼</sup> 2 assumes that the system is affected by Gaussian noise), and κ is a scaling factor, which can be used to reduce the higher-order errors of the mean and covariance approximations [9]. The Kronecker

The process update step of the aSRUKF is presented in Table 1. After the filter initialization, the sigma points (X<sup>k</sup>�1) that describe the pdf of the state estimate are calculated using the UT. At the same time, the sigma-point derivatives (Φ<sup>k</sup>�1) are also obtained. The sigma points and its derivatives are propagated through the system function and the system derivative function,

b�

<sup>k</sup> ). Considering additive process noises, the SR factor of the estimation error covariance

xx, <sup>k</sup>) is calculated using the QR decomposition (qrðÞ) and the rank-one update to Cholesky

<sup>i</sup> are a set of scalar weights, α determines the spread of sigma points around the

system output. The output sensitivity can be obtained using a KF derivative.

simplify the reading flow, the following definitions are presented:

� � , wc

<sup>i</sup> <sup>¼</sup> <sup>1</sup> 2 nx þ λ<sup>f</sup>

<sup>0</sup>;…; w<sup>c</sup> m � �, <sup>w</sup><sup>m</sup> <sup>¼</sup> <sup>w</sup><sup>m</sup>

respectively, to obtain the a priori state estimate (x

this factor and the convergence of the RPEM are discussed extensively in [11, 12].

2.4. Sensitivity-based adaptive square-root Kalman filter

of the filter described in this section.

unknown parameters and covariances.

wm <sup>i</sup> <sup>¼</sup> <sup>w</sup><sup>c</sup>

w<sup>m</sup>

where wm, <sup>c</sup>

(Xb �

(S�

<sup>0</sup> <sup>¼</sup> <sup>λ</sup><sup>f</sup> 2 nx þ λ<sup>f</sup>

<sup>w</sup><sup>c</sup> <sup>¼</sup> <sup>w</sup><sup>c</sup>

product [27] is described by ⨂ .

is minimized using the stochastic Gauss-Newton method in order to obtain the predictor parameters. The prediction error ekð Þ θ<sup>k</sup> at the discrete time k is described as

$$e\_k(\theta\_k) = y\_k - \hat{y}\_k(\theta\_k)\_\prime \tag{6}$$

where <sup>y</sup><sup>k</sup> corresponds to the actual system measurement, <sup>b</sup>ykð Þ <sup>θ</sup><sup>k</sup> refers to the parameterized predictor output using parameter set θ<sup>k</sup> and Λ is a user-defined weight factor.

The recursive solution that minimizes the quadratic criterion function in Eq. (5) is given by the following scheme:

$$\begin{split} \boldsymbol{\Delta}\_{k} &= \boldsymbol{\Delta}\_{k-1} + (1-\lambda) \left( \boldsymbol{e}\_{k} \boldsymbol{e}\_{k}^{\mathrm{T}} - \boldsymbol{\Delta}\_{k-1} \right), \\ \boldsymbol{\mathcal{S}}\_{k} &= \lambda \boldsymbol{\Delta}\_{k} + \frac{\mathrm{d}\hat{\boldsymbol{\mathcal{Y}}}\_{k}}{\mathrm{d}\hat{\boldsymbol{\mathcal{O}}}\_{k-1}} \boldsymbol{\Theta}\_{k-1} \frac{\mathrm{d}\hat{\boldsymbol{\mathcal{Y}}}\_{k}^{\mathrm{T}}}{\mathrm{d}\hat{\boldsymbol{\mathcal{O}}}\_{k-1}}, \\ \boldsymbol{L}\_{k} &= \boldsymbol{\Theta}\_{k-1} \frac{\mathrm{d}\hat{\boldsymbol{\mathcal{Y}}}\_{k}^{\mathrm{T}}}{\mathrm{d}\hat{\boldsymbol{\mathcal{O}}}\_{k-1}} \boldsymbol{S}\_{k}^{-1}, \\ \boldsymbol{\Theta}\_{k} &= \left( \boldsymbol{I}^{n\_{\theta}} - \boldsymbol{L}\_{k} \frac{\mathrm{d}\hat{\boldsymbol{\mathcal{Y}}}\_{k}}{\mathrm{d}\hat{\boldsymbol{\mathcal{O}}}\_{k-1}} \right) \boldsymbol{\Theta}\_{k-1} \left( \boldsymbol{I}^{n\_{\theta}} - \boldsymbol{L}\_{k} \frac{\mathrm{d}\hat{\boldsymbol{\mathcal{Y}}}\_{k}^{\mathrm{T}}}{\mathrm{d}\hat{\boldsymbol{\mathcal{O}}}\_{k-1}} \right) / \lambda + \boldsymbol{L}\_{k} \boldsymbol{\Delta}\_{k} \boldsymbol{L}\_{k}^{\mathrm{T}}, \\ \hat{\boldsymbol{\mathcal{O}}}\_{k} &= \hat{\boldsymbol{\mathcal{O}}}\_{k-1} + \boldsymbol{L}\_{k} \boldsymbol{\epsilon}\_{k}. \end{split} \tag{7}$$

The user-defined parameter 0 < λ ≤ 1 is often called the forgetting factor. The matrix Δ<sup>k</sup> is calculated using the prediction error. This matrix is used to calculate Sk, where the derivative of the output w.r.t. to the unknown parameter vector <sup>d</sup>by<sup>k</sup> <sup>d</sup>θb<sup>k</sup>�<sup>1</sup> � � appears. The gain vector <sup>L</sup><sup>k</sup> is multiplied by the innovation error to update then the parameter estimation. It should be noted that besides the matrix <sup>b</sup>y<sup>k</sup> <sup>¼</sup> <sup>d</sup>by<sup>k</sup> <sup>d</sup>θb<sup>k</sup>�<sup>1</sup> , all parameters, vectors, and matrices are defined after an initialization. The matrix <sup>b</sup>y<sup>k</sup> can be calculated modifying a KF derivative.

The selection of the forgetting factor essentially defines the measurements that are relevant for the current estimation of the parameter predictor. The most common choice is to take a constant forgetting factor for systems that change gradually. Other criterions for selection of this factor and the convergence of the RPEM are discussed extensively in [11, 12].

#### 2.4. Sensitivity-based adaptive square-root Kalman filter

algebra techniques such as the QR decomposition and the Cholesky factor [26] to calculate the SR of the estimation error covariance. The SR form improves the numerical stability of the filter and guarantees positive semi-definiteness of this covariance. Additionally, the computational

In this section, the recursive prediction-error method (RPEM) is briefly discussed. This method is extensively analysed in [11, 12] and uses a parameterized predictor that estimates the system outputs at the current time step. The resulting predicted system output is then compared to the actual system measurement, and the predictor parameters are corrected such as that the

complexity for state and parameter estimation is reduced [25].

Vkð Þ¼ θ<sup>k</sup>

parameters. The prediction error ekð Þ θ<sup>k</sup> at the discrete time k is described as

predictor output using parameter set θ<sup>k</sup> and Λ is a user-defined weight factor.

Θ<sup>k</sup>�<sup>1</sup>

S�<sup>1</sup> k ,

<sup>d</sup>by<sup>k</sup> dθb<sup>k</sup>�<sup>1</sup>

<sup>Δ</sup><sup>k</sup> <sup>¼</sup> <sup>Δ</sup><sup>k</sup>�<sup>1</sup> <sup>þ</sup> ð Þ <sup>1</sup> � <sup>λ</sup> <sup>e</sup>ke<sup>T</sup>

<sup>d</sup>by<sup>k</sup> dθb<sup>k</sup>�<sup>1</sup>

dybT k dθb<sup>k</sup>�<sup>1</sup>

!

<sup>n</sup><sup>θ</sup> � <sup>L</sup><sup>k</sup>

of the output w.r.t. to the unknown parameter vector <sup>d</sup>by<sup>k</sup>

<sup>d</sup>θb<sup>k</sup>�<sup>1</sup>

initialization. The matrix <sup>b</sup>y<sup>k</sup> can be calculated modifying a KF derivative.

θb<sup>k</sup> ¼ θb<sup>k</sup>�<sup>1</sup> þ Lkek:

S<sup>k</sup> ¼ λΔ<sup>k</sup> þ

L<sup>k</sup> ¼ Θ<sup>k</sup>�<sup>1</sup>

Θ<sup>k</sup> ¼ I

that besides the matrix <sup>b</sup>y<sup>k</sup> <sup>¼</sup> <sup>d</sup>by<sup>k</sup>

1 2 eT <sup>k</sup> ð Þ <sup>θ</sup><sup>k</sup> <sup>Λ</sup>�<sup>1</sup>

is minimized using the stochastic Gauss-Newton method in order to obtain the predictor

where <sup>y</sup><sup>k</sup> corresponds to the actual system measurement, <sup>b</sup>ykð Þ <sup>θ</sup><sup>k</sup> refers to the parameterized

The recursive solution that minimizes the quadratic criterion function in Eq. (5) is given by the

<sup>k</sup> � Δ<sup>k</sup>�<sup>1</sup> � �,

> dybT k dθb<sup>k</sup>�<sup>1</sup> ,

Θ<sup>k</sup>�<sup>1</sup> I

The user-defined parameter 0 < λ ≤ 1 is often called the forgetting factor. The matrix Δ<sup>k</sup> is calculated using the prediction error. This matrix is used to calculate Sk, where the derivative

multiplied by the innovation error to update then the parameter estimation. It should be noted

<sup>n</sup><sup>θ</sup> � <sup>L</sup><sup>k</sup>

!

dybT k dθb<sup>k</sup>�<sup>1</sup>

<sup>d</sup>θb<sup>k</sup>�<sup>1</sup> � �

, all parameters, vectors, and matrices are defined after an

<sup>=</sup><sup>λ</sup> <sup>þ</sup> <sup>L</sup>kΔkL<sup>T</sup>

k ,

appears. The gain vector L<sup>k</sup> is

(7)

ekð Þ θ<sup>k</sup> , (5)

<sup>e</sup>kð Þ¼ <sup>θ</sup><sup>k</sup> <sup>y</sup><sup>k</sup> � <sup>b</sup>ykð Þ <sup>θ</sup><sup>k</sup> , (6)

2.3. Recursive prediction-error method

82 Kalman Filters - Theory for Advanced Applications

The quadratic criterion function defined as

prediction error is minimized.

following scheme:

This is the main section of this chapter. The earlier sections were written to provide the needed methods for this section, and the later sections are written to analyse and test the performance of the filter described in this section.

The aSRUKF is discussed in this section. This filter combines the SRUKF and the RPEM. While the KF derivative estimates the system states and measurements, the RPEM calculates the unknown parameters and covariances.

In this filter, the innovation error in Eq. (6) is calculated and minimized using the recursive scheme presented in Eq. (7) in order to estimate the unknown system parameters and covariances. Besides the matrix <sup>b</sup>yk, all parameters, vectors, and matrices of the recursive scheme are defined. The derivative of the estimated measurement (byk<sup>Þ</sup> w.r.t. the vector (θb<sup>k</sup>�<sup>1</sup><sup>Þ</sup> containing the unknown values of parameters and covariances needs to be calculated. This matrix is also called the output sensitivity and describes the influence of a variation of a parameter on the system output. The output sensitivity can be obtained using a KF derivative.

The equations of a SRUKF are then extended in order to calculate the output sensitivity. To simplify the reading flow, the following definitions are presented:

$$\begin{aligned} w\_i^m &= w\_i^c = \frac{1}{2\left(n\_x + \lambda\_f\right)'} & \mathbf{i} &= 1, \dots, m = 2n\_x, & \lambda\_f &= \alpha^2 (n\_x + \kappa), \\ \mathbf{w}\_0^m &= \frac{\lambda\_f}{2\left(n\_x + \lambda\_f\right)'} & \mathbf{w}\_0^c = w\_0^m + \left(1 - \alpha^2 + \beta\right), & \eta &= \sqrt{n\_x + \lambda\_f}, \\ \mathbf{m}\_1 &= 1\_{1, n\_x} & \mathbf{m}\_2 = 1\_{1, l} & l &= 2n\_x + 1, \\ \mathbf{w}^c &= \left(w\_0^c, \dots, w\_m^c\right), & \mathbf{w}^m = \left(w\_0^m, \dots, w\_m^m\right), & \mathbf{W}\_{\mathbf{k}r}^c = \mathbf{w}^c \otimes \mathbf{m}\_{1'}^\top \end{aligned} \tag{8}$$

where wm, <sup>c</sup> <sup>i</sup> are a set of scalar weights, α determines the spread of sigma points around the estimated state <sup>b</sup>xk, <sup>β</sup> incorporates information about the noise distribution (e.g. <sup>β</sup> <sup>¼</sup> 2 assumes that the system is affected by Gaussian noise), and κ is a scaling factor, which can be used to reduce the higher-order errors of the mean and covariance approximations [9]. The Kronecker product [27] is described by ⨂ .

The process update step of the aSRUKF is presented in Table 1. After the filter initialization, the sigma points (X<sup>k</sup>�1) that describe the pdf of the state estimate are calculated using the UT. At the same time, the sigma-point derivatives (Φ<sup>k</sup>�1) are also obtained. The sigma points and its derivatives are propagated through the system function and the system derivative function, respectively, to obtain the a priori state estimate (x b� <sup>k</sup> ) and the a priori state estimate sensitivity (Xb � <sup>k</sup> ). Considering additive process noises, the SR factor of the estimation error covariance (S� xx, <sup>k</sup>) is calculated using the QR decomposition (qrðÞ) and the rank-one update to Cholesky


The correction step is shown in Table 2. A new set of sigma points (X�

RPEM to estimate the system parameters and covariances.

posteriori state estimation (bx<sup>þ</sup>

max <sup>X</sup><sup>b</sup> <sup>þ</sup>

� � �

k�Nw

using the SB-aSRUKF.

� � � 2 ;…; <sup>X</sup><sup>b</sup> <sup>þ</sup> k � � �

� � � 2

(Φk) can be generated using steps (a) and (b) from Table 2. If the nonlinearity is not severe, these steps can be skipped. This saves computational effort but sacrifices filter performance. The (new) sigma points and its derivatives are then propagated through the measurement function and its derivative, respectively. The resulting points are used to calculate the estimated measurements (Yk) as well as the output sensitivities (byk). These are used within the

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

The SR factor of the innovation error covariance (Syy, <sup>k</sup>), the cross-covariance (Pxy, <sup>k</sup>) together with its derivatives matrices (Syy, <sup>k</sup>, Pxy, <sup>k</sup>) are calculated in order to obtain the Kalman gain matrix (Kk) and its sensitivity (Kk). The aSRUKF treats also the measurement noises as additive. The a

<sup>k</sup> ), the a posteriori state sensitivity (Xb <sup>þ</sup>

of the estimation error covariance (Sxx, <sup>k</sup>) and its sensitivity (Sxx, <sup>k</sup>) close the loop of the aSRUKF. Local sensitivity analysis can be utilized to determine if a system input or a system modification can excite the system parameters in order to identify them. The a posteriori state sensitivity from Table 2 (d) can be used to determine the influence of parameters to the system states. This sensitivity results from the correction step of the aSRUKF. As long as the sensitivity Xb <sup>þ</sup>

remains below a user-defined threshold, the parameter update from Table 2 (e) can be skipped to prevent parameter estimation drifts. A time window ð Þ Nw can be used to calculate

> for p ¼ 1 to n<sup>θ</sup> do sa ¼ 0

if sa > tvð Þp then update\_values ¼ True

The variable sa represents the sensitivity sum w.r.t. a system parameter θk, <sup>p</sup> over all system states (xk, <sup>1</sup>, …, xk,nx Þ. The threshold vector t<sup>v</sup> should be selected with caution. Too high values prevent parameter estimation drifts but can increase the convergence time of the filter. Moreover, the parameter excitation can be significantly reduced and the resulting estimation can be

> dx<sup>k</sup>�<sup>1</sup> dθk,j þ ∂f ∂θk,j � � � � <sup>b</sup>x<sup>k</sup>�<sup>1</sup>,θb<sup>k</sup>�<sup>1</sup>

This sensitivity computation is compared in Section 4 with a posterior state sensitivity obtained

defined with values between 0 and 1. The update procedure can be described as

biased. The performance of the SB-aSRUKF is evaluated in Section 4. The local state sensitivity can be also calculated as follows (cf. [29]):

> ¼ ∂f ∂x<sup>k</sup> � � � � <sup>b</sup>x<sup>k</sup>�<sup>1</sup>,θb<sup>k</sup>�<sup>1</sup>

dx<sup>k</sup> dθk,j

� � to normalize the sensitivity values. A threshold vector <sup>t</sup><sup>v</sup> is then

for n ¼ 1 to nx do sa ¼ sa þ

dxk, <sup>n</sup> dθk, <sup>p</sup> <sup>k</sup> ) and its derivatives

85

http://dx.doi.org/10.5772/intechopen.72470

<sup>k</sup> ) together with the SR factor

k

(9)

(10)

Table 1. aSRUKF: filter initialization, sigma-points calculation and filter process update step. The Kronecker product is described by ⨂ and ⨀ defines the element-wise multiplication. The ð Þ<sup>s</sup> operator stacks the matrix columns to form a column vector.

factorization (cholupdateðÞ <sup>2</sup> ) in which the signum function (signðÞ) is used to determine the sign of the first calculated weight factor. If the weight factor results negative, a Cholesky downdate takes place; otherwise, a Cholesky update occurs. The next step calculates the derivative of the SR factor of the estimation error covariance (S� xx, <sup>k</sup>). In this step, the function treshapeMðÞ is used. This function converts a vector of dimension ð Þ ð Þ nxð Þ nx þ 1 =2 n<sup>θ</sup> � 1 into a ð Þ nx � nxn<sup>θ</sup> matrix with n<sup>θ</sup> lower triangular blocks of size (nx � nxÞ. Additionally, the operator ðÞ<sup>s</sup> is utilized to stack the matrix columns to form a column vector. Further information about this step can be found in [28].

<sup>2</sup> Matlab does not allow the use of cholupdateðÞ in real-time applications; using coder:extrinsic <sup>0</sup> cholupdate<sup>0</sup> � �, it is possible to use the function in Simulink but the application does not run in real time. The cholupdateðÞ line can be replaced with chol S� xx, k � �<sup>T</sup> S� xx, <sup>k</sup> <sup>þ</sup> <sup>w</sup><sup>c</sup> <sup>0</sup> X<sup>∗</sup> <sup>0</sup>, <sup>k</sup> � <sup>x</sup>b� k � � � � .

The correction step is shown in Table 2. A new set of sigma points (X� <sup>k</sup> ) and its derivatives (Φk) can be generated using steps (a) and (b) from Table 2. If the nonlinearity is not severe, these steps can be skipped. This saves computational effort but sacrifices filter performance. The (new) sigma points and its derivatives are then propagated through the measurement function and its derivative, respectively. The resulting points are used to calculate the estimated measurements (Yk) as well as the output sensitivities (byk). These are used within the RPEM to estimate the system parameters and covariances.

The SR factor of the innovation error covariance (Syy, <sup>k</sup>), the cross-covariance (Pxy, <sup>k</sup>) together with its derivatives matrices (Syy, <sup>k</sup>, Pxy, <sup>k</sup>) are calculated in order to obtain the Kalman gain matrix (Kk) and its sensitivity (Kk). The aSRUKF treats also the measurement noises as additive. The a posteriori state estimation (bx<sup>þ</sup> <sup>k</sup> ), the a posteriori state sensitivity (Xb <sup>þ</sup> <sup>k</sup> ) together with the SR factor of the estimation error covariance (Sxx, <sup>k</sup>) and its sensitivity (Sxx, <sup>k</sup>) close the loop of the aSRUKF.

Local sensitivity analysis can be utilized to determine if a system input or a system modification can excite the system parameters in order to identify them. The a posteriori state sensitivity from Table 2 (d) can be used to determine the influence of parameters to the system states. This sensitivity results from the correction step of the aSRUKF. As long as the sensitivity Xb <sup>þ</sup> k remains below a user-defined threshold, the parameter update from Table 2 (e) can be skipped to prevent parameter estimation drifts. A time window ð Þ Nw can be used to calculate max <sup>X</sup><sup>b</sup> <sup>þ</sup> k�Nw � � � � � � 2 ;…; <sup>X</sup><sup>b</sup> <sup>þ</sup> k � � � � � � 2 � � to normalize the sensitivity values. A threshold vector <sup>t</sup><sup>v</sup> is then defined with values between 0 and 1. The update procedure can be described as

$$\begin{aligned} \textbf{for } p &= 1 \text{ to } n\_{\theta} \text{ do} \\ \text{sa } &= 0 \\ \textbf{for } n &= 1 \text{ to } n\_{x} \text{ do} \\ \text{sa } &= \text{sa} + \frac{d x\_{k,n}}{d \theta\_{k,p}} \\ \text{if } \textbf{sa} &> \iota\_{v}(p) \text{ then} \\ \text{update\\_values} &= \text{True} \end{aligned} \tag{9}$$

The variable sa represents the sensitivity sum w.r.t. a system parameter θk, <sup>p</sup> over all system states (xk, <sup>1</sup>, …, xk,nx Þ. The threshold vector t<sup>v</sup> should be selected with caution. Too high values prevent parameter estimation drifts but can increase the convergence time of the filter. Moreover, the parameter excitation can be significantly reduced and the resulting estimation can be biased. The performance of the SB-aSRUKF is evaluated in Section 4.

The local state sensitivity can be also calculated as follows (cf. [29]):

factorization (cholupdateðÞ <sup>2</sup>

aSRUKF Initialization

SM Sigma-point

SRUKF A priori state estimate

SM A priori

column vector.

2

chol S� xx, k � �<sup>T</sup> S� xx, <sup>k</sup> <sup>þ</sup> <sup>w</sup><sup>c</sup> <sup>0</sup> X<sup>∗</sup> <sup>0</sup>, <sup>k</sup> � <sup>x</sup>b� k

Sigma-points propagation <sup>X</sup><sup>∗</sup>

Sensitivity propagation <sup>Φ</sup><sup>∗</sup>

SR estimation error covariance

Derivative of estimation error covariance

state sensitivity <sup>X</sup>

this step can be found in [28].

� � � �

) in which the signum function (signðÞ) is used to determine the

<sup>þ</sup> <sup>d</sup>Q<sup>k</sup> dθ<sup>k</sup> � � � � θb <sup>k</sup>�<sup>1</sup>

xx, <sup>k</sup>). In this step, the function

cholupdate<sup>0</sup> � �, it is possible

sign of the first calculated weight factor. If the weight factor results negative, a Cholesky downdate takes place; otherwise, a Cholesky update occurs. The next step calculates the

Table 1. aSRUKF: filter initialization, sigma-points calculation and filter process update step. The Kronecker product is described by ⨂ and ⨀ defines the element-wise multiplication. The ð Þ<sup>s</sup> operator stacks the matrix columns to form a

treshapeMðÞ is used. This function converts a vector of dimension ð Þ ð Þ nxð Þ nx þ 1 =2 n<sup>θ</sup> � 1 into a ð Þ nx � nxn<sup>θ</sup> matrix with n<sup>θ</sup> lower triangular blocks of size (nx � nxÞ. Additionally, the operator ðÞ<sup>s</sup> is utilized to stack the matrix columns to form a column vector. Further information about

to use the function in Simulink but the application does not run in real time. The cholupdateðÞ line can be replaced with

derivative of the SR factor of the estimation error covariance (S�

Matlab does not allow the use of cholupdateðÞ in real-time applications; using coder:extrinsic <sup>0</sup>

.

<sup>b</sup>x<sup>0</sup> <sup>¼</sup> <sup>x</sup>init <sup>∈</sup> <sup>R</sup>nx , <sup>θ</sup><sup>b</sup> <sup>0</sup> <sup>¼</sup> <sup>θ</sup>init <sup>∈</sup> <sup>R</sup><sup>n</sup><sup>θ</sup> , <sup>S</sup>yy:<sup>k</sup> <sup>¼</sup> <sup>d</sup>Syy, <sup>k</sup>

, <sup>P</sup>yy, <sup>k</sup> <sup>¼</sup> <sup>d</sup>Pyy, <sup>k</sup> dθ<sup>k</sup>

xx, <sup>0</sup> <sup>¼</sup> Pxx,init <sup>∈</sup> <sup>R</sup><sup>n</sup>x�n<sup>x</sup> , <sup>P</sup>xx, <sup>0</sup> <sup>¼</sup> <sup>S</sup>xx, <sup>0</sup> <sup>¼</sup> <sup>0</sup> <sup>∈</sup> <sup>R</sup><sup>n</sup>x�nxn<sup>θ</sup> , <sup>P</sup>yy, <sup>0</sup> <sup>¼</sup> <sup>S</sup>yy, <sup>0</sup> <sup>¼</sup> <sup>0</sup><sup>∈</sup> <sup>R</sup><sup>n</sup>y�n<sup>y</sup> <sup>n</sup><sup>θ</sup>

SRUKF Sigma points <sup>X</sup><sup>k</sup>�<sup>1</sup> <sup>¼</sup> <sup>ð</sup>X<sup>k</sup>�1, <sup>1</sup>;…; <sup>X</sup><sup>k</sup>�1,lÞ ¼ <sup>b</sup><sup>x</sup> <sup>k</sup>�<sup>1</sup>bx<sup>k</sup>�<sup>1</sup> <sup>⨂</sup> <sup>m</sup><sup>1</sup> <sup>þ</sup> <sup>η</sup>Sxx, <sup>k</sup>�<sup>1</sup>bx<sup>k</sup>�<sup>1</sup> <sup>⨂</sup> <sup>m</sup><sup>1</sup> � <sup>η</sup>Sxx, <sup>k</sup>�<sup>1</sup>

� � <sup>¼</sup> <sup>d</sup>Xk, <sup>1</sup>

<sup>Φ</sup><sup>k</sup>�1,j,i <sup>þ</sup> <sup>∂</sup><sup>f</sup> ∂θk,j � � � <sup>X</sup>k�<sup>1</sup> ,θ^ <sup>k</sup>�<sup>1</sup>

<sup>1</sup>:2nx , <sup>k</sup> � <sup>x</sup>b� k � �

> <sup>n</sup><sup>θ</sup> <sup>⨂</sup> A† ls,S� xx, <sup>k</sup> � �

� �

I <sup>n</sup><sup>θ</sup> <sup>⨂</sup> W<sup>c</sup> kr � �<sup>T</sup> ⨀ X<sup>∗</sup> <sup>k</sup> � <sup>x</sup>b� <sup>k</sup> <sup>⨂</sup> m<sup>2</sup>

� �

nx <sup>⨂</sup> S� xx, k � �

xx, <sup>k</sup> ; ffiffiffiffiffiffiffiffiffi wc 0 � � � � <sup>q</sup> X∗ <sup>0</sup>, <sup>k</sup> � <sup>x</sup>b� k � �

� � � �

db θk, <sup>j</sup> ;…; dXk,m db θk,j � �

SQ, <sup>k</sup>

� � � �

P� xx, k � � s

� �, and <sup>T</sup> <sup>¼</sup> <sup>0</sup><sup>l</sup>�<sup>l</sup> <sup>1</sup> ;…; <sup>0</sup><sup>l</sup>�<sup>l</sup> <sup>n</sup><sup>θ</sup> ;<sup>I</sup>

N ð Þ nx

,

; sign w<sup>c</sup> 0

,

� �<sup>T</sup> � � � �

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> Φ<sup>∗</sup>

ÞEð Þ nx and

<sup>k</sup> � <sup>c</sup><sup>X</sup> � <sup>k</sup> <sup>⨂</sup> m<sup>2</sup>

. Further details of the construction of the matrix N ð Þ nx and the elimination matrix Eð Þ nx can be found in [28]

� �<sup>T</sup> � �

<sup>l</sup> � �

<sup>P</sup>xx, <sup>k</sup> <sup>¼</sup> <sup>d</sup>Pxx, <sup>k</sup> dθ<sup>k</sup>

84 Kalman Filters - Theory for Advanced Applications

Pxx, <sup>0</sup> <sup>¼</sup> Sxx, <sup>0</sup>S<sup>T</sup>

derivatives <sup>Φ</sup><sup>k</sup>�1,j <sup>¼</sup> <sup>Φ</sup><sup>k</sup>�1, <sup>1</sup>,j;…; <sup>Φ</sup><sup>k</sup>�1,l,j

k,j,i <sup>¼</sup> <sup>∂</sup><sup>f</sup> ∂x<sup>k</sup> � � � <sup>X</sup>k�<sup>1</sup> ,θ^ <sup>k</sup>�<sup>1</sup>

xx, <sup>k</sup> <sup>¼</sup> qr ffiffiffiffiffiffi wc 1 p X<sup>∗</sup>

xx, <sup>k</sup> ¼ cholupdate S�

xx, <sup>k</sup> ¼ treshapeM I

<sup>þ</sup> <sup>W</sup><sup>c</sup> kr⨀ X<sup>∗</sup> <sup>k</sup> � <sup>x</sup>b� <sup>k</sup> <sup>⨂</sup> m<sup>2</sup> � � <sup>T</sup> ð Þ<sup>l</sup> <sup>I</sup>

in which T ð Þ<sup>l</sup> ¼ I

<sup>k</sup> � X c� <sup>k</sup> <sup>⨂</sup> m<sup>2</sup> � �

> 0 ; T1;…; T<sup>n</sup><sup>θ</sup>

with <sup>X</sup><sup>b</sup> <sup>k</sup>�<sup>1</sup> <sup>¼</sup> <sup>d</sup>x^k�<sup>1</sup> <sup>d</sup>θ^k�<sup>1</sup>

xb� <sup>k</sup> <sup>¼</sup> <sup>X</sup><sup>∗</sup> <sup>k</sup> <sup>w</sup><sup>m</sup> ð Þ<sup>T</sup>

S�

S�

c� <sup>k</sup> <sup>¼</sup> <sup>Φ</sup><sup>∗</sup> <sup>k</sup> I <sup>n</sup><sup>θ</sup> <sup>⨂</sup> <sup>w</sup><sup>m</sup> ð Þ<sup>T</sup> � �

S�

with Als,S� xx, <sup>k</sup> ¼ S� xx, <sup>k</sup> <sup>⨂</sup> I nx <sup>þ</sup> <sup>I</sup>

P� xx, <sup>k</sup> <sup>¼</sup> <sup>Φ</sup><sup>∗</sup>

<sup>k</sup> ¼ f X<sup>k</sup>�<sup>1</sup>; θb <sup>k</sup>�<sup>1</sup>; u<sup>k</sup>�<sup>1</sup> � � dθ<sup>k</sup>

� �

<sup>¼</sup> <sup>X</sup><sup>b</sup> <sup>k</sup>�1,j

, <sup>S</sup>xx:<sup>k</sup> <sup>¼</sup> <sup>d</sup>Sxx, <sup>k</sup> dθ<sup>k</sup>

, <sup>Θ</sup><sup>k</sup> <sup>¼</sup> <sup>Θ</sup>init <sup>∈</sup> <sup>R</sup><sup>n</sup>θ�n<sup>θ</sup>

, <sup>Δ</sup><sup>k</sup> <sup>¼</sup> <sup>0</sup> <sup>∈</sup> <sup>R</sup>ny�ny ,

Xb <sup>k</sup>�1,j <sup>⨂</sup> m<sup>1</sup> þ ηSxx, <sup>k</sup>�1,jXb <sup>k</sup>�1,j <sup>⨂</sup> m<sup>1</sup> � ηSxx, <sup>k</sup>�1,j � �

$$\frac{d\mathbf{x}\_k}{d\varPhi\_{k,j}} = \frac{\partial f}{\partial \mathbf{x}}\Big|\_{\widehat{\mathfrak{X}}\_{k-1}} \frac{d\mathbf{x}\_{k-1}}{\widehat{\mathfrak{G}}\_{k-1}} + \frac{\partial f}{\partial \varPhi\_{k,j}}\Big|\_{\widehat{\mathfrak{X}}\_{k-1}} \frac{}{\widehat{\mathfrak{G}}\_{k-1}}\tag{10}$$

This sensitivity computation is compared in Section 4 with a posterior state sensitivity obtained using the SB-aSRUKF.


The RPEM can be combined with different KF derivatives to estimate system parameters and covariances. An EKF and a SRCuKF were used to calculate the output sensitivity in [22], which is then used to estimate the unknown values. More information about the aSRUKF can be

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

http://dx.doi.org/10.5772/intechopen.72470

87

In this section, two testbeds are presented and modelled. These modelled systems are used in Section 4 to test the performance of the SB-aSRUKF. The planar one-link robot system is presented and extended with a second arm to form a pendulum robot (pendubot). The

This section describes the planar one-link robot system shown in Figure 1. It consists of a long rectangular aluminium link driven by a DC motor via a shaft and a one-state toothed gear.

The angular position is measured with an incremental rotary encoder and the motor torque is determined by measuring the motor current. To simplify the motor model, it is assumed that the motor current is directly proportional to the armature current and that the motor torque is proportional to this current by a constant factor. Additionally, the link acceleration is measured using a micro-electro-mechanical sensor (MEMS) accelerometer attached to the link. The motor position is controlled by a classical cascade structure with P- and P-feedback controllers for

The corresponding continuous state-space representation of the planar one-link robot system, where the link angular position and acceleration are measured, can be written as follows:

pendubot is a chaotic and inherently unstable system.

Figure 1. Planar one-link robot system: structure and functionality.

3.1. Planar one-link robot system

position and speed.

found in [28, 30].

3. Testbeds

Table 2. aSRUKF: filter correction step and the RPEM for parameter and covariance estimation.

The RPEM can be combined with different KF derivatives to estimate system parameters and covariances. An EKF and a SRCuKF were used to calculate the output sensitivity in [22], which is then used to estimate the unknown values. More information about the aSRUKF can be found in [28, 30].

### 3. Testbeds

SRUKF Sigma points X�

86 Kalman Filters - Theory for Advanced Applications

sigma-points derivative

Output

SRUKF SR innovation error covariance

SM Derivative of innovation error covariance

> Derivative of Crosscovariance matrix

SR estimation error covariance

SRUKF Kalman gain <sup>K</sup><sup>k</sup> <sup>¼</sup> Pxy, <sup>k</sup>=S<sup>T</sup>

SM Kalman gain derivative K<sup>k</sup> ¼ Pxy, <sup>k</sup>= I

A posteriori state sensitivity <sup>X</sup><sup>b</sup> <sup>þ</sup>

Derivative of estimation error covariance update

RPEM Parameter and covariance estimation

A posteriori state estimate x

Output sigma points <sup>Y</sup><sup>k</sup> <sup>¼</sup> h X�

Estimated measurement <sup>b</sup>y<sup>k</sup> <sup>¼</sup> <sup>Y</sup><sup>k</sup> <sup>w</sup><sup>m</sup> ð Þ<sup>T</sup>

SM Sigma-points derivative <sup>Φ</sup>k,j <sup>¼</sup> <sup>Φ</sup>k, <sup>1</sup>,j; …; <sup>Φ</sup>k,l,j

Output sensitivity <sup>b</sup>y<sup>k</sup> <sup>¼</sup> <sup>Ψ</sup><sup>k</sup> <sup>I</sup>

Cross-covariance matrix Pxy, <sup>k</sup> <sup>¼</sup> <sup>W</sup><sup>c</sup>

<sup>k</sup> ¼ ðXk, <sup>1</sup>; …; Xk,lÞ ¼ x

<sup>k</sup> ; <sup>θ</sup>b<sup>k</sup>�<sup>1</sup>; <sup>u</sup><sup>k</sup> � �

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> <sup>w</sup><sup>m</sup> ð Þ<sup>T</sup> � �

wc 1 <sup>p</sup> <sup>Y</sup><sup>1</sup>:2nx , <sup>k</sup> � <sup>b</sup>y<sup>k</sup> � � SR, <sup>k</sup> � � � � ,

kr<sup>⨀</sup> <sup>Y</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup>

Ψ<sup>k</sup> ¼ Ψk, <sup>1</sup>; …; Ψk,n<sup>θ</sup> ð Þ

Syy, <sup>k</sup> ¼ cholupdate Syy, <sup>k</sup>;

Syy, <sup>k</sup> ¼ treshapeM I

<sup>P</sup>yy, <sup>k</sup> <sup>¼</sup> <sup>Ψ</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup> � � I

<sup>þ</sup>W<sup>c</sup>

<sup>þ</sup>W<sup>c</sup>

yy � �

> <sup>k</sup> <sup>þ</sup> <sup>K</sup><sup>k</sup> <sup>y</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> � �

<sup>P</sup>xy, <sup>k</sup> <sup>¼</sup> <sup>Φ</sup><sup>k</sup> � <sup>X</sup><sup>b</sup> �

for z ¼ 1 to ny do Sxx, <sup>k</sup> ¼ cholupdate S�

with U<sup>k</sup> ¼ KkSyy, <sup>k</sup>

Sxx, <sup>k</sup> ¼ treshapeM I

<sup>S</sup><sup>k</sup> <sup>¼</sup> <sup>λ</sup>Δ<sup>k</sup> <sup>þ</sup> <sup>b</sup>ykΘ<sup>k</sup>�<sup>1</sup>yb<sup>T</sup>

<sup>n</sup><sup>θ</sup> � <sup>L</sup><sup>k</sup>by<sup>k</sup> � �Θ<sup>k</sup>�<sup>1</sup> <sup>I</sup>

<sup>k</sup> ¼ Xb �

Pxx, <sup>k</sup> ¼ P�

<sup>L</sup><sup>k</sup> <sup>¼</sup> <sup>Θ</sup><sup>k</sup>�<sup>1</sup> <sup>y</sup>b<sup>T</sup>

θb<sup>k</sup> ¼ θb<sup>k</sup>�<sup>1</sup> þ Lkek:

Table 2. aSRUKF: filter correction step and the RPEM for parameter and covariance estimation.

Θ<sup>k</sup> ¼ I

bþ <sup>k</sup> ¼ x b�

Als,Syy, <sup>k</sup> ¼ Syy, <sup>k</sup> <sup>⨂</sup> I

Syy, <sup>k</sup> <sup>¼</sup> qr ffiffiffiffiffiffi

<sup>Ψ</sup>k,j,i <sup>¼</sup> <sup>∂</sup><sup>h</sup> ∂x<sup>k</sup> � � � X� <sup>k</sup> ,θb <sup>k</sup>�<sup>1</sup>

� � ¼¼ <sup>X</sup><sup>b</sup> k,j

<sup>Φ</sup>k,j,i <sup>þ</sup> <sup>∂</sup><sup>h</sup> ∂θk,j � � � X� <sup>k</sup> ,θb <sup>k</sup>�<sup>1</sup>

with

ffiffiffiffiffiffiffiffiffi wc 0 � � � � <sup>q</sup>

� �<sup>T</sup> � �

� �

ny <sup>⨂</sup> Syy, <sup>k</sup> � �<sup>N</sup> ð Þ ny

> <sup>n</sup><sup>θ</sup> <sup>⨂</sup> W<sup>c</sup> kr � �<sup>T</sup>

� � <sup>X</sup><sup>k</sup> � <sup>x</sup>

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> A† ls,Syy, <sup>k</sup> � �

� �

I <sup>n</sup><sup>θ</sup> <sup>⨂</sup> W<sup>c</sup> kr � �<sup>T</sup>

xx, <sup>k</sup>; Ukð Þ :; z ,

� � � Pxy, <sup>k</sup>=Pyy, <sup>k</sup>

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> A† ls,S� xx, <sup>k</sup> � �

� �,

<sup>n</sup><sup>θ</sup> � <sup>L</sup>kyb<sup>T</sup> k � �

� �

0 �0

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> <sup>y</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup>

� �

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> K<sup>T</sup> k � � � <sup>P</sup>xy, <sup>k</sup> <sup>I</sup>

� � Pyy, <sup>k</sup>= I

ð Þ Pxx, <sup>k</sup> <sup>s</sup>

<sup>=</sup><sup>λ</sup> <sup>þ</sup> <sup>L</sup>kΔkL<sup>T</sup> k ,

ny <sup>þ</sup> <sup>I</sup>

kr<sup>⨀</sup> <sup>Y</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup> � � <sup>T</sup> ð Þ<sup>l</sup> <sup>I</sup>

<sup>k</sup> <sup>⨂</sup> m<sup>2</sup> � �

> kr⨀ X<sup>k</sup> � x b� <sup>k</sup> <sup>⨂</sup> m<sup>2</sup> � � <sup>T</sup> ð Þ<sup>l</sup> <sup>I</sup>

> > =Syy, <sup>k</sup>

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> Pyy, <sup>k</sup>

xx, <sup>k</sup> � Pxy, <sup>k</sup><sup>T</sup> ð Þ ny <sup>I</sup>

k ,

<sup>Δ</sup><sup>k</sup> <sup>¼</sup> <sup>Δ</sup><sup>k</sup>�<sup>1</sup> <sup>þ</sup> ð Þ <sup>1</sup> � <sup>λ</sup> <sup>e</sup>ke<sup>T</sup> � <sup>Δ</sup><sup>k</sup>�<sup>1</sup>

<sup>k</sup> <sup>S</sup>�<sup>1</sup> k ,

<sup>k</sup> � <sup>K</sup><sup>k</sup>by<sup>k</sup> <sup>þ</sup> <sup>K</sup><sup>k</sup> <sup>I</sup>

<sup>Y</sup>0, <sup>k</sup> � <sup>b</sup>y<sup>k</sup> � �; sign wc

> b� <sup>k</sup> <sup>⨂</sup> m<sup>2</sup>

Pyy, <sup>k</sup> � � s

� � � �

b � <sup>k</sup> <sup>x</sup>b�

<sup>k</sup> <sup>⨂</sup> m<sup>1</sup> þ ηS�

xx, <sup>k</sup>xb�

Xb k,j <sup>⨂</sup> m<sup>1</sup> þ ηS�

<sup>k</sup> <sup>⨂</sup> m<sup>1</sup> � ηS�

xx, k,j

0

, with

<sup>Þ</sup>Eð Þ ny and

<sup>⨀</sup> <sup>Y</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup> � �<sup>T</sup> � � � �

> <sup>n</sup><sup>θ</sup> <sup>⨂</sup> <sup>Ψ</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup> � �<sup>T</sup> � �

<sup>⨀</sup> <sup>Y</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup> � �<sup>T</sup> � � � �

> <sup>n</sup><sup>θ</sup> <sup>⨂</sup> <sup>Ψ</sup><sup>k</sup> � <sup>b</sup>y<sup>k</sup> <sup>⨂</sup> <sup>m</sup><sup>2</sup> � �<sup>T</sup> � �

> > <sup>n</sup><sup>θ</sup> <sup>⨂</sup> Pyy, <sup>k</sup> � � � �

� � � � (d)

<sup>n</sup><sup>θ</sup> <sup>⨂</sup> K<sup>T</sup> k � �

, with

� � (b)

� � (a)

xx, k�1

Xb k,j <sup>⨂</sup> m<sup>1</sup> � ηS�

xx, k,j

(c)

(e)

In this section, two testbeds are presented and modelled. These modelled systems are used in Section 4 to test the performance of the SB-aSRUKF. The planar one-link robot system is presented and extended with a second arm to form a pendulum robot (pendubot). The pendubot is a chaotic and inherently unstable system.

### 3.1. Planar one-link robot system

This section describes the planar one-link robot system shown in Figure 1. It consists of a long rectangular aluminium link driven by a DC motor via a shaft and a one-state toothed gear.

The angular position is measured with an incremental rotary encoder and the motor torque is determined by measuring the motor current. To simplify the motor model, it is assumed that the motor current is directly proportional to the armature current and that the motor torque is proportional to this current by a constant factor. Additionally, the link acceleration is measured using a micro-electro-mechanical sensor (MEMS) accelerometer attached to the link. The motor position is controlled by a classical cascade structure with P- and P-feedback controllers for position and speed.

The corresponding continuous state-space representation of the planar one-link robot system, where the link angular position and acceleration are measured, can be written as follows:

Figure 1. Planar one-link robot system: structure and functionality.

$$\begin{aligned} \dot{\mathfrak{x}} &= A\mathfrak{x} + b(\mathfrak{x}, \mathfrak{u}), \\ \mathfrak{y} &= \mathfrak{c}(\mathfrak{x}, \mathfrak{u}). \end{aligned}$$

The system states are the link angular position (x<sup>1</sup> ¼ q1) and the link speed (x<sup>2</sup> ¼ q\_1Þ. The input u corresponds to the motor torque (u ¼ τm). The measurements are the link angular position (y<sup>1</sup> ¼ q1) and acceleration (y<sup>2</sup> ¼ q€1). The matrix A and the vector-valued functions b and c are then described as

$$\begin{aligned} A &= \begin{pmatrix} 0 & 1 \\ 0 & -\frac{\mu\_{\rm v}}{f\_{\rm tot}} \end{pmatrix} '\\ b(\mathbf{x}, u) &= \begin{pmatrix} 0 \\ -\frac{\mu\_{\rm d}}{f\_{\rm tot}} \arctan(k \, \mathbf{x}\_2) - \frac{m\_{\rm d} l\_2}{2f\_{\rm tot}} \sin(\mathbf{x}\_1) + \frac{\tau\_{\rm m}}{f\_{\rm tot}} \end{pmatrix} ' \\ c(\mathbf{x}, u) &= \begin{pmatrix} \mathbf{x}\_1 \\ -\frac{\mu\_{\rm v}}{f\_{\rm tot}} \mathbf{x}\_2 - \frac{\mu\_{\rm d}}{f\_{\rm tot}} \arctan(k \, \mathbf{x}\_2) - \frac{m\_{\rm d} l\_2}{2f\_{\rm tot}} \sin(\mathbf{x}\_1) + \frac{\tau\_{\rm m}}{f\_{\rm tot}} \end{pmatrix} ' \end{aligned}$$

where Jtot represents the total inertia including motor, shaft and link inertias. The link friction is modelled as a dry Coulomb (μ<sup>d</sup> and k) and viscous friction (μvÞ. The parameters ma, l2, and g are the link mass, length, and the gravity of Earth coefficient, respectively.

where

x\_ 2 x\_ 4 � �

function d q\_

follows

<sup>¼</sup> <sup>q</sup>€ <sup>¼</sup> <sup>q</sup>€<sup>1</sup>

1

q€2 � �

Figure 2. Pendubot: structure and functionality.

� � <sup>¼</sup> <sup>μ</sup>darctan <sup>k</sup> <sup>q</sup>\_<sup>1</sup>

D qð Þ¼

g qð Þ¼

where the ϑ<sup>i</sup> parameters are defined as

0 B@

C qð Þ¼ ; q\_ ϑ<sup>3</sup> sin q<sup>2</sup>

0 @

<sup>¼</sup> D qð Þ�<sup>1</sup> <sup>τ</sup><sup>m</sup> � <sup>μ</sup>v1

q\_ <sup>1</sup> � d q\_ 1 � �

!

The viscous and Coulomb frictions are described with the parameters μv1 and μv2 and the

inertial and the Coriolis matrices and the gravity vector, respectively. They are defined as

� �

<sup>2</sup> �q\_

q\_<sup>1</sup> 0

ϑ<sup>5</sup> g cos q<sup>1</sup> þ q<sup>2</sup>

<sup>1</sup> þ ð Þ m<sup>2</sup> þ m<sup>3</sup> þ m<sup>4</sup> l

� �

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

<sup>1</sup> � q\_ 2

� � <sup>þ</sup> <sup>ϑ</sup><sup>5</sup> <sup>g</sup> cos <sup>q</sup><sup>1</sup> <sup>þ</sup> <sup>q</sup><sup>2</sup>

� �

1 A,

� �

2 <sup>2</sup> þ J1,

� D qð Þ�<sup>1</sup>

� �. The matrices D qð Þ and C qð Þ ; <sup>q</sup>\_ and the vector g qð Þ are the

ϑ<sup>2</sup> þ ϑ<sup>3</sup> cos q<sup>2</sup>

ϑ2

1 A, � �

1 CA,

C qð Þ ; <sup>q</sup>\_ <sup>q</sup>\_ � D qð Þ�<sup>1</sup>

http://dx.doi.org/10.5772/intechopen.72470

89

g qð Þ.

μv2 q\_ 2

ϑ<sup>1</sup> þ ϑ<sup>2</sup> þ 2ϑ<sup>3</sup> cos q<sup>2</sup>

ϑ<sup>2</sup> þ ϑ<sup>3</sup> cos q<sup>2</sup>

� � �q\_

ϑ<sup>4</sup> g cos q<sup>1</sup>

ϑ<sup>1</sup> ¼ m1l

ϑ<sup>2</sup> ¼ m2l

2

2 <sup>3</sup> þ m4l 2 <sup>4</sup> þ J2,

ϑ<sup>3</sup> ¼ ð Þ m2l<sup>3</sup> þ m4l<sup>4</sup> l2,

0 @

#### 3.2. Pendubot

This section describes the pendulum robot (pendubot) that is presented in Figure 2. The pendubot is built adding an under-actuated link to the planar one-link robot system described in Section 3.1. The actuated joint (q1) is located at the shoulder of the first link (arm) and the elbow joint (q2) allows the second link (forearm) to swing free. This joint contains only a second incremental rotatory encoder that measures the angle between the two links.

The system states result as x<sup>1</sup> ¼ q1, x<sup>2</sup> ¼ q\_ <sup>1</sup>, x<sup>3</sup> ¼ q2, and x<sup>4</sup> ¼ q\_ <sup>2</sup>, where qi and q\_ <sup>i</sup> are the corresponding position and speed of the i–joint, respectively. The state-space representation of the pendubot can be written as

$$\begin{aligned} \dot{\mathbf{x}} &= \mathbf{A}\mathbf{x} + \mathbf{b}(\mathbf{x}, \boldsymbol{\mu})\_{\prime} \\ \mathbf{y} &= \begin{pmatrix} \mathbf{x}\_1, \mathbf{x}\_3, \dot{\mathbf{x}}\_2 \end{pmatrix}^{\top} \end{aligned}$$

in which

$$A = \begin{pmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{pmatrix},$$

$$b(\mathbf{x}, \boldsymbol{\mu}) = \begin{pmatrix} 0 & \dot{\mathbf{x}}\_2 & 0 & \dot{\mathbf{x}}\_4 \end{pmatrix}^T.$$

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems http://dx.doi.org/10.5772/intechopen.72470 89

Figure 2. Pendubot: structure and functionality.

where

x\_ ¼ Ax þ b xð Þ ; u ,

The system states are the link angular position (x<sup>1</sup> ¼ q1) and the link speed (x<sup>2</sup> ¼ q\_1Þ. The input u corresponds to the motor torque (u ¼ τm). The measurements are the link angular position (y<sup>1</sup> ¼ q1) and acceleration (y<sup>2</sup> ¼ q€1). The matrix A and the vector-valued functions b and c are

0

mal<sup>2</sup> 2 Jtot

arctanð Þ� k x<sup>2</sup>

where Jtot represents the total inertia including motor, shaft and link inertias. The link friction is modelled as a dry Coulomb (μ<sup>d</sup> and k) and viscous friction (μvÞ. The parameters ma, l2, and g

This section describes the pendulum robot (pendubot) that is presented in Figure 2. The pendubot is built adding an under-actuated link to the planar one-link robot system described in Section 3.1. The actuated joint (q1) is located at the shoulder of the first link (arm) and the elbow joint (q2) allows the second link (forearm) to swing free. This joint contains only a second

corresponding position and speed of the i–joint, respectively. The state-space representation

x\_ ¼ Ax þ b xð Þ ; u , y ¼ x1; x3; x\_ ð Þ<sup>2</sup>

0

0

BBBBB@

0

b xð Þ¼ ; u 0 x\_ <sup>2</sup> 0 x\_ ð Þ <sup>4</sup>

<sup>1</sup>, x<sup>3</sup> ¼ q2, and x<sup>4</sup> ¼ q\_

T ,

0 1 00 0 0 00

0

1

1

CCCCCA ,

0

T ,

0

0

0

x1

sin ð Þþ x<sup>1</sup>

mal<sup>2</sup> g 2 Jtot

τ<sup>m</sup> Jtot 1 CA,

sin ð Þþ x<sup>1</sup>

τ<sup>m</sup> Jtot

<sup>2</sup>, where qi and q\_

<sup>i</sup> are the

1 CA,

y ¼ c xð Þ ; u :

then described as

3.2. Pendubot

in which

A ¼

b xð Þ¼ ; u

88 Kalman Filters - Theory for Advanced Applications

c xð Þ¼ ; u

The system states result as x<sup>1</sup> ¼ q1, x<sup>2</sup> ¼ q\_

of the pendubot can be written as

0 @

0 B@

0 B@ 0 1 <sup>0</sup> � <sup>μ</sup><sup>v</sup> Jtot

� <sup>μ</sup><sup>d</sup> Jtot

� μv Jtot 1 A,

arctanð Þ� k x<sup>2</sup>

<sup>x</sup><sup>2</sup> � <sup>μ</sup><sup>d</sup> Jtot

are the link mass, length, and the gravity of Earth coefficient, respectively.

incremental rotatory encoder that measures the angle between the two links.

A ¼

$$
\begin{pmatrix} \dot{\mathbf{x}}\_2 \\ \dot{\mathbf{x}}\_4 \end{pmatrix} = \ddot{\boldsymbol{\eta}} = \begin{pmatrix} \ddot{\boldsymbol{q}}\_1 \\ \ddot{\boldsymbol{q}}\_2 \end{pmatrix} = \mathbf{D}(\boldsymbol{\eta})^{-1} \begin{pmatrix} \tau\_{\rm m} - \mu\_{\rm v\_1} \dot{\boldsymbol{q}}\_1 - \mathbf{d}(\dot{\boldsymbol{q}}\_1) \\ \mu\_{\rm v\_2} \dot{\boldsymbol{q}}\_2 \end{pmatrix} - \mathbf{D}(\boldsymbol{\eta})^{-1} \mathbf{C}(\boldsymbol{q}, \dot{\boldsymbol{q}}) \dot{\boldsymbol{q}} - \mathbf{D}(\boldsymbol{\eta})^{-1} \mathbf{g}(\boldsymbol{\eta}).
$$

The viscous and Coulomb frictions are described with the parameters μv1 and μv2 and the function d q\_ 1 � � <sup>¼</sup> <sup>μ</sup>darctan <sup>k</sup> <sup>q</sup>\_<sup>1</sup> � �. The matrices D qð Þ and C qð Þ ; <sup>q</sup>\_ and the vector g qð Þ are the inertial and the Coriolis matrices and the gravity vector, respectively. They are defined as follows

$$\begin{aligned} \mathbf{D}(q) &= \begin{pmatrix} \mathfrak{G}\_1 + \mathfrak{G}\_2 + 2\mathfrak{G}\_3 \cos \left( q\_2 \right) & \mathfrak{G}\_2 + \mathfrak{G}\_3 \cos \left( q\_2 \right) \\\\ \mathfrak{G}\_2 + \mathfrak{G}\_3 \cos \left( q\_2 \right) & \mathfrak{G}\_2 \end{pmatrix}, \\ \mathbf{C}(q, \dot{q}) &= \mathfrak{G}\_3 \sin \left( q\_2 \right) \begin{pmatrix} -\dot{q}\_2 & -\dot{q}\_1 - \dot{q}\_2 \\\\ \dot{q}\_1 & 0 \end{pmatrix}, \\ \mathbf{g}(q) &= \begin{pmatrix} \mathfrak{G}\_4 \, \mathrm{g} \cos \left( q\_1 \right) + \mathfrak{G}\_5 \, \mathrm{g} \cos \left( q\_1 + q\_2 \right) \\\\ \mathfrak{G}\_5 \, \mathrm{g} \cos \left( q\_1 + q\_2 \right) \end{pmatrix}, \end{aligned}$$

where the ϑ<sup>i</sup> parameters are defined as

$$\begin{aligned} \mathfrak{G}\_1 &= m\_1 l\_1^2 + (m\_2 + m\_3 + m\_4) l\_2^2 + f\_{1\prime}, \\ \mathfrak{G}\_2 &= m\_2 l\_3^2 + m\_4 l\_4^2 + f\_{2\prime} \\ \mathfrak{G}\_3 &= (m\_2 l\_3 + m\_4 l\_4) \ l\_{2\prime} \end{aligned}$$

$$\begin{aligned} \mathfrak{G}\_4 &= m\_1 l\_1 + (m\_2 + m\_3 + m\_4) l\_2, \\ \mathfrak{G}\_5 &= m\_2 l\_3 + m\_4 l\_4. \end{aligned}$$

The remaining tuning factors for SB-aSRUKF were set as

Pxx,init ¼ I

were quadrupled.

2

<sup>θ</sup>init <sup>¼</sup> <sup>2</sup>∙10�<sup>8</sup>

<sup>Q</sup> <sup>¼</sup> <sup>q</sup><sup>22</sup> <sup>¼</sup> <sup>5</sup>∙10�<sup>5</sup>

true values multiply by a random factor between 0 < θfactor,i ≤ 10 as

sensitivity provided an almost noise-free estimation. While the SAJ

, R <sup>¼</sup> diag <sup>5</sup>∙10�<sup>7</sup> <sup>2</sup>∙101 � � � � ,

, <sup>Θ</sup>init <sup>¼</sup> diag <sup>5</sup>∙10�<sup>13</sup> <sup>10</sup>�<sup>1</sup> <sup>10</sup>�<sup>6</sup> <sup>10</sup>�<sup>4</sup> <sup>10</sup>�<sup>8</sup> � � � � :

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

α ¼ 0:08 β ¼ 2 κ ¼ 3 � nx λ ¼ 0:999,

The values of Θinit tune the parameter and covariance estimation, and the index order is the same as the above-defined θ<sup>i</sup> values. This means that the first value tunes the estimation of θ<sup>a</sup> (process covariance value), the second value tunes θ<sup>1</sup> (viscous friction coefficient) and so on. The filter initial system states were set to zero and the initial system parameters were set as the

xinit ¼ 0,

In order to test the sensitivity-based section of the filter, the link angular position was held at <sup>q</sup><sup>1</sup> <sup>¼</sup> <sup>π</sup>=2 after ca. 11 s for about 4:5 s. At the same time, the system parameters <sup>μ</sup>bv, <sup>μ</sup>bd, and <sup>m</sup><sup>b</sup> <sup>a</sup>

Figure 3 compares the a posteriori state sensitivity calculated using the SB-aSRUKF and the state sensitivity using Eq. (10). The first diagram shows the estimated and true link angular position of the planar one-link robot system. The following diagrams present the normalized SA related to the link angular speed (bq\_ <sup>1</sup>Þ and corresponding to the inverse inertia, viscous and Coulomb friction coefficients, and the link mass and length parameter. While the state sensitivity calculated using Eq. (10) was affected directly by input noises, the a posteriori state

with the acceleration (speed-up and brake phases), the SAμ<sup>v</sup> maxima coincided with the link maximal speed. The SAmal<sup>2</sup> was only zero while the arm was crossing the 0 rad position and the SAμ<sup>d</sup> was the sensitivity value more affected by the system noise. This is caused because the maximal change rate of arctanðÞ occurs when the argument is near zero. When the link speed is zero, the added noise varies near this value and its effect is amplified by arctanðÞ.

Figure 4 shows the state, parameter and covariance estimation of the planar one-link robot system. The aSRUKF was used in two configurations: SB-aSRUKF utilized SA to monitor the system excitation while aSRUKF did not. After the initialization, the two estimators needed almost the same time to converge to the offline identified values. The parameters estimated using the SB-aSRUKF did not diverge while the link position was held. Because two of the estimated parameters using the aSRUKF diverged, this filter needed more time to converge after the stop phase. The two filters were able to estimate the link mass and length parameter during the stop phase. While the viscous and the Coulomb friction coefficients and the inverse inertia estimated with the SB-aSRUKF remained constant during the stop phase, the aSRUKF was able to estimate the Coulomb friction with bias (before μ<sup>v</sup> diverged). Because of the added noise, the parameter was excited and could be identified. This can be seen in the fourth

rad<sup>2</sup> <sup>1</sup>:5 1=bJtot � � <sup>3</sup>μb<sup>v</sup> <sup>8</sup>μb<sup>d</sup> <sup>0</sup>:<sup>25</sup> <sup>m</sup><sup>b</sup> <sup>a</sup>

� � � � <sup>T</sup>

bl2

�1

tot maxima were related

:

http://dx.doi.org/10.5772/intechopen.72470

91

The parameters J<sup>1</sup> and J<sup>2</sup> correspond to the moments of inertia of link 1 and link 2 about their centroids. J<sup>1</sup> includes motor, gear and shaft inertias. The mi and li parameters are defined in Figure 2.

### 4. Experiments

In this section, the SB-aSRUKF is tested on the planar one-link robot system and on the pendubot. Both testbed models were discretized using first-order explicit Euler with a sample time of 0:2 ms. System states, parameters and covariances were estimated online. The SBaSRUKF is also compared with the joint state and parameter SRUKF in this section. Sensitivity analysis is also discussed.

#### 4.1. State sensitivity analysis and parameter and covariance estimation

Sensitivity analysis (SA) was performed on simulation using the planar one-link robot system. The system parameters were identified offline on the real testbed using Prediction-Error Method. The parameters defined as

$$
\widehat{\boldsymbol{\Theta}}\_{\text{true}} = \left( \widehat{\boldsymbol{I}}\_{\text{tot}} \,\widehat{\boldsymbol{\mu}}\_{\text{v}} \,\widehat{\boldsymbol{\mu}}\_{\text{d}} \,\widehat{\boldsymbol{m}}\_{\text{d}} \widehat{\boldsymbol{I}}\_{2} \widehat{\boldsymbol{k}} \right)^{\mathsf{T}} = \left( 5.59 \cdot 10^{-2} \,\mathrm{kg} \,\mathrm{m}^{2} \quad 0.05 \,\mathrm{N} \,\mathrm{m} \frac{\mathrm{s}}{\mathrm{rad}} \quad 0.27 \,\mathrm{N} \,\mathrm{m} \quad 0.11 \,\mathrm{kg} \,\mathrm{m} \quad 10 \frac{\mathrm{s}}{\mathrm{rad}} \right)^{\mathsf{T}},
$$

were used for the simulation. Noise distributions with the following covariance matrices

$$\begin{array}{cc} Q = \text{diag}\left(\begin{pmatrix} 10^{-11} & 5 \cdot 10^{-5} \end{pmatrix}\right)^3 \text{J} \\ R = \text{diag}\left(\begin{pmatrix} 5 \cdot 10^{-7} & 5 \end{pmatrix}\right) \text{J} \end{array}$$

were added to the simulation to incorporate model and measurement uncertainties. An scurve profile was considered as a desired link angular position.

The following system states, parameters and covariances were estimated:


<sup>3</sup> The function diagð Þ <sup>v</sup> transforms the <sup>v</sup><sup>∈</sup> <sup>R</sup><sup>n</sup> vector into a ð Þ <sup>n</sup> � <sup>n</sup> square matrix with the elements of <sup>v</sup> on the diagonal of the matrix.

The remaining tuning factors for SB-aSRUKF were set as

ϑ<sup>4</sup> ¼ m1l<sup>1</sup> þ ð Þ m<sup>2</sup> þ m<sup>3</sup> þ m<sup>4</sup> l2,

The parameters J<sup>1</sup> and J<sup>2</sup> correspond to the moments of inertia of link 1 and link 2 about their centroids. J<sup>1</sup> includes motor, gear and shaft inertias. The mi and li parameters are defined in Figure 2.

In this section, the SB-aSRUKF is tested on the planar one-link robot system and on the pendubot. Both testbed models were discretized using first-order explicit Euler with a sample time of 0:2 ms. System states, parameters and covariances were estimated online. The SBaSRUKF is also compared with the joint state and parameter SRUKF in this section. Sensitivity

Sensitivity analysis (SA) was performed on simulation using the planar one-link robot system. The system parameters were identified offline on the real testbed using Prediction-Error

were used for the simulation. Noise distributions with the following covariance matrices

<sup>Q</sup> <sup>¼</sup> diag <sup>10</sup>�<sup>11</sup> <sup>5</sup>∙10�<sup>5</sup> � � � � <sup>3</sup>

<sup>R</sup> <sup>¼</sup> diag <sup>5</sup>∙10�<sup>7</sup> <sup>5</sup> � � � � ,

were added to the simulation to incorporate model and measurement uncertainties. An s-

<sup>θ</sup><sup>a</sup> <sup>¼</sup> <sup>q</sup><sup>11</sup> ! process covariance value related to the link ang:pos: � �,

The function diagð Þ <sup>v</sup> transforms the <sup>v</sup><sup>∈</sup> <sup>R</sup><sup>n</sup> vector into a ð Þ <sup>n</sup> � <sup>n</sup> square matrix with the elements of <sup>v</sup> on the diagonal of

kg m2 0:05 N m <sup>s</sup>

� �<sup>T</sup>

,

rad 0:27 N m 0:11 kg m 10 <sup>s</sup>

rad

,

ϑ<sup>5</sup> ¼ m2l<sup>3</sup> þ m4l4:

4.1. State sensitivity analysis and parameter and covariance estimation

<sup>¼</sup> <sup>5</sup>:59∙10�<sup>2</sup>

curve profile was considered as a desired link angular position.

θ<sup>1</sup> ¼ μ<sup>v</sup> ! viscous friction coefficient, θ<sup>2</sup> ¼ μ<sup>d</sup> ! Coulomb friction coefficient,

tot ! inverse inertia:

x<sup>1</sup> ¼ q<sup>1</sup> ! link position, x<sup>2</sup> ¼ q\_<sup>1</sup> ! link speed,

The following system states, parameters and covariances were estimated:

4. Experiments

analysis is also discussed.

<sup>θ</sup>btrue<sup>¼</sup> <sup>b</sup><sup>J</sup> tot <sup>μ</sup>b<sup>v</sup> <sup>μ</sup>b<sup>d</sup> <sup>m</sup><sup>b</sup> <sup>a</sup>

Method. The parameters defined as

90 Kalman Filters - Theory for Advanced Applications

� �<sup>T</sup>

θ<sup>3</sup> ¼ J �1

3

the matrix.

bl<sup>2</sup> bk

$$Q = q\_{22} = 5 \cdot 10^{-5}, \quad R = \text{diag}(\begin{pmatrix} 5 \cdot 10^{-7} & 2 \cdot 10^1 \end{pmatrix}).$$

$$a = 0.08 \quad \beta = 2 \quad \kappa = 3 - n\_{\text{x}} \quad \lambda = 0.999,$$

$$P\_{\text{xx}, \text{init}} = I^2, \quad \Theta\_{\text{init}} = \text{diag}\{ \begin{pmatrix} 5 \cdot 10^{-13} & 10^{-1} & 10^{-6} & 10^{-4} & 10^{-8} \end{pmatrix} \}.$$

The values of Θinit tune the parameter and covariance estimation, and the index order is the same as the above-defined θ<sup>i</sup> values. This means that the first value tunes the estimation of θ<sup>a</sup> (process covariance value), the second value tunes θ<sup>1</sup> (viscous friction coefficient) and so on.

The filter initial system states were set to zero and the initial system parameters were set as the true values multiply by a random factor between 0 < θfactor,i ≤ 10 as

$$\mathbf{x}\_{\text{init}} = \mathbf{0},$$

$$\boldsymbol{\theta}\_{\text{init}} = \left(2 \cdot 10^{-8} \,\text{rad}^2 \quad 1.5 \Big(1/\hat{f}\_{\text{tot}}\Big) \quad 3\hat{\boldsymbol{\mu}}\_{\text{v}} \,\, 8\hat{\boldsymbol{\mu}}\_{\text{d}} \,\, 0.25 \Big(\hat{\boldsymbol{m}}\_{\text{a}} \hat{\boldsymbol{l}}\_{2}\Big)\right)^{\text{T}}.$$

In order to test the sensitivity-based section of the filter, the link angular position was held at <sup>q</sup><sup>1</sup> <sup>¼</sup> <sup>π</sup>=2 after ca. 11 s for about 4:5 s. At the same time, the system parameters <sup>μ</sup>bv, <sup>μ</sup>bd, and <sup>m</sup><sup>b</sup> <sup>a</sup> were quadrupled.

Figure 3 compares the a posteriori state sensitivity calculated using the SB-aSRUKF and the state sensitivity using Eq. (10). The first diagram shows the estimated and true link angular position of the planar one-link robot system. The following diagrams present the normalized SA related to the link angular speed (bq\_ <sup>1</sup>Þ and corresponding to the inverse inertia, viscous and Coulomb friction coefficients, and the link mass and length parameter. While the state sensitivity calculated using Eq. (10) was affected directly by input noises, the a posteriori state sensitivity provided an almost noise-free estimation. While the SAJ �1 tot maxima were related with the acceleration (speed-up and brake phases), the SAμ<sup>v</sup> maxima coincided with the link maximal speed. The SAmal<sup>2</sup> was only zero while the arm was crossing the 0 rad position and the SAμ<sup>d</sup> was the sensitivity value more affected by the system noise. This is caused because the maximal change rate of arctanðÞ occurs when the argument is near zero. When the link speed is zero, the added noise varies near this value and its effect is amplified by arctanðÞ.

Figure 4 shows the state, parameter and covariance estimation of the planar one-link robot system. The aSRUKF was used in two configurations: SB-aSRUKF utilized SA to monitor the system excitation while aSRUKF did not. After the initialization, the two estimators needed almost the same time to converge to the offline identified values. The parameters estimated using the SB-aSRUKF did not diverge while the link position was held. Because two of the estimated parameters using the aSRUKF diverged, this filter needed more time to converge after the stop phase. The two filters were able to estimate the link mass and length parameter during the stop phase. While the viscous and the Coulomb friction coefficients and the inverse inertia estimated with the SB-aSRUKF remained constant during the stop phase, the aSRUKF was able to estimate the Coulomb friction with bias (before μ<sup>v</sup> diverged). Because of the added noise, the parameter was excited and could be identified. This can be seen in the fourth

Figure 3. Sensitivity analysis (SA): comparison between the a posteriori state sensitivity obtained using the SB-aSRUKF and the resulting using Eq. (10). The desired link position was set as an s-curve between �π=2 and π=2. The link position was held at <sup>π</sup>=2 after ca. 11 s for about 4:5 s. The parameter sensitivities are related to the link angular speed (bx<sup>2</sup> <sup>¼</sup> <sup>b</sup>q\_ <sup>1</sup>Þ.

diagram of Figure 3. These SA values remained under the threshold used on the SB-aSRUKF and were filtered. The parameter estimation stayed then constant. It should be noted that the diagram corresponding to the viscous friction coefficient is zoomed to present the parameter change, and the oscillations of the aSRUKF are cut. These reached up more than 50 times the parameter true value.

An s-curve profile was selected as the desired position of the first link. The following states and

Figure 4. Planar one-link robot system: parameter and covariance estimation. The SB-aSRUKF uses SA to monitor the system excitation. The initial parameter θinit was randomly selected. The link position was held after ca. 11 s for about

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

http://dx.doi.org/10.5772/intechopen.72470

93

<sup>θ</sup><sup>a</sup> <sup>¼</sup> <sup>q</sup><sup>11</sup> ! process covariance related to the link 1 ang:pos: � �, <sup>θ</sup><sup>b</sup> <sup>¼</sup> <sup>q</sup><sup>33</sup> ! process covariance related to the link 2 ang:pos: � �,

The values θ<sup>a</sup> and θb, which correspond to the process covariance values, were only estimated using the SB-aSRUKF. The viscous and Coulomb friction coefficients were identified offline

To simulate model and measurement uncertainties, noise distributions with the following

<sup>Q</sup> <sup>¼</sup> diag <sup>2</sup>∙10�<sup>10</sup> <sup>1</sup>:5∙10�<sup>7</sup> <sup>2</sup>∙10�<sup>10</sup> <sup>1</sup>:5∙10�<sup>7</sup> � � � � ,

ϑ1, …, ϑ<sup>5</sup> ! pedubot minimal set of parameters:

covariance matrices were added to the system for the simulation:

<sup>R</sup> <sup>¼</sup> diag <sup>5</sup>∙10�<sup>7</sup> <sup>5</sup>∙10�<sup>7</sup> <sup>1</sup> � � � � :

parameters were estimated online:

and remained constant for both filters.

x<sup>1</sup> ¼ q<sup>1</sup> ! link 1 position, x<sup>2</sup> ¼ q\_<sup>1</sup> ! link 1 speed, x<sup>3</sup> ¼ q<sup>2</sup> ! link 2 position, x<sup>4</sup> ¼ q\_<sup>2</sup> ! link 2 speed,

<sup>4</sup>:5 s, and simultaneously the system parameters <sup>μ</sup><sup>b</sup> <sup>v</sup> , <sup>μ</sup>bd, and <sup>m</sup><sup>b</sup> <sup>a</sup> were quadrupled.

The SB-aSRUKF was able to estimate the parameters and covariance of the proposed testbed. The online estimations converged to the offline identified values without bias. The sensitivitybased approach used as a system excitation monitor prevented parameter estimation drifts and did not modify the convergence time of the filter.

#### 4.2. Comparison between SB-aSRUKF and joint state and parameter SRUKF

The SB-aSRUKF and the joint SRUKF were compared on the pendubot for state and parameter estimation. The SB-aSRUKF identified also covariances.

The system parameters were identified offline and used for the simulation as

$$
\widehat{\boldsymbol{\theta}}\_{\text{true}} = \left(\widehat{\boldsymbol{\theta}}\_{1} \,\, \widehat{\boldsymbol{\theta}}\_{2} \,\, \widehat{\boldsymbol{\theta}}\_{3} \,\, \widehat{\boldsymbol{\theta}}\_{4} \,\, \widehat{\boldsymbol{\theta}}\_{5}\right)^{\mathsf{T}} = \left(0.339 \,\, \text{kg} \,\, \text{m}^{2} \quad 0.0667 \,\, \text{kg} \,\, \text{m}^{2} \quad 0.0812 \,\, \text{kg} \,\, \text{m}^{2} \quad 0.717 \,\, \text{kg} \,\, \text{m} \quad 0.146 \,\, \text{kg} \,\, \text{m}\right)^{\mathsf{T}},
$$

$$
\left(\widehat{\boldsymbol{\mu}}\_{\text{v}1} \,\, \widehat{\boldsymbol{\mu}}\_{\text{d}} \,\, \widehat{\boldsymbol{\mu}}\_{\text{v}2} \widehat{\boldsymbol{k}}\right) = \left(0.09 \,\, \text{N} \,\, \text{m} \frac{\mathrm{s}}{\mathrm{rad}} \quad 0.226 \,\, \text{N} \,\, \text{m} \quad 0.003 \,\, \text{N} \,\, \text{m} \frac{\mathrm{s}}{\mathrm{rad}} \,\, \text{10} \,\frac{\mathrm{s}}{\mathrm{rad}}\right).
$$

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems http://dx.doi.org/10.5772/intechopen.72470 93

Figure 4. Planar one-link robot system: parameter and covariance estimation. The SB-aSRUKF uses SA to monitor the system excitation. The initial parameter θinit was randomly selected. The link position was held after ca. 11 s for about <sup>4</sup>:5 s, and simultaneously the system parameters <sup>μ</sup><sup>b</sup> <sup>v</sup> , <sup>μ</sup>bd, and <sup>m</sup><sup>b</sup> <sup>a</sup> were quadrupled.

An s-curve profile was selected as the desired position of the first link. The following states and parameters were estimated online:

diagram of Figure 3. These SA values remained under the threshold used on the SB-aSRUKF and were filtered. The parameter estimation stayed then constant. It should be noted that the diagram corresponding to the viscous friction coefficient is zoomed to present the parameter change, and the oscillations of the aSRUKF are cut. These reached up more than 50 times the

Figure 3. Sensitivity analysis (SA): comparison between the a posteriori state sensitivity obtained using the SB-aSRUKF and the resulting using Eq. (10). The desired link position was set as an s-curve between �π=2 and π=2. The link position was held at <sup>π</sup>=2 after ca. 11 s for about 4:5 s. The parameter sensitivities are related to the link angular speed (bx<sup>2</sup> <sup>¼</sup> <sup>b</sup>q\_ <sup>1</sup>Þ.

The SB-aSRUKF was able to estimate the parameters and covariance of the proposed testbed. The online estimations converged to the offline identified values without bias. The sensitivitybased approach used as a system excitation monitor prevented parameter estimation drifts

The SB-aSRUKF and the joint SRUKF were compared on the pendubot for state and parameter

<sup>¼</sup> <sup>0</sup>:339 kg m2 <sup>0</sup>:0667 kg m2 <sup>0</sup>:0812 kg m2 <sup>0</sup>:717 kg m 0:146 kg m � �<sup>T</sup>

rad <sup>10</sup> <sup>s</sup> rad

:

rad <sup>0</sup>:226 N m 0:003 N m <sup>s</sup>

� �

,

4.2. Comparison between SB-aSRUKF and joint state and parameter SRUKF

The system parameters were identified offline and used for the simulation as

<sup>¼</sup> <sup>0</sup>:09 N m <sup>s</sup>

parameter true value.

92 Kalman Filters - Theory for Advanced Applications

<sup>θ</sup>btrue ¼ ϑb<sup>1</sup> ϑb<sup>2</sup> ϑb<sup>3</sup> ϑb<sup>4</sup> ϑb<sup>5</sup>

� �<sup>T</sup>

<sup>μ</sup>bv1 <sup>μ</sup>b<sup>d</sup> <sup>μ</sup>bv2 <sup>b</sup><sup>k</sup> � �

and did not modify the convergence time of the filter.

estimation. The SB-aSRUKF identified also covariances.


The values θ<sup>a</sup> and θb, which correspond to the process covariance values, were only estimated using the SB-aSRUKF. The viscous and Coulomb friction coefficients were identified offline and remained constant for both filters.

To simulate model and measurement uncertainties, noise distributions with the following covariance matrices were added to the system for the simulation:

$$\begin{array}{ll} \mathbf{Q} = \text{diag}\left( \begin{pmatrix} 2 \cdot 10^{-10} & 1.5 \cdot 10^{-7} & 2 \cdot 10^{-10} & 1.5 \cdot 10^{-7} \end{pmatrix} \right), \\\mathbf{R} = \text{diag}\left( \begin{pmatrix} 5 \cdot 10^{-7} & 5 \cdot 10^{-7} & 1 \end{pmatrix} \right). \end{array}$$

The tuning parameters for the joint SRUKF were chosen as

$$\mathbf{Q}\_{0\_1} = \text{diag}(\begin{pmatrix} 2 \cdot 10^{-10} & 1.5 \cdot 10^{-7} & 2 \cdot 10^{-10} & 1.5 \cdot 10^{-7} \end{pmatrix}$$

$$10^{-7} \quad 10^{-7} \quad 10^{-7} \quad 5 \cdot 10^{-10} \quad 10^{-10}),$$

$$\mathbf{R}\_{0\_1} = \text{diag}(\begin{pmatrix} 5 \cdot 10^{-7} & 5 \cdot 10^{-7} & 10 \end{pmatrix}),$$

$$\alpha = 0.85, \quad \beta = 2, \quad \kappa = 3 - n\_{\overline{x}} - n\_{p\overline{\nu}}$$

$$\mathbf{P}\_{0\_1} = \text{diag}\left(\begin{pmatrix} 1 & 1 & 1 & 1 & 1 & 10^{-3} & 10^{-5} & 10^{-5} & 5 & 1 \end{pmatrix}\right).$$

The filter initial system states were set to zero and the initial system parameters were set as the

xinit ¼ 0,

� �<sup>T</sup>

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

,

:

http://dx.doi.org/10.5772/intechopen.72470

95

θinit1 ¼ 1:5 ϑb <sup>1</sup> 1:3 ϑb<sup>2</sup> 1:5 ϑb<sup>3</sup> 2 ϑb<sup>4</sup> 2 ϑb<sup>5</sup>

<sup>θ</sup>init2 <sup>¼</sup> <sup>2</sup>∙10�10rad2 <sup>2</sup>∙10�10rad2 <sup>θ</sup>init1 ð Þ<sup>T</sup> � �<sup>T</sup>

The first four values of P<sup>01</sup> tune the initial state estimation, while the last ones the parameter estimation. The first two values of Θinit tune the estimation of the covariance values θ<sup>a</sup> and θ<sup>b</sup> while the last values follow the index order of ϑ<sup>i</sup> defined in Section 3. It should be noted that the settings related to the state and parameters estimation were equally tuned for both filters. The state estimation of the pendubot is presented in Figure 5. The SB-aSRUKF was slightly faster to reach the true system states (cf. diagrams 1 and 4) and after ca. 5 s both filters followed

Figure 6. Pendubot: parameter and covariance estimation using the SB-aSRUKF and joint SRUKF. The SB-aSRUKF was configured to estimate the system parameters ϑ<sup>1</sup> to ϑ<sup>5</sup> and the process covariances corresponding to the link positions. The joint SRUKF estimates only the system parameters. It should be noted that the diagram scales for parameters ϑ<sup>4</sup> and

ϑ<sup>5</sup> are different between the filters.

true values multiply by a random factor between 0 < θfactor,i ≤ 5 as

the dynamic of the true system states without any significant bias.

and the parameters for the SB-aSRUKF were set as

$$\mathbf{Q}\_{0\_2} = \text{diag}\{ \begin{pmatrix} 1.5 \cdot 10^{-7} & 1.5 \cdot 10^{-7} \end{pmatrix} \}, \quad \mathbf{P}\_{\mathbf{x}, \mathbf{0}\_2} = \mathbf{I}^4,$$

$$\mathbf{R}\_{0\_2} = \text{diag}\{ \begin{pmatrix} 5 \cdot 10^{-7} & 5 \cdot 10^{-7} & 10 \end{pmatrix} \},$$

$$\alpha = 0.85, \quad \beta = 2, \quad \kappa = 3 - n\_{\omega}, \quad \lambda = 0.999,$$

$$\mathbf{\Theta}\_{\text{init}} = \text{diag}\{ \begin{pmatrix} 10^{-25} & 10^{-25} & 10^{-7} & 10^{-7} & 10^{-7} & 5 \cdot 10^{-10} & 10^{-10} \end{pmatrix} \}.$$

Figure 5. Pendubot: state estimation using the SB-aSRUKF and joint SRUKF. Both filters followed the dynamic of the true system states without any significant bias.

The filter initial system states were set to zero and the initial system parameters were set as the true values multiply by a random factor between 0 < θfactor,i ≤ 5 as

The tuning parameters for the joint SRUKF were chosen as

94 Kalman Filters - Theory for Advanced Applications

and the parameters for the SB-aSRUKF were set as

system states without any significant bias.

<sup>Q</sup><sup>01</sup> <sup>¼</sup> diag <sup>2</sup>∙10�<sup>10</sup> <sup>1</sup>:5∙10�<sup>7</sup> <sup>2</sup>∙10�<sup>10</sup> <sup>1</sup>:5∙10�<sup>7</sup>

<sup>10</sup>�<sup>7</sup> <sup>10</sup>�<sup>7</sup> <sup>10</sup>�<sup>7</sup> <sup>5</sup>∙10�<sup>10</sup> <sup>10</sup>�<sup>10</sup> ÞÞ,

<sup>R</sup><sup>01</sup> <sup>¼</sup> diag <sup>5</sup>∙10�<sup>7</sup> <sup>5</sup>∙10�<sup>7</sup> <sup>10</sup> ,

α ¼ 0:85, β ¼ 2, κ ¼ 3 � nx � np,

<sup>P</sup><sup>01</sup> <sup>¼</sup> diag 1 1 1 1 10�<sup>3</sup> <sup>10</sup>�<sup>5</sup> <sup>10</sup>�<sup>5</sup> 5 1 ,

<sup>Q</sup><sup>02</sup> <sup>¼</sup> diag <sup>1</sup>:5∙10�<sup>7</sup> <sup>1</sup>:5∙10�<sup>7</sup> , Pxx,<sup>02</sup> <sup>¼</sup> <sup>I</sup>

<sup>R</sup><sup>02</sup> <sup>¼</sup> diag <sup>5</sup>∙10�<sup>7</sup> <sup>5</sup>∙10�<sup>7</sup> <sup>10</sup> ,

α ¼ 0:85, β ¼ 2, κ ¼ 3 � nx, λ ¼ 0:999,

<sup>Θ</sup>init <sup>¼</sup> diag <sup>10</sup>�<sup>25</sup> <sup>10</sup>�<sup>25</sup> <sup>10</sup>�<sup>7</sup> <sup>10</sup>�<sup>7</sup> <sup>10</sup>�<sup>7</sup> <sup>5</sup>∙10�<sup>10</sup> <sup>10</sup>�<sup>10</sup> :

Figure 5. Pendubot: state estimation using the SB-aSRUKF and joint SRUKF. Both filters followed the dynamic of the true

4 ,

$$\mathbf{x}\_{\text{init}} = \mathbf{0},$$

$$\boldsymbol{\theta}\_{\text{init}\_1} = \left(1.5 \,\,\widehat{\boldsymbol{\\$}}\_1 \, 1.3 \,\, \widehat{\boldsymbol{\\$}}\_2 \, 1.5 \,\, \widehat{\boldsymbol{\\$}}\_3 \, 2 \,\, \widehat{\boldsymbol{\\$}}\_4 \, 2 \,\, \widehat{\boldsymbol{\\$}}\_5\right)^\mathrm{T},$$

$$\boldsymbol{\theta}\_{\text{init}\_2} = \left(2 \cdot 10^{-10} \,\text{rad}^2 \quad 2 \cdot 10^{-10} \,\text{rad}^2 \quad (\boldsymbol{\theta}\_{\text{init}\_1})^\mathrm{T}\right)^\mathrm{T}.$$

The first four values of P<sup>01</sup> tune the initial state estimation, while the last ones the parameter estimation. The first two values of Θinit tune the estimation of the covariance values θ<sup>a</sup> and θ<sup>b</sup> while the last values follow the index order of ϑ<sup>i</sup> defined in Section 3. It should be noted that the settings related to the state and parameters estimation were equally tuned for both filters.

The state estimation of the pendubot is presented in Figure 5. The SB-aSRUKF was slightly faster to reach the true system states (cf. diagrams 1 and 4) and after ca. 5 s both filters followed the dynamic of the true system states without any significant bias.

Figure 6. Pendubot: parameter and covariance estimation using the SB-aSRUKF and joint SRUKF. The SB-aSRUKF was configured to estimate the system parameters ϑ<sup>1</sup> to ϑ<sup>5</sup> and the process covariances corresponding to the link positions. The joint SRUKF estimates only the system parameters. It should be noted that the diagram scales for parameters ϑ<sup>4</sup> and ϑ<sup>5</sup> are different between the filters.

Figure 6 shows the parameter estimation of the pendubot for both filters. Using the same tuning parameter set, while the SB-aSRUKF estimated the ϑ<sup>1</sup> to ϑ<sup>5</sup> parameters without bias, the joint SRUKF estimated ϑ<sup>1</sup> to ϑ<sup>3</sup> with slight bias, and it was not able to estimate ϑ<sup>4</sup> and ϑ5. These two parameters did not converge to the true system values. It should be noted that the diagram scales corresponding to parameters ϑ<sup>4</sup> and ϑ<sup>5</sup> are different between the filters. The parameter initialization and the tuning settings for the two filters were the same. The SBaSRUKF outperforms the joint SRUKF for the parameter estimation of the pendubot.

[2] Ding SX. Model-based Fault Diagnosis Techniques: Design Schemes, Algorithms, and

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

http://dx.doi.org/10.5772/intechopen.72470

97

[3] Simon D, Simon DL. Kalman filtering with inequality constraints for turbofan engine health estimation. IEE Proceedings - Control Theory and Applications. 2006;153(3):371-

[4] Grewal MS, Andrews AP. Kalman Filtering: Theory and Practice with MATLAB. 4th ed.

[5] Sorenson HW. Least-squares estimation: from Gauss to Kalman. IEEE Spectrum. 1970;7

[6] Kalman RE. A new approach to linear filtering and prediction problems. Journal of Basic

[7] Anderson BDO, Moore JB. Optimal Filtering. 1st ed. Mineola, NY, USA: Dover Publica-

[8] Schmidt SF. Applications of state space methods to navigation problems. C. T. Leondes

[9] Simon D. Optimal State Estimation: Kalman, H Infinity, and Nonlinear Approaches. 1st

[10] Julier SJ, Uhlmann JK. New extension of the Kalman filter to nonlinear systems. In: Signal Processing, Sensor Fusion, and Target Recognition VI. Orlando, FL, USA: International

[11] Ljung L, Soderstrom T. Theory and Practice of Recursive Identification. 1st ed. Cam-

[12] Ljung L. System Identification: Theory for the User. 2nd ed. Prentice Hall: Upper Saddle

[13] Saab SS, Nasr GE. Sensitivity of discrete-time Kalman filter to statistical modeling errors. Optimal Control Applications and Methods. 1999;20(5):249-259. DOI: 10.1002/(SICI)1099-

[14] Fitzgerald R. Divergence of the Kalman filter. IEEE Transactions on Automatic Control.

[15] Price C. An analysis of the divergence problem in the Kalman filter. IEEE Transactions on

[16] Ljung L. Asymptotic behavior of the extended Kalman filter as a parameter estimator for linear systems. IEEE Transactions on Automatic Control. 1979;24(1):36-50. DOI: 10.1109/

[17] Odelson B. Estimating Disturbance Covariances From Data For Improved Control Performance [dissertation]. Madison, WI, USA: University of Wisconsin-Madison; 2003. p. 309

Automatic Control. 1968;13(6):699-702. DOI: 10.1109/TAC.1968.1099031

Society for Optics and Photonics; 1997. pp. 182-194. DOI: 10.1117/12.280797

Tools. 1st ed. Berlin, Germany: Springer; 2008. p. 493

Hoboken, New Jersey, USA: Wiley-IEEE Press; 2014. p. 640

Engineering. 1960;82(1):35-45. DOI: 10.1115/1.3662552

(Ed.) Advanced in Control Systems. 1966;3:293-340

ed. Hoboken, New Jersey, USA: Wiley-Interscience; 2006. p. 526

bridge, Massachusetts, USA: The MIT Press; 1983. p. 551

1514(199909/10)20:5<249::AID-OCA659>3.0.CO;2-2

1971;16(6):736-747. DOI: 10.1109/TAC.1971.1099836

(7):63-68. DOI: 10.1109/MSPEC.1970.5213471

378. DOI: 10.1049/ip-cta:20050074

tions; 2006. p. 368

River, NJ, USA; 1999. p. 672

TAC.1979.1101943

### 5. Conclusions

In this chapter, some approaches for state, parameter and covariance estimation were discussed. Moreover, a sensitivity-based adaptive square-root unscented Kalman filter (SB-aSRUKF) was discussed and its performance was analysed. This filter estimates system states, parameters and covariances online. Additionally, sensitivity models were presented and used as system excitation monitor to prevent parameter and covariance estimation drifts while the system excitation was not sufficient.

Two testbeds based on an axis serial mechanism were modelled and used for testing the performance of the filter. Two experiments were performed in simulation on these two testbeds: a state sensitivity analysis and a comparison between the joint state and parameter square-root unscented Kalman filter (SRUKF) and the SB-aSRUKF. Simulation results show that the SB-aSRUKF outperforms the joint SRUKF with the same tuning configuration. While the joint SRUKF did not estimate two of the five parameters correctly, the SB-aSRUKF identified all the parameters. Moreover, the estimation of covariances reduces the parameter estimation bias. Configuring the right excitation thresholds for the system excitation monitor in Eq. (9) prevented parameter estimation drifts, while the input was not persistently exciting and did not only increased but also in some cases reduced the convergence time of the filter.

### Author details

Mauro Hernán Riva\*, Mark Wielitzka and Tobias Ortmaier

\*Address all correspondence to: mauro.riva@imes.uni-hannover.de

Institute of Mechatronic Systems, Leibniz Universität Hanover, Hanover, Germany

### References

[1] Wielitzka M, Dagen M, Ortmaier T. State estimation of vehicle's lateral dynamics using unscented Kalman filter. 53rd IEEE Conference on Decision and Control (CDC); Los Angeles, USA. 2014:5015-5020. DOI: 10.1109/CDC.2014.7040172

[2] Ding SX. Model-based Fault Diagnosis Techniques: Design Schemes, Algorithms, and Tools. 1st ed. Berlin, Germany: Springer; 2008. p. 493

Figure 6 shows the parameter estimation of the pendubot for both filters. Using the same tuning parameter set, while the SB-aSRUKF estimated the ϑ<sup>1</sup> to ϑ<sup>5</sup> parameters without bias, the joint SRUKF estimated ϑ<sup>1</sup> to ϑ<sup>3</sup> with slight bias, and it was not able to estimate ϑ<sup>4</sup> and ϑ5. These two parameters did not converge to the true system values. It should be noted that the diagram scales corresponding to parameters ϑ<sup>4</sup> and ϑ<sup>5</sup> are different between the filters. The parameter initialization and the tuning settings for the two filters were the same. The SB-

In this chapter, some approaches for state, parameter and covariance estimation were discussed. Moreover, a sensitivity-based adaptive square-root unscented Kalman filter (SB-aSRUKF) was discussed and its performance was analysed. This filter estimates system states, parameters and covariances online. Additionally, sensitivity models were presented and used as system excitation monitor to prevent parameter and covariance estimation drifts while the system excitation

Two testbeds based on an axis serial mechanism were modelled and used for testing the performance of the filter. Two experiments were performed in simulation on these two testbeds: a state sensitivity analysis and a comparison between the joint state and parameter square-root unscented Kalman filter (SRUKF) and the SB-aSRUKF. Simulation results show that the SB-aSRUKF outperforms the joint SRUKF with the same tuning configuration. While the joint SRUKF did not estimate two of the five parameters correctly, the SB-aSRUKF identified all the parameters. Moreover, the estimation of covariances reduces the parameter estimation bias. Configuring the right excitation thresholds for the system excitation monitor in Eq. (9) prevented parameter estimation drifts, while the input was not persistently exciting and did not only increased but also in some cases reduced the convergence time of the filter.

aSRUKF outperforms the joint SRUKF for the parameter estimation of the pendubot.

5. Conclusions

96 Kalman Filters - Theory for Advanced Applications

was not sufficient.

Author details

References

Mauro Hernán Riva\*, Mark Wielitzka and Tobias Ortmaier

\*Address all correspondence to: mauro.riva@imes.uni-hannover.de

Institute of Mechatronic Systems, Leibniz Universität Hanover, Hanover, Germany

Angeles, USA. 2014:5015-5020. DOI: 10.1109/CDC.2014.7040172

[1] Wielitzka M, Dagen M, Ortmaier T. State estimation of vehicle's lateral dynamics using unscented Kalman filter. 53rd IEEE Conference on Decision and Control (CDC); Los


[18] Odelson BJ, Rajamani MR, Rawlings JB. A new autocovariance least-squares method for estimating noise covariances. Automatica. 2006;42(6):303-308. DOI: 10.1016/j.automatica. 2005.09.006

**Chapter 5**

Provisional chapter

**Kalman Filters for Parameter Estimation of**

An adaptive Taylor-Kalman filter with PSO tuning for tracking nonstationary signal parameters in a noisy environment with primary focus on time-varying power signals has been presented in this piece of work. In order to deal with the dynamic envelope of the power signal, second-order Taylor expansion has been used such that the Taylor coefficients are updated with the PSO-tuned Taylor-Kalman Filter algorithm. In addition to this, for fast convergence, a self-adaptive particle swarm optimization technique has been used for obtaining the optimal values of model and measurement error covariances of the Kalman filter. The proposed algorithm is linear and therefore has less computational burden, which is easier to be implemented on a hardware platform like DSP processor or FPGA. The proposed PSO-tuned Taylor-Kalman filter exhibits robust tracking capabilities even under changing signal dynamics, immune to critical noise conditions, harmonic contaminations, and also reveals excellent convergence properties.

DOI: 10.5772/intechopen.71874

Keywords: nonstationary signals, power signal frequency and phasor estimation,

Signal parameter estimation, which dates back to the late 19th century, describes the various methods employed to track amplitude, phase, and frequency-like parameters of a signal. Among all the signal parameters, frequency is the primary concern, as it is a nonlinear function in the received data sequence, and once that is measured accurately, tracking of other parameters like phase, amplitude, and damping factor of a signal can be relatively easier. Most real-world signals are nonstationary in nature, i.e., they have a time-varying frequency behavior. Some of the popular sources of nonstationary signals include speech, audio, sounds of mammals, machine vibrations, electrical power networks, and a variety of biomedical signals like electromyogram (EMG), electroencephalogram (EEG), phonocardiogram (PCG), and vibroarthrogram (VAG)).

> © The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Kalman Filters for Parameter Estimation of

**Nonstationary Signals**

Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

hybrid Kalman approach, PSO tuning

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

Sarita Nanda

Sarita Nanda

Abstract

1. Introduction


### **Kalman Filters for Parameter Estimation of Nonstationary Signals** Kalman Filters for Parameter Estimation of Nonstationary Signals

DOI: 10.5772/intechopen.71874

### Sarita Nanda Sarita Nanda

[18] Odelson BJ, Rajamani MR, Rawlings JB. A new autocovariance least-squares method for estimating noise covariances. Automatica. 2006;42(6):303-308. DOI: 10.1016/j.automatica.

[19] Rajamani MR, Rawlings JB. Estimation of the disturbance structure from data using semidefinite programming and optimal weighting. Automatica. 2009;45(1):142-148. DOI: 10.

[20] Riva MH, Díaz Díaz J, Dagen M, Ortmaier T. Estimation of covariances for Kalman filter tuning using autocovariance method with Landweber iteration. In: IASTED International Symposium on Intelligent Systems and Control; Marina del Rey, CA, USA. 2013. DOI:

[21] Rajamani MR. Data-based Techniques to Improve State Estimation in Model Predictive Control [dissertation]. Madison, WI, USA: University of Wisconsin-Madison; 2007. p. 262

[22] Riva MH, Beckmann D, Dagen M, Ortmaier T. Online parameter and process covariance estimation using adaptive EKF and SRCuKF approaches. In: 2015 IEEE Conference on Control Applications (CCA); Sydney, Australia. 2015. p. 1203-1210. DOI: 10.1109/CCA.2015.7320776

[23] Han J, Song Q, He Y. Adaptive unscented Kalman filter and its applications in nonlinear control. In: Moreno VM, Pigazo A, editors. Kalman Filter Recent Advances and Applica-

[24] Wan EA, Van der Merwe R. The unscented Kalman filter for nonlinear estimation. In: IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium; Lake Louise, Canada. 2000. p. 153-158. DOI: 10.1109/ASSPCC.2000.882463 [25] Van der Merwe R, Wan EA. The square-root unscented Kalman filter for state and parameter-estimation. In: IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP 01); Salt Lake City, USA. 2001. p. 3461-3464. DOI: 10.1109/

[26] Press WH, Flannery BP, Teukolsky SA, Vetterling WT. Numerical Recipes in C: The Art of Scientific Computing. 2nd ed. Cambridge, New York, USA: Cambridge University Press;

[27] Henderson HV, Searle SR. The vec-permutation matrix, the vec operator and Kronecker products: A review. Linear and Multilinear Algebra. 1981;9(4):271-288. DOI: 10.1080/

[28] Riva MH, Dagen M, Ortmaier T. Adaptive Unscented Kalman Filter for online state, parameter, and process covariance estimation. In: 2016 American Control Conference

[29] Eykhoff P. System Identification Parameter and State Estimation. 1st ed. Hoboken, New

[30] Riva MH, Dagen M, Ortmaier T. Comparison of covariance estimation using autocovariance LS method and adaptive SRUKF. In: 2017 American Control Conference

(ACC); Seattle, WA, USA. 2017. p. 5780-5786. DOI: 10.23919/ACC.2017.7963856

(ACC); Boston, MA, USA. 2016. p. 4513-4519. DOI: 10.1109/ACC.2016.7526063

tions. Croatia: InTech; 2009. pp. 1-24. DOI: 10.5772/6799

2005.09.006

1016/j.automatica.2008.05.032

98 Kalman Filters - Theory for Advanced Applications

10.2316/P.2013.807-009

ICASSP.2001.940586

03081088108817379

Jersey, USA: Wiley-Interscience; 1974. p. 555

1992. p. 994

Additional information is available at the end of the chapter Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.71874

#### Abstract

An adaptive Taylor-Kalman filter with PSO tuning for tracking nonstationary signal parameters in a noisy environment with primary focus on time-varying power signals has been presented in this piece of work. In order to deal with the dynamic envelope of the power signal, second-order Taylor expansion has been used such that the Taylor coefficients are updated with the PSO-tuned Taylor-Kalman Filter algorithm. In addition to this, for fast convergence, a self-adaptive particle swarm optimization technique has been used for obtaining the optimal values of model and measurement error covariances of the Kalman filter. The proposed algorithm is linear and therefore has less computational burden, which is easier to be implemented on a hardware platform like DSP processor or FPGA. The proposed PSO-tuned Taylor-Kalman filter exhibits robust tracking capabilities even under changing signal dynamics, immune to critical noise conditions, harmonic contaminations, and also reveals excellent convergence properties.

Keywords: nonstationary signals, power signal frequency and phasor estimation, hybrid Kalman approach, PSO tuning

### 1. Introduction

Signal parameter estimation, which dates back to the late 19th century, describes the various methods employed to track amplitude, phase, and frequency-like parameters of a signal. Among all the signal parameters, frequency is the primary concern, as it is a nonlinear function in the received data sequence, and once that is measured accurately, tracking of other parameters like phase, amplitude, and damping factor of a signal can be relatively easier. Most real-world signals are nonstationary in nature, i.e., they have a time-varying frequency behavior. Some of the popular sources of nonstationary signals include speech, audio, sounds of mammals, machine vibrations, electrical power networks, and a variety of biomedical signals like electromyogram (EMG), electroencephalogram (EEG), phonocardiogram (PCG), and vibroarthrogram (VAG)).

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

These signals are rich in information and when analyzed properly provides with information that could be used to improve many aspects of our lives. Hence, the information of interest of the signal can be extracted, which includes the estimation of parameters like amplitude, phase, frequency, and damping factor directly from the discrete measurement in the presence of noise both in stationary and nonstationary environments. Precise and smooth operation of the power generation and distribution system is very much required in the present day scenario. With the increasing demand for power, the number and type of load are having deteriorating effects on the power quality. Power quality is defined as the ability of the electrical grid to deliver clean and stable power to the consumer. Between generation and supply, the power being delivered encounters large number of transformers and several lengths of overhead lines and underground cables. Phenomena like lightning strikes, system faults, load switching, and other such intentional or unintentional events are the main cause of electromagnetic disturbances, which results in voltage or current waveform distortions to propagate in the entire power system. Recently, the increase in the number of power electronic loads in the system causes nonlinear loading effect on the power system signal, leading to degradation of power quality.

particular requirement, but so far, the existing methodologies have exhibited significant drawbacks. Here are some of the research works that have been performed in the last 5 years.

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

101

For the estimation of harmonics and interharmonics, a technique using simple techniques like least mean square [4] and a two-stage ADALINE network has been studied [5]. The method utilized here provided a better accuracy even when power frequency deviation and interharmonic components are present in the measured signal. As the conventional ADALINE is unable to detect interharmonics, a two-stage ADALINE is used. The architecture is classified in two parts—the front stage that extracts the frequency value and the back stage that computes amplitude and phase. Here, the adaptive algorithm used in the filter is the RLS algorithm. The method yielded more accurate results in protection and monitoring applications.

Sliding window tracking (SWT) [6] accurately tracks the frequency and amplitude of a signal by processing only three (or more) recent data points. It works for a signal with any nonzero moving average and noise. Teager-Kaiser algorithm (TKA) is a well-known four-point method for online tracking of frequency and amplitude. TKA takes into assumption that the signal is purely harmonic, so any moving average in the signal can totally destroy the accuracy of TKA, whereas SWT uses a pair of windowed regular harmonics to estimate the frequency and amplitude thus eliminating the effect of moving average. In order to start the online tracking of frequency, SWT requires TKA to provide the first estimate of the frequency. The accuracies of SWT and TKA are compared using Hilbert-Huang transform, which is used to extract accurate time-varying frequencies and amplitudes by processing the whole data set without assuming the signal to be harmonic. Tracking accuracy increases when window length is equal to or greater than one quarter of the signal period. If the chosen window length is too long, then the estimated frequency is an average over the window length. The method requires constant frequency and amplitude to accurately track the parameters, and this shows that the dynamic response of the method is very poor and the accuracy deteriorates, if there is no

A real-time approach for the estimation of power system frequency based on Newton-type algorithm and least squares method has been used in this paper [7]. The adopted optimization technique has been based on a two-stage mathematical model. A Newton type algorithm has been used to model the first stage for estimating the line to neutral voltage-phase angle and its variation. The second stage has been modeled using LS minimization technique that extracts the power system frequency by processing the information in the phase angles estimated using NTA. The method also studies the modulating effect of time-varying frequency on the online

Taylor series expansion and Fourier algorithm have been used for frequency estimation [8]. To model the changing envelope of a power signal within an observation, a second-order Taylor series has been used, and the parameters of the model have been estimated using Fourier algorithm. Comparing with the traditional Fourier algorithm, this method introduces more

A modified ADALINE structure has been used in the paper [9] for online tracking of harmonics. Self-synchronized ADALINE network for power system harmonics estimation relies on the Levenberg Gradient Descent method for updating the system parameters. A faster

change in the parameter values.

estimation of the phase angle.

computational load.

Recently, harmonic estimation has become a challenging and critical issue for electrical engineers. Estimating harmonics and other faults is important for maintaining power quality. Research works carried out recently sheds light on various techniques for estimating harmonics. FFT [1]-based techniques are the conventional ones, and they suffer from some pitfalls such as aliasing and picket fence effects, which lead to inaccurate estimation results. There are some other methods suffering from these three problems, and this is because of existing high frequency components measured in the signal; however, truncation of the sequence of sampled data, when only a fraction of the sequence of a cycle exists in the analyzed waveform, can boost leakage problem of the DFT method. So, the need of new algorithms that process the data, sample-by-sample and not in a window as in FFT and DFT, is of paramount importance. Another very robust algorithm for the purpose of estimating sinusoidal signals with unknown noise content is the Kalman filter (KF) [2, 3].

However, when cases related to system dynamics, like sudden changes in frequency, amplitude and phase of a signal, arise, KF exhibits serious drawbacks. Study of several literature shows that single methods employed for the purpose of signal estimation are not efficient on their own, so hybrid methods based on the combination of different need to be formulated. The major contribution of this chapter is the accurate tracking of nonstationary power signal parameters, i.e., phasor, frequency, and harmonics. The power signal is modeled using Taylor series, and the coefficients of the Taylor series are updated using the Kalman Filter [4, 5], which are again utilized to estimate the time varying amplitude, phase, and frequency of the test signal. Moreover, a self-adaptive particle swarm optimization approach is deployed to choose the optimum values of the Kalman filter parameters like model and measurement error covariances, which in turn enables the filter to attain convergence in a faster rate.

### 2. Literature review

Work on harmonic and parameter estimation has been going since the introduction of AC power generation. Over the course of time, several methods have been proposed to fulfill this particular requirement, but so far, the existing methodologies have exhibited significant drawbacks. Here are some of the research works that have been performed in the last 5 years.

These signals are rich in information and when analyzed properly provides with information that could be used to improve many aspects of our lives. Hence, the information of interest of the signal can be extracted, which includes the estimation of parameters like amplitude, phase, frequency, and damping factor directly from the discrete measurement in the presence of noise both in stationary and nonstationary environments. Precise and smooth operation of the power generation and distribution system is very much required in the present day scenario. With the increasing demand for power, the number and type of load are having deteriorating effects on the power quality. Power quality is defined as the ability of the electrical grid to deliver clean and stable power to the consumer. Between generation and supply, the power being delivered encounters large number of transformers and several lengths of overhead lines and underground cables. Phenomena like lightning strikes, system faults, load switching, and other such intentional or unintentional events are the main cause of electromagnetic disturbances, which results in voltage or current waveform distortions to propagate in the entire power system. Recently, the increase in the number of power electronic loads in the system causes nonlinear

loading effect on the power system signal, leading to degradation of power quality.

noise content is the Kalman filter (KF) [2, 3].

100 Kalman Filters - Theory for Advanced Applications

2. Literature review

Recently, harmonic estimation has become a challenging and critical issue for electrical engineers. Estimating harmonics and other faults is important for maintaining power quality. Research works carried out recently sheds light on various techniques for estimating harmonics. FFT [1]-based techniques are the conventional ones, and they suffer from some pitfalls such as aliasing and picket fence effects, which lead to inaccurate estimation results. There are some other methods suffering from these three problems, and this is because of existing high frequency components measured in the signal; however, truncation of the sequence of sampled data, when only a fraction of the sequence of a cycle exists in the analyzed waveform, can boost leakage problem of the DFT method. So, the need of new algorithms that process the data, sample-by-sample and not in a window as in FFT and DFT, is of paramount importance. Another very robust algorithm for the purpose of estimating sinusoidal signals with unknown

However, when cases related to system dynamics, like sudden changes in frequency, amplitude and phase of a signal, arise, KF exhibits serious drawbacks. Study of several literature shows that single methods employed for the purpose of signal estimation are not efficient on their own, so hybrid methods based on the combination of different need to be formulated. The major contribution of this chapter is the accurate tracking of nonstationary power signal parameters, i.e., phasor, frequency, and harmonics. The power signal is modeled using Taylor series, and the coefficients of the Taylor series are updated using the Kalman Filter [4, 5], which are again utilized to estimate the time varying amplitude, phase, and frequency of the test signal. Moreover, a self-adaptive particle swarm optimization approach is deployed to choose the optimum values of the Kalman filter parameters like model and measurement error

Work on harmonic and parameter estimation has been going since the introduction of AC power generation. Over the course of time, several methods have been proposed to fulfill this

covariances, which in turn enables the filter to attain convergence in a faster rate.

For the estimation of harmonics and interharmonics, a technique using simple techniques like least mean square [4] and a two-stage ADALINE network has been studied [5]. The method utilized here provided a better accuracy even when power frequency deviation and interharmonic components are present in the measured signal. As the conventional ADALINE is unable to detect interharmonics, a two-stage ADALINE is used. The architecture is classified in two parts—the front stage that extracts the frequency value and the back stage that computes amplitude and phase. Here, the adaptive algorithm used in the filter is the RLS algorithm. The method yielded more accurate results in protection and monitoring applications.

Sliding window tracking (SWT) [6] accurately tracks the frequency and amplitude of a signal by processing only three (or more) recent data points. It works for a signal with any nonzero moving average and noise. Teager-Kaiser algorithm (TKA) is a well-known four-point method for online tracking of frequency and amplitude. TKA takes into assumption that the signal is purely harmonic, so any moving average in the signal can totally destroy the accuracy of TKA, whereas SWT uses a pair of windowed regular harmonics to estimate the frequency and amplitude thus eliminating the effect of moving average. In order to start the online tracking of frequency, SWT requires TKA to provide the first estimate of the frequency. The accuracies of SWT and TKA are compared using Hilbert-Huang transform, which is used to extract accurate time-varying frequencies and amplitudes by processing the whole data set without assuming the signal to be harmonic. Tracking accuracy increases when window length is equal to or greater than one quarter of the signal period. If the chosen window length is too long, then the estimated frequency is an average over the window length. The method requires constant frequency and amplitude to accurately track the parameters, and this shows that the dynamic response of the method is very poor and the accuracy deteriorates, if there is no change in the parameter values.

A real-time approach for the estimation of power system frequency based on Newton-type algorithm and least squares method has been used in this paper [7]. The adopted optimization technique has been based on a two-stage mathematical model. A Newton type algorithm has been used to model the first stage for estimating the line to neutral voltage-phase angle and its variation. The second stage has been modeled using LS minimization technique that extracts the power system frequency by processing the information in the phase angles estimated using NTA. The method also studies the modulating effect of time-varying frequency on the online estimation of the phase angle.

Taylor series expansion and Fourier algorithm have been used for frequency estimation [8]. To model the changing envelope of a power signal within an observation, a second-order Taylor series has been used, and the parameters of the model have been estimated using Fourier algorithm. Comparing with the traditional Fourier algorithm, this method introduces more computational load.

A modified ADALINE structure has been used in the paper [9] for online tracking of harmonics. Self-synchronized ADALINE network for power system harmonics estimation relies on the Levenberg Gradient Descent method for updating the system parameters. A faster response and better noise immunity are provided by conventional methods. A high computational load is the only drawback that exists in the proposed approach.

consuming and prone to errors. Self-adaptive PSO is used here to select the optimal values of

where A ið Þ, ωð Þi , and ϕð Þi are "the amplitude", "angular frequency," and "phase" of the sinusoid, respectively. ωðÞ¼ i 2πf ið Þ and f ið Þ is the fundamental frequency of the signal, while κð Þi

ϕð Þi : The rate of change of phase angle is equal to frequency. So the signal frequency can be

The coefficient functions Q ið Þ andR ið Þ express the envelope of the time varying sinusoid and

dt<sup>2</sup> and <sup>m</sup><sup>3</sup> <sup>¼</sup> <sup>d</sup>3Q ið Þ

Now we can obtain the amplitude and phase angle of the described given sinusoid using

q

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi m<sup>2</sup> <sup>0</sup> <sup>þ</sup> <sup>n</sup><sup>2</sup> 0

dt<sup>2</sup> and <sup>n</sup><sup>3</sup> <sup>¼</sup> <sup>d</sup>3R ið Þ

<sup>b</sup><sup>a</sup> <sup>¼</sup>

1 2π d

<sup>2</sup> <sup>þ</sup> … and R iðÞffi <sup>n</sup><sup>0</sup> <sup>þ</sup> <sup>n</sup>1<sup>i</sup> <sup>þ</sup> <sup>n</sup>2<sup>i</sup>

dt<sup>3</sup> at k = 0.

dt<sup>3</sup> at k = 0.

ϕb ¼ arctanð Þ n0=m<sup>0</sup> (6)

dtð Þ¼ <sup>θ</sup>ð Þ<sup>i</sup> <sup>f</sup> <sup>0</sup> <sup>þ</sup>

v iðÞ¼ A ið Þ: cos <sup>i</sup>ωðÞþ<sup>i</sup> <sup>ϕ</sup>ð Þ<sup>i</sup> � � <sup>þ</sup> <sup>κ</sup>ð Þ<sup>i</sup> (1)

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

103

v iðÞ¼ Q ið Þ cos 2ð Þ� πf ið Þ R ið Þ sin 2ð Þ πf ið Þ (3)

<sup>2</sup> Now let us represent <sup>θ</sup>ðÞ¼ <sup>i</sup> <sup>2</sup>πfidt <sup>þ</sup>

dt <sup>ϕ</sup>ð Þ<sup>i</sup> � � (2)

<sup>2</sup> <sup>þ</sup> … (4)

(5)

the error covariances in order to achieve fast convergence.

is an additive white noise with unknown variance σ<sup>g</sup>

where Q iðÞ¼ A ið Þ cos ϕð Þi andR iðÞ¼ A ið Þ sin ϕð Þi .

can be expanded using Taylor series [17, 18] as shown:

Q iðÞffi m<sup>0</sup> þ m1i þ m2i

dt at k = 0; <sup>m</sup><sup>2</sup> <sup>¼</sup> <sup>d</sup>2Q ið Þ

dt at k = 0, <sup>n</sup><sup>2</sup> <sup>¼</sup> <sup>d</sup>2R ið Þ

<sup>f</sup> <sup>¼</sup> <sup>1</sup> 2π d

Eq. (1) can be expressed according to trigonometric function as:

3.1. Signal modeling using Taylor expansion

Let the discrete signal be represented as:

represented as [3]:

where

and

<sup>m</sup><sup>0</sup> <sup>¼</sup> <sup>Q</sup>ð Þ<sup>0</sup> , m<sup>1</sup> <sup>¼</sup> dQ ið Þ

<sup>n</sup><sup>0</sup> <sup>¼</sup> <sup>R</sup>ð Þ<sup>0</sup> , n<sup>1</sup> <sup>¼</sup> dR ið Þ

Eq. (3) and (4) as follows at k = 0:

where m<sup>0</sup> ¼ Að Þ0 : cos ϕð Þ0

Ensemble Kalman Filter has been used in the proposed method [10] for filtering and estimating signal harmonics and interharmonics. To avoid the problem of singularity and for the computational feasibility of state covariance P, the state covariance P is replaced by a sample covariance C for the computation of Kalman gain.

The proposed method [11] is adopted for real-time estimation of phasor and harmonics. The technique reduces the turnaround time on two different off-the-shelf research and development DSP platforms. The proposed method has been found to be superior to that of ADALINE and RDFT techniques under the presence of noise sub-harmonics and frequency variations. The proposed technique has a computational efficiency that is higher than that of ADALINE and RDFT techniques.

The proposed algorithm in [12] is simple, computational efficient and makes the correction of the signal that enables to reach the mean square error. It provides a new kind of step adaptation for LMS algorithm. Two LMS algorithms have been utilized by this method. The first one has a fixed-step size, and the weight coefficient generated from the first algorithm is used to update the step size of the second algorithm, which has initial step size of 0.001.

An adaptive linear network (ADALINE) [13–15] for harmonic and interharmonic estimation (Martin) allows the computing of root mean square voltage and total harmonic distortion indices. Classification and detection of sags, swells, outages, and harmonics-interharmonics have been done using the indices computed before. Classification of spikes, notching, flicker, and oscillatory transients has been achieved by using a feed forward neural network through pattern recognition using horizontal and vertical histograms of a specific voltage waveform. The method used in [16] uses noneven item interpolation FFT based on triangular selfconvolution window. Variances of frequency estimation are proportional to the energy of the adopted window. By choosing suitable values of length of FFT, sampling frequency, and the shape of the adopted window, the variances of frequency estimation have been determined.

### 3. PSO-tuned Taylor-Kalman filter

To improve the performance of Kalman Filter in this aspect, a hybrid adaptive filter has been proposed in this thesis work that consists of the combination of Taylor series, Kalman Filter, and self-adaptive PSO. Taylor series is used to model the changing envelope of the sinusoidal signal. The sinusoidal signal is expressed in its trigonometric components, which in turn are expanded by using Taylor series. The Taylor coefficients are stored in the state vector that is further used to estimate the signal and its amplitude, frequency, and phase. In each iteration, the state vector is updated in order to get a better estimate than the previous, and the process continues until convergence is reached. There are two parameters on which the performance of the KF depends—the model and measurement error covariances. In the traditional approach, the values for these parameters are chosen by trial and error that makes the algorithm time consuming and prone to errors. Self-adaptive PSO is used here to select the optimal values of the error covariances in order to achieve fast convergence.

#### 3.1. Signal modeling using Taylor expansion

Let the discrete signal be represented as:

$$w(i) = A(i) . \cos\left[i\omega(i) + \phi(i)\right] + \kappa(i) \tag{1}$$

where A ið Þ, ωð Þi , and ϕð Þi are "the amplitude", "angular frequency," and "phase" of the sinusoid, respectively. ωðÞ¼ i 2πf ið Þ and f ið Þ is the fundamental frequency of the signal, while κð Þi is an additive white noise with unknown variance σ<sup>g</sup> <sup>2</sup> Now let us represent <sup>θ</sup>ðÞ¼ <sup>i</sup> <sup>2</sup>πfidt <sup>þ</sup> ϕð Þi : The rate of change of phase angle is equal to frequency. So the signal frequency can be represented as [3]:

$$f = \frac{1}{2\pi} \frac{d}{dt} (\theta(i)) = f\_0 + \frac{1}{2\pi} \frac{d}{dt} (\phi(i)) \tag{2}$$

Eq. (1) can be expressed according to trigonometric function as:

$$v(i) = Q(i)\cos\left(2\pi f(i)\right) - R(i)\sin\left(2\pi f(i)\right) \tag{3}$$

where Q iðÞ¼ A ið Þ cos ϕð Þi andR iðÞ¼ A ið Þ sin ϕð Þi .

The coefficient functions Q ið Þ andR ið Þ express the envelope of the time varying sinusoid and can be expanded using Taylor series [17, 18] as shown:

$$Q(i) \cong m\_0 + m\_1 i + m\_2 i^2 + \dots \quad \text{and} \quad R(i) \cong n\_0 + n\_1 i + n\_2 i^2 + \dots \tag{4}$$

where

response and better noise immunity are provided by conventional methods. A high computa-

Ensemble Kalman Filter has been used in the proposed method [10] for filtering and estimating signal harmonics and interharmonics. To avoid the problem of singularity and for the computational feasibility of state covariance P, the state covariance P is replaced by a sample covari-

The proposed method [11] is adopted for real-time estimation of phasor and harmonics. The technique reduces the turnaround time on two different off-the-shelf research and development DSP platforms. The proposed method has been found to be superior to that of ADALINE and RDFT techniques under the presence of noise sub-harmonics and frequency variations. The proposed technique has a computational efficiency that is higher than that of ADALINE

The proposed algorithm in [12] is simple, computational efficient and makes the correction of the signal that enables to reach the mean square error. It provides a new kind of step adaptation for LMS algorithm. Two LMS algorithms have been utilized by this method. The first one has a fixed-step size, and the weight coefficient generated from the first algorithm is used to

An adaptive linear network (ADALINE) [13–15] for harmonic and interharmonic estimation (Martin) allows the computing of root mean square voltage and total harmonic distortion indices. Classification and detection of sags, swells, outages, and harmonics-interharmonics have been done using the indices computed before. Classification of spikes, notching, flicker, and oscillatory transients has been achieved by using a feed forward neural network through pattern recognition using horizontal and vertical histograms of a specific voltage waveform. The method used in [16] uses noneven item interpolation FFT based on triangular selfconvolution window. Variances of frequency estimation are proportional to the energy of the adopted window. By choosing suitable values of length of FFT, sampling frequency, and the shape of the adopted window, the variances of frequency estimation have been determined.

To improve the performance of Kalman Filter in this aspect, a hybrid adaptive filter has been proposed in this thesis work that consists of the combination of Taylor series, Kalman Filter, and self-adaptive PSO. Taylor series is used to model the changing envelope of the sinusoidal signal. The sinusoidal signal is expressed in its trigonometric components, which in turn are expanded by using Taylor series. The Taylor coefficients are stored in the state vector that is further used to estimate the signal and its amplitude, frequency, and phase. In each iteration, the state vector is updated in order to get a better estimate than the previous, and the process continues until convergence is reached. There are two parameters on which the performance of the KF depends—the model and measurement error covariances. In the traditional approach, the values for these parameters are chosen by trial and error that makes the algorithm time

update the step size of the second algorithm, which has initial step size of 0.001.

tional load is the only drawback that exists in the proposed approach.

ance C for the computation of Kalman gain.

102 Kalman Filters - Theory for Advanced Applications

3. PSO-tuned Taylor-Kalman filter

and RDFT techniques.

 $m\_0 = Q(0), \ m\_1 = \frac{dQ(i)}{dt}$  at  $\mathbf{k} = 0$ ;  $m\_2 = \frac{d^2Q(i)}{dt^2}$  and  $m\_3 = \frac{d^3Q(i)}{dt^3}$  at  $\mathbf{k} = 0$ . 
$$m\_0 = R(0), \ n\_1 = \frac{dR(i)}{dt}$$
 at  $\mathbf{k} = 0$ ,  $n\_2 = \frac{d^2R(i)}{dt^2}$  and  $n\_3 = \frac{d^3R(i)}{dt^3}$  at  $\mathbf{k} = 0$ .

Now we can obtain the amplitude and phase angle of the described given sinusoid using Eq. (3) and (4) as follows at k = 0:

$$
\widehat{a} = \sqrt{m\_0^2 + n\_0^2} \tag{5}
$$

and

$$\phi = \arctan(n\_0/m\_0) \tag{6}$$

where m<sup>0</sup> ¼ Að Þ0 : cos ϕð Þ0

$$m\_0 = A(0).\sin\phi(0)\tag{7}$$

The stochastic model of the signal is obtained as

where the observation matrix can be calculated as:

χ ^ ðÞ¼ <sup>i</sup> <sup>χ</sup> ^ �

K iðÞ¼ P i bð Þ � 1 Hi

The error signal can be obtained as

where the Kalman gain K(i) is given as:

where P i bð Þ is the covariance matrix given by

where q is the model noise covariance matrix given by

and

χ 1 ið Þ χ 2 ið Þ χ 3 ið Þ χ 4 ið Þ χ 5 ið Þ χ 6 ið Þ

The measurement model of the signal expressed in Eq. (12) can be calculated as:

Hi <sup>¼</sup> sin 2π<sup>f</sup> <sup>0</sup>idt � �idt sin 2π<sup>f</sup> <sup>0</sup>idt � �

Using Eq. (19) the updated state estimate can be obtained from the following equation

ð Þþ i � 1 K ið Þ Si � Hχ

<sup>T</sup> HP i <sup>b</sup>ð Þ � <sup>1</sup> <sup>i</sup>

χ 1 ið Þ χ 2 ið Þ χ 3 ið Þ χ 4 ið Þ χ 5 ið Þ χ 6 ið Þ

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

Si ¼ hiχ<sup>i</sup> þ vi (17)

cos 2π<sup>f</sup> <sup>0</sup>idt � �idt cos 2π<sup>f</sup> <sup>0</sup>idt � � " # (18)

Ei <sup>¼</sup> <sup>S</sup> � Hiχbð Þ<sup>i</sup> (19)

� � (20)

^ ð Þi

H<sup>T</sup> <sup>i</sup> þ r

P i bðÞ¼ P i bð Þ� � 1 KiHiP i bð Þ � 1 (22)

P i bð Þ¼ þ 1 P i bðÞþ q (23)

� ��<sup>1</sup>

(16)

(21)

Similarly for estimating the frequency of the given sinusoid, consider Eq.(4) at k = 0, the first derivative will be:

$$m\_1 = \frac{d}{dt}(A(0).\cos\phi(0))\tag{8}$$

$$m\_1 = \frac{d}{dt} \left( A(0), \sin \phi(0) \right) \tag{9}$$

By substituting Eq. (7) in Eq. (8) and (9) and by neglecting

$$\frac{d}{dt}(A(0)):\frac{d}{dt}(\phi(0)) = \frac{m\_0 n\_1 - n\_0 m\_1}{m\_0^2 + n\_0^2} \tag{10}$$

Now from Eq. (2) and Eq. (10), we get the formula for computing the frequency:

$$\widehat{f} = f\_0. + \frac{1}{2\pi} \left( \frac{m\_0 n\_1 - n\_0 m\_1}{m\_0^2 + n\_0^2} \right) \tag{11}$$

#### 3.2. Updation of Taylor coefficients using the PSO-tuned Kalman filtering algorithm

Let us consider the following discrete signal:

$$Y\_i = a.\sin\left[i\omega T\_S + \phi\right] + n\_k \tag{12}$$

where a, Ts, ω, andϕ are the amplitude, sampling time, angular frequency, and phase of the signal, respectively, and nk represents measurement noise with a covariance R.

We can represent the state space Eq. (10) of the discrete signal as:

$$
\stackrel{\frown}{\chi}^-(i) = f\_i \chi\_i + \eta\_i \tag{13}
$$

$$
\chi\_i(1) = m\_0; \ \chi\_i(2) = m\_1; \ \chi\_i(3) = m\_2; \chi\_i(4) = m\_0; \ \chi\_i(5) = m\_1; \ \chi\_i(6) = m\_2 \tag{14}
$$

And the state transition matrix is given by:

$$f\_i = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 \end{bmatrix} \tag{15}$$

The stochastic model of the signal is obtained as

n<sup>0</sup> ¼ Að Þ0 : sin ϕð Þ0 (7)

dt <sup>A</sup>ð Þ<sup>0</sup> : cos <sup>ϕ</sup>ð Þ<sup>0</sup> � � (8)

dt <sup>A</sup>ð Þ<sup>0</sup> : sin <sup>ϕ</sup>ð Þ<sup>0</sup> � � (9)

Yi <sup>¼</sup> <sup>a</sup>: sin <sup>i</sup>ωTS <sup>þ</sup> <sup>ϕ</sup> � � <sup>þ</sup> nk (12)

χ<sup>i</sup> þ η<sup>i</sup> (13)

(10)

(11)

(15)

Similarly for estimating the frequency of the given sinusoid, consider Eq.(4) at k = 0, the first

dt <sup>ϕ</sup>ð Þ<sup>0</sup> � � <sup>¼</sup> <sup>m</sup>0n<sup>1</sup> � <sup>n</sup>0m<sup>1</sup> m<sup>0</sup> þ n<sup>0</sup>

> m0n<sup>1</sup> � n0m<sup>1</sup> m<sup>0</sup> þ n<sup>0</sup>

� �

<sup>m</sup><sup>1</sup> <sup>¼</sup> <sup>d</sup>

<sup>n</sup><sup>1</sup> <sup>¼</sup> <sup>d</sup>

Now from Eq. (2) and Eq. (10), we get the formula for computing the frequency:

 π

3.2. Updation of Taylor coefficients using the PSO-tuned Kalman filtering algorithm

where a, Ts, ω, andϕ are the amplitude, sampling time, angular frequency, and phase of the

ðÞ¼ i f <sup>i</sup>

χið Þ¼ 1 m0; χið Þ¼ 2 m1; χið Þ¼ 3 m2; χið Þ¼ 4 n0; χið Þ¼ 5 n1; χið Þ¼ 6 m<sup>2</sup> (14)

bf ¼ f <sup>0</sup>: þ

signal, respectively, and nk represents measurement noise with a covariance R.

χ ^ �

f <sup>i</sup> ¼

We can represent the state space Eq. (10) of the discrete signal as:

By substituting Eq. (7) in Eq. (8) and (9) and by neglecting

Let us consider the following discrete signal:

And the state transition matrix is given by:

d

dtð Þ <sup>A</sup>ð Þ<sup>0</sup> : <sup>d</sup>

derivative will be:

Kalman Filters - Theory for Advanced Applications

$$
\begin{bmatrix}
\chi \ \mathbf{1}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{2}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{3}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{4}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{5}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{6}(\bar{\mathbf{i}})
\end{bmatrix} = \begin{bmatrix}
1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \\
0 \ 1 \ 0 \ 0 \ 0 \ 0 \\
0 \ 0 \ 1 \ 0 \ 0 \ 0 \\
0 \ 0 \ 0 \ 1 \ 0 \ 0 \\
0 \ 0 \ 0 \ 0 \ 1 \ 0 \\
0 \ 0 \ 0 \ 0 \ 1 \ 0 \\
0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 1
\end{bmatrix} \begin{bmatrix}
\chi \ \mathbf{1}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{2}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{3}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{4}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{5}(\bar{\mathbf{i}}) \\
\chi \ \mathbf{6}(\bar{\mathbf{i}})
\end{bmatrix} \tag{16}
$$

The measurement model of the signal expressed in Eq. (12) can be calculated as:

$$S\_i = h\_i \chi\_i + v\_i \tag{17}$$

where the observation matrix can be calculated as:

$$H\_i = \begin{bmatrix} \sin\left(2\pi f\_0 \dot{u} dt\right) \dot{u} dt \sin\left(2\pi f\_0 \dot{u} dt\right) \\ \cos\left(2\pi f\_0 \dot{u} dt\right) \dot{u} dt \cos\left(2\pi f\_0 \dot{u} dt\right) \end{bmatrix} \tag{18}$$

The error signal can be obtained as

$$E\_i = \mathbb{S} - H\_i \widehat{\chi}(i) \tag{19}$$

Using Eq. (19) the updated state estimate can be obtained from the following equation

$$
\hat{\boldsymbol{\chi}}^{\uparrow}(\mathbf{i}) = \hat{\boldsymbol{\chi}}^{-}(\mathbf{i} - \mathbf{1}) + \mathbf{K}(\mathbf{i}) \Big(\mathbf{S}\_{i} - H\hat{\boldsymbol{\chi}}(\mathbf{i})\Big) \tag{20}
$$

where the Kalman gain K(i) is given as:

$$K(i) = \widehat{P}(i-1)H\_i^T \left( H\widehat{P}(i-1)\_i H\_i^T + r \right)^{-1} \tag{21}$$

where P i bð Þ is the covariance matrix given by

$$
\widehat{P}(i) = \widehat{P}(i-1) - K\_i H\_i \widehat{P}(i-1) \tag{22}
$$

and

$$
\dot{P}(i+1) = \dot{P}(i) + q \tag{23}
$$

where q is the model noise covariance matrix given by

$$q = \begin{bmatrix} q\_a & 0 & 0 & 0 & 0 & 0 \\ 0 & q\_b & 0 & 0 & 0 & 0 \\ 0 & 0 & q\_c & 0 & 0 & 0 \\ 0 & 0 & 0 & q\_d & 0 & 0 \\ 0 & 0 & 0 & 0 & q\_c & 0 \\ 0 & 0 & 0 & 0 & 0 & q\_f \end{bmatrix} \tag{24}$$

Við Þ¼ k þ 1 K αvið Þþ k b1rnd<sup>1</sup> pbesti

<sup>K</sup> <sup>¼</sup> <sup>2</sup>

αð Þ¼ k

and k is the current evolutionary generation.

3.4. PSO-based Taylor-Kalman filter structure

Figure 1. Filter structure of the proposed approach.

random numbers in the range [0, 1], K is a constriction factor given by:

<sup>∣</sup><sup>2</sup> � <sup>b</sup> � ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

1 þ e

ð Þ� <sup>k</sup> xið Þ<sup>k</sup> � � <sup>þ</sup> <sup>b</sup>2rnd<sup>2</sup> gbesti ð Þ� <sup>k</sup> xið Þ<sup>k</sup> � � � � (29)

where α is the inertia weight factor, b<sup>1</sup> and b<sup>2</sup> are the acceleration constants, rnd<sup>1</sup> and rnd<sup>2</sup> are

The performance of the PSO algorithm is significantly affected by the three factors w, c1, and c2. In this approach, a detection function defined as: <sup>φ</sup>ð Þ¼ <sup>k</sup> <sup>∣</sup> gbesti � xið Þ<sup>k</sup> � �<sup>=</sup> pbesti � xið Þ<sup>k</sup> � �∣. The

αinitial � αfinal

<sup>c</sup>1ð Þ¼ <sup>k</sup> <sup>c</sup>1φ�<sup>1</sup>

where winitial and wfinal lie in the range 0ð Þ < w < 2 , Lmax is the final evolutionary generation,

The adaptive filter structure with the proposed adaptive algorithm is shown in the Figure 1. This particular structure is modeled for only the fundamental component of the signal to be estimated. For a signal with Nth order harmonics, the same structure can be extended to meet the requirements. The signal is modeled using Taylor series up to the second order, so the filter

<sup>φ</sup>ð Þ<sup>k</sup> ð Þ <sup>k</sup>�ð Þ ð Þ <sup>1</sup>þln ð Þ <sup>φ</sup>ð Þ<sup>k</sup> <sup>L</sup>max <sup>=</sup><sup>μ</sup>

values of the three factors are adjusted dynamically using the following equations

xið Þ¼ k þ 1 xið Þþ k Við Þ k þ 1 (30)

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

107

<sup>b</sup><sup>2</sup> � <sup>4</sup>b<sup>∣</sup> <sup>p</sup> , and <sup>b</sup> <sup>¼</sup> <sup>b</sup><sup>1</sup> <sup>þ</sup> <sup>b</sup>2; b <sup>&</sup>gt; <sup>4</sup> (31)

þ αfinal (32)

ð Þk (33)

c2ð Þ¼ k c2φð Þk (34)

r is the measurement noise covariance which is fine tuned by using the error between the desired and estimated signals for

$$r(i) = \lambda\_{\mathcal{S}}(r + (E(i))^\wedge 2) \tag{25}$$

where λ<sup>g</sup> is the forgetting factor in the range (0.9–1). Finally using the EKF time updated equations the X ið Þ matrix is computed which determines the values of the Taylor series coefficients m0, m1, n0, and n1.

#### 3.3. Particle swarm optimization-based tuning of the Kalman filter

For fast convergence, optimum values of q and r are selected by applying a self-adaptive PSO [19]. For this purpose, a cost function is formulated, which passed in the PSO algorithm to get the optimum value for q and r. Here, the cost function is:

$$F = \frac{1}{L} \sum\_{i=1}^{L} E\_i^2 \tag{26}$$

Particle swarm optimization is used to minimize the value of Eq. (26). Each particle is characterized by two attributes:


The PSO algorithm either minimizes or maximizes the value of gbest. Let xij and Vij be the position and velocity of the i th particle in the j th dimension at k th instance of time. The personal best value can be determined from Eq. (27).

$$pbest\_i(k+1) = \begin{cases} pbest\_i(k), \acute{\mu} \, F(\mathbf{x}\_i(k+1)) > F(pbest\_i(k)) \\ \mathbf{x}\_i(k+1), \acute{\mu} \, F(\mathbf{x}\_i(k+1)) < F(pbest\_i(k)) \end{cases} \tag{27}$$

where F indicates the cost function. The value of global best is obtained as:

$$\text{gbest}(k) = \min\left\{ \mathbb{C}...F(\text{pbest}\_0(k)), \mathbb{C}...F(\text{pbest}\_1(k)), \mathbb{C}...F(\text{pbest}\_2(k)), \dots, \mathbb{C}...F(\text{pbest}\_s(k)), \right\} \tag{28}$$

For each particle, the updated velocity and position at time ð Þ k þ 1 are given by

$$V\_i(k+1) = K \{ av\_i(k) + b\_1 rnd\_1 \{ pbest\_i(k) - \mathbf{x}\_i(k) \} + b\_2 rnd\_2 \{ gbest\_i(k) - \mathbf{x}\_i(k) \} \tag{29}$$

$$\mathbf{x}\_{i}(k+1) = \mathbf{x}\_{i}(k) + V\_{i}(k+1) \tag{30}$$

where α is the inertia weight factor, b<sup>1</sup> and b<sup>2</sup> are the acceleration constants, rnd<sup>1</sup> and rnd<sup>2</sup> are random numbers in the range [0, 1], K is a constriction factor given by:

$$K = \frac{2}{|2 - b - \sqrt{b^2 - 4b}|}, \quad \text{and} \quad b = b\_1 + b\_2; b > 4 \tag{31}$$

The performance of the PSO algorithm is significantly affected by the three factors w, c1, and c2. In this approach, a detection function defined as: <sup>φ</sup>ð Þ¼ <sup>k</sup> <sup>∣</sup> gbesti � xið Þ<sup>k</sup> � �<sup>=</sup> pbesti � xið Þ<sup>k</sup> � �∣. The values of the three factors are adjusted dynamically using the following equations

$$\alpha(k) = \frac{\alpha\_{initial} - \alpha\_{final}}{1 + e^{\rho(k)\left(k - ((1 + \ln\left(\rho(k)\right))L\_{\text{max}})/\mu\right)}} + \alpha\_{final} \tag{32}$$

$$\mathbf{c}\_1(k) = \mathbf{c}\_1 \boldsymbol{\varphi}^{-1}(k) \tag{33}$$

$$c\_2(k) = c\_2 \varphi(k)\tag{34}$$

where winitial and wfinal lie in the range 0ð Þ < w < 2 , Lmax is the final evolutionary generation, and k is the current evolutionary generation.

#### 3.4. PSO-based Taylor-Kalman filter structure

q ¼

3.3. Particle swarm optimization-based tuning of the Kalman filter

the optimum value for q and r. Here, the cost function is:

positions of the particular particle.

best value can be determined from Eq. (27).

pbesti

desired and estimated signals for

106 Kalman Filters - Theory for Advanced Applications

coefficients m0, m1, n0, and n1.

terized by two attributes:

position and velocity of the i

r is the measurement noise covariance which is fine tuned by using the error between the

where λ<sup>g</sup> is the forgetting factor in the range (0.9–1). Finally using the EKF time updated equations the X ið Þ matrix is computed which determines the values of the Taylor series

For fast convergence, optimum values of q and r are selected by applying a self-adaptive PSO [19]. For this purpose, a cost function is formulated, which passed in the PSO algorithm to get

> i¼1 E2

Particle swarm optimization is used to minimize the value of Eq. (26). Each particle is charac-

i. pbest or Personal best: it holds the best value of position with respect to the previous

The PSO algorithm either minimizes or maximizes the value of gbest. Let xij and Vij be the

th dimension at k

xið Þ k þ 1 , if F xð Þ <sup>i</sup>ð Þ k þ 1 < F pbesti

gbest kð Þ¼ min <sup>C</sup>::F pbest0ð Þ<sup>k</sup> � �; <sup>C</sup>::F pbest1ð Þ<sup>k</sup> � �;C::F pbest2ð Þ<sup>k</sup> � �; :…;C::F pbestsð Þ<sup>k</sup> � �; � � (28)

ð Þk , if F xð Þ <sup>i</sup>ð Þ k þ 1 > F pbesti

ii. gbest or Global best: it holds the best value of position in the entire search space.

th particle in the j

ð Þ¼ <sup>k</sup> <sup>þ</sup> <sup>1</sup> pbesti

(

where F indicates the cost function. The value of global best is obtained as:

For each particle, the updated velocity and position at time ð Þ k þ 1 are given by

<sup>F</sup> <sup>¼</sup> <sup>1</sup> L X L

r iðÞ¼ λgð Þ r þ ð Þ E ið Þ ^2 (25)

<sup>i</sup> (26)

th instance of time. The personal

(27)

ð Þ<sup>k</sup> � �

ð Þ<sup>k</sup> � �

(24)

The adaptive filter structure with the proposed adaptive algorithm is shown in the Figure 1. This particular structure is modeled for only the fundamental component of the signal to be estimated. For a signal with Nth order harmonics, the same structure can be extended to meet the requirements. The signal is modeled using Taylor series up to the second order, so the filter

Figure 1. Filter structure of the proposed approach.

has six weights for the six inputs that are used for the purpose of estimation. The performance of the algorithm is judged on the basis of speed of convergence, which is verified from the simulation results in Section 4.

### 4. Simulation and results

The performance of the proposed algorithm for power system signals has been shown with the help of three computer simulated examples.

### 4.1. Tracking of a nonstationary signal with simultaneous change in amplitude, phase, and frequency

A nonstationary test signal as shown in Eq. (35) is generated in MATLAB. The simulation is done over 1000 samples of the signal. To make the signal nonstationary, a double step is introduced in the signal by changing the value of amplitude from 500 to 700 samples. This is done to simulate voltage surge occurrences in real time, where the amplitude increases from that of its desired value for some period of time. Similar disturbances also change the values of frequency and phase which is also simulated to test the tracking accuracy of the proposed algorithm. The results in Figures 2–5 reveal that the accuracy of the proposed algorithm is very high and tracking is achieved within one cycle of the signal.

y iðÞ¼ a ið Þ sin <sup>i</sup>ωð Þ<sup>t</sup> dt <sup>þ</sup> <sup>ϕ</sup>ð Þ<sup>i</sup> � � <sup>þ</sup> n ið Þ (35)

**Desired Signal Estimated Signal**

**Phase**

**Estimated Phase**

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

109

0:8 p:u, i < 500samples 1 p:u, 500 < i < 700samples 0:8 p:u, i > 700samples

**400 500 600 700 800**

**200 300 400 500 600 700 800**

**Samples**

**Samples**

f iðÞ¼ <sup>50</sup> Hz, i <sup>&</sup>lt; <sup>500</sup>samples <sup>51</sup> Hz, i <sup>&</sup>gt; <sup>500</sup>samples �

> 0:5 rad <sup>0</sup>:45 rad � �

n ið Þ is the noise sequence with power level 30 dB. This signal fed into the algorithm and

where,

is the signal amplitude.

The sampling frequency f <sup>s</sup> ¼ 2kHz ϕðÞ¼ i

**-1**

**0**

**S ig n a l**

Figure 5. Estimated signal under 30 dB noise.

**1**

**0.3 0.4 0.5 0.6 0.7**

**Phase(rad)**

Figure 4. Estimated phase under 30 dB noise.

simulated in MATLAB 2013a environment.

a iðÞ¼

8 ><

>:

Figure 2. Estimated amplitude under 30 dB noise.

Figure 3. Estimated frequency under 30 dB noise.

Figure 4. Estimated phase under 30 dB noise.

Figure 5. Estimated signal under 30 dB noise.

$$y(i) = a(i)\sin\left(i\omega(t)dt + \phi(i)\right) + n(i)\tag{35}$$

where,

has six weights for the six inputs that are used for the purpose of estimation. The performance of the algorithm is judged on the basis of speed of convergence, which is verified from the

The performance of the proposed algorithm for power system signals has been shown with the

A nonstationary test signal as shown in Eq. (35) is generated in MATLAB. The simulation is done over 1000 samples of the signal. To make the signal nonstationary, a double step is introduced in the signal by changing the value of amplitude from 500 to 700 samples. This is done to simulate voltage surge occurrences in real time, where the amplitude increases from that of its desired value for some period of time. Similar disturbances also change the values of frequency and phase which is also simulated to test the tracking accuracy of the proposed algorithm. The results in Figures 2–5 reveal that the accuracy of the proposed algorithm is very

**400 500 600 700 800 900**

**Samples**

**0 200 400 600 800**

**Samples**

**Amplitude**

**Frequency**

**Estimated Frequency**

**Estimated Amplitude**

4.1. Tracking of a nonstationary signal with simultaneous change in amplitude, phase,

simulation results in Section 4.

108 Kalman Filters - Theory for Advanced Applications

4. Simulation and results

and frequency

help of three computer simulated examples.

high and tracking is achieved within one cycle of the signal.

**0.6 0.8 1 1.2 1.4**

**50**

**51**

**Frequency(Hz)**

Figure 3. Estimated frequency under 30 dB noise.

**52**

**Amplitude(p.u.)** 

Figure 2. Estimated amplitude under 30 dB noise.

$$a(i) = \begin{cases} 0.8 & p.u.\, i < 500 \, samples \\ 1 & p.u.\, 500 < i < 700 \, samples \\ 0.8 & p.u.\, i > 700 \, samples \end{cases}$$

is the signal amplitude.

$$f(i) = \begin{cases} 50 \text{ Hz, } i < 500 \text{ samples} \\ 51 \text{ Hz, } i > 500 \text{ samples} \end{cases}$$

The sampling frequency f <sup>s</sup> ¼ 2kHz ϕðÞ¼ i 0:5 rad <sup>0</sup>:45 rad � �

n ið Þ is the noise sequence with power level 30 dB. This signal fed into the algorithm and simulated in MATLAB 2013a environment.


Table 1. Estimated values of amplitude, frequency, and phase under different noise conditions.

Table 1 contains the estimated values of the amplitude, frequency, and phase of the signal under different noise conditions. In this simulation, three different noise conditions have been considered. The simulation is carried out in a dynamic noise range from high noise (20 dB) to low noise (40 dB) conditions to test the performance of the proposed algorithm under noise. The analysis of the performance under noisy conditions shows that the proposed algorithm is able to track the desired signal very closely even under heavy noise conditions.

#### 4.2. Performance of the proposed algorithm in harmonic estimation

In this case, the ability of the proposed algorithm is tested with respect to the tracking of harmonics. The number of harmonic components present in the system is not constant, and it can vary from few to a large number. It is not possible for any method to track infinite number of harmonics but can handle a substantial quantity. In the real-time scenario, harmonics occur as odd multiples of the fundamental frequency, so the simulation is carried out with a system generated signal containing harmonics up to the 19th order.

$$\begin{aligned} y(i) &= a1(i)\sin\left(i\omega(i)dt + \phi\_1(i)\right) + 0.8(i)\sin\left(i3\omega(i)dt + 0.4\right) \\ &+ 0.6(i)\sin\left(i5\omega(i)dt + 0.3\right) + 0.5(i)\sin\left(i7\omega(i)dt + 0.25\right) \\ &+ 0.4(i)\sin\left(i11\omega(i)dt + 0.2\right) + 0.2(i)\sin\left(i19\omega(i)dt + 0.1\right) \end{aligned} \tag{36}$$

Table 2 shows the comparison of the absolute errors in amplitude, frequency, and phase estimation for different harmonic components for EKF, LMS, RLS, and the proposed method. The values show that the higher order (>5th order) components exhibit higher error values for

**0 200 400 600 800 1000**

**0 200 400 600 800 1000**

**20 40 60 80 100**

**20 40 60 80 100 120**

**Samples**

**Samples**

**Samples**

**Samples**

**Amplitude Estimated amp**

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

111

**Amplitude estimated amp**

**Amplitude estimated amp**

**Amplitude estimated amp**

**0.9**

Figure 6. Estimated fundamental amplitude for case 4.2.

**0.7 0.8 0.9 1**

> **0.2 0.4 0.6 0.8 1**

**0 0.2 0.4 0.6 0.8**

**3rd Amplitude(p.u.)**

Figure 7. Estimated third amplitude for case 4.2.

**5th Amplitude(p.u)** 

Figure 8. Estimated fifth amplitude for case 4.2.

**7th Amplitude(p.u.)** 

Figure 9. Estimated seventh amplitude for case 4.2.

**1**

**1.1**

**Amplitude(p.u.)**

**1.2**

The signal parameters are taken as:

a iðÞ¼ 0:1 sin 2ð Þþ πidt 0:05 sin 10 ð Þ πidt a1ðÞ¼ i 1 þ a ið Þ f iðÞ¼ 50Hz f <sup>s</sup>ðÞ¼ i 4kHz ϕ<sup>1</sup> ¼ 0:5 � 0:2 sin 2ð Þ π 5 idtd þ 0:3

The amplitude, frequency, and phase are estimated, and results are shown in Figures 6–11.

Figure 6. Estimated fundamental amplitude for case 4.2.

Figure 7. Estimated third amplitude for case 4.2.

Table 1 contains the estimated values of the amplitude, frequency, and phase of the signal under different noise conditions. In this simulation, three different noise conditions have been considered. The simulation is carried out in a dynamic noise range from high noise (20 dB) to low noise (40 dB) conditions to test the performance of the proposed algorithm under noise. The analysis of the performance under noisy conditions shows that the proposed algorithm is

Amplitude 0–500 0.8 0.7 0.772 0.727 0.76 0.76 0.777 0.795 0.798 0.799

Frequency 0–500 50 50.05 50.02 50.02 50.03 50.02 50.03 50.00 50.01 50.00

Phase 0–500 0.5 0.53 0.513 0.521 0.53 0.53 0.53 0.511 0.513 0.533

500–700 1 0.885 0.946 0.919 0.89 0.88 0.93 0.896 0.942 0.997 700–1000 0.8 0.7 0.772 0.727 0.78 0.79 0.787 0.789 0.794 0.797

500–1000 51 50.38 50.55 50.63 50.43 50.76 51.02 50.94 50.99 51

500–1000 0.45 0.465 0.445 0.47 0.43 0.48 0.47 0.44 0.45 0.45

LMS EKF Proposed method

20 dB 30 dB 40 dB 20 dB 30 dB 40 dB 20 dB 30 dB 40 dB

In this case, the ability of the proposed algorithm is tested with respect to the tracking of harmonics. The number of harmonic components present in the system is not constant, and it can vary from few to a large number. It is not possible for any method to track infinite number of harmonics but can handle a substantial quantity. In the real-time scenario, harmonics occur as odd multiples of the fundamental frequency, so the simulation is carried out with a system

y iðÞ¼ <sup>a</sup>1ð Þ<sup>i</sup> sin <sup>i</sup>ωð Þ<sup>i</sup> dt <sup>þ</sup> <sup>ϕ</sup>1ð Þ<sup>i</sup> <sup>þ</sup> <sup>0</sup>:8ð Þ<sup>i</sup> sin ð Þ <sup>i</sup>3ωð Þ<sup>i</sup> dt <sup>þ</sup> <sup>0</sup>:<sup>4</sup>

þ0:6ð Þi sin ði5ωð Þi dt þ 0:3Þ þ 0:5ð Þi sin ð Þ i7ωð Þi dt þ 0:25 þ0:4ð Þi sin ði11ωð Þi dt þ 0:2Þ þ 0:2ð Þi sin ð Þ i19ωð Þi dt þ 0:1

a iðÞ¼ 0:1 sin 2ð Þþ πidt 0:05 sin 10 ð Þ πidt

ϕ<sup>1</sup> ¼ 0:5 � 0:2 sin 2ð Þ π 5 idtd þ 0:3

The amplitude, frequency, and phase are estimated, and results are shown in Figures 6–11.

(36)

able to track the desired signal very closely even under heavy noise conditions.

Table 1. Estimated values of amplitude, frequency, and phase under different noise conditions.

4.2. Performance of the proposed algorithm in harmonic estimation

a1ðÞ¼ i 1 þ a ið Þ f iðÞ¼ 50Hz f <sup>s</sup>ðÞ¼ i 4kHz

generated signal containing harmonics up to the 19th order.

The signal parameters are taken as:

Parameter Samples Actual value Estimated value

110 Kalman Filters - Theory for Advanced Applications

Figure 8. Estimated fifth amplitude for case 4.2.

Figure 9. Estimated seventh amplitude for case 4.2.

Table 2 shows the comparison of the absolute errors in amplitude, frequency, and phase estimation for different harmonic components for EKF, LMS, RLS, and the proposed method. The values show that the higher order (>5th order) components exhibit higher error values for

4.3. Estimation of a power signal in the presence of DC component

where,

is the signal amplitude. f iðÞ¼ 50Hz

**0**

Figure 12. Estimated amplitude for signal with decaying DC component.

**50**

Figure 13. Estimated frequency for signal with decaying DC component.

**Estimated frequency (Hz)**

**55**

**1**

**2**

**Estimated amplitude (p.u.)**

**3**

When a fault occurs it not only distorts the signal by changing the voltage and current waveforms but some DC component that decays over time also gets added to the signal. DC components are nonperiodic in nature and this simulation shows that the proposed algorithm efficiently tracks nonperiodic components in the signal which is clearly evident from Figures 12–15. A nonsta-

a iðÞ¼ A exp ð Þ �i=300 p:u:

**0 200 400 600 800 1000**

**Frequency**

**Estimated Frequency**

**Amplitude**

**Estimated Amplitude**

**Samples**

**450 <sup>200</sup> <sup>400</sup> <sup>600</sup> <sup>800</sup> <sup>1000</sup>**

**Samples**

y iðÞ¼ a ið Þ sin <sup>i</sup>ωð Þ<sup>t</sup> dt <sup>þ</sup> <sup>ϕ</sup>ð Þ<sup>i</sup> <sup>þ</sup> n ið Þ (37)

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

113

tionary test signal with a decaying DC component as shown in Eq.(37) is considered:

A ¼ 1p:u:

The sampling frequency f <sup>s</sup> ¼ 2kHz and ϕðÞ¼ i 0:52 rad n ið Þ is the 30 dB noise.

Figure 10. Estimated frequency of fundamental for case 4.2.

Figure 11. Estimated signal for case 4.2.


Table 2. Comparison of absolute errors.

all the methods, but the comparison shows that among all the methods compared, the proposed method has the least values of error. This comparison sheds light on the superiority of the proposed method over the other methods.

#### 4.3. Estimation of a power signal in the presence of DC component

When a fault occurs it not only distorts the signal by changing the voltage and current waveforms but some DC component that decays over time also gets added to the signal. DC components are nonperiodic in nature and this simulation shows that the proposed algorithm efficiently tracks nonperiodic components in the signal which is clearly evident from Figures 12–15. A nonstationary test signal with a decaying DC component as shown in Eq.(37) is considered:

$$y(i) = a(i)\sin\left(i\omega(t)dt + \phi(i)\right) + n(i)\tag{37}$$

where,

all the methods, but the comparison shows that among all the methods compared, the proposed method has the least values of error. This comparison sheds light on the superiority of

**0 200 400 600 800 1000**

**0 50 100 150 200 250 300**

**Samples**

Amplitude (harmonic order) A1 0.01 0.03 0.023 0.007

Frequency Fundamental 0.065 0.045 0.0201 0.058 Phase Φ<sup>1</sup> 0.0029 0.0087 0.0047 0.0023

**Samples**

**Frequency Estimated freq**

**Desired Signal Estimated Signal**

EKF LMS RLS Proposed

A3 0.013 0.032 0.04 0.003 A5 0.02 0.047 0.056 0.009 A7 0.04 0.058 0.0856 0.017 A11 0.025 0.0623 0.021 0.017 A19 0.03 0.0875 0.075 0.025

Φ<sup>3</sup> 0.006 0.04 0.032 0.0005 Φ<sup>5</sup> 0.024 0.045 0.054 0.007 Φ<sup>7</sup> 0.005 0.076 0.072 0.002 Φ<sup>11</sup> 0.03 0.085 0.088 0.0019 Φ<sup>19</sup> 0.067 0.083 0.0765 0.04

the proposed method over the other methods.

Table 2. Comparison of absolute errors.

**49**

Figure 10. Estimated frequency of fundamental for case 4.2.

**-2**

Parameter Component Absolute error

**0**

**Signal**

Figure 11. Estimated signal for case 4.2.

**2**

**50**

**Frequency(Hz)** 

112 Kalman Filters - Theory for Advanced Applications

**51**

$$\begin{aligned} a(i) &= A \exp\left(-i/300\right) p.u., \\ A &= 1p.u. \end{aligned}$$

is the signal amplitude. f iðÞ¼ 50Hz

The sampling frequency f <sup>s</sup> ¼ 2kHz and ϕðÞ¼ i 0:52 rad n ið Þ is the 30 dB noise.

Figure 12. Estimated amplitude for signal with decaying DC component.

Figure 13. Estimated frequency for signal with decaying DC component.

utility network. The objective of developing such a technology is to create a compact and versatile tool. It is a small contribution toward the development of smart grid technology.

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

115

[1] Lin HC, Lee CS. Enhanced FFT-based parameter algorithm for simultaneous multiple harmonics analysis. Proceedings of the Institute of Electrical and Electronics Engineers: Generation, Transmission and Distribution Proceedings. May 2001;148(3):209-214. DOI:

[2] Chen CI, Chang GW, Hong RC, Li HM. Extended real model of Kalman filter for timevarying harmonics estimation. IEEE Transactions on Power Delivery. Jan 2010;25(1):17-

[3] Nanda S, Hasan S, Pujari SS, Dash PK. A fast hybrid adaptive filter for parameter estimation of non-stationary sinusoid under noise. IEEE Conference PCTIC. 2015. DOI:

[4] Pradhan K, Routray A, Basak A. Power system frequency estimation using least mean square technique. IEEE Transactions on Power Delivery. Jul. 2005;20(3):1812-1816. DOI:

[5] Chen C-I, Chang GW. A two stage ADALINE for harmonic and inter harmonic measurement. IEEE Transactions on Industrial Electronics. 2009;56(6):2220-2228. DOI: 10.1109/

[6] Pai PF. On-line tracking of instantaneous frequency and amplitude of dynamical system response. Mechanical Systems and Signal Processing. May 2010;24(4):1007-1024. DOI:

[7] Sadinezhad I, Agelidis VG. Slow sampling online optimization approach to estimate power system frequency. IEEE Transactions on Smart Grid. June 2011;2(2). DOI: 10.1109/

[8] Ren J, Kezunovic M. An improved fourier method for power system frequency estimation. North American Power Symposium (NAPS), 4–6 Aug, 2011, Boston, MA. pp. 1-6.

Address all correspondence to: sarita22579@rediffmail.com

School of Electronics, KIIT University, India

10.1049/ip-gtd:20010278

10.1109/PCITC.2015.7438146

10.1109/TPWRD.2004.843453

org/10.1016/j.ymssp.2009.07.014

DOI: 10.1109/NAPS.2011.6024845

TIE.2009.2017093

TSG.2011.2114374

26. DOI: 10.1109/TPWRD.2009.2035217

Author details

Sarita Nanda

References

Figure 14. Estimated phase for signal with decaying DC component.

Figure 15. Estimated signal with decaying DC component.

### 5. Conclusion

The traditional Kalman filter has been extended to Taylor-Kalman filter which resulted in filters that are able to have flat magnitude and phase responses. These filters exhibit excellent tracking abilities and accurately estimate the amplitude, frequency and phase of a time varying power signal without any distortion. The further combination of the Taylor-Kalman filter with self-adaptive PSO makes the performance of the proposed method superior to the traditional approach. The methods can be individually used for the purpose of signal and parameter estimation, but individually, they suffer from some drawbacks. By combining the three methods into one hybrid method, the pitfalls of each are compensated by the other and hence much better results are obtained.

Further, the hardware implementation of the proposed method can be attempted for real-time applications [20–23]. The hardware implementation of the proposed method can be embedded within an integrated circuit that will result in a system on chip that can be installed at power distribution centers, from where power gets distributed to the consumers, thus equipping them with a tool for detecting anomalies in power quality before power is dispatched to the utility network. The objective of developing such a technology is to create a compact and versatile tool. It is a small contribution toward the development of smart grid technology.

### Author details

Sarita Nanda

Address all correspondence to: sarita22579@rediffmail.com

School of Electronics, KIIT University, India

### References

5. Conclusion

much better results are obtained.

The traditional Kalman filter has been extended to Taylor-Kalman filter which resulted in filters that are able to have flat magnitude and phase responses. These filters exhibit excellent tracking abilities and accurately estimate the amplitude, frequency and phase of a time varying power signal without any distortion. The further combination of the Taylor-Kalman filter with self-adaptive PSO makes the performance of the proposed method superior to the traditional approach. The methods can be individually used for the purpose of signal and parameter estimation, but individually, they suffer from some drawbacks. By combining the three methods into one hybrid method, the pitfalls of each are compensated by the other and hence

**<sup>0</sup> <sup>200</sup> <sup>400</sup> <sup>600</sup> -1**

**Samples**

**<sup>0</sup> <sup>200</sup> <sup>400</sup> <sup>600</sup> <sup>800</sup> <sup>1000</sup> <sup>0</sup>**

**Samples**

**Phase**

**Estimated Phase**

**Desired Signal Estimated Signal**

**0.2 0.4 0.6 0.8 1**

Figure 14. Estimated phase for signal with decaying DC component.

**1**

**-0.5**

Figure 15. Estimated signal with decaying DC component.

**0**

**Estimated signal**

**0.5**

**Estimated phase (rad)**

114 Kalman Filters - Theory for Advanced Applications

Further, the hardware implementation of the proposed method can be attempted for real-time applications [20–23]. The hardware implementation of the proposed method can be embedded within an integrated circuit that will result in a system on chip that can be installed at power distribution centers, from where power gets distributed to the consumers, thus equipping them with a tool for detecting anomalies in power quality before power is dispatched to the


[9] Arghya S, Roy Choudhury S, Sengupta S. A self-synchronized ADALINE network for online tracking of power system harmonics. Elsevier Measurement. May 2011;44(4):784-790. DOI: 10.1016/j.measurement.2011.01.009

[21] Jindapetch N, Chewae S, Phukpattaranont P. FPGA implementations of an ADALINE adaptive filter for power-line noise cancellation in surface electromyography signals.

Kalman Filters for Parameter Estimation of Nonstationary Signals

http://dx.doi.org/10.5772/intechopen.71874

117

[22] Sarita N, Dash PK. A gauss-Newton ADALINE for dynamic Phasor estimation of power signals and its FPGA implementation. IEEE Transactions on Instrumentation and

[23] Sarita N, Dash PK. Field programmable gate array implementation of fuzzy variable step size adaptive linear element for adaptive frequency estimation. IET Signal Processing,

Measurement. 2012;45(3):405-414. DOI: 10.1016/j.measurement.2011.11.004

Measurement, (Early access). 2016. DOI: 10.1109/TIM.2016.2620841

(Available online. DOI: 10.1049/iet-spr.2016.0574


[21] Jindapetch N, Chewae S, Phukpattaranont P. FPGA implementations of an ADALINE adaptive filter for power-line noise cancellation in surface electromyography signals. Measurement. 2012;45(3):405-414. DOI: 10.1016/j.measurement.2011.11.004

[9] Arghya S, Roy Choudhury S, Sengupta S. A self-synchronized ADALINE network for online tracking of power system harmonics. Elsevier Measurement. May 2011;44(4):784-790.

[10] Ray PK, Subudhi B. Ensemble-Kalman-filter-based power system harmonic estimation. IEEE Transactions on Instrumentation and Measurement. December 2012;61(12). DOI:

[11] Sadinezhad I, Agelidis VG. Real-time power system phasors and harmonics estimation using a new decoupled recursive-least-squares technique for DSP implementation. IEEE Transactions on Industrial Electronics. 2013;60(6):2295-2308. DOI: 10.1109/TIE.2012.2192895

[12] Marchesan G, Cardoso Jr G, Mariotto L, Morais AP, Oliveira AL. An adaptive step-size least mean square algorithm for electric power systems frequency estimation in protective relays. 12th IET International Conference on IEEE Developments in Power System

[13] Valtierra-Rodriguez M, Romero-Troncoso R d J, Osornio-Rios RA, Garcia-Perez A. Detection and classification of single and combined power quality disturbances using neural networks. IEEE Transactions on Industrial Electronics. May 2014;61(5). DOI: 10.1109/TIE.

[14] Nanda S, Biswal M, Dash PK. Estimation of time varying signal parameters using an improved Adaline learning algorithm. AEU International Journal of Electronics and Com-

[15] Nanda S, Dash PK, Chakraborty T, Hasan S. A quadratic polynomial signal model and fuzzy adaptive filter for frequency and parameter estimation of nonstationary power sig-

[16] He W, Guo S, Teng Z, Li F, Yang Y. Frequency estimation of distorted and noisy signals in power systems by FFT-based approach. IEEE Transactions on Power Systems. March 2014;

[17] Lee DG, Kang SH, Nam SR. Modified dynamic Phasor estimation algorithm for the transient signals of distributed generators. IEEE Transactions on Smart Grid. March.2013;4(1):

[18] de la O Serna JA, Maldonado JR. Taylor Kalman Fourier filters for instantaneous oscillating Phasor and harmonic estimates. IEEE Transactions on Instrumentation and Measure-

[19] Kingshuk B, Nanda S. An adaptive filtering technique with self-adaptive PSO for estimation of non-stationary signals. 2016 International Conference on Communication and

[20] Cardenas A, Guzman C, Agbossou K. Development of a FPGA based real-time power analysis and control for distributed generation Interface. IEEE Transactions on Power Apparatus and Systems. August 2012;27(3):1343-1353. DOI: 10.1109/TPWRS.2012.2186468

Signal Processing (ICCSP). IEEE, 2016. DOI: 10.1109/ICCSP.2016.7754311

nals. Measurement. June 2016;87:274-293. DOI: 10.1016/j.measurement.2016.03.026

munications. 2014;68(2):115-129. DOI: 10.1016/j.aeue.2013.07.014

ment. April 2012;61(4):941-951. DOI: 10.1109/TIM.2011.2178677

DOI: 10.1016/j.measurement.2011.01.009

Protection (DPSP 2014). DOI: 10.1049/cp.2014.0118

29(2). DOI: 10.1109/TPWRS.2013.2283273

419-424. DOI: 10.1109/TSG.2012.2233772

10.1109/TIM.2012.2205515

116 Kalman Filters - Theory for Advanced Applications

2013.2272276


**Chapter 6**

Provisional chapter

**Kalman Filter Models for the Prediction of**

Kalman Filter Models for the Prediction of Individualised

DOI: 10.5772/intechopen.71205

It is important to monitor and assess the physiological strain of individuals working in hot environments to avoid heat illness and performance degradation. The body core temperature (Tc) is a reliable indicator of thermal work strain. However, measuring Tc is invasive and often inconvenient and impractical for real-time monitoring of workers in high heat strain environments. Seeking a better solution, the main aim of the present study was to investigate the Kalman filter method to enable the estimation of heat strain from non-invasive measurements (heart rate (HR) and chest skin temperature (ST)) obtained 'online' via wearable body sensors. In particular, we developed two Kalman filter models. First, an extended Kalman filter (EFK) was implemented in a cubic state space modelling framework (HR versus Tc) with a stage-wise, autoregressive exogenous model (incorporating HR and ST) as the time update model. Under the second model, the online Kalman filter (OFK) approach builds up the time update equation depending only on the initial value of Tc and the latest value of the exogenous variables. Both models were trained and validated using data from laboratoryand outfield-based heat strain profiling studies in which subjects performed a high intensity military foot march. While both the EKF and OKF models provided satisfactory estimates of Tc, the results showed an overall superior performance of the OKF model (overall root mean

square error, RMSE = 0.31C) compared to the EKF model (RMSE = 0.45C).

Keywords: heat strain, body core temperature, wearable body sensors

© The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and eproduction in any medium, provided the original work is properly cited.

© 2018 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

extended Kalman filter, online Kalman filter

**Individualised Thermal Work Strain**

Si Hui Maureen Lee, Junxian Ong, Poh Ling Tan,

Jia Guo, Ying Chen, Weiping Priscilla Fan,

Thermal Work Strain

Yu Li Lydia Law, Kai Wei Jason Lee and

Kai Wei Jason Lee and Kok-Yong Seng

Jia Guo, Ying Chen, Weiping Priscilla Fan,

http://dx.doi.org/10.5772/intechopen.71205

Si Hui Maureen Lee, Junxian Ong, Poh Ling Tan, Yu Li Lydia Law,

Additional information is available at the end of the chapter

Additional information is available at the end of the chapter

Kok-Yong Seng

Abstract
