Algorithm for increasing the accuracy of three-axis MEMS orientation sensors

The authenticity of the readings of accelerometers and magnetometers is of great importance when using sensors in orientation systems. However, traditionally determined methods of calibration cannot always provide the necessary work and stability of indications. The method of calibration of MEMS accelerometers and magnetometers in the original setting of problems of identification of sensor parameters is considered in the article. The stochastic approach allows for the passage of a calibration from without an exact binding to a specific orientation of the accelerometer, since this does not require additional sensors to determine the angle of rotation. This allows us to use the algorithm for sensors, already fixed on the equipment. The experimental measurements were carried out using a three-axis MEMS sensor MPU-9265. The proposed method makes it possible to completely eliminate the displacement of zero, compensate for the non-unit scale of the axes, and also to determine the orientation of the sensitive axes of the magnetometer. The standard deviation of the experimental data from the reference cloud is less than 1%.


Introduction
In solving scientific-practical problems of synthesis and analysis of signals obtained from navigation devices, great progress has been made.The relevance of the topic is determined by the need to create hardware-software complex of calibration [1,2] of three-axial MEMS accelerometers and magnetometers in order to reduce the error in determining the angular coordinates.
The practical importance of the work is determined, on the one hand, by the high need for such calibration systems (the use of MEMS accelerometers and magnetometers currently amounts to tens and hundreds of thousands), and, on the other hand, in reducing the cost of mass-produced sensors and, consequently, elimination of presale calibration of sensors.The development of a fairly simple and accurate method and complex for calibration of orientation sensors will certainly be in demand.
In general, the resolution of the problem of the authenticity of the data obtained depends on the accuracy of the calibration of the navigation sensors and the algorithm for processing their signals.Traditional calibration methods don't always provide the accuracy and stability of the readings required for operation [3][4][5][6][7][8].The proposed approach providing a statistically significant estimate is different from most of the proposed calibration methods.
The solution of the calibration problem realizes the identification of the sensitivity ellipsoid over the cloud of points, which, unlike deterministic methods, makes it possible to determine not only the zero shift and statistically validate the gain factors, but also to determine the orientation of the sensitive axes.

Error Analysis
For the correct solution of the problem of calibration of orientation sensors, it is first necessary to perform an analysis and determine the main errors.The main source of errors in MEMS accelerometers can be considered sensitive part sensor [9].Errors in the readings of the three-axial accelerometer arise due to three factors [10 -12] associated with the structure of the board: -presence of a constant zero offset; -own noise; -non collinearity of the axes of the object's coordinate system and the coordinate system of the accelerometer.
The main sources of MEMS magnetometers errors are: -the presence of magnetic inclination due to the specificity of the earth's magnetic field; -the presence of artificial fields around the sensor, created, for example, motor magnets, batteries, power wires, etc.In foreign literature, such errors are called Hard Iron [13 -16]; -distortions caused by the presence of ferromagnetic materials near the sensor (Soft Iron) [13 -16].
Thus, the errors of the MEMS orientation sensors are the displacement of the coordinate system of the data cloud, the non-unit scale of the axes, and the rotation of the ellipsoid of data around the origin.

Description of the method
When posing the problem of calibration of orientation sensors in stochastic interpretation, the sensor response is represented as a point in three-dimensional space [17].Due to the influence of errors, the points form a cloud of data in the form of an ellipsoid with a shifted center, rotated relative to the origin.
Thus, the problem of calibration first of all becomes the determination of coefficients in the equation for the transformation of an ellipsoid into a sphere [18]: To eliminate the displacement error of zero, it is necessary to center data [19]: where are: Xa -the average component; Xia -numerical components of points of a cloud of data; X -the matrix of centered data.Also, when calibrating the magnetometer, it is necessary to take into account the effect of magnetic inclination, which depends on the coordinates of the location of the experiment.To eliminate this influence, the value of the angle, called magnetic declination, is added or subtracted to the readings of the sensor.
To eliminate the error of non-unit scale axes, the problem is to identify the semi-axes of the ellipsoid, which can be defined as the problem of minimizing the functional J() with respect to the parameters a, b and c: min The calculation of the parameter estimation vector is carried out using the method of least squares according to the formula (4): where are: X -explanatory variables matrix; Yexperimental results vector;  -parameters estimates vector.
Results of simulation modeling are presented in the paper [17].The error is 2 -3%, which provides the necessary accuracy.

Calibration features of the measuring unit
The complexity of calibration of the measuring unit, consisting of the MEMS accelerometer and magnetometer, makes it necessary to set the sensor axes to a level with the horizon, which in practice is almost impossible.Also, in fact, the exact direction of the magnetic field vector is not known in connection with the features of the Earth's magnetic field [20].As a result, the axes of the accelerometer and the magnetometer are mismatched, and the vector of the Earth's magnetic field does not coincide with the axis of the magnetometer "Fig.1".

Fig. 1. Location of the sensor axes
The solution of this problem can be the initial calibration of the accelerometer and the further centering of the magnetometer data.In this case, the actual direction of the magnetic field vector is calculated depending on the exact coordinates of the measurement site.Compensating the angle between the true vector of the Earth's magnetic field and the axis of the magnetometer, we can bring the data cloud of the sensor to the desired value.

Experimental results
Experimental measurements were carried out in the operating temperature range using a three-axis accelerometer sensor, a magnetometer and a gyro MPU-9265.
In the case of the miniature microcircuit MPU-9265 two crystals are united: on one placed three-axis gyroscope and a three-axis sensor, and on the second -a three-axis magnetometer AK8963.
Data from the sensors are digitized by 16-bit ADCs, processed and transmitted to the external microcontroller via the I2C / SPI bus.The GY-9250 module is characterized by low power consumption, low cost and high performance.
MPU-9265 work in robotics, in 3D mouse designs, in gesture recognition devices, in navigation devices, etc.
Figures 2, 3 show the measurement results.The root-mean-square deviation along the axes is less than 1%, which satisfies the necessary requirements for accuracy of operation.

Conclusions
The proposed method allows you to completely get rid of the error of zero displacement, and also compensate for the non-unit scale of the sensor axes and the error in the angular orientation of the magnetometer.The main advantage of the method of calculating the estimation vector with the help of OLS is the ability to perform calculations without reference to the coordinate system.This is more important when calibrating the magnetometer, when you can't take into account the angle of inclination and perform calibration independently, without a gyroscope or an accelerometer.This allows the use of an algorithm for sensors already installed on the equipment.