Keywords

1 Introduction

In recent years, the quad-rotor aircraft with its simple structure, good mobility, low cost and other advantages, is widely used in plant protection, aerial photography, detection and other civil and military fields [1]. Compared to fixed-wing aircraft, the movement of quad-rotor is more flexible. It can complete the vertical takeoff and landing, fixed hover, low-speed flight and indoor flight. The movement of the quad-rotor aircraft is carried out on the basis of the change of the attitude. For the quad-rotor aircraft attitude control, the current research has been carried out, including cascade PID control [2], back-stepping control [3], sliding mode control [4], robust control [5, 6], etc.

Among them, back-stepping control, sliding mode control and robust control need high model accuracy. However, it is difficult to obtain the accurate parameters of the aircraft due to the interference of environmental factors. Therefore, the cascade PID controller, which is independent of the model, is the most widely used in practical aircraft. However, there are still some defects in cascade PID control system, such as load change, strong wind and other disturbances will affect the control quality. In order to solve the above problems, ADRC technology has been widely concerned by the developers [7, 8].

The main idea of active disturbance rejection control is to count the internal disturbances and external disturbances of the system into the total perturbations, then estimate the total disturbance by the extended state observer and compensate it in real time. Professor Gao proposed a linear active disturbance rejection controller, which simplifies the conversion of the ADRC to only three parameters by adjusting the bandwidth, and the physical meaning of these parameters are clear [9]. So the LADRC is more suitable for actual system control applications.

Based on the analysis of the structure, flight principle and dynamic characteristics of the quad-rotor aircraft, linear active disturbance rejection controllers are designed for pitch, roll, yaw and height respectively. The simulation is carried out in the MATLAB/Simulink environment and the simulation results show that the attitude and height tracking and stabilization are achieved.

2 Dynamic Model of Quad-Rotor Aircraft

In order to describe the mathematical model of the quad-rotor aircraft, it is first necessary to establish two coordinate systems—the body coordinate system \({\text{B}}\left( {{\text{X}}_{\text{b}} , {\text{Y}}_{\text{b}} , {\text{Z}}_{\text{b}} } \right)\) and the earth coordinate system \({\text{E}}\left( {{\text{X}}_{\text{e}} , {\text{Y}}_{\text{e}} , {\text{Z}}_{\text{e}} } \right)\) as shown in the Figs. 1 and 2, respectively.

Fig. 1
figure 1

Body coordinate system

Fig. 2
figure 2

Earth coordinate system

Quad-rotor aircraft is a complex mechanical system, which contains a lot of physical effects in the field of mechanics and aerodynamics.

The motion of the quad-rotor in space can be regarded as a rigid body motion with six degrees of freedom, and its motion equation can be divided into two parts: the horizontal motion in space and the rotation around the center of mass. According to the Newton-Euler equation, the motion of the quad-rotor can be expressed in the body coordinate system:

$$\left[ {\begin{array}{*{20}c} {m{\text{I}}_{3*3} } & 0 \\ 0 & J \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\dot{\nu }_{b} } \\ {\dot{\omega }} \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {\omega \times mv_{b} } \\ {\omega \times J\omega } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} F \\ T \\ \end{array} } \right]$$
(1)

where m is the mass of the quad-rotor, \(J = [\begin{array}{*{20}c} {J_{x} } & {J_{y} } & {J_{z} } \\ \end{array} ]^{\text{T}}\) is the rotary inertia of the three axes in the body coordinate system, \(v_{b} = [\begin{array}{*{20}c} u & v & w \\ \end{array} ]^{\text{T}}\) is the speed of the quad-rotor in the body coordinate system along the three axis, \(\omega = [\begin{array}{*{20}c} p & q & r \\ \end{array} ]^{\text{T}}\) is the angular velocity that around the three axes in the body coordinate system, \(F = [\begin{array}{*{20}c} {F_{x} } & {F_{y} } & {F_{z} } \\ \end{array} ]^{\text{T}}\) is the composition of forces which the quad-rotor accepts along the three axis in the body coordinate system, \(T = [\begin{array}{*{20}c} {\tau_{x} } & {\tau_{y} } & {\tau_{z} } \\ \end{array} ]^{\text{T}}\) is the torque of the quad-rotor around the three axes in the body coordinate system.

The angular motion equation of the quad-rotor is exactly the same as that of other types of air vehicles. The relationship between the Euler angular velocity and the three axis angular velocity is:

$$\left[ {\begin{array}{*{20}c} 1 & 0 & { - \sin \,\theta } \\ 0 & {\cos \,\phi } & {\sin \,\phi \,\cos \,\theta } \\ 0 & { - \sin \,\phi } & {\cos \,\phi \,\cos \,\theta } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\dot{\phi }} \\ {\dot{\theta }} \\ {\dot{\psi }} \\ \end{array} } \right] = \omega$$
(2)

According to the relevant knowledge of inertial navigation, the rotation matrix of the body coordinate system to the earth coordinate system is:

$$R = \left[ {\begin{array}{*{20}c} {\cos \,\theta \,\cos \,\psi } & {\cos \,\psi \,\sin \,\theta \,\sin \,\phi - \sin \,\psi \,\cos \,\phi } & {\cos \,\psi \,\sin \,\theta \,\cos \,\phi + \sin \,\psi \,\sin \,\phi } \\ {\cos \,\theta \,\sin \,\psi } & {\sin \,\psi \,\sin \,\theta \,\sin \,\phi + \cos \,\psi \,\cos \,\phi } & {\sin \,\psi \,\sin \,\theta \,\cos \,\phi - \cos \,\psi \,\sin \,\phi } \\ {-\sin \,\theta } & {\sin \,\phi \,\cos \,\theta } & {\cos \,\phi \,\cos \,\theta } \\ \end{array} } \right]$$

where φ, θ and ψ are the rotation angles of the body coordinate system relative to the earth coordinate system respectively. Then:

$$v_{e} = Rv_{b}$$
(3)

where \(v_{e} = [\begin{array}{*{20}c} {v_{x} } & {v_{y} } & {v_{z} } \\ \end{array} ]^{\text{T}}\) is the quad-rotor’s speed in the earth coordinate system.

The quad-rotor is affected by the gravity–mg and the total pulling force of the propeller–\(F_{T}\), where the gravity direction is the positive direction of the Z axis in the earth coordinate system and the pulling force direction is the negative direction of the Z axis in the body coordinate system. The gravity is decomposed along the three axis of the body coordinate system, and put it in the formula (1), then:

$$\left\{ {\begin{array}{*{20}l} {\dot{u} = - {\text{gsin}}\,\theta + rv - qw} \hfill \\ {\dot{v} = {\text{gsin}}\,\varphi \,\cos \,\theta + pw - ru} \hfill \\ {\dot{w} = {\text{gcos}}\,\varphi \,\cos \,\theta + qu - pv - F_{T} } \hfill \\ \end{array} } \right.$$
(4)

The quad-rotor’s external torque in the body coordinate system is:

$$\left\{ {\begin{array}{*{20}l} {\tau_{x} = \frac{\sqrt 2 }{2}l\left( {T_{1} - T_{2} - T_{3} + T_{4} } \right) - J_{r} q\left( {\Omega _{1} -\Omega _{2} +\Omega _{3} -\Omega _{4} } \right)} \hfill \\ {\tau_{y} = \frac{\sqrt 2 }{2}l\left( {T_{1} - T_{2} - T_{3} + T_{4} } \right) + J_{r} p\left( {\Omega _{1} -\Omega _{2} +\Omega _{3} -\Omega _{4} } \right)} \hfill \\ {\tau_{z} = d\left( {\Omega _{1}^{2} -\Omega _{2}^{2} +\Omega _{3}^{2} -\Omega _{4}^{2} } \right) } \hfill \\ \end{array} } \right.$$
(5)

where \(T_{i}\) is the lift force of the ith propeller, ith is the speed of the ith propeller, \(J_{r}\) is the moment of inertia of the propeller and d is the inverse torque coefficient of the propeller.

There is a relationship between the lift and the speed of the propeller:

$$T_{i} = b\Omega _{\text{i}}^{2}$$
(6)

where b is the lift coefficient of the propeller.

According to formula 16, the mathematical model of the quad-rotor aircraft can be expressed as:

$$\left\{ \begin{aligned} \dot{p} & = \frac{{\left( {J_{y} - J_{z} } \right)}}{{J_{x} }}qr + \frac{{J_{r} q\left( {\Omega _{1} -\Omega _{2} +\Omega _{3} -\Omega _{4} } \right)}}{{J_{x} }} + \frac{{\frac{\sqrt 2 }{2}l\left( {T_{1} - T_{2} - T_{3} + T_{4} } \right)}}{{J_{x} }} \\ \dot{q} & = \frac{{\left( {J_{z} - J_{x} } \right)}}{{J_{y} }}pr - \frac{{J_{r} p\left( {\Omega _{1} -\Omega _{2} +\Omega _{3} -\Omega _{4} } \right)}}{{J_{y} }} + \frac{{\frac{\sqrt 2 }{2}l\left( {T_{1} - T_{2} - T_{3} + T_{4} } \right)}}{{J_{y} }} \\ \dot{r} & = \frac{{\left( {J_{x} - J_{y} } \right)}}{{J_{z} }}pq + \frac{{d\left( {\Omega _{1}^{2} -\Omega _{2}^{2} +\Omega _{3}^{2} -\Omega _{4}^{2} } \right)}}{{J_{z} }}\ \\ \dot{\phi } & = p + \left( {\sin \,\phi \,\tan \,\theta } \right)q + \left( {\cos \,\phi \,\tan \,\theta } \right)r \\ \dot{\theta } & = q\,\cos \,\phi - r\,\sin \,\phi \\ \dot{\psi } & = \left( {\sin \,\phi /\cos \,\theta } \right)q + \left( {\cos \,\phi /\cos \,\theta } \right)r \\ \dot{u} & = - {\text{gsin}}\,\theta + rv - qw \\ \dot{v} & = {\text{gsin}}\,\varphi \,\cos \,\theta + pw - ru \\ \dot{w} & = {\text{gcos}}\,\varphi \,\cos \,\theta + qu - pv - F_{T} \\ \ddot{X} & = R\left[ {\begin{array}{*{20}c} u & v & w \\ \end{array} } \right]^{\text{T}} \\ \end{aligned} \right.$$
(7)

where \(X = [\begin{array}{*{20}c} x & y & z \\ \end{array} ]^{\text{T}}\) is the position of the quad-rotor aircraft under the earth system.

All the parameters in the model are shown in Table 1

Table 1 Simulation parameter of quad-rotor

3 Attitude Control System Design

In this paper, using the incremental output in the attitude controller design. First, PWM wave with fixed duty cycle was transmitted to every motor to keep a base speed–R. Then the output of the controller is added or reduced on the basis of R. The speed that a pair of motors increases is equal to the other pair reduces. For this reason, it is possible to use a squared difference formula when calculating the torque. Thus, the non-linear relationship between the square of the speed and the lift is eliminated. The base speed R is set to the speed of four motors when the quad-rotor hovered steadily. That is \(mg = 4bR^{2}\).

Put the parameters of model given in chapter two into above formula, it can be calculated that R = 212.6 rad/s.

When designing the controller one channel, assume that other channels are set to zero. Then the transfer function of the roll channel is:

$$G_{r} ( {\text{s)}} = \frac{1.93}{{(0.178{\text{s}} + 1)s^{2} }}$$

Similarly, the transfer functions of the pitch channel and yaw channel are:

$$G_{p} ( {\text{s)}} = \frac{1.93}{{(0.178{\text{s}} + 1)s^{2} }},\,G_{y} ( {\text{s)}} = \frac{0.132}{{(0.178{\text{s}} + 1)s^{2} }}.$$

As for the height channel, all the motors accelerate and decelerate simultaneously, so the square relationship can’t be eliminated between the motor speed and lift. Thus the mathematical model of height channel is:

$$\ddot{z} = g - \frac{{b\left( {{\text{R}} + \sum\Delta {\Omega }_{i} } \right)^{2} }}{m}$$

3.1 Cascade PID Controller Design

As one of the earliest developed control strategies, PID control is widely used in production practice because of its simple algorithm, good robustness and high reliability. The cascade PID attitude controller connects the two PID controllers in series, where the output of the previous controller is used as the reference for the next controller. Inner loop named stabilization loop set the amount of change in attitude, responsible for coarse adjustment, and the outer loop named attitude loop set the attitude, responsible for fine tuning. The inner loop makes the response speed of the system be improved. Simultaneously it can suppress the disturbance in the inner loop, and enhance the anti-interference ability of the system. The structure of cascade PID control system is shown in Fig. 3.

Fig. 3
figure 3

The structure of cascade PID controller

In the cascade PID parameter tuning process, first disconnect the outer loop, set the inner loop. The inner loop is the follower system, its main role is to quickly track, resist interference, and the inner loop itself includes pure integral part. Therefore PD control is adopted.

In order to ensure the inner ring of the anti-interference ability of the system, we choose a larger value of \(kp = 100\). The performance requirements of the inner loop system are: fast response and allow for a small amount of overshoot, so we select the value near the root locus separation point as the final closed-loop pole of the inner loop system, where \(kd = 6\).

The inner loop PID parameters are determined and then connected to the outer loop, the outer loop also contains a pure integral link, so the outer loop can also be achieved without static error by PD controller. The same as the inner loop. First, increase the proportion coefficient to improve the response speed of the system. Then, increase the derivative time gradually to suppress overshoot. After repeated debugging, the final outer loop parameters are determined as \(kp = 20\), \(kd = 0.3\).

The parameter tuning process of the other three channels is similar to that of the roll channel, the details are omitted here due to space limit.

Finally, the parameters of the cascade PID controller are obtained, which are shown in Table 2

Table 2 Parameters of cascade PID controller

3.2 LADRC Controller Design

The core of linear active disturbance rejection controller is the linear extended state observer (ESO). The linear extended state observer makes use of the input and output information of the system to estimate the state of the system and the total disturbance. And then we design the linear state feedback to compensate this total disturbance. As the three attitude channels are third-order system, while the height channel can also be similar to the third-order system, so we select the fourth-order extended state observer. The linear active disturbance rejection attitude controller is shown in the Fig. 4:

Fig. 4
figure 4

Linear active disturbance rejection attitude controller

Taking the roll channel as an example, the design process of the linear active disturbance rejection attitude controller is presented.

First, the state space expression of the roll channel is expressed and the linear expansion state observer is established as follows:

$$\left\{ {\begin{array}{*{20}l} {\dot{x}_{1} = x_{2} } \hfill \\ {\dot{x}_{2} = x_{3} } \hfill \\ {\dot{x}_{3} = x_{4} + bu} \hfill \\ {\dot{x}_{4} = w\left( t \right)} \hfill \\ {\phi = x_{1} } \hfill \\ \end{array} } \right.\quad \left\{ {\begin{array}{*{20}l} {e_{1} = z_{1} - y} \hfill \\ {\dot{z}_{1} = z_{2} - \beta_{1} e_{1} } \hfill \\ {\dot{z}_{2} = z_{3} - \beta_{2} e_{1} } \hfill \\ {\dot{z}_{3} = z_{4} - \beta_{3} e_{1} + bu} \hfill \\ {\dot{z}_{4} = - \beta_{4} e_{1} } \hfill \\ \end{array} } \right.$$

where \(x_{3}\) is the extended new state variable.

According to the simple method that use the bandwidth to determine the ESO parameters proposed by Professor GAO in article [9], the characteristic equation of the observer is configured as \(( {\text{s}} + \omega_{0} )^{4}\). Then, \(\beta_{1}\), \(\beta_{2}\), \(\beta_{3}\), \(\beta_{4}\) can be expressed as: \(\beta_{1} = 4\omega_{0}\), \(\beta_{2} = 6\omega_{0}^{2}\), \(\beta_{3} = 6\omega_{0}^{3}\), \(\beta_{4} = \omega_{0}^{4}\).

Where \(\omega_{0}\) is the parameter of linear ESO, it can be determined according to the requirement of system bandwidth or adjusted on-line.

In addition to ESO, the process of tuning state feedback parameters can also be simplified in using bandwidth. Similarly, state feedback parameter is expressed as: \(kp = \omega_{c}^{3}\), \(kd = - 3\omega_{c}^{2}\), \(kdd = - 3\omega_{c}^{{}}\).

Similar to \(\omega_{0}\), \(\omega_{c}\) is another parameter can be adjusted online.

As for as compensation coefficient \(b_{0}\), in general, the closer it near the open loop gain of the system, the better control effect we can get.

After repeated debugging, the LADRC parameters for each channel are determined, which are shown in Table 3

Table 3 Parameters of cascade LADRC

4 Simulation Experiment and Result Analysis

Set the initial values of the three attitude angles and height as 0, and set the input signal as step signal, where 0.4 rad in roll channel, 0.5 rad in pitch channel, 0.3 rad in yaw channel and −5 m in height channel (Since the positive direction of Z axis is downward, the −5 m represents the rise to 5 m). The system output curve as shown in Fig. 5 in the cascade PID controller and LADRC controller.

Fig. 5
figure 5

The performance of cascade PID and LADRC in attitude tracking

It can be seen from the figure that the two control methods can quickly track the attitude angle while lifting the height, and no overshoot, which cascade PID control system reach the target attitude faster, and LADRC system is smoother. Both of them can meet the needs of practical applications.

After the attitude is stable in previous experiment, add the moment disturbance at 3, 4 and 5 s in roll, pitch and yaw channel. The moment disturbance is square wave which amplitude is 1 N m, 0.5 N m and 0.1 N m respectively and width is 0.2 s. The result is shown in Fig. 6.

Fig. 6
figure 6

The performance of cascade PID and LADRC in disturbance rejection

From the results shown in the figure, LAD controller’s disturbance rejection is significantly better than the cascade PID controller. In addition, when dealing with the coupling of each channel of the quad-rotor, the LADRC controller of either channel can treat the control of the other channels as part of the total disturbance and compensate it. Therefore, the LADRC is better than the cascade PID controller in dealing with the coupling of each channel of the quad-rotor.

5 Conclusion

In this paper, two kinds of controllers, cascade PID and LADRC, are designed for the attitude control of the quad-rotor aircraft. And the influence of the quad-rotor’s load change and the external environment on the control effect of the two controllers are discussed through theoretical modeling and simulation. The results show that the LADRC controller is superior to the cascade PID controller in dealing with the coupling and the disturbance rejection. In the future work, we will use the actual quad-rotor aircraft flight experiments to verify the theoretical and simulation results, so as to complete the transition from theory to practice.