# A LSTM-RNN-Based Fiber Optic Gyroscope Drift Compensation

Authors: Ning Mao; Jiangning Xu; Jingshu Li; Hongyang He
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

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 fields, due to its simple structure, small size, and high accuracy. However, noise such as temperature drift will reduce the accuracy of FOG, which will affect 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, classification and regression tree (CART) model, and online support vector machine regression (Online-SVR) model are established to filter FOG outputs. Numerical simulation based on field test data in the range of -20°C to 50°C is employed to verify the effectiveness 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 fields.


---

## Body

## 1. 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. The accuracy of FOG is greatly affected by the surrounding environment, especially the environment temperature change [1], which will bring errors to the FOG output. Therefore, there are two ways to compensate FOG drift. The first one is temperature control and compensation in hardware, which is efficient but high cost and complex. The 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.The 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. Therefore, some researchers have introduced some optimization algorithms to tackle the limitations. The 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–19]. The 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]. The 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 de-noising 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–26]. Therefore, 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.The structure of this paper is arranged as follows. The mechanism of FOG temperature drift is briefly reviewed in Section2, 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.


## 2. 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 lengthL and refractive index n. When the environment temperature changes, the possible phase delay can be written as(1)ϕ=β0nL+β0∂n∂T+nα∫0LΔTzdz,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, ∂n/∂T is the temperature coefficient of the refractive index, α is the temperature expansion coefficient of the optical fiber material, and ΔTz 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(2)ϕccwt=β0nL+β0∂n∂T×∫0LΔTL−z,t−zcdz,(3)ϕcwt=β0nL+β0∂n∂T×∫0LΔTz,t−zcdz,where ϕccwt is the phase shift caused by the interference light propagating along the fiber ring counterclockwise, ϕcwt 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(4)Δϕ=β0c0n∂n∂T∫0L/2ΔTz−ΔTL−z×2z−Ldz,where c0 is the speed of light in vacuum.The influence of temperature on FOG drift is mainly manifested in three aspects: temperature change, temperature gradient, and temperature change rate [6]. The 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.


## 3. 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. The principles, basic equations, and information flow are briefly introduced.


### 3.1. 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. Therefore, a 3-layer neural network is established in this paper, and its structure is shown in Figure1.Figure 1
Structure of the three-layer BP neural network.The output of the BP neural network can be given by(5)y=f2W2f1W1×P+b1+b2,where P is the input vector, W1 and W2 are weight matrices, and b1 and b2 are bias vectors.In this paper, the specific setting of important parameters of the BP model is shown in Table1.Table 1
The parameters setting of the BP model.
ResolverHidden layerActivation functionInitial learning rateLearning rateadam20relu0.1Adaptive


### 3.2. CART-Bagging Model

The 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.The 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. The 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. There 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]. The bagging algorithm uses the bootstrapping method to extract the training set and put them back after training. The prediction result is the average of the results of several base models, which are suitable for processing the temperature drift data of FOG. Therefore, 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. The algorithm flow of CART-Bagging can be summarized as Algorithm 1.Figure 2
CART-Bagging integrated model.Algorithm 1: CART-Bagging. Algorithm procedure of the CART-Bagging model.
(i)
Initialization: the maximum depth of CARTd; the maximum number of leaf nodes m; the number of decision trees L.(ii)
Input: Training samplesS=x1,y1,x2,y2,…,xm,ym(iii)
forM = 1, 2, 3, … do(iv)
ExtractS(i) from S according to a set proportion.(v)
Training CART-Bagging model withS(i).(vi)
If the termination condition is reached on a node(vii)
The node is defined as a leaf node.(viii)
Else(ix)
Continue training.(x)
M = M + 1(xi)
end for(xii)
Output: Average value of each basic model(xiii)
M is the current time, which is an integer.In this paper, the maximum depth of CART isd = 8, the maximum number of leaf nodes is m = 40, and the number of decision trees is L = 10.


### 3.3. Online-SVR Model

The Online-SVR algorithm, an online regression modelling method, is a time series analysis method, which can realize online dynamic update [32, 33]. The 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 asS. For any orthogonal basis ρ1,ρ2,…,ρk in Hilbert space H, ∑i=1kcos2ρi,θ=1 can be given by θ∈H, where cosx,y is the cosine function of vectors x and y and cosx,y=xTy÷x×y.A vector sequenceα1,α2,…,α3 is constructed firstly, where αk=Φxiyj−Φxjyi and k = 1, 2, l(l-1)/2. Φ is a nonlinear mapping, which can map the input data to a high-dimensional feature space. Then, an orthogonal vector sequence β1,β2,…,βd should be constructed, and(6)βi=αi−∑j=1dβjβjαiαi−∑j=1dβjβjαi,where d=rankα1,α2,…,α3 can be obtained by Schmidt orthogonalization. W,β1,…,βk is an orthogonal basis in space H and Φxi∈H, which yields(7)∑j=1dcos2βi,Φxi+cos2W,Φxi=1,where W is the Euclidean norm of W, which can be formulated as(8)W=yix1−∑j=1dcos2βj,Φxi.Therefore, the optimal kernel function parameters can be obtained by minimizingW. When a new sample l+1th enters, we need to judge whether it is suitable for the current model. If αl+1=∑i=1dβiαl+1Tβi, then the model remains unchanged. Otherwise, the optimal model needs to be updated. Calculate Ad+1,i,j, Bd+1,i,j, γd+1, Cd+1,i,j, and βd+1 in turn for updating the model, which can be given by(9)Cl,i,j=Βl+iyj−Βl+jyi,Al,i,j=Kxl,xiyi−Kxl,xjyi,Βl+i=βlTΦxi,γj=βjTΦxi∗=Βj,i∗,where i∗ is any value in 1,2,…,l.Therefore, 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. The real-time compensation process is shown in Figure3, and the algorithm flow of Online-SVR can be summarized as Algorithm 2.Figure 3
Real-time compensation process of Online-SVR.Algorithm 2: Online-SVR. Algorithm procedure of the Online-SVR model.
(i)
Initialization:Ker∑=K1∑,K2∑,…,Kp∑, where Ki∑ is the kernel function of type i with continuously adjusting kernel parameter ∑.(ii)
Input: Training samplesS=x1,y1,x2,y2,…,xm,ym(iii)
forM = 1, 2, 3, … do(iv)
Optimal kernel function selection.(v)
For eachK∑:=K∑∈Ker∑, calculate the optimization problem Λ∗=argminΛ∈∑FKΛ, where FK=W2=yi∗2/Kxi∗,xi∗−∑j=1dγj2.(vi)
The optimal kernel isK∗∑∗=Ko∗Λ∗, where o∗=argmin1≤i≤pKiΛ∗.(vii)
M = M + 1(viii)
end for(ix)
M is the current time, which is an integer.


### 3.4. LSTM-RNN Model

RNN is a deep learning algorithm, which is mainly used to deal with sequence prediction problems. As shown in Figure4, the output of the last calculation “Statet” and the input at the current time “Inputt” are used in each cycle of RNN. The output of RNN contains all the previous information, which is the time series prediction.Figure 4
The basic structure of RNN.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.Figure 5
The basic structure of 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 byit, ft, ot, and ct. The algorithm flow of LSTM-RNN can be summarized as Algorithm 3.Algorithm 3: LSTM-RNN. Algorithm procedure of the LSTM-RNN model.
(i)
Initialization: Time stepsH(ii)
Input: Training samplesS=x1,y1,x2,y2,…,xm,ym(iii)
forM = 1, 2, 3, … do(iv)
it=σW3xt+Wrec3yt−1+Wp3ct−1(v)
ft=σW2xt+Wrec2yt−1+Wp2ct−1(vi)
ot=σW1xt+Wrec1yt−1+Wp1ct−1(vii)
lt=tanhW4xt+Wrec4yt−1(viii)
ct=ftct−1+itlt(ix)
yt=tanhctot(x)
M = M + 1(xi)
end for(xii)
Wi is input connection, Wreci is recurrent connection, and Wpi is peephole connection, i = 1, 2, 3, and 4. σ is the sigmoid function.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. This paper aims to verify the effect of LSTM-RNN.


## 3.1. 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. Therefore, a 3-layer neural network is established in this paper, and its structure is shown in Figure1.Figure 1
Structure of the three-layer BP neural network.The output of the BP neural network can be given by(5)y=f2W2f1W1×P+b1+b2,where P is the input vector, W1 and W2 are weight matrices, and b1 and b2 are bias vectors.In this paper, the specific setting of important parameters of the BP model is shown in Table1.Table 1
The parameters setting of the BP model.
ResolverHidden layerActivation functionInitial learning rateLearning rateadam20relu0.1Adaptive


## 3.2. CART-Bagging Model

The 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.The 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. The 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. There 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]. The bagging algorithm uses the bootstrapping method to extract the training set and put them back after training. The prediction result is the average of the results of several base models, which are suitable for processing the temperature drift data of FOG. Therefore, 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. The algorithm flow of CART-Bagging can be summarized as Algorithm 1.Figure 2
CART-Bagging integrated model.Algorithm 1: CART-Bagging. Algorithm procedure of the CART-Bagging model.
(i)
Initialization: the maximum depth of CARTd; the maximum number of leaf nodes m; the number of decision trees L.(ii)
Input: Training samplesS=x1,y1,x2,y2,…,xm,ym(iii)
forM = 1, 2, 3, … do(iv)
ExtractS(i) from S according to a set proportion.(v)
Training CART-Bagging model withS(i).(vi)
If the termination condition is reached on a node(vii)
The node is defined as a leaf node.(viii)
Else(ix)
Continue training.(x)
M = M + 1(xi)
end for(xii)
Output: Average value of each basic model(xiii)
M is the current time, which is an integer.In this paper, the maximum depth of CART isd = 8, the maximum number of leaf nodes is m = 40, and the number of decision trees is L = 10.


## 3.3. Online-SVR Model

The Online-SVR algorithm, an online regression modelling method, is a time series analysis method, which can realize online dynamic update [32, 33]. The 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 asS. For any orthogonal basis ρ1,ρ2,…,ρk in Hilbert space H, ∑i=1kcos2ρi,θ=1 can be given by θ∈H, where cosx,y is the cosine function of vectors x and y and cosx,y=xTy÷x×y.A vector sequenceα1,α2,…,α3 is constructed firstly, where αk=Φxiyj−Φxjyi and k = 1, 2, l(l-1)/2. Φ is a nonlinear mapping, which can map the input data to a high-dimensional feature space. Then, an orthogonal vector sequence β1,β2,…,βd should be constructed, and(6)βi=αi−∑j=1dβjβjαiαi−∑j=1dβjβjαi,where d=rankα1,α2,…,α3 can be obtained by Schmidt orthogonalization. W,β1,…,βk is an orthogonal basis in space H and Φxi∈H, which yields(7)∑j=1dcos2βi,Φxi+cos2W,Φxi=1,where W is the Euclidean norm of W, which can be formulated as(8)W=yix1−∑j=1dcos2βj,Φxi.Therefore, the optimal kernel function parameters can be obtained by minimizingW. When a new sample l+1th enters, we need to judge whether it is suitable for the current model. If αl+1=∑i=1dβiαl+1Tβi, then the model remains unchanged. Otherwise, the optimal model needs to be updated. Calculate Ad+1,i,j, Bd+1,i,j, γd+1, Cd+1,i,j, and βd+1 in turn for updating the model, which can be given by(9)Cl,i,j=Βl+iyj−Βl+jyi,Al,i,j=Kxl,xiyi−Kxl,xjyi,Βl+i=βlTΦxi,γj=βjTΦxi∗=Βj,i∗,where i∗ is any value in 1,2,…,l.Therefore, 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. The real-time compensation process is shown in Figure3, and the algorithm flow of Online-SVR can be summarized as Algorithm 2.Figure 3
Real-time compensation process of Online-SVR.Algorithm 2: Online-SVR. Algorithm procedure of the Online-SVR model.
(i)
Initialization:Ker∑=K1∑,K2∑,…,Kp∑, where Ki∑ is the kernel function of type i with continuously adjusting kernel parameter ∑.(ii)
Input: Training samplesS=x1,y1,x2,y2,…,xm,ym(iii)
forM = 1, 2, 3, … do(iv)
Optimal kernel function selection.(v)
For eachK∑:=K∑∈Ker∑, calculate the optimization problem Λ∗=argminΛ∈∑FKΛ, where FK=W2=yi∗2/Kxi∗,xi∗−∑j=1dγj2.(vi)
The optimal kernel isK∗∑∗=Ko∗Λ∗, where o∗=argmin1≤i≤pKiΛ∗.(vii)
M = M + 1(viii)
end for(ix)
M is the current time, which is an integer.


## 3.4. LSTM-RNN Model

RNN is a deep learning algorithm, which is mainly used to deal with sequence prediction problems. As shown in Figure4, the output of the last calculation “Statet” and the input at the current time “Inputt” are used in each cycle of RNN. The output of RNN contains all the previous information, which is the time series prediction.Figure 4
The basic structure of RNN.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.Figure 5
The basic structure of 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 byit, ft, ot, and ct. The algorithm flow of LSTM-RNN can be summarized as Algorithm 3.Algorithm 3: LSTM-RNN. Algorithm procedure of the LSTM-RNN model.
(i)
Initialization: Time stepsH(ii)
Input: Training samplesS=x1,y1,x2,y2,…,xm,ym(iii)
forM = 1, 2, 3, … do(iv)
it=σW3xt+Wrec3yt−1+Wp3ct−1(v)
ft=σW2xt+Wrec2yt−1+Wp2ct−1(vi)
ot=σW1xt+Wrec1yt−1+Wp1ct−1(vii)
lt=tanhW4xt+Wrec4yt−1(viii)
ct=ftct−1+itlt(ix)
yt=tanhctot(x)
M = M + 1(xi)
end for(xii)
Wi is input connection, Wreci is recurrent connection, and Wpi is peephole connection, i = 1, 2, 3, and 4. σ is the sigmoid function.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. This paper aims to verify the effect of LSTM-RNN.


## 4. 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. Three FOGs, which are denoted by Gyro 1 to Gyro 3 in this paper, are used to validate the compensation methods abovementioned.


### 4.1. 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. The temperature range of this experiment is −20°C to 50°C. The raw datasets of FOGs are logged and saved, which are applied to verify our established model. The update rate of FOGs is 200 Hz. In Figure6, 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.Figure 6
Gyro 1 drift, temperature change, and temperature change rate with time (blue line indicates Gyro 1 drift; black line indicates temperature gradient; red line indicates temperature; min = minute; °C = centigrade).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. 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.


### 4.2. 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. The temperature at timei 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.Figure 7
Real-time acquisition of the temperature change rate.A moving window with lengthK is constructed. Firstly, a section of temperature data with length K is output; then, the temperature T1 at K/2 is the average value of the previous K temperature data. Therefore, the temperature change rate at any time i can be given by(10)T˙i=∑m=i−K/2+1i+K/2+1TmK−∑j=i−K/2i+K/2TjK×f,where Ti 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.In this paper, the moving average window length isk = 12000, the length of each movement is 1, and the real-time temperature change rate T˙i is calculated by (10).


### 4.3. Result Analysis

The LSTM-RNN model is built for real-time compensation, and the compensation effect is compared with the BP model, CART-Bagging model and Online-SVR model. The experimental results are shown in Figures8–10. The image on the left is FOG drift before compensation, and the image on the right is residual drift after compensation.Figure 8
FOG drift before and after compensation of Gyro 1.Figure 9
FOG drift before and after compensation of Gyro 2.Figure 10
FOG drift before and after compensation of Gyro 3.The results show that the BP model and CART-Bagging model have poor performance in compensation experiments of Gyro 1 and Gyro 2. The Online-SVR model has poor performance in the compensation experiment of Gyro 3. 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:(11)RMSEX,h=1m∑i=1mhxi−yi2,(12)MAEX,h=1m∑i=1mhxi−yi.From Tables2 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.Table 2
Comparison of the statistical results before and after compensation with four models of Gyro 1°/h.
SchemesAverageStandard deviationMAERMSEBefore compensation0.192560.00351——BP−0.041440.033800.041560.05347CART-Bagging0.012220.027370.019970.02998Online-SVR−0.013290.009060.013810.01609LSTM-RNN−0.007750.002760.007760.00823° = degree;h = hour.Table 3
Comparison of the statistical results before and after compensation with four models of Gyro 2°/h.
SchemesAverageStandard deviationMAERMSEBefore compensation0.192910.0039——BP−0.027510.025190.027510.03724CART-Bagging0.009770.019170.015520.02151Online-SVR−0.015650.006940.015680.01712LSTM-RNN−0.012250.00290.012250.01259° = degree;h = hour.Table 4
Comparison of the statistical results before and after compensation with four models of Gyro 3°/h.
SchemesAverageStandard deviationMAERMSEBefore compensation0.193550.00131——BP−0.007460.005670.008740.00937CART-Bagging−0.005420.002940.005470.00616Online-SVR−0.003660.010010.008480.01065LSTM-RNN−0.003580.002770.003870.00453° = degree;h = hour.


## 4.1. 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. The temperature range of this experiment is −20°C to 50°C. The raw datasets of FOGs are logged and saved, which are applied to verify our established model. The update rate of FOGs is 200 Hz. In Figure6, 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.Figure 6
Gyro 1 drift, temperature change, and temperature change rate with time (blue line indicates Gyro 1 drift; black line indicates temperature gradient; red line indicates temperature; min = minute; °C = centigrade).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. 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.


## 4.2. 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. The temperature at timei 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.Figure 7
Real-time acquisition of the temperature change rate.A moving window with lengthK is constructed. Firstly, a section of temperature data with length K is output; then, the temperature T1 at K/2 is the average value of the previous K temperature data. Therefore, the temperature change rate at any time i can be given by(10)T˙i=∑m=i−K/2+1i+K/2+1TmK−∑j=i−K/2i+K/2TjK×f,where Ti 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.In this paper, the moving average window length isk = 12000, the length of each movement is 1, and the real-time temperature change rate T˙i is calculated by (10).


## 4.3. Result Analysis

The LSTM-RNN model is built for real-time compensation, and the compensation effect is compared with the BP model, CART-Bagging model and Online-SVR model. The experimental results are shown in Figures8–10. The image on the left is FOG drift before compensation, and the image on the right is residual drift after compensation.Figure 8
FOG drift before and after compensation of Gyro 1.Figure 9
FOG drift before and after compensation of Gyro 2.Figure 10
FOG drift before and after compensation of Gyro 3.The results show that the BP model and CART-Bagging model have poor performance in compensation experiments of Gyro 1 and Gyro 2. The Online-SVR model has poor performance in the compensation experiment of Gyro 3. 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:(11)RMSEX,h=1m∑i=1mhxi−yi2,(12)MAEX,h=1m∑i=1mhxi−yi.From Tables2 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.Table 2
Comparison of the statistical results before and after compensation with four models of Gyro 1°/h.
SchemesAverageStandard deviationMAERMSEBefore compensation0.192560.00351——BP−0.041440.033800.041560.05347CART-Bagging0.012220.027370.019970.02998Online-SVR−0.013290.009060.013810.01609LSTM-RNN−0.007750.002760.007760.00823° = degree;h = hour.Table 3
Comparison of the statistical results before and after compensation with four models of Gyro 2°/h.
SchemesAverageStandard deviationMAERMSEBefore compensation0.192910.0039——BP−0.027510.025190.027510.03724CART-Bagging0.009770.019170.015520.02151Online-SVR−0.015650.006940.015680.01712LSTM-RNN−0.012250.00290.012250.01259° = degree;h = hour.Table 4
Comparison of the statistical results before and after compensation with four models of Gyro 3°/h.
SchemesAverageStandard deviationMAERMSEBefore compensation0.193550.00131——BP−0.007460.005670.008740.00937CART-Bagging−0.005420.002940.005470.00616Online-SVR−0.003660.010010.008480.01065LSTM-RNN−0.003580.002770.003870.00453° = degree;h = hour.


## 5. Conclusion

This paper discussed a FOG drift modelling method based on LSTM-RNN. Three 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. Through 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.



---

*Source: 1636001-2021-07-15.xml*