Study of the Algorithm of Backtracking Decoupling and Adaptive Extended Kalman Filter Based on the Quaternion Expanded to the State Variable for Underwater Glider Navigation

High accuracy attitude and position determination is very important for underwater gliders. The cross-coupling among three attitude angles (heading angle, pitch angle and roll angle) becomes more serious when pitch or roll motion occurs. This cross-coupling makes attitude angles inaccurate or even erroneous. Therefore, the high accuracy attitude and position determination becomes a difficult problem for a practical underwater glider. To solve this problem, this paper proposes backing decoupling and adaptive extended Kalman filter (EKF) based on the quaternion expanded to the state variable (BD-AEKF). The backtracking decoupling can eliminate effectively the cross-coupling among the three attitudes when pitch or roll motion occurs. After decoupling, the adaptive extended Kalman filter (AEKF) based on quaternion expanded to the state variable further smoothes the filtering output to improve the accuracy and stability of attitude and position determination. In order to evaluate the performance of the proposed BD-AEKF method, the pitch and roll motion are simulated and the proposed method performance is analyzed and compared with the traditional method. Simulation results demonstrate the proposed BD-AEKF performs better. Furthermore, for further verification, a new underwater navigation system is designed, and the three-axis non-magnetic turn table experiments and the vehicle experiments are done. The results show that the proposed BD-AEKF is effective in eliminating cross-coupling and reducing the errors compared with the conventional method.


Introduction
Underwater gliders play an important role and have become a mainstay in ocean missions, such as mine countermeasures, observation, survey, inspection and so on [1]. Underwater gliders are capable of performing long range missions with low energy consumption, low cost, and great endurance [2].
Their design must as simple as possible and the sensor quantity as few as strictly needed for the navigation system applied to an underwater glider because of the glider characteristics. The inertial navigation system (INS) is chosen as a better choice when GPS is unavailable underwater. The determination of navigation information is mainly dependent on the INS. The cross-coupling among three attitude angles (heading angle, pitch angle and roll angle) becomes more serious when pitch or roll motion occurs due to the misalignment errors between installation axis and the corresponding reference axis in the reference frame for the inertial measurement unit. This cross-coupling can make the determination of navigation information inaccurate or even erroneous. The pitch motion and roll motion are common for an underwater glider. There are two methods to solve the problem above: (1) establish and analyze the model of the inertial unit, and reduce and compensate the inherent error from the inertial system itself; (2) set up a model of the cross-coupling among the three attitude angles when pitch or roll motion occurs and derive the cross-coupling term, then eliminate the cross-coupling among attitudes and further smooth the filtering output to achieve improved accuracy and stability for the attitude and position determination. This paper focuses on the second method.
Li et al. [3] proposed an inverse Nyquist array (INA)-based method to design a precompensation matrix for approximate attitude decoupling. Hung et al. [4] proposed an adaptive neural network sliding-mode controller design approach with a decoupled method for nonlinear systems. In [5], a fuzzy decoupling method is proposed to solve the coupling problem. If it is hard to identify the system model, this intelligent decoupling solution is used. However, it is poor in engineering application because it needs a large amount of data, large computational resources and repetitive tests. References [6,7] proposed the differential geometry decoupling method, and the dynamic inverse decoupling method, respectively. A dynamic decoupling and static compensation procedure is designed to eliminate the cross-axis angular velocity coupling by Fang et al. [8].
After decoupling of attitude angles, the filtering method plays a very significant role in the process of attitude and position determination, to achieve high accuracy determination with high efficiency [9][10][11]. The Kalman filter (KF) is one of the most common examples for filtering. It can achieve the optimal estimation of states in a multi-input multi-output (MIMO) system under the conditions that prior knowledge about standard data deviation, the stochastic model of the transducer error, and the dynamic model of the system error are exactly known. Thus, the KF has been widely applied in vehicle attitude and position determination [12]. However, because of the system noises, measurements can be corrupted by white noise and the state estimation is approached with the minimization of the covariance of the estimation error, the KF is not suitable for nonlinear systems [13][14][15][16][17]. All kinds of algorithms are proposed to solve the problems of KF mentioned above.
Through the first-order linearization of the nonlinear system, extended Kalman filter (EKF) is able to achieve nonlinear estimation [18][19][20][21], but the state distribution is assumed as a Gaussian random variable (GRV). Large errors can be introduced in the true covariance of the transformed GRV and posterior mean. It makes EKF no longer effective in several special applications and sometimes even lead to divergence of the filter [22]. Moreover, the system with GRV is often unavailable in practice [23].
In the view of the above problems, this paper proposes the backing decoupling and adaptive extended Kalman filter (BD-AEKF) based on the quaternion expanded to the state variable method: (1) a backtracking decoupling method is proposed after establishing the model of the cross-coupling among three attitude angles and analyzing the reason for cross-coupling, to eliminate the cross-coupling during pitch or roll motion; (2) after decoupling, a state augmentation technique is applied in the process model and a specific measurement model is formulated, and adaptive extended Kalman filter (AEKF) based on quaternion expanded to the state variable is developed to further smooth the filtering output, therefore the accuracy and stability of attitude and position determination are improved greatly. This paper is organized as follows: the dead reckoning model is presented in Section 2. In Section 3, cross-coupling models among attitudes when pitch or roll motion occurs are discussed in detail and we propose the backtracking decoupling method to solve the cross-coupling among three attitude angles. In Section 4, the AEKF based on quaternion expanded to the state variable is proposed to further improve the accuracy and stability of attitude and position determination. Simulations and analyses can be presented in Section 5. Results and discussion of experimental verification are presented in Section 6, followed by the overall conclusions presented in Section 7.

Dead Reckoning
When the glider glides at certain depth in the sea, the underwater circumstances are comparatively stable. The glider usually follows a sawtooth motion pattern in the vertical plane. The change of depth is measured by a depthometer or other instruments, and it is not the focus in this paper. The acquisition of navigation information mainly by the inertial system in the horizontal plane is studied in the content that follows. The sea current average velocity is approximately regarded as the constant at a certain depth and the glider glides with the sea current. Hence, the average velocity of glider is also considered as a constant. A model of an underwater glider is shown in Figure 1.
Assume that the glider has glided through the distance S  and the time t  . The velocity of the glider is estimated by Equation (1): where dr v is the estimated velocity, cur v is the average velocity of the sea current, noi v is the additional noise; The distance S  is estimated as follows: The position calculated approximately by DR is: cos sin cos cos where i  , i  represent heading angle and pitch angle at the moment of i . Figure 1. The underwater glider model.

The Cross-Coupling Model
It is essential to establish the cross-coupling model of attitude angles and analyze the reasons for cross-coupling. This section analyzes in detail the cross-coupling among three attitude angles when roll motion occurs. When pitch motion occurs, the model analysis and decoupling process are similar to the case of roll motion mentioned above.
As shown in Figure 1, the translational velocity of the underwater glider is defined as   The cross-coupling matrix D is: with 222 The sea circumstances are relatively stable at a certain depth, so the sea current average velocity could be regard as constant. Because the glider gliders with the sea current, the horizontal average velocity of glider is also thought as unchanged. Moreover, the roll angle   1  , 2  are the coefficients, respectively. The symmetry in the model is derived by negating  in Equation (10), and then the motion equations become as follows: Make Equation (12) (13) where: 12 21

A ( ) A ( ) A ( ) A ( ) A ( )
Nonzero off-diagonal coupling terms are contained in the system matrix A ( ) where 0 v is the initial velocity of glider at certain depth in the sea.
Equation (16) shows kinematic coupling among attitudes: (16) where 3  is the coefficient. The non-diagonal terms are not zero because the roll angle  is non-zero (when the roll is changing), therefore pitch rate x  and heading rate z  are no longer the time derivatives of pitch angle  and heading angle  for non-zero roll angle.

Backtracking Decoupling
According to the analysis above, the roll motion leads to the cross-coupling among attitude angles, which causes three orientation misalignment angles x  , y  , z  erroneous. Attitudes correction equation is: where C b nco is the attitude matrix after correction; is the attitude correction matrix; C b n is the attitude matrix. According to Equation (17), C b nco is erroneous because C T is ill-conditioned. The quaternion equations are: under the radical sign may become negative, which can cause the quaternion 0 q erroneous. The same error also occurs for the quaternion 1 q , 2 q and 3 q in Equation (18): are erroneous in the correction phase and the incorrect quaternion will lead to attitude solution wrong in the following update phase, and the attitude angle error is growing continuously in the later process.
In addition, the error of attitude matrix also results in the specific force erroneous. In order to reduce the errors caused by cross-coupling among attitude angles, the paper proposes the backtracking decoupling method. The procedure for implementing the backtracking decoupling can be summarized below.
For Equation (18), if the value under the radical sign occurs negative, namely: use the last quaternions to reverse the attitude matrix. The specific steps are as follows: Step 1: calculate ω where ω b nb represents the angular velocity of the rotation projections of the carrier coordinate relative to the navigation coordinate frame on the carrier coordinate; ω b ib represents the angular velocity of the rotation projections of the carrier coordinate relative to the inertial coordinate frame on the carrier coordinate.
Step 2: calculate Step 3: calculate new quaternion Step 4: normalize the quaternion by dividing the element 0 1 2 3 q q q q    ; Step 5: compute the new matrix to get the accurate attitude matrix; Step 6: compute the attitudes according to Equation (19) and the calculate the specific force with the attitude matrix derived from Step 5; Through the method above, the cross-coupling among attitude angles is eliminated effectively.

The Quaternion Expanded to the State Variable
The state equation and the measurement equation of the first-order linear continuous system are respectively: The continuous system is described with differential equations in the practical application, so the continuous system needs to be discretized as follows: where X k is the state vector at the moment of k ; Z k is observation vector at the moment of k ; 1 , Φ kk  is the state transition matrix from the time of 1 k  to k ; Based on matrix F , state transition matrix Φ is calculated as:  is a sampling interval; matrices F and G can be established by error equations; 1 Γ k  is the system noise matrix at the moment of 1 k  ; 1 W k  is system noise; H k is the observation matrix at the moment of k and V k is observation noise. Commonly, 1 W k  and V k are white noise sequences with zero mean; the variance matrix are Q and R , respectively.
The quaternion is expanded to the state vector given by: The real velocity of the vehicle is RRR E N U VVV () in the East-North-Upward (ENU) axes, the velocity measured by the INS is: are the measurement errors of INS along the east, north and upward directions, respectively. The velocity estimated by DR is: are the estimated errors by DR along the east, north and upward directions, respectively. The real attitude angle of the vehicle is R R R    () in the ENU axes, and heading angle, pitch angle and roll angle measured by the gyroscope are respectively: are the corresponding attitude error estimates by gyroscopes along the east, north and upward directions, respectively. Heading angle measured by the magnetometer is: Pitch angle and roll angle measured by the accelerometer are respectively: are the corresponding attitude error estimates by accelerometers along the east, north and upward directions, respectively. The observation vector Z k is: where H V is the velocity observation noise; H Att is the attitude observation noise; V V is the velocity measurement noise matrix; V Att is the attitude measurement noise matrix.

Adaptive EKF
Define the measurement model as Equation (30) and assume two types of measurement noises [23].
where 1 V k is the measurement noise with a fixed variance,  is a real number, 0   , and 2 V k is the time-varying measurement noise. Assume that the two types of measurements noises are uncorrelated. Equation (31) shows the measurement residue considering the measurement value and the estimated value of the state variables: Substitute Equation (34) into Equation (33), thus: The measurement residual information is contained in Equation (35). It is possible to calculate the mean of the variance expressed as Equation (36) using the N residual from Equation (31): The  value of the adaptive filter can be obtained from Equations (35) The estimated value  is substituted into Equation (35) during the filtering procedure.
The proposed adaptive EKF is summarized below:

Simulation Results and Analysis
The pitch motion and roll motion of an underwater glider are simulated to evaluate the performance of the BD-AEKF method proposed in this paper. The simulations include: (1) the first simulation is that the pitch angle changes in the sine form ( 30sint   ;  is the pitch angle and t is the time) while keeping the heading and roll unchanged; (2) the second simulation is that the roll angle changes in the sine form ( 30sin t

 
;  is the roll angle and t is the time) while keeping the heading and pitch unchanged. These simulations are done to demonstrate whether the BD-AEKF method can eliminate cross-coupling, smooth the filtering output and improve the accuracy. The simulation initial conditions are as follows: the simulation time is 330 s; the sample frequency is 1 Hz; the initial heading angle is 45°; the initial pitch angle and roll angle are 0°; the angular rate bias is 0.02 s  (RMS); the angular rate random walk is 6 hr  ; the linear acceleration bias is 0.3 mg (RMS); the linear acceleration random walk is 0.06 m s hr ; the linear velocities in three directions are all zero. The first simulation results are shown in Figure 2. In Figure 2, the attitude angles errors for EKF and BD-AEKF are shown in Figure 2a-c, respectively. The position errors for EKF and BD-AEKF in east direction and north direction are shown in Figure 2d,e, respectively. Moreover, the root mean square errors (RMSE) of attitude and position for EKF, BD-AEKF are shown in Table 1.
From Figure 2 it can be clearly seen that the performance of BD-AEKF is much better than EKF. When the pitch is changing in the sine form, the cross-coupling among three attitude angles becomes more serious, and it can cause the attitude and position calculation to be inaccurate or even erroneous. The errors cannot be reduced for EKF, however the BD-AEKF method can eliminate the cross-coupling and further smooth the filtering output after decoupling. Therefore, the accuracy and stability of the attitude and position determination are greatly improved.  Table 1, the heading RMSE for BD-AEKF is 0.4164°, which is lower than the EKF. Because of the cross-coupling, the heading angle vibrates periodically while the pitch is changing in the sine form. The cross-coupling can be eliminated by BD-AEKF so the errors can be reduced correspondingly, as seen from Figure 2a. In Figure 2b the cross-coupling affects the pitch accuracy, and the RMSE of pitch for EKF is 0.6432°, however the RMSE for BD-AEKF is 0.1442°. Comparing Figure 2c with Figure 2a, like for the heading, the roll is affected by the cross-coupling when the pitch is swaying, but the effect on the roll due to cross-coupling is not greater than the effect on the heading due to cross-coupling, which it is proved in Table 1. Moreover, for the EKF the oscillation of the heading is more regular than the oscillation of the roll when the pitch is swaying. By employing the BD-AEKF, the oscillation of heading and the oscillation of roll are all avoided effectively. In Figure 2d, the theoretical east position is zero, but it oscillates regularly when the pitch is swaying for the EKF. The RMSE in east direction for BD-AEKF is 0.2119 m which is reduced greatly compared with the RMSE for EKF. In Figure 2e, the error of the north position for BD-AEKF is reduced and the RMSE decreases from 0.8400 m to 0.2331 m. The second simulation results are shown in Figure 3. In Figure 3, the attitude errors for EKF and BD-AEKF are shown in Figure 3a-c, respectively. The position errors for EKF and BD-AEKF in east direction and north direction are shown in Figure 3d,e, respectively. RMSE of attitude and position for EKF, BD-AEKF are shown in Table 2.
Like in Figure 2, it is seen from Figure 3 that the errors of attitude and position for BD-AEKF are smaller than the errors of attitude and position for EKF. In Table 2, the RMSE of heading for BD-AEKF is reduced from 1.0069° to 0.3751°. For the pitch error, the improvement in RMSE for BD-AEKF is reduced from 0.6812° to 0.1453°. In Figure 3c, the BD-AEKF also has the lower roll error. The RMSE for the BD-AEKF is 0.1466°, however, the RMSE for the EKF is 0.6488°. In Figure 3d,e, the theoretical east position and north positions are zero, but they vibrate periodically for EKF when the roll is changing in the sine form. By employing the BD-AEKF, the RMSE in the east position for BD-AEKF is reduced from 0.8297 m to 0.2050 m and the RMSE of the north position is reduced from 0.8104 m to 0.2194 m.

Experiments and Results
In order to assess the performance of the proposed BD-AEKF algorithm, a new inertial system is designed in our lab (Model number: SUNS-2). This system consists of a Digital Signal Processing (DSP) and Inertial Measurement Unit (IMU). The characteristics of the SUNS-2 are shown in Table 3.

The Experiment Based on a Three-Axis Non-Magnetic Turntable
In this experiment, a three-axis non-magnetic turntable is employed to validate whether the cross-coupling among attitudes is eliminated by using the proposed backtracking decoupling method when pitch or roll are changing. The specifications for this turntable are shown in Table 4. Adjust the inner frame, the middle frame and the external frame of the turntable to local level with initialization zero point. Then SUNS-2 is fixed on the center of the turntable. Rotate the pitch axis of the turntable every 10° while keeping the heading and roll axes of the turntable unchanged, and the data is sampled by a Personal Computer (PC). The sample time is approximately 1 min in every sampling location and the range of pitch axis rotation is from −60° to +60°. Record the attitude angle outputs and the results are shown in Table 5. After that, return the turntable to the initial location and rotate the roll axis of the turntable every 10° while keeping other two axes of the turntable unchanged. The range of roll axis rotation is from −60° to +60°. The attitude angle outputs results are shown in Table 6. It is clearly seen from Table 5 that the heading changes greatly with the pitch motion. The heading change is theoretically 0° when the pitch axis is rotating. However, the mean heading change is 2.7362°, and the standard deviation of the heading is 9.9466°, and the heading change maximum is 3.8.85°. Similarly, the roll also changes along with pitch motion. The roll change is theoretically 0°. However, the mean roll change is 1.4487°, and the standard deviation of roll is 4.3701°, and the maximum deviation of roll change is 2.3092°.
The results for roll motion are similar to those for pitch motion above as one can observe clearly in Table 6. Thus, it is concluded that the performance of attitude determination is very poor when the pitch axis or roll axis is rotating due to the cross-coupling among attitude angles. Large attitude errors can be introduced and the conventional method is no longer effective in many practical underwater glider applications.

The Experiment When Backing Decoupling Is Used
In order to solve the cross-decoupling problem, the backing decoupling method is proposed. The same experiment procedures as Section 6.1.1 are done to validate the performance of proposed method. Rotate the pitch and roll axes of turntable from −60° to +60°, respectively. The attitude angle outputs results are shown in Tables 7 and 8, respectively.  Table 7, by employing the backing decoupling, the heading changes little along with pitch motion and the heading change is close to the theoretical value of 0°. The mean of heading change is 0.4422° now, while the mean of heading change was 2.7362° before using the proposed backing decoupling. The standard deviation of heading is 0.5434° which is much lower than before. The heading change maximum is reduced from3.8085° before to 0.5992° now. Moreover, it is easily to see that the roll changes little along with pitch motion in Table 7. The mean of roll change, the standard deviation of roll and roll change maximum are 0.2066°, 0.2940°, 0.3999°, respectively, which are all lower than before using the proposed method.
Compared with Table 7, similar results are obtained from Table 8. The heading change and pitch change are close to the theoretical value of 0° when the roll is changing. The mean of heading change, the standard deviation of heading, and heading change maximum are 0.2949°, 0.5275°, 0.5858°, respectively. The mean of pitch change, the standard deviation of pitch, and pitch change maximum are 0.2397°, 0.2164°, 0.3992°, respectively. Therefore, it is concluded that the performance of attitude determination is improved because the cross-coupling among three attitude angles is eliminated by proposed backing decoupling.

The Vehicle Experiments
After eliminating cross-decoupling, to evaluate whether the proposed BD-AEKF can further smooth the filtering output to improve the accuracy and stability of attitude and position determination, real vehicle experiments were done in the playground of Southeast University. The vehicle with equipment is shown in Figure 4. The trajectories of the experiments are a straight line and a rectangle, respectively. The velocity of the vehicle is about 0.5 m/s. The Attitude and Heading Reference System (AHRS) is used as the attitude reference and the specifications for AHRS are shown in Table 9. The GPS receiver (JAVAD GNSS) is used as the position reference and the performance of the GPS receiver is given in Table 10. The sample time used in this work is 1 s.   In this experiment, the trolley runs along the straight line (about 40 m) in the playground, and Figure 5 displays the trajectory of the real experiment. The trolley runs from the start point to the end point. In Figure 6, the attitude errors for the EKF and the proposed BD-AEKF are shown in Figure 6a-c, respectively. The position errors in the east direction and north direction for the EKF and the BD-AEKF are shown in Figure 6d,e, respectively. Moreover, the RMSE of attitude and position for the EKF and BD-AEKF are shown in Table 11.

Start
As shown in Figure 6, it can be seen that the performance of the BD-AEKF is better than EKF in terms of attitude and position estimation. During the trolley running process, the pitch and roll are vibrating continuously in a small range because of the practical road implementation, so the cross-coupling is obvious. The BD-AEKF eliminates the cross-coupling and smoothes the filtering output, therefore the errors of attitude and position determination are greatly reduced, however, the traditional EKF cannot solve the cross-coupling problem among three-attitude and the errors are relatively larger. In Figure 6a, the heading error for EKF is much larger than the heading error for BD-AEKF. In Table 11, the RMSE of heading for BD-AEKF is 0.3278°, which is lower than the EKF. Similarly, the pitch and roll errors are reduced by the BD-AEKF. The RMSE of pitch is reduced from 0.5142° to 0.1140° and the RMSE of roll is reduced from 0.5043° to 0.1090°. From Figure 6d,e, it can be seen that the estimation accuracy in terms of east position and north position for BD-AEKF is superior to that for EKF. The BD-AEKF reduces the RMSE of east position from 0.9547 m to 0.2486 m compared with EKF. The RMSE of north position for BD-AEKF is 0.2629 m, which is lower than the RESE for EKF.   Figure 7 displays the trajectory of the real experiment. Figure 8 shows error comparison results between methods. The attitude errors for the EKF and the BD-AEKF are shown in Figure 8a-c, respectively. The position errors for the EKF and the BD-AEKF in the east direction and north direction are shown in Figure 8d,e, respectively. Furthermore, the RMSE of attitude and position for the EKF and BD-AEKF are shown in Table 12. Figure 8 shows that the BD-AEKF performs better than the EKF in the attitude and position determination. In Figure 8a, the BD-AEKF is able to reduce the heading error and it decreases the RMSE of the heading from 0.9651° to 0.3422° compared with the EKF in Table 12. Similarly, it is easy to see from Figure 8b,c that the BD-AEKF is effective at reducing the pitch error and the roll error, respectively. The RMSE of the pitch for the BD-AEKF is 0.1201° which is lower than that for EKF. The RMSE of the roll is reduced from 0.5374° to 0.1135°. For the position error, the BD-AEKF also has lower error than the EKF from Figure 8d     As can be seen from the simulations (Section 5) and the practical vehicle experiments (Section 6), it is concluded that the traditional EKF may be not suitable for a practical underwater glider. EKF uses linearized models by applying first order approximation to nonlinear systems. However, when the non-linearity is severe, EKF often gives unreliable or divergent estimates. The pitch and roll motion are common for underwater gliders. When pitch or roll motion appears, the cross-coupling among the three attitude angles becomes more obvious, which can cause the estimation of attitude and position to be inaccurate or even erroneous, therefore the EKF method cannot match the system model of the underwater glider well. In order to overcome EKF shortcomings, the BD-AEKF is proposed to solve this problem.

Conclusions
In order to eliminate the cross-coupling between attitudes and to improve the accuracy of attitude and position determination, this paper proposes the BD-AEKF method. The backtracking decoupling can eliminate effectively the cross-coupling among the three attitude angles when pitch or roll motion occurs. As the basis of decoupling, the AEKF based on quaternion expanded to the state variable further smoothes the filtering output. An improvement is achieved for the accuracy and stability of attitude and position determination. A new underwater navigation system is designed. Three-axis non-magnetic turntable experiments and vehicle experiments are done to assess the performance of BD-AEKF. The experimental results show the BD-AEKF method is more effective in terms of decoupling and navigation accuracy improvement than the traditional method in practical glider applications.