application and simulation of nonlinear geometric

0 downloads 0 Views 5MB Size Report
There are two prominent vision-based strategies, each de- signed to deal with ..... tiplying several rotation matrices together, which again ends up in SO(3). Conversely, ...... [36] R. Prouty, Helicopter Performance, Stability, and Control. Krieger ...
VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY FACULTY OF TRANSPORTATION ENGINEERING DEPARTMENT OF AERONAUTICAL ENGINEERING TRAINING PROGRAM OF EXCELLENT ENGINEERS IN VIETNAM

-------o0o-------

GRADUATION THESIS

APPLICATION AND SIMULATION OF NONLINEAR GEOMETRIC CONTROL FOR QUADROTOR UAVS

STUDENT:

HOANG DINH THINH

ADVISER: DR. LE THI HONG HIEU DR. NGUYEN NGOC HIEN

HO CHI MINH City, May 2018

Application and Simulation of Nonlinear Geometric Control for Quadrotor UAVs

Presented by Hoang Dinh Thinh under advisement of Dr. Le Thi Hong Hieu and Dr. Nguyen Ngoc Hien to Department of Aeronautical Engineering in partial fulfilment of the requirements for the degree of Bachelor of Science in Aeronautical Engineering.

Ho Chi Minh City University Of Technology Ho Chi Minh City, Vietnam May 2018

i

Intentionally left blank

ii

Commitment I hereby commit that this is my scientific work. The results are presented as-is and have never been published anywhere else. Under no circumstance did I intentionally claim facts from other people’s work without attributing them in the bibliography. Author.

iii

Intentionally left blank

iv

Acknowledgements This thesis marks the final of my study in Aeronautical Engineering at Ho Chi Minh City University of Technology. The process of conducting research and writing thesis has long been a challenging one, but I’m grateful to receive a lot of support from many people. I hereby express my highest gratitude towards my advisors, Dr. Le Thi Hong Hieu and Dr. Nguyen Ngoc Hien for their continuous mentoring and motivating throughout the thesis. I also felt greatly indebted to my Department of Aeronautical Engineering for having guided, inspired and facilitated my study for 5 years. This thesis would not be made possible without assistance from many professors and friends on Stack Exchange Mathematics forum, who have devoted their precious time to helping me tackling different aspects of the problems encountered. In particular, I would like to thank Professor Jean-Marie, Mr. Kwin van der Veen and AΓ for providing me with a lot of insights to form the inception of the proofs. My acknowledgement also goes to Dr. Fredric Schuller, Professor Peter Al Hokayem and Eduardo Gallestey whose great lectures have helped me a lot when getting started in differential geometry and nonlinear control. Ho Chi Minh City, May 2018. Hoang Dinh Thinh.

v

Intentionally left blank

vi

Contents Contents

vii

List of Tables

xiii

List of Figures

xv

List of Symbols

xix

Acronyms

xxi

1 Introduction 1.1 Unmanned Aerial Vehicles (UAVs) . . . . 1.2 The UAV civil market . . . . . . . . . . . 1.2.1 Market opportunity . . . . . . . . . 1.2.2 Applications . . . . . . . . . . . . . 1.2.3 Key challenges . . . . . . . . . . . 1.3 The HOPE project . . . . . . . . . . . . . 1.4 Quadrotor state of the art . . . . . . . . . 1.4.1 Introduction . . . . . . . . . . . . . 1.4.2 Quadrotor electronics . . . . . . . . 1.4.3 A brief survey of quadrotor control Linear control strategies . . . . . . Non-linear control strategies . . . . 1.5 Motivations, objectives and contributions . 1.5.1 Motivation . . . . . . . . . . . . . . 1.5.2 Objectives . . . . . . . . . . . . . . 1.5.3 Contribution of this work . . . . . 2 Dynamics Modelling 2.1 Assumptions . . . . . . . . . . . . . . . . 2.2 Frames . . . . . . . . . . . . . . . . . . . 2.2.1 Inertial and body frame . . . . . 2.2.2 The Euler angles parametrisation 2.3 Basic motions . . . . . . . . . . . . . . . 2.4 Primary forces and moments . . . . . . . 2.5 Secondary forces and moments . . . . . . 2.5.1 Horizontal force . . . . . . . . . . vii

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . .

. . . . . . . . . . . . . . . .

1 1 4 5 5 6 8 8 8 9 12 13 13 13 13 14 14

. . . . . . . .

16 16 17 17 18 21 21 22 22

2.6 2.7

2.5.2 Rotor flapping . . . . . . . . . . . . . 2.5.3 Rotor gyroscopic effect . . . . . . . . 2.5.4 Thrust model validity . . . . . . . . Actuator characteristics . . . . . . . . . . . Complete dynamics model and simplification 2.7.1 Complete dynamics model . . . . . . 2.7.2 Simplification of dynamics model . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

3 The geometric nonlinear control 3.1 The rotation group SO(3) . . . . . . . . . . . . . . . . . 3.1.1 Elements of differential geometry . . . . . . . . . 3.1.2 Matrix groups . . . . . . . . . . . . . . . . . . . . 3.1.3 Derivatives . . . . . . . . . . . . . . . . . . . . . 3.1.4 Lie algebra, exponential and logarithm mappings 3.2 Properties of some geometrical entities . . . . . . . . . . 3.2.1 Skew-symmetric matrix properties . . . . . . . . . 3.2.2 Error functions on SO(3) . . . . . . . . . . . . . . 3.3 Nonlinear control concepts . . . . . . . . . . . . . . . . . 3.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . 3.3.2 Stability . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 Lyapunov stability theorem . . . . . . . . . . . . 3.4 Derivation of control laws for quadrotor . . . . . . . . . . 3.4.1 Attitude tracking . . . . . . . . . . . . . . . . . . 3.4.2 Position tracking . . . . . . . . . . . . . . . . . . A motivational synthesis . . . . . . . . . . . . . . Position control synthesis . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

4 Implementation of the geometric control 4.1 The NLGC Toolbox . . . . . . . . . . . . . . . . . . . . . . 4.2 Bus conventions and variable tunnelling . . . . . . . . . . . 4.3 The aircraft model . . . . . . . . . . . . . . . . . . . . . . 4.4 Motor command block . . . . . . . . . . . . . . . . . . . . 4.5 Angular rates estimator . . . . . . . . . . . . . . . . . . . 4.6 Translational position error . . . . . . . . . . . . . . . . . 4.7 Translational velocity error . . . . . . . . . . . . . . . . . . 4.8 Attitude error block . . . . . . . . . . . . . . . . . . . . . . 4.9 Angular rates error block . . . . . . . . . . . . . . . . . . . 4.10 Attitude control synthesis block . . . . . . . . . . . . . . . 4.11 Flight director synthesis block . . . . . . . . . . . . . . . . 4.11.1 Trajectory filtering . . . . . . . . . . . . . . . . . . 4.11.2 Thrust magnitude and desired attitude calculations 5 Simulation of the geometric control 5.1 The tests . . . . . . . . . . . . . . . 5.2 Comparison method . . . . . . . . 5.3 Nonlinear geometric control in ideal 5.4 PID controller in ideal condition . . viii

. . . . . . . . . . . . condition . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . .

. . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . .

. . . . . . .

23 24 24 24 26 26 26

. . . . . . . . . . . . . . . . .

30 30 30 33 36 38 41 41 45 50 50 51 53 54 54 58 59 61

. . . . . . . . . . . . .

68 68 70 70 72 74 77 78 78 79 79 82 83 84

. . . .

92 92 96 98 106

5.5

5.6 5.7

Nonlinear geometric controller in SR condition 5.5.1 Model update . . . . . . . . . . . . . . 5.5.2 Simulation result . . . . . . . . . . . . PID controller in SR condition . . . . . . . . . Final remarks . . . . . . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

110 110 113 118 119

6 Conclusion and prospects of development 123 6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 6.2 Prospects of development . . . . . . . . . . . . . . . . . . . . . . . . . . 123 A Atmospheric Turbulence Modelling 125 A.1 The principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 A.2 Dryden turbulence model . . . . . . . . . . . . . . . . . . . . . . . . . . 127 A.3 The Dryden wind turbulence model block . . . . . . . . . . . . . . . . 128 Bibliography

130

ix

Intentionally left blank

x

Abstract This thesis presents a robust non-linear attitude and trajectory tracking algorithm based on geometric properties of the Special Orthogonal Group SO(3) for quadrotor controlling, along with the complete implementation of the system on MATLAB/Simulink. We studied that a reliable controller is an obligatory premise to more advanced autonomous features, thus we engaged in an approach to examine a particular controller design for quadrotors, which is the Nonlinear Geometric Controller. We present the physical laws that govern the dynamics of an aircraft in three-dimensional space and derive a full set of differential equations of motion. Then we exploit several properties of the group of rotations SO(3) to obtain the error functions along with their characteristics. These are the building blocks to construct the Lyapunov Candidate Functions which, by using Lyapunov’s theorem for stability, allow us to derive control laws to exponentially converge attitude and position error to zero. Numerical simulations conclude that this controller exhibits robustness against extrinsic disturbances and intrinsic uncertainties for accurate trajectory tracking. Detailed implementation of this controller on MATLAB/Simulink is given and along with a proposal for performance assessment method to compare between nonlinear geometric and traditional PID controllers. Finally, prospects about future works based on this thesis is mentioned. Keywords: UAV, quadrotor, nonlinear control, geometric, MATLAB/Simulink.

xi

Intentionally left blank

xii

List of Tables 1.1 1.2

Comparison between rotary wings UAV designs [12] . . . . . . . . . . . . . Market value of industries which may benefit from drones [15] . . . . . . .

4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12

Inputs and outputs of the 6DOF Euler block [59] . . . . . Inputs and outputs of the Engine Thrust block . . . . . . Inputs and outputs of the Motor control block . . . . . . . Inputs and outputs of the angular rates estimator block . . Inputs and outputs of the translational position error block Inputs and outputs of the translational velocity error block Inputs and outputs of the attitude error block . . . . . . . Inputs and outputs of the angular velocity error block . . . Inputs and outputs of the attitude control synthesis block A simple flight path/trajectory . . . . . . . . . . . . . . . Inputs and outputs of the attitude generation block . . . . Inputs and outputs of the flight director synthesis block . .

5.1 5.2 5.2

Sample trajectory to track . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Summary of benchmark indices . . . . . . . . . . . . . . . . . . . . . . . . 121 Summary of benchmark indices (cont.) . . . . . . . . . . . . . . . . . . . . 121

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

3 5 73 73 74 77 77 78 79 81 81 82 88 91

A.1 Inputs and outputs of the Dryden turbulence model . . . . . . . . . . . . . 129

xiii

Intentionally left blank

xiv

List of Figures 1.1 1.2 1.3 1.4

1.5 1.6 1.7 1.8 1.9 2.1 2.2 2.3 2.4

Various examples of UAV categorised by wing design . . . . . . . . . . . . Categorisation of aircraft based on flying principle and propulsion system [13] Categorisation of a general UAV based on wing design [13] . . . . . . . . . NDVI data gathered from a remote sensing mission showing how dense a vegetable planting area is. This is a trivial example in precision agriculture [21] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A quadrotor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Popular sensors for UAV control . . . . . . . . . . . . . . . . . . . . . . . . Popular electronic kits for UAV control . . . . . . . . . . . . . . . . . . . . A diagram of complementary filter . . . . . . . . . . . . . . . . . . . . . . UAS Networking: a telecommunication scheme for UAV [29] . . . . . . . .

2 4 4

7 9 10 10 12 12

2.5

Illustration of inertial frame G and body frame b . . . . . . . . . . . . . . Two modelling configuration of a quadrotor . . . . . . . . . . . . . . . . . Construction of Tait-Bryan angles [33] . . . . . . . . . . . . . . . . . . . . A diagram of BLDC motor. It is visible that at any moment, only two coils are electrified while the remaining coil is freely floating. Sophisticated electronic inverter controls the current input to each coil, creating a spinning motion [38]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Images of BLDC motors . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25 25

3.1 3.2 3.3 3.4 3.5 3.6

Preserving length also preserves angle . . . . . Representation of SO(3) geometrically . . . . Types of equilibrium . . . . . . . . . . . . . . MAVinci - a flight planning software for UAVs A quadrotor intercepting a desired trajectory Relationship between thrust vectors . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

34 40 52 59 61 63

4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9

The toolbox in Simulink Library Browser . . . . . . . . . The NLGC Toolbox . . . . . . . . . . . . . . . . . . . . Some Cyan sinks that direct signal to a Cyan bus . . . . Some Magenta sinks that direct signal to a Magenta bus A rotation matrix being tunnelled globally . . . . . . . . Quadrotor Dynamics Model . . . . . . . . . . . . . . . . Parametric setup of 6DOF Euler block . . . . . . . . . . Masked parametres of the Quadrotor Dynamics Block . . The motor control block . . . . . . . . . . . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

69 69 70 70 71 72 74 74 75

xv

. . . . . . . . . [56] . . . . . .

. . . . . .

. . . . . .

17 18 19

4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.21 4.22 4.23 4.24

Omega estimator block . . . . . . . . . . . . . . . . . . . . . Realisation of the translational position error block . . . . . Realisation of the translational velocity error block . . . . . Realisation of the Attitude Error block . . . . . . . . . . . . Realisation of the angular rates error block . . . . . . . . . . Realsiation of the attitude control synthesis block . . . . . . Mask parameters of the attitude control synthesis block . . . Pole-zero plot of the transfer function . . . . . . . . . . . . . Response of various derivatives of the flight trajectory filter Linear interpolation of sample trajectory . . . . . . . . . . . Post-processing of signals for the Attitude Generator block . Attitude Generator block . . . . . . . . . . . . . . . . . . . . Post-processing of signals from the attitude generation block Visualisation of PDV, DDV, V and T in space . . . . . . . . Mask configurations of the flight director synthesis block . .

5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.7 5.7 5.8 5.9 5.10

Sample trajectory to track . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 QuadSim simulation model for PID controller . . . . . . . . . . . . . . . . 96 Full implementation of the trajectory tracking nonlinear geometric controller 99 Implementation of the attitude control synthesis block . . . . . . . . . . . 100 Implementation of the flight director synthesis block . . . . . . . . . . . . 100 Sample trajectory to track . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Nonlinear geometric controller various responses . . . . . . . . . . . . . . . 103 Nonlinear geometric controller various responses (cont.) . . . . . . . . . . . 104 Nonlinear geometric controller various responses (cont.) . . . . . . . . . . . 105 Rearrangement of thrusts . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Trajectory tracking of PID controller . . . . . . . . . . . . . . . . . . . . . 107 3D view of PID controller trajectory tracking. Red line shows desired path and blue line shows real path . . . . . . . . . . . . . . . . . . . . . . . . . 108 Tait-Bryan angle responses of PID controller . . . . . . . . . . . . . . . . . 109 Rotors response of PID controller . . . . . . . . . . . . . . . . . . . . . . . 110 Implementation of wind disturbance force for dynamic model . . . . . . . . 111 Wind effects on quadrotor . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Adding noise into Tait-Bryan angles estimation . . . . . . . . . . . . . . . 112 Adding external torque to the system . . . . . . . . . . . . . . . . . . . . . 113 Trajectory tracking of nonlinear geometric controller with disturbance and uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Performance of nonlinear geometric controller in SR condition (cont.) . . . 115 Performance of nonlinear geometric controller in SR condition (cont.) . . . 116 Rotor response in SR condition . . . . . . . . . . . . . . . . . . . . . . . . 117 Trajectory tracking of nonlinear geometric controller with disturbance and uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Performance of PID controller in SR condition . . . . . . . . . . . . . . . . 120 Performance of PID controller in SR condition (cont.) . . . . . . . . . . . . 121 Rotor response in SR condition . . . . . . . . . . . . . . . . . . . . . . . . 122

5.11 5.12 5.13 5.14 5.15 5.16 5.17 5.18 5.18 5.19 5.20 5.21 5.21 5.22

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

75 77 78 79 80 80 82 84 85 86 86 87 87 89 90

A.1 Principle of simulating atmospheric turbulence . . . . . . . . . . . . . . . . 125 xvi

A.2 Spectral density function of white noise . . . . . . . . . . . . . . . . . . . . 127 A.3 The Dryden turbulence model block . . . . . . . . . . . . . . . . . . . . . 129

xvii

Intentionally left blank

xviii

List of Symbols I RB RIB R T W Ω ω φ ψ τ θ ξ cQ cT d eR eΩ ev ex kΩ kr kv kx sk() so

Rotation matrix from body to inertial frame. Rotation matrix from inertial to body frame. Rotation matrix from body to inertial frame. Rotor thrust. Wronskian. Angular rates with respect to body frame. Rotor speed. Roll angle. Yaw angle. Torque. Pitch angle. Position in inertial frame. Rotor torque coefficient. Rotor thrust coefficient. Quadrotor’s arm length. Attitude error. Angular rates error. Velocity error in inertial frame. Position error in inertial frame. Angular rates gain. Attitude gain. Velocity gain. Position gain. Skew symmetric map. Lie algebra of SO group.

xix

Intentionally left blank

xx

Acronyms Att

Attitude.

BEMT BIBO BLDC

Blade Element Momentum Theory. Bounded Input - Bounded Output. Brushless DC (motor).

CG

Centre of Gravity.

DCM DOF

Direct Cosine Matrix. Degree of Freedom.

EKF ESC

Extended Kalman filter. Electronic Speed Controller.

GL GPS

General Linear Group. Global Positioning System.

IC IC IMU ISE ISS

Intial Condition. Ideal Condition. Inertial Measurement Unit. Integral Squared Error. Input-to-state Stability.

KE KF

Kinetic Energy. Kalman filter.

LQR

Linear Quadratic Regulator.

MEMS Micro Electro-Mechanical Systems. MHE Moving Horizon Estimation. PD PID PPM PWM

Proportional-Derivative. Proportional - Integral - Derivative. Pulse Position Modulation. Pulse Width Modulation.

xxi

xxii

ACRONYMS RP3 RPE RPM

Real Projective Space (RP3). Recursive Prediction Error. Revolutions per Minute.

SAR SO(3) SoC SR

Search and Rescue. Special Orthogonal Group 3. System-on-chip. Simulated Reality.

TPG TV

Total Power Generated. Thrust Variance.

UAV UKF

Unmanned Aerial Vehicle. Unscented Kalman filter.

VTOL

Vertical Take-off and Landing.

Chapter 1 Introduction This chapter presents the introduction to Unmanned Aerial Vehicles (UAVs), their applications, key challenges and overview of the quadrotor structure, sensors and control strategies from literature. The chapter concludes with the motivations, objectives as to explain why nonlinear geometric control is of interest and details about the specific contributions that this work bring about.

1.1

Unmanned Aerial Vehicles (UAVs)

As indicated by the name, an Unmanned Aerial Vehicle (UAV) or drone is a type of aircraft which does not carry any human aboard. In this regard, a ballistic missile may fall under the UAV category. The Free Dictionary goes further and defines unmanned aerial vehicle as a powered aerial vehicle that does not carry a human operator, uses aerodynamic forces to provide vehicle lift, can fly autonomously or be piloted remotely, can be expendable or recoverable, and can carry a lethal or non-lethal payload. Ballistic or semi-ballistic vehicles, cruise missiles, and artillery projectiles are not considered unmanned aerial vehicles [1]. It is noteworthy that the official definition (as defined in law) varies from country to country. UAV is perhaps one of the fastest growing section of modern aerospace engineering, which has long expanded past the boundary of military purposes. Today we see UAVs in a large number of civilian activities with diverse user-base ranging from academics, scientists, hobbyists to commercial delivery companies. Applications of drones are numerous. UAVs help gathering atmospheric information, managing natural resources and collecting data from distant or inaccessible places via remote sensing... They are also regarded as being useful in agricultural activities such as seed and fertiliser distribution as well as in evaluation of disease spread on the fields and in forests. Active development of a new logistic strategy already taking place may soon enable UAVs delivering consumer products to customers. By definition, a UAV does not imply anything about its design. A better way to differentiate between aircraft is based on their flying principle. In this way, any aircraft can be classified into one of two smaller groups: those are heavier than air and those are lighter than air. The latter includes vehicles that ”fly because they already float” due to Archimedes principle like a balloon or a blimp. These are the technologies came from 1

1.1. UNMANNED AERIAL VEHICLES (UAVS)

(a) A fixed wing UAV from AIBird [5] (b) A hexacopter is a rotary wings UAV [6]

(c) A quadcopter of our team

(d) A Phoenix flapping wings UAV at MIT [7]

Figure 1.1: Various examples of UAV categorised by wing design

the earlier stage of human aviation history, but recently resurrected due to its superior energy efficiency [2] [3]. The former design requires wings or equivalent lift generation device to be able to fly. We can also go further and divide this aircraft category based on its propulsion design. In this respect, the group of powered aircraft carries propeller or jet engines for prolonged activity in the air. Unpowered counterparts (commonly referred to as gliders) are very light and rely on meteorological phenomena to maintain or gain height. They don’t have any engine and need to be towed by another plane in order to take off. Further classification can be made on the powered group. The carried engine could be a forward thruster i.e. a propulsion system that generates thrust in the direction of forward flying. In this case, fixed wings attached to the body are required. Due to forward motion, air travelling through these wings creates lift. Trivial examples are commercial aeroplanes e.g. Airbus A321, Boeing 737. Aircraft whose lift is generated from rotary wings form the rotorcraft category. In this design, the engine generates power to sustain the rotary motion of the propeller. Trivial examples are helicopters, tiltrotors, quadrotors... Some rotorcrafts are capable of Vertical Take-off and Landing (VTOL), but not all VTOLs are rotorcrafts, thus VTOLs make up the third subgroup of powered aircraft. Certainly there are many other ways to categorise an aircraft in general, but the classification method presented in this section is prominent [4]. The chart in Figure 1.2 summarises the above discussion. A general UAV might belong to any of the above categories, but usually to the group of powered heavierthan-air aircraft. From the perspective of wing design, a UAV may have fixed wings, rotary wings or even flapping wings (Figure 1.1): 2

CHAPTER 1. INTRODUCTION 1. Fixed wing UAV is suitable for missions which the UAV stays in cruising phase for the majority of time. Long range and high altitude operability are the main advantages [8]. 2. Flapping wing UAV imitates how birds and insects fly. These are very small flying machines (usually referred to as Micro Air Vehicles or MAV) and have brought about great challenges in mechanical design, aerodynamics, automatic control, intelligent planning and material engineering. Currently flapping wing UAVs are under active research with an outlook on achieving compromising performance between fixed wing UAV and rotary wing UAV: hover to low forward speed flying capability, high endurance and reduced noise [9][10]. 3. Rotary wing UAV is usually capable of VTOL, destined for missions that require hovering like helicopters. This design, however, is less suitable for longrange mission compared to its fixed wing counterpart. The noise is also louder due to high speed movement of rotary wing but it has been demonstrated that ability to reject air turbulence is better than other designs [11]. It is noteworthy that there are many different rotary wing aircraft designs, but when limited to small-sized UAVs we only find quadrotors, hexacopters and octocopters popular. The comparison between these designs are given in Table 1.1. Table 1.1: Comparison between rotary wings UAV designs [12] Feature Price Manoeuvrability Speed Elevation Size Speed Control (in bad weather) Power backup Payload size Safety (engine failure)

Quadcopter Cheapest Great Moderate Fine Small Moderate Good Good Light Hard to land with one engine failure

Hexacopter Medium Greater Higher High Bigger High Better Worse Heavier

Octocopter Most expensive Greatest Highest Very high Very big Highest Best Worst Heaviest

OK

Very safe

UAV may posses different level of autonomy i.e. performing actions without human intervention. Usually, a general autonomous control hierarchy can be divided into several different levels: 1. Attitude and position control. These loops are located at the lowest level of the autonomous control system that directly give commands to actuators and steer the aircraft to desired attitude and position. 2. Path planning. These loops generate a feasible trajectory for lower level loops. 3

1.2. THE UAV CIVIL MARKET

Figure 1.2: Categorisation of aircraft based on flying principle and propulsion system [13]

Figure 1.3: Categorisation of a general UAV based on wing design [13]

3. Decision making. These loops analyse the data obtained from sensors and make decisions. For example, with a video camera, an aircraft can see the crop from above and decide whether it should spray fertiliser or not.

Several autonomous features such as return-to-home, follow-me, aerobatic manoeuvres is achieved through higher loop designs [14].

1.2

The UAV civil market

This section manifests the current and future UAV industry to see how drones are transforming the world, along with some key technical challenges within the industry that still needs to be overcome. Through this section, we realise the motivation to study about UAVs. 4

CHAPTER 1. INTRODUCTION

1.2.1

Market opportunity

The market of UAVs and relevant products are growing into a compelling section with market value envisaged to continue increasing for some time. At the moment of writing, a report by PwC estimates that emerging global market for business services using drones is valued at over 127 billion USD. This figure is calculated based on costs that will be saved if industries switch to higher utilisation of aerial drones in their economic activities for better productivity, resulting in labour saving and business service value boost. Infrastructure industries are leading the list of prospects (Table 1.2), currently valued at 45.2 billion USD [15]. In fact, we have already seen some progress here at Ho Chi Minh City University of Technology: a research group lead by Dr. Anh Vu Ngoc has successfully designed a drone to tow electrical wires in arduous terrains and helped accelerating the electrification progress in rural areas. The drone is also expected to facilitate quality control over kilometres of wires, reducing human workload as well as latent risks for electrical workers. Table 1.2: Market value of industries which may benefit from drones [15] Field Infrastructure Agriculture Transport Security Media & Entertainment Insurance Telecommunication Mining Total

Value (billions USD) 45.2 32.4 13 10 8.8 6.8 6.3 4.4 127.3

The revenue for the entire drone industry crossed 1 billion USD mark in 2017 and projected to cross 1.6 billion USD mark in 2018 [16] with 4.45 millions of units will be shipped this year. The demand for labours rises quickly and the industry is expected to create up to 100 000 new jobs in 2025. It is also expected that the payload market (sensors, radar...) of the global UAV industry will cross the 3 billions USD mark of value in 2027 [17]. The reports pointed out that there will be a difference in demographic distribution of revenues: North America leads the demand, followed by Asia Pacific and Europe. In 2016, UAV manufacturers have generated 8.5 billions USD of revenue and Business Insider expects sales of drones to surpass 12 billions USD in 2021 (including military UAV section) - a growth at a rate of 7.6%. Consumer drones will account for nearly one-third of shipped units, and enterprise drones are expected to reach a number of over 800 000 in 2021 [18].

1.2.2

Applications

Possessing aerial advantages and high mobility, drones may help gathering a lot of valuable data from every economic activity. Thanks to video cameras and sensors, managing assets dispersed over a broad area, inspecting infrastructures, resources are 5

1.2. THE UAV CIVIL MARKET now very easy and convenient, let alone the transport industry. Data can be quickly analysed and action can be taken instantly. We have witnessed these benefits in agriculture: the crop is monitored, analysed and actions such as pesticide spraying are taken with little to no intervention from humans. 1. Search and Rescue (SAR). Using drones, SAR operations may become much more effective. SAR members can program optimal search paths for one or many drones. These aircraft will follow the paths to areas where rescue is needed, often in remote places that are very difficult for the rescue team to arrive in time. The search may be performed by human, or automated using image processing and machine learning. More drones involving in the operation may yield more effective result, and the aircraft can deliver emergency aids to the victims before help arrives. 2. Remote sensing. Drones, using sensors, can collect data about a specific region and relay this information back to ground bases. Exemplary datasets may include height profile when measuring the topology of the Earth, atmospheric compositions, backscattered radiation and hyper spectral images. These information is exceptionally helpful for resource management, control and scientific researches... With data processing and machine learning, we can learn the insights from datasets collected during a remote sensing mission for better decision making, like in Figure 1.4. [19] gives more details about of sensors, instruments and terminologies in remote sensing. 3. Precision agriculture. In combination with remote sensing, UAVs can assist humans in crop management, irrigation scheduling, disease detection, pesticide spraying as well as gathering data from underground sensors that record history of moisture and soil properties... The benefits are time and effort saving, better reaction to agricultural incidents such as disease spreads, resulting in overall increase of quality and productivity [17]. 4. Product delivery. This is perhaps one of the most exciting application at the moment. UAV is very versatile and highly mobile, making it an ideal means to deliver mails, food and packages to customers. In transportation, UAVs may become the new force in logistics, as product delivery is booming thanks to e-commerce websites. In Vietnam, we are seeing this trend very clearly with the appearance of multiple shipping companies such as LAZADA Express, La La, Tiki, GrabExpress... In the United States, Amazon is actively experimenting with UAVs on package delivery (Amazon Prime Air) [20] and if Amazon succeeds, we believe UAVs will be quickly adopted as a new delivery method all over the world, including Vietnam. There are many other applications, but these are the most obtrusive at the moment of writing.

1.2.3

Key challenges

Even though UAV has reached wide application in civilian activities, there are still major technical challenges to be overcome. 6

CHAPTER 1. INTRODUCTION

Figure 1.4: NDVI data gathered from a remote sensing mission showing how dense a vegetable planting area is. This is a trivial example in precision agriculture [21]

• Battery. There are many types of UAV, each equipped with a different propulsion system. However, the majority still uses electrical power from batteries. Endurance may last from as little as 3 minutes to over 30 minutes of flying with some exceptions permitted more. The battery life is affected by payload, number of sensors, instruments on board and weather condition. The situation is made even worse because most low-cost drones are not equipped with battery monitoring function, thus effectively limit the flying duration and range. Advances in battery and power storage is crucial for development of long-lasting drones, but for the moment, users might have to look for battery hot swapping and wireless charging capability at ground stations [17]. • Indoor flying. With limited localisation signal from a satellite positioning system (e.g. GPS), flying indoor is still a hindrance. There is active research in image processing that enables vision for UAVs using video cameras, most algorithms require intense computing capability and drain the battery even faster. Machine learning may aid in this challenge. • Communication system. Most UAV missions require streaming live data to ground stations [17]. This can be done via radio. However, for data like high definition video and audio signal, data transfer may suffer from delay and demand high bandwidth, severely limiting the maximum range for effective communication. Moreover, security might be a big issue that leaving the communication channels open can make our drones susceptible to cyber attacks. Encrypting data can circumvent this challenge at the cost of increased computation which in turn draws more power from the battery. 7

1.3. THE HOPE PROJECT

1.3

The HOPE project

With regard to the economic benefits and to overcome the challenges, the HOPE project initiated and led by Dr. Le Thi Hong Hieu and Dr. Nguyen Ngoc Hien is conducting research on UAV for both academic and application purposes. The project comprises of several researches on three UAV rotary wing designs: • Trirotor design: for short-range missions with VTOL capability. • Trirotor planar design: for short to medium-range missions with near VTOL capability. • Quadrotor design: for more flexibility and control. This thesis focuses on quadrotor control design, a subject which will be presented in the next section.

1.4

Quadrotor state of the art

We choose quadrotors (quadcopters) because of various reasons. First, it is very popular on market and not too expensive to buy. Second, the literature about quadcopter dynamics modelling and control is vast and diverse, making it easier to get started. We did not get ourselves exposed to UAVs before this thesis, so a quadrotor would justify for a good subject. Compared to other rotary wing designs as mentioned earlier, quadrotors give us adequate flexibility without compromising at the expense of complicated dynamics modelling. The following section will present some introduction into quadrotors, concluding with a little survey of available control algorithms in the literature.

1.4.1

Introduction

Quadcopter is of particular interest in research community due to the following advantages when compared to other rotary wing UAV design such as helicopter: 1. Simple mechanical structure. Complex mechanical linkages such as rotor hub often found on helicopters are not present, making quadrotors extremely easy to build, modify and repair. The propellers are usually stiff. 2. Resistance to damage. Since quadcopter’s rotors store less kinetic energy in flight, the latent risk of hitting obstacles is less severe than a helicopter, making this design much more suitable for indoor flying [22]. The general structure of a quadrotor (Figure 1.5) includes: • An airframe (made with metal, plastics or composite material), composes of a central hub with four crossed arms of equal length to mount rotors. 8

CHAPTER 1. INTRODUCTION

Figure 1.5: A quadrotor

• Motors mounted at the end of arms to spin the propellers, which in turn generate lift (and some aerodynamic torque). The lift and moment creates movement of the aircraft in three-dimensional space. Typically brushless DC motors (BLDC) are used to give high rotational speed. • Central hub carries fixed or suspended payload, micro-controllers, sensors and batteries. Among on board sensors, IMU and video camera are very popular choice. Several quadrotors offers capability of live streaming video to ground station via communication systems located here. • Landing gear to support the aircraft on the ground.

1.4.2

Quadrotor electronics

Quadrotors are made popular recently thanks to advances in electronics. Integrated sensors based on Micro Electro-Mechanical Systems (MEMS) have been available on the market for some time, providing state feedback information at a very low cost. A prominent device that is carried upon most quadrotors these days is the Inertial Measurement Unit (IMU - Figure 1.6a). Electrical power storage improvements also helped facilitating small-size flying vehicles development, although the main drive came from the smartphone industry. With the latest technology, we can now achieve a power density storage of over 190Wh/kg - the highest number ever reached in the industry [23]. The surge of open-source microcontroller and microprocessor kits such as Arduino, Raspberry Pi permits implementation of automatic control systems in a relatively easy way without getting much into the hassles of electronic design. Arduino and Raspberry Pi (Figure 1.7) have brought the works once thought only reserved for professional engineers to the hand of pupils, students, hobbyists and academic researchers. Advances in quadrotor research also come from the open-source community. With an increasing trend to share source code and findings on-line, hobbyists can quickly 9

1.4. QUADROTOR STATE OF THE ART

(a) MPU9250 is an IMU with digital compass

(b) A ublox GPS module

Figure 1.6: Popular sensors for UAV control

(a) An Arduino UNO board with AT-(b) A Raspberry Pi 3 with ARM Comega328P microcontroller tex A series processor

Figure 1.7: Popular electronic kits for UAV control find and use the tool they need without spending too much time to understand and reimplement the theory for themselves. Academic researchers could also benefit as they are able to verify their theory faster without worrying to have everything else in place before the tests. As resources open to more people, the one who is winning is everyone. However, there are still some impediments to overcome. MEMS sensors whose quality has improved in recent years, still show inadequate performance that can not be taken seriously. Drift and noise are two usually observed phenomenons. To mitigate, data obtained from one sensor has to be combined with other sources via an estimation filter for better yield, such as in the IMU case. Again, this would induce some computation cost of signal processing on board. The first choice of payload for quadrotors usually includes an IMU which integrates accelerometer with gyroscope for translational acceleration and angular rates measurement respectively. In theory, the attitude angles and aircraft’s position in three-dimensional space can be obtained via integrations of measurements from the respective sensors. However, without estimation filters we can not yield decent performance in this way. The reason is that due to noise, integrations of accelerations and angular rates cause the errors to accumulate quickly and increase the uncertainty of estimated aircraft attitude and position in three-dimensional space. As the uncer10

CHAPTER 1. INTRODUCTION tainty gets bigger, the control system fails to determine its precise state in space, and eventually break down in tracking performance because of garbage feedback signal. To improve the situation, a GPS sensor (Figure 1.6b) is placed on board. Localisation signal gives us data about position result with higher uncertainty but does not drift in time like the dead-reckoning technique of integrating acceleration values. The same narration goes for estimating Tait-Bryan (Euler) attitude angles. Usually, the accelerometer ”sees” the gravity vector, but small forces may perturb the readings with high frequency noise making accelerometer data only valuable in long term. Integrated gyroscope measurements, on the other hand, will tend to drift with time, thus it is only valuable in short term. The dynamics of states i.e. the relationship between acceleration, velocity and position or angular rates and Tait-Bryan angles are expressed by a system of observable differential equations (detailed in chapter 2) and full state of the system can be obtained by using a state estimator (or a filter). In this respect, different data sources can be combined to reduce uncertainties. In theory, for a linear system, Kalman Filter (KF) yields good result. But for a nonlinear system such as the quadrotor dynamics, several approaches are at our disposal: 1. Extended Kalman Filter (EKF): an extension of the linear KF which the dynamics is linearised at each time of estimation. Like its KF counterpart, this estimator works best if process and measurement noise are Gaussian [24]. 2. Recursive Prediction Error (RPE): estimation based on sensitivity. 3. Unscented Kalman Filter (UKF): by using Monte-Carlo, a bunch of sample points are picked around some mean, then passed through the nonlinear dynamics to calculate a new mean and covariance. It is this feature that differentiate between UKF and EKF: EKF uses the underlying linear dynamics [24]. 4. Moving Horizon Estimation (MHE). 5. High Gain Observers [25]. It is also noteworthy to mention one but extremely effective method in determining the Tait-Bryan angles. Since accelerometers are good for long-term use, a low-pass filter should be placed at the output. Gyroscope is good for short-term use, a high-pass filter can do the trick. These two data pieces are then combined together with some ratio r (Figure 1.8) and with proper tuning, we can achieve a quality reading good enough for any purpose. This estimation technique is called complementary filtering and it is very simple, intuitive and very effective. To fuse more data from different sensors, we are able to use the same trick, but this time the estimator may go nonlinear as in [26]. For comparison between different filters, please see [27]. Indoors, GPS localisation signal is not available. Solutions often turned to video cameras for positioning. There are two prominent vision-based strategies, each designed to deal with a specific kind of mission. The first stabilises the quad-rotor using images of the landing pad obtained from the camera. The position is then extracted through a process called homography estimation velocities are derived through calculation of optical flow. The second method fuses colour-extraction and line-detection 11

1.4. QUADROTOR STATE OF THE ART

Figure 1.8: A diagram of complementary filter

Figure 1.9: UAS Networking: a telecommunication scheme for UAV [29]

image processing techniques to control the quadrotor’s position and achieves forward velocity regulation during a trajectory tracking. This data can be combined in a similar manner with accelerometer data to generate better estimation of aircraft’s states [28]. Many quadrotors are equipped with telecommunication instruments, such as WiFi chips to transmit live data to ground stations. The data may include telemetry information such as position, altitude, airspeed, sensor data, images and others. Very often, an uplink is established to allow ground stations relaying information back to the aircraft. Such scenario happens when the UAV is remotely controlled or when the aircraft has to execute a computational so intensive that on-board processors can not afford.

1.4.3

A brief survey of quadrotor control

Careful statements should be made since literature about quadrotor control is very broad and diverse. As a matter of fact, we could only consider a very limited class of 12

CHAPTER 1. INTRODUCTION controllers in this section, which mostly bases on the surveys given by [30] and [31]. Linear control strategies Linearised state equations are necessary to design a linear controller. Usually implied a lot of simplifications, these controllers are designed to work in near hover condition. Although PID controllers usually show some robustness, it is often required to make some modifications to yield satisfactory performance. The techniques may include parametric optimisation and adaptation, or goes in accompanied with fuzzy control [30] [31]. LQR, on the other hand, though usually demonstrates robustness in linear applications, find its application on quadrotor very troubling without augmentation by some techniques. The controller is found to be sensitive to uncertainties and external disturbances [23]. Non-linear control strategies Feedback linearisation is a method to accurately transform a nonlinear system into a linear one through change of variables based on derivations of output. The input is also transformed and linear feedback strategies can be used to yield a control law. The down side of this method is the requirement for very precise description of the model, and like LQR, it is susceptible to parametric changes and extrinsic disturbances [31]. In handling intrinsic parametric uncertainties, it is found that back-stepping methods can perform very well but the ability to reject external disturbances is not very satisfactory [30]. A good compromise of performance is found when using integral back-stepping as in [23] and sliding mode control [30]. However for sliding mode control, chattering in near equilibrium is noticeable, and further augmentation have to be made. Recently, a robust tracking control algorithm based on geometric properties of some mathematical objects allow us to derive a control algorithm which possesses large region of attraction and robustness. The controller has shown some capability of performing fast attitude and position tracking which facilitates aggressive manoeuvres [32]. Inspired by this work, we hope this thesis will bring more attention to this novel control. These control algorithms can be equipped with adaptability using the techniques from adaptive control. By choosing some control laws, uncertain parameters can be estimated and controller gains are tuned to their optimal levels. We may find adaptive control on aircraft whose payload varies from mission to mission e.g. a package delivery drone or in case that some parameters of the aircraft can not be accurately measured.

1.5 1.5.1

Motivations, objectives and contributions Motivation

Through previous sections, we have learned some key points about UAVs: 1. UAV is a fast growing industry, envisaged to create a lot of revenue in the future. Research in UAV is fast-paced, at both academic and strategic corporate levels. 13

1.5. MOTIVATIONS, OBJECTIVES AND CONTRIBUTIONS 2. The applications are numerous and UAV can contribute to all businesses in one way or another. 3. There are a lot of key challenges ranging from design to control problems that remain to be solved. 4. Difficulties in sensors and signal treatment is not peculiar to UAV design, and it is very likely that advance in one field would benefit every other field. That is to say a finding in any field mentioned above would probably open whole new possibilities for application in UAV technologies. 5. Quadrotor control, though thoroughly studied in literature, still opens a lot of opportunities for improvements, even for elementary attitude and position control loop. The higher loops still remain largely undiscovered, with a lot of possibility to apply latest advances in signal processing, computer science, mathematics, artificial intelligence and machine learning to raise the level of autonomy. After all, an unmanned aerial vehicles should be unmanned, even if the man is on the ground. With all of that in mind, we are motivated to continue looking for a better UAV control solution. This thesis aims to study a reliable controller that can accurately track any desired attitude and position good enough so that the higher loops can depend on its reliability. Among all, the nonlinear geometric control promises all that we need: large region of attraction and capability of performing aggressive manoeuvres [32]. Detailed study about the nature of this controller is required before the conclusion can be made about whether this kind of control is really better or not. This thesis results from the desire to answer some parts of this question.

1.5.2

Objectives

We set out for an understanding about the geometric nonlinear control for unmanned quadrotor aerial vehicles. We have five goals clear: 1. Dynamics modelling of a quadrotor. 2. Differential geometry and properties of the Lie group of SO(3). 3. Full derivation of the attitude and position tracking algorithm. 4. Implementation of a full Simulink model. 5. Examination of the various properties of this controller and comparison with another control strategy like PID.

1.5.3

Contribution of this work

In the previous studies, dynamics modelling is the derivation of differential equations which govern the movement of a quadrotor in three-dimensional space. We will be explicit about the simplification process of our model about the terms being kept and 14

CHAPTER 1. INTRODUCTION simplified. Although these information were already outlined, we want to present the approach in a streamlined manner, with some meaningful explanation about the physics behind. In the differential geometry part, we focus on bringing into light various properties of the rotation matrix which we will see belonging to a Lie group SO(3). We restate some propositions and contribute the proofs missing from previous studies, especially [32]. Our main contribution is the geometrical interpretation and thorough explanation of the expressions, with an aim to deliver better intuition about these novel mathematical tools. In the derivation of tracking algorithm, we follow the path shown in [32] but we make small contributions to two things: • In attitude tracking, with a slightly different choice of the Lyapunov candidate, we can alleviate one restriction about the eigenvalues of the moment of inertia, giving us more freedom in choosing the controller parameters kR , kΩ . • In position tracking, we feel that the original proof in [32] is a little bit unnatural and quite difficult to comprehend. Therefore, we attempt to thoroughly explain every idea behind each step of the derivation process. The new Lyapunov candidate function that we proposed will further reduce cross-term interdependence and expand the range of possible choices for controller parameters. Lacking in the literature are details about implementation of the model which helps verifying the claim we have made. Starting from scratch, we build a model from basic Simulink blocks to test the validity of this controller, then we begin to add more advanced features to test several different properties such as robustness against parameter inaccuracies and external disturbance rejection. The detailed implementation is presented, along with discussions on the test results. These Simulink models will be of great aid when deploying to a micro-controller or microprocessor. Finally, based on several groundwork, we introduce a framework to test robustness and compare the results to other controller (PID). These are small contributions that this work can do to study more about the nature of this controller, which is currently forgotten by most of benchmark and survey articles. We hope that our contribution will become an inspiration for further ventures into this amazing field of geometric control theory.

15

Chapter 2 Dynamics Modelling In this chapter, we derive a dynamics model for quadrotors, which is a set of differential equations that governs the motion of aircraft in three-dimensional space. In reality, there are so many physical phenomenons that make the already intricate equations even more complicated such as the gyroscopic effect and body drag, let alone disturbances and uncertainties introduced into the system by wind and inaccurate measurement of the quadrotor parameters. Nevertheless, the plant should be simplified to derive the control laws, then the laws are subjected to testing under various conditions to evaluate performance.

2.1

Assumptions

Our approach to obtain a complete set of differential equations for the quadrotor (plant) is to write down the equations of motion for a six degrees of freedom object in three dimensional space. These equations will then be added with a thrust model, comprising of a directional force and a set of torques generated by the rotors. Identification of the parameters such as mass m and moment of inertia J is needed for substitution into the equations. Finally, phenomenons like blade flapping and gyroscopic effect are added to complete the equations. Despite the fact that we will use Tait-Bryan angles (introduced later) in the following sections, the derivation is not dependent on how we choose to parametrise the attitude representation. In some parts, it is more desirable to use quaternion since it does not introduce the gimbal lock problem at 90o of pitch like Euler angles. Nevertheless, we are still content with using the Tait-Bryan angles since they give us the intuition of how the aircraft’s attitude looks like in space and will be helpful during the debugging process. We will be explicit about where quaternion should be used instead of Tait-Bryan angles. We also assume the following points: 1. Rigid structure. No airframe bending or flexing. This is not true in the reality but because the deflections are small, we can safely regard the entire geometry of the quadrotor as unchanged during flights. 16

CHAPTER 2. DYNAMICS MODELLING

Figure 2.1: Illustration of inertial frame G and body frame b

2. Rigid propellers. This does not mean that propellers do not bend or flex due to aerodynamic forces, but rather implying the rigid model is used to derive the equations for phenomenons often seen on propellers such as blade flapping. 3. Symmetrical design. The arms are of equal length and placed at exact right angles to each other. This assumption is reasonable since quadrotors are usually designed with symmetry in mind to cancel out off-diagonal terms in the moment of inertia matrix J. Nevertheless, in the case of asymmetrical structure, we will be convinced later that the our geometric nonlinear control law can still do its trick. 4. Point of symmetry is also centre of gravity. The benefit is that we can conveniently choose this point as the origin of the body frame. Sensors should be placed at this exact point to yield accurate readings.

2.2 2.2.1

Frames Inertial and body frame

Conventionally, we will work with two frames: one attached to the Earth (inertial frame) and one attached to the aircraft (body frame). The body frame origin is located at the centre of gravity (and symmetry, as in one of the assumptions stated above), with x direction (roll axis or longitudinal axis) pointing towards the direction of any arbitrarily chosen rotor (called rotor 1). The y axis lies in the same plane, pointing to the right (rotor 4) and perpendicular to the x axis. We usually call this axis pitch axis or transverse axis. The z axis (yaw axis or vertical axis), perpendicular to both x and y axis, points downward following the right-hand rule for orientation (Figure 2.1). Using this definition, we are implying the ”plus configuration” because the rotor 1 and 4 lie on body axes. There is another configuration called ”cross configuration” 17

2.2. FRAMES

Figure 2.2: Two modelling configuration of a quadrotor

where x axis points towards a direction between rotor 1 and rotor 2 (Figure 2.2). We feel that the ”cross configuration” unnecessarily complicates the problem, thus from now on, we will only be talking about the ”plus configuration”. The second implication that we have made is that rotors were enumerated counter-clockwise, with rotor 1 lying in the x direction and 4 on the y direction. Without any loss of generalisation, we further assume that rotor 1 and 3 are turning counter-clockwise, while 2 and 4 turning in the opposite direction. As indicated by their names, rotations along x, y, z axis are called rolling, pitching and yawing respectively. As the matter of fact, except for the digital compass, every data obtained from sensors on board will be written with respect to the body frame.

2.2.2

The Euler angles parametrisation

The attitude of an aircraft is usually described by a rotation from the inertial frame to body frame (or vice-versa), which is usually expressed as a matrix R belonging to the Lie group SO(3). There are various options to parametrise a rotation group member like Euler angles, quaternion, Rodrigues... However, in this section we will only focus on the Euler angles representation (more accurately referred to as Tait-Bryan angles, a term which will be used from later on). Tait-Bryan angles are easy to visualise and construct. Unfortunately, there are many different types of Tait-Bryan angles representation, but we will be explicitly talking about the intrinsic ZYX rotation which is widely applied in the aerospace industry. To parametrise rotation from inertial to body frame, we need three variables: ψ, θ, φ which reads as yaw, pitch and roll respectively. Let the body and inertial axes xyz initially coincide. The following actions happen in sequence: 18

CHAPTER 2. DYNAMICS MODELLING

Figure 2.3: Construction of Tait-Bryan angles [33]

1. Rotate the entire frame xyz around z axis an angle ψ to obtain a new frame x0 y 0 z 0 . 2. Rotate the entire frame x0 y 0 z 0 around y 0 axis an angle θ to obtain a new frame x00 y 00 z 00 . 3. Rotate the entire frame x00 y 00 z 00 around x00 axis an angle φ to obtain the body frame XY Z (Figure 2.3) [33]. In this manner, almost all attitudes represented by the corresponding body frame can be parametrised by a tuple of (ψ, θ, φ). A very famous problem with this type of parametrisation is the gimbal lock which occurs when pitch angle is equal to θ = 90o . In such situation, a loss of one degree-of-freedom prevents accurate description of the attitude thus special attention has to be made because at such large angle, estimation of several system states fails. This problem could only be circumvented by switching to a higher degrees-of-freedom representation, such as quaternion. For normal flight paths and motions, the Tait-Bryan angles are good enough. Any rotation in three-dimensional space can be represented by a matrix belonging to SO(3) which bears a group structure whose operator is the conventional matrix multiplication. As a consequence, a series of rotations in order will correspond to multiplying several rotation matrices together, which again ends up in SO(3). Conversely, any rotation matrix could be decomposed into a multiplication of several ”elementary” matrices. This is the main idea behind Tait-Bryan angles representation. 19

2.2. FRAMES First rotation along z axis is:  0     x cψ sψ 0 x  y 0  =  −sψ cψ 0   y  z0 0 0 1 z Second rotation along y 0 axis is:  0   00   cθ 0 −sθ x x  y 00  =  0 1 0   y 0  z0 z 00 sθ 0 cθ Third rotation along x00 axis is:      00  X 1 0 0 x  Y  =  0 cφ sφ   y 00  Z z 00 0 −sφ cφ The ”aggregate” rotation matrix is then:      X cθcψ cθsψ −sθ x  Y  =  −cφsψ + sφsθcψ cφcψ + sφsθsψ sφcθ   y  Z sφsψ + cφsθcψ −sφcψ + cφsθsψ cφcθ z Let RIB be a rotation matrix from inertial to body frame:   cθcψ cθsψ −sθ RIB =  −cφsψ + sφsθcψ cφcψ + sφsθsψ sφcθ  sφsψ + cφsθcψ −sφcψ + cφsθsψ cφcθ

(2.1)

For every operator in SO(3), the following equality holds: RT R = I ⇒ R−1 = RT The rotation matrix from body to inertial frame can be put simply as: I RB = RIB

T

(2.2)

Special attention has to be taken as ambiguities may build up because every rotation matrix looks the same. We can use a matrix that rotates a vector from inertial to body frame for an equation takes a matrix that rotates a vector from body to inertial frame, except we will get the wrong result. From now on, we will refer to R as rotation I matrix from body frame to inertial frame (RB ). Derivation of Tait-Bryan angles follows the following treatment. Let Ω = [Ωx , Ωy , Ωz ]T be angular rates in the body frame, the following relationship is obtained [33]:     ˙  φ Ωx 1 0 −sθ  Ωy  =  0 cφ cθsφ   θ˙  (2.3) ˙ Ωz 0 −sφ cθ ψ where Ω is the angular rates measured by a gyroscope (IMU) in body frame. The Tait-Bryan angle rates are simply inverse of the above equation. 20

CHAPTER 2. DYNAMICS MODELLING

 ˙     φ 1 sφ cφ Ωx  θ˙  =  0 cφ −sφ   Ωy  0 sφ/cθ cφ/cθ Ωz ψ˙

(2.4)

Where c, s in the above expressions stand for cos and sin respectively. Note that there is a division of cosθ in equation (2.4), which makes the estimation invalid for θ = 90o . Close to 90o , the estimation is subjected to a lot of error, due to the gimbal lock problem mentioned above. Some articles may address the matrix   1 sφ cφ  0 cφ −sφ  0 sφ/cθ cφ/cθ as Wronskian, denoted by the letter W .

2.3

Basic motions

Unlike helicopters, a quadrotor does not have a swash plate and propeller pitch can not be altered. The only way of control one has over the aircraft is to vary thrust of individual rotors. There are four rotors, two turning in the clockwise direction while the remaining two turning in the counter-clockwise direction. This arrangement allows torques to cancel at trimmed level flight. It is easy for us to see that, pitching motion can be obtained by adjusting the difference in thrust between rotor 1 and 3 i.e. T1 − T3 . In particular, to increase pitch angle (pitch forward) we need T1 < T3 and T1 > T3 to decrease pitch angle. Rolling motion is subjected to thrust difference between rotor 2 and 4 i.e. T2 − T4 : to roll left, we demand that T4 > T2 and vice versa to roll right. The yawing motion is generated from 4 reaction torques of the rotors.

2.4

Primary forces and moments

Consider one particular rotor. The first kind of torque is created from the offset of thrust vector from the centre of gravity (CG) and tends to rotate the quadrotor away, in the thrust direction. Let τ be the induced torque, T be the thrust magnitude and d the arm’s length, we have: τ = Td The second type is reaction torque which is induced by reaction effects on spinning propellers, such as shaft acceleration, blades drag [28]. The reaction torque tends to move the quadrotor in a manner that preserves the xy plane (i.e. yawing). In other words, the z axis stays the same while x and y axes revolves around the origin. We will denote this torque as τMi for ith rotor, i ∈ [1, 2, 3, 4]. The detailed equation for rotor angular speed is: Irot ω˙i = τMi − τdrag 21

2.5. SECONDARY FORCES AND MOMENTS in which, Irot is the rotor moment of inertia, τdrag is the aerodynamic drag torque, calculated from the Blade Element Theory assuming linearly twisted blade. Full derivations of these models are from [34] and the final result is present in [23]. τdrag = CQ ρA(ωi R)2 R   1 1 1 1 CQ 2 = (1 + µ )Cdavg + λ θ0 − θtw − λ σa 8a 6 8 4

(2.5)

Recall that σ is solidity, A is rotor disk area, a is lift slope typically taken as 2π/180 for thin airfoils, µ is rotor advance ratio, λ is inflow ratio, v is induced velocity and ρ is air density. Note that λ in the above and subsequent equations is considered constant, implying the uniform inflow across the rotor disk. More details can be found in section 3.3 of [35]. A reasonable approximation for quasi-stationary state let ω˙i = 0, which yields τMi = τdrag . As we lump several variables into cQ , we have the final form: τMi = cQ ωi2

(2.6)

In practice, we let cQ be a constant and obtain its value from experiment. τM =

4 X

τ Mi

(2.7)

i=1

The thrust model is also derived from Blade Element Theory [35], just like the drag moment. Although the validity depends on the specific operating mode, it has been proven that the model below is good enough for most circumstances. T = CT ρA(ωR)2   1 1 2 θtw 1 CT = + µ θ0 − (1 + µ2 ) − λ σa 6 4 8 4

(2.8)

By lumping several variables together, we got: T = cT ωi2

(2.9)

Assume that cT is constant. Just like the reaction torque coefficient cQ , cT is also determined from experiment.

2.5 2.5.1

Secondary forces and moments Horizontal force

There are other physical interactions that need to be accounted to accurately describe the plant, but a too complicated one often makes control analysis extremely difficult. This section presents secondary forces and moments that are often neglected in control synthesis. 22

CHAPTER 2. DYNAMICS MODELLING Horizontal force is the aerodynamic force in horizontal direction acting on the rotor hub. This force is an accumulation of small horizontal aerodynamic drag forces on each blade element due to motion of relative wind in the radial direction, perpendicular to forward airspeed. For example, when flying sideward, a rolling moment is created if the rotor plane is higher than that containing the quadrotor CG [23]. The expression is as following: H = CH ρA(ωR)2 1 1 θtw CH = µCdavg + λµ(θ0 − ) a 4a 4 2

2.5.2

Rotor flapping

Flapping is a very characteristic motion of rotor in forward flight. As one blade advances, it has higher tip velocity and will generate more lift than the retreating blade. This create an imbalance of force between two blades, thus a moment is born and tilt the rotor plane away from the original vertical position. There is a 90o phase lag between aerodynamic moment and flapping angle response. To understand this, consider a blade flapping along the flapping hinge, with deflection from the horizontal axis an angle φ: Ir ω˙ = Ir φ¨ = Kφ + M

(2.10)

Where Ir is the rotor moment of inertia, K is the rate of restoring moment. The true nature is that periodic centrifugal force residing in each blade element is integrated along the span to give rise to a periodic restoring moment Mr , which under small angle φ approximation, proportional to φ : Mr = Kφ. External moment M will have to counter for this intrinsic Mr . The whole system is similar to a mass-spring damper, with natural frequency given by: r K ωn = Ir It is found that the natural frequency for the system in (2.10) is exactly equal to the rotor spinning frequency, thus the system is always in resonant mode. A phase lag of 90o is found at resonant frequency, thus explains a lag between φ and M . Also note that due to coning, the tip velocity is altered and therefore the angle of attack. The rotor responds exactly the same as in the previous section: a phase lag of 90o of induced aerodynamic force. This creates a lateral tilt of the rotor plane [22] [35] [36], generating a lateral flapping motion. Unfortunately, this phenomenon is called rolling moment but one should distinguish this with rolling moment generated by other causes [23]. To differentiate, we temporarily rename it to flapping moment. Other authors give explaination of rotor flapping as a change of rotor plane orientation as the blade flap up or down due to dissymmetry in lift between two blades, results in a gyroscopic precession motion of the rotor plane [37]. Nevertheless, due to high spinning motion of the rotors, the expression for flapping moment can be averaged as [23]: 23

2.6. ACTUATOR CHARACTERISTICS

Rm = CRm ρA(ωR)2 R   CRm 1 1 1 = −µ θ0 − θtw − λ σa 6 8 8

2.5.3

(2.11)

Rotor gyroscopic effect

Deliberate change of a high spinning rotor plane results in appearance of a torque called gyroscopic effect. This torque is expressed as [28]: τG = −(ω × ez )

4 X

Ir ωi

(2.12)

i=1

where ω is the angular rates in body frame, ωi is the angular speed of rotor, Ir is rotor moment of inertia and ez is defined as a unit vector without frame ez = [0, 0, 1]T .

2.5.4

Thrust model validity

We have seen that using momentum theory, we have obtained a thrust model in (2.9). However, this is only valid under some condition. Consider a vertical flight scenario. Recall that there are three modes [35]: 1. Normal working state: 0 ≤ vc /vh . 2. Vortex ring state: −2 ≤ vc /vh < 0. 3. Windmill braking state: vc /vh < −2. Only in the first and last case, an induced velocity could be derived from the momentum theory, thus confirms the validity of the thrust model presented in (2.9). Even so, cT should also be reassessed for individual modes. The uncertainty lies in the vortex ring state regime where the thrust model breaks down. We can still use approximation to work in this case, but for model UAVs, these data is not usually available. Moreover, it introduces a lot of complexity into modelling, thus flying in this regime should be avoided. This can be done while programming the trajectory: adding some forward velocity while descending [22].

2.6

Actuator characteristics

The motors mounted on quadrotors are often found to be of the Brushless DC type (BLDC). Unlike other types, BLDC does not have a mechanical commutator and lasts much longer. The armature of the motor is found on stator. Electromagnets allow higher voltage input and the motor can operate at higher frequency. A commercial electronic speed controller (ESC) for this kind of motor usually includes a rotor position feedback mechanism and a three-phase inverter (Figure 2.4). Based on input (usually in the form of pulse position or pulse width i.e. PWM, PPM) and feedback signal, the microcontroller on board will calculate and open the transistor at appropriate time to 24

CHAPTER 2. DYNAMICS MODELLING

Figure 2.4: A diagram of BLDC motor. It is visible that at any moment, only two coils are electrified while the remaining coil is freely floating. Sophisticated electronic inverter controls the current input to each coil, creating a spinning motion [38].

regulate the motor speed. However for small BLDCs, it is often found that ESC does not contain a position sensor like Hall sensor or position encoder. Back electromotive force (back EMF) is used to yield the feedback signal through measuring induced voltage in the floating coil while the other two coils are electrised.

(a) A BLDC motor in reality typi-(b) A BLDC motor often found on cally has three wires quadrotors

Figure 2.5: Images of BLDC motors For the input signal, controlling pulses only is usually not enough for fast dynamics induced from aggressive manoeuvres. Additional regulation can be made to other state variables, like the voltage that the motors is drawing from the power supply. In this case, the micro-controller will close the controller loop for two variables: ωi for angular speed tracking and Vi for voltage tracking. Usually a PD controller is involved [28]. Several projects such as [23] and [39] approximates BLDC transfer function between ω and ωd as a first order system: ω(s) =

a ωd (s) bs + 1 25

2.7. COMPLETE DYNAMICS MODEL AND SIMPLIFICATION where (a, b) ∈ R2 , ω(s), ωd (s) are Laplace transform of ω(t), ωd (t). For most cases, we find this is a good enough approximation, but saturations have to be taken into account.

2.7 2.7.1

Complete dynamics model and simplification Complete dynamics model

We can either choose Euler-Lagrange formalism or Newton-Euler formalism as both methods will yield the same basic equations of motion. The latter can be incorporated with many secondary forces and moments as discussed to yield a full form model. The complete equations of motion for a quadrotor is as follows [23]. 



P ˙ r + d(−T2 + T4 ) − h Jxx φ¨ = θ˙ψ˙ (Jyy − Jzz ) + Ir θΩ Hyi + (−1)i+1 Rmxi i=1..4  i=1..4  ˙ r + d(T1 − T3 ) + h P Hyi + (−1)i+1 P Rmyi Jyy θ¨ = φ˙ ψ˙ (Jzz − Jxx ) − Ir φΩ i=1..4 i=1..4 . i P ¨ ˙ ˙ Jzz ψ = θφ (Jxx − Jyy ) + Ir Ωr +(−1) Qi + d(Hx2 − Hx4 ) + d(−Hy1 + Hy3 ) i=1..4 P m¨ z = mg − (cψcφ) Ti i=1..4 P P ˙ m¨ x = (sψsφ + cψsθcφ) Ti − Hi − 12 Cx Ac ρx|x| i=1..4 i=1..4 P P m¨ y = (−cψsφ + sψsθcφ) Ti − Hyi − 12 Cy Ac ρy| ˙ y| ˙ P

i=1..4

i=1..4

(2.13) where Ωr indicates residual angular velocity of rotors: Ωr = ω1 + ω3 − ω2 − ω4 Note that there are several terms that we have yet to address in the foregoing such as the first term on the right hand side of the first three equations, which corresponds to the body gyro effect. Body drag, on the other hand, is the term written at the end of the last two equations. Overall, this is a set of highly nonlinear and difficult differential equations to the level that renders them impractical due to difficulties not only in deriving control laws, but in identification of the parameters as well. Our approach is to simplify, but will eventually come back to several terms in this equation later.

2.7.2

Simplification of dynamics model

Motion of a quadrotor is characterised by a more general form of 6 degrees-of-freedom object in three-dimensional space. Since we are working with geometric entities, we would like to construct a coordinate-independent expression of system dynamics. In this way we can in theory, alleviate the gimbal lock problem and make our equations simpler to work with. Let us denote ξ = (x, y, z)T the position of body frame with respect to the origin of inertial frame, v = [vx , vy , vz ] translational velocity written in inertial frame, Ω the 26

CHAPTER 2. DYNAMICS MODELLING angular rates in body fixed frame. We also recall R is a rotation matrix that transforms a vector in body to inertial frame. We certainly have the following relationships: ξ˙ = v mv˙ = F R˙ = R(sk(Ω))

(2.14)

J Ω˙ = −Ω × JΩ + τ The first equation of (2.14) is apparent. In the second equation, F is a vector of all forces acting on the aircraft written with respect to the inertial frame. We will only be retaining the thrust, gravity force and omit horizontal forces and body drag as they are usually quite insignificant when compared to others. X F = mge3 + R Ti = mge3 − f Re3 (2.15) i=1..4

which f is defined as total thrust from four rotors: X f= Ti i=1..4

−Re3 is the thrust direction in inertial frame. The third equation is extremely helpful. The symbol sk(·) denotes the transformation of a vector into a skew-symmetric matrix:      a 0 −c b 0 −a  sk  b  =  c (2.16) c −b a 0 The idea for derivation of this equation is given in [40]. Here we represent this result in a comprehensible manner with a lot more explanations and using the notations that we have made up to this moment. Proposition 2.1 (Time derivation of rotation matrix ) Given R a rotation matrix from body to inertial frame and Ω the angular rates measured in body frame. The following relationship is true: R˙ = Rsk(Ω) Proof. Consider a fixed point M in body frame B. We call the inertial frame A and relative to A, B might be revolving around with some angular rates written with respect to frame B as ΩB and A as ΩA . Moreover, B might be translating with respect to A as well. To frame B, the coordinates of M form a vector of R3 denoted as MB . To frame A, the coordinates of M form a vector of R3 denoted MA . Let us denote A0 a frame whose origin coincides with B but the axes stay parallel to those of A. One can imagine frame A0 is running along with frame B, but does not revolve around like B. 27

2.7. COMPLETE DYNAMICS MODEL AND SIMPLIFICATION Since M is fixed in B, its coordinates expressed in frame B do not change. This implies that: d MB = 0 dt A0 Since M can be expressed in frame A0 as a rotation of MB through the matrix RB which transforms a vector from B to A0 : 0

A MB MA0 = RB

Let us take time derivative of both sides: A0 ˙ A0 M˙A0 = R˙B MB + RB MB A0 M˙A0 = R˙B MB

(2.17)

We may think that as B revolves around A with angular rates ΩB , these angular rates form a vector whose direction indicate the axis of rotation and magnitude indicates how fast should the angle change as every point of B revolves around the axis. Nevertheless, at its core, ΩB is just a vector whose coordinates expressed in frame B so it can be written with respect to frame A0 too: B ΩB = RA 0 ΩA 0

Since the origins of these two frames coincide, ΩA0 represents an axis around which every point of A0 revolves, and a rate of angular change by the axis. This ”revolving around an axis motion” gives the velocity vector at every point, including MA0 as: M˙A0 = ΩA0 × MA0 = sk(ΩA0 )MA0

(2.18)

The cross-product of two vectors equals to skew-symmetric transform of first vector multiply by the other vector. We will see this property subsequent chapter. Finally, the coordinates of M is transformed between two frames as: B MB = RA 0 MA0

Placing back this equation into (2.17), and eliminate MA0 on both sides, we get: A0 B sk(ΩA0 ) = R˙B RA0

Which yields: BT A0 R˙B = sk(ΩA0 )RA 0

(2.19)

keep in mind RT R = I for any matrix R of SO(3). A property of the skew-symmetric transform (proven later) gives: sk(AB) = AT sk(B)A 0

A Thus, replacing ΩA0 with RB , we obtain: 0

0T

A A A sk(ΩA0 ) = sk(RB ΩB ) = RB sk(ΩB )RB

28

0

CHAPTER 2. DYNAMICS MODELLING Finally: A0 A0 sk(ΩB ) R˙B = RB

(2.20)

A0

A We have RB = RB because vector orientation does not depend on the origin of the frame. Thus: A A sk(ΩB ) R˙B = RB

(2.21)

Note that since A0 is translating with respect to A. The translational velocity renders (2.18) invalid if replaced A0 with A. In this regard, the expression of (2.19) is not true either. This explains why most dynamics models involving body frame tends to use angular rates expressed with respect to that frame rather than inertial frame. The fourth equation of (2.14) is actually written in body frame. To keep simple, τ includes only primary torques. A useful relation to convert from desired thrust and moment to individual rotor speeds is:     2  f 1 1 1 1 ω1 2   τ1   0   −dk 0 dk T T   ω2   = (2.22)  τ2   dkT 0 −dkT 0   ω3 2  ω4 2 τ3 −kQ kQ −kQ kQ ωi has both upper and lower saturation levels. The 4 × 4 matrix is invertible since determinant is different than 0. However, the expression: −1  1 1 1 1  0  −dkT 0 dkT      dkT 0 −dkT 0   −kQ kQ −kQ kQ 

 f M1   M2  M3

might not always yield positive result. Consequently, several ωi s can be imaginary when taking roots. In such case, we may set these ωi s to the lowest possible level.

29

Chapter 3 The geometric nonlinear control By presenting relevant geometric theory from differential geometry, we go on studying the rotation matrix in details to propose several useful expressions to create a Lyapunov candidate function. We will complement the missing proofs from original papers and introduce a slightly different Lyapunov candidate function to obtain the desired control laws. Although in some parts we try to treat the subject as rigorous as possible, for other parts we only focus on the intuition. Nevertheless, there will be references to the appropriate material for formal treatment.

3.1

The rotation group SO(3)

In this section, we will introduce the basic notions of differential geometry and some useful identities of the rotation group. We also present proofs to several relevant propositions that are hard to find (omitted usually due to simplicity) in textbooks and papers. Nevertheless, we believe these proofs will be of great aid when we try to convey the geometric intuition.

3.1.1

Elements of differential geometry

To represent an aircraft’s attitude, we only need to describe the body frame attached to the aircraft. The general idea is to describe how much each axis of the body frame ”tilts” compared to the those of the original inertial frame. Tait-Bryan angles do this by noting down the angles of successive rotations of the inertial frame around z, y 0 and x00 axis respectively. A tuple of these angles [φ, θ, ψ] forms a regular coordinate that represents most of aircraft’s possible attitudes. It turns out that Tait-Bryan angles are not the only way to parametrise any arbitrary rotation of a frame. We have briefly mentioned the quaternion representation, but in this section, we will treat all rotations in a homogeneous way through studying the group of rotations in three-dimensional space: the Special Orthogonal Group SO(3). We first start with defining a group in an algebraic sense: Definition 3.1 (Axioms for a group) A set G containing g1 , g2 , g3 , . . . , called group elements or group operations, combined with an inner formation operator (called group multiplication) ∗ form a group G under the satisfaction of the following axioms: 30

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL • Closure. Since ∗ is an inner formation operator, for any (a, b) ∈ G2 , a ∗ b ∈ G. • Associativity. Given (a, b, c) ∈ G3 , (a ∗ b) ∗ c = a ∗ (b ∗ c). • Identity. There exists an element e in G such that e ∗ a = a ∗ e = a for arbitrary a ∈ G. • Inverse. For each of group element a, there exists an element denoted as a−1 such that a−1 ∗ a = a ∗ a−1 = e. Note that we are not implying anything about the commutativity of the operator ∗. In general, a ∗ b is not equal to b ∗ a. If this happens to be true, the group is said to be abelian [41]. A rotation of a vector in three-dimensional space is unsurprisingly familiar to element of a group. The closure of the group can be understood in the sense that two or more rotations can be performed successively to form a new rotation - a trick that Tait-Bryan angles use to depict a generic rotation from one attitude to another. There is also an ”inverse rotation” such that when one performs a rotation of a vector around an axis clockwise and counter-clockwise the same angle θ, one ends up having the original vector. In this case, the counter-clockwise rotation is the inverse element of the clockwise rotation and vice-versa. In this respect, the identity element corresponds to a ”not rotating” rotation. To continue our conversation, some relevant definitions about topological and smooth manifold are required before defining Lie groups. Definition 3.2 (Topological manifold ) A topological space M is locally Euclidean of dimension n if every point p in M , there is a neighbourhood U such that there is a homeomorphism φ from U onto an open subset of Rn . The pair (U, φ) is called a chart, U is called a coordinate neighbourhood or a coordinate open set, φ a coordinate map or coordinate system on U [42]. Put simply, topological manifolds are generalisations of curves and surfaces in higher dimensional spaces. Since φ is a homeomorphism, continuity in both-direction of φ ensures the space being described as continuous i.e. no sudden jump from here to there. Since a manifold can be charted onto an Euclidean space (Rn ), we can apply various calculus tools at our disposal to resolve problems on this exotic space. The surface of the Earth is an example of a topological manifold. On large scale it has a spheric shape, but locally at the point where we are standing, the surface looks like a Euclidean space with parallel lines remain straight and never meet each other. This feature allows us to ”chart” the surface of the Earth onto different maps of different regions. All maps of every region form a geographic atlas. Definition 3.3 (Smoothness) A map f : M → Rn , p |→ (x1 , x2 , . . . , xn ) is said to be of class C k (or informally, k-smooth) if its partial derivatives ∂j f ∂xi1 . . . ∂xij 31

3.1. THE ROTATION GROUP SO(3) such that j ≤ k exist and continuous at p. If derivatives of f exist and continuous for all k ≥ 0 then f is called a smooth map or of class C ∞ . Following the standard notation in differential geometry, we will denote coordinate components as superscripts. Where ambiguity with power occurs, we will be explicit. Most of the time, we want not only continuous but smooth (in a derivative sense) transformations between charts. Again, imagine an atlas of the Earth - which is a book containing many pages, each page is a chart. There is a piece of China in the north of Vietnam chart (U,φ), and there is a piece of Vietnam in the south of China chart (V, ψ). Definition 3.4 (C ∞ -compatible charts) Two charts (U, φ : U → Rn ) and (V, ψ : V → Rn ) of a topological manifold are C ∞ compatible if the following two maps are C ∞ [42]: φ ◦ ψ −1 : ψ(U ∩ V ) → φ(U ∩ V ) ψ ◦ φ−1 : φ(U ∩ V ) → ψ(U ∩ V )

The idea of using charts is to study a geometric object like a curve on a topological manifold (a sphere for example), instead of on the manifold itself, but on a Euclidean space that we are familiar with. The properties yielded on the charts may or may not reflect the true object being in the manifold, since charts are just a figment of our imagination - a way that we choose to represent a real object. To avoid being ill-defined, meaning that the choice of charts could somehow meddle with the result, we need compatible charts to make sure the studied properties (like smoothness of a curve) are independent of the choice of charts. For example, a C 4 class mapping may only preserve differential properties of the geometric object up to 4th degree, a C 5 curve will fail under this map. That explains why we need a C ∞ map to preserve everything. If U ∩ V is empty, the two charts are automatically C ∞ compatible. If not, the intersection U ∩ V can be smoothly transformed from one chart to another without losing any mathematical details. Definition 3.5 (Atlas) A C ∞ atlas on a locally Euclidean space M is a collection U = (Uα , φα ) of pairwise C ∞ -compatible charts that cover M i.e. M = ∪α Uα [42]. This definition is easy to imagine. An atlas of the Earth with many pages, each is a chart, covers the entire Earth surface. If we want to work out a property of, say a curve from Ho Chi Minh City to Hanoi, we can turn to the chart of Vietnam; or a curve from Ho Chi Minh City to Beijing, we can use two charts of Vietnam and China. Part of the curve lying in the intersection between charts can be studied since the charts are C ∞ compatible. Definition 3.6 (Smooth manifold ) A smooth or C ∞ manifold is a topological manifold with a maximal atlas. The maximal atlas is sometimes called a differentiable structure. 32

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL However, it is already proven that one does not need to construct and prove an atlas is maximal to conclude about smooth manifold. Existence of any C ∞ atlas is enough [42].

3.1.2

Matrix groups

Definition 3.7 (Lie group) A Lie group is a C ∞ manifold G that is also a group such that two group operations: multiplication µ : G × G → G, µ(a, b) = ab and inverse i : G → G, i(a) = a−1 are C ∞ [42]. One important class of Lie groups is matrix group. We will introduce some basic Lie groups and subgroups to see the structure of SO(3). Definition 3.8 (General linear group GL(n,R)) A general linear group GL(n, R) is the group of n × n matrices that has determinant different than zero. GL(n, R) = A = [aij ] ∈ Rn×n |detA 6= 0

Proof. To prove that GL(n, R) is a Lie group, we have to prove the following statements: 1. Since elements of GL(n, R) are n × n matrices, we can identify each element of G 2 with a vector space of Rn×n , which is isomorphic to Rn . In this sense, we have introduced a chart for GL(n, R). 2. Define the map det as GL(n, R) → R : A |→ det(A). The pre-image of R\0, an open set via det is GL(n, R) is mapped to another open set following the proposition: Proposition 3.9 (Open set via continuous map) A function f : X → Y is continuous iff the pre-image of any open set in Y is open in X. The same goes for closed sets [43]. These two propositions will conclude that GL(n, R) is a manifold. To turn it into Lie group, we need to equip this group with a multiplication and inverse map that are both C ∞ . This can be achieved by defining matrix multiplication as the multiplication map and matrix inversion as the inverse map. det(AB) = det(A)det(B) 33

3.1. THE ROTATION GROUP SO(3)

Figure 3.1: Preserving length also preserves angle

1 [Aminor ] det(A) These maps are valid and smooth as long as matrix determinant is different than zero. A−1 =

We now study another Lie group, called the orthogonal group, denoted as O(n). A group of linear transformations that preserves length (and angle) of vectors is called an isometry. In layman terms, such linear transformations include translation, rotation and reflection. For translation, a vector is simply added with another vector while for rotation and reflection, we need a special kind of matrix that when leftmultiplied with a vector will result in a transformed vector. Proposition 3.10 (Length and angle preservation) A transformation that preserves length will also preserve angle. Proof. Consider three vectors V1 and V2 and V1 − V2 . According to the law of cosines (Figure 3.1): ||V1 − V2 ||2 = ||V1 ||2 + ||V2 ||2 − 2||V1 ||||V2 ||cosα Under some linear transformation that preserves length, ||·|| remains constant, thus α remains the same. Consider a matrix A ∈ Rn×n which satisfies: AAT = AT A = I Such matrix is called orthogonal matrix. We want to see how A transforms two column vectors (a, b) ∈ (Rn × Rn ). Proposition 3.11 (Orthogonal matrix preserves the scalar product) Given a pair of vectors a, b. An orthogonal matrix preserves the scalar product between these vectors. ha, bi = a · b = const

34

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Proof. We have: hAa, Abi = (Ab)T Aa = bT AT Aa = bT Ia = bT a = ha, bi We can clearly see the length preserving property of such transformation when assuming b = a: hAa, Aai = ha, ai = ||a|| And angle preserving: hAa, Abi = ||Aa||||Ab|| cos α0 = ha, bi = ||a||||b|| cos α Given || · || = const from the property of length preserving. An orthogonal matrix has either determinant +1 or -1 since: det(AAT ) = det(A)det(AT ) = det(A)2 = det(I) = 1 ⇒ det(A) = ±1 If det(A) = 1, the matrix is said to preserve the orientation (righthandness). Rotation matrix is one of such transformation. If det(A) = −1, the high-handedness is inverted. Reflection is one of such transformation. One of the interesting property of an orthogonal matrix is that the transformed orthonormal basis is already written as components of the matrix. This can be seen from the fact that:     1 0 0 Ae1 A = AI = A  0 1 0  =  Ae2  0 0 1 Ae3 With e1 = [1, 0, 0]T , e2 = [0, 1, 0]T , e3 = [0, 0, 1]T unit vectors of an orthonormal basis. The rows of A indicate the unit vectors of a new orthonormal basis after transformation (rotation or reflection). Orthogonal matrices form a Lie group called Orthogonal group, denoted by the letter O. It is in fact a subgroup of GL(n, R). [42] gives an excellent proof of this property. Now we only focus on orthogonal matrices whose determinant is 1 since they correspond to rotations. Earlier, we have exhibited that the map det is a group homomorphism. It can be inferred the two following statements: 1. O(n) matrices with det = 1, via det map, map onto the identity element of R as a group. This means that these matrices belong to the ker(det) and thus form a subgroup of GL(n, R). 2. Since 1 is a closed set, a homomorphism into a closed set infers that the pre-image is closed, thus the subgroup is closed. The above remarks allow us to conclude that O(n) matrices with det = 1 form an embedded Lie group following the infamous theorem: Theorem 3.12 (Closed subgroup theorem) 35

3.1. THE ROTATION GROUP SO(3) A closed subgroup of a Lie group is an embedded Lie subgroup. The proof for the above theorem is presented in [44]. At this moment, we can safely refer to ”the matrices of O(n) whose determinant is 1” as Special Orthogonal matrices. The group of these matrices is Special Orthogonal Group (SO(n)) and is a valid Lie group. When n = 3, SO(n) corresponds to a group of possible rotations in three-dimensional space. In the following sections, we will introduce a key concept called Lie algebra which can capture much of the underlying structure of a Lie group. Since Lie algebra has a vector space structure, it makes analysis on such space much easier than on the group. The properties near identities are carried by group lements on and on to different positions of the manifold. Before taking about the relationship between Lie groups and Lie algebras, we need to further define some concepts.

3.1.3

Derivatives

Definition 3.13 (Derivation) Derivation at a point in a manifold M , or a point-derivation of Cp∞ (M ) is defined to be a linear map D: Cp∞ (M ) → R which satisfies the Leibniz rule: D(f g) = (Df )g(p) + f (p)Dg

Recall that Cp∞ is a germ of real-valued function at p in M. They are a set of equivalent functions that agree with each other in a probably smaller (but not larger) neighbourhood of p. Seeing derivation as a map to a real number allows us to liberate ourself from having this concept attached to some specific coordinate system as we did in calculus. Definition 3.14 (Tangent vector ) A tangent vector at a point p in a manifold M is a derivation at p. Definition 3.15 (Derivation in component expression) Given a chart (U, φ) = (U, x1 , x2 , . . . , xn ) about a point p in M, derivation of a realvalued function f ∈ Cp∞ is defined as: ∂ ∂ f = i (f ◦ φ−1 ) ∈ R i ∂x ∂r

Definition 3.16 (Tangent space) Tangent vectors at p form a vector space Tp (M ) called the tangent space of M at p. In short, derivation at a point is synonymous to directional derivative of some realvalued function f . As an intuition, one may think this expression gives how much f 36

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL will vary if we change a coordinate xi on the chart a tiny amount of . Since φ is a diffeomorphism of p 3 U ⊂ M into its coordinate map φ(U ), there is an isomorphism between tangent spaces of image φ(U ) and preimage U . However, φ(U ) ∈ Rn , the tangent space is indeed a vector space. Definition 3.17 (Differential of a map) Let F : N → M be a C ∞ map between two manifolds M and N . The map F not only takes one point from one manifold to the other, but also their tangent spaces through an accompanied map F∗ defined below. F∗ = TP N → TF (p) M (F∗ (Xp ))f = Xp (f ◦ F ) ∈ R for all f ∈ CF∞(p) (M ) [42]. At its core, Lie algebra is a result of linearisation of group operations around the neighbourhood of its identity operator, just like Taylor expansion linearises a function around a point. Lie algebras composes of vectors in the tangent space at the identity element and closed under the Lie bracket operation [X, Y ]. The exponential map then takes tangent vectors in Lie algebra back to the group, but it is not always guaranteed that every group element has the corresponding tangent vector in Lie algebra [45]. This fact depends on the specific individual Lie group we are dealing with. Fortunately, the exponential map is surjective on SO(3). The intuition behind the relationship between Lie group and Lie algebra (understood as the tangent space at identity element) is described below. For more concrete construction, please refer to [44]. If there is a tangent vector X at the identity group element, we can make a vector field out of it i.e. assigning tangent vector for every other group element through some operator Lg defined as: Lg h = gh, (g, h) ∈ G It is apparent that if h is e, the identity element, the Lg will take us from identity to arbitrary g we choose. By choosing a variety of g from G, the differential map Lg∗ (note the star) takes the original tangent vector at identity to everywhere, thus creates a left-invariant vector field since Lg∗ X = X with X denotes a vector field. As we move away from the identity, following the direction pointed out by the tangent vectors at various points we come across, we reach new places (corresponding to new group elements of the Lie group G). The path we travel through can be seen as a curve on the manifold (more precisely, the local flows). Now if we see the vector field X as an ordinary differential equation, that path will correspond to the solution. This ”moving along the arrows” style is actually what the exponential map does. Intuitively, if we get stuck somewhere like the tangent vectors tell us to go around and around then we can not reach the entire manifold G, or if the manifold is not connected (think of a two-sheeted hyperboloid) where we can not draw a path from one surface to another, the exponential map won’t reach 37

3.1. THE ROTATION GROUP SO(3) those elements too. For this reason, the original name of Lie algebra was ”infinitesimal operator”. For a member of SO(3) it is possible to get the form of tangent vectors at identity element (i.e. Lie algebra) via the following proposition:

3.1.4

Lie algebra, exponential and logarithm mappings

Proposition 3.18 (Lie algebra of SO(n)) Lie algebra elements, denoted as son of SO(n) are tangent vectors at identity element, bear the form of skew-symmetric matrices. Proof. Define a curve c(t) as c(0) = I and c(0)0 = X with X is tangent vector at identity, which corresponds to t = 0. Because c(t) ∈ SO(3), we have the following equation: T c(t)c(t)  =I  ∂ c(t)c(t)T = 0 ⇒ ∂t ⇒ c0 (t)c(t)T + c(t)c0 (t)T = 0 ⇒ XI + IX T = 0 ⇒ X + XT = 0

which imples that X ∈ son is a skew-symmetric matrix. Orthogonal group also shares this form of Lie algebra too [42]. For n = 3, we have Lie algebra so3 and Lie group SO(3). It is also proven in [46] that the exponential map between Lie algebra so3 and Lie group SO(3) is surjective, which means that every possible notation in threedimensional space can be parametrised by a skew-symmetric matrix in so3. We also have the following proposition whose full proof is presented in [46]: Proposition 3.19 (Exponential mapping from so3 to SO(3)) Given a skew symmetric matrix A ∈ so3, the exponential map is defined as ∞ X A2 1 k A =I +A+ + ... A→e = k! 2 k=0 |

A

When A is parametrised by a skew-symmetric matrix in so3, we can define sk −1 (A) K= ⇒ ||K|| = 1 ||sk −1 (A)|| and θ = ||sk −1 (A)|| The above expression can be simplified as: R = eθK = I + (sinθ)sk(K) + (1 − cosθ)sk(K)2

38

(3.1)

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Proof. We use the finesse method introduced in [45]. Let K = [x1 , x2 , x3 ]T ∈ R3 such that ||K|| = 1. Then,   0 −x3 x2 0 −x1  ∈ so3 sk(K) =  x3 −x2 x1 0 The find the characteristic polynomial of sk(K) is:   −λ −x3 x2 P (λ) = det(K − λI) = det  x3 −λ −x1  −x2 x1 −λ Calculate determinant by expanding the first row elements of the matrix: P (λ) = −λ(λ2 + x21 ) − (−x3 )(−x3 λ − x1 x2 ) + x2 (x1 x3 − x2 λ) P (λ) = −λ3 − λ(x21 + x22 + x23 ) = −λ3 − λ||K|| = −(λ3 + λ) Using Cayley-Hamilton theorem that every matrix satisfies its characteristic equation: −(K 3 + K) = 0 ⇒ K 3 = −K Thus, K 4 = −K 2 , K 5 = K 3 K 2 = −KK 2 = −K 3 = K, K 6 = K 2 , . . . . In this way, we can reduce all K n whose power n is greater than 3 to either K or K 2 . The exponential expression is then simplified to:   2   θ θ4 θ6 θ3 θ5 θK + − ... K + − + − . . . K2 e =I+ θ− 3! 5! 2! 4! 6! Note the terms in parentheses are Taylor expression of sin(θ) and 1−cos(θ) respectively. The proof is completed. Equation (3.1) is of most important and we will frequently use this equation to derive subsequent expressions for our control law. Recall that if we have a vector v, the rotation of this vector v 0 around an axis K by an angle θ is given by: v 0 = (cosθ)v + sinθK × v + (1 − cosθ)(K · v)K

(3.2)

Such equation can be derived geometrically by taking cross-product and scalarproduct of vectors and their projections [47]. By comparing (3.1) and (3.2) using the following identity: a × (b × c) = (a · c)b − (a · b)c

(3.3)

it is clear that (3.1) is an axis-angle parametrisation of any rotation matrix: K is the vector indicating the axis, while θ indicates the counter-clockwise angle of rotation around this axis. We immediately realise that exponential map is not injective, because any rotation of π and −π (rad) around one axis result in the same rotation. Another remark we would like to make about this SO(3) group: if it is a topological manifold, we are curious to see what it looks like. Equation (3.1) hints at the space it 39

3.1. THE ROTATION GROUP SO(3)

Figure 3.2: Representation of SO(3) geometrically

is diffeomorphic to. Imagine we have a solid sphere of radius π. Any vector connecting the centre of the sphere with some point A inside the sphere will generate an axis for rotation, with an angle defined to be the length of this vector. If point A is on the surface of the sphere, something exotic might happen. We already know that the rotation of π and −π around one axis are exactly the same, thus a pair of antipodal points on the surface of the sphere is actually one. Imagine our sphere is made of clay and we can pull out this sphere to connect the pair of antipodal points together (Figure 3.2), so when one travel from the centre towards the surface, one will suddenly disappear at the surface and reappear at the antipodal point. We can not imagine this shape in our three-dimensional space as we can not do that without the sphere intersecting with itself. Nevertheless, it is made possible in higher dimension spaces, and the space that SO(3) diffeomorphic to, is called the Real Projective Space (RP3) [44]. But for the antipodal points where the exponential map fails to be injective, we can define a map which is inverse of the exponential map called logarithm map. Proposition 3.20 (Trace of squared skew-symmetric matrix ) Given K ∈ R3 , ||K|| = 1. The trace of sk(K)2 is −2. Proof. Let K = [x1 , x2 , x3 ]T . We have: 

 0 −x3 x2 0 −x1  sk(K) =  x3 −x2 x1 0

Thus, K 2 is:  2  −x2 − x23 x1 x2 x 1 x3 −x21 − x23 x 2 x3  K 2 =  x1 x2 x1 x3 x2 x3 −x21 − x22 Finally: trace(K 2 ) = −2(x21 + x22 + x23 ) = −2

40

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Proposition 3.21 (Logarithm map from SO(3) to so3) Given a matrix R ∈ SO(3), the angle of rotation is:   trace(R) − 1 θ = arccos 2 and rotation axis is: K=

 1 sk −1 R − RT 2sin(θ)

(3.4)

(3.5)

Proof. The above formulas are direct consequences of the exponential map. Since R ∈ SO(3) and the exponential map is surjective, there exists sk(K) that satisfies (3.1). Let us take the trace of R: 1. trace(I) = trace(diag(1, 1, 1)) = 3. 2. trace(sinθsk(K)) = 0 since trace(sk(K)) = 0, due to the definition of sk(·). 3. trace((1 − cosθ)sk(K)2 ) = (1 − cosθ)(−2) = −2 + 2cosθ Thus: 3 − 2 + 2cosθ = 1 + 2cosθ = trace(R)

(3.6)

Also since sk(K)T = −sk(K) due to the antisymmetry of skew-symmetric matrix K: R = I + sinθsk(K) + (1 − cosθ)sk(K)2 RT = I − sinθsk(K) + (1 − cosθ)sk(K)2 It is evident that:

R − RT 2sinθ Note that sk(K) is possible to be inferred from the above formula only when θ 6= ±π, confirming that the exponential map fails to be injective at antipodal points on RP 3. sk(K) =

3.2 3.2.1

Properties of some geometrical entities Skew-symmetric matrix properties

In this section, we will prove several properties of the skew-symmetric matrices, which are the representatives of rotation matrices in Lie algebra. In the end, we introduce some error function to quantitatively measure the difference between rotations. The properties are mentioned in [48], [32] with some proofs presented in [49]. Some identities, for unknown reason, are missing proof or the proof is not straightforward to follow. Either way, we will try to carefully reprove all of these formulas with some intuitive explanation about each geometric identity. Proposition 3.22 41

3.2. PROPERTIES OF SOME GEOMETRICAL ENTITIES Let sk(x), sk(y) ∈ so3 with (x, y) ∈ R3 × R3 , the following identity is true: sk(x)y = x × y = −y × x = −sk(y)x

(3.7)

Proof. Let three orthonormal basis of an Euclidean vector space as i, j, k. We have: i × j = k, j × k = i, k × i = j i×i=j×j =k×k =0 i × j = −j × i; . . . Any vector in an Euclidean vector space can be expressed as: linear combination of orthonormal basis: x = x 1 i + x2 j + x3 k y = y1 i + y2 j + y3 k Taking x × y is equivalent to: x × y = (x1 i + x2 j + x3 k) × (y1 i + y2 j + y3 k) x × y = (x2 y3 − x3 y2 )i + (x3 y1 − x1 y3 )j + (x1 y2 − x2 y1 )k    0 −x3 x2 y1    0 −x1 y2  x × y = x3 −x2 x1 0 y3 The remaining properties can be inferred from the anti commutativity property of cross product. Proposition 3.23 Given A, B ∈ Rn×n × Rn×n : trace(AB) = trace(BA)

(3.8)

Proof. The proof is given in [42]. tr(XY ) =

XX i

tr(Y X) =

k

XX k

xik yki yki xik

i

The two equations are equivalent since i, k are independent of each other which allows us to switch place of two sum signs. 42

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Proposition 3.24 Given A ∈ Rn×n . The following identity is true: trace(A) = trace(AT )

(3.9)

Proof. The diagonal elements of a matrix remains intact when doing a transpose transformation. The identity is apparent. Proposition 3.25 Given R ∈ SO(3) and x ∈ R3 , the following identity is true: sk(Rx) = Rsk(x)RT

(3.10)

Proof. First we observe that: (Rsk(x)RT )T = Rsk(x)T RT = −Rsk(x)T RT Which implies that Rsk(x)RT is a skew-symmetric matrix. Since matrix multiplication is associative: (Rsk(x)RT )Rx = Rsk(x)(RT R)x = Rsk(x)x = 0 since sk(x)x = x × x = 0 which implies that Rsk(x)RT = λsk(Rx). It remains to be seen if λ = 1. To prove this, we may choose another vector y such that ||y|| = ||x|| perpendicular to x so x × y = z and ||z|| = ||x|| = ||y||. This choice is possible for all x 6= [0, 0, 0]T . Since rotation of a basis does not alter its length nor orthogonality, the following identity holds: x × y = z ⇒ Rx × Ry = Rz We can also explicitly prove the above equation by writing out all the components of R, x, y and z. Finally: Rsk(x)RT Ry = Rsk(x)y = R(x × y) = Rz = Rx × Ry = sk(Rx)Ry Which yields λ = 1. Proposition 3.26 Given a matrix A ∈ Rn×n and x ∈ so3. The following identity is true:  1 trace(Ask(x)) = trace sk(x)(A − AT ) 2

43

(3.11)

3.2. PROPERTIES OF SOME GEOMETRICAL ENTITIES Proof. The proof is given in [49]: trace(Ask(x)) =

1 (trace(sk(x)A) + trace(Ask(x))) 2

since trace(AB) = trace(BA). Now using the identity trace(A) = trace(AT ): =

 1 trace(sk(x)A) + trace(sk(x)T AT ) 2

Since sk(x) is skew-symmetric, sk(x)T = −sk(x): =

 1 trace(sk(x)A) + trace(−sk(x)AT ) 2  1 = trace sk(x)A − sk(x)AT 2  1 = trace sk(x)(A − AT ) 2

Proposition 3.27 Given a matrix Z ∈ Rn×n and x ∈ so3. The following identity is true: 1 trace(sk(x)Z) = −xT sk −1 Z 2

(3.12)

Proof. Z − Z T is skew-symmetric since: (Z − Z T )T = Z T − Z = −(Z − Z T ) The following proof is presented in [49]. We have:    0 −x3 x2 0 −z3 z2 1 1 0 −x1   z3 0 −z1  trace(sk(x)Z) = trace  x3 2 2 −x2 x1 0 −z2 z1 0 = −(x1 z1 + x2 z2 + x3 z3 ) = −xT sk −1 Z

Proposition 3.28 Given a matrix A ∈ Rn×n and x ∈ so3. The following identity is true: sk(x)A + AT sk(x) = sk((trace(A)I3×3 − A)x)

44

(3.13)

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Proof. Let x = [x1 , x2 , x3 ]T and   a11 a12 a13 A = a21 a22 a23  a31 a31 a33 Thus: sk(x)A + AT sk(x) = 

 0 a31 x1 + a32 x2 − (a11 + a22 x3 ) −a21 x1 + (a11 + a33 )x2 − a23 x3 −a31 x1 − a32 x2 + (a11 + a22 x3 ) 0 −(a22 + a33 )x1 + a12 x2 + a13 x3  a21 x1 − (a11 + a33 )x2 + a23 x3 (a22 + a33 )x1 − a12 x2 − a13 x3 0 We also have: 

 (a22 + a33 )x1 − a12 x2 − a13 x3 trace(A)I3×3 − A = −a21 x1 + (a11 + a33 )x2 − a23 x3  −a31 x1 − a32 x2 + (a11 + a22 )x3

3.2.2

Error functions on SO(3)

To quantify the difference between two rotation matrices, we will introduce an error function that possesses some quality for building Lyapunov candidates. [50] suggests the following expression: Definition 3.29 (Error function on SO(3))  1 Ψ = trace I − RdT R 2

(3.14)

Such equation is widely used in geometrical control synthesis such as [32], [48]. The motivation for the above error function comes from the Logarithm map introduced earlier. Given two rotation matrices: R - the current attitude and Rd - the desired attitude, there is a rotation that takes Rd to R which is RdT R since Rd (RdT R) = (Rd RdT )R = R Such transformation can be expressed in terms of a single rotation around some axis with an angle. Consider (3.14), we can rewrite the expression as: trace(I − RdT R) = trace(I − R∆ ) = trace(I) − trace(R∆ ) = 3 − trace(R∆ ) From (3.6), we get: 1 3 1 3 1 (3 − trace(R∆ )) = − trace(R) = − − cosθ = 1 − cosθ 2 2 2 2 2 The identity matrix added to (3.14) increases Ψ by trace(I) = 3 to make the error function positive definite with respect to attitudes whose angle of a direct rotation between them is less than π, which is large enough for most situations. When R = Rd , RdT R = RT R = I ⇒ Ψ = 0. Taking derivative of the attitude error intuitively gives us two following senses: 45

3.2. PROPERTIES OF SOME GEOMETRICAL ENTITIES 1. How is the axis direction changing. 2. How fast is the angle correction taking place around that axis. Imagine we are being asked by a police officer to turn around (literally equivalent to correct an attitude error). Should we turn left or right? How fast should we turn? These are the intuitions which give rise to two respective error functions concerning the dynamics of a rotating system. ˙ ˙ = 1 trace(−R˙T R − RT R) Ψ d d 2 We have already proven R˙ = Rsk(Ω): ˙ = 1 trace(−(Rd sk(Ωd ))T R − RT Rsk(Ω)) Ψ d 2 Because (AB)T = B T AT and sk(x)T = −sk(x): ˙ = 1 trace(sk(Ωd )RT R − RT Rsk(Ω)) Ψ d d 2 Because RRT = Rd RdT = I, we can rewrite sk(Ωd )RdT R = RdT RRT Rd sk(Ωd )RdT R: ˙ = 1 trace(RT R(RT Rd sk(Ωd )RT R − sk(Ω)) Ψ d d 2 Using (3.10), we may write RT Rd sk(Ωd )RdT R as sk(RT Rd Ωd ) and take the minus sign outside the parentheses: ˙ = − 1 trace(RdT R(sk(Ω) − sk(RT Rd Ωd )) Ψ 2 After simplification: ˙ = − 1 trace(RT Rsk(Ω − RT Rd Ωd )) Ψ d 2 Following (3.8): ˙ = − 1 trace(sk(Ω − RT Rd Ωd )RdT R) Ψ 2 Applying (3.11), we yield: ˙ = − 1 trace(sk(Ω − RT Rd Ωd )(RdT R − RT Rd )) Ψ 4 And to get rid of the trace, we apply (3.12) to get: ˙ = 1 (Ω − RT Rd Ωd )T sk −1 (RT R − RT Rd ) Ψ d 2 Definition 3.30 (Attitude and angular velocity error functions) 46

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL We define the angular velocity error as: eΩ = Ω − RT Rd Ωd

(3.15)

 1 eR = sk −1 RdT R − RT Rd 2

(3.16)

And the attitude error as:

Thus, given the scalar product a · b = bT a = aT b, the derivative of attitude error function Ψ as: ˙ = eR · eΩ Ψ (3.17) The entity eR ∈ R3 , in light of logarithm map (3.5) can be interpreted as a representation of how the rotation axis of R and Rd relate to each other: 1 −1 T sk (R∆ − R∆ ) = sinθK 2

(3.18)

The other entity eΩ ∈ R3 expresses how fast R and Rd rotate around their respective rotation axis, compared to each other. Since aircraft attitude can be expressed a rotation R from the inertial to body frame, current attitude R can be made to track Rd so that the two attitudes evolute exactly alike if they are originally the same rotation matrix, share the same axis of rotation and ”spin” at the same rate. On such occasion, we have: eR = eΩ = 0 (3.19) To facilitate the attitude tracking process, the idea is to create a control law that makes (3.19) an asymptotic equilibrium. In other words, the controller will have to minimize both eR and eΩ to zero. The section following will present such law that enables the convergence of eR and eΩ exponentially to the equilibrium. It is believed that eR should contain some insights about the angular velocity of the frames. Such information is required for chained derivation of time. 1 T e˙R = sk −1 (R˙ d R + RdT R˙ − R˙ T Rd − RT R˙ d ) 2 ˙ Using the identity R = Rsk(Ω) we have: 1 e˙R = sk −1 (−sk(Ωd )RdT R + RdT Rsk(Ω) + sk(Ω)RT Rd − RT Rd sk(Ωd )) 2  1 e˙R = sk −1 RdT R(−RT Rd sk(Ωd )RdT R + sk(Ω)) + (sk(Ω) − RT Rd sk(Ωd )RdT R)RT Rd 2 Applying the identity of (3.10) we have:  1 e˙R = sk −1 RdT R(−sk(RT Rd RΩd ) + sk(Ω)) + (sk(Ω) − sk(RT Rd Ωd ))RT Rd 2 By grouping the sk(·) together:  1 e˙R = sk −1 RdT sk(eΩ ) + sk(eΩ )RT Rd 2 47

3.2. PROPERTIES OF SOME GEOMETRICAL ENTITIES Substituting this equation into the form of (3.13) we yield: 1 1 T T T e˙R = (trace(RT Rd )I − RT Rd )eΩ = (trace(R∆ )I3×3 − R∆ )eΩ = C(R∆ )eΩ 2 2

(3.20)

[32] claimed that the eigenvalues of C is less than 1 without showing any detailed proof. We thank professor Jean-Marie (INSA Lyon, France) for providing us with kind suggestions to prove this proposition. Proposition 3.31 (Boundedness of ||e˙R ||) Given attitude error function eR of (3.16). ||e˙R || is bounded by ||eΩ ||. T Proof. The first step involves finding the eigenvalues of C T (R∆ )C(R∆ ). We know iθ −iθ T eigenvalues of R ∈ SO(3) are 1, e , e [51]. Let us denote R∆ in equation (3.20) by R without any loss of generalisation. We also define:

D = diag(1, eiθ , e−iθ ) Using the Eigen Decomposition Theorem [52], any square matrix R can be decomposed into the following form: R = P DP −1 where D is a diagonal matrix containing the eigenvalues and P containing the eigenvectors written in columns. Expanding C(R)T C(R): 1 C(R)T C(R) = (trace(R)I − R)T (trace(R)I − R) 4 Replacing trace(R) with t = 1 + 2cosθ from (3.6), we have:  1 1 C(R)T C(R) = (tI − RT )(tI − R) = (1 + t2 )I − t(R + RT ) 4 4 Since R ∈ SO(3), the following equality holds: RRT = I ⇒ R−1 = RT We replace R with P DP −1 and RT with P D−1 P −1 : C(R)T C(R) =

 1  1 (1 + t2 )I − t(R + R−1 ) = (1 + t2 )I − tP (D + D−1 )P −1 4 4

Note that I = P P −1 = P IP −1 we can replace (1 + t2 )I with P (1 + t2 )IP −1 :    1 T 2 −1 C(R) C(R) = P (1 + t )I − t(D + D ) P −1 4 48

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Thus, the eigenvalues of C(R)T C(R) are the elements of the diagonal matrix ∆=

 1 (1 + t2 )I − t(D + D−1 ) 4

We have:   4cos2 θ + 4cosθ + 2 0 0  0 4cos2 θ + 4cosθ 0 (1+t2 )I = (1+(1+2cosθ)2 )I =  2 0 0 4cos θ + 4cosθ t(D + D−1 ) = (1 + 2cosθ)(diag(2, eiθ + e−iθ , eiθ + e−iθ ))   2(1 + 2cosθ) 0 0  0 2(1 + 2cosθ)cosθ 0 = 0 0 2(1 + 2cosθ)cosθ Finally:   4cos2 θ 0 0 1  2(cosθ + 1) 0 ∆=  0 4 0 0 2(cosθ + 1) T So the eigenvalues of C T (R∆ )C(R∆ ) are

1 1 cos2 θ, (1 + cosθ), (1 + cosθ) 2 2

(3.21)

The second step involves taking norm of the ||e˙R || vector. We may use a scalar product to achieve this: ||e˙R ||2 = e˙R · e˙R = e˙R T e˙R From (3.20), the expression is equivalent to: T ||e˙R ||2 = eTΩ C T (R∆ )C(R∆ )eΩ

We have the identity: λmin,A ||x||2 ≤ xT Ax ≤ λmax,A ||x||2

(3.22)

which λmin,A is the minimum eigenvalue of A and λmax,A is the maximum eigenvalue of A. Finally, all the eigenvalues in (3.21) are less than 1 given 0 < θ < π. The proof is completed. To wrap things up, in this section we have introduced a positive definite error function Ψ in (3.14), attitude and angular velocity error in (3.15) and (3.16) which govern the dynamics of how two attitudes evolute relative to each other. Before deriving the control law, we will review some basic concepts in nonlinear control. 49

3.3. NONLINEAR CONTROL CONCEPTS

3.3 3.3.1

Nonlinear control concepts Introduction

A general physical system is governed by a set of differential equations. x˙1 = f1 (x1 , x2 , . . . , u1 , u2 , . . . ) x˙2 = f2 (x1 , x2 , . . . , u1 , u2 , . . . ) x˙3 = f3 (x1 , x3 , . . . , u1 , u2 , . . . ) ... x˙n = fn (x1 , x2 , . . . , u1 , u2 , . . . ) y = g(x1 , x2 , . . . , u1 , u2 , . . . )

(3.23)

This set of equations is obtained by physical laws, such as Newton’s Second law for mechanical systems, Fourier’s law for thermo-conducting systems, Maxwell’s equations in electromagnetism... Any high-ordered differential equation can be rewritten into a set of first-order like above. We call this set a state-space representation of the system. x = [x1 , x2 , . . . , xn ]T ∈ Rn is the state vector, while u = [u1 , u2 , . . . , um ]T ∈ Rm is the input vector. Output of this system is y which usually depends on some states and inputs g. A methodology to yield these equations for mechanical systems usually involve either of Lagrange or Newton’s method. The latter is presented in chapter 2, while the former can be seen in [23]. Definition 3.32 (Autonomous system) A system whose dynamics fi (x1 , x2 , . . . , u1 , u2 , . . . ), i = 1..n do not depend explicitly on time t is called an autonomous. x˙ = f (x)

In our case, the quadrotor dynamics is autonomous. Although there has been tremendous progress in development, nonlinear control still remains a tough challenge. The main difficulties of controlling a nonlinear system compared to a linear one include: 1. Homogeneity does not hold anymore. Very often f (αx) 6= αf (x). 2. The superposition position does not hold anymore. Very often f (x + y) 6= f (x) + f (y). This means that we can not study the dynamic modes individually, but rather have to counter all of them at the same time. Moreover, it is usually also not the case that we can scale output based on variation of input. If we double up the input signal, the output might bear a completely different form [53]. The nonlinear dynamics are much richer than those of a linear system. Some of the nonlinear phenomenons include multiple isolated equilibrium points, limit cycles, multi 50

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL modes of behaviour that the response seems to not only depend on the intrinsic system itself, but also on external parameters [25]. Moreover, analysis of nonlinear system involves a lot of mathematics and in very limited scenarios, a systematic approach can be applied.

3.3.2

Stability

Although there are a lot more about nonlinear systems, here we focus only on the relevant theory to our desire. The Lyapunov stability theorem is a standard tool in analysis of nonlinear systems. Moreover, it can be used as a powerful tools to design a feedback control law that can guarantee stability once the conditions are met. This section follows [25] closely. The stability criterion presented here is intended for autonomous system. Consider one with no forcing input: x˙ = f (x) Theorem 3.33 (Cauchy-Lipschitz condition for differential equations) To have a unique solution locally over some [t0 , t0 + δ] it is required that f (t, x) is a piecewise continuous function in t and satisfy the Cauchy-Lipschitz condition. ||f (t, x) − f (t, y)|| ≤ L||x − y|| with ∀x, y ∈ B(x0 , r) such that B(x0 , r) = x : ||x − x0 || ≤ r. If we divide both sides with ||x − y||, we get: ||f (t, x) − f (t, y)|| ≤L 0 there exists a δ() > 0 such that: ||x(t0 )|| < δ ⇒ ||x(t)|| < , ∀t > t0

Put simply, once a system comes close to the equilibrium point, it will remain close to there. Note the definition distinctly states that  can be made arbitrarily small. Otherwise, there may exist a repulsive region that when the system tries to come closer to the equilibrium point, it is pushed back. Imagine two magnets with the same poles facing each other. No matter what we do, the magnets remain at some distance to each other (i.e. bounded) but can not be made smaller since they will repulse once we attempt to do that. The above definition does not require that  gets smaller with time or eventually come to rest. It might just continue to evolute though remaining near the equilibrium point. Definition 3.37 (Equilibrium asymptotic stability) An equilibrium xe = 0 of a nonlinear system x˙ = f (x) is said to be asymptotically stable (Figure 3.3b) if, in addition to being stable, δ can be chosen such that: ||x(t0 )|| < δ ⇒ lim ||x(t)|| = 0 t→∞

(3.24)

The system can then be brought to rest after some time. Definition 3.38 (Exponential stability) A signal is said to be converge exponentially to zero if the following identity holds: ||x(t)|| ≤ γ||x(t0 )||e−ρ(t−t0 )

(3.25)

for some γ, ρ > 0. An equilibrium is exponential stable if the states converge exponentially to the equilibrium.

52

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL

3.3.3

Lyapunov stability theorem

Lyapunov theorem supplies us with a tool to check for stability without actually solve the partial differential equations. Theorem 3.39 (Lyapunov direct method ) Let the origin x = 0 ∈ D ⊂ Rn be an equilibrium point for x˙ = f (x). We define V : D → R a continuously differentiable function, called a Lyapunov candidate function that is: 1. Positive definite ∀x ∈ D. 2. Time derivative V˙ is negative semi-definite ∀x ∈ D. Then V becomes a Lyaunov function and x = 0 is a stable equilibrium point. If time derivative V˙ is negative-definite then x = 0 is an asymptotic stable equilibrium point [25]. Recall that a function ψ is: 1. Positive definite in some subset D ⊂ R if ψ(x) > 0, ∀x ∈ D\0 ∧ ψ(0) = 0. 2. Positive semidefinite if D ⊂ R if ψ(x) ≥ 0, ∀x ∈ D\0 ∧ ψ(0) = 0. 3. Negative definite if −ψ is positive definite. 4. Negative semidefinite −ψ is positive semidefinite. The intuition of Lyapunov function V is some kind of an ”error measurement”. If the system is not in the equilibrium state, V is positive. Derivative with respect to time V˙ < 0 then requires V to decrease. The only way V could achieve its minimum value of 0 is when the system states coincide with equilibrium states. In other words, the system tries to correct any deviation of its internal states towards an equilibrium. In this sense, if we define the equilibrium as ”zero error” between output and input, the control law will attempt to track the given input precisely. For most nonlinear control problems, it is about the choice of an appropriate Lyapunov candidate function. For linear systems, the candidates are usually quadratic functions, which yield an equivalent condition that the transition matrix is Hurwitz. However for nonlinear systems, there is no consensus. The geometrical structure of SO(3) that we have presented up to this point serves the purpose to choose one that satisfies the conditions given in Lyapunov’s stability theorem, which will be presented in the next section. Before wrapping up this section, we would like to introduce a theorem that is very useful to prove exponential stability of an equilibrium. Theorem 3.40 (Exponential stability) If V (t, x) is a Lyapunov function which satisfies the following identities: ρ1 ||x||α ≤ V (t, x) ≤ ρ2 ||x||α V˙ (t, x) ≤ ρ3 ||x||α

(3.26)

for any positive constants ρ1 , ρ2 , ρ3 , α. Then x converges exponentially to zero [25].

53

3.4. DERIVATION OF CONTROL LAWS FOR QUADROTOR

3.4

Derivation of control laws for quadrotor

The process of derivation follows closely of [32]. However, we will be explicit where modifications are made in the proofs. We will divide our controlling problem into two sub-problems, each corresponds to a control loop: 1. Attitude tracking controller will correct the aircraft’s current R to any desired attitude Rd by calculating necessary torques to realise the movement. The torques are then converted to engines’ RPM by equation (2.22) introduced in chapter 2. This controller can not work independently since there are only three torques as inputs but four variables of engines have to be controlled. Nevertheless, it is possible to use some nominal value for the remaining degree-of-freedom. 2. Position tracking controller will yield the desired attitude Rd that the aircraft must track in order to follow a predefined trajectory in three-dimensional space, and a thrust magnitude value. Rd is fed into attitude tracking controller, while thrust magnitude is given directly to calculate engines’ RPM by the equation (2.22) introduced in chapter 2. For both sub-problems, we will use Lyapunov direct method to design the control laws.

3.4.1

Attitude tracking

Let us denote R the rotation matrix which represents current aircraft’s attitude and Rd the attitude we desire to track. We start with a slightly different Lyapunov candidate function than [32]. 1 1 V1 = (kr + kΩ )Ψ + eΩ · eΩ + eR · eΩ + eR · eR 2 2 Define the local subspace W ⊂ R3 × R3 such that

(3.27)

∀(eR , eΩ ) ∈ W, ||eR || < 1 The condition is equivalent to a space of possible attitudes such that a direct rotation from R to Rd can be performed around some axis with an angle less than π. Recall that this condition is necessary to keep (eR , eΩ , Ψ) meaningful as the exponential map is injective. If we can prove (eRe = eΩe ) = (0, 0) is an asymptotic stable equilibrium of system, the attitude control law will drive our aircraft attitude to any desired one within W. Proposition 3.41 (Positive definiteness of V1 ) With kr , kΩ > 0, the Lyapunov candidate function V1 is positive definite in W. Proof. Since 1 1 V1 ≥ (kr + kΩ )Ψ + ||eΩ ||2 + ||eR ||2 − ||eR ||||eΩ || 2 2 54

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL V1 ≥ (kr + kΩ )Ψ +

1 (||eR || − ||eΩ ||)2 2

Becayse Ψ is positive definite,  min

1 (||eR || − ||eΩ ||)2 2

 =0

Because kr + kΩ > 0, V1 = 0 ⇔ Ψ = 0 ∧ ||eR || = ||eΩ ||. Note that Ψ = 0 ⇔ R = Rd and by definition of eR in (3.16), it is evident that ||eR || = ||eΩ || = 0. Otherwise, V1 > 0. Proposition 3.42 (Asymptotic stability of attitude tracking) Given kΩ > 1, kr (kΩ − 1) > 1/4 and a control law that yields e˙Ω = −kr eR − kΩ eΩ , the errors eR and eΩ converge to zero. Proof. Let us take time-derivative of V1 with respect to (3.17) and (3.20): V˙1 = (kr + kΩ )er · eΩ + eΩ · e˙Ω + CeΩ · eΩ + eR · e˙Ω + eR · CeΩ By substituting e˙Ω = −kr eR − kΩ eΩ : V˙1 = (kr + kΩ )eR · eΩ + (eΩ + eR )(−kr eR − kΩ eΩ ) + CeΩ · eΩ + eR · CeΩ V˙1 = −kr eR · eR − kΩ eΩ · eΩ + CeΩ · eΩ + eR · CeΩ

(3.28)

By Proposition 3.31 and scalar product property: V˙1 ≤ −kΩ ||eΩ ||2 − kr ||eR ||2 + ||eΩ ||2 + ||eR ||||eΩ || V˙1 ≤ −((kΩ − 1)||eΩ ||2 + kr ||eR ||2 − ||eR ||||eΩ ||) The right hand side can be rewritten as −z1T W1 z1 with z1 = [||eΩ ||, ||eR ||]T . The necessary condition for V˙1 to be negative definite is positive definite W1 :   kΩ − 1 − 21 W1 = (3.29) − 12 kr Which yields: kΩ > 1, kr (kΩ − 1) > 1/4

(3.30)

It is noteworthy that this approach requires Ψ = 1 − cosθ < 2 because otherwise, our calculations will fail since we base all of our error functions on the exponential map. This would imply some initial conditions on the system which will be presented as following. Proposition 3.43 (Boundedness of Ψ in attitude tracking) The attitude tracking law presented in 3.42 yields an invariant set of Ψ < 2 if the initial angular velocity error satisfies the following inequality: 1 ||eΩ (0)||2 ≤ 2kr − kr Ψ(0) 2

55

(3.31)

3.4. DERIVATION OF CONTROL LAWS FOR QUADROTOR Proof. Using the same approach as in [32], let us propose a secondary Lyapunov candidate function: 1 (3.32) V2 = eΩ · eΩ + kr Ψ 2 By taking time-derivative and substitute for the control law that yields e˙Ω = −kr eR − kΩ eΩ , we get: V˙2 = eΩ · (−kr eR − kΩ eΩ ) + kr er · eΩ V˙2 = −kΩ ||eΩ ||2 ≤ 0 Which infers that V2 (t) ≤ V2 (0) = V2 (t = 0). We have: 1 V2 (0) = ||eΩ (0)||2 + kr Ψ(0) 2 To make Ψ bounded by 2 (since Ψ = 2 is where the exponential map fails to be injective), we define an additional initial condition for a domain P0 such that: 1 ||eΩ (0)||2 ≤ 2kr − kr Ψ(0) 2

(3.33)

With respect to P0 , V2 (0) ≤ 2kr − kr Ψ(0) + kr Ψ(0) = 2kr so kr Ψ ≤ V2 (t) ≤ V2 (0) ⇒ kr Ψ ≤ 1/2||eΩ ||2 + kr Ψ ≤ 2kr . Finally: Ψ 0 and kv > c1 /m. However, we can not realise such control law that yields e˙v = −kx ex − kv ev . The reason for this is that our quadrotor is an under-actuated system because we have four inputs corresponding to four rotors, but have to control six degrees-of-freedom in threedimensional space. Since we have already used three for attitude control (torques), the remaining degree-of-freedom is reserved for designating the total thrust magnitude. In other words, we are only left with a scalar R value while the above equation requires us to have control over a R3 vector, since e˙v has three components x, y, z. This is the reason why we can not freely decouple attitude and position control. Intuitively for a quadrotor, we can not have the airplane tilted to the left and fly to the right at same time. However, since we have designed a control law capable of exponentially bringing the aircraft to any desired attitude, we may rotate the thrust vector to any direction we want. Imagine a scenario that we can directly manipulate the thrust vector in both direction and magnitude. Then equation (3.47) hints at the desired thrust vector that the aircraft needs to take: e˙v = v˙ − v˙d = −kx ex − kv ev v˙ = −kx ex − kv ev + v˙d mv˙ = −mkx ex − mkv ev + mv˙d = mge3 − fc Rc e3 fc Rc e3 = mge3 + mkx ex + mkv ev − mv˙d

(3.48)

In this equation, f ∈ R is the thrust magnitude, while −Rc e3 ∈ R3 is thrust direction written in inertial frame which corresponds to −ez , a unit vector that points upward in the z direction of body frame. 60

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL

Figure 3.5: A quadrotor intercepting a desired trajectory

Since an attitude can be presented by an orthonormal basis of the body frame which takes three vectors, one equals to cross-product of the other two, we are left with two vectors. One of which is the thrust direction, while the remaining vector can be freely chosen. This is the yaw angle ψ of the path which we have to explicitly define for the entire trajectory. In short, the aircraft may fly with rotor 1, 2, 3, 4 or any direction in between facing the forward direction. This process effectively creates a desired attitude Rc to be fed into the attitude controller presented earlier. The thrust magnitude of (3.47) can be found by taking the scalar product of (3.48): fc Rc e3 · Rc e3 = fc ||Rc e3 || = fc because Rc e3 is just rotation of a unit vector from body to inertial frame. We have already proven that rotation is an isometric transformation and does not alter length of the original vector. fc = (mge3 + mkx ex + mkv ev − mv˙d ) · Rc e3 = eT3 RcT (mge3 + mkx ex + mkv ev − mv˙d )

(3.49)

Position control synthesis Although we can manipulate the airplane attitude and hence the thrust vector, the process takes time and is not perfect. There will be additional disturbances that prevents the aircraft from precisely tracking Rc . In such case, we would like to examine if ex and ev can still converge if the aircraft’s true attitude R ”approximates” Rc . In this derivation, we follow the same approach as in [32], but with a slightly different Lyapunov candidate function V4 , along with several reorganisations to reveal better overall picture and make the proof felt more natural. V4 is slightly different than one presented in [32], notably about the coefficients of |ex ||2 to further reduce the interdependence of kx and kv from error ||ex ||||ev ||. Moreover, our approach requires to preselect a ”region of tracking” α0 before deciding on kx , kv , which is the maximum angle between thrust vectors that position tracking still 61

3.4. DERIVATION OF CONTROL LAWS FOR QUADROTOR remains effective. If α0 is chosen too large, it requires large values of kx and kv which make the system tend to oscillate and more susceptible to noise and parameters inaccuracy. Typically we choose α0 around 30o for reasonable values of kx and kv . 1 m ||ev ||2 + V4 = 2 − 2α0 2



 m c1 c1 kx + kv ||ex ||2 + ex · ev 1 − α0 1 − α0 1 − α0

(3.50)

With a proper choice of c1 and α0 , the following proposition is true which we will state without proving the sufficient condition since these are the parameters that can be found with trial-and-error easily. Proposition 3.47 (Positive definiteness of the V4 Lyapunov candidate) It is possible to choose c1 and α0 such that the following matrix is positive definite.  mkx +c1 kv c1  1−α 2−2α 0 0 M2 = c1 m 2−2α0

2−2α0

We know that if attitude error is zero, the thrust magnitude is given in (3.49). However, in case of present error we could multiply this term with a coefficient γ: f = γfc = γ(mge3 + mkx ex + mkv ev − mv˙d ) · Re3

(3.51)

Note the second position of the scalar product is now R instead of Rc . This can be understood as a projection of desired thrust onto the current thrust vector, scaled by γ. Intuitively, γ should be a function that depends on attitude error and equals 1 when the error is zero. We can generalise this conversation via the following proposition that quantifies the angular difference between current and desired thrust vector. Proposition 3.48 (Angular difference boundedness of thrust vectors) Given attitudes R and Rd corresponding to current desired thrust vector direction. Given the following condition: ||f Re3 || = cosα||fc Rc e3 ||

(3.52)

in which, f, fc denote the thrust magnitude correspond to thrust vector −Re3 , −Rc e3 of attitude R and Rc respectively and α represents the angular difference between thrust vectors. If (3.52) is satisfied then the following entity is bounded by ||eR ||: ||Rc e3 − cosαRe3 || ≤ ||eR ||

(3.53)

Proof. Using the law of cosines from fundamental geometry (Figure 3.6), we yield the following equation from (3.51): ||Rc e3 − γRe3 ||2 = ||Rc e3 ||2 + γ 2 ||Re3 ||2 − 2γ||Re3 ||||Rc e3 || = 1 + γ 2 − 2γ cos α 62

(3.54)

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL

Figure 3.6: Relationship between thrust vectors

Since ||eR || quantifies attitude error, the term γ should be comparable to ||eR || = sinθ. It is then straightforward to see that γ can be chosen to be cosα: ||Rc e3 − γRe3 ||2 = sin2 α ≤ sin2 θ = ||eR ||2 Or: ||Rc e3 − γRe3 || ≤ ||eR ||

(3.55)

The importance of the term ||Rc e3 − cosαRe3 || will be described later. We can now formally state the asymptotic stability of (ex , ev ) = (0, 0) by the following proposition: Proposition 3.49 (Asymptotic stability of position tracking) With the attitude tracking controller tracks the thrust direction given by fc Rc e3 mge3 + mkx ex + mkv ev − mv˙d = ||fc Rc e3 || ||mge3 + mkx ex + mkv ev − mv˙d || and thrust magnitude given by f = cosα(mge3 + mkx ex + mkv ev − mv˙d ) · Re3 then in some region R of states (defined in proof) , ex and ev converge to zero. Proof. With respect to domain Q0 , we take time derivative of V4 :   m m c1 c1 c1 ˙ V4 = ev · e˙v + kx + kv ex · ev + ev · ev + ex · e˙v 1 − α0 1 − α0 1 − α0 1 − α0 1 − α0     m c m c c1 1 1 ev + ex · e˙v + kx + kv ex ·ev + ev ·ev (3.56) V˙4 = 1 − α0 1 − α0 1 − α0 1 − α0 1 − α0 We have: me˙v = m(v˙ − v˙d ) = mv˙ − mv˙d me˙v = (mge3 − f Re3 ) − mv˙d 63

3.4. DERIVATION OF CONTROL LAWS FOR QUADROTOR Our intention is to obtain two terms. One represents the ”ideal” thrust vector fc Rc e3 to bring in error feedback terms (−kx ex − kv ev ) while the other characterises deviation of our current thrust vector from the ideal one. This is achieved by adding and subtracting the term fc Rc e3 : me˙v = mge3 − fc Rc e3 + fc Rc e3 − f Re3 − mv˙d From (3.48), it can be inferred that: me˙v = mge3 − mge3 − mkx ex − mkv ev + mv˙d + (fc Rc e3 − f Re3 ) − mv˙d = −mkx ex − mkv ev + (fc Rc e3 − f Re3 ) Note the term in parentheses is the ”deviation from ideal” term. Certainly, it will have to depend on attitude error. Replace γ in (3.51) with cosα for the reason we have mentioned in the proof of Proposition 3.48: fc Rc e3 − f Re3 = fc (Rc e3 − cosαRe3 ) ||fc Rc e3 − f Re3 || = ||fc ||||Rc e3 − cosαRe3 || with

||fc || = ||kx ex + kv ev − v˙d + ge3 || m Using Cauchy-Schwarz inequality: ||fc || ≤ kx ||ex || + kv ||ev || + ||v˙d − ge3 || m Let us denote B = ||v˙d −ge3 ||. An additional condition imposed upon desired trajectory is: Y : B < Bmax By Proposition 3.48: ||Rc e3 − cosαRe3 || ≤ ||eR || < α0

(3.57)

Finally: e˙v = −kx ex − kv ev + (kx ||ex || + kv ||ev || + B) Return to equation (3.56), replacing e˙v with the expression above: c1 k x c1 kx α0 mkv α0 c1 mkv ||ev ||2 − ||ex ||2 + ||ex ||2 + ||ev ||2 + ||ev ||2 V˙4 = − 1 − α0 1 − α0 1 − α0 1 − α0 1 − α0   mkx c1 kv + + ||ex ||||ev ||||eR || 1 − α0 1 − α0   m c1 + ev + ex · B(Rc e3 − cosαRe3 ) 1 − α0 1 − α0 (3.58) On expansion of the expression above, the terms that contain α0 in the numerator can also be bounded with ||eR || instead of α0 (3.57). In that case, the terms containing third-order error like ||ex ||2 ||eR || make the analysis very difficult. It is easier to bound them to α0 and collect them along with other ||ex ||2 or ||ev ||2 terms. However, if 64

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL we try to do the same trick with the ||ex ||||ev ||||eR || term, it ends up carrying the interdependence between kx and kv to prevent effective choice of these parameters to ensure negative definiteness of V˙4 . One way to circumvent this dilemma is to divide the ||ex ||||ev ||||eR || term into two smaller ones, each involves kx and kv separately like below. Then we can bound one by α0 and the other by ||eR ||. The former may join other ||ex ||2 and ||ev ||2 terms such that their quadratic form is negative definite while the latter reflects coupling between position and attitude control we have discussed earlier. If we define another condition as: K : ||ex || < ||ex ||max then with respect to K, the separation can be realised as: 

c1 kv mkx + 1 − α0 1 − α0

 ||ex ||||ev ||||eR || ≤

c1 k v α 0 mkx ||ex ||||ev || + ||ex ||max ||ev ||||eR || 1 − α0 1 − α0 (3.59)

We also have: 

 m c1 ev + ex · B(Rc e3 − cosαRe3 ) 1 − α0 1 − α0   m c1 ≤ ||ev || + ||ex || Bmax ||eR || 1 − α0 1 − α0

(3.60)

The joint Lyapunov candidate function for both attitude and position tracking is: V = V1 + V4

(3.61)

is positive definite if V1 and V4 is positive definite. Taking time derivative: V˙ = V˙1 + V˙4 = −z1T W1 z1 + z1T WT z2 − z2T W2 z2 with W1 already defined in (3.29). From (3.58) and (3.59):   1 kv α0 c1 kx − c2−2α 0 W2 = 1 kv α0 − c2−2α mkv − c1 0

(3.62)

(3.63)

From (3.58), (3.59) and (3.60):   1 0 c1 Bmax WT = 1 − α0 0 mBmax + mkx ||ex ||max

(3.64)

The sufficient condition for V˙ to be negative definite is: min(eig(W2 )) >

4||WT ||2 min(eig(W1 ))

(3.65)

along with R = Y, Q0 , K conditions which govern the effective converging region. The notation || · ||2 denotes the Frobenius norm and is defined as: sX ||A||2 = ||aij ||2 , A = [aij ] i,j

65

3.4. DERIVATION OF CONTROL LAWS FOR QUADROTOR Although we follow the same approach as in [32], our choice of Lyapunov candidate relaxes the condition imposed upon W2 and allows wider range of possible values for kx and kv . Similar to attitude tracking, the position tracking law given in Proposition 3.49 isolates mass of aircraft m from derivation of the control law but there is no advantage in doing this compared to attitude tracking. The following proposition (omitted in original papers due to simplicity) reveals that position tracking can give exponential convergence of errors. Proposition 3.50 (Exponential convergence of position tracking) Given the position control law of Proposition 3.49, the errors ex and ev exponentially converge to zero. Proof. With respect to the conditions implied in Proposition 3.49’s proof, the errors are bounded during the entire position correction process. Moreover, there is only one exotic term Ψ which has also been bounded to ||eR ||. We observe that: V = z1T M1 z1 + z2T M2 z2 and V˙ ≤ −z1T W1 z1 − z2T W2 z2 + z1T ||WT ||2 z2 We can define an aggregate error vector for both tracking modes as: S = [z1 , z2 ]T Thus:

  M1 0 V =S S = ST MS 0 M2 T

while V˙ ≤ ST



W1 1 ||WT ||2 2

1 ||WT ||2 2

W2



S = ST NS

Under (3.65), it is apparent if we define: Γ=

min(eig(N)) max(eig(M))

Then V˙ ≤ −ΓV Given that V is uniformly bounded by S, we conclude that the law in Proposition 3.49 drives error states S exponentially to zero. We wrap up this chapter with a final complementary proposition to the original papers about robustness-type result. Definition 3.51 A continuous function α1 : [0, a) → [0, ∞) belongs to class K if it is strictly increasing and α1 (0) = 0. Moreover, α2 belongs to class K∞ and α2 (r) → ∞ as r → ∞ [25]. 66

CHAPTER 3. THE GEOMETRIC NONLINEAR CONTROL Definition 3.52 (Input to state stability [25] ) The system x˙ = f (t, x, d) is said to be input-to-state stable (ISS) if there exists a class KL function β and a class K function γ such that for any intial state x(t0 ) and any bounded input d(t), the solution x(t) exists for all t ≥ t0 and ! ||x(t)|| ≤ β(||x(t0 )||, t − t0 ) + γ

sup ||d(τ )|| τ ∈[t0 ,t]

Theorem 3.53 (ISS Lyapunov [25] ) Let V : [0, ∞) × Rn → Rn be a continuously differentiable function that: α1 (||x||) ≤ V (t, x) ≤ α2 (||x||) and

∂V ∂V + f (t, x, d) ≤ −W (x), ∀||x|| ≥ ρ(||d||) > 0 ∂t ∂x for all (t, x, d) ∈ [0, ∞) × Rn × Rn where α1 , α2 are class K∞ functions, ρ is a class K functioon and W is a continuous positive definite function on Rn . The the system is ISS with γ = α−1 ◦ α2 ◦ ρ. We return to the secondary moments (2.13) introduced in chapter 2 and lump them together into a variation of input torque. We would like to know in presence of such pertubation, is it still possible for the origin to remain stable. The attitude control is important [22] so we only focus on this particular controller. Proposition 3.54 (ISS of geometric attitude controller ) The attitude tracking controller is ISS. Proof. Consider the same Lyapunov function V1 but the input is pertubed by a term d. From (3.28), we yield: V˙1 ≤ −kr ||eR ||2 − (kΩ − 1)||eΩ ||2 + ||eR ||||eΩ || + (eΩ + eR ) · d

(3.66)

Using Cauchy-Schwarz inequality: V˙1 ≤ −kr ||eR ||2 − (kΩ − 1)||eΩ ||2 + ||eR ||||eΩ || + ||eR ||||d|| + ||eΩ ||||d||     k 2||d|| k − 1 2||d|| k r r Ω 2 2 2 − ||eΩ || 1 − +||eR ||||eΩ || V˙1 = − ||eR || − ||eR || 1 − 2 2 kr ||eR || 2 (kΩ − 1)||eΩ || For all ||eR ||, ||eΩ ||:  min(||eR ||, ||eΩ ) > min

 2 2 ||d||, ||d|| kr ||eR || (kΩ − 1)||eΩ ||

Because

2 2 , kr ||eR || (kΩ − 1)||eΩ || is of class K, the proof is completed. 67

Chapter 4 Implementation of the geometric control At the moment of writing, there are some papers briefly mention this novel controller like [37] and [57]. However, we have lots of difficulty in finding a detailed implementation of this controller in numerical software such as MATLAB/Simulink to verify the validity, thus such model has to be built from scratch. In this chapter, we propose a complete digital simulation using basic blocks supplied with default MATLAB/Simulink packages. We also mention some techniques to improve the stability of the model.

4.1

The NLGC Toolbox

To increase the versatility of model, we decompose the entire simulation project into many modules that can be reused in different contexts. These modules are organised into a Simulink library for easy access via Simulink’s Library Browser (figure 4.1). Figure 4.2 shows the main components of the toolbox. It includes: 1. A quadrotor dynamics model built upon 6DOF Euler block from MathWorks’ Aerospace Blockset provided in MATLAB/Simulink setup packages. 2. A motor command block that mixes the signals coming from attitude and position controller to yield desired rotor speed for each engine. 3. A motor control block that close the control loop for rotor speed (approximated as a first order transfer function) . 4. An attitude control synthesis that commands desired moment to the motor command block. 5. A flight director synthesis that takes a flight trajectory and yield desired attitude for the attitude control synthesis, along with thrust magnitude for the motor command block. 6. Several utility blocks to convert between rotation matrices, Tait-Bryan angles and calculate various error for feedback signal. 68

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.1: The toolbox in Simulink Library Browser

Figure 4.2: The NLGC Toolbox

69

4.2. BUS CONVENTIONS AND VARIABLE TUNNELLING 7. An omega estimator that yields angular rates in body frame, given the evolution of attitude rotation matrix with time. The following sections will introduce the basic principles of these blocks. For detailed implementation, please consult the full model attached to this thesis [58].

4.2

Bus conventions and variable tunnelling

We use buses for better organisation of signals throughout the entire simulation model. For convenience, the following conventions are laid out: • Cyan bus, often coloured cyan in submodels (figure 4.3). These are the standard basic outputs of the blocks that can be obtained either directly or via some estimation technique. All feedback control signals must originate from a Cyan bus. Some examples are Tait-Bryan angles, angular rates, rotation matrix denoting aircraft’s attitude... • Magenta bus, often coloured magenta in submodels (figure 4.4). These variables are useful for debugging, verifying or displaying outputs of the controlled system. Some examples include commanding force or moment amplitude of the controller or the amount of thrust being generated by engines...

Figure 4.3: Some Cyan sinks that di-Figure 4.4: Some Magenta sinks that rect signal to a Cyan bus direct signal to a Magenta bus Another technique that we frequently use is to ”tunnel” some variables, usually of Cyan bus to a global variable that can be accessed everywhere, even in submodels. These variables are very frequently used but the action of taking the signal out of the bus or creating input ports may clutter up the model, prevent seeing the overall picture. In our case, the rotation matrix DCMbe is tunnelled globally, along with the entire aircraft states. In Simulink, we use the ”Goto” and ”From” blocks to perform tunnelling, with scope set to global (figure 4.5).

4.3

The aircraft model

The general dynamics equations for an aircraft is given in (2.14), which is a generic case of a six degrees-of-freedom object moving in three-dimensional space under effect 70

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.5: A rotation matrix being tunnelled globally

of forces and moments. We have already discussed various parametrisation of aircraft’s attitude by either using Euler angles, quaternion or axis-angle representation. In this simulation, we specifically use the Tait-Bryan angles for easier interpretation of results, thus R can be parametrised by [ψ, θ, φ] - the yaw, pitch and roll angle corresponding to ZY X rotation order. As a consequence of the gimbal lock problem, we try to avoid manoeuvres that yield θ close to 90o . In Simulink, the model is taken from the 6DOF airplane block with Euler representation taken directly from the Aerospace Blockset supplied with the software. The thrust and moment components are added directly to the model according to (2.15) and (2.22). As said earlier, we neglect secondary forces and moments, but it is possible to be add them in terms of perturbations. For convenience, we define the entire quadrotor parameters in a workspace variable struct called quad. The struct contains the following fields: 1. J: moment of inertia matrix. If the quadrotor is perfectly symmetrical, J is a diagonal matrix. The unit is kgm2 . 2. m: total mass of the quadrotor, placed at the origin of body frame. The unit is kg. 3. g: gravitational acceleration. On near Earth surface, it is equal to 9.81m/s2 . 4. ct: thrust coefficient cT in equation (2.22). It is obtained from experiment on the propeller and motor set. The unit is N s2 . 5. cq: torque coefficient cQ in equation (2.22). It is also obtained from experiment on the propeller and motor set. The unit is N ms2 . 6. d: length of quadrotor’s arm, measured from centre of gravity to propeller’s mount point. The unit is m. 7. dctcq: the last three rows of (2.22), for convenience. The complete Quadrotor Dynamics Model is shown in figure 4.6. Table 4.1 summarises the inputs and outputs of the 6DOF Airplane block. Note that because the expression of total force presented in (2.15) is written with respect to inertial frame, we need to convert it to body frame: Fi = mge3 − f Reb e3 71

4.4. MOTOR COMMAND BLOCK

Figure 4.6: Quadrotor Dynamics Model

Multiply both sides with Rbe : Fb = Rbe Fi = mgRbe e3 − f Rbe Reb e3 −1 Because Rbe Reb = Reb Reb = I:

Fb = mgRbe e3 − f e3 = mgDCMbe e3 − f The block is configured with zero initial velocity and attitude. We also set initial position to another mask parameter called xinit which can be changed from simulation to simulation (figure 4.8). The quadrotor mass and moment of inertia is taken directly from the struct quad defined in workspace (figure 4.7). The engine thrust block converts rotors speed to thrust magnitude and moment. Basically this is just a MATLAB function block corresponding to (2.22). The inputs and outputs are given in Table 4.2. Since calculations of this block are made on both very large and very small numbers, numerical error can cause the system to destabilise even in perfect condition. To prevent this, we round the output signals (f, M) up to 10−6 by the function: y = round(x*10e6)/10e6. The full implementation can be found in the code base presented in [58].

4.4

Motor command block

This block is very simple. What it does is basically inverse of the Engine Thrust block introduced earlier (figure 4.9). However, it will add some saturations about the 72

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL Table 4.1: Inputs and outputs of the 6DOF Euler block [59] Type Input

Notation Fxyz

Input

Mxyz

Output

Ve

Output

Xe

Output Output

φθψ DCMbe

Output

Vb

Output

ωb

Output

dωb /dt

Output

Abb

Description Total force acting on the aircraft (thrust, weight, pertubations...) in body frame Moment acting on aircraft (rotor thrust) in body frame Translational velocity in inertial frame Translational position in inertial frame Tait-Bryan Angles Direct Cosine Matrix or Rotation Matrix from inertial to body frame Translational velocity in body frame (U, V, W ) Angular rates measured in body frame (or from sensors): ωb = [ωx , ωy , ωz ]T Angular accelerations measured in body frame (or from sensors) Translational acceleration measured in body frame (or from sensors)

Set R3

Unit N

R3

Nm

R3

m/s

R3

m

R3 SO(3) ⊂ GL(3, R)

rad 13×3

R3

m/s

R3

rad/s

R3

rad/s2

R3

m/s2

Table 4.2: Inputs and outputs of the Engine Thrust block Type Input Output Output

Notation o1, o2, o3, o4 f M

Description Rotor speed of engine 1, 2, 3, 4 Thrust magnitude f Moment τ

Set R+

Unit RPM - 1/s

R+ R3

N Nm

limit points of motors to prevent negative or exceedingly large values of RPMs which constitute an unrealistic scenario. A MATLAB function is used to calculate the inverse of (2.22). Since the determinant of the square matrix in (2.22) is different than zero, the inverse is always successful but does not guarantee that the result of this process is all-positive to take root of. If one value is negative, the Motor Control Block will set it to the lowest possible level - in our case, zero. The rotor rotation speed also saturates at some maximum RPMs defined by the engine manufacturer. Note that we have set the transfer function of engines to 1. By modifying this block, we can add various dynamics to the system. The inputs and outputs of this block are presented in Table 4.3. 73

4.5. ANGULAR RATES ESTIMATOR

Figure 4.7: Parametric setup of 6DOFFigure 4.8: Masked parametres of the Euler block Quadrotor Dynamics Block Table 4.3: Inputs and outputs of the Motor control block Type Input

Notation f

Input Output

M o1, o2, o3, o4

4.5

Description Commanded thurst magnitude Commanded moment Commanded rotor speed

Set R

Unit N

R3 R

Nm RPM - 1/s

Angular rates estimator

This block takes a rotation matrix and yields angular rates with respect to body frame digitally. In reality, we do not need this block because data can be directly obtained from an IMU sensor on-board. Although it is possible to get angular rates Ωb from the 6DOF Euler block introduced earlier via the Cyan bus, toolboxes other than Aerospace Blockset (e.g. Robotics Toolbox [60], QuadSim [39] . . . ) may not supply us with this data. Our goal was to create a versatile blockset that can be used with almost any other library so that we can quickly integrate our controller to compare performance. Another motivation comes from estimation of desired angular rates, which is yielded from the flight director synthesis block. Since we only have desired attitude as input, the only approach is to take multiple ”time-derivations” of Tait-Bryan angles. Structure of the angular rates estimator is presented in figure 4.10. The Rate Transition block samples the rotation matrix signals at f = 50Hz or periodically every Ts = 1/50 = 0.02s. The delay block stores the signal of the previous sample, so the MATLAB Function Omega Estimator can have two rotation matrices at kT and 74

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.9: The motor control block

Figure 4.10: Omega estimator block

(k − 1)T available to take finite difference as an approximation of derivative. Here we have several approaches. The first arises naturally from the desire to keep every modules of the geometric control from dependent on a particular coordinate representation like Euler angles or quaternion. A side advantage of this approach also lie in the capability to alleviate the gimbal lock problem introduced earlier. Recall from (2.14) that: R˙ = Rsk(ω) However we can not take: R(kT ) − R((k − 1)T ) R˙ ≈ ∆R = T ˙ Because if we try to reconstruct the rotation matrix R(kT ) from R: R(kT ) = R((k − 1)T ) + ∆RT 75

(4.1)

4.5. ANGULAR RATES ESTIMATOR ˙ thus destroying the orthogonality of R(kT ). A better ∆R is not exactly equal to R, approach is to use Logarithm mapping and Lie algebra. Given R((k − 1)T ) = R1 and R(kT ) = R2 , we already know R∆ = R1T R2 ∈ SO(3) is a rotation that takes R1 to R2 : R1 (R1T R2 ) = (R1 R1T )R2 = R2 This is made possible due to the associativity of the group (matrix) multiplication operator. Being an element of SO(3), there is a corresponding vector a ∈ so3 at the tangent space of identity element, which, through an exponential mapping will take a to R∆ . We also know that a is the axis-angle representation of the rotation matrix. The idea is that if we have a, we have the angle α and eigenaxis K around which the body frame is rotating during ∆t = ((k − 1)T, kT ). Assuming angular rates are constant in such tiny period of time, the angle whose nature is just a real number, can be approximated by the finite difference identity: α˙ ≈

α2 − α1 ∆t

If we project K onto orthonormal axes of the body frame and then multiply by α˙ (i.e. Kx α, ˙ Ky α, ˙ Kz α), ˙ it gives us a sense of how fast the rotation is happening with respect to each individual axis. This is the true definition of angular rates. We formalise the above discussion with the following proposition: Proposition 4.1 (Coordinate independent angular rates estimation) Given two rotation matrices R1 and R2 ∈ SO(3). If R2 is obtained via a constant angular rates rotation from R1 during a duration T , the angular rates can be obtained through the following process: 1. Calculate R = R1T R2 . 2. Calculate θ, K via the expression given in (3.4) and (3.5). 3. Calculate

θ θ˙ = T

4. Calculate Kx = R2 KeT1 , Ky = R2 KeT2 , Kz = R2 KeT3 with e1 = [1, 0, 0]T , e2 = [0, 1, 0]T , e3 = [0, 0, 1]T . ˙ Ky θ, ˙ Kz θ] ˙ T in R2 ’s basis. 5. The angular rates are then ω = [Kx θ, Through simulations, we get a very disappointing result with this approach mainly because estimated θ is very small so sin(θ) ≈ 0. K yielded from equation (3.5) is too inaccurate to be useful leaving us no choice but to settle for the classical approach which is coordinate-dependent. The rotation matrix is converted to Tait-Bryan angles, then approximated with time difference as derivative. The angular rates are then calculated by equation (2.3). If quaternion representation is used, the formula for estimation will have to change accordingly. In reality, we can use the a similar approach with the estimated Tait-Bryan angles from the filters. However, we believe some filtering applied directly to the gyroscope 76

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.11: Realisation of the translational position error block

output data will provide us with a higher quality reading of the angular rates while lower the computation cost. We wrap up this section with a summary about input and output data types for the angular rates estimation block in Table 4.4. Table 4.4: Inputs and outputs of the angular rates estimator block Type Input

Notation Reb

Output

Ob

4.6

Description Rotation matrix from body to inertial frame Angular rates with respect to body frame

Set SO(3) ⊂ GL(3, R) R3

Unit 13×3 rad/s2

Translational position error

This block is very straight forward to implement (figure 4.11) since we have defined: e x = x − xd ∈ R 3 with x, xd the current position and desired position of aircraft in inertial frame respectively. The input and output of this block is summarised in Table 4.5. Table 4.5: Inputs and outputs of the translational position error block Type Input Input Output

Notation Current Position Desired Position ex

Description Current translational position of aircraft’s centre of gravity Desired translational position of aircraft’s centre of gravity Translational position error

77

Set R3

Unit m

R3

m

R3

m

4.7. TRANSLATIONAL VELOCITY ERROR

Figure 4.12: Realisation of the translational velocity error block

4.7

Translational velocity error

This block is also very straight forward to implement (figure 4.12) since we have defined: ev = v − vd ∈ R3 with v, vd the current position and desired position of aircraft in inertial frame respectively. The input and output of this block is summarised in Table 4.6. Table 4.6: Inputs and outputs of the translational velocity error block Type Input Input Output

4.8

Notation Current Velocity Desired Velocity ev

Description Current translational velocity of aircraft’s centre of gravity Desired translational velocity of aircraft’s centre of gravity Translational velocity error

Set R3

Unit m/s

R3

m/s

R3

m/s

Attitude error block

The attitude error block yields eR from (3.16):  1 eR = sk −1 RdT R − RT Rd 2 where Rd , R denote the desired and current rotation matrix (attitude) respectively. The inverse of skew-symmetric mapping is defined as: sk −1 : R3×3 → R3     0 −x3 x2 x1  x3   0 −x1 |→ x2  x3 −x2 x1 0 In short:

  A32 −1  sk (A) = A13  A21 78

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.13: Realisation of the Attitude Error block

This is realised by a MATLAB Function called Att Error Calculator in figure 4.13. Table 4.7 summarises all inputs and outputs of the attitude error block. Table 4.7: Inputs and outputs of the attitude error block Type Input

Notation R

Input

Rd

Output

er

4.9

Description Current attitude matrix from body frame) R Desired attitude matrix from body frame) Rd Attitude error eR

(rotation to inertial (rotation to inertial

Set SO(3)

Unit 13×3

SO(3)

13×3

R3

1

Angular rates error block

This block (figure 4.14) yields eΩ from equation (3.15): eΩ = Ω − RT Rd Ωd which Ω is the angular rates written in body frame, R, Rd are current and desired attitude respectively. Ωd is the desired angular rates of Rd . Table 4.8 summarises all inputs and outputs for this block.

4.10

Attitude control synthesis block

This is one of two key blocks of the entire library which generates commanded torque signal for the Engine Command block. Although the derivation of the control law (3.39) seems complicated, implementation is quite easy. Figure 4.15 demonstrates the attitude controller’s structure. The main controller is the dark-shaded block named ”Attitude Controller” which is a MATLAB Function 79

4.10. ATTITUDE CONTROL SYNTHESIS BLOCK

Figure 4.14: Realisation of the angular rates error block

Figure 4.15: Realsiation of the attitude control synthesis block

80

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL Table 4.8: Inputs and outputs of the angular velocity error block Type Input

Notation R

Input

DesiredR

Input Input

Omega Desired Omega eo

Output

Description Current attitude (rotation matrix from body to inertial frame) R Desired attitude (rotation matrix from body to inertial frame) Rd Current angular rates of R Desired angular rates of Rd in body frame Angular rates error eΩ

Set SO(3)

Unit 13×3

SO(3)

13×3

R3 R3

rad/s rad/s

R3

rad/s

implementing (3.39). The controller needs to be fed with some physical parameters of the quadrotor such as moment of inertia matrix defined in the quad variable workspace earlier. The angular rates are interpreted from rotation matrices using the Omega Estimator blocks running at 50Hz. The desired angular accelerations Odb may contain some discontinuities thus resulting in very high-amplitude ”spikes” that may destabilise the system. We equip the input of Odb with a saturation that limits the maximum and minimum of the values in a reasonable interval. Some calculated signals such as ||eR || are directed to Magenta bus for plotting and later analysis. The attitude and angular rates errors are delivered from the blocks presented above. We also make use of Subsystem Mask (figure 4.16) for easier entry of controller gains such as kr , kΩ , the sampling time we desire. Since IMU operates at 50Hz, it is recommended that this controller operate at the same rate. Table 4.9 summarises the inputs and outputs of this synthesis block. Table 4.9: Inputs and outputs of the attitude control synthesis block Type Input

Notation Reb

Input

Reb*

Input

Ob*

Input

Odb*

Input Output

J Moment

Description Current attitude (rotation matrix from body to inertial frame) R Desired attitude (rotation matrix from body to inertial frame) Rd Desired angular rates of Rd

Desired angular accelerations of Rd Moment of inertia matrix Commanded torque

81

Set SO(3)

Unit 13×3

SO(3)

13×3

R3 written in body frame R3

rad/s

R3×3 R3

kgm2 Nm

rad/s2

4.11. FLIGHT DIRECTOR SYNTHESIS BLOCK

Figure 4.16: Mask parameters of the attitude control synthesis block

4.11

Flight director synthesis block

Of all the blocks introduced, this block is most complicated. To enable trajectory tracking, the path is defined as workspace variables t, x, y, z, ψ. These variables are stored as vector-type and must share the same length. Table 4.10 denotes a valid albeit simple flight trajectory.

Table 4.10: A simple flight path/trajectory t(s) 0 5 10 ...

x(m) 0 1 2

y(m) 0 1 -1

z(m) 0 1 4

ψ(rad) 0 0 0

We see that there is a ψ column that denotes the yaw angle i.e. the angle between direction of flying and the line connecting aircraft’s centre of gravity and rotor 1’s propeller mount. In the example, ψ is set to zero vector. If we have something like [0, π/10, π/5, 3π/10, . . . ]T , the aircraft will spin around its vertical axis. 82

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

4.11.1

Trajectory filtering

For values of time that are not present in the trajectory table, they have to be interpolated. In this thesis, we use a linear interpolation which does not give very good result because information about second derivative of translational acceleration is not available. As a result, there presents high-magnitude spikes that can make the system go unstable. Nevertheless, we can effectively saturate these signals. Simulation results showed that this is a reasonable approach. Another approach is to generate a C n signal that carries higher derivatives information. Such C n trajectory signal can be obtained from a nth order LTI system tracking the original trajectory. To generalise, suppose u(t) is a step input signal with Laplace transform U (s) = 1/s. The output signal of the system is y(t) with Laplace transform Y (s). We have: G(s) Y (s) = s where G(s) is the Laplace transformation of a nth order LTI system that tracks u(t). The first and second derivative of y(t) can be transformed into sY (s) and s2 Y (s) respectively. Thus, from the BIBO stability theorem, to have zeroth, first and second order time derivative of the trajectory to remain bounded, it is required that: G(s), sG(s), s2 G(s)

(4.2)

to be Hurwitz i.e. the poles locate in left half plane. Moreover, as we desire G(s) to closely track u(t), from Final Value Theorem: lim y(t) = lim sY (s) = lim G(s) = 1

t→∞

s→0

s→0

(4.3)

Finally, if we have initial conditions for first and second order derivative, we have to imply another set of conditions: lim y 0 (t) = lim s2 Y (s) = lim sG(s) = v0

(4.4)

lim y 00 (t) = lim s3 Y (s) = lim s2 G(s) = a0

(4.5)

t→0

t→0

s→∞

s→∞

s→∞

s→∞

If initial velocity and acceleration are zero, the conditions of (4.2), (4.4) and (4.5) imply that G(s) is a third-order Laplace transfer function that satisfy (4.3). We can use any classical technique like pole allocation, Bode diagram, Root locus, Nyquist plot to design such transfer function. For example: G(s) =

s3

+

1.5s2

0.1 + 0.7s + 0.1

Poles of the above transfer function are: −0.8488, −0.3256 ± 0.2031j (figure 4.17). We observer that all poles are stable, comprising of one real pole and a pair slowly oscillating poles with time constant T = 3.07s and damping ratio 0.848. We feel that the response time is too slow for complicated trajectory tracking as the rise time is 7.5324s and settling time is up to 12.4807s. Further fine tuning needs to be performed to yield adequate performance. 83

4.11. FLIGHT DIRECTOR SYNTHESIS BLOCK

Figure 4.17: Pole-zero plot of the transfer function

Figure 4.18 depicts various responses of the zeroth, first and second order of the output from G(s). Conversely, we consider G(s) to be a trajectory filter that gives out the true signal to position controller synthesis. Note that velocity and acceleration graphs start at zero, and there are smooth varying signals in all derivative components with no presence of high-magnitude ”spikes”. The filter promises increase of stability in position tracking. Unfortunately, in this thesis we do not have enough time to thoroughly test and fine tune this feature, thus stopping only at proposal.

4.11.2

Thrust magnitude and desired attitude calculations

Returning to our model, we use Lookup blocks (figure 4.19) to linearly interpolate the values for time instance not given in the sample trajectory. Such interpolation gives high-magnitude spikes on acceleration graph and is saturated to some maximum (and minimum) value. The interpolated values are then sampled at 50Hz to enable taking derivatives by approximating with finite difference method, then combined to yield the desired position vector xd . Current position, along with desired position is taken derivatives to obtain current and desired velocity and acceleration. From these we can calculate the translational error terms using the blocks introduced earlier like translational position and velocity error blocks. The acceleration components are saturated. Some of these signals are directed to a Magenta bus for debugging and analysis (figure 4.20) and everything is fed into the Attitude Generator. We summarise the inputs and outputs of Attitude Generator in Table 4.11. Since inputs of the block may come at different rates and the attitude generator block may operate at higher rates than several incoming signals. A recommended practice would be to make the block operate at some frequency, say 50Hz and lower frequency inputs 84

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

(a) Position response

(b) Velocity response

(c) Acceleration response

Figure 4.18: Response of various derivatives of the flight trajectory filter are hold by a zero order hold (ZOH) at most recent level. This is equivalent to resampling outputs at 50Hz, which explains the two Transition Rate blocks we see in thrust magnitude and desired attitude. The former is directly output to motor command block, while the latter is fed into attitude control synthesis block. We also perform some post-processing of the signals, like converting the desired attitude to TaitBryan angles for easier visualisation, as well as calculating several derivations such as desired angular rates through an Omega estimator and desired angular accelerations (figure 4.22). Through experiments, we find that it is best to saturate the output of desired angular acceleration like we did with translational acceleration. Many of these states are directed to a Magenta bus for debugging and visualising. The detailed implementation of the attitude generator block involves two process: 1. Derive the desired thrust direction T = Rc e3 ∈ R3 and thrust magnitude f ∈ R using the formulas given in Proposition 3.49. Note that Rc is rotation matrix that takes a vector from body frame and convert it to inertial frame, thus T is written with respect to inertial frame. 2. Caclulate the desired attitude with a process given below. 85

4.11. FLIGHT DIRECTOR SYNTHESIS BLOCK

Figure 4.19: Linear interpolation of sample trajectory

Figure 4.20: Post-processing of signals for the Attitude Generator block

86

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.21: Attitude Generator block

Figure 4.22: Post-processing of signals from the attitude generation block

87

4.11. FLIGHT DIRECTOR SYNTHESIS BLOCK Table 4.11: Inputs and outputs of the attitude generation block Type Input

Notation R

Input Input Input

ex ev a

Input Output

psi thrust magnitude desired attitude

Output

Description Rotation matrix from body to inertial frame that represents current attitude Translational position error Translational velocity error Desired translational acceleration Desired yaw angle Thrust magnitude

Set SO(3)

Unit 13×3

R3 R3 R3

m m/s m/s2

R R

rad N

Desired attitude Rd to command the attitude control synthesis block

SO(3)

13×3

Proposition 4.2 (Attitude generation algorithm) The desired attitude can be generated by the following process: 1. The unit vector −z of desired body frame (written with respect to inertial frame) coincides with normalised thrust vector T since T = Rc e3 . 2. Calculate the Provisional Desired Direction Vector (P DV ) by rotating the unit vector x of body frame basis so that the rotation corresponds to [0, 0, ψ]T when expressed by Tait-Bryan angles. This is achieved by constructing a rotation I matrix with RB from (2.1) with φ = 0, θ = 0, ψ = ψ and multiply this matrix with [1, 0, 0]. The result is a vector P DV expressed in the inertial frame. 3. Certainly P DV is not perpendicular to T and thus can not form a unit vector of the orthonormal basis for our desired body frame. To achieve this, we project P DV onto a plane perpendicular to T by the following formula to obtain a Promoted Desired Direction Vector (DDV ). DDV = T × (T × P DV ) = −sk(T )(sk(T )P DV ) After normalisation, this vector forms another component of the orthonormal basis. 4. The remaining vector V can be found by taking cross-product of DDV and T : V = T × DDV = sk(T )DDV The orthonormal basis of the desired attitude, whose nature is rotation matrix from body to inertial frame, is simply: Rd = [T, DDV, V ] i.e. the column vectors are stacked horizontally. Figure 4.23 visualises the entire construction process. 88

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Figure 4.23: Visualisation of PDV, DDV, V and T in space

Through experiments, we see the need to renormalise the entire Rd once more by using the function norm from Robotics Toolbox [60]. However this function does not work out of the box with Simulink. Fortunately, only small modifications of the original code are required to get the function working. Basically, the function takes norm of each column, then divides every components of the matrix with their respective column norm. Full code is shown in the source code attached to this thesis. There is a small possibility that P DV //T . In this scenario, P DV degenerates and so does the desired attitude. To prevent this, we may add some arbitrary but small I to restore the missing degree of freedom. In value to θ or φ when constructing RB practice, this is usually not a case which is of concern unless our quadrotor is doing a flip in mid-air. Various variables are configured in the Mask property of the block (figure 4.24) for easier tuning during simulations. These includes sampling time Ts which affects all submodules inside the block, position and velocity error gain kx , kv , initial position xinit and other quadrotor physical parameters as defined in workspace. Table 4.12 describes all inputs and outputs of the block. In this chapter, we have introduced to the main blocks of the NLGC Toolbox which will be simulated in the next chapter. We believe there are some latent mistakes and improvements can be made here and there, but we still like to share this model for everyone and open for feedbacks. Being a newcomer to the community already lacking open-source code of this particular control strategy, we hope this toolbox can help some people, especially those interested in nonlinear geometric control. For full model please consult [58].

89

4.11. FLIGHT DIRECTOR SYNTHESIS BLOCK

Figure 4.24: Mask configurations of the flight director synthesis block

90

CHAPTER 4. IMPLEMENTATION OF THE GEOMETRIC CONTROL

Table 4.12: Inputs and outputs of the flight director synthesis block Type Input

Notation Reb

Input Input Input

x v tdat

Input

xdat

Input

ydat

Input

zdat

Input

psidat

Output Output Output

x* v* Reb*

Output

Ob*

Output

Odb*

Output

f

Description Rotation matrix from body to inertial frame that represents current attitude Current CG position Current CG velocity Time data from sample trajectory x component of sample trajectory y component of sample trajectory z component of sample trajectory ψ component of sample trajectory Desired position Desired velocity Desired attitude (rotation matrix from body to inertial frame) Desired angular rates in body frame Desired angular acceleration in body frame Thurst Magnitude

91

Set SO(3)

Unit 13×3

R3 R3 R

m m/s s

R

m

R

m

R

m

R

rad

R3 R3 SO(3)

m m/s 13×3

R3

rad/s

R3

rad/s2

R

N

Chapter 5 Simulation of the geometric control In this chapter, simulation of trajectory tracking by the geometric nonlinear control is given along with some discussions and comparison with traditional PID controllers. The purpose is to evaluate performance in ideal environment with perfect sensors, then with external disturbance from wind, moment and sensor noise.

5.1

The tests

We will use these same following configuration for all subsequent tests, including those equipped with nonlinear geometric and PID controller. • Quadrotor mass m = 1.5kg. • Quadrotor moment of inertia   0.082 0 0 0.082 0  kgm2 J = 0 0 0 0.149 • Gravitational acceleration g = 9.81m/s2 . • Thrust coefficient cT = 1.4865 × 10−7 N s2 . • Torque coefficient cQ = 2.925 × 10−9 N ms2 . • Arm’s length d = 0.1857m. Such parameters can be obtained by conducting experiments presented in [39]. Initial conditions are set to: • Translational position: [0, 0, 0]T . • Translational velocity: [0, 0, 0]T (with respect to inertial frame). • Translational acceleration: [0, 0, 0]T . • Tait-Bryan angles: [0, 0, 0]T . 92

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL • Angular rates (with respect to body frame): [0, 0, 0]T . • Angular accelerations (with respect to body frame): [0, 0, 0]T . In short, the aircraft parks peacefully at the origin of the inertial frame, not moving anywhere (zero velocities) and ”intending” to do anything (zero accelerations) at t = 0. It is required that the information about initial conditions to be distributed to every blocks that contain a numerical derivative, since this is what they rely on to yield correct value at several time instances at the beginning of the simulation. This can be done by setting the fields defined in block’s mask to appropriate values. Moreover, all numerical blocks that involve sampling of signal (e.g. by a rate transition) must have sampling time defined. In our case, we try to run all loops at a frequency of 50Hz which corresponds to a period of Ts =

1 1 = = 0.02(s) fs 50

In fact, through many simulations of the geometric controller, we have found that a shorter sampling time may not bring more advantages, but significant longer values (like 0.2s) may severely reduce system stability. A powerful-enough microcontroller or microprocessor is required to be able to carry the entire calculation undertaking, keeping in mind that it has to perform other mission such as state variable estimation as well. We also require the flight trajectory at t = 0 coincides dynamically with the initial condition. By dynamically, we mean the zeroth, first and second derivatives of flight trajectory must match their counterparts of initial values. For example, if we have a trajectory begins at origin of the frame but with initial velocity of 1000m/s, the aircraft has no way but to give up on the tracking, resulting in instability. Equivalently, the initial error would be so big that it falls out of the controller’s conditions for convergence. We have also discussed a trajectory filter. In such case, it is essential that all initial derivatives are set to zero i.e. zero translational/angular velocity, zero translational/angular acceleration... The designed flight path is given in Table 5.1 and is visualised in Figure 5.1. Detailed explanation of this data is given in chapter 4. Although we choose this flight path arbitrarily, some sharp edges are added to see if the quadrotor can correct the error quickly enough, and there are some variations of aircraft speed on different flight segments. The following raw data will be taken for analysis: Angular outputs • True Tait-Bryan angles: roll φ, pitch θ, yaw ψ. • True angular rates written with respect to body frame: Ω = [Ωx , Ωy , Ωz ]T . • Commanded Tait-Bryan angles: roll φd , pitch θd , yaw ψd . • Commanded angular rates written with respect to body frame: Ωd = [Ωxd , Ωyd , Ωzd ]T . From which, the following derived quantities can be calculated: 93

5.1. THE TESTS Table 5.1: Sample trajectory to track t(s) 0 5 10 15 20 25 30

x(m) 0 1 1 0 -1 -1 0

y(m) 0 1 0 0 -1 -1 0

z(m) 0 -1 -2 -3 -4 5 -6

ψ(rad) 0 0 0 0 0 0 0

(a) In 3D view

(b) XY view

(c) XZ view

(d) YZ view

Figure 5.1: Sample trajectory to track • Tait-Bryan angle errors: φ − φd , θ − θd , ψ − ψd . • Attitude error function:

 1 Ψ = trace I − RdT R 2

Translational outputs • True CG position: x, y, z. 94

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL • Desired CG position: xd , yd , zd . • True CG velocity in inertial frame x, ˙ y, ˙ z. ˙ • Desired CG velocity in inertial frame x˙d , y˙d , z˙d . From which, the following derived quantities can be calculated: • Translational position error ex = [x − xd , y − yd , z − zd ]T ∈ R3 . • Translational velocity error ev ∈ R3 . Motor response • Thrust of engine 1, 2, 3 and 4. Two subtests are performed for each controller. The first one evaluates aircraft performance in ideal conditions (IC), which implies that: • Sensors are ideal. • No external wind. • No perturbation of moment. • The quadrotor parameters (specifically mass and moment of inertia) are identified with absolute certainty. This subtest also forms a baseline for controller parameters tuning before comparing the controllers in the simulated reality (SR) test. Method of comparison details are presented in the following section. The SR conditions are: • Roll, pitch, yaw angles are added with white-noise signal to simulate non-ideal sensors. Unfortunately, this random noise carries onto the derivatives (such as in Omega Estimator block) with amplified magnitude rendering the system unstable. In reality, the angular rates are estimated from sensor data using filters such as EKF. For accurate simulation, Omega Estimator blocks use the original signal without noise to estimate angular rates and white noise is then added later. • The aircraft is subjected to aerodynamic forces due to wind according to the Dryden Turbulence Model. • Some perturbation of moment is added to the moment input of the 6DOF Euler block. • The true quadrotor parameters (specifically mass and moment of inertia) are 20% off their identified values (which are fed into the controller). 95

5.2. COMPARISON METHOD

Figure 5.2: QuadSim simulation model for PID controller

The content of this test is inspired by [61], [62]. It is said that we could neglect the angular torques created from wind [57]. However in this model, we can consider that we have lumped them into the moment perturbation terms. [62] recommends that we can choose some fixed values for torque perturbations. The point of this test is to test the robustness of both PID and nonlinear geometric controller against external disturbance and inaccurate parameters yielded during the system identification process. An improvement of can be made to recalculate the propeller’s true angle of attack in presence of wind. Unfortunately this requires some concrete groundwork from CFD simulations or experiments, which fall beyond the scope of this thesis. A word of caution we would like to make that this is the test that we only come up with and we have no basis to claim about the validity in reality. Nevertheless, we believe it is enough to demonstrate whether a quadrotor controller is robust or not. For PID controller, we use a MATLAB/Simulink model (Figure 5.2) from [39] and [63]. The QuadSim package [39] equips the quadrotor with six PID controllers, four generating roll, pitch, yaw and altitude control signal to the engine mixing block that converts these signals to engine thrust difference and solve for each individual rotor thrust. The other two PID controllers yield desired pitch and roll angle from translational position error.

5.2

Comparison method

Since PID and nonlinear geometric controllers are very different, they also possess different set of parameters that can be configured. For PID controller, we have up to 96

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL 18 parameters to configure: the proportional, integral and derivative coefficients for 6 controllers. For nonlinear geometric controller, we have 4 parameters: two for attitude control synthesis block and two for flight director synthesis block. The difference in parametric configuration implies that any criteria to be compared between controllers can be ill-defined. In other words, one controller might perform worse than the other because it hasn’t been tuned to the correct parameters. To resolve this issue, we propose the following procedure: 1. The nonlinear geometric controller is first setup with some parameters and then simulated in ideal condition. 2. The response of the geometric controller serves as a baseline to fine-tune (with trial-and-error) performance of PID controllers in ideal condition. 3. A comparison of errors and some performance measuring quantities are then given to conclude about two controllers, along with some discussions. In the end of this step, we desire to have distinct parametric setup for each controller that gives on-par performance. 4. Keeping the controller configurations constant, we turn to simulated-reality condition and reassess the performance of each controller. 5. We analyse the results to yield the same report as in the ideal test. 6. Some discussions about the results. To quantify the trajectory tracking performance, we introduce some quantities. Definition 5.1 (ISE for translational position tracking) Integral square error of translational position tracking is defined as: Tf

Z

e2x dt ∈ R3

ISE =

(5.1)

0

We can also define ISES = ISEx + ISEy + ISEz i.e. the sum of all components. Definition 5.2 (IAE for translational position tracking) Integral absolute error of translational position tracking is defined as: Z IAE =

Tf

|ex |dt ∈ R3

(5.2)

0

Likewise, we can define IAES = IAEx + IAEy + IAEz ∈ R i.e. the sum of all components. Definition 5.3 (MAE for translational position tracking) 97

5.3. NONLINEAR GEOMETRIC CONTROL IN IDEAL CONDITION Maximum absolute error of translational position tracking is defined as: M AE = max(|ex |)

(5.3)

ISE and IAE will be our targets for tuning controllers. Both criteria evaluate how well the controller follows the flight path, but in slightly different ways. ISE penelises large error (especially those larger than 1) more than small error and reflects how long does the error correction process take place. Low ISE usually indicates that our controller is quick to respond. IAE, on the other hand, treats large and small error equally, and is a good indication if sustained small error and/or oscillation presents. If we can not make both ISE and IAE identical between controllers, we will emphasise on ISE. Besides, the following criteria, inspired from [30], will also be useful when assessing motor control signals. Definition 5.4 (TPG for motor control ) Total power generated (TPG) is defined as: Z Tf T P Gi = Ti dt ∈ R

(5.4)

t=0

These indices relate to the total control effort and energy efficiency, while the following indices indicate whether the control algorithm is friendly with hardware or not: Definition 5.5 (Thrust variance for motor control ) Thrust variance is defined as T V = E[T 2 ] − E[T ]2

(5.5)

where E[·] stands for mean of the value being calculated: Z T X(t) dt E(X) = lim T →∞ t=0 T

If the thrust is commanded over a large interval, it may cause damage to the hardware. These four criteria will be given in each test.

5.3

Nonlinear geometric control in ideal condition

The full model for position tracking control is given in Figure 5.3, 5.4 and 5.5 using the implementation technique presented in the previous chapter. Maximum engine saturation level is set at 8000 RPM, which corresponds to a maximum thrust of 2 Tmax = cT ωmax = 1.4865 × 10−7 × 80002 = 9.51(N )

98

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

Figure 5.3: Full implementation of the trajectory tracking nonlinear geometric controller

Since the quadrotor’s arm is 18.57cm, the maximum rolling or pitching moment achieved by one rotor once the opposite rotor is completely shut down is: τmax = Tmax d = 9.51 × 0.1857 = 1.77N m The flight director synthesis block’s gains are: • Position error gain (kx ): 12.6 (1/m). • Velocity error gain (kv ): 5.6 (s/m). The attitude control synthesis block’s gains are: • Attitude error gain (kr ): 9.2. • Angular velocity error gain (kΩ ): 5.6(s). These gains can be easily verified to satisfy the sufficient conditions given in chapter 3. Just like PID, there is no consensus on the method to choose optimal gain values. Trial-and-error method is utilised, and the iteration stops when a decent performance is observed. Position tracking result of this controller is given in 5.6. There are some fluctuations near turning points but in overall, the controller yields good tracking performance. Figure 5.7 details about the error terms during the entire tracking process. • For X error component (Figure 5.7a): IAE = 0.2513m.s, ISE = 0.0094m2 s. These numbers are obtained via a numerical integration of (5.1), (5.2). The maximum absolute error is 0.0582m achieved at around t = 10s, but there are roughly same peaks at t = 5, 10, 20 and 25s which correspond to the points where the aircraft began or stopped moving in the X direction. The controller tries to correct the position error very quickly, about more or less than 1s. 99

5.3. NONLINEAR GEOMETRIC CONTROL IN IDEAL CONDITION

Figure 5.4: Implementation of the attitude control synthesis block

Figure 5.5: Implementation of the flight director synthesis block

100

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(a) In 3D view

(b) x position with time

(c) y position with time

(d) z position with time

Figure 5.6: Sample trajectory to track • For Y error component (Figure 5.7b): IAE = 0.465m.s, ISE = 0.0298m2 s. The maximum absolute error is 0.14m achieved at around t = 5s when the quadrotor ”turned around” on Y axis. There are other lower peaks of error magnitude because they correspond to the points where the aircraft either started or stopped moving (defined as pauses), not reversing direction. There is some resemblance to the X error component in magnitude, except for the direction-reversing peak at around 5s, implying that X and Y dynamics are symmetrical. The equation of motion in chapter 2 confirms this remarks. Overall, the position error in this direction gets corrected very quickly with response time more or less than 1s. The performance indices indicate that the controller is doing very well. • The graph of Z error component (Figure 5.7c) also reveals some insights. Although the quadrotor is commanded to climb linearly, there exists some fluctuations on the graph. The X, Y and Z error has somehow coupled together, thus one can not isolate one dynamics from the others. The peaks happen coincidentally at the points where the aircraft performed movement in the lateral 101

5.3. NONLINEAR GEOMETRIC CONTROL IN IDEAL CONDITION plane. However, the amplitude of error in Z is quite small compared to other error components with IAE = 0.0967m.s, ISE = 0.0014m2 /s. This coupling nature is intuitive to explain. We have seen in chapter 3 that to control the position, the aircraft has to change its attitude to rotate the thrust vector. It is this rotation that caused the force element projected along x, y and z axis to change magnitude. The whole system takes time to restore balance. The details of the attitude dynamics can be observed in Figure 5.7d, 5.7f, 5.7h. The attitude change happened fairly quickly in around less than 0.5s. Note that the attitude controller does not correct each component of the Tait-Bryan angle error, but rather all components at once (the positive definite attitude error function Ψ). This explains why the yaw angle response seems to contradict the commanded signal. On Figure 5.7j, the reason why we witness a short rise of error function before reduction can be contributed to the acceleration phase when the system was trying to keep up with a fast variation of attitude error Ψ. We may now compute the nominal value of ISES and IAES for PID controller tuning. ISES = ISEx + ISEy + ISEz = 0.0094 + 0.0298 + 0.0014 = 0.0406(m2 s) IAES = IAEx + IAEy + IAEz = 0.2513 + 0.465 + 0.0967 = 0.813(m.s) Figure 5.7k, 5.7l, 5.7m and 5.7n give information about each rotor thrust during the entire trajectory. There are some high magnitude spikes because the given sample trajectory is not differentiable upto any order higher than one. In this context, the controller ”understands” that it must compromise for very large acceleration in order to turn the velocity vector around in such short period of time (which is equal to sampling time Ts ). As a result, the attitude controller was commanded for rapid rotation of thrust vector, thus it shut down or increased the engines to maximum thrust to fulfill the given order. For this reason, we have stated that a trajectory filter may be of useful to prevent such extremeness, and to better protect the hardware. Other method may include a trajectory generator at higher loop levels [55]. Recall that in the implementation phase, we have saturated the maximum value of acceleration components. For better visualisation of what the rotors were doing, we may rearrange the thrusts into the following terms: U1 = T1 + T2 + T3 + T4 U2 = T4 − T2 U3 = T3 − T1 U4 = T1 − T2 + T3 − T4 These are the linearly-independent equations of Ti , thus preserve the entire original information packed in T1 , T2 , T3 and T4 variables. The term U1 allows us to see the total thrust magnitude, U2 , U3 , U4 to see the roll, pitch and yaw command being realised on Figure 5.7d, 5.7f, 5.7h respectively. Finally, we calculate several variables that assess engine performance using (5.4) and (5.5). 102

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(a) X error

(b) Y error

(c) Z error

(d) φ response

(e) φ error

(f) θ response

Figure 5.7: Nonlinear geometric controller various responses

103

5.3. NONLINEAR GEOMETRIC CONTROL IN IDEAL CONDITION

(g) θ error

(h) ψ response

(i) ψ error

(j) Ψ attitude error

(k) Rotor 1 CMD thrust

(l) Rotor 2 CMD thrust

Figure 5.7: Nonlinear geometric controller various responses (cont.)

104

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(m) Rotor 3 CMD thrust

(n) Rotor 4 CMD thrust

Figure 5.7: Nonlinear geometric controller various responses (cont.)

(a) U1 term

(b) U2 term

(c) U3 term

(d) U4 term

Figure 5.8: Rearrangement of thrusts 105

5.4. PID CONTROLLER IN IDEAL CONDITION • For rotor 1, T P G = 110.5010(N.s), T V = 10.0646. • For rotor 2, T P G = 110.4931(N.s), T V = 10.1399. • For rotor 3, T P G = 110.5073(N.s), T V = 10.0520. • For rotor 4, T P G = 110.5570(N.s), T V = 10.1523. These results indicate that the rotors respond quite similar to each other due to symmetry of flight path. But let alone, they do not carry any more useful information, but for comparison with other controller.

5.4

PID controller in ideal condition

As mentioned earlier, we will try to tune the parameters of the controllers so that the performance closely matches those of nonlinear geometric controller, particularly ISES and IAES. However, no matter how hard we try, there is still some initial lagging (Figure 5.9) before the error correction takes place. We suspect the nature of PID controller only gives information about first-order derivative of position error i.e. velocity, not acceleration. Thus, the controller can not ”anticipate” the immediate trend of the dynamics and takes time to respond. But for the initial phase, adequate tracking performance can be obtained given the following PID parameters setup: Position controller block: • Body X component: kp = 0.32, kd = 0.11 which yields θcmd . The aircraft pitches fore-aft to correct the error along its X direction (ahead - after) of body frame. • Body Y component: kp = 0.32, kd = 0.11 which yields φcmd . The aircraft rolls side-ward to correct the error along its Y direction (right - left) of body frame. Attitude controller block: • φ correction: kp = 6.4, ki = 1.1, kd = 4.4 which yields ∆φ for calculation of rotor 2-4 thrust difference. • θ correction: kp = 6.4, ki = 1.1, kd = 4.6 which yields ∆θ for calculation of rotor 1-3 thrust difference. • ψ correction: kp = 4, ki = 0.5, kd = 3.5 which yields ∆ψ for calculation of reaction torque cQ /cT (T1 + T3 − T2 − T4 ). • Altitude h correction: kp = 6, ki = 1.1, kd = 4.8 which yields ∆h for calculation of total thrust magnitude T1 + T2 + T3 + T4 . A 3D view is given in Figure 5.10 and components are given in Figure 5.9. The error components are significantly larger than those of nonlinear geometric controller mostly due to lagging. This is the best performance we could make out of by tuning the parameters by trial-and-error, but we do not imply that this is the best that PID can do. With further refining, perhaps a better PID parameter suite can be found. We can calculate the performance indices like in the last section. 106

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(a) X position

(b) Y position

(c) Z position

(d) X position error

(e) Y position error

(f) Z position error

Figure 5.9: Trajectory tracking of PID controller

107

5.4. PID CONTROLLER IN IDEAL CONDITION

Figure 5.10: 3D view of PID controller trajectory tracking. Red line shows desired path and blue line shows real path

• For X error component, IAE = 4.0917m.s, M AE = 0.2336m achieved at around t = 10s and ISE = 0.7846m2 s. • For Y error component, IAE = 4.0188m.s, M AE = 0.2635m achieved at around t = 5s and ISE = 0.7756m2 s. • For Z error component, IAE = 0.8728m.s, M AE = 0.1836m achieved shortly after take-off and ISE = 0.0856m2 s. Which yields: IAES = IAEx + IAEy + IAEz = 8.9833m.s and ISES = ISEx + ISEy + ISEz = 1.6458m2 s Of all components, the altitude error is a magnitude smaller than lateral component errors. An analysis of Tait-Bryan angles revealed that PID controller gives more oscillation, which is exhibited in Figure 5.11. We can clearly observe that PID controller adjusts the error at each channel (roll, pitch, yaw) independently, unlike the nonlinear geometric controller that adjusts attitude error as a whole. Up to this moment, PID controller (with this particular parametric setup) has shown a deficit in performance compared to nonlinear geometric controller. But it still has an edge in being hardware-friendly. Response of the rotors are given in Figure 5.12. We may calculate the performance indices for motors: 108

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(a) φ response

(b) θ response

(c) ψ response

Figure 5.11: Tait-Bryan angle responses of PID controller • For rotor 1, T P G = 110.4432N.s, T V = 9.8751. • For rotor 2, T P G = 110.4432N.s, T V = 9.8751. • For rotor 3, T P G = 110.4432N.s, T V = 9.8751. • For rotor 4, T P G = 110.4432N.s, T V = 9.8751.

Actually, there is some discrepancy between rotors, but the amount is very small as indicated on Figure 5.12. The total power generated is comparable to nonlinear geometric controller, but thrust variance is smaller. There is no rapid rise or fall of thrust which makes the PID controller much more friendly with hardware. 109

5.5. NONLINEAR GEOMETRIC CONTROLLER IN SR CONDITION

Figure 5.12: Rotors response of PID controller

5.5 5.5.1

Nonlinear geometric controller in SR condition Model update

To bring in the disturbances to the system, we need to add some features to our model. In this section, we briefly present the way to implement perturbation by Simulink block. We first start with adding a wind model presented in the appendix. According to [57], the aerodynamic force due to wind turbulence can be calculated as follows. First we calculate the relative velocity of aircraft to wind by the formula: VBw = VB − Vwind = [Uw , Vw , Ww ]T in which, VB is translational velocity with respect to body frame, R is rotation matrix from body to inertial frame, Vwind is the wind components written in body frame, the output of the Dryden Wind Turbulence block. Then, the disturbance force generated by wind is:   χx sgn(Uw )Uw2 FBw = −  χy sgn(Vw )Vw2  (5.6) 2 χz sgn(Ww )Ww in which, χx , χy , χz are constants measured by experiment and sgn(·) is defined as:  x, x ≥ 0 sgn(x) = −x, x < 0 110

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

Figure 5.13: Implementation of wind disturbance force for dynamic model

(a) Wind velocity

(b) Force magnified by 10

Figure 5.14: Wind effects on quadrotor Unfortunately, we do not have values for χx , χy , χz . However, the quadrotor in [57] is similar to ours in both size and mass. We can take their values as: χx = χy = 6.1 × 10−3 , χz = 25 × 10−3 (N s2 /m2 ) Implementation of this feature in MATLAB/Simulink is straightforward. A MATLAB Function called Wind Force Calc that implements (5.6). Velocity in body frame can be taken out of the Cyan bus, minus Vwind which is the output of the Dryden Wind Turbulence block. The full setup is exhibited in Figure 5.13. The output of Figure 5.13 can be added directly along with thrust and gravity to 6DOF Euler Angles block. Note that we have added a gain to magnify the force generated by wind ten times, equivalent to either increase of flight speed or turbulence. Figure 5.14a shows the wind velocity components that the aircraft withstands when following the trajectory. Figure 5.14b is the disturbance force added to the system by wind, after magnified by 10. To simulate the effect of non-ideal sensors, we add some noise to the Tait-Bryan angles signal before converting them to Direct Cosine Matrix for the controller. The 111

5.5. NONLINEAR GEOMETRIC CONTROLLER IN SR CONDITION

Figure 5.15: Adding noise into Tait-Bryan angles estimation

signal is uniformly random whose magnitude is 0.005 and sampled at the same rate as the controller, 50Hz. Details of implementation is given in Figure 5.15. The same technique applies to angular rates, translational position and velocity error as well. Certainly it is more desirable to add Gaussian white noise to the data being collected by sensors (such as gyroscope or accelerometer), then recover original signals via estimation filter and use this signal as input of the controller. However, we only want to verify if our controller is susceptible to noise or not. We believe this can be achieved by observing analysing a piece of sample data coming out of some estimation filter. The signal disturbance is averaged over the entire time interval to yield the first term that does not change (or change slowly) with time - a bias term. The remaining fluctuating term is taken maximum and minimum value. These values are then used as upper and lower bounds of a uniformly random signal to be added to ideal measurement, which corresponds to the output of the quadrotor dynamic block. The system tolerates small magnitude noise. However, we find out that a noise whose magnitude of 0.1 to ex and ev renders the system unstable. The root of the cause lies in the way desired angular rates and accelerations are calculated in the flight director synthesis block. The desired attitude output of the Attitude Generator contains parasitic noise carried from upstream input signals, is taken numerical derivatives to yield angular rates and acceleration. The result is amplified noise which we are yet to find a way to circumvent. Unlike true angular rates and accelerations whose measurement can be improved by fusing more data source, desired attitude is the only input we have to perform such estimation. The third disturbance comes from disturbance of torque. [62] proposed that we can 112

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

Figure 5.16: Adding external torque to the system

use a constant value of τd to validate robustness. The paper suggested: τdx = 0.02N m τdy = 0.03N m τdz = 0.04N m These external torques can be added directly to the torque generated by rotors like in Figure 5.16. Finally, we clone workspace variable representing quadrotor physical configuration to a new variable with mass and moment of inertia set to 1.2 times of their real values. This new variable is used by the controller to simulate parametric uncertainties in the system.

5.5.2

Simulation result

The simulation result (Figure 5.17) of the system reveals that the controller possesses some robustness against external disturbance and parametric uncertainty. Analysis of position error components revealed that under torque disturbance, the performance of the controller has started to deteroriate. A steady-state error (SSE) can be observed across translational and angular quantities. For example, the SSE of X position is about -0.04m and Y is about 0.04m, roll angle is 0.03rad... Noise signal is carried into all quantities, resulting in some small high-frequency oscillations. Error correction takes place in very short time, about less than 1 seconds for both translational components and angular components. The trend in the graphs is similar to ideal condition, but leaves one question about the presence of steady-state error. For our case, it is very natural to understand the reason behind, but hard to quantify the correct value of the errors. If the tracking is perfect i.e. eR = eΩ = 0, the attitude controller will demand no torque from the rotors since τ = −J(kr eR + kΩ eΩ + . . . ). Consequently, the perturbation torque τd is not countered, triggers an attitude change. The system comes to equilibrium if there are some eR and eΩ such that the torque from motors, disturbance and other reasons stay in balance, resulting in a steady-state error. For nonlinear system however, it is usually difficult to quantify this entity. The takeaway point is that under external perturbations, the controller loses its asymptotic tracking capability but still remains stable. The performance degrades ”gracefully”, not abruptly thus our controller is robust. This simulation result reconfirms the claim from [32] and [57]. 113

5.5. NONLINEAR GEOMETRIC CONTROLLER IN SR CONDITION

(a) In 3D view

(b) x position with time

(c) y position with time

(d) z position with time

Figure 5.17: Trajectory tracking of nonlinear geometric controller with disturbance and uncertainty

114

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(a) X error

(b) Y error

(c) Z error

(d) Roll angle

(e) Pitch angle

(f) Yaw angle

Figure 5.18: Performance of nonlinear geometric controller in SR condition (cont.) 115

5.5. NONLINEAR GEOMETRIC CONTROLLER IN SR CONDITION

(g) Roll angle error

(h) Pitch angle error

(i) Yaw angle error

(j) Ψ attitude error

Figure 5.18: Performance of nonlinear geometric controller in SR condition (cont.) The SSE can be made smaller by increasing gain values of the flight director and attitude control synthesis block. However, setting the gains too high may result in instability. We may now calculate the performance measuring indices like the preceding sections: • For X error component (Figure 5.18a), IAE = 1.5042m.s, ISE = 0.0858m2 s. Maximum error M AE = 0.1193m is achieved at around t = 12s. • For Y error component (Figure 5.18b), IAE = 1.1238m.s, ISE = 0.0644m2 s. Maximum error M AE = 0.1728m is achieved around t = 6s. • For Z error component (Figure 5.18c), IAE = 0.9646m.s, ISE = 0.0471m2 s. Maximum error M AE = 0.1052m achieved around t = 18s. 116

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(a) Rotor 1 thrust

(b) Rotor 2 thrust

(c) Rotor 3 thrust

(d) Rotor 4 thrust

Figure 5.19: Rotor response in SR condition We may compute the overall performance measuring term: IAES = IAEx + IAEy + IAEz = 3.5926m.s ISES = ISEx + ISEy + ISEz = 0.1973m2 s The final step involves evaluating motor performance, given in Figure 5.19. We may calculate the input benchmarks as follows: • For rotor 1, T P G = 130.3911N.s, T V = 14.7324. • For rotor 2, T P G = 95.8319N.s, T V = 7.2401. • For rotor 3, T P G = 125.5753N.s, T V = 13.4903. 117

5.6. PID CONTROLLER IN SR CONDITION

(a) In 3D view

(b) x position with time

(c) y position with time

(d) z position with time

Figure 5.20: Trajectory tracking of nonlinear geometric controller with disturbance and uncertainty • For rotor 4, T P G = 99.0937N.s, T V = 7.8385. The difference in values may be attributed to the external torque disturbance that requires each rotor to correct in a different way, along with wind perturbation. Overall, we witness some increase in total power generated as well as thrust variance value for rotor 1 and 3.

5.6

PID controller in SR condition

The implementation of disturbances and uncertainties are the same as in last section. We have force disturbance from wind, torque disturbance, sensor noise and uncertain quadrotor parameters. At a glance at Figure 5.20, the tracking performance deteriorates even at a greater level than nonlinear geometric. The aircraft is subjected to a lot of oscillation and shows some struggle following the sample trajectory. The problem can be mitigated a little bit by varying the PID coefficients. Various simulations showed that wind 118

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL disturbance was a major cause of performance degradation, in contrary to nonlinear geometric controller, which is sensor noise. More insights can be gained from analysing error terms. Due to oscillations, it is not possible to see the steady-state error in the graphs. It can also be inferred that errors in general are much larger than their nonlinear geometric counterparts through a quantifying process below: • For X error component (Figure 5.21a), IAE = 6.699m.s, ISE = 2.3402m2 s. Maximum error M AE is 0.5328m achieved at around t = 12s. • For Y error component (Figure 5.21b), IAE = 5.0139m.s, ISE = 1.2013m2 s. Maximum error M AE is 0.5310m achieved at around t = 6s. • For Z error component (Figure 5.21c), IAE = 4.8589m.s, ISE = 1.1333m2 s. Maximum error M AE is 0.3977m achieved at around t = 7s. We can calculate the tracking performance measuring indices: IAES = IAEx + IAEy + IAEz = 16.5718m.s ISES = ISEx + ISEy + ISEz = 4.6748m2 s For attitude response, we can clearly see the steady state error in yaw angle response (Figure 5.21i). Notice the commanded angle for attitude correction of this controller is much lower than the nonlinear geometric controller. For example, in Figure 5.21d we see that roll angle usually stayed below 0.15o , while the nonlinear geometric counterpart (Figure 5.18d) might roll the aircraft up to over 2o . Finally, we evaluate the rotor performance in Figure 5.22. • For rotor 1, T P G = 125.0216N s, T V = 13.3211. • For rotor 2, T P G = 91.1099N s, T V = 6.2752. • For rotor 3, T P G = 120.9369N.s, T V = 12.3041. • For rotor 4, T P G = 93.8620N s, T V = 6.7113. The total T P G is comparable to nonlinear geometric controller, but the thrust variance is lower.

5.7

Final remarks

Having compared two controllers in ideal and simulated-reality (SR) environment (Table 5.2), we conclude that nonlinear geometric controller offers greater tracking capability and robustness to external disturbances and parametric uncertainties. It is also fast to respond to errors and damp out oscillatory responses. However, the controller requires moving the thrusts more frequently and in a wider range, relaying the conclusions made in [37], [57] and [32]. The disadvantages lie in the computation cost of this controller and susceptibility to sensor noise. The former can be resolved by using more powerful hardware while the latter requires some augmentation of design, perhaps a signal filter. 119

5.7. FINAL REMARKS

(a) X error

(b) Y error

(c) Z error

(d) Roll angle

(e) Pitch angle

(f) Yaw angle

Figure 5.21: Performance of PID controller in SR condition

120

CHAPTER 5. SIMULATION OF THE GEOMETRIC CONTROL

(g) Roll angle error

(h) Pitch angle error

(i) Yaw angle error

Figure 5.21: Performance of PID controller in SR condition (cont.)

Table 5.2: Summary of benchmark indices Tests NLG Ideal PID Ideal NLG SR PID SR

IAES (m.s) 0.813 8.9833 3.5926 16.5718

ISES (m2 s) 0.0406 1.6458 0.1973 4.6748

TPG1 (Ns) 110.5010 110.4432 130.3911 125.0216

TV1 10.0646 9.8751 14.7324 13.3211

Table 5.2: Summary of benchmark indices (cont.) Tests NLG Ideal PID Ideal NLG SR PID SR

TPG2 (Ns) 110.4931 110.4432 95.8319 91.1099

TV2 10.1399 9.8751 7.2401 6.2752

TPG3 (Ns) 110.5073 110.4432 125.5753 120.9369

121

TV3 10.0520 9.8751 13.4903 12.3041

TPG4 (Ns) 110.5570 110.4432 99.0937 93.8620

TV4 10.1523 9.8751 7.8385 6.7113

5.7. FINAL REMARKS

(a) Rotor 1 thrust

(b) Rotor 2 thrust

(c) Rotor 3 thrust

(d) Rotor 4 thrust

Figure 5.22: Rotor response in SR condition

122

Chapter 6 Conclusion and prospects of development 6.1

Conclusion

In this thesis, we have presented the study of the nonlinear geometric controller, originally published in [32]. We have attempted to go from the very basics of differential geometry to understand the meaning of each mathematical tool involved in the control law derivation process. The main contribution of this thesis is to interpret, explain and verify some of the missing theory and its proofs and to answer the question ”how and why did they do that?”. We also introduced a MATLAB/Simulink model for the quadrotor, the nonlinear geometric controller that yet to exist publicly and a framework to test robustness compared with other controller (like PID in our case). We favour the insights from differential geometry, in particular the SO(3) Lie group for the capability of simplifying highly nonlinear differential equations into a versatile entity. Though quite difficult to comprehend at first, these knowledge has described the underlying mathematics that govern the set of rotation transformations in threedimensional space naturally, intuitively via the exponential and logarithm map. To us, differential geometry exhibits a kind of beauty that can hardly be overlooked. It synchronises our intuition with the nonlinear dynamics of the system, making the entire thesis work feel both challenging and fascinated at the same time. These knowledge, will allow us to unlock the doors to design controllers, not only for quadrotors, but for trirotors, hexarotors, mobile robots and even underwater vehicles that promises some advantages such as robustness and fast response. It also supplied knowledge to learn and understand more about nonlinear and especially geometric control theory - a land that we have yet to visit during our entire coursework.

6.2

Prospects of development

This thesis has reviewed some flaws of the geometric controller that needs to be resolved in future works. These include a signal processing technique to estimate desired angular rates and accelerations to increase system stability. A realisation of this controller on SoCs e.g. Arduino, Raspberry Pi, Dragonboard would bring this controller to the real world. It is until then that we can eventually verify the claim that whether the 123

6.2. PROSPECTS OF DEVELOPMENT implementation suggested in this thesis works in reality or not. Simulated-reality test proposed in this thesis also needs to verify the validity with experiments and to be improved. We can directly add secondary forces and moments to the simulation model, as well as to simulate wind disturbance on thrust generation i.e. wind velocity changes propeller’s angle of attack. At theoretical level, we can also expand this controller to different multirotor UAV designs such as trirotor or hexarotor - a problem that is still left open in the literature too.

124

Appendix A Atmospheric Turbulence Modelling Along with wind gusts, shear, atmospheric turbulence is a very important phenomenon that can crucially affect the quality of an aircraft control system [64]. Because an aircraft often flies in windy sky, it is important to evaluate how the controller would respond to perturbations by wind. The motivation to include this problem into the thesis arose naturally from the desire to get more realistic condition when evaluating the robustness of both nonlinear geometric and PID controllers. As a limitation of this thesis, we have yet to include wind gusts and shear model to our simulation. This appendix chapter attempts to introduce the Dryden turbulence model at its basic, along with the Dryden Continuous block that come with default MATLAB/Simulation packages. For simplicity, we assume that the three-dimensional space containing atmospheric turbulence is stationary (no evolution with time), homogeneous, isotropic (everywhere looks the same in every direction) and large enough so that the entire airplane is in its affected region [65].

A.1

The principle

A random signal (non-correlated) is generated and then pass through shaping filter to provide turbulence signal, which is a variation of translational and angular velocity (Figure A.1) [66]. The output is then compared with experimental data to verify validity of the model. This section presents the Dryden model using materials from [66] and [64] at a less rigorous level. Please consult these papers for more comprehensive explaination.

Figure A.1: Principle of simulating atmospheric turbulence

125

A.1. THE PRINCIPLE Consider an airplane flying in a turbulent region. The translational velocity of the aircraft written with respect to body frame is U = [u, v, w]T and angular rates are ω = [ωx , ωy , ωz ]T = [p, q, r]T . The ω notation for angular rates is avoided since it may cause ambiguity with frequency in Fourier analysis, thus from now on we will refer to the angular rates as p, q, r. The general idea is that air in turbulent region seems to move stochastically, not randomly, but with a pattern. Nevertheless, any quantity perturbed by a stochastic process can be described as a sum of its average (static) component with perturbation component that varies with time. As such, any velocity component can be written as: Ui (t) = Ui + ui (t) in which Ui is the static component and ui is the perturbation. By this decomposition, ui can be thought as a random process with zero mean value. Consequently, the root-mean-square equals to signal variance σ 2 since: σ 2 = E[X 2 ] − E[X]2 ⇒ E[X]2 + σ 2 = E[X 2 ] = RM S where E[·] denotes the arithmetic mean set to zero and X is the random process. Now, replace X in the above expression with ui , we get: s Z 1 T 2 2 RM Si = E[ui ] = lim [ui (t)2 ]dt = σi2 t→∞ T 0 The term RM S 2 is a mean value of ui that closely relates to kinetic energy (KE) by a constant factor i.e. proportional to KE. From Fourier transforms, we know that every signal expresed in time can also be expressed in frequencies. If we define Eii as a frequency distribution of RM Si2 : Z ∞ 2 RM Si = Eii (ω)dω 0

We call E· a turbulent energy density function. It is possible to also define such function for E[ui , uj ] where i 6= j. Just like what we have done up to this moment, it is apparent that: σij = E[ui uj ] These components have their own names too: cross-correlations and cross-spectrum. Since we have defined our region as isotropic, we can imagine every piece of air is pushed and pulled alike in every single directions, thus alleviate the shearing stress i.e. ρE[ui uj ] = 0, i 6= j. We also define the normalised energy spectral density function as φi (ω) =

Eii ω Ui

2

Finally, a three-dimensional energy spectrum function E(K) is just a sum of components in three directions (i = 1, 2, 3), with cross-correlated terms removed as a result of isotropic turbulence: 126

APPENDIX A. ATMOSPHERIC TURBULENCE MODELLING

Figure A.2: Spectral density function of white noise

E(K) = 2πK[E11 (K) + E22 (K) + E33 (K)] The letter K denotes the wave number and is defined as: K=

ω V

with V is some reference velocity. φ(K) is then easily taken by dividing E(K) with square of the respective static velocity component. If there is a filter (continuous or digital) H(ω), it will transform the spectral density function according to the following rule: φout (ω) = |H(ω)|2 φin (ω)

(A.1)

A white noise signal has constant spectral at all frequencies (Figure A.2) and if is given as input into this filter, φin (ω) = const [66]. Everything is clear now. If we have a history of velocity perturbation (typically obtained from experiments), which is represented as a varying signal with zero mean in time, we can find a respective spectral density function φout . Because φin is known and constant, we can design the filter H(ω) such that, to replicate the perturbation signal, all we need is to plug in a white noise signal generator into our filter. In this way, it is possible to simulate atmospheric disturbance.

A.2

Dryden turbulence model

Dryden has proposed the following spectral density functions for translational velocity components [64]: 1 2σ 2 Lu φu (ω) = u  πV 1 + Lu ω 2 V

2 2σv2 Lv 1 + 12 Lv Vω φv (ω) =  2 2 πV 1 + 4 Lv Vω 127

128

APPENDIX A. ATMOSPHERIC TURBULENCE MODELLING 2 2σw2 Lw 1 + 12 Lw Vω φw (ω) =   2 πV ω 2 1 + 4 Lw V

and for angular velocity components: 1/3 w σw2 0.8 2πL 4b φp (ω) =  V Lw 1 + 4bω 2 πV

φq (ω) = φr (ω) =

± Vω 2 1+

 φw (ω) 4bω 2 πV

± Vω 2 1+

 φv (ω) 3bω 2 πV

where σu , σv , σw represents turbulence intensities, Lu , Lv , Lw indicate scale length and b wing span of the aircraft. Turbulence scale length depends on attitude. For low attitude, the following expressions are used: 2Lw = h h Lu = 2Lv = (0.177 + 0.000823h)1.2 For turbulence intensities [64]: σw = 0.1W20 1 σu = σv = σw (0.177 + 0.000823h)0.4 where W20 is wind speed at 20ft. The typical values are: • Light: 15kts. • Moderate: 30kts. • Severe: 45kts. Note: kts = knots = 1.852km/h. Following (A.1), it is possible to design the continuous filters for each velocity component by taking root of the respective spectral density function and replace s = jω. Details of the filters are given in [67].

A.3

The Dryden wind turbulence model block

Fortunately for us, MATLAB/Simulink provided us with a Dryden block (Figure A.3) that implements all the discussed features in the Aerospace Blockset. Table A.1 summarises the inputs and outputs of the block.

A.3. THE DRYDEN WIND TURBULENCE MODEL BLOCK

129

Figure A.3: The Dryden turbulence model block

Table A.1: Inputs and outputs of the Dryden turbulence model Type Input Input Input

Notation h (m) V (m/s) DCM

Output Output

vwind ωwind

Description Altitude Aircraft speed Rotation matrix from body to inertial frame Wind velocity Wind angular rates

Set R R SO(3)

Unit m m/s 13×3

R3 R3

m/s rad/s

Bibliography [1] The Free Dictionary. (2017). Unmanned aerial vehicle, [Online]. Available: http: //www.thefreedictionary.com/Unmanned+Aerial+Vehicle. [2] B. Coxworth. (2017). Hybrid drone aims for the best of both worlds, [Online]. Available: https://newatlas.com/plimp-drone/51623/. [3] EBlimp. (2017). Solar powered UAV blimp, [Online]. Available: https://eblimp. store/blog/2017/06/23/solar-powered-uav-blimp/. [4] S. Norouzi Ghazbi, Y. Aghli, M. Alimohammadi, and A. Akbari, “Quadrotors unmanned aerial vehicles: A review.,” International Journal on Smart Sensing & Intelligent Systems, vol. 9, no. 1, 2016. [5] AIBird. (2018). AIBird KC 2000, [Online]. Available: http://www.aibird.com/ en/KC2000.html. [6] Aperture. (2018). Aperture Hexacopter Aerial Photography Drone, [Online]. Available: https : / / www . rotordronemag . com / aperture - hexacopter - aerial photography-drone-video/. [7] Z. J. Jackowski, “Design and construction of an autonomous ornithopter,” PhD thesis, Massachusetts Institute of Technology, 2009. [8] G. Yu, H. Song, and J. Gao, “Unmanned aerial vehicle path planning based on tlbo algorithm,” International Journal on Smart Sensing and Intelligent Systems, vol. 7, no. 3, pp. 1310–1325, 2014. [9] J. A. Yang, “Conceptual aerodynamic modeling of a flapping wing unmanned aerial vehicle,” ARMY RESEARCH LAB ABERDEEN PROVING GROUND MD VEHICLE TECHNOLOGY DIRECTORATE, Tech. Rep., 2013. [10] C. Grand, P. Martinelli, J.-B. Mouret, and S. Doncieux, “Flapping-wing mechanism for a bird-sized UAVs: Design, modeling and control,” in Advances in Robot Kinematics: Analysis and Design, Springer, 2008, pp. 127–134. [11] Y. Peng, W. Guo, M. Liu, and S. Xie, “Active modeling based yaw control of unmanned rotorcraft,” International Journal on Smart Sensing & Intelligent Systems, vol. 7, no. 1, 2014. [12] M. Gortolev. (2017). Quadcopter vs hexacopter vs octocopter: The pros and cons, [Online]. Available: http://dronebly.com/quadcopter-vs-hexacopter-vsoctocopter-the-pros-and-cons. [13] S. Gupte, P. I. T. Mohandas, and J. M. Conrad, “A survey of quadrotor unmanned aerial vehicles,” in Southeastcon, 2012 proceedings of IEEE, IEEE, 2012, pp. 1–6. 130

BIBLIOGRAPHY

131

[14] H. Bou-Ammar, H. Voos, and W. Ertel, “Controller design for quadrotor uavs using reinforcement learning,” in Control Applications (CCA), 2010 IEEE International Conference on, IEEE, 2010, pp. 2130–2135. [15] PwC. (2016). Global market for commercial applications of drone technology valued at over $127 bn, [Online]. Available: https://press.pwc.com/Newsreleases / global - market - for - commercial - applications - of - drone technology - valued - at - over -- 127 - bn / s / ac04349e - c40d - 4767 - 9f92 a4d219860cd2. [16] K. Hart. (2017). Demand for drones is exploding, [Online]. Available: https:// www.axios.com/demand-for-drones-is-exploding-1513305009-8ad06735f4e2-4043-b8ad-2a165164b5d2.html. [17] H. Shakhatreh, A. Sawalmeh, A. Al-Fuqaha, Z. Dou, E. Almaita, I. Khalil, N. S. Othman, A. Khreishah, and M. Guizani, “Unmanned aerial vehicles: A survey on civil applications and key research challenges,” arXiv preprint arXiv:1805.00881, 2018. [18] D. Joshi. (2017). Commercial unmanned aerial vehicle (UAV) market analysis – industry trends, companies and what you should know, [Online]. Available: http: //www.businessinsider.com/commercial-uav-market-analysis-2017-8. [19] NASA. (2018). Remote sensors, [Online]. Available: https://earthdata.nasa. gov/user-resources/remote-sensors. [20] (2018). Amazon prime air, [Online]. Available: https : / / www . amazon . com / Amazon-Prime-Air/.

[21] National Aeronautics and Space Administration. (2018). Measuring vegetation, [Online]. Available: https://earthobservatory.nasa.gov/Features/MeasuringVegetati measuring_vegetation_2.php. [22] G. Hoffmann, H. Huang, S. Waslander, and C. Tomlin, “Quadrotor helicopter flight dynamics and control: Theory and experiment,” in AIAA Guidance, Navigation and Control Conference and Exhibit, p. 6461. [23] S. Bouabdallah, “Design and control of quadrotors with application to autonomous flying,” 2007. [24] Wikipedia. (2018). Kalman filter, [Online]. Available: https://en.wikipedia. org/wiki/Kalman_Filter. [25] P. A. Hokayem and E. Gallestey, Lecture notes on nonlinear systems and control at ETH Zurich, 2017. [26] M. Euston, P. Coote, R. Mahony, J. Kim, and T. Hamel, “A complementary filter for attitude estimation of a fixed-wing UAV,” in Intelligent Robots and Systems, 2008. IROS 2008. IEEE/RSJ International Conference on, IEEE, 2008, pp. 340– 345. [27] O. Bastelseiten. (2015). IMU data fusing: Complementary, Kalman, and Mahony Filter, [Online]. Available: http://www.olliw.eu/2013/imu-data-fusing/.

132

BIBLIOGRAPHY

[28] L. Carrillo, A. L´opez, R. Lozano, and C. P´egard, Quad Rotorcraft Control: Vision-Based Hovering and Navigation, ser. Advances in Industrial Control. Springer London, 2012, isbn: 9781447143987. [29] FunLab at University of Washington. (2018). UAS networking, [Online]. Available: https://depts.washington.edu/funlab/projects/software-definedwireless-networks/uas-networking/. ¨ ¨ ¨ Efe, “Feedback control strategies for quadrotor[30] N. S. Ozbek, M. Onkol, and M. O. type aerial robots: A survey,” Transactions of the Institute of Measurement and Control, vol. 38, no. 5, pp. 529–554, 2016. [31] Y. Li and S. Song, “A survey of control algorithms for quadrotor unmanned helicopter,” in Advanced Computational Intelligence (ICACI), 2012 IEEE Fifth International Conference on, IEEE, 2012, pp. 365–369. [32] T. Lee, M. Leoky, and N. H. McClamroch, “Geometric tracking control of a quadrotor UAV on SE (3),” in Decision and Control (CDC), 2010 49th IEEE Conference on, IEEE, 2010, pp. 5420–5425. [33] J. P. How, Lecture notes on aircraft stability and control at MIT - course 16.333, 2004. [Online]. Available: https://ocw.mit.edu/courses/aeronautics-andastronautics / 16 - 333 - aircraft - stability - and - control - fall - 2004 / lecture-notes/lecture_3.pdf. [34] G. Fay, Derivation of the aerodynamic forces for the mesicopter simulation. 2001. 2. [35] G. Leishman, Principles of Helicopter Aerodynamics with CD Extra, ser. Cambridge aerospace series. Cambridge University Press, 2006, isbn: 9780521858601. [36] R. Prouty, Helicopter Performance, Stability, and Control. Krieger, 2003, isbn: 9781575242095. [37] R. Mahony, V. Kumar, and P. Corke, “Multirotor aerial vehicles,” IEEE Robotics and Automation magazine, vol. 20, no. 32, 2012. [38] Renesas. (2018). BLDC motor basics, [Online]. Available: https://www.renesas. com/en- eu/support/technical- resources/engineer- school/brushlessdc-motor-01-overview.html. [39] D. Hartman, K. Landis, M. Mehrer, S. Moreno, and J. Kim, Quad-sim: Mathematical model documentation. [40] S. Zhao, “Time derivative of rotation matrices: A tutorial,” arXiv preprint arXiv:1609.06088, 2016. [41] O. Debarre. (2016). Algebre 1 - notes de lecture a l’Ecole Normale Superieure, [Online]. Available: https://www.math.ens.fr/~debarre/Algebre1.pdf. [42] L. Tu, An Introduction to Manifolds, ser. Universitext. Springer New York, 2010, isbn: 9781441974006. [43] B. Mendelson, Introduction to topology, ser. Introduction to Topology v. 1. Allyn and Bacon, 1974.

BIBLIOGRAPHY

133

[44] B. Hall and B. Hall, Lie Groups, Lie Algebras, and Representations: An Elementary Introduction, ser. Graduate Texts in Mathematics. Springer, 2003, isbn: 9780387401225. [45] R. Gilmore, Lie Groups, Physics, and Geometry: An Introduction for Physicists, Engineers and Chemists. Cambridge University Press, 2008, isbn: 9781139637688. [46] J. Gallier. (2018). Notes on differential geometry and Lie groups, [Online]. Available: http://www.seas.upenn.edu/~jean/diffgeom-spr-I.pdf. [47] Wikipedia. (2018). Rodrigues’ rotation formulae, [Online]. Available: https:// en.wikipedia.org/wiki/Rodrigues%27_rotation_formula. [48] R. Mahony, T. Hamel, and J.-M. Pflimlin, “Nonlinear complementary filters on the special orthogonal group,” IEEE Transactions on automatic control, vol. 53, no. 5, pp. 1203–1218, 2008. [49] Y. Zhu, X. Chen, and C. Li, “Some discussions about the error functions on SO (3) and SE (3) for the guidance of a UAV using the screw algebra theory,” Advances in Mathematical Physics, vol. 2017, 2017. [50] F. Bullo and A. D. Lewis, Geometric control of mechanical systems: modeling, analysis, and design for simple mechanical control systems. Springer Science & Business Media, 2004, vol. 49. [51] E. W. Weisstein. (2018). Rotation matrix, [Online]. Available: http://mathworld. wolfram.com/RotationMatrix.html. [52] ——, (2018). Eigen decomposition, [Online]. Available: http : / / mathworld . wolfram.com/EigenDecomposition.html. [53] D. Heeger. (2007). Linear systems theory, [Online]. Available: http://www.cns. nyu.edu/~david/handouts/linear-systems/linear-systems.html. [54] P. Theo. (2018). Equations differentielles, [Online]. Available: http://perso. eleves.ens-rennes.fr/~tpier758/cours/edo.pdf. [55] D. Mellinger and V. Kumar, “Minimum snap trajectory generation and control for quadrotors,” in Robotics and Automation (ICRA), 2011 IEEE International Conference on, IEEE, 2011, pp. 2520–2525. [56] Mavinci. (2018). Mission control, [Online]. Available: http://www.mavinci.de/ mavinci-system/mission-control-software/. [57] J. M. Baudet, “Non-linear attitude control and guidance of a quadrotor UAV,” Instituto Superior Tecnico, Resumo, 2016. [Online]. Available: https://fenix. tecnico.ulisboa.pt/downloadFile/281870113701978/Resumo%20alargado% 20Baudet.pdf. [58] T. D. Hoang. (2018). Geometric nonlinear control MATLAB/Simulink implementation, [Online]. Available: https://github.com/thinhhoang95/geometricquadrotor. [59] MathWorks. (2018). 6DOF (Euler Angles), [Online]. Available: https://www. mathworks.com/help/aeroblks/6dofeulerangles.html. [60] P. I. Corke, “A robotics toolbox for MATLAB,” IEEE Robotics & Automation Magazine, vol. 3, no. 1, pp. 24–32, 1996.

134

BIBLIOGRAPHY

[61] A. Aboudonia, R. Rashad, and A. El-Badawy, “Time domain disturbance observer based control of a quadrotor unmanned aerial vehicle,” in Information, Communication and Automation Technologies (ICAT), 2015 XXV International Conference on, IEEE, 2015, pp. 1–6. [62] A. Mokhtari and A. Benallegue, “Dynamic feedback controller of euler angles and wind parameters estimation for a quadrotor unmanned aerial vehicle,” in Robotics and Automation, 2004. Proceedings. ICRA’04. 2004 IEEE International Conference on, IEEE, vol. 3, 2004, pp. 2359–2366. [63] D. D. Ngo, H. D. A. Le, T. N. Nguyen, and P. N. Nguyen, “Autonomous flight quadcopter analysis,” in Aeronautical Engineering, 2018 PFIEV Students Symposium on, HCMUT, 2018. [64] T. M. I. Hakim and O. Arifianto, “Implementation of dryden continuous turbulence model into simulink for lsa-02 flight test simulation,” in Journal of Physics: Conference Series, IOP Publishing, vol. 1005, 2018, p. 012 017. [65] P. H. Zipfel, Modeling and simulation of aerospace vehicle dynamics. Aiaa, 2000. [66] S.-T. Wang and W. Frost, “Atmospheric turbulence simulation techniques with application to flight analysis,” 1980. [67] MathWorks. (2018). Dryden wind turbulence model (continuous), [Online]. Available: https://www.mathworks.com/help/aeroblks/drydenwindturbulencemodelcontinuous. html.

Suggest Documents