# A Designed Calibration Approach for the Measurement -While-Drilling Instrument
## 2 Materials and Methods
### Basic Calibration Algorithm  
#### 2.2.1 Ellipsoidal Fitting Method (EF)  
According to the existing literature [14], the data points in the set \(\mathbf{D}_{\mathbf{k}}\), measured by a sensor triplet, are to lie on the surface of an ellipsoid. Yet, the data points of the local field vector \(\mathbf{u}^{b}_{\mathbf{k}}\), in the _car_ frame in any direction, are to lie on the surface of a sphere whose radius is equal to the field strength. Then, the EF method, one kind of a scalar calibration method, makes use of the fact that the strength of the local field vector is a constant. It can determine all the error parameters of a single sensor triplet. With these error parameters, the data points on the surface of a sphere are mapped to the data points on the surface of an ellipsoid through translation, skewness and scaling. As discussed in [14], the data set \(\mathbf{D}_{\mathbf{k}}\) obtained from rotating a sensor triplet in any direction could meet the equation of Equation (5), according to the principle that the norm of the data points in \(\mathbf{D}_{\mathbf{k}}\) is equal to the strength of the field vector. \[ \begin{split}\|\mathbf{u}^{b}_{\mathbf{k}}\|^{2}&=\mathbf{u}^{b \text{T}}_{\mathbf{k}}\mathbf{n}^{b}_{\mathbf{k}}=\big{(}\mathbf{v}^{s}_{\mathbf{k}}-b_{k}\big{)}^ {\text{T}}L^{b}_{ks}\,\text{T}L^{b}_{ks}\big{(}\mathbf{v}^{s}_{\mathbf{k}}-b_{k}\big{)} \\ &=\mathbf{v}^{s\text{T}}_{\text{Ls}}L^{b}_{ks}\,\text{T}L^{b}_{ks}\bm {v}^{s}_{\mathbf{k}}-2b_{k}^{\text{T}}L^{b}_{ks}\,\text{T}L^{b}_{ks}\mathbf{v}^{s}_{ \mathbf{k}}+b_{k}^{\text{T}}L^{b}_{ks}\,\text{T}L^{b}_{ks}\,b_{k}\\ &=\mathbf{v}^{s\text{T}}_{\mathbf{k}}Q\mathbf{v}^{s}_{\mathbf{k}}-2b_{k}^{\text{ T}}Q\mathbf{v}^{s}_{\mathbf{k}}+b_{k}^{\text{T}}Qb_{k}=\|H\|^{2}\\ &\quad\big{(}\mathbf{v}^{s}_{\mathbf{k}}-b_{k}\big{)}^{\text{T}}Q\big{(} \mathbf{v}^{s}_{\mathbf{k}}-b_{k}\big{)}=\|H\|^{2}\end{split}  \tag{5}\]  
where \(Q=L^{b}_{\text{Ls}}T\,L^{b}_{ks}\), and \(H\) is the Euclidean norm of the field vector. When the errors of sensor are small, the matrix \(Q\) is strictly diagonally dominant [34]. The Gaussian white noise is ignored here. After algebraic operation, Equation (5) could be rewritten as Equation (6), which is shown below. \[\mathbf{v}^{s\text{T}}_{\mathbf{k}}Q^{\prime}\mathbf{v}^{s}_{\mathbf{k}}+p^{\prime}\mathbf{v}^{s}_ {\mathbf{k}}=1 \tag{6}\]  
where \(Q^{\prime}=Q/(\|H\|^{2}-b_{k}^{\text{T}}Qb_{k})\), and \(p^{\prime}=-2b_{k}^{\text{T}}Q^{\prime}\). Then, a parameter \(\sigma\) is introduced to simplify the equation of \(Q^{\prime}\), namely  
Furthermore, the matrix \(Q\) and bias vector \(b_{k}\) can also be solved out by the equations as shown below. \[b_{k}=-0.5p^{\prime}(Q^{\prime})^{-1}\Rightarrow\quad\sigma=\frac{1}{\|H\|^{2} -b_{k}^{\mathrm{T}}Qb_{k}}=\frac{1+b_{k}^{\mathrm{T}}Q^{\prime}b_{k}}{\|H\|^{2} }\Rightarrow\quad Q=\frac{1}{\sigma}Q^{\prime},p=\frac{1}{\sigma}p^{\prime} \tag{9}\]  
An overdetermined linear equation set is established when the data points in \(\mathbf{D_{k}}\) are substituted into Equation (7) on the condition of \(N>>12\). The traditional solving method of the overdetermined equations is just the least squares criterion. The resulting equation is shown in Equation (10). \[\beta=\left(\mathbf{V_{kn}^{s}}^{\mathrm{T}}\mathbf{V_{kn}^{s}}\right)^{-1}\mathbf{V_{kn}^{ s}}^{\mathrm{T}}\mathbf{I_{n}} \tag{10}\]  
where \(\beta\) denotes the coefficient vector of Equation (7), \(\mathbf{V_{kn}^{s}}\) is the matrix of the raw data set \(\mathbf{D_{k}}\) and its dimension is \(N\times 9\). \(\mathbf{I_{n}}\) is a unit vector of \(N\times 1\) dimension. Then, the calibration matrix \(L_{\mathrm{ks}}^{b}\) is derived by the eigenvalue decomposition method, (\(Q=VDV^{\mathrm{T}}\)). The result is stated in Equation (11), in which \(V\) is the eigenvector of \(Q\), and \(D\) is a diagonal matrix with the eigenvalue of \(Q\).