## 2 Wellbore Attitude Measurement Method and Error Analysis
### Near-Vertical Wellbore Attitude Errors Characteristics  
The actual signal of the accelerometer includes the specific force and the measure errors introduced by circuit and manufacturing processes. The horizontal attitude equation for the error model is given by  
\[\left\{ \begin{array}{c}i\widetilde{n}c=arctan\left(-\left(a_{y}+\delta a _{y}\right)/\sqrt{\left(a_{x}+\delta a_{x}\right)^{2}+\left(a_{z}+\delta a_{z} \right)^{2}}\right)\\ t\widetilde{f}=arctan(-\left(a_{x}+\delta a_{x}\right)/\left(a_{z}+\delta a_{ z}\right))\end{array} \right., \tag{11}\]  
where the symbol \(\delta\bullet\) denotes the measurement errors of the accelerometer. The radial accelerometer output in the near-vertical position has a small amplitude. Notably, the measurement error of MEMS accelerometers may exceed the component of the gravity field. Consequently, considerable errors will be introduced into the calculation of the roll angle, which usually exists in two cases:  
Figure 3: The schematic of attitude calculation-based MEMS-IMU/magnetometers. 1. \(a_{x}\ll\delta a_{x}\), \(a_{z}\ll\delta a_{z}\). The theoretical value is swamped by the accelerometer errors, and the roll angle is calculated incorrectly. 2. \(a_{x}/\left(a_{x}+\delta a_{x}\right)<\delta a_{x}/\left(a_{x}+\delta a_{x} \right)<1\), \(a_{z}/\left(a_{z}+\delta a_{z}\right)<\delta a_{z}/\left(a_{z}+\delta a_{z} \right)<1\). Accelerometer errors have a larger weight in the true value, and the roll angle calculation errors increase. An inaccurate horizontal angle will induce an increased azimuth error. Figure 4 depicts the attitude error trends for a pitch varying from 55 degrees to 89 degrees. In order to recognize the effect of the accelerometer error on the attitude, the simulation parameters for the magnetometer errors are contained at a low magnitude. The bias errors of the accelerometer and magnetometer are set to 5 mg and 0.5 nT, respectively. The standard deviation of the random error for the accelerometer is 2.5 mg. The random error of the magnetometer is 5 nT. The true azimuth and roll were set as 45\({}^{\circ}\) and 15\({}^{\circ}\), respectively. The orange curve shows that the azimuth error increases rapidly at the pitch angle above 85\({}^{\circ}\). Similarly, the red curve shows that the roll angle error has the same trend at pitch angles above 85 degrees. It is concluded that the azimuth and roll errors increase with magnitudes of \(\pm 10^{\circ}\) and \(\pm 15^{\circ}\), respectively. Notably, if the magnetometer error is added to the simulation, the azimuth error will exceed the current simulation results. Only one group of attitude error trends with pitch is simulated in Figure 4. In order to describe the error characteristics in different azimuths and rolls, the static Monte Carlo simulation of the attitude error is designed to discuss the error mechanism with a pitch range of 0-89 degrees. Both azimuth and roll are calculated from 0 to 180 degrees. As shown in Figure 5a, the pitch error has consistent characteristics at all attitude angles. Theoretically, the pitch is only related to the y-axis accelerometer and gravity. The fraction of Equation (3) calculating \(inc\) can also be expressed as the equivalent form given by \(-a_{y}/\sqrt{g^{2}-a_{y}^{2}}\). Figure 5b depicts that the roll error at different roll angles has the same trend with the increase in pitch. As can be seen from Figure 5c,d, the azimuth error increases rapidly at near-vertical conditions. The roll error in the near-vertical position is interfered with by the error of the radial accelerometer leading to uncertainty on the calculation results. If the azimuth calculation formula is expressed as a function \(az=f(inc,tf,mx,my,mz)\), the independent variable \(tf\) will have a dramatic effect on the azimuth. Low-noise and high-end accelerometers have a significant effect on improving horizontal attitude accuracy, which will negatively impact the small-size design of the drilling instrument and the cost control of drilling engineering.