Research on Nonlinear Compensation of the MEMS Gyroscope under Tiny Angular Velocity

The Micro-Electro-Mechanical System (MEMS) gyroscope has been widely used in various fields, but the output of the MEMS gyroscope has strong nonlinearity, especially in the range of tiny angular velocity. This paper proposes an adaptive Fourier series compensation method (AFCM) based on the steepest descent method and Fourier series residual correction. The proposed method improves the Fourier series fitting method according to the output characteristics of the MEMS gyroscope under tiny angular velocity. Then, the optimal weights are solved by the steepest descent method, and finally the fitting residuals are corrected by Fourier series to further improve the compensation accuracy. In order to verify the effectiveness of the proposed method, the angle velocity component of the earth’s rotation is used as the input of the MEMS gyroscope to obtain the output of the MEMS gyroscope under tiny angular velocities. Experimental characterization resulted in an input angular velocity between −0.0036°/s and 0.0036°/s, compared with the original data, the polynomial compensation method, and the Fourier series compensation method, and the output nonlinearity of the MEMS gyroscope was reduced from 1150.87 ppm, 641.13 ppm, and 250.55 ppm to 68.89 ppm after AFCM compensation, respectively, which verifies the effectiveness and superiority of the proposed method.


Introduction
The Micro-Electro-Mechanical System (MEMS) gyroscope is a critical component of inertial navigation systems (INS) [1]. The advantages of the MEMS gyroscope include its low cost, compact volume, low power consumption, and easy integration. As a result, the MEMS gyroscope is widely used in oil drilling and geological research [2,3]. However, the MEMS gyroscope's precision is affected by various errors [4].
The error of the MEMS gyroscope consists of random error and deterministic error [5]. Random errors are caused by uncertain factors and have no obvious repeatability. It can be analyzed by statistics and filtering methods, such as the Auto Regression Moving Average (ARMA) model, the Adaptive Kalman Filter (AKF), and Allan variance [6][7][8]. Deterministic errors include misalignment, zero bias, and nonlinearity [9,10]. The compensation of the MEMS gyroscope misalignment and the zero bias have been extensively reported [11][12][13][14]. However, the nonlinearity of the MEMS gyroscope is affected by geometric and material effects, electrostatic actuation, capacitance detection, and other factors. The source of the error is complex, which results in compensation difficulties [15].
In earlier work, the nonlinear compensation method of the MEMS gyroscope has been studied, which can be mainly divided into the following methods:

•
The traditional compensation method: Refers to the IEEE standard format guide [16,17], where the relationship between the input and output angular velocity of the MEMS gyroscope is established, and the optimal relationship is found by polynomial fitting [18][19][20], so as to realize the nonlinear error compensation. However, the performance of polynomial fitting depends on the accuracy of the compensation model and the repeatability of the system output, which is not universal. • Virtual Coriolis force-based nonlinear compensation method: With a specific resonator structure (force rebalance comb), the MEMS gyroscope outputs an equivalent angular velocity signal by applying an electrical excitation signal and then compensates for the nonlinearity of the MEMS gyroscope according to the output [21,22]. However, the additional vibration introduced by the virtual Coriolis force method, which is coupled to the gyroscope sensitive end, results in additional nonlinear errors. • Artificial intelligence algorithm: The output model of the MEMS gyroscope was established by using fuzzy logic [23] and neural networks [24]. When the input angular velocity is −60 • /s to 60 • /s and the interval is 3 • /s, the nonlinear error of the MEMS gyroscope is about 140 ppm. However, artificial intelligence algorithms require a large number of samples to train.

•
In-run compensation method: The sources of MEMS gyroscope nonlinear error were investigated, and a nonlinear error correction method that does not require system calibration or data fitting was proposed, which can be applied to resonant gyroscopes in amplitude-modulated (AM) mode in general [25,26]. When the input angular velocity is ±0.1 • /s, ±0.2 • /s, ±0.5 • /s, ±1 • /s, and ±2 • /s, the compensation method is verified.
These studies have effectively reduced the nonlinear error of the MEMS gyroscope at high angular velocity, but the compensation of MEMS gyroscope output nonlinearity (nonlinear behavior, or deviation from linear dependence) under tiny angular velocity (from −0.0036 • /s to 0.0036 • /s) has not been studied. Due to the strong nonlinearity of MEMS gyroscope output, it is difficult for the MEMS gyroscope to accurately measure the earth's rotation angle velocity component. Therefore, the MEMS gyroscope is rarely used in north-seeking. With the increasing demand for MEMS gyroscope north-seeking accuracy, more and more fields need to use the MEMS gyroscope for north-seeking. The nonlinear compensation of the MEMS gyroscope output is particularly important, especially in the case of tiny angular velocity (angular velocity of earth's rotation). Therefore, this paper studies the nonlinear error compensation method of the MEMS gyroscope under tiny angular velocity. An adaptive Fourier series compensation method (AFCM) based on the steepest descent method and Fourier series residual correction is proposed. AFCM achieves a better compensation effect by improving the Fourier series fitting method. It then iteratively solves the optimal weights using the steepest descent method and further improves the compensation accuracy by correcting the residuals of the fitted model with the Fourier series. The experimental results show that the proposed method can effectively reduce the nonlinear error of the MEMS gyroscope under tiny angular velocity.
The paper is organized as follows. Section 2 introduces the nonlinear mechanism of the MEMS gyroscope and establishes the output model of the MEMS gyroscope at tiny angular velocities. In Section 3, the method of nonlinear compensation is reviewed. Section 4 represents the experimental process and results. Section 5 is the concluding remarks and future work.

Nonlinear Analysis of the MEMS Gyroscope
Polysilicon, or crystalline silicon, is the main material of the MEMS gyroscope, which is fabricated by microfabrication. The MEMS gyroscope is a micron-scale device, so it has the characteristics of micro-size semiconductor processing, which leads to the weak signals being vulnerable to interference and complex error sources, limiting the accuracy of the device. In the machining process, the machining accuracy of device size is difficult to control, which affects the performance of the MEMS gyroscope. For the MEMS gyroscope, noise is an important factor affecting the performance of the gyroscope. Noise is a kind of random signal, which will affect the useful signal measured by the system. When the signal-to-noise ratio of the system is too low, the useful signal will be seriously disturbed, and even submerged by noise, so the noise largely determines the accuracy of the MEMS gyroscope output. The main noise sources of the MEMS gyroscope include thermal noise [27,28] and flicker noise (1/f noise) [29]. Thermal noise includes mechanical thermal noise and electronic thermal noise, which is caused by the random thermal motion of molecules or electrons. The random fluctuation of the conductance of the conductor contact point causes 1/f noise. The relationship between signal, noise, and the MEMS gyroscope is shown in Figure 1. In addition, the nonlinearity of capacitance detection also leads to the nonlinearity of MEMS gyroscope output [30,31].
Sensors 2022, 22, x FOR PEER REVIEW 3 of 16 random signal, which will affect the useful signal measured by the system. When the signal-to-noise ratio of the system is too low, the useful signal will be seriously disturbed, and even submerged by noise, so the noise largely determines the accuracy of the MEMS gyroscope output. The main noise sources of the MEMS gyroscope include thermal noise [27,28] and flicker noise (1/f noise) [29]. Thermal noise includes mechanical thermal noise and electronic thermal noise, which is caused by the random thermal motion of molecules or electrons. The random fluctuation of the conductance of the conductor contact point causes 1/f noise. The relationship between signal, noise, and the MEMS gyroscope is shown in Figure 1. In addition, the nonlinearity of capacitance detection also leads to the nonlinearity of MEMS gyroscope output [30,31]. The structure of the MEMS gyroscope is shown in Figure 2, which consists of a vibratory mass, driving electrodes, sensing electrodes, two anchors, supporting beams, an inner frame, and an outer frame [32]. When there is angle movement on the MEMS gyroscope's input axis, because of the Coriolis effect, the vibratory mass will twist and a Coriolis inertia torque ( c M ) is generated, resulting in the change of the capacitance value of the sensing electrode. Torsion amplitude ( k   ) in the output axis is sensed by the sensing electrodes, and the capacitance difference ( C  ) between the two sensing electrodes is output. Through the measurement of the capacitance change, the input angular velocity (   ) can be indirectly calculated. The c M can be expressed as: where J  is the equivalent moment of inertia of the inner frame and N   is the constant amplitude vibration of the inner frame.
In accordance with the Laplace transform principle, the movement of the outer frame of the MEMS gyroscope subjected to c M is described by the equation: The structure of the MEMS gyroscope is shown in Figure 2, which consists of a vibratory mass, driving electrodes, sensing electrodes, two anchors, supporting beams, an inner frame, and an outer frame [32]. When there is angle movement on the MEMS gyroscope's input axis, because of the Coriolis effect, the vibratory mass will twist and a Coriolis inertia torque (M c ) is generated, resulting in the change of the capacitance value of the sensing electrode. Torsion amplitude (θ k ) in the output axis is sensed by the sensing electrodes, and the capacitance difference (∆C) between the two sensing electrodes is output. Through the measurement of the capacitance change, the input angular velocity ( Ω) can be indirectly calculated. and even submerged by noise, so the noise largely determines the accuracy gyroscope output. The main noise sources of the MEMS gyroscope include [27,28] and flicker noise (1/f noise) [29]. Thermal noise includes mechanical and electronic thermal noise, which is caused by the random thermal motion or electrons. The random fluctuation of the conductance of the conductor causes 1/f noise. The relationship between signal, noise, and the MEMS shown in Figure 1. In addition, the nonlinearity of capacitance detection als nonlinearity of MEMS gyroscope output [30,31]. The structure of the MEMS gyroscope is shown in Figure 2, which co bratory mass, driving electrodes, sensing electrodes, two anchors, supporti inner frame, and an outer frame [32]. When there is angle movement on the scope's input axis, because of the Coriolis effect, the vibratory mass will twi olis inertia torque ( c M ) is generated, resulting in the change of the capacit the sensing electrode. Torsion amplitude ( k   ) in the output axis is sensed b electrodes, and the capacitance difference ( C  ) between the two sensing elec put. Through the measurement of the capacitance change, the input angula ) can be indirectly calculated. The c M can be expressed as: where J  is the equivalent moment of inertia of the inner frame and N   i amplitude vibration of the inner frame.
In accordance with the Laplace transform principle, the movement of th of the MEMS gyroscope subjected to c M is described by the equation: The M c can be expressed as: where Θ J is the equivalent moment of inertia of the inner frame and .. θ N is the constant amplitude vibration of the inner frame. In accordance with the Laplace transform principle, the movement of the outer frame of the MEMS gyroscope subjected to M c is described by the equation: where J k is the moment of inertia in k axis, k = x, y, z, θ k is torsion amplitude in output axis, S is complex frequency, S = σ + jω, D k and ψ k are the damping coefficient and ratio, ψ k = D k /2 √ B k · J k , ℵ D and ℵ k are the resonant radial frequency of drive and output axis, and B k is the rigidity of output axis, B k = ℵ 2 k J k . The capacitance difference of the MEMS gyroscope, as a function of torsion displacement, θ k , is given as: where κ is the dielectric constant between plates, l s is the effective length of the sensitive electrode, h 0 is the initial distance between the drive plate and the inner frame, s is the distance between the sensitive electrode, and the width of the plate is denoted by b. It can be seen from Equation (3) that ∆C is not a linear function of θ k , that is, the output of the MEMS gyroscope has nonlinear error. Through expansion of natural logarithm in Equation (3) by Taylor series and omitting higher order terms, we can obtain: In the formula, A is the effective area of the sensitive electrode. From the above equation, the nonlinear error of the MEMS gyroscope can be expressed as: It can be seen from Equation (5) and Figure 1 that the nonlinearity of MEMS gyroscope output is affected by the nonlinearity of capacitance detection, and in the low input speed range, the effective signal is small, the machining error and noise are prominently affected, and the MEMS gyroscope output error nonlinearity is more significant.

Establishment of MEMS Gyroscope Output Model
To compensate for the nonlinearity of the MEMS gyroscope in a tiny angular velocity range and improve its output precision, it is necessary to establish the output model of the MEMS gyroscope mathematically. The mathematical model expresses the relationship between the input and output of the MEMS gyroscope [33]. Therefore, the gyroscope's output model can be expressed as follows: where G is the output angular velocity of the MEMS gyroscope, ω denotes the true angular velocity, and A is the acceleration. They are shown as follows: Gyroscope zero bias errors and random errors are defined as: K is scale factor of the MEMS gyroscope. It is shown as follows: E is installation error of the MEMS gyroscope.D is bias error related to acceleration. They are shown as follows: where E ij is the misalignment caused by the non-orthogonality axes of the gyroscope. The misalignmentD ij denotes that the acceleration sensed by the i-axis accelerometer is caused by the input acceleration of the j-axis accelerometer. Inserting Equations (7)-(13) into Equation (6), we obtain: To obtain the output of the MEMS gyroscope at a tiny angular velocity, the earth's rotation angular velocity component is used as the input of the gyroscope. As shown in Figure 3, the gyroscope output appears to be a cosine signal when the angle between the gyroscope sensitive axis and the Earth's rotation axis varies.
It can be seen from Figure 3 that the input of the MEMS gyroscope and accelerometer is [34]: where ω ie represents the earth's angular velocity, L denotes the earth's latitude, and α indicates the angle between the sensitive axis of the MEMS gyroscope and true north. It can be seen from Figure 3 that the input of the MEMS gyroscope and accele is [34]: where ie  represents the earth's angular velocity, L denotes the earth's latitu  indicates the angle between the sensitive axis of the MEMS gyroscope and tru Substituting Equation (15) into Equation (14), the output model of the MEM scope under tiny angular velocity is shown as: The output model of the MEMS gyroscope includes installation error, acce bias error, zero bias error, and random error. These errors can be calibrated by method and the position method. After calibrating the above errors, the lineari MEMS gyroscope is better at large angular velocity, but at tiny angular velocity, arity becomes poor. Therefore, this paper focuses on the nonlinear compens MEMS gyroscope output at tiny angular velocity.

The Traditional Polynomial Compensation Method
The classical strategy to compensate for MEMS gyroscope nonlinearity is pol Substituting Equation (15) into Equation (14), the output model of the MEMS gyroscope under tiny angular velocity is shown as: The output model of the MEMS gyroscope includes installation error, acceleration bias error, zero bias error, and random error. These errors can be calibrated by the rate method and the position method. After calibrating the above errors, the linearity of the MEMS gyroscope is better at large angular velocity, but at tiny angular velocity, the linearity becomes poor. Therefore, this paper focuses on the nonlinear compensation of MEMS gyroscope output at tiny angular velocity.

The Traditional Polynomial Compensation Method
The classical strategy to compensate for MEMS gyroscope nonlinearity is polynomial fitting. The regression equation can be obtained [35,36]: where → G is the MEMS gyroscope output angular velocity,Ω( → G) is the fitting angular velocity, and a 0 , a 1 , · · · , a n is the parameter of the established model.
The difference between the value calculated by the regression equation and the desired value is as follows: where ω i is the ideal output value of the MEMS gyroscope. According to the least mean squares theory, the first-order partial derivative of I should be set to the minimum to obtain the optimum value for the coefficients: The linear equations about a 0 , a 1 , · · · , a n can be obtained. Thus, the regression equation with order n can be obtained.

The Adaptive Fourier Series Compensation Method (AFCM)
There are many factors that cause the nonlinearity of the MEMS gyroscope. The polynomial compensation method is difficult to accurately describe this characteristic, and the calculation amount is also large [37]. Therefore, this paper proposes an adaptive Fourier series compensation method (AFCM). It can be seen from the output model of the tiny angular velocity of the MEMS gyroscope that the model includes not only sine and cosine terms but also some additional terms. The Fourier series fitting method is improved in order to better fit the output of the MEMS gyroscope at tiny angular velocity. Then, the optimal weight is iteratively obtained by the steepest descent method. Finally, the Fourier series is used to eliminate the residuals of the fitting model, so as to achieve the best fitting effect.
A very high-precision-rate turntable is needed in order to achieve the input of tiny angular velocity. Therefore, this paper adopts the multi-position turntable experiment in Section 2.2. It can be seen from Equation (16) and Figure 3 that the output of the MEMS gyroscope can be approximated as a periodic trigonometric function satisfying the Dirichlet condition. As a result, the output of the MEMS gyroscope can be decomposed into a Fourier series, and its trigonometric function can be expressed as: The coefficients of the Fourier series are denoted by the following: where a 0 , a n , and b n are the coefficients to be determined, n is the number of harmonics, and w is the base frequency.
Since Fourier series fitting cannot effectively identify the signal outside the frequency band, in order to fit the target signal outside the frequency band output by the MEMS gyroscope, a linear term n is added on the basis of Fourier sine and cosine components in this paper, and this linear term is used for linear fitting of signals outside the range of ( w, M w).
The improved Fourier fitting algorithm is shown in Equation (22).
x nk = a n · cos(n wG k ) + b n · sin(n wG k ) n = 1, 2, · · · 2M n n = 2M + 1 where X k is a column vector with dimension 2M + 1, and its specific element x nk is defined by Equation (22), which is used to represent the results of fitting each sine and cosine, k is also a column vector with dimension 2M + 1, and each element nk is the weight of the corresponding element x nk in X k , G k is the MEMS gyroscope output angular velocity, ω k is the ideal output value of the MEMS gyroscope, ℘ k represents the error between the estimated value of the gyroscope output and the true value, ξ is the convergence rate coefficient of the algorithm, and its magnitude determines the rate of convergence.
In the process of fitting, the least squares algorithm is used to obtain the optimal weight. From Equation (23) we can obtain: where E represents the expected value, R = E(X k X T k ) is the correlation matrix of the input vector, and is the weight vector.
The determination of the optimal weights is based on the principle of minimizing the fitting error, and according to the least squares method, the vector of weights is derived as: When ∂ /∂ = 0, the optimal weight vector can be determined as: In the process of solving the optimal weight vector by using Equation (27), it is necessary to solve the linear equations. Before solving the equations, it is necessary to invert the correlation matrix, but the calculation of the inverse matrix is large. In order to reduce the amount of calculation, the optimal weight vector uses the steepest descent algorithm.
The steepest descent algorithm is used to find an optimal solution 0 , so that: In each iteration, the weights of the input vector satisfy: where m is the number of iterations.
In the iteration process, is continuously adjusted along the inverse gradient of J( ) to obtain: = ∇J( ) = ∂J( )/∂ (30) where represents the gradient vector. From the above, the steepest descent method can be expressed as: where ν is a positive step parameter.
To illustrate the convergence of the steepest descent method, Taylor expansion is performed at (m): Through the analysis of the steepest descent algorithm, when 0 < ν < 2/λ max , the steepest descent method is convergent, where λ max is the maximum eigenvalue of the correlation matrix R. The fitting result of the MEMS gyroscope output is: According to Equation (16), the output of the MEMS gyroscope is affected by random error. Therefore, this paper uses the strong noise reduction ability of the Fourier series to correct the residual of the fitting model (Equation (34)) so as to improve the accuracy of the fitting model.
The residual sequence of the fitting model can be expressed as: The residual sequence can be approximately expressed by Fourier series expansion as follows: where, a 0 , a i , and b i are the coefficients to be determined, k a = j/2. The matrix form of Equation (37) is: where, E ak = e 1 e 2 · · · e j T is the residual vector, C a = a 0 a 1 b 1 · · · a ka b ka T is the residual Fourier coefficient vector, and P a can be expressed as: The coefficient vector obtained by the least squares method is: Substituting the obtained Fourier coefficient vectorĈ a into Equation (38),Ê k can be obtained, so as to obtain the modified model:

Experiment Setup
To verify the effectiveness of the presented method, the compensation process was performed on an AG-20 sensor (Table 1). AG-20 is a three-axis MEMS gyroscope fabricated by polysilicon micromachining. The experimental environment is shown in Figure 4. The experimental equipment includes a biaxial angular velocity turntable, a data acquisition system, and a processing system. The IMU is connected to a laptop computer through an RS485 interface, which is used for information exchange with the computer.

Analysis of Compensation Results for MEMS Gyroscope
The MEMS gyroscope (AG-20) is fixed horizontally on the rate turntable w tooling fixture, and the Y-axis is selected as the sensitivity axis. Preheating the ME roscope lasted for 20 min. In the process of experiment, in order to provide a tiny velocity for the MEMS gyroscope, a static experiment with a 10-degree interval w ried out on the turntable. The turntable was at an azimuth angle of 0°, 10°, 20°, 50°, 60°, 70°, 80°, 90°, 100°, 110°, 120°, 130°, 140°, 150°, 160°, 170°, 180°, 190°, 20 230°, 240°, 250°, 260°, 270°, 280°, 290°, 300°, 330°, 340°, and 350° in order of rotati gyroscope output data were collected for three minutes at each azimuth with a sa frequency of 100 Hz. Therefore, 36 components of the angular velocity of the Eart tion can be obtained as inputs to the MEMS gyroscope. Randomly selecting the output data of the MEMS gyroscope at four of these azimuth angles, they are sh Figure 5. In Figure 5, the red line, blue line, pink line, and green line are the origina data of the MEMS gyroscope when the azimuth angles are 10°, 70°, 170°, and 240° tively.

Analysis of Compensation Results for MEMS Gyroscope
The MEMS gyroscope (AG-20) is fixed horizontally on the rate turntable with the tooling fixture, and the Y-axis is selected as the sensitivity axis. Preheating the MEMS gyroscope lasted for 20 min. In the process of experiment, in order to provide a tiny angular velocity for the MEMS gyroscope, a static experiment with a 10-degree interval was carried out on the turntable. The turntable was at an azimuth angle of 0

Analysis of Compensation Results for MEMS Gyroscope
The MEMS gyroscope (AG-20) is fixed horizontally on the rate turntable w tooling fixture, and the Y-axis is selected as the sensitivity axis. Preheating the MEM roscope lasted for 20 min. In the process of experiment, in order to provide a tiny a velocity for the MEMS gyroscope, a static experiment with a 10-degree interval w ried out on the turntable. The turntable was at an azimuth angle of 0°, 10°, 20°, 3 50°, 60°, 70°, 80°, 90°, 100°, 110°, 120°, 130°, 140°, 150°, 160°, 170°, 180°, 190°, 200 230°, 240°, 250°, 260°, 270°, 280°, 290°, 300°, 330°, 340°, and 350° in order of rotatio gyroscope output data were collected for three minutes at each azimuth with a sam frequency of 100 Hz. Therefore, 36 components of the angular velocity of the Earth tion can be obtained as inputs to the MEMS gyroscope. Randomly selecting the o output data of the MEMS gyroscope at four of these azimuth angles, they are sho Figure 5. In Figure 5, the red line, blue line, pink line, and green line are the original data of the MEMS gyroscope when the azimuth angles are 10°, 70°, 170°, and 240°, r tively.  When the experiment is completed and all the data are collected, the relationship between the input and output of the MEMS gyroscope at different azimuths is shown  Figure 6. The relative errors of the MEMS gyroscope output at different azimuths are shown in Figure 7.
Sensors 2022, 22, x FOR PEER REVIEW When the experiment is completed and all the data are collected, the relat between the input and output of the MEMS gyroscope at different azimuths is sh Figure 6. The relative errors of the MEMS gyroscope output at different azimu shown in Figure 7.  Figure 6 shows the relationship between the input and output of the MEM scope at different azimuths. It can be seen that the output of the MEMS gyroscope p different degrees of nonlinearity with the change in azimuth. The standard value in 6 represents the input angular velocity of the MEMS gyroscope. In this paper, the rotation angular velocity component is used as the input of the MEMS gyroscope standard value can be calculated by Equation (15). The experimental data in Figu averaged by collecting three-minute output data from the MEMS gyroscope. As Figure 7, when the azimuth angle is close to 90° or 270°, the relative error is the and it increased to 85.13% and 81.42%, respectively. The reason for this is that the a velocity component of the Earth's rotation is close to zero, and the MEMS gyrosco acquires the effective signal is so tiny that the nonlinearity is more noticeable. In this paper, 20 data points were randomly selected to establish the model, remaining 16 data points were utilized to validate the model and compare the com   Figure 6 shows the relationship between the input and output of the MEM scope at different azimuths. It can be seen that the output of the MEMS gyroscope p different degrees of nonlinearity with the change in azimuth. The standard value in 6 represents the input angular velocity of the MEMS gyroscope. In this paper, the rotation angular velocity component is used as the input of the MEMS gyroscope standard value can be calculated by Equation (15). The experimental data in Figu averaged by collecting three-minute output data from the MEMS gyroscope. As Figure 7, when the azimuth angle is close to 90° or 270°, the relative error is the and it increased to 85.13% and 81.42%, respectively. The reason for this is that the a velocity component of the Earth's rotation is close to zero, and the MEMS gyrosco acquires the effective signal is so tiny that the nonlinearity is more noticeable. In this paper, 20 data points were randomly selected to establish the model, remaining 16 data points were utilized to validate the model and compare the com tion effects of different compensation methods. Figure 8 shows the fitting results ferent compensation methods. The fitting residuals of different compensation m are shown in Figure 9.  Figure 6 shows the relationship between the input and output of the MEMS gyroscope at different azimuths. It can be seen that the output of the MEMS gyroscope presents different degrees of nonlinearity with the change in azimuth. The standard value in Figure 6 represents the input angular velocity of the MEMS gyroscope. In this paper, the earth's rotation angular velocity component is used as the input of the MEMS gyroscope, so the standard value can be calculated by Equation (15). The experimental data in Figure 6 are averaged by collecting three-minute output data from the MEMS gyroscope. As seen in Figure 7, when the azimuth angle is close to 90 • or 270 • , the relative error is the largest, and it increased to 85.13% and 81.42%, respectively. The reason for this is that the angular velocity component of the Earth's rotation is close to zero, and the MEMS gyroscope that acquires the effective signal is so tiny that the nonlinearity is more noticeable.
In this paper, 20 data points were randomly selected to establish the model, and the remaining 16 data points were utilized to validate the model and compare the compensation effects of different compensation methods. Figure 8 shows the fitting results of different compensation methods. The fitting residuals of different compensation methods are shown in Figure 9.
can be judged by the coefficient of determination (R-square), and the closer the R is to 1, the better the fitting effect. The R-square of polynomial fitting is 0.8203 square of the Fourier series is 0.9056, and the R-square of AFCM is 0.9996. It can from Figure 9 that the residuals with AFCM are smaller and more concentrated tha of polynomial fitting and Fourier series fitting. Therefore, the fitting effect of AFCM best.  The remaining 16 data points were used to validate models fitted by differe pensation methods. The results are shown in Figure 10, with the specific values g Table 2. square of the Fourier series is 0.9056, and the R-square of AFCM is 0.9996. It can be seen from Figure 9 that the residuals with AFCM are smaller and more concentrated than those of polynomial fitting and Fourier series fitting. Therefore, the fitting effect of AFCM is the best.  The remaining 16 data points were used to validate models fitted by different compensation methods. The results are shown in Figure 10, with the specific values given in Table 2.  Figure 8 shows the fitting effect of different compensation methods. The fitting effect can be judged by the coefficient of determination (R-square), and the closer the R-square is to 1, the better the fitting effect. The R-square of polynomial fitting is 0.8203, the R-square of the Fourier series is 0.9056, and the R-square of AFCM is 0.9996. It can be seen from Figure 9 that the residuals with AFCM are smaller and more concentrated than those of polynomial fitting and Fourier series fitting. Therefore, the fitting effect of AFCM is the best.
The remaining 16 data points were used to validate models fitted by different compensation methods. The results are shown in Figure 10, with the specific values given in Table 2. The output results of the MEMS gyroscope after compensation by different m are displayed in Figure 10. The red line in Figure 10 is the original output of the gyroscope, which has a large error compared with the standard value (purple line compensation by the traditional polynomial fitting method (cyan line) and the series fitting method (blue line), the output error of the MEMS gyroscope is redu varying degrees, but there are still some errors. The output of the MEMS gyros closer to the standard value after AFCM compensation (green line). In Table 2, w marize the absolute error, mean error, and standard deviation (STD) of MEMS gyr output after different compensation methods. We evaluate the results with the st deviation. The proposed compensation method reduces the STD by 96.15%, 77.92 42.47% compared to the raw data, traditional polynomial, and Fourier series, respe The calculation method is shown in Equations (42)-(44). The results show that the error of the MEMS gyroscope is the smallest and the stability is the best after AFCM pensation.    The output results of the MEMS gyroscope after compensation by different methods are displayed in Figure 10. The red line in Figure 10 is the original output of the MEMS gyroscope, which has a large error compared with the standard value (purple line). After compensation by the traditional polynomial fitting method (cyan line) and the Fourier series fitting method (blue line), the output error of the MEMS gyroscope is reduced to varying degrees, but there are still some errors. The output of the MEMS gyroscope is closer to the standard value after AFCM compensation (green line). In Table 2, we summarize the absolute error, mean error, and standard deviation (STD) of MEMS gyroscope output after different compensation methods. We evaluate the results with the standard deviation. The proposed compensation method reduces the STD by 96.15%, 77.92%, and 42.47% compared to the raw data, traditional polynomial, and Fourier series, respectively. The calculation method is shown in Equations (42)-(44). The results show that the output error of the MEMS gyroscope is the smallest and the stability is the best after AFCM compensation.
where η AFCM raw , η AFCM polynomial , η AFCM f ourier are the percentages of STD reduction after compensation by the proposed method, STD raw is the STD of the MEMS gyroscope's raw output error, STD polynomial is the STD of MEMS gyroscope output error after polynomial compensation, STD f ourier is the STD of MEMS gyroscope output error after Fourier series compensation, and STD AFCM is the STD of MEMS gyroscope output error after AFCM compensation. Figure 11 shows the nonlinearity before and after compensation by different methods. As we can see, the MEMS gyroscope exhibits significant nonlinearity (the red line) at a tiny angular velocity. After compensation by the traditional polynomial method (the cyan line) and the Fourier series fitting method (the blue line), the nonlinearity is reduced, but there is still some nonlinearity. After AFCM (green line) compensation, the nonlinearity of the MEMS gyroscope is greatly reduced. It can be seen from Figure 10 that the raw nonlinearity of the MEMS gyroscope output is 1150.87 ppm. After compensation by the traditional polynomial method, the nonlinearity is 641.13 ppm. After compensation by the Fourier series method, the nonlinearity is 250.55 ppm. After compensation by the AFCM, the nonlinearity is reduced to 68.89 ppm. The compensation method proposed in this paper substantially improves the output accuracy of the MEMS gyroscope, and the accuracy consistency of the whole range is better.   Figure 11 shows the nonlinearity before and after compensation by different methods. As we can see, the MEMS gyroscope exhibits significant nonlinearity (the red line) at a tiny angular velocity. After compensation by the traditional polynomial method (the cyan line) and the Fourier series fitting method (the blue line), the nonlinearity is reduced, but there is still some nonlinearity. After AFCM (green line) compensation, the nonlinearity of the MEMS gyroscope is greatly reduced. It can be seen from Figure 10 that the raw nonlinearity of the MEMS gyroscope output is 1150.87 ppm. After compensation by the traditional polynomial method, the nonlinearity is 641.13 ppm. After compensation by the Fourier series method, the nonlinearity is 250.55 ppm. After compensation by the AFCM, the nonlinearity is reduced to 68.89 ppm. The compensation method proposed in this paper substantially improves the output accuracy of the MEMS gyroscope, and the accuracy consistency of the whole range is better. Figure 11. Comparison of nonlinear error compensation results. Figure 11. Comparison of nonlinear error compensation results.

Conclusions
In this paper, the output precision of the MEMS gyroscope is improved by compensating for the nonlinearity of the MEMS gyroscope at tiny angular velocities. The key contributions of this paper are to improve the Fourier series fitting method, then use the steepest descent method to solve the optimal weight, and finally, use the Fourier series to correct the residual error of the fitted model. Based on the experimental results and analyses, the following conclusions can be drawn: (a) by comparing the results of traditional polynomial fitting and Fourier fitting, the evaluation standard of fitting residuals (R-square) is obtained, and the results show that the proposed method has a better fitting effect; (b) the availability and effectiveness of the AFCM are demonstrated by an obvious decrease in the standard deviation of the MEME gyroscope output error after compensation, which is shown in Table 2; (c) the output nonlinearity of the MEMS gyroscope is reduced from 1150.87 ppm to 68.89 ppm, and the compensation effect is better than that of the traditional polynomial method and the Fourier series method. The proposed method can effectively compensate for the nonlinearity of the MEMS gyroscope under tiny angular velocity and exhibits wide application prospects.