• No results found

Flight control of a quadrotor: theory and experiments

N/A
N/A
Protected

Academic year: 2021

Share "Flight control of a quadrotor: theory and experiments"

Copied!
102
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of

MASTER OF APPLIED SCIENCE

in the Department of Mechanical Engineering

c

⃝ Kunwu Zhang, 2016 University of Victoria

All rights reserved. This thesis may not be reproduced in whole or in part, by photocopying or other means, without the permission of the author.

(2)

Flight Control of a Quadrotor: Theory and Experiments

by

Kunwu Zhang

B. Eng., Hubei University of Science and Technology, 2013

Supervisory Committee

Dr. Yang Shi, Supervisor

(Department of Mechanical Engineering)

Dr. Nikolai Dechev, Departmental Member (Department of Mechanical Engineering)

(3)

(Department of Mechanical Engineering)

Dr. Nikolai Dechev, Departmental Member (Department of Mechanical Engineering)

ABSTRACT

In the last decade, the quadrotor has been adopted in many application areas. Deign-ing an effective flight control algorithm for the quadrotor has attracted great interests in both control and robotics communities. This thesis focuses on the flight control of the quadrotor by using two different methods: The extend Kalman filter (EKF)-based linear quadratic regulator (LQR) method and the learning-based model predictive control (LBMPC) method.

This thesis investigates the flight control of a quadrotor subject to model uncer-tainties and external disturbances. An LQR-based tracking algorithm is proposed. The designed LQR controller is hard to be implemented because of the existing noises in the measured states. A modified EKF is then designed for the online estimation of the position, velocity and motor dynamics by using the measured outputs. The simulations and experimental results are provided to evaluate the proposed algorithm. The tracking control problem of the quadrotor subject to external disturbances and physical constraints is also studied. A model predictive control (MPC)-based tracking control algorithm is adopted. To reduce the computational load, a modified prior barrier interior-point method is adopted to solve the quadratic programming (QP) problem. Nevertheless, the achievable flight performance by using the stan-dard MPC algorithm is affected by external disturbances. An LBMPC algorithm is introduced for the disturbance rejection. The simulation results obtained from the LBMPC algorithm are also provided.

(4)

Contents

Supervisory Committee ii

Abstract iii

Table of Contents v

List of Figures viii

Acknowledgments xii

Nomenclature xiii

1 Introduction 1

1.1 Overview of the unmanned aerial vehicle (UAV) . . . 1

1.2 Recent developments of the quadrotor . . . 3

1.3 Previous work on the control of the quadrotor . . . 4

1.3.1 System dynamics . . . 4

1.3.2 Control methods . . . 5

1.3.3 Applied control methods . . . 8

1.4 Contributions . . . 11

1.5 Thesis organization . . . 11

2 Experimental Setup 13 2.1 Overview . . . 13

2.2 Quanser QBall-X4 . . . 14

2.2.1 Protective cage and frame . . . 14

2.2.2 HiQ DAQ and the Gumstix computer . . . 14

2.2.3 Batteries . . . 15

2.2.4 Motors and propellers . . . 16

(5)

2.4 Conclusion . . . 24 3 System Modeling 25 3.1 Introduction . . . 25 3.2 Quadrotor kinematic . . . 26 3.3 Quadrotor dynamics . . . 31 3.3.1 Forces calculation . . . 32 3.3.2 Torques calculation . . . 33

3.3.3 Final quadrotor dynamic equations . . . 34

3.4 Simplified quadrotor dynamics . . . 35

3.4.1 Simplified quadrotor dynamics involving the motor dynamics . 37 3.5 Conclusion . . . 38

4 EKF-based LQR controller design 39 4.1 Overview . . . 39

4.2 LQR controller design . . . 40

4.3 Simulations . . . 43

4.3.1 Preliminaries . . . 43

4.3.2 Simulations for the nominal system . . . 46

4.3.3 Simulations for the uncertain system . . . 48

4.4 Experiments . . . 50

4.5 Conclusion . . . 53

5 MPC control 55 5.1 Overview . . . 55

5.2 Standard MPC . . . 56

5.3 Modified primal barrier interior-point method . . . 59

5.3.1 Preliminaries . . . 59

5.3.2 Basic primal barrier interior-point method . . . 62

5.3.3 Modified primal barrier interior-point method . . . 64

5.4 Learning-based MPC . . . 66

(6)

5.4.2 LBMPC algorithm . . . 69 5.5 Numerical simulations . . . 70 5.5.1 Preliminary . . . 70 5.5.2 Simulations for the modified primal barrier interior-point method 74 5.5.3 Simulations for the nominal system . . . 74 5.5.4 Simulations for the uncertain system . . . 75 5.6 Conclusion . . . 78

6 Conclusions and future works 80

6.1 Conclusions . . . 80 6.2 Future work . . . 81

(7)

List of Figures

Figure 1.1 The AtlantikSolar fixed-wing UAV developed by Autonomous

System Lab, ETH Zurich 1. . . . 2

Figure 1.2 The A160T Humingbird rotary-wing UAV designed by Boeing 2. 2 Figure 1.3 The QBall-X4 quadrotor. . . 3

Figure 1.4 The quadrotor with tilting propellers. . . 4

Figure 2.1 Quanser QBall-X4 X-4. . . 14

Figure 2.2 HiQ DAQ board. . . 15

Figure 2.3 Two 2500mAh LiPo batteries. . . 16

Figure 2.4 QBall-X4 motor distribution. . . 17

(a) One motor connected with ESC. . . 17

(b) 4 motors symmetrically mounted on QBall-X4 frame. . . 17

Figure 2.5 The wireless setting for the host computer. . . 18

(a) The wireless USB adapter setting. . . 18

(b) Checking the connection between the QBall-X4 and the host PC. 18 Figure 2.6 The Optitrack camera. . . 20

Figure 2.7 The distribution of cameras. . . 20

Figure 2.8 The initial Motive screen shot. . . 21

(a) Quick start menu. . . 21

(b) Main Motive screen for the calibration. . . 21

Figure 2.9 Wand and the ground plane used in the experiments. . . 22

(a) Three marker wand. . . 22

(b) Ground plane. . . 22

Figure 2.10Wand and the ground plane used in the experiments. . . 23

(a) The screen shot for the data collection. . . 23

(b) The screen shot for the optimization progress. . . 23

Figure 2.11The created rigid body for QBall-X4. . . 24

(8)

Figure 3.2 The hovering condition. . . 27

Figure 3.3 The roll angle. . . 28

(a) Rotation around X-axis. . . . 28

(b) Roll movement. . . 28

Figure 3.4 The pitch angle. . . 28

(a) Rotation around Y -axis. . . . 28

(b) Pitch movement. . . 28

Figure 3.5 The yaw angle. . . 29

(a) Rotation around Z-axis. . . . 29

(b) Yaw movement. . . 29

Figure 3.6 The system block diagram. . . 36

(a) The one-loop control structure. . . 36

(b) The inner-outer control structure. . . 36

Figure 4.1 The inner-outer control structure. . . 40

(a) The system strucutre for the EKF-based LQR control algorithm. 40 (b) The system strucutre for the LQR control approach only. . . 40

Figure 4.2 Simulation results for the nominal system: Time responses of x positions . . . 47

Figure 4.3 Simulation results for the nominal system: Time responses of y positions . . . 47

Figure 4.4 Simulation results for the nominal system: Time responses of θ angles . . . 48

Figure 4.5 Simulation results for the nominal system: Time responses of ϕ angles . . . 48

Figure 4.6 The Saturation block . . . . 49

Figure 4.7 Simulation results for the uncertain system: Time responses of x positions. . . . 50

(a) Time responses of x positions in simulations. . . . 50

(b) The tracking errors. . . 50

Figure 4.8 Simulation results for the uncertain system: Time responses of y positions. . . . 50

(a) Time responses of y positions in simulations. . . . 50

(9)

Figure 4.10Simulation results for the uncertain system: Time responses of

ϕ angles. . . . 51

(a) Time responses of ϕ angles in simulations. . . . 51

(b) The tracking errors. . . 51

Figure 4.11The Quanser UVS platform. . . 51

Figure 4.12Experimental results for the QBall-X4: Time responses of x po-sitions. . . 53

(a) Time responses of x positions in experments. . . . 53

(b) The tracking errors. . . 53

Figure 4.13Experimental results for the QBall-X4: Time responses of y po-sitions. . . 53

(a) Time responses of y positions in experments. . . . 53

(b) The tracking errors. . . 53

Figure 4.14Experimental results for the QBall-X4: Time responses of θ angles. 53 (a) Time responses of θ angles in experments. . . . 53

(b) The tracking errors. . . 53

Figure 4.15Experimental results for the QBall-X4: Time responses of ϕ angles. 54 (a) Time responses of ϕ angles in experments. . . . 54

(b) The tracking errors. . . 54

Figure 5.1 Simulation results for x positions obtained from the basic and modified primal barrier interior-point methods. . . 75

(a) Time responses of x positions in simulations. . . . 75

(b) The performance differences. . . 75

Figure 5.2 Simulation results for the nominal system: Time responses of x positions. . . 75

Figure 5.3 Simulation results for the nominal system: Time responses of y positions. . . 76

Figure 5.4 Simulation results for the nominal system: Time responses of θ angles. . . 76

(10)

Figure 5.5 Simulation results for the nominal system: Time responses of ϕ angles. . . 76 Figure 5.6 Simulation results for the uncertain system: Time responses of

x positions. . . . 77 (a) Time responses of x positions in simulations. . . . 77 (b) The tracking errors. . . 77 Figure 5.7 Simulation results for the uncertain system: Time responses of

y positions. . . . 78 (a) Time responses of y positions in simulations. . . . 78 (b) The tracking errors. . . 78 Figure 5.8 Simulation results for the uncertain system: Time responses of

θ angles. . . . 78 Figure 5.9 Simulation results for the uncertain system: Time responses of

(11)

study. He always offered outstanding suggestions in the countless individual meetings and group meetings throughout my time at Victoria to date, and many tips have laid the foundation of this thesis. He always encouraged me with great patience when I suffered from frustrations. I cannot image how I could have completed my master program without his help.

I would like also to thank the committee members, Dr. Kui Wu and Dr. Nikolai Dechev, for their outstanding suggestions.

Moreover, I greatly enjoy being one of our group members. I would like to show my appreciation to my group members. Dr. Mingxi Liu helped me settle down when I arrived in Vicotria and gave me many constructive suggestions. Bingxian Mu introduced me a lot for the academic research and writing. I highly enjoyed collaborating with him on the Quanser project. Chao Shen showed me the tricks for solving the optimization problems. Thank Jicheng Chen not only for instructing me the MPC knowledge, but also for the help in my daily life. Thank Qianyan Shen for revising my thesis, and Yuanye Chen for providing suggestions for my research. I really appreciate the suggestions and help from other group members including Haoqiang Ji, Xiang Shen, Lei Zhuo, Zhuo Zhang and Chengcheng Zhao.

(12)

Acronyms

UAV unmanned aerial vehicle LQR linear quadratic regulator MPC model predictive control EKF extended Kalman filter

PID proportional-integral-derivative LTI linear time-invariant

DAQ data acquisition

(13)

1.1

Overview of the unmanned aerial vehicle (UAV)

In the last decade, due to the great development of micro-electromechanical systems, actuators, batteries and embedded microcomputer techniques, a vast amount of re-search efforts have been put on designing and controlling UAVs [1]. Because of the inherent characteristics of UAVs, such as the high maneuverability and the capabil-ity of carrying great payload, UAVs have been widely applied for the both civilian and military applications. Depending on the propulsion mode, UAVs can mainly be divided into two categories: The fixed-wing UAV and the rotary-wing UAV.

The fixed-wing UAV has rigid wings making the flight feasible, such as the At-lantikSolar fixed-wing UAV shown in Figure 1.1. For the fixed-wing UAV, the forward thrust generated by the electric motor or the combustion engine produces the for-ward airspeed. The airspeed and fixed wings will cause the lift required by the flight. Comparing with the rotary-wing UAV, the fixed-wing UAV has a simpler mechani-cal structure, leading to cheaper manufacturing and maintaining costs. However, as the runway or the launcher is required when taking off or landing, fixed-wing UAVs cannot fly in a narrow space. Since fixed-wing UAV has to keep moving forward to generate the lift, it is invalid for stationary duties, such as inspection works. Accord-ing to the positions of wAccord-ings, the common fixed-wAccord-ing UAVs are the high wAccord-ing UAV, the mid wing UAV and the low wing UAV.

The rotary-wing UAV has a wide range of the number of propellers starting from 1 up to 16. For example, the A160T Humingbird rotary-wing UAV designed by Boeing Company is shown in Figure 1.2. The rotary-wing UAV is different from the

(14)

fixed-Figure 1.1: The AtlantikSolar fixed-wing UAV developed by Autonomous System Lab, ETH Zurich 1.

wing UAV that the lift can be directly produced by propellers. The rotary-wing UAV is able to vertically take off and land. The rotary-wing UAV is also capable of hovering at the certain height. Therefore, the rotary-wing UAV can operate within a small vicinity. But the rotary-wing UAV has more complicated mechanical and electronic structure in comparison to the fixed-wing UAV, leading to greater manufacturing and maintaining costs. Based on the number of propellers, the common rotary-wing UAVs are helicopters, tricopters, quadcopters, hexacopters and octocopters.

Figure 1.2: The A160T Humingbird rotary-wing UAV designed by Boeing 2.

1http://www.atlantiksolar.ethz.ch/?attachment id=854

(15)

copters. As shown in Figure 1.3, 4 propellers are symmetrically mounted on the crossbeam, and separated into two groups rotating at opposite directions. Because of the specific structure of the quadrotor, the rotary torque effectiveness is balanced. The quadrotor also has higher accelerations than traditional helicopters due to its light weight and powerful motors. The quadrotor can conduct complicated tasks such as mapping and navigation [2], wildfire surveillance [3], power line inspections [4] and agriculture applications [5].

Figure 1.3: The QBall-X4 quadrotor.

Since the quadrotor has 4 actuators with 6 degrees of freedom, it is an under-actuated system. The system dynamics for the linear motions and the angular rota-tions of the quadrotor are coupled. The quadrotor cannot reach an arbitrary position in the space, which limits its trajectories and applications. In order to solve this prob-lem, the tilting mechanism is applied. In [6], the authors design a novel mechanism so that four propellers are capable of tilting about the frame. Figure 1.4 shows this novel mechanism. The tilting angles of the propellers can be controlled by using 4 extra actuators, hence the linear motions and the angular rotations of the quadrotor are decoupled. This novel quadrotor can be a fully-actuated system. Another tilting mechanism is the tilted wings described in [7], in which 4 propellers are fixed on two tilting wings.

(16)

Figure 1.4: The quadrotor with tilting propellers.

1.3

Previous work on the control of the quadrotor

As aforementioned, the quadrotor has attracted increasing attention. Enormous ef-forts have been made to develop the control algorithms for the tracking problem of the quadrotor. In this section, the recent studies on the flight control of the quadrotor will be described.

1.3.1

System dynamics

The quadrotor dynamics consist of aerodynamic effects, inertial torques, gyroscope effects, gravity, and frictions. Assume that the quadrotor and all propellers are rigid bodies, the quadrotor dynamics can be derived by using the Newton-Euler formalism. If perturbations are small, the theoretical model is accurate enough to describe the motions and orientations of the quadrotor [8, 9]. Bouabdallah et al. [10] use the same methodology to derived the quadrotor dynamics involving the motor dynamics.

However, there exist high nonlinearities in the full quadrotor dynamics making the design of flight controller complicated. The simpified nonlinear quadrotor dynamics can be obtained by omitting the gyroscope effects and frictions due to the lower airspeed [11]. The gravity of the quadrotor and the total thrust generated by all propellers are considered as equal at the hovering flight. As introduced in [12, 13], if and the orientations are small at the hovering flight, the nonlinear quadrotor dynamics can be linearized.

Given the full quadrotor dynamics, if perturbations are small when the quadrotor hovers at the certain height, the angular rotation of quadrotor are independent on its linear translations, while the translational motions of the quadrotor depend on its orientations [14]. Therefore, the quadrotor system can be split into two groups

(17)

of the quadrotor due to the existed uncertainties mainly caused by model inaccuracy, external disturbances and measurement inaccuracy. The details about each part are given as follows.

• Model inaccuracy

The model inaccuracy is mainly caused by the following reasons: 1) The lin-earized quadrotor dynamics are widely used for simplifying the controller design. 2) Some system parameters are inaccurate including the rotational inertia and the weight of the quadrotor. 3) The motor dynamics are assumed to be a first-/second-order system which may not exactly describe the thrust generated by propellers. The problem of the model inaccuracy can be solved by identifying the system dynamics through experiments [18–20], or by considering it as an external disturbance in [11, 16, 18].

• External disturbances

During the flight, the quadrotor is usually affected by external disturbances, including the severe wind, the actuator failure and the additional payload. In [21], the quadrotor is operated under the strong wind. In [22], an unknown payload is connected to the quadrotor by using a flexible cable. The loss of the motor effectiveness is considered and handled in [23].

• Measurement inaccuracy

The inaccurate measurement is usually produced by the following reasons: 1) There exist sensor noises so that the measured data are inaccurate. 2) The sen-sor loses effectiveness leading to the unavailable states. To solve this problem, the estimator are usually adopted, as described in [24].

1.3.2

Control methods

As aforementioned, the quadrotor are always subject to several uncertainties. In nearly ideal cases, perturbations are small so that the quadrotor dynamics are con-sidered to be accurate. The control methods are not required to be capable of handling

(18)

the uncertainties. For the complicated working environment, the robustness of con-trol methods applied to the quadrotor is required due to external disturbances. In this subsection, the recent works on the control methods for the quadrotor will be reviewed.

Control methods for the nominal system

If uncertainties are not considered, the nonlinear model can accurately describe the motions of the quadrotor. The nonlinear model of the quadrotor have been widely studied due to the model accuracy. Many nonlinear methods have been adopted to control the quadrotor. In [8], Mistler et al. linearize the quadrotor dynamics by using the exact linearization technique, and then design a dynamic feedback controller to solve the path following problem of the quadrotor. In [25], the authors propose two nonlinear control methods: The backstepping method and the sliding mode method, in which the inner-outer loop structure is employed with the consideration of full quadrotor dynamics. The linear motion subsystems are controlled by using the back-stepping technique. The sliding mode technique and the backback-stepping technique are applied to the attitude subsystems of the quadrotor, respectively.

As mentioned in Section 1.3.1, the nonlinearities of the quadrotor dynamics make the controller design and implementation complicated. The linearized quadrotor dy-namics are sufficiently accurate to describe the motions of the quadrotor when the quadrotor is nearly hovering at certain height. The linear control methods are widely adopted for the flight control of the quadrotor. The classical proportional-integral-derivative (PID) controllers are proposed in [26, 27] to track a desired point.

The linear quadratic regulator (LQR) technique is also widely used for the lin-earized quadrotor dynamics due to the simple implementation and the good perfor-mance. In [27], Bouabdallah et al. update the linearized quadrotor model around each equilibrium point, and develop an adaptive LQR controller to regulate the ori-entations of the quadrotor. In [28], the quadrotor model linearized by using feedback linearization, then an LQR controller is proposed to regulate the orientations of the quadrotor. A model-free-control-based LQR controller is designed and implemented in [29].

When considering physical constraints of the quadrotor, e.g., the limited input voltage of motors and the constricted flying area, the LQR method is unable to han-dle system constraints. The model predictive control (MPC) technique is a good

(19)

tracking control algorithms of the quadrotor based on the LQR technique and the MPC technique, respectively. The details will be described in latter chapters.

Control methods for the uncertain system

If external disturbances are small, the uncertainties are mainly caused by parameter perturbations, which can be solved by identifying the quadrotor dynamics. In [19], the translational position subsystems of the quadrotor are considered as second-order linear systems. The unknown parameters can be obtained by using the step response. According to the identified models, Iskandarani et al. propose linear MPC algorithms to solve the trajectory tracking problem. In [18], the attitude subsystems are identified by using a similar methodology. The linearized quadrotor dynamics can be also rewritten in a piecewise affine representation around the equilibrium point, and be updated around different operating points [21, 30].

In order to deal with external disturbances, in recent years, enormous efforts have been made to improve the robustness of the flight controller of the quadrotor. The integral-based methods can be adopted to deal with external disturbances by con-sidering the sum of errors. The integral-based actions may lead to an additional disturbance if the nonlinearities of the quadrotor dynamics are omitted [31]. There-fore, the full quadrotor dynamics need to be considered when using integral-based methods. Bouabdallah and Siegwart [32] propose an integral backstepping control algorithm to counteract external disturbances. In [31], the authors design an integral-prediction-based nonlinear H control algorithm for the path following problem of the quadrotor.

For the linearized quadrotor dynamics, because of the additional disturbance caused by using integral actions, the observer-based control algorithms have been widely adopted. One common observer is based on the sliding mode technique. A high-order sliding mode observer is proposed in [33] for the state estimation and the disturbance rejection. In [34], Besnard et al. develop a sliding mode observer only relying on the boundaries of the disturbance. Some other observers including the extended Kalman filter (EKF), the linear observer and the nonlinear

(20)

symmetry-preserving observer are given in [13,35,36]. A modified EKF will be adopted in latter chapters.

1.3.3

Applied control methods

The optimal control strategy is to explore a control law for a given system so that the system satisfies a desired optimality condition such as the minimum energy cost and the minimum tracking error. The optimality index is usually formulated as a quadratic function with respect to the states and inputs of the given system. In order to emphasize the specific states and inputs in the cost function, the state and input weighting matrices are adopted. If the given system is descried by state-space equations, the optimal control problem can be solved by using the feedback control method. The unique feedback gain matrix can be obtained by the LQR technique [37]. From the mathematical perspective, the optimal control is to formulate an opti-mization problem involving control inputs and system states. We can find an optimal solution in a systematical way [37]. Because of the rapid development of the com-puter techniques and control algorithms, it is possible to apply the optimal control in industry. The optimal control can handle the simple case effectively. However, prac-tical problems become increasingly complicated, which limits the application of the optimal control method. For example, when the system is nonlinear or is subject to the physical constraints, it is difficult to obtain the analytical optimal solutions. Due to these limitations, the approximate optimal solution is considered, and the MPC is proposed to find the suboptimal solution to handle more complicated problems.

Overview of the LQR method

As discussed in [37], it is shown that LQR control strategy has several advantages: 1) The closed-loop stability is guaranteed if the given system is controllable and all states are available. 2) It is easy to implement the LQR algorithms in both simulations and experiments. 3) Designing an LQR controller for the multi-input multi-output system is similar to designing an LQR controller for the single-input single-output system.

However, there are still some limitations of the LQR algorithm: 1) The system may have poor performance if there is a mismatch caused by the model inaccuracy, system changes or nonlinearities. 2) All states are required by the LQR algorithm to calculate the control input. If some states are unknown, the observer should be adopted, which may increase the computational complexity. It may be more

(21)

there is relatively few research on realizing the LQR technique on the quadrotor due to the following reasons:

• Because of the system structure and the aerodynamic effects, there exist high nonlinearities in the quadrotor dynamics.

• The quadrotor is an embedded system with limited memory resources, hence the computing ability is restricted.

• The system dynamics of the quadrotor are always subject to several uncertain-ties, i.e., the model inaccuracy due to the linearity approximation and parameter perturbations.

Overview of the MPC method

MPC, as a successful control approach, has been widely applied in process control, such as chemical and automotive industries, due to its capability of handling complex systems with certain physical constraints [41,42] . The main idea of MPC is to predict the system performance by using the system dynamics, and to decide the optimal control actions by optimizing the predicted states. The MPC problem consists of two parts: The regulation problem and the estimation problem. The prediction of certain period is adopted to generate the optimal control sequence. The optimal state is obtained based on the record of the past measurements, the system dynamics and the calculated optimal control input.

Due to the practical requirements and the development of MPC in deterministic system, the uncertain MPC has drawn increasing attentions for the last decade, in which the presence of the uncertainty consists of external disturbances, the model inaccuracy and unknown states. Therefore, the works on MPC can be mainly divided into two classes: Deterministic MPC including standard MPC, explicit MPC and distributed MPC, and uncertain MPC such as robust MPC and stochastic MPC. More details can be found in a survey paper [42].

In practical applications of the MPC algorithm, we have to use a finite prediction horizon in the MPC algorithm since the computational load is extremely high when

(22)

considering an infinite horizon. However, the system stability cannot be guaranteed if the prediction horizon is finite. Thanks to the Lyapunov theory, the nominal stability of a linear or nonlinear system controlled by MPC is achieved by considering the terminal constraint and terminal cost, or using a sufficient long prediction horizon to solve the online optimization problem [43].

The MPC algorithm performs well in the industries with a relatively long sampling period [41]. For the systems requiring the short sampling time, or having to be run on the embedded system with limit memory source, the heavy computational load of MPC caused by solving the optimization problem makes its advantages invalid.

Recently, numerous works have been done to reduce the computational load of the MPC algorithm. These methods can be mainly divided into two classes: Offline methods and online methods. The offline methods pre-compute the solution for each state by using the multi-parameter programming. This kind of offline MPC algorithm is called explicit MPC [44]. For the problem with a relatively small size, i.e., the short prediction horizon and a small number of states and inputs, the explicit MPC can work efficiently. However, as the problem size increases, the size of the pre-computed solution increases exponentially. Consequently, the computational load of the explicit MPC will be extremely high.

The online methods devote to improving the efficiency of solving the optimization problem, which can be used for the relatively large size MPC problems. Various optimization algorithms are used for solving the online QP problem: Wang and Boyd propose a modified primal barrier method in [45]. Richer et al. use a fast gradient method to solve the optimization problem and certify the computational complexity in [46]. Active set methods and interior-point methods are also widely studied [47–49]. Comparing with the LQR method, the MPC method can handle the state and input constraints. However, the standard linear MPC algorithm cannot be directly adopted due to following reasons:

• The real-time optimization in the MPC algorithm results in high computational load.

(23)

development of the quadrotor flight control. The detailed contributions of this thesis are

• An LQR tracking controller is proposed for the decoupled quadrotor dynamics. • The states of the quadrotor and the uncertain parameters in the dynamics are both estimated by the proposed modified EKF, and then the EKF-based LQR tracking algorithm is developed.

• The developed EKF-based LQR algorithm is realized on the real-time experi-mental platform.

• A modified primal barrier interior-point method is adopted to improve the com-putational efficiency of the MPC algorithm.

• The LBMPC algorithm is designed to solve the tracking problem of the quadro-tor subject to several uncertainties.

1.5

Thesis organization

The remaining part of this thesis is organized as follows:

• Chapter 2 introduces the details for a real-time experimental platform including the quadrotor and the indoor positioning system. The procedure of experimen-tal environment setup is given.

• Chapter 3 describes the quadrotor dynamics and the motor dynamics. The simplified quadrotor dynamics involving the motor dynamics are elaborated. • Chapter 4 provides the design and implementation of the EKF-based LQR

control for the quadrotor. Simulations and experimental results are provided to evaluate the proposed algorithm.

(24)

• Chapter 5 illustrates the design of an LBMPC algorithm for the quadrotor according to the modified primal barrier interior-point method. The simulation results are provided to evaluate the performance of LBMPC algorithm.

(25)

Chapter 2

Experimental Setup

2.1

Overview

This chapter investigates the setup of the experimental platform, i.e., the Quanser Un-named Vehicle System (UVS) consisting of a quadrotor (QBall-X4), a single ground station (host PC), and an indoor positioning system (Optitrack cameras). The Quanser UVS is an open-architecture environment that allows the researchers to verify their research results in control theory in a safe indoor environment. In this system, the control algorithms are designed in Simulink, complied into executable files, and downloaded into the QBall-X4 by using the Quanser real-time control soft-ware (QUARC).

As shown in Figure 2.1, the Quanser QBall-X4 is an innovative quadrotor lifted and propelled by four motors equipped with 10-inch propellers. The QBall-X4 is en-veloped within a protective carbon fiber cage protecting the QBall-X4 from collision with close-range obstacles, e.g., the unmanned vehicles. An embedded Gumstix com-puter is mounted on the QBall-X4 and an HiQ avionics data acquisition (DAQ) card is connected to Gumstix computer. The HiQ DAQ card receives data from on-board sensors; the Gumstix computer outputs commands to the motors. The Gumstix computer is also embedded with a wireless module, enabling the control algorithm to be downloaded into the Gumstix computer through the wireless communication. In addition, a cluster of markers with a unique configuration are fixed on the cage of the QBall-X4. Therefore, the QBall-X4 can be tracked as a rigid body by OptiTrack cameras.

(26)

the details of the QBall-X4 including the mechanical and electronic components. A brief introduction to the QUARC is also given in this section. The setup of the indoor positioning system is presented in Section 2.3. Section 2.4 concludes this chapter.

Figure 2.1: Quanser QBall-X4 X-4.

2.2

Quanser QBall-X4

2.2.1

Protective cage and frame

As shown in Figure 1, the main body of QBall-X4 is a crossbeam structure. The HiQ DAQ and the Gumstix computer are located at the center of the crossbeam and cov-ered by a protective black box. The motors and propellers are placed symmetrically on the beam.

2.2.2

HiQ DAQ and the Gumstix computer

The HiQ DAQ is the data acquisition board of the QBall-X4. Combined with Gumstix computer, the HiQ DAQ is capable of receiving data from sensors and controlling motors. As shown in Figure2.2, the HiQ DAQ consists of an inertial measurement unit (IMU) including the accelerometer, the gyroscope, and the magnetometer. Therefore, the linear and angular accelerations of the QBall-X4 can be measured. In addition, there are 10 pulse-width modulation (PWM) servo output channels labeled from 0 to 9 on the HiQ DAQ board. Four motors located at the crossbeam are connected to channels from 0 to 3, respectively.

(27)

Figure 2.2: HiQ DAQ board. Table 2.1: Some HiQ DAQ characters. Characters Description

Power input 10–20 V, 400 mA

PWM 10 servo output channels Analog input 6 channels, 12-bit, 3.3 V

Accelerometer 3-axis, 3.33 mg/LSB resolution

Gyroscope 3-axis, available range including ±75 deg/s, ±150 deg/s, or ±300 deg/s, resolution of 0.0125 deg/s/LSB at a range setting of ±75 deg/s

Magnetometer 3-axis, 0.5 mGa/LSB resolution Sonar 4 Maxbotix inputs, 1 cm resolution

The HiQ daughter board is also embedded on HiQ DAQ board. It provides ex-ternal ports including the sonar inputs, digital input/output (I/O) and serial I/O. Consequently, it is feasible to extend the applications of this QBall-X4. The main characters of the HiQ DAQ are given in Table 2.1.

2.2.3

Batteries

The QBall-X4 is powered by two 3-cell 2500 mAh LiPo batteries, as shown in Figure 2.3. Four motors are classified into two pairs based on their locations, i.e., front ,back, left and right. Each pair of motors is powered by one battery. Figure 2.3 shows that these batteries are vertically placed on a battery plate, which is beneath the center of the crossbeam. Two velcro straps are adopted to fix the batteries. In order to avoid accidents, the batteries are firmly connected to the batteries connector.

Note that the LiPo batteries should not be overspent. The LiPo batteries would be damaged and then become dangerous and unstable if they are discharged below

(28)

Battery connector Qball power switch

Figure 2.3: Two 2500mAh LiPo batteries.

10V. The LiPo batteries is usually charged at the “LiPo” mode by using the battery charger. Once the voltage of the battery is too low, it cannot be charged at the “LiPo” mode. It can be charged at the “NiMh” mode until the voltage is slightly higher than 10V, and then charged in ”LiPo” mode. Although the LiPo batteries can be normally charged, the lifespan of the LiPo batteries is significantly shortened. Therefore, it is necessary to keep the voltage of the batteries higher than 10V.

2.2.4

Motors and propellers

Figure 2.4a shows that the QBall-X4 utilizes four E-flite park 480 brushless outrunner motor (1020 KV) fitted with propellers. Two pairs of APC 10×4.7SFP slow flyer counter rotating propellers are used to generate the thrust in the same direction although they rotate in converse directions. More details about the motor and the propeller can be referred to [50, 51].

Four motors are symmetrically placed on the crossbeam of the QBall-X4, as dis-played in Figure 2.4b. Each of them is controlled by the electronic speed controllers (ESCs) which receive the PWM signals from the HiQ DAQ card. As mentioned in [52], the maximum and minimum PWM outputs time are 2 ms and 1 ms, respec-tively. Since the period for each cycle of the PWM signal is 20ms, the feasible duty circle range for the PWM signals is from 0.05 to 0.1.

(29)

(a) One motor connected with ESC. (b) 4 motors symmetrically mounted on QBall-X4 frame.

Figure 2.4: QBall-X4 motor distribution.

2.2.5

QUARC

The QUARC is the Quanser’s real-time rapid control prototyping software for Win-dows. The QUARC is designed as a powerful toolbox for MATLAB and Simulink. It compiles Simulink program directly and runs the code on Windows targets or the QUARC targets in real-time mode. The QUARC avoids the complicated code writing and makes the development and deployment of real-time control applications easier in the experiments. The main advantages of the QUARC are listed as follows:

• Simple and flexible hardware interfacing

• Flexible and protocol-independent communication framework • Support of multi-threaded, multi-rate and asynchronous models • Extensive devices support

As mentioned in [52], QUARC supports several targets: 32-bit and 64-bit Windows 7 SP1 and Windows 8, QNX X86, and Linux Verdex targets. QUARC provides a Simulink Development Environment, which is required to compile Simulink program and generate the real-time code for the targets. There are two kinds of targets that can be selected: The local target, such as the host computer, and the remote target including the QBall-X4. After selecting the target, the controller designed in Simulink can be compiled and executed on the target by using the QUARC targets manager.

(30)

2.2.6

Communication

As aforementioned, the communication between the QBall-X4 and the host computer is realized by using the wireless network, i.e., an ad-hoc peer-to-peer wireless TCP/IP protocol.The IP address of each vehicle and the host computer must be unique. The IP addresses for the vehicles are predefined and labeled in the network. The host computer uses an USB wireless adapter to set up the connection. When the QBall-X4 is turned on, the host computer should detect a network named “GASH”. As required in [52], the IP address of the host computer should be set as shown in Figure 2.5a. The connection between the Quanser unmanned vehicles and the host computer can be checked by running the the Windows program Run and opening “ping {IP of QBall-X4}”. As shown in Figure 2.5b, the communication delay can be found accordingly.

(a) The wireless USB adapter setting.

(b) Checking the connection between the QBall-X4 and the host PC.

Figure 2.5: The wireless setting for the host computer.

In Simulink, once the QUARC is successfully installed, there will be a new menu item called QUARC. In order to download the generated code to the target vehicle, the target’s IP address should be specified in the “Preference” under the “QUARC” menu. For the QBall-X4, the target type should be chosen as “linux verdex”. The Default Mode URI should be the target IP address.

Besides, Simulink should work at the “External” mode since the target machine is not the host PC. The model will run on the QUARC target. If all the initial setup is completed, the model is ready to be compiled. When compiling Simulink program, each step of the code generation will be displayed in the MATLAB main window.

(31)

cameras. The reflective markers are placed on the mobile vehicles (grey balls marked by red circles in Figure 2.1) with certain configurations, therefore the OptiTrack system can track the 6 degrees of freedom (DoF) pose of one or even more mobile vehicles. According to the DoF of unmanned vehicles, the minimum requirements of the reflective markers are different: 3 markers for the 3-DoF unmanned vehicle (e.g., under ground vehicle) and 4 markers for the 6-DoF unmanned vehicle (e.g., quadrotors) [53].

NaturalPoint Inc. has developed a software called Motive to implement the sys-tem configuration and the object tracking. The tracking data can be read by the QUARC OptiTrack block in Simulink to provide the position information, i.e., the linear position and velocity. The technical parameters of the OptiTrack cameras and the setup of the calibration system will be introduced in sequel.

2.3.1

OptiTrack camera and OptiHub

The camera used in the OptiTrack vision system is OptiTrack Flex 3 (Figure 2.6). As introduced in [54], Flex 3 is a powerful camera which is capable of capturing and processing integrated images with 100 frames per second capture speed and 640×480 VGA resolution. Thanks to the on-camera image processing ability, the Flex 3 can send the following 5 types of pre-processed images to the PC:

• Precision grayscale: Most precise marker detection • Segment: Balanced marker detection

• Object: The most CPU-efficient marker detection

• MJPEG-compressed grayscale: Full resolution with compressed grayscale frames • Raw grayscale: Full resolution with uncompressed grayscale frames

In the NaturePoint OptiTrack system, at least 3 cameras are required, and up to 24 cameras can be accommodated [53]. In order to eliminate the dead zone, which may degrade the quality of the calibrated space, a sufficient amount of cameras are

(32)

Figure 2.6: The Optitrack camera.

required. To simplify the setup, the OptiHub is introduced in the system. Each OptiHub is connected to 6 cameras by using high speed USB cables at one side, and to the computers by USB Uplink cables on the other side. More technical parameters can be found in [55]. In our lab, the room volume is 4.21 m× 4.06 m × 2.74 m (Length×Width×Height). As described in [53], the minimum amount of OptiTrack cameras is 6. The corresponding calibrated workspace volume is 1.5 m× 1.5 m × 1 m (Length×Width×Height). In order to fully use the volume of lab room, 10 cameras are mounted on the wall to enlarge the workspace, supported by two OptiHubs. Figure 2.7 shows the cameras distribution.

Optihub

Optihub

OptiTrack Cameras

QBall-X4 Host Computer

Figure 2.7: The distribution of cameras.

2.3.2

Motive

The Motive is an optical motion capture software developed by NaturePoint Inc. The main function of Motive is to construct a 3-D coordinate and to observe the motion of the traceable object. By using Motive, we can clearly monitor the images from all

(33)

The position information can be read directly in Simulink. The procedure of the calibration is introduced as follows: 1. Run Motive. The Quick Start menu should pep up.

2. Choose the options of Perform Camera Calibration, as shown in Figure 2.8a, to build a new project. The main screen of Motive for the calibration is shown in 2.8b.

(a) Quick start menu. (b) Main Motive screen for the calibration.

Figure 2.8: The initial Motive screen shot.

3. Right click on the button Camera Preview for each camera, and set the video type as the precision mode. At this moment, only the positions of the markers are displayed.

4. Click on the button Start Wanding to start the calibration. To calibrate the workspace covered by the cameras, the wand, as shown in Figure 2.9a, is waved in the indoor space while the cameras capture the markers and collect the sam-ples. A sampling is valid when the three markers are simultaneously captured by at least three cameras, therefore the wand should be waved averagely and comprehensively across the entire covered volume to collect sufficient samples.

(34)

If the number of samples collected by each camera is more than 200 multiplied by the number of cameras used in experiments, the quality of the calibration can be guaranteed. The number of samples can be found in the sub-window named Calibration Engine, as shown in Figure 2.10a

(a) Three marker wand. (b) Ground plane.

Figure 2.9: Wand and the ground plane used in the experiments.

5. Click on the button Calculate in the Calibration Engine sub-window after col-lecting the samples, as shown in Figure 2.10b. The sampling window turns to be the solver window, and displays the solver stage including the overall quality, the calculated focal length, the mean errors, and the pixel for each camera. The overall quality includes “Poor”, “Fair”, “Good, “Great”, “Excellent” and “Ex-ceptional”. When Motive completes the global optimization, a word “Ready to Apply” will appear in the Calibration Engine sub-window. The minimum requirement of the calibration quality of each camera is the “Great”. The step 4 should be repeated until the calibration quality of each camera satisfies the requirement. When the calibration qualities of all cameras are equal or better than “Great”, click on the “Apply result” and save the wanding timeline file. 6. Place the ground plane on the floor and then define the origin of the calibrated

workspace according to the location of the ground plane, as shown in Figure 2.9b. The ground plane is L-shape with three markers mounted on each corner. In this step, the ground plane must be the only one traceable object captured by cameras. In general, the ground plane is placed at the center of the calibrated

(35)

(a) The screen shot for the data collection. (b) The screen shot for the optimization progress.

Figure 2.10: Wand and the ground plane used in the experiments.

volume with the Z axis pointing to the host computer. Once the ground plane is placed, click on the button Set Ground Plane and save the calibration file. 7. Define the traceable object. In Motive, each object is defined as a rigid body so

a minimum of three markers are required. The accuracy of the pose estimation would be increased if four or more markers are mounted on each vehicle. In order to classify different rigid bodies, a cluster of markers must be placed on the QBall-X4 with the unique configurationas shown in Figure 2.1. For the purpose of defining a rigid body, click the button Create From Selection after selecting four highlighted markers in the Perspective View sub-window, then the “Rigid Body 1” is configured. The pivot point of the configured rigid body is automatically set as the geometric center of four points. Note that real pivot point of the quadrotor is its center of gravity (CoG). The distance between its top point and its CoG is 0.35 meters. The pivot point must be manually adjusted by using the Pivot-Point translation, as shown in Figure 2.11. After redefining the pivot point, navigate to File→ Export Rigid Bodies and save the rigid body definition file.

In Simulink, by using the QUARC OptiTrack Traceable block, the information of the defined rigid body and the calibrated coordinate can be read from the rigid body definition file and the calibration file, respectively. Therefore, the motion of the QBall-X4 can be directly expressed in the calibrated coordinate.

(36)

Figure 2.11: The created rigid body for QBall-X4.

2.4

Conclusion

This chapter presents the details of the Quanser UVS including the QBall-X4, the host computer and the OptiTrack cameras. The calibration procedure is introduced. In the calibrated workspace, the positions of the QBall-X4 can be measured. The orientations of the QBall-X4 are measured by using the IMU. The QBall-X4 can be controlled by using these measured positions and orientations.

(37)

Chapter 3

System Modeling

3.1

Introduction

Quadrotor is one type of multi-rotor helicopters which is lifted and propelled by four rotors. Figure 3.1 shows the mechanism of a quadrotor. In this mechanism, four identical propellers are mounted on the crossbeam. Four propellers are separated into two pairs: The propeller pair (1,3) rotates in the clockwisely; the propeller pair (2,4) rotates counterclockwisely. Comparing with the transitional helicopter that uses the anti-trail rotor to counteract the friction torque caused by rotating the main propellers, the quadrotor has two propeller pairs rotating in contrary directions. Therefore, the rotary torque effectiveness caused by the friction is balance. The quadrotor has two pair propellers with opposite blade pitch angles so that the thrust generated by each propeller has the same direction.

Before deriving the quadrotor dynamics, we have some reasonable assumptions: • The quadrotor is a rigid body with symmetrical structure.

• The four propellers are rigid bodies.

• The CoG and the origin of the body fixed frame are same.

The remaining part in this chapter is originated as follows: The quadrotor kine-matics and dynamics are given in Section 3.2 and Section 3.3, respectively. Section 3.4 shows the linearzied quadrotor dynamics, in which the motor dynamics are con-sidered. The conclusion of this chapter is described in Section 3.5.

(38)

3.2

Quadrotor kinematic

In this thesis, two frames are adopted to describe the motions of the quadrotor: The earth-fixed inertial frame (E-Frame) and the body-fixed frame (B-Frame). In the E-frame (oE, x, y, z), the positive directions of x, y, z axes point to North, East and

Upward, respectively. The origin oE can be any arbitrary point at ground. In the

B-frame (OB, X, Y, Z), the origin OB is located at the quadrotor’s CoG. As shown in Figure 3.1, the positive directions of X and Y axes are front and left along the crossbeam of the quadrotor; the direction of Z axis points to Upward. Note that the superscript B and E indicate the variable expressed in the B-frame and E-frame, respectively. OB Y Z Propeller 1 Propeller 2 Propeller 4 Propeller 3 Clockwise Counter-clockwise Clockwise Counter-clockwise X x y z oE

Figure 3.1: The body frame and the inertial frame.

When stationary relative to the E-frame, the quadrotor is considered to be in the hovering condition. In this case, all propellers rotate at a same speed ΩH. The

entire thrust is equal to the gravity of the quadrotor. If the speed of each propeller increases or decreases by △Ω simultaneously in the hovering condition, it would lead to a vertical acceleration along Z axis in the B-frame, as shown in Figure 3.2. We use the length of the blue arrow to present the magnitude of the motor speed. When all propellers rotate with different speeds, the quadrotor will rotate.

The motions and rotations of the quadrotor from the hovering condition can be realized by varying the speed of propellers. An arbitrary rotation of the quadrotor can be expressed by the pitch, roll and yaw angles with certain configurations. The quadrotor’s position expressed in the E-frame is dependent on the rotations of the quadrotor. In the following parts, we will introduce the changes of quadrotor’s posi-tion in the E-frame after rotating around X, Y, Z axes. Here, let ϕ, θ and ψ as the pitch, roll and yaw angles rotating around X, Y and Z axes, respectively.

(39)

OB(oE)

Propeller 2 Propeller 3

Ω H+ Ω Ω H+ Ω

Figure 3.2: The hovering condition.

As shown in Figure 3.3a, the roll is the rotation around the X-axis by angle ϕ. Figure 3.3b shows that changing the speed of propellers 2 and 4 by △ΩA and

△ΩB, respectively, in the hovering condition leads to a torque around X-axis.

In this case, the directions of the thrust and the gravity are not same. When the vertical component of the total thrust is equal to the gravity, the component of the thrust along the Y -axis is generated. Accordingly, the quadrotor will keep the current height and move along the Y -axis.

Let ΓE = [x y z]T and ΓB = [X Y Z]T are the positions of the quadrotor in the E-frame and B-frame, respectively. From Figure 3.3a, it can be obtained that the relation between the position of the quadrotor in the E-frame and B-frame after rotating around the X-axis with ϕ degrees can be expressed as follows:

ΓE = R(x, ϕ)ΓB, R(x, ϕ) =    1 0 0 0 cos ϕ − sin ϕ 0 sin ϕ cos ϕ    .

Herein, the matrix R(x, ϕ) is the rotation matrix around the X-axis. • Pitch angle θ

As shown in Figure 3.4a, the pitch is the rotation around the Y -axis by angle θ. When the speed of propellers 1 and 3 increases or decreases by △ΩA and

△ΩB in the hovering condition, respectively, the torque with respect to Y -axis

will be generated. The quadrotor will rotate around the Y -axis. As shown in Figure 3.4b, if the the vertical component of the thrust is same as the gravity, the horizontal component of the thrust will lead to the motion along the X-axis.

(40)

roll x y z X OB(oE)

(a) Rotation around X-axis.

Y Z Propeller 1 Propeller 2 Propeller 4 Propeller 3 X Ω H+ ΩA Ω H Ω H Ω H+ ΩB OB(oE) (b) Roll movement.

Figure 3.3: The roll angle.

After rotating around the Y -axis with θ degrees, the transformation of the quadrotor’s position between the E-frame and B-frame can be expressed as follows:

ΓE = R(y, θ)ΓB,

where the matrix R(y, θ) is the rotation matrix around the Y -axis, and

R(y, θ) =    cos θ 0 sin θ 0 1 0 − sin θ 0 cos θ    . x y z Y OB(oE) Pitch

(a) Rotation around Y -axis.

Y Z Propeller 1 Propeller 2 Propeller 4 Propeller 3 X Ω H+ ΩA Ω H Ω H Ω H+ ΩB OB(oE) (b) Pitch movement.

Figure 3.4: The pitch angle. • Yaw angle (ψ)

When the quadrotor rotates around the Z-axis by angle ψ, the rotation is called Yaw angle, as shown in Figure 3.5b. If the speeds of propellers 1 and 3 increase (or decrease) by△ΩB and the speeds of propellers 2 and 4 increase (or decrease)

(41)

rotates around the Z-axis.

Similarly, after rotating around the Z-axis by ψ degrees, the new position of the quadrotor in the E-frame can be obtained as

ΓE = R(z, ψ)ΓB, with R(z, ψ) =    cos ψ − sin ψ 0 sin ψ cos ψ 0 0 0 1    .

Herein, matrix R(z, ψ) is the rotation matrix around the Z-axis.

Yaw x y z Z OB(oE)

(a) Rotation around Z-axis.

OB(oE) Y Z Propeller 1 Propeller 2 Propeller 4 Propeller 3 X Ω H+ ΩA Ω H+ ΩB Ω H+ ΩA Ω H+ ΩB (b) Yaw movement.

Figure 3.5: The yaw angle.

According to the Z-X-Y Euler angle convention [56], the position of the quadrotor in the B-frame can be transformed into the E-frame by using:

ΓE = RB,EΓB,

where RB,E is the rotation matrix from the B-frame to the E-frame. RB,E is the

product of the rotations around X, Y, Z axes, which can be calculated as RB,E = R(z, ψ)· R(y, θ) · R(x, ϕ)

(42)

=   

cos θ cos ψ sin ϕ sin θ cos ψ− cos ϕ sin ψ cos ϕ cos ψ sin θ + sin ϕ sin ψ sin ψ cos θ sin ϕ sin θ sin ψ + cos ϕ cos ψ cos ϕ sin ψ sin θ− sin ϕ cos ψ

− sin θ sin ϕ cos θ cos ϕ cos θ

   .

The rotation matrix from E-frame to B-frame is RE,B = R−1B,E = RTB,E. Generally,

the quadrotor operates within a small area comparing with the area of the earth. It is assumed that, within the quadrotor’s working area, the earth is flat and the earth rotation is ignored [57]. Therefore, the relation between linear velocities VE in the

E-frame and VB in the B-frame is

VE = RB,EVB. (3.1)

Let ωE and ωB represent the angular velocities in the E-frame and B-frame,

respec-tively. As mentioned in [56], the angular velocity of the quadrotor in the B-frame can be transformed into the E-frame by using the transformation matrix TB,E as

ωE = TB,EωB. (3.2)

TB,E can be derived by using

   p q r    =    ˙ ϕ 0 0    + R(x, ϕ)−1    0 ˙ θ 0    + R(x, ϕ)−1R(y, θ)−1    0 0 ˙ ψ    .

By solving the above equation, we have

TB,E−1 =   

1 0 − sin θ

0 cos ϕ cos θ sin ϕ 0 − sin ϕ cos θ cos ϕ

   , TB,E =   

1 sin ϕ tan θ cos ϕ tan θ 0 cos ϕ − sin ϕ 0 sin ϕcos θ cos ϕcos θ

   .

Herein, p, q and r are the quadrotor angular velocities around the X, Y and Z axes in the B-frame, respectively.

According to (3.1) and (3.2), the kinematic equation of the quadrotor can be represented as [ VE ωE ] = [ RB,E 03×3 03×3 TB,E ] [ VB ωB ] , (3.3)

(43)

Based on the Newton-Euler formalism [56], the motions of the quadrotor are described in the B-frame. From the Newton’s second law, we derive the dynamics of the linear motion of the quadrotor as follows:

FE = md dt(V

E),

RB,EFB = mdtd(RB,EVB),

RB,EFB = m(RB,EV˙B+ ˙RB,EVB),

RB,EFB = m(RB,EV˙B+ S(ωB)RB,EVB),

RB,EFB = mRB,E( ˙VB+ RTB,ES(ωB)RB,EVB),

RB,EFB = mRB,E( ˙VB+ S(ωB)VB),

FB = m( ˙VB+ ωB× VB),

(3.4)

where m is the mass of the quadrotor; FE and FB are the forces applied to quadrotor expressed in the E-frame and the B-frame, respectively. Note that RB,E−1 = RTB,E and

˙

RB,E = S(ωB)RB,E, where S(ωB) is a skew-symmetric matrix that

S(ωB)VB = ωB× VB =    qw− rv ru− pw pv− qu    ,

where u, v and w are the linear velocities along X, Y and Z axes in the B-frame. From the Euler’s equations, the quadrotor dynamics of the angular rotation can be derived as

τE = J d dtω

E,

TB,EτB = Jdtd(TB,EωB),

TB,EτB = J (TB,Eω˙B+ ˙TB,EωB),

TB,EτB = J (TB,Eω˙B+ S(ωB)TB,E, ωB),

TB,EτB = J TB,E( ˙ωB+ TB,ET S(ω B)T

B,EωB),

TB,EτB = J TB,E( ˙ωB+ S(ωB)ωB),

τB = J ( ˙ωB+ ωB× ωB),

(3.5)

where τE, τB are the torques applied to the quadrotor and expressed in the E-frame

(44)

According to (3.4) and (3.5), the quadrotor dynamics can be represented in the B-frame as

m ˙VB+ ωB× (mVB) = FB, (3.6a) J ˙ωB+ ωB× (JωB) = τB. (3.6b) Herein, the term m(ωB× VB) is called Coriolis term indicating the Coriolis effects.

3.3.1

Forces calculation

The main forces applied to the quadrotor are the thrust FB

T generated by all propellers,

the gravity FE

G, the drag force FDB and the hub force FHB. The hub force FHB is caused

by the horizontal force acting on the blade of the propellers [14]. In this thesis, due to the low indoor air speed, the hub force is ignored.

• Gravity force

Gravity force FGE in the E-frame is along the z-axis pointing to the ground, and FE

G = [0 0 mg]T. From (3.6), it is shown that the system dynamics are

expressed in the B-frame. Therefore, the gravity FE

G must be transformed into

the B-frame by using

FGB = RE,BFGE = RE,B    0 0 mg    =    −mg sin θ mg sin ϕ cos θ mg cos ϕ cos θ    . • Drag force

The drag force FDB applied to the quadrotor is

FDB= 1 2CDSρV B=    1 2CDxSρu 1 2CDySρv 1 2CDzSρw    ,

where CDx, CDy and CDz are the drag coefficients along x, y and z axes in the

E-frame; S is the cross-sectional area; ρ is the air density. • Thrust force

(45)

FTB = 0 TB

 ,

where TB = FT 1B + FT 2B + FT 3B + FT 4B.

According to the previous discussion, the entire force applied to the quadrotor in the B-frame is

FB = FGB+ FDB+ FTB.

Since the drag force FDB is much less than FTB and FGB [56], it is omitted in the derivation of the quadrotor dynamics. Therefore, (3.6a) can be rewritten as

m ˙u + m(qw− rv) = −mg sin θ, m ˙v + m(ru− pw) = mg sin ψ cos θ, m ˙w + m(pv− qu) = mg cos ψ cos θ + TB.

(3.7)

3.3.2

Torques calculation

The torques leading to the rotation of the quadrotor are mainly caused by four pro-pellers. In Section 3.1, the rotations around each axis are described and an arbitrary rotation of the quadrotor can be considered as the combination of the rotation around the X, Y, Z axes. Detail information about the pitching, rolling and yawing torques will be introduced in the following parts.

As described in [14], the pitching and rolling torques can be calculated by using τθB = l(FT 1B − FT 3B),

τϕB = l(FT 2B − FT 4B),

where l is the distance between the propeller and the CoG of the quadrotor. The yawing torque τB

ψ is the sum of the torque generated by all propellers, i.e.

(46)

Here, τiB is the torque produced by the ith propeller for i = 1, 2, 3, 4. The inertia tensor J can be expressed as

J =    Jxx Jxy Jxz Jyx Jyy Jyz Jzx Jzy Jzz    . (3.8)

Since the quadrotor structure is symmetric, we can really obtained that Jxy = Jxz =

Jyx= Jyz= Jzx= Jzy = 0. Therefore, (3.8) can be rewritten as

J =    Jxx 0 0 0 Jyy 0 0 0 Jzz    .

According to the above discussion, (3.6b) can be represented as Jxxp + qr(J˙ zz − Jyy) = l(FT 1B − FT 3B),

Jyyq + pr(J˙ xx− Jzz) = l(FT 2B − FT 4B),

Jzz˙r + pq(Jyy− Jxx) = τ1B+ τ3B− τ2B− τ4B.

(3.9)

3.3.3

Final quadrotor dynamic equations

From (3.7) and (3.9), the quadrotor dynamics in the B-frame can be described as ˙u = −g sin θ − (qw − rv),

˙v = g sin ψ cos θ− (ru − pw), ˙

w = g cos ψ cos θ + TmB − (pv − qu), ˙ p = l(FT 1B−F B T 3) Jxx qr(Jzz−Jyy) Jxx , ˙ q = l(FT 2B−F B T 4) Jyy pr(Jxx−Jzz) Jyy , ˙r = τ1B+τ3B−τ2B−τ4B Jzz pq(Jyy−Jxx) Jzz . (3.10)

In the E-frame, the positions and orientations of the quadrotor can be measured by the indoor positioning system and sensors, respectively. Nevertheless the quadrotor dynamics in (3.10) are expressed in the B-frame. (3.10) should be transformed into E-frame by using the quadrotor kinematics in (3.3).

The perturbations are small when the quadrotor hovers at a certain height, then angular velocities of the quadrotor in the E-frame and the B-frame are considered as

(47)

RB,EFB = m

d dt(V

E).

Accordingly, the quadrotor dynamics in the E-frame can be described as ¨

x = TB

m (cos ϕ sin ψ + cos ϕ sin θ cos ψ),

¨

y = TmB(−sinϕ cos ψ + cos ϕ sin θ sin ψ), ¨ z = TmB cos ϕ cos θ− g, ¨ ϕ = l(FT 1B−FT 3B) Jxx ˙ θ ˙ψ(Jzz−Jyy) Jxx , ¨ θ = l(FT 2B−FT 4B) Jyy ˙ ϕ ˙ψ(Jxx−Jzz) Jyy , ¨ ψ = τ1B+τ3B−τ2B−τ4B Jzz ˙ ϕ ˙θ(Jyy−Jxx) Jzz . (3.11)

3.4

Simplified quadrotor dynamics

Simplified quadrotor dynamics without involving the motor dynamics

Because of the nonlinearities in (3.11), it is complicated to design the control al-gorithm. In order to solve this problem, some reasonable assumptions are given to simplify the quadrotor dynamics, which are displayed as follows:

• The quadrotor operates at the nearly hovering condition.

• The orientations of the quadrotor (pitch, roll and yaw angles) are small. • The cross-coupling terms in the system dynamics are ignored.

At the nearly hovering condition, it is shown that the total thrust is approximately equal to the gravity of the quadrotor, i.e. TB ≈ mg. Due to the small orientations,

we have

(48)

Therefore, the quadrotor dynamics in (3.11) can be simplified as ¨ x = gθ, ¨ y = −gϕ, ¨ z = TB m − g, ¨ ϕ = FT 1B−FT 3B Jxx , ¨ θ = FT 2B−FT 4B Jyy , ¨ ψ = τ1B+τ3B−τ2B−τ4B Jzz . (3.12)

The system diagram is illustrated in Figure 3.6a.

From the simplified quadrotor dynamics in (3.12), it is clear that the angular rotation of the quadrotor is independent of its linear motion, while its horizontal motions depend on the pitch and roll angle. Therefore, the quadrotor system can be split into two subsystems: The attitude subsystem and the position subsystem; the quadrotor system can be divided into two loops: The inner attitude loop and the outer position loop. Figure 3.6b shows the above mentioned two subsystems. Herein, xd, yd, zd, θd, ϕdand ψdindicate the desired positions and orientations of the quadrotor

in the E-frame.

Controller

(a) The one-loop control structure.

Outer loop Inner loop Position controller Attitute controller

(b) The inner-outer control structure.

(49)

FT iB = Kmς = Km

φ s + φui,

where uiis the input PWM signals to the ith motor; φ indicates the motor bandwidth.

Kmis a positive gain; and ς is a state variable representing the motor dynamics. Here,

we define the four control inputs uth, uθ, uϕ, uψ that satisfy the following conditions:

TB = 4K ms+φφ uth, τB θ = 2Kmls+φφ uθ, τϕB = 2Kmls+φφ uϕ, τB ψ = 4Kyuψ. (3.13)

According to (3.12) and (3.13), the decoupled quadrotor dynamics can be repre-sented as in the state-space form as:

˙xθ = Aθxθ+ Bθuθ, ˙xϕ = Aϕxϕ+ Bϕuϕ, ˙xψ = Aψxψ+ Bψuψ, ˙xz = Azxz+ Bzuth+ Λ, ˙xx = Axxx+ Bxθ, ˙xy = Ayxy+ Byϕ, (3.14) where =    ˙ θ ¨ θ ˙ςθ    , Aθ =    0 1 0 0 0 2Kml Jyy 0 0 −φ    , Bθ =    0 0 φ    , =    ˙ ϕ ¨ ϕ ˙ςϕ    , Aϕ =    0 1 0 0 0 2Kml Jxx 0 0 −φ    , Bϕ=    0 0 φ    , = [ ˙ ψ ¨ ψ ] , = [ 0 1 0 0 ] , = [ 0 4Ky Jzz ] ,

Referenties

GERELATEERDE DOCUMENTEN

lonen om er te gaan verzamelen, daar wind en regen nog wel even nieuw materiaal aan de oppervlakte zullen

In de achterwand van de groeve, gelegen min of meer loodrecht op bovenbe- schreven wand, zijn bovenin geulen aanwezig die zoch hebben ingesneden in het pakket met de graafgangen. In

Près d'un siècle de recherches dans la région d'Ottignies ont révélé une impor- tante accupation préhistorique allant du Paléolithique moyen au Néolithique, en passant par

(lets beter gezegd: twee lichamen met evenveel elementen zijn isomorf.) Voor een grondige behandeling van Galois lichamen verwijzen we naar: B.L.. van der

De afgeleide wordt steeds kleiner (nadert van onderen naar 0): afnemende

Secondly, 8 of these binary variables are used to construct an eight-item variety index ranging between 0 and 8 (formal pathways) regarding whether or not a researcher has developed

Concluding, by executing three steps: transcription of audio to text by means of ASR, filtering the transcriptions using NLP techniques to obtain the content of the discussions,

clinical trial is to investigate the effect of Bifidobacterium animalis DN-173 010 on bowel movements and IBS symptoms, such as abdominal pain and bloating and as well