Intelligent oil extraction flexible control method for oil pumping unit
Through a three-layer architecture and advanced control algorithms, intelligent and flexible control of the pumping unit is achieved, solving multiple shortcomings of traditional pumping unit control systems, improving oil production efficiency, extending equipment life, reducing energy consumption, enhancing adaptability to complex working conditions and fault early warning capabilities, and promoting the dual improvement of digitalization and economic benefits in oilfield production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG SHOUGUANG KUNLONG PETROLEUM MACHINERY
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-28
AI Technical Summary
Existing pumping unit control systems have significant deficiencies in supply and production balance, equipment lifespan, energy consumption control, intelligent management, adaptability to complex well conditions, and fault diagnosis, resulting in low efficiency, high energy consumption, rapid equipment wear and tear, and low level of intelligence, making it difficult to achieve precise oil production with a tailored approach for each well.
The system adopts a three-layer architecture design, combining dynamic torque closed-loop control, load adaptive matching, well rod stability control, dual-speed operation and PID stroke adjustment. Through fuzzy-PID algorithm and particle swarm optimization algorithm, it realizes intelligent and flexible control of the pumping unit, integrates fault detection and safety protection, builds a multi-level protection mechanism, and realizes fault early warning and predictive maintenance.
It significantly improves oil production efficiency, extends equipment life, reduces energy consumption, enhances adaptability to complex working conditions, enables early warning of faults, reduces human intervention, and promotes the transformation of oilfield production towards high efficiency, energy saving, and intelligence.
Smart Images

Figure CN121934347A_ABST
Abstract
Description
Technical Field
[0001] This invention is a flexible control method for intelligent oil production of pumping units, belonging to the field of intelligent control technology for pumping units. Background Technology
[0002] In oilfield production, the pumping unit, as the core production equipment, directly determines the oilfield's production benefits and operating costs through its operating efficiency, energy consumption level, and equipment lifespan. Currently, most mainstream pumping unit control systems in domestic and international oilfields adopt a fixed-stroke operation mode, meaning the pumping unit operates continuously at a preset rated speed. This lack of adaptability to dynamic downhole conditions leads to significant deficiencies in supply-production balance, equipment protection, energy consumption control, and intelligent management. Specific problems are as follows: I. Severe imbalance between supply and demand, resulting in low pump efficiency and low liquid production; Traditional control systems cannot dynamically adjust the pumping frequency based on real-time operating conditions such as downhole fluid level and well fluid supply capacity. This easily leads to a contradiction: when the pumping frequency is too high, the downhole fluid level drops faster than the fluid supply rate, causing frequent empty pumping and wasted energy. When the pumping frequency is too low, the fluid supply capacity cannot be fully utilized, resulting in low oil production efficiency. This fixed mode leads to generally low pump efficiency, serious energy waste, and unstable daily crude oil production, making it difficult to achieve precise oil production tailored to each well.
[0003] Second, the impact of loads and mechanical vibrations are prominent, resulting in a shortened equipment lifespan; Fixed-stroke operation subjectes the pumping unit to significant inertial loads and alternating stresses during the transition between upstroke and downstroke: the upstroke must overcome the weight of the sucker rod string and the oil, while the downstroke faces the inertial impact of the falling rod string, easily leading to problems such as sucker rod string fatigue, breakage, and uneven wear. Under long-term operation, core components (such as sucker rod, pump, and gearbox) wear accelerate, equipment lifespan is shortened, maintenance frequency and costs increase significantly, and pump inspection cycles are generally only 120-160 days, severely impacting continuous oilfield production.
[0004] Third, fault diagnosis is lagging and lacks intelligent early warning and intervention capabilities; Existing systems have limited ability to identify abnormal conditions such as soft sticking (rod string obstruction), wax buildup (wax buildup on the tubing wall hindering rod string movement), and hydraulic hammer (sudden pressure changes due to gas-liquid mixing in the pump). They mainly rely on manual inspections and experience-based judgment. Manual inspections suffer from drawbacks such as long cycles and limited coverage, leading to delayed fault detection. Experience-based judgments are easily affected by personnel skill levels, resulting in a high rate of misjudgment. This leads to the inability to provide early warnings for faults, often resulting in reactive measures only after serious accidents have occurred. This not only increases maintenance costs but may also trigger secondary safety risks (such as wellbore blockage caused by rod breakage).
[0005] Fourth, it has high energy consumption and insufficient renewable energy recovery, resulting in low energy efficiency. From the perspective of energy consumption structure, traditional pumping unit drive systems have two major problems: First, the phenomenon of "overpowered motors for underpowered tasks" is common—the motor is designed for maximum load power, but in actual operation, it is mostly under light load or variable load conditions, resulting in low load rate and wasted energy; Second, the regenerated energy during the downstroke cannot be effectively recovered—during the downstroke, the gravity of the sucker rod string drives the motor to reverse and generate electricity. Traditional drive systems lack energy feedback devices and cannot feed the regenerated energy back to the grid, which not only wastes energy but may also affect grid stability due to the lack of outlet for the energy. The overall energy efficiency of the system is significantly lower than the advanced level in the industry.
[0006] Fifth, the control method is singular, and its adaptability to complex well conditions is poor; Faced with complex well conditions such as heavy oil (high viscosity and poor fluidity), high gas-oil ratio (high gas content in oil wells, affecting pump suction and discharge efficiency), and wax deposition, traditional PID control algorithms struggle to achieve precise speed regulation and torque control. PID parameters are mostly fixed values, unable to adapt to nonlinear and time-varying load characteristics, easily leading to overshoot, oscillations, and other problems, resulting in poor pumping unit operational stability. For example, heavy oil wells require reduced stroke frequency and hot washing processes, but fixed control cannot be adjusted in tandem, relying solely on manual intervention, which fails to meet the flexible adjustment needs under complex well conditions.
[0007] VI. Low level of automation and integration, lack of intelligent management; Although some oilfields have deployed remote monitoring systems, their functions are limited to data acquisition and status display, failing to achieve full-process intelligent control. Key aspects such as intermittent pumping control (starting and stopping pumping units based on fluid supply capacity), angular displacement positioning (precisely controlling the stop position of the pumping unit), and multi-equipment linkage still rely on manual operation. This results in limited intelligence levels in the oilfields, making unmanned operation impossible. Labor costs are high, and operational accuracy is affected by human factors, making it difficult to meet the overall needs of digital oilfield construction.
[0008] In summary, existing pumping unit control systems have multiple shortcomings in terms of operating efficiency, equipment protection, energy consumption control, operating condition adaptability, and intelligent management. There is an urgent need for an integrated solution that combines dynamic speed regulation, load optimization, intelligent diagnosis, and flexible control to break through the limitations of traditional models and promote the transformation of oilfield production towards high efficiency, energy saving, and intelligence. Summary of the Invention
[0009] The technical problem this invention aims to solve is to address the above-mentioned shortcomings by providing an intelligent and flexible control method for oil pumping units. This method overcomes the inherent defects of traditional oil pumping unit control systems through advanced control algorithms and system integration, achieving intelligent, flexible, and efficient oil production processes. It enables dynamic speed regulation to match supply and demand, optimizes load to extend equipment life, identifies abnormal operating conditions based on load rate feedback, and links maintenance strategies to achieve early warning and predictive maintenance of faults, reducing manual intervention, constructing multi-level safety protection, and achieving zero unplanned downtime, zero safety accidents, and zero inefficient operation. This promotes a dual improvement in oilfield production in terms of digitalization and economic benefits.
[0010] To solve the above technical problems, the present invention adopts the following technical solution: A method for intelligent flexible control of oil production in a pumping unit includes the following steps: Step 1, System Deployment and Initialization: Step 1.1, Hardware Deployment: Establish the physical foundation for a three-layer architecture consisting of the field device layer, the edge control layer software, and the cloud platform layer. Step 1.2: System initialization, completing parameter configuration and self-test; Step 2: Implement intelligent and flexible control of the pumping unit through core algorithm execution: Step 2.1, dynamic torque closed-loop control, to achieve flexible speed regulation of the motor; Step 2.2: Adaptive load matching to optimize supply and demand balance; Step 2.3: Wellbore stability control to suppress load impact; Step 2.4, Dual-speed operation and PID stroke adjustment; Step 2.5: Based on the multi-level collaborative control strategy of working condition perception, solve the command conflict problem caused by the three types of control strategies: dynamic torque closed-loop control, dual-speed operation and PID stroke adjustment based on liquid level. Step 3, Wellbore Fault Detection and Safety Protection: Step 3.1, Signal Acquisition and Preprocessing; Step 3.2, FFT spectrum analysis and fault identification; Step 3.3, Three-level security protection mechanism; Step 4: Operation monitoring and dynamic optimization; Real-time monitoring and data interaction: The RTU uploads operating data to the cloud platform via the MQTT protocol. The cloud platform displays indicators such as current diagram, dynamometer diagram, and power curve in real time and generates daily operation reports. Dynamic parameter optimization: The cloud platform AI model continuously optimizes control parameters based on massive amounts of data, and sends them to the RTU through a cloud-edge collaboration mechanism to adjust the target torque and stroke setpoints, achieving full-process adaptive optimization; Stop control: Normal stop: The system precisely positions the crank to 1 / 3-1 / 2 of the upstroke based on the data from the angular displacement sensor and applies a soft brake; Emergency stop: Triggering the on-site or remote emergency stop button immediately cuts off power and records the event.
[0011] Furthermore, the specific implementation process of step 1.1 is as follows: Step 1.1.1, Installation of on-site equipment layer: The intelligent IoT terminal RTU is fixed in the well site control cabinet as a local control hub. Its protection level reaches IP56, supports wide temperature range of -40℃ to +85℃, and is equipped with UPS backup power. Deploy the variable frequency drive cabinet: A four-quadrant vector control frequency converter is selected and connected to the RTU via an RS-485 interface. The frequency converter has a built-in DC reactor to achieve stepless speed regulation and energy feedback of the motor from 0.1 to 150 Hz. It communicates with the RTU using the Modbus-RTU protocol. Sensor system deployment: The electrical parameter acquisition unit is connected to the motor power line to collect current and voltage data; the dynamometer is fixed to the suspension rope device to measure the load and displacement of the smooth rod; the angular displacement sensor is connected to the output shaft of the gearbox through a coupling to provide feedback on the crank angle; the pressure transmitter is installed on the wellhead valve to monitor oil pressure and casing pressure; an optional liquid level tester is installed on the casing valve to detect the dynamic liquid level depth through sound waves. Step 1.1.2, Edge control layer software configuration; The RTU is equipped with an embedded Linux operating system, and C++ applications and Lua script engines are deployed to solidify core functions such as data acquisition, filtering and preprocessing, and protocol conversion. Configure a multi-threaded data acquisition module to acquire electrical parameters at a 100ms cycle, angular displacement at a 50ms cycle, and dynamometer data once per stroke, and remove outliers by using a moving average filter. Step 1.1.3, Cloud platform layer service setup; A cloud platform with a microservice architecture is deployed to receive well site data through an MQTTBroker cluster, with a peak processing capacity of no less than 100,000 data entries per second. We build a time-series database and a relational database. The time-series database stores massive amounts of real-time operating data, while the relational database stores structured data such as equipment files and alarm records. We deploy deep learning models based on the TensorFlow / PyTorch framework to provide AI services such as operating condition diagnosis and parameter optimization.
[0012] Furthermore, the specific implementation process of step 1.2 is as follows: Turn on the main power supply, start the frequency converter cabinet and RTU, and the system will automatically perform hardware self-test and provide feedback on the equipment status through indicator lights; Maintenance personnel can log in to the cloud platform via PC or mobile APP to check the online status of well site equipment and enter basic oil well parameters, target production volume and electricity price period. Once the control mode is selected, the cloud platform will send the initial control policy to the RTU, completing the cloud-edge-device data link connection.
[0013] Furthermore, the specific implementation process of step 2.1 is as follows: Step 2.1.1, Target Torque Setting: The target torque Tref is dynamically generated by the cloud platform AI algorithm or local rule base and updated to the RTU every 5-15 minutes through the cloud-edge collaboration mechanism; Step 2.1.2, Real-time torque feedback calculation: The RTU reads the instantaneous three-phase current value I of the inverter via RS-485 at 100ms intervals. a I b I c ; The three-phase current is converted into a two-phase stationary coordinate system current I using the Clarke transform. α and I β The calculation formula is as follows: ; Combined with the motor rotor electrical angle θ read from the encoder e Perform the Park transformation to convert the two-phase static current into the excitation current I in a two-phase rotating coordinate system. d and torque current I q The calculation formula is as follows: ; Real-time load torque Tactual is determined by torque current I q The calculation shows that: ; Where p is the number of pole pairs of the motor, Lm is the mutual inductance, Lr is the rotor inductance, and ψr is the rotor flux linkage; Step 2.1.3, Fuzzy-PID control; Input fuzzification: This involves fuzzifying the torque error e=T. ref -T actual The error e and its rate of change ec = de / dt are used as inputs to the fuzzy controller. The universe of discourse of the error e is set to [-30, 30] N·m, and the fuzzy subset of the error e is {NB, NM, NS, ZO, PS, PM, PB}. The universe of discourse of the error rate of change ec is set to [-10, 10] N·m / s, and the fuzzy subset of the error rate of change ec is {NB, NM, NS, ZO, PS, PM, PB}. Fuzzy rule base: 49 fuzzy rules are established to dynamically correct the proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd of the PID parameters. Kp = Kp0 + ΔKp; Ki = Ki0 + ΔKi; Kd = Kd0 + ΔKd; Where Kp0, Ki0, and Kd0 are the initial reference parameters of the PID controller, and the real-time correction values ΔKp, ΔKi, and ΔKd are calculated by the fuzzy rule base. The motor speed correction ΔS is calculated using a positional PID algorithm. Where Ts is the control period of 100ms, k is the sampling time index, e(k) is the torque error of the kth control period, and e(i) is the torque deviation in the ith sampling period. Output limiting: Limits ΔS within the range of [-2Hz, +2Hz], outputs a 0-10V or 4-20mA analog signal to the speed setpoint terminal of the frequency converter through the AO port of the RTU, thereby smoothly adjusting the motor speed and achieving torque closed-loop tracking with a response time of <100ms.
[0014] 5. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: the specific implementation process of step 2.2 is as follows: Step 2.2.1, Operating Condition Identification: Calculate the pump fill rate η=A per stroke of the RTU. 实际 / A 理论 ×100%, where A 实际 A is the effective filling parameter measured during pump operation. 理论 These are the theoretical filling parameters of the pump under ideal full-fill conditions, combined with the motor's maximum torque Tmax and rated torque T. 额定 If η < 70% and Tmax < 85%T for three consecutive strokes 额定 If the liquid supply is insufficient, it is considered a working condition; if η < 70% for three consecutive strokes and Tmax ≥ 85%T 额定 If η ≥ 70%, it is determined to be a viscous oil condition; if η ≥ 70%, it is determined to be a sufficient oil supply condition. Step 2.2.2, Strategy execution; Insufficient fluid supply: The RTU automatically reduces the target stroke rate in increments of 0.1 strokes / minute until η recovers to a reasonable range of 75%-85%, and maintains that stroke rate. The oil is viscous. Phase 1: The RTU reduces the target stroke rate to 60% of the rated value and simultaneously outputs a switch signal through the DO port to automatically start the wellhead chemical dosing device or the downhole electric heating system; Phase 2: As the fluidity of the oil improves, the system detects a continuous decrease in Tmax and slowly increases the stroke rate in increments of 0.05 strokes per minute until the filling degree stabilizes within a reasonable range. Sufficient liquid supply: During off-peak electricity hours, the RTU increases the stroke rate to 115%-130% of the rated value according to cloud instructions, thereby increasing production.
[0015] Furthermore, the specific implementation process of step 2.3 is as follows: Step 2.3.1, Construction of the inertial load compensation model; The pumping unit structure is decomposed into independent rigid body units. The core mechanical components of the pumping unit are divided into 6 independent rigid bodies, each of which is considered as a concentrated, undeformed rigid body: Electric motor: As a rigid body that provides power input, its mass is concentrated on the motor shaft; Gearbox: As a rigid transmission body, its mass is concentrated in the input shaft and crankshaft; Roller: The crank at the output end of the gearbox, with mass concentrated in the crank arm and crank pin; Head pulley: The fixed pulley at the top of the derrick, with its mass concentrated on the pulley shaft; Counterweight: A counterweight used to balance the load on the sucker rod, with its mass concentrated at the center of the counterweight. Sucker rod string: The rod string from the polished rod to the pump, with the mass concentrated at the point where the polished rod is suspended; Constraints and connections define the motion relationships between rigid bodies: The motion constraints of each rigid body, i.e., the relative motion restrictions between rigid bodies, are defined by means of hinges, fixed connections, and rope constraints. Motor and gearbox: The motor shaft and the gearbox input shaft are fixedly connected, with no relative rotation, and the speeds are synchronized; Gearbox and roller: The gearbox output shaft is fixedly connected to the crank, and the crank rotates synchronously with the output shaft; Drum and head pulley: The crank pin is hinged to the walking beam through the connecting rod of the four-bar linkage of the pumping unit, and the other end of the walking beam is constrained to the sucker rod string rope through the head pulley; Counterweight and gearbox: The counterweight is fixed to the other end of the crank and rotates synchronously with the crank; Sucker rod string and head pulley: The sucker rod string is suspended from the rope of the head pulley by a suspension rope device and moves only in a straight line in the vertical direction; Step 2.3.2: Establish the equations for kinetic energy, potential energy, and dissipated energy using the Lagrange equation: ; ; ; Among them, J dLet Js be the moment of inertia of the roller, Dd and Ds be its damping coefficients, mb be the mass of the counterweight, and P be the moment of inertia of the head pulley. s,avg Let g be the average suspension point load, and g be the acceleration due to gravity. It is the angular velocity of the crank. It is the angular velocity of the crankshaft. It is the linear velocity of the sucker rod; Calculate the compensation torque T required to balance the inertial load. comp : ; Where Ps is the current suspension load, r is the effective radius of the head pulley, αd is the angular acceleration of the roller, and ωd is the angular velocity of the roller; Step 2.3.3, Parameter Identification and Model Application; Initial parameters: Jd, Js, mb are fixed parameters calculated from the equipment drawings and PRO / E 3D model.
[0016] Dynamic parameter identification: The damping coefficient D is identified using the particle swarm optimization algorithm (PSO). d D s Online identification of time-varying suspension loads Ps was performed, with the PSO population size set to 30. Identification was triggered once after each stroke cycle, and the latest parameters were updated to the model. Feedforward compensation: The RTU calculates the current crank angle θd and angular velocity. Real-time prediction of inertial torque T using a dynamic model comp This value is then added as a feedforward to the output of the aforementioned fuzzy-PID controller. That is, the final speed correction sent to the inverter is ΔS. final =ΔS PID +X⋅T comp ΔS PID X is the motor speed correction factor, X is the gain coefficient, and the model is updated once per stroke. comp As a feedforward quantity, it is added to the PID output to suppress inertial shocks at the top and bottom dead points.
[0017] Furthermore, the specific implementation process of step 2.4 is as follows: Step 2.4.1, dual-speed operation; The RTU has a preset dual-speed operating logic and a preset top stroke base speed V. up Set to the speed corresponding to the rated number of strokes; Downstroke speed V down Based on the current balance β=I during the up / down stroke up−peak / I down−peak Adjust by ×100%, I up−peak I is the peak current of the upstroke. down−peakTo determine the peak current during the downstroke, the RTU dynamically adjusts V using a PID algorithm. down This keeps β stable within the ideal range of 90%-110%; Step 2.4.2, PID stroke adjustment based on liquid level; The dynamic liquid level depth H is the controlled variable, and the target dynamic liquid level Href is set to 500-800 meters; RTU performs PID calculations and outputs the stroke adjustment ΔN: ; Among them, e H =H ref -H actual H actual The real-time dynamic liquid level depth is calculated using the principle of acoustic echo ranging. Through this closed loop, the system automatically maintains the dynamic liquid level within the optimal range, achieving a balance between supply and extraction. The proportional coefficient of the PID controller for stroke control. The integral coefficient of the PID controller for stroke control. The derivative coefficient of the PID controller for stroke control. Stroke control deviation in the kth cycle Historical stroke control deviation in the i-th cycle The sampling period for impulse control, where k is the sampling time index.
[0018] Furthermore, the specific implementation process of step 2.5 is as follows: Highest priority: Safety protection and fault handling; Controlled by an independent fault diagnosis module, once triggered, it immediately overrides all other control commands.
[0019] First priority: Ensuring a balance between supply and demand; Control strategy: PID stroke adjustment based on liquid level; Triggering condition: When the system determines that the liquid supply is insufficient, that is, the pump fill degree η is less than 70% for 3 consecutive strokes, this strategy will automatically obtain the highest control. Coordination rule: Under this operating condition, dynamic torque closed-loop and dual-speed operation control will be temporarily suppressed or their output will be limited to a safe range. The system will unilaterally execute the liquid level PID down-adjustment command until the liquid level is restored.
[0020] Second priority: System optimization and operation; Triggering condition: This priority is activated when the system is in normal operating condition with sufficient liquid supply or η≥70%; Collaborative Mechanism: At this level, dynamic torque closed-loop control, dual-speed PID regulation, and cloud-based global optimization commands operate in parallel, and dynamic weight fusion is performed through a multi-objective collaborative controller to generate the final control command.
[0021] Furthermore, the specific implementation process of step 3.1 is as follows: The system collects motor current signals through the electrical parameter module at a sampling frequency of 1kHz, and collects wellhead vibration signals through the vibration acceleration sensor installed on the suspension cable. The original signal is zero-mean and processed with a Hanning window, and then passed through a fourth-order Butterworth bandpass filter to remove power frequency interference and high-frequency noise. The specific implementation process of step 3.2 is as follows: Perform a 1024-point FFT transform on the preprocessed time-domain signal x(n) to obtain the complex spectrum X(y): ; Where y is the frequency index, j is a mathematical constant, the imaginary unit, used to construct the complex exponential basis function, n is the summation index, an integer variable that iterates through all sampling points in the time domain, and N is the key parameter, the FFT transform length, which determines the analysis duration and frequency resolution; Calculate the power spectral density: , where fs is the sampling frequency, which is 1000 Hz, and N=1024; Broken rod fault: In the power spectrum, identify the resonant peak at 2-5 times the rotational frequency, with an amplitude exceeding 5 times the baseline value; monitor the PSD value in the 25-40Hz frequency band, and if this value exceeds the threshold T for 5 consecutive analysis cycles. hrbreak If so, it is determined to be a sign of a broken pole, T hrbrea It is an engineering threshold for frequency domain energy judgment, determined based on historical normal data statistics, fault sample verification, and on-site fine-tuning. Hardware card failure: Energy concentrates in low frequencies, with a significant increase in the energy proportion in the 0.5-2Hz frequency band. Calculate the total signal energy E. total and low-frequency energy E low If the energy concentration R=E low / E total If the value is >0.3 and persists for 3 consecutive cycles, it is considered a hard card risk. Low-frequency energy E low The calculation method is as follows: The frequency band of the hard card fault characteristic is set to 0.5Hz to 2Hz. Based on the frequency resolution Δf=fs / N, the corresponding FFT index is calculated: ; Summation calculation: ; Calculate the total signal energy E total : Take all PSD values in the positive frequency range from 0Hz to fs / 2fs / 2Hz.
[0022] Summation calculation: .
[0023] Furthermore, the specific implementation process of step 3.3 is as follows: Level 1: When a potential risk is identified, the RTU pushes an early warning message to the local HMI and the remote monitoring center, and limits the pumping unit to 80% of its rated stroke rate. Level 2: When the fault characteristics are obvious, the RTU immediately controls the frequency converter to enter the load reduction operation mode, limiting the maximum output torque to 60% of the rated value, and starts the system self-test program; Level 3: When a serious fault is confirmed, the RTU issues an emergency stop command through the DO port, cuts off the inverter's main circuit, and locks the fault code in the non-volatile memory.
[0024] The present invention adopts the above technical solution and has the following technical effects compared with the prior art: 1. Significantly improve production efficiency: Through intelligent speed regulation and dynamic matching of supply and demand balance, pump efficiency is improved by 15%-25%, and pump fullness stability rate is improved by 90%, directly increasing daily crude oil production.
[0025] 2. Significantly extend equipment life: By reducing the amplitude of alternating load stress and suppressing rod string floating, the fatigue life of the sucker rod string is extended by more than 1.5 times, the rod and tube wear rate is reduced by 40%-60%, and the pump inspection cycle is extended from about 120-160 days to 276-350 days.
[0026] 3. Excellent energy saving and consumption reduction effect: Through frequency conversion control, kinetic energy recovery (such as the use of four-quadrant frequency converters) and optimized operation strategies, the overall energy consumption of the system is reduced by 15%-30%, and the daily power saving of a single well can reach 30-40kWh, and the annual power saving exceeds 13,000kWh.
[0027] 4. Strong adaptability to complex working conditions: By integrating advanced algorithms such as fuzzy PID, the system can adapt to various complex working conditions such as heavy oil, waxing, and gas lock, reducing the frequency of manual inspections by 80% and reducing hardware dependence costs.
[0028] 5. Intelligent operation and maintenance and security assurance: It realizes early warning of faults (12-24 hours in advance) and millisecond-level fault identification and protection, reducing maintenance costs by 30%-55% and effectively preventing secondary safety accidents.
[0029] 6. High degree of automation and integration: It realizes full automation of start-up, shutdown, intermittent pumping, braking and equipment linkage, with a shutdown position error of ≤±1°, a 60% increase in start-up and shutdown efficiency, and a 45% reduction in mechanical impact damage, providing a solid technical foundation for the digital construction of oilfields. Attached Figure Description
[0030] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0031] Figure 1 This is a schematic diagram of the overall architecture of the intelligent flexible oil production control system for the pumping unit of the present invention; Figure 2 This is a block diagram illustrating the principle of dynamic torque closed-loop control and load adaptive matching of the present invention. Figure 3 This is a simplified structural schematic diagram of the dynamic model of the oil pumping unit rod system of the present invention; Figure 4 This is a schematic diagram of the deployment of the intelligent IoT terminal and sensing equipment at the well site according to the present invention. Detailed Implementation
[0032] Examples, such as Figures 1 to 4 As shown, a method for intelligent flexible control of oil production in a pumping unit includes the following steps: Step 1, System Deployment and Initialization; Step 1.1, Hardware Deployment: Establish the physical foundation for a three-layer architecture consisting of the field device layer, the edge control layer software, and the cloud platform layer; Step 1.1.1, Installation of on-site equipment layer: The intelligent IoT terminal RTU is fixed in the well site control cabinet as a local control hub. Its protection level reaches IP56, supports wide temperature range of -40℃ to +85℃, and is equipped with UPS backup power. It adopts an industrial-grade RTU, with a core processor of an ARM Cortex-A53 quad-core chip with a main frequency of 1.2GHz, and is equipped with 1GB RAM and 8GB eMMC storage. It has at least 4 RS-485 interfaces, 2 Ethernet ports, 8 digital input (DI) interfaces, 6 digital output (DO) interfaces, 4 analog input (AI) interfaces, and 2 analog output (AO) interfaces.
[0033] The power supply is AC220V±15%, and it has a built-in optional 24VDCUPS backup power module to ensure that the core controller and key sensors can continue to work for at least 2 hours in the event of grid fluctuations or short-term power outages.
[0034] Deploy the variable frequency drive cabinet: A four-quadrant vector control frequency converter is selected and connected to the RTU via an RS-485 interface. The frequency converter has a built-in DC reactor to achieve stepless speed regulation of the motor from 0.1 to 150 Hz and energy feedback.
[0035] The inverter's start / stop, speed control, and fault reset terminals are connected to the RTU's DO and AO interfaces, respectively. The inverter's operating status, fault codes, output frequency, current, voltage, and other parameters communicate with the RTU via an RS-485 interface using the Modbus-RTU protocol.
[0036] Sensor system deployment: The electrical parameter acquisition unit is connected to the motor power line and uploads real-time data such as current (0-150A), voltage (0-500V), active / reactive power, and power factor to the RTU via an RS-485 interface. The dynamometer is fixed to the suspension rope device to measure the load and displacement of the polished rod. It has a built-in high-precision pressure sensor and accelerometer and sends the polished rod load (0-150kN) and displacement (0-6m) data to the RTU's gateway via Bluetooth or LoRa wirelessly. The angular displacement sensor is connected to the gearbox output shaft via a coupling to provide feedback on the crank angle. The output is a 4-20mA analog signal or an RS-485 digital signal, providing real-time feedback on the absolute angle of the crank from 0-360° with an accuracy of ±0.1°. The oil pressure and casing pressure transmitters are installed at the pressure tapping points after the wellhead production valve and casing valve, respectively. The range is 0-10MPa, and the output is a 4-20mA signal to the RTU's AI port. An isolation valve and a dirt collector must be installed before the transmitter during installation; a liquid level tester can be optionally installed on the sleeve valve to detect the dynamic liquid level depth through sound waves.
[0037] Step 1.1.2, Edge control layer software configuration: The RTU is equipped with an embedded Linux operating system, and C++ applications and Lua script engines are deployed to solidify core functions such as data acquisition, filtering preprocessing, and protocol conversion.
[0038] Configure a multi-threaded data acquisition module to acquire electrical parameters at a 100ms cycle, angular displacement at a 50ms cycle, and indicator diagram data once per stroke, and remove outliers by using a moving average filter.
[0039] It supports communication with cloud platforms via the MQTT protocol, while also being backward compatible with various industrial protocols such as Modbus RTU / TCP and OPCUA, enabling interconnection and interoperability with equipment from different manufacturers.
[0040] Step 1.1.3, Cloud Platform Layer Service Setup: A cloud platform with a microservice architecture is deployed to receive well site data through an MQTTBroker cluster, with a peak processing capacity of no less than 100,000 data entries per second.
[0041] We build a time-series database and a relational database. The time-series database stores massive amounts of real-time operating data, while the relational database stores structured data such as equipment files and alarm records. We deploy deep learning models based on the TensorFlow / PyTorch framework to provide AI services such as operating condition diagnosis and parameter optimization.
[0042] Step 1.2, System Initialization: Complete parameter configuration and self-test; Turn on the main power supply, start the frequency converter cabinet and RTU, and the system will automatically perform hardware self-test, providing feedback on the equipment status through indicator lights.
[0043] Maintenance personnel can log in to the cloud platform via PC or mobile APP to check the online status of well site equipment and enter basic oil well parameters (pump diameter, pump depth, rod string assembly, etc.), target production volume, and electricity price period.
[0044] Once the control mode is selected, the cloud platform will send the initial control policy to the RTU, completing the cloud-edge-device data link connection.
[0045] Step 2: Through the execution of core algorithms, intelligent and flexible control of the pumping unit is achieved, realizing high efficiency, energy saving, safety and stability in the oil production process; Step 2.1, dynamic torque closed-loop control, to achieve flexible speed regulation of the motor; Step 2.1.1, Target Torque Setting: The target torque Tref is dynamically generated by the cloud platform AI algorithm or local rule base. For example, when reducing peak load, the target torque of the upstroke is set to 80% of the rated value, and it is updated to the RTU every 5-15 minutes through the cloud-edge collaboration mechanism.
[0046] Step 2.1.2, Real-time torque feedback calculation: The RTU reads the instantaneous three-phase current value I of the inverter via RS-485 at 100ms intervals. a I b I c ; The three-phase current is converted into a two-phase stationary coordinate system current I using the Clarke transform. α and I β The calculation formula is as follows: ; Combined with the motor rotor electrical angle θ read from the encoder e Perform the Park transformation to convert the two-phase static current into the excitation current I in a two-phase rotating coordinate system. d and torque current I q The calculation formula is as follows: ; Real-time load torque Tactual is determined by torque current I q The calculation shows that: ; Where p is the number of pole pairs of the motor, Lm is the mutual inductance, Lr is the rotor inductance, and ψr is the rotor flux linkage.
[0047] Step 2.1.3, Fuzzy-PID control; Input fuzzification: This involves fuzzifying the torque error e=T. ref -T actual The error rate ec = de / dt is used as the input to the fuzzy controller. The universe of discourse of the error e is set to [-30, 30] N·m, and the fuzzy subset of the error e is {NB, NM, NS, ZO, PS, PM, PB}. The universe of discourse of the error rate ec is set to [-10, 10] N·m / s, and the fuzzy subset of the error rate ec is {NB, NM, NS, ZO, PS, PM, PB}.
[0048] Fuzzy rule base: 49 fuzzy rules are established to dynamically correct the proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd of the PID parameters. Kp = Kp0 + ΔKp; Ki = Ki0 + ΔKi; Kd = Kd0 + ΔKd; Where Kp0, Ki0, and Kd0 are the initial reference parameters of the PID controller, and the real-time correction values ΔKp, ΔKi, and ΔKd are calculated by the fuzzy rule base.
[0049] The motor speed correction ΔS is calculated using a positional PID algorithm. Where Ts is the control period (100ms), k is the sampling time index, e(k) is the torque error of the kth control period, and e(i) is the torque deviation in the ith sampling period.
[0050] Output limiting: Limits ΔS within the range of [-2Hz, +2Hz], outputs a 0-10V or 4-20mA analog signal to the speed setpoint terminal of the frequency converter through the AO port of the RTU, thereby smoothly adjusting the motor speed and achieving torque closed-loop tracking with a response time of <100ms.
[0051] Step 2.2: Adaptive load matching to optimize supply and demand balance; Step 2.2.1, Operating Condition Identification: Calculate the pump fill rate η=A per stroke of the RTU. 实际 / A 理论 ×100%, where A实际 A is the effective filling parameter measured during pump operation. 理论 These are the theoretical filling parameters of the pump under ideal full-fill conditions, combined with the motor's maximum torque Tmax and rated torque T. 额定 If η < 70% and Tmax < 85%T for three consecutive strokes 额定 If the liquid supply is insufficient, it is considered a working condition; if η < 70% for three consecutive strokes and Tmax ≥ 85%T 额定 If η ≥ 70%, it is determined to be a viscous oil condition; if η ≥ 70%, it is determined to be a sufficient oil supply condition.
[0052] Step 2.2.2, Strategy execution; Insufficient fluid supply: The RTU automatically reduces the target stroke rate in increments of 0.1 strokes / minute until η recovers to a reasonable range of 75%-85%, and maintains that stroke rate.
[0053] The oil is viscous. Phase 1: The RTU reduces the target stroke rate to 60% of the rated value and simultaneously outputs a switching signal through the DO port to automatically start the wellhead chemical dosing device or the downhole electric heating system.
[0054] Phase Two: As the fluidity of the oil improves, the system detects a continuous decrease in Tmax and slowly increases the stroke rate in increments of 0.05 strokes per minute until the filling degree stabilizes within a reasonable range.
[0055] Sufficient liquid supply: During off-peak electricity hours, the RTU increases the stroke rate to 115%-130% of the rated value according to cloud instructions, thereby increasing production.
[0056] Step 2.3: Wellbore stability control to suppress load impact; Step 2.3.1, Construction of the inertial load compensation model; The pumping unit structure is decomposed into independent rigid body units. The core mechanical components of the pumping unit are divided into 6 independent rigid bodies, each of which is considered as a concentrated, undeformed rigid body: Electric motor: As a rigid body that provides power input, its mass is concentrated on the motor shaft; Gearbox: As a rigid transmission body, its mass is concentrated on the input shaft and output shaft (crankshaft). Crank (roller): The crank component at the output end of the gearbox, with mass concentrated in the crank arm and crank pin; Head pulley: The fixed pulley at the top of the derrick, with its mass concentrated on the pulley shaft; Counterweight: A counterweight used to balance the load on the sucker rod, with its mass concentrated at the center of the counterweight. Sucker rod string: The rod string from the polished rod to the pump, with mass concentrated at the polished rod suspension point (equivalent to concentrated mass distributed along the well depth).
[0057] Constraints and connections define the motion relationships between rigid bodies: The motion constraints of each rigid body (i.e., the relative motion restrictions between rigid bodies) are clearly defined by means of hinges, fixed connections, rope constraints, etc. Motor and gearbox: The motor shaft and the gearbox input shaft are fixedly connected, with no relative rotation, and the speeds are synchronized; Gearbox and crank: The gearbox output shaft is fixedly connected to the crank, and the crank rotates synchronously with the output shaft; Roller (crank) and head pulley: The crank pin is hinged to the walking beam through the connecting rod of the four-bar linkage of the pumping unit, and the other end of the walking beam is constrained to the sucker rod string rope through the head pulley; Counterweight and gearbox: The counterweight is fixed to the other end of the crank and rotates synchronously with the crank; Sucker rod string and head pulley: The sucker rod string is suspended from the rope of the head pulley by a suspension rope device and moves only in a straight line in the vertical direction.
[0058] Step 2.3.2: Establish the equations for kinetic energy, potential energy, and dissipated energy using the Lagrange equation: ; ; ; Among them, J d Let Js be the moment of inertia of the roller, Dd and Ds be its damping coefficients, mb be the mass of the counterweight, and P be the moment of inertia of the head pulley. s,avg Let g be the average suspension point load, and g be the acceleration due to gravity. It is the angular velocity of the crank. It is the angular velocity of the crankshaft. It is the linear velocity of the sucker rod.
[0059] Calculate the compensation torque T required to balance the inertial load. comp : ; Where Ps is the current suspension load, r is the effective radius of the head pulley, αd is the angular acceleration of the roller, and ωd is the angular velocity of the roller.
[0060] Step 2.3.3, Parameter Identification and Model Application; Initial parameters: Fixed parameters such as Jd, Js, and mb are calculated from the equipment drawings and the PRO / E 3D model.
[0061] Dynamic parameter identification: The damping coefficient D is identified using the particle swarm optimization (PSO) algorithm. d D sOnline identification of time-varying suspension loads Ps is performed, with the PSO population size set to 30. Identification is triggered once after each stroke cycle, and the latest parameters are updated to the model.
[0062] Feedforward compensation: The RTU calculates the current crank angle θd and angular velocity. Real-time prediction of inertial torque T using a dynamic model comp This value is then added as a feedforward to the output of the aforementioned fuzzy-PID controller. That is, the final speed correction sent to the inverter is ΔS. final =ΔS PID +X⋅T comp ΔS PID X represents the motor speed correction, and X is the gain coefficient. This effectively suppresses inertial impacts near the top and bottom dead centers. A particle swarm optimization algorithm is used to identify parameters such as moment of inertia and damping coefficient online. The model is updated once per stroke. T... comp As a feedforward quantity, it is added to the PID output to suppress inertial shocks at the top and bottom dead points.
[0063] Step 2.4, Dual-speed operation and PID stroke adjustment; Step 2.4.1, dual-speed operation; The RTU has a preset dual-speed operating logic and a preset top stroke base speed V. up Set to the speed corresponding to the rated stroke.
[0064] Downstroke speed V down Based on the current balance β=I during the up / down stroke up−peak / I down−peak Adjust by ×100%, I up−peak I is the peak current of the upstroke. down−peak To determine the peak current during the downstroke, the RTU dynamically adjusts V using a PID algorithm (Kp=0.5, Ki=0.1, Kd=0.05). down This allows β to remain stable within the ideal range of 90%-110%.
[0065] Step 2.4.2, PID stroke adjustment based on liquid level; The dynamic liquid level depth H is the controlled variable, and the target dynamic liquid level Href is set to 500-800 meters.
[0066] RTU performs PID calculations and outputs the stroke adjustment ΔN: ; Among them, e H =H ref -H actual H actualThe real-time dynamic liquid level depth is calculated using the principle of acoustic echo ranging. Through this closed loop, the system automatically maintains the dynamic liquid level within the optimal range, achieving a balance between supply and extraction. The proportional coefficient of the PID controller for stroke control. The integral coefficient of the PID controller for stroke control. The derivative coefficient of the PID controller for stroke control. Stroke control deviation in the kth cycle Historical stroke control deviation in the i-th cycle The sampling period for impulse control, where k is the sampling time index.
[0067] Step 2.5: Based on the multi-level collaborative control strategy of working condition perception, solve the command conflict problem that may be generated by the three types of control strategies: dynamic torque closed-loop control, dual-speed operation and PID stroke adjustment based on liquid level. Highest priority: Safety protection and fault handling; Controlled by an independent fault diagnosis module, once triggered, it immediately overrides all other control commands.
[0068] First priority: Ensuring a balance between supply and demand; Control strategy: PID stroke adjustment based on liquid level; Triggering condition: When the system determines that the liquid supply is insufficient, that is, the pump fill degree η is less than 70% for 3 consecutive strokes, this strategy will automatically obtain the highest control. Coordination rule: Under this operating condition, dynamic torque closed-loop and dual-speed operation control will be temporarily suppressed or their output will be limited to a safe range. The system will unilaterally execute the liquid level PID down-adjustment command until the liquid level is restored.
[0069] Second priority: System optimization and operation; Triggering condition: This priority is activated when the system is in normal operating condition with sufficient liquid supply or η≥70%; Collaborative Mechanism: At this level, dynamic torque closed-loop control, dual-speed PID regulation, and cloud-based global optimization commands operate in parallel, and dynamic weight fusion is performed through a multi-objective collaborative controller to generate the final control command.
[0070] Step 3, wellbore fault detection and safety protection; Step 3.1, Signal Acquisition and Preprocessing; The system collects motor current signals through the electrical parameter module at a sampling frequency of 1kHz, and collects wellhead vibration signals through a vibration acceleration sensor (range ±50g) installed on the suspension cable.
[0071] The original signal is zero-mean and processed with a Hanning window, and then passed through a fourth-order Butterworth bandpass filter (passband 2-200Hz) to remove power frequency interference and high-frequency noise.
[0072] Step 3.2, FFT spectrum analysis and fault identification; Perform a 1024-point FFT transform on the preprocessed time-domain signal x(n) to obtain the complex spectrum X(y): ; Where y is the frequency index, j is a mathematical constant, the imaginary unit, used to construct the complex exponential basis function, n is the summation index, an integer variable that iterates through all sampling points in the time domain, and N is the key parameter, the FFT transform length, which determines the analysis duration and frequency resolution.
[0073] Calculate the power spectral density: , where fs is the sampling frequency, which is 1000 Hz, and N=1024.
[0074] Broken rod fault: In the power spectrum, identify the resonant peak at 2-5 times the rotational frequency, and its amplitude exceeds 5 times the baseline value; the system monitors the PSD value in the 25-40Hz frequency band (corresponding to the 3rd harmonic of a 3Hz impulse). If this value exceeds the threshold T for 5 consecutive analysis cycles... hrbreak If so, it is determined to be a sign of a broken pole, T hrbrea It is an engineering threshold for frequency domain energy judgment, determined based on historical normal data statistics, fault sample verification, and on-site fine-tuning.
[0075] Hardware card failure: Energy concentrates in low frequencies, with a significant increase in the energy proportion in the 0.5-2Hz frequency band. Calculate the total signal energy E. total and low-frequency energy E low (0.5−2Hz), if the energy concentration R=E low / E total If the value is greater than 0.3 and persists for 3 consecutive cycles, it is considered a hard card risk.
[0076] Low-frequency energy E low The calculation method is as follows: The frequency band of the hard card fault characteristic is set to 0.5Hz to 2Hz. Based on the frequency resolution Δf=fs / N, the corresponding FFT index is calculated: ; Summation calculation: .
[0077] Calculate the total signal energy E total : Take all PSD values in the positive frequency range from 0Hz to fs / 2fs / 2Hz.
[0078] Summation calculation: .
[0079] Step 3.3, Three-level security protection mechanism; Level 1 (Mild): When a potential risk is identified (e.g., R>0.25), the RTU pushes an early warning message to the local HMI and the remote monitoring center, and limits the pumping unit to 80% of its rated stroke rate.
[0080] Level 2 (Medium): When the fault characteristics are obvious (e.g., R>0.3), the RTU immediately controls the inverter to enter the load reduction operation mode, limiting the maximum output torque to 60% of the rated value, and starts the system self-test program.
[0081] Level 3 (Severe): When a serious fault is confirmed (such as PSD peak exceeding Thrbreak and abnormal current), the RTU issues an emergency stop command through the DO port, cuts off the inverter's main circuit, and locks the fault code (such as F001-broken rod, F002-hard card) in the non-volatile memory.
[0082] Step 4: Operation monitoring and dynamic optimization; Real-time monitoring and data interaction: The RTU uploads operating data to the cloud platform via the MQTT protocol. The cloud platform displays indicators such as current diagram, dynamometer diagram, and power curve in real time, and generates daily operation reports (including daily liquid production, power consumption, and power saving rate).
[0083] Dynamic parameter optimization: The cloud platform AI model continuously optimizes control parameters based on massive amounts of data, and sends them to the RTU through a cloud-edge collaboration mechanism to adjust the target torque, stroke and other set values, achieving full-process adaptive optimization.
[0084] Stop control: Normal stop: The system precisely positions the crank to 1 / 3-1 / 2 of the upstroke based on the data from the angular displacement sensor and applies a soft brake; Emergency stop: Triggering the on-site or remote emergency stop button immediately cuts off power and records the event.
[0085] The description of this invention is given for illustrative and descriptive purposes only and is not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention and to enable those skilled in the art to understand the invention and design various embodiments with various modifications suitable for a particular purpose.
Claims
1. A method for intelligent flexible control of oil production in a pumping unit, characterized in that: Includes the following steps: Step 1, System Deployment and Initialization: Step 1.1, Hardware Deployment: Establish the physical foundation for a three-layer architecture consisting of the field device layer, the edge control layer software, and the cloud platform layer; Step 1.2: System initialization, completing parameter configuration and self-test; Step 2: Implement intelligent and flexible control of the oil pumping unit through core algorithm execution: Step 2.1, dynamic torque closed-loop control, to achieve flexible speed regulation of the motor; Step 2.2, adaptive load matching to optimize supply and demand balance; Step 2.3: Wellbore stability control to suppress load impact; Step 2.4, Dual-speed operation and PID stroke adjustment; Step 2.5: Based on the multi-level collaborative control strategy of working condition perception, the command conflict problem caused by the three types of control strategies, namely dynamic torque closed-loop control, dual-speed operation and PID stroke adjustment based on liquid level, is solved. Step 3, Wellbore Fault Detection and Safety Protection: Step 3.1, Signal Acquisition and Preprocessing; Step 3.2, FFT spectrum analysis and fault identification; Step 3.3, Three-level security protection mechanism; Step 4: Operation monitoring and dynamic optimization; Real-time monitoring and data interaction: The RTU uploads operating data to the cloud platform via the MQTT protocol. The cloud platform displays indicators such as current diagram, dynamometer diagram, and power curve in real time and generates daily operation reports. Dynamic parameter optimization: The cloud platform AI model continuously optimizes control parameters based on massive amounts of data, and sends them to the RTU through a cloud-edge collaboration mechanism to adjust the target torque and stroke setpoints, achieving full-process adaptive optimization; Stop control: Normal stop: The system uses data from the angular displacement sensor to precisely position the crank to 1 / 3-1 / 2 of the upstroke and apply a soft brake. Emergency stop: Trigger the on-site or remote emergency stop button to immediately cut off power and record the event.
2. The intelligent flexible control method for oil pumping unit as described in claim 1, characterized in that: The specific implementation process of step 1.1 is as follows: Step 1.1.1, Installation of on-site equipment layer: The intelligent IoT terminal RTU is fixed in the well site control cabinet as a local control hub. Its protection level reaches IP56, supports wide temperature range of -40℃ to +85℃, and is equipped with UPS backup power. Deploy the variable frequency drive cabinet: A four-quadrant vector control frequency converter is selected and connected to the RTU via an RS-485 interface. The frequency converter has a built-in DC reactor to achieve stepless speed regulation of the motor from 0.1 to 150 Hz and energy feedback. It communicates with the RTU using the Modbus-RTU protocol. Sensor system deployment: The electrical parameter acquisition unit is connected to the motor power line to collect current and voltage data; the dynamometer is fixed to the suspension rope device to measure the load and displacement of the smooth rod; the angular displacement sensor is connected to the output shaft of the gearbox through a coupling to provide feedback on the crank angle; the pressure transmitter is installed on the wellhead valve to monitor oil pressure and casing pressure; an optional liquid level tester is installed on the casing valve to detect the dynamic liquid level depth through sound waves. Step 1.1.2, Edge control layer software configuration; The RTU is equipped with an embedded Linux operating system, and C++ applications and Lua script engines are deployed to solidify core functions such as data acquisition, filtering and preprocessing, and protocol conversion. Configure a multi-threaded data acquisition module to acquire electrical parameters at a 100ms cycle, angular displacement at a 50ms cycle, and dynamometer data once per stroke, and remove outliers by using a moving average filter. Step 1.1.3, Cloud platform layer service setup; A cloud platform with a microservice architecture is deployed to receive well site data through an MQTTBroker cluster, with a peak processing capacity of no less than 100,000 data entries per second. We build a time-series database and a relational database. The time-series database stores massive amounts of real-time operating data, while the relational database stores structured data such as equipment files and alarm records. We deploy deep learning models based on the TensorFlow / PyTorch framework to provide AI services such as operating condition diagnosis and parameter optimization.
3. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: The specific implementation process of step 1.2 is as follows: Turn on the main power supply, start the frequency converter cabinet and RTU, and the system will automatically perform hardware self-test and provide feedback on the equipment status through indicator lights; Maintenance personnel can log in to the cloud platform via PC or mobile APP to check the online status of well site equipment and enter basic oil well parameters, target production volume and electricity price period. Once the control mode is selected, the cloud platform will send the initial control policy to the RTU, completing the cloud-edge-device data link connection.
4. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: The specific implementation process of step 2.1 is as follows: Step 2.1.1, Target Torque Setting: The target torque Tref is dynamically generated by the cloud platform AI algorithm or local rule base and updated to the RTU every 5-15 minutes through the cloud-edge collaboration mechanism; Step 2.1.2, Real-time torque feedback calculation: The RTU reads the instantaneous three-phase current value I of the inverter via RS-485 at 100ms intervals. a I b I c ; The three-phase current is converted into a two-phase stationary coordinate system current I using the Clarke transform. α and I β The calculation formula is as follows: ; Combined with the motor rotor electrical angle θ read from the encoder e Perform the Park transformation to convert the two-phase static current into the excitation current I in a two-phase rotating coordinate system. d and torque current I q The calculation formula is as follows: ; Real-time load torque Tactual is determined by torque current I q The calculation shows that: ; Where p is the number of pole pairs of the motor, Lm is the mutual inductance, Lr is the rotor inductance, and ψr is the rotor flux linkage; Step 2.1.3, Fuzzy-PID control; Input fuzzification: This involves fuzzifying the torque error e=T. ref -T actual The error e and its rate of change ec = de / dt are used as inputs to the fuzzy controller. The universe of discourse of the error e is set to [-30, 30] N·m, and the fuzzy subset of the error e is {NB, NM, NS, ZO, PS, PM, PB}. The universe of discourse of the error rate of change ec is set to [-10, 10] N·m / s, and the fuzzy subset of the error rate of change ec is {NB, NM, NS, ZO, PS, PM, PB}. Fuzzy rule base: 49 fuzzy rules are established to dynamically correct the proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd of the PID parameters. Kp = Kp0 + ΔKp; Ki = Ki0 + ΔKi; Kd = Kd0 + ΔKd; Where Kp0, Ki0, and Kd0 are the initial reference parameters of the PID controller, and the real-time correction values ΔKp, ΔKi, and ΔKd are calculated by the fuzzy rule base. The motor speed correction ΔS is calculated using a positional PID algorithm. Where Ts is the control period of 100ms, k is the sampling time index, e(k) is the torque error of the kth control period, and e(i) is the torque deviation in the ith sampling period. Output limiting: Limits ΔS within the range of [-2Hz, +2Hz], outputs a 0-10V or 4-20mA analog signal to the speed setpoint terminal of the frequency converter through the AO port of the RTU, thereby smoothly adjusting the motor speed and achieving torque closed-loop tracking with a response time of <100ms.
5. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: The specific implementation process of step 2.2 is as follows: Step 2.2.1, Operating Condition Identification: Calculate the pump fill rate η=A per stroke of the RTU. 实际 / A 理论 ×100%, where A 实际 A is the effective filling parameter measured during pump operation. 理论 These are the theoretical filling parameters of the pump under ideal full-fill conditions, combined with the motor's maximum torque Tmax and rated torque T. 额定 If η < 70% and Tmax < 85%T for three consecutive strokes 额定 If the liquid supply is insufficient, it is considered a working condition; if η < 70% for three consecutive strokes and Tmax ≥ 85%T 额定 If η ≥ 70%, it is determined to be a viscous oil condition; if η ≥ 70%, it is determined to be a sufficient oil supply condition. Step 2.2.2, Strategy execution; Insufficient fluid supply: The RTU automatically reduces the target stroke rate in increments of 0.1 strokes / minute until η recovers to a reasonable range of 75%-85%, and maintains that stroke rate. The oil is viscous. Phase 1: The RTU reduces the target stroke rate to 60% of the rated value and simultaneously outputs a switch signal through the DO port to automatically start the wellhead chemical dosing device or the downhole electric heating system; Phase 2: As the fluidity of the oil improves, the system detects a continuous decrease in Tmax and slowly increases the stroke rate in increments of 0.05 strokes per minute until the filling degree stabilizes within a reasonable range. Sufficient liquid supply: During off-peak electricity hours, the RTU increases the stroke rate to 115%-130% of the rated value according to cloud instructions, thereby increasing production.
6. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: The specific implementation process of step 2.3 is as follows: Step 2.3.1, Construction of the inertial load compensation model; The pumping unit structure is decomposed into independent rigid body units. The core mechanical components of the pumping unit are divided into 6 independent rigid bodies, each of which is considered as a concentrated, undeformed rigid body: Electric motor: As a rigid body that provides power input, its mass is concentrated on the motor shaft; Gearbox: As a rigid transmission body, its mass is concentrated in the input shaft and crankshaft; Roller: The crank at the output end of the gearbox, with mass concentrated in the crank arm and crank pin; Head pulley: The fixed pulley at the top of the derrick, with its mass concentrated on the pulley shaft; Counterweight: A counterweight used to balance the load on the sucker rod, with its mass concentrated at the center of the counterweight. Sucker rod string: The rod string from the polished rod to the pump, with the mass concentrated at the point where the polished rod is suspended; Constraints and connections define the motion relationships between rigid bodies: The motion constraints of each rigid body, i.e., the relative motion restrictions between rigid bodies, are defined by means of hinges, fixed connections, and rope constraints. Motor and gearbox: The motor shaft and the gearbox input shaft are fixedly connected, with no relative rotation, and the speeds are synchronized; Gearbox and roller: The gearbox output shaft is fixedly connected to the crank, and the crank rotates synchronously with the output shaft; Drum and head pulley: The crank pin is hinged to the walking beam through the connecting rod of the four-bar linkage of the pumping unit, and the other end of the walking beam is constrained to the sucker rod string rope through the head pulley; Counterweight and gearbox: The counterweight is fixed to the other end of the crank and rotates synchronously with the crank; Sucker rod string and head pulley: The sucker rod string is suspended from the rope of the head pulley by a suspension rope device and moves only in a straight line in the vertical direction; Step 2.3.2: Establish the equations for kinetic energy, potential energy, and dissipated energy using the Lagrange equation: ; ; ; Among them, J d Let Js be the moment of inertia of the roller, Dd and Ds be its damping coefficients, mb be the mass of the counterweight, and P be the moment of inertia of the head pulley. s,avg Let g be the average suspension point load, and g be the acceleration due to gravity. It is the angular velocity of the crank. It is the angular velocity of the crankshaft. It is the linear velocity of the sucker rod; Calculate the compensation torque T required to balance the inertial load. comp : ; Where Ps is the current suspension load, r is the effective radius of the head pulley, αd is the angular acceleration of the roller, and ωd is the angular velocity of the roller; Step 2.3.3, Parameter Identification and Model Application; Initial parameters: Jd, Js, mb are fixed parameters calculated from the equipment drawings and the PRO / E 3D model; Dynamic parameter identification: The damping coefficient D is identified using the particle swarm optimization algorithm (PSO). d D s Online identification of time-varying suspension loads Ps was performed, with the PSO population size set to 30. Identification was triggered once after each stroke cycle, and the latest parameters were updated to the model. Feedforward compensation: The RTU calculates the current crank angle θd and angular velocity. Real-time prediction of inertial torque T using a dynamic model comp This value is then added as a feedforward to the output of the aforementioned fuzzy-PID controller. That is, the final speed correction amount sent to the frequency converter is ΔS final =ΔS PID +X⋅T comp ΔS PID X is the motor speed correction factor, X is the gain coefficient, and the model is updated once per stroke. comp As a feedforward quantity, it is added to the PID output to suppress inertial shocks at the top and bottom dead points.
7. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: The specific implementation process of step 2.4 is as follows: Step 2.4.1, dual-speed operation; The RTU has a preset dual-speed operating logic and a preset top stroke base speed V. up Set to the speed corresponding to the rated number of strokes; Downstroke speed V down Based on the current balance β=I during the up / down stroke up−peak / I down−peak Adjust by ×100%, I up−peak I is the peak current of the upstroke. down−peak To determine the peak current during the downstroke, the RTU dynamically adjusts V using a PID algorithm. down This keeps β stable within the ideal range of 90%-110%; Step 2.4.2, PID stroke adjustment based on liquid level; The dynamic liquid level depth H is the controlled variable, and the target dynamic liquid level Href is set to 500-800 meters; RTU performs PID calculations and outputs the stroke adjustment ΔN: ; Among them, e H =H ref -H actual H actual The real-time dynamic liquid level depth is calculated using the principle of acoustic echo ranging. Through this closed loop, the system automatically maintains the dynamic liquid level within the optimal range, achieving a balance between supply and extraction. The proportional coefficient of the PID controller for stroke control. The integral coefficient of the PID controller for stroke control. The derivative coefficient of the PID controller for stroke control. Stroke control deviation in the kth cycle Historical stroke control deviation in the i-th cycle The sampling period for impulse control, where k is the sampling time index.
8. The intelligent flexible control method for oil pumping unit as described in claim 5, characterized in that: The specific implementation process of step 2.5 is as follows: Highest priority: Safety protection and fault handling; Controlled by an independent fault diagnosis module, once triggered, it immediately overrides all other control commands; First priority: Ensuring a balance between supply and demand; Control strategy: PID stroke adjustment based on liquid level; Triggering condition: When the system determines that the liquid supply is insufficient, that is, the pump fill degree η is less than 70% for 3 consecutive strokes, this strategy will automatically obtain the highest control. Coordination rule: Under this operating condition, dynamic torque closed-loop and dual-speed operation control will be temporarily suppressed or their output will be limited to a safe range. The system will unilaterally execute the liquid level PID down-adjustment command until the liquid level is restored. Second priority: System optimization and operation; Triggering condition: This priority is activated when the system is in normal operating condition with sufficient liquid supply or η≥70%; Collaborative Mechanism: At this level, dynamic torque closed-loop control, dual-speed PID regulation, and cloud-based global optimization commands operate in parallel, and dynamic weight fusion is performed through a multi-objective collaborative controller to generate the final control command.
9. The intelligent flexible control method for oil pumping unit as described in claim 2, characterized in that: The specific implementation process of step 3.1 is as follows: The system collects motor current signals through the electrical parameter module at a sampling frequency of 1kHz, and collects wellhead vibration signals through the vibration acceleration sensor installed on the suspension cable. The original signal is zero-mean and processed with a Hanning window, and then passed through a fourth-order Butterworth bandpass filter to remove power frequency interference and high-frequency noise. The specific implementation process of step 3.2 is as follows: Perform a 1024-point FFT transform on the preprocessed time-domain signal x(n) to obtain the complex spectrum X(y): ; Where y is the frequency index, j is a mathematical constant, the imaginary unit, used to construct the complex exponential basis function, n is the summation index, an integer variable that iterates through all sampling points in the time domain, and N is the key parameter, the FFT transform length, which determines the analysis duration and frequency resolution; Calculate the power spectral density: , where fs is the sampling frequency, which is 1000 Hz, and N=1024; Broken rod fault: In the power spectrum, identify the resonant peak at 2-5 times the rotational frequency, with an amplitude exceeding 5 times the baseline value; monitor the PSD value in the 25-40Hz frequency band, and if this value exceeds the threshold T for 5 consecutive analysis cycles. hrbreak If so, it is determined to be a sign of a broken pole, T hrbrea It is an engineering threshold for frequency domain energy judgment, determined based on historical normal data statistics, fault sample verification, and on-site fine-tuning. Hardware card failure: Energy concentrates in low frequencies, with a significant increase in the energy proportion in the 0.5-2Hz frequency band. Calculate the total signal energy E. total and low-frequency energy E low If the energy concentration R=E low / E total If the value is >0.3 and persists for 3 consecutive cycles, it is considered a hard card risk. Low-frequency energy E low The calculation method is as follows: The frequency band of the hard card fault characteristic is set to 0.5Hz to 2Hz. Based on the frequency resolution Δf=fs / N, the corresponding FFT index is calculated: ; Summation calculation: ; Calculate the total signal energy E total : Take all PSD values in the positive frequency range from 0Hz to fs / 2fs / 2Hz; Summation calculation: 。 10. The intelligent flexible control method for oil pumping unit as described in claim 9, characterized in that: The specific implementation process of step 3.3 is as follows: Level 1: When a potential risk is identified, the RTU pushes an early warning message to the local HMI and the remote monitoring center, and limits the pumping unit to 80% of its rated stroke rate. Level 2: When the fault characteristics are obvious, the RTU immediately controls the frequency converter to enter the load reduction operation mode, limiting the maximum output torque to 60% of the rated value, and starts the system self-test program; Level 3: When a serious fault is confirmed, the RTU issues an emergency stop command through the DO port, cuts off the inverter's main circuit, and locks the fault code in the non-volatile memory.