Study and Development of Robust Control Systems for Educational Drones

Thispaperconsiderstheproblemofattitudeandaltitudecontrolofquadro-torsusingtheslidingmodecontroltheory.Themathematicalmodelofthequadrotoris derivedusingtheEuler-Newtonformalism.Thesliding-modeisappliedtotheParrot Mambominidrone,whichisastrongexampleofbringingeducationalroboticsto formal(MATLAB,Python,JavaScript),non-formal(Tynker,Blockly,SwiftPlay-ground)andinformaleducation.Thecontrolconsideredshowsgoodperformance andenhancedrobustness.

Blocky; for secondary schools and universities it offers text coding with JavaScript and Python and also compatibility with MATLAB & Simulink [2]. Simulink is the environment used to implement a robust nonlinear control algorithm (sliding mode control), in order to demonstrate the flexibility and the versatility of this novel educational ecosystem: from block coding to state-of-the-art prototyping, implementation and testing of experimental control approaches. This paper considers a mathematical model of the Parrot Mambo, which was used to modify the classical sliding mode control algorithm in order to get enhanced robustness against disturbances.

Quadrotor Mathematical Model
As shown in Fig. 1, the quadrotor contains four motors placed in a cross-configuration (front and rear propeller rotate counterclockwise, while the right and the left ones rotate clockwise) [3]. Each rotor is linked to a propeller. The quadrotor is an underactuated system: in fact, it has 6 DOF (degree of freedom), three Cartesian coordinates (X, Y, Z) and three attitude angles, φ, θ and ψ (roll, pitch and yaw, respectively) but only four rotors/motors. However, it is possible to choose four controls to set the altitude (vertical distance from the ground) and the attitude (angular position) of the drone, that is, Throttle U z : vertical force obtained by increasing or decreasing the speed of the four propellers by the same amount; Roll Uφ: torque with respect to the x axis of the body frame, obtained by increasing or decreasing the speed of either the left or the right propellers; Pitch U θ : torque with respect to the y axis of the body frame, obtained by increasing or decreasing the speed of either the front or the rear propellers; Yaw Uψ: torque with respect to the z axis of the body frame, obtained by increasing (or decreasing) the speed of both the front and the rear propellers, while decreasing (or increasing) both the left and the right propellers. Two coordinate frames are used to describe the motion of the drone: the earth-centered inertial frame and the body-fixed frame. The earth frame O e x e y e z e is used to define the defines the vector of linear velocities μ = [u v w] T expressed in meters per seconds, the vector of angular velocities ω = P Q R T expressed in radians per seconds, the forces F expressed in newton and the torques τ expressed in newton meters. The dynamic model was derived using the Newton-Euler formalism. As seen in [4], the dynamics of the 6 DOF rigid body under the effect of external forces and torques are: In order to develop Eq. (1), the different forces and torques that affect the quadrotor need to be determined. The main forces that affect the system are: • Input forces and torques: directly produced by the four rotors. As a result of rotation, each motor exhibits an aerodynamic moment M i and a lift force F i given by [5]: where C T and C q are the thrust and the torque coefficient respectively, i is the velocity of the i th rotor. As reported in [6], the resultant input torque vector is: The vector of input forces with respect to the body frame is: • Gyroscopic effect: this is produced by rotation of the propeller and it is given as: where J tp is the total rotational moment of inertia around the propeller axis and is the sum ( = − 1 + 2 − 3 + 4 ) of the four propeller speeds expressed in radians per seconds. • Gravitational force: where g is the gravitational acceleration and m the mass of the drone.

Sliding Mode Controller
The sliding mode control technique consists of a high-speed switching control law that forces the state trajectories to follow a manifold called switching surface, and keeps the trajectories on this surface [7]. Sliding mode control design is a two-step procedure: sliding surface synthesis to provide the desired performance, and control design to ensure that all motions slide along the desired surfaces. The sliding mode control (SMC) is composed of equivalent control and corrective control [8]. The former ensures that the trajectories stay on the surface. The latter ensures that the trajectories reach the surface and compensates for any variations around the surface, whether due to external disturbances or to unmodeled dynamics. The sliding control for a given state is: where U eq i is the equivalent control and U C i is the corrective control. As in [9], let the sliding surface be of the form: where S i is the sliding surface for a given state, e i is the error between the actual state and the desired value, and α i is a positive proportional gain. As for most first order systems, the chosen Lyapunov function is: To ensure system stability, the time derivative of the Lyapunov function S i must strictly be negative. To ensure that, we can set [6]: by the corrective control. As is well known, sliding mode control is robust against matched bounded disturbances. However, as proposed in [6], a more realistic assumption on unmodeled dynamics and external disturbances can be represented as: where 0 < vi < 1, 0 ≤ ρi ≤ 1, pi is a positive real number and d0i is a bounded disturbance. With corrective control the surface dynamics take the form [6]: where m i is a positive integer. To respect the condition of a strictly negative derivative of Eq. (10) we can take [6]: and the control algorithm is [6]:

Experimental Results
The performance of the control algorithm deployed on the Parrot Mambo drone are shown below. The reference trajectory is shown in red (dashed line) and the actual trajectory is shown in blue (continuous line). In Fig. 2, the weight of the drone has been modified (its weight has been increased by 16% compared with the nominal mass) and we can see that the control algorithm, with surface dynamics of Eq. (11), cannot compensate for this weight increase, since there is an offset of about 10 cm in altitude (see Fig. 2a). On the other hand, the control algorithm with surface dynamics of Eq. (13), after a transient, is able to reach the desired altitude (see Fig. 2b). In Fig. 3, the yaw angle is shown, and the drone is in an environment with disturbances that are created artificially (wind fan). In Fig. 3a, spikes and an oscillatory behavior are seen for the control algorithm with surface dynamics of Eq. (11). In Fig. 3b, the control algorithm, with surface dynamics of Eq. (13), eliminates the spikes, and the behavior of the drone does not differ more than 0.1 radians with respect to the reference signal.

Conclusions
This paper has proposed a sliding mode control to control the altitude and the attitude of the quadrotor. The derived quadrotor model and the controller have been tested on a real drone, and the results demonstrate the robustness and the effectiveness of the control algorithm. What has been shown so far also demonstrates the flexibility and versatility of this new educational ecosystem: from block programming (via Simulink) to prototyping, to implement and test cutting-edge experimental and research control approaches.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.