UAV Linear and Nonlinear Estimation Using Extended Kalman Filter

Report 3 Downloads 142 Views
UAV Linear and Nonlinear Estimation Using Extended Kalman Filter Abhijit G. Kallapur, Sreenatha G. Anavatti University of New South Wales, Australian Defence Force Academy {a.kallapur, agsrenat}@adfa.edu.au Abstract UAV state and parameter estimation for three dynamic models is presented using techniques of Extended Kalman Filter. Two nonlinear models and one linear model are used for the identification of a small Unmanned Aerial Vehicle (UAV), all of which are derived from a common UAV coupled, dynamic model.

1. Introduction Linear and nonlinear identification of aircrafts has been carried out in various scenarios and conditions [16] with emphasis on the latter considering difficulties in system modeling and estimation. Methods such as Least Squares [5], Gauss-Newton [4] and Kalman Filters [7] have been used successfully for flight parameter estimation, but their performance deteriorates with increasing system nonlinearities. The use of constant gain filter methods to estimate system coefficients have shown satisfactory results for moderately nonlinear systems [8]. However time varying filter methods become essential for systems with higher degrees of nonlinearity [4]. As the number of states and parameters increase it becomes necessary to use single pass estimation methods that can consider augmented systems. Kalman Filters and its variations have this ability. With an increase in the use of Unmanned Aerial Vehicles (UAV) for dangerous and routine missions it becomes imperative to understand their dynamics which can then be used for control design and modeling of the UAV. These are hard to learn from literature as they have not been well documented. This paper presents results derived from the application of Extended Kalman Filters (EKF) for linear as well as nonlinear models based on the formulation of certain UAV coupled, nonlinear dynamics. It also highlights the use of EKF for both state as well as parameter estimation A summary of three UAV dynamic models used for estimation is presented in Section 2 followed by an introduction to the Extended Kalman Filter (EKF) in

International Conference on Computational Intelligence for Modelling Control and Automation,and International Conference on Intelligent Agents,Web Technologies and Internet Commerce (CIMCA-IAWTIC'06) 0-7695-2731-0/06 $20.00 © 2006

Section 3. Section 4 presents results whereas Section 5 concludes with remarks.

2. Dynamics of the UAV The flight data used for identification in this paper is obtained from a 3 Degrees-of-Freedom (DoF) Inertial Measurement Unit designed and built at UNSW@ADFA. This UAV data is highly noisy as can be seen from figures (1) – (3). The identification of states and aerodynamic coefficients is carried out based on the nonlinear model [6] as in equation (1).  I z [ L + ( I y − I z )qr ]+    1 p= I xz [ N + ( I x − I y + I z ) pq −    2 I x I z − I xz    I xz qr ]   1  (1) q = [ M + pr ( I z − I x ) + (r 2 − p 2 ) I xz ]  Iy   I x [ N + ( I x − I y ) pq]+      1 r= I [ L + ( I y − I x − I z )qr +   2  xz I x I z − I xz     I xz pq]   L = L( p, r , δ a , δ r , δ th ) = L p p + Lr r + Lδ δ a + Lδ δ r + Lδ δ th a r th M = M (q, δ e , δ th ) = M q q + Mδ e δ e + Mδ th δth N = N ( p, r , δ a , δ r , δ th )

(2) (3)

(4) = N p p + Nr r + Nδ aδ a + Nδ r δ r + Nδ thδ th Here Ix, Iy, Iz and Ixz represent various moments of inertia whereas p, q, r; L, M, N; represent the angular rates; aerodynamic moments for the roll, pitch and yaw respectively. These aerodynamic moments are modeled as in equations (2) - (4) [6]. Here the terms δ e ,δ r, δ a , and δ th represent the elevator, rudder, aileron and throttle deflections respectively whereas Lp, Lr, Lδa, Lδr, Lδth, Mq, Mδe, Mδth, Np, Nr, Nδa, Nδr, Nδth represent various aerodynamic coefficients that will be referred to as parameters in the rest of the paper.

This paper identifies states and parameters using EKF for three different system models. Case I represents a nonlinear system model as in equation (1); Case II, as described in equation (11), also represents a nonlinear system based on the model described by equation (1) but without the effects of the p2 and q2 terms, whereas Case III represents a linear model as in equation (12), based on the nonlinear model described in equation (1) but without the coupled terms. To understand the effect of the coupling terms (inertial coupling) in equation (1) we present in Table 1 i

the values of individual components of the q equation at two different time steps. Table 1. Effect of various linear and nonlinear i

Time step 28 79

terms on q values M pr(Iz-Ix) -0.003891 -0.000101 -0.002731 0.0012695

2

2

(r - p )Ixz -.0000221 0.0005114

The values in Table 1 indicate the fact that the nonlinear terms do have an effect on the overall value of the equation. All the three system models described by equations (1), (11) and (12) can be represented in the continuous form, •

x (t ) = f ( x , u , t ) where, t represents time and, x(t ) = [ p q r ]T

(5) (6)

u (t ) = [δ e δ r δ a δ th ] (7) The function f varies in all three cases depending upon the type of coupling between the states considered. If fI, fII, fIII are these functions for cases I, II and III, f I will be defined as a function of: T

( pq qr pr p 2 r 2 p q r δ e δ r δ a δ th )

(8)

II

f as a function of:

( pq qr pr p q r δ e δ r δ a δ th )

(9)

III

and f as a function of: ( p q r δ e δ r δ a δth ) (10) The outcome of the estimation process is to estimate the three states p, q, and r along with thirteen parameters Lp, Lr, Lδa, Lδr, Lδth, Mq, Mδe, Mδth, Np, Nr, Nδa, Nδr, and Nδth

International Conference on Computational Intelligence for Modelling Control and Automation,and International Conference on Intelligent Agents,Web Technologies and Internet Commerce (CIMCA-IAWTIC'06) 0-7695-2731-0/06 $20.00 © 2006

 I z [ L + ( I y − I z )qr ]+    p= I xz [ N + ( I x − I y + I z ) pq −    2 I x I z − I xz    I xz qr ]   1  q = [ M + pr ( I z − I x )]  Iy   I x [ N + ( I x − I y ) pq]+      1 r= I [ L + ( I y − I x − I z )qr +   2  xz I x I z − I xz     I xz pq]  

1

p= q= r=

1 2 I x I z − I xz

1 [M ] Iy 1 2 I x I z − I xz

(11)



{ I z [ L]+ I xz [ N ]}

     {I x [ N ]+ I xz [ L]}  

(12)

3. Extended Kalman Filter (EKF) The EKF is a nonlinear estimation filter that uses a blending factor called the Kalman Gain K to reduce the mean-square error of the estimates. The estimation procedure in this paper utilizes an augmented state which is formed by adding parameters to be estimated as additional states [3]. EKF can then be used as a single pass procedure to estimate the states and parameters of the augmented model [4]. The discrete state and observation models considered in this paper are of the form,

xk +1 = f ( xk , u k , wk )

(13) z k = h ( xk , vk ) with the process and observation noise presented by wk and vk respectively. The augmented state vector consists of three states and thirteen parameters as described in equation (14). x = [ p q r L p Lr Lδ r Lδ a N p N r Nδ r T

Nδ a M q M δ e M δ th Lδ th Nδ th ]

(14)

The system described by (13) which is generally nonlinear is approximated to a first order linear form about the trim condition [4]. This linearization should provide a precise model so that the estimated values are as close as possible to the real values for the estimation to converge. The linearization process is not necessary for Case III described in the previous section as it represents a linear model. The linearization in case

∂x x = x^ + k

∂h ∂x x = x^ − k

(15)

where the superscripts (^), (-) and (+) denote an estimate, apriori value and posteriori value respectively. The linearized matrix Fk is then discretized to the second order as, ( F ∆t ) 2 F = exp( Fk ∆t ) ≈ I + ( Fk ∆t ) + k (16) 2! Since the measurements in our case consist of the three states p, q and r, the measurement sensitivity matrix Hk is time invariant and hence considered a constant. It is described as, H = [ I 3x 3 |03x13 ]

(17) where I is the identity matrix and ‘0’ is a zero matrix. Initial estimates of states, parameters and error covariance (P) are necessary for the estimation process to converge. The initial estimates for various states and parameters were decided upon engineering judgment whereas the diagonal error covariance matrix values represented confidence levels in the corresponding initial estimates. The error covariance values for the states were set to the corresponding measurement error variances whereas those for the parameters were set to a high value [3, 4]. The EKF estimation process consists of two sets of operations namely Estimation and Correction. Estimation involves propagating the states and covariance to the next time step using the present knowledge of the system as described by equations (18) -(19). The correction step that is needed to reduce the error in estimation based upon the current measurement is as given in equations (20) - (22).

4. Results This section provides results from EKF state and parameter estimation. Matlab© Simulink was used to carry out the numerical simulations. The state estimation results for cases I, II and III are as in Figures (1), (2) and (3) respectively. Table 1 compares the Root Mean Square Error (RMSE) values for all the three cases. Noisy flight data

K k = Pk H

T

T



( H Pk H + Rk ) −

x^ k = x^ + K k ( z k − H x^ k ) k

+

30

40

50

60

10

20

30

40

50

60

10

20

30 time (s)

40

50

60

0.5 0 -0.5 0 0.5 0 -0.5 -1 0

Figure 1. State estimation results for Case I

Noisy flight data

EKF

1 0 -1 0

10

20

30

40

50

60

10

20

30

40

50

60



Pk = ( I − K k H ) Pk

−1

(20)

10

20

30 time (s)

40

50

60

(21) (22)

In spite of EKF being a good nonlinear estimator that can simultaneously estimate states as well as

International Conference on Computational Intelligence for Modelling Control and Automation,and International Conference on Intelligent Agents,Web Technologies and Internet Commerce (CIMCA-IAWTIC'06) 0-7695-2731-0/06 $20.00 © 2006

q (rad/s)

0.5 0 -0.5 0

(19)

T



+

20

1

0.5 r (rad/s)

+

(18)

Pk = F Pk F + Qk −

10

1

x^ k− = f ( x^ k+−1 , u k −1 , t k −1 ) Correction Equations:

0 -1 0

Estimation Equations:



EKF

1 p (rad/s)

Hk =

q (rad/s)

∂f

r (rad/s)

Fk =

parameters of time-variant, unstable systems [2] its performance strongly relies upon the initial estimates and the degree of nonlinearity of the system under consideration.

p (rad/s)

of nonlinear models is carried out by applying Jacobians as in equation (15),

0 -0.5 -1 0

Figure 2. State estimation results for Case II

nonlinear model for the case of a UAV as presented here.

Table 2. Comparison of RMSE q-RMSE

Case I

0.1576268

0.0475917

0.0300283

Case II

0.1576288 0.1576341

0.0475931

0.0300273

0.0476389

0.0300639

Noisy flight data

EKF

1

10

20

30

40

50

60

1 0.5

Case III

10

20

30

40

50

60

10

20

30

40

50

60

10

20

30

40

50

60

10

20

30

40

50

60

10

20

30

40

50

60

-0.5 0

10

20

30

40

50

60

10

20

30 time (s)

40

50

60

N da

0 10

20

30

40

50

60

N dth

q (rad/s)

Case II

Mq

0 -1 0

0.5 r (ras/d)

0 -2 -4 0 10 0 -10 0 0.5 0 -0.5 0 5 0 -5 0 1 0 -1 0 2 0 -2 0 0.2 0 -0.2 0

M de

p (rad/s)

Case I

Ldr

Case III

r-RMSE Lp

p-RMSE

Lr

Model

0 -0.5 -1 0

10

20

30 time (s)

40

50

60

Figure 4. Comparison of seven parameters for the three cases

Figure 3. State estimation results for Case III Case I

5. Concluding Remarks A comparison of EKF state and parameter estimation was presented for two nonlinear and one linear case, all based on the basic model described in equation (1). Since the use of EKF has resulted in similar results for the linear as well as nonlinear models with the same fidelity, the former can be used for identification and henceforth for control design, as control design procedures are better established in case of linear systems. Moreover, considering loss of accuracy to be negligible the linear model can be used instead of a

International Conference on Computational Intelligence for Modelling Control and Automation,and International Conference on Intelligent Agents,Web Technologies and Internet Commerce (CIMCA-IAWTIC'06) 0-7695-2731-0/06 $20.00 © 2006

Case III

Lp

-1.25

-1.35

-1.45 21

22

23

24

25

26

27

28

29

30

21

22

23

24

25 time(s)

26

27

28

29

30

-0.3 -0.4 Lr

From the RMSE values of Table 2 it is clear that the EKF state estimation for all three cases is identical. However, owing to the fact that nonlinear coupling terms do have an effect on the estimation process there are slight differences in the RMSE values. The EKF computes the estimates by linearizing the nonlinear models to the first order, which in our case is not significantly different from the linear model. Figure 4 presents estimation results for seven of the thirteen parameters namely Lp, Lr, Lδr, Mq, Mδe, Nδa and Nδth. The remaining parameters exhibited similar trends. In order to emphasize the difference in parameter values estimated for linear as well as nonlinear models, these values for Lp and Lr for cases I and III are presented in a zoomed-in version in Figure 5.

-0.5 -0.6 -0.7 -0.8

Figure 5. Comparison of Lp and Lr for the Case I and Case III

6. References [1] E.A. Morelli, System identification Programs for aircraft (SIDPAC). in AIAA Atmospheric Flight Mechanics Conference. 2002. Monterey, Canada. [2] M. E. Campbell, S.B. Nonlinear Estimation of Aircraft Models for On-line Control Customization. in IEEE Aerospace Conference. 2001. Big Sky MT.

[3] M. Curvo, Estimation of aircraft aerodynamic derivatives using Extended Kalman Filter. J. Braz. Soc. Mech. Sci., 2000. 22(2): p. 133-148. [4] R. V. Jategaonkar, E. Plaetschke, Algorithms for AircraftParameter Estimation Accounting for Process and Measurement Noise. Journal of Aircraft, 1989. 26(4): p. 360372. [5] K.W. Iliff, Parameter Estimation for Flight Vehicles. Journal of Guidance, Control and Dynamics, 1989. 12: p. 609-622. [6] S. A. Salman, S. G. Anavatti, J. Y. Choi, Attitude dynamics Identification of Unmanned aircraft vehicle.

International Conference on Computational Intelligence for Modelling Control and Automation,and International Conference on Intelligent Agents,Web Technologies and Internet Commerce (CIMCA-IAWTIC'06) 0-7695-2731-0/06 $20.00 © 2006

International Journal of Control, Automation, and Systems (IJCAS), December 2006. [7] R. W. Johnson, S. Jayaram, L. Sun, J. Zalewski. Distributed Processing Kalman Filter for Automated Vehicle Parameter Estimation - A Case Study. in Proceedings IASTED Int’l Conf. on Applied Simulation and Modeling. 2000. [8] R. V. Jategaonkar, E. Plaetschke, Identification of moderately nonlinear flight mechanics systems with additive process and measurement noise. Journal of Guidance, Control, and Dynamics, 1990. 13(2): p. 277-285.