Académique Documents
Professionnel Documents
Culture Documents
1, JANUARY 2014
495
I. I NTRODUCTION
496
is a matrix.
is the estimated state, and P
In the following, z
The algorithm is made of two steps:
1) the continuous prediction step, for t [tk1 , tk ]
d
z
= A(u)
z + b(
z, u)
dt
dP
+P
(A(u) + b (
= (A(u) + b (
z, u)) P
z, u))T + QG
dt
(3)
where
k1
k1 ) = P
P(t
k)
= P(t
P
k
(tk1 ) = z
k1
z
(tk )
z
k =z
B. ContinuousDiscrete AEKF
(2)
0 i,2 (u)
0
...
0
..
.
i,3 (u) . .
.
.
..
..
Ai (u) = .
.
.
0
i,nx,i (u)
0
...
0
bi,1 (
zi,1 , u)
zi,1 , zi,2 , u)
bi,2 (
..
.
bi (z, u) =
.
zi,1 , . . . , zi,nx,i 1 , u)
bi,nx,i 1 (
bi,nx,i (z, u)
While the other bi,j () cannot, the subvector field components
of the form bi,nx,i ()can depend on the full state; see, e.g., [8].
Ck is a (ny nx ) matrix for which the ith row is composed of zeroes except for the element at index (nx,1 + nx,2 +
+ nx,i1 + 1), which equals i,1 (u)i.e., a measurement
is the first element of a subvector up to multiplication by a
u-dependent function.
CT (Ck P
CT + RG )1
Kk = P
k k
k k
k = z
k + Kk y(tk ) Ck z
z
k)
k = (Id Kk Ck )P
P
k
Id,k =
(ti ))2Rny
(ti ti1 ) (y(ti ) y
i=m+1
Gk = F(Gk1 , Id,k ).
(4)
SEBESTA AND BOIZOT: REAL-TIME AEKF, APPLIED TO A QUADCOPTER INERTIAL NAVIGATION SYSTEM
497
TABLE I
QUADCOPTER PHYSICAL CONSTANTS
Fig. 1.
Quadcopter diagram.
Discussions on the observability of general asynchronous systems and derivation of an adequate AEKF will be treated in
future works.
,
)
T and body angular velocity = (1 , 2 , 3 )T is ob(,
tained by inverting the relation [28]
1
0
sin()
III. M ODELING
While more complex models exist for components such as
rotor blades [24] or the effects of wind [25], the authors have
opted to use a model that takes into account only the kinematic
inertia and idealizes the propulsion units as perfect propellers
[26]. This decision is justified by the desire to first and foremost
examine the AEKF approach and capabilities.
Fig. 1 shows a diagram of a quadcopter. Contrary to much
of the literature, the authors have set the positive rotation sense
to be the same for all motors and for the quadcopter heading.
This facilitates future work where individual rotors can change
direction and/or pitch sufficiently to push or pull [27]. For space
reasons, the model is presented in brief. Readers interested in its
derivation may refer to [2], [12], and [14].
As is common in the aerospace field [28], the world frame
is attached to some arbitrary reference point in 3-D space,
with its axes oriented in the north, east, and down (NED)
directions. The body frame is attached to the quadcopter center
of mass. The xyz-directions are along branches 1 and 2 of the
quadcopter and downward (cf., Fig. 1). The SO(3) rotation from
the body to world frame is parameterized by the use of three
successive plane rotations: roll (), pitch (), and yaw (), also
known as the TaitBryan rotation [29]. The associated matrix
representation, where c denotes cos() and s denotes sin(), is
c c s s c c s c s c + s s
R = c s s s s + c c c s s s c . (5)
s
c s
c c
The quadcopter state derives from the full SE(3) representation, modified in order to permit a clean one-to-one invertible
transformation between the original (i.e., physical) coordinates
and the normal form coordinates (cf., Sections II-A and IV).
Thus, the and states are represented by their sines and
cosines.
With the aforementioned discussion in mind, the state
vector is defined as x = (x, y, z, x,
y,
z,
cos , sin , , cos ,
sin , 1 , 2 , 3 )T .
The dynamic model for the 3-D translations (x, y, z)T is
obvious, and the relationship between Euler angle speeds
(7a)
u1 = b 21 + 22 + 23 + 24
2
2
(7b)
u2 = b 2 4
(7c)
u3 = b 23 21
4
u4 = i=1 (motor,i )
(7d)
(8)
motor,i = sign(i )2i d.
Finally, b, d, L, Ir , M , Ixx , Iyy , and Izz are physical model
constants. They are detailed in Table I, and values for the
experimental quadcopter platform are provided.
Note 1: Henceforth, x refers to the elements of the x
state vector, instead of the xyz 3-D coordinates (i.e., x8 =
sin ).
The dynamic model is thus
x4
x5
x6
g + (x7 cos(x9 )) u1 /M
x7 x13 x8 x14
498
where = 4i=1 |i |. Gravity g is assumed to be constant
and equal to 9.803 m/s2 .
The experimental quadcopter is equipped with a GPS, a
three-axis accelerometer, a three-axis gyroscope, a three-axis
magnetometer, and a barometric pressure sensor.
The GPS and barometric sensor provide measurements for
x1 , x2 , and x3 . The accelerometer measurements, denoted a1 ,
a2 , and a3 in accordance with Fig. 1, are derived into model
outputs by using the following steady-state equation, which
assumes that the quadcopter is not undergoing an external force
aside from gravity
0
a1
a2 = (R )T 0 ( r)
(10)
g
a3
where r is the vector from the quadcopters center of gravity to
the accelerometer. The gyroscope gives , and the accelerometer is assumed to be at the center of gravity, so r = 0.
Finally, with (mN , mE , mD )T being the locally constant
earth magnetic field vector in the NED frame, this yields
mN
mag1
mag2 = (R )T mE .
(11)
mag3
mD
It is instructive to discuss the following situation regarding
the observability normal form. Remark that six equations are
needed to account for the T(3) position and the derivative
in NED frame. The corresponding measurements come from
the GPS and the barometer, leaving nine measurements still
available. Recall from Section II-A that, in this representation,
one output variable corresponds to at least one component of
the state. Hence, the use of all the measurements implies a
15-dimension state at a minimum for a normal form that uses
all the outputs.
A first option is to treat x9 = in the same way as and .
This solution removes all sine-related nonlinearities from the
observers inner algorithm. Another option is to estimate the
extra parameters.
A third option, the one chosen for this paper, is to use only
two magnetometer measurements, denoted maga and magb , and
a 14-dimension state which lessens the observers computational demand. The measurement model is therefore
x1
x2
x3
g sin(x9 )
gx8 cos(x9 )
y = gx7 cos(x9 ) .
maga
magb
x12
x13
x14
(12)
z1 = x 1
z8 = x8 cos(x9 )
=
x
z9 = x7 cos(x9 )
z
2
4
z10 = maga
z3 = x 2
z11 = magb
(13)
= z4 = x 5
z
=
x
z
=
x
5
3
12
12
z13 = x13
z6 = x 6
z7 = sin(x9 ) z14 = x14
brings the model into a normal form. The analysis shows that,
in order to avoid nonobservability when the UAV is level, mag1
from (11) must be present in the output. Consequently, set
maga = mag1 and magb = mag2 . Conversely, the transformation given in (14) brings the model back into the physical
coordinates
x 1 = z1
x 8 = z8 2
1z7
x 2 = z3
x9 = arcsin(z7 )
=
z
x
=
z
x
5
4
12
12
x 6 = z6
x13 = z13
x7 = z9 2 x14 = z14
1z7
where the complete expressions for x10 and x11 are given in
(15), shown at the bottom of the next page.
As is clear from the expressions of x7 , x8 , x10 , and x11 ,
this transformation is valid for (/2, /2) and as long
as = /2. Also, remark that taking into account only two
magnetometer outputs leads to the m2E + m2N = 0 constraint,
which is valid in areas without magnetic disturbances.
Although it is not reproduced here for space reasons, the
normal form clearly appears through (13). Implementationwise,
it is easy to obtain the equations needed with the help of any
symbolic computation software.
It is also interesting to note the two following facts.
1) First, had there been a direct measurement for heading ,
then the transformation to normal form would have been
trivial and would not have required the addition of the
extra two states in order to disambiguate the estimation of
roll and heading . Indeed, with additional information,
it becomes possible to fully observe an extended state,
such as estimating the wind speed or the quadcopters
center of gravity.
2) Second, in the absence of magnetometer measurements,
heading can only be recovered from the xy accelerations expressed in the world frame. This is possible since
information about the heading () is available in the
fourth and fifth equations of system (9). Since x7 , x8 , and
x9 are recovered from the acceleration measurements,
SEBESTA AND BOIZOT: REAL-TIME AEKF, APPLIED TO A QUADCOPTER INERTIAL NAVIGATION SYSTEM
Fig. 2.
499
Simulation results, innovation, and high-gain adaptation. (a) Innovation. (b) High-gain adaptation (Gmax = 5).
V. P RACTICAL C ONSIDERATIONS
The AEKF is more computationally demanding than the
EKF, principally due to the calculation of innovation. Fortunately, an extensive horizon is not reasonable, as, due to model
imperfections if the innovation calculation begins too far back
in time, there will always be a large divergence between the
expectation and estimated states.
From experience, the innovation horizon should not be larger
than the expected rise time of a perturbation. For instance, in the
case of a quadcopter, the most common perturbation that one
could (or at least reasonably should) expect is a wind gust. For
micro-UAVs, a wind perturbation has a rise time of less than
1 s, so, by applying the aforementioned rule, the AEKF horizon
should be no more than 1 s.
Note 2: The discussion on innovation is extensive and,
as such, has been completed in Appendix B. There, the
main ideas are developed, and implementation hints are
given. An important topic treated in the Appendix is a
method to compute the normalizing matrix .
Significant speed gains can be made by taking advantage of
the models sparse layout to simplify and propagate ones and
zeroes through the intermediate steps. For instance, the calcula + P(A
+ b )T + QG is simplified greatly in
tion (A + b )P
this case, as most elements in A, b , and QG are null.
Finally, fixed-point algorithms can be used as an alternative
to floating-point calculations, for additional speed. However,
the authors prefer to avoid this approach, as it is less general
and is best suited to a production run where the engineering
time to properly implement and test fixed point is amortized
x10
x11
mE z11 (1 z72 ) + z8 (z10 z7 mD ) + mN z9 (z10 + mD z7 )
=
(m2E + m2N ) z9 1 z72
mN z11 (z72 1) + z8 (z10 z7 + mD ) + mE z9 (z10 + mD z7 )
=
(m2E + m2N ) z9 1 z72
(15)
500
SEBESTA AND BOIZOT: REAL-TIME AEKF, APPLIED TO A QUADCOPTER INERTIAL NAVIGATION SYSTEM
TABLE III
0.5-S HORIZON AEKF SPEED RESULTS PER LOOP
501
estimations, increasing the gain (cf., Fig. 6). This high gain
drives the estimate to the new perturbed state within 30 ms.
The yaw results (Fig. 7) demonstrate how the filter reacts
quickly to gyroscope measurements but slowly to magnetometer measurements. This is desired, as the magnetic field in
theory is constant but, in reality, varies rapidly in the presence
of current-carrying wires or ferromagnetic materials. Owing to
the normalizing matrix , the error between expected yaw angle
and measured yaw angle can be kept from triggering the highgain adaptation, keeping noise rejection high.
VIII. C ONCLUSION
Fig. 5.
Fig. 6.
(16)
RG = G1 G Rd G
(17)
C. Filter Performance
Figs. 57 show the effects of a perturbation on the hovering
quadcopter inertial navigation system (INS). At t = 102.55, the
vehicle is externally perturbed (i.e., thumped with a broomstick). As per Section VI-B, the EKF filter was tuned to reject
noise, with the result that it responds very slowly, peaking
almost 100 ms later.
On the other hand, the AEKF innovation metric captures the
difference between the perturbed measurements and the state
for j = 1, . . . , nx,i
The matrix G Rny ny is diagonal, with elements determined by taking the first element of each subdiagonal of G
for i = 1, . . . , 11
502
TABLE IV
C ALCULATING G AND G FOR THE Q UADCOPTER
A PPENDIX B
C ALCULATING I NNOVATION
The innovation at time t is calculated in a moving window
from (t d) to t, and as such, d is the characterizing parameter.
Due to the variable time-step nature, t d need not necessarily
be a time when a sensor measurement was taken (see Fig. 8).
Innovation for a variable-step asynchronous continuous
discrete system is written as
Id,k (t)
i )2Rny
(ti ti1 ) (yi y
ACKNOWLEDGMENT
(18)
i=m+1
where
m = index of
The authors would like to thank the Syn2Cat [34] for the
generous use of its quadcopter and R. J. Cotton and Tau Labs
[35] for providing much technical assistance.
min (tm t d)
tm [t0 ,tk ]
(19)
i is
and is a normalizing matrix (defined hereinafter) and y
found by integrating the following initial value problem, with
(tm ):
z(tm ) = z
z = A(u)z + b(z, u)
(20)
i = Ci z(ti ).
y
The normalizing matrix is meant to ease the use of innovation. Since innovation is computed from variables that do not
have uniform amplitudes, these same must be weighted such
that comparable variations have a comparable impact on the
result. As such, can be constructed as a (ny ny ) diagonal
matrix, each diagonal element corresponding to an output variable yi , for i {1, . . . , ny }. The maximal expected variation
for a given output is sought by using the time derivative of
its analytic expression in the physical coordinates: d/dt(yi ).
Then, we consider the set defined by the maximum anticipated
state values, xi [xi,max , xi,max ], and take the inverse of the
maximum for d/dt(yi ) over this set
1
d(yi )
i,i = max
.
(21)
x,x
dt
For example, if there were a direct measurement of North, then
the normalizing corresponding to this would be found by first
deriving North to obtain a velocity and then using the highest
R EFERENCES
[1] A. Gelb, Ed., Applied Optimal Estimation. Cambridge, MA, USA: MIT
Press, 1974.
[2] S. Lesecq, S. Gentil, and N. Daraoui, Quadrotor attitude estimation with
data losses, in Proc. ECC, Budapest, Hungary, 2009, CD-ROM.
[3] N. Boizot, E. Busvelle, and J.-P. Gauthier, An adaptive high-gain observer for nonlinear systems, Automatica, vol. 46, no. 9, pp. 14831488,
Sep. 2010.
[4] A. B. J. S. Baras and M. R. James, Dynamic observers as asymptotic
limits of recursive filters: Special cases, SIAM J. Appl. Math., vol. 48,
no. 5, pp. 11471158, Oct. 1988.
[5] J. P. Gauthier, H. Hammouri, and S. Othman, A simple observer for nonlinear system. Application to bioreactors, IEEE Trans. Autom. Control,
vol. 37, no. 6, pp. 875880, Jun. 1992.
[6] F. Esfandiari and H. K. Khalil, Output feedback stabilization of fully
linearizable systems, Int. J. Control, vol. 56, no. 5, pp. 10071037, 1992.
[7] A. Tornamb, High-gain observers for non-linear systems, Int. J. Syst.
Sci., vol. 23, no. 9, pp. 14751489, 1992.
[8] J. Gauthier and I. Kupka, Deterministic Observation Theory and
Applications. Cambridge, U.K.: Cambridge Univ. Press, 2001.
[9] F. Deza, E. Busvelle, and J. Gauthier, Exponentially converging observers for distillation columns and internal stability of the dynamic
output feedback, Chem. Eng. Sci., vol. 47, no. 15/16, pp. 39353941,
Oct./Nov. 1992.
[10] J. Picard, Efficency of the EKF for nonlinear systems with small noise,
SIAM J. Appl. Math., vol. 51, no. 3, pp. 843885, Jun. 1991.
[11] N. Boizot, E. Busvelle, and J.-P. Gauthier, Adaptive-gain extended
Kalman filter: Extension to the continuous-discrete case, in Proc. 10th
ECC, Budapest, Hungary, 2009, CD-ROM.
[12] P. Castillo, R. Lozano, and A. Dzul, Stabilization of a mini rotorcraft
with four rotors, IEEE Control Syst. Mag., vol. 25, no. 6, pp. 4555,
Dec. 2005.
[13] S. B. Anderson, Historical overview of V/STOL aircraft technology,
NASA, Washington, DC, USA, Tech. Rep., 1981.
[14] H. Voos, Nonlinear control of a quadrotor micro-UAV using feedbacklinearization, in Proc. IEEE Int. Conf. Mechatron., 2009, pp. 16.
SEBESTA AND BOIZOT: REAL-TIME AEKF, APPLIED TO A QUADCOPTER INERTIAL NAVIGATION SYSTEM
503