# Extreme Learning Machine Assisted Adaptive Control of a Quadrotor Helicopter

Authors: Yu Zhang; Zheng Fang; Hongbo Li
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

Control of quadrotor helicopters is difficult because the problem
is naturally nonlinear. The problem becomes more challenging for
common model based controllers when unpredictable uncertainties and
disturbances in physical control system are taken into account. This paper
proposes a novel intelligent controller design based on a fast online
learning method called extreme learning machine (ELM). Our neural
controller does not require precise system modeling or prior knowledge
of disturbances and well approximates the dynamics of the quadrotor
at a fast speed. The proposed method also incorporates a sliding mode
controller for further elimination of external disturbances. Simulation
results demonstrate that the proposed controller can reliably stabilize a
quadrotor helicopter in both agitated attitude and position control tasks.


---

## Body

## 1. Introduction

Unmanned aerial vehicles (UAVs) have received considerable attention in recent years due to their wide military and civilian applications. Their typical applications include collecting data, monitoring, surveillance, investigation, and inspection [1], which can be used in scenarios such as environmental monitoring, resource exploration, agriculture surveying, traffic control, weather forecasting, aerial photography, disasters search, and rescue. Particularly, unmanned rotorcrafts play an important role in these applications because of their flexibility such as hovering and vertical take-off and landing (VTOL). However, conventional rotorcraft with a main rotor and a tail rotor has extremely complex dynamics. Its maneuverability is greatly limited since it is very difficult to design a controller with high performance. Meanwhile, a special kind of rotorcrafts called quadrotor helicopter which has a compact form is becoming more and more popular than conventional rotorcrafts as they are mechanically and dynamically simpler and easier to control. In spite of this, the quadrotor is still a dynamically unstable system and its controller design is also challenging because of the inherent system characteristics such as nonlinearities, cross couplings due to the gyroscopic effects, and underactuation [2]. Besides, all the applications mentioned above require a vehicle with stable and accurate performance of motion control. Therefore, how to design a high quality controller for quadrotor is an important and meaningful problem.Many different control theories and methods are employed to design the attitude stabilizer or motion controller for quadrotors [3]. In the early stage, Bouabdallah et al. first apply two different control techniques, PID and linear quadratic (LQ) techniques, to a microquadrotor called OS4 [2]. Subsequently, other research works using PID [4, 5] or LQ [6] methods are also reported. These two kinds of controllers are easy to design and implement. However, they cannot handle the unmolded dynamics and external disturbances. Because of the nonlinearity, feedback linearization technology is adopted to design the controller for quadrotors [7, 8]. However, precise model of quadrotors which is required for linearization is difficult to obtain. Backstepping design method [9–11] is another choice to deal with the nonlinear models of quadrotors [12, 13], but the controller is usually vulnerable to parameters uncertainty. To deal with the dynamic uncertainty and external disturbances, sliding mode control [14] and H infinite control [15, 16] algorithms are used to improve the robustness of the system. However, sliding mode controller is likely to have chattering phenomena in both sides of sliding mode surface due to the delay of sensors or actuators, and H infinite control method, which requires approximate linearization near the equilibrium point of the system, is not suitable for aggressive control.The performance of model based controllers above degrades significantly in case of model uncertainties and unknown disturbances. One potential way to solve this problem is intelligent control methods such as fuzzy logic control [17, 18], neural networks control [19, 20], and learning based control [21]. One main challenge of utilizing these techniques is the convergence performance of controllers. Slow convergence may cause failure in real time control system.In this paper, a novel computational intelligence technique called extreme learning machine (ELM) [22] is introduced to control the quadrotors by compensating the dynamic uncertainties and the external disturbances. ELM theories have been successfully improved recently by Cao et al. [23] and widely used in several control systems [24]. Essentially, it is a learning policy for generalized single hidden layer feedforward networks (SLFNs) whose input weight and hidden layer do not need to be tuned. Compared with backpropagation (BP) method and support vector machines (SVMs), ELM provides better generalization performance at a much faster learning speed and with least human intervention [25]. Thus, ELM can be used to estimate and compensate the uncertainties and disturbances of the systems simultaneously in real time.There are three main contributions of this paper. First, we employ Lyapunov second method to minimize the cost function of ELM and satisfy the quadrotor control system stability simultaneously under the framework of ELM. So it is a development of ELM theory. Second, traditional neural network based controller is facing two problems. One is that too many parameters need to be initialized and tuned. The other is slow convergence. Since ELM can converge very fast with its input weight and hidden nodes parameters fixed, the two problems above are significantly alleviated when ELM is employed to the quadrotor control. Third, the quadrotor control system is a complicated dynamic system. The stability of the ELM based control system is proved.This paper is organized as follows: In Section2, the mathematical model of ELM is presented. Kinematics and dynamics models of quadrotors are described in Section 3. In Section 4, the details of designing an ELM-assisted quadrotor controller are presented. The stability of the proposed controller is also proved in this section. Simulation results are given in Section 5 to demonstrate the performance of the proposed controller. Finally, the paper is concluded in Section 6.


## 2. Preliminary on Extreme Learning Machine

In this section, the basic idea of ELM is briefly reviewed to provide a background for designing controller for the quadrotor. ELM is a special SLFN whose learning speed can be much faster than conventional feedforward network learning algorithm such as BP algorithm while obtaining better generalization performance [26]. The essence of ELM is that the input weights and the parameters of the hidden layer do not need to adjust during the learning procedure. We take a SLFN with L hidden nodes as an example. The output of the SLFN can be modeled as(1)fLx=∑i=1LβiGx,ci,ai,x∈Rn,ci∈Rn,where βi is the output weight connecting the ith hidden node to the output node, G(x,ci,ai) is the activation function of the ith hidden node, and ci and ai are the parameters of the activation function which are randomly generated and then fixed afterwards. Furthermore, there are two kinds of hidden nodes. Usually, additive hidden nodes use Sigmoid or threshold activation function as follows:(2)Gx,ci,ai=1-e-cix+ai1+e-cix+ai,where ci is the input weight vector for the ith hidden node and ai is the bias of the ith hidden node. For RBF hidden nodes, Gaussian or triangular activation function is used for activation which can be given by(3)Gx,ci,ai=exp⁡-x-ci22ai2,where ci and ai are the center and impact factor of the ith RBF node, respectively.Then,N sample pairs (xk,yk)∈Rn×Rm(k=1,…,N) are used to train the SLFN. If this network can approximate N samples with zero error, there must exist βi*, ci, and ai such that(4)∑i=1Lβi*Gxk,ci,ai=yk,k=1,…,N.The previous equation can be rewritten compactly as(5)Hβ*=Y,where(6)H=Gx1,c1,a1⋯Gx1,cL,aL⋮⋱⋮GxN,c1,a1⋯GxN,cL,aLN×L,β*=β1*T⋯βL*TT,Y=Y1T⋯YLTT.ELM aims to minimize not only the training error but also the norm of output weights, which would yield a better generalization performance [25]. In other words, ELM try to minimize the training error as well as the norm of the output weights. So the objective function can be expressed as(7)min⁡Hβ-Y,β.Finally, the minimal norm least-square method instead of the standard optimization method was adopted in the original implementation of ELM [25], and the closed form solution is obtained:(8)β*=H†Y,where H† is the Moore-Penrose generalized inverse of matrix H.


## 3. Quadrotor Helicopters Model

The quadrotor helicopter has four rotors in cross configuration. As we can see from Figure1, the two pairs of rotors (1, 3) and (2, 4) always turn in opposite directions. By changing the rotor speed, we can move the vehicles in different directions in 3D space. Initially, suppose all the rotors have the same speed as shown in Figure 1(c); increasing the four rotors speeds together generates upward movement. Then, increasing or decreasing 2 and 4 rotors speed inversely will change the attitude of the quadrotor. It generates roll rotation as well as lateral motion. Changing 1 and 3 rotors speed in the same way produces the pitch rotation as well as the longitudinal movements (see Figure 1(d)). Finally, if the counter-torque resulting from rotor (1, 3) is different from that of rotor (2, 4), the yaw rotations of the quadrotor are generated as shown in Figures 1(a) and 1(b).Figure 1
Quadrotor schematic. The white arrow width is proportional to rotor rotational speed, and the black arrows show the moving direction of the quadrotor.
(a)
(b)
(c)
(d)


### 3.1. Kinematic Model

To facilitate the model description, quadrotor reference frames are defined first. We consider earth fixed frameE-XYZ as an inertia frame while frame B-xyz is a body fixed frame as shown in Figure 2.Figure 2
Quadrotor reference frames.To transform an attitude from the body frame (x, y, and z) to the inertia frame (X, Y, and Z), the coordinate transformation matrix [1](9)R=cθcψsϕsθcψ-cϕsψcϕsθcψ+sϕsψcθsψsϕsθsψ+cϕcψcϕsθsψ-sϕcψ-sθsϕcθcϕcθ,where c and s denote cosine and sine functions. Then, the relationship between the euler rates η˙=ϕ˙θ˙ψ˙T and angular body rates ω=pqrT can be represented by(10)ω=Rrη˙,where(11)Rr=10-sinθ0cos⁡ϕsinϕcos⁡θ0-sinϕcos⁡ϕcos⁡θ.Particularly, when the quadrotor works around the hover position, the following condition can be approximately satisfied:(12)Rr≈I3×3,where I is the identity matrix.


### 3.2. Dynamic Model

Since the quadrotor helicopter can fly in 3D space, both rotational and translational motions should be considered in system modeling. The rotational equations of motion can be derived in the body frame using the Newton-Euler method while the translational equations of motion are derived in the inertia navigation frame using Newton’s second law [1]. Many works about quadrotor modeling have been reported, so here we directly give the full state space model [27] of a quadrotor for controller design.The state vector is defined asX=ϕϕ˙θθ˙ψψ˙zz˙xx˙yy˙T, where ϕ, θ, and ψ are the attitude angles which represent roll, pitch, and yaw. (x,y,z) is the quadrotor’s position in the inertia frame. If we define the speeds of the four rotors as Ω1, Ω2, Ω3, and Ω4, the control input vector can be further defined as U=U1U2U3U4T, which is mapped by(13)U1=kFΩ12+Ω22+Ω32+Ω42,U2=kF-Ω22+Ω42,U3=kFΩ12-Ω32,U4=kMΩ12-Ω22+Ω32-Ω42,where kF and kM are the aerodynamic force and moment constants, respectively. In this case, U1 is the total thrust generated from the four rotors. U2, U3, and U4 are the equivalent of the torques around x-, y-, and z-axis in body frame.Then, the state space model can be given by the following compact form:(14)X˙=fX,U,where(15)fX,U=ϕ˙θ˙ψ˙a1+θ˙a2Ωr+b1U2θ˙ϕ˙ψ˙a3-ϕ˙a4Ωr+b2U3ψ˙θ˙ϕ˙a5+b3U4z˙g-cos⁡ϕcos⁡θU1mx˙cos⁡ϕsinθcos⁡ψ+sinϕsinψU1my˙cos⁡ϕsinθsinψ-sinϕcos⁡ψU1m,(16)a1=Iyy-IzzIxx,a2=JrIxx,a3=Izz-IxxIyy,a4=JrIyy,a5=Ixx-IyyIzz,b1=lIxx,b2=lIyy,b3=1Izz,and Ixx, Iyy, and Izz are the moment of inertia around x-, y-, and z-axis, respectively. Jr is the propeller inertia coefficient. l is the arm length of the quadrotor.


## 3.1. Kinematic Model

To facilitate the model description, quadrotor reference frames are defined first. We consider earth fixed frameE-XYZ as an inertia frame while frame B-xyz is a body fixed frame as shown in Figure 2.Figure 2
Quadrotor reference frames.To transform an attitude from the body frame (x, y, and z) to the inertia frame (X, Y, and Z), the coordinate transformation matrix [1](9)R=cθcψsϕsθcψ-cϕsψcϕsθcψ+sϕsψcθsψsϕsθsψ+cϕcψcϕsθsψ-sϕcψ-sθsϕcθcϕcθ,where c and s denote cosine and sine functions. Then, the relationship between the euler rates η˙=ϕ˙θ˙ψ˙T and angular body rates ω=pqrT can be represented by(10)ω=Rrη˙,where(11)Rr=10-sinθ0cos⁡ϕsinϕcos⁡θ0-sinϕcos⁡ϕcos⁡θ.Particularly, when the quadrotor works around the hover position, the following condition can be approximately satisfied:(12)Rr≈I3×3,where I is the identity matrix.


## 3.2. Dynamic Model

Since the quadrotor helicopter can fly in 3D space, both rotational and translational motions should be considered in system modeling. The rotational equations of motion can be derived in the body frame using the Newton-Euler method while the translational equations of motion are derived in the inertia navigation frame using Newton’s second law [1]. Many works about quadrotor modeling have been reported, so here we directly give the full state space model [27] of a quadrotor for controller design.The state vector is defined asX=ϕϕ˙θθ˙ψψ˙zz˙xx˙yy˙T, where ϕ, θ, and ψ are the attitude angles which represent roll, pitch, and yaw. (x,y,z) is the quadrotor’s position in the inertia frame. If we define the speeds of the four rotors as Ω1, Ω2, Ω3, and Ω4, the control input vector can be further defined as U=U1U2U3U4T, which is mapped by(13)U1=kFΩ12+Ω22+Ω32+Ω42,U2=kF-Ω22+Ω42,U3=kFΩ12-Ω32,U4=kMΩ12-Ω22+Ω32-Ω42,where kF and kM are the aerodynamic force and moment constants, respectively. In this case, U1 is the total thrust generated from the four rotors. U2, U3, and U4 are the equivalent of the torques around x-, y-, and z-axis in body frame.Then, the state space model can be given by the following compact form:(14)X˙=fX,U,where(15)fX,U=ϕ˙θ˙ψ˙a1+θ˙a2Ωr+b1U2θ˙ϕ˙ψ˙a3-ϕ˙a4Ωr+b2U3ψ˙θ˙ϕ˙a5+b3U4z˙g-cos⁡ϕcos⁡θU1mx˙cos⁡ϕsinθcos⁡ψ+sinϕsinψU1my˙cos⁡ϕsinθsinψ-sinϕcos⁡ψU1m,(16)a1=Iyy-IzzIxx,a2=JrIxx,a3=Izz-IxxIyy,a4=JrIyy,a5=Ixx-IyyIzz,b1=lIxx,b2=lIyy,b3=1Izz,and Ixx, Iyy, and Izz are the moment of inertia around x-, y-, and z-axis, respectively. Jr is the propeller inertia coefficient. l is the arm length of the quadrotor.


## 4. Controller Design Using ELM

By investigating the relationship between the state variables in (15), the attitude of the quadrotor does not depend on the translational motion while the translation of the quadrotor depends on the attitude angles. Thus, the whole system can be decoupled into two subsystems: inner loop attitude subsystem and outer loop position subsystem, respectively. The structure of the whole control system is described in Figure 3, where xd,x˙d,yd,y˙d,zd,z˙d is the coordinate of the desired trajectory and ϕd,θd,ψd,ϕ˙d,θ˙d,ψ˙d is the desired attitude angles and their rates generated by the position controller. U1 is produced by the position controller related to the altitude of the vehicle while the U2, U3, and U4 are calculated by the attitude controller.Figure 3
The structure of the quadrotor control system.


### 4.1. Position Control Loop

The outer loop is a position control system which is much slower compared to the inner loop attitude control system. In addition, the desired roll, pitch, and yaw angles are normally small that makes the position subsystem an approximately linear system near the equilibrium points. A simple PD controller is sufficient to control the quadrotor’s position.For horizontal movement, according to the desired trajectory, the expected accelerations inX and Y direction can be calculated by the PD controller:(17)x¨d=kpxxd-x+kdxx˙d-x˙,y¨d=kpyyd-y+kdyy˙d-y˙,where (kpx,kdx) and (kpy,kdy) are the proportional and differential control gains in X and Y directions. Control gains are acquired using pole placement design method to make the position system stable. When the yaw angle of the quadrotor keeps fixed, we can substitute x¨d and y¨d into (15) and obtain(18)cos⁡ϕdsinθdcos⁡ψ+sinϕdsinψU1m=x¨d,cos⁡ϕdsinθdsinψ-sinϕdcos⁡ψU1m=y¨d.Using the small angle assumption around the equilibrium position, (18) can be simplified as(19)θdcos⁡ψ+ϕdsinψU1m=x¨d,θdsinψ-ϕdcos⁡ψU1m=y¨d.Then, the reference roll and pitch angles can be solved by(20)ϕdθd=mU1sinψcos⁡ψ-cos⁡ψsinψ-1x¨dy¨d.For vertical movements, the altitude control input can be calculated by(21)U1=1cos⁡⁡ϕcos⁡⁡θ·1+k1k2zd-z+k1+k2z˙d-z˙+mgusing backstepping design method, where k1 and k2 are positive real numbers and mg is the term to balance the gravity. Please note that all the inputs have their own saturation functions.


### 4.2. Attitude Control Loop

The quadrotor’s attitude system is sensitive to the disturbances. It is also a nonlinear system with unmodeled dynamic uncertainties compared to the real quadrotor system. Hence an ELM based SLFN with very fast learning speed is employed to adaptively learn and estimate the nonlinear model including the uncertainties of the quadrotor’s attitude system in real time. Meanwhile, the proposed neural controller incorporates a sliding mode controller to deal with the external disturbances. The stability of the attitude control system is proved using the Lyapunov theory.Since the roll, pitch, and yaw subsystems have the same form of expression, without loss of generality, we take roll subsystem as an example to introduce the design procedure. Although three attitude subsystems are coupled with each other, the coupled items can be considered the unknown nonlinear functions of dynamic system or internal disturbances and thus be adaptively estimated by the SLFN with ELM.


#### 4.2.1. Model Based Control Law

According to (15), the roll subsystem is expressed in the following form:(22)x˙1=x2,x˙2=fx+gxu+d,y=x1,where f(x) is assumed to be unknown but bounded and g(x) is the input gain. Particularly, in roll subsystem g(x)=b1=l/Ixx which is known. d is the unknown disturbances. It is bounded and satisfies d≤dmax⁡, where dmax⁡ is the upper bound of the disturbances. Then, the output tracking error E=[e,e˙]T, where e=yd-x1 and e˙=y˙d-x2.Suppose all the functions and parameters in (22) are precisely known; the perfect control law u* can be obtained using feedback linearization method as follows:(23)u*=Ixxly¨d-fx-d+KTE,where K=[K1,K2]T is a real number vector. Substitute (23) into (22); the following error equation is obtained:(24)e¨+K2e˙+K1=0.K1 and K2 can be determined when all the roots of the polynomial s2+K2s+K1=0 are in the open left half plane, which indicates that the tracking error will converge to zero.


#### 4.2.2. Neural Controller Structure

Sincef(x) is coupled with other variables and cannot be accurately modeled, d is also unknown disturbances; control law of (23) cannot be directly implemented. Here, we present an ELM-assisted neural controller to solve the problem.The inner loop controller is mainly composed of two parts. One is the neural controllerun and the other is the sliding mode controller us. So the overall control law(25)u=un+us.The neural controller is used to approximate the unknown function f(x) while the sliding mode controller is employed to eliminate the external disturbances d.For the neural controller, according to (23), the optimal neural control law is expected as(26)un*=Ixxly¨d-fx+KTE.Here, a SLFN whose parameters are determined based on the ELM is employed to approximate the above desired neural control law. Then, the actual neural control law un is given by(27)un=Hr,c,aβ,where r=[y¨d;x;E]T is the input vector. As we mentioned in Section 2, c and a are hidden node parameters which are generated randomly and then fixed. Training a SLFN with ELM is the equivalent of finding a least-square solution of the output weights β*, such that(28)u^n*=Hr,c,aβ*+εr,where ε(r) is the approximation error. This error arises if the number of hidden nodes is much less than the number of training samples [24], but it is bounded with the constant εN; that is, ε(r)≤εN.For the sliding mode controller, standard sliding mode control law has the form(29)us=GsxsgnfE,where Gs(x) is the sliding mode gain and f(E) is the sliding mode surface function.Since we have the forms of the neural controller and the sliding mode controller, the next step is to derive the adaptive lawβ˙, so that β converges to β*. The parameters of the sliding mode controller are determined. The details are given in the next subsection.


### 4.3. Adaptive Control Law and Stability Analysis

The stable adaptive law forβ and the parameters of the sliding mode controller are derived using Lyapunov second method.Based on (22), (25), and (26), the tracking error equation can be obtained:(30)E˙=ΛE+Bun*-un-us-dIxxl,where(31)Λ=01-K1-K2,B=0lIxx.Substituting (27), (28) into (30) yields(32)E˙=ΛE+BHr,c,aβ~+εr-us-dIxxl,where β~=β*-β. Then, the following Lyapunov function is considered to derive the stable tuning law for β:(33)V=12ETPE+12ηβ~Tβ~,where P is a symmetric and positive definite matrix and η is a positive constant which is referred to as the learning rate of the SLFN.According to (32), the derivative of the Lyapunov function is acquired as(34)V˙=12E˙TPE+ETPE˙+1ηβ~˙Tβ~=-12ETQE+ETPBH+1ηβ~˙Tβ~-ETPBdIxxl-εr-ETPBus,where(35)Q=-ΛTP+PΛ.Suppose Q is selected as a symmetric definite matrix, the first item of the Lyapunov function will converge to zero. Then, P can be calculated by solving (35). According to the second item of the Lyapunov function, β~ can be eliminated if we let(36)β~˙T=-ηETPBH.Consider β~˙=-β˙ based on the definition of the β~. Thus, the tuning rule for the output weight is acquired:(37)β˙T=ηETPBH.After that, (34) becomes(38)V˙=-12ETQE-ETPBdIxxl-εr-ETPBus.To make (38) less than or equal to zero, the sliding mode controller us can be determined as(39)us=dmax⁡Ixxl+εNsgnETPB.Therefore, the following relationship can be derived from (39):(40)V˙≤-12ETQE+ETPBdIxxl+εrW-ETPBdmax⁡Ixxl+εNsgnETPB=-12ETQE+ETPBdIxxl+εrW-ETPBdmax⁡Ixxl+εN=-12ETQE+ETPBd-dmax⁡IxxlW+ETPBεr-εN≤0.Equation (40) indicates that V˙ is negative semidefinite and the control system is guaranteed to be stable. Please note that traditional ELM trains their output weights using the least-square error method, but in this paper, we derived the tuning rate of the output weights using Lyapunov second method. It is an online sequential learning process that makes the controller applicable in real time. The input weight and the parameters of the hidden nodes are randomly assigned as the normal ELM algorithm.Finally, the overall control laws for quadrotor’s attitude system are given by(41)U2=Hϕrϕ,cϕ,aϕβϕ+dmax⁡Ixxl+εNsgnEϕTPϕBϕ,U3=Hθrθ,cθ,aθβθ+dmax⁡Iyyl+εNsgnEθTPθBθ,U4=Hψrψ,cψ,aψβψ+dmax⁡Izz+εNsgnEψTPψBψ,where the subscripts ϕ, θ, and ψ represent the roll, pitch, and yaw subsystem, respectively. To avoid chattering problem, the sgn(·) function can be replaced by the saturation function sat⁡(·).


## 4.1. Position Control Loop

The outer loop is a position control system which is much slower compared to the inner loop attitude control system. In addition, the desired roll, pitch, and yaw angles are normally small that makes the position subsystem an approximately linear system near the equilibrium points. A simple PD controller is sufficient to control the quadrotor’s position.For horizontal movement, according to the desired trajectory, the expected accelerations inX and Y direction can be calculated by the PD controller:(17)x¨d=kpxxd-x+kdxx˙d-x˙,y¨d=kpyyd-y+kdyy˙d-y˙,where (kpx,kdx) and (kpy,kdy) are the proportional and differential control gains in X and Y directions. Control gains are acquired using pole placement design method to make the position system stable. When the yaw angle of the quadrotor keeps fixed, we can substitute x¨d and y¨d into (15) and obtain(18)cos⁡ϕdsinθdcos⁡ψ+sinϕdsinψU1m=x¨d,cos⁡ϕdsinθdsinψ-sinϕdcos⁡ψU1m=y¨d.Using the small angle assumption around the equilibrium position, (18) can be simplified as(19)θdcos⁡ψ+ϕdsinψU1m=x¨d,θdsinψ-ϕdcos⁡ψU1m=y¨d.Then, the reference roll and pitch angles can be solved by(20)ϕdθd=mU1sinψcos⁡ψ-cos⁡ψsinψ-1x¨dy¨d.For vertical movements, the altitude control input can be calculated by(21)U1=1cos⁡⁡ϕcos⁡⁡θ·1+k1k2zd-z+k1+k2z˙d-z˙+mgusing backstepping design method, where k1 and k2 are positive real numbers and mg is the term to balance the gravity. Please note that all the inputs have their own saturation functions.


## 4.2. Attitude Control Loop

The quadrotor’s attitude system is sensitive to the disturbances. It is also a nonlinear system with unmodeled dynamic uncertainties compared to the real quadrotor system. Hence an ELM based SLFN with very fast learning speed is employed to adaptively learn and estimate the nonlinear model including the uncertainties of the quadrotor’s attitude system in real time. Meanwhile, the proposed neural controller incorporates a sliding mode controller to deal with the external disturbances. The stability of the attitude control system is proved using the Lyapunov theory.Since the roll, pitch, and yaw subsystems have the same form of expression, without loss of generality, we take roll subsystem as an example to introduce the design procedure. Although three attitude subsystems are coupled with each other, the coupled items can be considered the unknown nonlinear functions of dynamic system or internal disturbances and thus be adaptively estimated by the SLFN with ELM.


### 4.2.1. Model Based Control Law

According to (15), the roll subsystem is expressed in the following form:(22)x˙1=x2,x˙2=fx+gxu+d,y=x1,where f(x) is assumed to be unknown but bounded and g(x) is the input gain. Particularly, in roll subsystem g(x)=b1=l/Ixx which is known. d is the unknown disturbances. It is bounded and satisfies d≤dmax⁡, where dmax⁡ is the upper bound of the disturbances. Then, the output tracking error E=[e,e˙]T, where e=yd-x1 and e˙=y˙d-x2.Suppose all the functions and parameters in (22) are precisely known; the perfect control law u* can be obtained using feedback linearization method as follows:(23)u*=Ixxly¨d-fx-d+KTE,where K=[K1,K2]T is a real number vector. Substitute (23) into (22); the following error equation is obtained:(24)e¨+K2e˙+K1=0.K1 and K2 can be determined when all the roots of the polynomial s2+K2s+K1=0 are in the open left half plane, which indicates that the tracking error will converge to zero.


### 4.2.2. Neural Controller Structure

Sincef(x) is coupled with other variables and cannot be accurately modeled, d is also unknown disturbances; control law of (23) cannot be directly implemented. Here, we present an ELM-assisted neural controller to solve the problem.The inner loop controller is mainly composed of two parts. One is the neural controllerun and the other is the sliding mode controller us. So the overall control law(25)u=un+us.The neural controller is used to approximate the unknown function f(x) while the sliding mode controller is employed to eliminate the external disturbances d.For the neural controller, according to (23), the optimal neural control law is expected as(26)un*=Ixxly¨d-fx+KTE.Here, a SLFN whose parameters are determined based on the ELM is employed to approximate the above desired neural control law. Then, the actual neural control law un is given by(27)un=Hr,c,aβ,where r=[y¨d;x;E]T is the input vector. As we mentioned in Section 2, c and a are hidden node parameters which are generated randomly and then fixed. Training a SLFN with ELM is the equivalent of finding a least-square solution of the output weights β*, such that(28)u^n*=Hr,c,aβ*+εr,where ε(r) is the approximation error. This error arises if the number of hidden nodes is much less than the number of training samples [24], but it is bounded with the constant εN; that is, ε(r)≤εN.For the sliding mode controller, standard sliding mode control law has the form(29)us=GsxsgnfE,where Gs(x) is the sliding mode gain and f(E) is the sliding mode surface function.Since we have the forms of the neural controller and the sliding mode controller, the next step is to derive the adaptive lawβ˙, so that β converges to β*. The parameters of the sliding mode controller are determined. The details are given in the next subsection.


## 4.2.1. Model Based Control Law

According to (15), the roll subsystem is expressed in the following form:(22)x˙1=x2,x˙2=fx+gxu+d,y=x1,where f(x) is assumed to be unknown but bounded and g(x) is the input gain. Particularly, in roll subsystem g(x)=b1=l/Ixx which is known. d is the unknown disturbances. It is bounded and satisfies d≤dmax⁡, where dmax⁡ is the upper bound of the disturbances. Then, the output tracking error E=[e,e˙]T, where e=yd-x1 and e˙=y˙d-x2.Suppose all the functions and parameters in (22) are precisely known; the perfect control law u* can be obtained using feedback linearization method as follows:(23)u*=Ixxly¨d-fx-d+KTE,where K=[K1,K2]T is a real number vector. Substitute (23) into (22); the following error equation is obtained:(24)e¨+K2e˙+K1=0.K1 and K2 can be determined when all the roots of the polynomial s2+K2s+K1=0 are in the open left half plane, which indicates that the tracking error will converge to zero.


## 4.2.2. Neural Controller Structure

Sincef(x) is coupled with other variables and cannot be accurately modeled, d is also unknown disturbances; control law of (23) cannot be directly implemented. Here, we present an ELM-assisted neural controller to solve the problem.The inner loop controller is mainly composed of two parts. One is the neural controllerun and the other is the sliding mode controller us. So the overall control law(25)u=un+us.The neural controller is used to approximate the unknown function f(x) while the sliding mode controller is employed to eliminate the external disturbances d.For the neural controller, according to (23), the optimal neural control law is expected as(26)un*=Ixxly¨d-fx+KTE.Here, a SLFN whose parameters are determined based on the ELM is employed to approximate the above desired neural control law. Then, the actual neural control law un is given by(27)un=Hr,c,aβ,where r=[y¨d;x;E]T is the input vector. As we mentioned in Section 2, c and a are hidden node parameters which are generated randomly and then fixed. Training a SLFN with ELM is the equivalent of finding a least-square solution of the output weights β*, such that(28)u^n*=Hr,c,aβ*+εr,where ε(r) is the approximation error. This error arises if the number of hidden nodes is much less than the number of training samples [24], but it is bounded with the constant εN; that is, ε(r)≤εN.For the sliding mode controller, standard sliding mode control law has the form(29)us=GsxsgnfE,where Gs(x) is the sliding mode gain and f(E) is the sliding mode surface function.Since we have the forms of the neural controller and the sliding mode controller, the next step is to derive the adaptive lawβ˙, so that β converges to β*. The parameters of the sliding mode controller are determined. The details are given in the next subsection.


## 4.3. Adaptive Control Law and Stability Analysis

The stable adaptive law forβ and the parameters of the sliding mode controller are derived using Lyapunov second method.Based on (22), (25), and (26), the tracking error equation can be obtained:(30)E˙=ΛE+Bun*-un-us-dIxxl,where(31)Λ=01-K1-K2,B=0lIxx.Substituting (27), (28) into (30) yields(32)E˙=ΛE+BHr,c,aβ~+εr-us-dIxxl,where β~=β*-β. Then, the following Lyapunov function is considered to derive the stable tuning law for β:(33)V=12ETPE+12ηβ~Tβ~,where P is a symmetric and positive definite matrix and η is a positive constant which is referred to as the learning rate of the SLFN.According to (32), the derivative of the Lyapunov function is acquired as(34)V˙=12E˙TPE+ETPE˙+1ηβ~˙Tβ~=-12ETQE+ETPBH+1ηβ~˙Tβ~-ETPBdIxxl-εr-ETPBus,where(35)Q=-ΛTP+PΛ.Suppose Q is selected as a symmetric definite matrix, the first item of the Lyapunov function will converge to zero. Then, P can be calculated by solving (35). According to the second item of the Lyapunov function, β~ can be eliminated if we let(36)β~˙T=-ηETPBH.Consider β~˙=-β˙ based on the definition of the β~. Thus, the tuning rule for the output weight is acquired:(37)β˙T=ηETPBH.After that, (34) becomes(38)V˙=-12ETQE-ETPBdIxxl-εr-ETPBus.To make (38) less than or equal to zero, the sliding mode controller us can be determined as(39)us=dmax⁡Ixxl+εNsgnETPB.Therefore, the following relationship can be derived from (39):(40)V˙≤-12ETQE+ETPBdIxxl+εrW-ETPBdmax⁡Ixxl+εNsgnETPB=-12ETQE+ETPBdIxxl+εrW-ETPBdmax⁡Ixxl+εN=-12ETQE+ETPBd-dmax⁡IxxlW+ETPBεr-εN≤0.Equation (40) indicates that V˙ is negative semidefinite and the control system is guaranteed to be stable. Please note that traditional ELM trains their output weights using the least-square error method, but in this paper, we derived the tuning rate of the output weights using Lyapunov second method. It is an online sequential learning process that makes the controller applicable in real time. The input weight and the parameters of the hidden nodes are randomly assigned as the normal ELM algorithm.Finally, the overall control laws for quadrotor’s attitude system are given by(41)U2=Hϕrϕ,cϕ,aϕβϕ+dmax⁡Ixxl+εNsgnEϕTPϕBϕ,U3=Hθrθ,cθ,aθβθ+dmax⁡Iyyl+εNsgnEθTPθBθ,U4=Hψrψ,cψ,aψβψ+dmax⁡Izz+εNsgnEψTPψBψ,where the subscripts ϕ, θ, and ψ represent the roll, pitch, and yaw subsystem, respectively. To avoid chattering problem, the sgn(·) function can be replaced by the saturation function sat⁡(·).


## 5. Simulations

In this section, attitude and position control simulations are both implemented on a nonlinear quadrotor model to evaluate the performance of the proposed controller. We also compare our method to some other controllers to demonstrate the effectiveness of ELM. The parameters of the quadrotor for simulation are measured from a real platform as listed in Table1.Table 1
Parameters of the quadrotor.
Name
Parameter
Value
Unit
Mass
m
2.2
kg
Inertia aroundx axis
I
x
x
1.676
e
-
2
kg·m2
Inertia aroundy axis
I
y
y
1.676
e
-
2
kg·m2
Inertia aroundz axis
I
z
z
2.314
e
-
2
kg·m2
Rotor inertia
J
r
0.1
kg·m2
Arm length
l
0.18
m


### 5.1. Simulation Setup

Two cases are tested for attitude control simulations. The first case is to regulate the quadrotor helicopter from an initial attitude(ϕi=π/8,  θi=π/8,  ψi=0) to a target attitude (ϕt=-π/16,  θt=-π/16,  ψt=0). The attitude response speed and accuracy can be evaluated in this case. The second case is an attitude tracking mission. The quadrotor’s attitude is set to follow a trajectory (ϕd=(π/8)sin(2π×0.25t),  θd=(π/8)sin(2π×0.25t)) while the yaw angle keeps fixed.To further demonstrate the controller performance, position tracking simulations are also implemented, where the quadrotor is expected to follow a trajectory such as straight line and circle.In all the cases above, the model uncertaintyd in (22) is given by 0.5*sin(πt), and dmax⁡=0.5. The controller parameters are chosen as follows: K1=8, K2=128, Q=diag(100,100), η=0.05, and εN=14. The number of hidden nodes L=6. RBF nodes are selected as the hidden nodes whose parameter c is generated in the interval [-5π/16,5π/16] and a=0.4.To show the feasibility and advantage of the proposed controller, we compare our method (SMC with ELM) to a proportion-differentiation controller (PD), a standard sliding mode controller (SMC), and a SMC with back propagation based neural network (SMC with NN). The parameters of the PD controller are chosen as follows:kpϕ=5, kdϕ=1.2, kpθ=5, kdθ=1.2, kpψ=5, and kdψ=1. Sliding mode control gain G=14.5. Sliding mode surface parameters c1=8 and c2=1. The initial parameters of the SMC with NN are the same as the SMC with ELM.


### 5.2.  Results

The results of roll (ϕ) and pitch (θ) angles regulation using different controllers are illustrated in Figure 4. As we can see, the proposed controller makes the attitude angles converge faster to the reference values than the other controllers. PD controller has attitude overshoot problem which may result in vehicle’s vibration. This problem can be avoided by decreasing PD control gains, but the response speed is sacrificed. The result from SMC with NN has large errors because of the slow convergence problem. The control inputs related to roll and pitch are shown in Figure 5. All of them are bounded and applicable. Inputs in our method are large at the beginning but decrease quickly. This is the reason why the response speed and accuracy are obtained simultaneously. In Figure 6, it indicates that the output weights β trained by ELM can converge faster than BP based neural networks. Thus, the contribution of ELM in quadrotor controller design is further confirmed.Figure 4
Roll and pitch angle regulation.Figure 5
Control inputsU2 and U3.Figure 6
Learning curve ofβ in attitude regulation control.Attitude tracking results are shown in Figure7. ELM-assisted controller makes the attitude follow the reference trajectory pretty well while PD and SMC have a delay in tracking process. The result from SMC with NN also cannot follow the reference input well. It shows that the proposed controller has the best tracking performance among the four controllers. Tracking errors of this case are shown in Figure 8. We can see that our proposed method has the smallest error. Figure 9 shows the better convergency of output weights β using ELM than traditional neural networks.Figure 7
Roll and pitch angle tracking.Figure 8
Attitude tracking errors.Figure 9
Learning curve ofβ in attitude tracking control.The results of straight line tracking are shown in Figure10 which demonstrate better tracking performance of proposed controller. As we can see from Figure 11, SMC with ELM has the smallest error compared to the others. In addition, the PD and SMC with NN cannot damp the errors quickly and have some oscillations. The learning curve of ELM also converges fast as shown in Figure 12.Figure 10
Position tracking on a straight line.Figure 11
Tracking errors inX and Y direction.Figure 12
Learning curve ofβ in position tracking control (straight line).Position tracking on a circle trajectory is shown in Figure13. It seems that all methods can give a stable tracking performance. However, as we can see, the SMC with ELM has the best performance in terms of stability and tracking accuracy. The training process of β in ELM is also better than BP based neural networks as given in Figure 14. ELM can converge quickly and remains unchanged afterwards in this test.Figure 13
Position tracking on a circle trajectory.Figure 14
Learning curve ofβ in position tracking control (circle).


## 5.1. Simulation Setup

Two cases are tested for attitude control simulations. The first case is to regulate the quadrotor helicopter from an initial attitude(ϕi=π/8,  θi=π/8,  ψi=0) to a target attitude (ϕt=-π/16,  θt=-π/16,  ψt=0). The attitude response speed and accuracy can be evaluated in this case. The second case is an attitude tracking mission. The quadrotor’s attitude is set to follow a trajectory (ϕd=(π/8)sin(2π×0.25t),  θd=(π/8)sin(2π×0.25t)) while the yaw angle keeps fixed.To further demonstrate the controller performance, position tracking simulations are also implemented, where the quadrotor is expected to follow a trajectory such as straight line and circle.In all the cases above, the model uncertaintyd in (22) is given by 0.5*sin(πt), and dmax⁡=0.5. The controller parameters are chosen as follows: K1=8, K2=128, Q=diag(100,100), η=0.05, and εN=14. The number of hidden nodes L=6. RBF nodes are selected as the hidden nodes whose parameter c is generated in the interval [-5π/16,5π/16] and a=0.4.To show the feasibility and advantage of the proposed controller, we compare our method (SMC with ELM) to a proportion-differentiation controller (PD), a standard sliding mode controller (SMC), and a SMC with back propagation based neural network (SMC with NN). The parameters of the PD controller are chosen as follows:kpϕ=5, kdϕ=1.2, kpθ=5, kdθ=1.2, kpψ=5, and kdψ=1. Sliding mode control gain G=14.5. Sliding mode surface parameters c1=8 and c2=1. The initial parameters of the SMC with NN are the same as the SMC with ELM.


## 5.2.  Results

The results of roll (ϕ) and pitch (θ) angles regulation using different controllers are illustrated in Figure 4. As we can see, the proposed controller makes the attitude angles converge faster to the reference values than the other controllers. PD controller has attitude overshoot problem which may result in vehicle’s vibration. This problem can be avoided by decreasing PD control gains, but the response speed is sacrificed. The result from SMC with NN has large errors because of the slow convergence problem. The control inputs related to roll and pitch are shown in Figure 5. All of them are bounded and applicable. Inputs in our method are large at the beginning but decrease quickly. This is the reason why the response speed and accuracy are obtained simultaneously. In Figure 6, it indicates that the output weights β trained by ELM can converge faster than BP based neural networks. Thus, the contribution of ELM in quadrotor controller design is further confirmed.Figure 4
Roll and pitch angle regulation.Figure 5
Control inputsU2 and U3.Figure 6
Learning curve ofβ in attitude regulation control.Attitude tracking results are shown in Figure7. ELM-assisted controller makes the attitude follow the reference trajectory pretty well while PD and SMC have a delay in tracking process. The result from SMC with NN also cannot follow the reference input well. It shows that the proposed controller has the best tracking performance among the four controllers. Tracking errors of this case are shown in Figure 8. We can see that our proposed method has the smallest error. Figure 9 shows the better convergency of output weights β using ELM than traditional neural networks.Figure 7
Roll and pitch angle tracking.Figure 8
Attitude tracking errors.Figure 9
Learning curve ofβ in attitude tracking control.The results of straight line tracking are shown in Figure10 which demonstrate better tracking performance of proposed controller. As we can see from Figure 11, SMC with ELM has the smallest error compared to the others. In addition, the PD and SMC with NN cannot damp the errors quickly and have some oscillations. The learning curve of ELM also converges fast as shown in Figure 12.Figure 10
Position tracking on a straight line.Figure 11
Tracking errors inX and Y direction.Figure 12
Learning curve ofβ in position tracking control (straight line).Position tracking on a circle trajectory is shown in Figure13. It seems that all methods can give a stable tracking performance. However, as we can see, the SMC with ELM has the best performance in terms of stability and tracking accuracy. The training process of β in ELM is also better than BP based neural networks as given in Figure 14. ELM can converge quickly and remains unchanged afterwards in this test.Figure 13
Position tracking on a circle trajectory.Figure 14
Learning curve ofβ in position tracking control (circle).


## 6. Conclusions

In this paper, an ELM-assisted adaptive controller combined with a sliding mode controller is designed for control of a quadrotor helicopter. A single hidden layer feedforward network whose input weights and hidden node parameters are generated randomly and fixed afterwards is used to approximate the unknown dynamic model and internal uncertainties. Different from the standard ELM algorithm, the output weights of this neural network are updated based on the Lyapunov second method to guarantee the stability of the attitude control system. A sliding mode controller is employed to compensate the approximation error of the SLFN and eliminate the external disturbances. Plenty of simulations on quadrotor’s attitude and position control are implemented to validate the effectiveness of the proposed control scheme. The simulation results show that the proposed controller has better performance on response speed and control accuracy than simple PD controller. Furthermore, the comparison with the standard SMC and SMC with NN indicates that the extreme learning machine has potential ability to handle the unmodeled uncertainty problem in the control domain because of its fast convergence capability and good approximation ability.For future work, the idea of composite design and reinforcement learning [28] could be borrowed to develop new ELM algorithm to achieve better results.



---

*Source: 905184-2015-05-26.xml*