| MEMS heading and attitude measurement systems are very popular in practical applications due to their low cost,low power consumption,small size,and easy measurement.However,due to the interference of the external environment,the errors generated by the measurement device itself,and the accumulation of errors over time,Which often leads to situations where the output data cannot meet the accuracy requirements.Therefore,using the characteristics of relatively stable geomagnetic field,fast response speed of the magnetometer,attached attitude information and no error accumulation,the drift phenomenon of the gyroscope can be compensated by magnetic field information,which can greatly improve the accuracy of attitude measurement.The MARG sensor is a sensor composed of a three-axis MEMS(Micro-Electro-Mechanical System)gyroscope,a three-axis accelerometer and a three-axis magnetometer.Its essence is the complement of the inertial measurement unit IMU(Inertial Measurement Unit)and the magnetometer.The combination is widely used in micro-electromechanical heading and attitude measurement systems.When there is external magnetic field interference,there will be errors in the output of the magnetometer,which will lead to errors in the results of the attitude calculation.In order to solve the problem of magnetometer compensation and correction and the fusion of accelerometer,gyroscope and magnetometer measurement data under the condition of magnetic field interference,this paper mainly conducts the following research:First,to solve the problem that the traditional magnetometer calibration method is greatly affected by gross errors,an improved magnetometer calibration algorithm is proposed.Through the analysis of the causes of the magnetometer error,a comprehensive error compensation model of the magnetometer is established;the ellipsoid fitting algorithm based on the least square method is analyzed,and an improvement is proposed for the problem that the gross error has a greater influence on this algorithm.This improved algorithm uses the normal distribution to reduce the gross errors in the data,and optimizes the data through multiple iterative calculations;then,it is verified and analyzed through experiments.The experimental results show that the improved ellipsoid fitting algorithm is compared with the original ellipsoid fitting algorithm.The combined algorithm effectively reduces the number of gross points and has a better compensation effect.Secondly,a two-stage complementary filter fusion algorithm(TCF)is proposed to solve the problem of the error in the accuracy of the heading angle calculation in the magnetic interference environment in the existing attitude calculation methods such as gradient descent method and complementary filtering method.According to the measurement data of the accelerometer and the magnetometer,the algorithm compensates and corrects the estimated data of the gyroscope in two stages,which reduces the influence of the heading angle error on the accuracy of the attitude calculation.Then,aiming at the problem that the error of the attitude measurement system has high nonlinearity and time variability,an adaptive incremental Kalman filter algorithm(AIKF)is proposed to calculate the attitude information of the carrier.This algorithm calculates the difference between the data fused by the two-stage complementary filtering algorithm,which is used as the observation value of the adaptive incremental Kalman filter,and at the same time,the system noise is adaptively estimated to obtain an accurate attitude solution value.Finally,this paper uses the MPU6050 inertial measurement unit and the RM3100 magnetic sensor to build the hardware platform of the heading and attitude system,and conducts an experimental analysis on the resolution accuracy of the TCF-AIKF algorithm in the case of magnetic interference.It is combined with the traditional complementary filtering algorithm(CF)and The adaptive Kalman filter algorithm(AKF)is used for comparative experiments.The experimental results show that the TCF-AIKF algorithm has a better effect on the fusion of attitude information in the magnetic interference environment,and the accuracy is higher than the complementary filter algorithm and the adaptive Kalman filter algorithm. |