Next Article in Journal
Detection of COVID-19 from Deep Breathing Sounds Using Sound Spectrum with Image Augmentation and Deep Learning Techniques
Previous Article in Journal
Global Correlation Enhanced Hand Action Recognition Based on NST-GCN
Previous Article in Special Issue
Robust Nonlinear Tracking Control for Unmanned Aircraft in the Presence of Wake Vortex
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimised Sliding Mode Control of a Hexacopter: Simulation and Experiments

1
School of Engineering and Materials Science, Queen Mary University of London, London E1 4NS, UK
2
Department of Engineering and Mathematics, Sheffield Hallam University, Sheffield S1 1WB, UK
3
School of Electrical Engineering, Universiti Teknologi Malaysia, Skudai 81310, Malaysia
*
Author to whom correspondence should be addressed.
Electronics 2022, 11(16), 2519; https://doi.org/10.3390/electronics11162519
Submission received: 20 June 2022 / Revised: 29 July 2022 / Accepted: 4 August 2022 / Published: 11 August 2022
(This article belongs to the Special Issue Design and Applications of Aerial Robotics)

Abstract

:
Hexacopters are a kind of unmanned aerial vehicle (UAV) with six actuators and six degrees-of-freedom motions. The control of a hexacopter drone is a critical challenge. This paper presents a nonlinear dynamical model for a hexacopter and complete control approaches based on sliding mode control theory. Furthermore, this study proposed an effective control tuning method based on an optimisation algorithm. The controller has been improved by the grey wolf optimisation (GWO) algorithm, an iteration algorithm inspired by the social hierarchy and hunting behaviour of grey wolves. The improvement of the controller has been verified both experimentally and in simulations. The performance of the sub-controller for an attitude angle was tested in a test bench, and the whole flight controller was tested in simulation hexacopters, which are highly manoeuvrable, nonlinear aerial vehicles with six independent rotors and capacity for vertical take-off and landing. This article presents a derivation of the nonlinear dynamical model for a hexacopter, which includes the aerodynamic drag, and inertia counter torques. Flight control based on sliding mode control theory, which generally shows good performance on nonlinear systems, is developed and implemented. Given the need to simultaneously tune controller parameters, two nature inspired optimisation routines (GWO and PSO) are applied and compared for effectiveness in controller tuning. Results indicate that GWO-based tuning produces superior outcomes in terms of controller performance. This is in addition to the fact that PSO parameters require tuning rather than random selection of algorithm parameters. A reduced-order physical prototype is presented for the validation of the tuning routine on the roll/pitch control. The results indicate good agreement between simulation and experimental outcomes, with about 10.4% improvement in the tracking performance of roll DOF when GWO is applied to tune the controller.

1. Introduction

In recent years, multirotor UAVs (commonly known as drones) have become popular and widely used. Compared to traditional helicopters, drones have a simper mechanical structure, which is easier to control [1]. As a result, drones are widely used for aerial filming. They have potential applications in search and rescue operations, environment monitoring, law enforcement, precision agriculture, traffic management, delivery, etc.
The most commonly used drones are quadcopters or quadrotor helicopters. Drones with more rotors, however, have a higher thrust-to-weight ratio and a greater load capacity but generally, higher energy consumption. However, a drone with more rotors, such as a hexacopter, can consume lower energy under certain mass distribution conditions than a quadrotor with the same material and the same motor, as demonstrated in Sun’s research [2]. This study investigates the enhancement of the potential of a hexacopter through the development of an optimised sliding mode control (SMC) model. Although more research has focussed on quadrotors, the core of the flight control structure is similar for both quadrotors and hexacopters.
In order to meet the requirements of remote control and the autonomous flight of a drone, designing a flight controller is a critical task. The study of control usually starts from the PID control theory. The traditional PID control approach can partially meet these requirements. Salih et al. applied the PID control approach for the remote control of a quadcopter. The results show that the controller responds quickly. However, there are obvious oscillations and overshoots [3]. Mustapa et al. applied PID control for the altitude controller of a quadcopter. Altitude control is a relatively simple part of a drone flight controller, which can be addressed by the classic PID approach [4].
Agha [5] and Abidali [6] each studied the PID controller as a baseline controller for solar-powered drones and used other approaches to improve the performance. Bouabdallah’s early work on quadrotor flight control was mainly focused on the backstepping control approach, which was validated in experiments [7]. Bouabdallah also studied the sliding mode control (SMC) approach with Siegwart [7,8,9]. J.A. Ricardo Jr and D.A. Santos studied a smooth second-order SMC for a hexacopter for position and attitude control problems [10]. Moya et al. studied SMC for a drone and confirmed its advantages over PID controllers [11]. In Chiew et al.’s research about altitude and yaw control of a quadcopter, second-order SMC outperformed PD control in all considered performance indicators. [12] Abrougui et al. proposed a robust SMC scheme to stabilise the attitude of a hexacopter during waypoint tracking [13].
Tuning is a critical process of control approaches development; it refers to adjusting the coefficients of the controller to improve performance. Agha, for example, used the Ziegler–Nichols tuning method in the case of PID control, and both Agha and Abidali used fuzzy logic theory to improve the performance of the PID controllers [5,6]. The tuning of SMC has also been studied, for example, Concha et al. developed a tuning algorithm for SMC and applied it into attenuating the structural vibration. [14] Nekoukar and Dehkordi applied fuzzy logic-based theory on a sliding mode controller of a quadcopter, which achieved robust past tracking. [15]
Optimisation algorithms have been widely used in tuning, for example, particle swarm optimisation (PSO) and grey wolf optimisation (GWO). Both approaches involve biomimicry to obtain the optimal solution. They are characterised by the fact that they do not require in-depth knowledge of the system to obtain the optimal solution; just as animals arriving in a new environment can also obtain their prey quickly in some way. So, these approaches have a wide range of applications. Liu et al. applied PSO on SMC for a vector machine [16]; Kumar et al. utilised PSO- and GWO-optimised SMC on frequency regulation. [17] These approaches have also been applied to drones; for example, PSO has previously been used for tuning the PID control of a quadrotor UAV by Noordin et al. [18] and Yin et al. [19]. Qu et al. developed a hybrid GWO algorithm and applied it on the path planning of a drone. [20] However, the study of optimisation-based SMC optimisation for controlling a hexacopter is limited. This study improves the SMC flight controller by using optimisation approaches, such as PSO and GWO.

2. Dynamical Model

Two coordinate systems are needed to describe the translational and rotational movement of a hexacopter. They are the inertial coordinate (OiXiYiZi), based on earth, and the body-fixed coordinate (ObXbYbZb) attached to the centre of mass of the drone. For a hexacopter, Xb-axis is on a strip, Yb-axis is on an angle bisector of two strips, and Zb-axis is defined by the right-hand rule, as demonstrated in Figure 1. The position of the drone is expressed by vector r in inertial coordinate:
r = [   x y z ] T
Moreover, the velocity of the drone is expressed in body-fixed coordinate:
V = [ v x v y v z     ] T
The attitude of the drone is described by Euler angles φ   θ   ψ , which expresses roll, pitch, and yaw angles, respectively. In addition, the transformation between inertial and body-fixed coordinates depends on the attitude angles. The two coordinates are coincident initially, and the drone rotates around the z, y, and x axes, as shown in Figure 2. O1 × 1Y1Z1 and O2X2Y2Z2 are two intermediate coordinates after the first and second rotation; accordingly,   r 1 ˙ = [ x ˙ y ˙ z ˙ ] T and   r 2 ˙ = [ x ˙ y ˙ z ˙ ] T are the intermediate velocity vectors. The mutual orientation of the coordinates is described by the rotation matrix R [21].
R = [ c o s θ   c o s ψ s i n φ   s i n θ   c o s ψ c o s φ   s i n ψ c o s φ   s i n θ   c o s ψ + s i n φ   s i n ψ c o s θ   s i n ψ s i n φ   s i n θ   s i n ψ + c o s φ   c o s ψ c o s φ   s i n θ   s i n ψ s i n φ   c o s ψ s i n θ s i n φ   c o s θ c o s φ   c o s θ ]
The transformation of velocities between the body-fixed and inertial frames is given as:
r ˙ = R V
The same angular velocity is expressed differently in different coordinate systems. The vector ω denotes the angular speed of the drone in body-fixed coordinates where p , q , and r are the angular velocities of hexacopter in the body frame; the vector q is the attitude vector in the earth-fixed frame.
ω = [ p q r   ] T
q = [ φ θ ψ     ] T
The transformation matrix for the angular speed is as follows:
R A = [ 1 0 sin θ 0 cos φ cos θ sin φ 0 sin φ cos θ cos φ ]
The transformation of the angular speed is:
ω = R A q ˙
Equation (9) is the Newton–Euler equation of motion, which describe the equilibrium of forces of a drone in body coordinate:
[ F N ] = [ m I 3 0 0 M ] [ V ˙ ω ˙ ] + [ ω × m V ω × M ω ]
where F is the force vector and N is the torque vector, I3 is a 3 × 3 identity matrix, and M is the inertia matrix:
M = [ J x 0 0 0 J y 0 0 0 J z ]  
The force is determined by the gravity of the drone and the thrust generated by the rotors, the aerodynamic resistance. The equation of force with transformation can be expressed as Equation (11):
F = [ 0 0 T ] + R 1 [ 0 0 m g ] + R 1 [ D x D y D z + L ]
where m is the mass of the drone, g is gravitational acceleration, and T is the total thrust generated by the propellers.
T = b ( Ω 1 2 + Ω 2 2 + Ω 3 2 + Ω 4 2 + Ω 5 2 + Ω 6 2 )
In Equation (12), b is the thrust coefficient, and Ω 1 to Ω 6 are the angular speeds of the corresponding propellers.
The aerodynamic resistance of the drone cannot be ignored. The direction of the drag is opposite to the direction of the movement, D x , D y , and D z   are the aerodynamic resistances or drags in x, y, and z direction. [22,23]
In Equation (13), ρ is the air density; C D x , C D y     a n d   C D z are the drag coefficients, which are dimensionless numbers, depending on the angle of attack (AOA).   C L x ,   C L y are dimensionless lift coefficients dependent on the AOA; A is the area of the drone in contact with the air when flying vertically upwards.
{ D x = 1 2 ρ A C D x x ˙ | x ˙ | D y = 1 2 ρ A C D y y ˙ | y ˙ | D z = 1 2 ρ A C D z z ˙ | z ˙ | L = 1 2 ρ A ( C L x x ˙ 2 + C L y y ˙ 2 )
The torque vector N :
N = [ N x N y N z ] T = τ T + τ P G y r o + τ c o u n t e r + τ d r a g
where τ T is the torque produced by the propellers; τ P G y r o is the propeller gyroscopic torque, τ c o u n t e r is the inertial counter-torque; τ d r a g is the torque due to the aerodynamic drag.
For a hexacopter, the torque produced by the propeller is [24,25]:
{ τ T x = 3 2 b l ( Ω 5 2 + Ω 6 2 Ω 2 2 Ω 3 2 ) τ T y = b l ( Ω 1 2 1 2 Ω 2 2 + 1 2 Ω 3 2 + Ω 4 2 + 1 2 Ω 5 2 1 2 Ω 6 2 ) τ D z = d ( Ω 1 2 + Ω 3 2 + Ω 5 2 Ω 2 2 Ω 4 2 Ω 6 2 )  
where b is the thrust factor, d is the drag torque constant, and l   is the arm length; τ T x and τ T y are the torque due to thrust about x-axis on body-fixed frame; τ D z is the torque about the z-axis, which is dominated by the torque from the drag of the blade.
The propeller gyroscopic effect results from a change of angular momentum of propellers due to the rotation of the hexacopter. It is given by the cross-product of the angular velocity of the hexacopter and the angular momentum of a propeller. The expression is:
τ P G y r o = [ J r q ( Ω 1 Ω 2 + Ω 3 Ω 4 + Ω 5 Ω 6 ) J r p ( Ω 1 Ω 2 + Ω 3 Ω 4 + Ω 5 Ω 6 ) 0 ]
where J r is the moment of inertia of the rotor (a propeller and a motor).
The inertial counter-torque is the torque required to balance the torque of rotors. The torque is given by the product of the rotor moment of inertia and angular acceleration. Applying the rotation form of Newton’s third law; the counter torques are numerically equal to the rotors torques but in opposite directions. The counter-torque only appears on the z-axis (of the body-fixed frame):
τ c o u n t e r = [ 0 0 J r ( α 1 α 2 + α 3 α 4 + α 5 α 6 ) ]
where α 1 to α 6 are the angular accelerations of the corresponding propellers.
The drone is also affected by aerodynamics during its rotation. The expression of the torque caused by aerodynamics is:
τ d r a g = [ C T x p | p | C T y q | q | C T z r | r | ]
C T x ,   C T y , and C T z   are the drag torque coefficients.
According to Newton–Euler Equation, the acceleration and angular acceleration of the drone in body-fixed coordinate can be calculated with the following equation:
{ V ˙ = 1 m F ω × V ω ˙ = M 1 N ω × ω
The drone’s velocity can be calculated by integrating the acceleration and then transforming the velocity to inertial coordinate by Equations (3) and (4). Likewise, the position can be calculated by integrating the velocity. Similarly, the attitude angle can be calculated by two integrations and one transformation.

3. Control of Hexacopter

The objective of the control is to make the drone fly autonomously following a desired trajectory. The desired trajectory includes the desired position (x, y, z) and the desired yaw angle. The pitch and roll angles are supposed to be small, but they control the position. A state vector is defined [11]:
x = [ x 1   x 2   x 3   x 4   x 5   x 6   x 7   x 8   x 9   x 10   x 11   x 12 ] T = [ φ   φ ˙   θ   θ ˙   ψ   ψ ˙   z   z ˙   x   x ˙   y   y ˙ ] T
The 12-state variables are the position in the inertial axis, attitude angles, and their time derivatives (or speed). The 12 state variables correspond to six degrees of freedom. The flight controller can be divided into six sub-controllers, corresponding to the state variables or degrees of freedom. The rotation sub-controllers are roll sub-controller, pitch sub-controller, and yaw sub-controller; the position sub-controllers are z (altitude) sub-controller, x sub-controller, and y sub-controller.
The state of the drone is determined by the thrust and torque provided by the rotors, the control vector of the hexacopter is defined as:
U = [ U 1   U 2   U 3   U 4   ] T = [ T   N x   N y   N z ] T
After simplification, the dynamical model for the flight controller, the time derivative of the state vector is:
x ˙ = f ( x , U ) = ( x 2 a 1 x 4 x 6 + b 1 U 2 + b 1 c 1 x 2 | x 2 | x 4 a 2 x 2 x 6 + b 2 U 3 + b 2 c 2 x 4 | x 4 | x 6 a 3 x 2 x 4 + b 3 U 4 + b 3 c 3 x 6 | x 6 | x 8 1 m cos x 3 cos x 1 U 1 g + 1 m c 4 x 8 | x 8 | + 1 m ( c 5 x 10 2 + c 6 x 12 2 ) x 10 1 m u x U 1 + 1 m c 7 x 10 | x 10 | x 12 1 m u y U 1 + 1 m c 8 x 12 | x 12 | )
With
c 1 = C T x   c 2 = C T y   c 3 = C T z   a 1 = ( J y J z ) / J x b 1 = 1 J x c 4 = ρ A C D z 2 a 2 = ( J z J x ) / J y b 2 = 1 J y c 5 = ρ C L x A 2 a 3 = ( J x J y ) / J z b 3 = 1 J z c 6 = ρ C L y A 2 c 7 = ρ A C D x 2 c 8 = ρ A C D y 2 u x = cos x 5 sin x 3 cos x 1 + sin x 5 sin x 1   u y = sin x 5 sin x 3 cos x 1 cos x 5 sin x 1  
The propeller gyro effect and inertial counter-torque are neglected in this equation. U 2 is the control variable of roll sub-controller; U 3 is for pitch sub-controller; U 4 is for yaw sub-controller. u x and u y are an expansion of the control variables and are determined by the attitude angles and U 1 . They are the control variables of x and y sub-controllers. In addition, conversely, the commanded pitch and roll angle (x1c, x3c in the form of state variables) can be calculated by the control variables u x and u y . When the pitch and roll angles are small,
  x 1 c = u x sin x 5 u y cos x 5 x 3 c = u x cos x 5 + u y sin x 5
The flight control scheme for a hexacopter is indicated in Figure 3. The input variables are the desired position and yaw angle. First, input the desired position to the position sub-controllers to get the commanded control variable U 1 and commanded pitch and roll angles. Then, input the desired yaw angle and commanded pitch and roll angles to the rotation sub-controllers to get the control variables U 2 , U 3 , and U 4 . The control variables are inputted into the system. The system estimates the actual position and attitude and then feeds back to the sub-controllers.
The control strategy applied in the position and rotation sub-controllers is the sliding mode control approach. It is an iterative method based on Lyapunov stability theory. A sliding surface is designed to drive the state space, and the controller makes the state space reach the sliding surface. When the sliding surface is reached, the controller keeps the state on the neighbourhood of the sliding surface [26]. For a second-order system, such as the roll sub-controller:
{ x 1 ˙ = x 2 x 2 ˙ = f ( x 1 , x 2 ) + h ( x 1 , x 2 ) U 2    
Define the setpoint x1d and the error z 1 :
z 1 = x 1 d x 1
The sliding surface is defined as follows:
s 1 ( t ) = { ( x 1 , x 2 ) | s 1 ( x 1 , x 2 , t ) = 0 }
With s 1 ( x 1 , x 2 , t ) defined by
s 1 ( x 1 , x 2 , t ) = ( d d t + m 1 ) z 1 ( t ) ,   m 1 > 0
where m 1 is a positive constant.
s 1 = x 1 d ˙ x 2 + m 1 z 1
To make the state approach, the sliding mode is equivalent with stabilising s to zero, a positive definite Lyapunov candidate function for s is defined as:
V ( s 1 ) = 1 2 s 1 2
Differentiating:
s 1 ˙ = x 1 d ¨ ( f ( x 1 , x 2 ) + h ( x 1 , x 2 ) U 2 ) + m 1 ( s 1 m 1 z 1 )  
Define
  U 2 * = 1 h ( x 1 , x 2 ) ( x 1 d ¨ + m 1 ( s 1 m 1 z 1 ) f ( x 1 , x 2 ) )  
Then, if U 2 = U 2 * , s 1 ˙ = 0 for all time. Following the exponential reaching law:
                                        s 1 ˙ = n 1 s g n ( s 1 ) n 2 s 1 , w i t h   U 2 = U 2 * + 1 h ( x 1 , x 2 ) ( n 1 s g n ( s 1 ) + n 2 s 1 )
    V ˙ ( s 1 ) = s 1 s 1 ˙ = n 1 | s 1 | n 2 s 1 2
where n 1 and n 2 are positive constants, the three coefficients of one sliding mode controller. In addition, V ˙ ( s ) is a negative definite function. Apply this control approach to a hexacopter with Equation (22), following the exponential law, the rotation sub-controllers:
{ U 2 = 1 b 1 ( x 1 d ¨ + m 1 ( s 1 m 1 z 1 ) a 1 x 4 x 6 c 1 x 2 | x 2 | + n 1 s g n ( s 1 ) + n 2 s 1 ) U 3 = 1 b 2 ( x 3 d ¨ + m 2 ( s 2 m 2 z 3 ) a 2 x 3 x 6 c 2 x 4 | x 4 | + n 3 s g n ( s 2 ) + n 4 s 2 ) U 4 = 1 b 3 ( x 5 d ¨ + m 3 ( s 3 m 3 z 5 ) a 3 x 2 x 4 c 3 x 6 | x 6 | + n 5 s g n ( s 3 ) + n 6 s 3 )
With
{ s 1 = x 1 d ˙ x 2 + m 1 z 1 s 2 = x 3 d ˙ x 4 + m 2 z 3 s 3 = x 5 d ˙ x 6 + m 3 z 5
And the position sub-controllers:
{ U 1 = m cos ( x 1 ) cos ( x 3 ) ( x 7 d ¨ + g + m 4 ( s 4 m 4 z 7 ) n 7 s g n ( s 4 ) + n 8 s 4 1 m c 4 x 8 | x 8 | c 5 m x 10 2 c 5 m x 12 2 ) u x = m U 1 ( x 9 d ¨ m 5 ( s 5 m 5 z 9 ) n 9 s g n ( s 5 ) + n 10 s 5 1 m c 7 x 10 | x 10 | ) u x = m U 1 ( x 11 d ¨ m 6 ( s 6 m 6 z 11 ) n 11 s g n ( s 6 ) + n 12 s 6 1 m c 7 x 12 | x 12 | )
With
  { s 4 = x 7 d ˙ x 8 + m 4 z 7 s 5 = x 9 d ˙ x 10 + m 5 z 9 s 6 = x 11 d ˙ x 12 + m 6 z 11  
z 1 to z 11 are the difference between the desired value and real value or error. m 1 to m 6 and n 1 to n 12 are the control coefficients. In the sliding mode flight controller of the drone, each sub-controller has three coefficients; there are 6 sub-controllers with 18 coefficients. These coefficients have been tuned based on previous experience, the requirements for an autonomous flight can be achieved in this way. However, further improvements can be made by means of optimisation.

4. Optimisation

PSO and GWO have been used to optimise the controllers by tuning the coefficients in this study. Both of these optimisation approaches are derived from biomimicry. PSO is inspired by the social behaviour and dynamical movements with the communication applicable in insects, birds, and fish; GWO is inspired by grey wolves’ social hierarchy and hunting process.
In PSO, all particles are in search of an optimal position. This position is unknown, but it is possible to compare which particle is in a better position. Each particle decides where to move next based on the best position it has experienced and the best position of all the particles [18].
{ W ( t i + 1 ) = w 0 W ( t i ) + w 1 r 1 ( P ( t i ) X ( t i ) ) + w 2 r 2 ( G ( t i ) X ( t i ) ) X ( t i + 1 ) = X ( t i ) + W ( t i + 1 )  
Equation (39) expresses the direction and position of a particle in the next iteration. t i is the iteration number, W is the direction, and X is the position. P is the best position reached by the particle, and G is the best position reached by the swarm. r 1 and r 2 are random numbers between 0 and 1; w   0 ,   w 1 , and w 2 are positive constants as the coefficients. w 0 is usually equal to 1 and w 1 + w 2 = 4 .
In GWO, four groups are defined in the algorithm to simulate the social hierarchy of grey wolves [27]:
  • Alpha (α)—the leaders, called alpha, are responsible for decision-making, such as hunting, sleeping place, time to wake, etc.
  • Beta (β)—this is the second level. They are the subordinate wolves, and they help the alpha wolves with decision making.
  • Delta (δ)—like beta wolves, they must submit to alpha and beta wolves but dominate the other wolves.
  • Omega (ω)—the followers.
During the hunting process, the exact location of the prey is unknown. Therefore, the alpha, beta, and delta wolves have more experience and knowledge about hunting to estimate the prey’s position more accurately. The hunting is guided by alpha, beta, and delta; the omega wolves are followers.
The following equations represent the mathematical model of the hunting behaviour:
{ D α = | C 1 X α ( t i ) X ( t i ) | D β = | C 2 X β ( t i ) X ( t i ) | D δ = | C 3 X δ ( t i ) X ( t i ) |
In Equation (40), t i is the current iteration. Thus, Xα, Xβ, and Xδ are the three best positions or the positions of alpha, beta, and delta wolves. X is the position of any wolf in the group; C1, C2, and C3 are random numbers.
{ X 1 = X α A 1 D α X 2 = X β A 2 D β X 3 = X δ A 3 D δ X ( t i + 1 ) = X 1 + X 2 + X 3 3
In Equation (41), A 1 , A 2 , and A 3 are adaptive numbers; these two equations define how the wolf moves with the guide of the leaders. The random numbers and adaptive numbers are defined with
{ C 1 , 2 , 3 = 2 r 1 A 1 , 2 , 3 = 2 a r 2 a a = 2 2 ( t i / m a x )  
where r 1 and r 2 are random numbers between 0 and 1, max is the number of iterations. The process of the GWO algorithm is indicated in Figure 4. The three groups of wolves with the highest fitness are alpha, beta, and delta wolves. The position and identity of the wolves are updated in each loop. The system then proceeds to the next iteration (Iter = Iter + 1) until the maximum number of iterations is reached (Iter == max).
At first, the roll sub-controller was used to test the performance of the optimisation algorithms. The 30 degrees step response tested the sets of coefficients of the roll sub-controller. The optimal coefficients are unknown during the optimisation of a sliding mode controller. A total of 10 sets of coefficients are generated randomly, such as ten particles or wolves. The integral of time multiplied absolute error (ITAE, Equation (43)) measured in simulation has been taken as the objective function.
  ITAE = 0 t | e ( t ) | d t  
where e ( t ) represents the error at a certain operation time.
ITEA reflects the accumulated error in the control as an indicator to judge the performance of a controller. So, three coefficients refer to the position of a particle or a group of wolves. The smaller the ITAE, the better the position. Initially, the coefficients m 1 , n 1 , and n 2 are 20, 4, and 4, respectively, these coefficients are based on some previous experiences and manual tunings. The step time of the input signal is at 2 s, and the final value is 30 degrees. The original ITAE is 8.616. The roll sub-controller has been optimised four times with the number of iterations 3, 5, 10, and 15 with the two optimisation approaches. With the increase in iterations, the ITAE reduced significantly. The detail of the comparisons is in Table 1 for PSO and Table 2 for GWO.
As can be seen from Table 1 and Table 2, the effectiveness of the two optimisation algorithms can be compared by comparing ITAE. GWO outperformed PSO by 6.6% and 7.2% in three and five iterations, respectively, in terms of optimisation; in 10 and 15 iterations, the advantage reduced to 4.7% and 3.5%. After more than ten iterations, the sub-controllers improved by both optimisation algorithms and were close to optimal. However, the performance of GWO is always slightly better than PSO. The coefficients were set to w 1 = 2   and w 2 = 2 . Other coefficients have been tried but with no better performance. The purpose of using these optimisation methods is to tune the controller. Still, the PSO itself also has coefficients that need to be adjusted. This includes its three coefficients and the initial direction of motion, which all impact the optimisation results. Whereas all the coefficients of the GWO are random numbers or can vary linearly depending on the number of iterations. The GWO shows better performance; therefore, the overall flight controller is optimised using GWO.
In Table 3, the rise time, the peak time, the overshoot, and the settling time of each optimised roll sub-controller have been compared. All these four response parameters have improved after optimisation. The performances of the sub-controllers optimised over 10 and 15 iterations are very similar; there was only a 0.3% difference in the ITAE. The sub-controller with 15 iterations should be selected if only numerical results are considered. However, from Figure 5, in the performance of the sub-controllers with 10 and 15 iterations, when the simulated value exceeds the target value, there was some oscillation before reaching the peak. This oscillation occurs when the sub-controller has undergone more than five iterations of optimisation. When all rotation sub-controllers work in tandem, these oscillations can introduce further instability into the flight of the drone. So finally, the roll sub-controller, optimised through five iterations, was selected for further design. With the optimisation of five iterations, the rise time was reduced by 52.9%; the peak time was reduced by 45.2%, the overshot reduced by 1.9%, and the ITEA reduced by 59.7%. With the exception of the overshot, the improvement in all other aspects is remarkable.
The other sub-controllers have also been optimised by GWO with a similar process. The roll and pitch motions of the drone are very similar, so the pitch sub-controller used the same coefficients as the roll controller. These two sub-controllers were optimised first because they are essential for stable flight and are used to control the translational movement of the drone.
The yaw sub-controller has been optimised secondly. The control of the yaw angle is relatively less important than the other two attitude angles. Thus, when optimising the yaw sub-controller, it is also important to consider its influence on the other two attitude angles. The method used is to simultaneously give a 30 degrees step response command to all three attitude angles. To minimise the sum of the three angles ITAE is used as the optimisation target.
Then, the altitude sub-controller has been optimised. A 2 m step response was given to the system. The optimisation target is to minimise the ITAE of the motion in z-direction. The x and y sub-controllers have been optimised last as the thrust and attitude angles determine the translational motion. They need to be optimised based on the optimised rotation sub-controllers and the altitude sub-controller. The process is the same with the altitude sub-controller. Due to the similarity of the two translational movements, the two sub-controllers use the same coefficients. The original and optimal coefficients are shown in Table 4.
The optimisation effect of the roll angle sub-controller has been certified in a test bench. In addition, the entire flight controller has been verified in simulation with a designed trajectory.

5. Test Bench

A preliminary test bench was carried out to test the flight controller. This test bench is a two-motor system, motors are fixed to the ends of a carbon fibre board, and an axis is fixed in the middle with a bearing, as shown in Figure 6. The system has one degree-of-freedom motion, the roll angle. The test bench helps lock some degrees of freedom to avoid system damage and reduce control complexity [6]. This test bench is equivalent to the roll motion of the drone; it was used to test the roll sub-controller. Using the following equation:
I t e s t θ t ¨ = b l t ( Ω 1 2 Ω 2 2 )
Where θ t is the angle between the system and horizontal plane, it can be measured by an IMU, l t is the distance between propeller and axis, which is easy to measure, Ω 1 and Ω 2 are the speeds of the two propellers. I t e s t   is the moment of inertia of this testing device. In this experiment, the moment of inertia of the system is measured by the oscillation of a bifilar suspension (Figure 7).
I t e s t = m t g t b 2 d l 2 16 π 2 L  
The moment of inertia I t e s t can be calculated using Equation (45). m t   is the mass of the system, g is the acceleration due to gravity. L is the rope length; d l is the distance between the wires; and t b  is the period of the swing, which a stopwatch can measure. This test bench was applied to test the different controllers in the roll angle step response; the control algorithm was translated to codes and implemented to a microcontroller (Arduino Uno).

6. Results

The optimised roll sub-controller was verified in the test bench, as shown in Figure 8 and Table 5. In quantitative analysis, the integration of absolute error (IAE, Equation (46)) is also used in the analysis. This indicator does not take time into account. IAE is more valuable in trajectory tracing. In Table 4, the IAE and ITAE in the simulation, as well as in the experiment are compared; E-ITAE and E-IAE refer to the ITAE and IAE in the experiment. In this step response, the step time is 0, so the ITAE is smaller than the simulation in the optimisation process. In the simulation, the IAE and ITAE were reduced by 39.13 and 58.33, respectively, while in the experiment, the E-IAE and E-ITAE were reduced by 19.35 and 10.39, respectively. The situation is caused by the vibration in the results given by the sensor, nevertheless, the effect of the optimisation is remarkable. Moreover, due to the results’ vibration, in Figure 8, it is difficult to visualise the difference between the original system and the optimised system.
  IAE = 0 | e ( t ) | d t  
The whole optimised flight controller has been implemented in Simulink for simulation with the mathematical model. First, the inputs of the controller have to be confirmed. During the control of the autonomous flight, the system’s inputs are the desired position (x, y, z) and yaw angle ( ψ ). The outputs of the flight controller are the commanded speeds of the motors; the commanded speeds are inputted into the dynamical model for simulation.
A trajectory was designed to test the flight controller to face extreme conditions. In the test trajectory, the drone rises 2 metres in the first second and then starts moving along a circular trajectory, and simultaneously the drone should rotate 360 degrees; the simulation time is 20 s. All the six degrees of freedom motion are involved in this trajectory. The equation of trajectory is as follows:
x d ( t ) = x 9 d ( t ) = {                         0 ,         0 t < π 2 s i n ( t ) ,         π t < 3 π                 0 ,             t 3 π y d ( t ) = x 11 d ( t ) = {                             0 ,               0 t < π 2 cos ( t ) + 2 ,               π t < 3 π                       0 ,             t 3 π z d ( t ) = x 7 d ( t ) = { 2 t ,                                     0 t < 2 2 ,                           t 2 ψ d ( t ) = x 5 d ( t ) = π 10 t
The trajectory is shown graphically in Figure 9. The designed trajectory was used to test both the original and optimised flight controller, and the results are presented in Figure 10 and Figure 11.
From 0 to 2 s, the drone started to rotate and rise; there was no translational movement or roll and pitch. From the π th second, the drone was required to move towards both x and y directions, so the commanded roll and pitch angle appeared. The commanded roll and pitch angle is limited to +/− 30 degrees in both original and optimised controllers to maintain a stable flight. The two figures clearly show that the drone with the optimised controller follows the designed trajectory more closely. This result does not only come from intuition but is confirmed numerically.
Quantitative analysis is more convincing. In Table 6, both ITAE and IAE in six degrees of freedom motion have been compared. ITAE is a kind of time-weighted measurement. Applying ITAE on step response is necessary, since it is important to consider a steady-state error. However, for this trajectory, some significant errors appear in the late stage due to the complexity of the desired value; it is not reasonable to compare ITAE in this case. So, the measurement without time weighted or IAE has been compared too. However, all the error measurements of the drone with optimised sub-controllers are smaller.
Table 6 also gives the percentage of the improvement. The most improved is the yaw sub-controller with 73.2% error reduction. The performance of the x and y sub-controllers has also improved by close to or more than 50%. Relatively small improvements were made to the altitude controller. Mainly the coefficients of the original z sub-controller are closer to optimal compared to the other sub-controllers. The above four sub-controllers, which receive direct commands regarding the desired trajectory, have all been significantly optimised. The roll and pitch controllers receive instructions from the position sub-controllers. When the position sub-controllers are optimised, the angle commands are given more aggressively to achieve a fast response. This poses a greater challenge to the roll and pitch sub-controllers. Despite this, the cumulative control error of the roll and pitch sub-controllers for the same trajectory is reduced by 15.6% and 22.4%. This is a further indication of the success of the optimisation.

7. Conclusions

The nonlinear dynamical model of a hexacopter drone has been simulated, and a flight controller based on sliding mode control theory has been developed and applied to the drone. The drone can fly autonomously following a desired trajectory. GWO was chosen to optimise the entire SMC flight controller on the basis of a comparative performance study of PSO and GWO on a sub-controller. The optimised sub-controller has improved in rise time, peak time, overshot, settle time, and ITAE. In theory, optimisation for a single angle sub-controller could result in a 58.3% reduction in ITAE. However, due to equipment limitations, only a 10.4% improvement was measured in the experiment. The entire flight controller has also been optimised. For the same trajectory tracking, the optimised controller shows a significant reduction in the IAE in each degree of freedom compared to the original controller. The optimisation is most evident in the yaw angle, where the cumulative error is reduced by 73.2%. In practice, these optimisations enable the drone to get to the desired location faster and more accurately and could make surveillance or information collection via cameras more accurate.

Author Contributions

Conceptualisation, C.S. and M.H.S.; methodology, C.S. and M.H.S.; software, C.S.; validation, C.S.; formal analysis, C.S.; investigation, C.S.; resources, C.S. and M.H.S.; data curation, C.S. and S.A.A.; writing—original draft preparation, C.S. and S.A.A.; writing—review and editing, M.H.S., Z.M. and S.A.A.; visualization, C.S; supervision, M.H.S. and Z.M. project administration, C.S. and M.H.S.; funding acquisition, C.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The study did not report any data.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Manarvi, I.A.; Aqib, M.; Ajmal, M.; Usman, M.; Khurshid, S.; Sikandar, U. Design and development of a quad copter (UMAASK) using CAD/CAM/CAE. In Proceedings of the 2013 IEEE Aerospace Conference, Big Sky, MT, USA, 2–9 March 2013; pp. 1–10. [Google Scholar] [CrossRef]
  2. Sun, C. Design, Modelling and Control of a Solar-powered Rotary Aerial Vehicle. Ph.D. Thesis, Queen Mary University of London, London, UK, 2021. [Google Scholar]
  3. Salih, A.L.; Moghavemmi, M.; Mohamed, H.A.F.; Gaeid, K.S. Modelling and PID Controller Design for a Quadrotor Unmanned Air Vehicle. In Proceedings of the IEEE International Conference on Automation, Quality and Testing, Robotics (AQTR), Cluj-Napoca, Romania, 28–30 May 2010; pp. 1–5. [Google Scholar]
  4. Mustapa, Z.; Saat, S.; Husin, S.H.; Abas, N. Altitude controller design for multi-copter UAV. In Proceedings of the 2014 International Conference on Computer, Communications, and Control Technology (I4CT), Langkawi, Malaysia, 2–4 September 2014; pp. 382–387. [Google Scholar] [CrossRef]
  5. Agha, S.A. A Systematic Approach to Design and Control of a Solar-Powered Multi-Rotor Unmanned Aerial Vehicle. Ph.D. Thesis, Queen Mary University of London, London, UK, 2019. [Google Scholar]
  6. Abidali, A. Design, Fabrication, and Control of a Solar-Powered Multi-Rotor Micro Aerial Vehicle. Ph.D. Thesis, Queen Mary University of London, London, UK, 2018. [Google Scholar]
  7. Bouabdallah, S. Design and Control of Quadrotors with Application to Autonomous Flying. Ph.D. Thesis, École Polytechnique Fédéral de Lausanne, Lausanne, Switzerland, 2007. [Google Scholar]
  8. Bouabdallah, S.; Siegwart, R. Backstepping and sliding-mode techniques applied to an indoor micro quadrotor. In Proceedings of the International Conference on Robotics and Automation, Barcelona, Spain, 18–22 April 2005; pp. 2247–2252. [Google Scholar] [CrossRef]
  9. Bouabdallah, S.; Siegwart, R. Full control of a quadrotor. In Proceedings of the 2007 IEEE/RSJ International Conference on Intelligent Robots and Systems, San Diego, CA, USA, 29 October–2 November 2007; pp. 153–158. [Google Scholar] [CrossRef]
  10. Ricardo, J.A., Jr.; Santos, D.A. Smooth second-order sliding mode control for fully actuated multirotor aerial vehicles. ISA Trans. 2022, 1–10. [Google Scholar] [CrossRef] [PubMed]
  11. Moya, V.; Espinosa, V.; Chavez, D.; Leica, P.; Camacho, O. Trajectory tracking for quadcopter’s formation with two control strategies. In Proceedings of the 2016 IEEE Ecuador Technical Chapters Meeting (ETCM), Guayaquil, Ecuador, 12–14 October 2016; pp. 1–6. [Google Scholar] [CrossRef]
  12. Chiew, T.H.; Lee, H.-E.; Lee, Y.K.; Chang, K.M.; Ong, J.J.; Eu, K.S. Second Order Sliding Mode Controller for Altitude and Yaw Control of Quadcopter. In Proceedings of the 2021 11th IEEE International Conference on Control System, Computing and Engineering (ICCSCE), Penang, Malaysia, 27–28 August 2021; pp. 97–102. [Google Scholar] [CrossRef]
  13. Abrougui, H.; Nejim, S.; Charrada, A.; Dallagi, H. Sliding Mode Control for Hexacopter Autopilot design. In Proceedings of the 2022 5th International Conference on Advanced Systems and Emergent Technologies (IC_ASET), Hammamet, Tunisia, 22–25 March 2022; pp. 445–449. [Google Scholar] [CrossRef]
  14. Concha, A.; Thenozhi, S.; Betancourt, R.J.; Gadi, S. A tuning algorithm for a sliding mode controller of buildings with ATMD. Mech. Syst. Signal Process. 2021, 154, 107539. [Google Scholar] [CrossRef]
  15. Nekoukar, V.; Dehkordi, N.M. Robust path tracking of a quadrotor using adaptive fuzzy terminal sliding mode control. Control Eng. Pr. 2021, 110, 104763. [Google Scholar] [CrossRef]
  16. Liu, M.; Chen, Z.; Sun, Z. Sliding mode control based on particle swarm optimization and support vector machine. In Proceedings of the 2011 9th World Congress on Intelligent Control and Automation, Taipei, Taiwan, 21–25 June 2011; pp. 260–264. [Google Scholar] [CrossRef]
  17. Kumar, A.; Anwar, N.; Kumar, S. Sliding mode controller design for frequency regulation in an interconnected power system. Prot. Control Mod. Power Syst. 2021, 6, 6. [Google Scholar] [CrossRef]
  18. Noordin, A.; Basri, M.A.M.; Mohamed, Z.; Abidin, A.F.Z. Modelling and PSO Fine-tuned PID Control of Quadrotor UAV. Int. J. Adv. Sci. Eng. Inf. Technol. 2017, 7, 1367. [Google Scholar] [CrossRef]
  19. Haitao, Y.; Yan, L. Research on Attitude Control for UAV Based on Improved PSO Algorithm. In Proceedings of the 2021 6th International Conference on Robotics and Automation Engineering (ICRAE), Guangzhou, China, 19–22 November 2021; pp. 46–49. [Google Scholar] [CrossRef]
  20. Qu, C.; Gai, W.; Zhang, J.; Zhong, M. A novel hybrid grey wolf optimizer algorithm for unmanned aerial vehicle (UAV) path planning. Knowl.-Based Syst. 2020, 194, 105530. [Google Scholar] [CrossRef]
  21. Patel, K.; Barve, J. Modeling, simulation and control study for the quad-copter UAV. In Proceedings of the 2014 9th International Conference on Industrial and Information Systems (ICIIS), Gwalior, India, 15–17 December 2014; pp. 1–6. [Google Scholar] [CrossRef]
  22. Dong, W.; Gu, G.; Zhu, X.; Ding, H. Modeling and Control of a Quadrotor UAV with Aerodynamic Concepts; World Academy of Science: Shanghai, China, 2013. [Google Scholar]
  23. Ye, J.; Wang, J.; Song, T.; Wu, Z.; Tang, P. Nonlinear Modeling the Quadcopter Considering the Aerodynamic Interaction. IEEE Access 2021, 9, 134716–134732. [Google Scholar] [CrossRef]
  24. Baranek, R.; Solc, F. Modelling and control of a hexa-copter. In Proceedings of the 13th International Carpathian Control Conference (ICCC), High Tatras, Slovakia, 28–31 May 2012; pp. 19–23. [Google Scholar] [CrossRef]
  25. Alaimo, A.; Artale, V.; Milazzo, C.; Ricciardello, A.; Trefiletti, L. Mathematical modeling and control of a hexacopter. In Proceedings of the 2013 International Conference on Unmanned Aircraft Systems (ICUAS), Atlanta, GA, USA, 28–31 May 2013; pp. 1043–1050. [Google Scholar] [CrossRef]
  26. Garcia-Gabin, W.; Dorado, F.; Bordons, C. Real-time implementation of a sliding mode controller for air supply on a PEM fuel cell. J. Process Control 2010, 20, 325–336. [Google Scholar] [CrossRef]
  27. Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey Wolf Optimizer. Advances in Engineering Software. 2014, 69, 46–61. [Google Scholar] [CrossRef]
Figure 1. Kinematic scheme of a hexacopter.
Figure 1. Kinematic scheme of a hexacopter.
Electronics 11 02519 g001
Figure 2. Rotation of hexacopter.
Figure 2. Rotation of hexacopter.
Electronics 11 02519 g002
Figure 3. Control scheme.
Figure 3. Control scheme.
Electronics 11 02519 g003
Figure 4. GWO Algorithm.
Figure 4. GWO Algorithm.
Electronics 11 02519 g004
Figure 5. Comparison of the roll sub-controllers optimised by GWO in simulation.
Figure 5. Comparison of the roll sub-controllers optimised by GWO in simulation.
Electronics 11 02519 g005
Figure 6. Two motors test bench.
Figure 6. Two motors test bench.
Electronics 11 02519 g006
Figure 7. Oscillation of a bifilar Suspension ((a): Schematic; (b): Physical).
Figure 7. Oscillation of a bifilar Suspension ((a): Schematic; (b): Physical).
Electronics 11 02519 g007
Figure 8. Comparison between original and GWO improved roll sub-controller in the experiment.
Figure 8. Comparison between original and GWO improved roll sub-controller in the experiment.
Electronics 11 02519 g008
Figure 9. Test trajectory in the 3D coordinate system.
Figure 9. Test trajectory in the 3D coordinate system.
Electronics 11 02519 g009
Figure 10. Control performance in the desired trajectory.
Figure 10. Control performance in the desired trajectory.
Electronics 11 02519 g010
Figure 11. Control performance in roll and pitch.
Figure 11. Control performance in roll and pitch.
Electronics 11 02519 g011
Table 1. PSO controller performance in term of ITAE.
Table 1. PSO controller performance in term of ITAE.
PSO Iterationsm1n1n2ITAE (rad s2)
020.04.004.008.616
317.967.3422.716.056
519.6613.2624.595.540
1035.7711.0436.914.153
1537.9110.6138.03 4.097
Table 2. GWO controller performance in term of ITAE.
Table 2. GWO controller performance in term of ITAE.
GWO Iterationsm1n1n2ITAE (rad s2)
020.04.004.008.616
318.848.2426.825.654
520.389.8533.145.141
1039.3515.8046.313.956
1539.4915.8546.473.955
Table 3. Controller performance in terms of rise time, overshoot, and settling time.
Table 3. Controller performance in terms of rise time, overshoot, and settling time.
GWO IterationsRise(s)Peak (s)Overshot (%)Settle (s)
00.0870.25921.21.014
30.0510.15424.60.499
50.0410.14220.80.469
100.0260.12019.00.389
150.0260.12019.00.389
Table 4. The original and optimised coefficients of other sub-controllers.
Table 4. The original and optimised coefficients of other sub-controllers.
Coefficient m 3 n 5 n 6 m 4 n 7 n 8 m 5 & m 6 n 9 & n 11 n 10 & n 12
Original1.600.903.205.0010.003.002..501.001.00
Optimal15.1411.4012.676.919.966.653.814.683.89
No. of Iterations5103
Table 5. Performance of the optimised roll sub-controller.
Table 5. Performance of the optimised roll sub-controller.
IndicatorIAE (rad s)ITAE (rad s2)E-IAE (rad s)E-ITAE (rad s2)
Origin0.0690.0120.1550.231
GWO0.0420.0050.1250.207
Table 6. Original and optimised comparison in IAE and ITAE.
Table 6. Original and optimised comparison in IAE and ITAE.
IAE-Roll
(deg s)
ITAE-Roll
(deg s2)
IAE-Pitch
(deg s)
ITAE-Pitch
(deg s2)
IAE-Yaw
(deg s)
ITAE-Yaw
(deg s2)
Origin11.7955.2414.51112.405.18523.04
GWO9.9651.711.2681.361.395.68
Improvement (%)15.66.422.427.673.273.4
IAE-x(ms)ITAE-x(ms2)IAE-y (ms)ITAE-y (ms2)IAE-z (ms)ITAE-z (ms2)
Origin1.158.730.804.530.060.09
GWO0.604.370.291.920.040.06
Improvement (%)47.850.063.857.633.333.3
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Sun, C.; Agha, S.A.; Mohamed, Z.; Shaheed, M.H. Optimised Sliding Mode Control of a Hexacopter: Simulation and Experiments. Electronics 2022, 11, 2519. https://doi.org/10.3390/electronics11162519

AMA Style

Sun C, Agha SA, Mohamed Z, Shaheed MH. Optimised Sliding Mode Control of a Hexacopter: Simulation and Experiments. Electronics. 2022; 11(16):2519. https://doi.org/10.3390/electronics11162519

Chicago/Turabian Style

Sun, Chaoran, Stephen A. Agha, Zaharuddin Mohamed, and M. Hasan Shaheed. 2022. "Optimised Sliding Mode Control of a Hexacopter: Simulation and Experiments" Electronics 11, no. 16: 2519. https://doi.org/10.3390/electronics11162519

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop