Keywords

1 Introduction

Quadrotors are agile aerial vehicles equipped by four vertical rotors with several applications from military purposes to rescue projects. Recently, the quadrotors have received considerable attention from researchers all around the world within diverse disciplines. Studying the dynamic equations applied to the quadrotor motions is a good starting point for the study [1, 2]. This can be continued by designing some low-level controllers for the torque generation of electric motors and energy management in the battery as well as designing a high-level controller for trajectory tracking or localization [3]. Different control methods has been studied for the quadrotors [2], including PID [4], back-stepping control [5, 6], nonlinear H-Infinity control [7], LQR controllers [8], nonlinear controllers and adaptive controllers [9]. Other class of adaptive controllers which assume the indirect adaptive scheme [1012] are potentially applicable for a quadrotor control as it is a very highly nonlinear system. The above control techniques are compared for their capability in quadrotor flight control in Table 1. In this table, three parameters are considered. Tracking performance measures the ability of the controller to force the quadrotor to track an input command for position or velocity. The ability of the controller to remain as effective as possible in presence of actuator or sensor failures as well as the model uncertainties is considered in the second column of Table 1. The third column describes the amount of effort and cost required by the controller to generate the control command. As can be seen, designing an adaptive controller would be the most useful and affordable choice.

Table 1 Comparison of different control techniques for quadrotor flight control

The paper is organised as follows, first section describes the kinematics and dynamics model for a quadrotor. The second section illustrates the validation of the developed model using a PID controller to do the hovering motion. The third section presents the adaptive control design using adaptive law with leakage integrator for added robustness on the adaptation. The result is proven through simulation.

2 Quadrotor System Modelling

In this section, the quadrotor body and its four rotors as its corresponding actuators are modeled.

2.1 Electric Rotor Model

The voltage balance and the torque balance in a brushless DC motor are given by

$$\begin{aligned} V_m = IR_{res} + V_{bemf}~(1a), \quad {J_M\dot{\omega }_M = \tau _M - \tau _d, \quad \tau _m = K_i I}~(1b) \end{aligned}$$
(1)

where \(V_m\) is the motor supply voltage, I is the motor supply current, \(R_{res}\) is the internal resistance of the motor, \(\tau _m\) is the traction torque of the electric motor and \(\tau _d\) is the drag torque which is expressed as \({\tau _d = \frac{1}{2}\rho C_d A_{blade}(r\omega _M)^2 \times r}\) \({= K_d \omega ^2_M}\). Here, r is the radius for each rotor blade, \(\rho \) is the air density, \(C_d\) is the drag coefficient against the blade rotation and \(A_{blade}\) is the blade cross section. The motor back electromotive force or back emf can be expressed as \(V_{bemf}=K_v \omega _m\) where \(\omega _m\) is the angular velocity of the motor. Here, the internal inductance of the motor is neglected.

2.2 Thrust Force of Each Rotor

The thrust force for each electric motor is driven from the balance of energy

$$\begin{aligned} {P_{air} = P_{Mech} = \eta P_{elec} = \eta V_{in}I = \eta \frac{K_v}{K_i} \tau _m \omega _m} \end{aligned}$$
(2)

where \(\eta \) is the efficiency of the power generation in each electric motor and \(P_{air}\) is the power induced to the air by the electric motor. Based on the momentum theory, we have [2]

$$\begin{aligned} {P_{air} = \sqrt{\frac{T^2}{2\rho A_{swept}}}}~(3a) \quad {T = \root 3 \of {(\eta \frac{K_v}{K_i} \tau _m \omega _m)^2 \times 2\rho A_{swept}}}~(3b) \end{aligned}$$
(3)

where \(A_{swept}\) is the total area swept by each rotor blade and T is the thrust force.

2.3 Quadrotor Kinematics

A schematic for body diagram of the quadrotor and the corresponding reference frames are shown in Fig. 1.

Fig. 1
figure 1

Body diagram for the quadrotor and the two reference frames [2]

There are two frames required for defining the quadrotor dynamics. The inertia frame (subscript I) is fixed in earth and the body frame (subscript B) which is fixed to the quadrotor body is rotated by (\(\theta \), \(\phi \), \(\psi \)) with respect to the inertia frame. These angles are roll, pitch and yaw which are rotations about x, y and z axes respectively. Here, the rotation matrix is

$$\begin{aligned} R = \left[ \begin{array}{ccc} C\psi . C\phi \;\;\;&{} C\psi . S\phi . S\theta + S\psi . C\theta \;\;\;&{} -C\psi . S\phi . C\theta + S\psi . S\theta \\ -S\psi . C\phi \;\;\;&{} -S\psi . S\phi . S\theta + C\psi . C\theta \;\;\;&{} S\psi . S\phi . C\theta + C\psi . S\theta \\ S\phi \;\;\;&{} -C\phi . S\theta \;\;\;&{} C\phi . C\theta \end{array} \right] \end{aligned}$$
(4)

where \(C\psi ,C\phi ,C\theta ,S\psi ,S\phi \) and \(S\theta \) denote abbreviated trigonometric functions for \(\cos (\cdot ),\sin (\cdot )\) respectively. Each vector in body from, v, is transformed to the inertia frame by Rv. In addition, the angular velocity vector of the body frame (quadrotor) in inertia frame is

$$\begin{aligned} {\omega = \left[ \begin{array}{c} \omega _x \\ \omega _y \\ \omega _z \end{array} \right] = \left[ \begin{array}{ccc} 1 \;\;\;&{} 0 \;\;\;&{} \sin \phi \\ 0 \;\;\;&{} \cos \theta \;\;\;&{} -\cos \phi . \sin \theta \\ 0 \;\;\;&{} \sin \theta \;\;\;&{} \cos \phi . \cos \theta \end{array} \right] \left[ \begin{array}{c} \dot{\theta } \\ \dot{\phi } \\ \dot{\psi } \end{array} \right] } \end{aligned}$$
(5)

where \(\left( \dot{\theta },\dot{\phi },\dot{\psi }\right) \) are the derivatives of roll, pitch and yaw angles. From the kinematics of rigid bodies, we have

$$\begin{aligned} {\begin{array}{c} [a_{(G_i)}]_I = [r_{(OG)_i}]_I \times \dot{\omega } + \omega \times ([r_{({OG}_i)}]_I \times \omega ) \\ \\ \frac{d}{dt}[H_{(G_i)}]_I = [I_{(G_i)}]_I \dot{\omega } \end{array}} \end{aligned}$$
(6)

in which \([a_{(G_i)}]_I \in R^{[3\times 1]}\) is the acceleration of the center point of ith rotor, \([r_{({OG}_i)}]_I \in R^{[3\times 1]}\) is the distance vector from the ith rotor set centroid to the quadrotor centroid, \([H_{(G_i)}]_I \in R^{[3\times 1]}\) is the angular momentum of the ith rotor set around its own centroid and \([I_{(G_i)}]_I \in R^{[3\times 1]}\) is the second moment of inertia matrix for ith rotor set around its centroid and \(\dot{\omega }\) is the angular acceleration vector.

2.4 Quadrotor Dynamics

The quadrotor dynamics includes two main equations

$$\begin{aligned} {\begin{array}{c} \sum \nolimits ^4_{i=1} [F_i]_I - [F_D]_I = \sum \nolimits ^4_{i=1} m_i [a_{(G_i)}]_I \\ \\ \sum \nolimits ^4_{i=1} [M_{o(i)}]_I = \sum \nolimits ^4_{i=1} \frac{d}{dt}[H_{(G_i)}]_I + \sum \nolimits ^4_{i=1} [r_{({OG}_i)}]_I \times m_i [a_{(G_i)}]_I \end{array}} \end{aligned}$$
(7)

where, \([F_i]_I \in R^{[3\times 1]}\) is the thrust force generated by the ith rotor, \([F_D]_I \in R^{[3\times 1]}\) is the total drag force against the quadrotor motion, \(m_i\) is each rotor set mass and \([M_o(i)]_I \in R^{[3\times 1]}\) is the sum of moments from the ith rotor set around the quadrotor centroid. Hence, the moment balance equation is

$$\begin{aligned} {\begin{array}{c} \sum \nolimits ^4_{i=1} [I_{(G_i)}]_I \dot{\omega } + \sum \nolimits ^4_{i=1} m_i [r_{({OG}_i)}]_I \times ([r_{({OG}_i)}]_I \times \dot{\omega }) = \sum \nolimits ^4_{i=1} [M_{o(i)}]_I - \\ \\ \;\; \sum \nolimits ^4_{i=1} m_i [r_{({OG}_i)}]_I \times (\omega \times ([r_{({OG}_i)}]_I \times \omega )) \end{array}} \end{aligned}$$
(8)

By doing some algebra, we have

$$\begin{aligned} {[r_{({OG}_i)}]_I \times ([r_{({OG}_i)}]_I \times \dot{\omega }) = (([r_{({OG}_i)}]_I [r_{({OG}_i)}]_I^T) - ([r_{({OG}_i)}]_I . [r_{({OG}_i)}]_I^T)I) \dot{\omega }} \end{aligned}$$
(9)

where \(([r_{({OG}_i)}]_I [r_{({OG}_i)}]_I^T)\) is belonged to \(R^{[3\times 3]}\) and \(I \in R^{[3\times 3]}\) is the identity matrix. Moreover, the superscript T is indication for vector or matrix transpose. Actually, the triple vector product is changed to a matrix product. Hence, the left part of Eq. 8 is equal to

$$\begin{aligned} {\sum \nolimits ^4_{i=1} ([I_{(G_i)}]_I + m_i \times (([r_{({OG}_i)}]_I [r_{({OG}_i)}]_I^T) - ([r_{({OG}_i)}]_I . [r_{({OG}_i)}]_I^T)I) ) \dot{\omega }} \end{aligned}$$
(10)

Similarly, we have

$$\begin{aligned} {(\omega \times ([r_{({OG}_i)}]_I \times \omega )) = ((\omega . \omega )I) - (\omega \omega ^T))[r_{({OG}_i)}]_I} \end{aligned}$$
(11)

where \((\omega \omega ^T)\) is belonged to \(R^{[3\times 3]}\) and again \(I \in R^{[3\times 3]}\) is the identity matrix. Hence, the second term in the right hand side of Eq. 8 is equal to

$$\begin{aligned} {\sum \nolimits ^4_{i=1} m_i [r_{({OG}_i)}]_I \times (((\omega . \omega )I) - (\omega \omega ^T))[r_{({OG}_i)}]_I)} \end{aligned}$$
(12)

In addition, the first term in the right hand side of that equation is

$$\begin{aligned} {\begin{array}{c} \sum \nolimits ^4_{i=1} [M_{o(i)}]_I = \sum \nolimits ^4_{i=1} R[\tau _i]_B \\ \\ \;\; [\tau _1]_B = \left[ \begin{array}{c} 0 \\ -LF_1 \\ M_1 \end{array} \right] \;\;\;, [\tau _2]_B = \left[ \begin{array}{c} LF_2 \\ 0 \\ M_2 \end{array} \right] \;\;\;, [\tau _3]_B = \left[ \begin{array}{c} 0 \\ LF_3 \\ M_3 \end{array} \right] \;\;\;, [\tau _4]_B = \left[ \begin{array}{c} -LF_4 \\ 0 \\ -M_4 \end{array} \right] \end{array}} \end{aligned}$$
(13)

where L is the length of quadrotor arm, \(F_i\) is the ith rotor thrust, \(M_i\) is the ith rotor torque and R is the rotation matrix. It should be noted that two diagonal positioned motors rotate in the same direction while the two motors positioned along the other diametric line rotate in the reverse direction with respect to the first two motors. This causes two motors to generate negative torque while the other two motors have positive torque. Finally, Eq. 8 could be solved in a recursive manner to determine \(\omega \).

$$\begin{aligned} {\begin{array}{c} \dot{\omega } = [ \sum \nolimits ^4_{i=1} [I_{(G_i)}]_I + m_i \times ( ([r_{({OG}_i)}]_I [r_{({OG}_i)}]_I^T) - ([r_{({OG}_i)}]_I . [r_{({OG}_i)}]_I^T)I) ) ] ^{-1} \; [ \sum \nolimits ^4_{i=1} \\ \\ \;\; R[\tau _i]_B - m_i [r_{({OG}_i)}]_I \times (((\omega . \omega )I) - (\omega \omega ^T))[r_{({OG}_i)}]_I ] \end{array}} \end{aligned}$$
(14)

Moreover, the equation for force balance (Eq. 7) is solved in a similar recursive algorithm by the initial value of \([0 \;\; 0 \;\; 0]^T\) for linear position of the quadrotor

$$\begin{aligned} {[a_{(G_i)}]_I = \left[ \begin{array}{c} \ddot{x} \\ \ddot{y} \\ \ddot{z} \end{array} \right] = \frac{1}{M_{total}} [\sum \nolimits ^4_{i=1} R[F_i]_B - [F_D]_I - M_{total}g] \;\;,\;\; [F_i]_B = \left[ \begin{array}{c} 0 \\ 0 \\ F_i \end{array} \right] } \end{aligned}$$
(15)

where \([F_D]_I\) is the total drag force against the quadrotor translation in all direction and can be determined by [2]

$$\begin{aligned} {[F_D]_I = 0.5 \rho C_D A_T \left[ \begin{array}{c} \dot{x} \\ \dot{y} \\ \dot{z} \end{array} \right] = k_d^* \left[ \begin{array}{c} \dot{x} \\ \dot{y} \\ \dot{z} \end{array} \right] } \end{aligned}$$
(16)

All the above equations are modeled in MATLAB/SIMULINK to have a physical model for quadrotor motion.

3 Adaptive Control Design

In this section, we want to control a simplified motion including taking-off, hovering and landing of the quadrotor in presence of missing some data about the quadrotor model. Hence, the following assumptions are drawn:

3.1 Assumptions:

Assumption 1

Only the vertical displacement is considered and therefore four rotors are assumed to generate the same thrust, i.e. requiring an equal synchronised input voltage and consequently the similar rotation speed of each electric motor

$$\begin{aligned} {[F]_B = [F_1]_B + [F_2]_B + [F_3]_B + [F_4]_B = \left[ \begin{array}{c} 0 \\ 0 \\ 4F_0 \end{array} \right] } \end{aligned}$$
(17)

Assumption 2

since all the electric motors rotate in same angular speed (same input voltage), the total torque implemented on the quadrotor would be zero

$$\begin{aligned} {[\tau ]_B = \left[ \begin{array}{c} 0 \\ -LF_0 \\ M_0 \end{array} \right] + \left[ \begin{array}{c} LF_0 \\ 0 \\ -M_0 \end{array} \right] + \left[ \begin{array}{c} 0 \\ LF_0 \\ M_0 \end{array} \right] + \left[ \begin{array}{c} -LF_0 \\ 0 \\ -M_0 \end{array} \right] = \left[ \begin{array}{c} 0 \\ 0 \\ 0 \end{array} \right] } \end{aligned}$$
(18)

Assumption 3

since only a translation motion is considered, the amount of quadrotor rotation around each axis of inertia frame is neglected.

Assumption 4

the internal resistance (\(R_{res}\)) for each electric motor and the moment of inertia (\(J_M\)) are negligible. Hence, the relation between the generated thrust force T and the input voltage \(V_{in}(t)\) based on the electrical equations presented before is

$$\begin{aligned} {\begin{array}{c} \tau _m = \tau _d = K_d \omega _M ^2 \;\;,\;\; \omega _M = \frac{V_{in}(t)}{K_v} \\ \\ F_0 = T = \root 3 \of {{(\eta \frac{K_v}{K_i} \tau _M \omega _M)}^2 \times 2\rho A_{swept}} = K_T \omega _M ^2 = \frac{K_T}{K_v^2} V_{in}(t)^2 \end{array}} \end{aligned}$$
(19)

Finally, the simplified quadrotor model based on the above assumptions is a single-input and single-output system

$$\begin{aligned} {\begin{array}{c} \ddot{z}(t) = -\frac{k_d^*}{M_{total}} \dot{z}(t) - g + \frac{4K_T}{M_{total}K_v^2} V_{in}(t)^2 = -\mathcal {A}\dot{z}(t) + \beta u(t) - g \\ \\ u(t) = V_{in}(t)^2 \;\;,\;\; \mathcal {A} = \frac{k_d^*}{M_{total}} \;\;,\;\; \beta = \frac{4K_T}{M_{total}K_v^2} \end{array}} \end{aligned}$$
(20)

Both \(\mathcal {A}\) and \(\beta \) above, includes the uncertainty values. The control signal, u(t), should be designed in such a way that the model track the reference signal at least asymptotically.

3.2 Controller Design Without Considering Any Uncertainty

First, we design the controller considering the values of \(\mathcal {A}\) and \(\beta \) in Eq. 20 are known (0.0016 for \(\mathcal {A}\) and 5.8827e3 for \(\beta \)). The control signal is defined as

$$\begin{aligned} {u(t) = \frac{1}{\beta } g + K_p e(t) + K_d \dot{e}(t) \;\;,\;\; e(t) = z_r(t) - z(t)} \end{aligned}$$
(21)

where \(z_r\) is the reference signal for the vertical displacement of the quadrotor. By replacing Eq. 21 in Eq. 20 and using Laplace transform, we have

$$\begin{aligned} {\frac{z(s)}{z_r(s)} = \frac{\beta K_ds + \beta K_p}{s^2 + (\mathcal {A}+\beta K_d)s + \beta K_p}} \end{aligned}$$
(22)

Requesting for less overshoot and the sufficient settling time, the values for the controller gains can be determined as

$$\begin{aligned} {K_p = 0.0034 \;\;,\;\; K_d = 0.0025} \end{aligned}$$
(23)

3.3 Controller Design Considering the Uncertainties

Here an adaptive controller is designed to consider the uncertainties in \(\mathcal {A}\) and \(\beta \). The adaptive controller employed in this paper is of an indirect adaptive scheme, i.e., both the convergence of the parameters estimation error and tracking error to zero can be guaranteed. Moreover, it has been proven recently that an indirect scheme allows the control designer to flexibly enhance the adaptive law (for estimating unknown parameters) to allow the convergence at a faster rate for. e.g. finite-time estimation in [10]. However, for brevity, this paper demonstrates only the gradient-based adaptive law which is well known for asymptotical convergence properties [13]. The control signal is same as the one generated in previous section. Only, the unknown parameters are estimated before the generation of control signal. Equation 20 can be rearranged as follows by using the Laplace transform

$$\begin{aligned} \begin{array}{c} \;\; s^2 z(s) + g = -\mathcal {A}sz(s) + \beta u(s) \\ \\ \;\; \frac{s^2}{s^3 + 1} z(s) + \frac{1}{s^3 + 1} g = \mathcal {A} \frac{-s}{s^3 + 1} z(s) + \beta \frac{1}{s^3 + 1} u(s) \end{array} \end{aligned}$$
(24)

where, the equation is divided by \(\frac{1}{s^3 + 1}\) (the filter operator) to avoid using the derivative of signals, i.e. differentiating noisy signal may cause instability. Hence, a filtered linearly-parameterized model can be formulated as

$$\begin{aligned} Y = \varTheta ^T \varPhi \end{aligned}$$
(25)

where the unknown parameter vector \(\varTheta \) can be defined as \(\varTheta = \left[ \mathcal {A} \quad \beta \right] ^T\) and the associated filtered regressor vector \(\varPhi \) can be defined \(\varPhi = [\phi _1^T \quad \phi _2^T]\) with \(\phi _1= \frac{-s}{s^3 + 1} z(s)\) and \(\phi _2=\frac{1}{s^3 + 1}u(s)\).

Now, we are to search the unknown parameters \(\mathcal {A}\) and \(\beta \) in \(\varTheta \in \mathbb {R}^2\) by virtue of the gradient-based adaptive law (normalised version),

$$\begin{aligned} \dot{\hat{\varTheta }} = \frac{\gamma \varPhi \epsilon }{1+\varPhi ^T \varPhi } \quad \varTheta _0 = \left[ \begin{array}{c} 0 \\ 1000 \end{array} \right] \end{aligned}$$
(26)

where, \(\epsilon = Y - \varTheta ^T \varPhi \) is the parameter estimation error, \(\gamma \) is the adaptive gain to be designed by the Lyapunov stability approach. Differentiating a Lyapunov candidate chosen as \(\mathcal {V}= \frac{1}{2}\tilde{\varTheta }^T\gamma ^{-1}\tilde{\varTheta }\) will lead to \(\dot{\mathcal {V}} \le -\alpha \mathcal {V}\) to be negative definite with asymptotical convergence rate \(\alpha \) of parameter estimation error \(\tilde{\varTheta }=\varTheta -\hat{\varTheta }\) to zero.

The initial condition (\(\varTheta _0\)) for running the estimation process can be defined based on the prior knowledge about the order of unknown parameters.

Table 2 Quadrotor Specifications
Fig. 2
figure 2

Vertical displacement of the quadrotor (left), control signal for each electric motor (right)

Fig. 3
figure 3

Estimated values of unknown parameters

4 Simulation Results

In this section, the simulation results for performance of the designed adaptive controller implemented on the nonlinear quadrotor plant are presented. The quadrotor specification are presented in Table 2. As can be seen the estimation process is performed in about 30 seconds and after that the reference signal is tracked appropriately (Fig. 2). Moreover, the estimated values for unknown parameters are very close to the real values (Fig. 3).

5 Conclusion

In this paper, a complete mathematical model for a quadrotor is presented. The dynamics and kinematics equations are defined in such a way that the modeling process and controller designing can be performed without any complexity. In addition, an indirect adaptive controller is designed for the taking-off, hovering and landing of the quadrotor. The controller includes a linear parameter estimation procedure based on Lyapunov stability theory. The simulation results show that the unknown parameters are estimated accurately and quickly. Moreover, the tracking performance of the controlled plant is acceptable.