xx, k ; ffiffiffiffiffiffiffiffiffi wc 0 � � � � q X∗ 0, k � xb� k � �

� � � �

db θk, j ;…; dXk,m db θk,j � �

SQ, k

� � � �

P� xx, k � � s

� �, and T ¼ 0l�l 1 ;…; 0l�l nθ ;I

N ð Þ nx

,

; sign wc 0

,

� �T � � � �

nθ ⨂ Φ∗

ÞEð Þ nx and

k � cX � k ⨂ m2

. Further details of the construction of the matrix N ð Þ nx and the elimination matrix Eð Þ nx can be found in [28]

� �T � �

l � �

Pxx, k ¼ dPxx, k dθk

84 Kalman Filters - Theory for Advanced Applications

Pxx, 0 ¼ Sxx, 0ST

derivatives Φk�1,j ¼ Φk�1, 1,j;…; Φk�1,l,j

k,j,i ¼ ∂f ∂xk � � � Xk�1 ,θ^ k�1

xx, k ¼ qr ffiffiffiffiffiffi wc 1 p X∗

xx, k ¼ cholupdate S�

xx, k ¼ treshapeM I

þ Wc kr⨀ X∗ k � xb� k ⨂ m2 � � T ð Þl I

in which T ð Þl ¼ I

k � X c� k ⨂ m2 � �

> 0 ; T1;…; Tnθ

with Xb k�1 ¼ dx^k�1 dθ^k�1

xb� k ¼ X∗ k wm ð ÞT

S�

S�

c� k ¼ Φ∗ k I nθ ⨂ wm ð ÞT � �

S�

with Als,S� xx, k ¼ S� xx, k ⨂ I nx þ I

P� xx, k ¼ Φ∗

k ¼ f Xk�1; θb k�1; uk�1 � � dθk

� �

¼ Xb k�1,j

, Sxx:k ¼ dSxx, k dθk

, Θk ¼ Θinit ∈ Rnθ�nθ

, Δk ¼ 0 ∈ Rny�ny ,

Xb k�1,j ⨂ m1 þ ηSxx, k�1,jXb k�1,j ⨂ m1 � ηSxx, k�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 Kk ¼ Pxy, k=ST

SM Kalman gain derivative Kk ¼ Pxy, k= I

A posteriori state sensitivity Xb þ

Derivative of estimation error covariance update

RPEM Parameter and covariance estimation

A posteriori state estimate x

Output sigma points Yk ¼ h X�

Estimated measurement byk ¼ Yk wm ð ÞT

SM Sigma-points derivative Φk,j ¼ Φk, 1,j; …; Φk,l,j

Output sensitivity byk ¼ Ψk I

Cross-covariance matrix Pxy, k ¼ Wc

k ¼ ðXk, 1; …; Xk,lÞ ¼ x

k ; θbk�1; uk � �

nθ ⨂ wm ð ÞT � �

wc 1 p Y1:2nx , k � byk � � SR, k � � � � ,

kr⨀ Yk � byk ⨂ m2

Ψk ¼ Ψk, 1; …; Ψk,nθ ð Þ

Syy, k ¼ cholupdate Syy, k;

Syy, k ¼ treshapeM I

Pyy, k ¼ Ψk � byk ⨂ m2 � � I

þWc

þWc

yy � �

> k þ Kk yk � byk � �

Pxy, k ¼ Φk � Xb �

for z ¼ 1 to ny do Sxx, k ¼ cholupdate S�

with Uk ¼ KkSyy, k

Sxx, k ¼ treshapeM I

Sk ¼ λΔk þ bykΘk�1ybT

nθ � Lkbyk � �Θk�1 I

k ¼ Xb �

Pxx, k ¼ P�

Lk ¼ Θk�1 ybT

θbk ¼ θbk�1 þ Lkek:

Table 2. aSRUKF: filter correction step and the RPEM for parameter and covariance estimation.

Θk ¼ I

bþ k ¼ x b�

Als,Syy, k ¼ Syy, k ⨂ I

Syy, k ¼ qr ffiffiffiffiffiffi

Ψk,j,i ¼ ∂h ∂xk � � � X� k ,θb k�1

� � ¼¼ Xb k,j

Φk,j,i þ ∂h ∂θk,j � � � X� k ,θb k�1

with

ffiffiffiffiffiffiffiffiffi wc 0 � � � � q

� �T � �

� �

ny ⨂ Syy, k � �N ð Þ ny

> nθ ⨂ Wc kr � �T

� � Xk � x

nθ ⨂ A† ls,Syy, k � �

� �

I nθ ⨂ Wc kr � �T

xx, k; Ukð Þ :; z ,

� � � Pxy, k=Pyy, k

nθ ⨂ A† ls,S� xx, k � �

� �,

nθ � LkybT k � �

� �

0 �0

nθ ⨂ yk � byk

� �

nθ ⨂ KT k � � � Pxy, k I

� � Pyy, k= I

ð Þ Pxx, k s

=λ þ LkΔkLT k ,

ny þ I

kr⨀ Yk � byk ⨂ m2 � � T ð Þl I

k ⨂ m2 � �

> kr⨀ Xk � x b� k ⨂ m2 � � T ð Þl I

> > =Syy, k

nθ ⨂ Pyy, k

xx, k � Pxy, kT ð Þ ny I

k ,

Δk ¼ Δk�1 þ ð Þ 1 � λ ekeT � Δk�1

k S�1 k ,

k � Kkbyk þ Kk I

Y0, k � byk � �; sign wc

> b� k ⨂ m2

Pyy, k � � s

� � � �

b � k xb�

k ⨂ m1 þ ηS�

xx, kxb�

Xb k,j ⨂ m1 þ ηS�

k ⨂ m1 � ηS�

xx, k,j

0

, with

ÞEð Þ ny and

⨀ Yk � byk ⨂ m2 � �T � � � �

> nθ ⨂ Ψk � byk ⨂ m2 � �T � �

⨀ Yk � byk ⨂ m2 � �T � � � �

> nθ ⨂ Ψk � byk ⨂ m2 � �T � �

> > nθ ⨂ Pyy, k � � � �

� � � � (d)

nθ ⨂ KT k � �

, with

� � (b)

� � (a)

xx, k�1

Xb k,j ⨂ m1 � η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 (x1 ¼ q1) and the link speed (x2 ¼ q\_1Þ. The input u corresponds to the motor torque (u ¼ τm). The measurements are the link angular position (y1 ¼ q1) and acceleration (y2 ¼ 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 (μd 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

¼ q€ ¼ q€1

1

q€2 � �

Figure 2. Pendubot: structure and functionality.

� � ¼ μdarctan k q\_1

D qð Þ¼

g qð Þ¼

where the ϑi parameters are defined as

0 B@

C qð Þ¼ ; q\_ ϑ3 sin q2

0 @

¼ D qð Þ�1 τm � μv1

q\_ 1 � 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

� �

2 �q\_

q\_1 0

ϑ5 g cos q1 þ q2

1 þ ð Þ m2 þ m3 þ m4 l

� �

Sensitivity-Based Adaptive SRUKF for State, Parameter, and Covariance Estimation on Mechatronic Systems

1 � q\_ 2

� � þ ϑ5 g cos q1 þ q2

� �

1 A,

� �

2 2 þ J1,

� D qð Þ�1

� �.  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 x1 ¼ q1, x2 ¼ q\_ 1, x3 ¼ q2, and x4 ¼ q\_ 2, where qi and q\_ i 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 (x1 ¼ q1) and the link speed (x2 ¼ q\_1Þ. The input u corresponds to the motor torque (u ¼ τm). The measurements are the link angular position (y1 ¼ q1) and acceleration (y2 ¼ q€1). The matrix A and the vector-valued functions b and c are

0

mal2 2 Jtot

arctanð Þ� k x2

where Jtot represents the total inertia including motor, shaft and link inertias. The link friction is modelled as a dry Coulomb (μd 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\_ ð Þ2

0

0

BBBBB@

0

b xð Þ¼ ; u 0 x\_ 2 0 x\_ ð Þ 4

1, x3 ¼ q2, and x4 ¼ q\_

T ,

0 1 00 0 0 00

0

1

1

CCCCCA ,

0

T ,

0

0

0

x1

sin ð Þþ x1

mal2 g 2 Jtot

τm Jtot 1 CA,

sin ð Þþ x1

τm Jtot

2, where qi and q\_

i 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 x1 ¼ q1, x2 ¼ q\_

of the pendubot can be written as

0 @

0 B@

0 B@ 0 1 0 � μv Jtot

� μd Jtot

� μv Jtot 1 A,

arctanð Þ� k x2

x2 � μd 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 � � ¼ μdarctan k q\_1 � �. The matrices D qð Þ and C qð Þ ; q\_ 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 ϑi 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

θinit ¼ 2∙10�8

Q ¼ q22 ¼ 5∙10�5

true values multiply by a random factor between 0 < θfactor,i ≤ 10 as

sensitivity provided an almost noise-free estimation. While the SAJ

, R ¼ diag 5∙10�7 2∙101 � � � � ,

, Θinit ¼ diag 5∙10�13 10�1 10�6 10�4 10�8 � � � � :

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 θi values. This means that the first value tunes the estimation of θa (process covariance value), the second value tunes θ1 (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 q1 ¼ π=2 after ca. 11 s for about 4:5 s. At the same time, the system parameters μbv, μbd, and mb a

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\_ 1Þ 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μv maxima coincided with the link maximal speed. The SAmal2 was only zero while the arm was crossing the 0 rad position and the SAμd 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 μv diverged). Because of the added noise, the parameter was excited and could be identified. This can be seen in the fourth

rad2 1:5 1=bJtot � � 3μbv 8μbd 0:25 mb a

� � � � T

bl2

�1

tot maxima were related

:

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

91

The parameters J1 and J2 correspond to the moments of inertia of link 1 and link 2 about their centroids. J1 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:

3 The function diagð Þ v transforms the v∈ Rn vector into a ð Þ n � n square matrix with the elements of v on the diagonal of the matrix.

The remaining tuning factors for SB-aSRUKF were set as

ϑ4 ¼ m1l1 þ ð Þ m2 þ m3 þ m4 l2,

The parameters J1 and J2 correspond to the moments of inertia of link 1 and link 2 about their centroids. J1 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

Q ¼ diag 10�11 5∙10�5 � � � � 3

R ¼ diag 5∙10�7 5 � � � � ,

were added to the simulation to incorporate model and measurement uncertainties. An s-

θa ¼ q11 ! process covariance value related to the link ang:pos: � �,

The function diagð Þ v transforms the v∈ Rn vector into a ð Þ n � n square matrix with the elements of v on the diagonal of

kg m2 0:05 N m s

� �T

,

rad 0:27 N m 0:11 kg m 10 s

rad

,

ϑ5 ¼ m2l3 þ m4l4:

4.1. State sensitivity analysis and parameter and covariance estimation

¼ 5:59∙10�2

curve profile was considered as a desired link angular position.

θ1 ¼ μv ! viscous friction coefficient, θ2 ¼ μd ! Coulomb friction coefficient,

tot ! inverse inertia:

x1 ¼ q1 ! link position, x2 ¼ q\_1 ! link speed,

The following system states, parameters and covariances were estimated:

4. Experiments

analysis is also discussed.

θbtrue¼ bJ tot μbv μbd mb a

Method. The parameters defined as

90 Kalman Filters - Theory for Advanced Applications

� �T

θ3 ¼ J �1

3

the matrix.

bl2 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 θi values. This means that the first value tunes the estimation of θa (process covariance value), the second value tunes θ1 (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 q1 ¼ π=2 after ca. 11 s for about 4:5 s. At the same time, the system parameters μbv, μbd, and mb a 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\_ 1Þ 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μv maxima coincided with the link maximal speed. The SAmal2 was only zero while the arm was crossing the 0 rad position and the SAμd 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 μv 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 π=2 after ca. 11 s for about 4:5 s. The parameter sensitivities are related to the link angular speed (bx2 ¼ bq\_ 1Þ.

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

θa ¼ q11 ! process covariance related to the link 1 ang:pos: � �, θb ¼ q33 ! process covariance related to the link 2 ang:pos: � �,

The values θa 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

Q ¼ diag 2∙10�10 1:5∙10�7 2∙10�10 1:5∙10�7 � � � � ,

ϑ1, …, ϑ5 ! pedubot minimal set of parameters:

covariance matrices were added to the system for the simulation:

R ¼ diag 5∙10�7 5∙10�7 1 � � � � :

parameters were estimated online:

and remained constant for both filters.

x1 ¼ q1 ! link 1 position, x2 ¼ q\_1 ! link 1 speed, x3 ¼ q2 ! link 2 position, x4 ¼ q\_2 ! link 2 speed,

4:5 s, and simultaneously the system parameters μb v , μbd, and mb a 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 4:5 s, and simultaneously the system parameters μb v , μbd, and mb a 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 π=2 after ca. 11 s for about 4:5 s. The parameter sensitivities are related to the link angular speed (bx2 ¼ bq\_ 1Þ.

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

¼ 0:339 kg m2 0:0667 kg m2 0:0812 kg m2 0:717 kg m 0:146 kg m � �T

rad 10 s rad

:

rad 0:226 N m 0:003 N m s

� �

,

4.2. Comparison between SB-aSRUKF and joint state and parameter SRUKF

The system parameters were identified offline and used for the simulation as

¼ 0:09 N m s

parameter true value.

92 Kalman Filters - Theory for Advanced Applications

θbtrue ¼ ϑb1 ϑb2 ϑb3 ϑb4 ϑb5

� �T

μbv1 μbd μbv2 bk � �

and did not modify the convergence time of the filter.

estimation. The SB-aSRUKF identified also covariances.

The values θa 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,

� �T

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 1 1:3 ϑb2 1:5 ϑb3 2 ϑb4 2 ϑb5

θinit2 ¼ 2∙10�10rad2 2∙10�10rad2 θinit1 ð ÞT � �T

The first four values of P01 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 θa and θb while the last values follow the index order of ϑi 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 ϑ1 to ϑ5 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 ϑ4 and

ϑ5 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.

Q01 ¼ diag 2∙10�10 1:5∙10�7 2∙10�10 1:5∙10�7

10�7 10�7 10�7 5∙10�10 10�10 ÞÞ,

R01 ¼ diag 5∙10�7 5∙10�7 10 ,

α ¼ 0:85, β ¼ 2, κ ¼ 3 � nx � np,

P01 ¼ diag 1 1 1 1 10�3 10�5 10�5 5 1 ,

Q02 ¼ diag 1:5∙10�7 1:5∙10�7 , Pxx,02 ¼ I

R02 ¼ diag 5∙10�7 5∙10�7 10 ,

α ¼ 0:85, β ¼ 2, κ ¼ 3 � nx, λ ¼ 0:999,

Θinit ¼ diag 10�25 10�25 10�7 10�7 10�7 5∙10�10 10�10 :

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 P01 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 θa and θb while the last values follow the index order of ϑi 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 ϑ1 to ϑ5 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 ϑ4 and ϑ5 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 ϑ1 to ϑ5 parameters without bias, the joint SRUKF estimated ϑ1 to ϑ3 with slight bias, and it was not able to estimate ϑ4 and ϑ5. These two parameters did not converge to the true system values. It should be noted that the diagram scales corresponding to parameters ϑ4 and ϑ5 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<EMAIL_ADDRESS>
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 ϑ1 to ϑ5 parameters without bias, the joint SRUKF estimated ϑ1 to ϑ3 with slight bias, and it was not able to estimate ϑ4 and ϑ5. These two parameters did not converge to the true system values. It should be noted that the diagram scales corresponding to parameters ϑ4 and ϑ5 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<EMAIL_ADDRESS>
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

dt2 and m3 ¼ d3Q ið Þ

Now we can obtain the amplitude and phase angle of the described given sinusoid using

q

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi m2 0 þ n2 0

dt2 and n3 ¼ d3R ið Þ

ba ¼

1 2π d

2 þ … and R iðÞffi n0 þ n1i þ n2i

dt3 at k = 0.

dt3 at k = 0.

ϕb ¼ arctanð Þ n0=m0 (6)

dtð Þ¼ θð Þi f 0 þ

v iðÞ¼ A ið Þ: cos iωðÞþi ϕð Þi � � þ κð Þi (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)

2 Now let us represent θðÞ¼ i 2πfidt þ

dt ϕð Þi � � (2)

2 þ … (4)

(5)

the error covariances in order to achieve fast convergence.

is an additive white noise with unknown variance σg

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 m0 þ m1i þ m2i

dt at k = 0; m2 ¼ d2Q ið Þ

dt at k = 0, n2 ¼ d2R ið Þ

f ¼ 1 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

m0 ¼ Qð Þ0 , m1 ¼ dQ ið Þ

n0 ¼ Rð Þ0 , n1 ¼ dR ið Þ

Eq. (3) and (4) as follows at k = 0:

where m0 ¼ 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 σg 2 Now let us represent θðÞ¼ i 2πfidt þ ϕð Þ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 m0 ¼ 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:

χ ^ ðÞ¼ i χ ^ �

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 ¼ sin 2πf 0idt � �idt sin 2πf 0idt � �

Using Eq. (19) the updated state estimate can be obtained from the following equation

ð Þþ i � 1 K ið Þ Si � Hχ

T HP i bð Þ � 1 i

χ 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χi þ vi (17)

cos 2πf 0idt � �idt cos 2πf 0idt � � " # (18)

Ei ¼ S � Hiχbð Þi (19)

� � (20)

^ ð Þi

HT i þ r

P i bðÞ¼ P i bð Þ� � 1 KiHiP i bð Þ � 1 (22)

P i bð Þ¼ þ 1 P i bðÞþ q (23)

� ��1

(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

n0 ¼ Að Þ0 : sin ϕð Þ0 (7)

dt Að Þ0 : cos ϕð Þ0 � � (8)

dt Að Þ0 : sin ϕð Þ0 � � (9)

Yi ¼ a: sin iωTS þ ϕ � � þ nk (12)

χi þ ηi (13)

(10)

(11)

(15)

Similarly for estimating the frequency of the given sinusoid, consider Eq.(4) at k = 0, the first

dt ϕð Þ0 � � ¼ m0n1 � n0m1 m0 þ n0

> m0n1 � n0m1 m0 þ n0

� �

m1 ¼ d

n1 ¼ d

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 i

χið Þ¼ 1 m0; χið Þ¼ 2 m1; χið Þ¼ 3 m2; χið Þ¼ 4 n0; χið Þ¼ 5 n1; χið Þ¼ 6 m2 (14)

bf ¼ f 0: þ

signal, respectively, and nk represents measurement noise with a covariance R.

χ ^ �

f i ¼

We can represent the state space Eq. (10) of the discrete signal as:

By substituting Eq. (7) 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 b1rnd1 pbesti

K ¼ 2

αð Þ¼ 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:

∣2 � b � ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

1 þ e

ð Þ� k xið Þk � � þ b2rnd2 gbesti ð Þ� k xið Þk � � � � (29)

where α is the inertia weight factor, b1 and b2 are the acceleration constants, rnd1 and rnd2 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: φð Þ¼ k ∣ gbesti � xið Þk � �= pbesti � xið Þk � �∣. The

αinitial � αfinal

c1ð Þ¼ k c1φ�1

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

φð Þk ð Þ k�ð Þ ð Þ 1þln ð Þ φð Þk Lmax =μ

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

b2 � 4b∣ p , and b ¼ b1 þ b2; b > 4 (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 λg 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, b1 and b2 are the acceleration constants, rnd1 and rnd2 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: φð Þ¼ k ∣ gbesti � xið Þk � �= pbesti � xið Þk � �∣. 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 λg 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ð Þ ið Þ k þ 1 < F pbesti

gbest kð Þ¼ min C::F pbest0ð Þk � �; C::F pbest1ð Þk � �;C::F pbest2ð Þk � �; :…;C::F pbestsð Þk � �; � � (28)

ð Þk , if F xð Þ ið Þ 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

ð Þ¼ k þ 1 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

F ¼ 1 L X L

r iðÞ¼ λgð Þ r þ ð Þ E ið Þ ^2 (25)

i (26)

th instance of time. The personal

(27)

ð Þk � �

ð Þk � �

(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 iωð Þt dt þ ϕð Þi � � þ 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ðÞ¼ 50 Hz, i < 500samples 51 Hz, i > 500samples �

> 0:5 rad 0: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 s ¼ 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 s ¼ 2kHz ϕðÞ¼ i 0:5 rad 0: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<PHONE_NUMBER>**

**0 200 400<PHONE_NUMBER>**

**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 sðÞ¼ i 4kHz ϕ1 ¼ 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ðÞ¼ a1ð Þi sin iωð Þi dt þ ϕ1ð Þi þ 0:8ð Þi sin ð Þ i3ωð Þi dt þ 0:4

þ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

ϕ1 ¼ 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 sðÞ¼ 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<PHONE_NUMBER>**

**Frequency**

**Estimated Frequency**

**Amplitude**

**Estimated Amplitude**

**Samples**

**450 200 400 600 800 1000**

**Samples**

y iðÞ¼ a ið Þ sin iωð Þt dt þ ϕð Þi þ 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 s ¼ 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<PHONE_NUMBER>**

**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 Φ1 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

Φ3 0.006 0.04 0.032 0.0005 Φ5 0.024 0.045 0.054 0.007 Φ7 0.005 0.076 0.072 0.002 Φ11 0.03 0.085 0.088 0.0019 Φ19 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 s ¼ 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<EMAIL_ADDRESS>
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<EMAIL_ADDRESS>
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

**0 200 400 600 -1**

**Samples**

**0 200 400 600 800 1000 0**

**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