With the development of MEMS and inertial technology, MEMS inertial device technology is more and more mature. MEMS gyroscope is widely used in low-cost attitude measurement system because of its high performance, small size, low energy consumption, high reliability, light weight and low price. However, the MEMS gyroscope is limited by the manufacturing process. Compared with the inertial gyroscope manufactured by the traditional process, the output data of MEMS gyroscope has large random noise under the influence of temperature and peripheral circuit, which affects its measurement accuracy. In order to reduce the influence of random noise on the measurement accuracy of the system, it is necessary to establish an accurate random noise model according to a large number of gyro actual measurement data, and select a reasonable and effective method for filtering compensation according to the noise model, so as to improve the measurement accuracy of the system. In recent years, in the application of MEMS gyroscope, the methods of modeling gyroscope random noise mainly include wavelet analysis, neural network and time series analysis, and the filtering method is to carry out certain data processing according to the model. The main filtering technologies used for the above modeling methods include proton filtering, robust filtering, Kalman filtering and improved filtering technology.
In the practical application of MEMS gyroscope in attitude measurement system, in order to collect the attitude information of the system in real time, the data acquisition, processing and calculation must meet the real-time requirements of the system. The noise model established by wavelet analysis, neural network and other methods usually has a high order, which is difficult to be realized in engineering and meet the real-time requirements of the system. By using time series analysis method and AR modeling of gyro random noise, the random noise model of conventional gyro can be established effectively. In this paper, based on the application of small UAV attitude measurement system, according to the actual test data of MEMS gyroscope in the system design, the modeling method and Kalman filtering method for its random noise data are studied in detail.
1 gyro error modeling
1.1 raw data collection
The main controller of the system communicates with the MEMS gyroscope through the serial data interface SPI. The angular rate sampling period of the gyroscope is 20ms, and the test data is collected for 20min under the static state of the gyroscope. Figure 1 shows the original noise data when the z-axis of the gyroscope is at zero, with a total of 10000 groups of sampling data.
Through the analysis of the original data of MEMS gyroscope noise, we can know that the noise contains random drift component and constant term, and the noise sample sequence obtained by removing the constant term is a random time series. According to the method of time series analysis, the random time series samples are modeled. The model can be used to approximate the real noise data. The time series model can be used to predict the gyro noise. The filtering technique can be used to remove the noise characteristics and improve the measurement accuracy of the system.
1.2 data preprocessing
The original noise data of MEMS gyroscope includes constant component and random component. Constant components can be extracted by means of the mean method. When the gyro works for a short time, it can be compensated by this method. When it works for a long time, it needs to consider its own constant drift. Simply using the mean method to remove the constant components can not get an effective random drift sequence. By analyzing the measured data of gyro, considering the sampling period and service period of gyro raw data, this paper adopts the real-time moving average algorithm to process the gyro raw data, and takes the real-time collected value and the average value of the previous nine sampling points as the constant component at the current time. The selection of sampling points needs to consider the real-time performance of practical application and gyro constant drift characteristics. If the number of sampling points is too small, the average effect is not good; If there are too many points, it will directly affect the real-time performance of gyro measurement. In UAV attitude control, it will directly affect the mobility and stability of the system.
At the beginning of modeling, we judge the stationarity and normality of the pretreated MEMS Gyroscope Random noise signal to ensure that the pretreated data really meet the requirements of time series modeling.
1.3 gyro error modeling
After data preprocessing, the gyro noise data is modeled by time series. In this paper, considering the real-time and applicability of the system and AIC criteria, the AR model of time series analysis method is selected to model the gyro random noise.
The general format of AR (P) model is as follows:
Where AP is the model regression coefficient, X (k) is the model output, w (k) is the model noise sequence, and P is the model order.
According to the minimum AIC standard, the mathematical model of gyro drift is determined. By analyzing the test data of gyro noise characteristics, AR (1) with the minimum AIC value is selected as the gyro drift model.
The AR (1) model of gyro is as follows
Where A1 is the regression coefficient of the model, X (k) is the measured value, and w (k) is the noise sequence.
The regression coefficient A1 of AR (1) model can be calculated by 10000 groups of noise data measured by gyro in static state. The regression coefficient A1 of AR (1) model is 0.77 by Yule Walker calculation method in MATLAB software.
2 Kalman filter
2.1 establishment of Kalman filter equation
In the process of random signal processing, according to the characteristics of system noise and observation noise, Kalman filter takes the observation of the system as the input of the filter and the estimated value as the output of the filter. The filter estimates the required processing data according to the state equation and observation equation. It is simple and easy to implement in engineering application, and is a real-time recursive optimal estimation method. In this paper, based on the establishment of the gyro noise model, the Kalman filtering method is used to filter the gyro noise.
According to the first-order AR (1) model, the discrete Kalman filter is used to estimate the gyroscope sampling data
Let VK be the measurement noise sequence, then the observation equation of the system is:
Where C = [1,0]; XK is the state estimation value obtained from the gyro sampling data, wk is the system noise, ZK is the gyro noise measurement value, and VK is the observation noise. According to the test characteristics of gyroscope at rest, it can be assumed that the mathematical statistical characteristics of system noise wk and observation noise VK (k = 0, 1, 2, 3,…) are e (VK) = e (wk) = 0.
2.2 filtering recurrence formula
According to the state equation, observation equation and Kalman filtering recursive formula, the filtering algorithm of the whole system can be obtained. The input ZK of the filter is zero drift data, and the initial condition P0 is the second order unit matrix, and 0 is [0, 0] t.
Real time state prediction matrix:
k/k－1= Φ k－1
One step prediction of covariance matrix is as follows:
Pk/k-1= Φ Pk-1 Φ+ HQHT
Update of covariance matrix estimation:
The significance of each variable is shown in Table 1.
3 data analysis
Kalman filtering analysis is carried out on the measured data through MATLAB, and Figure 2 shows the zero point data output curve of gyroscope after Kalman filtering. The mean value and variance of gyro noise data before and after filtering are shown in Table 2. The mean value of noise after filtering is 30% less than that before filtering, and its variance is 1 ~ 2 orders of magnitude smaller than that before filtering. Through the analysis and comparison of mean value and variance, it can be seen that the Kalman filtering method based on AR (1) model of gyro noise can effectively reduce the gyro noise characteristics, The noise dispersion is also significantly reduced. The data curve of gyro noise after filtering is shown in Figure 2. By comparing the gyro noise curves in Fig. 1 and Fig. 2, we can directly see the data changes before and after filtering.
In this paper, the noise characteristics of MEMS gyroscope are studied through experimental simulation. Taking the real gyroscope noise data as the processing object, a data preprocessing method with good real-time performance is designed. The preprocessed data is modeled by time series analysis method and filtered by Kalman filtering technology. The simulation results show that the noise modeling method and filtering technology can effectively reduce the random noise characteristics of gyroscope, reduce the random dispersion degree of noise, improve the measurement accuracy of gyroscope in attitude measurement system, and improve the application value of MEMS gyroscope.