Keywords

8.1 Introduction

Nowadays, there are many application fields for unmanned aerial vehicles (UAVs) and drones such as surveillance, emergency operations, military applications, and package transportation (Metin and Aygün 2019). In particular, quadrotor becomes popular among researchers due to its hovering capacity and high maneuverability. Quadrotor is a highly nonlinear system and hard to control with linear control methods that operate around an equilibrium point (Zuo 2010). Although linear control techniques such as proportional derivative (PD) (Kıyak 2016), proportional integral derivative (PID) (Ermeydan and Kiyak 2017), linear quadratic regulator (LQR) (Khatoon et al. 2014), and H-infinity (H) (Araar and Aouf 2014) are applied to the quadrotor successfully, these control approaches may experience a performance drop when deviating from the equilibrium point (Kendoul 2012).

Recently, nonlinear control techniques have become widespread when it comes to the quadrotor. A PID-like speed controller is proposed by Yazar et al. (2018) for a nonlinear small-scale turbojet engine. Ai and Yu (2019) proposed a flatness-based sliding mode control is proposed for the trajectory tracking problem in a quadrotor in the presence of external disturbances. A backstepping-like feedback linearization method is suggested by Choi and Ahn (2014) for controlling the quadrotor. Köksal et al. (2016) presented a two-level nonlinear control design. An incremental sliding mode fault-tolerant flight controller is proposed by Wang et al. (2019). Xuan-Mung and Hong (2019) presented a new altitude algorithm that consists of nonlinear and linear controllers for quadrotors. A nonlinear PID controller is suggested by Najm and Ibraheem (2019) to stabilize a quadrotor system. To track the position and attitude of a quadrotor, a new control method is proposed by Razmi and Afshinfar (2019). A neural network is used to tune sliding mode controllers in the suggested method. The proposed method obtained better results for both attitude and position tracking in comparison to (Zheng et al. 2014) and (Xiong and Zhang 2017). A robust nonlinear control method is utilized to control the quadrotor’s position and orientation (Labbadi and Cherkaoui 2019). A dynamic inversion based nonlinear controller is suggested for quadrotors by Prabhakaran et al. (2015). Nonlinear optimal backstepping control is applied to a quadrotor (Basri et al. 2015).

Literature survey showed that the control of the quadrotor can be insufficient when the dynamics are considered linear. Recent research efforts are shifting toward the nonlinear dynamics and control. Feedback linearization technique as one of the nonlinear controllers can transform the nonlinear plant dynamics to a linear dynamical form by using a proper feedback law (Özbek et al. 2016). In difference to linear controllers, feedback linearization control law is obtained through the exact state transformation rather than the state approximation approach (Gee et al. 1998). So, the nonlinear model of the plant can be converted into a fully or partly linear model with the cancellation of nonlinearities. The application of the feedback linearization control technique into the quadrotor control problem can be found in many research papers. Voos (2009) proposed the nonlinear control of a micro-quadrotor platform by using a feedback linearization technique. Saif (2017) proposed a feedback linearization control law for a tiltable quadrotor under wind gusts scenario. Bonna and Camino (2015) proposed the trajectory tracking control of a quadrotor with feedback linearization technique. Fault-tolerant control application of the feedback linearization approach is proposed by Ghandour et al. (2014) to a quadrotor testbed. Position-tracking control of the quadrotor is proposed by Kuantama et al. (2018) using the feedback linearization linear quadratic regulator (LQR) technique. Quadrotor control using feedback linearization with dynamic extension is proposed by Al-Hiddabi (2009). Attitude and altitude control of a quadrotor with feedback linearization technique is presented by Eltayeb et al. (2019).

Despite the advantages of the feedback linearization technique, the controller operates if all the state parameters are well-defined and do not have any uncertainties (Chen et al. 2016). It is a challenging but an essential task to control the quadrotor in full degree-of-freedom space since quadrotors are both subjected to internal and external noise sources such as modeling inaccuracies, assumptions, wind gusts, measurement noises, and sensor errors. To overcome these disturbances, the feedback linearization control technique is enhanced with an observer to handle the control of the quadrotor subjected to internal and external disturbances.

Several disturbance-observer-based control techniques are available in the literature Chen et al. (2016). In this chapter, the enhancement of the feedback linearization control method is ensured by particle filter–based observer. The particle filter is a Monte Carlo–based suboptimal algorithm that deals with closed-loop integral problems of the recursive Bayesian estimation (Oh and Kim 2019). Unlike linear observers and simple robust controller structures, the particle filter can handle system nonlinearities and noise with both Gaussian and non-Gaussian distributions (Daroogheh et al. 2018).

Based on the given discussion, the originality of this manuscript is to propose a nonlinear observer–based feedback linearization control method of a quadrotor that solves the integration problems, overcomes the uncertainty issue of the feedback linearization technique, and not only reduces disturbance errors and minimizes sensor errors but also controls the quadrotor with nonlinear dynamics in a wide range of operation regions.

The organization of the chapter is as follows: Nonlinear kinematic and dynamic equations of the quadrotor are derived in Sect. 8.2. The proposed method and theoretical background are given in Sect. 8.3. The main results are covered in Sect. 8.4. Conclusions and discussions are given in Sect. 8.5.

8.2 Quadrotor

Quadrotor is a multirotor that consists of four motors and propellers. The two opposite propeller turn in the same direction and the other two turn in the opposite direction. The speeds of the rotors are equal in a balanced flight (Kose and Oktay 2019).

8.2.1 Euler Transformation

There are different methods for expressing a vector in one axis set in another axis set. Euler transformation is one of these methods. In this transformation, one set of axes is rotated three times to overlap the other. Here, the order of rotation of the axis assembly is important; since the rotation order changes, it leads to a different result (Pamadi 2015).

The inertial reference system is I = (xi, yi, zi) and the body reference system is B = (xb, yb, zb). So the following is obtained if I reference system is rotated around B reference system with angles ψ, θ, and ϕ sequentially as shown in Fig. 8.1.

$$ {R}_3\left(\psi \right)=\left[\cos \psi\ \sin \psi\ 0-\sin \psi\ \cos \psi\ 0\ 0\ 0\ 1\ \right] $$
(8.1)
$$ {R}_2\left(\theta \right)=\left[\cos \theta\ 0-\sin \theta\ 0\ 1\ 0\ \sin \theta\ 0\ \cos \theta\ \right] $$
(8.2)
$$ {R}_1\left(\phi \right)=\left[1\ 0\ 0\ 0\ \cos \phi\ \sin \phi\ 0-\sin \phi\ \cos \phi\ \right] $$
(8.3)
Fig. 8.1
A three-dimensional illustration presents U A V with 4 arms. It presents 4 sets of blades, F 1, F 2, F 3, and F 4, along with Z b, Y b, and Z b. Below, it presents an X i, Y i and Z i coordinate system with phi, theta, and psi, respectively.

Quadrotor coordinate system

These matrices are orthogonal matrices and multiplication of the matrices form the following transformation matrix, which moves any vector from I reference system to B reference system.

$$ {T}_i^{\mathrm{b}}={R}_1\left(\phi \right){R}_2\left(\theta \right){R}_3\left(\psi \right) $$
(8.4)
$$ {T}_i^{\mathrm{b}}={\displaystyle \begin{array}{l}\Big[\cos \theta \cos \psi\ \cos \theta \sin \psi -\sin \theta\ \sin \theta \sin \phi \cos \psi \\ {}-\sin \psi \cos \phi\ \sin \psi \sin \theta \sin \phi +\cos \psi \cos \phi\ \sin \phi \cos \theta\ \sin \theta \cos \phi \cos \psi \\ {}+\sin \psi \sin \phi\ \sin \psi \sin \theta \cos \phi -\cos \psi \sin \phi\ \cos \phi \cos \theta \Big]\end{array}} $$
(8.5)

It is not possible to measure Euler angles directly in the flight control system. However, P, Q, and R, which are the angular velocities around three axes in the body reference system, can be measured. It is possible to obtain Euler angular velocities by applying a transformation to these angular velocities (Corke 2013).

To move Euler angular velocities from I reference system to B reference system, the following matrix calculations are performed.

$$ \left[P\ Q\ R\ \right]={R}_1\left(\phi \right){R}_2\left(\theta \right)\left[0\ 0\ \dot{\psi}\ \right]+{R}_1\left(\phi \right)\left[0\ \dot{\theta}\ 0\ \right]+\left[\dot{\phi}\ 0\ 0\ \right] $$
(8.6)
$$ \left[P\ Q\ R\ \right]=\left[\cos \theta\ 0-\sin \theta\ \sin \phi \sin \theta\ \cos \phi\ \sin \phi \cos \theta\ \cos \phi \sin \theta -\sin \phi\ \cos \phi \cos \theta \right]\left[0\ 0\ \dot{\psi}\ \right]+\left[1\ 0\ 0\ 0\ \cos \phi\ \sin \phi\ 0-\sin \phi\ \cos \phi \right]\left[0\ \dot{\theta}\ 0\ \right]+\left[\dot{\phi}\ 0\ 0\ \right] $$
(8.7)
$$ \left[P\ Q\ R\ \right]=\left[1\ 0-\sin \theta\ 0\ \cos \phi\ \sin \phi \cos \theta\ 0-\sin \phi\ \cos \phi \cos \theta \right]\left[\dot{\phi}\ \dot{\theta}\ \dot{\psi}\ \right] $$
(8.8)

However, P, Q, and R are generally given, and Euler angular velocities are desired. Therefore, L matrix is defined, and Euler angular velocities can be found using its inverse.

$$ L=\left[1\ 0-\sin \theta\ 0\ \cos \phi\ \sin \phi \cos \theta\ 0-\sin \phi\ \cos \phi \cos \theta\ \right] $$
(8.9)
$$ \left[\dot{\phi}\ \dot{\theta}\ \dot{\psi}\ \right]={L}^{-1}\left[P\ Q\ R\ \right] $$
(8.10)
$$ \left[\dot{\phi}\ \dot{\theta}\ \dot{\psi}\ \right]=\left[1\ \sin \phi \tan \theta\ \cos \phi \tan \theta\ 0\ \cos \phi -\sin \phi\ 0\ \sin \phi \sec \theta\ \cos \phi \sec \theta\ \right]\left[P\ Q\ R\ \right] $$
(8.11)

8.2.2 Equations of Motion

The following assumptions are made while gathering the equations of motion of the quadrotor (Musa 2017).

  • Quadrotor is a rigid body.

  • The center of gravity of the quadrotor is coincident with the center of the body reference frame.

  • The ground effect of the quadrotor is neglected.

  • Earth is an inertial reference.

To derive equations of motion according to the Newton–Euler method, it is essential to define forces and torques acting on a quadrotor (He and Zhao 2014). There are four control inputs of a quadrotor, which has six degrees of freedom.

$$ {u}_{\phi }=l\left({F}_4-{F}_2\right) $$
(8.12)
$$ {u}_{\theta }=l\left({F}_3-{F}_1\right) $$
(8.13)
$$ {u}_{\psi }=d\left({F}_1-{F}_2+{F}_3-{F}_4\right) $$
(8.14)

where l is the distance (m) between the center of gravity of the quadrotor and the center of the propeller, and d is the ratio between the drag and the thrust coefficients of the propeller.

The net moment on the quadrotor is the sum of the moments resulting from the speed differences of the propellers and rotational drag.

$$ {M}_{\mathrm{net}}={M}_{\mathrm{quad}}+{M}_k $$
(8.15)

The net moment acting on the quadrotor is equal to the change in angular momentum.

$$ {M}_{\mathrm{net}}=I\frac{d}{dt}(w)+w\times (Iw) $$
(8.16)

Ix, Iy, and Iz are moments of inertia, and since the quadrotor is symmetrical along the x and y axes, the product of inertia is zero.

$$ {M}_{\mathrm{net}}=\left[{I}_x\dot{P}\ {I}_y\dot{Q}\ {I}_z\dot{R}\ \right]+\left[\left({I}_z-{\mathrm{I}}_y\right) QR\ \left({I}_x-{I}_z\right) RP\ \left({I}_y-{I}_x\right) PQ\ \right] $$
(8.17)

Roll, pitch, and yaw inputs are part of the moments on the quadrotor.

$$ {M}_k=\left[l\left({F}_4-{F}_2\right)\ l\left({F}_3-{F}_1\right)\ d\left({F}_1-{F}_2+{F}_3-{F}_4\right)\ \right]=\left[{u}_{\phi }\ {u}_{\theta }\ {u}_{\psi }\ \right] $$
(8.18)

If Mquad and Mk are summed and arranged, the following equation is obtained:

$$ \left[\dot{P}\ \dot{Q}\ \dot{R}\ \right]=\left[\frac{\left({I}_y-{I}_z\right)}{I_x} QR\ \frac{\left({I}_z-{I}_x\right)}{I_y} RP\ \frac{\left({I}_x-{I}_y\right)}{I_z} PQ\ \right]+\left[\frac{u_{\phi }}{I_x}\ \frac{u_{\theta }}{I_y}\ \frac{u_{\psi }}{I_z}\ \right]-\left[\frac{k_{\mathrm{r}}P}{I_x}\ \frac{k_{\mathrm{r}}Q}{I_y}\ \frac{k_{\mathrm{r}}R}{I_z}\ \right] $$
(8.19)

where kr is the rotational drag coefficient.

A summary of the equations of motion for the rotational subsystem of the quadrotor is given below:

$$ \dot{P}=\frac{1}{I_x}\left[\left({I}_y-{I}_z\right) QR+{u}_{\phi }-{k}_{\mathrm{r}}P\right] $$
(8.20)
$$ \dot{Q}=\frac{1}{I_y}\left[\left({I}_z-{I}_x\right) RP+{u}_{\theta }-{k}_{\mathrm{r}}Q\right] $$
(8.21)
$$ \dot{R}=\frac{1}{I_z}\left[\left({I}_x-{I}_y\right) PQ+{u}_{\psi }-{k}_{\mathrm{r}}R\right] $$
(8.22)
$$ \dot{\phi}=P+Q\sin \phi \tan \theta +R\cos \phi \tan \theta $$
(8.23)
$$ \dot{\theta}=Q\cos \phi -R\sin \phi $$
(8.24)
$$ \dot{\psi}=Q\sin \phi \sec \theta +R\cos \phi \sec \theta $$
(8.25)

8.3 Scheme of the Proposed Method

8.3.1 Input–Output Linearization

We consider the following nonlinear system with n states, m inputs, and m outputs (Freddi 2012):

$$ \dot{x}=f(x)+g(x)u=f(x)+{\sum}_{i=1}^m{g}_jx{u}_j $$
(8.26)
$$ y={\left[{h}_1(x),\dots, {h}_m(x)\right]}^T $$
(8.27)

where x ϵ Rn is the state vector, u ϵ Rm is the control input, y ϵ Rm is the output vector, and f(x), g1(x),…,gm(x), y are smooth vector fields described on an open subset of Rm.

If the system is single input single output (SISO) (m = 1), it has a relative degree ρ, 1 ≤ ρ ≤ n in a region D0 ⊂ D if

$$ {L}_g{L}_f^{i-1}h(x)=0,\kern1.25em i=1,2,\dots, \rho -1,{L}_g{L}_f^{\rho -1}h(x)\ne 0\kern1em \mathrm{for}\ \mathrm{all}\kern0.5em x\epsilon {D}_0 $$
(8.28)

If the system is multiple input multiple output (MIMO) (m ≠ 1), the relative degree definition changes, and the system is said to have a vector relative degree {r1,…,rm} at a point x0 if:

  • The following condition holds for all 1 ≤ j ≤ m, for all k ≤ ri − 1, for all 1 ≤ i ≤ m, and for all x in the neighborhood of x0 (Freddi 2012)

$$ {L}_{g_j}{L}_f^k{h}_i(x)=0 $$
(8.29)
  • The following matrix is nonsingular at x = x0:

$$ M(x)=\left[{L}_{g_1}{L}_f^{r_1-1}{h}_1(x)\cdots {L}_{g_m}{L}_f^{r_1-1}{h}_1(x){L}_{g_1}{L}_f^{r_2-1}{h}_2(x)\dots {L}_{g_m}{L}_f^{r_2-1}{h}_2(x)\vdots \dots \vdots {L}_{g_1}{L}_f^{r_m-1}{h}_m(x)\cdots {L}_{g_m}{L}_f^{r_m-1}{h}_m(x)\right] $$
(8.30)

The nonlinear system above must hold the conditions below:

  • Sum of elements of the vector relative degree {r1,…,rm} must be equal to n.

  • The matrix M(x) is invertible.

If these conditions are satisfied, a linearizing control law can be found as follows:

$$ {u}_c\left(x,w\right)={\alpha}_c(x)+{\beta}_c(x)w $$
(8.31)

where

$$ {\alpha}_c(x)=-{M}^{-1}(x){\left[{L}_f^{r_1}{h}_1(x)\dots {L}_f^{r_m}{h}_m(x)\right]}^{\mathrm{T}} $$
(8.32)
$$ {\beta}_c={M}^{-1}(x) $$
(8.33)

A diffeomorphism can also be defined as:

$$ {x}_c={\phi}_c(x) $$
(8.34)

where

$$ {\phi}_c^{\mathrm{T}}=\left[{\phi}_{c_1}^{\mathrm{T}}(x)\dots {\phi}_{c_m}^{\mathrm{T}}(x)\right] $$
(8.35)
$$ {\phi}_{c_i}^{\mathrm{T}}=\left[{h}_i(x)\ {L}_f{h}_i(x)\dots {L}_f^{r_i-1}{h}_i(x)\right] $$
(8.36)

A linear system can be obtained if the diffeomorphism is applied to the nonlinear system.

$$ \dot{x}={A}_c{x}_c+{B}_cw $$
(8.37)

where w is linear control law and Ac and Bc represent the canonical Brunowski form.

$$ {A}_c=\operatorname{diag}\left({A}_1\dots {A}_m\right) $$
(8.38)
$$ {B}_c=\operatorname{diag}\left({b}_1\dots {b}_m\right) $$
(8.39)

where

$$ {A}_i=\left[0\ 1\ 0\cdots 0\ 0\ 0\ 1\dots 0\dots \cdots .0\ 0\ 0\dots 1\ 0\ 0\ 0\dots 0\ \right] $$
(8.40)
$$ {b}_i=\left[0\dots 1\ \right] $$
(8.41)

8.3.2 Control System Structure

Control system consists of two control loops: the inner loop is feedback linearization, and the outer loop is LQR. State variables are selected as follows:

$$ x=\left[{x}_1\ {x}_2\ {x}_3\ {x}_4\ {x}_5\ {x}_6\right]=\left[\phi\ \theta\ \psi\ P\ Q\ R\right] $$
(8.42)

x1, x2, x3, x4, x5, and x6 are chosen for feedback linearization. The nonlinear system is represented by:

$$ x=\left[{x}_1\ {x}_2\ {x}_3\ {x}_4\ {x}_5\ {x}_6\right]=\left[\phi\ \theta\ \psi\ P\ Q\ R\right] $$
(8.43)
$$ y={\left[{h}_1\ {h}_2\ {h}_3\right]}^{\mathrm{T}}={\left[{x}_1\ {x}_2\ {x}_3\right]}^{\mathrm{T}} $$
(8.44)

where

$$ f(x)={\displaystyle \begin{array}{l}\Big[{x}_4+{x}_5\mathrm{sinsin}\ {x}_1\ \mathrm{tantan}\ {x}_2+{x}_6\mathrm{coscos}\ {x}_1\ \mathrm{tantan}\ {x}_2\ {x}_5\mathrm{coscos}\ {x}_1\\ {}-\kern2px {x}_6\mathrm{sinsin}\ {x}_1\left({x}_5\mathrm{sinsin}\ {x}_1+{x}_6\mathrm{coscos}\ {x}_1\right)/\mathrm{coscos}\ {x}_2\left(-{k}_r{x}_4-{x}_5{x}_6\left({I}_z-{I}_y\right)\right)\\ {}/{I}_x\left(-{k}_r{x}_5-{x}_4{x}_6\left({I}_x-{I}_z\right)\right)/{I}_y\left(-{k}_r{x}_6\right)/{I}_z\Big]\end{array}} $$
(8.45)

and

$$ g(x)=\left[0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ \frac{1}{I_x}\ 0\ 0\ 0\ \frac{1}{I_y}\ 0\ 0\ 0\ \frac{1}{I_z}\ \right] $$
(8.46)

The summation of relative degrees (r1 = 2, r2 = 2, and r3 = 2) equals to the vector relative degree (r = 6) that is equal to the number of states. The matrix M(x) that is nonsingular is calculated as follows:

$$ M(x)=\left[\frac{1}{I_x}\frac{\mathrm{sinsin}\ {x}_1\ \mathrm{tantan}\ {x}_2}{I_y}\frac{\mathrm{coscos}\ {x}_1\ \mathrm{tantan}\ {x}_2}{I_z}0\frac{\mathrm{coscos}\ {x}_1}{I_y}\frac{-\mathrm{sinsin}\ {x}_1}{I_z}0\frac{\mathrm{sinsin}\ {x}_1}{I_y\mathrm{coscos}\ {x}_2}\frac{\mathrm{coscos}\ {x}_1}{I_z\mathrm{coscos}\ {x}_2}\right] $$
(8.47)

So, two conditions required for feedback linearization are satisfied. Diffeomorphism converts the state variables in the nonlinear system into the state variables of the new system that is linearized in the feedback linearization method.

$$ {\phi}_c(x)={\displaystyle \begin{array}{l}\Big[{x}_1\ {x}_4+{x}_6\mathrm{coscos}\ {x}_1\ \mathrm{tantan}\ {x}_2+{x}_5\mathrm{sinsin}\ {x}_1\ \mathrm{tantan}\ {x}_2\ {x}_2\ {x}_5\mathrm{coscos}\ {x}_1\\ {}-\kern2px {x}_6\mathrm{sinsin}\ {x}_1\ {x}_3\frac{\left({x}_5\mathrm{coscos}\ {x}_1+{x}_5\mathrm{sinsin}\ {x}_1\right)}{\mathrm{coscos}\ {x}_2}\Big]\end{array}} $$
(8.48)

The feedback linearizing law is computed as:

$$ {u}_c\left(x,w\right)={\alpha}_c(x)+{\beta}_c(x)w $$
(8.49)

where

$$ {\alpha}_c(x)={\displaystyle \begin{array}{l}\Big[{k}_r{x}_4+{I}_z{x}_5{x}_6-\frac{I_x{x}_5^2\mathrm{sinsin}\ 2{x}_1}{2}+\frac{{\mathrm{I}}_x{x}_6^2\mathrm{sinsin}\ 2{x}_1}{2}\\ {}-\kern2px 2{I}_x{x}_5{x}_6\mathrm{coscos}\ {x_1}^2\frac{k_r{x}_5\mathrm{coscos}\ {x}_2-{I}_y{x}_5^2\mathrm{coscos}\ {x}_1\ \mathrm{sinsin}\ {x}_2+2{I}_y\cos {x}_6^2\cos\ {x}_1\ \mathrm{sinsin}\ {x}_2+{I}_x{x}_4{x}_6\mathrm{coscos}\ {x}_2+a}{\mathrm{coscos}\ {x}_2}\\ {}\frac{-\left({I}_z{x}_5^2\mathrm{sinsin}\ {x}_1\ \mathrm{sinsin}\ {x}_2-{k}_r{x}_6\mathrm{coscos}\ {x}_2+{I}_z{x}_4{x}_5\mathrm{coscos}\ {x}_2+b\right)}{\mathrm{coscos}\ {x}_2}\Big]\end{array}} $$
(8.50)
$$ a={I}_y{x}_4{x}_6\mathrm{coscos}\ {x}_2-{I}_z{x}_4{x}_6\mathrm{coscos}\ {x}_2+{I}_y{x}_5^2\mathrm{coscos}\ {x_1}^3\mathrm{sinsin}\ {x}_2-{I}_y{x}_6^2\mathrm{coscos}\ {x_1}^3\mathrm{sinsin}\ {x}_2 $$
(8.51)
$$ b={I}_z{x}_5^2\mathrm{coscos}\ {x_1}^2\mathrm{sinsin}\ {x}_1\ \mathrm{sinsin}\ {x}_2-{I}_z{x}_6^2\mathrm{coscos}\ {x_1}^2\mathrm{sinsin}\ {x}_1\ \mathrm{sinsin}\ {x}_2+2{I}_z{x}_5{x}_6\mathrm{coscos}\ {x_1}^3\mathrm{sinsin}\ {x}_2 $$
(8.52)
$$ {\beta}_c(x)={\displaystyle \begin{array}{l}\Big[{I}_x\ 0-{I}_x\mathrm{sinsin}\ {x}_2\ 0\ {I}_y\mathrm{coscos}\ {x}_1\ {I}_y\mathrm{coscos}\ {x}_2\ \mathrm{sinsin}\ {x}_1\ 0\\ {}-\kern2px {I}_z\mathrm{sinsin}\ {x}_1\ {I}_z\mathrm{coscos}\ {x}_1\ \mathrm{coscos}\ {x}_2\Big]\end{array}} $$
(8.53)

If the control law is applied, the following linearized system is obtained:

$$ {\dot{x}}_c={A}_c{x}_c+{B}_cw=\left[0\ 1\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 1\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 1\ 0\ 0\ 0\ 0\ 0\ 0\ \right]{x}_c+\left[0\ 0\ 0\ 1\ 0\ 0\ 0\ 0\ 0\ 0\ 1\ 0\ 0\ 0\ 0\ 0\ 0\ 1\ \right]w $$
(8.54)

Since the system is now linear, a linear control method can be applied. Therefore, linear quadratic regulator (LQR) is preferred because it has easy design and application for linear control of the system. A control law:

$$ w=-K{x}_c $$
(8.55)

is designed by selecting an appropriate K value. This is achieved by choosing Q and R matrices and using MATLAB command lqr, where Q and R matrices are given as follows:

$$ Q=\left[100\ 0\ 0\ 0\ 0\ 0\ 0\ 100\ 0\ 0\ 0\ 0\ 0\ 0\ 100\ 0\ 0\ 0\ 0\ 0\ 0\ 100\ 0\ 0\ 0\ 0\ 0\ 0\ 100\ 0\ 0\ 0\ 0\ 0\ 0\ 100\right] $$
(8.56)
$$ R=\left[0.01\ 0\ 0\ 0\ 0.01\ 0\ 0\ 0\ 0.01\ \right] $$
(8.57)

In the SISO case, if the dimension of the nonlinear system is not equal to the relative degree, zero dynamics appear. So, the stability of the system depends on the stability of the zero dynamics, but this condition is not valid for MIMO systems. In addition, there are no zero dynamics that appear into the system since relative degree is equal to the dimension of the system. So, since our model is MIMO, it is globally asymptotically stable. Sufficient conditions for the system to be stable can be found in (Seborg and Henson 1996).

The general diagram of the proposed observer-based feedback controller is given in Fig. 8.2. {ϕref, θref, ψref} is the reference attitude input. The proposed scheme is based on the quadrotor attitude dynamics given in Eqs. (8.20) and (8.25). The internal disturbance Di is added to the model since the physical and mathematical modeling of the quadrotor contains unknown errors and uncertainty. The external disturbance De is also added due to environmental disturbances and sensor errors. {\( \hat{\phi} \), \( \hat{\theta} \), \( \hat{\psi} \)} is the set of outputs that contain noise terms. Lastly, {\( \overset{\sim }{\phi } \), \( \overset{\sim }{\theta } \), \( \overset{\sim }{\psi } \)} is the set of estimated attitude signals of the quadrotor.

Fig. 8.2
A flow diagram. An input phi ref, theta ref, psi ref within flower brackets, D e, and D i subjected to the dynamics and controller, which processes the input and sends phi cap, theta cap, psi cap within flower brackets, to the observer, which in turn gives the output of phi bar, theta bar, psi bar.

General diagram of the proposed scheme

The sub-diagram of the dynamics and controller block is given in Fig. 8.3. Nonlinear dynamics are linearized by the feedback linearization controller. Then, LQR controller is designed using the linearized dynamics. The sensor produces noisy {ϕ, θ, ψ} states, and reference states are subtracted from these noisy states. The error signal is fed to the LQR controller, which computes the control signal of the linearized system. The feedback linearization controller calculates roll, pitch, and yaw inputs according to LQR output. Nonlinear dynamics generate a state vector that goes to feedback linearization and observer.

Fig. 8.3
A flow diagram. An input phi ref, theta ref, psi ref within flower brackets, and an output from observer lead to a summing point, followed by L Q R, feedback linearization controller, nonlinear dynamics that leads to observer, and an output of phi cap, theta cap, psi cap within flower brackets.

Block diagram of the controller structure

The observer employed in this method is chosen as particle filter. Particle filter is a Monte Carlo–based iterative importance sampling method. Particle filter finds a suboptimal solution to the Bayesian estimation. This suboptimal solution is based on the approximation of the integral terms in the probability density functions. The density functions mentioned before are represented by a vector of random particles and weights. If the number of particle size increases, representation converges to the optimal solution. Particle filter–based scheme is chosen as observer since particle filter has nonlinear framework and can deal with both Gaussian and non-Gaussian distributed noises. Thus, the performance of the proposed controller can be increased and enhanced in real-world scenarios.

The flowchart shown in Fig. 8.4 demonstrates the flow of the proposed controller. First, controller parameters are initialized. Then the loop starts with LQR controller gain. The output of the diffeomorphism is multiplied by LQR gain, and the gain is fed to feedback linearization law. The control mixer produces motor (1–4) inputs from roll, pitch, and yaw inputs. Motor dynamics consist of motor saturation and motor rate limiter. The motor saturation limits motor thrust between 0 N and 5 N. The motor rate limiter restricts the motor rate of thrust by ±50 N/s. Nonlinear quadrotor dynamics generate a derivative of the states using motor (1–4) outputs. The integrator integrates the derivative of the state vector to obtain the states to be used in the control system. Diffeomorphism calculates the linearized system state vector that is observed and fed to LQR gain. The loop continues during the simulation time in this way.

Fig. 8.4
A flow diagram presents the flow as follows. Initialize controller parameters, linear quadratic regular gain, feedback linerization control law, control mixer, motor saturation, motor rate limiter, nonlinear quadrotor dynamics, Integrator, diffeomorphism, observer, and linear quadratic regular gain.

Flowchart of the proposed controller

8.4 Results and Discussion

The proposed observer-based nonlinear control of the quadrotor is implemented in both MATLAB and Simulink environments. Simulations are carried out for 20 [s] with a discrete time step of 0.1 [s]. The parameters of the nonlinear quadrotor model are given in Table 8.1 (Lanzon et al. 2014), where m is the weight, g is the gravity, (Ix, Iy, Iz) are the moments of inertia, l is the length of the arm, d is the drag coefficient of the propellers, and (kr, kt) are rotational and translational drag coefficients. The attitude response of the feedback controller is tested from negative initial angles to positive reference angles for each attitude angle. The initial state vectors are set as [0, 0, 0], [−π/4, −π/8, −π/12] and reference vectors are set as [π/6, π/4, π/3], [0, 0, 0] for first and second scenarios where states are [ϕ, θ, ψ] in [rad], respectively.

Table 8.1 Quadrotor parameters

8.4.1 Noisy Reference Tracking

Since quadrotors are prone to low-cost and unstable sensor errors, it is an essential task to support the controller with an observer/estimator block. Thus, sensor errors can be eliminated through the observer scheme. To evaluate the sensor noise performance of the proposed method, an internal noise source with a variance of 0.01 [rad2] and an external sensor noise with a variance of 0.02 [rad2] are injected to the attitude states of the quadrotor as disturbances. The disturbances are modeled as Gaussian random variable with zero mean and a total of 0.03 [rad2] variance component. The measured overall variance values of the states are 0.0302 for ϕ, 0.0327 for θ, and 0.0283 for ψ. The responses of the controller for the first scenario are given in Fig. 8.5 and the error plot is given in Fig. 8.6. The responses of the controller for the second trajectory is given in Fig. 8.7 and the error plot is given in Fig. 8.8. In Fig. 8.5, green points show the measurement of the states subjected to sensor noise, the blue line shows the ideal controller response without any noise component, and, lastly, the red line shows the response of the proposed method under the sensor noise. A comparative analysis of the performance of the proposed method and total noise is seen in Fig. 8.6 where the magenta line denotes the error of the method and blue points show the total error of internal and external disturbances. The notation is similar for Fig. 8.7 and Fig. 8.8 except sensor noise is given with cyan points for the second scenario. It can be clearly deduced from Figs. 8.5, 8.6, 8.7 and 8.8 that the proposed method is well performed and tracks the reference trajectory even under the sensor noise with a low error ratio for all states.

Fig. 8.5
3 graphs of phi, theta, and psi in radians versus time in seconds. Each graph plots 2 lines for corresponding ideal controller and proposed method, and scatter points for measurement. The plots ascend initially and continue horizontally with fluctuations except ideal controller with no fluctuations.

Noisy response of the proposed controller: from 0 [rad] to arbitrary states

Fig. 8.6
3 graphs of error of phi, theta, and psi in radians versus time in seconds. Each graph plots a line for corresponding error of the method and scatter points for the total error. In all graphs, the line and scatter plots have a horizontal trend with fluctuations.

A comparison of sensor noise and error of the proposed method: from 0 [rad] to arbitrary states

Fig. 8.7
3 graphs of phi, theta, and psi in radians versus time in seconds. Each graph plots 2 lines for corresponding ideal controller and proposed method, and scatter points for measurement. The plots ascend initially and continue horizontally with fluctuations except ideal controller with no fluctuations.

Noisy response of the proposed controller: from arbitrary states to 0 [rad]

Fig. 8.8
3 graphs of error of phi, theta, and psi in radians versus time in seconds. Each graph plots a line for corresponding error of the method and scatter points for the total error. In all graphs, the line and scatter plots have a horizontal trend with fluctuations

A comparison of sensor noise and error of the proposed method: from arbitrary states to 0 [rad]

The statistical analyses of the proposed method under sensor noise are given in Tables 8.2, 8.3, and 8.4 for standard deviation, signal-to-noise ratio (SNR), and absolute error, respectively. The performance of the proposed method is compared against the total noise to show the enhancements of the algorithm. Standard deviations of the errors for all states are seen in Table 8.2 for both trajectories. The proposed method is capable of controlling and reducing sensor errors. The standard deviation of the error for the attitude angles are reduced from nearly 0.17 [rad] to nearly 0.05 [rad]. The standard deviation performance of the proposed method is no more than 0.056 [rad], which is approximately reduced three times with respect to the total error. The signal-to-noise ratio analysis of the algorithm is given in Table 8.3. The method is capable of increasing the SNR for all states and trajectories. The SNR is increased as high as 25.5 with the lowest increment of 0.34 to 1.14. Lastly, the absolute error performance of the algorithm is given in Table 8.4. According to the results, the length of the error is reduced from nearly 0.6 [rad] up to 0.145 [rad] with a reduction of four times.

Table 8.2 Standard deviation analysis of the proposed method
Table 8.3 Signal-to-noise ratio analysis of the proposed method
Table 8.4 Absolute error analysis of the proposed method

8.5 Conclusion

In this work, an observer-based feedback linearization controller for a quadrotor is proposed to control the nonlinear attitude dynamics subjected to sensor noise. The proposed method is tested for noisy references. Two scenarios are considered: from 0 [rad] to any arbitrary state and from any arbitrary state to 0 [rad] to cover more circumstances. According to the results, the proposed method is capable of tracking the given trajectories for noisy references. Numerical analysis showed that the maximum standard deviation of the error of the proposed method is reduced by three times, signal-to-noise ratio is increased by seven times, and the absolute error is reduced by four times.

The SNR is increased from 0.34 to 1.14, absolute error is reduced from 0.6 [rad] up to 0.145 [rad], and standard deviation is reduced from 0.17 [rad] to 0.05 [rad]. According to the abovementioned results, it can be easily concluded that the proposed controller has good control, estimation, and reference tracking responses regarding internal and external noise sources with a low standard deviation of error, absolute error, and high signal-to-noise ratio statistics, respectively.