| In recent years, the small UAV has become a new research hotspot, and its application prospect is very broad in the military and civil fields. Therefore, this paper aims at the design of the hardware circuit and the attitude algorithm of the small UAV autopilot.First of all, This paper analyzes the research background and significance of the subject, and then introduce the research status of the UAV autopilot at home and abroad and the development of multi-sensor data fusion technology. The main research contents are summarized in this paper.Secondly, based on the analysis of the overall design scheme of the small UAV autopilot system, this paper introduces the principle of the UAV autopilot, and analyzes the design requirements. Based on the design requirements, the hardware platform and software drive scheme design are completed.Thirdly, the paper introduces the design scheme of the hardware platform and driving software of the small UAV autopilot in detail. Lists the detailed circuit schematic and design principle of the core control module, power module, AHRS module, wireless communication module and servo drive module; and then briefly introduces the PCB and electromagnetic compatibility design scheme; finally, this paper complete the software design of the UART interface, SPI interface, I2 C interface and PWM output.Fourthly, this paper introduce the theoretical basis of attitude algorithm which include the definition of coordinate system, coordinate system conversion, attitude update algorithm, etc.;and then complete the error calibration and compensation of the MEMS inertial sensor. Finaly, this paper presents one design algorithm of an attitude and heading reference system(AHRS) based on Gauss Newton and Complementary Filtering algorithm(CF). The algorithm uses quaternions represents rotations and uses data measured from the MEMS sensor converts angular rates into quaternion rates, which are integrated to obtain quaternions.The GaussNewton iteration algorithm is utilized to find the optimal quaternion that relates the measured accelerations and earth magnetic field in the body coordinate frame to calculated values in the earth coordinate frame. Then fuse the optimal quaternion with the quaternion updated from gyroscope and calculate the attitude angle based on the complementary filtering algorithm.Finally, this paper test the whole system of the small UAV autopilot. Based on the open source upper monitor system to test the hardware platform, including power supply test, sensor test and PWM output test; Design verification experiment(simulation experiment and physical experiment) to verify the feasibility and accuracy of the attitude algorithm. Extensive experimental results have proved that the small UAV autopilot hardware platform and the attitude algorithm can meet the requirements of the aircraft. |