• No results found

Robust Control of Teleoperated Unmanned Aerial Vehicles

N/A
N/A
Protected

Academic year: 2022

Share "Robust Control of Teleoperated Unmanned Aerial Vehicles"

Copied!
53
0
0

Loading.... (view fulltext now)

Full text

(1)

IN

DEGREE PROJECT ELECTRICAL ENGINEERING, SECOND CYCLE, 30 CREDITS

STOCKHOLM SWEDEN 2020,

Robust Control of

Teleoperated Unmanned Aerial Vehicles

CHUNYANG HAN

KTH ROYAL INSTITUTE OF TECHNOLOGY

(2)
(3)

A BSTRACT

In this thesis, we first use the reachability theory to develop algorithms for state predic- tion under delayed state or output measurements. We next develop control strategies for collision avoidance and trajectory tracking of UAVs based on the devised algorithms and the model predictive control theory. Finally, simulations results for collision avoidance and trajectory tracking problems are presented, for different communication delays, using a UAV model with 6 degrees of freedom.

Keyword

communication delay, Model Predictive Control, linear discrete control system, reacha- bility of target set and target tube

(4)
(5)

S AMMANFATTNING

I denna avhandling använder vi först tillgänglighetsteorin för att utveckla algoritmer för tillståndsförutsägelse under fördröjda tillstånds- eller utgångsmätningar. Därefter utvecklar kontrollstrategier för undvikande av kollision och spårning av UAV: er baser- ade på de planerade algoritmerna och modellen förutsägbar kontrollteori. Slutligen presenteras simuleringsresultat för att undvika kollision och problem med spårning av banan, för olika kommunikationsförseningar, med en UAV-modell med 6 frihetsgrader.

Keywords

kommunikationsfördröjning, Model Predictive Control, linjärt diskret styrsystem, mål- sättning och målrörs tillgänglighet

(6)
(7)

T ABLE OF C ONTENTS

Page

List of Tables vii

List of Figures ix

1 Introduction 1

1.1 Motivation . . . 1

1.2 Related Work . . . 2

1.2.1 Reachability Analysis of Linear System . . . 2

1.2.2 Control of UAV under Delay . . . 3

1.3 Objectives . . . 3

1.4 Contributions . . . 4

2 Theory 7 2.1 State Prediction under Communication Delay . . . 7

2.1.1 State Estimation Using Initial Condition . . . 8

2.1.2 State Prediction with Delayed State Measurements . . . 8

2.1.3 State Prediction with Delayed Output Measurements . . . 11

2.2 Comparison between State Estimation Using Initial Condition and State Prediction with Delayed State Measurements . . . 13

3 Application 15 3.1 Background . . . 15

3.1.1 Model Predictive Control . . . 15

3.1.2 Reachability Analysis Toolbox . . . 20

3.1.3 Optimization Modeling Toolbox . . . 21

3.2 Algorithm . . . 21

3.3 Simulation . . . 25

(8)

TABLE OF CONTENTS

3.3.1 Collision Avoidance with Communication Delay . . . 25 3.3.2 Tracking Problem with Communication Delay . . . 27

4 Conclusion and Future Development 33

Bibliography 35

A Appendix 37

A.1 Computation for Hyperplanes . . . 37

vi

(9)

L IST OF T ABLES

TABLE Page

3.1 Parameters for collision avoidance with communication delay . . . 25

(10)
(11)

L IST OF F IGURES

FIGURE Page

1.1 Time delayed control system in UAV . . . 4

2.1 Delayed state information . . . 9

2.2 Discrete-time UAV system using initial condition . . . 14

2.3 Discrete-time UAV system with delayed information . . . 14

3.1 MPC: receding horizon principle [1] . . . 16

3.2 MPC (or RHC): computation timeline [2] . . . 19

3.3 Reachable set with hyperplane . . . 26

3.4 Collision avoidance examples . . . 26

3.5 Video screenshots for different tracking problems . . . 27

3.6 Tracking problem 1 (delayed timeτu= 1 , τd= 1 ) . . . 28

3.7 Tracking problem 2 (delayed timeτu= 2 , τd= 2 ) . . . 29

3.8 Tracking problem 3 (delayed timeτu= 3 , τd= 1 ) . . . 30

3.9 Tracking problem 4 (delayed timeτu= 1 , τd= 1 ) . . . 31

A.1 Notation of an ellipsoid . . . 38

A.2 Hyperplane examples . . . 38

(12)
(13)

L IST OF A LGORITHMS

1 State prediction with delayed state measurements . . . 10

2 State prediction with delayed output measurements . . . 13

3 Algorithm with MPC in collision avoidance problem . . . 23

4 Algorithm with MPC in tracking problem . . . 23

5 Algorithm with MPC and state prediction . . . 25

(14)
(15)

C

HAPTER

1

I NTRODUCTION

1.1 Motivation

Unmanned aerial vehicles (UAVs) are flying robots which can be controlled by a human operator or a remote controller while teleoperated unmanned aerial vehicles (TUAVs) are flying robots which can be controlled remotely while flying. When it comes to drones for entertainment purpose, generally they can fly within a short time and a short control distance. However, the advanced teleoperated unmanned aerial vehicles which can be controlled from a relatively long distance are equipped with excellent flight capabilities because of their light weight, flexible shape and other advantageous properties. They can be used in remote surveillance applications which demand them to hover for hours and can receive controlled information from a very long distance.

TUAVs are also allowed to be equipped with many advanced equipment, such as GPS guided missiles, sensors, cameras, navigation systems and Global Positioning Systems (GPS), which also improve their capability for locating and detecting in remote surveillance situations. For example, in firefighting situation, TUAVs are used to test the amount of CO, CO2, etc gases in air with certain equipment [3]. In research work, they help scientists to investigate different kinds of occurrences in a certain environment that is dangerous and inaccessible for human operators and other robots. For instance, they are implemented in measuring contamination in nuclear accidents, observing volcanic eruptions, etc [3].

In these applications, communication links convey control commands and sensors’

(16)

CHAPTER 1. INTRODUCTION

measurements between TUAVs and remote controllers or human operators. As a result, the closed-loop performance of systems comprising TUAVs highly depends on the quality of the communication links. For example, the performance heavily degrades in presence of time-varying communication delays and packet drops. The idea of this thesis is to improve the closed-loop performance of these systems against uncertainties imposed by communication links. The more precise the time-delayed control model is, the better the closed-loop performance of systems will be.

1.2 Related Work

The research for teleoperated unmanned aerial vehicles has become more and more popular in recent years and the topic of designing time delayed control system has been discussed in many research articles. This literature provides different models from different dynamic systems to solve this time delayed problem.

1.2.1 Reachability Analysis of Linear System

The uncertainty can be disturbance in the dynamics of system, and disturbances can affect the state or output measurements. In uncertain dynamic systems, the feedback control may be generated under a condition that the system state is restricted to stay in a specific region of state space, and the state space can only be expressed by input and observation disturbances [4]. In the paper [4], the closed-loop control of discrete-time systems with uncertainty is discussed. In the first part, the paper talks about under the worst disturbances of system dynamics, how to put the system state at the final time in a given set, which is called a target set. In the second part, the paper gives a target tube, and talks about the approach to keeping the system state trajectory in the target tube.

In the last part, the paper shows the sufficient and necessary conditions for reachability of a target set and a target tube, as long as the system state can be measured exactly [4].

According to paper [5], the reachability analysis for nonlinear dynamical systems can also be achieved by solving appropriate Hamilton-Jacobi equations. This approach provides a very efficient tool to deal with many applications regarding reachability, such as path planning with collision avoidance. Classic schemes of solving Hamilton-Jacobi equation are based on Finite Differences, Semi-Lagrangian approximations which are generally used for solving Partial Diffential Equation (PDE) and so on. The solutions of these schemes can be very stable.

2

(17)

1.3. OBJECTIVES

In paper [6], the approach to computing reachable sets for discrete time linear control systems is described. For the discrete time control system with time-varying coefficients, the computation of the reachable sets can be approximated by ellipsoidal bounds from both initial conditions and feedback controls of the system. In paper [7], it provides a way to compute the ellipsoid more precisely. The paper constructs external and internal ellipsoidal approximation which can touch the reachable sets boundary from both inside and outside. For implementation of computing reachable sets, "ellipsoidal tool" package in MATLAB is designed to generate the approximate reachable ellipsoidal sets [8].

1.2.2 Control of UAV under Delay

Because of delayed state information and outdated control feedback, the stability of the UAV control system will be affected by communication delay. Although many of time delayed control algorithms have been came up with to solve the communication delay problem, most of studies have assumed that the communication delay is constant or the system dynamics is known and simple. But because of UAVs’ time-sensitive and nonlinearity characteristics, the assumptions are not proper to apply for UAVs’ systems.

In paper [9], it came up with a time delayed control system under communication delay by using Model Predictive Control (MPC). It is then extended to learn an unknown nonlinear model by using Gaussian Process (GP), which increase the accuracy of computing state estimation and trajectory planning under communication delay.

Furthermore, the paper [10] also provides different ways to build up a networked control model under communication delay. In this paper, it proposes two time delayed models for multi-rotor system under communication delay. The first one is using linear robust MPC with disturbance and the second one is using nonlinear MPC without disturbance. By implementing state estimation to the MPC method with Robot Operating System (ROS) [10], this paper also provides a way to achieve trajectory tracking for both multi-rotor UAV and fixed-wing UAV. In the paper [11], it describes a linear system without disturbance and proposes a block diagram model which exploit the structure of uncertainty to compensate the impact of communication delay.

1.3 Objectives

We consider the remote control of a plant over a common custom network as shown in Figure 1.1, The controller receives sensor measurements with delay and the actuator

(18)

CHAPTER 1. INTRODUCTION

receives the controller commands with delay. The objective of this thesis is to improve the closed-loop performance of UAVs against communication delay. This is achieved by developing state prediction algorithms with delayed state or output measurements.

By estimating forward state prediction with delayed state measurements and using Linear Model Predictive Control method, we compensate the impact of uncertainties imposed by communication links. The model is used to implemented two applications, such as collision avoidance under communication delay and tracking problem under communication.

Figure 1.1: Time delayed control system in UAV

1.4 Contributions

The contributions of this thesis are organized as follows:

1. Chapter 2 introduces the theory for predicting reachable sets under delayed state or output measurements.

2. In Chapter 3, the algorithms which are used for predicting state sets and also form- ing trajectories of UAVs are implemented to two applications, including collision avoidance with communication delay in two UAVs and tracking problems in two

4

(19)

1.4. CONTRIBUTIONS

UAVs with communication delay. Furthermore, simulation results for the work above are also showed.

3. In Chapter 4, conclusions based on the simulation results and suggestions for future work are discussed.

(20)
(21)

C

HAPTER

2

T HEORY

In this Chapter, we study the state estimation problem under communication delay, for discrete time system with state or output measurements.

2.1 State Prediction under Communication Delay

Let us consider the discrete-time system:

(2.1) xk+1= Akxk+ Gkwk

where Ak∈ Rn∗n, Gk∈ Rn∗p, state vector xk∈ Xk⊂ Rn(n-dimensional Euclidean space) and the disturbance wk is assumed to belong to a given bounded set Wk⊂ Rp. This is the system we use for state prediction. Notice that we introduce the state equations but there is no input in this system.

(22)

CHAPTER 2. THEORY

2.1.1 State Estimation Using Initial Condition

If we don’t know any information from the UAV plant, we assume the initial state set X0 is given, then

0= X0,

1= A00⊕ G0W0, Xˆ2= A11⊕ G1W1, ...

N= AN−1N−1⊕ GN−1WN−1 (2.2)

where ˆX0, ˆX1, ˆX2, ... ˆXN are estimated reachable state sets [4] at time step t=0,1,2,...N, respectively, and Wk is bounded set of disturbance. Notice that "⊕" here and in the following equations corresponds to set addition.

In this case, we can get the estimated sets of possible states. But as we know that the X0, G, Wk are all given bounded sets, the size of estimated reachable sets will increase with time, meaning that the estimator with only initial information is not accurate enough.

2.1.2 State Prediction with Delayed State Measurements

In this subsection, we assume that the estimator only has access to the delayed state measurements. Our objective is to design a state estimator with delayed state measure- ments.

Under communication delay, the estimator can get the corresponding delayed infor- mation at each time step, meaning that the estimator with communication delay can get only part of past state information, which means the estimation with communication delay is totally different from the situation without communication delay. We illustrate the state transmission under communication delay in Figure 2.1.

Next we derive the structure of state estimation with delayed state measurements.

In the case of communication delay, we assume that the delay isτ time steps, and at time step t = N we also assume that the initial state x0is given for both N ≤ τ and N ≥ τ + 1 situations.

For N ≤ τ, the estimator only knows initial state x0. From the linear system in Equa- tion 2.1, we know the corresponding state set at time step t = 0,1,2,...., N, respectively, as is shown in Equation 2.3:

8

(23)

2.1. STATE PREDICTION UNDER COMMUNICATION DELAY

Figure 2.1: Delayed state information

1= A0x0⊕ G0W0, Xˆ2= A11⊕ G1W1, ...

N= AN−1N−1⊕ GN−1WN−1 (2.3)

where ˆX1, ..., ˆXN−1, ˆXN are estimated reachable state sets at time step t = 1,..., N − 1, N, respectively, and W0, W1, ..., WN−1 are bounded set of disturbance at time step t = 0,1,..., N − 1, respectively.

For N ≥ τ + 1, the estimator has information from t = 0,1,2,...., N − τ. From the linear system in Equation 2.1, we know the corresponding state at time step t = 0,1,2,...., N − τ, respectively, which can be written as Equation 2.4:

x1= A0x0+ G0w0, x2= A1x1+ G1w1, ...

xN−τ= AN−τ−1xN−τ−1+ GN−τ−1wN−τ−1. (2.4)

To find the estimated reachable set at t = N, we compute the reachable sets with the given state measurements x0, x1, x2, ...., xN−τ. As is shown in Equation 2.5:

(24)

CHAPTER 2. THEORY

N−τ+1= AN−τxN−τ⊕ GN−τWN−τ,

N−τ+2= AN−τ+1N−τ+1⊕ GN−τ+1WN−τ+1, ...

N= AN−1N−1⊕ GN−1WN−1 (2.5)

where ˆXN−τ+1, ˆXN−τ+2, ..., ˆXN−1, ˆXN are estimated reachable state sets at time step t = N − τ + 1, N − τ + 2,..., N − 1, N, respectively, and WN−τ, WN−τ+1, ..., WN−1 are bounded set of disturbance at time step t = N − τ, N − τ + 1,..., N − 1, respectively.

From Equation 2.5, it is inferred that we can use the given state xN−τ to describe the estimated reachable set at time step t = N. As we can see in Equation 2.6, for state estimation with communication delay, the estimated reachable set ˆXN depends on the latest information the estimator receives according to delayed time steps τ and the disturbance of the system from time step t = N − τ, N − τ + 1,..., N − 1 when N ≥ τ + 1.

A(n,τ)=

N−1Y

i=N−(τ−n)

Ai,

N= A(0,τ)xN−τ⊕ A(1,τ)GN−τWN−τ⊕ A(2,τ)GN−τ−1WN−τ−1⊕ ....

⊕ A(τ−2,τ)GN−3WN−3⊕ A(τ−1,τ)GN−2WN−2⊕ GN−1WN−1. (2.6)

Equation 2.6 above expresses the structure of estimator with delayed state mea- surements. Next, we create an algorithm structure for this problem, as is showed in Algorithm 1:

Algorithm 1: State prediction with delayed state measurements

1 τ ← delayed time steps;

2 x0← initial state;

3 if N ≥ τ + 1 then

4 xN−τ← D iscretes ys_state(x0,τ);

5N← P rediction_state(xN−τ);

6 else

7N← P rediction_stateN ≤ τ(x0);

8 end

where "Discretesys _ state" is corresponding to Equation 2.1 and 2.4, "Prediction_state"

is corresponding to Equation 2.6, and "Prediction_stateN≤ τ" is corresponding to Equation 2.3.

10

(25)

2.1. STATE PREDICTION UNDER COMMUNICATION DELAY

2.1.3 State Prediction with Delayed Output Measurements

In this subsection, we assume that the estimator only has access to the delayed out- put measurements. Our objective is to design a state estimator with delayed output measurements.

Now let us concentrate on the case of the linear discrete system with output measure- ments:

xk+1= Akxk+ Gkwk zk= Hkxk+ vk

(2.7)

where Ak∈ Rn∗n, Gk∈ Rn∗p, Hk∈ Rm∗n, input disturbance wk∈ Wk⊂ Rp and measure- ment disturbance vk∈ Vk⊂ Rm are all given and xk∈ Xk⊂ Rnwith the initial condition x0contained in a given set X0⊂ Rn.

In the absence of communication delay, the set S0

k|kof estimated states xk, consistent with a given set of output measurements z1, z2, z3, ...., zkis given recursively by Equation 2.8 [4]:

S0

k|k= S0k|k−1∩ {xk: zk− Hkxk∈ Vk}, S0k|k−1= Ak−1S0k−1|k−1⊕ Gk−1Wk−1,

S00|0= X0, k = 1,2,.., N − 1, N.

(2.8)

In the case of communication delay, we assume that the delay isτ time steps, and at time step t = N we also assume that the initial state set X0is given for both N ≤ τ and N ≥ τ + 1 situations.

For N ≤ τ, since the estimator only knows the initial state set X0, we can use the method in Equation 2.8 to estimate the set Sk|0of estimated states xk in k = 1,2,.., N.

As is shown in Equation 2.9:

S0|0= X0,

S1|0= A0S0|0⊕ G0W0, S2|0= A1S1|0⊕ G1W1,

....

SN|0= AN−1SN−1|0⊕ GN−1WN−1. (2.9)

(26)

CHAPTER 2. THEORY

For N ≥ τ + 1, since the output measurements z1, z2, z3, ...., zN−τ are known, we can use the method in Equation 2.8 to estimate the set Sk|k of estimated states xk in k = 1,2,.., N − τ. The state set estimation can be expressed by:

S0|0= X0,

S1|0= A0S0|0⊕ G0W0,

S1|1= S1|0∩ {x1: z1− H1x1∈ V1}, ....

Sk|k−1= Ak−1Sk−1|k−1⊕ Gk−1Wk−1,

Sk|k= Sk|k−1∩ {xk: zk− Hkxk∈ Vk}, k = 1,2,.., N − τ.

(2.10)

In k = N − τ + 1,..., N, the set Sk|N−τof estimated states xk can be obtained by:

SN−τ+1|N−τ= AN−τSN−τ|N−τ⊕ GN−τWN−τ,

SN−τ+2|N−τ= AN−τ+1SN−τ+1|N−τ⊕ GN−τ+1WN−τ+1, ....

SN|N−τ= AN−1SN−1|N−τ⊕ GN−1WN−1. (2.11)

Then for N ≥ τ + 1, we can summarize the set SN|N−τ of estimated states xN given the information of output measurements z1, z2, z3, ...., zk−τ, as is shown in Equation 2.12:

A(n,τ)=

N−1Y

i=N−(τ−n)

Ai,

SN|N−τ= A(0,τ)SN−τ|N−τ⊕ A(1,τ)GN−τWN−τ⊕ A(2,τ)GN−τ−1WN−τ−1⊕ .... ⊕ A(τ−1,τ)GN−2WN−2⊕ GN−1WN−1.

(2.12)

Equation 2.12 above expresses the structure of estimator with delayed output mea- surements. Next, we present an algorithm structure for this problem, as is showed in Algorithm 2:

12

(27)

2.2. COMPARISON BETWEEN STATE ESTIMATION USING INITIAL CONDITION AND STATE PREDICTION WITH DELAYED STATE MEASUREMENTS

Algorithm 2: State prediction with delayed output measurements

1 τ ← delayed time steps;

2 X0← initial state set;

3 if N ≥ τ + 1 then

4 z1, z2, z3, ...., zk−τ← given set o f output measurements;

5 SN−τ|N−τ← D iscretes ys_output(X0, z1, z2, z3, ...., zk−τ,τ);

6 SN|N−τ← P rediction_output(SN−τ|N−τ);

7 else

8 SN|0← P rediction_outputN ≤ τ(X0);

9 end

where "Discretesys _ output" is corresponding to Equation 2.10 and Equation 2.7,

"Prediction_output" is corresponding to Equation 2.12, and "Prediction _ outputN≤ τ" is corresponding to Equation 2.9.

2.2 Comparison between State Estimation Using Initial Condition and State Prediction with Delayed State Measurements

Here we demonstrate the differences between state estimation using initial condition as we deduced in Equation 2.2 and state estimation with delayed state measurements as we deduced in Equations 2.4, 2.5 and 2.6.

Under the same dynamics and the same initial conditions, we estimate state reachable sets by initial condition as we can see in Figure 2.2, compared with state reachable sets estimation by delayed state information (communication delay isτ = 4) as we can see in Figure 2.3.

Because ofτ = 4, after time step = 4, the state estimations become larger and larger in Figure 2.2 estimated by initial conditions, while state estimations keep the same area in Figure 2.3 because the states are predicted by updated delayed state information. In a conclusion, the state estimation with delayed state measurement is more accurate than the state estimation using initial condition.

(28)

CHAPTER 2. THEORY

Figure 2.2: Discrete-time UAV system using initial condition

Figure 2.3: Discrete-time UAV system with delayed information

14

(29)

C

HAPTER

3

A PPLICATION

In this Chapter, we firstly introduce Model Predictive Control theory, YALMIP, MPT toolbox and ellipsoid toolbox. All of toolboxes are implemented in MATLAB R2017b. Then the algorithm and simulation results of two application examples are demonstrated.

3.1 Background

3.1.1 Model Predictive Control

Model Predictive Control (MPC) technique uses the dynamical model of the process to predict its output or state values and optimize the control signal. MPC computes the control signal by solving a finite-horizon optimization control problem at every sampling instant while satisfying a set of constraints. So far, MPC has been applied successfully to a variety of applications. For example, it can be used in the technology for advanced multivariable control applications such as trajectory optimization and tracking of drones and fine-tune steering of autonomous trucks. There are also many practical advantages that MPC can bring:

• Straightforward formulation and constraint enforcement based on well understood concepts

• Easy to tune parameters – Prediction horizon

(30)

CHAPTER 3. APPLICATION

– Parameters for optimization problem itself, such as the initial condition and system matrices.

• Computation time much shorter than most of other advanced control methods

MPC is also known as Dynamic Matrix Control (DMC), Generalized Predictive Control (GPC), and Receding Horizon Control (RHC). The basic idea behind MPC is to plan an optimal control sequence over a fixed horizon N by minimizing an objective function. At the initial step the control input is implemented to the dynamics of system, with the sampling system states, new control actions and new predicted states are generated. Then the computation of getting new control actions and new predicted sequence of states are repeated. Because the prediction horizon keeps moving forward, MPC is also called receding horizon control. [12] The receding horizon principle is illustrated in Figure 3.1.

Figure 3.1: MPC: receding horizon principle [1]

Unfortunately, even for linear systems and polyhedral state and control constraints, the optimal control policy is difficult to find. So instead of relying on dynamic program- ming and aiming for optimal policies, we will use the receding horizon principle to find policies that guarantee stability and have near-optimal performance [2]. Although this is not optimal, it has given very good results in practice. Nowadays, many of researchers in control field are still looking for faster and more stable methods to improve the MPC method.

16

(31)

3.1. BACKGROUND

3.1.1.1 General Formulation

The discrete dynamics of a system can be written as:

(3.1) x(k + 1) = fk(x(k), u(k)), t ≤ 0.

Denote the number of states to be n and the number of control inputs to be m, so x(k) ∈ Rn, u(k) ∈ Rm. At every time k, the MPC plans an optimal control sequence over a fixed horizon N. Here we introduce the notations:

(3.2) x(k + i|k), u(k + i|k), k = 0,1,.., N, i = 0,1,..N

for the prediction of system state and control actions at time k+i, given the information available about the system state and input at time t. The notations in Equation 3.2 are written by xk+i|k, uk+i|k shortly. Notice that the predicted states and control actions xk+i|k, uk+i|kshould be seen as possible future states and inputs over possible trajectories, they should be distinguished by the real states x(k) and control inputs u(k), denoted by xk, uk respectively.

Let us denote the sequences of states and control actions:

xk= {xk+1|k, xk+2|k, .., xk+N|k}, uk= {uk|k, uk+1|k, .., uk+N−1|k}.

(3.3)

We also need the system’s states and control inputs to satisfy the MPC’s constraints , which can be expressed generally as belonging to the sets:

x0∈ X0⊆ Rn, xk∈ X ⊆ Rn, uk∈ U ⊆ Rm. (3.4)

3.1.1.2 Linear MPC

The discrete dynamics of system is written as:

(3.5) xk+1= Akxk+ Bkuk

where state vector xk∈ Rn, control input vector uk∈ Rm, and A ∈ Rn∗n, B ∈ Rn∗m. Then the MPC can be expressed as a linear MPC and the system state and input constraints are also assumed to be linear. Constraints 3.4 can be expressed using matrices Mx, Muand vectors vx, vuas:

Mxxk+i≤ Vx, i = 1,2,.., N − 1 Muuk+i≤ Vu, i = 1,2,.., N − 1.

(3.6)

(32)

CHAPTER 3. APPLICATION

In addition, we impose an extra constraint on the terminal state by using matrix MN

and vector VN, denoted by

(3.7) MNxk+N≤ VN.

The objective function which is also called cost function is defined as a function of the initial state x0and the control input sequence {uk, uk+1, .., uk+N−1},

(3.8) VN(x0, u) =

N−1X

i=0

J(xk+i, uk+i) + JN(xk+N)

where the stage cost function J(xk, uk) is denoted to be a convex function.

In the linear case, we choose the stage cost function to be a linear quadratic function, denoted by

(3.9) J(xk, uk) = xTkQ xk+ uTkRuk, JN(xk+N) = xTk+NQNxk+N

where Q and QN are positive semidefinite matrices and R is a positive definite matrix.

Then the linear MPC problem is to solve the optimization problem 3.10 with optimal solution, which if exists, are a optimal state sequence and a optimal control action sequence.

(3.10)

minimize

u

N−1X

i=0

J(xk+i|k, uk+i|k) + JN(xk+N|k) subject to xk|k= x0,

xk+i+1|k= Akxk+i|k+ Bkuk+i|k, i = 1,..., N − 1 Mxxk+i|k≤ Vx, i = 1,..., N − 1

Muuk+i|k≤ Vu, i = 1,..., N − 1 MNxk+N|k≤ VN.

Regarding the definition of state and control input sequences 3.3, the optimal control action sequence and its corresponding state sequence can be showed as:

uk= {uk|k, uk+1|k, .., uk+N−1|k}, xk= {xk+1|k, xk+2|k, .., xk+N|k} (3.11)

where the first control action is applied as a real input, such as:

(3.12) uk= uk|k.

18

(33)

3.1. BACKGROUND

Further, the cost function evaluated using the optimal control input sequence is called the value function:

(3.13) VN0(x0) = VN((x0, u) where the optimal control input sequence is denoted as:

(3.14) u= {u1|1, u2|2, u3|3, .., uk|k, uk+1|k+1 , ...}.

In addition, the initial condition at each time sample is given by the corresponding state of system x0= x(k). The whole computation timeline can be described in Figure 3.2 as following.

Figure 3.2: MPC (or RHC): computation timeline [2]

3.1.1.3 Practical Aspects For Implementing MPC

Notice that when implementing MPC, we need to consider many practical aspects, such as

• Estimating the future states as precise as possible

• Keeping computational time as small as possible

• Keeping the optimization problem feasible

We can measure the accuracy of estimated future states by comparing the estimated trajectories with the real trajectories that we get from experiments. The sampling time

(34)

CHAPTER 3. APPLICATION

and the number of modelled states can both affect the accuracy of estimated future states.

The main factors that can influence the running time of the problem are the number of modelled states and the control inputs as well as the time horizon (sampling time).

Furthermore, the type of the optimization problem (linear, nonlinear, convex, nonconvex) can also affect the computational time. In order to limit the computational time, we need to keep the number of modelled states relatively small and the time horizon length may not need to be very long depending on the dynamic system itself.

Feasibility can be influenced by the terminal set, the horizon length N and the state and input constraints. If the size of terminal set is chosen too small, or the horizon length is too short, then the set of feasibility will be small. Then the solutions may be too conservative. For example, part of the trajectory states keeps returning to a certain small area or the terminal set when the small terminal set or short horizon is applied to the collision avoidance problem. If we choose the inappropriate terminal set which is infeasible for the constraints sets, or if we choose a short or a long time horizon length, the optimization problem will be infeasible. States constraints can also cause infeasibility due to disturbance or measurements noise and so on. Then the solver will not be able to compute a valid control action. As a result, the optimality of Model Predicted Control will be lost.

In our topic, adding relaxation to the state and input constraints can make the controlled UAV more safe and further from the uncontrolled UAV, but it may increase the total energy cost for the system, such as the cost function of the optimization problem.

3.1.2 Reachability Analysis Toolbox

Reachability analysis is recognized as a problem to compute a reachable set in a more effectively way. It requires that in a given time, the approach can determine if the reachable set have nonempty intersection with a given set (target set), and projection of the reachable set can be displayed into two-or three-dimensional subspace [8]. In MATLAB, reachable sets can be analyzed and calculated by Ellipsoidal Toolbox. With ellipsoidal calculus, the reachable set of linear system can be approximately measured by implementing internal and external ellipsoids.

In our topic, the disturbance W and initial state set X0talked in Chapters 2 and 3 are all given bounded sets. So in our implementation, we set the given bounded sets to be ellipsoids, such as in Equations 2.4, 2.5 and 2.6. We choose to estimate the reachable sets ˆXk, k = τ,τ + 1,τ + 2,...., by Ellipsoid Toolbox implementing in MATLAB R2017b.

20

(35)

3.2. ALGORITHM

3.1.3 Optimization Modeling Toolbox

Linear matrix inequalities (LMI) and semidefinite programming (SDP) are two impor- tant mathematical tools in control and systems theory. Semidefinite programming can deal with many of control problems, including classical Lyapunov theory for linear sys- tems, modern control theory based on the algebraic Riccati equation and so on. LMIs and SDP has contributed a lot to many new developments on robust model predictive control,stability analysis and so on [13].

SDPs is concerned with a convex optimization problems that can be dealt with in polynomial time in 1990s. After that, software with modeling language and interface such as YALMIP (Yet Another LMI(linear matrix inequality) Parser) Toolbox are developed for SDP. Nowadays, YALMIP Toolbox is a modeling language package in MATLAB designed for supporting linear programming (LP), quadratic programming (QP), semidefinite programming, determinant, multiparametric linear and so on. YALMIP Toolbox has many benefits, for example, it can automatically reduce the the number of variables in equality constrained problems [13].

In the section 3.1.1, we introduced Model Predictive Control optimization method to optimize the problem for collision avoidance under communication delay and tracking problem under communication delay. However, since MPC is based on optimization control theory, it needs a considerable amount of on-line computer power to deal with the optimization problems with a low enough time cost [13]. To solve this problem, a concept of multiparametric programming is introduced, which means generating explicit solutions to parameterized optimization problems. The algorithm of multiparametric programming can calculate explicit solutions efficiently by using less on-line computer resources and has been publicly in MPT Toolbox in MATLAB [14]. MPT toolbox is also interfaced in YALMIP Toolbox. With MPT and YALMIP Toolbox implemented in MATLAB, we can design the MPC controller to solve our optimization problem by using multiparametric programming and semidefinite programming solvers [13].

3.2 Algorithm

In this section, we discuss two applications including collision avoidance under commu- nication delay and tracking problem under communication delay. We define that

1. τu is the uplink time delay andτd is downlink time delay.

(36)

CHAPTER 3. APPLICATION

2. U AVcis the UAV that we can control and U AVucis the UAV which is uncontrolled.

The dynamics of both UAVs follows the linearized dynamic model of quadrotor in [15]. The discrete-time control system of U AVc(3.15) is same as Equation 3.5,

(3.15) xc

k+1= Ackxkc+ Bkcuck

where state vector xkc ∈ Rn , control input vector uck∈ Rm, and Akc ∈ Rn∗n, Bck∈ Rn∗m.

The discrete-time system of U AVuc (3.16) is same as Equation 2.1

(3.16) xuc

k+1= Auck xuck + Guck wkuc.

where state vector xkuc∈ Rn , Auck ∈ Rn∗n, Guck ∈ Rn∗p, and the disturbance wk is assumed to belong to a given bounded set Wk⊂ Rp.

We also assume that 1. (τu,τd) are known.

2. At time t=0, the states of both UAVs are known at the controller.

3. The U AVc starts moving after receiving the first command.

4. We generate the first command at time t=0.

In collision avoidance problem, we consider two UAVs, U AVcand U AVuc. Once the U AVucstarts flying, we receive its position information with a communication downlink delay τd. Then we send the state estimator information and the control information out to the controlled U AVcwith a communication uplink delayτu to control U AVcto avoid the trajectory of U AVucwhile both are flying. Notice that the terminal position of U AVcis given .

In tracking problem under communication delay, we also consider two UAVs, U AVc and U AVuc. Once the uncontrolled U AVuc starts flying, we receive its position informa- tion with a communication downlink delayτdand send the control information out to the U AVc with a communication uplink delayτu to track U AVuc’s trajectory. Notice that we require the U AVcto start flying at the U AVuc’s initial state at time t=0, then track the U AVuc’s trajectory without crashing.

22

(37)

3.2. ALGORITHM

Algorithm 3: Algorithm with MPC in collision avoidance problem

1 k ← 0;

2 x0c← xc(0);

3 while k ∈ time horizon do

4 hk is given ;

5 xc∗

k+1, uc∗k ← MPC_ Avoidance(x0c, hk);

6 if feasible solution then

7 uc(k) ← uc∗k (0);

8 xc(k + 1) ← xc∗k+1;

9 k ← k + 1;

10 x0c← xc(k);

11 else

12 print( "stop" );

13 break;

14 end

15 end

16

Algorithm 4: Algorithm with MPC in tracking problem

1 k ← 0;

2 x0c← xc(0);

3 while k ∈ time horizon do

4 hk is given ;

5 xc∗

k+1, uc∗k ← MPC_ Tracking(xc0, hk);

6 if feasible solution then

7 uc(k) ← uc∗k (0);

8 xc(k + 1) ← xc∗k+1;

9 k ← k + 1;

10 x0c← xc(k);

11 else

12 print( "stop" );

13 break;

14 end

15 end

16

(38)

CHAPTER 3. APPLICATION

In order to create an algorithm for collision avoidance problem and tracking problem, we create MPC algorithm structures 3 and 4 for the two problems first.

In these two MPC algorithms, {xc(k), k = 0,1,...} denotes the estimated state trajectory of U AVc, {uc(k), k = 0,1,...} denotes the sequence of optimal control regarding U AVc, {hk, k = 0,1,...} denotes the hyperplanes of predicted state sets of U AVuc. Furthermore, both of "MPC_ Avoidance" and "MPC_ Tracking" denotes the optimization problem 3.10 solved at x0c= xc(0). The cost function of "MPC_ Avoidance" and "MPC_ Tracking"

is Equation 3.9 and the constraints of "MPC_ Avoidance" and "MPC_ Tracking" are {hk, k = 0,1,...}.

Notice that we require different constraints computations in these two MPC algo- rithms. In collision avoidance with communication delay application, we calculate the hyperplanes of U AVuc’s reachable state sets ˆXuc

k to restrict the U AVc’s corresponding state xc(k) (the calculation method is appended in Appendix A.1). In tracking problem, we require the U AVc’s state xc(k) to be the same as that of U AVuc’s previous states xuc(i), i = 0,1,.., k −1, and we also calculate the hyperplanes of U AVuc’s reachable state sets ˆXuc

k to restrict the U AVc’s state xc(k) "behind" U AVuc’s state xuc(k). Besides using hyperplanes as safety constraints directly, we can also add more or less relaxation based on the hyperplanes’ coordinates.

Next, we implement the Algorithm 1 from state prediction with delayed state mea- surements in Chapter 2 to the Algorithm 3 from MPC in collision avoidance problem, because Algorithm 1 generates the constraints for Algorithm 3. Then we can get the algorithm with MPC and state prediction in collision avoidance problem. For the same reason, we implement Algorithm 1 to Algorithm 4 from MPC in tracking problem as well, in order to get the algorithm with MPC and state prediction in tracking problem. In the Algorithm 5, we combine the algorithm in collision avoidance problem and the algorithm in tracking problem together.

As we can see in Algorithm 5, {xuck , k = 0,1,...} is given by the U AVuc’s states informa- tion under communication delay, { ˆXkuc, k = 0,1,...} denotes predicted state sets of U AVuc. Furthermore, "StatePrediction" is corresponding to the Agorithm 1, "SafetyConstrains"

is corresponding to the different constraints computations in Algorithm 3 and Algorithm 4 and "MPC_ AvoidanceorTracking" denotes "MPC_ Avoidance" in Algorithm 3 or "MPC_

Tracking" in Algorithm 4 depending on the problem we will solve.

Using algorithm 5, we get the estimated state trajectory {xc(k), k = 0,1,...} of U AVc and predicted state sets trajectory { ˆXuc

k , k = 0,1,...} of U AVuc. Then we can achieve the communication delayed control model where the state estimator information and

24

(39)

3.3. SIMULATION

Algorithm 5: Algorithm with MPC and state prediction

1 k ← 0;

2 x0c← xc(0);

3 x0uc← xuc(0);

4 while k ∈ time horizon do

5kuc← StateP rediction(x0uc) ;

6 hk← Sa f et yConstraints( ˆXkuc) ;

7 xc∗

k+1, uc∗k ← MPC_ AvoidanceorTracking(x0c, hk);

8 if feasible solution then

9 uc(k) ← uc∗k (0);

10 xc(k + 1) ← xc∗k+1;

11 k ← k + 1;

12 x0c← xc(k);

13 x0uc← xuc(k);

14 else

15 print( "stop" );

16 break;

17 end

18 end

19

control information are designed to compensate the uncertainties imposed by uplink and downlink communication delay.

3.3 Simulation

3.3.1 Collision Avoidance with Communication Delay

We are aiming at simulating different trajectories with different hyperplane constraints and different time delays. We define the parameters in table 3.1 and apply them to Algorithm 5. Meanwhile, with the hyperplane of reachable sets from uncontrolled UAV in Figure 3.3, we require that the position of the U AVcis restricted to the shadow area.

Then we simulate the collision avoidance trajectories as is shown in Figure 3.4.

initial position x0c terminal position xNc initial position x0uc time horizon

[-0.5;2] [-20.5;-18] [0;2] 9

Table 3.1: Parameters for collision avoidance with communication delay

(40)

CHAPTER 3. APPLICATION

Figure 3.3: Reachable set with hyperplane

communication delay = 1 communication delay = 2

communication delay = 3 communication delay = 4 Figure 3.4: Collision avoidance examples

26

(41)

3.3. SIMULATION

As is shown in Figure 3.4, with a fixed time horizon, we observe that more commu- nication delay the system has, the less accurate state estimation will be, which means that the size of reachable set becomes large and the controlled U AVcneeds to perform unnecessary maneuvers to avoid collision.

3.3.2 Tracking Problem with Communication Delay

In tracking problem, we made 3D animation with four videos by "Videowriter" command in MATLAB R2107b to demonstrate the tracking simulations with different control systems and different communication delays. The video screen shots are showed in Figure 3.5.

Figure 3.5: Video screenshots for different tracking problems

In detail, Figure 3.6 shows the position of U AVcand predicted position of U AVuc for τu= 1 , τd= 1; Figure 3.9 shows the position of U AVcand predicted position of U AVuc for τu= 1 , τd= 1; Figure 3.7 shows the position of U AVc and predicted position of U AVucforτu= 2 , τd= 2; Figure 3.8 shows the position of U AVcand predicted position of U AVuc forτu= 3 , τd= 1. As it is demonstrated, the small point which always moved

(42)

CHAPTER 3. APPLICATION

behind the big red circle is represented to be the position of U AVc, the big red circle is represented to be the predicted position of U AVuc. When the U AVcpoint will "touch"

the U AVc’s state set, the Algorithm 4 will detect and stop moving the controlled U AVc, as we can see "stop" from the arrow.

Under the same tracking trajectory and fixed time horizon, we observe that more communication delay the system has, the less accurate state estimation will be, mean- ing that the size of uncontrolled U AVuc’s reachable state set becomes larger and the controlled U AVc needs to move more slowly to guarantee the safety.

Figure 3.6: Tracking problem 1 (delayed timeτu= 1 , τd= 1 )

28

(43)
(44)

CHAPTER 3. APPLICATION

Figure 3.8: Tracking problem 3 (delayed timeτu= 3 , τd= 1 )

30

(45)

3.3. SIMULATION

Figure 3.9: Tracking problem 4 (delayed timeτu= 1 , τd= 1 )

(46)
(47)

C

HAPTER

4

C ONCLUSION AND F UTURE D EVELOPMENT

In this work, we started the state prediction problem under delayed state measurement or delayed output measurement, we developed algorithms for the state prediction problem using reachability of target sets and target tubes [4]. These algorithms and linear MPC theory were used to perform collision avoidance and trajectory tracking tasks for UAVs under communication delay between sensor and controller as well as controller and actuator. In the end, simulations of the two applications were presented, for different communication delays and time steps using a UAV model with 6 degrees of freedom.

The future work could be improving the model with more complex disturbance or improving the complexity of the control system, and performing teleoperation of UAVs over internet.

(48)
(49)

B IBLIOGRAPHY

[1] M. Behrendt, “A basic working principle of model predictive control,” 2 October 2009. [Online]. Available: https://commons.wikimedia.org/wiki/File:

MPC_scheme_basic.svg

[2] M. Johansson, Linear quadratic and model predictive control. KTH Royal Institute of Technology, 2018.

[3] J. Brown, “What is a drone: Main features & applications of today’s drones.”

[Online]. Available: http://mydronelab.com/blog/what-is-a-drone.html

[4] D.P.Bertsekas and I.B.Rhodes, “On the minimax reachability of target sets and target tubes,” Automatica, vol. VOL. 7, pp. 233–247, 1971.

[5] O. Bokanowski, A. Désilles, and H. Zidani, “Hjb approach for motion planning and reachabilty analysis.” Paris, France: Proceedings of the 5th International ICST Conference on Performance Evaluation Methodologies and Tools, May 16 - 20, 2011.

[6] A. A. Kurzhanskiy and P. Varaiya, “Ellipsoidal techniques for reachability analysis of discrete-time linear systems,” IEEE Transactions on Automatic Control, vol.

VOL.52, p. NO. 1, JANUARY 2007.

[7] A. A. Kurzhanskiy and ravin Varaiya, “Theory and computational techniques for analysis of discrete time control systems with disturbances,” Optimization Meth- ods and Software, vol. VOL. 26:4-5, pp. 719–746, 2011.

[8] A. A. Kurzhanskiy and P. Varaiya, “Ellipsoid tool eecs,” May 6, 2006. [Online].

Available: http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-46.

html

[9] J. Dohyun, Y. Jaehyun, S. C. Youngdong, K. H. Jin, and J. K. H., “Networked operation of a uav using gaussian process-based delay compensation and model

(50)

BIBLIOGRAPHY

predictive control.” Palais des congres de Montreal, Montreal, Canada: 2019 International Conference on Robotics and Automation (ICRA), May 20-24, 2019.

[10] M. Kamel, T. Stastny, K. Alexis, and R. Siegwart, “Model predictive control for trajectory tracking of unmanned aerial vehicles using robot operating system,in Robot Operating System(ROS).” Springer, 2017, pp. 3–39.

[11] J. Zhang, X. Zhou, and Z. Zhou, “Design of time delayed control systems in uav using model based predictive algorithm.” 2nd International Asia Conference on Informatics in Control,Automation and Robotics, 2010.

[12] Wikipedia, “Model predictive control.” [Online]. Available: https://en.wikipedia.org/

wiki/Model_predictive_control#cite_note-6

[13] J. Lofberg, “Yalmip : a toolbox for modeling and optimization in matlab.” New Orleans, LA, USA: 2004 IEEE International Conference on Robotics and Au- tomation (IEEE Cat. No.04CH37508), 2-4 Sept. 2004.

[14] M. Kvasnica, P. Grieder, M. Baotic, and M. Morari, “Multi-parametric toolbox (mpt).”

ETHZ, Zurich: Automatic Control Laboratory, 2003.

[15] F. SABATINO, Quadrotor control: modeling, nonlinear control design, and simula- tion. Stockholm, Sweden: KTH Royal Institute of Technology, June 2015.

[16] L. Asselborn, “Control of stochastic hybrid systems based on probabilistic reachable set computation.” Faculty of Electrical Engineering / Computer Science of the University of Kassel, 2018.

36

(51)

APPENDIX

A

A PPENDIX

A.1 Computation for Hyperplanes

In Algorithm 5 with MPC and state estimation, we need to compute hyperplanes of reachable state sets in order to get the safety constraints in MPC (we require that the controlled UAV should be "above" the uncontrolled UAV). As the examples illustrated in Figure A.2, there are many kinds of hyperplanes we can design in order to be the safety constraint. Now we will take one example in two dimension to demonstrate how to compute the coordinates of hyperplane.

Definition A.1. [8] Ellipsoid²(q,Q) in Rnwith center q and shape matrix Q is the set

²(q,Q) = {x ∈ Rn| < (x − q),Q−1(x − q) >≤ 1}

where Q is positive definite (Q = QT and < x,Qx >> 0 for all nonzero x ∈ Rn). Here < .,. >

denotes inner product.

According to [16], the location of an ellipsoid is defined by its center q, the shape and direction of an ellipsoid is defined by its shape matrix Q. The semi-major axis is the longest radius of an ellipsoid, the length isp

λ1 whereλ1 is the maximum eigenvalue of the shape matrix Q, and direction is defined by the corresponding eigenvector v1. The semi-minor axis is the shortest radius of an ellipsoid, the length isp

λ2 whereλ2is the minimum eigenvalue of the shape matrix Q, and direction is defined by the corresponding eigenvector v2.

(52)

APPENDIX A. APPENDIX

Figure A.1: Notation of an ellipsoid

Figure A.1 shows the specification of an ellipsoid as we described above.

Hence, for different hyperplanes described in Figure A.2, we all can calculate their hyperplanes’ coordinates according to the eigenvalues and eigenvectors of the shape matrix Q.

Figure A.2: Hyperplane examples

38

(53)

TRITA-EECS-EX-2020:34

References

Related documents

In turn, the extensive contracting of PSCs by state and non-state actors in Iraq to perform armed functions makes the case important in terms of exploring the impact of

The aim of the dissertation is, firstly, to situate the post-Cold War expansion of the market for privatised security in a historical perspective and, secondly,

This class contains the method db.setCurrent(current) (Line 110 of the Listing 3.10) the same one as was used to exchange the GPS coordinates with the

Thus, provided that the observer and the control error can be bounded and shown to lie in sufficiently ”small” sets, it is possible to find an admissible control sequence ¯ u and ¯

Pretty simple pattern for insertion, open stitch for the top of babie’s shoes, stockings, &amp;c. Ditto for the center of a shetland shawl, also pretty for toilet-covers,

Arbetet inleds med ett kapitel om kreativitet där det beskrivs hur den definieras och problematiken som finns kring området och detta leder sedan till problemformuleringen. I

This allows us to reason at different levels of abstraction on the user: while the decisions taken on component Human are always a di- rect consequence of sensor

In case of the most common permanent magnet synchronous machine (PMSM) applications, the VSI is constructed from 3 half bridges connected in parallel to an input capacitor, a