# Experimental Study of Measuring Algorithm Accuracy of the Electromagnetic Distance Measurement Anticollision Tool

Authors: Cui Li; Lei Li; Yuzheng Zhao; Ruichao Zhang; Yuanwei Sun
Journal: Geofluids
 (2022)

---

## Abstract

In order to prevent collision of complex structure well, accurate measurement of the distance of adjacent wells must be required during the development of the unconventional reservoir. The precision of the traditional survey tools and scanning software is not accurate enough. Based on the electromagnetic anticollision measuring calculation method, the electromagnetic anticollision detection tool was designed and simulation experiments were carried out. The influence of different position relations between sensor and casing on magnetic field strength detected by the sensor was analyzed. When the sensor and the casing were parallel and the distance of them was 0.5 m∼3 m, the tool could calculate accurately the distance and orientation of the adjoining well. When the angle between the sensor and the casing was within 50°, the calculation result was accurate. This research result validated the accuracy of the principle of the electromagnetic anticollision tool while drilling cluster well, and it could provide theoretical support for the development of electromagnetic detection tools.


---

## Body

## 1. Introduction

With the increasing difficulty of oil and gas resource exploration, the drilling technology of complex structure wells has become a key technology for the low-permeability, unconventional, and offshore oil reservoir [1,2]. The horizontal wells, infill wells, and cluster wells have been used to develop low-grade oil and gas resources. However, in order to prevent collisions between adjacent wells during drilling, the precise measurement of the distance between adjacent wells is required. The traditional inclinometer tools and offset well-scanning software are not enough [3,4].At present, a series of relatively mature active magnetic detection tools have been invented, such as the MGT electromagnetic guidance tool, the RMRS rotating magnetic field measuring guidance system, and the SWG single cable guidance tool [5–8]. Although some electromagnetic detection tools can be used to measure the distance of adjacent wells accurately, these tools require additional equipment such as magnetic sources or probes to be run in the adjacent wells [9–11]. But this not only affects the normal production of the wells but also increases the cost [12–14]. Based on the principle of active anticollision ranging, cluster wells anticollision electromagnetic signal acquisition system was designed. The first reliable validation instrument could quickly handle weak electromagnetic MWD signals submerged in the strong noise environment [15]. A new antisymmetry electromagnets rotating magnetic ranging method was proposed [16]. A collision avoidance estimation was established based on magnetic difference signals [17]. The influence of several factors on magnetic difference signals was analyzed [18]. Based on the pseudo-analytical equation of electromagnetic log for layered formation, an optimal boundary match method was proposed to adaptively truncate the encountered formation structures [19–21]. The inverted results of field data demonstrated that the real-time interactive inversion method was capable of providing the accurate boundaries of layers around the wellbore from the LWD EM, and it will benefit the wellbore trajectory optimization and reservoir interpretation [22–24].Therefore, it is necessary to develop an electromagnetic anticollision detection tool for adjacent wells. It should realize measurement while drilling without magnetic sources or sensors in the adjacent wells, and it should also simultaneously monitor multiple surrounding wells that have been drilled. This tool of this research can reduce the risk of collisions between adjacent wells, and it can ensure the safety of drilling.


## 2. Experimental Principle

In order to realize the real-time measurement of the distance between adjacent wells to prevent collisions without affecting the normal production of surrounding production wells, a kind of active magnetization type electromagnetic detection tool was proposed [25]. A probe for the electromagnetic distance measurement was installed behind the downhole power drilling tool. A magnetic field sensor was placed in the middle of the probe. There was a magnetic source at each end of the probe. The magnetic source was placed symmetrically with respect to the magnetic field sensor. They were axially parallel, but the magnetic pole directions were opposite. As shown with the red line in Figure 1, the direction of magnetic field lines in the axial direction of the casing emitted by two magnetic sources was the same. When there was a casing around the probe, the casing was magnetized to generate a magnetic field along the axial direction of the casing, as shown with the green line in Figure 1. The magnetic induction intensity was related to the distance between the casing and the probe. Combined with the own attitude of the probe, the magnetic induction intensity could be detected by the probe. The relative distance between the positive well and the adjacent well could be calculated by the electromagnetic anticollision measuring and steering algorithm for adjacent wells while drilling.Figure 1
Distribution of magnetic line around probe with casing.The following assumptions were proposed. (1) The formation was uniform and isotropic. (2) The casing was infinitely long and isotropic. (3) The radius of the casing was smaller than the distance between the casing of the positive well and the adjacent well. (4) There were no ferromagnetic minerals with high magnetic permeability in the formation. The size of the magnetic source was much smaller than the distance between adjacent wells, so the magnetic source could be regarded as a magnetic dipole, as shown in Figure2.Figure 2
Calculation model of the magnetic intensity.A Cartesian coordinate system was established. It is assumed that the origin C is the center of the magnetic source on the upper part of the probe, they-axis is the axis of the probe, and the z-axis is the axis of the magnetic source. The distance OE which is from the center of the probe to the axis of the casing is d, m. The angle between the axis of the casing and the direction of the axis of the probe (the y-axis direction) is α. The distance between the two magnetic sources at both ends of the probe is 2h. The angle between the line of any point P and point C on the casing and the z-axis is θ1. The distance between P and C is r1. Point D is another magnetic source. The angle between the line of any point P and point D on the casing and the z-axis is θ2. The distance between P and D is r2. Point A is the intersection of the extension of the magnetic source axis of point C and the casing axis AB. Point B is the intersection of the extension of the magnetic source axis of point D and the casing axis AB. The casing is evenly divided into several microelements along the axis of the casing. For the microelement at point P of the casing, the total magnetizing magnetic field can be described as follows [26].(1)BPx=0,BPy=3μ1m8πsin2θ1r13−sin2θ2r23,BPz=μ1m2π1−3/2sin2θ1r13−1−3/2sin2θ2r23,where BPx, BPy, and BPz are the triaxial magnetic induction components at point P, T. μ1 is the surrounding space permeability, T·m/A. m is the magnetic moment when a magnetic source is used as a magnetic dipole, A·m2. θ1, θ1 and θ2 are the angles between any point of the casing and magnetic source axis, °. r1, r1 and r2 are the distances between any point of the casing and magnetic source, m.Assuming that the rectangular coordinates of pointP are P(x, y, z), x = 0, z = d + ytanα, then θ1, r1, θ2, and r2 in rectangular coordinates of point P are taken into formula (1). The magnetic induction intensity of the microelement casing at point P can be described as follows.(2)BPx=0,BPy=3μ1m4πy−hd+ytanαy−h2+d+ytanα25−y+hd+ytanαy+h2+d+ytanα25,BPz=μ1m2π1−3y−h2/2y−h2+d+ytanα2y−h2+d+ytanα23−1−3y+h2/2y+h2+d+ytanα2y+h2+d+ytanα23,where h is the distance between the probe and magnetic source, m. d is the distance from the center of the probe to the axis of casing, m. α is the angle between casing axis direction and probe axis direction, °.For the position of the magnetic field sensor at point O, according to the distribution of the magnetic field around the magnetic dipole [27,28], the magnetic induction intensity of the magnetic dipole at point P at the magnetic field sensor can be described as follows.(3)Bx=0,By=−D2δχmBPy2+BPz216μ1⋅3μyd+ytanαy2+d+ytanα25,Bz=D2δχmBPy2+BPz28μ1⋅μy2+d+ytanα231−3y22y2+d+ytanα2,where Bx, By, and Bz are the magnetic induction intensities of magnetic dipole at point P at the magnetic field sensor, T. D is the diameter of the element, m. δ is the length of the element, m. χm is the magnetic susceptibility of the casing.The magnetic field sensor is taken as the center, and the simulation calculation is performed along the range of ±10 m in they-axis direction. The range of ±10 m is divided into N equal parts, and each part has a length of δ. The magnetic induction intensity BPi of each point is calculated, and then the magnetic induction intensity BOi of each point at the position of the magnetic field sensor is calculated [29,30].(4)BOx=0,BOy=∑i=1NBPyi,BOz=∑i=1NBPzi,where BOx, BOy, and BOz are the magnetic induction intensities of each point at the position of the magnetic field sensor, T.Then, the total magnetic induction intensity detected by the magnetic field sensor can be obtained. All variables of formula (3) are known except for the variable y. The magnetic field of the magnetized casing has a definite relationship with the distance d between the probe and the casing. The distance between the probe and the casing can be calculated with the magnetic induction intensity value which can be detected by the magnetic field sensor.


## 3. Design of Electromagnetic Anticollision System While Drilling

### 3.1. Structure Design

In order to measure the distance between adjacent wells while drilling, electromagnetic detection tools must be installed in downhole BHA. Theoretically, the smaller the distance between the tool and the bit is, the better the effect is. However, downhole power drilling tools need to be installed behind the bit during the actual directional well drilling process. The electromagnetic anticollision system while drilling in cluster wells needs mud pulse to transmit data to the ground. If it is installed directly behind the bit, it is difficult to connect with the mud pulse transmitter. Therefore, the best installation position of the probe is behind the downhole power drilling tool.For the design of an electromagnetic detection system, the detection tube is directly connected with the power motor, and it is very similar to MWD. Therefore, the structural design of the system is based on the structure of MWD. Replace MWD probe with sensor nipple, and install magnetic source at both ends of probe shell. Mud flows through the gap between the magnetic source and the probe shell, and mud also flows through the gap between the sensor nipple and the probe shell. The overall structure of the probe is shown in Figure3.Figure 3
The overall structure of the probe.The probe is composed of the shell, the magnetic source, and the sensor nipple. All structures of the system should be designed according to the site standards. The 6 3/4ʺ drill collar is used for the probe shell, and the total length is 2000 mm. In order to ensure sufficient strength, the diameter of the hole in the middle of the probe is designed to be 71.4 mm, and the drilling fluid can flow to the bottom of the well through the hollow. In order to maximize the detection distance of the system, a total of 6 magnetic sources are placed at both ends of the probe, and the axes are parallel to each other. They are symmetrical about the center of the probe. The minimum distance between the two groups of magnetic sources is 1600 mm. The diameter of the magnetic source is 30 mm and the length is 150 mm. Permanent magnets or electromagnetic solenoids can be installed.There is a spring circlip at both ends of the magnetic source. After the magnetic source is installed, both ends should be sealed with special high-temperature resistant resin glue to prevent leakage of the drilling fluid. The sensor joint is installed in the hollow of the probe. The length of the sensor joint is 750 mm and the outer diameter is 45 mm. There is a centralizer outside the sensor joint, and the sensor joint is installed in the hole in the middle of the probe. The center of the sensor must be located at the center point of the magnetic source at both ends of the probe during the installation.The main function of the sensor joint is to collect three-axis magnetic field data and its own attitude data. The sensor joint processes the data and transmits it to the ground through mud pulse. The data is further processed and displayed by the ground system. The core of the sensor joint includes the three-axis magnetic field sensor, the three-axis accelerometer, and the signal processing circuit board.The shell of the sensor joint is made of low-carbon high chromium manganese alloy steel which is of high strength and nonmagnetic. The outer diameter of the shell of the sensor nipple is 45 mm and the wall thickness is 5 mm, which is basically consistent with the MWD probe. There is an end cap seal head at both ends of the sensor joint to prevent the drilling fluid from entering the sensor joint. The upper and lower covers have the same size, and they are made of the high chromium manganese alloy steel with nonmagnetic low carbon. There are two O-ring grooves inside the upper and lower covers. The O-rings are installed during assembly to ensure good sealing after tightening. An outlet hole is reserved on the upper-end cover to output the processed data to the mud pulser through cable.The sensor and signal processing circuit board inside the sensor joint are installed on a nonmagnetic aluminum support. The sensor is located in the hole under the support, and it is consistent with the axis of the sensor joint. The signal processing circuit board is installed above the support. The circuit board is in a long strip shape, and it is fixed on the support with copper columns and stainless steel screws.


### 3.2. Circuit Design

When the system works normally, the magnetic field sensor can collect not only the alternating signal but also the DC signal of the geomagnetic field. The alternating signal is superimposed on the DC signal of the geomagnetic field. The alternating signal of the magnetic field sensor is the key to calculating the distance and azimuth of adjacent wells. But it is very weak, and it may be in the order of 10−1 nT. Therefore, it is necessary to design a perfect amplification and filtering circuit to amplify the alternating signal. In this way, the signal with sufficient strength can be collected by the downhole processor.In addition to the alternating signal of the magnetic field sensor, the geomagnetic signal of the magnetic field sensor also needs to be collected at the same time. The geomagnetic signal is used to calculate the well deviation, the azimuth, and the current rotation angle of the probe in combination with the acceleration sensor so that the azimuth of adjacent wells can be determined by the ground data analysis software.The overall structure of the signal processing circuit board is shown in Figure4. The DC component signal of the three-axis magnetic field sensor is directly analog-to-digital converted, and the AC component is processed by the AC amplification filter circuit before analog-to-digital conversion. The three-axis acceleration sensor collects data directly by the microprocessor. After the underground microprocessor reads the data, the final calculation result is obtained by the software. The results are sent to the mud pulse transmitter through the mud pulse interface, and the mud pulse transmitter sends the data to the ground.Figure 4
Overall structure diagram of signal processing circuit board.


### 3.3. Software Design

The electromagnetic anticollision system while drilling in cluster wells collects the triaxial alternating magnetic field data, the triaxial magnetic field DC component data, and the triaxial acceleration data during the drill string rotation. Because the acquisition rate is very high, and the mud pulse transmission rate is low. It is impossible to upload all collected data. This requires the downhole data to be processed to a certain extent. It should be simplified into some necessary data, and they can be transmitted to the surface system through mud pulse.The electromagnetic anticollision system while drilling for cluster wells includes two kinds of software, which are the data processing software of downhole microprocessor and the surface data analysis software. The data processing software of the downhole microprocessor makes a preliminary analysis of the collected data, and the peak value and valley value of the collected signal can be calculated. Combining the collected peak and valley values with wellbore parameters, the surface data analysis software calculates the final distance and the azimuth of adjacent wells.


#### 3.3.1. Data Processing Software Design of Downhole Microprocessor

The AD conversion chip of three-axis alternating magnetic field data acquisition is AD7712. The chip controls the start of AD conversion by writing the START bit of the control register. The write signal starts when the TFs signal is pulled low, and the TFS is pulled high after all bits are written. At this time, AD7712 starts AD conversion.After the three-axis AD conversion is completed, the program reads the conversion results in the order ofX, Y, and Z axes. The time difference of reading the conversion result program does not affect the time difference of three-axis data acquisition. Therefore, the conversion result of each chip can be read step by step. In order to meet the requirements of consistent acquisition values of three axes, the first acquisition value of the X-axis and the last acquisition value of the Z-axis can be discarded. Then, the average value point can be calculated again.(5)VX=1213∑3n=1VXn+14∑7n=4VXn=V0+1532V1−V0,VY=18∑7n=0VYn=V0+1532V1−V0,VZ=1214∑3n=0VXn+13∑6n=4VXn=V0+1532V1−V0.The recombined three-way acquisition outputs the same results, and the purpose of synchronous acquisition ofX, Y, and Z axes is achieved. Similar to the alternating magnetic field, the X-, Y-, and Z-axis signal inputs are connected together during the test. A sinusoidal signal with the frequency of 1 Hz and amplitude of 5 V is input with a function generator. The three-axis AD conversion data is transferred directly to the computer test software. The test results are shown in Figure 5.Figure 5
Data acquisition test result of three-axis DC component.The magnitude and phase of the peaks of the three curves are consistent. It indicates that the consistency of the three-axis DC signal acquisition part is good, and the accuracy of the three-axis DC component data acquisition is high.The three-axis acceleration sensor uses the MODEL544 microangle positioning sensor. It includes the three-axis fluxgate sensor, the three-axis acceleration sensor, and the temperature sensor. The interface uses TTL-level serial port. The communication parameters of MODEL544 are as follows: baud rate 19200, 8 data bits, 1 stop bit, and no parity. Based on the communication setting of MODEL544, the binary mode is used for output. The data output speed is about 75 times/s, and the output data format is shown in Table1.Table 1
Output date format of MODEL544.
Address offsetData nameRemarks0START byteFixed to 0 × 101∼2Magnetic fieldX-axis dataHigh byte first3∼4AccelerationX-axis dataHigh byte first5∼6Magnetic fieldY-axis dataHigh byte first7∼8AccelerationY-axis dataHigh byte first9∼10Magnetic fieldz-axis dataHigh byte first11∼12Accelerationz-axis dataHigh byte first13∼14Temperature dataHigh byte first15∼16Supply voltage dataHigh byte first17∼18Check codeHigh byte first19∼20End flagFixed to 0x7FFFIn order to reduce the occupation of microprocessor time, the timeout receiving method is proposed in this research. The timeout receiving method uses the 3 ms data interval between frames. The specific process is shown in Figure6.Figure 6
Flow of timeout reception method.After the actual test, the timeout receiving method generates an interrupt every 1 ms. The interrupt service program takes about 1∼5μs. It has little impact on other procedures. It solves the problem that serial port reception occupies microprocessor time. The main frequency of the microprocessor can be reduced to 48 MHz, which greatly reduces the power consumption of the system and improves the stability of the system.The data acquisition program stores all data into a large array in the microprocessor memory, and the storage time is about 10 s. When the acquisition process is completed, the microprocessor will stop the acquisition, and it will process the data. For calculating the distance and relative orientation of adjacent wells, the parameters include the size of the peak value of the alternating magnetic field signal generated during one cycle of the probe rotation, and the rotation angle of the probe relative to the reference plane when the peak value is generated.During the actual data acquisition process, the alternating magnetic field signal is placed in the alternating signal array, and the DC component data and the acceleration sensor data are placed in the DC component array. The two arrays correspond one by one depending on the acquisition time. The DC component data and acceleration sensor data stored in the DC component array are used to calculate the attitude of the probe itself, and then the rotation angle of the probe relative to the origin can be determined. The DC component array needs to be processed first to obtain the rotation angle value of the probe at each time point. And then when the alternating signal array is processed, the found signal peak can be corresponding to the angle.The alternating signal array contains all the alternating magnetic field data, among which the useful data are the size of the signal peak and the time corresponding to the peak. If the process from the datum plane to the 360° rotation of the probe is regarded as a cycle, the alternating signal array should contain multiple cycles of data. During data processing, the angle and time correspondence array shall be generated according to the DC component array. Divide the data into multiple cycles and discard incomplete data cycles. Then, the peak and valley values of the data periodically can be calculated to obtain multiple groups of peak and valley data. These peak and valley data reflect the rotation angle of the probe when the peak and valley appear.The final data processed by the microprocessor includes the peak value, the valley value, and the corresponding angle in a complete cycle. The actual transmission only needs to send these values, and the ground system data analysis software can complete the calculation. The format of data sent by the probe to the ground system is shown in Table2.Table 2
Data sending format from the probe to the ground system.
Address offsetData nameRemarks0Data quantityForn groups of data, this byte is 0 × 50 + n1∼4Peak or valley data 14 bytes and 1 group of data, respectively, high-order angle value, low-order angle value, high-order peak or valley value, and low-order peak or valley value5∼8Peak or valley data 2…n × 4–3∼n × 4Peak or valley data nn × 4 + 1CRC check codeVerification of all previous bytesWhen one well has been drilled near the well being drilled, there should be one peak value and one valley value. The data to be transmitted is 10 bytes in total, and the transmission time is about 80∼90 s. Similarly, when 2 and 3 wells have been drilled near the well being drilled, the data to be sent are 18 bytes and 26 bytes, respectively, and the required transmission time is about 150 s ∼ 160 s and 210 s∼240 s, respectively. When it is ensured that there are no adjacent wells that may collide around the drilling well, the measurement may not be carried on. Frequent measurement is required only when there are adjacent wells close to each other.


#### 3.3.2. Design of Ground Data Analysis Software

After the data collected and processed by the probe is transmitted to the ground through mud pulse, it is decoded by the ground receiving system, and the same group of peak and valley data sent by the probe is restored. After these data are input into the data analysis software, the relative distance and orientation of adjacent wells around the normal drilling can be calculated.Based on the Boland C++ Builder 6.0 environment, the data analysis software of electromagnetic anticollision system while drilling for cluster wells is developed. The main function is to calculate the distance and azimuth of adjacent wells based on the signal peak and valley data uploaded by the probe. After entering the required parameters in the software, click the “calculate” button to calculate the relative distance and the relative orientation of adjacent wells, and the figure will show on the right side of the software. The software also has the function of saving data. The input parameters, peak and valley data, and calculation results can be saved as an engineering file. It can be retransferred when necessary.


## 3.1. Structure Design

In order to measure the distance between adjacent wells while drilling, electromagnetic detection tools must be installed in downhole BHA. Theoretically, the smaller the distance between the tool and the bit is, the better the effect is. However, downhole power drilling tools need to be installed behind the bit during the actual directional well drilling process. The electromagnetic anticollision system while drilling in cluster wells needs mud pulse to transmit data to the ground. If it is installed directly behind the bit, it is difficult to connect with the mud pulse transmitter. Therefore, the best installation position of the probe is behind the downhole power drilling tool.For the design of an electromagnetic detection system, the detection tube is directly connected with the power motor, and it is very similar to MWD. Therefore, the structural design of the system is based on the structure of MWD. Replace MWD probe with sensor nipple, and install magnetic source at both ends of probe shell. Mud flows through the gap between the magnetic source and the probe shell, and mud also flows through the gap between the sensor nipple and the probe shell. The overall structure of the probe is shown in Figure3.Figure 3
The overall structure of the probe.The probe is composed of the shell, the magnetic source, and the sensor nipple. All structures of the system should be designed according to the site standards. The 6 3/4ʺ drill collar is used for the probe shell, and the total length is 2000 mm. In order to ensure sufficient strength, the diameter of the hole in the middle of the probe is designed to be 71.4 mm, and the drilling fluid can flow to the bottom of the well through the hollow. In order to maximize the detection distance of the system, a total of 6 magnetic sources are placed at both ends of the probe, and the axes are parallel to each other. They are symmetrical about the center of the probe. The minimum distance between the two groups of magnetic sources is 1600 mm. The diameter of the magnetic source is 30 mm and the length is 150 mm. Permanent magnets or electromagnetic solenoids can be installed.There is a spring circlip at both ends of the magnetic source. After the magnetic source is installed, both ends should be sealed with special high-temperature resistant resin glue to prevent leakage of the drilling fluid. The sensor joint is installed in the hollow of the probe. The length of the sensor joint is 750 mm and the outer diameter is 45 mm. There is a centralizer outside the sensor joint, and the sensor joint is installed in the hole in the middle of the probe. The center of the sensor must be located at the center point of the magnetic source at both ends of the probe during the installation.The main function of the sensor joint is to collect three-axis magnetic field data and its own attitude data. The sensor joint processes the data and transmits it to the ground through mud pulse. The data is further processed and displayed by the ground system. The core of the sensor joint includes the three-axis magnetic field sensor, the three-axis accelerometer, and the signal processing circuit board.The shell of the sensor joint is made of low-carbon high chromium manganese alloy steel which is of high strength and nonmagnetic. The outer diameter of the shell of the sensor nipple is 45 mm and the wall thickness is 5 mm, which is basically consistent with the MWD probe. There is an end cap seal head at both ends of the sensor joint to prevent the drilling fluid from entering the sensor joint. The upper and lower covers have the same size, and they are made of the high chromium manganese alloy steel with nonmagnetic low carbon. There are two O-ring grooves inside the upper and lower covers. The O-rings are installed during assembly to ensure good sealing after tightening. An outlet hole is reserved on the upper-end cover to output the processed data to the mud pulser through cable.The sensor and signal processing circuit board inside the sensor joint are installed on a nonmagnetic aluminum support. The sensor is located in the hole under the support, and it is consistent with the axis of the sensor joint. The signal processing circuit board is installed above the support. The circuit board is in a long strip shape, and it is fixed on the support with copper columns and stainless steel screws.


## 3.2. Circuit Design

When the system works normally, the magnetic field sensor can collect not only the alternating signal but also the DC signal of the geomagnetic field. The alternating signal is superimposed on the DC signal of the geomagnetic field. The alternating signal of the magnetic field sensor is the key to calculating the distance and azimuth of adjacent wells. But it is very weak, and it may be in the order of 10−1 nT. Therefore, it is necessary to design a perfect amplification and filtering circuit to amplify the alternating signal. In this way, the signal with sufficient strength can be collected by the downhole processor.In addition to the alternating signal of the magnetic field sensor, the geomagnetic signal of the magnetic field sensor also needs to be collected at the same time. The geomagnetic signal is used to calculate the well deviation, the azimuth, and the current rotation angle of the probe in combination with the acceleration sensor so that the azimuth of adjacent wells can be determined by the ground data analysis software.The overall structure of the signal processing circuit board is shown in Figure4. The DC component signal of the three-axis magnetic field sensor is directly analog-to-digital converted, and the AC component is processed by the AC amplification filter circuit before analog-to-digital conversion. The three-axis acceleration sensor collects data directly by the microprocessor. After the underground microprocessor reads the data, the final calculation result is obtained by the software. The results are sent to the mud pulse transmitter through the mud pulse interface, and the mud pulse transmitter sends the data to the ground.Figure 4
Overall structure diagram of signal processing circuit board.


## 3.3. Software Design

The electromagnetic anticollision system while drilling in cluster wells collects the triaxial alternating magnetic field data, the triaxial magnetic field DC component data, and the triaxial acceleration data during the drill string rotation. Because the acquisition rate is very high, and the mud pulse transmission rate is low. It is impossible to upload all collected data. This requires the downhole data to be processed to a certain extent. It should be simplified into some necessary data, and they can be transmitted to the surface system through mud pulse.The electromagnetic anticollision system while drilling for cluster wells includes two kinds of software, which are the data processing software of downhole microprocessor and the surface data analysis software. The data processing software of the downhole microprocessor makes a preliminary analysis of the collected data, and the peak value and valley value of the collected signal can be calculated. Combining the collected peak and valley values with wellbore parameters, the surface data analysis software calculates the final distance and the azimuth of adjacent wells.


### 3.3.1. Data Processing Software Design of Downhole Microprocessor

The AD conversion chip of three-axis alternating magnetic field data acquisition is AD7712. The chip controls the start of AD conversion by writing the START bit of the control register. The write signal starts when the TFs signal is pulled low, and the TFS is pulled high after all bits are written. At this time, AD7712 starts AD conversion.After the three-axis AD conversion is completed, the program reads the conversion results in the order ofX, Y, and Z axes. The time difference of reading the conversion result program does not affect the time difference of three-axis data acquisition. Therefore, the conversion result of each chip can be read step by step. In order to meet the requirements of consistent acquisition values of three axes, the first acquisition value of the X-axis and the last acquisition value of the Z-axis can be discarded. Then, the average value point can be calculated again.(5)VX=1213∑3n=1VXn+14∑7n=4VXn=V0+1532V1−V0,VY=18∑7n=0VYn=V0+1532V1−V0,VZ=1214∑3n=0VXn+13∑6n=4VXn=V0+1532V1−V0.The recombined three-way acquisition outputs the same results, and the purpose of synchronous acquisition ofX, Y, and Z axes is achieved. Similar to the alternating magnetic field, the X-, Y-, and Z-axis signal inputs are connected together during the test. A sinusoidal signal with the frequency of 1 Hz and amplitude of 5 V is input with a function generator. The three-axis AD conversion data is transferred directly to the computer test software. The test results are shown in Figure 5.Figure 5
Data acquisition test result of three-axis DC component.The magnitude and phase of the peaks of the three curves are consistent. It indicates that the consistency of the three-axis DC signal acquisition part is good, and the accuracy of the three-axis DC component data acquisition is high.The three-axis acceleration sensor uses the MODEL544 microangle positioning sensor. It includes the three-axis fluxgate sensor, the three-axis acceleration sensor, and the temperature sensor. The interface uses TTL-level serial port. The communication parameters of MODEL544 are as follows: baud rate 19200, 8 data bits, 1 stop bit, and no parity. Based on the communication setting of MODEL544, the binary mode is used for output. The data output speed is about 75 times/s, and the output data format is shown in Table1.Table 1
Output date format of MODEL544.
Address offsetData nameRemarks0START byteFixed to 0 × 101∼2Magnetic fieldX-axis dataHigh byte first3∼4AccelerationX-axis dataHigh byte first5∼6Magnetic fieldY-axis dataHigh byte first7∼8AccelerationY-axis dataHigh byte first9∼10Magnetic fieldz-axis dataHigh byte first11∼12Accelerationz-axis dataHigh byte first13∼14Temperature dataHigh byte first15∼16Supply voltage dataHigh byte first17∼18Check codeHigh byte first19∼20End flagFixed to 0x7FFFIn order to reduce the occupation of microprocessor time, the timeout receiving method is proposed in this research. The timeout receiving method uses the 3 ms data interval between frames. The specific process is shown in Figure6.Figure 6
Flow of timeout reception method.After the actual test, the timeout receiving method generates an interrupt every 1 ms. The interrupt service program takes about 1∼5μs. It has little impact on other procedures. It solves the problem that serial port reception occupies microprocessor time. The main frequency of the microprocessor can be reduced to 48 MHz, which greatly reduces the power consumption of the system and improves the stability of the system.The data acquisition program stores all data into a large array in the microprocessor memory, and the storage time is about 10 s. When the acquisition process is completed, the microprocessor will stop the acquisition, and it will process the data. For calculating the distance and relative orientation of adjacent wells, the parameters include the size of the peak value of the alternating magnetic field signal generated during one cycle of the probe rotation, and the rotation angle of the probe relative to the reference plane when the peak value is generated.During the actual data acquisition process, the alternating magnetic field signal is placed in the alternating signal array, and the DC component data and the acceleration sensor data are placed in the DC component array. The two arrays correspond one by one depending on the acquisition time. The DC component data and acceleration sensor data stored in the DC component array are used to calculate the attitude of the probe itself, and then the rotation angle of the probe relative to the origin can be determined. The DC component array needs to be processed first to obtain the rotation angle value of the probe at each time point. And then when the alternating signal array is processed, the found signal peak can be corresponding to the angle.The alternating signal array contains all the alternating magnetic field data, among which the useful data are the size of the signal peak and the time corresponding to the peak. If the process from the datum plane to the 360° rotation of the probe is regarded as a cycle, the alternating signal array should contain multiple cycles of data. During data processing, the angle and time correspondence array shall be generated according to the DC component array. Divide the data into multiple cycles and discard incomplete data cycles. Then, the peak and valley values of the data periodically can be calculated to obtain multiple groups of peak and valley data. These peak and valley data reflect the rotation angle of the probe when the peak and valley appear.The final data processed by the microprocessor includes the peak value, the valley value, and the corresponding angle in a complete cycle. The actual transmission only needs to send these values, and the ground system data analysis software can complete the calculation. The format of data sent by the probe to the ground system is shown in Table2.Table 2
Data sending format from the probe to the ground system.
Address offsetData nameRemarks0Data quantityForn groups of data, this byte is 0 × 50 + n1∼4Peak or valley data 14 bytes and 1 group of data, respectively, high-order angle value, low-order angle value, high-order peak or valley value, and low-order peak or valley value5∼8Peak or valley data 2…n × 4–3∼n × 4Peak or valley data nn × 4 + 1CRC check codeVerification of all previous bytesWhen one well has been drilled near the well being drilled, there should be one peak value and one valley value. The data to be transmitted is 10 bytes in total, and the transmission time is about 80∼90 s. Similarly, when 2 and 3 wells have been drilled near the well being drilled, the data to be sent are 18 bytes and 26 bytes, respectively, and the required transmission time is about 150 s ∼ 160 s and 210 s∼240 s, respectively. When it is ensured that there are no adjacent wells that may collide around the drilling well, the measurement may not be carried on. Frequent measurement is required only when there are adjacent wells close to each other.


### 3.3.2. Design of Ground Data Analysis Software

After the data collected and processed by the probe is transmitted to the ground through mud pulse, it is decoded by the ground receiving system, and the same group of peak and valley data sent by the probe is restored. After these data are input into the data analysis software, the relative distance and orientation of adjacent wells around the normal drilling can be calculated.Based on the Boland C++ Builder 6.0 environment, the data analysis software of electromagnetic anticollision system while drilling for cluster wells is developed. The main function is to calculate the distance and azimuth of adjacent wells based on the signal peak and valley data uploaded by the probe. After entering the required parameters in the software, click the “calculate” button to calculate the relative distance and the relative orientation of adjacent wells, and the figure will show on the right side of the software. The software also has the function of saving data. The input parameters, peak and valley data, and calculation results can be saved as an engineering file. It can be retransferred when necessary.


## 3.3.1. Data Processing Software Design of Downhole Microprocessor

The AD conversion chip of three-axis alternating magnetic field data acquisition is AD7712. The chip controls the start of AD conversion by writing the START bit of the control register. The write signal starts when the TFs signal is pulled low, and the TFS is pulled high after all bits are written. At this time, AD7712 starts AD conversion.After the three-axis AD conversion is completed, the program reads the conversion results in the order ofX, Y, and Z axes. The time difference of reading the conversion result program does not affect the time difference of three-axis data acquisition. Therefore, the conversion result of each chip can be read step by step. In order to meet the requirements of consistent acquisition values of three axes, the first acquisition value of the X-axis and the last acquisition value of the Z-axis can be discarded. Then, the average value point can be calculated again.(5)VX=1213∑3n=1VXn+14∑7n=4VXn=V0+1532V1−V0,VY=18∑7n=0VYn=V0+1532V1−V0,VZ=1214∑3n=0VXn+13∑6n=4VXn=V0+1532V1−V0.The recombined three-way acquisition outputs the same results, and the purpose of synchronous acquisition ofX, Y, and Z axes is achieved. Similar to the alternating magnetic field, the X-, Y-, and Z-axis signal inputs are connected together during the test. A sinusoidal signal with the frequency of 1 Hz and amplitude of 5 V is input with a function generator. The three-axis AD conversion data is transferred directly to the computer test software. The test results are shown in Figure 5.Figure 5
Data acquisition test result of three-axis DC component.The magnitude and phase of the peaks of the three curves are consistent. It indicates that the consistency of the three-axis DC signal acquisition part is good, and the accuracy of the three-axis DC component data acquisition is high.The three-axis acceleration sensor uses the MODEL544 microangle positioning sensor. It includes the three-axis fluxgate sensor, the three-axis acceleration sensor, and the temperature sensor. The interface uses TTL-level serial port. The communication parameters of MODEL544 are as follows: baud rate 19200, 8 data bits, 1 stop bit, and no parity. Based on the communication setting of MODEL544, the binary mode is used for output. The data output speed is about 75 times/s, and the output data format is shown in Table1.Table 1
Output date format of MODEL544.
Address offsetData nameRemarks0START byteFixed to 0 × 101∼2Magnetic fieldX-axis dataHigh byte first3∼4AccelerationX-axis dataHigh byte first5∼6Magnetic fieldY-axis dataHigh byte first7∼8AccelerationY-axis dataHigh byte first9∼10Magnetic fieldz-axis dataHigh byte first11∼12Accelerationz-axis dataHigh byte first13∼14Temperature dataHigh byte first15∼16Supply voltage dataHigh byte first17∼18Check codeHigh byte first19∼20End flagFixed to 0x7FFFIn order to reduce the occupation of microprocessor time, the timeout receiving method is proposed in this research. The timeout receiving method uses the 3 ms data interval between frames. The specific process is shown in Figure6.Figure 6
Flow of timeout reception method.After the actual test, the timeout receiving method generates an interrupt every 1 ms. The interrupt service program takes about 1∼5μs. It has little impact on other procedures. It solves the problem that serial port reception occupies microprocessor time. The main frequency of the microprocessor can be reduced to 48 MHz, which greatly reduces the power consumption of the system and improves the stability of the system.The data acquisition program stores all data into a large array in the microprocessor memory, and the storage time is about 10 s. When the acquisition process is completed, the microprocessor will stop the acquisition, and it will process the data. For calculating the distance and relative orientation of adjacent wells, the parameters include the size of the peak value of the alternating magnetic field signal generated during one cycle of the probe rotation, and the rotation angle of the probe relative to the reference plane when the peak value is generated.During the actual data acquisition process, the alternating magnetic field signal is placed in the alternating signal array, and the DC component data and the acceleration sensor data are placed in the DC component array. The two arrays correspond one by one depending on the acquisition time. The DC component data and acceleration sensor data stored in the DC component array are used to calculate the attitude of the probe itself, and then the rotation angle of the probe relative to the origin can be determined. The DC component array needs to be processed first to obtain the rotation angle value of the probe at each time point. And then when the alternating signal array is processed, the found signal peak can be corresponding to the angle.The alternating signal array contains all the alternating magnetic field data, among which the useful data are the size of the signal peak and the time corresponding to the peak. If the process from the datum plane to the 360° rotation of the probe is regarded as a cycle, the alternating signal array should contain multiple cycles of data. During data processing, the angle and time correspondence array shall be generated according to the DC component array. Divide the data into multiple cycles and discard incomplete data cycles. Then, the peak and valley values of the data periodically can be calculated to obtain multiple groups of peak and valley data. These peak and valley data reflect the rotation angle of the probe when the peak and valley appear.The final data processed by the microprocessor includes the peak value, the valley value, and the corresponding angle in a complete cycle. The actual transmission only needs to send these values, and the ground system data analysis software can complete the calculation. The format of data sent by the probe to the ground system is shown in Table2.Table 2
Data sending format from the probe to the ground system.
Address offsetData nameRemarks0Data quantityForn groups of data, this byte is 0 × 50 + n1∼4Peak or valley data 14 bytes and 1 group of data, respectively, high-order angle value, low-order angle value, high-order peak or valley value, and low-order peak or valley value5∼8Peak or valley data 2…n × 4–3∼n × 4Peak or valley data nn × 4 + 1CRC check codeVerification of all previous bytesWhen one well has been drilled near the well being drilled, there should be one peak value and one valley value. The data to be transmitted is 10 bytes in total, and the transmission time is about 80∼90 s. Similarly, when 2 and 3 wells have been drilled near the well being drilled, the data to be sent are 18 bytes and 26 bytes, respectively, and the required transmission time is about 150 s ∼ 160 s and 210 s∼240 s, respectively. When it is ensured that there are no adjacent wells that may collide around the drilling well, the measurement may not be carried on. Frequent measurement is required only when there are adjacent wells close to each other.


## 3.3.2. Design of Ground Data Analysis Software

After the data collected and processed by the probe is transmitted to the ground through mud pulse, it is decoded by the ground receiving system, and the same group of peak and valley data sent by the probe is restored. After these data are input into the data analysis software, the relative distance and orientation of adjacent wells around the normal drilling can be calculated.Based on the Boland C++ Builder 6.0 environment, the data analysis software of electromagnetic anticollision system while drilling for cluster wells is developed. The main function is to calculate the distance and azimuth of adjacent wells based on the signal peak and valley data uploaded by the probe. After entering the required parameters in the software, click the “calculate” button to calculate the relative distance and the relative orientation of adjacent wells, and the figure will show on the right side of the software. The software also has the function of saving data. The input parameters, peak and valley data, and calculation results can be saved as an engineering file. It can be retransferred when necessary.


## 4. Experimental Equipment and Method

Based on the principle prototype of the electromagnetic distance measurement while drilling in adjacent wells, experiments were carried out. Although the electromagnetic anticollision measuring and steering algorithm of adjacent wells proposed in this paper has errors, it can realize the real-time monitoring of the distance and azimuth of adjacent wells.


### 4.1. Experimental Site

Due to the various magnetic fields in the real environment, the detection accuracy of electromagnetic detection tools will be affected. In order to minimize the influence of the surrounding environment on the measurement results of electromagnetic detection tools, this paper chose a farmyard in Shunyi District as the experiment site, which was far away from various buildings such as highways, high-voltage towers, and low-voltage wires. There were no metal cables and pipelines underground, and the environmental magnetic field was relatively stable. There were few stray interference signals. It was suitable as an experiment site for electromagnetic anticollision tools while drilling in cluster wells.


### 4.2. Experimental Equipment

As shown in Figure7, the ground experimental equipment mainly included the casing, the experiment probe, the interface box, and the computer. The experiment used three 5ʺ casings, and the casings were connected together. The total length is 28.47 m. The main structure of the experiment probe is made of nonmagnetic aluminum alloy. The diameter of the permanent magnet is 25 mm, and the length is 80 mm. The material is neodymium iron boron, and the surface magnetic field strength is 5000 Gs. The experiment probe is equipped with a three-axis fluxgate sensor and a three-axis acceleration sensor. Because it was a ground environment, there was no need to use mud pulses to transmit data, so the experiment probe sent data directly to a computer by a cable at a speed of up to 20 Kb/s. All alternating signal data and DC component data were directly transmitted to the computer, and it was convenient for the data analysis and processing. The two ends of the experiment probe were connected with the driving rod passing through the synchronization wheel and synchronization belt. Manually rotating the drive rod could drive the experiment probe to rotate around its axis to simulate the rotation of the drill string. The interface box was used to convert the signal collected by the experiment probe into a USB interface signal, and it provided 48 V power to the analog probe. The computer was equipped with the data acquisition software which could collect data.Figure 7
Diagram of simulated experimental instrument.


### 4.3. Experimental Method

(1)
Place the probe more than 20 m away from the casing to simulate that there is no drilled hole around the drilling well. Manually rotate the probe to simulate the rotation of the drill string. Record and save the data(2)
Align the probe to a position in the casing and place it parallel to the casing. The probe is 2 m away from the casing to simulate that there are drilled wells around the drilling well. Manually rotate the probe to simulate the rotation of the drill string. Record and save the data(3)
Align the probe with the same position in the casing and place it parallel to the casing. The probe is 0.5 m, 1 m, 2 m, 3 m, 4 m, and 5 m away from the casing, respectively, to simulate the situation of drilled wells around the drilling in progress. Manually rotate the probe to simulate the rotation of the drill string. Record and save the data(4)
Replace the position and repeat step (3)(5)
Change the position. Align the probe with the casing coupling, and repeat step (3)(6)
Place the probe and casing at angles of 10°, 20°, 30°, 40°, 50°, 60°, 70°, 80°, and 90°, respectively. The equipment is 1 m away from the casing to simulate that there are drilled wells around the drilling well. Manually rotate the probe to simulate the rotation of the drill string(7)
Change the distance between the probe and the casing to 2 m, and repeat step (6)


## 4.1. Experimental Site

Due to the various magnetic fields in the real environment, the detection accuracy of electromagnetic detection tools will be affected. In order to minimize the influence of the surrounding environment on the measurement results of electromagnetic detection tools, this paper chose a farmyard in Shunyi District as the experiment site, which was far away from various buildings such as highways, high-voltage towers, and low-voltage wires. There were no metal cables and pipelines underground, and the environmental magnetic field was relatively stable. There were few stray interference signals. It was suitable as an experiment site for electromagnetic anticollision tools while drilling in cluster wells.


## 4.2. Experimental Equipment

As shown in Figure7, the ground experimental equipment mainly included the casing, the experiment probe, the interface box, and the computer. The experiment used three 5ʺ casings, and the casings were connected together. The total length is 28.47 m. The main structure of the experiment probe is made of nonmagnetic aluminum alloy. The diameter of the permanent magnet is 25 mm, and the length is 80 mm. The material is neodymium iron boron, and the surface magnetic field strength is 5000 Gs. The experiment probe is equipped with a three-axis fluxgate sensor and a three-axis acceleration sensor. Because it was a ground environment, there was no need to use mud pulses to transmit data, so the experiment probe sent data directly to a computer by a cable at a speed of up to 20 Kb/s. All alternating signal data and DC component data were directly transmitted to the computer, and it was convenient for the data analysis and processing. The two ends of the experiment probe were connected with the driving rod passing through the synchronization wheel and synchronization belt. Manually rotating the drive rod could drive the experiment probe to rotate around its axis to simulate the rotation of the drill string. The interface box was used to convert the signal collected by the experiment probe into a USB interface signal, and it provided 48 V power to the analog probe. The computer was equipped with the data acquisition software which could collect data.Figure 7
Diagram of simulated experimental instrument.


## 4.3. Experimental Method

(1)
Place the probe more than 20 m away from the casing to simulate that there is no drilled hole around the drilling well. Manually rotate the probe to simulate the rotation of the drill string. Record and save the data(2)
Align the probe to a position in the casing and place it parallel to the casing. The probe is 2 m away from the casing to simulate that there are drilled wells around the drilling well. Manually rotate the probe to simulate the rotation of the drill string. Record and save the data(3)
Align the probe with the same position in the casing and place it parallel to the casing. The probe is 0.5 m, 1 m, 2 m, 3 m, 4 m, and 5 m away from the casing, respectively, to simulate the situation of drilled wells around the drilling in progress. Manually rotate the probe to simulate the rotation of the drill string. Record and save the data(4)
Replace the position and repeat step (3)(5)
Change the position. Align the probe with the casing coupling, and repeat step (3)(6)
Place the probe and casing at angles of 10°, 20°, 30°, 40°, 50°, 60°, 70°, 80°, and 90°, respectively. The equipment is 1 m away from the casing to simulate that there are drilled wells around the drilling well. Manually rotate the probe to simulate the rotation of the drill string(7)
Change the distance between the probe and the casing to 2 m, and repeat step (6)


## 5. Experimental Results

### 5.1. Feasibility of Measuring Principle

The height of the casing was 0.35 m from the ground, and the axis of the probe was 0.25 m from the ground. When the rotation angle of the probe was 0°, the magnetic source axis at both ends of the probe was perpendicular to the ground, as shown in Figure8. When the experiment probe was 21 m and 2 m away from the casing, respectively, the data obtained by the software was shown in Figure 9.Figure 8
Position relationship between the probe and the casing.Figure 9
Simulation data when the distance from the probe to the casing is (a)d = 21 m and (b) d = 2 m.
(a)(b)When the experiment probe was 21 m away from the casing, the magnetic field intensity changes little during the process of the probe rotating one circle, and there were no obvious wave crests and troughs. When the probe was 2 m away from the casing, although there were many data burrs during the process of the probe rotating one circle, it could be clearly seen that there was a peak and a trough in the magnetic field strength data. When the probe is 2 m away from the casing, the probe rotated to 96° and 276°, and the axis of the magnetic source just passed through the casing. In theory, the peak or trough should be detected at this time. The wave crests and wave troughs occurred exactly at the positions corresponding to these two angles. It proved the feasibility of the distance measurement principle of the electromagnetic anticollision tool while drilling in cluster wells.


### 5.2. Measuring Algorithm Accuracy Results

#### 5.2.1. The Probe Was Placed Parallel to the Casing

Three points on the casing were selected as the measuring points. The position distribution of the three measuring points on the casing was shown in Figure10. The measuring point 1 and measuring point 2 were different positions on the two casings, and measuring point 3 was the coupling position of the two casings.Figure 10
Selection of experiment position.After selecting the measuring points, the probe was placed in parallel with the casing. The probe was 0.5 m, 1 m, 2 m, 3 m, 4 m, and 5 m away from the casing. Six sets of data were measured, and the peak value, valley value, and the corresponding angle of the three measurement points were input into the data analysis software for calculation (Figures11–13).Figure 11
Calculation result of measuring point 1. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)Figure 12
Calculation result of experiment point 2. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)Figure 13
Calculation result of experiment point 3. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)When the probe and the casing were placed in parallel, and the distance between the probe and the casing was 0.5∼3 m, the calculation result was more accurate. The distance error and the angle error were both within 10%. When the distance between the probe and the casing exceeded 3 m, the error became larger and the signal became chaotic. The reason was that the tool currently only used two magnetic sources. When the distance was far away, the magnetic field strength signal was weak. At the same time, it was affected by the background noise of the circuit board, and the signal-to-noise ratio was low. The noise signal affected the peak magnetic field strength data, and it led to a larger calculation error.Because the alternating magnetic field signals shielded the influence of the geomagnetic field and the remanence of the casing, different detection positions had relatively little influence on the measurement results of the magnetic field strength of the probe. However, due to the different diameters of the collar and casing, the existence of a step had a certain impact on the magnetic field strength measurement data. It may cause large deviations in the calculation results. Therefore, the position of the casing coupling should be avoided as far as possible during the actual measurement.


#### 5.2.2. The Probe and the Casing Were Placed at a Certain Angle

The probe and the casing were placed at a certain angle, and the position of measuring point 1 was selected for the experiment. The distance between the probe and the casing was 1 m, and the peak value, valley value, and the corresponding angle of point 1 were input into the data analysis software for calculation. The calculation results were shown in Table3.Table 3
Calculation result of different angles when the distance from sensor to casing is 1 m.
Angle (°)Theory angle (°)Peak (nT)Peak angle (°)Valley (nT)Valley angle (°)Calculation distance (m)Calculation angle (°)Distance error (%)Angle error (°)10951292.197.3−1033.4271.20.9297.582.520951000.5103.5−11022621.062102.76.27.730951025.2103.7−988.2268.41.048103.54.88.540951005.4104.8−1010.2270.50.958103.24.28.25095998104.2−792.2268.40.931104.36.99.36095805.492.8−810.1273.90.82292.917.82.17095538.2110.4−508.4270.50.795109.820.514.88095263.4112.5−336.2281.30.788110.221.215.29095383.5134.2−321.3287.80.811108.218.913.9When the distance between the probe and the casing was 2 m, the calculation results of different angles were shown in Table4. Regardless of the distance, when the included angle between the normal drilling and the adjacent well was about 80°, the trend of the magnetic induction data detected by the probe had changed suddenly (Figure 14). When the included angle between the positive well and the adjacent well was large, the magnetic field generated by the magnetic source far away from the casing in the probe was too small. The direction of the magnetic pole of the magnetic source also pointed to the distance of the casing; it was equivalent to that only one magnetic source in the probe had magnetized the casing. The distribution of the magnetic field line had changed, and it resulted in a sudden change in the curve. When the included angle between the drilling well and the adjacent well changed from 0° to about 50°, the magnetic induction data detected by the probe had been basically reduced to half of the original. At this time, the collected signal had been relatively weak.Table 4
Calculation result of different angles when the distance from sensor to casing is 2 m.
Angle (°)Theory angle (°)Peak (nT)Peak angle (°)Valley (nT)Valley angle (°)Calculation distance (m)Calculation angle (°)Distance error (%)Angle error (°)1092150.198.2−146.8268.12.15198.87.66.82092120.5101.4−142.4265.71.834101.18.39.13092108.9100.2−108.7264.21.9199.597.54092101.599.6−105.4262.71.93597.76.55.75092100.1101.7−78.9269.11.822101.28.99.2609272.785.7−86.4264.81.95484.84.67.2709252.7103.5−50.1271.31.809102.819.110.8809248.9105.8−61.1258.52.371112.518.620.5909250.4112.1−55.62811.929111.27.119.2Figure 14
Effect of the angle between drilling well and adjacent well on measurement results.When the angle between the two magnetic sources exceeded 50°, the distribution of the magnetizing magnetic field generated by the two magnetic sources on the probe changed, so the error increased. Therefore, this tool was mainly suitable for the well section of which the angle between the two wells is within 50°. When the angle between the probe and the casing exceeded 50°, it was best to choose other types of anticollision tools for the distance measurement and guidance.


## 5.1. Feasibility of Measuring Principle

The height of the casing was 0.35 m from the ground, and the axis of the probe was 0.25 m from the ground. When the rotation angle of the probe was 0°, the magnetic source axis at both ends of the probe was perpendicular to the ground, as shown in Figure8. When the experiment probe was 21 m and 2 m away from the casing, respectively, the data obtained by the software was shown in Figure 9.Figure 8
Position relationship between the probe and the casing.Figure 9
Simulation data when the distance from the probe to the casing is (a)d = 21 m and (b) d = 2 m.
(a)(b)When the experiment probe was 21 m away from the casing, the magnetic field intensity changes little during the process of the probe rotating one circle, and there were no obvious wave crests and troughs. When the probe was 2 m away from the casing, although there were many data burrs during the process of the probe rotating one circle, it could be clearly seen that there was a peak and a trough in the magnetic field strength data. When the probe is 2 m away from the casing, the probe rotated to 96° and 276°, and the axis of the magnetic source just passed through the casing. In theory, the peak or trough should be detected at this time. The wave crests and wave troughs occurred exactly at the positions corresponding to these two angles. It proved the feasibility of the distance measurement principle of the electromagnetic anticollision tool while drilling in cluster wells.


## 5.2. Measuring Algorithm Accuracy Results

### 5.2.1. The Probe Was Placed Parallel to the Casing

Three points on the casing were selected as the measuring points. The position distribution of the three measuring points on the casing was shown in Figure10. The measuring point 1 and measuring point 2 were different positions on the two casings, and measuring point 3 was the coupling position of the two casings.Figure 10
Selection of experiment position.After selecting the measuring points, the probe was placed in parallel with the casing. The probe was 0.5 m, 1 m, 2 m, 3 m, 4 m, and 5 m away from the casing. Six sets of data were measured, and the peak value, valley value, and the corresponding angle of the three measurement points were input into the data analysis software for calculation (Figures11–13).Figure 11
Calculation result of measuring point 1. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)Figure 12
Calculation result of experiment point 2. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)Figure 13
Calculation result of experiment point 3. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)When the probe and the casing were placed in parallel, and the distance between the probe and the casing was 0.5∼3 m, the calculation result was more accurate. The distance error and the angle error were both within 10%. When the distance between the probe and the casing exceeded 3 m, the error became larger and the signal became chaotic. The reason was that the tool currently only used two magnetic sources. When the distance was far away, the magnetic field strength signal was weak. At the same time, it was affected by the background noise of the circuit board, and the signal-to-noise ratio was low. The noise signal affected the peak magnetic field strength data, and it led to a larger calculation error.Because the alternating magnetic field signals shielded the influence of the geomagnetic field and the remanence of the casing, different detection positions had relatively little influence on the measurement results of the magnetic field strength of the probe. However, due to the different diameters of the collar and casing, the existence of a step had a certain impact on the magnetic field strength measurement data. It may cause large deviations in the calculation results. Therefore, the position of the casing coupling should be avoided as far as possible during the actual measurement.


### 5.2.2. The Probe and the Casing Were Placed at a Certain Angle

The probe and the casing were placed at a certain angle, and the position of measuring point 1 was selected for the experiment. The distance between the probe and the casing was 1 m, and the peak value, valley value, and the corresponding angle of point 1 were input into the data analysis software for calculation. The calculation results were shown in Table3.Table 3
Calculation result of different angles when the distance from sensor to casing is 1 m.
Angle (°)Theory angle (°)Peak (nT)Peak angle (°)Valley (nT)Valley angle (°)Calculation distance (m)Calculation angle (°)Distance error (%)Angle error (°)10951292.197.3−1033.4271.20.9297.582.520951000.5103.5−11022621.062102.76.27.730951025.2103.7−988.2268.41.048103.54.88.540951005.4104.8−1010.2270.50.958103.24.28.25095998104.2−792.2268.40.931104.36.99.36095805.492.8−810.1273.90.82292.917.82.17095538.2110.4−508.4270.50.795109.820.514.88095263.4112.5−336.2281.30.788110.221.215.29095383.5134.2−321.3287.80.811108.218.913.9When the distance between the probe and the casing was 2 m, the calculation results of different angles were shown in Table4. Regardless of the distance, when the included angle between the normal drilling and the adjacent well was about 80°, the trend of the magnetic induction data detected by the probe had changed suddenly (Figure 14). When the included angle between the positive well and the adjacent well was large, the magnetic field generated by the magnetic source far away from the casing in the probe was too small. The direction of the magnetic pole of the magnetic source also pointed to the distance of the casing; it was equivalent to that only one magnetic source in the probe had magnetized the casing. The distribution of the magnetic field line had changed, and it resulted in a sudden change in the curve. When the included angle between the drilling well and the adjacent well changed from 0° to about 50°, the magnetic induction data detected by the probe had been basically reduced to half of the original. At this time, the collected signal had been relatively weak.Table 4
Calculation result of different angles when the distance from sensor to casing is 2 m.
Angle (°)Theory angle (°)Peak (nT)Peak angle (°)Valley (nT)Valley angle (°)Calculation distance (m)Calculation angle (°)Distance error (%)Angle error (°)1092150.198.2−146.8268.12.15198.87.66.82092120.5101.4−142.4265.71.834101.18.39.13092108.9100.2−108.7264.21.9199.597.54092101.599.6−105.4262.71.93597.76.55.75092100.1101.7−78.9269.11.822101.28.99.2609272.785.7−86.4264.81.95484.84.67.2709252.7103.5−50.1271.31.809102.819.110.8809248.9105.8−61.1258.52.371112.518.620.5909250.4112.1−55.62811.929111.27.119.2Figure 14
Effect of the angle between drilling well and adjacent well on measurement results.When the angle between the two magnetic sources exceeded 50°, the distribution of the magnetizing magnetic field generated by the two magnetic sources on the probe changed, so the error increased. Therefore, this tool was mainly suitable for the well section of which the angle between the two wells is within 50°. When the angle between the probe and the casing exceeded 50°, it was best to choose other types of anticollision tools for the distance measurement and guidance.


## 5.2.1. The Probe Was Placed Parallel to the Casing

Three points on the casing were selected as the measuring points. The position distribution of the three measuring points on the casing was shown in Figure10. The measuring point 1 and measuring point 2 were different positions on the two casings, and measuring point 3 was the coupling position of the two casings.Figure 10
Selection of experiment position.After selecting the measuring points, the probe was placed in parallel with the casing. The probe was 0.5 m, 1 m, 2 m, 3 m, 4 m, and 5 m away from the casing. Six sets of data were measured, and the peak value, valley value, and the corresponding angle of the three measurement points were input into the data analysis software for calculation (Figures11–13).Figure 11
Calculation result of measuring point 1. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)Figure 12
Calculation result of experiment point 2. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)Figure 13
Calculation result of experiment point 3. (a)d = 0.5 m. (b) d = 1 m. (c) d = 2 m. (d) d = 3 m. (e) d = 4 m. (f) d = 5 m.
(a)(b)(c)(d)(e)(f)When the probe and the casing were placed in parallel, and the distance between the probe and the casing was 0.5∼3 m, the calculation result was more accurate. The distance error and the angle error were both within 10%. When the distance between the probe and the casing exceeded 3 m, the error became larger and the signal became chaotic. The reason was that the tool currently only used two magnetic sources. When the distance was far away, the magnetic field strength signal was weak. At the same time, it was affected by the background noise of the circuit board, and the signal-to-noise ratio was low. The noise signal affected the peak magnetic field strength data, and it led to a larger calculation error.Because the alternating magnetic field signals shielded the influence of the geomagnetic field and the remanence of the casing, different detection positions had relatively little influence on the measurement results of the magnetic field strength of the probe. However, due to the different diameters of the collar and casing, the existence of a step had a certain impact on the magnetic field strength measurement data. It may cause large deviations in the calculation results. Therefore, the position of the casing coupling should be avoided as far as possible during the actual measurement.


## 5.2.2. The Probe and the Casing Were Placed at a Certain Angle

The probe and the casing were placed at a certain angle, and the position of measuring point 1 was selected for the experiment. The distance between the probe and the casing was 1 m, and the peak value, valley value, and the corresponding angle of point 1 were input into the data analysis software for calculation. The calculation results were shown in Table3.Table 3
Calculation result of different angles when the distance from sensor to casing is 1 m.
Angle (°)Theory angle (°)Peak (nT)Peak angle (°)Valley (nT)Valley angle (°)Calculation distance (m)Calculation angle (°)Distance error (%)Angle error (°)10951292.197.3−1033.4271.20.9297.582.520951000.5103.5−11022621.062102.76.27.730951025.2103.7−988.2268.41.048103.54.88.540951005.4104.8−1010.2270.50.958103.24.28.25095998104.2−792.2268.40.931104.36.99.36095805.492.8−810.1273.90.82292.917.82.17095538.2110.4−508.4270.50.795109.820.514.88095263.4112.5−336.2281.30.788110.221.215.29095383.5134.2−321.3287.80.811108.218.913.9When the distance between the probe and the casing was 2 m, the calculation results of different angles were shown in Table4. Regardless of the distance, when the included angle between the normal drilling and the adjacent well was about 80°, the trend of the magnetic induction data detected by the probe had changed suddenly (Figure 14). When the included angle between the positive well and the adjacent well was large, the magnetic field generated by the magnetic source far away from the casing in the probe was too small. The direction of the magnetic pole of the magnetic source also pointed to the distance of the casing; it was equivalent to that only one magnetic source in the probe had magnetized the casing. The distribution of the magnetic field line had changed, and it resulted in a sudden change in the curve. When the included angle between the drilling well and the adjacent well changed from 0° to about 50°, the magnetic induction data detected by the probe had been basically reduced to half of the original. At this time, the collected signal had been relatively weak.Table 4
Calculation result of different angles when the distance from sensor to casing is 2 m.
Angle (°)Theory angle (°)Peak (nT)Peak angle (°)Valley (nT)Valley angle (°)Calculation distance (m)Calculation angle (°)Distance error (%)Angle error (°)1092150.198.2−146.8268.12.15198.87.66.82092120.5101.4−142.4265.71.834101.18.39.13092108.9100.2−108.7264.21.9199.597.54092101.599.6−105.4262.71.93597.76.55.75092100.1101.7−78.9269.11.822101.28.99.2609272.785.7−86.4264.81.95484.84.67.2709252.7103.5−50.1271.31.809102.819.110.8809248.9105.8−61.1258.52.371112.518.620.5909250.4112.1−55.62811.929111.27.119.2Figure 14
Effect of the angle between drilling well and adjacent well on measurement results.When the angle between the two magnetic sources exceeded 50°, the distribution of the magnetizing magnetic field generated by the two magnetic sources on the probe changed, so the error increased. Therefore, this tool was mainly suitable for the well section of which the angle between the two wells is within 50°. When the angle between the probe and the casing exceeded 50°, it was best to choose other types of anticollision tools for the distance measurement and guidance.


## 6. Conclusion

To verify the accuracy of the electromagnetic anticollision measuring while drilling steering algorithms, a self-developed set of experimental prototypes of adjacent wells of electromagnetic measuring anticollision tools while drilling was used to conduct simulation experiments.(1)
When there was a casing around the probe, there was a peak and a trough in the data. The position of the peak and trough appeared at the moment when the axis of the magnetic source on the probe was directly opposite to the casing(2)
When the probe and the casing were placed in parallel, the distance between the probe and the casing was within 0.5∼3 m, and the system could calculate the distance and azimuth information of the adjacent well more accurately. However, due to the weak magnetic field strength of the current magnetic source, the calculation result error increased when the distance exceeded 3 m(3)
Because the alternating magnetic field signal shielded the influence of the Earth's magnetic field and the remanence of the casing, different detection positions had relatively little influence on the measurement results of the probe. However, the casing coupling had a certain impact on the magnetic field, and it caused large deviations in the calculation results. Therefore, the position of the casing coupling should be avoided as far as possible during the actual measurement



---

*Source: 1518320-2022-02-09.xml*