In oil well development and production, as well depth increases, controlling downhole valves becomes increasingly difficult, primarily due to the high downhole temperatures (reaching over 100°C at depths exceeding 5000m). Furthermore, supplying power to and controlling the downhole valves from the surface becomes more challenging. Therefore, it is essential to develop an intelligent valve control system powered by batteries that can operate independently for extended periods in the high-temperature downhole environment, according to pre-defined requirements.
This paper designs a downhole intelligent valve control system, employing a timing and control unit composed of a microcontroller, in conjunction with a multi-stage packer. This system enables a single downhole operation to integrate with underground metering and analysis, allowing for stratified and sequential oil production according to set times (some set times can be disabled as needed). The system uses dual-CPU control; the main unit can complete data entry, processing, and display on-site. The slave unit uses a PIC microcontroller and a silicon oscillator, enabling the system to operate continuously in a 125°C high-temperature environment. The downhole control system has an average operating current of less than 0.2mA and can operate continuously for 10,000 hours powered by a 10-ounce battery.
System working principle
The basic working principle of the system is as follows: based on the user's needs for well layer testing, multiple opening and closing times are set for each intelligent valve on the surface to be run into the well at different target depths. Then, the valves, along with the packer and sand control pipe, are run into the well. Each intelligent valve opens or closes its corresponding control valve according to the set time (or, depending on external conditions, a set valve closure can be disabled), automatically switching the target layer. This is then combined with surface testing instruments to quantitatively read relevant data.
The system mainly consists of two parts: a valve action time setter (hereinafter referred to as the main unit) and a downhole valve controller (hereinafter referred to as the slave unit). The system principle block diagram is shown in Figure 1. The main unit is designed as a handheld device with an LCD display, which can set multiple times for each slave unit on the ground, process and display the set time data, and determine the correctness of the set time. After the slave unit is lowered into the well, it can drive the motor to open or close the corresponding valve according to the set time and in coordination with relevant flow instruments.
Hardware circuit design of the host unit
The main unit comprises a human-machine interface and a communication module, using an AT89C52 microcontroller as the control core, as shown in Figure 2. The system has five buttons: "+", "-", "right", "OK", and "Cancel". Operators can use these buttons to set and confirm multiple time settings according to a calendar. The displayed time data includes "year, month, day, hour, and minute," which is a large amount. Therefore, a 192×64-unit LCD display is selected. The microcontroller can directly access the LCD display, eliminating the need for a separate liquid crystal display controller between the microcontroller and the LCD, thus reducing system costs. RS-232 serial communication is used between the main unit and the secondary unit to transmit data and control commands.
Hardware circuit design of the slave unit
The slave unit is battery-powered and needs to operate independently for extended periods in downhole environments below 125°C. Therefore, high temperature resistance, low power consumption, and high reliability are primary considerations in the slave unit's design. This system uses the PIC16F876A microcontroller as its core to implement an oil well valve controller, and its hardware structure is shown in Figure 3. The slave unit mainly includes: a clock control signal, a current controller, a valve motor driver, and a flow signal acquisition unit. The PIC16F876A is a 28-pin 8-bit microcontroller manufactured by Microchip Technology Inc., employing a Harvard bus architecture. At a 3V operating voltage and a 32kHz clock frequency, its typical operating current is less than 20µA, and its operating temperature range is -40°C to +125°C. It also features a built-in asynchronous serial port, meeting the system's requirements for low power consumption and high operating temperature.
The clock control signal is provided by the Max7378CMOJ silicon oscillator manufactured by Maxim Integrated. This chip can provide a 32.768kHz master clock pulse for a microcontroller operating on a 3V power supply, with a typical operating current of 11 uA. It operates in temperatures ranging from -40℃ to +125℃ and features vibration resistance and EMI suppression, making it insensitive to polluted and humid environments. It can operate in harsh downhole environments and meet the set clock requirements.
The power supply controller, composed of BG1 and BG2, primarily functions to reduce system power consumption. For the majority of the slave device's operation, only the clock signal is required. During this time, pin ② of the microcontroller outputs a low level, and the power supply controller's output voltage Vc is 0V. Thus, no power is supplied to any circuits in the slave device except for the clock signal. Only when the set time intervals are reached does pin ② of the microcontroller output a high level for 10 minutes. At this time, Vc rises to approximately 10V, powering on all functional circuits for 10 minutes, which is sufficient to complete the valve opening and closing operations. This design effectively reduces the slave device's power consumption under reliable operating conditions.
The valve motor driver consists of BG4, BG5, J1, J2, and IC2C. When a set valve opening time is reached, the microcontroller outputs a high-level signal at pin 4 or 5 to drive the valve to rotate forward (or reverse), completing the valve opening (or closing) function. When the motor is normally driving the valve, the motor current is less than its rated value, and IC2C outputs a low level, which does not affect the drive operation. When the motor drives the valve to its destination, the drive motor stalls. At this time, the motor current is greater than its rated value, IC2C outputs a high level, and the microcontroller detects this high level, delays for 7 seconds, and then stops the driver operation, thus completing one valve closing (or valve opening) operation.
The flow signal acquisition unit consists of Hall effect sensors IC3, IC2A, and IC2B, and rotatable vanes (each vane equipped with a magnet) installed in the tubing near the valve controller. Its function is to coordinate with wellhead pumping operations. It can disable a pre-set valve closing time, allowing for adjustments to the preset closing time as needed. When a pre-set valve closing time has elapsed, pumping operations are underway on the wellhead, and fluid is flowing in the downhole tubing.
When the rotating blades with magnets rotate, the Hall sensor detects this signal and causes IC2B to output a high level. The microcontroller detects this high level and allows the valve closing control to proceed normally. If, based on the wellhead conditions, a set valve closing time is not desired, the wellhead operation temporarily stops the pumping system before the set time expires, resulting in no fluid flow in the downhole tubing. The blades stop rotating, and the Hall sensor detects this, causing IC2C to output a low level. When the microcontroller detects this low level, it stops the valve closing control, leaving the system in the open valve state.
System software design
This system adopts a modular approach and uses C language to complete the software design of the host AT89C52 and the slave PIC16F876A.
The host program implements functions such as keyboard scanning, LCD display, time data processing, and serial communication. The system program flowchart is shown in Figure 4. The time data processing subroutine can set the "current time" and seven preset times. When the set time data does not meet the design requirements or communication fails, the user can detect and troubleshoot the fault based on the system error type prompts.
The slave program implements an interrupt timing function, generating a timed interrupt every second. It uses a polling method to detect whether there is a stall or flow signal. If the set time is up, it drives the smart valve to open or close. The system program flowchart is shown in Figure 5.
The high-temperature downhole intelligent valve control system utilizes a microcontroller for automatic control. The system features a simple structure, low power consumption, high temperature resistance, and convenient on-site installation and debugging. It can operate for extended periods in high-temperature environments below 125℃. Currently in stable operation, it meets the working requirements of various well conditions.