Adaptive Dynamic Analysis of MEMS Gyroscope Random Noise Based on PID-DAVAR

As a MEMS gyroscope is susceptible to environmental interference, its performance is degraded due to random noise. Accurate and rapid analysis of random noise of MEMS gyroscope is of great significance to improve the gyroscope’s performance. A PID-DAVAR adaptive algorithm is designed by combining the PID principle with DAVAR. It can adaptively adjust the length of the truncation window according to the dynamic characteristics of the gyroscope’s output signal. When the output signal fluctuates drastically, the length of the truncation window becomes smaller, and the mutation characteristics of the intercepted signal are analyzed detailed and thoroughly. When the output signal fluctuates steadily, the length of the truncation window becomes larger, and the intercepted signals are analyzed swiftly and roughly. The variable length of the truncation window ensures the confidence of the variance and shortens the data processing time without losing the signal characteristics. Experimental and simulation results show that the PID-DAVAR adaptive algorithm can shorten the data processing time by 50%. The tracking error of the noise coefficients of angular random walk, bias instability, and rate random walk is about 10% on average, and the minimum error is about 4%. It can accurately and promptly present the dynamic characteristics of the MEMS gyroscope’s random noise. The PID-DAVAR adaptive algorithm not only satisfies the requirement of variance confidence but also has a good signal-tracking ability.


Introduction
MEMS gyroscope plays an important role in industrial equipment, inertial navigation systems, and other fields because of their small size and low power consumption [1]. However, the complexity of MEMS gyroscope processing and the variability of the operating environment result in a lot of random noise in the gyroscope's output signal, which seriously affects the performance of MEMS gyroscopes [2,3]. Therefore, to improve the accuracy of the MEMS gyroscope, it is necessary to comprehensively analyze the random noise characteristics of the MEMS gyroscope and assess its performance. At present, the random error modeling methods of MEMS gyroscopes mainly include the autocorrelation analysis method, power spectral density method, and Allan variance analysis method. Among them, the autocorrelation analysis method requires too much data acquisition time and has a poor analysis effect on error. The power spectral density method is applicable to frequency domain analysis, the power spectral density curves of errors are easy to overlap, making it difficult to separate errors [4,5]. It is worth noting that when the method converts the frequency domain results into time domain characteristics, further analysis and processing lead to a large workload and time-consuming. The Allan variance analysis method is simple in its calculation and can identify noise and quantify the statistical contribution of each kind of noise in random error. The DAVAR method is a combination of Allan variance and window function, it can not only identify the random error of MEMS gyro array, but also show the stability of random error over time. Reference [6] systematically introduced the basic theoretical knowledge of Allan variance modeling inertial sensor error term and expounded the implementation effect in different levels of inertial sensor modeling. Reference [7] proposed a fast DAVAR algorithm in the case of missing data. The results showed that the fast DAVAR method could significantly reduce the calculation time. Reference [8] extended fast DAVAR to discontinuous time series. The improved DAVAR could not only handle discrete data but also consume less computing time. Reference [9]. Proposed an improved fast DAVAR algorithm based on selected correlation time τ. When the amount of data was large, the consumed time was 1/186 that of the ordinary DAVAR algorithm, which greatly reduced the calculation time. Reference [10] proposed a timevarying window dynamic Allan variance method based on fuzzy control. Experimental results showed that the method could effectively identify the characteristics of fiber optic gyroscopic dynamic signals, and the performance evaluation index improved by at least 30%. Reference [11] improved the dynamic Allan variance by establishing a dynamic noise model and using a new truncation window based on entropy features. The results showed that the dynamic Allan variance could extract noise features well.
In order to solve the problems of low accuracy, long data processing time, and poor tracking ability of noise characteristics when using the traditional DAVAR method to analyze MEMS gyro's noise, a PID-DAVAR adaptive algorithm combining PID principle and DAVAR is designed. The gyro's angular rate signal is dynamically intercepted in real-time, and the length of the truncation window is adaptively adjusted according to the characteristics of the gyro's output signal. The adaptive adjustment of window size not only meets the requirement of variance confidence, but also shortens the running time owning good signal tracking ability, and high efficiency.
This article is organized as follows. In Section 2, principles of Allan variance and the character analysis of five random noise terms are introduced. In Section 3, principles of dynamic Allan variance are introduced in detail. In Section 4, by introducing the PID principle, the PID-DAVAR adaptive algorithm is proposed, and the calculation process of the algorithm is gradually introduced. In Section 5, the effectiveness of the PID-DAVAR adaptive algorithm is verified by vibration experiments. The conclusion is given in Section 6.

Principle of Conventional Allan Variance
Allan variance is a time-domain analysis method proposed by David Allan of the National Bureau of Standards (NBS) in the mid-1960s as a single data analysis method, can also be added as a frequency domain analysis technique [12]. It can analyze the gyro parameters and identify error terms, calculate and characterize all kinds of noise in the output signal of MEMS gyroscope [13,14].
The sampling period of the MEMS gyroscope is set as τ 0 , a total of N angular rate data were sampled, and N data were evenly divided into D(D = N/m) groups, each consisting of m(m ≤ (N − 1)/2) data. The average value of each group is: The estimation formula of Allan variance [15,16] is: where represents the overall average of the data, the correlation time is τ = mτ 0 , ω i (m) is the average angular rate of the group i, and i is the grouping number (i = 1, 2, · · · , D − 1).

Characterization of Five Typical Random Noise Terms
The error of MEMS gyroscope is generally divided into deterministic error and random error. The deterministic error is compensated by experimental calibration, while the random error is accidental and random, which changes with time. To reduce the influence of random error on the gyroscope, the noise characteristics are identified by Allan variance, and the software algorithm is used to compensate, so as to improve the accuracy of the gyroscope [17,18]. Typical MEMS gyroscope random errors include quantization noise (QN), angular random walk (ARW), bias instability (BI), rate random walk (RRW), and rate ramp (RR) [19]. The relationship between these five types of noise terms and Allan variance is derived in Equations (3)-(7).

1.
Quantization noise refers to a high-frequency noise generated during the conversion of digital signals to analog signals. The Allan variance is expressed as:

2.
Angle random walk is high-frequency noise caused by MEMS gyro angular rate random white noise integration. The Allan variance is expressed as: 3.
Bias instability refers to the low-frequency bias drift caused by the flicker noise of electronic circuits, environmental noise, and other components. The Allan variance is expressed as: Rate random walk refers to the random error generated by integrating the power spectral density of the bandwidth angular acceleration signal. The Allan variance is expressed as:

5.
Rate ramp refers to the extremely slow monotonic change of the MEMS gyroscope during the long-term output process. The Allan variance is expressed as: Assuming that these five random error sources are independent of each other, the total Allan variance is the sum of the variances of various error sources, namely: Equation (3) is fitted by the least square method, and the total Allan standard deviation σ all is: According to the fitting coefficient, the parameter estimation can be obtained, as shown in Table 1.

Principle of DAVAR
The conventional Allan variance is generally used to analyze the stability of the error signal [20], which is suitable for the ideal time-varying signal analysis and process. However, in the actual inertial navigation application environment, the signal shows obvious instability in a very short time. To accurately analyze the random noise in the MEMS gyroscope's signal, the DAVAR method is used to analyze the gyroscope's output signal, and accurately represent the real-time characteristics of the MEMS gyroscope's random noise [21,22]. The specific steps are shown in Figure 1, and described as follows: (1) Fix an analysis point, let t = t 1 ; (2) Take the analysis point t 1 as the center, the fixed length L(t 1 ) is selected to intercept the original output signal; (3) Take the signal intercepted in step (2) as the research object, the Allan variance σ 2 (t 1 , τ) is calculated; (4) Continue to select another time analysis point, namely t = t 2 . The selection of t 2 should make the intercepted signal data overlap with the intercepted data of the previous time analysis point t 1 , repeat steps (2)~(4) to obtain Allan variance σ 2 (t 2 , τ). Analogously, piecewise estimation is performed through a moving window, and the Allan variance set σ 2 (t N , τ) is obtained by multiple calculations; (5) The Allan variance set σ 2 (t 1 , τ), · · · , σ 2 (t N , τ) are arranged in chronological order, which corresponds to different time analysis points t and different interception intervals τ. It is reflected in the form of a 3D graph, which characterizes the stability of real-time measurement of the MEMS gyroscope's signal.
shown in Table 1.

Principle of DAVAR
The conventional Allan variance is generally used to analyze the stability of the erro signal [20], which is suitable for the ideal time-varying signal analysis and process. How ever, in the actual inertial navigation application environment, the signal shows obviou instability in a very short time. To accurately analyze the random noise in the MEMS gy roscope's signal, the DAVAR method is used to analyze the gyroscope's output signal, and accurately represent the real-time characteristics of the MEMS gyroscope's random nois [21,22]. The specific steps are shown in Figure 1, and described as follows: (1) Fix an analysis point, let (2) Take the analysis point   Considering the continuous situation, assuming that y(t) is the angular rate data collected by the MEMS gyroscope, the output signal y(t ) is intercepted in the window interval (t − L/2) ≤ t ≤ (t + L/2), and the truncated signal is expressed in mathematical form as: where, y L (t, t ) is truncated data of MEMS gyro's signal. L is the length of the truncation window, it is assumed to be odd. P L (t) is the function of truncation window length, as shown in Equation (11).
No matter which window form is selected, t always represents the center of the rectangular window. By convoluting truncated data y L (t, t ) and the Allan window A τ (t ), a continuous growth process is constructed. It can be written as: (12) where, the star sign stands for convolution, and A τ (t ) is the Allan window, defined as: where the variables in Equation (13) need to meet the conditions: τ max is the maximum observation interval. Here, we can set τ max as: In Equation (14), is the symbol that is rounded down to the nearest integer. Substituting Equation (12) into Equation (2), it can be written as: The dynamic Allan variance is the expected value of Equation (15), that is:

PID Principle in PID-DAVAR Adaptive Algorithm
The traditional DAVAR method used a rectangular window with a fixed window length to intercept the output signal of the MEMS gyroscope. However, DAVAR with a fixed window length is difficult to meet the requirements of MEMS gyroscope's signal accuracy identification in the whole time domain. If the data intercepted by the window is long, the dynamic tracking ability of the DAVAR method will be greatly weakened, resulting in a small gap with the Allan variance, which cannot represent the characteristics of random noise in detail and is insensitive to the tracking of burst signals; If the data intercepted by the window is short, although it can achieve good tracking effect, it will lose a certain confidence of variance, resulting in a large analysis error [23,24]. Therefore, a method of adjusting the length of the DAVAR window based on the adaptive PID principle is proposed. The length of the truncation window is adjusted adaptively to achieve better tracking ability and ideal variance confidence [25,26]. PID is a linear combination of the proportion (P), integral (I), and differential (D) of the error in the feedback system. The error e(t) is obtained by subtracting the input value x(t) from the actual output value y(t). It can be expressed as: The ideal PID principle can be expressed as: where, u(t) is the output value at a time t, K P is the proportional coefficient, T I is the integral time constant, and T D is the differential time constant. The error e(t) is used as the input and u is used as the output. Because Equation (18) contains mathematical algorithms such as integral and differential, it is difficult to program in the computer control system, so it needs to be transformed into a discrete control algorithm. Therefore, Equation (18) is transformed into a transfer function form: Equation (18) is discretized, and many sampling time points KT are used instead of continuous time t. The integral part is added, and the differential part is expressed by increment. Let t ≈ kT, so that: Among them, k(k = 0, 1, 2, 3, . . .) is the sampling time point. T is the sampling period. In order to represent clarity and reduce the calculation time, the value of T is reduced, and then e(kT) ≈ e(k) in Equation (21).
Substitute Equation (20) and Equation (21) into Equation (18) to get: Simplifying Equation (22) can be redescribed as: Equation (23) can also be called position PID control. Where, u(k) is the output of the kth sampling, e(k) is the error of the kth sampling, e(k − 1) is the error of the (k − 1)th sampling, K I = K P T T I is the integral coefficient, and K D = K P T D T is the differential coefficient. It can be seen from Equation (23) that the biggest disadvantage of using this algorithm to program is that each output of the system is closely related to the cumulative error at all times. Each calculation needs to accumulate an error at each time, resulting in a large amount of calculation and waste of computing resources. In order to avoid the above problems, using incremental PID algorithm, it can be seen from Equation (23): By subtracting Equation (23) from Equation (24): where, ∆u(k) is the increment of the output value at the kth sampling, and e(k − 2) is the error at the (k − 2)th sampling. The incremental PID algorithm does not need cumulative calculation and only needs one calculation cycle to correct the error. The whole system has strong fault tolerance, convenient implementation, and wide application.

PID-DAVAR Adaptive Algorithm
In order to better analyze the dynamic characteristics of the MEMS gyroscope's random noise [27], the PID-DAVAR adaptive algorithm is proposed. It can automatically adjust the length of the truncation window according to the fluctuation of the MEMS gyro's signal [28]. The adaptive calculation is performed every t 0 time. The deviation index ε of the data needs to be calculated in this truncation window before PID-DAVAR adaptive algorithm.
where, σ is the standard deviation of the data in the truncation window, d ave and is the average value of the data in the truncation window. The specific flow chart is shown in Figure 2. The premise of the PID-DAVAR adaptive algorithm is to input the measured MEMS gyroscope original signal, sampling time T, set the initial window length L 0 , and the initial deviation index ε 0 = 0. The deviation index ε k is calculated by Equation (26). The deviation index ε k can be regarded as e(k) in Equation (25). The difference between ε k and ε k−1 is multiplied by K p as the proportional term of the output of the PID-DAVAR adaptive algorithm. The integral term and differential term are also replaced by the deviation index ε k . The output of the PID-DAVAR adaptive algorithm is added to the previous window length L k−1 to obtain the current window number L k . According to the length of current windows L k , the Allan variance at t k can be calculated. ∆t is the time interval between two adjacent truncation windows. When t k < T the t k is shifted by ∆t and continues to enter the calculation cycle of Allan variance. When t k ≥ T all the calculated Allan curves are superimposed in chronological to obtain the DAVAR 3D diagram.
When the fluctuation deviation index ε is large, the output data of the MEMS gyroscope fluctuates violently. At this time, the length of the truncation window is reduced, the instability of the data is accurately characterized, and a better tracking effect is achieved. When the fluctuation deviation index ε is small, the output data of the MEMS gyroscope is stable. At this time, the length of the truncation window should be increased, which not only highlights the stationary characteristics of the data but also ensures the variance confidence of DAVAR. This algorithm can adaptively adjust the length of the window according to the fluctuation characteristics of the data, realizing the real-time tracking of unstable data and ensuring the variance confidence of DAVAR. Meanwhile, it also reduces the amount of calculation, shortening the running time and improving computational efficiency. gyroscope is stable. At this time, the length of the truncation window should be increased, which not only highlights the stationary characteristics of the data but also ensures the variance confidence of DAVAR. This algorithm can adaptively adjust the length of the window according to the fluctuation characteristics of the data, realizing the real-time tracking of unstable data and ensuring the variance confidence of DAVAR. Meanwhile, it also reduces the amount of calculation, shortening the running time and improving computational efficiency.

Experimental
In order to verify the PID-DAVAR adaptive algorithm, experiments were performed at a room temperature of 25 °C. The MEMS gyroscope with the model MGZ211HC was placed on the vibration tester platform to collect the dynamic output signal. The STM32F2103MCU communicated with the MGZ211HC gyroscope through full-duplex SPI communication. The sampling frequency was set to 100 Hz and the sampling interval was 0.01 s. In order to ensure the integrity of the data, the data was continuously collected and sent to the PC for recording in real-time by USART. The experimental device and output signal are shown in Figures 3 and 4.

Experimental
In order to verify the PID-DAVAR adaptive algorithm, experiments were performed at a room temperature of 25 • C. The MEMS gyroscope with the model MGZ211HC was placed on the vibration tester platform to collect the dynamic output signal. The STM32F2103MCU communicated with the MGZ211HC gyroscope through full-duplex SPI communication. The sampling frequency was set to 100 Hz and the sampling interval was 0.01 s. In order to ensure the integrity of the data, the data was continuously collected and sent to the PC for recording in real-time by USART. The experimental device and output signal are shown in Figures 3 and 4.
The MEMS gyroscope's original output signal is shown in Figure 4. The vibration platform starts to vibrate at t = 40 s, the vibration frequency is 60 Hz, and the duration is 30 s. The second and third vibrations started at t = 230 s and t = 460 s, respectively. The vibration frequencies are 65 Hz and 70 Hz, and the duration times are both 50 s. Then, DAVAR is used to analyze the vibration data, and the length of the truncation window is set to L = 1001 and L = 3001, the traditional DAVAR method and the PID-DAVAR adaptive algorithm are analyzed respectively. The results are shown in Figure 5.  Micromachines 2023, 14, x FOR PEER REVIEW 9 of 15  The MEMS gyroscope's original output signal is shown in Figure 4. The vibration platform starts to vibrate at t = 40 s, the vibration frequency is 60 Hz, and the duration is 30 s. The second and third vibrations started at t = 230 s and t = 460 s, respectively. The vibration frequencies are 65 Hz and 70 Hz, and the duration times are both 50 s. Then, DAVAR is used to analyze the vibration data, and the length of the truncation window is set to L = 1001 and L = 3001, the traditional DAVAR method and the PID-DAVAR adaptive algorithm are analyzed respectively. The results are shown in Figure 5.   The MEMS gyroscope's original output signal is shown in Figure 4. The vibration platform starts to vibrate at t = 40 s, the vibration frequency is 60 Hz, and the duration is 30 s. The second and third vibrations started at t = 230 s and t = 460 s, respectively. The vibration frequencies are 65 Hz and 70 Hz, and the duration times are both 50 s. Then, DAVAR is used to analyze the vibration data, and the length of the truncation window is set to L = 1001 and L = 3001, the traditional DAVAR method and the PID-DAVAR adaptive algorithm are analyzed respectively. The results are shown in Figure 5. As can be seen in Figure 5, the MEMS gyroscope's output signal behaves differently for varying window lengths. When the truncation window of length L = 1001, the data fluctuation is not stable, and the curve has more inflection points, the difference between the maximum and minimum values of Z-axis data fluctuation is 418.28. When the truncation window of length L = 3001, the fluctuation of the data becomes stable and the curve is smooth, the difference between the maximum and minimum values of Z-axis data fluctuation is 275. 19. When the length of the truncation window is adaptive, the output signal of the MEMS gyroscope changes drastically under vibration. In the absence of vibration, the signal is stable and the curve is smooth, the difference between the maximum and minimum values of Z-axis data fluctuations is 386.71.  As can be seen in Figure 5, the MEMS gyroscope's output signal behaves differently for varying window lengths. When the truncation window of length L = 1001, the data fluctuation is not stable, and the curve has more inflection points, the difference between the maximum and minimum values of Z-axis data fluctuation is 418.28. When the truncation window of length L = 3001, the fluctuation of the data becomes stable and the curve is smooth, the difference between the maximum and minimum values of Z-axis data fluctuation is 275. 19. When the length of the truncation window is adaptive, the output signal As the length of the truncation window is adaptively adjusted, the number of windows changes with the DAVAR calculation process as shown in Figure 6. Kurtosis is used to represent the degree of fluctuation of data. At t = 41 s-76 s, t = 234 s-291 s, and t = 63 s-519 s, the length of the truncation window gradually decreases with the fluctuation of the kurtosis. The larger the kurtosis value, the smaller the corresponding truncation window length to ensure the dynamic tracking effect of the gyroscope's signal. By automatically adjusting the length of the truncation window, the algorithm accurately and clearly shows the unstable characteristics of the MEMS gyroscope's signal, shortens the running time, and improves the operating efficiency. minimum values of Z-axis data fluctuations is 386.71.
As the length of the truncation window is adaptively adjusted, the number of windows changes with the DAVAR calculation process as shown in Figure 6. Kurtosis is used to represent the degree of fluctuation of data. At t = 41 s-76 s, t = 234 s-291 s, and t = 63 s-519 s, the length of the truncation window gradually decreases with the fluctuation of the kurtosis. The larger the kurtosis value, the smaller the corresponding truncation window length to ensure the dynamic tracking effect of the gyroscope's signal. By automatically adjusting the length of the truncation window, the algorithm accurately and clearly shows the unstable characteristics of the MEMS gyroscope's signal, shortens the running time, and improves the operating efficiency. Taking the data in t = 234 s-291 s as an example, the tracking ability and data processing time of the fixed window and adaptive window are compared in Table 2. The CPU model used in this paper is Intel (R) Core (TM) i3-10100F, and the RAM of the machine is 32.0 GB. It can be seen from Table 2 that the starting point of data mutation under the PID-DAVAR adaptive algorithm is t = 235.5 s, which is closest to the mutation reference value t = 237.3 s. It shows that the PID-DAVAR adaptive algorithm has a better tracking ability for abrupt signals than fixed window DAVAR. The total time is 8.65 s, which is nearly 10 times less than the fixed window DAVAR. It can be seen that the PID-DAVAR adaptive algorithm can not only characterize the fluctuation and mutation characteristics of MEMS gyroscope signals but also shorten the time of data processing.
In order to verify the tracking ability of the PID-DAVAR adaptive algorithm to random error, angle random walk, bias instability, and rate random walk are selected for Taking the data in t = 234 s-291 s as an example, the tracking ability and data processing time of the fixed window and adaptive window are compared in Table 2. The CPU model used in this paper is Intel (R) Core (TM) i3-10100F, and the RAM of the machine is 32.0 GB. It can be seen from Table 2 that the starting point of data mutation under the PID-DAVAR adaptive algorithm is t = 235.5 s, which is closest to the mutation reference value t = 237.3 s. It shows that the PID-DAVAR adaptive algorithm has a better tracking ability for abrupt signals than fixed window DAVAR. The total time is 8.65 s, which is nearly 10 times less than the fixed window DAVAR. It can be seen that the PID-DAVAR adaptive algorithm can not only characterize the fluctuation and mutation characteristics of MEMS gyroscope signals but also shorten the time of data processing.
In order to verify the tracking ability of the PID-DAVAR adaptive algorithm to random error, angle random walk, bias instability, and rate random walk are selected for identification analysis. Figure 7 shows the variation curves of noise coefficients under different window lengths.
As the gyroscope is in a static state (t = 0-40 s, t = 77-233 s, t = 292-465 s, t = 520-600 s) in Figure 7, the coefficient of each noise is small without obvious fluctuation. As the shaker starts to vibrate at 60 Hz, 65 Hz, and 70 Hz (t = 41-76 s, t = 234-291 s, t = 463-519 s), the noise terms of the gyroscope change significantly. When the shaker stops vibrating, all the noise terms of the gyroscope are restored to the previous state. When L = 1001, the three noise coefficients of the gyroscope change significantly under dynamic conditions, and it is difficult to accurately locate the mutation point of the signal. When L = 3001, the three noise coefficient curves of the gyroscope are relatively smooth, and it is difficult to determine the specific location of the mutation. Using the PID-DAVAR adaptive algorithm, the mutation trend is slow and the steady state can be restored at the fastest speed. The algorithm can not only clearly obtain the position of the mutation point, but also accurately express the variation characteristics of the noise coefficient under dynamic conditions. identification analysis. Figure 7 shows the variation curves of noise coefficients under different window lengths. As the gyroscope is in a static state (t = 0-40 s, t = 77-233 s, t = 292-465 s, t = 520-600 s) in Figure 7, the coefficient of each noise is small without obvious fluctuation. As the shaker starts to vibrate at 60 Hz, 65 Hz, and 70 Hz (t = 41-76 s, t = 234-291 s, t = 463-519 s), the noise terms of the gyroscope change significantly. When the shaker stops vibrating, all the noise terms of the gyroscope are restored to the previous state. When L = 1001, the three noise coefficients of the gyroscope change significantly under dynamic conditions, and it is difficult to accurately locate the mutation point of the signal. When L = 3001, the three noise coefficient curves of the gyroscope are relatively smooth, and it is difficult to determine the specific location of the mutation. Using the PID-DAVAR adaptive The angular rate signal of MGZ211HC gyro acquired at room temperature and stationary state is calculated by Allan variance. The calculated angular random walk, bias instability, and rate random walk are used as reference values. In order to verify the tracking ability and variance confidence of the PID-DAVAR adaptive algorithm, 100 sets of sample data are selected to calculate the average value of the three noise coefficients, which are compared with the reference values. The comparison results are shown in Table 3. When L = 1001, the length of the truncation window is fixed to 1001 data. At this time, fewer data are selected, which leads to obvious changes in the coefficients of angular random walk, bias instability, and rate random walk. The values are: 2.01( • ) · h −1/2 , 14.71( • ) · h −1 , and 91.04( • ) · h −3/2 . These three coefficients have large errors compared with the standard values. Therefore, the setting of this window length does not guarantee the MEMS gyro variance confidence. When L = 3001, the length of the truncation window is fixed to 3001 at this time. Due to the large number of selected data, the angle random walk, bias instability, and rate random walk coefficients do not change significantly, and the values become smaller, which are 1.99( • ) · h −1/2 , 7.86( • ) · h −1 , and 34.07( • ) · h −3/2 , respectively. Compared with the reference value, the error between the two is larger and the calculation time is prolonged. Therefore, the setting of this window length cannot accurately represent the dynamic characteristics of the MEMS gyroscope's random noise. When the window length is adaptive, the length of the truncation window is variable. The larger the fluctuation of the data, the shorter the window length, and vice versa. The coefficients of angular random walk, bias instability, and rate random walk are closer to the reference value. Their values are 1.79( • ) · h −1/2 , 15.32( • ) · h −1 , and 95.76( • ) · h −3/2 , which differ from the reference value by 0.07( • ) · h −1/2 , 3.57( • ) · h −1 , and 6.62( • ) · h −3/2 respectively. The errors are 4%, 19%, and 6% respectively, and the average error is about 10%. By using adaptive window length based on the adaptive PID principle, PID-DAVAR adaptive algorithm can describe the dynamic characteristics of MEMS gyro's random noise precisely with fewer computing resources, ensuring the confidence of variance and high efficiency.

Conclusions
Random noise is a key factor affecting the performance improvement of the MEMS gyroscope. It is necessary to dynamically analyze and identify various noise items in MEMS gyroscope. In order to dynamically analyze the random noise characteristics of the MEMS gyroscope, PID-DAVAR adaptive algorithm is proposed in this paper. The PID-DAVER adaptive algorithm combines the PID principle and the DAVAR method to realize the adaptive adjustment of the truncation window's length. The algorithm can adjust the length of the truncation window according to the size of the data fluctuation kurtosis. The larger the kurtosis is, the shorter the length of the truncation window, and the better the tracking effect of the abrupt signal. The smaller the kurtosis is, the longer the truncation window length is, and the signal is stable and the curve is smooth. According to the experimental results, the noise coefficient calculated by the PID-DAVAR adaptive algorithm is more accurate than the traditional DAVAR method. The average error of the coefficients of angular random walk, bias instability, and rate random walk is only 10%, and the minimum coefficient error reaches 4%. It only takes 8.65 s to calculate and draw the DAVAR three-dimensional diagram of 60,000 data. The algorithm saves a lot of computing resources and shortens the calculation time. It is beneficial to realize real-time online analysis and error compensation of MEMS gyro dynamic noise. The PID-DAVAR adaptive algorithm effectively guarantees the variance confidence of the MEMS gyroscope's signal processing and improves the tracking ability of signal mutation. In practical applications, especially when inertial navigation devices such as MEMS gyroscopes and fiber optic gyroscopes work in harsh environments, the PID-DAVAR adaptive algorithm provides further technical support for the dynamic analysis of gyro random error terms. When the