Multi-Sensor Fusion and Error Compensation of Attitude Measurement System for Shaft Boring Machine

To ensure that the shaft boring machine (SBM) runs along the pre-designed axis steadily, the role of the attitude measurement system is essential, but its accuracy and reliability cannot be guaranteed. Currently, there is no effective technology to meet the actual requirements, and there is a lack of relevant theoretical research in this field. Through further study of the attitude analysis method and multi-sensor fusion technology, this paper presents a dual coordinate method, which can be used to describe the attitude characteristics of the SBM. Moreover, this paper discusses the relationships between the attitude changes and the values of the angle as well as displacement and analyzes the implementation complexity and computational efficiency of related algorithms in software and hardware. According to the working characteristics of the SBM, the hardware design and the reasonable layout of the attitude measurement system are provided. Based on multi-sensor data, this paper puts forward an improved method combining a complementary filter with an extended Kalman filter (EKF) for attitude estimation and error compensation. The simulation experiments of different working processes verify the steady-state response and dynamic response performance of the method. Experimental results show that the dual coordinate method and the proposed filter are more suitable for attitude estimation of the SBM compared to other methods.


Introduction
A shaft boring machine (SBM), as a special type of shaft drilling equipment, can carry out mechanical rock breaking and support quickly. It has many advantages, such as a high degree of mechanization without blasting operation, fewer underground workers, high construction efficiency, good completion quality, and high security. In fact, it has become the major piece of technical equipment for infrastructure construction and resource development, as well as an important development direction of intelligence and automation for modern mines [1,2]. The SBM is composed of a control system, support system, propulsion system, driving system, and cutterhead [3,4]; the overall structure is shown in Figure 1. The control system is the core part, and it is responsible for coordinating the normal work of other parts and completing the data interaction with a remote monitoring center. Because the SBM adopts the rolling impact and shear mode to break the complex rock structure, the vibration is strong, and it has a small operating space, high temperature, high dust concentration, At present, attitude measurement methods of tunnel boring machines applied in underground construction contain manual methods and automatic methods [7]. The operation time is long, and the calculation is complicated for manual methods, but the manual methods are often used as supplementary means for an automatic measurement method because of their high detection accuracy. Automatic measurement methods mainly include a gyroscope guidance system, prism guidance system, laser target guidance system, and visual measurement guidance system, and these systems have some advantages and disadvantages. TMG-32B (gyroscope guidance system) is low cost but needs regular calibration due to the poor stability and low measurement accuracy. ROBOTEC, PPS, and RMS-D (prism guidance system) have a simple structure and low cost but have high requirements for the installation environment with poor real-time performance and low precision. ZED and TUnIS (laser target guidance system) have long measurement distance and high precision but easily cause errors and improper installation. The visual measurement guidance system has a large field of view and good real-time performance, but it is still in the research stage and has some limitations, so there is no typical engineering application [8][9][10][11][12].
Obviously, different attitude measurement methods have their applicability and limitations, and the working environments of the SBM are complicated, including mechanical vibration, electromagnetic interference, temperature effect, pressure change, and so on. Consequently, there are no effective technical means for the attitude measurement of the SBM, and it is easy to generate cumulative and random errors only by a single attitude measurement method [13,14]. To avoid the above problems, multi-sensor fusion technology can be used to study attitude calculation and error compensation methods, and thus can improve the accuracy and reliability of the attitude measurement system. At present, attitude measurement methods of tunnel boring machines applied in underground construction contain manual methods and automatic methods [7]. The operation time is long, and the calculation is complicated for manual methods, but the manual methods are often used as supplementary means for an automatic measurement method because of their high detection accuracy. Automatic measurement methods mainly include a gyroscope guidance system, prism guidance system, laser target guidance system, and visual measurement guidance system, and these systems have some advantages and disadvantages. TMG-32B (gyroscope guidance system) is low cost but needs regular calibration due to the poor stability and low measurement accuracy. ROBOTEC, PPS, and RMS-D (prism guidance system) have a simple structure and low cost but have high requirements for the installation environment with poor real-time performance and low precision. ZED and TUnIS (laser target guidance system) have long measurement distance and high precision but easily cause errors and improper installation. The visual measurement guidance system has a large field of view and good real-time performance, but it is still in the research stage and has some limitations, so there is no typical engineering application [8][9][10][11][12].
Obviously, different attitude measurement methods have their applicability and limitations, and the working environments of the SBM are complicated, including mechanical vibration, electromagnetic interference, temperature effect, pressure change, and so on. Consequently, there are no effective technical means for the attitude measurement of the SBM, and it is easy to generate cumulative and random errors only by a single attitude measurement method [13,14]. To avoid the above problems, multi-sensor fusion technology can be used to study attitude calculation and error compensation methods, and thus can improve the accuracy and reliability of the attitude measurement system. hardware and software must be considered. Due to the speed limit, the 8-bit and 16-bit microcontrollers only support fixed-point operation, have some difficulties in algorithm implementation, and can barely run some simple algorithms [33,34]. However, the flexibility of the algorithm is obviously improved on advanced RISC (reduced instruction set computing) machine (ARM), field programmable gate array (FPGA) and other high-speed chips. For instance, the STM32F3 evaluation board can process the gradient descent method, nonlinear complementary filter, and standard EKF method quickly [35]; the STM32F103 controller can implement EKF based on quaternion, which meets the accuracy requirement for the attitude measurement of UAVs in dynamic environments [36]; Sabatelli et al. [37] proposed an IMU sensor fusion method based on a double stage Kalman filter to reduce the complexity of the algorithm, which was verified on FPGA.
To solve the above problems, based on hardware design and multi-sensor data acquisition, this paper presents a dual coordinate method suitable for the SBM. The method reflects the working characteristics of the SBM and external environment and can be used to calculate the attitude angle and displacement. Combining the complementary filter with EKF, a fusion method of multi-sensor data is put forward to improve the accuracy of attitude estimation, and the method can effectively compensate estimation errors under working conditions. Meanwhile, the theoretical analysis and simulation experiments are adopted to validate related methods. Finally, the reliable attitude information of the SBM is obtained. The block diagram of multi-sensor fusion and error compensation is shown in Figure 2.
Sensors 2019, 19, x FOR PEER REVIEW 4 of 27 16-bit microcontrollers only support fixed-point operation, have some difficulties in algorithm implementation, and can barely run some simple algorithms [33,34]. However, the flexibility of the algorithm is obviously improved on advanced RISC (reduced instruction set computing) machine (ARM), field programmable gate array (FPGA) and other high-speed chips. For instance, the STM32F3 evaluation board can process the gradient descent method, nonlinear complementary filter, and standard EKF method quickly [35]; the STM32F103 controller can implement EKF based on quaternion, which meets the accuracy requirement for the attitude measurement of UAVs in dynamic environments [36]; Sabatelli et al. [37] proposed an IMU sensor fusion method based on a double stage Kalman filter to reduce the complexity of the algorithm, which was verified on FPGA.
To solve the above problems, based on hardware design and multi-sensor data acquisition, this paper presents a dual coordinate method suitable for the SBM. The method reflects the working characteristics of the SBM and external environment and can be used to calculate the attitude angle and displacement. Combining the complementary filter with EKF, a fusion method of multi-sensor data is put forward to improve the accuracy of attitude estimation, and the method can effectively compensate estimation errors under working conditions. Meanwhile, the theoretical analysis and simulation experiments are adopted to validate related methods. Finally, the reliable attitude information of the SBM is obtained. The block diagram of multi-sensor fusion and error compensation is shown in Figure 2. Thus, the main contributions of the presented work are (i) a dual coordinate system structure and analysis method suitable for the attitude measurement of the SBM, (ii) a fusion method of attitude estimation and error compensation based on the complementary filter and EKF, (iii) the complexity and computational efficiency analysis of different algorithms to ensure the real-time performance and reliability of data fusion results.
The rest of this paper is structured as follows. Firstly, Section 2 introduces the hardware composition and design of the attitude measurement system for the SBM. Section 3 presents the dual coordinate method based on angle and displacement and then analyzes the attitude characteristics of the SBM, matrix transformation, and the relationship between the attitude changes and coordinate values. The implementation processes of the improved attitude estimation algorithm are explained in Section 4. Next, experimental results are presented and discussed in Section 5. Finally, the conclusions and future work are proposed in Section 6.

Hardware Design
This section mainly introduces the hardware architecture of the attitude measurement system for the SBM. As shown in Figure 3, the SBM is moving down along the rock structure (shadow part). To ensure the running track of the SBM, the attitude measurement system generally includes a laser Thus, the main contributions of the presented work are (i) a dual coordinate system structure and analysis method suitable for the attitude measurement of the SBM, (ii) a fusion method of attitude estimation and error compensation based on the complementary filter and EKF, (iii) the complexity and computational efficiency analysis of different algorithms to ensure the real-time performance and reliability of data fusion results.
The rest of this paper is structured as follows. Firstly, Section 2 introduces the hardware composition and design of the attitude measurement system for the SBM. Section 3 presents the dual coordinate method based on angle and displacement and then analyzes the attitude characteristics of the SBM, matrix transformation, and the relationship between the attitude changes and coordinate values. The implementation processes of the improved attitude estimation algorithm are explained in Section 4. Next, experimental results are presented and discussed in Section 5. Finally, the conclusions and future work are proposed in Section 6.

Hardware Design
This section mainly introduces the hardware architecture of the attitude measurement system for the SBM. As shown in Figure 3, the SBM is moving down along the rock structure (shadow part). To ensure the running track of the SBM, the attitude measurement system generally includes a laser orientation instrument, position sensitive detector (PSD), attitude measurement units, and an embedded monitoring terminal. The technical characteristics of each component are as follows: 1.
Laser orientation instrument (YHJ800, Beijing Wokesida Technology Development Co., Ltd., Beijing, China), which is fixed vertically on the sidewall of the shaft. At the first time, it locates 5 m above the SBM and is used to point the direction of the drilling construction. The low power semiconductor laser is driven by a DC power supply to generate the laser beam; the laser power is more than 10 mW, and the effective range of laser is 800 m.

2.
Position sensitive detector (PSD6060, Shanghai Ouguang Electronic Technology Co., Ltd., Shanghai, China), which is installed on the top surface of the SBM, and it receives the laser signal to determine the horizontal relative displacement of the SBM. It is a two-dimension device, and the photosensitive surface range is 60 × 60 mm. Based on the photoelectric effect of the PIN photodiode, it can convert the light point position at the photosensitive surface to an electrical signal and has high position resolution and fast response speed. The output signal is only related to the light energy center position, independent of spot size and shape.

3.
Attitude measurement units are fastened at the measuring point on the top of SBM, each unit integrates an embedded controller and MEMS sensors (a gyroscope, accelerometer, magnetometer, etc.), and the units are applied for preliminary data fusion to obtain the deviation angle of the SBM. As shown in Figure 4, each unit is composed of a power supply circuit, microcontroller, gyroscope, accelerometer, magnetometer, and 485 communication module SP3485 (MaxLinear, INC., Carlsbad, CA, USA). The STM32F051K8 (STMicroelectronics, Geneva, Switzerland) is the core part, and its operating frequency is up to 48 MHz. The signals of BMI160 (Bosch Sensortec GmbH, Reutlingen, Germany, including a tri-axial gyroscope and a tri-axial accelerometer) and RM3100 (PNI Sensor Corporation, Santa Rosa, CA, USA, a tri-axial magnetometer) are collected by interface I 2 C (SCL and SDA). The interrupt control signal is issued by the custom interface INT of STM32F051K8, and the data transfer interrupt is triggered by the interface INT of BMI160. Meanwhile, the chip pin CTL is also the custom interface of STM32F051K8, and it can control the enable signal of sending and receiving for interface RE and DE of SP3485. Moreover, RXD is the data receiving interface and receives data from the interface RO, TXD is the data sending interface and sends data to the interface DI, and then attitude measurement units communicate with the embedded monitoring terminal through the 485 bus (interface A and B).

4.
The embedded monitoring terminal is on the top console of the SBM and collects information, such as displacement, air pressure, temperature, deviation angle, and then completes secondary data fusion and the attitude calculation. As shown in Figure   1. Laser orientation instrument (YHJ800, Beijing Wokesida Technology Development Co., Ltd., Beijing, China), which is fixed vertically on the sidewall of the shaft. At the first time, it locates 5 m above the SBM and is used to point the direction of the drilling construction. The low power semiconductor laser is driven by a DC power supply to generate the laser beam; the laser power is more than 10 mW, and the effective range of laser is 800 m.

2.
Position sensitive detector (PSD6060, Shanghai Ouguang Electronic Technology Co., Ltd., Shanghai, China), which is installed on the top surface of the SBM, and it receives the laser signal to determine the horizontal relative displacement of the SBM. It is a two-dimension device, and the photosensitive surface range is 60 × 60 mm. Based on the photoelectric effect of the PIN photodiode, it can convert the light point position at the photosensitive surface to an electrical signal and has high position resolution and fast response speed. The output signal is only related to the light energy center position, independent of spot size and shape.
3. Attitude measurement units are fastened at the measuring point on the top of SBM, each unit integrates an embedded controller and MEMS sensors (a gyroscope, accelerometer, magnetometer, etc.), and the units are applied for preliminary data fusion to obtain the deviation angle of the SBM. As shown in Figure 4, each unit is composed of a power supply circuit, microcontroller, gyroscope, accelerometer, magnetometer, and 485 communication module SP3485 (MaxLinear, INC., Carlsbad, CA, USA). The STM32F051K8 (STMicroelectronics, Geneva, Switzerland) is the core part, and its operating frequency is up to 48 MHz. The signals of BMI160 (Bosch Sensortec GmbH, Reutlingen, Germany, including a tri-axial gyroscope and a tri-axial accelerometer) and RM3100 (PNI Sensor Corporation, Santa Rosa, CA, USA, a    tri-axial magnetometer) are collected by interface I 2 C (SCL and SDA). The interrupt control signal is issued by the custom interface INT of STM32F051K8, and the data transfer interrupt is triggered by the interface INT of BMI160. Meanwhile, the chip pin CTL is also the custom interface of STM32F051K8, and it can control the enable signal of sending and receiving for interface RE and DE of SP3485. Moreover, RXD is the data receiving interface and receives data from the interface RO, TXD is the data sending interface and sends data to the interface DI, and then attitude measurement units communicate with the embedded monitoring terminal through the 485 bus (interface A and B).

Dual Coordinate Method
To describe the spatial motion state of the SBM, the reference coordinate system and target coordinate system must be established. Just like the navigation system of UAV, it has a coordinate navigation system (north-east-down) and body coordinate system, can calculate the angle deflection, and acquire the location information through GPS, COMPASS, and GLONASS [38], which are not suitable for the shaft environment. Therefore, according to the working characteristics of the SBM, on the one hand, the angle analytical coordinate system needs to be established to obtain the angle deflection; on the other hand, the displacement coordinate system must be established based on the PSD and laser orientation instrument to obtain the horizontal displacement of the SBM relative to the shaft design axis. As shown in Figure 6, combined with the calculation data of the dual coordinate system, the accurate attitude information of the SBM can be determined in the restricted space of the shaft.

Dual Coordinate Method
To describe the spatial motion state of the SBM, the reference coordinate system and target coordinate system must be established. Just like the navigation system of UAV, it has a coordinate navigation system (north-east-down) and body coordinate system, can calculate the angle deflection, and acquire the location information through GPS, COMPASS, and GLONASS [38], which are not suitable for the shaft environment. Therefore, according to the working characteristics of the SBM, on the one hand, the angle analytical coordinate system needs to be established to obtain the angle deflection; on the other hand, the displacement coordinate system must be established based on the PSD and laser orientation instrument to obtain the horizontal displacement of the SBM relative to the shaft design axis. As shown in Figure 6, combined with the calculation data of the dual coordinate system, the accurate attitude information of the SBM can be determined in the restricted space of the shaft.

Angle Coordinate Analysis
Attitude angles are three-dimensional vectors used to determine the rotation of an object on its axis [39]; they represent the rotation angle of the SBM around three axes of the coordinate system. According to the relationship between reference coordinate and angle coordinate, the attitude of the SBM relative to the horizontal plane is obtained. As shown in Figure 6, the attitude angles of the SBM include roll angle α, pitch angle β, and yaw angle γ. The specific definitions are as follows: 1. Roll angle α: the angle between the Za axis and the plumb plane containing the Xa axis after the SBM rotates around the Xa axis. It is positive to the right and negative to the contrary, which shows the deflection degree around the Xa axis; the threshold range is [−15°, 15°]. 2. Pitch angle β: the angle between the Xa axis and the horizontal plane after the SBM rotates around the Ya axis. When the positive half of the Xa axis is above the horizontal plane, the pitch angle is positive, otherwise it is negative, which proves the deflection degree around the Ya axis; the threshold range is [−15°, 15°]. 3. Yaw angle γ: the angle between the projection of the Xa axis on the horizontal plane and the Xa axis of the reference frame after the SBM rotates around the Za axis. When the X axis rotates clockwise to the Xa axis projection, the yaw angle is positive, otherwise it is negative. It is 0° under normal conditions, non-zero indicates that the support system has failed or the SBM is passing through an abnormal geological area, which causes the SBM to rotate laterally along the shaft; thus, the operation must be stopped immediately.
There are three kinds of angle analysis methods, including the Euler angle method, direction cosine method, and quaternion method [40]. By using the Euler angle method, if the reference coordinate rotates α around the X axis, then rotates β around the Y axis, and finally rotates γ

Angle Coordinate Analysis
Attitude angles are three-dimensional vectors used to determine the rotation of an object on its axis [39]; they represent the rotation angle of the SBM around three axes of the coordinate system. According to the relationship between reference coordinate and angle coordinate, the attitude of the SBM relative to the horizontal plane is obtained. As shown in Figure 6, the attitude angles of the SBM include roll angle α, pitch angle β, and yaw angle γ. The specific definitions are as follows:

1.
Roll angle α: the angle between the Z a axis and the plumb plane containing the X a axis after the SBM rotates around the X a axis. It is positive to the right and negative to the contrary, which shows the deflection degree around the X a axis; the threshold range is Pitch angle β: the angle between the X a axis and the horizontal plane after the SBM rotates around the Y a axis. When the positive half of the X a axis is above the horizontal plane, the pitch angle is positive, otherwise it is negative, which proves the deflection degree around the Y a axis; the threshold range is Yaw angle γ: the angle between the projection of the X a axis on the horizontal plane and the X a axis of the reference frame after the SBM rotates around the Z a axis. When the X axis rotates clockwise to the X a axis projection, the yaw angle is positive, otherwise it is negative. It is 0 • under normal conditions, non-zero indicates that the support system has failed or the SBM is passing through an abnormal geological area, which causes the SBM to rotate laterally along the shaft; thus, the operation must be stopped immediately.
There are three kinds of angle analysis methods, including the Euler angle method, direction cosine method, and quaternion method [40]. By using the Euler angle method, if the reference coordinate rotates α around the X axis, then rotates β around the Y axis, and finally rotates γ around the Z axis, it can overlap with angle coordinate, and the transformation matrix C a r after three rotations is expressed as follows: (1) where r stands for the reference coordinate system, and a is on behalf of the angle coordinate system of the SBM. C α r , C β r , C γ r , each, respectively, represents the transformation matrix of the reference coordinate rotation around the X axis, the Y axis, and the Z axis. C a r is the orthogonal matrix, which is associated with the rotating order. Therefore, C r a can be expressed as: The rotation transformation matrix represents the transformation relation between different coordinate systems, and can also be called the direction cosine matrix, C r a is defined as: Through the information of the rotation transformation matrix, the Euler angle can be solved as: where, α main , γ main are calculated by an inverse trigonometric function, the values should be corrected by the positive and negative judgment of C 11 , C 21 , C 32 , C 33 , and the final angle can be given by: If ω = ω x ω y ω z T is the angle velocity vector of the gyroscope in the angle coordinate system, and . α . β . γ T represents the differential of the attitude angle, the relationship between them can be shown as: Because the analysis processes of the Euler angle method include the trigonometric function operation, the calculation speed is slow and the singularity problem will appear; thus, the Euler angle method cannot be used for the whole attitude measurement. Meanwhile, the direction cosine method solves the singularity problem, but the computation of the rotation matrix elements is still very large [39]. To solve these problems, the quaternion method can be applied in the attitude description of the SBM. The symbol Q usually identifies the rotation quaternion of the angle coordinate relative to the reference coordinate, Q can be expressed as a plural number consisting of a real number q 0 and three imaginary numbers: q 1 i, q 2 j, q 3 k: The quaternion form of the transformation matrix C r a is: According to Equation (4), the attitude angle can be expressed as the quaternion form: The angle correction method adopted in Equation (5) is also applicable to Equation (9). The attitude angle of the initial state is substituted into Equation (10), and then the initial quaternions can be obtained.

Displacement Coordinate Analysis
The displacement coordinate system is an effective supplement to the angle coordinate method, and it can accurately indicate the relative position of the SBM in a shaft. Before the drilling operation, the laser orientation instrument is installed vertically downward on the sidewall of the shaft. After the reference point S of the initial coordinate is confirmed in the power-on test, the PSD is fixed reliably at the designated position on the top of the SBM. As shown in Figure 7, when the displacement deviation appears in the downward drilling, the PSD can determine the light spot position (a, b) in the two-dimensional coordinate system. The displacement relative to point S can be defined as d = √ a 2 + b 2 , and the threshold range of d should be determined according to the specific requirements of the construction. In particular, the values of a and b can clearly indicate the specific position of the point, and they are the important indexes of displacement coordinate analysis.
To calculate the attitude angle, the updated quaternions can be obtained through the angle velocity of the gyroscope in each calculation period. However, angle velocity errors accumulate over time, which leads to poor reliability in long-term measurement; thus, it is necessary to adopt other methods to compensate angle velocity errors.

Displacement Coordinate Analysis
The displacement coordinate system is an effective supplement to the angle coordinate method, and it can accurately indicate the relative position of the SBM in a shaft. Before the drilling operation, the laser orientation instrument is installed vertically downward on the sidewall of the shaft. After the reference point S of the initial coordinate is confirmed in the power-on test, the PSD is fixed reliably at the designated position on the top of the SBM. As shown in Figure 7, when the displacement deviation appears in the downward drilling, the PSD can determine the light spot position (a, b) in the two-dimensional coordinate system. The displacement relative to point S can be defined as = √ 2 + 2 , and the threshold range of d should be determined according to the specific requirements of the construction. In particular, the values of a and b can clearly indicate the specific position of the point, and they are the important indexes of displacement coordinate analysis. As shown in Figure 8, each image stands for the one form of displacement deviation in actual engineering, and the red point represents the light spot position on the PSD. Case (1)(2)(3)(4)(5)(6)(7)(8), respectively, mean the bottom deviation as the light spot is in different quadrants; case (9-16), respectively, show the displacement deviation when the light spot is on the coordinate axis; case (17)(18)(19)(20)(21)(22)(23)(24), respectively, indicate that only the displacement changes without angle deflection; case (25)(26)(27)(28)(29)(30)(31)(32), respectively, indicate that only the angle changes without relative displacement. In addition to the above cases, the deviation judgment should be combined with the yaw angle γ. As shown in Figure 8, each image stands for the one form of displacement deviation in actual engineering, and the red point represents the light spot position on the PSD. Case (1)(2)(3)(4)(5)(6)(7)(8), respectively, mean the bottom deviation as the light spot is in different quadrants; case (9)(10)(11)(12)(13)(14)(15)(16), respectively, show the displacement deviation when the light spot is on the coordinate axis; case (17)(18)(19)(20)(21)(22)(23)(24), respectively, indicate that only the displacement changes without angle deflection; case (25)(26)(27)(28)(29)(30)(31)(32), respectively, indicate that only the angle changes without relative displacement. In addition to the above cases, the deviation judgment should be combined with the yaw angle γ. When γ = 0, the deviation correction control system is likely to disorder and needs to troubleshoot in time; as γ 0, the system equipment or environment is abnormal, and the construction must stop.
Generally, the change of relative displacement is accompanied by the changes of the roll angle α and the pitch angle β. The relevant data should be statistically analyzed to accurately describe the deviation of the SBM, which will provide the decision basis for the effective implementation of the drilling operation plan and deviation correction control. The corresponding relationship between the attitude changes and coordinate values is shown in Table 1. When γ = 0, the deviation correction control system is likely to disorder and needs to troubleshoot in time; as γ ≠ 0, the system equipment or environment is abnormal, and the construction must stop. Generally, the change of relative displacement is accompanied by the changes of the roll angle α and the pitch angle β. The relevant data should be statistically analyzed to accurately describe the deviation of the SBM, which will provide the decision basis for the effective implementation of the drilling operation plan and deviation correction control. The corresponding relationship between the attitude changes and coordinate values is shown in Table 1.
Positive half of X axis Only displacement deviation (24) Negative half of X axis Left (14) β < 0, α = 0 a < 0, b = 0   Figure 7) In fact, there are 81 combination forms through the coordinate values of α, β, a, b, but only 33 forms in Table 1 are normal states, and the others are abnormal conditions. To facilitate the subsequent analysis, the displacement error and speed error can be expressed as:

Displacement Coordinate Values
where e s , e v are, respectively, the displacement error and speed error, d r , V r are, respectively, the real values of displacement and speed, and d est , V est , respectively, stand for the estimation values of displacement and speed. The detailed calculation processes of coordinate values and errors are introduced in Section 4.

Attitude Estimation Algorithms
In the attitude measurement system of the SBM, the relative displacement, rotation angle velocity, acceleration, and magnetic strength can be obtained through the PSD, barometer, gyroscope, accelerometer, and magnetometer. However, the attitude angle of the SBM cannot be directly acquired by these sensors. The attitude angle, displacement, and speed must be solved by the estimation algorithm, and then they can be used for attitude control. MEMS sensors are the key data acquisition units, and they inevitably have noises because of the manufacturing process, temperature, vibration, and other factors [42]. The error models should be established in the attitude calculation and corrected in the process of multi-sensor data fusion. The complementary filter is an analysis method applied in the frequency domain, whereas the Kalman filter is used to deal with the signals in the time domain. Under normal circumstances, useful signals and interfering noises overlap in the frequency and time domains, which leads to useful signals with a degree of randomness. Regarding the switching algorithm between the complementary filter and Kalman filter, the robust adaptive control [43] and multi-model robust control [44] are of some reference significance. However, the proposed algorithm is the combination of the two methods, and it is feasible in theory by combining the complementary filter with the EKF. Moreover, according to the characteristics of signals and noises, the error compensation models can be established to recover useful information and effectively improve the measurement accuracy and dynamic performance.

Complementary Filter
Due to the good dynamic response characteristics of gyroscopes, the attitude angle obtained by the integration is relatively accurate in a short period. However, the drift errors accumulate continuously over time and the accuracy decreases, so gyroscopes are not suitable for long-term measurement. At the same time, there are no time accumulation errors for accelerometers and magnetometers; they have good long-term stability, but they are not suitable for short-term measurement because of slow dynamic response, low short-time measurement accuracy, and are easily affected by the motion acceleration and the external environment. Obviously, the characteristics of the gyroscope, accelerometer, and magnetometer are complementary in the frequency domain, and the complementary filter can distinguish noise from the frequency domain, so the complementary characteristics can be used to obtain an accurate attitude angle by information fusion [35]. The transfer function of the complementary filter can be written as: Sensors where C(s) is the real attitude matrix,Ĉ(s) represents the attitude matrix of the complementary filter estimation, and the low-pass filter G L (s) is designed to remove the high-frequency noise µ H of the accelerometer and magnetometer. In addition, the observation data matrix is C o (s), and the high-pass filter G H (s) is designed to remove the low-frequency noise µ L of the gyroscope; the observation data matrix is G ω (s) at this time. G L (s) + G H (s) = 1 shows that there is no attenuation of the attitude signal.
To eliminate the influence of static errors, PI feedback control can be added on the basis of the complementary filter; thus, C(s) will be expressed as C(s) = K p + K i /s [45], and K p determines the cut-off frequency f T of the filters ( f T = K p /2π). When the noise frequency f > f T , the gyroscope plays a major role in the calculation results; as f < f T , the results come from accelerometers and magnetometers. K p mainly affects the dynamic performance and stability of the complementary filter; a large K p value makes the adjustment time too long, which reduces the real-time performance of the algorithm, and the small K p value increases output error. Moreover, K i determines the time of the filter eliminating static errors, generally K i = (0.01 − 0.1) K p , K p = 3, K i = 0.06 in this paper.
The complementary filter is adopted to correct the roll angle and pitch angle data of the gyroscope by the accelerometer as well as compensate the yaw angle data by the magnetometer. The output values of the accelerometer and magnetometer in the angle coordinate system are respectively: a s = a x a y a z T , m s = m x m y m z T . When the accelerometer is stationary or moving at a constant speed relative to the reference coordinate system, the value of gravity acceleration is a r = [0 0 g] T , the unit vector is [0 0 1] T [38]. The roll angle α a and pitch angle β a solved by the accelerometer and the yaw angle γ m obtained from magnetometer can be derived as: α a = arctan a y /a z β a = arcsin(−a x /g) γ m = arctan m y cosα a −m z sinα a m x cosβ a +m y sinα a sinβ a +m z cosα a sinβ a .
The value of the magnetometer is H = [H n 0 H d ] T in the reference coordinate system, H n is the north component of the geomagnetic field in the reference coordinate system, and H d is the vertical component; thus, the unit vector is [h n 0 h d ] T . The gravitational field measured by the accelerometer is converted to the angle coordinate system.
The geomagnetic field measured by the magnetometer is converted to the angle coordinate system.
However, the error divergence occurs when the data status is updated, which will reduce the reliability of angle estimation, and the attitude transformation matrix of quaternions no longer satisfies the normalization after a long time, so the attitude transformation matrix should be normalized when the quaternions are updated every time. a s , m s , Q are, respectively, are the normalization form of the accelerometer measurement value a s , the magnetometer measurement value m s and the quaternion Q; they are given as: where a s , m s can, respectively, carry out the cross-product operation with a f , m f , and then e αβ , e γ can be obtained, e αβ is the measurement error of roll angle α, and pitch angle β, e γ is the measurement error of yaw angle γ. Furthermore, the overall measurement error e can be expressed as: The compensation value η of the gyroscope drift can be obtained by the overall measurement error e by using PI feedback control.
Finally, ω = ω s + η is used to compensate the angle velocity ω s of the gyroscope, and ω is substituted into Equation (12) to update quaternions iteratively; thus, the attitude angle [α i β i γ i ] T is calculated preliminarily.

Extended Kalman Filter
The Kalman filter is an optimal linear estimation, and its principle is that the optimal value of the current state is estimated based on the statistical error at the previous moment and the error of the measured value at this moment; the attitude angle and displacement at the next moment are obtained through the prediction and update process. However, the filter model of the SBM is nonlinear, and the filtering algorithm must be suitable for a nonlinear system. The EKF is established on the basis of the Kalman filter, the specific process of the EKF is that the nonlinear part of the state equation is expanded into the Taylor series, after omitting the parts of the second order and above, the approximate linearized model is obtained and applied in the state estimation with a linear Kalman filter method.
To design the Kalman filter, the state equation and observation equation of the system need to be established. X k = [A k d k V k ] T is the state model variable, A k = [α k β k γ k ] T is the attitude angle vector, and A k is calculated by the complementary filter method. d k = d xk d yk d zk T is the displacement vector, d xk , d yk are the horizontal displacements from PSD, and d zk is the vertical displacement solved by the barometer. Moreover, V k = V xk V yk V zk T is the speed vector. According to the kinematics theory, the relations of different vectors are expressed as: where a xk a yk a zk T is the motion acceleration vector, and C r a is the transfer matrix from the angle coordinate system to the reference coordinate system. w ax w ay w az T is the noise vector of the accelerometer in the axial direction, and its value is available from the accelerometer manual.
The measurement value a x a y a z T of the accelerometer is the vector sum of gravitational acceleration and motion acceleration, and it is necessary to compensate the gravitational acceleration when the motion acceleration is calculated. In practical application, the attitude angle, displacement, and vertical speed are the key indexes; other parameters are only process calculation variables. The interval time of system status update is T, on the basis of the differential equation of the attitude angle and kinematics analysis, the state equation of Kalman filter is obtained as: T is the system noise vector. At the current moment, [α ak β ak γ mk ] T is the attitude angle calculated by accelerometer and magnetometer, and the speed and displacement are solved by the integral of motion acceleration. Based on these observational variables, the observation equation is expressed as: where σ αk σ βk σ γk σ dxk σ dyk σ dzk σ Vzk T is the observed noise vector. By using the EKF, the nonlinear part of the state equation is expanded by the Taylor series and approximated by the first order, and the approximate linearized model is obtained; thus, the Kalman filter can be applied. After the state equation linearization, the Jacobian matrix Φ k/k−1 can be derived as: The prediction and update process of the EKF algorithm is divided into five parts; they are as follows: 1.
State prediction equation:X X k/k−1 is the estimation of the status variableX k , Φ k/k−1 is the state transition matrix, i.e., the Jacobian matrix.
P k/k−1 is the estimation of the state covariance matrix P k−1 , Q k is the covariance matrix of the system noise.

3.
Kalman filter gain update: R k is the covariance matrix of the observed noise. 4.
Status update:X

5.
State covariance matrix update: In conclusion, based on the multi-sensor data of the gyroscope, accelerometer, magnetometer, PSD, and barometer, the fusion method of the complementary filter and EKF is used to calculate the displacement, attitude angle, and vertical movement speed, and the flowchart of the proposed method is shown in Figure 9. displacement, attitude angle, and vertical movement speed, and the flowchart of the proposed method is shown in Figure 9.

Experimental Setup
To verify the application effect of different methods, the experimental platform is designed for attitude measurement. As shown in Figure 10, the key parts of this platform are similar to the ones of the SBM, and the platform can simulate the normal working process of the SBM. The attitude measurement units are located at (A) and (D), and the embedded monitoring terminal and PSD are, respectively, in position (B) and (C). The comparative experiments are carried out for the complementary filter, EKF, and proposed filter method, and the experiment processes include the steady-state response test and dynamic response test. The sampling frequency is 50 Hz, and the test

Experimental Setup
To verify the application effect of different methods, the experimental platform is designed for attitude measurement. As shown in Figure 10, the key parts of this platform are similar to the ones of the SBM, and the platform can simulate the normal working process of the SBM. The attitude measurement units are located at (A) and (D), and the embedded monitoring terminal and PSD are, respectively, in position (B) and (C). The comparative experiments are carried out for the complementary filter, EKF, and proposed filter method, and the experiment processes include the steady-state response test and dynamic response test. The sampling frequency is 50 Hz, and the test time is 40 s. The whole platform is kept level during the experiment, i.e., the reference values of the attitude angles are 0 degrees.

Experimental Setup
To verify the application effect of different methods, the experimental platform is designed for attitude measurement. As shown in Figure 10, the key parts of this platform are similar to the ones of the SBM, and the platform can simulate the normal working process of the SBM. The attitude measurement units are located at (A) and (D), and the embedded monitoring terminal and PSD are, respectively, in position (B) and (C). The comparative experiments are carried out for the complementary filter, EKF, and proposed filter method, and the experiment processes include the steady-state response test and dynamic response test. The sampling frequency is 50 Hz, and the test time is 40 s. The whole platform is kept level during the experiment, i.e., the reference values of the attitude angles are 0 degrees.

Steady-State Response Performance
When the experimental platform is in a stationary state, the influences come from the external environment without the internal interference of the system. As shown in Figure 11, the measurement value of the PSD is 0 cm, the filtering function does not work, and the estimation errors of different methods are maintained in the range of −0.3-0.3 degrees, so all methods can meet the practical requirements.
The speed of the cutterhead is 10 r/min during the drilling test at low speed, and the propulsion system makes the cutterhead remain in the rock breaking state. As shown in Figure 12, compared with the static test process, the mechanical vibration and electrical magnetic field have affected the attitude measurement, and the estimation errors increase obviously. The angle estimation errors of the EKF and complementary filter change in the range of −3-3 degrees, and the displacement estimation errors of the EKF and complementary filter change in the range of −0.16-0.16 cm; the estimation errors of the complementary filter are larger. However, the angle estimation errors of the proposed filter are in the range of −1-1 degrees, and the displacement estimation errors of the proposed filter change in the range of −0.04-0.04 cm, so the proposed filter has better performance.
The speed of cutterhead is 40 r/min during the drilling test at high speed. As shown in Figure 13, compared with the low-speed drilling process, the estimation errors increase again. The angle estimation errors of the EKF and complementary filter are in the range of −6-6 degrees, and the displacement estimation errors of the EKF and complementary filter are in the range of −0.54-0.54 cm. Meanwhile, the angle estimation errors of the proposed filter are in the range of −2-2 degrees, and the displacement estimation errors of the proposed filter are in the range of −0.1-0.1 cm.

Steady-State Response Performance
When the experimental platform is in a stationary state, the influences come from the external environment without the internal interference of the system. As shown in Figure 11, the measurement value of the PSD is 0 cm, the filtering function does not work, and the estimation errors of different methods are maintained in the range of −0.3-0.3 degrees, so all methods can meet the practical requirements. The speed of the cutterhead is 10 r/min during the drilling test at low speed, and the propulsion system makes the cutterhead remain in the rock breaking state. As shown in Figure 12  The speed of cutterhead is 40 r/min during the drilling test at high speed. As shown in Figure  13, compared with the low-speed drilling process, the estimation errors increase again. The angle estimation errors of the EKF and complementary filter are in the range of −6-6 degrees, and the displacement estimation errors of the EKF and complementary filter are in the range of −0.54-0.54 The speed of cutterhead is 40 r/min during the drilling test at high speed. As shown in Figure  13, compared with the low-speed drilling process, the estimation errors increase again. The angle estimation errors of the EKF and complementary filter are in the range of −6-6 degrees, and the displacement estimation errors of the EKF and complementary filter are in the range of −0.54-0.54 cm. Meanwhile, the angle estimation errors of the proposed filter are in the range of −2-2 degrees, and the displacement estimation errors of the proposed filter are in the range of −0.1-0.1 cm.

Dynamic Response Performance
When the experimental platform maintains in the horizontal attitude, all of the test processes show the steady-state response performance of each algorithm in the normal drilling without deviation. However, the platform does not have the testing ability of deviation state and vertical movement. To verify the dynamic response performance of different algorithms, i.e., the performance of fast tracking the change of the attitude angle, we designed the test equipment for dynamic response. As shown in Figure 14a, it mainly includes attitude measurement units, a two-way rotation platform, core control board, and rotation control module. The sampling frequency of the test is 50 Hz, and the test time is 80 s. As shown in Figure 14b, the shaft hoisting system of a coal mine is selected as the experimental environment for tracking the vertical displacement and speed, and the system is composed of a slow hoisting cage, fast hoisting cage, and control system, and the shaft depth is 430 m.
In the drilling process, the deviation of the SBM is often accidental, so it is very important to measure the dynamic response performance of each algorithm, i.e., whether the algorithm can track the change of the attitude angle quickly and accurately. As shown in Figure 15, during the test, the roll angle and pitch angle remain at 0 degrees, and the yaw angle changes in the range of −17-17 degrees because of the rotation control module. Influenced by the mechanical vibration and electromagnetic interference of the motor, both of roll angle and pitch angle have a fluctuation at different degrees, but they are consistent with the change in the trend of the yaw angle. For the roll angle and pitch angle, the estimation errors of the EKF and complementary filter are in the range of −0.8-0.8 degrees, and the estimation errors of the proposed filter are in the range of −0.3-0.3 degrees. Meanwhile, for the yaw angle, the estimation errors of the EKF and complementary filter are in the range of −4-4 degrees, and the estimation errors of the proposed filter are in the range of −1.5-1.5 degrees. Therefore, the dynamic response performance of the proposed filter is better than the EKF and complementary filter.
The displacement in the horizontal direction indicates the deviation degree of the SBM relative to the designed axis of the shaft, and the displacement in the vertical direction demonstrates the movement of support structure relative to the initial point. According to the control commands, the slow movement of the SBM is the normal process, and the abrupt changes of vertical displacement and speed are often caused by the instability of the support structure or geological structure, which are the important reference indexes for safe construction. Therefore, the accurate tracking and estimation for vertical displacement and speed is an indispensable function of the attitude measurement system. The vertical displacement (height) is converted from the barometer data, and the speed can be calculated, then the error is compensated by the proposed filter. The tracking performance of vertical displacement and speed can be simulated by the shaft hoisting system. As shown in Figures 16 and 17, to ensure the safety of the hoisting cage, the whole operation process is divided into three stages, including the start and acceleration

Dynamic Response Performance
When the experimental platform maintains in the horizontal attitude, all of the test processes show the steady-state response performance of each algorithm in the normal drilling without deviation. However, the platform does not have the testing ability of deviation state and vertical movement. To verify the dynamic response performance of different algorithms, i.e., the performance of fast tracking the change of the attitude angle, we designed the test equipment for dynamic response. As shown in Figure 14a, it mainly includes attitude measurement units, a two-way rotation platform, core control board, and rotation control module. The sampling frequency of the test is 50 Hz, and the test time is 80 s. As shown in Figure 14b, the shaft hoisting system of a coal mine is selected as the experimental environment for tracking the vertical displacement and speed, and the system is composed of a slow hoisting cage, fast hoisting cage, and control system, and the shaft depth is 430 m. In the drilling process, the deviation of the SBM is often accidental, so it is very important to measure the dynamic response performance of each algorithm, i.e., whether the algorithm can track the change of the attitude angle quickly and accurately. As shown in Figure 15, during the test, the roll angle and pitch angle remain at 0 degrees, and the yaw angle changes in the range of −17-17  degrees. Therefore, the dynamic response performance of the proposed filter is better than the EKF and complementary filter. The displacement in the horizontal direction indicates the deviation degree of the SBM relative to the designed axis of the shaft, and the displacement in the vertical direction demonstrates the movement of support structure relative to the initial point. According to the control commands, the slow movement of the SBM is the normal process, and the abrupt changes of vertical displacement and speed are often caused by the instability of the support structure or geological structure, which are the important reference indexes for safe construction. Therefore, the accurate tracking and estimation for vertical displacement and speed is an indispensable function of the attitude measurement system. The vertical displacement (height) is converted from the barometer data, and the speed can be calculated, then the error is compensated by the proposed filter. The tracking performance of vertical displacement and speed can be simulated by the shaft hoisting system. As shown in Figures 16 and 17, to ensure the safety of the hoisting cage, the whole operation process is divided into three stages, including the start and acceleration       To facilitate the statistical analysis, the mean variance of each method is calculated. As shown in Tables 2-4, in the steady-state response test, the maximum error of the attitude angle estimation is 3.24 degrees with the complementary filter, and the maximum error of the attitude angle estimation is 2.47 degrees for the EKF, then the maximum error of the attitude angle estimation is 0.75 degrees by the proposed filter; the maximum error of displacement estimation is 0.24 cm with the complementary filter, and the maximum error of displacement estimation is 0.15 cm for the EKF, then the maximum error of displacement estimation is 0.07 cm by the proposed filter. In the dynamic response test, the maximum error of the attitude angle estimation is 3.52 degrees with the complementary filter, and the maximum error of the attitude angle estimation is 2.73 degrees for the EKF, then the maximum error of the attitude angle estimation is 1.16 degrees by the proposed filter; the maximum error of displacement tracking is 4.64 m with the complementary filter, and the maximum error of displacement tracking is 3.22 m for the EKF, then the maximum error of displacement tracking is 1.36 m by the proposed filter; the maximum error of speed tracking is 0.23 m/s with the complementary filter, and the maximum error of speed tracking is 0.17 m/s for the EKF, then the maximum error of speed tracking is 0.06 m/s by the proposed filter. Obviously, due to the combination of the frequency domain and time domain method, the proposed filter gives full play to the advantages of tracking accuracy from the EKF and fast dynamic response from the complementary filter, and it can effectively suppress the disturbance errors. The steady-state response performance and dynamic response performance of the proposed filter are better than the EKF and complementary filter, so the proposed filter is suitable for the attitude measurement system of the SBM. Meanwhile, the complementary filter model is relatively simple in structure and small in computation. The calculation amount of the EKF and proposed filter varies a little, but they have higher requirements for hardware configuration. If there is a certain hardware condition, the proposed filter is a better choice on the premise of considering dynamic response, estimation accuracy, stability, and robustness.  To study the applicability and efficiency of related algorithms on different microcontrollers, the complementary filter, EKF, and the proposed filter are, respectively, implemented in TMS320F28335 (32-bit), STM32F051 (32-bit), MSP430F5418 (16-bit), and ATmega128 (8-bit). Without other subroutines running, the quantitative comparative analysis is carried out for the time consumption of different algorithms. As shown in Table 5, the 32-bit controllers can quickly complete the calculation process of three algorithms and meet the real-time requirements. However, MSP430F5418 and ATmega128 can only efficiently solve the complementary filter, which shows that the complementary filter requires little computation, and it is a good choice when the microcontroller configuration is low, but the dynamic error is large. Therefore, the 32-bit microcontroller is the basic configuration to meet the requirements of measurement error and dynamic response performance. Moreover, the updated efficiency of the MEMS sensors, data acquisition, and subroutine running will also take a certain time, so the microcontroller selection must leave enough margins.

Conclusions and Future Work
This paper presents a dual coordinate method suitable for the attitude measurement of the SBM, and the key parts of coordinate analysis are the attitude matrix transformation and state update, and they are in the form of quaternions to improve the efficiency of the calculation process. The dual coordinate method makes full use of the data from the gyroscope, accelerometer, magnetometer, PSD, and barometer to calculate the angle, displacement, and speed, which can accurately describe the attitude characteristics of the SBM in the restricted space of the shaft. Meanwhile, to improve the environmental adaptability of the attitude measurement system, we proposed the improved attitude estimation and error compensation method and deduced the method implementation process theoretically.
Through simulation experiments of the attitude estimation, this paper analyzes the steady-state performance and dynamic response performance of different algorithms. The mechanical vibration, electromagnetic interference, and random noise have significant effects on attitude estimation, but the air pressure effect is small. As a method of combining the time domain and frequency domain, the proposed filter can give full play to the advantages of the complementary filter and EKF, and it can ensure the effective acquisition of real attitude information. Furthermore, the time consumption experiments indicate that the complexity of different algorithms have a certain requirements for the hardware configuration, thus the experimental results can provide a reference for the follow-up research.
All experiments in this paper are performed at room temperature. Actually, the influence of temperature change on attitude estimation cannot be ignored, so it is necessary to study the temperature estimation and error compensation method. Moreover, due to the limitations of experimental conditions, there are still some differences between the simulation experiment platform and the SBM; thus, the method proposed in this paper still needs to be improved by the actual working test of the SBM.