Abstract:Miniature attitude and heading reference system (AHRS) incorporates tri-axial magnetometer, accelerometer, and gyroscope to achieve three-dimensional attitude measurement. It has be widely used in flight control of unmanned aerial vehicle and other related fields for. However, AHRS uses gravity vector to calculate pitch and roll angles, and thus will have errors caused by motion acceleration. Existing algorithms for motion acceleration elimination essentially rely on gyroscope, and may cause accumulative errors when affected by persistent motion acceleration. A novel algorithm is proposed to improve the dynamic performance of extended Kalman filter, which utilizes optical flow sensor to measure and compensate motion acceleration, while estimates gravity and geomagnetic vectors in parallel. Experiment shows that with the impact of horizontal acceleration, attitude error of the proposed algorithm can be 50% lower than existing methods, and thus it can significantly enhance dynamic attitude accuracy.