# In-Motion Coarse Alignment Method Based on Position Loci and Optimal-REQUEST for SINS
## 5 Simulation  
The simulation tests carried out to verify the accuracy and rapidity of the proposed OP-PL algorithm are described in this section. The trajectory of the vehicle was designed to follow a zigzag movement, and the actual information of the vehicle was known. Thus, the actual angles were used as reference angles to calculate the errors of three angles. The zigzag trajectory and the reference information are shown in Figures 2 and 3, respectively. It can be seen that the outliers, which corrupt the measurement of GPS, were added to the measurement. The output frequencies of GPS and the simulated inertial measurement unit (IMU) were set as 5 Hz and 200 Hz, respectively. The constant bias and random noise of the gyroscopes and accelerometers are listed in Table 2. The initial latitude and longitude were set as 32.00\({}^{\circ}\) and 118.00\({}^{\circ}\), respectively. Throughout the in-motion coarse alignment process, it was assumed that the vehicle was moving on the horizontal plane; the initial values of the attitude angles were all set as 0\({}^{\circ}\). The simulation was conducted using Matlab 2016b with an alignment time of 300 s. The proposed OP-PL algorithm was compared with the QUEST algorithm and the REQUEST algorithm to verify performance. Figures 4-6 show the different performances of the REQUEST algorithm and the proposed OP-PL algorithm. We chose three different values of the fading memory factor, which were 0.1, 0.01 and 0.001, to compare with the optimal adaptive gain \(\rho^{*}\). Figure 7 shows the optimal gain of the proposed algorithm in the simulation. Considering the results from three angles, we found that the REQUEST algorithm was unstable during simulation. From Figures 4 and 5, it is evident that the REQUEST algorithm showed similar performance to the proposed algorithm when 0.1 was chosen as the value of the fading memory factor. The 'MEAN' and 'RMSE' represent the mean and the root mean square error of the attitude errors. The MEAN and RMSE errors of the blue and black curves were calculated by collecting data from 150 s to 300 s, where the blue curve represents \(\rho=0.1\) and the black curve represents the optimal adaptively gain. The pitch MEAN errors of the blue and black curves were 0.0269\({}^{\circ}\) and \(-0.0760^{\circ}\), respectively. The pitch RMSE errors of the blue and black curves were 0.0425\({}^{\circ}\) and 0.0824\({}^{\circ}\), respectively. Although the accuracy of the pitch angle calculated by the proposed OP-PL algorithm was lower than the REQUEST,  
Figure 1: In-motion coarse alignment procedure. Figure 4: Pitch comparisons of different \(\rho\). Figure 5: Roll comparisons of different \(\rho\). Figure 6: Yaw comparisons of different \(\rho\). Moreover, the roll MEAN errors of the blue and black curves were 0.1875\({}^{\circ}\) and 0.1159\({}^{\circ}\), respectively. The roll RMSE errors of the blue and black curves were 0.2114\({}^{\circ}\) and 0.1210\({}^{\circ}\), respectively. From the RMSE data, it is evident that the proposed OP-PL algorithm performed better than the REQUEST algorithm for the calculation of the roll angle. It can also be seen from Figure 5 that the proposed OP-PL algorithm was very stable and that the convergence speed was still very fast. However, when \(\rho=0.1\), the performance of the yaw angle was very poor. Although this value can produce excellent results in calculating the roll angle and the pitch angle, it was completely wrong for calculating the yaw angle. This indicates that the fixed gain was unreliable during the coarse alignment. When the value of \(\rho\) was selected as 0.1, the new K-matrix (\(\delta\)K\({}_{k+1}\)) accounted for a relatively large proportion during the update of the K-matrix. This made it impossible to calculate the yaw angle correctly. If the value of \(\rho\) was decreased to 0.001, more error effects were accumulated because the old K-matrix (K\({}_{k+1/k}\)) accounted for a relatively large proportion during the update of the K-matrix.