Abstract:An UAV Attitude Control System based on least squares fit and quaternion expand Kalman filter estimation scheme is proposed. Firstly, the physical model of triaxial magnetometer is established, the least squares fitting algorithm is used to estimate the disturbance vector magnetometer, and then the accelerometer is used to tilt compensation magnetometer. Finally, the 3D pose of the aircraft is estimated by expanding the Kalman filter fusion accelerometer, gyroscope and magnetometer data. The test results show that the maximum linearity error of the azimuth is 4 °, tilt angle is 40 °, the maximum azimuth error is 2.6°, and in static placement, the maximum static deviation of roll angle, pitch angle and azimuth is 0.215 °, 0.103 ° and 0.464 ° respectively.