## 4 Recognition of the Coefficient of the Vibration Error
### The 36-Order EKF  
The 36-order EKF is designed. The EKF method has two equations (Statement equation and Observation equation), which are given by:  
\[\left\{ \begin{array}{l}\dot{\mathbf{X}}=f(\mathbf{X})+\mathbf{Q}\\ \mathbf{Z}=h(\mathbf{X})+\mathbf{R}\\ \end{array} \right. \tag{12}\]  
where \(\mathbf{X}\) is the state vector, \(\mathbf{Z}\) is the measurement vector, \(f(\cdot)\) and \(h(\cdot)\) are nonlinear function. \(\mathbf{Q}\) is zero-mean uncorrelated \"state noise\" process, \(\mathbf{R}\) is zero-mean uncorrelated \"measurement noise\" process. Figure 3: The relationship between different frames. In order to estimate and recognize the coefficients of the error items, the state vector is designed to include the linear error and nonlinear error coefficients. The state vector is given in (13). There are 36 elements in the state vector in total. \[\begin{array}{cccccccccccc}X=\left[ \begin{array}{cccccccc}\delta L&\delta \lambda&\delta h&\delta V^{I}_{x}&\delta V^{I}_{y}&\delta V^{I}_{z}&\delta I& \delta T&\delta A\\ B_{ax}&B_{ay}&B_{az}&B_{gx}&B_{gy}&B_{gz}\\ \delta k_{gxx}&\delta k_{gyx}&\delta k_{gxx}&\delta k_{gyy}&\delta k_{gzy}& \delta k_{gz}\\ \delta k_{axx}&\delta k_{ayx}&\delta k_{axx}&\delta k_{xay}&\delta k_{ayy}& \delta k_{azy}&\delta k_{azz}&\delta k_{ayz}&\delta k_{azz}\\ d_{ax}&d_{ay}&d_{az}&d_{gx}&d_{gy}&d_{gz}\end{array}  \tag{13}\]  
In this paper, the EKF is designed based on the nonlinear error model of the FOGs-based MWD. The ACC's error model \(\Delta f^{b}_{ib}\) and FOG's error model \(\Delta\omega^{b}_{ib}\) used in Equations (2) and (3) are the already established nonlinear error model in Equations (9) and (10). With this nonlinear error model, both the linear error item and the nonlinear error item could be recognized and compensated. The state noise matrix in the statement equation includes the ACC noise and the FOG noise. Therefore, it is given by  
\[\mathbf{Q}=\left[0_{1\times 9}\;\omega^{b}_{ibx}\;\varepsilon\omega^{b}_{iby}\; \varepsilon\omega^{b}_{ibz}\;\varepsilon^{b}_{lix}\;\varepsilon^{b}_{libx}\; \varepsilon^{b}_{liby}\;\varepsilon^{b}_{lbz}\;0_{1\times 21}\right]^{T} \tag{14}\]  
In this paper, the local position is already known and remains unchanged when the calibration experiment is done. Hence, we can use this fixed position as one of the external measurements. Besides, the velocity of the FOG-based MWD keeps zero while doing the calibration experiment. Thus, the zero velocity could be another external measurement. Because the external measurement in the measurement equation does not changed with time. Thus, the measurement equation is a linear system. The nonlinear function \(h(\;)\) could be replaced by the linear function \(\mathbf{Z}=\mathbf{H}(\mathbf{X})+\mathbf{v}\). The observation vector \(\mathbf{Z}\) and the measurement matrix \(\mathbf{H}\) can be written as follows:  
\[\mathbf{Z}=\left[ \begin{array}{cccccccc}L-L^{*}&\lambda-\lambda^{*}&h-h^{*}&V^{I }_{x}-0&V^{I}_{y}-0&V^{I}_{z}-0\end{array} \right]^{T} \tag{15}\]  
\[\mathbf{H}=\left[ \begin{array}{cccccccc}I_{6\times 6}&0_{6\times 30}\end{array}  \right]_{6\times 36} \tag{16}\]  
where \(L^{*}\), \(\lambda^{*}\) and \(h^{*}\) is the local latitude, longitude, height which is known ahead. \(I_{6\times 6}\) is the identity matrix with six rows and six columns. \(0_{6\times 30}\) is the zero matrix with six rows and thirty columns. However, as mentioned above, the state equation is nonlinear. So, before using the Kalman filter method, we needed to linearize the state equation using the Taylor expansion [31]. \[\dot{\mathbf{X}}=\left.f(\mathbf{X})\right|_{X=\hat{X}}+\left.\frac{\partial f(\mathbf{X}) }{\partial\mathbf{X}}\right|_{X=\hat{X}}(\mathbf{X}-\mathbf{\hat{X}})+\left.\frac{\partial^ {2}f(\mathbf{X})}{\partial^{2}\mathbf{X}}\right|_{X=\hat{X}}(\mathbf{X}-\mathbf{\hat{X}})^{2}+ \cdots+\mathbf{\omega} \tag{17}\]  
\(\hat{\mathbf{X}}\) is the estimate of the state vector.