Automatic throttling system pressure sensor fault detection and fault-tolerant control system
By introducing the MSSDAE-RBiLSTM prediction module and ADRPID control module into the automatic throttling system for oil and gas drilling, combined with SPRT fault detection, the problem of fault detection and fault-tolerant control of pressure sensors under extreme conditions was solved, achieving fast and accurate pressure feedback and stable drilling control.
Patent Information
- Application Number
- CN202511879340.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, the pressure sensors of automatic throttling control systems for oil and gas drilling are prone to failure under extreme conditions, leading to inaccurate pressure feedback and potentially causing well kicks, well leakage, and other accidents. Furthermore, existing fault detection methods suffer from high hardware redundancy costs, detection delays, and high false alarm rates, resulting in a disconnect between fault-tolerant control and pressure control strategies.
The distributed control system consists of a pressure acquisition unit, an MSSDAE-RBiLSTM prediction module, an SPRT fault detection module, and an ADRPID control module. It acquires pressure data in real time, uses MSSDAE-RBiLSTM for multi-parameter fusion prediction, SPRT for rapid fault detection, and ADRPID module for closed-loop control, thus avoiding hardware redundancy.
It achieves fast and accurate pressure sensor fault detection, reduces false alarm rate, improves system adaptability and response speed, and ensures stable pressure control during drilling.
Smart Images

Figure CN121523052A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automatic control technology for oil and gas drilling, and in particular to a fault detection and fault-tolerant control system for pressure sensor in an automatic throttling system. Background Technology
[0002] In complex drilling operations such as deep and ultra-deep wells, precision controlled pressure drilling (MPD) relies on an automatic throttling control system to regulate wellbore pressure in real time, and its core lies in the reliable monitoring of pressure sensors. However, sensors are prone to additive and multiplicative failures under extreme operating conditions, leading to inaccurate pressure feedback and potentially causing serious accidents such as well kicks and well leakage.
[0003] Currently, sensor fault detection and fault-tolerant control methods have three major limitations: high hardware redundancy costs: multi-sensor backup schemes are expensive, installation is limited, and they cannot cope with the simultaneous failure of multiple sensors; poor adaptability of traditional data-driven models: single models do not consider multi-parameter coupling, detection delays often exceed 1 second, and false alarm and false alarm rates are high; and fault-tolerant control is disconnected from system strategy: after a fault, a fixed value is simply used as a substitute without coordination with the pressure control strategy, which can easily lead to pressure overshoot.
[0004] Therefore, current technologies cannot simultaneously meet the requirements of low cost, rapid response, low false alarms, and high-precision pressure stabilization. There is an urgent need to develop a rapid fault detection method with no hardware redundancy and multi-parameter fusion, as well as a fault-tolerant solution that is deeply integrated with the pressure control strategy. Summary of the Invention
[0005] To address the aforementioned shortcomings in the prior art, this application provides an automatic throttling system pressure sensor fault detection and fault-tolerant control system, which solves the problems of high hardware redundancy costs, slow fault detection response, and disconnect between fault-tolerant control and pressure control strategies in the prior art.
[0006] To achieve the aforementioned objectives, the technical solution adopted in this application is as follows: This application provides a fault detection and fault-tolerant control system for pressure sensors in an automatic throttling system, including: a pressure acquisition unit, an MSSDAE-RBiLSTM prediction module, an SPRT fault detection module, an ADRPID control module, and a distributed control unit; The pressure acquisition unit is installed at the mud inlet of the automatic throttling system to collect the measured pressure data of the drilling mud inlet in real time. The output end is communicatively connected to the first input end of the SPRT fault detection module and the first input end of the distributed control unit, and synchronously transmits the collected measured pressure data to the SPRT fault detection module and the distributed control unit. The input of the MSSDAE-RBiLSTM prediction module is communicatively connected to the set pressure signal output of the automatic throttling system, the A-channel throttling valve opening sensor, the B-channel throttling valve opening sensor, and the volumetric flow rate sensor, respectively, to receive the set pressure value, the A-channel throttling valve opening, the B-channel throttling valve opening, and the volumetric flow rate. The output is communicatively connected to the second input of the SPRT fault detection module, to predict the mud inlet pressure based on the preset trained model, and output the predicted pressure value. The output of the SPRT fault detection module is communicatively connected to the second input of the distributed control unit. It is used to calculate the residual between the pressure prediction value and the measured pressure data, construct time-series independent samples based on the residual, calculate the log-likelihood ratio of the samples using a preset log-likelihood ratio formula, and output the fault detection flag bit after comparing it with a preset threshold. The third input terminal of the distributed control unit is communicatively connected to the output terminal of the MSSDAE-RBiLSTM prediction module, and the output terminal is communicatively connected to the input terminal of the ADRPID control module. It is used to receive measured pressure data, pressure prediction value and fault detection flag bit, and switch the input data of the ADRPID control module according to the received fault detection flag bit value. The output of the ADRPID control module is connected to the throttle valve actuator of the automatic throttle system. It is used to adjust the throttle valve opening based on the received measured pressure data and the deviation between the pressure prediction value and the set pressure value through a preset control law, so as to realize closed-loop control of the mud inlet pressure.
[0007] Furthermore, the MSSDAE-RBiLSTM prediction module includes an MSSDAE submodule, a residual bidirectional LSTM submodule, and a fully connected output submodule; The input layer of the MSSDAE submodule contains four neurons to receive a four-dimensional input feature vector containing a set pressure value, the opening of the throttle valve in channel A, the opening of the throttle valve in channel B, and the volumetric flow rate. The main body of the MSSDAE submodule consists of three parallel fully connected layers. Adjacent fully connected layers are connected in series with a PReLU activation function, a LayerNorm layer, and a Dropout layer to perform multi-scale extraction and noise reduction on the input features. The input of the residual bidirectional LSTM submodule is connected to the output of the MSSDAE submodule. It contains multiple hidden units, and the output of the hidden layer is processed by the PReLU activation function to perform time series prediction on the denoised multi-scale features. The fully connected output submodule contains two sequentially connected fully connected layers, with the output being a neuron, used to convert the prediction results of the residual bidirectional LSTM submodule into a single-valued stress prediction value.
[0008] Furthermore, the preset training process of the MSSDAE-RBiLSTM prediction module includes: A1: Obtain the dataset of the automatic throttling system operation at the production site. The dataset includes the input features of the samples and the measured pressure of the mud inlet at the corresponding time. A2: Divide the dataset into a training set, a validation set, and a test set; A3: Preprocess the training set, validation set, and test set separately; In this process, mean-standard deviation normalization is used to process the input features and measured stress of the training set separately. The normalization formula is as follows:
[0009] In the formula, The mean of the input features or measured pressure corresponding to the training set. The standard deviation of the training set corresponding to the input features or measured pressure. The training set corresponds to the input features or measured stress. The normalized training set corresponds to the input features or measured stress. The validation and test sets are computed using the same data as the training set. and Perform normalization processing; A4: Use the Adam optimizer and MSE as the loss function for training, and set the batch size and maximum number of training epochs; A5: Calculate the validation set loss after each training round. If the decrease in validation set loss is less than 1×10 for 15 consecutive rounds... -5 If the training is terminated, the optimal model parameters are saved and used as the preset trained model called in the MSSDAE-RBiLSTM prediction module.
[0010] Further, the step of constructing time-series independent samples based on the residuals, calculating the log-likelihood ratio of the samples using a preset log-likelihood ratio formula, and outputting a fault detection flag after comparing it with a preset threshold includes: B1: Calculate the residual between the predicted pressure value and the measured pressure data. The calculation formula is as follows:
[0011] in, For a moment The residual, For a moment Predicted pressure values, For a moment Measured pressure data; B2: Define normal and fault states; B3: Based on continuity The residual sequence at each time step is used to construct time-sequential independent samples, and the log-likelihood ratio of the samples is calculated using a pre-defined log-likelihood ratio formula. The formula is as follows:
[0012] in, For log-likelihood ratio, To count the number of samples, For the first The residuals of each sample This is the normal state. This is a fault condition. Let be the probability density function of the residual. It is the natural logarithm. The standard deviation of the residuals under normal conditions. This represents the mean of the residuals under normal sensor conditions. The standard deviation of the residuals under fault conditions. This represents the mean of the residuals under sensor failure conditions. B4: Based on the preset fault judgment false positive rate and false negative rate, the basic threshold is calculated using the following formula:
[0013] in, and Based on the threshold, The false negative rate, The false positive rate; B5: Basic threshold and Perform natural logarithmic transformations to obtain the log-likelihood ratio. Comparison threshold and ; B6: Based on the log-likelihood ratio and the comparison threshold, the fault detection flag is obtained; Among them, if Then output the fault detection flag bit. This indicates that the pressure sensor is working properly; otherwise, a fault detection flag will be output. This indicates a pressure sensor malfunction.
[0014] Furthermore, the ADRPID control module includes a PID basic control unit and a second-order linear extended state observer; the second-order linear extended state observer is used to observe the measured values of the mud inlet pressure and the measured values of the system disturbance in real time. The observer gain of the second-order linear extended state observer satisfies:
[0015] in, For the observer bandwidth, and For observer gain; The expressions for the observed values of the mud inlet pressure and the observed values of the system disturbance are as follows:
[0016] Among them, superscript To represent the differential, The pressure value obtained by the sensor. For the observation of mud inlet pressure, The observed values of the system disturbance. For preset control coefficients, This is the final adjustment command output to the throttle valve actuator; The preset control law of the ADRPID control module is:
[0017] in, The output of the PID basic control unit, , and For PID parameters, For differential operators, For time The output of the PID basic control unit.
[0018] Further, the step of switching the input data of the ADRPID control module according to the received fault detection flag value includes: When the received fault detection flag value is 0, input the measured pressure data; When the received fault detection flag value is 1, the pressure prediction value is...
[0019] Furthermore, the switching logic of the distributed control unit satisfies: When the value of the fault detection flag changes from 0 to 1, the distributed control unit completes the switch of input data from measured pressure data to predicted pressure value. During the switch, a smooth transition algorithm is used to avoid sudden changes in pressure data. When the value of the fault detection flag changes from 1 to 0, the distributed control unit synchronously resumes the input of the measured pressure data. Before resuming, the deviation between the measured pressure data and the pressure prediction value is checked. If the absolute value of the deviation is less than or equal to the preset pressure value, the system resumes directly. If the absolute value of the deviation is greater than the preset pressure value, the system gradually transitions to the measured pressure data through gradient adjustment.
[0020] The beneficial effects of this application are: This application provides a fault detection and fault-tolerant control system for pressure sensors in an automatic throttling system. It improves the stability of pressure prediction through the MSSDAE-RBiLSTM module, achieves rapid fault response by combining SPRT, and ensures stable pressure control through the ADRPID module. It does not require additional hardware redundancy and solves the problem of insufficient adaptability of traditional methods to complex drilling conditions. It is suitable for automatic throttling systems in oil and gas drilling. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0022] Figure 1 This is a schematic diagram of the framework of an automatic throttling system pressure sensor fault detection and fault-tolerant control system provided in an embodiment of this application.
[0023] Figure 2 This is an internal structure diagram of the MSSDAE-RBiLSTM prediction module provided in an embodiment of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0025] This application contains some technical terms, which are explained below: MSSDAE: Multi-scale stacked denoising autoencoder, which extracts multi-scale features through parallel fully connected layers and combines denoising mechanisms to improve feature robustness; RBiLSTM: Residual bidirectional long short-term memory network that integrates forward and reverse temporal feature extraction capabilities and alleviates gradient vanishing through residual connections; SPRT: Sequential Probability Ratio Test, which achieves rapid fault diagnosis by continuously collecting residual samples, calculating the log-likelihood ratio and comparing it with a threshold. ADRPID: Active Disturbance Rejection PID, which adds a Linear Extended State Observer (LESO) to the traditional PID to compensate for system disturbances in real time.
[0026] Example 1: This application provides a fault detection and fault-tolerant control system for pressure sensors in an automatic throttling system. This system can be found in [reference needed]. Figure 1It includes: a pressure acquisition unit, an MSSDAE-RBiLSTM prediction module, an SPRT fault detection module, an ADRPID control module, and a distributed control unit.
[0027] In one embodiment of this application, the 4-20mA signal output by the pressure sensor, after being processed by a signal conditioning module, is connected via two shielded cables (model: RVVP 2×0.5mm², anti-interference level ≥40dB) to: the ADC input channel 1 of the SPRT module and the analog input channel 0 of the distributed control unit. The Ethernet interface of the MSSDAE-RBiLSTM module is connected to the Profinet interface of the distributed control unit via a Cat 5e cable (transmission distance ≤100m); the digital output interface of the MSSDAE-RBiLSTM module is connected to the CAN input interface of the SPRT module via a CAN bus cable (model: CANBUS 2×0.75mm²) for transmitting pressure prediction values. The CAN output interface of the SPRT module is connected to the CAN input interface of the distributed control unit via a CAN bus cable for transmitting fault detection flags. ( Output low level when The output is high (signal amplitude 3.3V). The analog output channel 0 of the distributed control unit is connected to the analog input channel 1 of the ADRPID module via a shielded cable to transmit the pressure data after switching; the analog output channel 0 of the ADRPID module is connected to the control interface of the throttle valve actuator via a shielded cable to transmit the throttle valve adjustment command.
[0028] In one embodiment of this application, the pressure acquisition unit hardware is selected as a diffused silicon pressure sensor, specifically a PT200 diffused silicon pressure sensor. Its core parameters are adapted to the drilling site requirements: a measurement range of 0-10 MPa (covering the conventional range of drilling mud inlet pressure 1-4 MPa), an accuracy of 0.1%FS (ensuring pressure acquisition error ≤0.001 MPa), a power supply voltage of 24VDC, and an output signal of 4-20mA analog (strong anti-interference capability, adaptable to complex electromagnetic environments). A flange-type fixing method is used, and the sensor is installed on the side wall of the mud inlet pipeline of the automatic throttling system (10-15 cm from the front end of the throttling valve; this position avoids interference from turbulence generated during throttling valve opening and closing, and also facilitates sensor maintenance). Before installation, the pipeline interface must be sealed (using fluororubber sealing rings) to prevent mud leakage. The sensor probe must be in complete contact with the mud and perpendicular to the pipeline axis to ensure that the acquired pressure is the real-time static pressure within the pipeline. Its pressure acquisition unit's signal output is connected to the signal conditioning module via a shielded cable for signal filtering and amplification. Then, it communicates with the first input of the SPRT fault detection module and the first input of the distributed control unit via the RS485 communication protocol, enabling the acquisition of measured pressure data at the drilling mud inlet every 100ms. The signal is simultaneously transmitted to the SPRT fault detection module and the distributed control unit. A TSR-02 signal conditioning module is used to filter (cutoff frequency 50Hz, filtering out field power frequency interference) and linearly amplify (amplification factor 1, only enhancing signal driving capability) the 4-20mA analog signal output from the sensor. The conditioned signal is then transmitted to subsequent modules via a shielded cable.
[0029] In one embodiment of this application, the MSSDAE-RBiLSTM (Multi-Scale Stacked Denoising Autoencoder-Residual Bidirectional Long Short-Term Memory Network) prediction module includes an MSSDAE submodule, a residual bidirectional LSTM submodule, and a fully connected output submodule. The input layer of the MSSDAE submodule contains four neurons for receiving a 4-dimensional input feature vector. ,in To set the pressure value, the analog output interface from the main controller of the automatic throttling system... For the opening of the throttle valve in channel A, For the opening of the B-channel throttle valve, and Encoder signal from the throttle valve actuator, The volumetric flow rate is the digital output from an electromagnetic flowmeter installed in the mud pipeline. The main body consists of three parallel fully connected layers with dimensions of 1200, 1000, and 800, respectively. Adjacent fully connected layers are connected in series with a PReLU activation function, a LayerNorm layer, and a Dropout layer (with a Dropout rate of 0.25) for multi-scale feature extraction and noise reduction. The input of this residual bidirectional LSTM submodule is connected to the output of the MSSDAE submodule, containing 200 hidden units. The hidden layer output is processed by a PReLU activation function to mitigate gradient vanishing, used for time-series prediction of the denoised multi-scale features. The fully connected output submodule contains two sequentially connected fully connected layers (dimensions 200 and 100, respectively), with a single neuron at the output, used to convert the prediction result of the residual bidirectional LSTM submodule into a single-valued pressure prediction. .
[0030] The MSSDAE-RBiLSTM prediction module can be implemented using an NVIDIA Jetson Xavier NX edge computing unit (manufacturer: NVIDIA). Its core configuration meets the real-time inference requirements of the model: a 6-core ARM Cortex-A78 CPU, a 384-core Volta architecture GPU, 8GB LPDDR4x memory, and 64GB eMMC storage (expandable to 128GB via SD card for storing model files and historical data). It is powered by 19V DC with a power consumption of ≤15W, suitable for mobile power supply scenarios in drilling sites. Data interaction is achieved through the module's built-in interfaces: ① Analog input interface (4 channels, adaptable to 4-20mA signals for setting pressure values, corresponding to a pressure range of 0-10MPa); ② Digital input interface (8 channels, receiving encoder signals from channel A throttle valve opening sensor K1 and channel B throttle valve opening sensor K2 via Modbus protocol); ③ Ethernet interface (1 channel, 1000Mbps rate, used for transmitting pressure prediction values). ④ USB interface (2 channels, used for model debugging and data export).
[0031] In one embodiment of this application, the SPRT (Sequential Probability Ratio Test) fault detection module is integrated into an industrial control board (such as an STM32), and its first input terminal receives the measured pressure data from the pressure acquisition unit. The second input terminal receives the pressure prediction value from the MSSDAE-RBiLSTM prediction module. The module has pre-set residual calculation logic and log-likelihood ratio algorithm, which can continuously collect residuals at 5 time points (500ms in total). Composition of time-sequential independent samples ,in, For a moment The residual, For a moment Predicted pressure values, For a moment The measured pressure data, based on a preset misjudgment rate. False negative rate Calculate threshold Comparison of log-likelihood ratio and Then, a fault detection flag is output every 100ms. ( This is normal. (For faults), and transmits the information to the second input terminal of the distributed control unit via the CAN bus.
[0032] The hardware core of this SPRT (Sequential Probability Ratio Test) fault detection module can be built on an STM32H743VIT6 microcontroller board (manufacturer: STMicroelectronics). This chip has a main frequency of 480MHz and a floating-point unit (FPU) for fast log-likelihood ratio calculation. Supporting peripheral circuitry includes: a 12-bit ADC module (for acquiring 4-20mA signals from the pressure acquisition unit at a sampling rate of 1kHz to ensure residual calculation accuracy) and a CAN bus interface (one channel for outputting fault detection flags). ), power management module (converts 24V DC to 3.3V DC, with power supply stability ±2%). Software carrier: using Keil MDK 5.37 development environment, SPRT algorithm program is written in C language, the program is stored in 1MB Flash of the control board, and loaded into 512KB RAM at runtime to ensure instruction execution delay ≤10ms (meeting the real-time requirements of fault detection).
[0033] In one embodiment of this application, the first input terminal of the distributed control unit is communicatively connected to the output terminal of the pressure acquisition unit to acquire measured pressure data, and the second input terminal is communicatively connected to the output terminal of the SPRT fault detection module to acquire fault detection flag bits. The third input terminal communicates with the output terminal of the MSSDAE-RBiLSTM prediction module to obtain the pressure prediction value; its output terminal communicates with the input terminal of the ADRPID control module. The unit has preset data switching logic, which can be adjusted according to... The value switches the input data of the ADRPID control module within 0.1s. At that time, input the measured pressure data. ;when At that time, input the predicted pressure value The switching command is transmitted to the ADRPID control module via the Profinet protocol.
[0034] The distributed control unit hardware can be selected from the Siemens S7-1200 series PLC (model: 1214C DC / DC / DC), whose core configuration is adapted for multi-module collaborative control: CPU is a 32-bit ARM Cortex-M4, working memory is 128KB, program memory is 512KB, and input interface is 14 channels (including 6 analog inputs for receiving signals). , The system features 10 output interfaces (4 of which are analog outputs used to send control commands to the ADRPID module); it supports multiple communication protocols such as Profinet and RS485 to meet the data interaction needs of multiple modules. It is installed in an explosion-proof control cabinet (IP54 protection rating, suitable for dusty and humid environments at drilling sites). The control cabinet is equipped with a cooling fan (2m / s) to ensure the PLC operating temperature is maintained between 0-40℃ (to avoid command delays caused by high temperatures).
[0035] In one embodiment of this application, the ADRPID (Active Disturbance Rejection PID) control module includes a PID basic control unit and a second-order linear extended state observer (LESO). Its input is communicatively connected to the output of the distributed control unit, and its output is communicatively connected to the throttle valve actuator of the automatic throttling system, used for controlling based on received pressure data (…). or ) and set pressure value The deviation is controlled by adjusting the throttle valve opening using a preset control law, achieving closed-loop control of the mud inlet pressure. LESO's observer bandwidth... Observer gain Real-time observation of mud inlet pressure Observed values of system disturbance Its differential equation is: , The pressure value is obtained from the sensor. The control law of the ADRPID control module is: ,in The final output is the regulation command to the throttle valve actuator. The preset control coefficients are determined through system identification experiments; For PID output, PID parameters , and , For differential operators, For time The output of the PID basic control unit. The module calculates a throttle valve adjustment command (4-20mA analog signal) every 50ms, and transmits it to the throttle valve actuator of the automatic throttle system via cable to adjust the throttle valve opening to stabilize the mud inlet pressure.
[0036] In one embodiment of this application, the hardware implementation of the ADRPID control module can be based on a Xilinx Zynq-7020 FPGA chip. This chip integrates dual ARM Cortex-A9 processors (866MHz clock speed) and 740 logic units, enabling parallel execution of PID calculations and the LESO observer algorithm. The supporting circuitry includes: a 16-bit DAC module (for outputting 4-20mA throttle valve adjustment commands with an output accuracy of ±0.1%), a Profinet communication module (one channel for receiving pressure data from the distributed control unit), and a power supply module (input 24V DC, output 5V / 3.3V DC, ripple coefficient ≤1%). Control cycle guarantee: Through the FPGA's parallel hardware logic, the calculation cycle of the ADRPID control law is compressed to 50ms (i.e., an adjustment command is output every 50ms), which is twice the 100ms cycle of a traditional PLC, ensuring rapid elimination of pressure deviations.
[0037] In one embodiment of this application, the system's communication protocol configuration includes an RS485 protocol (used from the pressure acquisition unit to the SPRT or distributed control unit), with a baud rate of 9600bps, 8 data bits, 1 stop bit, and no parity bit. Each data frame contains a start bit (1 bit), 8 data bits (corresponding to the hexadecimal encoding of the pressure value), and a stop bit (1 bit). The data transmission interval is 100ms (synchronized with the pressure acquisition interval). A Modbus protocol (used from the MSSDAE-RBiLSTM to the K1 / K2 encoder) is also included, employing Modbus-RTU mode, with a baud rate of 19200bps, 8 data bits, 1 stop bit, and an even parity bit. The encoder sends the current opening value of K1 / K2 (range 0-100%, corresponding to a digital value of 0-65535) every 100ms. The MSSDAE-RBiLSTM module ensures data integrity through CRC check. The Profinet protocol (used for the distributed control unit → ADRPID module) adopts IRT (Isochronous Real-Time) mode with a communication cycle of 10ms. Data priority is divided into control data (high priority, such as pressure data and regulation commands) and status data (low priority, such as module fault alarms). The device name and IP address (distributed control unit IP: 192.168.0.1, ADRPID module IP: 192.168.0.2) are configured through Profinet configuration software (such as TIA Portal V17) to ensure that the communication delay is ≤10ms.
[0038] Example 2: This application provides a method for fault detection and fault-tolerant control of pressure sensor in an automatic throttling system, including: S1: After system startup, data acquisition is performed synchronously: the pressure acquisition unit acquires the measured pressure data at the mud inlet of the automatic throttling system. The data is synchronously transmitted to the SPRT fault detection module and the distributed control unit; the MSSDAE-RBiLSTM predictive module receives the set pressure value of the automatic throttling system. Channel A throttle valve opening ,B channel throttle valve opening Volumetric flow rate This forms a 4-dimensional input feature vector. .
[0039] S2: The MSSDAE-RBiLSTM prediction module calls the pre-trained model, processes the input feature vector, and generates the predicted pressure value at the mud inlet. The data is transmitted to the SPRT fault detection module and the distributed control unit.
[0040] The pre-training process for this MSSDAE-RBiLSTM prediction module includes: A1: Obtain a dataset of the automatic throttling system operating on the production floor. The dataset includes the input features of the samples. and the measured pressure at the mud inlet at the corresponding time. .
[0041] A2: Divide the training, validation, and test sets into sets of 0.7, 0.15, and 0.15 respectively.
[0042] A3: Preprocess the training set, validation set, and test set separately.
[0043] In this process, mean-standard deviation normalization is used to process the input features and measured stress of the training set separately. The normalization formula is as follows:
[0044] In the formula, The mean of the input features or measured pressure corresponding to the training set. The standard deviation of the training set corresponding to the input features or measured pressure. The training set corresponds to the input features or measured stress. The normalized training set corresponds to the input features or measured stress. The validation and test sets are computed using the same data as the training set. and Normalization is performed.
[0045] A4: Uses the Adam optimizer (learning rate 1×10⁻⁶). -4 The training process uses MSE (mean squared error) as the loss function, with a batch size of 16 and a maximum training epoch of 200.
[0046] A5: Enable early stopping mechanism: Calculate the validation set loss after each training round. If the decrease in validation set loss is less than 1×10 for 15 consecutive rounds, the early stopping mechanism will be activated. -5 If the training is terminated, the optimal model parameters are saved and used as the preset trained model called in S2.
[0047] S3: SPRT fault detection module based on received data and Perform fault diagnosis, including: B1: Calculate the residual between the predicted pressure value and the measured pressure data. The calculation formula is as follows:
[0048] in, For a moment The residual, For a moment Predicted pressure values, For a moment The measured pressure data.
[0049] B2: Define normal and fault states.
[0050] B3: Based on continuity Constructing time-sequential independent samples from the residual sequence at each time step (The sample approximately follows a normal distribution), and the log-likelihood ratio of the sample is calculated using a pre-defined log-likelihood ratio formula. The formula is as follows:
[0051] in, For log-likelihood ratio, To count the number of samples, For the first The residuals of each sample This is the normal state. This is a fault condition. Let be the probability density function of the residual. It is the natural logarithm. The standard deviation of the residuals under normal conditions. This represents the mean of the residuals under normal sensor conditions. The standard deviation of the residuals under fault conditions. This represents the mean of the residuals under sensor failure conditions.
[0052] B4: Based on the preset fault judgment false positive rate and false negative rate, the basic threshold is calculated using the following formula:
[0053] in, and Based on the threshold, The false negative rate, This represents the false positive rate.
[0054] B5: Basic threshold and Perform natural logarithmic transformations to obtain the log-likelihood ratio. Comparison threshold and .
[0055] B6: Based on the log-likelihood ratio and the comparison threshold, the fault detection flag is obtained.
[0056] Among them, if Then output the fault detection flag bit. This indicates that the pressure sensor is working properly; otherwise, a fault detection flag will be output. This indicates a pressure sensor malfunction.
[0057] S4: Distributed control unit receives fault detection flag bit The value is used to perform a data switch: like The measured pressure data Transmitted to the ADRPID control module; if , to predict the pressure value Transmitted to the ADRPID control module.
[0058] The switching logic of the distributed control unit satisfies the following: When the value of the fault detection flag changes from 0 to 1, the distributed control unit completes the switching of input data from measured pressure data to pressure prediction value within 0.1s. During the switching process, a smooth transition algorithm is used to avoid sudden changes in pressure data. When the value of the fault detection flag changes from 1 to 0, the distributed control unit synchronously restores the input of measured pressure data. Before restoration, the deviation between the measured pressure data and the pressure prediction value is checked. If the absolute value of the deviation is ≤0.035MPa (preset pressure value), it is restored directly. If the absolute value of the deviation is >0.035MPa, it gradually transitions to the measured pressure data through gradient adjustment to ensure stable response of the throttle valve actuator.
[0059] S5: The ADRPID control module is based on the received pressure data ( or ) and set pressure value The deviation is calculated by the preset control law to control the throttle valve adjustment command, which is then transmitted to the throttle valve actuator to adjust the throttle valve opening to stabilize the mud inlet pressure, thus completing one closed-loop control cycle. This process is repeated from S1 to S5 to achieve continuous pressure monitoring and fault-tolerant control.
[0060] In one embodiment of this application, the entire process of model operation from dataset preprocessing to training completion is described in detail for the MSSDAE-RBiLSTM prediction module structure and model training process, including data processing logic, training parameter configuration, and sub-module training details, to ensure that those skilled in the art can reproduce the model training process based on the following steps. The internal structure of the model is as follows: Figure 2 As shown.
[0061] 1. Data Sources and Preprocessing: The dataset comes from an automatic choke system at a drilling site, with a collection period of 72 hours (covering typical operating conditions such as "normal drilling - tripping in and out - plugging leaks") and a sampling interval of 100ms (consistent with the system's data acquisition interval). A total of 118,854 valid samples were generated (invalid data such as sensor signal loss and mud flow interruption were removed). A sample structure containing 4-dimensional input features and 1-dimensional target variable was constructed, with specific definitions shown in Table 1 (corresponding to...). Figure 2 (4 neurons in the middle input layer).
[0062] Table 1. Composition of the sample
[0063] Dataset partitioning: The samples were divided into training, validation, and test sets using stratified random sampling at a ratio of 0.7:0.15:0.15 (ensuring a consistent sample proportion for each working condition). Mean-standard deviation normalization: Statistical parameters were calculated for the input features and target variable in the training set separately (to avoid the influence of differences in units on training). Input feature statistics: , , , Calculate the mean separately Standard deviation (For example , ; , ). Target variable statistics: for Calculate the mean Standard deviation .
[0064] Normalize the training set data; reuse the training set data for the validation and test sets. , Perform normalization (strictly prohibit the use of self-statistical parameters to avoid data leakage), for example, for a sample in the validation set. Normalization: .
[0065] Outlier handling: Use "3" The criterion removes outlier samples from the training set. For the normalized input features and target variable, if any feature value of a sample exceeds […], then… 3 ,3 ] range (i.e., the original data exceeds) If a sample is found to be abnormal, it will be deleted.
[0066] 2. Training environment and core parameter configuration Software framework: TensorFlow 2.8.0 deep learning framework (compatible with Python 3.9) is used, along with Keras 2.8.0 high-level API to build models; auxiliary tools include: Pandas 1.4.2 (data reading), NumPy 1.21.6 (numerical computation), and Matplotlib 3.5.3 (training loss curve plotting).
[0067] Hardware configuration: The training server uses an Intel Core i7-12700K CPU + NVIDIA RTX 3090 GPU (24GB VRAM), 32GB DDR4 memory (3200MHz), and 1TB SSD storage (ensuring data read speed ≥500MB / s to avoid IO bottlenecks); GPU acceleration is enabled during training (configured via TensorFlow's CUDA 11.6 toolkit), and the training time for a single round can be controlled within 5 minutes. The core parameters for model training are shown in Table 2.
[0068] Table 2 Core parameters for model training
[0069] 3. Model hierarchical training process MSSDAE submodule training (multi-scale feature extraction and noise reduction), such as Figure 2 The diagram shown is an internal structure diagram of the MSSDAE-RBiLSTM prediction module. Submodule structure: Input layer: 4 neurons (receiving normalized 4D input features) Multi-scale fully connected layers: Three parallel fully connected layers (dimensions 1200, 1000, and 800 respectively). The weights of each fully connected layer are initialized using a He normal distribution (adapted to the PReLU activation function), and the biases are initialized to 0. Activation and normalization layers: Each fully connected layer is followed by a PReLU activation function (slope parameter...). Initial value = 0.25 (adaptively adjusted during training) → LayerNorm layer (eps = 1e-5, stabilized training gradient) → Dropout layer (Dropout rate = 0.25). Feature fusion: The outputs of the three parallel fully connected layers (dimensions of 1200, 1000, and 800 respectively) are concatenated into a single 2000-dimensional feature vector, which serves as the input to the RBiLSTM submodule. Pre-training and fine-tuning: The MSSDAE submodule is first subjected to "unsupervised pre-training": the parameters of other modules are fixed, and only the MSSDAE submodule is trained. The goal is for the submodule to learn a multi-scale denoised representation of the input features (Gaussian white noise is added to the input, noise intensity = 0.1). After 10 rounds of pre-training, the submodule parameters are fixed, and it is jointly trained with the subsequent RBiLSTM submodule and fully connected output submodule to achieve end-to-end stress prediction.
[0070] Residual bidirectional LSTM (RBiLSTM) submodule training (time series prediction), submodule structure construction corresponding Figure 2 The "BiLSTM + Residual Structure" in the code consists of: a bidirectional LSTM layer containing 200 hidden units, divided into a forward LSTM (extracting features from t=1 to t=n) and a backward LSTM (extracting features from t=n to t=1), with the weights of the two LSTMs initialized independently; residual connections: the output of the bidirectional LSTM layer (dimensionality = 400, 200 forward + 200 backward) is added element-wise to the input of this sub-module (2000-dimensional feature vector) to achieve residual connections (the input vector needs to be compressed to 400 dimensions using a 1×1 convolution to ensure dimension matching); and PReLU activation: after the residual connections, the PReLU activation function is applied. This process helps alleviate the gradient vanishing problem in long-term time-series training.
[0071] Training of the fully connected output submodule (predicted value output), and corresponding structure construction. Figure 2 The fully connected output submodule in the model consists of two sequentially connected fully connected layers: the first layer has a dimension of 200 (weights initialized using Xavier normality), and the second layer has a dimension of 1 (outputting normalized stress predictions; denormalized: normalized measured stress data output by the model during training). Through the training set , Inverse normalization yields the true stress prediction.
[0072] 4. Model training monitoring and saving Training process monitoring: After each training round, calculate the MSE loss of the training set and the MSE loss of the validation set, and plot the loss curve. Model saving and deployment: After training terminates, only the model parameters with the minimum validation set loss are saved (discarding overfitted models from later stages), saved in HDF5 format (.h5 file, approximately 80MB in size); the model file is transferred to the edge computing unit (NVIDIA Jetson Xavier NX) of the MSSDAE-RBiLSTM prediction module via USB interface, and the model weights are loaded during deployment to ensure inference latency ≤50ms (meeting the system's 100ms data acquisition interval requirement).
[0073] In one embodiment of this application, the entire hardware implementation and software programming logic of the SPRT fault detection module, from residual acquisition and parameter calculation to fault flag output, are described in detail for the PRT threshold determination logic and log-likelihood ratio calculation, ensuring the real-time performance and accuracy of the fault detection function. Figure 1 The interaction between the SPRT module and other modules.
[0074] 1. Residual Acquisition and Preprocessing (Basic Data Preparation for Fault Detection) (1) Data acquisition hardware configuration Sampling triggering method: The STM32H743 microcontroller board of the SPRT module acquires the measured pressure data of the pressure acquisition unit through ADC channel 1. (4-20mA analog signal), receiving pressure prediction values from the MSSDAE-RBiLSTM prediction module via CAN bus. (Digital quantity, hexadecimal encoding, range 0-65535 corresponding to 0-10MPa); Sampling is triggered by a timer interrupt, configured with a 100ms interrupt period (synchronized with the system data acquisition interval), ensuring that one set of data is collected synchronously every 100ms. and data.
[0075] ADC sampling accuracy is guaranteed: The STM32H743's ADC module is configured with 12-bit resolution and a sampling time of 15 ADC clock cycles (ADC clock = 120MHz, sampling time = 125ns). The 4-20mA signal is converted from analog to digital using the following formula:
[0076] in, for The converted digital value, 4095, is 12 bits. Full-scale value, 0.1 corresponds to 4mA percentage, 0.8 corresponds to 4-20mA signal range percentage), after conversion The accuracy is ≤0.001MPa, and Precision matching.
[0077] Data caching logic: Two circular buffers are allocated in the STM32's RAM (each storing 5 sets of data), respectively caching the latest 5 time steps. and Data (corresponding to the residual sequence at k consecutive time points, k=5, acquisition time 500ms); the buffer adopts the first-in-first-out (FIFO) mechanism, and the oldest data is overwritten when new data is written to ensure that the residual is always calculated based on the latest data.
[0078] (2) Residual calculation and preprocessing Real-time residual calculation: Every 100ms timer interrupt, the current time and four historical time points are read from the circular buffer. , According to the formula Calculate the residual at each time step. Calculate the values at five consecutive time points to obtain a time-sequential independent sample consisting of five residuals.
[0079] Residual non-recurring value removal: using Temporary criteria for removing outliers from residuals: If a certain residual... Exceeding Scope (of which) This is the mean of the current 5 residuals. If the residual is less than the standard deviation, it is considered an abnormal residual and replaced with the residual from the previous time step (to avoid misjudging faults due to a single data jump). This process is only executed when there are obvious isolated points in the residual sequence and is not triggered under normal operating conditions.
[0080] 2. Hardware implementation of SPRT threshold calculation (1) Threshold calculation timing and parameter setting Calculation timing: Threshold and The calculation is performed only once during the system initialization phase (within 3 seconds after power-on, when no pressure is being used for data acquisition). The calculation result is stored in the STM32's Flash memory (it is not lost when power is off), avoiding redundant calculations during operation and thus avoiding wasting computing power. Core parameter setting: based on the preset misjudgment rate. False negative rate The basic threshold is calculated based on the formula:
[0081] right and Perform a natural logarithm transformation (calling the logf() function in the STM32 standard library, with floating-point precision of 32-bit single precision) to obtain... , .
[0082] Considering the calculation errors in engineering implementation, Revised to 5.3 (rounded down by 0.012 to ensure that fault detection sensitivity is not reduced). The value is retained as -4.6, and the correction value is stored in the Flash configuration file, which supports fine-tuning on-site via the host computer.
[0083] (2) Threshold storage and retrieval logic Calculated and The threshold data is stored in the STM32's Flash sector (sector address 0x08080000-0x08080FFF, avoiding the program storage sector) in 32-bit floating-point format. After the system powers on, the threshold data is read from this address during the initialization phase. If the read fails (e.g., the Flash data is corrupted), the default threshold is automatically loaded. , ), to ensure the module starts normally.
[0084] 3. Software flow for calculating the log-likelihood ratio (1) Core parameters are updated in real time Normal state parameters , The sliding window method is used for real-time updates. Each time a new set of 5 residual samples is obtained, the update is performed according to the formula:
[0085]
[0086] Calculate the current sample , Replace the parameters of the previous set of samples; if <0.001MPa (residual error is extremely small, sensor condition is stable), then fix =0.001MPa, to avoid the abnormality of the denominator approaching 0 in logarithmic calculations. Fault state parameters , : As set , No real-time calculation is required, only , Update synchronously after the update to ensure that the residual distribution of the fault state and the normal state are significantly different.
[0087] (2) Calculate the log-likelihood ratio using the formula. ):
[0088] 4. Fault diagnosis and flag output (1) Fault determination logic: After each group is completed After calculation, immediately compare with the preset threshold. Comparison: If <5.3: Sensor is deemed normal, fault detection flag is set. ;like ≥5.3: Sensor fault detected, fault detection flag bit The simplified judgment logic is used to avoid retaining undetermined states, ensuring real-time fault detection and avoiding delays.
[0089] (2) Flag output hardware configuration: The GPIO port PA0 of STM32H743 is configured as a push-pull output mode (output voltage 3.3V, drive capability ≥20mA) for output. Signal: (Normal): PA0 outputs a low level (0V); (Fault): PA0 output high level (3.3V); flag output and Computation synchronization, i.e., updating once every 100ms. The status and output signals are simultaneously transmitted to the distributed control unit (for data switching) and the host computer (for status monitoring) via the CAN bus. The CAN bus transmission delay is ≤5ms, ensuring that the distributed control unit can respond quickly.
[0090] (3) Verification of false positive and false negative rates: During the system debugging phase, simulated fault residuals (generated according to the residual distribution of additive and multiplicative faults) were injected into the SPRT module through the host computer, and the detection results of 1000 sets of test data were statistically analyzed: false positive rate Under normal conditions The number of times ≥5.3 ≤10 times ( ≤0.01); false negative rate : under fault conditions <5.3 times ≤ 5 times ( ≤0.005); if the requirement is not met, it can be fine-tuned. The threshold (step size 0.1) is optimized until the preset target is reached.
[0091] In one embodiment of this application, the switching timing of the distributed control unit, the programming implementation of the smooth transition algorithm, and the pressure control verification process of the ADRPID module under the full operating conditions of "normal-fault-recovery" are described in detail, focusing on the structure, control law, and data switching smoothing logic of the ADRPID control module. This ensures the closed-loop implementation of fault-tolerant control and pressure stability control. Figure 1 .
[0092] 1. Hardware safeguards and timing control for data switching (1) Interrupt priority configuration (ensure switching within 0.1s) Interrupt trigger source: The fault detection flag output by the SPRT module from the distributed control unit (Siemens S7-1200 PLC). (GPIO port input signal) configured as the highest priority interrupt trigger source, The signal level change (0→1 or 1→0) directly triggers the PLC hardware interrupt, and the interrupt response time is ≤1ms (far lower than the 0.1s switching requirement).
[0093] Interrupt Service Routine Design: The interrupt service routine contains only core switching logic (no redundant operations), with a program length limited to 50 lines and an execution time ≤ 5ms; Program Function: ① Read the measured stress at the current moment. (From pressure acquisition unit) or predicted pressure value (From MSSDAE-RBiLSTM module); ② Write the target data into the input buffer of the ADRPID module; ③ Send a "data update" trigger signal to the ADRPID module to ensure that ADRPID immediately uses the new data for pressure control calculation.
[0094] Switching timing verification: Record the entire switching process time using the PLC's system clock (1ms accuracy): from Signal level change ( Interrupt trigger () → Data writing complete () → ADRPID confirmation received ( Total time It meets the requirement of completing the handover within 0.1 seconds.
[0095] (2) Synchronous processing of data at three input terminals: The three input terminals of the distributed control unit (connected to...) , , A clock synchronization mechanism is adopted: the clock is calibrated with the system master clock every 100ms to ensure... , , The timestamp deviation should be ≤10ms (to avoid sudden pressure changes during switching due to data asynchrony). Data caching strategy: An independent cache area should be allocated in the PLC's working memory to store the latest 10 sets of data. , Data (each data set includes a timestamp), prioritized during switching. Signal timestamp or If the corresponding timestamp data is missing, the most recent data (time difference ≤ 10ms) will be used.
[0096] 2. PLC Programming Implementation of Smooth Transition Algorithm (1) The algorithm is designed as a first-order low-pass filter and written in ST (structured text) language in TIA Portal V17 programming software.
[0097] (2) Switching logic is implemented in different scenarios: Scenario 1: From 0 to 1 (Normal to Fault): Input Data Switch to The filtering algorithm starts from the current stable value Begin, gradually transition to Scene 2: From 1 to 0 (fault to normal): First verify and Deviation: If Transition directly to through filtering algorithm If the deviation is >0.035MPa, first... Set as " +0.01MPa × step size (gradient adjustment, increasing / decreasing by 0.01MPa every 100ms), until... and If the deviation is ≤0.035MPa, then start the filter transition to avoid large fluctuations.
[0098] 3. Voltage control verification of the ADRPID control module (1) FPGA implementation of ADRPID control law: LESO observer parameter configuration: In Xilinx Vivado 2022.1 software, LESO observer code is written based on Verilog language and configured according to the settings. Calculate the observer gain , The parameters are stored in the FPGA's configuration registers and can be fine-tuned on-site via a host computer. Control law hardware calculation: ADRPID control law. The calculation is implemented in parallel using the hardware multiplier and adder of the FPGA, with a calculation cycle of 50ms.
[0099] First, calculate the deviation receiving pressure data, then apply the PID formula. Calculate the basic control quantity ( , and ); Read the interference observations output by LESO. Calculated according to the control law ,calculate The differential equation is:
[0100] Among them, superscript To represent the differential, The pressure value obtained by the sensor. For the observation of mud inlet pressure, The observed values of the system disturbance. This is the preset control coefficient. Convert to 4-20mA analog signal ( Corresponding to 4mA, (20mA at full scale) is output to the throttle valve actuator.
[0101] (2) Full-condition pressure control verification experiment: A simulated drilling fluid circulation system (including throttle valve, mud pump, and pressure sensor calibration device) was built in the laboratory to simulate the "no fault → additive fault → fault recovery" working conditions and verify the pressure control effect.
[0102] Experimental conditions: set pressure Volumetric flow rate Initial opening of the A / B channel throttle valve , .
[0103] Trouble-free operation: ADRPID adopts As input, the pressure stabilizes within 2.5 ± 0.015 MPa, overshoot = 0, and adjustment response time ≤ 0.8 s (from startup to stabilization). Additive fault condition: fault injection at 8.5 s ( SPRT module output within 0.08s The distributed control unit switches to [the desired state] within 0.09 seconds. After switching, pressure fluctuation is ≤0.03MPa (stabilizing at 2.48-2.51MPa), with no overshoot. Fault recovery condition: fault removed at 12.5s, SPRT module output within 0.15s. The distributed control unit recovers to normal within 0.3 seconds through gradient adjustment and filtering transition. The input and recovery process pressure fluctuations are ≤0.025MPa, eventually stabilizing at 2.5±0.015MPa.
[0104] 4. Abnormal Situation Handling Mechanism Data missing handling: If or If the data is not updated for three consecutive cycles (300ms), the distributed control unit automatically activates the emergency backup value, using the average of the previous 10 sets of historical data as input, and simultaneously sends an alarm signal to the host computer.
[0105] ADRPID fault handling: If the ADRPID module output is abnormal (such as the adjustment command exceeding the 4-20mA range), the distributed control unit immediately cuts off its output and controls the throttle valve to maintain the current opening to avoid pressure runaway.
[0106] In one embodiment of this application, as a system end-to-end verification step, the overall feasibility of hardware connection, software algorithm, and module collaboration is verified by simulating typical working conditions and extreme scenarios at the drilling site. This ensures that the system can stably achieve fault detection and fault-tolerant pressure control in practical applications to meet practical requirements.
[0107] 1. Debugging Preparation (1) Experimental platform construction Simulated circulation system: A drilling fluid circulation test bench identical to the field setup is constructed. Core components include: ① Mud tank (1m³ volume, storing drilling fluid (density 2.34kg / m³, viscosity 45mPa)). ② Mud pump (model 3NB-80 / 1.5, maximum flow rate 80L / s, supports stepless flow rate adjustment); ③ Automatic throttle valve (electrically adjustable type, opening adjustment range 0-100%, response time ≤50ms); ④ Calibration device (standard pressure source (accuracy 0.001MPa), flow calibrator, used to verify the accuracy of collected data).
[0108] Data logging tool: NI cDAQ-9178 data acquisition card (1kHz sampling rate, 16-bit precision) for synchronous recording. , , Key data such as throttle valve opening and adjustment commands are collected; LabVIEW 2023 software is installed on the host computer to draw pressure response curves and module status curves in real time, which facilitates debugging and analysis.
[0109] (2) Pre-commissioning calibration: Sensor calibration: Input standard pressures of 1MPa, 2.5MPa, and 4MPa into the pressure acquisition unit through a standard pressure source to calibrate the ADC conversion formula and ensure that... The measurement error is ≤0.001MPa. Model prediction accuracy calibration: Under fault-free conditions, 1000 sets of data are collected. , Data, calculate prediction bias Ensure the average deviation is ≤0.01MPa and the maximum deviation is ≤0.03MPa (if these conditions are not met, readjust the model parameters). Communication link calibration: Test the communication delay between modules to ensure that the RS485 protocol delay is ≤10ms and the Profinet protocol delay is ≤5ms, with no data packet loss (continuous communication for 1 hour, packet loss rate = 0).
[0110] 2. Trouble-free commissioning (verifying basic pressure control capabilities) (1) Debugging steps, setting pressure Stepped input is adopted: initial pressure 1MPa, increasing by 0.5MPa every 10 seconds, up to 4MPa (covering the conventional pressure control range on site); when starting the system, the distributed control unit uses the default input. The ADRPID module executes closed-loop pressure control; after each pressure level stabilizes (pressure fluctuation ≤ ±0.005MPa for 5 consecutive cycles (500ms), record: ① Adjustment response time (from (Time taken to update to stable pressure); ② Stable pressure fluctuation range; ③ Throttle valve opening adjustment range.
[0111] (2) Judgment criteria and results. Qualification criteria: ① Response time ≤ 1s / level; ② Stable pressure fluctuation ≤ ±0.02MPa; ③ No sudden change in throttle valve opening (single adjustment amplitude ≤ 5%). Typical commissioning results: 1MPa→1.5MPa response time 0.7s, stable fluctuation ±0.012MPa; 3.5MPa→4MPa response time 0.9s, stable fluctuation ±0.015MPa, both meeting the qualification criteria, verifying that the basic pressure control accuracy meets the standards.
[0112] 3. Fault simulation debugging (verification of the entire fault-tolerant control process): Simulate two typical sensor faults to verify the closed-loop logic of fault detection → data switching → voltage stabilization → fault recovery. (1) Additive fault debugging ( ) Experimental conditions: , , Debugging steps: 0-8.5s: No faults, system stabilizes and controls pressure; 8.5s: Inject an additive fault into the pressure acquisition unit via the host computer; 8.5-12.5s: Record the SPRT fault detection time ( (Time taken from 0 to 1), time taken to switch to the distributed control unit, and pressure fluctuations after the switch; 12.5s: Remove the fault and record. The time taken to transition from 1 to 0 and the pressure fluctuation during the recovery process. Acceptable standards: ① Fault detection time ≤ 0.1s; ② Switching time ≤ 0.1s; ③ Pressure fluctuation during the fault ≤ ±0.035MPa; ④ Fluctuation during the recovery process ≤ ±0.025MPa. Debugging results: Detection time 0.08s, switching time 0.07s, pressure during the fault 2.48-2.51MPa, recovery process fluctuation ±0.02MPa, meeting the standards.
[0113] (2) Multiplicative fault debugging ( ) Experimental conditions: , , , Debugging steps: Inject the fault at 29.5s, remove the fault at 32.5s, and proceed as before for additive faults. Acceptance criteria: Consistent with additive fault debugging. Debugging results: Detection time 0.09s, switching time 0.08s, pressure during fault period 3.47-3.52MPa, recovery fluctuation ±0.022MPa, meeting requirements.
[0114] 4. Extreme operating condition adaptation verification (verifying system robustness) (1) Sudden change in volumetric flow rate Experimental conditions: ,initial At 10 seconds The flow rate suddenly increased to 80 L / s (an increase of 60%); Validation indicators: ① MSSDAE-RBiLSTM prediction bias ( ① ≤0.05MPa; ② ADRPID anti-interference ability (pressure overshoot ≤2%, stabilization time ≤1.5s); Results: The maximum prediction deviation was 0.042MPa, the pressure overshoot was 1.8%, and it stabilized in 1.2s, which meets the requirements.
[0115] (2) Set pressure jump condition Experimental conditions: Initial After stabilizing, the pressure suddenly jumped to 3.5 MPa (jump amplitude 2 MPa); verification indicators: ① no overshoot; ② stabilization time ≤ 2s; ③ fluctuation ≤ ±0.03 MPa; results: no overshoot, stabilized in 1.8s, fluctuation ±0.028 MPa, meeting the requirements.
[0116] (3) Electromagnetic interference conditions Experimental conditions: Deploy electromagnetic interference sources (frequency 50Hz, intensity 10V / m) around the system. Verification criteria: ① Sensor data is distortion-free ( Fluctuation ≤ ±0.01MPa); ② No false alarms detected ( ③ The pressure control is stable; Result: Fluctuation ±0.008MPa, no false alarms, stable pressure control, and verification that the anti-interference capability meets the standard.
[0117] 5. Summary of Debugging Results: Through three types of debugging—fault-free, fault simulation, and extreme working conditions—the system's core indicators all meet the design requirements: Fault-free pressure control: fluctuation ≤ ±0.02MPa, response time ≤ 1s; Fault handling: total detection and switching time ≤ 0.2s, fluctuation during fault ≤ ±0.035MPa; Extreme working conditions: prediction deviation ≤ 0.05MPa, anti-interference and distortion-free. This proves that the technical solution of this application is generally feasible and can meet the requirements of pressure sensor fault detection and fault-tolerant pressure control under complex working conditions in drilling sites.
[0118] The system provided in this application eliminates the need for additional hardware redundant sensors. It achieves fault tolerance through software-based prediction, fault detection, and data switching, solving the problems of high cost and installation limitations associated with traditional hardware redundancy, and adapting to the complex environment of drilling sites. Furthermore, it integrates MSSDAE-RBiLSTM multi-scale feature extraction and SPRT fast statistical testing to quickly complete fault detection and data switching, significantly reducing detection latency compared to traditional models and meeting the requirements for second-level pressure control. Simultaneously, the ADRPID combined with LESO interference compensation and smooth switching algorithms results in smaller pressure fluctuations and no overshoot during fault switching and recovery, achieving pressure control accuracy superior to traditional PID controllers. In addition, MSSDAE-RBiLSTM incorporates 4D coupling features, enabling it to adapt to extreme conditions such as sudden changes in flow rate, pressure jumps, and electromagnetic interference, thus exhibiting stronger robustness.
[0119] It should be noted that those skilled in the art will recognize that the embodiments described herein are for the purpose of helping readers understand the principles of this application, and should be understood as not limiting the scope of protection of this application to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this application without departing from the essence of this application, and these modifications and combinations are still within the scope of protection of this application.
Claims
1. A fault detection and fault-tolerant control system for pressure sensors in an automatic throttling system, characterized in that, include: Pressure acquisition unit, MSSDAE-RBiLSTM prediction module, SPRT fault detection module, ADRPID control module, and distributed control unit; The pressure acquisition unit is installed at the mud inlet of the automatic throttling system to collect the measured pressure data of the drilling mud inlet in real time. The output end is communicatively connected to the first input end of the SPRT fault detection module and the first input end of the distributed control unit, and synchronously transmits the collected measured pressure data to the SPRT fault detection module and the distributed control unit. The input of the MSSDAE-RBiLSTM prediction module is communicatively connected to the set pressure signal output of the automatic throttling system, the A-channel throttling valve opening sensor, the B-channel throttling valve opening sensor, and the volumetric flow rate sensor, respectively, to receive the set pressure value, the A-channel throttling valve opening, the B-channel throttling valve opening, and the volumetric flow rate. The output is communicatively connected to the second input of the SPRT fault detection module, to predict the mud inlet pressure based on the preset trained model, and output the predicted pressure value. The output of the SPRT fault detection module is communicatively connected to the second input of the distributed control unit. It is used to calculate the residual between the pressure prediction value and the measured pressure data, construct time-series independent samples based on the residual, calculate the log-likelihood ratio of the samples using a preset log-likelihood ratio formula, and output the fault detection flag bit after comparing it with a preset threshold. The third input terminal of the distributed control unit is communicatively connected to the output terminal of the MSSDAE-RBiLSTM prediction module, and the output terminal is communicatively connected to the input terminal of the ADRPID control module. It is used to receive measured pressure data, pressure prediction value and fault detection flag bit, and switch the input data of the ADRPID control module according to the received fault detection flag bit value. The output of the ADRPID control module is connected to the throttle valve actuator of the automatic throttle system. It is used to adjust the throttle valve opening based on the received measured pressure data and the deviation between the pressure prediction value and the set pressure value through a preset control law, so as to realize closed-loop control of the mud inlet pressure.
2. The automatic throttling system pressure sensor fault detection and fault-tolerant control system according to claim 1, characterized in that, The MSSDAE-RBiLSTM prediction module includes an MSSDAE submodule, a residual bidirectional LSTM submodule, and a fully connected output submodule. The input layer of the MSSDAE submodule contains four neurons to receive a four-dimensional input feature vector containing a set pressure value, the opening of the throttle valve in channel A, the opening of the throttle valve in channel B, and the volumetric flow rate. The main body of the MSSDAE submodule consists of three parallel fully connected layers. Adjacent fully connected layers are connected in series with a PReLU activation function, a LayerNorm layer, and a Dropout layer to perform multi-scale extraction and noise reduction on the input features. The input of the residual bidirectional LSTM submodule is connected to the output of the MSSDAE submodule. It contains multiple hidden units, and the output of the hidden layer is processed by the PReLU activation function to perform time series prediction on the denoised multi-scale features. The fully connected output submodule contains two sequentially connected fully connected layers, with the output being a neuron, used to convert the prediction results of the residual bidirectional LSTM submodule into a single-valued stress prediction value.
3. The automatic throttling system pressure sensor fault detection and fault-tolerant control system according to claim 1, characterized in that, The preset training process of the MSSDAE-RBiLSTM prediction module includes: A1: Obtain the dataset of the automatic throttling system operation at the production site. The dataset includes the input features of the samples and the measured pressure of the mud inlet at the corresponding time. A2: Divide the dataset into a training set, a validation set, and a test set; A3: Preprocess the training set, validation set, and test set separately; In this process, mean-standard deviation normalization is used to process the input features and measured stress of the training set separately. The normalization formula is as follows: In the formula, The mean of the input features or measured pressure corresponding to the training set. The standard deviation of the training set corresponding to the input features or measured pressure. The training set corresponds to the input features or measured stress. The normalized training set corresponds to the input features or measured stress. The validation and test sets are computed using the same data as the training set. and Perform normalization processing; A4: Use the Adam optimizer and MSE as the loss function for training, and set the batch size and maximum number of training epochs; A5: Calculate the validation set loss after each training round. If the decrease in validation set loss is less than 1×10 for 15 consecutive rounds... -5 If the training is terminated, the optimal model parameters are saved and used as the preset trained model called in the MSSDAE-RBiLSTM prediction module.
4. The automatic throttling system pressure sensor fault detection and fault-tolerant control system according to claim 1, characterized in that, The process of constructing time-series independent samples based on the residuals, calculating the log-likelihood ratio of the samples using a preset log-likelihood ratio formula, and comparing it with a preset threshold to output a fault detection flag includes: B1: Calculate the residual between the predicted pressure value and the measured pressure data. The calculation formula is as follows: in, For a moment The residual, For a moment Predicted pressure values, For a moment Measured pressure data; B2: Define normal and fault states; B3: Based on continuity The residual sequence at each time step, the normal state, and the fault state are used to construct time-series independent samples. The log-likelihood ratio of the samples is calculated using a pre-defined log-likelihood ratio formula. The formula is as follows: in, For log-likelihood ratio, To count the number of samples, For the first The residuals of each sample This is the normal state. This is a fault condition. Let be the probability density function of the residual. It is the natural logarithm. The standard deviation of the residuals under normal conditions. This represents the mean of the residuals under normal sensor conditions. The standard deviation of the residuals under fault conditions. This represents the mean of the residuals under sensor failure conditions. B4: Based on the preset fault judgment false positive rate and false negative rate, the basic threshold is calculated using the following formula: in, and Based on the threshold, The false negative rate, The false positive rate; B5: Basic threshold and Perform natural logarithmic transformations to obtain the log-likelihood ratio. Comparison threshold and ; B6: Based on the log-likelihood ratio and the comparison threshold, the fault detection flag is obtained; Among them, if Then output the fault detection flag bit. This indicates that the pressure sensor is working properly; otherwise, a fault detection flag will be output. This indicates a pressure sensor malfunction.
5. The automatic throttling system pressure sensor fault detection and fault-tolerant control system according to claim 1, characterized in that, The ADRPID control module includes a PID basic control unit and a second-order linear extended state observer; the second-order linear extended state observer is used to observe the measured values of the mud inlet pressure and the observed values of system disturbances in real time. The observer gain of the second-order linear extended state observer satisfies: in, For the observer bandwidth, and For observer gain; The expressions for the observed values of the mud inlet pressure and the observed values of the system disturbance are as follows: Among them, superscript To represent the differential, The pressure value obtained by the sensor. For the observation of mud inlet pressure, The observed values of the system disturbance. For preset control coefficients, This is the final adjustment command output to the throttle valve actuator; The preset control law of the ADRPID control module is: in, The output of the PID basic control unit, , and For PID parameters, For differential operators, For time The output of the PID basic control unit.
6. The automatic throttling system pressure sensor fault detection and fault-tolerant control system according to claim 1, characterized in that, The step of switching the input data of the ADRPID control module according to the received fault detection flag value includes: When the received fault detection flag value is 0, input the measured pressure data; When the received fault detection flag value is 1, the pressure prediction value is...
7. The automatic throttling system pressure sensor fault detection and fault-tolerant control system according to claim 1, characterized in that, The switching logic of the distributed control unit satisfies: When the value of the fault detection flag changes from 0 to 1, the distributed control unit completes the switch of input data from measured pressure data to predicted pressure value. During the switch, a smooth transition algorithm is used to avoid sudden changes in pressure data. When the value of the fault detection flag changes from 1 to 0, the distributed control unit synchronously resumes the input of the measured pressure data. Before resuming, the deviation between the measured pressure data and the pressure prediction value is checked. If the absolute value of the deviation is less than or equal to the preset pressure value, the system resumes directly. If the absolute value of the deviation is greater than the preset pressure value, the system gradually transitions to the measured pressure data through gradient adjustment.