| With the UAV application in many fields, more demands are brought up on the UAV. As the "brain" of the flight control system, it also gets more attention. Flight control software is an important part of the flight control system. Its performance is directly related to the flight safety of UAV. Therefore, the flight control software is not only designed to meet the basic flight capabilities, but also to improve the safety performance of the software.This thesis was put forward on the basis of the research background and actual project requirement.Firstly, this paper designed and developed the flight control software on the basis of small fixed-wing UAV with the modularized design. This could ensure the software can be maintainable and expansible. At the same time, considering the requirement of dynamic multi-task operation and memory protection, the rotation of reading and writing with data area was designed to solve the conflict that different module read and wrote with the same data area. The software watchdog was designed to avoid the system halted.These can ensure the reliability of flight control software.Secondly, according to the configuration of flight control computer, this paper completed the target hardware initialization, serial port, PWM, AD and DIO driver. After completing the drive- environment, the different tasks and priorities were assigned. With the comprehensive consideration on the function and performance of flight control software, the software was divided into nine tasks, such as sensor task, control task, remote telemetry task and guidance task to realize the autonomous navigation, instruction navigation and manual navigation. Otherwise, the tasks were dispatched by the event-trigger to switch different flight mode smoothly.Thirdly, aiming at the configuration of airborne equipment, the software designed the failure-handling logic of the sensor information-failure and the monitor-link failure. According to the communication status, data security range and monitor-link condition, the failure-handling logic on the attitude source, location source and monitor-link is designed to ensure the flight safety of the UAV.Finally, the semi-physical simulations are carried out to test the sensor failure, monitor-link failure and functions of flight control software in the real-time simulation environment. The results show that flight control software meets the flight control requirements of small fixed-wing UAV. |