Extreme Learning Machine Assisted Adaptive Control of a Quadrotor Helicopter

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.


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][10][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 2 Mathematical Problems in Engineering uncertainty and external disturbances, sliding mode control [14] and  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  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 Section 2, 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.

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  hidden nodes as an example.The output of the SLFN can be modeled as where   is the output weight connecting the th hidden node to the output node, (x, c  ,   ) is the activation function of the th hidden node, and c  and   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: where c  is the input weight vector for the th hidden node and   is the bias of the th hidden node.For RBF hidden nodes, Gaussian or triangular activation function is used for activation which can be given by where c  and   are the center and impact factor of the th RBF node, respectively.
The previous equation can be rewritten compactly as where ELM aims to minimize not only the training error but also the norm of output weights, which would yield a better generalization performance [25].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: where H † is the Moore-Penrose generalized inverse of matrix H.

Quadrotor Helicopters Model
The quadrotor helicopter has four rotors in cross configuration.As we can see from Figure 1, 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).

Kinematic Model.
To facilitate the model description, quadrotor reference frames are defined first.We consider earth fixed frame - as an inertia frame while frame - is a body fixed frame as shown in Figure 2.
To transform an attitude from the body frame (, , and ) to the inertia frame (, , and ), the coordinate transformation matrix [  can be represented by where Particularly, when the quadrotor works around the hover position, the following condition can be approximately satisfied: where I is the identity matrix.

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 as X , where , , and  are the attitude angles which represent roll, pitch, and yaw.(, , ) 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 , which is mapped by where   and   are the aerodynamic force and moment constants, respectively.In this case,  1 is the total thrust generated from the four rotors. 2 ,  3 , and  4 are the equivalent of the torques around -, -, and -axis in body frame.
Then, the state space model can be given by the following compact form: where and   ,   , and   are the moment of inertia around -, -, and -axis, respectively.  is the propeller inertia coefficient. is the arm length of the quadrotor.

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 (  , ẋ  ,   , ẏ  ,   , ż  ) is the coordinate of the desired trajectory and (  ,   ,   , φ  , θ  , ψ  ) is the desired attitude angles and their rates generated by the position controller. 1 is produced by the position controller related to the altitude of the vehicle while the  2 ,  3 , and  4 are calculated by the attitude controller.

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 in  and  direction can be calculated by the PD controller: where (  ,   ) and (  ,   ) are the proportional and differential control gains in  and  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 ẍ  and ÿ  into (15) and obtain Using the small angle assumption around the equilibrium position, ( 18) can be simplified as Then, the reference roll and pitch angles can be solved by For vertical movements, the altitude control input can be calculated by using backstepping design method, where  1 and  2 are positive real numbers and  is the term to balance the gravity.Please note that all the inputs have their own saturation functions.

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.

Model Based Control Law.
According to ( 15), the roll subsystem is expressed in the following form: where (x) is assumed to be unknown but bounded and (x) is the input gain.Particularly, in roll subsystem (x) =  1 = /  which is known. is the unknown disturbances.It is bounded and satisfies || ≤  max , where  max is the upper bound of the disturbances.Then, the output tracking error E = [, ė ]  , where  =   −  1 and ė = ẏ  −  2 .Suppose all the functions and parameters in (22) are precisely known; the perfect control law  * can be obtained using feedback linearization method as follows: where K = [ 1 ,  2 ]  is a real number vector.Substitute ( 23) into (22); the following error equation is obtained: 1 and  2 can be determined when all the roots of the polynomial  2 +  2  +  1 = 0 are in the open left half plane, which indicates that the tracking error will converge to zero.

Neural Controller
Structure.Since (x) is coupled with other variables and cannot be accurately modeled,  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 controller   and the other is the sliding mode controller   .So the overall control law The neural controller is used to approximate the unknown function (x) while the sliding mode controller is employed to eliminate the external disturbances .For the neural controller, according to (23), the optimal neural control law is expected as 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   is given by where r = [ ÿ  ; x; E]  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 û *  = H(r, 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   ; that is, |(r)| ≤   .
For the sliding mode controller, standard sliding mode control law has the form where   (x) is the sliding mode gain and (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.

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: where Substituting ( 27), ( 28) into (30) yields where β =  * − .Then, the following Lyapunov function is considered to derive the stable tuning law for : 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 where 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 Consider β = − β based on the definition of the β.Thus, the tuning rule for the output weight is acquired: After that, (34) becomes To make (38) less than or equal to zero, the sliding mode controller   can be determined as Therefore, the following relationship can be derived from (39): 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 leastsquare 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 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(⋅).

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 Table 1.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 (  = (/8) sin(2 × 0.25),   = (/8) sin(2 × 0.25)) 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.
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:   = 5,   = 1.2,   = 5,   = 1.2,   = 5, and   = 1.Sliding mode control gain  = 14.5.Sliding mode surface parameters  1 = 8 and  2 = 1.The initial parameters of the SMC with NN are the same as the SMC with ELM.

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.
Attitude tracking results are shown in Figure 7. ELMassisted 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.
The results of straight line tracking are shown in Figure 10 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.
Position tracking on a circle trajectory is shown in Figure 13.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.

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.

Figure 1 :
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.

Figure 3 :
Figure 3: The structure of the quadrotor control system.

Figure 11 :
Figure 11: Tracking errors in  and  direction.