Autonomous Trajectory Tracking Control for a Large-Scale Unmanned Helicopter under Airflow Influence

In this paper, a complete nonlinear dynamic unmanned helicopter model considering wind disturbance is proposed to achieve realistic simulations and teasing out the effect of wind on the control system. The wind velocity vector which is horizontal as seen in the inertial frame can be obtained by subtracting the airspeed measured by atmospheric data computer from the inertial speed measured by GPS.The design of the controller fully considers the existence of wind, and the wind disturbance is suppressed by the method of hierarchical control combined with the integral sliding mode control (SMC). The stability proof is given. Hardware in the loop (HIL) tool is employed as a practical engineering solution, and it is an essential step in validating the new algorithm before moving to real flight experiments.

(1) The unmanned helicopter's dynamic model is inherently unstable, strongly nonlinear, and highly coupled.
(2) The dynamics are significantly different from hovering to high-speed forward flight, and the model may be changing from a minimum phase system to a nonminimum phase system that flies at different speeds.
Robust control such as ∞ control [18,19] is well known for handling internal uncertainties and external disturbances.Since the uncertainties and disturbances are usually supposed unknown, the balance between robustness and conservation is hard to achieve.This problem is especially important when the UH is flying at different speed with strong wind.He and Han use a new acceleration feedback control as a robust enhancement for the ∞ algorithm to attenuate uncertainties and external disturbances involved in the tracking control of an unmanned helicopter [20].Acceleration feedback control does enhance tracking performance significantly compared to the standard ∞ control.However, the ∞ control is conservative as it supposes that the uncertainties are all unknown, which limits the performance of the closed-loop system.If the disturbances are too large, however, the control inputs would become insufficient to alleviate the disturbance fully.
The flight speed of small scale helicopters with stabilize bar is relatively low.Generally, the aerodynamics of the rotor can be ignored, and the linearized mathematical model can be directly applied to design the control law in hovering and near hovering flight conditions [21].But when the UH is flying at high speed and with strong wind interference, a complex model, including blade dynamics, is desired.Blade dynamics must be captured by the helicopter model because of several reasons.Under the conditions of high altitude and high-speed flight, the wind has a tremendous influence on the blade.The flapping motion of the rotor includes a serious nonlinear term, and neglecting the nonlinear term is lack of realism, and it does not have much significance for tuning the gains by using a model that ignores blade dynamics.
The presence of time-varying airflow imposes higher requirements on the accuracy, rapidity, and stability of the trajectory tracking control for large-scale unmanned helicopters, especially when it is flying at high altitude and with long flight time.This paper proposes the following innovations to deal with the problem.
(i) Compared with the linearised mathematical model that was previously used to design the control law, this paper applies a complete and nonlinear helicopter model with a stochastic gust model to design the control law that can resist wind disturbance.
(ii) The design of the controller fully considers the existence of airflow, and the wind disturbance is suppressed by the method of hierarchical control combined with the integral sliding mode control.
This paper is organized as follows: Section 2 describes the UH nonlinear mathematical model disturbed by strong airflow.
Then the control structure and algorithm is presented in Section 3. The experimental results and analysis are given in Section 4. Finally, the conclusion is shown in Section 5.

Complete Nonlinear Model of the Ultrasport 496 Helicopter
The test-bed in this paper is converted from the American Sportscopter Ultrasport 496 (U496) helicopter (Figure 1) [22].The 496 helicopter is equipped with an avionics system, including the onboard computer system, the sensors, and the actuators which generate together the control signals for an automatic flight.

Equations of Mathematical Model.
The helicopter is a vehicle that is free to rotate and translate simultaneously in all six degrees of freedom (DOF), which are defined as rolling, pitching, yawing, surging, swaying, and heaving.The Newton-Euler equations of motion describe the rigidbody dynamics of such vehicles.There exist two reference frames which are generally used to determine the movement of a helicopter: the body-fixed framework and the inertial framework (NED).The equation of motion for the body-fixed reference frame is where   = [, V, ]  is the vector of body velocities, Ω = [, , ]  is the vector of angular rates,  is the helicopter total mass,  is the inertia moment of the body, and   = [  ,   ,   ]  and   = [  ,   ,   ]  are the sum of the external forces and moments acting on the airframe and are determined by where  X ,  Y ,  Z and  X ,  Y ,  Z are the main rotor and tail rotor forces and moments exerting on the body of the helicopter, and the subscripts MR and TR denote main rotor and tail rotor, respectively.The force and moment generated by the horizontal stabilizer, vertical fin, and fuselage are neglected because their impact is relatively small.The forces distribution of different components is where T MR , T TR are thrust of main and tail rotors,  MR and S MR are backward and lateral forces generated by the main rotor when flying forward, M K and M K.TR are the main rotor torque and tail rotor torque, respectively,  lon and  lat are the pitch and roll cyclic, and x tg , z mg , z tg are the corresponding distances shown in Figure 2.
The differential equations in (1) is the rigid-body equations, the forces and moments acting on the body are contained in these equations.Further, the inertial position (, , ) and the Euler angles (, , ) can be calculated using suitable transformations.Solving the following three differential equations provides the inertial position from body velocities: where  * and  * denote cos * and sin * .Finally, to determine the Euler angles from angular rates, we use the following transformation: φ = p + tan  sin q + tan  cos r θ = cos q − sin r ψ = sin  sec q + cos  sec r According to [23][24][25][26][27], the force and moment expressions acting on the U496 helicopter are given directly in Appendix A. The results of many times real flight tests prove that the helicopter model uses these expressions to simulate real flight well, and the similarity is more than 60%.This makes sense for studying the impact of wind on flight control systems.

Wind Model and Its
Application in the UH Model.For a specific real flight test, the wind model was established with reference to airflow velocity, inertial velocity, trajectory, heading, and inertial navigation information.

Establishment of the Wind Model.
The waypoint position information of a real flight is shown in Figure 3.The properties of the helicopter passing through each waypoint are shown in Table 1.The information of each waypoint is set as follows: waypoint number, longitude, latitude, altitude, speed, and heading angle.The UH first took off from the waypoint 0 and climbed to a height of 20 meters, then passed through the waypoints 1 to 13, and finally landed at the waypoint 14.The geodetic coordinate system adopts the North East Down (NED) coordinate system with an initial heading of 220 degrees.The red point in Figure 3 represents both waypoint 0 and waypoint 14.
The calculation of the wind velocity: the air velocity is calculated from the pressure data measured by the pitot tube through the atmospheric data computer, which is shown in Figure 4.The inertial speed   is measured by the Differential Global Positioning System (DGPS) which is shown in Figure 5.The air velocity   is the body's relative velocity to the wind.Thus the wind velocity   is obtained by subtracting the air velocity   from the inertial speed   which is  shown in Figure 6.The numbers in these figures represent waypoints.Figure 7 replaces Figure 6 with a representation of the wind velocity at which the helicopter passes through each waypoint.
The wind direction setting: on the day of the real flight, the helicopter was disturbed by a 5th-level southwesterly wind.According to the flight results, the wind direction is set as shown in Figure 7.The wind direction between the waypoints varies randomly between the set wind direction of the previous waypoint and the next waypoint.
In this way, we set up a stochastic gust model, in which the wind velocity and direction are always changing according to the real flight test.
Note 1.The airflow direction measured by the pitot tube through the atmospheric data computer is facing the head of the UH, and the direction of the real-time wind is completely unmeasurable, so the magnitude of the wind applied to the helicopter model is modified accordingly based on the real flight data.Adjustments bring the simulation curve closer to the actual flight curve.

External Wind Disturbances Exerted on the UH.
Since the aerodynamic forces are functions of the air velocity   , the helicopter model subjected to wind disturbance requires the body's relative velocity  and the wind velocity   as control inputs.In the near hover situation, the aircraft air velocity can be expressed by adding the effect of a wind velocity vector which is horizontal as seen in the inertial frame in the form where   is the velocity of the horizontal wind and   is the direction of the horizontal wind.Since there are so many variants such as inflow ratio

Control Structure and Algorithm
The flight control system is designed as two parts: (1) path planning layer and (2) kernel control layer; the overall hierarchical structure is shown in Figure 8.

Path Planning Layer.
The UH requires a series of waypoints to fly according to the preset flight route.However, in long-haul flights, a path that uses a large number of discrete points is not suitable for autonomous flight systems because it requires a large amount of memory to save all the waypoints.Thus B-Spline describing the route using a finite set of control points and knots is applied to the route generation process.By adding and deleting the spline curves in a stepwise manner, the memory space can be effectively utilized to achieve realtime control effects.

B-Spline Curve.
A spline curve represents the sequential curve segments that are connected to create a single continuous curve.A B-Spline is a type of representation of a spline curve constructed by control points, knot vectors, and basic functions.n+1 control points are selected in the inertial coordinate system, and a spline curve C(u) generated by the n+1 control points is used as a preset route of the UH.The B-Spline curve C(u) is described using the parametric spline equations, as shown in where  is the order of the spline,   ( = 0, . . ., ) are the control points, and  is the parameter of the spline.The control points define the convex hull of the spline curve.Therefore, the spline curve begins from the first control point and ends at the last point, within the convex hull.The knot vector  is described as  = [ 0 ,  1 , . . .,  +−1 ,  + ], where the elements set of  are a nondecreasing sequence of real value.To fix both the endpoints of the spline curve to the start and end of control points,  0 and   , the first and last set of knots are repeated  times with the same value as follows: where   and   are the parameter values of the start and endpoint of the spline, respectively. , () is the basic function of the curve with order p and can be described with the following equation:  where  = 1, 2, . . ., .Using the spline parameter  we divide the spline into equal intervals, and the spacing is approximately equal to 30 meters.These equally spaced points on the spline will be used as the trajectory reference point (  ,   ) for the UH.
In the next subsection, we will explain how to obtain the projection point  on the B-Spline curve which is closest to the UH real-time position (, ) and how the reference point is given.

Position Reference Generation.
According to the UH real-time position (, ) measured by GPS during flight, the iterative method is used to find the closest point (  ,   ) on the B-Spline curve.Project the current real-time position  to the preset trajectory to obtain the projection point (  ,   ).Then, a certain buffer distance is added along the direction of the B-Spline curve with reference to the point , and the virtual future point thus obtained is regarded as the position tracking reference point .As  moves continuously forward on the B-Spline curve, the UH gradually flies toward the B-Spline curve under its guidance.As shown in Figure 9, the specific implementation steps are as follows.
( (2) Suppose  1 is the closest point (  ,   ); thus  =  1 .According to the spline parameter   of point (  ,   ) and combining the UH heading  and the heading   of point (  ,   ), the increment of  of the projection point  relative to   is obtained by trigonometric transformation (3) Thus the spline parameter   of point (  ,   ) is   =   + Δ 1 .Then adding a certain buffer distance from point  to point , the spline parameter of the point  is   =   + Δ 2 , where Δ 2 is determined by the speed of the UH.
(4) Based on the spline parameter   of point , the corresponding position coordinates are calculated as the position tracking reference point (  ,   ) according to (7).

Kernel Control
Layer.The helicopter's kernel control layer uses a cascade control structure combined with the PID method and sliding mode control strategy.The attitude and angular rate loops are considered as the inner loops, while the speed and position loops are considered as the outer loops.
In the cascade control method, the control output of the upper subcontroller is the control reference of the lower subcontroller.By looking for a strong correlation state between the upper and lower layers, that state is taken as the virtual output of the upper subcontroller, that is, the virtual reference of the next subcontroller.According to this idea, the strong correlation states , V,  are chosen as the virtual output of the position controller, while the strong correlation states , ,   are selected as the virtual output of the velocity controller.
The roll, pitch, and heading channels in the inner loops adopt feedback control, while feedforward control is also used between the heading and altitude channels and between the roll and pitch channels to suppress the state coupling.Through multiple flight tests, it has achieved an excellent decoupling control effect for the inner loops.Thus the traditional PID controller is used for the inner loops here.
The focus of this paper is to resist the disturbance of the wind and complete the trajectory tracking flight mission at a constant speed.To accomplish this task, the SMC algorithm is used for the multiple inputs and multiple outputs system of the outer loops.1) and ( 4), the position error tracking subsystem and the speed error tracking subsystem in the outer loop are rewritten as follows.

Error Tracking System of the Outer Loop. Based on (
(1) Position (pos) error tracking subsystem: where During the constant speed flight of the helicopter, since the heading is controlled by the inner loop, the output   is the given speed.The role of the position controller output V  is to eliminate the lateral deviation.
(2) Velocity (vel) error tracking subsystem: where Because the gravity is much larger than the forward and lateral components of the rotor lift, we consider  sin  as the dominant term of the forward component force  X and  cos  sin  as the dominant item of the lateral component force  Y .And  X.MR +  X.TR and  Y.MR +  Y.TR are treated as the minor items.According to the observation, , ,   are selected as the states strongly correlated with the upper and lower layers.Thus,  and  in  sin  and  cos  sin  can be regarded as virtual reference to the next layer.

Decoupling Control Method Considering Wind Disturbance.
To maintain constant speed flight in the longitudinal channel, the use of integral sliding mode control is a very good solution.According to the above error tracking system, we design the sliding mode controller as follows.Step 1.For  V or   , the switching surfaces  are designed as where  =   ,  = diag {  ,   ,   }, () = [  ,   ,   ]  in the position subcontroller, while  =  V ,  = diag {  ,  V ,   }, () = [  ,  V ,   ]  in the velocity subcontroller.
Step 2. The approaching law of the sliding mode control method is where  = diag {  ,   ,   } in the position subcontroller, while  = diag {  ,  V ,   } in the velocity subcontroller.
It should be noted here that in the velocity subcontroller, the roll angle  and the pitch angle  have a coupling effect on the speed of the UH.From the perspective of decoupling, it is necessary to set the calculation order of the three control outputs in  V .First, we solve the differential equation of forwarding velocity to get   .Then   is solved in the lateral velocity differential equation by   .Finally,   and   are substituted into the vertical velocity differential equation to obtain   .In this way, it is possible to reduce the coupling between the longitudinal and the lateral directions while maintaining the speed constant.At the same time, because the wind disturbance is introduced in the calculation of aerodynamic force, the controller has a good effect of suppressing wind disturbance.

Experimental Results
In this section, two sets of experiments are performed on the HIL simulation platform of the U496 unmanned helicopter, which is the experimental verification of the PID control strategy and the new flight control strategy on the mathematical model.The purpose of Scenario 1 is to tease out the effect of wind on the control system by the comparison with and without wind in a simulation compared to real flight test results.The purpose of Scenario 2 is to verify the new flight control law is better able to improve disturbance rejection compared to the PID control strategy.The HIL simulation platform is shown in Figure 10.

Scenario A: HIL Flight Test with and without Wind by Using PID Control.
According to the test data after a real test flight, we adopt the newly developed nonlinear mathematical model and reshow the entire flight process by applying a wind disturbance to the model.In the process of HIL simulation, the three-dimensional flight trajectory of unmanned helicopters flying following the planned flight path is shown in Figure 11.The maximum given speed is 20m/s, the maximum flying height is 600m, and the turning angle of the route is 45 ∘ , 90 ∘ , and 135 ∘ .The waypoint number information is shown in Figure 3. Since the size of the XY coordinate is much larger than the size of the Z coordinate (height), to enhance the three-dimensional effect, we enlarge the Z coordinate by a factor of 2, and the actual flying height is shown by the blue curve in Figure 11.To fully reproduce the real flight test, we set the size and direction of the wind during flight simulation following Table 1 and Figure 7.
To show the effect of wind disturbance on the model, we conducted simulation tests in both windless and windy conditions and compared them with real flight data.The PID control gains for the three tests are all shown in Table 2.The simulation results are shown in Figures 12-20.
By putting the nonlinear mathematical model into the simulation computer and according to the predefined simulation content, we conducted a large-range flight simulation of the Ultrasport 496 UH.In the simulation process of up to 2200 seconds, there was no case where the model was stuck, or the model was out of control under the disturbance of wind, indicating the reliability of the newly developed nonlinear model and the control strategy.The test data of the U496 unmanned helicopter for large-scale flight simulation is similar to that of the real test flight.The net result is the ability to tease out the effect of wind on the control system,  which is a crucial contribution of this work to bring out and make as useful as possible.
From the simulation results, due to the presence of wind disturbances, the forward flight speed has a significant deviation, and it has not been able to maintain constant flight speed.The yaw distance is usually within 10 meters, and the maximum is 22 meters.The PID control strategy used in this section can resist the disturbance of the wind in the case of different turning angles and speeds and achieves the fit of the flight path and the set route.However, there is still a specific gap between the simulation results and performance index.3. We compare them with the control strategy that uses a set of PID control gains and test whether the control law meets the following performance index: speed error 0.5m/s, lateral position error 20m.The results are shown as follows.
In the two-dimensional plan of the yaw distance shown in Figure 21 that have more considerable side-offset distances in actual flight.As can be seen from these figures, the new control law corrects the lateral offset at these typical positions and obtains an accurate tracking effect.Figure 22 is a speed variation curve during autonomous flight.By comparison, we have found that using the new control law improves the helicopter's constant speed flying effect significantly at different speeds of 20m/s and 10m/s and 1m/s.As shown in Figure 23 the pitch angle is limited during the forward flight.This is why the helicopter's speed still has an error of about 0.5m/s when flying in the top wind of 1400 to 1800 seconds.
Compared with the ordinary sliding mode control methods which uses the symbol function as the switching term [27], this method can eliminate the chattering phenomenon by using Tangent function.Thus the servos will not be damaged due to the chattering problem during the execution.
As shown in Figure 7 can be established in real time.Although the wind model is called static, it is also time-varying.Therefore, this paper has proved that our SMC method has the ability of effectively suppressing time-varying wind disturbance through HIL simulation experiments.How to build a test platform to build a dynamic wind model becomes the work we will focus on in the next step.

Conclusions
In this paper, a trajectory tracking flight controller is proposed for unmanned helicopters in longtime flight.Wind disturbances are captured by the helicopter nonlinear mathematical model to reproduce the effects of disturbance during a real flight.According to the real flight data and measured airflow, the proposed control strategy can consider the wind disturbance as a known state to study the optimal control effect against the wind disturbance for different given speeds.The hierarchical control law combined with the integral sliding mode is expected to provide the reference for the new trial flights of unmanned helicopters at a fixed speed.
Thus   can also be expressed in a simplified form: Similarly, two parts of the main rotor lateral force can be expressed in ( 14) and (15). (

Figure 7 :
Figure 7: Wind vector at the waypoints.
x,y,z u,v,w p,q,r

Figure 8 :
Figure 8: Structure of the overall autonomous flight control system.
) Calculate the distance  between the equidistant point on the spline curve and the point (, ) from the initial point (  ) one by one.The iterative calculation ends until the point  1 that makes  1 = √ (  − ) 2 + (  − ) 2 < 40 meters found.Find the next point  2 along the direction of the B-Spline from point  1 .The distance between  2 and  is  2 .If  2 <  1 , select  2 as the closest point (  ,   ); otherwise select  1 .The spline parameter corresponding to the closest point (  ,   ) is   .

Figure 9 :
Figure 9: Schematic diagram of projection point  and reference point .

Figure 10 :
Figure 10: Hardware in the loop simulation platform.

Table 2 :
PID gains and Trim values used in the real flight and HIL simulation test.

Table 3 :
PID and SMC gains used in the HIL simulation test.