Flight Tests of Autopilot Integrated with Fault-Tolerant Control of a Small Fixed-Wing UAV

A fault-tolerant control scheme for the autopilot of the small fixed-wingUAV is designed and tested by the actual flight experiments. The small fixed-wing UAV called Xiang Fei is developed independently by Nanjing University of Aeronautics and Astronautics.The flight control system is designed based on an open-source autopilot (Pixhawk). Real-time kinematic (RTK) GPS is introduced due to its high accuracy. Some modifications on the longitudinal and lateral guidance laws are achieved to improve the flight control performance. Moreover, a data fusion based fault-tolerant control scheme is integrated in altitude control and speed control for altitude sensor failure and airspeed sensor failure, which are the common problems for small fixed-wing UAV. Finally, the real flight experiments are implemented to test the fault-tolerant control based autopilot of UAV. Real flight test results are given and analyzed in detail, which show that the fixed-wing UAV can track the desired altitude and speed commands during the whole flight process including takeoff, climbing, cruising, gliding, landing, and wave-off by the fault-tolerant control based autopilot.


Introduction
Unmanned aerial vehicle (UAV) is one kind of aerospace system which has been widely applied in military and civil fields, such as surveillance, attack, fire alarm, and even express delivery.UAV is composed of several parts, in which the flight control system including autopilot and guidance devices is the key part.
Considerable research has been done on autopilot hardware design, attitude control, altitude control methods, and so forth.Pu et al. briefly surveyed the development of UAV and its subsystems including autopilot, ground control station, and navigation system.UAV flight control methods were also summarized [1].He et al. designed an autopilot based on FPGA with embedded Linux system [2].Tu and Du designed an autopilot hardware system based on DSP [3].Most of UAVs use low-performance MEMS sensors as parts of their autopilots because of the limitation of production cost, which increases the probability of fault on these kinds of devices.Zhen et al. designed longitudinal and lateral controllers based on information fusion optimal control [4,5].Simulation was implemented on a nonlinear alterable thrust direction UAV, which showed that information fusion-based optimal control improves the anti-wind disturbance performance, better than traditional single-loop method; however, this method was not verified by real flight tests [4,5].Matveev et al. applied sliding mode control theory on the guidance and control of unicycle-like vehicle; considering obstacle avoidance, simulation results indicated the efficiency of the proposed algorithm in border patrolling and obstacle avoidance [6].This method is also suitable for applications of other UAVs; however, faulttolerant problem was not considered in the controller design.Yamasaki et al. implemented high-order sliding mode differentiator on the estimation of uncertain sliding surfaces and did some simulations on YF-16 model, and results showed that the second-order sliding mode controller provided excellent path-following performance under the wind turbulence circumstance [7].Cayero et al. built a thorough model of TX-1570 and designed a nonlinear controller based on adaptive backstepping control theory, and the simulation showed that the flight-path error of longitudinal path traditional is small enough [8].But fault of sensors was not considered in this paper, and flight test was not carried out.
Health monitoring is responsible of detecting, isolating, and identifying the faults, failures, and upsets in related systems.As an extension, fault-tolerant control is a health management technique.The main role of the fault-tolerant control is to accommodate different faults and failures and aid the overall system in achieving high level of safety and reliability over the lifetime of the system.Fault-tolerant control is very important to the autopilots of UAVs.Some researches on UAV fault-tolerant control theory have been done in recent years.Jourdan et al. demonstrated in-flight MRAC-based inner-loop attitude control in the presence of severe structural faults on UAV in Rockwell Collins Control Techniques [9].Bateman et al. developed the multiple model adaptive estimation for sensor and actuator faults and simulated a nonlinear model of aircraft with aileron and rudder failures [10].Reference [11] used West Virginia University UAV simulation environment to verify the nonlinear dynamic inversion approach augmented with an artificial immune system in autonomous UAV flight in the presence of disturbances and actuator failures.Reference [12] gave the flight-test results of fault-tolerant guidance and control algorithm on the GT Twinstar of Georgia Institute of Technology, under the actuator failures and severe structural damage conditions.Reference [13] designed fault-tolerant controller for a tiltrotor UAV for actuator and sensor faults.The fault-tolerant federated Kalman filter presented in this paper guaranteed the accuracy and robustness of state estimation.At last, numerical simulation was implemented to prove that.Neural control was used in [14] for auto-landing when aircraft is subjected to actuator faults and severe winds, and simulation showed that the neural controller based Single Hidden Layer Feedforward Networks (SLFNs) can achieve safe landing and track reference signals well under actuator failure.But neural controller needs much calculation, which is difficult to implement on MCU.We noticed that most of the faulttolerant control designs are focused on numerical simulation rather than actual flight tests.Besides, some advanced control theories need a great deal of calculation, which is difficult to implement on autopilot of UAV.
In this paper, we design a fault-tolerant flight control system for an open-source autopilot and give the real flight tests on a small fixed-wing UAV called Xiang Fei, which is developed by Nanjing University of Aeronautics and Astronautics.This fault-tolerant flight control system consists of autopilot, real-time kinematic (RTK) GPS navigation system, and ground control station.For the proposed fault-tolerant control scheme, a sensor redundancy strategy guarantees the robustness of controller, and a failure detection algorithm and a fault-tolerant control algorithm are integrated in altitude control and speed control.The open-source autopilot is Pixhawk [15].Compared with the original Pixhawk autopilot, we improve the position and altitude measurement using RTK GPS.Finally, the fault-tolerant flight control system is tested on a small fixed-wing UAV to prove the reliability and stability of the initially developed autopilot, which is rare in current researches.

Independently Designed Small Fixed-Wing UAV
Small fixed-wing UAV is widely used in military and civilian applications, including search, monitoring, mapping, and earthquake rescue, because of its flexibility and low cost.Many universities and companies have been doing a mass of researches on fixed-wing UAV, including attitude control, trajectory tracking, and fault-tolerant control.Figure 1 shows a small fixed-wing UAV named Xiang Fei.The details about this aircraft are shown in Table 1.The purpose of designing this UAV was to do research on autonomous flight, including auto-takeoff, path tracking, and auto-landing on moving platform or ship with high accuracy.The small fixed-wing UAV is low-cost and has high performance.is the only sensor to measure altitude of UAV in Pixhawk, which leads to poor accuracy of altitude.Sensor failures are not considered in the software of Pixhawk.Hence, several improvements on hardware and software will be given in the following.

Hardware Design of Autopilot.
Pixhawk contains kinds of on-board sensors, such as low-cost 9-DOF AHRS, barometer, and electronic compass.However, the accuracy and stability of on-board sensors are usually not high enough for UAV flight.Besides, sensor failures have not been considered.
To solve these problems, a real-time kinematic (RTK) GPS is integrated in the proposed fault-tolerant flight control system.RTK operation provides centimeter-level accuracy by eliminating errors that are presented in the GPS system.The RTK GPS system contains the base station and the rover station.The base station is placed at ground or moving platform.At the same time, both receivers track the same satellites, and then the message of position corrections of the base station is sent through a radio link to the rover receiver, where these messages are used to calculate the real-time positions of the rover.Figure 2 shows the principle diagram of the whole hardware system.RTK GPS base station is placed on a moving platform where the UAV is expected to land.A pair of radios is used to transmit position corrections for RTK GPS.Pixhawk and RTK GPS rover station are placed on the fixed-wing UAV.Another pair of radios is used to transmit flight data from aircraft to the ground control station.initialization, variables initialization, and flight mission reading.Then an endless loop will be carried out after the setup function.The endless loop contains sensors read function, flight controller logic calculation, and servos output function.TECS controller is used for altitude control and speed control, which will be detailed in the next section.

Improved Guidance and Control System of UAV.
In this section, the longitudinal guidance and lateral guidance are redesigned to improve the flight control performance of the UAV.
Total energy control system (TECS) [17] is used in Pixhawk to track altitude and speed commands.Altitude control and speed control are coupled in TECS controller.There are about 20 parameters in TECS controller of Pixhawk.Some parameters have influence on both the altitude and the speed of the UAV, so it is hard to choose proper parameter values due to coupling, especially for the small fixed-wing UAV.To solve this problem, The TECS is replaced by the separate PID control system for altitude and speed tracking, and the parameter of each PID controller can be tuned separately.
The lateral guidance law of Pixhawk uses  1 control algorithm [18].The  1 control method is good at trajectory tracking when following curved paths. 1 controller selects a reference point on the desired trajectory and generates a lateral acceleration command using the reference point; then the desired roll angle can be obtained using lateral acceleration command through specific transmit formulation.For straight line path tracking, the reference point is on the desired path at a distance ( 1 ) forward of the UAV, as shown in Figure 4.
To decrease the cross track error , shown in Figure 4, the UAV should have lateral acceleration.The desired lateral acceleration can be determined by where  is the airspeed,  is the angle between vector  and direction from position of UAV to reference point, and  1 is the distance between the position of UAV and reference point, which can be determined by where  and  are damping and period, respectively, which can be adjusted by the users.The angle  can be calculated by where  is the cross track error and  and  are the previous position and next position of desired flight path, shown in Figure 5. Vector   →  can be obtained by GPS location of positions , .
Then, to obtain desired lateral acceleration, the UAV should roll.The desired roll angle can be obtained by where  is the acceleration of gravity and   can be obtained by combination of ( 1)-( 3).The desired path is generated by connecting each independent position directly for Pixhawk, without any smooth.In the case of sharp turn, for example, in Figure 5(a), the switch of path from  to  will lead to sudden large change of desired roll angle calculated by  1 controller.To fix this problem, we redesigned the desired flight path through adding a coordinated turn stage (line ) between the adjacent line paths, shown in Figure 5(b).
The desired roll angle in coordinated turn can be determined by where  is the radius of turning.The desired roll angle is easy to calculate when the desired radius of turning is known.

Fault-Tolerant Control Scheme for Xiang Fei UAV
4.1.Fault-Tolerant Design for Altitude Controller.Barometer is the unique altitude sensor of Pixhawk.However, the barometer sensor is very sensitive to temperature and atmospheric turbulence, which makes it difficult for altitude tracking and auto-landing with high accuracy.In this paper, we use RTK GPS as the source of altitude data.The accuracy of RTK GPS system can reach centimeter-level; however, RTK GPS system sometimes is affected by communication problem between base station and rover station.When failure occurs in any of the transmitters of RTK GPS receivers, the rover GPS station cannot receive correction messages, which will cause the UAV crash.To fix this problem, we introduce the data fusion scheme for the information of RTK GPS height and barometer height.Thus, the new structure of height controller is shown in Figure 6.
The RTK GPS device used here is Novatel OEM 617.The rover station can output 10 Hz of relative altitude at the frequency of 10 Hz when it works normally; when failure occurs in the communication between base station and rover station, the rover station will not output any data of relative altitude, so we will know whether the RTK GPS is working normally, so we can deal with communication fault when failure occurs.
Although the barometer sensor will generate drift in long time, the instantaneous rate of change of barometer altitude is accurate.So we can use this data as a compensation of RTK GPS altitude when failure occurs on RTK GPS.The faulttolerant design is the following: let autopilot store barometer altitude and RTK GPS altitude in the same time; when RTK GPS failure occurs, we can calculate an estimation of real altitude based on normal RTK GPS altitude measured before communication fault and barometer altitude rate.The calculation formula is where  est is the estimation of real altitude,  GPS is the RTK GPS altitude measured before failure,  rate is the barometer altitude rate, and  is the duration of failure time.
When RTK GPS works normally again, we change to use normal RTK GPS data in altitude controller.A firstorder filter is used to reduce the influence of switch between estimation altitude and RTK GPS altitude.

Fault-Tolerant
Design for Speed Controller.The speed control of UAV is very important; because the lift force of UAV is related to the airspeed, sufficient airspeed provides enough lift force for flight safety.Airspeed sensor is usually influenced by electromagnetic interference or block of pitot tube of airspeed sensor.Therefore, it is important to design fault-tolerant control for airspeed sensor failure.
To detect airspeed sensor error, we use GPS speed and airspeed to calculate the wind speed.When wind speed is much larger than the real wind speed, which can be measured by special instrument, that means airspeed sensor is not normal.We use GPS speed as the compensation for airspeed.Figure 7 shows the structure of the fault-tolerant airspeed controller.The difference value between airspeed and GPS speed is input into data fusion.When the speed error is larger than current wind speed which is set by UAV pilot, we change to use GPS speed as the current speed of UAV; otherwise, airspeed sensor data will be used directly.A one-order filter is used to reduce the fluctuation of speed signal switch.

Flight Test Results and Analysis
The fault-tolerant flight control system is tested on the small fixed-wing UAV called Xiang Fei, shown in Figure 1.The tests contain the whole flight process from the takeoff, climbing, cruising, gliding, and wave-off to the auto-landing.Particularly, the UAV is required to land on a moving platform at the speed of about 2 m/s, which increases the difficulty for flight control.Figure 8 shows the UAV in flight tests.Figure 9 shows the altitude tracking of entire flight process, including takeoff stage, climbing stage, and landing stage.We can see that the UAV can track the altitude commands very well in the whole flight stages.The error is a little large only on the takeoff stage (at 100 s) and wave-off stage (at 360 s), when insufficient power causes the UAV to climb too slow to track the climbing command.The altitude error is less than 1 m at the auto-landing stage, which is small enough to ensure the UAV landing on specified point of the moving platform.
Figure 10 shows the altitude error in an auto-landing flight test.The altitude error average is about 0.3 m, which is accurate enough for auto-landing.The fluctuation of altitude error may be due to noise of GPS signal.
Figure 11 shows the airspeed and GPS speed of UAV.The desired cruise airspeed is 22 m/s.We can know that the speed keeps stable in the whole flight process.There is some drastic change on airspeed, due to stochastic disturbance on airspeed sensor, which can be weakened by low-pass filter.The GPS speed only has a small difference from airspeed because of the influence of wind.
Figure 12 shows the roll angle tracking of UAV during turning.The error is small enough to guarantee good performance of lateral path tracking.Besides, the maximum roll angle command generated by autopilot is less than 35 ∘ , due to our improvement on lateral controller.

Conclusion
A fault-tolerant flight control system based on Pixhawk for a small fixed-wing UAV is designed to control the UAV flight with high performance against the sensor failure.The faulttolerant schemes of the altitude controller and the speed controller can ensure the UAV flight normally in case failures occurred on RTK GPS or airspeed sensor.The separation of altitude control loop and speed control loop is suitable for the small fixed-wing UAV.The improvement of lateral guidance

Figure 2 :
Figure 2: Principle diagram of UAV hardware system.

Table 1 :
Parameters and performance of Xiang Fei UAV.