# A Designed Calibration Approach for the Measurement -While-Drilling Instrument
## 2 Materials and Methods
### Basic Calibration Algorithm
#### 2.2.2 Plane Fitting Method (PF)  
The coordinate frame of the two sensor triplets have been regulated to its respective mirror coordinate frame in the first part of this section. However, the problem of the direction of the mirror coordinate frame still exists. In this part, this problem will be solved by aligning with the _car_ frame. [PERSON] [35; 36] had proposed a similar method to solve the problem but did not given the detailed equations. In this paper, the method is further deduced and refined. It is assumed that the Euler angles (\(\alpha_{k}\), \(\beta_{k}\), \(\gamma_{k}\)) are used to depict misalignment between the mirror coordinate frame (x\({}_{\mathrm{k}\mathrm{o}}\)y\({}_{\mathrm{k}\mathrm{o}}\)z\({}_{\mathrm{k}\mathrm{o}}\)) and the _car_ frame (x\({}_{\mathrm{k}\mathrm{o}}\)y\({}_{\mathrm{k}\mathrm{o}}\)z\({}_{\mathrm{k}\mathrm{o}}\)). As well, two sets of raw data of the measured points (\(\mathbf{D_{k-x}}\) and \(\mathbf{D_{k-z}}\)) can be sampled from the sensors of the MWD instrument by rotating around the two axes (\(x_{b}\)-axis and \(z_{b}\)-axis) of the _car_ frame, respectively. The outputs of the sensors mounted along the \(x_{b}\)-axis and the \(z_{b}\)-axis have a sinewave form, when they are calibrated to its mirror coordinate frame by the EF method, although they will be constant in the _car_ frame. This phenomenon had been depicted by [PERSON] in [36]. The outputs of the other sensors, when they are calibrated to the _car_ frame, will form two planar circles which will be perpendicular to \(x_{b}\)-axis or \(z_{b}\)-axis, respectively. Based on these phenomenon, the equations can be established on the principle of the direction cosine matrix (DCM), as depicted as follows:\[\left( \begin{array}{c}u_{kx}^{b}\\ u_{ky}^{b}\\ u_{kz}^{b}\end{array} \right)=R_{k}^{-1}\left( \begin{array}{c}u_{kx}^{so}\\ u_{ky}^{so}\\ u_{kz}^{so}\end{array} \right) \tag{13}\] \[=\left( \begin{array}{ccc}\cos\beta_{k}\cos\alpha_{k}&\sin\gamma_{k}\sin \beta_{k}\cos\alpha_{k}-\cos\gamma_{k}\sin\alpha_{k}&\cos\gamma_{k}\sin\beta_{k} \cos\alpha_{k}+\sin\gamma_{k}\sin\alpha_{k}\\ \cos\beta_{k}\sin\alpha_{k}&\sin\gamma_{k}\sin\beta_{k}\sin\alpha_{k}+\cos \gamma_{k}\cos\alpha_{k}&\cos\gamma_{k}\sin\beta_{k}\sin\alpha_{k}-\sin\gamma_ {k}\cos\alpha_{k}\\ -\sin\beta_{k}&\sin\gamma_{k}\cos\beta_{k}&\cos\gamma_{k}\cos\beta_{k}\\ \end{array} \right)\left( \begin{array}{c}u_{kx}^{so}\\ u_{ky}^{so}\\ u_{kz}^{so}\end{array} \right)\] \[u_{kx}^{b}=\left( \begin{array}{ccc}\cos\beta_{k}\cos\alpha_{k}\\ \sin\gamma_{k}\sin\beta_{k}\cos\alpha_{k}-\cos\gamma_{k}\sin\alpha_{k}\\ \cos\gamma_{k}\sin\beta_{k}\cos\alpha_{k}+\sin\gamma_{k}\sin\alpha_{k}\\ \end{array} \right)\mathbf{u}_{k}^{so}=const_{x}\] (13a) \[u_{kz}^{b}=\left(-\sin\beta_{k}\quad\sin\gamma_{k}\cos\beta_{k}\quad\cos\gamma _{k}\cos\beta_{k}\right)\mathbf{u}_{k}^{so}=const_{z} \tag{13b}\]  
where \(\mathbf{u}_{k}^{so}=(u_{kx}^{so},u_{ky}^{so},u_{kz}^{so})^{\mathrm{T}}\) is the output vector in its mirror coordinate frame (x\({}_{\mathrm{ko}}\)y\({}_{\mathrm{ko}}\)z\({}_{\mathrm{ko}}\)) and \(u_{kx}^{b}\) and \(u_{kz}^{b}\) are the components of Earth's field vector along the two axes (x\({}_{b}\)-axis and z\({}_{b}\)-axis) of the \(car\) frame. When the data points in the dataset \(\mathbf{D}_{k-x}\) are calibrated firstly by the EF method and then substituted into Equation (13), Equation (13a) will be established, and the component \(u_{kx}^{b}\) will be considered as a constant (\(const_{x}\)). In the same way, when the data points in the dataset \(\mathbf{D}_{k-z}\) are operated and substituted into Equation (13), Equation (13b) will be established, and the component \(u_{kz}^{b}\) will also be a constant (\(const_{z}\)). If the number of measuring points in the two datasets is large enough, there will be two overdetermined equations listed. The two equations can also be solved by the least squares criterion.