Online Adaptive Error Compensation SVM-Based Sliding Mode Control of an Unmanned Aerial Vehicle

. Unmanned Aerial Vehicle (UAV) is a nonlinear dynamic system with uncertainties and noises. Therefore, an appropriate control system has an obligation to ensure the stabilization and navigation of UAV. This paper mainly discusses the control problem of quad-rotor UAV system, which is influenced by unknown parameters and noises. Besides, a sliding mode control based on online adaptive error compensation support vector machine (SVM) is proposed for stabilizing quad-rotor UAV system. Sliding mode controller is established through analyzing quad-rotor dynamics model in which the unknown parameters are computed by offline SVM. During this process, the online adaptive error compensation SVM method is applied in this paper. As modeling errors and noises both exist in the process of flight, the offline SVM one-time mode cannot predict the uncertainties and noises accurately. The control law is adjusted in real-time by introducing new training sample data to online adaptive SVM in the control process, so that the stability and robustness of flight are ensured. It can be demonstrated through the simulation experiments that the UAV that joined online adaptive SVM can track the changing path faster according to its dynamic model. Consequently, the proposed method that is proved has the better control effect in the UAV system.


Introduction
Unmanned Aerial Vehicle (UAV) has drawn a great attention from researchers in the past few years.The characteristics of quad-rotor UAV, such as novel appearance, simple structure, low cost, excellent performance, and a unique way of flight control [1,2], have enabled it to be the new research hotspot all over the world [3][4][5][6].
Quad-rotor UAV consists of four independent propellers attached at each corner of a cross frame.It is relied on the resultant forces and moments of four independent rotors that adjust the flight attitude and position [7].Compared with the fixed wing aircraft, the quad-rotor UAVs that are equipped with vertical take-off have better landing capabilities even in the narrow space, because this vertical take-off has higher manoeuvrability and hovering capacities [8].
Quad-rotor UAV has all the advantages of unmanned rotor aerial vehicle; thus its application prospect is limitless.UAV has been used more and more in civilian such as rescue missions [9], forest fire surveillance [10], disaster relief support [11], exploration of high buildings or contaminated areas [12], aerial photography [13], area mapping [14], inspection of transmission lines and bridge [15], and assessment of water status [16].
However, the 6-DOF air-frame dynamic of quad-rotor UAV is nonlinear and coupled with each other.In addition, an underactuated system for the aircraft is equipped with four actuators, whose number is smaller than the degrees of freedom.Therefore, it is comparatively difficult to design an excellent controller for aircraft due to the reasons mentioned above.
The conventional sliding mode control (SMC), as a kind of nonlinear system control method, possesses the advantages of wide applicability, fine dynamic characteristics, and insensitivity to interference changes.This research on the sliding model control mainly deals with adaptive sliding model control [17,18], robust sliding mode control [19], optimal sliding mode control [20], fuzzy slidingmode control  [ 21,22], neural network sliding mode control [23,24], and sliding mode control combined with other intelligent controls [25].
To achieve the effective sliding mode control of quadrotor UAV, the mathematical model of various flight conditions must be designed accurately.Nevertheless, during the process of flight, UAVs are affected by various physical attributes such as aerodynamic force, gravity, gyroscopic effect, and the rotor inertia moment.It is also very vulnerable to the interference of the external environment like airflow.According to these reasons, it is quite difficult to establish a reliable dynamic model.Furthermore, the size and the weight of the rotor, the degree of deformation, and parameters of aerodynamic performance will also directly affect the precision of the model.
In consideration of these problems, how to make the estimator more accurate is very important.Hence the system can reach the sliding surface rapidly in coordination with a sliding mode control law.
Standard offline support vector machine (SVM) is a machine learning based on statistical theory.It can solve small-sample, nonlinear, and high dimension problems by using structural risk minimization.This method can efficiently supply the details without considering the changes of modeling the quad-rotor system.But it only focuses on training sample data within the limited time and its estimated result is predicted one time; hence there are still many dynamic variations that cannot be predicted during the process of flight.The main contribution of this paper is to compensate unknown parameters and to reduce the dynamic error by using online adaptive SVM for the quadrotor system.
This paper presents a method that standard SVM is combined with online adaptive error compensation SVM to design a sliding mode controller.Through this way, the weights of SVM can be adjusted adaptively to an optimal status.The rest of the paper is divided into five sections.The nonlinear dynamic model of the quad-rotor is described in Section 2. The design procedure of sliding mode controller using the online adaptive error compensation SVM is presented in Section 3. Section 4 analyzes the stability of online adaptive error compensation SVM.Simulation results are shown in Section 5. Section 6 draws the concluding remarks.All in all, this paper proves the effectiveness of this method through the simulation results of the quad-rotor system.

Dynamic Model Analysis of Quad-Rotor UAV
The quad-rotor UAV is an underactuated system as it has six degrees of freedom with only four inputs.Pitch movement of quad-rotor UAV is motivated by reducing two motors' speed on either front or back side.And an equivalent increase of the two motors' speed on another side is required simultaneously.
According to the symmetrical structure of quad-rotor UAV, the adjustment mode of the roll movement is similar to the pitch movement.Yaw movement of quad-rotor UAV is realized through reducing one diagonal motors' speed, and equally increasing the two motors' speed of another diagonal at the same time.Based on this theory, the reduced speed on motor torque of the quad-rotor UAV is less than the speed increased; therefore, it makes the aircraft body present in a framework of yaw movement.Three basic movements of quad-rotor are shown in Figure 1.
Two coordinate systems are defined before the dynamic model is established, one for the ground coordinate system and the other for quad-rotor coordinate system.The ground coordinate system is a static coordinate system that relates to a reference ground point.The flight speed and displacement of quad-rotor UAV in different directions are mainly judged by aiming at the ground coordinate system.Pitch angle, roll angle, and yaw angle are mainly considered from the direction of the quad-rotor coordinate system which is based on the geometry center of the aircraft body.The speed of the aircraft under the body coordinate system is described as the following relationship: As shown in Figure 2,  = [, V, ]  is the velocity vector of the plane with respect to the ground coordinate system and [V  , V  , V  ]  is the velocity vector with respect to the quadrotor coordinate system.The transformation matrix  = [ 1 , where  is the pitch angle,  is the roll angle, and  is the yaw angle.According to Newton's second law, the quad-rotor motion equation of ground coordinate system can be written as where the response of quad-rotor UAV produced by gravity is where  is the mass of UAV and  is the acceleration of gravity.Each propeller generates vertical lifting force, so the overall lifting force   will be where the   is lifting force coefficient,  =   (Ω Let  1 =  2 = [0, 0, 1]  ; by taking (3), (4), and ( 5) into (6), then the motion equations of quad-rotor UAV can be written as Attitude foundation model can cooperate with the two coordinate systems from (7) by establishing the aircraft angular velocity.On the basis of conversion relations between the aircraft coordinate system and the ground coordinate system, the following quad-rotor attitude kinematics equation can be got: International Journal of Aerospace Engineering According to the moment of momentum theorem, the aircraft torque equation of mass motion can be derived by Newton-Euler equation: where  = [,,]  is the rotation rate of quadrotor UAV based on the aircraft coordinate system. = diag[  ,   ,   ] means the moment of inertia of quad-rotor UAV.  ,   ,   , and   represent rotor lift, gyroscopic effect generated by the rotor, air resistance torque, and external disturbances torque, respectively. is overall external torque of quad-rotor UAV.
The torque comes from four rotor wings.The relationship between air dynamic torque and four motors' speeds Ω 1 , Ω 2 , Ω 3 , and Ω 4 is where   ,   , and   mean the three-axis torques caused by brush-less motors,  is the distance from the motors to the center of the aircraft,   is the lift coefficient, and   is the torque coefficient.The torque of the gyroscopic effect   is where and   ,   are the rotor moments of inertia that rotate around of the motor shaft.The air resistance torque vector   is where   = diag[  ,   ,   ] and   ,   , and   are moment coefficients of three-axis air resistance in the aircraft coordinate system.Finally (13) can be obtained by

Sliding Mode Controller Design of Unmanned Aerial Vehicle
In this section, the purpose is to carry out the design procedure of basic sliding mode controller.Firstly, sliding surface  is established according to the attitude error that satisfies the necessary sliding condition  ṡ < 0. Secondly, integrate sliding mode control law with equivalent control part and switch control part will be presented.If the attitude angle variation is small and the speed is slow when the aircraft is hovering, a simplification can be made as [ φ , θ , ψ]  ≈ [, , ]  .The quad-rotor UAV attitude model with sliding mode controller can be written as In this equation,  = [, , , , , ]  ,  1 is the first derivative of , and f() is g() is the input matrix, Δf +d = [  ,   ,   ,   ,   ,   ]  , Δf ∈  6 is an uncertainty vector, and d ∈  6 is a noise vector. 1 ,  2 ,  3 , and  4 as the inputs of the quad-rotor are adjusted by four motor rotor speeds.Control input is selected as Then the state tracking error of the system e ()  can be described as follows: where e ()  ∈  6 and  is the factorial number.Sliding surface equation is given by Because  (−) conforms to Hurwitz stable polynomial,   > 0, the sliding mode motion is asymptotically stable.The input includes two parts can be written as where  eg is the equivalent control part and  sw is the switch part for the purpose of suppressing systematic disturbances.
Let k = d + , where  is greater than zero.It can be written as u =  eg +  sw .Similarly,  2 ,  3 , and  4 can be obtained by where   > 0,   > 0, and   > 0. This system will tend toward origin point along the sliding surface  by the action of the sliding mode control inputs.
The sliding mode controller receives the difference between desired position (  ,   ,   ) and the real-time position (  ,   ,   ) of quad-rotor UAV.After calculating the control input  1 , the two virtual control inputs   ,   can be obtained.Virtual controllers are joined into the attitude algorithm module and then the desired attitude angles   ,   are calculated.Further, the desired attitude angles   ,   ,   together with the returned attitude angles , ,  are sent to the attitude control system, where they can be promoted to control the quad-rotor UAV flight attitude.Similar to the sliding mode control design for attitude system, the position errors are defined as follows: Derivation process is similar to (18) and (19) and the sliding mode surfaces (  ,   ,   ) of (, , ) can be got by using the position error and their derivatives.Finally, control inputs  1 ,   , and   are designed, respectively, as follows: According to (22), through the virtual control inputs   ,   to get ẍ , ÿ , thus the desired pitch angle and roll angle are calculated.The inverse equations are given by where where  is the penalty parameter,  is the insensitive loss function, and   ,  *  are the relaxation factors.Lagrange function is established as follows to solve the above optimization problem: where   ,  *  are Lagrange multipliers.According to the KKT (Karush-Kuhn-Tucker) condition, eliminating ,   ,  *  , and , the following SVM nonlinear function can be obtained by According to the KKT condition, a congruent relationship between ℎ(x  |    ) and    can be obtained as follows [26]: And because the sum of Δ  is always equal to zero, According to (31) and (32), it can be found in the support vector set  as follows:  The support vector set is defined as  = { 1 ,  2 , . . .,   }.According to (33), the following matrix can be given by where ) . ( It can change    but cannot change the ℎ of the support vectors set.However, it will alter ℎ for the support vector error set and retain sample set.Assume that  =  ∪  = { 1 ,  2 , . . .,   }; the changes of ℎ can be got from (31), (35), and (36) So every set can be renewed and adjusted to achieve the objective that online SVM learns the noises and the uncertainties of the model through the above equations.Position control system structure diagram of the corresponding sliding mode controller is shown in Figure 3.

Stability Analysis of Online Adaptive Error Compensation SVM
According to (19), (27), and (28), the sliding mode controller is redesigned as Then where   and   are support vector weights of offline SVM and online SVM, respectively.
Theorem 3.For the nonlinear system (14), using the modified sliding mode control law (38), the sliding mode control system is asymptotically stable if the adaptive adjusting law is ẇ = −(x  , x  )  , where  > 0 is the gain parameter of adaptive rate.
Proof.The following Lyapunov function is considered: The derivative of ( 18) is given by Using (14) and letting  = 0, then International Journal of Aerospace Engineering Because ẇ = ẇ *  − ẇ  − ẇ  and ẇ *  = ẇ = 0, the adaptive adjusting law is selected as Then (44) can be written as The boundary value of  is  0 .It can be known that V ≤ 0 if  ≥  0 .Not only the asymptotic stability of the system and the boundedness of w are ensured, but also the system outputs tend to the desired target   .

Simulation Results
To verify the effectiveness of the control method, Matlab/Simulink simulation platform is introduced.This platform is responsible for simulating the position tracking control of the quad-rotor UAV system with multiple flight aim points under the condition of high frequency noises and uncertainties.At the same time, the attitude controller output is recorded.Control goal is to make the position track reference instructions.
First, part parameters of quad-rotor Unmanned Aerial Vehicle are given in Table 1.The sliding mode controller (19) is established by using the offline SVM to predict the model when there are some unknown parameters in the UAV system.Training sample data include the speed of each motor and the aircraft attitude.Sampling period is 0.01 s and 2000 points are taken as training sample data.At the same time, the sliding mode controller is reconstructed by joining online adaptive SVM compensation.There are 30 online SVM training samples and replaced by the new data real-timely.Adaptive parameter  of online SVM is taken as 1.5.
The start point of flight is (0, 0, 0) m and UAV tracks the desired paths   = 10 sin(0.15+ /3) m,   = 10 sin(0.15+  * 5/6) m, and   = 0.5 m.The simulation time is 200 s.Both controllers are joined to the same UAV system under the conditions of existing noise which is equal to 0.4 * sin(50 * ) and 20% uncertainties including mass, inertia, and aerodynamic coefficients.UAV flight path with online adaptive error compensation SVM-based sliding mode control was labeled as  1 , and the flight path with only offline SVM-based sliding mode control was labeled as  2 .The flight path tracking results of two conditions are shown in Figure 4.
And the speeds , V, and  of the quad-rotor are shown in Figure 5.
It can be seen that the UAV with the sliding mode control based on online adaptive SVM compensation can track the path more rapidly and accurately even if there are some noises and uncertainties.It also can be seen that the UAV which joins online adaptive SVM compensation has the good performance from the tracking error.Changes of the position errors   ,   , and   are shown in Figure 6.
The 3D path tracking with two different controllers is shown in Figures 7 and 8.
In order to test the step signal response of UAV with online adaptive error compensation SVM-based sliding mode control, let UAV fly from the initial position (0, 0, 0) m through points (3, 3, 8) m, (12, 7, 8) m, and (13, 14, 8) m in turn.The simulation time is 60 s and position simulation results are shown as in Figure 9.
Figure 9 shows that the UAV with online adaptive SVM compensation reaches the three target points at 9 s, 28 s, and 47 s.And the path without online adaptive SVM compensation is more slow.Three-dimensional path tracking diagrams are shown in Figure 10, Figure 10 As shown in Figure 9, although there are uncertainties and noises, it still can achieve the satisfactory tracking.Good results have two reasons.First, offline SVM and online adaptive SVM used together can establish the model rapidly and the errors will be compensated real-timely even if there are noises and uncertainties.Second, as the adaptive online SVM real-time adjustment method, it will not lead to a decline in tracking performance even if the predictions have deviation or drift.
It can be seen from the results of simulation, whatever, modeling errors, parameter uncertainties or noises do not affect the tracking accuracy of the controller.And the robustness of the controller can be proved.

Conclusion
In this paper, the control problem of quad-rotor UAV system is discussed during tracking the procedure by using the sliding mode controller.To ensure the stabilization and the navigation of UAV with unknown parameters, a sliding mode controller with online adaptive error compensation SVM is presented.Sliding mode controller is established through analyzing quad-rotor dynamics model in which the unknown parameters are estimated by offline SVM.But offline SVM cannot guarantee the precision of model in the process of flight because modeling errors and external disturbances always exist.So the online adaptive SVM method is added for the controller to compensate noises and uncertainties.Control law is adjusted in real-time by introducing new training sample data to online adaptive SVM in the control process and thereby it guarantees the stability and the robustness of flight.
Two experiments about above control scheme are performed.In the first experiment, it can be shown that the control performance with only offline SVM modeling is worse than the control performance with both offline SVM and online adaptive SVM.And the tracking speed is much slower.In the second experiment, the step signal response of UAV is tested with online adaptive error compensation SVMbased sliding mode control.The simulation results also verify its superiority and the better results are obtained in this case.
International Journal of Aerospace Engineering The simulation results demonstrate that the proposed method effectively improves the path tracking performance.They also prove the good performance of online adaptive error compensation SVM-based sliding mode control in a quad-rotor UAV system with noises and uncertainties.

(
−  *  )  (x  , x) + .(27) 3.3.Online Adaptive SVM Error Compensations of Uncertainties and Noises.It is relatively hard to obtain a completely precise estimation of model utilizing the offline SVM once regression.Other uncertain factors such as modeling error and uncertainties in the flight process will also influence the stability of the UAV during the flight.Therefore, this paper combines the online adaptive SVM with offline SVM for compensation of modeling errors which are caused by the uncertainties and noises during the flight process.Define (x) = f() − f(x |   ) + Δf + d, where f(x |   ) represents the estimated value of f() and   =   −  *  .According to the characteristic value x  in the sample data, the predicted value D with respect to the   is given by D (x |    ) =  ∑ =1 (  −  *  )  (x  , x) +   =  ∑ =1     (x  , x) +   , (28) where   ,  *  are the computed Lagrange multipliers of D (x |    ) and    =   −  *  .Then the boundary function of the th sample can be defined as ℎ (x  |    ) =  (x |    ) − D (x |    )  (x  , x  ) +  − D (x |    ) .
size of   (x), it can be divided into the following three kinds of circumstances: support vector error set  = { | |   | = }, support vector set  = { | 0 < |   | < }, and retain sample set  = { |    = 0}.If a new sample x  is added here, parameters Δ  , Δ  can be obtained by computing.Because each sample satisfies KKT condition, the change of available boundary function value is given by

Figure 3 :
Figure 3: Position control system structure for quad-rotor UAV.

Assumption 1 .
Outputs f( |   ) and D( |   ) of offline SVM and online SVM are continuous and bounded.
(a) is the expected route, and Figures 10(b), 10(c), and 10(d) are the actual paths of UAV in the different time points.
2 ,  3 ]  can be denoted as follows: cos  cos  − sin  cos  + cos  sin  sin  sin  sin  + cos  sin  cos  sin  cos  cos  cos  + sin  sin  sin  −cos  sin  + sin  sin  cos means the rotation rate of the th propeller. 1 and  2 are transfer matrices.Air resistance of quad-rotor UAV is expressed as

)
3.2.Offline SVM Modeling of Quad-Rotor UAV with UnknownParameters.Some nonlinear terms and parameters of a quad-rotor UAV are usually unknown, which may disturb the precision of the model.Aiming at the disadvantages of physical model, this paper adopts the offline SVM to establish the quad-rotor UAV model.For a given training sample data set {(x  , f  ) | x  ∈   ,   ∈ ,  = 1, 2, . . ., },  is the number of sample data and SVM prediction function equation can be written as