A LSTM-RNN-Based Fiber Optic Gyroscope Drift Compensation

Fiber optic gyroscope (FOG) inertial measurement unit (IMU) containing a three-orthogonal gyroscope and three-orthogonal accelerometer has been widely utilized in positioning and navigation of military and aerospace ﬁelds, due to its simple structure, small size, and high accuracy. However, noise such as temperature drift will reduce the accuracy of FOG, which will aﬀect the resolution accuracy of IMU. In order to reduce the FOG drift and improve the navigation accuracy, a long short-term memory recurrent neural network (LSTM-RNN) model is established, and a real-time acquisition method of the temperature change rate based on moving average is proposed. In addition, for comparative analysis, backpropagation (BP) neural network model, CART-Bagging, classiﬁcation and regression tree (CART) model, and online support vector machine regression (Online-SVR) model are established to ﬁlter FOG outputs. Numerical simulation based on ﬁeld test data in the range of -20 ° C to 50 ° C is employed to verify the eﬀectiveness and superiority of the LSTM-RNN model. The results indicate that the LSTM-RNN model has better compensation accuracy and stability, which is suitable for online compensation. This proposed solution can be applied in military and aerospace ﬁelds.


Introduction
FOG is a kind of optical fiber sensor based on Sagnac effect, which is widely used in strapdown inertial navigation system (SINS) and engineering at present. In addition, FOG has been broadly used in military and aerospace fields because of its simple structure, small size, and high accuracy. e accuracy of FOG is greatly affected by the surrounding environment, especially the environment temperature change [1], which will bring errors to the FOG output. erefore, there are two ways to compensate FOG drift. e first one is temperature control and compensation in hardware, which is efficient but high cost and complex. e second one is compensation FOG drift in software by analyzing the test data, which is easy implementation and utility draws lots of the researcher's attention. Studies [2,3] have shown that the FOG drift has a strong nonlinearity, and the general approach of polynomial linear fitting methods cannot express the nonlinear characteristics of FOG exactly. Some optimization algorithms and artificial neural networks [4] can better approximate nonlinear problems. With this consideration, this paper is devoted to compensating FOG drift by using several fine artificial intelligence algorithms. e past few decades have seen the fruitful methods' development for the compensation of FOG drift such as the neural network model [5,6], autoregressive integrated moving average (AIMA) model [7,8], adaptive compensation model [9,10], and deep learning model [11,12]. Pan et al. [13] applied the neural network method to the fitting and compensation of the FOG temperature drift model. However, random white noise in FOG output data was not considered, which might lead to overfitting of the network model. Guo et al. [14] used a BP neural network algorithm based on optimized prediction data, which could effectively reduce the influence of random white noise in FOG data on the model compensation accuracy. However, the establishment and learning process of the neural network belong to the nondeterministic polynomial (NP) problem. It is difficult to find a suitable network structure, which may lead the generalization ability of the neural network insufficient. erefore, some researchers have introduced some optimization algorithms to tackle the limitations. e genetic algorithm (GA) was applied by Pan et al. [15], the artificial fish swarm algorithm was applied by Song et al. [16], and the particle swarm optimization (PSO) was applied by Wang, Cheng, and Tong et al. [17][18][19]. e experimental results indicated that the optimized models are effective and can improve the system's performance. In addition, the idea of ensemble learning [20] is used by Liu et al. [21]. e BP-Bagging model of FOG temperature drift was established, which had better compensation effect than the linear regression model and BP neural network model.
In recent years, deep learning models, such as recurrent neural network (RNN) and convolutional neural network (CNN), have been rapidly developed and widely applied in the data science community. LSTM-RNN [22] is a time series prediction model, which can address the long-term memory compared with RNN. Jiang et al. [23] proposed a LSTM-RNN-based microelectromechanical system (MEMS) IMU errors' modelling method, which achieved better denoising effect than the ARMA model and performed excellently in time series signal processing. In addition, LSTM-RNN has performed excellently in speech recognition, Google translate, image recognition, and others [24][25][26]. erefore, we establish the LSTM-RNN model to compensate FOG drift. Moreover, the BP model, CART-Bagging model, and Online-SVR model are established, respectively, for comparing and analyzing. e structure of this paper is arranged as follows. e mechanism of FOG temperature drift is briefly reviewed in Section 2, with an emphasis to Shupe effect. In Section 3, the BP, CART-Bagging, Online-SVR, and LSTM-RNN are established, respectively. Simulation results based on field test data are reported in Section 4. Finally, Section 5 draws the conclusions.

Problem Statement
FOG drift is mainly caused by temperature change and vibration [27]. According to Shupe's study [28], the change of temperature will cause different refractive index of optical fiber in every sector of the fiber coil, which is called Shupe effect.
Denote that the optical wave of FOG propagates along the fiber coil with length L and refractive index n. When the environment temperature changes, the possible phase delay can be written as where β 0 � 2π/λ is the propagation constant of light in vacuum, λ is the light wavelength, n is the refractive index of the fiber coil, L is the length of the fiber coil, z n /z T is the temperature coefficient of the refractive index, α is the temperature expansion coefficient of the optical fiber material, and ΔT (z) is the temperature gradient value of the fiber ring at position z. According to (1), the thermally induced nonreciprocal phase delay produced by two beams along counterclockwise (CCW) and clockwise (CW) can be expressed as where ϕ ccw (t) is the phase shift caused by the interference light propagating along the fiber ring counterclockwise, ϕ cw (t) is the phase shift generated by the interference light propagating along the fiber ring clockwise, c is the propagation speed of the light, and z is the distance from any point to the end point. According to (2) and (3), the Shupe nonreciprocal phase delay caused by temperature effects can be calculated as where c 0 is the speed of light in vacuum. e influence of temperature on FOG drift is mainly manifested in three aspects: temperature change, temperature gradient, and temperature change rate [6]. e common method in engineering is to approximate the variation of FOG drift in a linear relationship and establish a polynomial model. In fact, the temperature characteristics of FOG drift have complex nonlinear characteristics, and the general approach of polynomial linear fitting methods cannot express the nonlinear characteristics of FOG exactly.

Theory of Modelling for FOG
In this section, the conventional BP and CART-Bagging representing the postprocessing methods and the Online-SVR and LSTM-RNN representing real-time methods are presented. e principles, basic equations, and information flow are briefly introduced.

BP Model.
Essentially, the BP neural network is a mapping from input to output, and a 3-layer forward network can approximate any continuous function at any expected accuracy. erefore, a 3-layer neural network is established in this paper, and its structure is shown in Figure 1. e output of the BP neural network can be given by where P is the input vector, W 1 and W 2 are weight matrices, and b 1 and b 2 are bias vectors. In this paper, the specific setting of important parameters of the BP model is shown in Table 1.

CART-Bagging Model.
e decision tree model is a classification algorithm [29], which is similar with tree structure. Test the data from the root node; then, the data will be divided into different subsets by using different test results. And, each data sample subset constitutes a subnode. e CART regression tree is a kind of decision tree [29], which analyses continuously distributed data and supports the processing when the data feature is continuous distribution. e CART regression tree algorithm can be regarded as a collection of many if-then rules. Every path from the root node to the leaf node has a rule [30], and the leaf node corresponds to the conclusion of the rule. ere is a termination condition in the process of training a model, which is the threshold condition from the root node to the leaf node.
At present, the most widely used ensemble learning algorithms are bagging and boosting [31]. e bagging algorithm uses the bootstrapping method to extract the training set and put them back after training. e prediction result is the average of the results of several base models, which are suitable for processing the temperature drift data of FOG. erefore, as shown in Figure 2, we combine the CART regression tree with the bagging algorithm, which is recorded as the CART-Bagging model in this paper. e algorithm flow of CART-Bagging can be summarized as Algorithm 1.
In this paper, the maximum depth of CART is d � 8, the maximum number of leaf nodes is m � 40, and the number of decision trees is L � 10.

Online-SVR Model.
e Online-SVR algorithm, an online regression modelling method, is a time series analysis method, which can realize online dynamic update [32,33]. e main difference between the Online-SVR model and traditional SVR model is the way of data processing [34]. Compared with the traditional SVR method, the data in the Online-SVR model is gradually generated in an orderly manner, and the computer cost in each iteration does not increase.
Denote the initial data size as S. For any orthogonal basis ρ 1 , ρ 2 , . . . , ρ k in Hilbert space H, k i�1 cos 2 (ρ i , θ) � 1 can be given by θ ∈ H, where cos(x, y) is the cosine function of vectors x and y and cos(x, y) � x T y÷(‖x‖ × ‖y‖).
A vector sequence α 1 , α 2 , . . . , α 3 is constructed firstly, where α k � Φ(x i )y j − Φ(x j )y i and k � 1, 2, l(l-1)/2. Φ is a nonlinear mapping, which can map the input data to a high-dimensional feature space. en, an orthogonal vector sequence β 1 , β 2 , . . . , β d should be constructed, and where where ‖W‖ is the Euclidean norm of W, which can be formulated as erefore, the optimal kernel function parameters can be obtained by minimizing ‖W‖. When a new sample (l + 1)th enters, we need to judge whether it is suitable for the current model. If α l+1 � d i�1 β i α T l+1 β i , then the model remains unchanged. Otherwise, the optimal model needs to be updated. 1, i, j), and β d+1 in turn for updating the model, which can be given by where i * is any value in 1, 2, . . . , l { }. erefore, the acquisition of the optimal model only needs to calculate the cost of the minimization optimization problem corresponding to the optimal kernel selection, and the whole calculation cost in each iteration is not increased compared with the traditional SVM training. e real-time compensation process is shown in Figure 3, and the algorithm flow of Online-SVR can be summarized as Algorithm 2.  Figure 1: Structure of the three-layer BP neural network.

LSTM-RNN Model.
RNN is a deep learning algorithm, which is mainly used to deal with sequence prediction problems. As shown in Figure 4, the output of the last calculation "State t " and the input at the current time "Input t " are used in each cycle of RNN. e output of RNN contains all the previous information, which is the time series prediction.
However, in RNN, the more recent time has a greater impact on the current time, which may cause gradient disappearance or gradient explosion [35]. Compared with RNN, LSTM-RNN adds a structure that can transmit data at multiple time steps, which can save long-ago information and effectively solve the problems of gradient disappearance and gradient explosion. As shown in Figure 5, LSTM-RNN is affected by the input of the previous layer, the pervious time state of the current layer, and the internal state of the LSTM-RNN. A LSTM unit is composed of an "output gate," a "forget gate," an "input gate," and a "memory cell," and the state vector of LSTM can be set by i t , f t , o t , and c t . e algorithm flow of LSTM-RNN can be summarized as Algorithm 3.
It should be noted that BP and CART-Bagging belong to postprocessing algorithms, which are only used as controlled experimental. Online-SVR and LSTM-RNN belong to time series analysis methods, which can realize real-time compensation.
is paper aims to verify the effect of LSTM-RNN.

Experimental Study
In this section, a real-time acquisition method of the temperature change rate based on moving average is proposed. And, we design a temperature test. ree FOGs, which are denoted by Gyro 1 to Gyro 3 in this paper, are used to validate the compensation methods abovementioned.

Temperature Experiment for FOGs.
In order to evaluate the performance of the LSTM-RNN method, a temperature control experiment was carried out. In the experiment test, the gyro unit is fixed in a horizontal static temperature chamber, and gyroscopes are only affected by the rotation of the Earth. e temperature range of this experiment is −20°C to 50°C. e raw datasets of FOGs are logged and saved, which are applied to verify our established model. e update rate of FOGs is 200 Hz. In Figure 6, the smoothed Gyro 1 original output, temperature change, and temperature change rate with time are shown, and the average value for 1 minute data is used for 1 cluster. Gyro 1 drift is greatly affected by the temperature change rate.
Although the effectiveness of BP, CART-Bagging, and Online-SVR to compensate FOG drift has been proved in our previous work, it is necessary to experiment again.
M is the current time, which is an integer.
ALGORITHM 2: Online-SVR. Algorithm procedure of the Online-SVR model.
Output t Output t+1 Figure 4: e basic structure of RNN.

Mathematical Problems in Engineering
Actually, the superiority of compensating FOG drift can also be illustrated through the comparison of BP, CART-Bagging, Online-SVR, and LSTM-RNN, which will be shown in the following study.

Real-Time Acquisition of Temperature Change Rate.
Different from the offline model, in order to realize the online compensation, the issue of real-time and stable acquisition of the temperature change rate needs to be solved first. Temperature change is a time series problem. e temperature at time i is only related to the environmental temperature at time i and before time i. Based on this characteristic, as shown in Figure 7, this paper establishes a real-time acquisition method of the temperature change rate based on moving average. A moving window with length K is constructed. Firstly, a section of temperature data with length K is output; then, the temperature T 1 at K/2 is the average value of the previous K temperature data. erefore, the temperature change rate at any time i can be given by where T(i) is the temperature at time i, _ T(i) is the temperature change rate at time i, and f is the output frequency of temperature data.
According to (10), the noise pollution caused by temperature sensor measurement and data transmission can be effectively reduced by choosing an appropriate moving average window length K. In addition, this method is effective to avoid the temperature change rate to be zero, which is caused by high temperature measurement frequency and is harmful for compensation models.   Mathematical Problems in Engineering In this paper, the moving average window length is k � 12000, the length of each movement is 1, and the realtime temperature change rate _ T(i) is calculated by (10). e Online-SVR model has poor performance in the compensation experiment of Gyro 3.

Mathematical Problems in Engineering
And, the LSTM-RNN model has stable performance and good effect in the three experiments. In this paper, the mean and standard deviation of FOG drift before and after compensation are used to compare the compensation effect of the models. In addition, the mean absolute error (MAE) and root mean square error (RMSE) are used to compare the stability and effect of the models. MAE and RMSE are calculated as (11) and (12), and the smaller the value of RMSE and MAE, the better the model compensation effect: From Tables 2 to 4, the LSTM-RNN model has better compensation accuracy and stability than the BP model, CART-Bagging model, and Online-SVR model. In addition, the model has high operation efficiency, which can meet the real-time requirements of compensation.

Conclusion
is paper discussed a FOG drift modelling method based on LSTM-RNN.
ree FOGs were employed for a temperature control experiment to test the proposed method. By analyzing and preprocessing the FOG outputs from −20°C to 50°C, we proposed a real-time temperature change rate acquisition method based on moving average. rough comparing the compensation effect of the BP neural network, CART-Bagging, and Online-SVR, the results show that LSTM-RNN has better compensation accuracy and stability, and the model has high operation efficiency, which can meet the real-time requirements of compensation.
In addition, there are two details that are worthy to investigate in the future: (1) a well-trained LSTM-RNN should be trained with massive data and optimized hyperparameters; more experiments are needed in future; (2) some variants of RNN, such as BRNN [36] and DRNN [37], have been proposed in recent years. It is meaningful to compare the effects of different RNN on compensating FOG drift.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.