In this paper,a complete design method of AHRS is proposed for the attitude estimation of carrier.The microprocessor(MPU)is integrated with 9 DOF Micro-electromechanical Systems(MEMS)that include gyroscope,accelerometer and magnetometer.Through the design of software and hardware,the research and development of AHRS is completed.The main work of this paper is as follows:Firstly,the demand analysis of the AHRS is carried out,From the demand to determine the system output attitude angle accuracy,range.The software design scheme of system is proppsed.The microprocessors and sensors are selected according to system volume,power consumption,cost and other factors.Finally,the overall design of system,as well as the system structure block diagram is proposed.Secondly,the method of attitude measurement is analyzed theoretically,and the coordinate system and attitude angle are defined.The performance index of gyroscope is analyzed by Allan variance analysis method.The basic Kalman filter algorithm and the generalized Kalman filter algorithm are derived from the formula,the difference between direct filtering and indirect filtering is studied.The adaptive processing method of the measurement equation matrix and the attitude measurement method of the carrier in the accelerated motion state are proposed,and the attitude verification algorithm is simulated and verified in this paper.Through the analysis of the simulation results to determine the direct method of filtering as the attitude calculation method.Then,the system software design in detail,and a preprocessing method for outputting original data of the sensor is proposed,which effectively improves the sensor output precision.The attitude calculation algorithm of the system is designed by Simulink.The model is optimized and validated by the Simulink advisor.Finally,the attitude and heading reference system engineering realization is designed.And the hardware circuit is designed around the system microprocessor and sensor.Write the underlying drive to the microprocessor of AHRS,and use underlying drive to optimize the efficiency of code execution.Through the Simulink code generation toolbox translate Simulink model to C coder,and the automatic generation of code is integrated with underlying drive.The results of simulation and turntable experiment show that the static error and dynamic error is better than 0.5 and 2,respectively.The AHRS designed in this paper can be applied to a carrier that has a short time to accelerate motion,have certain engineering application value. |