Research and Test on the Device of Downhole Near-Bit Temperature and Pressure Measurement While Drilling

: The accurate acquisition of downhole engineering parameters, such as real-time pressure and temperature measurements, plays a crucial role in mitigating drilling risks and preventing accidents. In this study, we present the design of a real-time data acquisition and transmission system for drilling operations. The system utilizes a near-bit measurement method to simultaneously measure downhole parameters, including mud pressure and temperature. By analyzing the pressure and temperature frequencies obtained from a quartz crystal pressure gauge and compensating for temperature effects, accurate pressure values are obtained. The resistance value of a PT1000 sensor is measured, and a second-order ﬁtting is performed using laboratory scale coefﬁcients to determine the temperature values. The data acquisition system employs an advanced microcontroller as the main control chip, along with an A/D conversion chip. Additionally, signal ampliﬁcation, data storage modules, data transmission modules, and relevant peripheral circuits are designed. The ﬁeld tests were conducted in the 4605~4620 m well section of well Qing 2-76 in the Yumen Oilﬁeld. The results demonstrate stable transmission signals and accurate decoding, enabling the real-time monitoring of pressure and temperature. The tests yielded favorable outcomes, providing a tangible means to analyze the actual operating conditions of the downhole drill string.


Introduction
With the advancement of deep well drilling technology, particularly under-balanced drilling, in the 1990s, the global drilling industry made significant progress in the implementation of temperature and pressure measurement systems during drilling operations.Notably, Wang Yifa, Guan Zhichuan, Li Zhigang, Sun Chengtang, and Han Zhiyong developed an underground automatic measurement joint system as part of a pivotal scientific and technological project during China's Ninth Five Year Plan [1].This system was designed to measure various parameters of the drill string, including the axial force, bending force, torque, longitudinal acceleration, radial acceleration, circumferential acceleration, fluid pressure inside and outside the drill string, and downhole temperature.
The system underwent five experiments, of which three successfully collected specific data.For instance, in two experiments, conducted in Shengli Oilfield, the acceleration measurement curve in Well Ceping-59 and the axial force in Well Ceping-1 were obtained [2,3].Wang [4] proposed a novel intelligent drill bit that incorporated an electronic system chamber within the drill bit body.All of the measurement and control system hardware, such as pressure sensors, temperature sensors, formation parameter detection sensors, circuit boards, and batteries, were housed in this chamber, with the exception of the antenna.Wu [5] designed a downhole mechanical parameter measurement device which included a pressure sensor installed near the bit collar to measure the water-jet pressure and annular pressure.Wang [6] devised a mechanical parameter measurement system near the drill bit to capture the axial force, torque, radial force, and pressure, with data transmission being facilitated through wireless circuits.composed of a pulse device, an electric generator, a rectification module, a drive module, a central control module, and a data acquisition module.Its purpose is to facilitate downhole data acquisition, calculation, and storage.On the other hand, the ground signal decoding system consists of a signal acquisition device, a detection and filtering processing box, decoding software, a data restoration box, and measurement and data analysis software.Its function is to facilitate signal detection, filtering, decoding, display, and storage.

Working Principle of Measurement System
Connect the temperature and pressure measurement system to the drilling tool assembly and run it into the well together with the drilling tool assembly.During the drilling process, the mud generator generates electricity with the circulating power of the drilling fluid.The rectification module of the mud generator rectifies the three-phase AC generated by the generator into 32 V DC power, which then provides electrical energy to the electronic module.The pressure and temperature measurement modules monitor the pressure and temperature data at the bottom of the well in real time, and send the data to the downhole coding module.The downhole coding module processes the data and sends them to the central control module.The central control module controls the drive module according to the specified transmission protocol, and uses an electric pulse signal to drive the electromagnetic valve of the pulse generator to generate drilling fluid pressure pulses inside the drill string, uploading the drilling fluid pulse signal to the ground.The ground information receiving and processing system collects drilling fluid pulse pressure fluctuations through a pressure sensor installed in the riser, identifies and processes them through a detection and filtering processing box, filters out noise and interference, and sends them to the ground decoding system.The decoding software decodes the uploaded drilling fluid pulse data using a combination code communication protocol, and sends the decoded data to the data reduction box according to a specific serial port protocol.The data are restored, and the restored signal is then sent to the system working interface with the real-time display of pressure and temperature through the pressure gauge decoding box, thereby achieving real-time monitoring of the downhole pressure and temperature.

Mechanical Design
The mechanical part of the temperature and pressure monitoring system mainly consists of a mud pulse generator, electronic cartridge, shell, and circuit installation core shaft.The connections between the mud pulse generator, the electronic cartridge, and the outer cylinder adopt a rotating plug structure.With the outer cylinder rotating, the pin automatically rotates in, achieving the modular design of the pressure monitoring system.The overall structure is shown in Figures 1 and 2.

Strength Check
The material of the pressure gauge packaging cylinder is 4145 H, and the tensile strength is 980 MPa.The stress of five parts is analyzed: the upper connecting piston, upper sealing sleeve, lower connecting piston, lower sealing sleeve, and seat sealing sleeve.By measuring an infinitesimal unit on the shell of the monitoring system, it can be seen that any point is in a three-dimensional stress state, as shown in Figure 3.In the strength check, it can be discretized into multiple finite element combinations.The finite element method discretizes the structure into several elements, usually solved through the displacement method, where each node in the space has three displacement components.

Strength Check
The material of the pressure gauge packaging cylinder is 4145 H, and the tensile strength is 980 MPa.The stress of five parts is analyzed: the upper connecting piston, upper sealing sleeve, lower connecting piston, lower sealing sleeve, and seat sealing sleeve.By measuring an infinitesimal unit on the shell of the monitoring system, it can be seen that any point is in a three-dimensional stress state, as shown in Figure 3.In the strength check, it can be discretized into multiple finite element combinations.The finite element method discretizes the structure into several elements, usually solved through the displacement method, where each node in the space has three displacement components.
The displacement function at any point within an element is: Node displacement equation: where N is the shape function matrix, and there are six strain components at each node of the structure.Substitute the above equation into the geometric equation: The Element Strain Equation: According to the physical equation of the spatial structure (generalized Hooke's law): Element stress represented by node displacement, with six stress components per node in a spatial structure: Element stress equation: where D is the elasticity matrix; The dynamic annular pressure monitoring system is based on the fourth strength theory: The dynamic annular pressure monitoring device is mainly subjected to the pressure of the internal fluid of the tool, the annular fluid pressure, the torque, and the axial tension during drilling.The results of the finite element strength check are as follows: As shown in Figure 4, a constraint condition of a drilling pressure of 300 KN and a torque of 30 KN was applied to the measurement system model.The maximum stress value of the measurement system was 115.35 MPa.Due to the large stress concentration around the sensor hole, the stress value was the maximum, resulting in a maximum deformation of 0.05 mm.This is instrumental in collecting the deformation at the sensor hole and ensuring the measuring sensitivity.Under the working conditions of a drilling pressure of 300 kN and a torque of 30 kN, the equivalent strain of the monitoring nipple is 0.0587.Under this working condition, the effect on the strength of the measurement system is slight, so it will not cause damage to the system.

Seal Design
According to the practical application of the deep well drilling tool, the sealing ele ments should have a temperature resistance of around 175-225 °C and the corresponding pressure difference for leakage is 175 MPa.Thermal sealing is an obstacle faced by wire less drilling instruments.Currently, there are few patents and related articles and, espe cially, a lack of analysis and evaluation methods [17][18][19][20].
At present, thermal seals are still mainly based on empirical design, lacking design specifications and analysis method guidance.This section focuses on systematic research from several aspects, including basic principles, the design process, key elements, design analysis methods, and experimental evaluation.The sealing design was evaluated through high-temperature compression tests.The thermal sealing design process i shown in Figure 5.

Seal Design
According to the practical application of the deep well drilling tool, the sealing elements should have a temperature resistance of around 175-225 • C and the corresponding pressure difference for leakage is 175 MPa.Thermal sealing is an obstacle faced by wireless drilling instruments.Currently, there are few patents and related articles and, especially, a lack of analysis and evaluation methods [17][18][19][20].
At present, thermal seals are still mainly based on empirical design, lacking design specifications and analysis method guidance.This section focuses on systematic research from several aspects, including basic principles, the design process, key elements, design analysis methods, and experimental evaluation.The sealing design was evaluated through high-temperature compression tests.The thermal sealing design process is shown in Figure 5. (iii) Design of pressure transmission The circular injection holes are designed to inject resin, avoiding direct contact between the crystal pressure gauges and mud, and ensuring the accuracy of the pressure values [18][19][20].The electronic cartridge adopts a core shaft circuit installation method, which directly installs the circuit board, crystal pressure sensor, and related accessories on the circuit core shaft, fixed with screws, allowing the mud to pass through.The electronic cartridge has achieved modular design, with expandable measurement functions and a strong compressive capacity.To verify its sealing and compressive capacity, it was tested in a condition with a temperature of 175 °C and a pressure of 138 MPa.It was found that the test curve was smooth, as shown in Figure 6.After disassembling the instruments for inspection, it was found that the seal was intact, proving that the system can meet the sealing and compression requirements for high-temperature environments.Test curve a-the interface for drawing the curve after data collection of the test system; b-the sealing pressure test curve.

Design of Temperature and Pressure Measurement Circuit (i) Voltage stabilizing circuit
The voltage stabilizing circuit adopts transistors as its key components, which changes the voltage from 32 V to 5 V and then to 3.3 V (required by the circuit board), as shown in Figure 7. (i) Basic principle and process of thermal sealing design Sealing is the use of close contact to prevent the infiltration of gases and liquids inside and outside the instrument to the greatest extent possible.Using the rebound characteristics of the sealing material to deform the contact interface by applying pressure to components such as bolts, flanges, and threaded buckles, the gap between two contact surfaces is pressed by elastic materials into a tight contact state.The thermal sealing design of wireless measuring instruments mainly revolves around the connection gaps of different parts.
(ii) Main properties of thermal sealing materials (a) Heat resistance: Due to the high temperature of the downhole fluid and highpressure environment, the thermal sealing material must be able to adapt to high-temperature and high-pressure environments; (b) High-temperature resilience: The fluid, under high pressure, will affect the sealing gap.A sealing structure with good resilience can maintain good contact with the sealing surface in a high-temperature and high-pressure environment.
(iii) Design of pressure transmission The circular injection holes are designed to inject resin, avoiding direct contact between the crystal pressure gauges and mud, and ensuring the accuracy of the pressure values [18][19][20].The electronic cartridge adopts a core shaft circuit installation method, which directly installs the circuit board, crystal pressure sensor, and related accessories on the circuit core shaft, fixed with screws, allowing the mud to pass through.The electronic cartridge has achieved modular design, with expandable measurement functions and a strong compressive capacity.To verify its sealing and compressive capacity, it was tested in a condition with a temperature of 175 • C and a pressure of 138 MPa.It was found that the test curve was smooth, as shown in Figure 6.After disassembling the instruments for inspection, it was found that the seal was intact, proving that the system can meet the sealing and compression requirements for high-temperature environments.
Test curve a-the interface for drawing the curve after data collection of the test system; b-the sealing pressure test curve.
on the circuit core shaft, fixed with screws, allowing the mud to pass through.The electronic cartridge has achieved modular design, with expandable measurement functions and a strong compressive capacity.To verify its sealing and compressive capacity, it was tested in a condition with a temperature of 175 °C and a pressure of 138 MPa.It was found that the test curve was smooth, as shown in Figure 6.After disassembling the instruments for inspection, it was found that the seal was intact, proving that the system can meet the sealing and compression requirements for high-temperature environments.Test curve a-the interface for drawing the curve after data collection of the test system; b-the sealing pressure test curve.

Design of Temperature and Pressure Measurement Circuit (i) Voltage stabilizing circuit
The voltage stabilizing circuit adopts transistors as its key components, which changes the voltage from 32 V to 5 V and then to 3.3 V (required by the circuit board), as shown in Figure 7.  (ii) Design of pressure measurement circuit The input voltage of the pressure sensor is 3 V, and the output pressure frequency and temperature frequency are provided with a reference frequency (7.2 MHz).The pressure measurement design diagram is shown in Figure 8. Figure 9 shows the schematic diagram of pressure measurement.Behind the pressure and temperature frequency board, a control circuit with a microcontroller is added.The pressure and temperature frequency range is a 10 k~100 kHz square wave.Due to environmental interference when the signal is transmitted over a long line, noise will appear on the signal wave.A low-pass filter contains a 100 Ω and 1 nF capacitor, with a cutoff frequency of: (ii) Design of pressure measurement circuit The input voltage of the pressure sensor is 3 V, and the output pressure frequency and temperature frequency are provided with a reference frequency (7.2 MHz).The pressure measurement design diagram is shown in Figure 8. (ii) Design of pressure measurement circuit The input voltage of the pressure sensor is 3 V, and the output pressure frequency and temperature frequency are provided with a reference frequency (7.2 MHz).The pressure measurement design diagram is shown in Figure 8. Figure 9 shows the schematic diagram of pressure measurement.Behind the pressure and temperature frequency board, a control circuit with a microcontroller is added.The pressure and temperature frequency range is a 10 k~100 kHz square wave.Due to environmental interference when the signal is transmitted over a long line, noise will appear on the signal wave.A low-pass filter contains a 100 Ω and 1 nF capacitor, with a cutoff frequency of: Figure 9 shows the schematic diagram of pressure measurement.Behind the pressure and temperature frequency board, a control circuit with a microcontroller is added.The pressure and temperature frequency range is a 10 k~100 kHz square wave.Due to environmental interference when the signal is transmitted over a long line, noise will appear on the signal wave.A low-pass filter contains a 100 Ω and 1 nF capacitor, with a cutoff frequency of: ronmental interference when the signal is transmitted over a long line, noise will appear on the signal wave.A low-pass filter contains a 100 Ω and 1 nF capacitor, with a cutoff frequency of: According to Formula (10), f ≈ 159.1 K, is used, which takes into account the influence of the temperature on electronic components and the variation in the frequency parameters.The capacitance accuracy is 10% and the resistance accuracy is 1%.After the signal is According to Formula (10), f ≈ 159.1 K, is used, which takes into account the influence of the temperature on electronic components and the variation in the frequency parameters.The capacitance accuracy is 10% and the resistance accuracy is 1%.After the signal is processed through a low-pass filter, the high-frequency component of the square wave signal is filtered out.At this point, the waveform tends to a sine curve, and the signal is processed through a Schmidt digital circuit again.The digital circuit converts the signal into a square wave, and the pressure sensor output signal that removes interference is obtained.
Using a D trigger to form a switching effect, FP_CLR_CTRL controls the CLR (negative logic) end of the D trigger, FP_CNT_The CTRL is connected to the input end of the D trigger, and the set end of the D trigger is connected to the high level (the set signal does not work).At this time, FP_CNT_CTRL moves the data from Port D on the rising edge of the clock, ensuring that the control signal is synchronized with the clock signal.The Q end will obtain the control signal ICCB, which is synchronized with the clock edge_FP; by combining the input clock signal with the Q-terminal signal, a controlled frequency signal is obtained.The advantage of this signal is that the obtained clock signal has a complete cycle, eliminating the possible noise interference of asynchronous signals.FP_CLR_CTRL is the clear signal of the switch and the low back signal FP_CNT_CTRL, while ICCB_FP is pulled down.
After being processed by the above circuit, the frequency signal is filtered and shaped, and the signal can be synchronously controlled to enter the microcontroller.
After entering the microcontroller, the capture comparison function and timer function inside the microcontroller complete the counting of the unit time.The timer measurement principle diagram is shown in Figure 10.After being processed by the above circuit, the frequency signal is filtered and shaped, and the signal can be synchronously controlled to enter the microcontroller.
After entering the microcontroller, the capture comparison function and timer function inside the microcontroller complete the counting of the unit time.The timer measurement principle diagram is shown in Figure 10.Firstly, a timer is used to count the known frequency signals, and then the measured frequency signals are counted within the same time frame.Since the counting events are the same, the frequency of the measured signal is calculated.
where f is the tested signal frequency; 0 f is the known frequency; x N is the unknown frequency counter value, and N i is known the frequency counter value.Firstly, a timer is used to count the known frequency signals, and then the measured frequency signals are counted within the same time frame.Since the counting events are the same, the frequency of the measured signal is calculated.
where f is the tested signal frequency; f 0 is the known frequency; N x is the unknown frequency counter value, and N i is known the frequency counter value.
In order to ensure accuracy, the starting and stopping of counting should be triggered by an inherent rising or falling edge during the counting process.The peripheral circuit of the microcontroller has achieved synchronous control of the edge, and the microcontroller should also ensure synchronous control internally.The final error can be controlled within the accuracy of a basic timer and frequency.
where δ is Precision; T is Basic clock/sampling time length; f basic is Basic clock frequency.CLK_FP_IN and CLK_FT_Each IN are connected to two internal counters of the microcontroller.FP_CNT_CTRL and FT_CNT_CTRL control the counting start and stop of the input frequency.FP_CLR_CTRL and FT_CLR_CTRL are responsible for setting the output status of the device.These two signals control the counter.The use interrupts in order to stop the counting after the corresponding conditions are met.After obtaining the temperature and pressure frequency, the temperature value is calculated by using the temperature scale coefficient.The fourth order calculation is used in the calculation of the temperature and pressure coefficient in this system.Note that the double precision floating point number is used in the calculation process to ensure the accuracy after highorder calculation.Utilize the coefficient of temperature during the calibration process to determine the current temperature.
Use matrix coefficients of 5 × 5 for parameter or scale parameters.
Bring the temperature frequency into the equation: Processes 2023, 11, 2238 10 of 19 After this process, the temperature coefficient required for calculating pressure was obtained and then incorporated into the equation: (iii) Design of temperature measurement circuit The temperature measurement principle diagram is shown in Figure 11.PT1000 is a pure resistance that can be measured using linear second-order fitting within the temperature range to obtain temperature values.Due to the inability of the current in the bridge circuit to reach the intensity that causes its own resistance to heat up (the accuracy of PT1000 includes the accuracy error caused by its own emission), an equivalent resistance of 68 K is added to the upper arm of the bridge.Considering the issue of resistance accuracy, two resistance positions are placed on the lower side of each bridge circuit for easy adjustment.On the other side of the temperature resistance in the lower arm, a resistance similar to the temperature resistance at 0 degrees is added (three resistance positions are used for adjustment).
After the output of the resistance bridge is connected to the instrument amplifier (considering noise issues, a low-pass filter is added to the differential output of each bridge), the −3 DB frequency of the bridge corresponding to a 100 ohm and 1 nf capacitor is about 1.6 MHz, and the gain multiple of the instrument amplifier is about 46.7.The voltage result is sent to the AD terminal and, at this time, the change in the voltage value measured by the temperature resistance change is obtained, and the resistance value of the temperature resistance is inverted.Assuming that the value measured by AD is Vmeas, the resistance value for calculating the temperature resistance is: At this point, the resistance value is the theoretical calculation result of the PT1000 resistor.Due to the nonlinearity of the resistor, we also need to use a second-order function to calculate the temperature in the output resistor result.To perform second-order calibration at three temperatures, after removing the intermediate calculation process, we calculate directly using the measured values and the results of the external temperature, using the formula      .We bring the obtained temperature into the measured value to obtain three coefficients, store the coefficients as coefficients of the PT1000 in the microcontroller, and use the above formula to calculate the measured temperature at the current temperature.
(iv) Laboratory error analysis of temperature and pressure data In the PT1000 measurement, the bridge method is used for measurement, and an instrument amplifier is added to obtain the voltage change caused by the bridge imbalance, caused in turn by the change in the temperature resistance.The instrument amplifier is used for differential amplification to obtain the voltage value, and then the AD is used to obtain the digital signal to calculate the temperature resistance value.
Due to the inability of the current in the bridge circuit to reach the intensity that causes its own resistance to heat up (the accuracy of PT1000 includes the accuracy error caused by its own emission), an equivalent resistance of 68 K is added to the upper arm of the bridge.Considering the issue of resistance accuracy, two resistance positions are placed on the lower side of each bridge circuit for easy adjustment.On the other side of the temperature resistance in the lower arm, a resistance similar to the temperature resistance at 0 degrees is added (three resistance positions are used for adjustment).
After the output of the resistance bridge is connected to the instrument amplifier (considering noise issues, a low-pass filter is added to the differential output of each bridge), the −3 DB frequency of the bridge corresponding to a 100 ohm and 1 nf capacitor is about 1.6 MHz, and the gain multiple of the instrument amplifier is about 46.7.The voltage result is sent to the AD terminal and, at this time, the change in the voltage value measured by the temperature resistance change is obtained, and the resistance value of the temperature resistance is inverted.Assuming that the value measured by AD is Vmeas, the resistance value for calculating the temperature resistance is: where : R 36 + R 39 = 68K, R 37 + R 40 = 68K, R 45 + R 46 = 842.7,Ver f = 2.5V Then the resistance value of PT1000 is At this point, the resistance value is the theoretical calculation result of the PT1000 resistor.Due to the nonlinearity of the resistor, we also need to use a second-order function to calculate the temperature in the output resistor result.To perform second-order calibration at three temperatures, after removing the intermediate calculation process, we calculate directly using the measured values and the results of the external temperature, using the formula T = A × Vm 2 + B × Vm + C. We bring the obtained temperature into the measured value to obtain three coefficients, store the coefficients as coefficients of the PT1000 in the microcontroller, and use the above formula to calculate the measured temperature at the current temperature.
(iv) Laboratory error analysis of temperature and pressure data To ensure the accuracy of the temperature and pressure measurements in hightemperature environments, error analysis was conducted on the system temperature and pressure measurements.The laboratory temperature and pressure calibration process is shown in Figure 12.To ensure the accuracy of the temperature and pressure measurements in high-temperature environments, error analysis was conducted on the system temperature and pressure measurements.The laboratory temperature and pressure calibration process is shown in Figure 12.
Test steps: a.At room temperature (22.8 °C), the pressure gradually increases from 0 MPa to 140 MPa, with each level reaching 10 MPa.Record the input and output values of the system temperature and pressure; b.Place the test nipple in a high-temperature constant temperature box, raise the temperature to 145 °C, and apply the pressure in the same way as step 1. Record the input and output values of the system temperature and pressure; c.When the temperature of the incubator rises to 175 °C, the pressure is applied in the same way as step 1, and the input and output values of the system temperature and pressure are recorded; d.Organize and list the input temperature and pressure values and output temperature and pressure values, and conduct error analysis on the data.

Error analysis explanation:
(1) The overall accuracy of pressure P1 is 3.480 × 10 0 psia; (2) The overall accuracy of temperature T1 is 3.075 × 10 −1 °C; (3) The overall accuracy of temperature T2 is 3.469 × 10 −1 °C.The Table 1 shows the pressure and temperature scale error table at different temperatures.In a high-temperature environment, error analysis was conducted on the temperature and pressure measurement accuracy of the system.The results show that the measurement error was within the allowable error range of the system.The experiment proved that the system had high accuracy in outputting measurement values in high-temperature environments, meeting the actual measurement requirements of engineering.The Table 1 shows the pressure and temperature scale error table at different temperatures.In a high-temperature environment, error analysis was conducted on the temperature and pressure measurement accuracy of the system.The results show that the measurement error was within the allowable error range of the system.The experiment proved that the system had high accuracy in outputting measurement values in high-temperature environments, meeting the actual measurement requirements of engineering.(v) Data processing The temperature and pressure data processing module is shown in Figure 13.The sensor signal is input into the A/D conversion circuit after circuit shaping, filtering, and amplification.The A/D conversion circuit performs parallel analog digital conversion on each channel signal, and then transmits the data to the data processing circuit, with the microprocessor being the main component to complete the digital signal processing of the data.Communication with the central control circuit is completed through the communication interface.(v) Data processing The temperature and pressure data processing module is shown in Figure 13.The sensor signal is input into the A/D conversion circuit after circuit shaping, filtering, and amplification.The A/D conversion circuit performs parallel analog digital conversion on each channel signal, and then transmits the data to the data processing circuit, with the microprocessor being the main component to complete the digital signal processing of the data.Communication with the central control circuit is completed through the communication interface.(vi) Power management The power management module adopts a dual power supply mode, and the temperature and pressure collection circuit adopts a dual power supply mode of the mud generator and battery.When the mud generator stops working, the battery starts to supply (vi) Power management The power management module adopts a dual power supply mode, and the temperature and pressure collection circuit adopts a dual power supply mode of the mud generator and battery.When the mud generator stops working, the battery starts to supply power, achieving uninterrupted storage of the wellbore temperature and pressure, imthus proving the accuracy of the wellbore pressure and temperature data.The principle for this is shown in Figure 14.
Processes 2023, 11, x FOR PEER REVIEW 14 of 20 power, achieving uninterrupted storage of the wellbore temperature and pressure, imthus proving the accuracy of the wellbore pressure and temperature data.The principle for this is shown in Figure 14.(vii) Signal transmission The pulse transmission management module encodes the data, amplifies the power, and sends a control pulse signal, as shown in Figure 15.

Selection of Pressure Sensors
In order to accurately measure pressure values in harsh environmental conditions deep in the formation, the selection of pressure sensors is particularly important.At present, the main types of sensors used for downhole instrument measurement include strain gauges, quartz gauges, and fiber optic pressure sensors, each with advantages and disadvantages in terms of data acquisition function [21]: (1) The strain gauge is significantly affected by temperature changes and has a significant hysteresis effect; (2) Quartz pressure gauges are suitable for point measurement, with low sensitivity to temperature, and are suitable for pressure testing in situations where temperature changes are not significant.However, when temperature changes are large, they should not be used.They can be used for underground pressure monitoring; (3) Fiber optic pressure sensors can be applied to harsh environments, with a high temperature and pressure underground, with high sensitivity.However, their main drawback is their cross sensitivity to temperature and pressure.
In the process of measuring formation pressure while drilling, it is necessary to measure the pressure at a fixed point.The temperature and pressure at the measurement point are high, but the temperature change is not significant, as using a quartz pressure gauge meets the technical requirements.

Data Transmission Module
The system CPU is mainly used for lower-level computers in multi-machine communication.The upper-level computer sends the corresponding address-encoding signal of the lower-level computer, and the lower-level computer receives it and then transmits the required data back to the upper-level computer through the serial port according to the requirements.After receiving instructions, the lower computer executes the corresponding operations and responds to the upper computer through the 485 serial interface.The serial communication baud rate is 57,600 bps, with eight data bits, one stop bit, and no parity, and is verified using CRC software.
The system uses a serial port for online simulation and downloading, so this module also has negative online simulation debugging and download functions.(vii) Signal transmission The pulse transmission management module encodes the data, amplifies the power, and sends a control pulse signal, as shown in Figure 15.
Processes 2023, 11, x FOR PEER REVIEW 14 of 20 power, achieving uninterrupted storage of the wellbore temperature and pressure, imthus proving the accuracy of the wellbore pressure and temperature data.The principle for this is shown in Figure 14.(vii) Signal transmission The pulse transmission management module encodes the data, amplifies the power, and sends a control pulse signal, as shown in Figure 15.

Selection of Pressure Sensors
In order to accurately measure pressure values in harsh environmental conditions deep in the formation, the selection of pressure sensors is particularly important.At present, the main types of sensors used for downhole instrument measurement include strain gauges, quartz gauges, and fiber optic pressure sensors, each with advantages and disadvantages in terms of data acquisition function [21]: (1) The strain gauge is significantly affected by temperature changes and has a significant hysteresis effect; (2) Quartz pressure gauges are suitable for point measurement, with low sensitivity to temperature, and are suitable for pressure testing in situations where temperature changes are not significant.However, when temperature changes are large, they should not be used.They can be used for underground pressure monitoring; (3) Fiber optic pressure sensors can be applied to harsh environments, with a high temperature and pressure underground, with high sensitivity.However, their main drawback is their cross sensitivity to temperature and pressure.
In the process of measuring formation pressure while drilling, it is necessary to measure the pressure at a fixed point.The temperature and pressure at the measurement point are high, but the temperature change is not significant, as using a quartz pressure gauge meets the technical requirements.

Data Transmission Module
The system CPU is mainly used for lower-level computers in multi-machine communication.The upper-level computer sends the corresponding address-encoding signal of the lower-level computer, and the lower-level computer receives it and then transmits the required data back to the upper-level computer through the serial port according to the requirements.After receiving instructions, the lower computer executes the corresponding operations and responds to the upper computer through the 485 serial interface.The serial communication baud rate is 57,600 bps, with eight data bits, one stop bit, and no parity, and is verified using CRC software.
The system uses a serial port for online simulation and downloading, so this module also has negative online simulation debugging and download functions.

Selection of Pressure Sensors
In order to accurately measure pressure values in harsh environmental conditions deep in the formation, the selection of pressure sensors is particularly important.At present, the main types of sensors used for downhole instrument measurement include strain gauges, quartz gauges, and fiber optic pressure sensors, each with advantages and disadvantages in terms of data acquisition function [21]: (1) The strain gauge is significantly affected by temperature changes and has a significant hysteresis effect; (2) Quartz pressure gauges are suitable for point measurement, with low sensitivity to temperature, and are suitable for pressure testing in situations where temperature changes are not significant.However, when temperature changes are large, they should not be used.They can be used for underground pressure monitoring; (3) Fiber optic pressure sensors can be applied to harsh environments, with a high temperature and pressure underground, with high sensitivity.However, their main drawback is their cross sensitivity to temperature and pressure.
In the process of measuring formation pressure while drilling, it is necessary to measure the pressure at a fixed point.The temperature and pressure at the measurement point are high, but the temperature change is not significant, as using a quartz pressure gauge meets the technical requirements.

Data Transmission Module
The system CPU is mainly used for lower-level computers in multi-machine communication.The upper-level computer sends the corresponding address-encoding signal of the lower-level computer, and the lower-level computer receives it and then transmits the required data back to the upper-level computer through the serial port according to the requirements.After receiving instructions, the lower computer executes the corresponding operations and responds to the upper computer through the 485 serial interface.The serial communication baud rate is 57,600 bps, with eight data bits, one stop bit, and no parity, and is verified using CRC software.
The system uses a serial port for online simulation and downloading, so this module also has negative online simulation debugging and download functions.

Signal Processing Methodology
The combination code encoding mechanism is employed to sequence the uploaded data; for example, transmitting pressure first, followed by temperature, and finally gamma data.The encoding sequence consists of a synchronization header, data header, and data position, which are then decoded corresponding to the parameters in the database.The utilization of the combination code encoding mechanism enables high-speed decoding in the ground decoding system.

Field Test of Well Qing 2-76
To verify the effectiveness and reliability of the temperature and pressure monitoring system [22][23][24][25], this article takes the 4606-4620 m well section of Qing 2-76 well in Yumen Oilfield as an example to develop a test plan and conduct on-site tests.
Justification for selecting this well: The target formation has a narrow pressure window, and the downhole structure of the wellbore is sensitive to changes in wellbore pressure.This can lead to complex drilling issues such as wellbore collapse and stuck pipe.To avoid such complications, real-time monitoring of the temperature and pressure in the wellbore is conducted.
The well depth exceeds 4000 m, with a bottomhole liquid column pressure exceeding 50 MPa and a high bottomhole temperature exceeding 100 • C. The temperature and pressure conditions at the bottom of the well are suitable for the experimental requirements of the instrument.
The drilling engineering design utilizes nitrogen drilling, which, theoretically, can alter the wellbore temperature and pressure.However, it cannot quantitatively reflect the specific changes in the temperature and pressure.By using this instrument, real-time monitoring of temperature and pressure variations at the bottom of the well after nitrogen injection can be achieved.Additionally, based on real-time formation pressure data, adjustments can be made to the drilling fluid density to prevent complex conditions such as wellbore collapse and stuck pipe.
The test started at 13:10 on 5 September 2020, and the PWD instrument was first tested on the ground.The displacement was 13 L/s, the pump pressure was 9 MPa, the riser pressure was 7.7 MPa, and the temperature and pressure data were normal.The instrument entered the well.The performance of the mud used is shown in Table 2. Field Experiment: (1) After completing the instrument detection, it was hoisted to the wellhead for surface testing, and the signals were normal.
(2) The status indicator displayed normal generator and battery voltages, normal temperature and pressure signals, and correct data decoding.
On 6 September at 4:00 am, the drill bit was lowered to the bottom of the well.If the mud remained stationary and did not circulate, the position of the drill bit was 4605 m (vertical depth 4585 m), and the measured bottom-hole pressure was 51.45 MPa; if the mud was circulated, the mud displacement was 18 L/s, and the maximum measured bottom hole pressure at 5:30 was 56.4 MPa, while the normal circulating bottom-hole pressure was 54.28 MPa.
Starting from 8:00 on 6 September, nitrogen gas drilling was carried out, with a gas volume of 40 m 3 /min and a drilling fluid displacement of 17 L/s.The measured bottomhole pressure decreased to a minimum of 45 MPa, and the normal nitrogen gas drilling bottom-hole pressure was 47.84 MPa.Compared with the pressure before inflation, the bottom-hole pressure decreased by 6.44 MPa.
At 22:00 on 7 September, the instrument came out of the wellhead and collected 81,920 records of temperature and pressure data.The maximum pressure recorded was 8904.4 psi (61.394MPa) and the maximum temperature was 120.8 • C.
Based on the calculation and comparative analysis of the above data, it can be concluded that the collected temperature and pressure data are accurate.Based on the bottomhole data, real-time operating curves of the bottom-hole pressure and temperature are shown in Figure 16.
Processes 2023, 11, x FOR PEER REVIEW 16 of 20 mud was circulated, the mud displacement was 18 L/s, and the maximum measured bottom hole pressure at 5:30 was 56.4 MPa, while the normal circulating bottom-hole pressure was 54.28 MPa.
Starting from 8:00 on 6 September, nitrogen gas drilling was carried out, with a gas volume of 40 m3/min and a drilling fluid displacement of 17 L/s.The measured bottomhole pressure decreased to a minimum of 45 MPa, and the normal nitrogen gas drilling bottom-hole pressure was 47.84 MPa.Compared with the pressure before inflation, the bottom-hole pressure decreased by 6.44 MPa.
At 22:00 on 7 September, the instrument came out of the wellhead and collected 81,920 records of temperature and pressure data.The maximum pressure recorded was 8904.4 psi (61.394MPa) and the maximum temperature was 120.8 °C.
Based on the calculation and comparative analysis of the above data, it can be concluded that the collected temperature and pressure data are accurate.Based on the bottom-hole data, real-time operating curves of the bottom-hole pressure and temperature are shown in Figure 16. Figure 17 shows the corresponding relationship between temperature and pressure curves and actual working conditions.The temperature and pressure measurement system is utilized to collect extensive engineering data related to temperature and pressure in close proximity to the drill bit.Subsequently, the acquired temperature and pressure data are comprehensively analyzed in accordance with the practical engineering process.Figure 17 shows the corresponding relationship between temperature and pressure curves and actual working conditions.The temperature and pressure measurement system is utilized to collect extensive engineering data related to temperature and pressure in close proximity to the drill bit.Subsequently, the acquired temperature and pressure data are comprehensively analyzed in accordance with the practical engineering process.
Processes 2023, 11, x FOR PEER REVIEW 16 of 20 mud was circulated, the mud displacement was 18 L/s, and the maximum measured bottom hole pressure at 5:30 was 56.4 MPa, while the normal circulating bottom-hole pressure was 54.28 MPa.
Starting from 8:00 on 6 September, nitrogen gas drilling was carried out, with a gas volume of 40 m3/min and a drilling fluid displacement of 17 L/s.The measured bottomhole pressure decreased to a minimum of 45 MPa, and the normal nitrogen gas drilling bottom-hole pressure was 47.84 MPa.Compared with the pressure before inflation, the bottom-hole pressure decreased by 6.44 MPa.
At 22:00 on 7 September, the instrument came out of the wellhead and collected 81,920 records of temperature and pressure data.The maximum pressure recorded was 8904.4 psi (61.394MPa) and the maximum temperature was 120.8 °C.
Based on the calculation and comparative analysis of the above data, it can be concluded that the collected temperature and pressure data are accurate.Based on the bottom-hole data, real-time operating curves of the bottom-hole pressure and temperature are shown in Figure 16. Figure 17 shows the corresponding relationship between temperature and pressure curves and actual working conditions.The temperature and pressure measurement system is utilized to collect extensive engineering data related to temperature and pressure in close proximity to the drill bit.Subsequently, the acquired temperature and pressure data are comprehensively analyzed in accordance with the practical engineering process.In Stage a, the drilling operation involves the insertion of the drill string into the well.As the drilling progresses, there is a gradual increase in both temperature and pressure with increasing depth.This increase in pressure is attributed to the excitation caused by the lowering of the drill string, and it subsides once the drill string is fully connected.The corresponding condition for the temperature curve is characterized by a decrease after reaching its peak value, indicating the initiation of drilling fluid circulation.
During drilling fluid circulation, the lower-temperature drilling fluid reaches the bottom of the well, leading to a rapid reduction in temperature to 38 °C.The normal bottom In Stage a, the drilling operation involves the insertion of the drill string into the well.As the drilling progresses, there is a gradual increase in both temperature and pressure with increasing depth.This increase in pressure is attributed to the excitation caused by the lowering of the drill string, and it subsides once the drill string is fully connected.The corresponding condition for the temperature curve is characterized by a decrease after reaching its peak value, indicating the initiation of drilling fluid circulation.
During drilling fluid circulation, the lower-temperature drilling fluid reaches the bottom of the well, leading to a rapid reduction in temperature to 38 • C. The normal bottom temperature is maintained at 56 • C, resulting in a temperature difference of 18 • C.These temperature variations provide essential data for circuit design related to temperature measurements.
The measured data reveal that the highest underground temperature during the drilling fluid circulation process is not observed at the well's bottom but rather at a specific distance from the bottom.This occurs at the equilibrium point of heat exchange, indicating a thermal equilibrium between the circulating fluid and the surrounding formations.
Stage b corresponds to the nitrogen-filled drilling phase, during which pressure and temperature curves can be obtained.In inflatable drilling operations, two abrupt pressure fluctuations occur, indicating the influx of a significant amount of gas and uneven distribution of the gas phase.Consequently, substantial pressure fluctuations are observed, which is a normal occurrence underground.Once the pressure stabilizes at 48 MPa, it indicates that nitrogen has achieved uniform distribution within the drilling fluid.At this point, the gas, solid, and liquid phases reach a stable equilibrium, eliminating drilling risks such as wellbore collapse.Normal drilling with inflatable drilling leads to a temperature increase of approximately 4-5 • C compared to non-inflatable drilling.This temperature rise signifies a decrease in heat transfer within the drilling fluid after the addition of the gas phase, resulting in higher bottom-hole temperatures.
In Stage c, which involves cycle degassing and short pulling, a phenomenon occurs where the nitrogen filling in the drilling fluid ceases, resulting in a gradual increase in pressure.This increase in pressure exhibits regular fluctuations that align with the short pulling operation.Simultaneously, the temperature gradually decreases to 82 • C and subsequently returns to its normal state without any inflation.This observed behavior accurately reflects the variations in the underground engineering parameters associated with inflatable drilling.
During stage d, the testing process is concluded, and the drill string is successfully extracted, leading to a gradual decrease in temperature and pressure measurements.

Result and Discussion
(1) A field trial was conducted to test a monitoring system for near-drill bit temperature and pressure in Well Qing 2-76.The system successfully measured and uploaded realtime downhole pressure and temperature data throughout the drilling process.The static bottom-hole temperature in the test well reached a high of 120.8 • C, while the circulating bottom-hole pressure was measured as 61.394MPa.
(2) The downhole data curve demonstrates a high level of accuracy and a rapid response in capturing temperature and pressure measurements, providing an accurate depiction of diverse operational conditions within drilling engineering.Moreover, the curve exhibits a strong correlation with the actual drilling working conditions, ensuring a reliable representation of the downhole environment.
(3) The instrument has not undergone functional testing under environmental temperatures exceeding 175 • C, rendering it incapable of meeting the measurement requirements of deep wells with bottom-hole temperatures exceeding 175 • C. The research team will prioritize the development of high-temperature instruments above 200 • C, aiming to address the stability issues of wireless downhole instruments in high-temperature environments.
(4) The proposed system demonstrates compatibility with real-world drilling conditions and offers a comprehensive assessment of near-bit tools, thereby providing an intuitive approach to analyzing the operational status.It enables accurate anticipation of potential drilling hazards such as wellbore influx, leakage, and collapse within a limited safety margin, leading to reduced drilling time and improved operational efficiency.

Figure 1 .
Figure 1.Schematic diagram of temperature and pressure monitoring system.

Figure 1 .
Figure 1.Schematic diagram of temperature and pressure monitoring system.

Figure 1 .
Figure 1.Schematic diagram of temperature and pressure monitoring system.

Figure 3 .
Figure 3. stress state of a point in space.

Figure 3 .
Figure 3. Stress state of a point in space.

Figure 4 .
Figure 4. Schematic diagram of overall deformation, equivalent stress, and equivalent strain of tem perature and pressure monitoring nipple.

Figure 4 .
Figure 4. Schematic diagram of overall deformation, equivalent stress, and equivalent strain of temperature and pressure monitoring nipple.

Figure 5 .
Figure 5. Flow chart of high temperature seal design.

Figure 8 .
Figure 8. interface diagram of pressure sensor.

Figure 7 .
Figure 7. Schematic diagram of voltage stabilizing circuit scheme.

Figure 8 .
Figure 8. interface diagram of pressure sensor.

Figure 8 .
Figure 8. Interface diagram of pressure sensor.
Processes 2023, 11, x FOR PEER REVIEW 9 of 20 processed through a low-pass filter, the high-frequency component of the square wave signal is filtered out.At this point, the waveform tends to a sine curve, and the signal is processed through a Schmidt digital circuit again.The digital circuit converts the signal into a square wave, and the pressure sensor output signal that removes interference is obtained.Using a D trigger to form a switching effect, FP_CLR_CTRL controls the CLR (negative logic) end of the D trigger, FP_CNT_The CTRL is connected to the input end of the D trigger, and the set end of the D trigger is connected to the high level (the set signal does not work).At this time, FP_CNT_CTRL moves the data from Port D on the rising edge of the clock, ensuring that the control signal is synchronized with the clock signal.The Q end will obtain the control signal ICCB, which is synchronized with the clock edge_FP; by combining the input clock signal with the Q-terminal signal, a controlled frequency signal is obtained.The advantage of this signal is that the obtained clock signal has a complete cycle, eliminating the possible noise interference of asynchronous signals.FP_CLR_CTRL is the clear signal of the switch and the low back signal FP_CNT_CTRL, while ICCB_FP is pulled down.

Processes 2023 ,
11, x FOR PEER REVIEW 11 of 20 caused in turn by the change in the temperature resistance.The instrument amplifier is used for differential amplification to obtain the voltage value, and then the AD is used to obtain the digital signal to calculate the temperature resistance value.

Figure 12 .
Figure 12.Calibration of Laboratory Temperature and Pressure Scale at 145 °C and 175 °C.

Figure 12 .
Figure 12.Calibration of Laboratory Temperature and Pressure Scale at 145 • C and 175 • C. Test steps: a.At room temperature (22.8 • C), the pressure gradually increases from 0 MPa to 140 MPa, with each level reaching 10 MPa.Record the input and output values of the system temperature and pressure; b.Place the test nipple in a high-temperature constant temperature box, raise the temperature to 145 • C, and apply the pressure in the same way as step 1. Record the input and output values of the system temperature and pressure; c.When the temperature of the incubator rises to 175 • C, the pressure is applied in the same way as step 1, and the input and output values of the system temperature and pressure are recorded; d.Organize and list the input temperature and pressure values and output temperature and pressure values, and conduct error analysis on the data.Error analysis explanation: (1) The overall accuracy of pressure P1 is 3.480 × 10 0 psia; (2) The overall accuracy of temperature T1 is 3.075 × 10 −1 • C; (3) The overall accuracy of temperature T2 is 3.469 × 10 −1 • C.

Figure 13 .
Figure 13.schematic diagram of data processing scheme.

Figure 13 .
Figure 13.Schematic diagram of data processing scheme.

Figure 14 .
Figure 14.schematic diagram of dual power supply mode circuit scheme.

Figure 15 .
Figure 15.Schematic diagram of pulse transmission circuit scheme.

Figure 14 .
Figure 14.Schematic diagram of dual power supply mode circuit scheme.

Figure 14 .
Figure 14.schematic diagram of dual power supply mode circuit scheme.

Figure 15 .
Figure 15.Schematic diagram of pulse transmission circuit scheme.

Figure 15 .
Figure 15.Schematic diagram of pulse transmission circuit scheme.

Figure 17 .
Figure 17.Corresponding relationship between temperature and pressure curves and actual working conditions.

Table 1 .
Pressure and temperature scale error table at different temperatures.

Table 1 .
Pressure and temperature scale error table at different temperatures.