50

Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Embed Size (px)

Citation preview

Page 1: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Design of a model predictive

controller to control UAVs

A.J.M. Raemaekers

DCT 2007.141

Traineeship report

Coach(es): dr. R. Hill (RMIT)prof. dr. L. Wang (RMIT)

Supervisor: ass. prof. dr. C. Bil (RMIT)prof. dr. H. Nijmeijer (TU/e)

Technische Universiteit Eindhoven Royal Melbourne Institute of TechnologyDepartment Mechanical Engineering Aerospace Design TechnologyDynamics and Control Group Sir Lawrence Wackett Centre

Eindhoven, December, 2007

Page 2: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Abstract

In this report a continuous time model predictive controller is applied to the controlof an Unmanned Aerial Vehicle (UAV). The purpose of this work, is to see if it ispossible to design a good tracking controller that is capable of simulating a highlynonlinear aircraft system.

For the simulations a MATLAB Simulink model of the UAV 'Ariel' is used. Thenonlinear Simulink model covers all the aircraft dynamics. The model consists of�ve inputs, twelve states and twelve outputs. This model is linearized at severaldi�erent operating conditions, for use with the model predictive controller.

The model predictive controller is capable of simulating in real time, making itpossible to use this in on-line applications. The Ariel model is linearized to a lineartime invariant state space system. The state space model is then extended. Thismeans the outputs of the original model are included in the state vector of theextended model. With this extended state space model, it can be shown that theselected outputs can be tracked by the controller. The controller uses an algorithmwhich reduces the required computational power compared to classic model predic-tive control.

The possibility to apply constraints on the controller input, the derivative of thecontroller input, the states and the outputs of the system, make this model predic-tive controller a nonlinear system. Because in real life constraints are almost alwayspresent on any dynamical system, the presented model predictive controller has abroad application scope.

The simulations show that the controller performs well, after tuning of the pa-rameters. Applying the constraints puts some limits on the possible reference tra-jectories, but shows that the system is very capable of handling these controls. Also,simulation of failure of one of the controls is possible, simply by setting the maxi-mum and minimum values to zero. The UAV controller is able to use the other threecontrols to compensate for the lack of the fourth, keeping the aircraft at steady �ight.

The application of model predictive control to aircraft control is relatively new.This report shows that using a model predictive controller works well for the simu-lations done in this report. This method of MPC can be used not only on aircraftsystems, but in general on all types of dynamic systems, with the possibility ofapplying constraints.For future work, a switching controller can be designed to use the di�erent linearizedmodels at di�erent operating conditions. Wrapping another controller around themodel predictive controller presented here, should make it possible to let the aircraftfollow a set of way-points, thus not requiring a pre-de�ned reference trajectory tobe able to �y fully autonomously.

Page 3: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Contents

1 Introduction 3

2 UAV and �ight background 52.1 UAV development . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Aircraft control history . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Flight dynamics 73.1 Coordinate system . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.1.1 Body-�xed coordinate system . . . . . . . . . . . . . . . . . . 83.1.2 Earth-�xed coordinate system . . . . . . . . . . . . . . . . . . 83.1.3 Atmosphere-�xed coordinate system . . . . . . . . . . . . . . 8

3.2 Equations of motion . . . . . . . . . . . . . . . . . . . . . . . . . . . 83.2.1 Aircraft controls . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.3 Aircraft trim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.4 Ariel model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.5 Linearizing the equations of motion . . . . . . . . . . . . . . . . . . . 12

4 Model Predictive Control 144.1 Model Predictive Control . . . . . . . . . . . . . . . . . . . . . . . . 14

4.1.1 Receding horizon concept . . . . . . . . . . . . . . . . . . . . 144.1.2 Optimal control formulation . . . . . . . . . . . . . . . . . . . 15

4.2 Continuous time model predictive control design using orthonormalfunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.2.2 Description of control trajectory . . . . . . . . . . . . . . . . 174.2.3 Predicted plant output . . . . . . . . . . . . . . . . . . . . . . 194.2.4 Optimal control strategy . . . . . . . . . . . . . . . . . . . . . 21

5 Simulations and results 245.1 Model selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.2 Output selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.3 Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.4 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5.4.1 Simulation without constraints . . . . . . . . . . . . . . . . . 295.4.2 Simulation with constraints . . . . . . . . . . . . . . . . . . . 315.4.3 Simulation of failure . . . . . . . . . . . . . . . . . . . . . . . 35

6 Conclusions and recommendations 376.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376.2 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

A Time dependent A matrix 39

1

Page 4: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

B LTI Ariel model 40

C Controls and states scenario 1 and 2 42

D Trim conditions 45

2

Page 5: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Chapter 1

Introduction

In recent years, model predictive control (MPC) has been an upcoming control tech-nique in on-line applications due to the ever increasing computer power of moderncomputers. MPC is mostly used to control large time scale factory processes, butin recent years the application has moved to dynamic processes with smaller timescales.

Most existing MPC implementations use a discrete-time form; the continuous-timecounterpart was developed much later. Continuous time modeling gives the advan-tage that future predictions can be calculated in an analytical form. This reducesthe required computational e�ort because there are less parameters that need to beoptimized.

The response time of the control signal in the continuous time MPC case is abit slower compared to the discrete time case [1]. This means the performance isslightly worse, because it takes more time before the system is stabilized. However,continuous time MPC requires less optimization steps to calculate the control sig-nal. It also makes the tuning of the controller more intuitive, and the calculatedcontrol signal smoother. One of the latest developments in continuous time MPCis the use of orthonormal functions to describe the control signal [1]. In this reportthe application of this method to the control of a Unmanned Aerial Vehicle (UAV)will be discussed.

In recent years, unmanned aircraft have become more and more popular. Themilitary has great interest in these machines, for amongst other things, battle�eldsurveillance, reconnaissance and targeting. They can also be used for civilian ap-plications such as reconnaissance, crop dusting, observations, police surveillance,TV broadcasting, photography etc. The fact that they are unmanned make UAVsparticularly suitable for going into inhospitable or hazardous environments. In gen-eral, UAVs have the potential to complement traditional manned surveillance andmonitoring operations or, for some missions, can be a cost e�ective alternative.

In the beginning of the last century the research was mainly focused on auto pi-lot systems, but this knowledge was restricted for the public for military security.Controllers designed before the development of classical control theory, were simplealtitude and heading holds. But with the up-come of classical control theory andthe introduction of the jet engine more and more controllers were applied to theaircraft to assist the pilot in �ying the aircraft. Therefore, control of aircraft hasbeen studied for a long time, ever since the development of modern computers inthe 1950's.

3

Page 6: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

To control UAVs, di�erent methods have been studied over the years, with dif-ferent results. In this report a continuous time model predictive controller withorthonormal functions will be designed to control a UAV. The UAV 'Ariel' used inthis report was modeled by Crump [2] with the MATLAB Simulink software.

This Simulink model is linearized at di�erent operating points. The linearizedmodel is used in the model predictive controller. The controller calculates the sys-tem controls, needed to track the selected outputs of the Ariel aircraft model. Themodel predictive controller makes it possible to add hard constraints to the states,controls and outputs of the linear state space model. It is also possible to simulatefailure of one or more of the controls by setting the hard constraints to zero.

MPC has been applied to UAV control before [3], but this method di�ers fromthe previous work done, because, by using orthonormal functions to approximatethe control signal and calculate the UAV response, the required computation e�ortdecreases, making it possible to use this version of MPC to control the Ariel modelin an on-line environment.

This report is organized as follows; in the second chapter the background of UAVand �ight control is described. The third chapter gives the reader some insight in�ight dynamics and the equations of motion describing the states of an aircraft. Italso describes the linearization of the (non linear) equations of motion and how thesteady state operating conditions are determined. The fourth chapter will familiar-ize the reader with model predictive control, and deals with the use of orthonormalfunctions to describe the control trajectory in more detail. The �fth chapter con-tains the simulations done to show how the implementation of the model predictivecontroller is able to control the Ariel UAV and also how it is able to deal withconstraints on and failure of one or more of the control inputs. Finally in chaptersix the conclusions and recommendations are dealt with.

4

Page 7: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Chapter 2

UAV and �ight background

2.1 UAV development

In the last few decades the use of Unmanned Aerial Vehicles (UAVs), has becomemore and more popular. Due to the more advanced technology available nowadays,the emphasis has moved from Remotely Piloted Vehicles (RPVs) to UAVs, whichhave a form of autonomy. The autonomous capabilities of UAVs have improvedover the last years due to improvements in (control) technology and improvementsof computational power.

A brief review of the last 20 years of UAV activity is given in [4]. Another re-view of UAV activity can be found in [5], where several speci�c aircraft platformsare discussed in reasonable depth. All reports indicate the increasing prominencewhich UAVs are taking in present day armed forces. These documents only discussthe developments in Western countries, whilst development within the Middle East,the Soviet bloc and Asia is also well underway.

The majority of UAV development has been military based. Most well knownare The Predator (a medium sized tactical UAV), developed by General Atomicsand produced in 1997 and the Northrop Grumman Global Hawk, which has beendeveloped as a high altitude, large area surveillance aircraft. But there have beenseveral civilian forays into the �eld as well. The two most successful civilian UAVare the Aerosonde aircraft, used for meteorological surveying and the Yamaha Aero-Robot, an unmanned helicopter used for crop-dusting.

A study of the market in Australia for both civilian and military uses is givenin [6, 7]. They conclude that Australia has both a very large potential market forUAV applications and also a mature capability for advanced aircraft design, whichcould be applied very successfully to a `small' design project such as a UAV. Thedevelopment of a multi-purpose Australian UAV is discussed in [8], addressing someof the issues that must be considered in design for the Australian environment.

2.2 Aircraft control history

The introduction of the jet aircraft resulted in more complicated aircraft dynamics.Underdamped high frequency modes which became increasingly di�cult for humanpilots to control became evident. The so called short period longitudinal mode andthe dutch roll lateral mode fall in this category. Thus, in these jet aircraft, arti-�cial damping had to be provided to allow satisfactory handling qualities. These

5

Page 8: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

arti�cial damping systems were developed using the emerging classical design tech-niques which are mainly based on working with single input single output (SISO)systems and using tools such as Bode plots, Nyquist plots and Evans Root Locustechniques. These techniques all use the frequency domain as a design region andare widely accepted, utilizing phase margins and gain margins to illustrate robust-ness. These classical techniques proved extremely successful for the aircraft of thetime; however, they have some well known limitations. The main design techniquesare all based upon linear time invariant (LTI) SISO systems and with increasinglycomplicated aircraft and control objectives, these techniques became increasinglydi�cult to apply. In 1960, Kalman published three major papers that were thebeginning of the modern control era.

These papers contained detailed development of the optimal control of systems,through the use of a Linear Quadratic Regulator (LQR) and the development ofan optimal �ltering technique, commonly known today as the Kalman �lter. Themain point of Kalman's work is that it is a time domain approach that uses lin-ear algebra, so systems with multiple inputs and multiple outputs (MIMO) can behandled with no extra e�ort. He also introduced the concept of the internal state,implying that one is concerned with the internal system behavior as well as thesystem input/output behavior. Kalman formalized the concept of `control optimal-ity' by minimizing a quadratic energy function, which provides a unique solutionwith guaranteed performance. However, only because of the development of digitalcomputer technology, it was possible to solve his matrix equations, which are verytime intensive and di�cult to solve by hand.

One method that has found a large amount of acceptance in the control industry isan extension of both linear quadratic regulators and Kalman �lters to a techniqueknown as Linear Quadratic Gaussian with Loop Transfer Recovery (LQG/LTR).This method utilizes both the linear quadratic regulator (LQR) which requires fullstate feedback and the Kalman �lter to provide a state estimate based upon systemoutputs. This method does not have the guaranteed properties of each individualsystem on its own, so the enhancement, Loop Transfer Recovery (LTR), attemptsto automatically synthesize an appropriate Kalman �lter given a regulator or vice-versa. This technique will generally almost fully recover the desired properties ofthe full state feedback regulator. Examples of the use of this technique are given in[9].

These new control techniques have two problems compared to classical techniques.The �rst problem is the lack of engineering intuition in control design, with all prob-lems simply solved through the solution of matrix equations, whilst the second moreimportant problem is that of robustness. The guaranteed performance of moderncontrol designs could quite easily be lost when unmodeled dynamics, disturbancesand measurement noise are introduced. Also, the well known phase and gain marginconcepts can not be easily applied to the multivariable systems that modern controlis so suited for. These problems lead to the introduction of robust modern controltheory, and more recently, with computing power still increasing every day, the ap-plication of model predictive control (MPC). MPC has been known and used sincethe 1970's and has been successfully applied to systems with large time constants,e.g. in the control of process industry, because MPC requires a lot of computationalpower. However in recent years the application of MPC to systems with small timeconstants has increased and new applications arise every day.

6

Page 9: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Chapter 3

Flight dynamics

In this report a continuous time model predictive controller is designed with or-thonormal functions to control a UAV model. M. Crump has developed an accu-rate MATLAB Simulink model of the UAV Ariel [2], which is an unmanned aircraftdeveloped by the UAV group in the Department of Aeronautical Engineering at theUniversity of Sydney. A picture of this aircraft is shown in �gure 3.1. The majorityof data on this aircraft is available in [10].

Figure 3.1: Ariel UAV

3.1 Coordinate system

The movement of an airplane is described by the equations of motion with respectto the body frame coordinate system. In general there are three coordinate systemsthat are important when describing the motion of an airplane [11].1. Body-�xed coordinate system2. Earth-�xed coordinate system3. Atmosphere-�xed coordinate system

The body-�xed frame can be expressed in terms of the Earth-�xed frame by theuse of Euler angles (φ, θ and ψ).

7

Page 10: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

3.1.1 Body-�xed coordinate system

This coordinate system's origin is located at the aircraft center of gravity. The x-axispoints forward along some axis of the fuselage in the aircraft's plane of symmetry.The y-axis is normal to the plane of symmetry pointing in the direction of the rightwing. The z-axis points downward, completing the right-handed Cartesian system.See also �gure 3.2(a). Rotations about the x, y and z-axis are called roll (φ), pitch(θ) and yaw (ψ) respectively. See also �gure 3.2(b). The Body-�xed coordinatesystem is also called the ABC frame.

(a) Body CS (b) Rotations

Figure 3.2: Coordinate system

3.1.2 Earth-�xed coordinate system

The Earth-�xed coordinate system points in the directions North, East and Down(NED frame). The x, y-plane is normal to the local gravitational vector with thex-axis pointing north and the y-axis pointing east. The z-axis points down. Fornavigation on a small piece of the Earth, the curvature of the Earth can be ne-glected for simpli�cation. The NED frame is then �xed and does not rotate. Thissimpli�cation is also called the '�at Earth' approximation.

3.1.3 Atmosphere-�xed coordinate system

The atmosphere-�xed coordinate system is de�ned such that all three axes arealways parallel to those of the Earth-�xed coordinate system. However, the atmo-spheric coordinate system moves at a constant velocity relative to the Earth-�xedcoordinate system. The atmosphere coordinate system is only used when derivingthe equations of motion. It is also used in wind tunnel testing of aircraft models.

3.2 Equations of motion

When deriving the equations of motion, the aircraft is considered as a rigid body.To switch between the ABC and NED coordinate frame, a matrix multiplication isused, consisting of three rotations:1. Rotation about the z-axis, positive nose right (yaw ψ)2. Rotation about the new y-axis, positive nose up (pitch θ)

8

Page 11: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

3. Rotation about the new x-axis, positive right wing down (bank φ)

The yaw, pitch and bank angles are known as the Euler angles. The transformationmatrix B is given as: x

yz

ABC

= B

xyz

NED

(3.1)

with

B =

cos θ cosψ cos θ sinψ − sin θ− cosφ sinψ + sinφ sin θ cosψ cosφ cosψ + sinφ sin θ sinψ sinφ cos θsinφ sinψ + cosφ sin θ cosψ − sinφ cosψ + cosφ sin θ sinψ cosφ cos θ

The inertia properties of the rigid airplane body can be de�ned by:

c1 = (Jy−Jz)Jz−J2xz

τ c2 = (Jx−Jy+Jz)Jxzτ c3 = Jz

τ c4 = Jxzτ

c5 = Jz−JxJy

c6 = JxzJy

c7 = 1Jy

c8 = Jx(Jx−Jy)+J2xz

τ

c9 = Jxτ τ = JxJz − J2

xz

(3.2)

And the aerodynamic and propulsive forces and torques will be split into the bodyaxes:

FB =

FxFyFz

TB =

LMN

(3.3)

With these de�nitions, the equations of motion of the aircraft can be described by:

U = RV −QW − g sin θ + Fx/m

V = −RU + PW + g sinφ cos θ + Fy/m

W = QU − PV + g cosφ cos θ + Fz/m

φ = P + tan θ(Q sin θ −R cos θ)

θ = Q cos θ −R sinφ

ψ = (Q sinφ+R cosφ)/ cos θ

P = (c1R+ c2P )Q+ c3L+ c4N

Q = c5PR− c6(P 2 −R2) + c7M

R = (c8P − c2R)Q+ c4L+ c9N

˙pN = U cos θ cosψ + V (sinφ sin θ cosψ − cosφ sinψ) +W (sinφ sin θ cosψ + sinφ sinψ)

˙pE = U cos θ sinψ + V (sinφ sin θ sinψ + cosφ cosψ) +W (cosφ sin θ sinψ − sinφ cosψ)

˙pD = −U sin θ + V sinφ cos θ +W cosφ cos θ(3.4)

With the de�nition of the state vector as:

X =[U V W φ θ ψ P Q R pN pE pD

]T(3.5)

9

Page 12: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

with

• U , V andW the velocity with respect to the body axes x, y and z respectively

• φ, θ and ψ the three Euler angles

• P , Q and R the angular rates

• pN , pE and pD the positions with respect to the NED frame.

The model is linearized using the so called '�at Earth' approximation. In thisapproximation it is assumed that the Earth is �at, and this can be used whennavigation is only required over a small area of the Earth.

3.2.1 Aircraft controls

The Ariel UAV can be controlled by four de�ective surfaces and the throttle, whichare shown in �gure 3.3. The controls and their e�ect on the aircraft are:1. Throttle: Accelerates/deccelerates the aircraft2. Elevator: Change the pitch (θ) of the aircraft3. Rudder: Change the yaw (ψ) of the aircraft.4. Aileron: Change the banking angle (φ) of the aircraft.5. Flaps: Increase the lift of the wings. Used for take-o� and landing.

Figure 3.3: Aircraft controls

3.3 Aircraft trim

Aircraft trim is the de�nition of the aircraft �ying at steady state. This meansthat all the aircraft velocity variables are �xed at a constant value. The aircraftis 'tuned' in a way that it conducts a steady �ight and no torque is applied to the

10

Page 13: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

airplane's center of gravity. This implies that the aircraft acceleration componentsare all zero. This de�nition leads to:

U , V , W , P , Q, R ≡ 0, U > 0 (3.6)

Steady wings-level �ight and steady turning �ight is allowed using the '�at Earth'simpli�cation discussed in section 3.1.2. Ignoring the e�ects of changing density withaltitude, steady wings-level climb and steady climbing turn are also trim conditions.For each of the di�erent trim conditions extra constraints need to be applied. Forinstance, for a steady wings level �ight, the trim condition also requires:

φ, θ, ψ, P,Q,R, φ ≡ 0 (3.7)

With these constraints an optimum trim condition can be found using an optimiza-tion algorithm. In general, a good objective function to optimize is to minimize thesum of the square of the aircraft body accelerations. In the work of Crump [2] anoptimization algorithm has been provided and is used to obtain trim conditions forthe state, input and output variables for di�erent operating conditions.

The Ariel model is linearized around di�erent trim conditions. Each trim con-dition is a steady state equilibrium, therefore, the state space system obtained fordi�erent operating conditions is stable. In the simulations, the deviations aroundthe steady states of the di�erent state space models have to be added to the valuesof the trim conditions to provide the 'real' values that are used as input for thenon-linear Ariel model.

3.4 Ariel model

The Ariel model is built in the MATLAB Simulink environment. The model useslookup tables to �nd values for the aerodynamic and propulsive forces and aircraftparameters for di�erent operating conditions, acquired by windtunnel testing. The6-degree of freedom dynamic model is complemented by modeling the engine, sensorand actuator dynamics. More details about the Ariel Simulink model can be foundin [2]. The model has �ve inputs; throttle, elevators, ailerons, rudder and �aps,represented as

[δT δe δa δr δf

]respectively. The values and rates of these

inputs are limited. The states of the equations of motion (3.5) are the internalstates of the model. The measured outputs are:

Y =[nx ny nz VT α β P Q R φ θ ψ

]T(3.8)

with

• nx, ny and nz the accelerations in x, y and z direction with respect to theABC-frame

• VT the total velocity, VT =√U2 + V 2 +W 2

• α the angle of attack

• β the sideslip angle

• P , Q and R the angular rates

• φ, θ and ψ the Euler angles

11

Page 14: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

3.5 Linearizing the equations of motion

A general nonlinear system can be written in the following form:

x(t) = f (x(t), u(t), t) (3.9)

y(t) = g (x(t), u(t), t) (3.10)

In these equations, x(t) represents the n-states of the model, u(t) represents them-inputs of the model, and y(t) represents the p-outputs of the model.A linearized model of this system is valid in a small region around the operatingpoint t = t0, x(t0) = x0, u(t0) = u0, and y(t0) = g(x0, u0, t0) = y0. Operatingpoints can be found using the trim algorithm. Subtracting the operating pointvalues from the states, inputs, and outputs de�nes a set of variables centered aboutthe operating point:

δx(t) = x(t)− x0

δy(t) = y(t)− y0δu(t) = u(t)− u0

(3.11)

The linearized model can be written in terms of these new variables and is usuallyvalid when these variables are small, i.e. when the departure from the operatingpoint is small:

δx(t) = A(t)δx(t) +B(t)δu(t) + ∂f∂t (x0, u0, t)

δy(t) = C(t)δx(t) +D(t)δu(t) + ∂g∂t (x0, u0, t)

(3.12)

The state-space matrices A(t), B(t), C(t), and D(t) of this linearized model repre-sent the Jacobian matrices of the system, which are de�ned as follows:

A(t) =

∇xf1(x0, u0, t)...

∇xfn(x0, u0, t)

B(t) =

∇uf1(x0, u0, t)...

∇ufn(x0, u0, t)

C(t) =

∇xg1(x0, u0, t)...

∇xgp(x0, u0, t)

D(t) =

∇ug1(x0, u0, t)...

∇ugp(x0, u0, t)

(3.13)

where

∇xf(x0, u0, t) =[

∂f(x0,u0,t)∂x1(t)

∂f(x0,u0,t)∂x2(t)

. . . ∂f(x0,u0,t)∂xn(t)

](3.14)

The obtained matrices A(t), B(t), C(t), and D(t) are all time dependent. Thematrix A(t) is speci�ed in appendix A. When the aircraft trim condition for steadywings-level �ight (speci�ed in section 3.3) is applied, the system matrix further

12

Page 15: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

simpli�es to:

A =

0 0 −0.07 0 −9.81 0 0 −2.05 0.01 0 0 00 0 0 9.81 0 0 2.05 0 −30 0 0 0

0.07 0 0 0 0 0 −0.01 30 0 0 0 00 0 0 0 0 0 1 0 0 0 0 00 0 0 0 0 0 0 1 0 0 0 00 0 0 0.07 0 0 0 0 1 0 0 00 0 0 0 0 0 0.07c2 0 0.07c1 0 0 00 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0.07c8 0 −0.07c2 0 0 01 0 0 0 0 −0.02 0 0 0 0 0 00 1 0 −2.05 0 30 0 0 0 0 0 00 0 1 0.01 −30 0 0 0 0 0 0 0

(3.15)

The other matrices B(t), C(t) and D(t) will also become time invariant. Be-cause all the accelerations are zero and the external forces don't change over time,∂f∂t (x0, u0, t) ≡ 0 and ∂g

∂t (x0, u0, t) ≡ 0 and these terms can thus be neglected. Inthe steady wings-level �ight case, the state space system becomes a linear time in-variant (LTI) state space system.

As mentioned before in section 3.3 there are four di�erent trim conditions. Themodel only simpli�es to a LTI state space system when the trim condition forsteady wings-level �ight or steady wings-level climb is applied. When the othertrim conditions, steady turning �ight and steady climbing turn, are used the statespace system will remain time dependent.In this research, only the LTI state space model is used. Using the time varyingmodel in the model predictive controller will require more computations, and there-fore makes it not (yet) possible to use this for real time control.

The general equations of motion and the aircraft speci�c propulsive and aerody-namic force models are combined in the Simulink model of the Ariel UAV togetherwith the sensor and actuator dynamics. To obtain the Linear Time Invariant (LTI)model, a numerical perturbation algorithm is used to linearize the system. Thisinvolves introducing small perturbations to the nonlinear model and measuring theresponses to these perturbations. Both the perturbations and the responses are usedto create the matrices of the linear state-space model. In appendix B an exampleof a state space model is given linearized around a trim condition.

13

Page 16: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Chapter 4

Model Predictive Control

In the work of Wang [1] it is shown how to create a continuous time model predictivecontroller using orthonormal functions. The big advantage of this method is thatit reduces the required computing power. First, general model predictive controlwill be discussed. Secondly, the use of orthonormal functions to design a continuoustime model predictive controller will be discussed. In this section a model predictivecontroller is presented which can be used to control all general types of state spacemodels, as long as they satisfy certain conditions (see 4.2.3). This method reducesthe required computing power, thus giving it signi�cant advantages when used in anon-line environment. In chapter 5 the application and results of this design methodto control the Ariel model will be described.

4.1 Model Predictive Control

Model predictive control is an approach to controller design that involves on-lineoptimization calculations. The online optimization problem takes account of sys-tem dynamics, constraints and control objectives. Several authors have publishedreviews of MPC theoretical issues, including the papers of García et al. [12], Ricker[13], Morari and Lee [14], Muske and Rawlings [15] and Rawlings et al. [16]. Themain reason for the wide-scale adoption by industry of model predictive control isits ability to handle hard constraints on controls and states that arise in most appli-cations. Conventional model predictive control requires the solution of an open-loopoptimal control problem, in which the decision variable is a sequence of control ac-tions, at each sample time. Current control action is set equal to the �rst term ofthe optimal control sequence.

4.1.1 Receding horizon concept

The receding horizon idea is the basic concept behind MPC [17]. In most cases,model predictive control uses a discrete time setting. At time t the predicted plantoutput is calculated using the internal plant model. This is done for the predictionhorizon p. Based on the plants predicted output at time t + p, a control e�ort iscomputed to reduce the system error, thus following the reference trajectory. The�rst step (t + 1) of the calculated control input is executed. Then the outputs aremeasured again (y + 1), and based on this output, the new predicted plant statesand outputs are calculated for the new prediction horizon t+ 1 + p. This way, theprediction horizon keeps shifting, every time p seconds ahead of the current time t.This principle is illustrated in �gure 4.1.

14

Page 17: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

In this research a continuous time MPC is used. This means that a continuoustime model is used to calculate the system behavior and the desired control tra-jectory. The execution of the algorithm does use a discrete time setting in thesense that for a prede�ned time step the control e�ort is executed before a newoptimization step is made.

Figure 4.1: Receding horizon control

4.1.2 Optimal control formulation

The plant behavior can be described by:

dx

dt= f(x, u, t) (4.1)

The model outputs are calculated up to time p. The control objective is to minimizea cost function, which has the form:

V (x, u, t) =∫ p

0

l(x(t), u(t), t)dt+ F (x(p)) (4.2)

where l(x(t), u(t), t) is some function, satisfying l(x(t), u(t), t) ≥ 0, F (x(p)) is theterminal state weighting (at the prediction horizon p) and the control input isconstrained to be in some set u(t)εU . This is a very general formulation, andjust about every sensible problem can be represented in this form by using suitablefunctions f , F and l.To solve the minimization of the cost function, the following partial di�erentialequation needs to be solved:

∂tV 0(x, t) = minuεUH(x, u,

∂xV 0(x, t)) (4.3)

Where H(x, u, λ) = l(x, u) + λf(x, u), with the boundary condition V (x, p) =F (x(p)). This equation is called the Hamilton-Jacobian-Bellman equation and in

15

Page 18: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

most cases it is virtually impossible to solve this partial di�erential equation. Itis necessary to make some assumptions to get solutions in practice. One way is toassume the plant is linear, so that f(x, u, t) has the special form:

x = A(t)x(t) +B(t)u(t) (4.4)

and that the functions l and F are quadratic functions:

l(x(t), u(t), t) = xT (t)Q(t)x(t) + uT (t)R(t)u(t) (4.5)

F (x(p)) = xT (p)Sx(p) (4.6)

where Q(t), R(t) and S are square, positive-de�nite matrices. In that case theHamilton-Jacobi-Bellman equation simpli�es to an ordinary di�erential equation,the Ricatti equation. A candidate function to solve the HJB equation is to maintaina quadratic form of the cost function at all time t. Assume that:

V 0(x, t) = xT (t)P (t)x(t), P (t) = PT (t) (4.7)

Then, the HJB equation is simpli�ed to the following Riccati equation:

−P (t) = P (t)A(t) +A(t)TP (t) +Q(t)− P (t)B(t)R−1(t)B(t)TP (t) (4.8)

P (p) = S (4.9)

This can be solved and leads to a linear, time-varying feedback law:

u(t) = F (t)x(t) (4.10)

where F (t) is the 'state feedback' matrix, which depends on the solution of theRicatti equation.

F (t) = R−1(t)B(t)TP (t) (4.11)

4.2 Continuous time model predictive control de-

sign using orthonormal functions

4.2.1 Introduction

Most of the MPC techniques developed over the last years have focussed on dis-crete time systems. In recent years the interest in continuous time model predictivecontrol has grown. In general, continuous time MPC is more complicated than itsdiscrete time counterpart. This is because in the continuous time case, the futureplant behavior is calculated through convolution instead of direct iteration, whichis computationally more demanding. An emulator was proposed to obtain the pre-dictions through a Taylor series expansion in [18, 19, 20].

One of the crucial steps widely used in the derivation of discrete time MPC isto capture the projected control signal over a prediction horizon using a movingaverage structure. To make the structure �nite dimensional, long term incrementsof the future control signal are assumed to go to zero. This technique can not benaturally adopted in continuous time MPC design where the corresponding com-ponents are the derivatives of the control signal over the prediction horizon. Thesecan not be assumed to be zero without a�ecting closed-loop performance.Based on a state space model, Gawthrop [21] proposed to use a set of exponential

16

Page 19: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

functions to capture the control trajectory with the parameters related to the lo-cation of the closed-loop poles. In his method the number of exponential functionsmatches the number of state variables.

The design technique presented here can be used as an alternative to classical re-ceding horizon control without the need to solve the matrix di�erential Ricattiequation. Future prediction is calculated in an analytical form. The control tra-jectory is calculated using a pre-chosen set of orthonormal basis functions. Thistechnique is designed for continuous time, but it can be readily extended to discretetime systems and it is expected to be applicable to non-linear systems as well [1].The �rst derivative of the control signal can be approximated within the predictionhorizon using orthonormal basis functions [22]. The accuracy of the approximation,when using orthonormal functions, is dependent on the choice of certain scalingfactors. For example, when using a Laguerre network, the pole location is impor-tant. To simplify the performance speci�cation procedure, Laguerre orthonormalfunctions are used in this design. The scaling factor is made a performance tuningparameter. This parameter plays an important role in the response speed of theclosed-loop system.

The novelty of this approach lies in the fact that the problem of �nding the optimalcontrol signal is converted into one of �nding a set of coe�cients for the Laguerremodel. This approach e�ectively reduces the number of parameters required in theoperation, thus o�ering a substantial advantage when used in an on-line environ-ment.

4.2.2 Description of control trajectory

It is known that an arbitrary function f(t) has a formal expansion analogous toa Fourier expansion [23]. Based on this technique, an arbitrary function f(t) isexpressed in terms of a series expansion as

f(t) =∞∑i=1

ξili(t) (4.12)

where ξi, i = 1, 2, . . . are the coe�cients and li(t), i = 1, 2, . . . are orthogonalfunctions satisfying∫ ∞

0

li(t)2dt = 1∫ ∞

0

li(t)lj(t)dt = 0 i 6= j (4.13)

Further, assuming that f(t) is a piece-wise continuous function satisfying∫ ∞0

f(t)2dt <∞ (4.14)

then for any ε > 0 and 0 ≤ t ≤ ∞, there exists an integer N such that for all k ≥ N∫ ∞0

(f(t)−k∑i=1

ξili(t))2dt ≤ ε (4.15)

In summary, a truncated expansion∑Ni=1 ξili(t) is used to closely approximate f(t).

One set of orthonormal functions frequently used is the set of Laguerre functions.

17

Page 20: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Laguerre functions are appealing to engineers because the Laplace transform of li(t)has a particularly simple form:∫ ∞

0

li(t)e−stdt =√

2p(s− p)i−1

(s+ p)i(4.16)

where p is positive and often called scaling factor. From (4.16), a di�erential equa-tion can be derived, which is satis�ed by the Laguerre functions. Speci�cally, letL(t) = [l1(t) l2(t) . . . lN (t)]T and L(0) =

√2p[1 1 . . . 1]T . Then the Laguerre

functions satisfy the di�erential equation:

L(t) = ApL(t) (4.17)

where

Ap =

−p 0 . . . 0−2p −p . . . 0...

. . ....

−2p . . . −2p −p

(4.18)

The solution of the di�erential equation (4.17) leads to a representation of theLaguerre functions in terms of a matrix exponential function:

L(t) = eAptL(0) (4.19)

For a linear time invariant system, when the closed loop system is stable, the controlsignal for a set-point change or a load disturbance rejection exponentially convergesto a constant after the transient response period. Using this in the receding horizoncontrol design, the future control signal, derived in section 4.1.2 responds in a timeinvariant fashion for each moving horizon window. Thus the derivative of the controlsignal u(t) converges to zero, when it is assumed that the closed loop system is stablewithin each moving horizon window ti ≤ t ≤ ti + Tp. It is seen that:∫ ti+Tp

ti

u(t)2dt <∞ (4.20)

By applying the technique used by Wiener and Lee [22], the derivative of the controlsignal can be described by using a Laguerre function based series expansion as:

u(t) =N∑i=1

ξili(t) = L(t)T η (4.21)

where η = [ξ1 ξ2 . . . ξN ]T is the vector of coe�cients of the orthogonal functionsli(t) which express the series expansion of u(t).

Remarks:

• Assume that a moving time window is taken as ti ≤ t ≤ ti + Tp, and withinthis window the control signal is denoted by u(t) and its derivative by u(t).In general, the control signal in a stable closed-loop system does not convergeto zero as t→∞ if there exists a constant external signal such as a set-pointsignal, step input disturbance or step output disturbance.Suppose that for ti ≤ t ≤ ti + Tp, the projected control signal u(t) convergesexponentially to a constant, consequently leading to the exponential conver-gence of the derivative, u(t), to zero. As a result the orthonormal functions

18

Page 21: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

can not be used to describe the control signal with the expectation of conver-gence of the expansion in a �nite number of terms. However, the derivativeof the control signal does preserves the property that

∫∞0u(t)2dt ≤ ∞.

In summary, if there is an external constant input signal to the closed-loopcontrol signal, the suitable candidate variable which can be modelled by a setof orthonormal functions is the derivative of the control signal, not the controlsignal itself. This is a realistic situation as setpoint change and disturbancerejection are the primary roles in which a feedback control system plays.

• Model predictive control is an open-loop optimisation strategy unless the statevariable x(t) is measurable. The actual feedback is introduced through theuse of an observer to estimate the state variables (see section 4.2.4). Also, byintroducing the controller, the open loop properties of the system are a�ected.Assuming that the closed loop system is stable is therefore questionable.

4.2.3 Predicted plant output

The plant to be controlled is a multivariable state space system with r inputs u(t)and q outputs y(t). Furthermore, it is assumed that the plant su�ers from externaldisturbances ω(t) (e.g. changing wind, temperature change of the air, changes ofthe air density) and the measurements of the outputs are disturbed with µ(t):

xm(t) = Amxm(t) +Bmu(t) + ω(t)y(t) = Cmxm(t) +Dmu(t) + µ(t) (4.22)

where xm(t) is the state vector of dimension n. It is assumed that

E

{dω(t)dt

}= 0

E

{dµ(t)dt

}= 0 (4.23)

and

E

{dω(t)dt

dω(τ)T

}= Wωδ(t− τ)

E

{dµ(t)dt

dµ(τ)T

}= Rµδ(t− τ) (4.24)

where E{} denotes expectation and δ(.) is the Dirac function. Here it is assumedthat ω(t) and µ(t) are continuous time white noise processes.

Introduce the variable

z(t) = xm(t) =d

dt

(Amxm(t) +Bmxm(t) + ω(t)

)(4.25)

The state space system (4.22) can now be written in an augmented form:

X(t) = AX(t) +Bu(t) +[ω(t)µ(t)

]y(t) = CX(t) (4.26)

where

X(t) =[z(t)y(t)

]A =

[Am 0Cm 0

]B =

[BmDm

]C = [0 I]

19

Page 22: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

I is the q × q unit matrix. Note that the augmented state space description (4.26)takes the �rst derivative of the control signal as its input and its output remainsthe same.Because the white noise has a zero average, the expected e�ect of the random distur-bances (ω(t), µ(t)) in the future prediction is assumed to be zero. The measurementnoise ω(t) and the disturbances µ(t) are not ampli�ed, because an observer is usedto estimate the state variables so that explicit di�erentiation is avoided. Becauseof this, the noise terms are neglected in this analytical approach, and it is not nec-essary to calculate the derivative of ω(t) and µ(t) in equation (4.26). Simulationsshow that the presence of measurement noise and disturbances do not in�uence theperformance of the controller [1].It can be shown that if the augmented state space system is observable and con-trollable, it is possible to track the outputs of the original system using a modelpredictive controller [26]. Of course, this only holds when there are no constraintsactive on the system.

It is assumed that at the current time ti, the state variable X(ti) is available.Then at the future time ti + τ , τ > 0, the predicted state variable X(ti + τ) isdescribed by the following equation:

X(ti + τ) = eAτX(ti) +∫ ti+τ

ti

eA(ti+τ−β)Bu(β)dβ (4.27)

= eAτX(ti) +∫ τ

0

eA(τ−γ)Bu(ti + γ)dγ (4.28)

(4.29)

where the expected e�ect of the random disturbances (ω(t), µ(t)) in the future pre-diction is zero. The projected control trajectory u(t) will be parameterized usingthe orthonormal functions described in section 4.2.2.

The control signal can be written as:

u(t) = [u1(t) u2(t) . . . ur(t)]T

and the input matrix B as:

B = [B1 B2 . . . Br]

where Bi is the i-th column of the B matrix. The i-th control signal ui(t) (i =1, 2 . . . r) is expressed as:

ui(t) ∼= Li(t)T ηi

where Li(t)T =[li1(t) li2(t) . . . liNi(t)

]and ηi =

[ξi1 ξi2 . . . ξiNi

]T. pi

and Ni are pre-chosen. Then the predicted future state at time ti + τ , X(ti + τ), is

X(ti + τ) = eAτX(ti)

+∫ τ

0

eA(τ−γ) [ B1L1(γ)T B2L2(γ)T ... BrLr(γ)T]ηdγ (4.30)

where the coe�cient vector ηT =[ηT1 ηT2 . . . ηTr

]Thas dimension

∑ri=1Ni.

Accordingly, the plant output prediction can be represented by

y(ti + τ) = CX(ti + τ) (4.31)

The major computation load in evaluating the prediction comes from the convolu-tion operation in (4.30), which requires the solutions of (n+ q)×

∑ri=1Ni integral

20

Page 23: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

equations. For a given τ , the integral equations can be solved numerically using�nite sum approximation. However, such a numerical approximation is unnecessaryand analytical solutions can be found for the convolution integral.

The convolution integral corresponding to the i-th input is de�ned as:

Iint(τ)i =∫ τ

0

eA(τ−γ)Bi Li(γ)T dγ (4.32)

where Iint(τ)i is a matrix with dimensionality of (n+ q)×Ni. Substituting this in(4.30) shows that the prediction of the future trajectory can be expressed in termsof Iint(τ)i with 1 ≤ i ≤ r. The matrix Iint(τ)i can be expressed as:

AIint(τ)− Iint(τ)ATp = −BL(τ)T + eAτBL(0)T (4.33)

where L(τ)T , L(0)T and Ap are de�ned by equations (4.17), (4.18) and (4.19). Uponobtaining the matrices Iint(τ)i for i = 1, 2, . . . , r, as outlined above, the predictionX(ti+τ) can be determined. With this the predicted plant output can be calculatedusing (4.31).

4.2.4 Optimal control strategy

To compute the optimal control a cost function has to be optimized. Suppose thata set of future setpoints r(ti + τ) =

[r1(ti + τ) r2(ti + τ) . . . rq(ti + τ)

],

0 ≤ τ ≤ Tp are available, where Tp is the prediction horizon. The common objectiveof model predictive control is to �nd the control law that will drive the predictedplant output y(ti + τ) as close as possible, in a least squares sense, to the futuretrajectory of the setpoint r(ti + τ). The equivalent cost function can be de�ned as:

J =∫ Tp

0

[r(ti+τ)−y(ti+τ)]TQ[r(ti+τ)−y(ti+τ)]dτ+∫ Tp

0

u(τ)TRu(τ)dτ (4.34)

where Q and R are symmetric matrices with Q > 0 and R ≥ 0. To simplify thetuning process, Q is set to the unit matrix I and R to zero. In [1] it is shown thatthe performance of the MPC is predominantly determined by tuning the values ofp and N and tuning of Q and R is therefore not necessary. The tuning of the MPCwill be done by changing the parameters p (poles of the Laguerre functions) and N(number of orthonormal functions).The cost function can be written as a function of η instead of y(ti + τ). Assumingfurther that the reference trajectory does not change within the prediction horizonTp, the quadratic cost function can be written as:

J = ηTΠη − 2ηT {Ψ1r(ti)−Ψ2X(ti)}+∫ Tp

0

wT (ti + τ)Qw(ti + τ)dτ (4.35)

where

Π =∫ Tp

0

φ(τ)Qφ(τ)T dτ + R

Ψ1 =∫ Tp

0

φ(τ)Qdτ ; Ψ2 =∫ Tp

0

φ(τ)QCeAτdτ

andR = diag (λiINi×Ni)

where λi are the eigenvalues of extended system matrix A and INi×Ni is the Ni×Niunity matrix.

21

Page 24: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

The minimum of (4.35), without hard constraints on the variables, is then given bythe least squares solution:

η = Π−1{Ψ1r(ti)−Ψ2X(ti)} (4.36)

The derivative of the control input u(t) can now be computed by:

u(ti) =

L1(0)T 0 . . . 0

0 L2(0)T . . . 0...

.... . .

...0 0 . . . Lr(0)T

Π−1{Ψ1r(ti)−Ψ2X(ti)} (4.37)

Integration gives the control law:

u(t) =∫ t

0

u (τ) dτ (4.38)

The cost function can be expanded by adding weighting to the terminal state [1],to guarantee closed-loop stability for continuous time model predictive control [18].

Because the cost function (4.35) is a quadratic function, it is relatively easy toput hard constraints on the output-, the control- and the �rst derivative of thecontrol variables. The optimization of the cost function, subject to a number ofinequality constraints is a standard quadratic programming problem. To form aset of inequality constraints for the output and control signals, discretization of thetrajectories is necessary.The bounds on the derivative of the control can be de�ned as:

ulow(ti + τi) ≤

L1(τi)T 0 . . . 0

0 L2(τi)T . . . 0...

.... . .

...0 0 . . . Lr(τi)T

η ≤ uhigh(ti + τi) (4.39)

where τi, i = 0, 1, . . . ,K, denotes the set of future time instants at which we wishto impose the limits on u. (4.39) yields a set of linear inequality equations. SinceLk(τ), k = 1, 2, . . . , r are the exponential functions, which guarantees the exponen-tial decay of u(ti + τ), it is necessary to apply the constraints only to the initialstage of the prediction horizon. This feature could potentially reduce the numberof constraints required.

Constraints on the control signal, the output variables and the system states canbe de�ned as follows:

ulow(ti + τi) ≤

∫ τi0L1(γ)T dγ 0 . . . 0

0∫ τi0L2(γ)T dγ . . . 0

......

. . ....

0 0 . . .∫ τi0Lr(γ)T dγ

η + u(ti −∆t)

≤ uhigh(ti + τi) (4.40)

where u(ti − ∆t) is the previous control signal. Simple computation shows that,with p and N suitably chosen,∫ τi

0

Lk(γ)T dγ =[A−1p (eApτi − I)L(0)

]T(4.41)

22

Page 25: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

where Ap is de�ned by equation (4.18). Thus, for a given set of time instants τi,equation (4.40) yields a set of linear inequality constraints on the control signal.

Xlow ≤ eAτiX(ti) +[Iint(τi)1 Iint(τi)2 . . . Iint(τi)r

]η ≤ Xhigh (4.42)

and

ylow ≤ CeAτiX(ti) + C[Iint(τi)1 Iint(τi)2 . . . Iint(τi)r

]η ≤ yhigh (4.43)

The whole procedure described above assumes that the states at time ti are known.In general it is not possible to measure the state of a plant. The standard approachis the use of an observer to estimate te state variables X(ti) [24, 25]. The observerequation that is needed for the implementation of the continuous time MPC is givenby:

˙X(t) = AX(t) +Bu(t) + Job(y(t)− CX(t)) (4.44)

Here X(t) is the estimate of X(t) and Job is the observer gain. u(t) is deter-mined from the optimal solution of the model predictive control strategy, eitherusing the analytical solution or a quadratic programming approach. The observercan be designed using a continuous time steady-state Kalman �lter or using othertechniques such as pole assignment. Here, Job is calculated recursively using aKalman �lter. The iterative solution of the Riccati equation is not required inreal-time. The observer gain is calculated o�-line. Provided that the system model(A,B,C,D) is completely observable, in theory, Job can be chosen such that theerror, X(t) = X(t) − X(t), decays exponentially at any desired rate. However, inpractice, the observer gain Job is often limited by the existence of measurementnoise.

23

Page 26: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Chapter 5

Simulations and results

5.1 Model selection

From the original twelve outputs:

Y =[nx ny nz VT α β P Q R φ θ ψ

]Tof the Ariel model, up

to 4 outputs can be selected for tracking, to satisfy the condition that the extendedstate space system must be both observable and controllable to be able to track theselected outputs [26].

Several linearized models are obtained by linearizing at di�erent trim conditionsfor steady wings level �ight. In table 5.1 a list of the di�erent operating points isshown. The exact trim conditions can be found in appendix D. Di�erent altitudes(100, 1000 and 5000 m) and velocities (30 and 55 m/s) are selected.

The rank of the controllability matrix is smaller than the rank of matrix A forthe higher velocity. This is because the constraints on the aircraft are active in thenonlinear Ariel model. At this trim condition the throttle is at its maximum, thusbeing unable to increase the velocity. This results in a bad controllability condition,implying that tracking of the selected outputs is not possible, but simulations showthat it is still possible to operate at this condition, as long as no increase in throttleis required.

Altitude [m] Velocity [m/s] Rank A obsv ctrb100 30 10 13 12100 55 10 13 51000 30 10 14 121000 55 10 13 55000 30 10 14 145000 55 10 13 8

Table 5.1: Observability and controllability of di�erent linearized models

Simply put, by introducing the extended state space model, the selected trackingoutputs become part of the state space system. If the extended system is observ-able and controllable, then all the (extended) states can be controlled. This meansthat the selected outputs can be controlled. Given the fact that there are four con-trol inputs, it seems logical that it is possible to control a maximum of four outputs.

If more then 4 outputs are selected for the extended state space system, the observ-

24

Page 27: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

ability and controllability conditions are no longer satis�ed and the outputs andstates of the original system can no longer be controlled and/or tracked. Therefore,the maximum number of outputs that can be selected for this particular system isequal to four. Other systems may be able to include more or less outputs, depend-ing on the speci�c system dynamics.

All the simulations are done by using one linearized time invariant model. For bet-ter performance and more reliable results, a switching controller can be designed,which switches between di�erent linearized models when the operating conditionsof the aircraft change. Switching between di�erent models can cause instability,and care should be taken when a switching controller is applied that the overallstability of the system is maintained. However, to show that this control methodworks, this does not necessarily needs to be implemented. As can be seen in section5.4.1, only the magnitudes of the state space system di�er for the di�erent operatingconditions, the general dynamic behavior remains the same.

For the four outputs that are tracked, di�erent reference signals are de�ned. TheLTI model obtained by linearizing the Ariel model at 1000 m altitude and 30 m/svelocity is used in all the simulations. This model is speci�ed in appendix B andoperates at the following equilibrium point:

x0 =

26666666666666666664

UVWφθψPQRpN

pE

pD

37777777777777777775

=

26666666666666666664

300.0122.052

0000

0.068000

−1000

37777777777777777775

y0 =

26666666666666666664

nx

ny

nz

VT

αβPQRφθψ

37777777777777777775

=

26666666666666666664

0.0680

0.99830.070.068

00000

0.0680

37777777777777777775

u0 =

266664δT

δe

δa

δr

δf

377775 =

2666640.2382.7900.3280.061

1

377775

(5.1)

The reference signal is the change from the steady state operating conditions. Afterthe simulations, the values of the steady state operating conditions are added to thesystem states, outputs and controls to obtain the 'real', physical values that can befed into the nonlinear system. These 'real' values are the values shown in all thesimulation plots.

5.2 Output selection

One of the four outputs that needs to be selected is the yaw angle ψ. This is a prop-erty of this particular system and is needed, because otherwise the system needs tobe reduced by another state, ψ. Without being able to control the yaw angle of theaircraft, it is not possible to keep the aircraft from drifting o� course.

By doing di�erent simulations with di�erent selected outputs for tracking, it can beseen that not all output variables give the desired system performance. Comparetwo di�erent selections; in �gure 5.1 the outputs nx, ny, nz and ψ have been chosen.In �gure 5.2 the simulation results are shown when the outputs VT , φ, θ and ψ arechosen. To compare the performance, both times a step is put on the yaw angle.This way it is possible to compare the response of the system and the resulting

25

Page 28: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

actions of the four system inputs for the two selections.

Although the tracking in both scenarios is good, e.g. the outputs all follow thegiven setpoint (note that ny will also converge over time), the control e�ort and thee�ect on the internal states di�er. In appendix C the di�erence between the controle�orts and the states of the system can be seen. The control e�ort when choosingas reference output the three angles and the velocity for tracking, seems to give amore 'natural' aircraft control than the other selection of outputs. The step op theyaw angle is mainly taken care of by the rudder, which seems a logical control e�ort.

By selecting the accelerations as output, the step on the yaw angle results in amuch smaller e�ort of the rudder. The throttle and elevator also take hold of a bigpart of the total control e�ort. This seems a much less natural way of controlling anaircraft. Also, the response is much faster when the angles and velocity are selectedas output.

0 20 40 60 80 1000.04

0.05

0.06

0.07

0.08nx

[m/s

2 ]

0 20 40 60 80 100−0.015

−0.01

−0.005

0

0.005

0.01

0.015ny

0 20 40 60 80 1000.95

1

1.05nz

t [s]

[m/s

2 ]

0 20 40 60 80 100−0.5

0

0.5

1

1.5!

[°]

t [s]

Figure 5.1: Tracking of the outputs nx, ny, nz and ψ (solid: reference, dashed:control signal)

26

Page 29: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 5 10 15 2029.85

29.9

29.95

30

30.05

30.1VT

[m/s

]

0 5 10 15 20−0.02

−0.01

0

0.01

0.02

0.03

0.04!

[°]

0 5 10 15 200.01

0.02

0.03

0.04

0.05

0.06

0.07"

t [s]

[°]

0 5 10 15 20−0.5

0

0.5

1

1.5#

t [s]

Figure 5.2: Tracking of the outputs VT , φ, θ and ψ (solid: reference, dashed: controlsignal)

After comparing several possible output combinations, the following con�gurationscame out best:

Con�guration Outputs

1 VT φ θ ψ2 ny VT θ ψ3 VT P θ ψ

Table 5.2: Selected outputs

The choice of the outputs seems logical. It is important to keep track of the velocityVT to keep the aircraft �ying. The yaw angle ψ or the acceleration in y-direction nyseems a good choice to keep the aircraft on the right course. And the pitch angle θis a good choice to control the altitude of the aircraft. In the following simulations,the outputs of con�guration 1 have been chosen as controlled output variables.

5.3 Tuning

The behavior of the MPC can be changed by adjusting the location of the polesp, the order of the control trajectory N , the prediction horizon Tp, the weightingmatrices Q and R and the weighting matrix for the system inputs:

• parameter Tp : Prediction horizon;

• parameter p: Pole location of the Laguerre model for the projected controlsignal; also the key parameter for control horizon;

27

Page 30: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

• parameter N : Number of terms used in the Laguerre model to capture theprojected control signal;

• weighting matrices: Q and R. As mentioned in section 4.2.4, Q = I and R = 0to simplify the tuning procedures;

• weighting matrix W : When constraints are applied the e�orts of the controlsneed to be scaled.

Prediction horizon Tp: For a stable system, the prediction horizon is recom-mended to be chosen approximately equal to the open loop process settling time,i.e. the time that the response reaches 99 percent of its �nal value. For unstable andintegrating processes, Tp is recommended to be chosen depending on the value ofp, approximately equal to 10/p, i.e. larger than the time that the projected controlsignal e�ectively reaches a constant [1].

Pole location p: p is a tuning parameter for the closed-loop response speed. Largerp results in larger changes in the projected control signal in the initial period, andthus faster closed-loop response speed. The most e�ective tuning procedure for pis to start near the location of the plant dominant pole, and to then subsequentlyspeed up (or slow down) the closed-loop response by increasing (or decreasing) pto achieve the required performance. The upper performance limit is reached whenincreasing p no longer changes the closed-loop response speed. It was found thatan upper limit was reached for |p| > 0.1.

Parameter N : The parameter N stands for the number of terms that will beused in capturing the projected control signal. As N increases, the degrees of free-dom in describing the control trajectory increases. The control signal tends to bemore aggressive when N increases. It was found that up to N = 9 the speed of theresponse still increases quite signi�cantly. Increasing N further still gives a littlebit better results, but it is not really worth the extra computational e�ort for thesmall increase in response.

Weighting matrix W : When there are constraints active on the control sig-nal, these need to be scaled in such a was that the relative action of the controls isequally weighted. The constraints on the Ariel model are shown in table 5.3.

Value min max rate min rate maxδthrottle [% of max] 1 100 -200 200δelevator [

◦] -32 16 -250 250δaileron [◦] -16 16 -250 250δrudder [

◦] -16 16 -250 250

Table 5.3: Input constraints

These are weighted and scaled as follows:

W = (δe,max − δe,min) ·δt,max − δt,min 0 0 0

0 δe,max − δe,min 0 00 0 δa,max − δa,min 00 0 0 δr,max − δr,min

−1

(5.2)

28

Page 31: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

5.4 Simulations

5.4.1 Simulation without constraints

Several scenarios are simulated to show that the controller will always stabilize thesystem, if no constraints are applied. Here simulations are shown when 5 m/s stepsare put on the velocity until it reaches 55 m/s. As can be seen in �gure 5.3, thereference signal is very well tracked.

What can be seen, is that the value of input δt goes to 114%, which is higherthen the value at trim condition with a velocity of 55 m/s. With increased velocity,the pitch angle θ should be reduced to keep the aircraft at steady �ight. Withoutdecreasing the pitch angle the aircraft starts to climb, which seems a logical result.The di�erence in throttle input, pitch angle and elevator input between the twolinearized models both operating at 55 m/s can be seen in table 5.4.This di�erence originates from the di�erence of the atmospheric forces at di�erentvelocities, which are implemented in the nonlinear Simulink model by using lookuptables. The data in these tables was obtained by doing wind tunnel testing of theAriel aircraft by Crump [2]. The linearized model does not take this into accountand this is where the di�erence originates from.

Linearized model Operating velocity δt θ δe30 m/s 55 m/s 114 0.07 3.955 m/s 55 m/s 100 0.00 3.3

Table 5.4: Di�erence in operating values for di�erent models

0 20 40 6030

35

40

45

50

55

60VT

[m/s

]

0 20 40 60−0.02

0

0.02

0.04

0.06!

[°]

0 20 40 60−0.05

0

0.05

0.1

0.15"

t [s]

[°]

0 20 40 60−0.6

−0.4

−0.2

0

0.2#

t [s]

Figure 5.3: System outputs for simulation of steps on the velocity (solid: reference,dashed: control signal)

29

Page 32: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 20 40 600

50

100

150

200!throttle

[% o

f max

]

0 20 40 602.5

3

3.5

4!elevator

[°]

0 20 40 60−0.5

0

0.5

1!aileron

[°]

t [s]0 20 40 60

−10

−5

0

5

10

15

20!rudder

[°]

t [s]

Figure 5.4: System inputs for simulation of steps on the velocity

0 10 20 30 40 50 60980

1000

1020

1040

1060

1080

1100

1120pD

[m]

t [s]

Figure 5.5: Aircraft altitude for simulation of steps on the velocity

30

Page 33: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

5.4.2 Simulation with constraints

In reality, the aircraft controls are constrained. There are constraints on the maxi-mum and minimum values of the controls and on the control rates. The constraintsare listed in table 5.5. To make the e�ort of all the controls the same, the controlsare weighted so that the domain of each control input is valued equally.

Value min max rate min rate maxδthrottle [%ofmax] 1 100 -200 200δelevator [

◦] -32 16 -250 250δaileron [◦] -16 16 -250 250δrudder [

◦] -16 16 -250 250

Table 5.5: Input constraints

To see if the controller is capable of following a mission pro�le, two simulations aremade, one increasing the altitude of the aircraft, typically representing the climb tocruise altitude. A second simulation is done decreasing the altitude of the aircraft,e.g. for reconnaissance of the surroundings. The reference trajectory is, as men-tioned in section 5.1, superimposed to the steady state operating point of the LTIstate space model.

The reference and output trajectory, the controls and the altitude of the simulationare shown in �gures 5.6, 5.7 and 5.8 respectively, for the �rst simulation, where thealtitude of the aircraft is increased. The aircraft starts at 1000 m altitude at 30m/s, begins to climb with a 8◦ climbing angle, �ying 25 m/s and continues a steady�ight at 2500 m altitude at 45 m/s.

0 100 200 30025

30

35

40

45

50VT

[m/s

]

0 100 200 300−0.04

−0.03

−0.02

−0.01

0

0.01

0.02!

[°]

0 100 200 300−0.1

0

0.1

0.2

0.3

0.4"

t [s]

[°]

0 100 200 300−0.06

−0.04

−0.02

0

0.02

0.04#

t [s]

Figure 5.6: Aircraft climb; tracked outputs (solid: reference, dashed: control signal)

31

Page 34: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 100 200 3000

20

40

60

80

100!throttle

[% o

f max

]

0 100 200 3000

1

2

3

4!elevator

[°]

0 100 200 3000.2

0.4

0.6

0.8

1

1.2!aileron

[°]

t [s]0 100 200 300

−0.6

−0.4

−0.2

0

0.2!rudder

[°]

t [s]

Figure 5.7: Aircraft climb; constrained system inputs

0 50 100 150 200 250 300800

1000

1200

1400

1600

1800

2000

2200

2400

2600pD

[m]

t [s]

Figure 5.8: Aircraft climb; aircraft altitude

32

Page 35: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

In the second simulation, the altitude is decreased from 1000 m to 200 m. Thereference and output trajectory, the controls and the altitude are shown in �gures5.9, 5.10 and 5.11 respectively. The velocity increases during the descent to 45 m/s,and goes back to 30 m/s at the steady levelled �ight.

0 100 200 30030

35

40

45

50VT

[m/s

]

0 100 200 300−5

0

5

10x 10−3 !

[°]

0 100 200 300−0.3

−0.2

−0.1

0

0.1"

t [s]

[°]

0 100 200 300−0.02

−0.01

0

0.01

0.02#

t [s]

Figure 5.9: Aircraft descent; tracked outputs (solid: reference, dashed: controlsignal)

33

Page 36: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 100 200 3000

10

20

30

40!throttle

[% o

f max

]

0 100 200 3002.5

3

3.5

4

4.5

5

5.5!elevator

[°]

0 100 200 300−0.4

−0.2

0

0.2

0.4!aileron

[°]

t [s]0 100 200 300

0

0.1

0.2

0.3

0.4

0.5!rudder

[°]

t [s]

Figure 5.10: Aircraft descent; constrained system inputs

0 50 100 150 200 250 300100

200

300

400

500

600

700

800

900

1000

1100pD

[m]

t [s]

Figure 5.11: Aircraft descent, aircraft altitude

Note that the controls hit the constraints in both situations. In the �rst simulation,the throttle is fully open (100%), to reach the desired velocity as soon as possible. Inthe second simulation the throttle is completely closed (1%) when the aircraft startsthe descent, and goes down to zero several times after that to prevent the veloc-ity from increasing too much, while the elevator is e�ecting a change to steady �ight.

De�ning a good trajectory by hand is quite di�cult. An extra controller can bedesigned to translate for instance a list of way points intro a trajectory for theoutputs that the MPC tracks. However, this does not lie within the scope of this

34

Page 37: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

research.

5.4.3 Simulation of failure

Another interesting feature of the model predictive controller with constraints ap-plied is the ability to simulate some kind of failure of one of the controls. Tosimulate one of the controls becoming 'stuck' for instance, the minimum and max-imum on the input constraint is set to zero. This capability makes the modelpredictive control scheme useful for fault-tolerant control applications, within cer-tain limits. The limitation is that the control can only be 'stuck' at it's equilibrium,e.g. u = ufixed = u0. Using a di�erent value for ufixed requires a state space modelwhich is linearized at a di�erent operating point, which takes into account the factthat one of the controls has a di�erent numerical value.

In this simulation the aileron is assumed to be stuck at its initial value, and thismeans the controller cannot change the banking angle by means of adjusting theailerons any more. The simulation shows that the airplane is still capable of �ying.Although the maneuverability of the airplane is limited, it is still able to �y in astable, steady �ight, allowing the UAV to return home for instance. The simulationhas been made with and without the failure of the ailerons. The di�erence in thetracking of the reference signal and the control inputs can be seen in �gures 5.12and 5.13.

Although the response is not as good without the aileron working, the aircraftis still able to follow the reference trajectory. The control signal of the throttle andthe rudder changes to compensate for the failed ailerons.

It will also be interesting to investigate how a random value for one of the con-trols a�ects the aircraft model. This can simulate one of the controls being 'free' tomove, e.g. when a controller cable has failed. The movement of the control surfacewill not be completely random however, and more research needs to be done toinvestigate the 'free' movement of one of the control surfaces.

35

Page 38: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 20 40 6030.05

30.06

30.07

30.08

30.09VT

[m/s

]

0 20 40 60−0.01

0

0.01

0.02

0.03

0.04

0.05!

[°]

0 20 40 600.06

0.065

0.07

0.075

0.08

0.085"

t [s]

[°]

0 20 40 60−0.05

0

0.05

0.1

0.15#

t [s]

Figure 5.12: Tracked outputs (solid:reference, dashed: without failure, dash-dotted:with failure)

0 20 40 6022

23

24

25

26!throttle

[% o

f max

]

0 20 40 602.7

2.72

2.74

2.76

2.78

2.8

2.82!elevator

[°]

0 20 40 60

0.35

0.4

0.45

0.5!aileron

[°]

t [s]0 20 40 60

−4

−3

−2

−1

0

1

2!rudder

[°]

t [s]

Figure 5.13: System inputs (dashed: without failure, dash-dotted: with failure)

36

Page 39: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Chapter 6

Conclusions and

recommendations

6.1 Conclusions

In this report a continuous time model predictive controller is built, which uses or-thonormal functions to describe the control signal. A multi-input-multi-output lin-ear time invariant state space system is derived from a nonlinear MATLAB Simulinkmodel of an unmanned aerial vehicle. Constraints are applied to the controls and itis shown that the model predictive controller is also capable of fault tolerant controlwithin certain limits.

Control of a UAV by means of a model predictive controller works well. It isshown that by using the MPC discussed in this report, it is possible to track agiven reference signal if no constraints are active. The continuous time MPC whichuses orthonormal functions to describe the control signal has not been used beforeto control a complex 4-input-4-output system like the aircraft model presented here.

Adding constraints on the controls, inputs and outputs of the aircraft model iseasy. Simulations show that the application of 'hard' constraints works very well.The controller will never override the applied constraints. It should be noted thatwhen the constraints are active, the aircraft model is no longer able to follow anygiven reference signal. There are limits to what the aircraft model is still capableof. If the constraints are hit for a long period of time, the controller tries to reachits objective by changing the other controls. For example, by setting a big stepon the velocity, the controller will not just raise the throttle to its maximum andwait patiently for the aircraft model to reach the desired velocity, but it will pitchthe aircraft in a downwards motion to speed up the acceleration process. This is alogical result from the optimization algorithm, but in general this behavior is notdesired.

The work presented in this report shows that the continuous time MPC using or-thonormal functions to describe the control signal, gives good performance whenapplied to the linear time invariant state space system derived from operating at thesteady wings-level �ight trim condition. To use this controller for the entire �ightscope of the aircraft, a MPC capable of handling time-varying state space systemsneeds to be designed to handle the trim conditions which result in time-varyingstate space systems.

37

Page 40: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

6.2 Recommendations

To obtain a good trajectory following solution, a second (MPC) controller can bewrapped around the one presented here. This second controller can translate forinstance a given set of way-points, into an optimized North-East-Down and velocityvector, varying over time. This trajectory must then be translated into the trackedoutput variables of the system. The here presented MPC will assure that the air-craft model will smoothly follow the given trajectory and will also make the UAVrobust to failure of any of the aircraft controls, within certain limits.

Another possible re�nement is to make a switching controller that switches betweendi�erent linearized models for di�erent operating conditions. The linearized modelsare typically not valid for the whole mission scope, and switching between statespace models is necessary to assure good and reliable performance. It should benoted that a switching controller can cause instability of the whole system. There-fore care should be taken when implementing such a controller to assure stability ofthe aircraft model. A switching controller can be implemented within the MATLABSimulink environment.

Finally, to make trajectory following easier to implement, the Simulink Aerospacetoolbox can be used to translate between a reference trajectory of North-East-Downcoordinates and the Euler angles to the selected reference model outputs. It is alsopossible to link this to the FlightGear �ight simulation software to make a visualpresentation of the simulation.

38

Page 41: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Appendix A

Time dependent A matrix

(c = cos, s = sin, tn = tan)

A(t) =

2666666666666666664

0 R −Q 0 −9.81cθ 0 0 −W V 0 0 0−R 0 P 9.81cφcθ −9.81sφsθ 0 W 0 −U 0 0 0Q −P 0 −9.81sφcθ −9.81cφsθ 0 −V U 0 0 0 00 0 0 0 p1 0 1 tnθsθ −tnθcθ 0 0 00 0 0 −Rcφ −Qsθ 0 0 cθ −sφ 0 0 0

0 0 0 Qcφ−Rsφcθ

Qsφ+Rcφcθ2sθ

0 0 sφcθ

cφcθ 0 0 0

0 0 0 0 0 0 c2Q c1R + c2P c1Q 0 0 00 0 0 0 0 0 c5R− 2c6P 0 c5P + 2c6R 0 0 00 0 0 0 0 0 c8Q c8P − c2R −c2Q 0 0 0

cθcψ p10 p11 p2 p3 p4 0 0 0 0 0 0cθsψ p12 p13 p5 p6 p7 0 0 0 0 0 0−sθ sφcθ cφcθ p8 p9 0 0 0 0 0 0 0

3777777777777777775(A.1)

with:

p1 = (1 + tnθ2)Qsθ −Rcθ + tθQcθ +Rsθp2 = V (cφsθcψ + sφsψ) +W (cφsθcψ + cφsψ)p3 = −Usθcψ + V sφcθcψ) +Wsφcθcψp4 = −Ucθsψ + V (−sφsθsψ − cφcψ) +W (−sφsθsψ + sφcψ)p5 = V cφsθsψ +W (−sφsθsψ − cφcψ)p6 = −Usθsψ + V (sφcθsψ − sθcψ) +Wcφcθsψp7 = Ucθcψ + V (sφsθcψ − cθsψ) +W (cφsθcψ + sφsψ)p8 = V cφcθ −Wsφcθp9 = −Ucθ − V sφsθ −Wcφsθp10 = sφsθcψ − cφsψp11 = sφsθcψ + sφsψp12 = sφsθsψ + cθcψp13 = cφsθsψ − sφcψ

39

Page 42: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Appendix B

LTI Ariel model

The time invariant Ariel model linearized at trim condition

x0 =

2666666666666666664

UVWφθψPQRpN

pE

pD

3777777777777777775

=

2666666666666666664

300.0122.052

0000

0.068000

−1000

3777777777777777775

y0 =

2666666666666666664

nx

ny

nz

VT

αβPQRφθψ

3777777777777777775

=

2666666666666666664

0.0680

0.99830.070.068

00000

0.0680

3777777777777777775

u0 =

26664δTδeδaδrδf

37775 =

266640.2382.7900.3280.061

1

37775

Am =

2666666666666666664

−0.075 −0.001 0.408 0 −2.056 0.012 0 −9.787 0 0 0 00.000 −0.529 0 2.478 0 −29.208 9.787 0 0 0 0 0−0.431 −0.021 −3.243 −0.014 28.637 −0.001 0 −0.669 0 0 0 −0.001−0.030 −0.156 0.018 −7.681 −0.089 0.615 0 0 0 0 0 00.037 0.019 −0.161 0.001 −2.967 −0.525 0 0 0 0 0 0−0.004 0.504 0.006 −2.001 −0.349 −1.702 0 0 0 0 0 0

0 0 0 1 0 0.068 0 0 0 0 0 00 0 0 0 1 0 0 0 0 0 0 00 0 0 0 0 1.002 0 0 0 0 0 0

0.998 0 0.068 0 0 0 0.001 0 −0.012 0 0 00 1 0 0 0 0 −2.052 0 30.07 0 0 0

−0.068 0 0.998 0 0 0 0.012 −30.07 0 0 0 0

3777777777777777775

Bm =

2666666666666666664

3.651 0.012 0 0 0.0090 0 −0.003 0.119 0

0.011 −0.215 0 0 −2.8901.146 0.002 −1.183 0.033 0−1.032 −0.473 0 0 0.6400.128 0 −0.126 −0.299 0

0 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 0

3777777777777777775

40

Page 43: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Cm =

2666666666666666664

−0.0080 0 0.042 0 0 0 0 0 0 0 0 00 −0.054 0 0.043 0 0.081 0 0 0 0 0 0

0.044 0.002 0.331 0 0.139 0 0 0 0 0 0 00.997 0 0.068 0 0 0 0 0 0 0 0 0−0.002 0 0.033 0 0 0 0 0 0 0 0 0

0 0.033 0 0 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 0 0 0 00 0 0 0 1 0 0 0 0 0 0 00 0 0 0 0 1 0 0 0 0 0 00 0 0 0 0 0 1 0 0 0 0 00 0 0 0 0 0 0 1 0 0 0 00 0 0 0 0 0 0 0 1 0 0 0

3777777777777777775

Dm =

26666666666666664

0.372 0.001 0 0 0.0010 0 0 0.012 0

−0.001 0.0223 0 0 0.2950 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 0

37777777777777775

41

Page 44: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Appendix C

Controls and states scenario 1

and 2

0 20 40 60 80 10022

24

26

28

30

32

34!throttle

[% o

f max

]

0 20 40 60 80 1002.6

2.65

2.7

2.75

2.8

2.85!elevator

[°]

0 20 40 60 80 100−0.5

0

0.5

1!aileron

[°]

t [s]0 20 40 60 80 100

−0.3

−0.2

−0.1

0

0.1!rudder

[°]

t [s]

Figure C.1: Control e�orts for outputs nx, ny, nz and ψ

42

Page 45: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 5 10 15 2010

15

20

25!throttle

[% o

f max

]

0 5 10 15 201.8

2

2.2

2.4

2.6

2.8!elevator

[°]

0 5 10 15 200

0.5

1

1.5

2!aileron

[°]

t [s]0 5 10 15 20

−40

−30

−20

−10

0

10!rudder

[°]

t [s]

Figure C.2: Control e�orts for outputs VT , φ, θ and ψ

0 50 10030

31

32

33U

[m/s

]

0 50 100−0.5

0

0.5V

0 50 1001.8

2

2.2W

0 50 100−0.1

0

0.1

0.2

P

[°/s]

0 50 100−0.02

0

0.02Q

0 50 100−0.05

0

0.05

0.1

R

0 50 100−0.2

0

0.2

0.4

!

[°]

t [s]0 50 100

0

0.1

0.2"

t [s]0 50 100

0

0.5

1

1.5#

t [s]

Figure C.3: States for outputs nx, ny, nz and ψ

43

Page 46: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

0 10 2029.85

29.9

29.95

30

30.05U

[m/s

]

0 10 20−20

−10

0

10V

0 10 201.5

2

2.5W

0 10 20−0.1

0

0.1P

[°/s]

0 10 20−0.1

0

0.1Q

0 10 20−0.5

0

0.5

1

1.5R

0 10 20−0.02

0

0.02

0.04!

[°]

t [s]0 10 20

0

0.02

0.04

0.06

0.08"

t [s]0 10 20

0

0.5

1#

t [s]

Figure C.4: States for outputs VT , φ, θ and ψ

0 10 20 30 40 50 60 70 80 90 1000

200

400

600

800

1000

1200

1400

1600

1800

2000pD

[m]

t [s]

(a) scenario 1

0 2 4 6 8 10 12 14 16 18 200

200

400

600

800

1000

1200

1400

1600

1800

2000pD

[m]

t [s]

(b) scenario 2

Figure C.5: State pD

44

Page 47: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Appendix D

Trim conditions

Operating point outputs controlsalt [m] vel [m/s] VT [m/s] φ [rad] θ [rad] ψ [rad] δt [%] δe [rad] δa [rad] δr [rad]

100 30 30.05 0 0.06 0 23 2.90 0.31 0.051000 30 30.07 0 0.07 0 24 2.79 0.33 0.065000 30 30.24 0 0.13 0 32 1.84 0.47 0.11100 55 54.51 0 0 0 100 0 0 01000 55 54.55 0 0 0 100 3.36 0.24 0.015000 55 54.68 0 0.01 0 100 3.33 0.24 0.02

Table D.1: Operating conditions

45

Page 48: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

Bibliography

[1] L. WangContinuous time model predictive control design using orthonormal functionsInternational Journal of Control, Vol. 74(16), 1588-1600, 2001.

[2] M. R. CrumpThe dynamics and control of catapult launching unmanned air vehicles frommoving platformsTechnical report, Royal Melbourne Institute of Technology, 2002.

[3] D. H. Shim, H. J. Kim and S. SastryDecentralized Nonlinear Model Predictive Control of Multiple Flying Robotsin Dynamic EnvironmentsIEEE Conference on Decision and Control, December 2003.

[4] R. Howard and I. KaminerSurvey of unmanned vehiclesIn Proceedings of the American Control Conference Vol. 5: 2950-2953, 1995.

[5] R. MooreUnmanned air vehicles - a prospectusAerospace America, Vol. 27: 26-28, February, 1989.

[6] K. WongUnmanned aerial vehicles (UAVs) - are they ready this time? are we?Technical report, RAES Sydney Branch, 1997.

[7] K. Wong and C. BilUav's over Australia- market and capabilitiesIn Bristol RPV/UAV Systems Conference, 1998.

[8] L. Thompson, S. Abanteriba, and C. BilA multipurpose autonomous �ight vehicle systemTechnical report, RMIT Wackett Centre, 1995.

[9] D. L. Juul, M. McDermott, E. L. Nelson, D. M. Barnett, and G. N. WilliamsSubmersible control using the linear quadratic gaussian with loop transfer re-covery methodIn IEEE Sympsium on Autonomous Underwater Vehicle Technology, pp. 417-425, 1994.

[10] D. Newman and K. WongSix Degree of Freedom Flight Dynamic and Performance Simulation of aRemotely-Piloted VehicleTechnical report, The University of Sydney, 1993.

46

Page 49: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

[11] Warren F. PhillipsMechanics of �ightHoboken, New York: Wiley, 2004.

[12] C. E. García, D. M. Prett, M. MorariModel predictive control: Theory and practice�a surveyAutomatica, Vol. 25(3): 335-348, 1989.

[13] N. L. RickerModel predictive control: State of the artIn Y. Arkun W. H. Ray (eds), Chemical Process Control�CPC IV, FourthInternational Conference on Chemical Process Control, Elsevier, Amsterdam,pp. 271-296, 1991.

[14] M. Morari, J. H. LeeModel predictive control: The good, the bad, and the uglyIn Y. Arkun W. H. Ray (eds), Chemical Process Control�CPC IV, FourthInternational Conference on Chemical Process Control, Elsevier, Amsterdam,pp. 419-444, 1991.

[15] K. R. Muske, J. B. RawlingsModel predictive control with linear modelsAIChE J. Vol. 39(2): 262-287, 1993.

[16] J. B. Rawlings, E. S. Meadows, K. R. MuskeNonlinear model predictive control: A tutorial and surveyADCHEM '94 Proceedings, Kyoto, Japan, 1994.

[17] M. J. MaciejowskiPredictive Control: with constraintsPearson Education Limited, England: Harlow, 2001.

[18] H. Demircioglu, D. W. ClarkeCGPC with guaranteed stability propertiesIEEE Proceedings, Pt. D. Vol. 139, 371-380, 1992.

[19] H. Demircioglu, P. J. GawthropContinuous time generalized predictive controlAutomatica. Vol. 27, 55-74, 1991.

[20] H. Demircioglu, P. J. GawthropMultivariable continuous time generalized predictive controlAutomatica. Vol. 28, 697-713, 1992

[21] P. J. GawthropLinear predictive pole-placement control: practical issues39th IEEE Cenference on Decision and Control. Sydney, Australia, pp. 160-165,2000.

[22] Y. W. LeeStatistical Theory of CommunicationNew York: Wiley, 1960.

[23] C. R. WylieAdvanced Engineering MathematicsNew York: McGraw-Hill, 1960.

47

Page 50: Design of a model predictive controller to control UAVs - · PDF file · 2008-01-21Design of a model predictive controller to control UAVs ... 3 Flight dynamics 7 ... The two most

[24] T. KailathLinear systemsEnglewood Cli�s, New Jersey: Prentice-Hall, 1980.

[25] G.C. Goodwin, S. Graebe, M. SalgadoControl System DesignEnglewood Cli�s, New Jersey: Prentice-Hall, 2000.

[26] L. WangModel Predictive Control System Design and Implementation using MATLABIn preparation. Publisher: Springer-Verlag, 2007.

48