waypoint-based guidance with obstacle … · instituto tecnolÓgico de aeronÁutica josé agnelo...

61
INSTITUTO TECNOLÓGICO DE AERONÁUTICA José Agnelo Bezerra Guilherme Silva WAYPOINT-BASED GUIDANCE WITH OBSTACLE AVOIDANCE FOR MULTIROTOR VEHICLES USING A MODEL PREDICTIVE CONTROLLER Trabalho de Graduação 2015 Curso de Engenharia Mecânica-Aeronáutica

Upload: nguyenphuc

Post on 19-Sep-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

INSTITUTO TECNOLÓGICO DE AERONÁUTICA

José Agnelo Bezerra Guilherme Silva

WAYPOINT-BASED GUIDANCE WITH

OBSTACLE AVOIDANCE FOR MULTIROTOR

VEHICLES USING A MODEL PREDICTIVE

CONTROLLER

Trabalho de Graduação

2015

Curso de Engenharia

Mecânica-Aeronáutica

Page 2: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CDU 681.5:629.73

Jose Agnelo Bezerra Guilherme Silva

WAYPOINT-BASED GUIDANCE WITH

OBSTACLE AVOIDANCE FOR MULTIROTOR

VEHICLES USING A MODEL PREDICTIVE

CONTROLLER

Prof. Dr. Davi Antonio dos Santos

Advisor

ENGENHARIA MECANICA-AERONAUTICA

Sao Jose dos Camposinstituto tecnologico de aeronautica

2015

Page 3: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Cataloging-in Publication DataDocumentation and Information Division

Silva, Jose Agnelo Bezerra GuilhermeWaypoint-Based Guidance with Obstacle Avoidance for Multirotor Vehicles Using a Model

Predictive Controller / Jose Agnelo Bezerra Guilherme Silva.Sao Jose dos Campos, 2015.59f.

Final paper (Undergraduation study) – Course of Engenharia Mecanica-Aeronautica– InstitutoTecnologico de Aeronautica, 2015. Advisor: Prof. Dr. Davi Antonio dos Santos.

1. Multirotor Aerial Vehicle. 2. Model Predictive Control. 3. Waypoint Navigation. 4. ObstacleAvoidance. I. Instituto Tecnologico de Aeronautica. II. Title.

BIBLIOGRAPHIC REFERENCE

SILVA, Jose Agnelo Bezerra Guilherme. Waypoint-Based Guidance with ObstacleAvoidance for Multirotor Vehicles Using a Model Predictive Controller. 2015.59f. Final paper (Undergraduation study) – Instituto Tecnologico de Aeronautica, SaoJose dos Campos.

CESSION OF RIGHTS

AUTHOR’S NAME: Jose Agnelo Bezerra Guilherme SilvaPUBLICATION TITLE: Waypoint-Based Guidance with Obstacle Avoidance for MultirotorVehicles Using a Model Predictive Controller.PUBLICATION KIND/YEAR: Final paper (Undergraduation study) / 2015

It is granted to Instituto Tecnologico de Aeronautica permission to reproduce copies ofthis final paper and to only loan or to sell copies for academic and scientific purposes.The author reserves other publication rights and no part of this final paper can bereproduced without the authorization of the author.

Jose Agnelo Bezerra Guilherme SilvaH20B, 113, CTA12228-470 – Sao Jose dos Campos–SP

Page 4: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor
Page 5: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

I dedicate this work to my parents Ed-

naldo and Fatima and my sister Irielly,

who supported my education and made

me reach ITA.

Page 6: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Acknowledgments

I would like first to thank God, Who always blessed me and made this moment possible.

All the achievements I have had in life were due to Him.

To my father Ednaldo Guilherme, my mother Maria de Fatima and my sister Irielly

Katarina, for my formation as person. They are the great responsible for what I am today,

so I dedicate this victory to them.

To my beloved Nathana Alcantara, who closely shared my career in ITA. In the most

hard times of the past years, I always had her with me and counted on her support. I

wish that so be it for the rest of our lives.

To the teacher Davi Antonio, for all he taught me in the past two years. He is one of

those men who justify the ITA excellence level and make a difference with their work.

To my fellows of the last five years, people with whom I shared unique moments of my

life. In particular, I thank Igor Prado, friend of main importance to this work success.

I conclude with a quote from Dr. Ozires Silva, who said: “I thank my country and the

Brazilian Air Force for the free education”.

Page 7: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Resumo

Este trabalho de graduacao lida com o problema de guiamento por waypoints de veıcu-

los aereos multirotores com desvio de multiplos obstaculos politopicos. A fim de solucionar

o problema, e utilizado um controlador preditivo (MPC) com horizonte retrocedente. As

entradas de comando para o controlador consistem em uma sequencia de waypoints tridi-

mensionais e uma velocidade de referencia. A trajetoria futura de referencia calculada pelo

MPC e definida como uma linha reta ate o proximo waypoint da sequencia, devendo ser

percorrida com a velocidade de referencia. Um waypoint e detectado assim que o veıculo

entra em uma esfera euclidiana com centro nesse ponto e raio especificado. No mesmo

instante, o algoritmo ja passa a buscar o proximo waypoint da sequencia. Essa regra e

repetida ate o veıculo alcancar o ultimo waypoint, onde ele e comandado a permanecer.

A fim de desviar de varios obstaculos politopicos, um metodo simples baseado em ambos

os waypoints anterior e posterior e proposto para a obtencao de um espaco de otimizacao

convexo livre de obstaculos. O metodo em questao e avaliado por meio de simulacoes

computacionais, que mostram a sua eficiencia em guiar um veıculo multirotores ao longo

dos waypoints com, aproximadamente, a velocidade de referencia, mesmo na presenca de

multiplos obstaculos e sob forcas de perturbacao.

Page 8: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Abstract

This undergraduation study deals with the problem of waypoint-based guidance of

multirotor aerial vehicles with avoidance of multiple polytopic obstacles. In order to

solve the problem, a receding horizon model predictive controller (MPC) is adopted. The

command inputs to the controller consist of a sequence of tridimensional waypoints as

well as a reference speed. The future reference output trajectory embedded in the MPC

is chosen as a straight line, traveled with the reference speed, towards the next waypoint

of the sequence. A waypoint is detected as soon as the vehicle enters inside a specified

Euclidean ball centered at it. At the same moment, the next waypoint of the sequence is

switched on. This rule is repeated until reaching the final waypoint, at which the vehicle is

commanded to hover. In order to avoid multiple polytopic obstacles, a very simple method

based on both the previous and the next waypoints is proposed for obtaining a convex

optimization space that does not contain the obstacles. The proposed method is evaluated

by simulations, showing that it is effective to guide a multirotor vehicle throughout the

waypoints, with approximately the reference speed, even in the presence of obstacles and

under disturbance forces.

Page 9: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

List of Figures

FIGURE 2.1 – Basic structure of Model Predictive Control. . . . . . . . . . . . . . 20

FIGURE 3.1 – Cartesian Coordinate Systems and forces in a multirotor aerial vehicle. 24

FIGURE 3.2 – A waypoint-based reference trajectory avoiding a polytopic obstacle. 26

FIGURE 4.1 – The vehicle’s perception of an obstacle. . . . . . . . . . . . . . . . . 30

FIGURE 4.2 – Computation of the attitude command to the internal loop of control. 37

FIGURE 5.1 – First trajectory, when the vehicle is released against a side face of

the obstacle. The flight path is projected in the XG − YG plane. . . 42

FIGURE 5.2 – Second trajectory, when the vehicle is released against the top face

of the obstacle. The flight path is projected in the XG − ZG plane. . 43

FIGURE 5.3 – Trajectory of the quadrotor in the roof inspection simulation in the

case with disabled obstacle avoidance. . . . . . . . . . . . . . . . . . 46

FIGURE 5.4 – Trajectory of the quadrotor in the roof inspection simulation with

activated obstacle avoidance scheme. . . . . . . . . . . . . . . . . . 46

FIGURE 5.5 – Comparison between the control inputs in XG direction calculated

by MPC in the cases with the obstacle avoidance strategy on (red

line) and off (blue line). . . . . . . . . . . . . . . . . . . . . . . . . . 47

FIGURE 5.6 – Comparison between the control inputs in YG direction calculated

by MPC in the cases with the obstacle avoidance strategy on (red

line) and off (blue line). . . . . . . . . . . . . . . . . . . . . . . . . . 47

FIGURE 5.7 – Comparison between the control inputs in ZG direction calculated

by MPC in the cases with the obstacle avoidance strategy on (red

line) and off (blue line). . . . . . . . . . . . . . . . . . . . . . . . . . 48

FIGURE 5.8 – Difference of controls in theXG direction caused by the consideration

of the obstacle constraints. . . . . . . . . . . . . . . . . . . . . . . . 49

Page 10: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

LIST OF FIGURES ix

FIGURE 5.9 – Difference of controls in the YG direction caused by the consideration

of the obstacle constraints. . . . . . . . . . . . . . . . . . . . . . . . 49

FIGURE 5.10 –Difference of controls in the ZG direction caused by the consideration

of the obstacle constraints. . . . . . . . . . . . . . . . . . . . . . . . 50

Page 11: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

List of Tables

TABLE 5.1 – Parameters of the quadrotor vehicle considered in the simulations. . 39

TABLE 5.2 – Parameters of the MPC controller. . . . . . . . . . . . . . . . . . . . 40

TABLE 5.3 – Waypoints of the two reference trajectories considered in the simu-

lations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

TABLE 5.4 – Waypoints considered in the roof inspection mission. . . . . . . . . . 45

TABLE 5.5 – Parameters of the MPC controller at the roof inspection simulation. 45

Page 12: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

List of Abbreviations and Acronyms

3D Three Dimensional

CCS Cartesian Coordinate System

CM Center of Mass

ITA Instituto Tecnologico de Aeronautica

MIQP Mixed-Integer Quadratic Programming

MPC Model Predictive Control

PID Proportional, Integral and Derivative

QP Quadratic Programming

RCAC Retrospective Cost Adaptive Control

UAV Unmanned Aerial Vehicles

Page 13: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

List of Symbols

A, B, C State-space matrices of the discretized model.

Ac, Bc, Cc State-space matrices of the continuous-time model.

A, B, C State-space matrices of the incremental discrete-time model.

DGB Attitude matrix of system SB w.r.t. SG.

dik Minimum distance between the vehicle and the ith obstacle at instant k.

FcG Resultant thrust force.

FdG Disturbance force.

F Thrust command.

Fmax Maximum thrust.

Fmin Minimum thrust.

F Matrix used to calculate the free response.

fk Free response of the conventional state-space model.

fk Free response of the incremental model.

G Dynamics matrix of the prediction model.

g Local gravitational acceleration.

I is External space to the face s of the ith obstacle.

k Discrete-time.

m Total mass of the multirotor helicopter.

M Control horizon.

N Prediction horizon.

ni Number of faces of the ith obstacle inside the restricted space.

no Number of perceived obstacles at current instant.

nu Number of control inputs of the state-space model.

nx Number of states of the state-space model.

ny Number of outputs of the state-space model.

nz Number of augmented states of an incremental state-space model.

O Augmented matrix of obstacle constraints.

p Number of obstacles in the considered space.

q Number of waypoints on the reference trajectory.

rG Position of the quadrotor in the environment.

Page 14: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

LIST OF SYMBOLS xiii

rmax Maximum position of the vehicle in the restricted space.

rmin Minimum position of the vehicle in the restricted space.

r Reference trajectory to the multirotor’s motion.

r Generic point in the bounded space.

SB CCR centered at the vehicle’s CM and fixed on its frame.

SG Inertial CCR.

T Time-step of integration.

u Continuous-time vector of input control.

uk Vector of control inputs of the state-space model at instant k.

uk+i−1|k Predicted value of the control inputs uk+i−1 calculated at instant k.

umax Maximum control input.

umin Minimum control input.

Uk Augmented vector of predicted future inputs.

∆uk Incremental control at discrete-time k.

∆Uk Augmented vector of predicted future increments of control.

v Reference speed to the quadrotor’s flight.

wj Waypoint of position j on the reference trajectory.

x Continuous-time states vector

xk Vector of model’s states at discrete-time k.

xk+i|k Predicted value of state xk+i calculated at instant k.

y Continuous-time output vector

yk Vector of outputs of the state-space model at discrete-time k.

yk+i|k Predicted value of outputs yk+i calculated at instant k.

Yk Augmented vector of predicted outputs.

zk Vector of augmented states at discrete-time k.

zk+i|k Predicted values of states zk+i calculated at instant k.

β Obstacle perception radius of the quadrotor.

Θi Matrix of coefficients of the position r describing the ith obstacle.

Θis Line s of the matrix Θi.

Θk Matrix of coefficients of the vector yk in the obstacle constraint at instant k.

θi Vector of independent coefficients that describes the ith obstacle.

θis Line s of the matrix θi.

θk Vector of independent coefficients of the obstacle constraint at instant k.

λ Waypoint detection radius.

ρ Weight of the control effort in the cost functional of MPC.

ξ, Ξ Matrices of the linear augmented constraints of MPC.

Page 15: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.2 Bibliography Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

1.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

1.4 Text Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2 Model Predictive Control . . . . . . . . . . . . . . . . . . . . 20

2.1 The MPC strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2 MPC of a State-Space model . . . . . . . . . . . . . . . . . . . . . . . 21

3 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.1 Preliminary Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.2 Position Control Problem . . . . . . . . . . . . . . . . . . . . . . . . . 25

4 Problem Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.1 Preliminary Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.2 State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.2.1 Incremental State-Space Model . . . . . . . . . . . . . . . . . . . . . 28

4.3 Environment and Thrust Constraints . . . . . . . . . . . . . . . . . . 29

4.4 Obstacle Avoidance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

4.4.1 Obstacle Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4.5 Reference Trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.5.1 Waypoint Commutation . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.6 Model Predictive Controller . . . . . . . . . . . . . . . . . . . . . . . 33

Page 16: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CONTENTS xv

4.6.1 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.6.2 Computation of the Control Input . . . . . . . . . . . . . . . . . . . . 35

4.7 Computation of final commands . . . . . . . . . . . . . . . . . . . . . 36

5 Computational Simulations . . . . . . . . . . . . . . . . . . . . 39

5.1 Simulation with a single obstacle . . . . . . . . . . . . . . . . . . . . 40

5.2 Simulation with multiple obstacles . . . . . . . . . . . . . . . . . . . 43

6 Conclusions and Future Works . . . . . . . . . . . . . . . . . 51

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Appendix A – Prediction Equation . . . . . . . . . . . . . . . . 55

A.1 Model in conventional form . . . . . . . . . . . . . . . . . . . . . . . . 55

A.2 Model in incremental form . . . . . . . . . . . . . . . . . . . . . . . . 58

Page 17: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

1 Introduction

This initial Chapter is composed by four Sections. Section 1.1 gives a motivation for

studying the multirotor position control problem. Section 1.2 presents a review of previous

works in multirotor guidance and control. Section 1.3 states the objectives of this study.

Finally, Section 1.4 presents the general organization of this text.

1.1 Motivation

Unmanned Aerial Vehicles (UAVs) have been an important research topic in the scien-

tific community over the past two decades and various applications of these vehicles have

already been investigated. For example, due to their ability to reach places of difficult ac-

cess to a man, they can be employed in inspection tasks of structures, transmission lines,

oil pipelines, roofs etc. Also there is a great interest in using them in applications that

involve some risk to humans, such as security, risk areas monitoring, search and rescue

operations etc.

Over the last few years, this new technology began to be used in practical applications.

The first commercial applications were developed for aerial payload delivery, filming in

general, security and monitoring. In Brazil, it is expected that the initial uses of UAVs

will be on public security and monitoring services for agribusiness.

The obstacle avoidance feature, in turn, is essential for all applications where there is

some static or mobile solid inside the flight environment, such as those in indoor spaces

and inspections. In general, this feature is desired in order to provide greater safety to

these vehicles’ flight.

This work takes into consideration a multirotor helicopter with four propulsion sets

(i.e., the well-known quadrotor). Due to its high maneuverability and hover capability,

this vehicle is quite suitable for inspection applications. In order to illustrate it, some

simulation results will be presented for the proposed controller in a roof inspection use.

Page 18: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 1. INTRODUCTION 17

1.2 Bibliography Review

Obstacle avoidance applied to Unmanned Aerial Vehicles (UAV) has been a subject

of interest in the past decades, mainly due to the multiple possible applications of these

robots in indoor environments. As a primary reference, we cite the work of (KYRIAKOPOU-

LOS; SARIDIS, 1993), which formulated a strategy to collision prediction and avoidance of

convex moving obstacles, however considering a wheeled autonomous robot. The paper

(BOUABDALLAH et al., 2007) was one that introduced this theme applied to quadrotors.

Using the backstepping technique, the authors developed an obstacle avoidance controller

to a micro quadcopter. The control design was based on numerical simulations in MAT-

LAB/Simulink, considering different modeled restricted environments. More recently,

(GENG et al., 2013) studied the problem also using a backstepping controller. In this

paper, a comparison between two obstacle avoidance approaches was performed. Based

on 3D simulations, the work indicates that the method of safety ball model has better

performance than the mass point model one in terms of the route generated. Finally, the

paper (MELLINGER; KUMAR, 2011) considered the problem of optimal trajectory genera-

tion to quadrotors in a typical setting of indoor environment. The proposed path planning

algorithm respects tight constraints related to inputs, velocity, acceleration and even cor-

ridors. The paper also proposes a nonlinear controller design for the desired trajectory

tracking.

The Model Predictive Control (MPC) is a convenient way to handle with position

control of multirotors. One of the main advantages of MPC to this application is the

direct treatment of constraints over control and plant outputs, which allows to respect

restrictions of the thrust actuators and those related to flight environment and obstacles.

The paper (MAYNE, 2014) presents a deep review about MPC, pointing out several devel-

opments in this concept until now, giving their benefits and disadvantages to using in a

general form. The author also indicates some fields in this area to be improved in future

research. We can cite some works that apply MPC to UAV tracking control, as it follows:

(RAFFO et al., 2010) and (ALEXIS et al., 2014). Reference (RAFFO et al., 2010) uses a hier-

archical control setting consisting of a predictive controller for the trajectory tracking in

the outer loop and a nonlinear H∞ controller for the attitude control in the inner loop.

The paper tests this arrangement with numerical simulations, which assures robustness

against external disturbances, parametric and structural uncertainties of the model. In

(ALEXIS et al., 2014), the authors employ a Robust MPC formulation with the metric of

Minimum Peak Performance Measure. Bounded unknown disturbances are considered in

the control modeling and the robustness of this strategy is noticed by means of a batch

of experiments. The authors considered two types of unmanned aerial vehicles in these

experiments: a quadrotor and a micro tiltrotor.

Page 19: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 1. INTRODUCTION 18

Other control strategies have been studied with the multirotors application. One of the

seminal works dealing with this subject is (BOUABDALLAH et al., 2004), in which the au-

thors proposes two approaches of control: a classical PID and an optimal linear quadratic

control (LQ). Backstepping is an example of control technique with lots of researches ap-

plied to UAVs. It assures stability of the modeled system by using the Lyapunov theory in

a recursive design procedure. Some recent articles that employs this method are (SHI et al.,

2015) and (BASRI et al., 2015). Reference (SHI et al., 2015) also decomposes the trajectory

tracking problem into two cascaded control loops. The external loop consists of a back-

stepping controller for the position tracking. At this stage, two commands are calculated:

a thrust control input for the quadrotor’s dynamics and a reference attitude matrix for

the internal control loop, which in turn is composed by a nonlinear terminal sliding mode

algorithm. The paper (BASRI et al., 2015) proposes a robust control design to a quadrotor

using backstepping and a PID formulation. In this way, robustness is obtained allying

stability assured by backstepping with the minimization of system uncertainties effects

related to the PID controller.

Some recent contributions to position control of multirotors have been made at Aero-

nautics Institute of Technology (ITA). The works of (SANTOS et al., 2013) and (YAN et

al., 2014) faced the problem of tracking control of quadrotors handling with constraints

on the thrust vector in three dimensions. In (SANTOS et al., 2013), the authors decoupled

this problem into two partial ones: an altitude tracking control and an horizontal position

control. In the first problem, were considered constraints on the thrust magnitude, while

the second one was subject to thrust vector inclination bounds. This paper treated these

topics using a proportional-derivative controller with the feedback linearization strategy.

Similar constraints were employed in (YAN et al., 2014), but the later article proposed a

formulation of the modern retrospective cost adaptive control (RCAC). An interesting

approach is made in (PRADO; SANTOS, 2014), where the thrust vector is constrained into

a conic space. With this, bounds on the magnitude and thrust direction are considered

simultaneously. In order to solve a QP problem, the conic space is approximated by an

inscribed pyramidal space, which leads to linear inequalities at the control input.

The reference (VIANA et al., 2015) dealt with the position control of a multirotor he-

licopter with deviation from a static obstacle. The referred paper used a MPC strategy

set as a mixed-integer quadratic programming (MIQP) problem. The obstacle avoidance

was carried out by the authors with a group of linear inequalities containing some boolean

design variables, which responds about the mixed character of the optimization problem.

The present graduation study faces the obstacle avoidance problem with linear inequali-

ties in terms of the quadrotor’s position. Therewith, the resulting optimization problem

is a simpler quadratic programming (QP) formulation of MPC. Moreover this approach

allows the deviation from multiple polytopic obstacles that lies in the flight environment

Page 20: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 1. INTRODUCTION 19

without any major increase of final problem’s complexity.

1.3 Objectives

The main objectives of this work are the following ones:

1. Formulate a MPC controller for multirotor helicopters capable of performing waypoint-

based guidance with obstacle avoidance, considering multiple obstacles;

2. Evaluate the controller of item 1 using computational simulations in the software

MATLAB/Simulink, considering that the vehicle is subject to a constant distur-

bance.

1.4 Text Organization

The present work is organized in six chapters. The first one is the current Introduction.

The subsequent chapters are summarized as follows:

• Chapter 2 presents a basic review about the main concepts related to Model Pre-

dictive Control;

• Chapter 3 provides some primary definitions and enunciates the position control

problem in a formal manner;

• Chapter 4 proposes a solution to the problem defined in Chapter 3;

• Chapter 5 evaluates the method proposed in Chapter 4 using extensive computa-

tional simulation;

• Chapter 6 concludes the work with some final remarks and suggestions for future

investigations.

Page 21: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

2 Model Predictive Control

In this chapter, we point out the basic aspects about Model Predictive Control (MPC).

In section 2.1, we present the general MPC strategy. In section 2.2, we formulate the

optimization problem that leads to the control input in a state-space model.

2.1 The MPC strategy

Model Predictive Control (the well-known MPC) is an optimal control scheme that

uses a model of the plant to calculate the control inputs. Basically, we can describe

the MPC strategy by understanding its two essential parts: the plant’s model and an

optimizer (see Figure 2.1).

Model

Optimizer

Predicted outputs

Tracking error

Reference

trajectory

-

+

Future

inputs

Past controls

and outputs

Cost function Constraints

FIGURE 2.1: Basic structure of Model Predictive Control.

The plant’s model is used to predict future values of the system output (yk+i|k ∈ Rny).

In this process, past values of outputs and controls are considered, as well as future control

inputs (uk+i−1|k ∈ Rnu), ie, those will be applied to the plant in the current or subsequent

moments. The amount of predicted outputs (N ∈ Z+) is a controller parameter and is

called the MPC prediction horizon.

Page 22: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 2. MODEL PREDICTIVE CONTROL 21

The future controls used in the prediction of the outputs are calculated using an

optimization problem. This problem usually consists in minimizing a quadratic cost that

computes the error between the predicted and desired outputs (yk+i|k ∈ Rny), which is

known as the tracking error. Additionally, in order to prevent that the system be subjected

to sudden control signals, a factor related to the control effort is also considered in the

cost function. Thus, the optimization performed by MPC can be written as follows:

minJ(∆uk|k, . . . ,∆uk+M−1|k

),

N∑i=1

(yk+i|k − yk+i|k

)2+ ρ

M∑i=1

(∆uk+i−1|k

)2, (2.1)

where vector ∆uk+i|k , uk+i|k − uk+i−1|k is the control effort at instant k + i and ρ ∈ R+

is the control weight of the cost function.

The total of future controls calculated (M ∈ Z+) is called the MPC control horizon

and it is bounded above by the prediction horizon (M ≤ N).

The control applied to the plant at the actual instant k is the first of the optimized

signals. Subsequent control values are not applied to the plant. This is done because, at

the next discrete-time k + 1, the method is repeated and the prediction is made based

on a new scenario, since the output yk+1 is already known and will be considered. Thus,

the controls calculated at time k + 1 may be different from the previous ones (uk+1|k 6=uk+1|k+1), due to the new information available. This strategy is known as the receding

horizon concept.

One main advantage related to MPC is the ease of embedding constraints to the

control. This can be done by solving a constrained optimization problem, in place of

an unconstrained one (as in equation 2.1). So, the control is carried out respecting the

actuators’ limits and possible restrictions of the plant output. Normally, the constraints

are written in the form of linear inequalities, so that numerical methods to the solution

of Quadratic Programming (QP) problems may be used. For more information about the

MPC theory, we recommend references (CAMACHO; BORDONS, 1999) and (MACIEJOWSKI,

2002).

2.2 MPC of a State-Space model

Consider a linear time-invariant (LTI) system with multiple inputs and multiple out-

puts (MIMO) modeled in a incremental discrete-time state-space formulation:

zk+1 = Azk + B∆uk, (2.2)

Page 23: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 2. MODEL PREDICTIVE CONTROL 22

yk = Czk, (2.3)

where zk ∈ Rnz is the states vector at instant k. ∆uk , uk − uk−1, with uk ∈ Rnu , is the

incremental control inputs. yk ∈ Rny is the controlled output vector. Finally, A ∈ Rnz×nz

is the state matrix, B ∈ Rnz×nu is the control matrix and C ∈ Rny×nz is the output

matrix.

Consider known the matrices A, B and C. In this context, the prediction performed

at instant k of the output vector yk+i of future discrete-time k + i is calculated by:

zk+i|k = Azk+i−1|k + B∆uk+i−1|k, (2.4)

yk+i|k = Czk+i|k, (2.5)

where zk+i|k is the prediction held at the moment k for the future state vector zk+i and

∆uk+i−1|k is the incremental control of discrete-time k+ i− 1 and calculated at instant k.

Lemma 1. Consider known the system’s model (matrices A, B, C) and the current

states zk. Predictions yk+i|k will be held for the moments i ∈ {1, 2, ...,N}. Also consider

uk+i|k = uk+M−1|k, ∀i ∈ {M,M + 1,M + 2, ..., N − 1}. Thus, we have ∆uk+i|k = 0, for

M ≤ i ≤ N − 1. Predictions yk+i|k are given by:

Yk = Fzk + G∆Uk, (2.6)

where

Yk , [ yTk+1|k yT

k+2|k yTk+3|k . . . yT

k+N|k ]T ∈ RNny ,

∆Uk , [ ∆uTk|k ∆uT

k+1|k ∆uTk+2|k . . . ∆uT

k+M−1|k ]T ∈ RMnu ,

F ,

CA

CA2

CA3

...

CAN

∈ RNny×nz and

Page 24: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 2. MODEL PREDICTIVE CONTROL 23

G ,

CB 0ny×nu 0ny×nu . . . 0ny×nu

CAB CB 0ny×nu . . . 0ny×nu

......

... . . ....

CAM−1B CAM−2B CAM−3B . . . CB...

...... . . .

...

CAN−1B CAN−2B CAN−3B . . . CAN−MB

∈ RNny×Mnu .

Proof. In Appendix A.

Definition 1: incremental MPC. Let ∆U∗k be the values of ∆Uk that minimizes

the following cost function:

J (∆Uk) , ‖Yk − Yk‖2 + ρ‖∆Uk‖2, (2.7)

subject to the restrictions:

Ξ∆Uk ≤ ξ, (2.8)

with Yk , [ yTk+1|k yT

k+2|k yTk+3|k . . . yT

k+N|k ]T ∈ RNny , where yk+i|k is a command to

yk+i|k. ρ ∈ R+ is the control weight. Ξ and ξ are matrices that describe the problem

constraints.

The control vector uk of incremental MPC is given by:

uk = uk−1 + ∆u∗k, (2.9)

with ∆u∗k =[

Inu 0nu×nu(M−1)

]∆U∗k.

Theorem 1. Consider the unrestricted optimization problem, described as follows:

minJ (∆Uk) , ‖Yk − Yk‖2 + ρ‖∆Uk‖2. (2.10)

Considering the prediction equation defined in (2.6), the vector solution ∆U∗k of the

unrestricted optimization problem is given by:

U∗M(k) =(GTG + ρIMnu

)−1GT[Yk −Fxk

]. (2.11)

Proof. See section 3.1.1 of reference (MACIEJOWSKI, 2002).

Page 25: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

3 Problem Statement

This Chapter focuses on the definition of the control problem considered in this un-

dergraduation study. Section 3.1 provides some primary definitions used in this work and

Section 3.2 enunciates the position control problem in a formal manner.

3.1 Preliminary Definitions

This work will be developed with the consideration of two Cartesian Coordinate Sys-

tems (CCS), they are illustrated in Figure 3.1. The ground CCS SG is fixed at a known

point on the Earth and is composed by the axes {XG, YG, ZG}, where ZG is aligned with

the local vertical. The body CCS SB = {XB, YB, ZB} is centered at the CM, but it is

fixed on the multirotor’s frame.

𝐫

𝑂 𝑌G

𝑋G

𝑍G

𝑍B

𝑋B

𝑌B

𝐅c

𝐅d CM

𝑚𝐠

FIGURE 3.1: Cartesian Coordinate Systems and forces in a multirotor aerial vehicle.

Assume that SG is an inertial frame. Consider the representation of the vehicle’s

position w.r.t. SG as rG ∈ R3 (1). Figure 3.1 also illustrates the forces acting on the

1This notation will be repeated throughout this work.

Page 26: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 3. PROBLEM STATEMENT 25

aerial vehicle: its weight mg, the control force Fc and a disturbance force Fd (g ∈ R3,

Fc ∈ R3 and Fd ∈ R3). Consider g ,[

0 0 −g]T

, where g is the local gravitational

acceleration. Fc is the resultant force of the four rotors, which is in the ZB direction. In

this work, Fd will simulate the wind influence in the multirotor’s dynamics.

3.2 Position Control Problem

The quadrotor’s translation dynamics can be derived by the application of the New-

ton’s Second Law. The result is presented in equation (3.1).

mgG + FcG + Fd

G = mrG, (3.1)

where gG, FcG, Fd

G and rG are the representations in SG of g, Fc, Fd and r, respectively.

Assume DGB ∈ R3×3 as the attitude matrix of SB w.r.t. SG. So the conversion between

these two CCS can be done as in next equation:

FcG = (DG

B)TFcB (3.2)

The vehicle is restricted to move inside a bounded environment, which can be expressed

in terms of a minimum position rmin ∈ R3 and a maximum position rmax ∈ R3, both

represented in SG:

rmin ≤ rG ≤ rmax. (3.3)

Consider that this environment has a known number p ∈ Z+ of polytopic obstacles in

its interior and each of them can be described as a linear inequality:

Θir ≤ θi, i ∈ {1, 2, . . . , p}, (3.4)

where Θi ∈ Rni×3 and θi ∈ Rni , with ni ∈ Z+ representing the number of faces of the ith

polytope. The vector r ∈ R3 is not a multirotor’s position, but it denotes a generic point

in the space of equation (3.3).

In order to respect the rotors’ maximum thrust limit, avoid inadvertent flips and pos-

sible stops of the rotors, the control force will be constrained between a lower bound Fmin

and an upper bound Fmax (Fmin,Fmax ∈ R3), as in equation (3.5). For more informations

Page 27: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 3. PROBLEM STATEMENT 26

about position control under thrust constraints, see the reference (SANTOS et al., 2013).

Fmin ≤ FcG ≤ Fmax (3.5)

The trajectory desired to the vehicle’s motion is established by a set of q ∈ Z+ way-

points {w1,w2, . . . ,wq}, where wj ∈ R3, with j ∈ {1, 2, . . . , q}. So consider the reference

trajectory r as the set of points connecting each pair of successive waypoints by a straight

line (see the dashed lines in Figure 3.2). Related to that, there is also a given reference

speed v ∈ R+, which is an indication of the quadrotor’s velocity during the flight.

𝐰1

𝐰2

𝐰3 𝐰q

𝐫ҧ

𝐰4

𝐰5

𝑣ҧ

FIGURE 3.2: A waypoint-based reference trajectory avoiding a polytopic obstacle.

At this point, we can enunciate the problem that will be studied in the next chapters

of this work.

Problem 1. The waypoint-based guidance problem for multirotor aerial vehicles is to

find a feedback control law for FcG that makes the vehicle’s position rG follow the reference

trajectory r in the presence of a constant wind (FdG), while respecting the environment

constraint in (3.3), the thrust constraint in (3.5) and avoiding the obstacles described by

(3.4).

Page 28: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

4 Problem Solution

This chapter will present a solution to Problem 1 defined in the previous chapter. The

method is based on its formulation in a standard Quadratic Programming problem [see

in (BOYD; VANDENBERGHE, 2004), section 4.4].

4.1 Preliminary Assumptions

The following assumptions will be necessary to the subsequent development.

Assumption 1. In the design of the controller, the force disturbances will not be con-

sidered.

Assumption 2. Consider F ∈ R3 as the thrust command computed by the guidance law

defined in Problem 1. Assume that there is no deviation between this command and the

effective force acting on the multirotor, i.e.,

FcG ≡ F. (4.1)

4.2 State-Space Model

The vehicle’s translational dynamics is described by equation (3.1). In order to design

the MPC controller, one can use the assumptions 1 and 2 introduced previously and

rewrite that expression in a simpler form:

gG +1

mF = rG. (4.2)

Assume that the quadrotor’s states are its position (rG) and velocity (rG). So the

state vector is defined by:

x ,

[rG

rG

]∈ R6. (4.3)

Page 29: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 28

The output of the translational state-space model is the vehicle’s position (y , rG ∈R3) and the control input is defined as the acceleration vector in terms of equation (4.2):

u , rG =1

mF + gG ∈ R3. (4.4)

Considering the previous definitions, the multirotor’s translational dynamics can be

modeled by the linear continuous-time state-space formulation:

x = Acx + Bcu, (4.5)

y = Ccx, (4.6)

where

Ac =

[03×3 I3

03×3 03×3

]∈ R6×6, Bc =

[03×3

I3

]∈ R6×3, Cc =

[I3 03×3

]∈ R3×6 and

I3 ∈ R3×3 is the identity matrix of size 3.

For control purposes, this continuous-time model must be discretized. Using the Zero

Order Hold method with a known sampling period T ∈ Z+, the next discrete-time model

is obtained:

xk+1 = Axk + Buk, (4.7)

yk = Cxk, (4.8)

with

A =

[I3 T I3

03×3 I3

]∈ R6×6, B =

[T 2

2I3

T I3

]∈ R6×3, C =

[I3 03×3

]∈ R3×6.

4.2.1 Incremental State-Space Model

In order to ensure robustness to a constant disturbance at the control input (simulating

a constant environment wind), the linear discrete-time model presented in equations (4.7)-

(4.8) must be organized in a incremental form [like in equations (A.17)-(A.18)]. In this

way, we define the incremental state vector as:

∆xk+1 , xk+1 − xk ∈ R6. (4.9)

Using the previous definition and state equation described in (4.7), one can realize the

Page 30: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 29

next expression:

∆xk+1 = A∆xk + B∆uk. (4.10)

In terms of the output, the vector yk+1 ∈ R3 can be derived directly from equation

(4.8):

yk+1 = Cxk+1. (4.11)

From the definition in (4.9), we have that xk+1 = ∆xk+1 + xk. Considering this

expression and (4.10), we can rewrite the equation (4.11) in a new way:

yk+1 = C (A∆xk + B∆uk + xk) , (4.12)

and after the algebraic handling, we get:

yk+1 = CA∆xk + CB∆uk + yk. (4.13)

Following the previous development, we may define the augmented state vector of the

incremental model as:

zk ,

[∆xk

yk

]∈ R9. (4.14)

Finally, using equations (4.10) and (4.13), we may set up the incremental state-space

formulation:

zk+1 = Azk + B∆uk, (4.15)

yk = Czk, (4.16)

with

A =

[A 06×3

CA I3

]∈ R9×9, B =

[B

CB

]∈ R9×3, C =

[03×6 I3

]∈ R3×9.

4.3 Environment and Thrust Constraints

As established in equation (3.3), the quadrotor’s translation is restricted to a bounded

environment. Considering the model defined in section 4.2, this constraint may be ex-

pressed as:

rmin ≤ yk ≤ rmax. (4.17)

In a similar way, the thrust force created by the rotors is limited to a lower and an

upper bounds [see equation (3.5)]. Using the assumption 2, we can rewrite it in terms of

Page 31: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 30

the thrust command of the controller:

Fmin ≤ F ≤ Fmax. (4.18)

Now, considering the definition (4.4), the previous equation may be expressed by

means of the control input uk:

umin ≤ uk ≤ umax, (4.19)

where umin , 1m

Fmin + gG ∈ R3 and umax , 1m

Fmax + gG ∈ R3.

4.4 Obstacle Avoidance

The polytopic obstacles which lie in the constrained environment of (4.17) were de-

scribed by equation (3.4). In order to avoid them, we first have to present some basic

definitions at first.

Consider the design parameter β ∈ R+ as the radius of a virtual sphere centered at

the vehicle. The method proposed in this work considers an obstacle if there exists an

intersection between it and that sphere (see Figure 4.1).

𝛽

v yk

Obstacle face

dk 𝑖

FIGURE 4.1: The vehicle’s perception of an obstacle.

As the Figure 4.1 suggests, we define dik ∈ R+ as the minimum distance between the

vehicle and the ith obstacle at instant k. This parameter can be calculated by solving the

next QP problem:

dik

2= min

Θir≤θi‖r− rG‖2, (4.20)

Page 32: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 31

where rG is the quadrotor’s position at current discrete-time k and r is an arbitrary point

inside the obstacle. Note that, in this optimization problem, rG is treated as a constant.

In the case of dik > β, the obstacle is too far from the vehicle and, therefore, it will be

simply ignored by the position control.

Otherwise, in case of dik ≤ β, the space described by equation (4.17) must be adapted,

taking into account the obstacle, in order to prevent a collision. The computation of the

constraint related to the perceived obstacle will be carried out in Subsection 4.4.1.

4.4.1 Obstacle Constraints

As was defined previously, ni is the number of faces of the ith obstacle. So we can

define the external space to the sth face, with s ∈ Z+ and s ≤ ni:

I is ,

{r : Θi

sr ≥ θis

}⊂ R3, (4.21)

where Θis ∈ R1×3 and θi

s ∈ R are the sth rows of the matrices Θi and θi, respectively.

Assume that the waypoints of the reference trajectory are chosen in order to, for any

space I is, there are at least two waypoints inside it. With this, in the case of di

k ≤ β, the

vehicle’s position is limited to the external spaces that contain both the previous (wj−1)

and the next waypoint wj. Mathematically, if rG ∈ I is and wj ∈ I i

s, then the obstacle

constraint is given by:

−Θisyk ≤ −θi

s. (4.22)

The strategy described up to here was explained to a single polytopic obstacle. In the

general case with p polytopes, this strategy must be applied to each one of them. As a

result, one can obtain a set of equations in the form of (4.22). For convenience, we may

join all these inequalities in an unique one:

−Θkyk ≤ −θk, (4.23)

where Θk ∈ Rno×3 and θk ∈ Rno , with no ∈ Z+ corresponding to the number of perceived

obstacles at instant k.

Page 33: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 32

4.5 Reference Trajectory

Consider the future reference trajectory of the MPC at instant k by the sequence{yk+i|k, i = 1, 2, . . .N

}, where yk+i|k ∈ R3 denotes the reference for the predicted output

yk+i|k. In the present work, the reference trajectory will be calculated as a straight line

between the current position of the vehicle yk and the next waypoint wj. With this

property, one can compute the future reference positions using the following equation:

yk+i|k = yk + vwj − yk

‖wj − yk‖iT, (4.24)

with i ∈ Z+, 1 ≤ i ≤ N . T ∈ Z+ is the sample time and v ∈ R+ is a reference speed to

the position controller (see Section 3.2).

Note that the second term of the right-hand side of (4.24) is the product of a reference

velocity vector with a time proportional to the sampling time T . Moreover, one can see

that this reference velocity has a magnitude v and points towards the current waypoint

wj.

However, equation (4.24) does not prevent the reference trajectory of going through

the waypoint wj. We can verify by simulations that this case would lead to overshoots in

the vehicle’s trajectory. Therefore, in order to avoid this undesired effect, we modify the

equation 4.24 by fixing yk+i|k = wj as soon as the following relation is verified:

‖yk+i|k − yk‖ > ‖wj − yk‖. (4.25)

Other case of exception to the equation (4.24) is when the multirotor have already

reached the final waypoint wq. In this case, the reference trajectory commands the vehicle

to hold this position by simply making yk+i|k = wq, for i ∈ {1, 2, . . . N}.

For convenience of notation, we consider all the future reference positions in the fol-

lowing augmented vector: yk+i|k:

Yk , [ yTk+1|k yT

k+2|k yTk+3|k . . . yT

k+N|k ]T ∈ R3N. (4.26)

4.5.1 Waypoint Commutation

During the flight of the quadrotor, the next waypoint of the trajectory must be changed

at the moment the vehicle approaches the current waypoint wj. In an extreme case, such

commutation could be done as soon as condition yk = wj is verified. However, in practice,

that strict requirement generates large overshoots and, for greater values of the reference

speed v, the vehicle may even orbit around the waypoint, which would delay the overall

Page 34: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 33

mission.

In this way, consider a spherical region involving each waypoint with radius λ ∈ R+

and denote it by Bλ(wj), which is called the waypoint detection region. The parameter λ

is called the waypoint detection radius and is a design parameter of the position controller.

Therefore, the commutation to the next waypoint wj+1 is done when the quadrotor enters

the waypoint detection region related to wj, i.e.:

yk ∈ Bλ(wj)⇒ {wj → wj+1} , (4.27)

where the symbol → represents the waypoint commutation.

The strategy described by (4.27) is performed until the multirotor reaches the last

waypoint wq of the trajectory.

4.6 Model Predictive Controller

In this section, we will enunciate the QP problem that composes the Model Predictive

Controller. The first subsection treats the adaptation of the given constraints to the

prediction model, while the solution of the resultant optimization problem is discussed in

the second one.

4.6.1 Constraints

The three basic types of constraints in the Position Control Problem were presented

previously: environment, thrust and obstacle constraints. They are expressed in equations

(4.17), (4.19) and (4.23), respectively. All these equations are written in terms of the

output vector or control input at the current discrete-time k. However, expressions (4.17)

and (4.23) are valid on all instants in the prediction horizon N , in the same way as

constraint (4.19) is applicable to all the control horizon M . So we may adapt them using

the naming introduced in the Appendix A:

[rmin]N ≤ Yk ≤ [rmax]N , (4.28)

[umin]M ≤ Uk ≤ [umax]M , (4.29)

−OYk ≤ − [θk]N , (4.30)

where [a]N denotes a column vector with N entries equal to a and

Page 35: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 34

O ,

Θk 0no×3 0no×3 . . . 0no×3

0no×3 Θk 0no×3 . . . 0no×3

......

... . . ....

0no×3 0no×3 0no×3 . . . Θk

∈ RnoN×3N .

Using the prediction equation in (A.21), the expressions (4.28) and (4.30) may be

rewritten in terms of the vector of incremental control ∆Uk, as follow:

[rmin]N ≤ fk + G∆Uk ≤ [rmax]N , (4.31)

−O(fk + G∆Uk

)≤ − [θk]N . (4.32)

The previous inequalities can yet be manipulated in order to isolate the term of ∆Uk

in the left-hand side, as follows:

G∆Uk ≤ [rmax]N − fk, (4.33)

−G∆Uk ≤ − [rmin]N + fk, (4.34)

−OG∆Uk ≤ Ofk − [θk]N . (4.35)

Concerning the thrust constraint in (4.29), it must be rewritten in terms of ∆Uk, in

order to adjust it to the model’s incremental formulation. So consider the next equation,

which is demonstrated by (MACIEJOWSKI, 2002), at page 54:

Uk = [uk−1]M + TM∆Uk, (4.36)

with

TM =

I3 03×3 . . . 03×3

I3 I3 . . . 03×3

...... . . .

...

I3 I3 . . . I3

∈ R3M×3M .

So applying the expression (4.36) in the constraint (4.29), we obtain the next two

inequalities, expressed in the standard form:

TM∆Uk ≤ [umax − uk−1]M , (4.37)

−TM∆Uk ≤ [−umin + uk−1]M . (4.38)

Page 36: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 35

Finally, as we have expressed all the constraints in terms of the incremental control

input, for simplicity, we may rewrite them in a single expression. So equations (4.33)-

(4.35) and (4.37)-(4.38) can be concatenated in the general form:

Ξ∆Uk ≤ ξ, (4.39)

with

Ξ ,

G−G−OGTM−TM

∈ R[(6+no)N+6M ]×3M and ξ ,

[rmax]N − fk

− [rmin]N + fk

Ofk − [θk]N[umax − uk−1]M

[−umin + uk−1]M

∈ R(6+no)N+6M .

4.6.2 Computation of the Control Input

As was explained in chapter 2, the Model Predictive Controller works by the solution

of a quadratic optimization problem at each discrete-time k. So consider the following

QP problem:

J (∆U∗k) = minΞ∆Uk≤ξ

J (∆Uk), (4.40)

with

J (∆Uk) , ‖Yk − Yk‖2 + ρ‖∆Uk‖2, (4.41)

where J (∆Uk) : R3M → R is the quadratic cost functional and ρ ∈ R+ is a design

weighting parameter. The vector ∆U∗k ∈ R3M is the array of optimal control inputs and

is the solution of the QP problem.

The functional J (∆Uk) may be written in the standard form of a quadratic cost

expression. To obtain this, we have to replace the prediction equation (A.21) in the

functional statement, as it’s done at next:

J (∆Uk) = ‖fk + G∆Uk − Yk‖2 + ρ‖∆Uk‖2. (4.42)

By manipulating the previous equation, we reach the quadratic conventional formula-

tion:

J (∆Uk) = ∆UTkH∆Uk − 2bT

k ∆Uk + ck, (4.43)

where

H , GTG + ρI3M ∈ R3M×3M,

bk , GT(Yk − fk

)∈ R3M and

Page 37: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 36

ck ,(Yk − fk

)T (Yk − fk

)∈ R.

Finally, the problem in (4.40) can be expressed as a standard quadratic optimization

problem with linear inequality constraints:

J (∆U∗k) = minΞ∆Uk≤ξ

J (∆Uk), (4.44)

J (∆Uk) , ∆UTkH∆Uk − 2bT

k ∆Uk + ck, (4.45)

where

∆U∗k , [ ∆u∗Tk|k ∆u∗Tk+1|k . . . ∆u∗Tk+M−2|k ∆u∗Tk+M−1|k ]T ∈ R3M.

To solve a convex optimization problem like the previous one, there are some op-

tions of efficient algorithms. For more information about this, see the reference (BOYD;

VANDENBERGHE, 2004) in its Part III.

The control input vector to be applied at instant k (uk) is taken as the optimal

incremental control ∆u∗k|k, the first vector component of ∆U∗k:

uk = uk−1 + ∆u∗k|k. (4.46)

4.7 Computation of final commands

In a cascaded control scheme, the position controller generates a thrust command to

the plant and a reference to the attitude controller in the internal loop. These two outputs

are calculated from the control vector uk computed by the predictive controller.

The thrust command to the propulsion set can be calculated as defined in equation

(4.4) and we have a 3D vector as follows:

Fk = muk −mgG. (4.47)

As the rotors of the vehicle are fixed in the direction of ZB, they are commanded by

dot quantities (Fk ∈ R+), which are the absolute values of Fk. So, the thrust command

calculated by the position controller is given by:

Fk = ‖Fk‖. (4.48)

The direction of Fk, in turn, is an indicative of the attitude command, as it means

the direction of the rotors’ plane. In this way, we define the unitary vector nk in this

Page 38: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 37

direction:

nk ,Fk

Fk

∈ R3. (4.49)

As is illustrated in Figure 4.2, we can calculate the angle ϕ ∈ R between the vectors

e3 and nk, where e3 =[

0 0 1]T

represents the direction of ZG. We may also compute

the normal vector ak ∈ R3 to the plane formed by those arrays. These two relations are

expressed in the next equations:

ϕ = arccos(nk · e3), (4.50)

ak = e3 × nk, (4.51)

where symbol ’·’ represents the dot product and ’×’ represents the vector product.

𝑋𝐺

𝑌𝐺

𝑍𝐺

𝐅തk

𝐚k

𝜑

𝑋തB

𝑌തB

𝑍ҧB

𝜓ത

CM

FIGURE 4.2: Computation of the attitude command to the internal loop of control.

The angle ϕ and vector ak form a pair of Euler’s angle/axis and can be used as a

reference to the inclination of the rotors’ plane. Consider the matrix Dak(ϕ) ∈ R3×3 as

this attitude representation.

However, for the complete attitude representation of that command, a heading angle

ψ ∈ R is necessary, which will be treated as an input to the position controller. So, this

heading command can be also written in the form of attitude matrix: D3(ψ) ∈ R3×3.

Finally, the attitude reference passed to the inner-loop attitude control is calculated

as the composition of Dak(ϕ) and D3(ψ), which is described by equation (4.52). For

more details about attitude representations and the computation of these two matrices,

Page 39: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 4. PROBLEM SOLUTION 38

we suggest the reference (SHUSTER, 1993).

DGB = D3(ψ)Dak

(ϕ) ∈ R3×3. (4.52)

Page 40: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

5 Computational Simulations

This Chapter presents the results of the numerical simulations done using the software

MATLAB/Simulink. The codes developed to implement the proposed control method and

simulate the quadrotor’s dynamics are provided in the disk attached to this work.

In Table 5.1, we give the quadrotor mechanical properties considered in the simula-

tions.

TABLE 5.1: Parameters of the quadrotor vehicle considered in the simulations.

Parameter Value

Mass m = 1 kg

Inertia matrix J = diag {0.02, 0.02, 0.03} kg m2

Frame radius l = 0.2 m

Time constant of the motor-drive τ = 0.01 s

Maximum speed of the motor ωmax = 10000 rpm

Force constant of the rotor kf = 3, 13× 10−5 N/(rad/s)2

Moment constant of the rotor kt = 7, 5× 10−7 N m/(rad/s)2

The thrust bounds Fmax and Fmin considered in the two sections were taken by limiting

the rotor’s plane inclination and the thrust magnitude. In order to avoid undesired flips,

a maximum inclination of ϕmax = 35◦ was employed. To respect the motor-drive limits

of good performance, the thrust magnitude was bounded between a maximum limit of

Fmax = 20 N and a minimum limit of Fmin = 2 N. With this assumptions, the 3D vectors

Fmax and Fmin are calculated using the method proposed in (PRADO; SANTOS, 2014).

Considering, for simplicity, a right prism of square base as the thrust constraint region,

we have the following expressions:

Fmin =

−Fmin tanϕmax√

2

− Fmin tanϕmax√2

Fmin

, (5.1)

Page 41: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 40

Fmax =

Fmin tanϕmax√

2Fmin tanϕmax√

2√F 2

max − (Fmin tanϕmax)2

. (5.2)

5.1 Simulation with a single obstacle

In this section, the proposed method of guiding and position controlling of multirotor

vehicles is tested in an environment containing a single polytopic obstacle. Equation (5.3)

presents the matrices that define the given solid.

Θ1 =

1 0 0

−1 0 0

0 1 0

0 −1 0

0 0 1

0 0 −1

,θ1 =

16

−6

16

−6

10

0

. (5.3)

In order to evaluate the effectiveness of the obstacle avoidance strategy, some numerical

simulations were done varying the reference speed and obstacle perception radius, with

all other control parameters kept constant. Table 5.2 presents the MPC parameters

considered in the simulations.

TABLE 5.2: Parameters of the MPC controller.

Parameter Value

Prediction horizon N = 20

Control horizon M = 20

Sampling time T = 0.1 s

Control weight ρ = 20

Reference speed v ∈ {3.0, 4.0, 5.0} m/s

Waypoint detection radius λ = 1 m

Obstacle perception radius β ∈ {0, 0.1, 0.5, 1.0} m

Minimum position rmin = [−5 − 5 − 5]T m

Maximum position rmax = [50 50 50]T m

Minimum thrust Fmin = [−1 − 1 2]T N

Maximum thrust Fmax = [1 1 19.81]T N

In this first simulation, it was considered a constant disturbance input in the XG

direction simulating a light wind in the environment. Thus, the disturbance force vector

Page 42: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 41

considered is FdG =

[0.1 0 0

]T

N.

Because of the inclination constraint imposed to the vehicle, it has different thrust

generation capacities in the ZG axis and in the perpendicular plane. Thus, the simula-

tions were performed on two batteries, each one with twelve tests, varying the controller

parameters v and β. In the first (shown in Figure 5.1), the reference trajectory commands

the vehicle to lash out against one of the side faces of the convex obstacle. In the second

battery (Figure 5.2), in a similar way, the quadrotor is commanded against the upper face

of the polytope. The two reference trajectories used in the simulations are described in

Table 5.3.

TABLE 5.3: Waypoints of the two reference trajectories considered in the simulations.

First trajectory Second trajectory

w1 = [ 0 0 0 ]T w1 = [ 9 8 16 ]T

w2 = [ 8 1 5 ]T w2 = [ 12 11 16 ]T

w3 = [ 8 5 5 ]T w3 = [ 12 11 10.5 ]T

w4 = [ 25 5 5 ]T w4 = [ 20 11 10.5 ]T

In the following two figures, the solid blue lines represent the vehicle’s trajectory and

the red rectangle is the obstacle. The solid green lines are the vehicle’s path inside the

obstacle when the strategy of obstacle avoidance approach is not considered. The dashed

lines represent the reference trajectory and the stars illustrate the waypoints (the red one

is the last waypoint).

Page 43: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 42

v=

3.0

[m/s]

Without deviation. β = 0.1 [m] β = 0.5 [m] β = 1.0 [m]

v=

4.0[m

/s]

v=

5.0[m

/s]

FIGURE 5.1: First trajectory, when the vehicle is released against a side face of the

obstacle. The flight path is projected in the XG − YG plane.

In the previous figure, the first column presents the results without obstacle deviation,

which corresponds to the vehicle trajectory in a hypothetical space without the obstacle.

In this case, the solid green lines show that the vehicle would enter into the obstacle.

However, increasing the parameter β, one can see that the vehicle is able to realize the

polytope so that the obstacle constraints are activated and the controller optimizes the

trajectory to avoid it.

When the speed v is increased up to 4.0 m/s, the vehicle is not able to avoid the

obstacle, considering β = 0.1 m. It happens because the multirotor helicopter only ”sees”

the polytope at a short distance such that it cannot produce the lateral deceleration

required to avoid the cube. This scenario also occurs when v goes up to 5.0 m/s. In these

two aforementioned cases, when the parameter β is increased, the vehicle can deviate of

the obstacle because the multirotor helicopter ”sees” it from a larger distance, allowing

the controller to implement a turn in the path.

Page 44: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 43

v=

3.0

[m/s]

Without deviation. β = 0.1 [m] β = 0.5 [m] β = 1.0 [m]

v=

4.0[m

/s]

v=

5.0[m

/s]

FIGURE 5.2: Second trajectory, when the vehicle is released against the top face of the

obstacle. The flight path is projected in the XG − ZG plane.

Figure 5.2 presents the vehicle behavior during a vertical approximation to the obsta-

cle. As shown in the previews cases, the vehicle enters into the solid when the obstacle

deviation algorithm is not implemented. However, for the smaller value of the obstacle

perception radius, the quadrotor only shocks with the cube for the higher speed. In the

scenario with v = 4 m/s and β = 0.1 m, one can see that the vehicle is able to deviate from

the solid. In comparison with the first trajectory, the aerial vehicle has more capability

to avoid the obstacle in this case. It is justified due to the rotors potential to produce

bigger thrust in the ZG direction (see Table 5.2).

Finally, is possible to see that the disturbance force doesn’t affect so much the vehicle’s

path, once it can pass by all the waypoints even in the worst cases.

5.2 Simulation with multiple obstacles

In this section, a space containing three convex obstacles is simulated at MATLAB/

Simulink and the formulated position control is evaluated in this environment. The ma-

Page 45: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 44

trices that describes the polytopes are given at next:

Θ1 =

1 0 0

−1 0 0

0 1 0

0 −1 0

0 0 1

0 0 −1

,θ1 =

4

−2

11

−1

10

0

; (5.4)

Θ2 =

1 0 0

−1 0 0

0 1 0

0 −1 0

0 0 1

0 0 −1

,θ2 =

9

−7

11

−1

10

0

; (5.5)

Θ2 =

1 0 0

−1 0 0

0 1 0

0 −1 0

0 0 1

0 0 −1

,θ2 =

14

−12

11

−1

10

0

. (5.6)

The obstacles reproduce buildings with ten meters height and the reference trajectory

simulates a roof inspection mission to be performed by the multirotor. The mission

consists of taking off at a point on the ground and climb until a height of two meters

above the buildings. In the sequence, the vehicle has to move down to a lower height

of ten centimeters above the first building and tracks a path along its length keeping

constant the distance to the roof. As completing the track, the quadrotor must climb

other time to the height of two meters up to the second roof and repeat the inspection.

Finally, the vehicle has to execute the inspection of the third roof and landing at a point

near to the last building.

The reference trajectory was set with the total of fifteen waypoints, which are exposed

in the next table.

Page 46: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 45

TABLE 5.4: Waypoints considered in the roof inspection mission.

w1 = [ 0 0 0 ]T w2 = [ 0 2 12 ]T

w3 = [ 3 2 12 ]T w4 = [ 3 2 10.1 ]T

w5 = [ 3 10 10.1 ]T w6 = [ 3 10 12 ]T

w7 = [ 8 10 12 ]T w8 = [ 8 10 10.1 ]T

w9 = [ 8 2 10.1 ]T w10 = [ 8 2 12 ]T

w11 = [ 13 2 12 ]T w12 = [ 13 2 10.1 ]T

w13 = [ 13 10 10.1 ]T w14 = [ 11 10 10.1 ]T

w15 = [ 11 1 0 ]T

Two simulations were done in this section: the first with no obstacle avoidance (β = 0)

and the second with β = 1.5 m. As can be observed in Table 5.5, all the others control

parameters were kept constant.

TABLE 5.5: Parameters of the MPC controller at the roof inspection simulation.

Parameter Value

Prediction horizon N = 20

Control horizon M = 20

Sampling time T = 0.1 s

Control weight ρ = 5

Reference speed v = 4m/s

Waypoint detection radius λ = 0.5 m

Obstacle perception radius β ∈ {0, 1.5} m

Minimum position rmin = [−5 − 5 − 5]T m

Maximum position rmax = [15 20 15]T m

Minimum thrust Fmin = [−1 − 1 2]T N

Maximum thrust Fmax = [1 1 19.81]T N

In the simulations presented, the quadrotor was subject to a constant disturbance

input in the YG direction, which simulates a light wind in the environment. Thus, the

disturbance force vector considered is FdG =

[0 0.3 0

]T

N.

In the next two figures, the symbols and colors pattern utilized is the same of Figures

5.1 and 5.2. An additional solid black line is employed in this case to indicate the points

in which the obstacle constraints are activated.

Page 47: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 46

FIGURE 5.3: Trajectory of the quadrotor in the roof inspection simulation in the case

with disabled obstacle avoidance.

05

1015

0

5

10

15

0

2

4

6

8

10

12

3D position

FIGURE 5.4: Trajectory of the quadrotor in the roof inspection simulation with

activated obstacle avoidance scheme.

Page 48: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 47

In the next graphs, lines of three different colors are used. The blue ones represent

the case without the obstacle avoidance and the red ones are used for the opposite case.

The green lines show the limits of each control component.

0 10 20 30 40 50 60 70 80−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1control input in XG direction

time (s)

ux(m

/s2)

FIGURE 5.5: Comparison between the control inputs in XG direction calculated by

MPC in the cases with the obstacle avoidance strategy on (red line) and off (blue line).

0 10 20 30 40 50 60 70 80−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1control input in YG direction

time (s)

uy(m

/s2)

FIGURE 5.6: Comparison between the control inputs in YG direction calculated by

MPC in the cases with the obstacle avoidance strategy on (red line) and off (blue line).

Page 49: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 48

0 10 20 30 40 50 60 70 80−8

−6

−4

−2

0

2

4

6

8

10control input in ZG direction

time (s)

uz(m

/s2)

FIGURE 5.7: Comparison between the control inputs in ZG direction calculated by

MPC in the cases with the obstacle avoidance strategy on (red line) and off (blue line).

In Figure 5.3, the vehicle collides with the obstacles in three times during its path. In

Figure 5.4, we see that it can run all the trajectory without touching any building. Thus,

we can see that the obstacle avoidance strategy proposed works for the case of multiple

obstacles.

Regarding the controls calculated by the MPC during the simulations, we observe

initially that the control restrictions are not violated at any moment. In XG and YG

directions, in which the vehicle has reduced thrust capacity, the realized controls assume

the extreme values on several occasions. However, in the ZG direction, due to the higher

capacity of thrust, the controls don’t assume the maximum or minimum value at any

time.

Also note the dynamic difference between the ZG axis and the other ones by the existing

overshoots on the executed trajectory. We can note that most of them are overshoots in

the directions of XG or YG. In these instants, the controller commands the motors to

generate the extreme lateral acceleration in order to return to the reference trajectory. In

contrast, overshoots in the ZG direction are uncommon because the vehicle can generate

enough acceleration to prevent them. In fact, the vehicle is able to execute even more

sudden maneuvers in the vertical direction without compromising the flight safety.

Figures 5.8-5.10 illustrates the effect of inserting the obstacle avoidance approach in

the control. These curves are computed as the difference between the control in the case

with active obstacle avoidance and the same quantity calculated without those constraints.

Page 50: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 49

0 10 20 30 40 50 60 70 80−1

−0.5

0

0.5

1

1.5variation of control input in XG direction

time (s)

variationin

ux(m

/s2)

FIGURE 5.8: Difference of controls in the XG direction caused by the consideration of

the obstacle constraints.

0 10 20 30 40 50 60 70 80−1

−0.5

0

0.5

1

1.5

2variation of control input in YG direction

time (s)

variationin

uy(m

/s2)

FIGURE 5.9: Difference of controls in the YG direction caused by the consideration of

the obstacle constraints.

Page 51: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 5. COMPUTATIONAL SIMULATIONS 50

0 10 20 30 40 50 60 70 80−1.2

−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8variation of control input in ZG direction

time (s)

variationin

uz(m

/s2)

FIGURE 5.10: Difference of controls in the ZG direction caused by the consideration of

the obstacle constraints.

Page 52: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

6 Conclusions and Future Works

This undergraduate course final work presents a MPC formulation applied to the

waypoint-based guidance with avoidance of multiple obstacles to multirotor aerial vehicles.

This proposal was tested by means of computer simulations in MATLAB/Simulink. The

results of these simulations, which were presented in Chapter 5, show that the method

is effective in preventing collisions with environmental obstacles, even when subjected to

light input disturbances.

It could be seen that the restrictions imposed on the control variable were respected in

all cases. Also it was observed the difference between the calculated controls with active

obstacle constraints and without them. In a general way, these differences are small, so

that the additional requirement to the motors in order to avoid obstacles is not significant.

However, the obstacle avoidance approach is limited by the vehicle inclination restric-

tion. Thus, the calculated controls in the XG and YG directions assume the extreme values

at different moments on the path. This fact reduces the obstacle avoidance capacity in

these two directions. However, in the ZG direction, the vehicle deviates well without using

the extreme controls imposed by the constraints.

The proposed obstacle avoidance method is considered by the MPC to adding con-

straints to the optimization problem. However, due to the operation of the controller,

one might think that a different method which acts on the problem’s objective function

could have better performance. As an example, we can suggest a method that changes

the reference values to the model outputs according to the perception of obstacles during

the path. This idealized method would even reduce the overshoots made during vehicle’s

flight.

As other suggestions of future works, we can cite:

• The use of a modern design of MPC to ensure stability and/or robustness in the

presence of disturbances adapted for obstacle avoidance;

• Adaptation of a path planning algorithm designed to the generation of waypoints

external of obstacles in the environment;

Page 53: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

CHAPTER 6. CONCLUSIONS AND FUTURE WORKS 52

• Adaptation of the position controller proposed in this work in order to board it on

a real quadrotor and perform practical experiments of waypoint-based guidance in

the presence of obstacles, like an indoor flight.

Page 54: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Bibliography

ALEXIS, K.; PAPACHRISTOS, C.; SIEGWART, R.; TZES, A. Robust ModelPredictive Flight Control of Unmanned Rotorcrafts. In: European ControlConference (ECC). Strasbourg, France: [s.n.], 2014. p. 498–503.

BASRI, M. A. M.; HUSAIN, A. R.; DANAPALASINGAM, K. A. EnhancedBackstepping Controller Design with Application to Autonomous Quadrotor UnmannedAerial Vehicle. Journal of Intelligent & Robotic Systems, Springer, v. 79, n. 2, p.295–321, 2015.

BOUABDALLAH, S.; BECKER, M.; PERROT, V. de; SIEGWART, R. TowardObstacle Avoidance on Quadrotors. In: XII International Symposium on DynamicProblems of Mechanics (DINAME 2007). Ilhabela, Brazil: [s.n.], 2007.

BOUABDALLAH, S.; NOTH, A.; SIEGWART, R. PID vs LQ Control TechniquesApplied to an Indoor Micro Quadrotor. In: IEEE/RSJ International Conferenceon Intelligent Robots and Systems (IROS 2004). Sendai, Japan: [s.n.], 2004.

BOYD, S.; VANDENBERGHE, L. Convex Optimization. New York: CambridgeUniversity Press, 2004.

CAMACHO, E. F.; BORDONS, C. Model Predictive Control. London, England:Springer, 1999.

GENG, Q.; SHUAI, H.; HU, Q. Obstacle Avoidance Approaches for Quadrotor UAVbased on Backstepping Technique. In: 25th Chinese Control and DecisionConference. Guiyang, China: [s.n.], 2013.

KYRIAKOPOULOS, K. J.; SARIDIS, G. N. An Integrated Collision Prediction andAvoidance Scheme for Mobile Robots in Non-stationary Environments. Automatica,Elsevier, v. 29, n. 2, p. 309–322, 1993.

MACIEJOWSKI, J. M. Predictive Control with Constraints. Harlow, England:Prentice Hall, 2002.

MAYNE, D. Q. Model Predictive Control: Recent Developments and Future Promise.Automatica, Elsevier, v. 50, n. 12, p. 2967–2986, 2014.

MELLINGER, D.; KUMAR, V. Minimum Snap Trajectory Generation and Control forQuadrotors. In: IEEE International Conference on Robotics and Automation.Shangai, China: [s.n.], 2011.

Page 55: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

BIBLIOGRAPHY 54

PRADO, I. A. A.; SANTOS, D. A. A Safe Position Tracking Strategy for MultirotorHelicopters. In: 22st Mediterranean Conference on Control and Automation(MED). Palermo, Italy: [s.n.], 2014.

RAFFO, G. V.; ORTEGA, M. G.; RUBIO, F. R. An integral predictive/nonlinear H∞control structure for a quadrotor helicopter. Automatica, Elsevier, v. 46, n. 1, p.29–39, 2010.

SANTOS, D. A.; SAOTOME, O.; CELA, A. Trajectory Control of MultirotorHelicopters with Thrust Vector Constraints. In: 21st Mediterranean Conference onControl and Automation (MED). Platanias, Greece: [s.n.], 2013.

SHI, X.-N.; ZHANG, Y.-A.; ZHOU, D. A Geometric Approach for Quadrotor TrajectoryTracking Control. International Journal of Control, Taylor & Francis, v. 79, n. 2, p.295–321, 2015.

SHUSTER, M. D. A Survey of Attitude Representations. The Journal of theAstronautical Sciences, v. 41, n. 4, p. 439–517, 1993.

VIANA, I. B.; PRADO, I. A. A.; SANTOS, D. A.; GOES, L. C. S. Trajectory TrackingControl of an Aerial Robot with Obstacle Avoidance. In: 11th IFAC Symposium onRobot Control. Salvador, Brazil: [s.n.], 2015.

YAN, J.; SANTOS, D. A.; BERNSTEIN, D. S. Adaptive control with convex saturationconstraints. IET Control Theory and Applications, IET Research Journals, v. 8,n. 12, p. 1096–1104, 2014.

Page 56: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

Appendix A - Prediction Equation

In this chapter, it will be demonstrated the algebra to derive the prediction equation of

MPC. The section A.1 will consider the case of a system modeled in a standard linearized

state-space formulation, while section A.2 will present an adaptation to the case of a

incremental state-space model.

A.1 Model in conventional form

Consider a system modeled in a linearized discrete-time state-space formulation:

xk+1 = Axk + Buk, (A.1)

yk = Cxk, (A.2)

where k ∈ Z+ is the discrete-time. The vector xk ∈ Rnx holds all the model’s states

at instant k. Similarly, vector uk ∈ Rnu contains the control inputs and yk ∈ Rny is

composed by the model’s outputs at the same instant. In this way, matrices A ∈ Rnx×nx ,

B ∈ Rnx×nu and C ∈ Rny×nx is known. Expression (A.1) is called the state equation and

(A.2) is the output equation of the state-space model.

In terms of predicted values, equations (A.1) and (A.2) can be rewritten as:

xk+1|k = Axk + Buk|k, (A.3)

yk = Cxk, (A.4)

where xk+1|k is the predicted value of xk+1 calculated at instant k. Likewise, vector uk|k

is the control computed at instant k to be applied at the same discrete-time.

To compute the prediction equation, one can describe the predicted state xk+2|k in the

Page 57: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

APPENDIX A. PREDICTION EQUATION 56

same way as equation (A.3):

xk+2|k = Axk+1|k + Buk+1|k. (A.5)

Then, xk+1|k at equation (A.3) can be substituted in (A.5) to obtain the expression:

xk+2|k = A2xk + ABuk|k + Buk+1|k. (A.6)

Similarly, the predicted state at instant k + 3 (xk+3|k) can be written as:

xk+3|k = Axk+2|k + Buk+2|k. (A.7)

And the vector xk+2|k from equation (A.6) can be substituted in (A.7) to have this:

xk+3|k = A3xk + A2Buk|k + ABuk+1|k + Buk+2|k. (A.8)

By the previous development, one can note a general formation rule for the predicted

state at instant k + i, i ∈ Z+, 1 ≤ i ≤ N:

xk+i|k = Aixk + Ai−1Buk|k + Ai−2Buk+1|k + · · ·+ Buk+i−1|k. (A.9)

Equations (A.3), (A.6), (A.8) and (A.9) can be rewritten in terms of predicted outputs

by left-hand multiplying the two sides of this expressions by matrix C. The results of this

are given at next:

yk+1|k = CAxk + CBuk|k, (A.10)

yk+2|k = CA2xk + CABuk|k + CBuk+1|k, (A.11)

yk+3|k = CA3xk + CA2Buk|k + CABuk+1|k + CBuk+2|k, (A.12)

yk+i|k = CAixk + CAi−1Buk|k + CAi−2Buk+1|k + · · ·+ CBuk+i−1|k, (A.13)

with i ∈ Z+, 1 ≤ i ≤ N and yk+i|k is the predicted value of yk+i computed at discrete-time

k.

Finally, equations (A.10)-(A.13) can be organized in a compact matrix form:

Yk = Fxk + GUk, (A.14)

Page 58: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

APPENDIX A. PREDICTION EQUATION 57

with

Yk , [ yTk+1|k yT

k+2|k yTk+3|k . . . yT

k+N|k ]T ∈ RNny ,

Uk , [ uTk|k uT

k+1|k uTk+2|k . . . uT

k+N−1|k ]T ∈ RNnu ,

F ,

CA

CA2

CA3

...

CAN

∈ RNny×nx and

G ,

CB 0ny×nu 0ny×nu . . . 0ny×nu

CAB CB 0ny×nu . . . 0ny×nu

CA2B CAB CB . . . 0ny×nu

......

... . . ....

CAN−1B CAN−2B CAN−3B . . . CB

∈ RNny×Nnu .

The previous equation is valid in the particular case with control horizon equal to

prediction horizon. Consider yet that 0ny×nu ∈ Rny×nu represents a matrix composed only

by zeros.

Matrix G at equation (A.14) computes the system’s dynamics between the control

inputs (Uk) and output variables (Yk), so it is called the dynamics matrix of the MPC.

In turn, the product Fxk calculates the system’s outputs in case with no control action,

thus this is the output caused exclusively by the initial state of the system at discrete-

time k (xk) and is known as the free response of the system (see reference (MACIEJOWSKI,

2002)). The free response will be designated from now on by fk ∈ RNny .

In the case when M < N , the predicted control inputs at instants beyond the control

horizon remain constants, so uk+i|k = uk+M−1|k,M ≤ i ≤ N−1. In this case, the prediction

equation (A.14) can be slightly modified to a new form:

Yk = fk + GUk, (A.15)

with Yk, fk as defined previously and

Uk , [ uTk|k uT

k+1|k . . . uTk+M−2|k uT

k+M−1|k ]T ∈ RMnu ,

Page 59: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

APPENDIX A. PREDICTION EQUATION 58

G ,

CB 0ny×nu . . . 0ny×nu 0ny×nu

CAB CB ... 0ny×nu 0ny×nu

...... . . .

......

CAM−1B CAM−2B ... CAB CB...

... . . ....

...

CAN−1B CAN−2B ... CAN−M+1BN∑i=M

CAN−iB

∈ RNny×Mnu .

A.2 Model in incremental form

A possible way to model a system in a discrete-time state-space formulation is using

the increments of control:

∆uk , uk − uk−1 ∈ Rnu . (A.16)

In this case, a system originally modeled as equations (A.1)-(A.2) may be adapted to

a new linearized state-space model (see details in Subsection 4.2.1):

zk+1 = Azk + B∆uk, (A.17)

yk = Czk, (A.18)

where zk ∈ Rnz holds the states of this model, with nz > nx. The matrices A ∈ Rnz×nz ,

B ∈ Rnz×nu and C ∈ Rny×nz are algebraically obtained from A, B, C, respectively.

In terms of predicted values, one can rewrite equations (A.17) and (A.18) in a similar

form:

zk+1|k = Azk + B∆uk|k, (A.19)

yk = Czk, (A.20)

where zk+1|k is the predicted value of zk+1 calculated at discrete-time k and ∆uk|k ,

uk|k − uk−1.

The prediction equation related to this model can be computed by the same form

presented in section A.1. The difference in this case is that, for instants k+i such that M ≤i ≤ N − 1, vector ∆uk+i|k remains zero, because it was assumed that uk+i|k = uk+M−1|k.

Due to this fact, the last N −M columns of G in equation (A.14) can be ignored, because

all their elements are being multiplied by null incremental controls. So the result is the

Page 60: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

APPENDIX A. PREDICTION EQUATION 59

prediction equation:

Yk = Fzk + G∆Uk, (A.21)

with vector Yk as defined in the previous section and

∆Uk , [ ∆uTk|k ∆uT

k+1|k . . . ∆uTk+M−2|k ∆uT

k+M−1|k ]T ∈ RMnu ,

F ,

CA

CA2

CA3

...

CAN

∈ RNny×nx ,

G ,

CB 0ny×nu . . . 0ny×nu 0ny×nu

CAB CB ... 0ny×nu 0ny×nu

...... . . .

......

CAM−1

B CAM−2

B ... CAB CB...

... . . ....

...

CAN−1

B CAN−2

B ... CAN−M+1

B CAN−M

B

∈ RNny×Mnu .

The term Fzk in equation (A.21) also indicates the free response of the model and

will be represented in this work by fk ∈ RNny .

Page 61: WAYPOINT-BASED GUIDANCE WITH OBSTACLE … · instituto tecnolÓgico de aeronÁutica josé agnelo bezerra guilherme silva waypoint-based guidance with obstacle avoidance for multirotor

FOLHA DE REGISTRO DO DOCUMENTO

1. CLASSIFICACAO/TIPO 2. DATA 3. DOCUMENTO No 4. No DE PAGINAS

TC 25 de novembro de 2015 DCTA/ITA/TC-054/2015 59

5. TITULO E SUBTITULO:

Waypoint-Based Guidance with Obstacle Avoidance for Multirotor Vehicles Using a Model Predictive Controller

6. AUTOR(ES):

Jose Agnelo Bezerra Guilherme Silva

7. INSTITUICAO(OES)/ORGAO(S) INTERNO(S)/DIVISAO(OES):

Instituto Tecnologico de Aeronautica – Divisao de Engenharia Mecanica-Aeronautica – ITA/IEM.

8. PALAVRAS-CHAVE SUGERIDAS PELO AUTOR:

Multirotor Aerial Vehicle; Model Predictive Control; Waypoint Navigation; Obstacle Avoidance

9. PALAVRAS-CHAVE RESULTANTES DE INDEXACAO:

Controle preditivo; Ponto de notificacao; Controle de trajetoria; Simulacao computacional; Controladores; Con-trole.10. APRESENTACAO: (X) Nacional ( ) Internacional

Trabalho de Graduacao, ITA, Sao Jose dos Campos, 2015. 59 paginas. Curso de Graduacao em EngenhariaMecanica-Aeronautica. Orientador: Davi Antonio dos Santos. Publicado em 2015.11. RESUMO:

This undergraduation study deals with the problem of waypoint-based guidance of multirotor aerial vehicles with

avoidance of multiple polytopic obstacles. In order to solve the problem, a receding horizon model predictive

controller (MPC) is adopted. The command inputs to the controller consist of a sequence of tridimensional

waypoints as well as a reference speed. The future reference output trajectory embedded in the MPC is chosen

as a straight line, traveled with the reference speed, towards the next waypoint of the sequence. A waypoint is

detected as soon as the vehicle enters inside a specified Euclidean ball centered at it. At the same moment, the

next waypoint of the sequence is switched on. This rule is repeated until reaching the final waypoint, at which

the vehicle is commanded to hover. In order to avoid multiple polytopic obstacles, a very simple method based

on both the previous and the next waypoints is proposed for obtaining a convex optimization space that does

not contain the obstacles. The proposed method is evaluated by simulations, showing that it is effective to guide

a multirotor vehicle throughout the waypoints, with approximately the reference speed, even in the presence of

obstacles and under disturbance forces.

12. GRAU DE SIGILO:

(X) OSTENSIVO ( ) RESERVADO ( ) CONFIDENCIAL ( ) SECRETO