Quadrotor Flight in Constrained Indoor Environments
by
Antonio Matus-Vargas
Dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Science in Computational Science at the Instituto Nacional de Astrof´ısica, Optica´ y Electr´onica Tonantzintla, Puebla, M´exico November, 2020
Supervisors:
Dr. Gustavo Rodr´ıguez G´omez Dr. Jos´eMart´ınez Carranza Coordination of Computational Science INAOE
c INAOE 2020 All rights reserved
The author hereby grants to INAOE permission to reproduce and to distribute copies of this thesis document in whole or in part. 2 Quadrotor Flight in Constrained Indoor Environments by Antonio Matus-Vargas
Submitted to the Coordination of Computational Science on November 26, 2020, in partial fulfillment of the requirements for the degree of Doctor of Science in Computational Science
Abstract
Nowadays, advances in sensor, actuator, and processing technologies have permitted to shrink rotorcraft down to a micro-scale. Thanks to their hovering capability and high maneuverability, micro rotorcraft, classified as micro aerial vehicles (MAVs), are well suited for operating within constrained indoor environments. The autonomous navigation of these vehicles in such environments is a challenge for two main reasons. First, due to payload and energy restrictions, a MAV is equipped with the least quantity of sensors. Second, operation within a constrained environment will place a MAV close to objects, which will induce aerodynamic interactions. The most studied aerodynamic interaction is the ground effect, which can be explained as the cushion of air under the vehicle when it flies closely over a rigid surface. In this thesis, we propose a novel approach for rejecting disturbances induced by the ground effect. To retrieve the position of the vehicle, we employ a monocular camera, which is a lightweight and energy-efficient sensor. Also, we provide experimental evidence that theground effect induces sensor faults. For that reason, we develop the approach asafault- tolerant control scheme, which consists of a detection strategy and mitigation strategy. We assume a hierarchical control structure for trajectory tracking. Specifically, we assume that the nominal control structure consists of an external PD controller and an internal PI controller. In experimental tests, we found that the sensor faults occur on the inner loop, which we counteract in the outer loop by switching between control actions. In a novel approach, we use a metric monocular SLAM algorithm for detecting internal faults. We design the fault detection scheme as a logical process that depends on the weighted residual between inner and outer estimations. Furthermore, we propose two control strategies for fault mitigation. The first combines the external PD controller and a function of the residual (FTC 1). The second treats the sensor fault as an actuator fault and compensates with a sliding mode action (FTC 2). In either case, we utilize onboard sensors only. We evaluate the effectiveness of the strategies in simulations and experiments. The experimental results show that FTC 1 surpasses FTC 2. Finally, we explore the usage of optical flow estimations for the detection and mitigation of the ground effect.
3 Thesis Supervisor: Dr. Gustavo Rodríguez Gómez Title: Full Researcher and Associate Professor
Thesis Supervisor: Dr. José Martínez Carranza Title: Full Researcher and Associate Professor
4 Acknowledgments
The completion of this thesis would not have been possible without the help of a large group of people. First, I would like to extend my deepest gratitude to my supervisors, Gustavo Rodríguez Gómez and José Martínez Carranza. I am grateful to Gustavo for bringing order out of the chaos of my research ideas and for all the superb advice. I thank José for the great discussions, which helped me to develop and explain my research both in spoken and written form. Also, I would like to express my appreciation to all members of my committee for their valuable comments that enhanced this thesis. In my work, I have received invaluable support from Oyuki Rojas Perez, Aldrich Cabrera Ponce, Arturo Cocoma Ortega, David Carrillo López, and Roberto Munguía Silva. Furthermore, I am deeply indebted to my parents, aunt, brother, and sister for always being there for me; and to my friends for the good times over the years. Finally, I have to admit that I lack the poetic skills to express, in a suitable way, my gratitude to Kristel, my fiancée. She always brightens up my day and hopefully will do so for years to come. This research has been funded by the Consejo Nacional de Ciencia y Tecnología (Conacyt), in the framework of the Programa Nacional de Posgrados de Calidad (PNPC) as a scholarship registered to the CVU number 540945. Also, I gratefully acknowledge financial support over the final months by the Instituto Nacional de Astrofísica, Óptica y Electrónica (INAOE).
5 6 Contents
1 Introduction 19 1.1 Justification and Motivation ...... 21 1.2 Problem Statement ...... 23 1.2.1 Research Questions ...... 23 1.2.2 Hypothesis ...... 23 1.3 Objectives ...... 24 1.4 Research Methodology ...... 24 1.5 Contributions ...... 25 1.5.1 Publications ...... 27 1.6 Thesis Outline ...... 28
2 Theoretical Framework 29 2.1 Multirotor UAVs ...... 29 2.2 Hardware ...... 30 2.3 Quadrotor Concepts ...... 34 2.4 Attitude Representations ...... 35 2.4.1 Rotation Matrix ...... 36 2.4.2 Euler Angles ...... 39 2.4.3 Quaternions ...... 41 2.4.4 Rotation Vector ...... 44 2.5 Control Systems ...... 45 2.6 SLAM ...... 47 2.6.1 Metric Monocular SLAM ...... 49
7 2.7 Optical Flow ...... 50 2.8 Deep Learning ...... 53 2.8.1 Convolutional Neural Networks ...... 55
3 Literature Review 59 3.1 Full-scale Helicopter ...... 59 3.1.1 Hovering Flight ...... 59 3.1.2 Forward Flight ...... 62 3.2 Model Helicopter ...... 65 3.2.1 Control ...... 65 3.2.2 Flow Studies ...... 66 3.2.3 Modeling ...... 67 3.3 Multirotor ...... 68 3.3.1 Control ...... 69 3.3.2 Modeling ...... 75 3.3.3 Applications ...... 85 3.4 Other Proximity Effects ...... 86 3.5 Discussion ...... 88 3.6 Chapter Conclusion ...... 90
4 Control Optimization 93 4.1 Deterministic Procedures ...... 94 4.1.1 Related Work ...... 95 4.1.2 Quadrotor Model ...... 96 4.1.3 Mathematical Problem ...... 97 4.1.4 Conjugate Gradient Methods ...... 99 4.1.5 Optimal Control ...... 101 4.1.6 Controllers Implementation ...... 102 4.1.7 Results and Analysis ...... 105 4.1.8 Summary ...... 107 4.2 Stochastic Procedure ...... 108
8 4.2.1 Background on Multirotor Control ...... 109 4.2.2 Multirotor Model ...... 110 4.2.3 Position Control Algorithm ...... 112 4.2.4 Attitude Control Algorithm ...... 113 4.2.5 Cost Function ...... 114 4.2.6 Stochastic Test Signals ...... 116 4.2.7 Results and Analysis ...... 118 4.2.8 Summary ...... 122 4.3 Ground Effect Simulation ...... 123 4.3.1 Optimization with Reduced Vehicle Model ...... 123 4.3.2 Optimization with Full Vehicle Model ...... 125 4.4 Chapter Conclusion ...... 127
5 Discontinuous Control 129 5.1 Multi-controller Structure ...... 129 5.1.1 Drone Overview ...... 131 5.1.2 Proposed Control Structure ...... 132 5.1.3 Experiments ...... 136 5.1.4 Summary ...... 140 5.2 Fault-Tolerant Control ...... 141 5.2.1 Related Work ...... 142 5.2.2 Methods and Materials ...... 144 5.2.3 Results and Discussion ...... 154 5.2.4 Summary ...... 162 5.3 Optical Flow and GE ...... 163 5.3.1 Dataset ...... 164 5.3.2 Training ...... 165 5.3.3 Detection Results ...... 167 5.3.4 Focus of Expansion ...... 168 5.4 Chapter Conclusion ...... 170
9 6 Conclusion 173 6.1 Answers to the Research Questions ...... 174 6.2 Hypothesis and Objectives Assessment ...... 175 6.3 Limitations and Future Research ...... 176
10 List of Figures
1-1 Qualitative schematic view of flow vectors. The pressure above the
vehicle is indicated as 푃푎, the pressure below as 푃푔, and the net force
due to the ground effect as 푓푒...... 22 1-2 Outline of the research methodology...... 25
2-1 UAV classification, based on [56]...... 30
2-2 Main components of a quadcopter...... 31
2-3 Common quadrotor configurations (top view), a) “x” style, b) “+” style. 34
2-4 Degrees of freedom of a quadrotor...... 35
2-5 Block diagrams of a) the open-loop and b) the closed-loop control sys- tems...... 46
2-6 Architecture of a typical SLAM system. The back end can provide feedback to the front end for loop closure detection and verification. . 48
2-7 Geometric configuration to generate the synthetic depth image. . 49
2-8 Snapshots that illustrate the functioning of the metric monocular SLAM; the top row provides samples from camera frames with the tracked fea- tures (green markers); the bottom row displays three views of the map with keyframes (blue pyramids, the first one is green), and map points (red ones are being used for tracking, while black ones are ignored). . 50
2-9 Two visualization techniques of the motion field transforming 퐼1 in 퐼2 [49]...... 52
2-10 A simple CNN architecture, comprised of four layers...... 56
11 3-1 Increase in rotor thrust versus distance from the ground for a variety of helicopters [109]. The legends OH-6A, OH-58A, UH-1H, and UH-1C are codenames for full-scale helicopters...... 60 3-2 Measurements and predictions of rotor power versus forward speed when operating near the ground [109]...... 63 3-3 The flow patterns for a fan in GE represented as a source (a)anda dipole (b) [82]...... 68 3-4 Modeling and mapping of aerodynamic effects acting on a single rotor [172]...... 77 3-5 Two flight cases for testing the influence of the ground in multirotors, (a) flying over an obstacle under the influence of the ground, and(b) hovering at a point with only one rotor under the influence of the ground (partial GE) [168]...... 81 3-6 Problems, trends, and challenges...... 88
4-1 Performance of the tuned PD controller: (a) approximated gradient, (b) analytic gradient...... 106 4-2 States behavior when subjected to the optimal control functions. The inner figure shows the same function performance zoomed in between the time interval 0 s to 0.6 s...... 106 4-3 Cascade control scheme for multirotors...... 110 4-4 Simulation diagram for a quadcopter with torque disturbance. . . . . 118 4-5 Performance of the controllers tuned with deterministic signals: (a) PID, (b) backstepping...... 119 4-6 Performance of the backstepping controller tuned with stochastic test signals...... 120 4-7 Communication/computation structure for flight tests...... 122 4-8 Experimental performance of the tuned backstepping controller: (a)
position, and (b) Euler angles. The set-points were set to (푥ref , 푦ref ,
푧ref , 휓ref ) = (0 m, 0 m, 0.4 m, 0 rad)...... 123
12 4-9 Simulation results of the optimized backstepping controller with similar initial conditions and same set-points as in Fig. 4-8: (a) position, and (b) Euler angles...... 123 4-10 Performance of the PD controller tuned with stochastic ground effect simulation: filtered stochastic signals (a), states behavior (b). For(b),
the references are (푧ref , 휑ref , 휃ref , 휓ref ) = (1 m, 0 rad, 0 rad, 휋/6 rad). 125 4-11 Performance of the backstepping controller tuned with the ground ef-
fect model (3.13). The references are (푥ref , 푦ref , 푧ref ) = (1, 1, 0.35) m...... 126 4-12 Performance of the backstepping controller tuned with the wall effect
model in [158]. The references are (푥ref , 푦ref , 푧ref ) = (1, 1, 1) m. . . . 127
5-1 Quadrotor and reference frame...... 131 5-2 Quadrotor with inner stabilization system...... 132 5-3 Multi-controller switching structure...... 134
5-4 Entrance and departure conditions for 푢2...... 134 5-5 Structure of the integration constants...... 136 5-6 Bebop 2 drone during a test...... 138 5-7 Response of the multi-controller structure...... 139 5-8 Response position for five runs where the quadrotor is tracking acon- stant reference that is close to the ground: multi-controller structure (top) vs classical controller (bottom)...... 140 5-9 Fault-tolerant control schematic...... 149 5-10 Position response while hovering close to the ground...... 156 5-11 Photographs showing the quadrotor in three conditions: a) faultless, b) descending due to an upward sensor fault, and c) ascending due to a downward sensor fault; we indicate the reference with a green line; for supplementary video check https://youtu.be/uszilXBFKP4... 157 5-12 Simulation response of three control strategies...... 158 5-13 Control actions of three control strategies in simulation...... 159
13 5-14 Error response of the control strategies for five tests with the real drone.160 5-15 Sensor, reference, and fault detection signals for individual tests. . . . 161 5-16 Control signals for individual tests...... 162 5-17 Side view of the conditions of the flight tests in which the quadrotor passes over a table, the GE causes an upward disturbance...... 165 5-18 Training and validation results of the top three neural network archi- tectures: (orange) 1-conv-32-nodes-0-dense, (green) 2-conv-32-nodes- 0-dense, and (magenta) 2-conv-32-nodes-1-dense...... 166 5-19 Architecture of the convolutional neural network for detecting the ground effect...... 167 5-20 Qualitative results of the detection scheme. Eight forward-in-time frames ordered from left to right and up to down...... 168 5-21 Qualitative results of the algorithm to estimate the FoE using trajec- tories of interest points [59]. Twelve forward-in-time frames ordered from left to right and up to down, in which the intersection of the lines represent the FoE location...... 169 5-22 Quantitative results of the estimations of the FoE’s vertical location. 170 5-23 Envisaged control scheme based on optical flow...... 170
14 List of Tables
3.1 Control strategies presented in the literature...... 76 3.2 Classification of the ground effect models...... 85
4.1 Variable description...... 98 4.2 Parameter description...... 98 4.3 Optimal control parameters and cost function values...... 105 4.4 Summary of typical control problems and cost functions [128, 98]. . . 115 4.5 Simulation parameters...... 119 4.6 Optimization results with deterministic and stochastic test signals. . . 120
5.1 API inputs of the Bebop 2 quadcopter...... 132 5.2 Parameter values for the switching algorithm...... 138 5.3 Height error statistics comparison between a classical controller and the proposed multi-controller structure...... 139 5.4 Root mean square error of the control strategies in simulation. . . . . 159 5.5 Root mean square error of the strategies with the real drone...... 161
15 16 Acronyms
ANN Artificial Neural Network.
API Application Programming Interface.
BET Blade Element Theory.
CFD Computational Fluid Dynamics.
CG Conjugate Gradient.
CM Center of Mass.
CNN Convolutional Neural Network.
ESC Electronic Speed Controller.
FoE Focus of Expansion.
GE Ground Effect.
IESO Integral Extended State Observer.
IMU Inertial Measurement Unit.
IVP Initial Value Problem.
LQR Linear Quadratic Regulator.
MAV Micro Air Vehicle.
17 MoCap Motion Capture.
MRAC Model Reference Adaptive Control.
NDO Nonlinear Disturbance Observer.
PID Proportional-Integral-Derivative.
QTR Quad TiltRotor.
ReLU Rectified Linear Unit.
RGB Red-Blue-Green.
RISE Robust Integral of the Sign of Error.
RMSE Root Mean Square Error.
RQ Research Question.
SDK Software Development Kit.
SLAM Simultaneous Localization and Mapping.
SMC Sliding Mode Control.
UAV Unmanned Aerial Vehicle.
VTOL Vertical Take-Off and Landing.
18 Chapter 1
Introduction
Humankind has been fascinated by flight since it first observed animals sailing through the air and wondered how they do it. Ancient peoples had a passionate interest in flight, which led them to create stories about gods, demigods, creatures, andobjects endowed with this gift. In particular, the concept of taking off vertically, moving to the destination, and landing vertically has been for centuries the dream of inventors. It is the most logical form of flight because it dispenses with large landing fields located far from city centers [20]. The history of vertical flight can be traced back to about 400 BC with flying toys [86]. The earliest version of the bamboo-copter or Chinese top consisted of a stick with feathers on top, which was spun with the hands and then released into flight. It was not until 1483, when Leonardo da Vinci conceived his design ofthe aerial screw, that any record was made concerning vertical flight. From the 1700s to the 1800s, inventors developed several helicopter models using either elastic energy or steam power. Around 1900, the internal combustion engine became available and made possible human-carrying flight [109]. By 1950, the production of the Sikorsky R-4 helicopter had already finished and the Bell 47 was being mass-produced. Today, the use of rotorcraft has grown widespread in applications such as transportation, search and rescue, disaster relief, construction, and law enforcement. There is a clear connection between the development of flying machines and Un- manned (unhabitated or uncrewed) Aerial Vehicles (UAVs), commonly known as
19 drones. Nikola Tesla deserves credit for having fathered the concept of controlling vehicles without wires [136]. In 1898, Tesla filed his patent US613809A, which he publicly demonstrated with his teleautomaton, a remote controlled one-meter-long boat. Because of the possible military applications, a growing interest in remote controlled vehicles emerged in various countries. The first successful flight by a pow- ered uncrewed airplane occurred in 1918, when a Curtiss-Sperry Aerial Torpedo flew 900 m and then dived at its preset distance into the water [32]. It was recovered and later re-flown. During the 1930s, similar efforts took place to achieve thefirst radio-controlled model airplane. In contrast, the world’s first unmanned helicopter, the Gyrodyne QH-50 DASH (Drone Anti-Submarine Helicopter), appeared until 1960 [92].
Since the 1990s, the development of sophisticated rotorcraft UAVs has rapidly become an attractive research topic in the academy worldwide. In 1991, the first international aerial robotics competition was held at Georgia Institute of Technology. The military also manifested interest in the topic. A multi-year, 35-million-US-dollar program was launched by DARPA (Defense Advanced Research Projects Agency) in 1997, directly aiming to develop Micro Air Vehicles (MAVs) whose largest dimension was set to be at most 15 cm. This initial effort ended in 2001, demonstrating that, over the short run, a 15 cm UAV was simply too small to be workable. Attention was then shifted to larger miniature UAVs, and the MAV nomenclature was redefined for UAVs weighing less than 1 kg and operating at Reynolds numbers1 in the range between 102 and 104 [120].
Nowadays, advances in sensor, actuator, and processing technologies have permit- ted to shrink rotorcraft down to a micro-scale. Thanks to their hovering capability and high maneuverability, rotorcraft MAVs are well suited for search and rescue, re- mote inspection, and aerial photography and videography. Further to this, their small size allows them to operate within confined or cluttered indoor environments that are otherwise inaccessible to larger aircraft. A micro rotorcraft operating in a confined en-
1The Reynolds number (Re) helps foresee the patterns in fluid’s behavior; at low Reynolds num- bers, flows tend to be laminar, while at high Reynolds numbers flows tend to be turbulent.
20 vironment will be subject to disturbances induced by aerodynamic proximity effects. Such disturbances are likely to affect the stability and performance.
1.1 Justification and Motivation
Research on MAVs is a growing area of interest that is being conducted by industries, governments, and universities around the world. MAVs are of interest due to their potential of performing a wide range of civilian and military missions. Specifically, the main advantage of micro and small rotorcrafts over larger aircraft and ground robots is that they can access confined environments such as corridors, air ducts, collapsed spaces, and between buildings. Operation within such environments will require the drone to fly close to objects. The autonomous flight of MAVs indoors is still a challenge in the robotics com- munity for several reasons. First, due to payload and energy restrictions, a MAV is equipped with the least quantity of sensors. The minimal sensor suite for autonomous navigation has been reported to be a monocular camera and an Inertial Measurement Unit (IMU) [74, 113]. However, it is common that a MAV is also equipped with sen- sors for measuring altitude. Second, most research on MAV control has concentrated on handling dynamics when operating in free space, where aerodynamic interactions with nearby surfaces can be neglected [21, 146]. Although aerodynamic effects are mentioned in some works, most of them treat these interactions as random distur- bances, which the control must compensate using feedback. One of the most studied aerodynamic interactions is the Ground Effect (GE), which is the upward lift caused by compressed air beneath the vehicle, as shown in Fig. 1-1. Such effect induces disturbances that are difficult to handle even for tele-operated drones that are inline of sight. The GE has been well researched for helicopters [26, 68, 108]. For multirotors, em- pirical models have been developed [141, 167]. Furthermore, several control schemes have been proposed for compensating the GE in multirotors such as adaptive [106], fuzzy [122], and sliding mode [141]. Many of these techniques yield controllers with
21 (a) Normal (b) Ground effect
Figure 1-1: Qualitative schematic view of flow vectors. The pressure above the vehicle is indicated as 푃푎, the pressure below as 푃푔, and the net force due to the ground effect as 푓푒. open parameters that need to be tuned so that the closed-loop system describes the desired behavior. As a promising solution, optimization methods have been applied for controller tuning. However, optimization methods have not been explored in the control of the GE. Besides the increment in thrust efficiency, the GE causes variations in the pressure altitude measured by barometers [130] and in the distance measurements from range sensors [64]. The first type of sensor is affected by the air pressure around the vehicle. In general, the second type of sensor is affected by abrupt changes on the measurement surface, and some of them by turbulence. Even though several control schemes have been proposed for compensating the GE, most of them have only considered the case in which there are no faults in the rotorcraft. Taking into account faults could be fundamental to explain and control GE disturbances. By multirotors, we refer to rotorcraft with two or more lift-generating rotors. Within this classification, one of the most popular platforms is the quadrotor or quadcopter, a four-rotor helicopter. It is constructed with fixed-pitch propellers and motors mounted over a symmetrical cross-like frame. The movement of the quadrotor is controlled by the throttle in each motor. They possess the ability of omnidirectional movement and a mechanically simple structure, which in turn makes them low-cost. There has been extensive research about the quadrotor, making it an excellent test- bed for novel control techniques. Being able to control a quadrotor MAV near the
22 ground will improve well-known flight missions like hovering, picking-up and releasing objects, taking-off and landing in hard conditions, and operating near the groundin general.
1.2 Problem Statement
In this thesis, we formulate the following problem statement: The quadrotor MAV is disturbed when flying close to the ground within a constrained indoor environment. Here, the adjective “indoor” has two connotations: no GPS signal, and negligible environmental wind. In addition, the environment is constrained, which implies a high risk of collision with adjacent objects. We assume that the vehicle is equipped with an onboard monocular camera, an IMU, and an altimeter.
1.2.1 Research Questions
To gain good insight into the problem statement, we focus on three main Research Questions (RQs):
RQ 1: How can the ground effect be detected autonomously using the least quantity of onboard sensors?
RQ 2: How can unreliable sensors be compensated when the vehicle is flying subject to ground effect?
RQ 3: How can the ground effect be interpreted such that this interpretation canbe exploited to mitigate the ground effect?
1.2.2 Hypothesis
We hypothesize that an onboard monocular camera could provide enough information for detecting and mitigating disturbances induced by the ground effect in confined spaces.
23 1.3 Objectives
The general aim of the research is to design and implement a novel algorithm for reducing the control error of a quadrotor flying subject to ground effect. Particular objectives are:
To design a strategy to detect the GE using the minimum set of sensors on ∙ board the drone.
To carry out an analysis to characterize sensor faults occurring in GE and a ∙ strategy to mitigate such faults.
To propose a method to translate or map the detection of the GE into rules of ∙ compensation, aiming at achieving stable flight.
1.4 Research Methodology
We address the problem statement and the three research questions by employing the following research methodology. We first perform literature research to identify existing models and control meth- ods concerning the GE. Furthermore, we classify both the models and control methods in order to gain insight into their differences on the basis of their theoretical prop- erties (RQ 1, RQ 3). This classification motivates us to explore the application of optimization methods in the control of the GE. Subsequently, we develop an optimization procedure for tuning controllers under the assumption of ideal feedback (RQ 3). We first validate the optimization procedure using a classical controller in simulations. Then, we extend the procedure by intro- ducing stochastic test signals (RQ 3), which is validated with a nonlinear controller in simulations and experiments. Finally, we explore the inclusion of a GE model in the controller tuning procedure in simulation (RQ 3). To complement the previous simulation result, we develop a multi-controller strat- egy for a real quadrotor platform (RQ 3). For this strategy, we assume feedback from
24 a motion capture system. The strategy is validated by comparing its error statistics against a classical controller in real-world experiments. Motivated by the analysis of these experimental results, we relax the assumption of ideal feedback to develop a fault-tolerant control scheme based on monocular Simultaneous Localization and Mapping (SLAM) (RQ 1, RQ 2, RQ 3). We search for a detection strategy and mitigation strategy and evaluate the overall scheme in simulations and experiments. Error statistics of the fault-tolerant scheme are compared against a classical controller and a nonlinear controller. Finally, we explore how to use optical flow for detecting and mitigating the GE in forward flight. The research methodology is outlined in Fig. 1-2.
Figure 1-2: Outline of the research methodology.
1.5 Contributions
In this section, we provide a summary of the contributions that will be presented throughout this thesis.
We perform a thorough literature review by analyzing relevant material con- ∙ cerning the GE on multirotor MAVs. We disclose control methods, modeling approaches, and applications. Specifically, a gap in current knowledge is iden-
25 tified when it comes to acknowledging and addressing GE-related faults inthe control of multirotors.
As a starting point, we analyze two optimization procedures based on conjugate ∙ gradient for model-based quadrotor control tuning, experimentally demonstrat- ing that approximating the gradient by a first-order finite difference formula yields better results than using the analytic Jacobian gradient; this is a coun- terintuitive finding. Moreover, we study the behavior of the approximated gra- dient optimization procedure when stochastic test signals are introduced. It is found that considering stochastic test signals enhances the control optimization output.
We design and implement a novel multi-controller approach for reducing the ∙ control error of a hovering quadrotor under GE. Experimental validation of this approach is provided.
We found experimental evidence of sensor faults occurring in the quadrotor ∙ while in GE. It is important to remark that such evidence was missing in the literature. In particular, we provide evidence that barometric and range (al- timeter) sensors are prone to fail when the vehicle is in GE or transitions to GE.
We design and implement a novel fault-tolerant control scheme for quadrotors ∙ with sensors faults under GE. This scheme consists of a fault detection strategy and a mitigation strategy. We perform validation of the scheme in simulations and experiments, demonstrating that our scheme significantly reduces the con- trol error for a quadrotor hovering in GE.
Finally, we propose a novel application of convolutional neural networks for ∙ detecting the GE in forward flight. We provide evidence that a convolutional neural network can be used to effectively detect the GE from optical flow esti- mations.
26 1.5.1 Publications
The investigations performed during the development of this thesis resulted in the following publications (involved RQs in curly brackets):
1. Conference: A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza, and A. Muñoz-Silva (2017). Numerical optimization techniques for nonlinear quadrotor control. In 2017 International Conference on Unmanned Aircraft Systems (ICUAS), Miami, FL, USA. {RQ 3}
2. Book chapter: A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza (2019). Parametric Optimization for Nonlinear Quadcopter Control using Stochas- tic Test Signals. In: Koubaa A. (eds), Robot Operating System (ROS), Studies in Computational Intelligence, vol. 831, Springer, Cham. {RQ 3}
3. Conference: A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza (2019). Aerodynamic disturbance rejection acting on a quadcopter near ground. In 2019 6th International Conference on Control, Decision and Information Technolo- gies (CoDIT), Paris, France. {RQ 3}
4. Conference: A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza (2019). Quadrotor Control Simulation with Multirate Integration Methods. In Memo- rias del Congreso Nacional de Control Automático, Puebla, Mexico. {RQ 3}
5. Conference: A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza (2019). Sensor Fault Mitigation for MAVs under Ground Effect. In IEEE 5th Work- shop on Research, Education and Development of Unmanned Aerial Systems (RED-UAS), Cranfield, UK. {RQ 1, RQ 2, RQ 3}
6. Journal (JCR Q1): A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza (2019). A Monocular SLAM-based Controller for Multirotors with Sensor Faults under Ground Effect. Sensors, vol. 19(22), 4848. {RQ 1, RQ 2, RQ 3}
7. Journal (JCR Q3): A. Matus-Vargas, G. Rodriguez-Gomez, J. Martinez-Carranza
27 (in submission). Ground effect on rotorcraft unmanned aerial vehicles: Are- view. Submitted to Intelligent Service Robotics. {RQ 1, RQ 3}
We remark that item 6 was published in a journal belonging to the first quar- tile (Q1) according to the Journal Citation Reports (JCR) index. Also, we mostly targeted conferences having significant international recognition.
1.6 Thesis Outline
In this thesis, we study the problem statement and research questions introduced above. The remainder of the thesis outlined as follows. In Chapter 2, we provide definitions of critical concepts. Then, in Chapter 3, we provide an overview ofthe existing literature of the GE on miniature rotorcraft UAVs. As the basis for addressing the research questions, we explore mathematical optimization for tuning controllers in Chapter 4. Subsequently, we directly address the research questions in Chapter 5. In Chapter 6, we provide our conclusions and give recommendations for further research.
28 Chapter 2
Theoretical Framework
This segment provides a general overview of the concepts needed to understand the following chapters of this thesis.
2.1 Multirotor UAVs
There exist a wide variety of UAV sizes, shapes, and configurations. They have been classified using different nomenclatures, but they can be intuitively classified into fixed-, rotary-, flapping-wing, and hybrid (which can transition between classes midflight, e.g., rotary-wing to fixed-wing). The last three classes are well suitedto carry out missions in confined spaces; however, the simpler mechanical design and the well established free-space models of rotary-wing UAVs are the main reasons to choose this class. Initially, rotorcrafts can be sub-classified according to the number of rotors [56]. Furthermore, other configurations have been formed by stacking, fixing at some tilt angle, and dynamically tilting the rotors. An UAV classification diagram is shown in Fig. 2-1. The coplanar quadcopter possesses features that favor flight in confined spaces. For indoor flight, the size, flight time, and costs are the main points to takeinto account. Helicopters are energy efficient because their design allows the use of large propellers; however, their tilting mechanisms make them pricey to maintain. More than two coplanar rotors can increase safety owing to the fact that the vehicle may
29 Figure 2-1: UAV classification, based on [56]. be able to maintain or recover flight if one propeller is lost. On the other hand, rotor redundancy implies an increase of the overall vehicle size, more energy consumption, and more maintenance costs. With respect to tilted configurations, they have been used to passively move in canted channels or to resist any wrench for aerial manipula- tion. The ability to exert horizontal forces for these canted configurations comes with a decrease in total thrust. Dynamical rotor tilting mechanism has been proposed to enhance the controllability properties of quadrotors; sadly, tilting mechanisms com- plicates the mechanical design and construction. In summary, the quadrotor is not the most efficient platform, but it provides a compact footprint with a low overall cost.
2.2 Hardware
The major components of a multirotor are described in the following paragraphs. In Fig. 2-2 the main components of a quadcopter are indicated. The flight control board or flight controller is the brain of the vehicle. Itmayhave integrated sensors and/or have connections for extra measuring devices. It keeps the multirotor aloft by processing the sensing data and precisely controlling the motors. The flight controller tracks the orientation and, possibly, position of the vehicle by
30 Figure 2-2: Main components of a quadcopter. monitoring how it flies. Transmitters and receivers are connected to the flight control board to enable the communication between the aircraft and the ground station. There is a wide range of receiver and transmitter combinations, however, the most widely used technology is radio-frequency. The frame is a cross-like structure to which all the other essential components are attached, it is lightweight, rigid, and can be bought off-the-shelf or it could be designed to any specification. Motor mounts are located at the end of each armand the electronics are housed in a flat area at the center of the cross. Either brushed or brushless motors are used to power the propellers of multirotors. Each motor is independently controlled by an Electronic Speed Controller (ESC), which takes input from the flight controller and sends varying pulses to a motorto make it spin at different rates. The propellers are mechanically attached to the motors and are used to provide lift and thrust for maneuvering. Motors and propellers are configured in such a way that half of them spin clockwise and the other halfspin counter-clockwise. This arrangement attempts to produce a balance of forces and moments, giving some stability to the multirotor. Multirotors are equipped with flight sensors, including accelerometers, gyroscopes, magnetometers, barometers, ultrasonic transducers, GPS receivers, cameras, etc. Sen- sors continually send information to the flight controller, which, as previously men-
31 tioned, processes the data to keep the vehicle aloft.
In the context of UAVs, one of the most important sensing modules is the IMU, which is an electronic device that measures and reports proper acceleration, rotation rate, and sometimes orientation of the vehicle, using a combination of accelerometers, gyroscopes, and sometimes magnetometers. It is common that an IMU contains tri- axis versions of the three aforementioned sensors. When onboard processing is added to the IMU to provide attitude and heading information, it is referred to as an Attitude and Heading Reference System (AHRS). In practice, the AHRS can be programmed inside the flight control board or can be integrated as an external module ofthis board.
Accelerometers, gyroscopes, and magnetometers of an IMU are implemented as MicroelEctroMechanical Systems (MEMS). In particular, an accelerometer is a de- vice that measures the physical acceleration experienced by the object to which it is attached (proper acceleration). Single- and multiple-axis accelerometers can detect both the magnitude and direction of the acceleration as a vector quantity, and can be used to determine orientation by measuring the amount of static pull due to grav- ity. Furthermore, analysis of the movement of the object can be done by monitoring the amount of dynamic acceleration. On the other hand, a gyroscope is a device for measuring the rate of orientation about an axis. These gyroscopes are packaged simi- larly to other integrated circuits and, in many cases, a single part includes gyroscopic sensors for multiple axes. Moreover, some parts incorporate multiple-axis gyroscopes and accelerometers to achieve output that has the full six degrees of freedom. Finally, a magnetometer senses the direction and strength of a magnetic field at a particular location and is used as a compass.
Another important sensing module is the altimeter, which estimates the above the ground altitude of the vehicle. For operation above 20 m from the ground, the altitude is commonly determined with a barometric sensor, based on the measurement of atmospheric pressure. Below 20 m, the altitude is measured with a range sensor, which is based on the transmission either of sound or light. Also, it is common to fuse measurements of the available sensors on board to estimate the altitude. This
32 array of sensors is then referred to as the altimeter.
The inclusion of cameras on board multirotors is now widely adopted for two main purposes: translational stabilization and videography. The first make use ofa low resolution camera pointing below the drone to estimate the lateral and frontal velocities. This is done by combining optical flow estimations from the camera with altitude measurements. On the other hand, a high resolution camera is used for general photography or videography. This camera is mounted over the drone with a tilting and/or panning mechanism that allows filming (and transmitting to the ground station) what is in front of the vehicle. Apart from videography, such a camera can be used to achieve vision-related tasks, such as object recognition, collision avoidance, localization and mapping, etc.
IMU implementations that utilize MEMS fulfill the weight and power requirements of MAVs, however, they typically provide poor accuracy because they are susceptible to time-varying biases and drifts as well as noise generated by the motors. Numerous researchers have sought to improve measurement accuracy by using additional sen- sors, including ultrasonic sensors, pressure sensors, and GPS. While GPS is able to provide more accurate estimates of vehicle states, it is not likely to be feasible when operating within a confined environment due to obstacles denying GPS signals. An- other approach is to use an external Motion Capture (MoCap) system to augment or replace onboard sensors. MoCap is especially useful for collecting high-fidelity flight data, however, it has limited applicability as it cannot be implemented outside of a laboratory environment.
A major drawback of multirotors is their high energy consumption. They are normally fitted with lightweight rechargeable batteries that have the capacity to power all the components during the desired flight endurance period. Most manufacturers and hobbyists use Lithium-ion Polymer (LiPo/LiPoly) batteries.
33 2.3 Quadrotor Concepts
Quadcopters are commonly flown and modeled in two configurations: the “x” (cross, square) configuration and the “+” (plus, diamond) configuration, which are shownin Fig. 2-3. Either way, two of the motors rotate counter-clockwise, while the other two rotate clockwise. This arrangement helps the vehicle to not spin on its vertical axis since the rotational inertia is canceled out, eliminating the need for a tail rotor which is used to stabilize the conventional helicopter.
(a) (b)
Figure 2-3: Common quadrotor configurations (top view), a) “x” style, b) “+” style.
The following lines make sense considering a coordinate system aligned with the positive 푥-axis aligned with the heading direction, the 푧-axis pointing against grav- ity, and the 푦-axis following the right-hand rule. Now, observing how the rotors are distributed, it is easy to note that when the pair of rotors that are spinning in one direction is faster than the other pair, the vehicle will spin on its vertical axis, subsequently leading to a change of heading of the aircraft’s direction of movement. Angular acceleration about the 푥-axis and 푦-axis can be caused without affecting the rotation with respect to the 푧-axis. Increasing thrust for some rotors and decreasing it for others will maintain the vertical axis stability and induce a net torque about the other two. Translational acceleration is achieved by maintaining an inclination angle at the front and/or side of the structure. This way, fixed-pitched rotor blades can be used to maneuver the quadcopter in all dimensions.
34 Hovering is the term used to describe when the rotorcraft maintains a constant position at a selected point in the air. At this point, the forces of lift and weight reach a state of equilibrium. To reach the hovering state, all the propellers must rotate at approximately the same speed to generate collective lift force that offsets the weight of the quadcopter. In general, rotorcraft can climb or descend by altering the vertical balance of forces acting on them. This alteration can be performed by applying throttle, which is the action of increasing (or decreasing) all the propeller speeds by identical amounts. If the quadcopter is tilted then the provided thrust generates accelerations in both vertical and horizontal directions. The quadrotor has six degrees of freedom, three translational and three rotational, represented in Fig. 2-4. Here, the term pose refers to the position and orientation of the quadcopter in a three-dimensional space. The position on the 푥 and 푦 axes shall be named as such, while the position on the 푧 axis may be referred to as altitude. The orientation angles measured shall be named roll (휑), pitch (휃), and yaw (휓), being the rotation angles about the 푥, 푦, and 푧 axis, respectively. The yaw angle may also be referred to as heading.
Figure 2-4: Degrees of freedom of a quadrotor.
2.4 Attitude Representations
The focus on this section is to give a summary of the different formalisms used to represent the attitude of a rigid body. A more detailed explanation is given in [39].
35 The pose of a rigid body is the position and attitude (orientation) of that body. The data for this case is expressed in two different coordinate systems:
The world coordinate system is fixed to the earth; it is also common to said ∙ that is fixed to inertial space. The origin of this coordinate system is denoted
by 푥푤.
The body-fixed coordinate system is rigidly attached to the object of interest. ∙ The origin of this coordinate system is denoted by 푥푏.
Points and vectors are expressed in the body-fixed coordinates and distinguished from those expressed in the world coordinates by a prime symbol.
2.4.1 Rotation Matrix
A rotation matrix is a matrix whose multiplication with a vector rotates the latter while preserving its length. The special orthogonal group of all 3 3 rotation matrices × is denoted by 푆푂(3). Thus, if 푅 = 푆푂(3), then:
det 푅 = 1 and 푅−1 = 푅푇 . ± Two possible conventions exist for defining the rotation matrix that encodes the attitude of a rigid body: a) the matrix that maps from the body-fixed to coordinates to the world coordinates, b) the matrix that maps from the world coordinates to the body-fixed coordinates. Though converting between the two conventions is as trivial as performing the transpose matrix, it is necessary to check that two different sources are using the same convention prior to use results from both sources together. Here, the rotation matrix that encodes the attitude of a rigid body is defined to be the matrix that when pre-multiplied by a vector expressed in the world coordinates
yields the same vector expressed in the body-fixed coordinates. Let 푧 R3 be a vector ∈ in the world coordinates and 푧′ R be the same vector expressed in the body-fixed ∈ coordinates, then the following relations hold:
36 푧′ = 푅푧, 푧 = 푅푇 푧′.
To transform a point from one coordinate system to the other one must subtract the offset to the origin of the target coordinate system before applying the rotation
matrix. Thus, if 푥 R3 is a point in the world coordinates and 푥′ R3 is the same ∈ ∈ point expressed in the body-fixed coordinates, then:
′ ′ 푥 = 푅(푥 푥푏) = 푅푥 + 푥 (2.1) − 푤 푇 ′ ′ 푇 ′ 푥 = 푅 (푥 푥 ) = 푅 푥 + 푥푏. (2.2) − 푤
Substituting 푥 = 0 into Eq. 2.1 and 푥′ = 0 into Eq. 2.2 yields
′ 푇 ′ 푥 = 푅푥푏, 푥푏 = 푅 푥 . 푤 − − 푤
In the computer graphics community, it is quite common to write Eqs. 2.1 and 2.2 as matrix-vector products:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ′ ′ 푥 푅 푥푤 푥 푅 푅푥푏 푥 ⎣ ⎦ = ⎣ ⎦ ⎣ ⎦ = ⎣ − ⎦ ⎣ ⎦ , 1 0푇 1 1 0푇 1 1
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ 푇 ′ 푇 ′ ′ 푥 푅 푥푏 푥 푅 푅푥푤 푥 ⎣ ⎦ = ⎣ ⎦ ⎣ ⎦ = ⎣ − ⎦ ⎣ ⎦ . 1 0푇 1 1 0푇 1 1
A coordinate rotation is a rotation about a single coordinate axis. Enumerating the 푥-, 푦-, and 푧-axes with 1, 2, and 3, the coordinate rotations, 푅푖 : R 푆푂(3), → for 푖 1, 2, 3 , are ∈ { } ⎡ ⎤ ⎡ ⎤ 1 0 0 cos 훼 0 sin 훼 ⎢ ⎥ ⎢ − ⎥ ⎢ ⎥ ⎢ ⎥ 푅1(훼) = ⎢0 cos 훼 sin 훼⎥ , 푅2(훼) = ⎢ 0 1 0 ⎥ , ⎣ ⎦ ⎣ ⎦ 0 sin 훼 cos 훼 sin 훼 0 cos 훼 − 37 ⎡ ⎤ cos 훼 sin 훼 0 ⎢ ⎥ ⎢ ⎥ 푅3(훼) = ⎢ sin 훼 cos 훼 0⎥ . ⎣− ⎦ 0 0 1
A rotation matrix may also be referred to as direction cosine matrix because its elements are the cosines of the unsigned angles between the body-fixed axes and the world axes. Denoting the world axes by (푥, 푦, 푧) and the body-fixed axes (푥′, 푦′, 푧′), ′ let 휃푥′,푦 be, for example the unsigned angle between the 푥 -axis and the 푦-axis. In terms of these angles, the rotation matrix may be written
⎡ ⎤ cos(휃푥′,푥) cos(휃푥′,푦) cos(휃푥′,푧) ⎢ ⎥ ⎢ ⎥ 푅 = ⎢cos(휃푦′,푥) cos(휃푦′,푦) cos(휃푦′,푧)⎥ . ⎣ ⎦ cos(휃푧′,푥) cos(휃푧′,푦) cos(휃푧′,푧)
The rotation matrix may also be thought of as the matrix of basis vectors that define the world and body-fixed coordinate systems. The rows of the rotation matrix are the basis vectors of the body-fixed coordinates expressed in world coordinate, and the columns are the basis vectors of the world coordinates expressed in the body-fixed coordinates.
The multiplication of two rotation matrices yields another rotation matrix whose application to a point effects the same rotation as the sequential application ofthe two original rotation matrices. For example, let
′ ′′ ′ 푧 = 푅푎푧, 푧 = 푅푏/푎푧 = 푅푏/푎푅푎푧 = 푅푏푧,
where
푅푏 = 푅푏/푎푅푎.
Note that the rotations are applied in the reverse order.
38 2.4.2 Euler Angles
Leonhard Euler introduced that three coordinate rotations in sequence can describe any rotation. Consider triple rotations in which the first rotation is an angle 휓 about the 푘-axis, the second rotation is an angle 휃 about the 푗-axis, and the third rotation is an angle 휑 about the 푖-axis. For notational brevity, let arrange these angles in a three-dimensional vector called the Euler angle vector, defined by
푢 := [휑, 휃, 휓]푇 .
The function that maps an Euler vector to its corresponding rotation matrix
3 푅푖푗푘 : R 푆푂(3), is →
푅푖푗푘(휑, 휃, 휓) := 푅푖(휑)푅푗(휃)푅푘(휓). (2.3)
The time derivative of the Euler angle vector is the vector of Euler angle rates. The relationship of the Euler angle rates and the angular velocity of the body is encoded in the Euler angle rates matrix. Multiplying this matrix by the vector of
Euler angle rates gives the angular velocity in the global coordinates. Letting 푒ˆ푖 be the 푖푡ℎ unit vector, the function that maps an Euler angle vector to its corresponding
Euler angle rates matrix, 퐸 : R3 R3×3, is →
푇 푇 푇 퐸푖푗푘(휑, 휃, 휓) := [푅푘(휓) 푅푗(휃) 푒ˆ푖, 푅푘(휓) 푒ˆ푗, 푒ˆ푘], (2.4)
and the related conjugate Euler angle rates matrix function, 퐸′ : R3 R3×3, whose → multiplication with the vector of Euler angle rates yields the body-fixed angular ve- locity is
′ 퐸푖푗푘(휑, 휃, 휓) := [ˆ푒푖, 푅푖(휑)ˆ푒푗, 푅푖(휑)푅푗(휃)ˆ푒푘]. (2.5)
Hence,
′ ′ 휔 = 퐸푖푗푘(푢)푢, ˙ 휔 = 퐸푖푗푘(푢)푢. ˙
39 Noting also that the angular velocity in the body-fixed coordinates may be related to the angular velocity in the global coordinates by
′ 푇 ′ 휔 = 푅푖푗푘(푢)휔, 휔 = 푅푖푗푘(푢) 휔 .
Angular velocities, 휔 and 휔′, and 푢˙ can be eliminated to yield
′ −1 푇 ′ −1 푅푖푗푘(푢) = 퐸푖푗푘(푢)[퐸푖푗푘(푢)] , 푅푖푗푘(푢) = 퐸푖푗푘(푢)[퐸푖푗푘(푢)] .
Thus far, the sequences of coordinate rotations that are able to span all dimen- sional rotations have not been specified. In fact, only 12 of the 27 possible sequences of three integers in 1, 2, 3 satisfy the constraint that no two consecutive numbers { } in a valid sequence may be equal. These are
(푖, 푗, 푘) (1, 2, 1), (1, 2, 3), (1, 3, 1), (1, 3, 2), ∈ { (2, 1, 2), (2, 1, 3), (2, 3, 1), (2, 3, 2),
(3, 1, 2), (3, 1, 3), (3, 2, 1), (3, 2, 3) . }
Euler angle representations have singularities that are said to arise from gimbal lock. Gimbal lock may be understood in different ways. Intuitively, it arises from the indistinguishability of changes in the first and third Euler angles when the second Euler angle is at some critical value. The phenomenon may also be seen in the mathematics, where it manifests itself as singularities. For all parametrizations of the form (푖, 푗, 푖) there exist a singularity at the home position, [휑, 휃, 휓] = [0, 0, 0]. On the other hand, all the Euler angle sequences that do not have a repeated axis have singularities at pitch values of 휃 = 휋/2 + 푛휋, for 푛 Z. A common strategy ∈ for dealing with singularities is to change representations whenever an object nears a singularity. Even more popular is the use of unit quaternions to represent an object’s attitude.
40 2.4.3 Quaternions
William Rowan Hamilton first devised quaternions in the 19th-century. A quaternion,
푞 H, may be represented as a vector, ∈
⎡ ⎤ 푇 푞0 푞 = [푞0, 푞1, 푞2, 푞3] = ⎣ ⎦ . 푞1:3
The adjoint, norm, and inverse of the quaternion, 푞, are
⎡ ⎤ 푞 √︁ 0 2 2 2 2 −1 푞¯ 푞¯ = ⎣ ⎦ , 푞 = 푞0 + 푞1 + 푞2 + 푞3, 푞 = . ‖ ‖ 푞 푞1:3 − ‖ ‖ Quaternion multiplication is not commutative. Multiplication between quaternion 푞 and 푝 is defined by
⎡ ⎤ 푇 푞0푝0 푞1:3푝1:3 푞 푝 = 푞푚(푞, 푝) = ⎣ − ⎦ · 푞0푝1:3 + 푝0푞1:3 푞1:3 푝1:3 − × ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ 푇 푇 푞0 푞1:3 푝0 푝0 푝1:3 푞0 = ⎣ − ⎦ ⎣ ⎦ = ⎣ − ⎦ ⎣ ⎦ , 푞1:3 푞0퐼3 퐶(푞1:3) 푝1:3 푝1:3 푝0퐼3 + 퐶(푝1:3) 푞1:3 −
where the skew-symmetric cross product matrix function 퐶 : R3 R3×3 is defined → by
⎡ ⎤ 0 푥3 푥2 ⎢ − ⎥ ⎢ ⎥ 퐶(푥) = ⎢푥3 0 푥1⎥ . ⎣ − ⎦ 푥2 푥1 0
More compactly, quaternion multiplication may be written as the second quater- nion pre-multiplied by a matrix-valued function of the first quaternion. That is,
41 푞 푝 = 푞푚(푞, 푝) = 푄(푞)푝 = 푄¯(푝)푞 ·
푝 푞 = 푞푚(푝, 푞) = 푄(푝)푞 = 푄¯(푞)푝, ·
where the quaternion matrix function, 푄 : H R4×4 is defined by → ⎡ ⎤ 푞0 푞1 푞2 푞3 ⎡ ⎤ ⎢ − − ⎥ 푇 ⎢ ⎥ 푞0 푞1:3 ⎢푞1 푞0 푞3 푞2⎥ 푄(푞) = ⎣ − ⎦ = ⎢ − ⎥ , ⎢ ⎥ 푞1:3 푞0퐼3 + 퐶(푞1:3) ⎢푞2 푞3 푞0 푞1 ⎥ ⎣ − ⎦ 푞3 푞2 푞1 푞0
and the related conjugate quaternion matrix function, 푄¯ : H R4×4 is defined by → ⎡ ⎤ 푞0 푞1 푞2 푞3 ⎡ ⎤ ⎢ − − − ⎥ 푇 ⎢ ⎥ 푞0 푞1:3 ⎢푞1 푞0 푞3 푞2 ⎥ 푄¯(푞) = ⎣ − ⎦ = ⎢ − ⎥ . ⎢ ⎥ 푞1:3 푞0퐼3 퐶(푞1:3) ⎢푞2 푞3 푞0 푞1⎥ − ⎣ − ⎦ 푞3 푞2 푞1 푞0 − Unit quaternions are quaternions with unity norm, which means that
푞 = 1. ‖ ‖
A unit quaternion can be used to represent the attitude of a rigid body. Recalling the vector 푧 R3 in the global coordinates, and 푧′ R3 the same vector in the ∈ ∈ body-fixed coordinates, then the following relations hold:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ 0 0 −1 0 ⎣ ⎦ = 푞 ⎣ ⎦ 푞 = 푞 ⎣ ⎦ 푞¯ 푧′ · 푧 · · 푧 · ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ 푇 푇 0 1 0 0 = 푄¯(푞) 푄(푞) ⎣ ⎦ = ⎣ ⎦ ⎣ ⎦ , 푧 0 푅푞(푞) 푧
42 where
⎡ ⎤ 2 2 2 2 푞0 + 푞1 푞2 푞3 2푞1푞2 + 2푞0푞3 2푞1푞3 2푞0푞2 ⎢ − − − ⎥ 푅 푞 ⎢ 2 2 2 2 ⎥ . (2.6) 푞( ) = ⎢ 2푞1푞2 2푞0푞3 푞0 푞1 + 푞2 푞3 2푞2푞3 + 2푞0푞1 ⎥ ⎣ − − − ⎦ 2 2 2 2 2푞1푞3 + 2푞0푞2 2푞2푞3 2푞0푞1 푞 푞 푞 + 푞 − 0 − 1 − 2 3
푖 Inverse mappings 푞푅 : 푆푂(3) H for 푖 0, 1, 2, 3 , can be retrieved by inspec- → ∈ { } tion of Eqn. (2.6), however, they are not displayed here for the sake of brevity.
Just as with rotation matrices, sequences of rotations are represented by products of quaternions. That is, for unit quaternions 푞 and 푝, it holds that
푅푞(푞 푝) = 푅푞(푞)푅푞(푝). ·
The main disadvantage of unit quaternions is that they are constrained to have unit length. Furthermore, the unity norm constraint is quadratic in form and thus can lead to complications when attempting to optimize over the quaternion parameters.
Alternatively, it is possible to parameterize the attitude of a rigid body with an angle 훼 R and a unit vector 푛 S2, where S2 := 푣 R3 푣 = 1 . The ∈ ∈ { ∈ | ‖ ‖ } quaternion that arises from a rotation 훼 about an axis 푛 is given by the axis-angle
2 quaternion function, 푞푎 : R S H, defined by × → ⎡ ⎤ cos(1/2훼) 푞푎(훼, 푛) := ⎣ ⎦ . 푛 sin(1/2훼)
This representation, while perhaps more intuitive than quaternion, is functionally equivalent to it: both require four parameters and a single quadratic constraint.
The inverse mappings, from unit quaternion to the corresponding axis and angle
2 of rotation, are 훼푞 : H R and 푛푞 : H S , defined by → →
푞1:3 푞1:3 훼푞(푞) := 2 arccos(푞0), 푛푞(푞) := = . √︀ 2 푞1:3 1 푞 ‖ ‖ − 0 43 2.4.4 Rotation Vector
One of the major drawbacks of quaternions is that they require a quadratic norm constraint in order to be valid rotations. This problem can be overcome by folding the unity norm constraint into the parametrization. The rotation vector appears to be the most natural three-dimensional parametrization of the quaternion representation of an object’s attitude.
2 The rotation vector is a function of the axis and angle of a rotation, v푎 : R S × → R3, given by
v푎(훼, 푛) := 훼푛.
Noting that 푛 = 1, the previous definition may be inverted to yield the functions, ‖ ‖ 3 3 2 훼푣 : R R and 푛푣 : R S , defined by → →
v 훼푣(v) := v , 푛푣(v) := . ‖ ‖ v ‖ ‖ 3 The function that maps a rotation vector to a unit quaternion, 푞푣 : R H, is → defined by
⎡ ⎤ cos( v /2) 푞푣(v) := 푞푎(훼푣(v), 푛푣(v)) = ⎣ ‖ ‖ ⎦ . v sin( v /2) ‖v‖ ‖ ‖ 3 The inverse mapping, v푞 : H R , which maps a unit quaternion to a rotation → vector, is given by
푞1:3 2 arccos(푞0) v푞(푞) := 훼푞(푞)푛푞(푞) = 2 arccos(푞0) = 2 1/2 푞1:3 푞1:3 (1 푞 ) ‖ ‖ − 0 The multiplication of two rotation vectors 푢 and 푣 R3 is defined in terms of the ∈ product of quaternions:
푣 푢 = v푚(푣, 푢) = v푞(푞푚(푞푣(푣), 푞푣(푢))). * Basically, the expression above indicates that the product computed by converting
44 each rotation vector to a unit quaternion, performing the quaternion product, and then converting back to a rotation vector. Now, consider an object with a body-fixed angular velocity of 휔′(푡) and the change in attitude from time 푡0 to time 푡1. The rotation vector over this interval is defined to be
∫︁ 푡1 ′ v휔′ (푡0, 푡1) := 휔 (푡)푑휏. 푡0 If the body-fixed angular velocity is provided as discrete samples (from asetof gyros for example) the integration will have to be carried numerically. If at time 푡0 the body has a quaternion attitude of 푞0, then the attitude at time 푡1 is
푞1 = 푞푣(v휔′ (푡0, 푡1)) 푞0. · This equation may be generalized to read
푞푖+1 = 푞푣(v휔′ (푡푖, 푡푖+1)) 푞푖, · which gives a simple update rule for tracking the attitude of an object over time. This method is more accurate than integrating the Euler angles rates.
2.5 Control Systems
The autonomous flight of a quadrotor requires the implementation of a controller. This subsection shall present concepts in order to provide a better understanding of a control system implementation. In modern control theory, the physical object to be controlled is commonly referred to as the plant. A set of variables from the plant is measured and controlled, which is also referred to as the output of the system. The user feeds the system with a set of desired values, also called the reference or setpoint. The task of the controller is to issue a control signal to compensate for the difference between the output and the reference. In other words, the action of control means measuring the value of the
45 (a)
(b)
Figure 2-5: Block diagrams of a) the open-loop and b) the closed-loop control systems. controlled variables to correct or limit the deviation of the measured value from the desired value [144]. On the contrary, a disturbance is a signal that tends to adversely affect the value of the system output. If a disturbance is generated within thesystem it is called internal, while an external disturbance is caused outside the system and is an input. Control systems can be classified in open-loop and closed-loop systems. The for- mer only uses the user input to obtain the desired output, however, it cannot com- pensate for external disturbances. Closed-loop control systems operate with output feedback. A sensor provides the output measurement which is compared with the reference value in order to produce the desired value at the output. Therefore, the closed-loop system is able to compensate for external disturbances. General block diagrams for both aforementioned control systems are displayed in Fig. 2-5. Consider a dynamical system, where:
푦 is the output–represents what is “visible” from outside the system. ∙
푥 is the state of the system–characterizes the state of the system. ∙
푢 is the control input–makes the system move. ∙ 46 The system can be represented either by differential equations or difference equa- tions. In this thesis, it is assumed that the system can be represented by the following form:
푥˙ = 푓(푥(푡), 푢(푡)) (2.7) 푦 = ℎ(푥(푡), 푢(푡)).
With the previous definitions, the general control problems are:
1. Open-loop control–find 푢(푡) such that lim푡→∞ 푦(푡) 푦푑(푡) = 0. ‖ − ‖
2. Closed-loop control–find 푢(푥(푡)) such that lim푡→∞ 푦(푡) 푦푑(푡) = 0. ‖ − ‖ In particular, there exist three subproblems of the general closed-loop control problem:
a) Tracking problem–find 푢(푥) such that lim푡→∞ 푥(푡) 푥푑(푡) = 0. ‖ − ‖
b) Stabilization problem–find 푢(푥) such that lim푡→∞ 푥(푡) 푥푑 = 0 for 푥푑 = ‖ − ‖ constant.
c) Null stabilization problem–find 푢(푥) such that lim푡→∞ 푥(푡) 푥푑 = 0 for 푥푑 = ‖ − ‖ 0.
In any case, a null stabilization problem of 푧(푡) = 푦(푡) 푦푑(푡) can be posed. −
2.6 SLAM
The term SLAM was originally developed by John J. Leonard and Hugh Durrant- Whyte [110] based on earlier work by Smith, Self, and Cheeseman [179]. It is con- cerned with the problem of building or updating a map of an unknown environment while at the same time keeping track of an agent’s location within it. The goal of the SLAM process is to use the environment to update the position of the agent. Since the odometry of the agent is often erroneous, we cannot rely directly on it. We can use sensor data to correct the position of the agent. This is accomplished
47 by extracting features from the environment and re-observing when the robot moves around. These features are commonly called landmarks and are used for updating the estimation of the agent’s position. An estimation algorithm keeps track of the uncertainty in the agent’s position and also the uncertainty of the landmarks the agent has seen in the environment. When the odometry changes, because the agent moves, the uncertainty of the agent’s new position is updated by the estimation algorithm. Landmarks are then extracted from the environment in the agent’s new position. Subsequently, these landmarks are associated with observations of landmarks the agent has previously seen. Re-observed landmarks are used to update the agent’s position with the estimation algorithm. Landmarks that have not been previously seen are consumed by the estimation algorithm as new observations so they can be re-observed later. The architecture of a SLAM system can be summarized in two main components: the front end and the back end [24]. This architecture is depicted in Fig 2-6. The front end abstracts sensor data into models amenable for estimation. It handles the feature extraction and tracking in the sensor data stream. Also, it creates long-term associations that reduce drift by recognizing places that have been encountered before. On the other hand, the back end performs inference on the abstract data produced by the front end. It takes care of localizing the agent as well as handling the overall geometrical reconstruction. The SLAM estimate contains the tracked features, their locations and relations, as well as the agent position within the environment.
Figure 2-6: Architecture of a typical SLAM system. The back end can provide feedback to the front end for loop closure detection and verification.
48 2.6.1 Metric Monocular SLAM
Sensors have a big impact on the SLAM process. Early SLAM approaches focused on the use of range sensors, such as sonar and laser. Nevertheless, there are two main disadvantages with the use of range sensors in SLAM: data association becomes difficult, and some of them are limited to 2D maps [126]. For that reason, recent works have moved towards the use of cameras as the primary sensing mode. Cameras provide valuable information for data association in 3D, they are lightweight, cheap, and low-power. Given a monocular onboard camera, ORB-SLAM2 can be employed to obtain the camera pose and 3D point estimates without metric [127]. To address the scale problem, assuming planar ground and knowing the camera angle and distance to the ground, we can obtain a synthetic depth image by resolving the ray-ground inter- section geometry. This synthetic image can be coupled with incoming RGB images and then fed to the RGB-D version of ORB-SLAM2, which generates metric pose estimates [162, 125].