LeeShen SystemIdentificationOfCessna182ModelUAV
LeeShen SystemIdentificationOfCessna182ModelUAV
Abstract
The first step to implementing an autopilot system on an Unmanned Aerial Vehicle
(UAV) involves first to characterize the UAV’s dynamics using a mathematical model.
To accomplish this accurately for the particular UAV, the process of system
identification, which is the estimation of the parameters of the equation of motion, is
essential. However, experimental data is generally noisy and thus presents a challenging
problem. In this research project, we are presented with several sets of flight test data of
the UAV (a quarter scale model of a Cessna 182) and we wish to provide an accurate
estimation of the system model parameters. Specifically, we apply and compare several
different machine learning algorithms to the flight data including General Least Squares,
Coordinate Descent, Recursive Estimation with Gaussian Noise, and Learn-Lagged-
Linear. It is customary to evaluate a dynamic model by comparing its simulated state
trajectories with experimental state trajectories. As a result, the dynamic models
computed here are evaluated based on how well the simulated model trajectories compare
with the flight data. Finally, an algorithm is suggested as a basis for in-flight updating of
the system dynamics model in pseudo-real-time.
where [φ θ ψ] is the roll, pitch, yaw Euler angles, [p q r] is the angular velocity of body-
fixed axis frame relative to earth-fixed frame, [u v w] is the linear velocity of the body-
fixed axis frame, and [δa. δr δe δt] are the aileron, rudder, elevator and throttle inputs,
respectively. For compactness, each of (1) and (2) can be rewritten in the form
In this approach, we attempt to find the best estimate of the unknown parameters in A and
B by applying least squares regression to the following objective function
where the state data and unknown parameters are reordered as  and ŝ, respectively. In
this form, the pseudo-inverse is used to find ŝ.
While the model results are fair, it leads to the notion that the proper objective function is
not being considered since the model is evaluated based on its simulated trajectory.
3 Coordinate Descent
Since we are evaluating the performance of the dynamical model based on its simulated
trajectory relative to the actual trajectory, a reasonable objective function would be to
minimize the mean squared error between the simulated states and actual states at each
time step. Numerically minimizing the cost function for each parameter one at a time and
iterating through the parameters in random permutations, we hope to be able to converge
to a reasonable objective function minimum.
However, initial trials suggest that this is a very computationally expensive algorithm that
does not scale well with number of parameters and trajectory lengths, and therefore is
prohibitively expensive for in-flight computation.
A recursive algorithm for the optimal estimation of a stationary state vector assuming
zero mean Gaussian noise is presented in [3]. The two recursion equations are
where ŝk and Qk are the optimal state and covariance estimates given k measurements y1
to yk. Using a similar rearrangement as in (5), the unknown parameters are posed as the
estimated state ŝk and the data at time k is reordered as Ak. Recursive methods are ideal
for in-flight computations since it does not require the reconsideration of past data. All
past data information is embodied in the most recent state and covariance estimates.
However since the prior covariances of the data and parameters are unknown, we need to
devise a method to estimate these. The initial estimate on the parameters was chosen to
be all zero with relatively large decoupled covariances to allow for the presented data to
bear more weight than the priors. Also, since the covariance of each individual data point
is unknown, the measurement covariance of each state was assumed constant with cross-
terms assumed to be zero. With these assumptions, the simulation results perform
reasonably well, however, it leads us to the notion that we are not optimally estimating
the proper covariances.
5 Learn-Lagged-Linear
However, this is in general a non-linear and difficult problem that leads to prohibitively
expensive algorithms such as the EM algorithm suggested in [4]. Motivated by this, an
algorithm to approximately minimize the lagged criterion is given by [5] called Learn-
Lagged-Linear. For convenience, it is excerpted here.
A horizon time H of 2 seconds (20 data points) was chosen. A comparison of the results
is presented in Figure 1.
Applying online learning concepts to the LLL algorithm leads to an algorithm suitable to
serve as a basis for in-flight updating of the system dynamics model in pseudo-real-time.
The algorithm alternates between an evaluation step and a least squares step that solves
for the new parameters.
1. Start with the model found by running the LLL algorithm on available training data
(mentioned in Section 5).
2. Simulate the current model on the given new test data.
3. Compare the simulated state trajectories with the actual measured state data at each
specific time step and calculate the state error.
4. At each time step, if the calculated errors in the previous consecutive N time steps are all
above a preset tolerance threshold, reiterate a new model using the LLL algorithm using
the following input parameters:
a. If the current time step is less than a lower bound L, then the algorithm uses all of
the training data and the simulated data from all previous time steps for re-
iteration.
b. If the current time step is larger than the lower bound L, but less than an upper
bound U, then the algorithm uses all available simulated data and part of the
training data for re-iteration. The size of the training data used in the re-iteration
can be adjusted based on, for example, size of the available simulated data.
c. If the current time step is larger than the upper bound U, then the algorithm uses
all available simulated data for re-iteration.
5. Continue the simulation and repeat steps 2 through 4 as necessary.
This algorithm will continually adapt to the new test data and prevent the model and new
measurement data from having diverging state trajectories. The final results of the
algorithm are compared here in Figure 1:
In this literature, we have discussed several different methods for accomplishing system
identification of a UAV: Generalized Least Squares, Coordinate Descent, Recursive
Estimation, and Learn-Lagged-Linear. Considering speed and performance, the Learn-
Lagged-Linear algorithm presents itself as the best candidate for finding the model that
performs well in the simulation criterion. A summary of the results are shown here in
Table 1.
Although the online learning algorithm presented in Section 6 performs reasonably well
on the given dataset, testing on more extensive data is recommended to develop robust
criteria that will perform well under a wide range of aircraft states. The algorithm is also
fairly computationally expensive which renders it unsuitable for fully real-time updates.
Future projects may involve the development of faster algorithms as well as an online
learning algorithm that is robust enough to reliably detect the transitioning from
accelerating flight, to straight and steady flight, to a coordinated banked turn.
Acknowledgements
We give warm thanks to Corey Ippolito, Pieter Abbeel, and Adam Coates for their
guidance on this work.
References
[1] J. H. Blakelock. Automatic Control of Aircraft and Missiles. Second Edition. John Wiley & Sons, Inc.
1991.
[2] R. Nelson. Flight Stability and Automatic Control. McGraw Hill Book Company, New York, 1995
[3] S. Lall. ENGR207b Introduction to Modern Control. Lecture Notes. Stanford University 2006.
[4] P. Abbeel and A. Y. Ng. Learning First Order Markov Models for Control. In NIPS 18, 2005.
[5] P. Abbeel, V. Ganathi and A. Y. Ng. Learning Vehicular Dynamics, with application to modeling
helicopters. In NIPS 2005.