An intelligent control method and system for cement head operation of well cementing
By calculating real-time ratios and constructing cost functions to optimize valve opening and plug release time, the problem of insufficient adaptability and control robustness in cement head operations was solved, enabling dynamic correction of abnormal situations and improving operational adaptability and safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGSHU PETROLEUM CEMENTING TOOLS CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-03
AI Technical Summary
Existing control methods for cementing head operations are insufficient in their ability to correct for changes in operating conditions such as plug sticking and valve misalignment, and have limited adaptive capabilities and control robustness.
By collecting operational data and calculating the real-time pressure-flow ratio, and combining the rubber plug position with the valve opening of the stopcock, the current operational stage and abnormal trend type are determined. A cost function is then constructed to optimize the valve opening and rubber plug release time, achieving dynamic correction.
It improved the adaptability and safety of cementing operations, maintained control accuracy, dynamically corrected abnormal situations, and improved cementing quality.
Smart Images

Figure CN122328053A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of oil and gas well cementing tools, and relates to an intelligent control method and system for cementing head operations. Background Technology
[0002] Cementing is a process in oil and gas well construction where cement slurry is injected into the annulus between the casing and the wellbore to seal the wellbore and isolate the formation. The cement head, a key piece of equipment in cementing operations, is installed at the top of the casing string and performs functions such as releasing the rubber plug and injecting cement slurry. Traditional cement head operations rely on manual on-site operation. Workers must manually open or close the stop valve, insert or remove the stop pin, and observe the rubber plug's descent under high pressure. This process is not only complex but also poses safety hazards such as falls from heights and high-pressure leaks.
[0003] In existing technologies, semi-automated methods based on preset timing logic and fuzzy control decompose the cementing operation process into discrete operation steps, issuing commands to achieve valve group action and plug release via fixed time sequences or event triggering. However, existing technologies have the following problems: insufficient correction effect when facing changes in working conditions such as plug jamming and valve misalignment; lack of adaptive capability to dynamic changes in different operation stages; and limited control robustness. Summary of the Invention
[0004] The purpose of this invention is to provide an intelligent control method and system for cement head operations, in order to solve the problems of insufficient correction effect, limited adaptive capability and control robustness in the prior art.
[0005] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution.
[0006] A smart control method for cement head operations includes:
[0007] Collect operational data during the cement head injection process, align it with a unified time axis to generate an operational condition vector, and calculate the real-time pressure-flow ratio based on the operational condition vector;
[0008] The real-time ratio is compared with the preset stage characteristic range, and the current operation stage and abnormal trend type are determined by combining the position of the rubber plug and the valve opening of the plug valve.
[0009] In each control cycle of the plug valve, a cost function is constructed based on the current operating stage and the type of abnormal trend, combined with the measured values of pressure, flow and current. The correction parameters are obtained by calculating the valve opening correction amount and the plug release time offset that minimize the cost function.
[0010] The corrected parameters are superimposed into the cement head operation control process to generate the execution command for the next control cycle to control the cementing operation.
[0011] Data collected during the cementing head injection process is used to generate a working condition vector aligned with a unified time axis. The real-time pressure-to-flow ratio is then calculated based on this vector, including:
[0012] Collect the current value of the plug valve drive motor, the valve opening percentage, the pipeline pressure value, the sensor signal of the rubber plug downward movement, the cement slurry density and flow data, and generate a sampling data set;
[0013] For parameters with inconsistent sampling times in the sampled data set, linear interpolation is performed using two adjacent sampled values to calculate the corresponding value at the current time and combine them to generate a working condition vector;
[0014] Based on the latest collected pipeline pressure and flow data, calculate the difference between it and the corresponding value collected previously, and divide it by the time difference between the two collections to obtain the pressure change rate and flow change rate.
[0015] The pressure change rate is divided by the flow rate change rate to obtain the real-time ratio of the pressure change rate to the flow rate change rate.
[0016] By comparing the real-time ratio with the preset stage characteristic range, and combining the position of the rubber plug with the valve opening of the stopcock, the current operating stage and abnormal trend type are determined, including:
[0017] The real-time ratio is compared sequentially with the upper and lower limits of the preset stage feature range corresponding to each work stage to determine the range in which the real-time ratio falls and to record the corresponding work stage identifier.
[0018] The median of the characteristic range of the stage is used as a reference benchmark, and the absolute value of the difference between the ratio and the real-time value is used as the deviation. The operation stage and abnormal trend are correlated and processed based on the comparison between the deviation and the preset allowable fluctuation range.
[0019] The median of the stage characteristic range is used as a reference benchmark, and the absolute value of the difference between this and the real-time ratio is used as the deviation. Based on the comparison between the deviation and the preset allowable fluctuation range, the operation stage and abnormal trends are correlated and processed, including:
[0020] If the real-time ratio is greater than the median, the median is subtracted from the real-time ratio; if the real-time ratio is less than the median, the real-time ratio is subtracted from the median. The absolute value of the difference is taken as the deviation.
[0021] Compare the deviation with the allowable fluctuation range. If the deviation is less than the allowable fluctuation range, the current operation stage is determined to be stable and without abnormalities.
[0022] If the deviation is greater than or equal to the allowable fluctuation range, then based on the positive or negative direction of the deviation relative to the median and the current operation stage identifier, the abnormal trend of the rubber plug being ahead or behind, or the valve being too open or too closed will be output, and the corresponding abnormal suffix will be added to the operation stage identifier.
[0023] In each control cycle of the plug valve, a cost function is constructed based on the current operating stage and the type of abnormal trend, combined with the measured values of pressure, flow, and current. The correction parameters are obtained by calculating the valve opening correction amount and the plug release time offset that minimize the cost function, including:
[0024] Based on the preset expected value set, the pressure deviation, flow deviation and current deviation are calculated by subtracting the measured values of pressure, flow rate and current respectively.
[0025] The current operation stage and abnormal trend type are mapped to numerical indices respectively. At the same time, the pressure deviation, flow deviation, and current deviation are calculated by dividing the normalized value by their respective maximum allowable deviations. The deviation weighting coefficients of pressure, flow, and current are obtained by linear interpolation of neighboring points.
[0026] Based on the weighted coefficients of the deviations of pressure, flow rate, and current, and the deviations of pressure, flow rate, and current, the pressure term, flow rate term, and current term are calculated, and the cost function of the current control cycle is constructed.
[0027] By substituting the valve opening correction and the rubber plug release time offset as variables to be determined, and using the predicted values of pressure, flow rate and current at future moments as unknowns as linear relationships, we obtain a quadratic expression for the cost function with respect to the variables to be determined.
[0028] Calculate the partial derivatives of the quadratic expression with respect to the valve opening correction and the rubber stopper release time offset, and set them to zero. Solve the equations simultaneously to obtain the optimal correction parameters.
[0029] The current operating stage and abnormal trend type are mapped to numerical indices respectively. Simultaneously, the normalized values of pressure deviation, flow rate deviation, and current deviation are calculated by dividing by their respective maximum allowable deviations. Weighting coefficients for pressure, flow rate, and current deviations are obtained through linear interpolation of nearest neighbor points, including:
[0030] The current operation stage is coded according to its name and abnormal trend type. The stage index and trend index are calculated by combining the valve opening degree, pressure change rate and flow change rate.
[0031] Divide the pressure deviation, flow deviation, and current deviation by their respective maximum allowable deviation values to obtain the normalized values for pressure deviation, flow deviation, and current deviation.
[0032] Based on the stage index and trend index, the numerical point that is closest to the corresponding three normalized values is determined by the preset coefficient rules, and the value at the corresponding numerical point is read to calculate the weighted coefficients of pressure, flow and current deviation.
[0033] The current operational phase is coded according to its name and abnormal trend type. A phase index and trend index are calculated by combining valve opening degree, pressure change rate, and flow change rate, including:
[0034] Based on the name of the current operation stage and the type of abnormal trend, establish stage coding sequences and trend coding sequences respectively;
[0035] The encoded value of the stage coding sequence is sequentially multiplied by the pressure change rate, flow change rate, and rubber plug position value, and all multiplications are summed to obtain the stage mapping value;
[0036] The coded values in the trend coding sequence are sequentially multiplied by the valve opening, pressure change rate, and flow change rate, and all multiplications are summed to obtain the trend mapping value.
[0037] Divide the stage mapping value by the length of the stage coding sequence and take the decimal part of the quotient as the stage index. Divide the trend mapping value by the length of the trend coding sequence and take the decimal part of the quotient as the trend index.
[0038] By substituting the valve opening correction and the rubber plug release time offset as variables to be determined, and using the predicted future pressure, flow rate, and current values as unknowns in a linear relationship, the quadratic expression of the cost function with respect to these two variables is obtained, including:
[0039] Using the actual pressure value at the current moment as the pressure reference value, the actual flow rate as the flow rate reference value, and the actual current value as the current reference value, calculate the linear coefficients of the valve opening correction amount and the rubber plug release time offset for different reference values.
[0040] By multiplying the linear coefficient by the valve opening correction and the rubber plug release time offset respectively, we can construct the pressure deviation expression, flow deviation expression, and current deviation expression respectively.
[0041] By squaring the pressure deviation expression, flow rate deviation expression, and current deviation expression respectively, multiplying them by the corresponding pressure deviation weighting coefficient, flow rate deviation weighting coefficient, and current deviation weighting coefficient, and then summing them, we obtain a quadratic expression for the valve opening correction amount and the rubber plug release time offset.
[0042] The corrected parameters are superimposed into the cement head operation control process to generate the execution command for the next control cycle to control the cementing operation, including:
[0043] The correction parameters are added to the valve opening reference value and the rubber plug release time reference value recorded at the beginning of the current control cycle, respectively, to obtain the valve opening command value and the rubber plug release time command value.
[0044] The valve opening command value is converted into a voltage signal to control the actuator of the plug valve to rotate. The command value of the rubber plug release time is written into the controller of the cement head control system, and the rubber plug is controlled by outputting a trigger pulse.
[0045] An intelligent control system for cementing head operations includes a sensing module, an anomaly detection module, a compensation and correction module, and a control module.
[0046] The sensing module is used to collect operation data during the cement head injection process, generate a working condition vector aligned with a unified time axis, and calculate the real-time pressure-flow ratio based on the working condition vector.
[0047] The anomaly detection module is used to compare the real-time ratio with the preset stage characteristic range, and combine the rubber plug position with the valve opening of the plug valve to determine the current operation stage and the type of anomaly trend.
[0048] The compensation and correction module is used to construct a cost function in each control cycle of the plug valve based on the current operating stage and the type of abnormal trend, combined with the measured values of pressure, flow and current. By calculating the valve opening correction amount and the plug release time offset that minimize the cost function, the correction parameters are obtained.
[0049] The control module is used to superimpose the correction parameters into the cement head operation control process and generate the execution command for the next control cycle to control the cementing operation.
[0050] Compared with existing technologies, the beneficial effects achieved by this invention are as follows: Data is collected during the cement head operation process; the real-time ratio of pressure change rate to flow rate change rate is calculated; the current operation stage and abnormal trend type are determined by combining the rubber plug position and valve opening degree; in each control cycle, weighted coefficients for pressure, flow rate, and current deviations are dynamically constructed based on the stage and abnormality; a cost function is established; and rolling time-domain optimization is used to calculate the valve opening correction amount and rubber plug release time offset, which are then superimposed as correction parameters onto the operation control process. This solves the problems of insufficient correction effect, limited adaptive capability, and control robustness in existing technologies. It maintains stable control accuracy within the operation cycle while achieving dynamic correction of abnormal situations, thus improving the adaptability, operational safety, and cementing quality of cementing operations.
[0051] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure. Attached Figure Description
[0052] Figure 1 A flowchart of an intelligent control method for cement head operations provided by the present invention;
[0053] Figure 2 The diagram shows the external shape and structure of the cement head product provided by this invention.
[0054] Figure 3 A connection diagram of the transmission system provided by the present invention;
[0055] Figure 4 This invention provides a structural diagram of an intelligent control system for cement head operations. Detailed Implementation
[0056] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0057] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0058] Example 1
[0059] Please see Figures 1-3 This invention provides an embodiment of an intelligent control method for cement head operations, comprising the following specific steps:
[0060] Step S1: Collect operational data during the cement head injection process, align the data with a unified time axis to generate an operational condition vector, and calculate the real-time pressure-flow ratio based on the operational condition vector.
[0061] The specific steps of step S1 are as follows:
[0062] Step S101: Collect the current value of the plug valve drive motor, the valve opening percentage, the pipeline pressure value, the sensor signal of the rubber plug downward movement, the cement slurry density and flow data, and generate a sampling data set.
[0063] In this embodiment, a current sensor installed on the power supply line of the plug valve drive motor continuously collects the current value of the plug valve drive motor. An angle sensor connected to the plug valve stem synchronously collects the valve opening percentage. A pressure transmitter threaded to the grouting port of the cement head body collects the pipeline pressure value. A magnetic induction proximity switch installed on the side wall of the plug falling channel obtains the plug descending sensor signal, which jumps from low level to high level when the plug passes by. A mass flow meter collects the cement slurry density, and an electromagnetic flow meter collects the flow rate data. After each collection action is completed, the programmable logic controller reads the count value of the current hardware timer as the current sampling time identifier. The sensor data and their respective time identifiers are combined into a sampling record to form a sampling data group covering the most recent sampling time.
[0064] exist Figure 2 In the middle, the cement head manifold mainly consists of 10 # Cement head body, plug manifold, manual / automatic integrated plug valve (including 1) # ~4 # ), 5 # Rubber stopper indicator, 6 # Stop pin actuator (rotates 11 times), 7 # The pressure transmitter and connecting fittings consist of, specifically, 1 # Used to indicate a plug valve / 90°, i.e., a plug-operated electrically driven rotary plug valve, 2 # Used to indicate ash injection valve / 90°, i.e., ash injection electric drive plug valve, 3 # Used to indicate a cleaning valve / 90°, i.e., a cleaning electrically driven plug valve, 4 # Used to indicate standby valve / 90°, i.e., standby electrically driven plug valve, 5 # Used to indicate rubber stopper indication, i.e., rubber stopper indicator sensor, 6 # Used to indicate a stop pin actuator, i.e., an electrically driven stop pin, 7 # Used to represent pressure transmitters, i.e., pressure transmitter sensors, 8 # Used to represent an interface controller, 9 # Used to indicate a DC 24V power supply, 10 # Used to indicate the cement head body, 11 # Used to indicate a high-pressure manifold, 12 # Used to indicate a PC remote control (wireless and wired dual-use), 9 # 8 # Each electrically driven plug valve, 6 # Powered by components such as 12 # Issue control commands, 8 # After receiving the instruction, control 1 according to the job requirements. # 2 # 3 # 4# The on / off state, in conjunction with 6 # The action achieves precise release of the rubber stopper, 7 # Real-time data collection 10 # and 11 # The internal pressure data is fed back to 8 # 5 # The passage status of the rubber stopper is monitored synchronously, and the entire process is carried out by 8 # Closed-loop control of the actions and operating parameters of each valve group is implemented to complete cementing operations such as ash injection, plugging, and cleaning, while simultaneously ensuring that the valves are not disassembled within 10... # Under the premise of 3 # Clean and maintain the internal fluid channels.
[0065] Step S102: For parameters with inconsistent sampling times in the sampled data group, perform linear interpolation using two adjacent sampled values, calculate the corresponding value at the current time, and combine them to generate the working condition vector.
[0066] In this embodiment, the sampling time of the current value of the plug valve drive motor is used as the reference time. The current value of the plug valve drive motor corresponding to the reference time is found from the sampled data group. At the same time, the two closest sampling points of pipeline pressure value, valve opening percentage, rubber stopper downward sensor signal, cement slurry density, and flow rate data before and after the reference time are found respectively. For each parameter to be aligned, the time interval is obtained by subtracting the previous sampling time from the subsequent sampling time, where the time interval is greater than zero. The change in value is obtained by subtracting the previous sampling value from the subsequent sampling value. The time offset is obtained by subtracting the previous sampling time from the reference time. The quotient of the time offset and the time interval is used to obtain the value. The scaling factor is calculated by adding the change in the value of the previous sampled value and multiplying it by the scaling factor to obtain the value of the parameter to be aligned at the reference time. If the signal of the rubber stopper downward sensor is a digital signal, the signal value of the latest valid sampled value before and after the reference time is taken as the signal value at that time. If there is a jump, an intermediate value is assigned according to the relationship between the jump time and the reference time. The values of all parameters calculated at the reference time are spliced together in the order of the current value of the plug valve drive motor, the valve opening percentage, the pipeline pressure value, the rubber stopper downward sensor signal, the cement slurry density and flow data, as the working condition vector of the current reference time. The working condition vector ensures the synchronization and accuracy of the pressure-flow ratio calculation and stage determination.
[0067] Step S103: Based on the latest collected pipeline pressure and flow data, calculate the difference between it and the corresponding value collected previously, and divide it by the time difference between the two collections to obtain the pressure change rate and flow change rate.
[0068] In this embodiment, the latest recorded pipeline pressure value and its corresponding time value are read, and the previously recorded pipeline pressure value and its corresponding time value are read. The pipeline pressure difference is obtained by subtracting the previous pipeline pressure value from the latest pipeline pressure value. The latest recorded flow rate data and its corresponding time value are read, and the previously recorded flow rate data and its corresponding time value are read. The flow rate difference is obtained by subtracting the previous flow rate data from the latest flow rate data. The time interval count value is obtained by subtracting the previous time value from the latest time value. The pressure change rate is obtained by dividing the pipeline pressure difference by the time interval count value, and the flow rate change rate is obtained by dividing the flow rate difference by the time interval count value. The pressure change rate and flow rate change rate represent the change amplitude of pipeline pressure and flow rate within a unit timer counting interval, respectively, and are used to quantify the severity of pressure fluctuations and the speed of cement slurry flow fluctuations during the cementing process.
[0069] For example, suppose the pipeline pressure was 12.5 MPa at the time of the last sampling (5000 ms), and the pipeline pressure was 12.8 MPa at the time of the most recent sampling (5050 ms). Then the pipeline pressure difference is 12.8 MPa. 12.5 0.3 MPa, time interval value 5050-5000 50ms. Dividing 0.3MPa by 50 gives 0.006MPa / ms, which is the pressure change rate. This means that the pressure increases by an average of 0.006MPa for each additional timer count. Meanwhile, the flow rate at the time of the last sampling was 1.2m³. 3 / min, the corresponding time value is also 5000ms, and the flow rate at the most recent sampling time was 1.15m. 3 / min, corresponding to a time value of 5050ms, then the flow rate difference is 1.15. 1.2 -0.05m 3 / min, divided by 50ms, gives -0.001(m 3 The flow rate ( / min) represents the rate of change in flow rate, indicating that the flow rate decreases by an average of 0.001 m³ / min for each additional timer. 3 / min.
[0070] Step S104: Divide the pressure change rate and the flow rate change rate to obtain the real-time ratio of the pressure change rate to the flow rate change rate.
[0071] In this embodiment, the pressure change rate is used as the dividend, and the flow rate change rate is used as the divisor for division. Before division, it is determined whether the absolute value of the flow rate change rate is less than a preset minimum flow fluctuation threshold. The minimum flow fluctuation threshold is set based on the measurement noise and normal fluctuation range of the flowmeter during cementing operations. The maximum value of the random fluctuation amplitude of the output value is recorded by introducing static or constant-velocity fluid into the flowmeter as measurement noise. The statistical distribution of the difference between two adjacent sampling flow rates during normal operation is statistically analyzed to determine the boundary of the normal fluctuation range. The larger of the measurement noise and the normal fluctuation range boundary is multiplied by an empirical coefficient to obtain the minimum flow fluctuation threshold. The empirical coefficient is set to a positive number, for example, greater than one and less than two. If the absolute value of the flow rate change rate is less than the minimum flow fluctuation threshold, the flow rate is determined to be in a quasi-steady state. The real-time ratio is set to zero. If the absolute value of the flow rate change is greater than or equal to the minimum flow fluctuation threshold, the normal calculation of pressure change rate divided by flow rate change rate is performed, and the result is used as the real-time ratio of pressure change rate to flow rate change rate. It should be noted that the real-time ratio can sensitively reflect the relative relationship between pressure and flow rate changes during cementing. The real-time ratio is divided by zero. When the real-time ratio is negative, it indicates that the pressure change rate and flow rate change rate have opposite signs. An increase in the absolute value of the real-time ratio indicates that the pressure rise rate is relatively faster than the flow rate fall rate, such as in the initial stage of rubber plug jamming, or that the pressure fall rate is faster than the flow rise rate, such as in the case of fluid acceleration after rubber plug release. When the real-time ratio is positive, it indicates that the pressure change rate and flow rate change rate have the same sign, such as in the case of pump displacement adjustment operation. If the real-time ratio fluctuates around the value of one, it indicates that the pressure and flow rate change synchronously, and the operating condition is stable.
[0072] Step S2: Compare the real-time ratio with the preset stage characteristic range, and combine the rubber plug position with the valve opening of the plug valve to determine the current operation stage and abnormal trend type.
[0073] The specific steps of step S2 are as follows:
[0074] Step S201: Compare the real-time ratio with the upper and lower limits of the preset stage feature range corresponding to each operation stage in turn to determine the range in which the real-time ratio falls and record the corresponding operation stage identifier.
[0075] In this embodiment, a work record is pre-established for each work stage. Each work record contains a unique identifier for the work stage, a lower limit of the stage's characteristic range, and an upper limit of the stage's characteristic range. The real-time ratio is used as the value to be matched. Starting from the first work record, the lower limit and upper limit of each work stage are read sequentially. For the currently read record, it is determined whether the real-time ratio is greater than or equal to the lower limit of the work record and simultaneously less than or equal to the upper limit of the work record. If both conditions are met, it is determined that the real-time ratio falls within the stage characteristic range corresponding to the work record, and subsequent comparisons are stopped. The work stage identifier in the work record is assigned to the current work stage identifier variable. If the real-time ratio is less than the lower limit of the current work record or greater than the upper limit of the current work record, the next work record is read and the same judgment is performed. If no matching range is found after traversing all work records, the current work stage identifier variable is assigned an unknown stage identifier. By comparing layer by layer, the real-time ratio is mapped to a specific work stage name, improving the targeting of the control logic. The lower limit and upper limit of the stage characteristic range are set according to the historical work data statistics of different stages of cementing operations.
[0076] For example, suppose there are characteristic ranges for three operation stages: a lower limit of 0.20 and an upper limit of 0.50 for the cement injection stage; a lower limit of 0.60 and an upper limit of 1.00 for the rubber plugging stage; and a lower limit of 1.10 and an upper limit of 1.80 for the grout replacement stage. The real-time ratio calculated at the current moment is 0.85. First, the first record is read, for example, the lower limit of 0.20 and the upper limit of 0.50 for the cement injection stage. It is then determined whether 0.85 is greater than or equal to 0.20 and less than or equal to 0.50. Since 0.85 is greater than 0.50, the condition is not met, and the second record is read, for example, the lower limit of 0.60 for the rubber plugging stage. Given an upper limit of 1.00, we determine whether 0.85 is greater than or equal to 0.60 and less than or equal to 1.00. If both conditions are met, the real-time ratio of 0.85 is determined to fall within the range of the rubber plug pressing stage. The identifier PHASEPLUG of the rubber plug pressing stage is assigned to the current operation stage identifier variable. It should be noted that in actual working conditions, the actual ratio range of each action stage should be determined through field tests. By collecting multiple sets of pressure change rate and flow change rate data under typical working conditions, such as cement injection, rubber plug pressing, and grout replacement stages, the ratio is calculated, and the standard deviation of the mean of the ratios of each stage is taken as the stage characteristic range.
[0077] Step S202: Take the median of the stage characteristic range as the reference benchmark, calculate the absolute value of the difference between the ratio and the real-time value as the deviation, and process the correlation between the operation stage and abnormal trend based on the comparison result of the deviation and the preset allowable fluctuation range.
[0078] The specific steps of step S202 are as follows:
[0079] Step S2021: If the real-time ratio is greater than the median, subtract the median from the real-time ratio; if the real-time ratio is less than the median, subtract the real-time ratio from the median. The absolute value of the difference is taken as the deviation.
[0080] In this embodiment, the upper and lower limits corresponding to the stage characteristic range are read, the upper and lower limits are added together, and the result is divided by two to calculate the median of the stage characteristic range. This median represents the ideal center point of the real-time ratio of pressure change rate to flow change rate in this stage. The real-time ratio is compared with the median. If the real-time ratio is greater than the median, the real-time ratio is subtracted from the median to obtain a positive difference. If the real-time ratio is less than the median, the median is subtracted from the real-time ratio to obtain a negative difference. If the real-time ratio is equal to the median, the difference is directly assigned to zero. The absolute value of the difference is output as the deviation. The deviation quantifies the degree to which the current real-time ratio deviates from the ideal center of the stage characteristic range. The larger the deviation, the more significant the difference between the current pressure-flow dynamic relationship and the standard operating condition.
[0081] Step S2022: Compare the deviation with the allowable fluctuation range. If the deviation is less than the allowable fluctuation range, then the current operation stage is determined to be stable and without abnormalities.
[0082] In this embodiment, an allowable fluctuation range is set, and the deviation is compared with the allowable fluctuation range. If the deviation is less than the allowable fluctuation range, it is determined that the current real-time ratio is within the normal fluctuation range, which means that the cement slurry flow and plug migration are stable and there is no abnormality that requires intervention. At this time, the current operation stage identifier is kept unchanged, and the abnormal trend type variable is assigned to no abnormality to ensure that unnecessary correction actions are not initiated and to maintain the continuity and stability of the cementing operation process. The allowable fluctuation range is determined according to the statistical upper limit of the random fluctuation of pressure and flow rate of the cement head under normal operating conditions, and is used to distinguish between normal fluctuations and abnormal deviations.
[0083] Step S2023: If the deviation is greater than or equal to the allowable fluctuation range, then based on the positive or negative direction of the deviation relative to the median and the current operation stage identifier, output the abnormal trend of the rubber plug being ahead or behind, or the valve being too open or too closed, and add the corresponding abnormal suffix to the operation stage identifier.
[0084] In this embodiment, if the deviation is greater than or equal to the allowable fluctuation range, an abnormal trend determination is triggered. First, the difference value is read, and the deviation direction is determined based on the sign of the difference. If the difference value is positive, the deviation direction is marked as positive; if the difference value is negative, the deviation direction is marked as negative. The current operation stage identifier and the deviation direction are combined to determine the abnormal trend. For example, assuming that in the plug-pressing stage, a positive deviation corresponds to the plug being blocked from descending, causing the pressure to rise relatively faster than the flow rate to decrease, the output abnormal trend type is plug lag; a negative deviation outputs an abnormal trend type as plug release abnormality pending confirmation. In the cement injection stage, a positive deviation corresponds to the plug valve opening being too large, causing pressure fluctuations, and the output valve position is too open; a negative deviation corresponds to the plug valve opening being too small or blocked, and the output valve position is closed. The matched abnormal trend type is assigned to the abnormal trend type variable, and a corresponding suffix character is added to the end of the current operation stage identifier to generate a stage identifier with an abnormal mark.
[0085] Step S3: In each control cycle of the plug valve, construct a cost function based on the current operating stage and abnormal trend type, combined with the measured values of pressure, flow rate and current. Calculate the valve opening correction amount and plug release time offset that minimize the cost function to obtain the correction parameters.
[0086] The specific steps of step S3 are as follows:
[0087] Step S301: Based on the preset expected value group, calculate the pressure deviation, flow deviation and current deviation by subtracting the measured values of pressure, flow rate and current respectively.
[0088] In this embodiment, a set of expected values is set according to the current operation stage identifier. The expected value set includes the expected pressure value, the expected flow rate value, and the expected current value. The expected pressure value is determined according to the cementing or slurry displacement pressure specified in the cementing design. The expected flow rate value is determined according to the cement slurry discharge design value. The expected current value is obtained according to the motor load characteristics when the plug valve is operating normally. The measured pressure value, the measured flow rate value, and the measured current value at the current moment after the most recent update are obtained. The pressure deviation is obtained by subtracting the expected pressure value from the measured pressure value, the flow rate deviation is obtained by subtracting the expected flow rate value from the measured flow rate value, and the current deviation is obtained by subtracting the expected current value from the measured current value. The pressure deviation, flow rate deviation, and current deviation represent the degree to which the pressure deviates from the target pressure, the degree to which the flow rate deviates from the target flow rate, and the degree to which the motor load deviates from the normal load at the current moment, respectively.
[0089] For example, assuming the current operation stage is the cementing stage, the expected pressure value is 25.0 MPa and the expected flow rate is 1.2 m³ / s. 3 The expected current is 8.5A. The actual measured pressure value obtained from the sensor at the current moment, after interpolation and alignment, is 24.2MPa, and the actual measured flow rate is 1.3m³ / min. 3The measured current was 9.8A / min. The deviation was calculated by subtracting 25.0MPa from 24.2MPa, resulting in a pressure deviation of -0.8MPa. This indicates that the actual pressure is 0.8MPa lower than the expected pressure, potentially suggesting insufficient pumping or leakage. (Using 1.3m...) 3 / min minus 1.2m 3 / min yields a flow rate deviation of +0.1m 3 / min indicates that the actual flow rate is 0.1m higher than the expected flow rate. 3 A reading of 9.8A / min may indicate that the fluid below the rubber plug is accelerating or that the valve opening is too large. Subtracting 8.5A from 9.8A gives a current deviation of +1.3A, which means that the actual motor current is 1.3A higher than the normal load, possibly indicating that the valve is obstructed or the rubber plug is stuck.
[0090] Step S302: Map the current operation stage and the abnormal trend type to numerical indices respectively, and calculate the pressure deviation, flow deviation, and current deviation by dividing the normalized value of their respective maximum allowable deviations. Obtain the deviation weighting coefficients of pressure, flow, and current through linear interpolation of neighboring points.
[0091] The specific steps of step S302 are as follows:
[0092] Step S3021: Encode the current operation stage according to its name and abnormal trend type, and calculate the stage index and trend index by combining the valve opening degree, pressure change rate and flow change rate.
[0093] The specific steps of step S3021 are as follows:
[0094] Step S30211: Based on the name of the current operation stage and the abnormal trend type, establish the stage coding sequence and the trend coding sequence respectively.
[0095] In this embodiment, the name string of the current operation stage and the abnormal trend type string are read. An integer code value is assigned to each character according to pre-stored encoding rules. The characters are arranged sequentially in the strings to construct a stage encoding sequence corresponding to the name of the current operation stage. Similarly, the code value is read character by character from the name string of the abnormal trend type, and a trend encoding sequence is constructed sequentially. The lengths of the stage encoding sequence and the trend encoding sequence are equal to the number of characters in their respective strings. The encoding rule uses, for example, a linear mapping based on the ASCII code of characters. A base value is subtracted from the ASCII code of each character. The base value is, for example, set to a small prime number, and then multiplied by a coefficient related to the cementing equipment, such as the diameter in millimeters of a plug valve or the length of a rubber plug, to ensure that the code values do not repeat between different characters. The length of the stage encoding sequence is equal to the number of characters in the stage name string.
[0096] Step S30212: The encoded value of the stage encoding sequence is sequentially multiplied by the pressure change rate, flow change rate and rubber plug position value, and all multiplications are accumulated to obtain the stage mapping value.
[0097] In this embodiment, the most recently calculated pressure change rate, flow rate change rate, and the current stopper position value are read. The stopper position value is calculated by integrating the cumulative cement slurry injection flow rate over time before the stopper downward sensor is triggered, and then dividing by the internal volume of the sleeve. The value ranges from zero to one, representing the percentage of the stopper's completed stroke. The first coded value in the stage coding sequence is multiplied by the pressure change rate to obtain the first product. The second coded value in the stage coding sequence is multiplied by the flow rate change rate to obtain the second product. The third coded value in the stage coding sequence is multiplied by the stopper position value to obtain the third product. If the stage coding sequence is longer than three, the subsequent coded values are cyclically multiplied by the pressure change rate, flow rate change rate, and stopper position value until all coded values are involved in the calculation. All product terms are accumulated to obtain the stage mapping value. The stage mapping value combines the inherent characteristics of the stage name with the real-time dynamic parameters of the current operating condition, so that even the same stage name will produce different mapping results due to different pressure change rates, flow rate change rates, and stopper position values.
[0098] Step S30213: Multiply the encoded value in the trend encoding sequence alternately with the valve opening degree, pressure change rate, and flow change rate, and sum all the multiplications to obtain the trend mapping value.
[0099] In this embodiment, the trend coding sequence and the valve opening, pressure change rate, and flow change rate at the current moment are read. The first coded value in the trend coding sequence is multiplied by the valve opening to obtain the first product. The second coded value in the trend coding sequence is multiplied by the pressure change rate to obtain the second product. The third coded value in the trend coding sequence is multiplied by the flow change rate to obtain the third product. If the length of the trend coding sequence is greater than three, the subsequent coded values are continuously multiplied alternately by the valve opening, pressure change rate, and flow change rate until all coded values in the trend coding sequence participate in the calculation. All product terms are accumulated to obtain the trend mapping value. The trend mapping value dynamically couples the trend type feature with the current valve position state and pressure and flow changes, so that the same trend type produces differentiated mapping results under different valve openings or different pressure and flow change rates, thereby improving the trend index's ability to distinguish actual working conditions.
[0100] Step S30214: Divide the stage mapping value by the length of the stage coding sequence and take the decimal part of the quotient as the stage index; divide the trend mapping value by the length of the trend coding sequence and take the decimal part of the quotient as the trend index.
[0101] In this embodiment, the stage mapping value and the length of the stage encoding sequence are read. The stage mapping value is used as the dividend, and the length of the stage encoding sequence is used as the divisor. A division operation is performed to obtain the quotient, and the decimal part of the quotient is extracted as the stage index. At the same time, the trend mapping value and the length of the trend encoding sequence are read. The trend mapping value is used as the dividend, and the length of the trend encoding sequence is used as the divisor. A division operation is performed to obtain the quotient, and the decimal part of the quotient is extracted as the trend index. Both the stage index and the trend index are limited to a range greater than or equal to zero and less than one. By compressing the discrete stage and trend information into a unified continuous interval, the need to continuously expand the coefficient dimension due to the increase in the types of stages and trends is avoided. At the same time, the differences of the original mapping values are preserved, so that the weighting coefficients can be continuously and smoothly adjusted with the changes in stages and trends.
[0102] Step S3022: Divide the pressure deviation, flow deviation, and current deviation by their respective maximum allowable deviation values to obtain the normalized values of pressure deviation, flow deviation, and current deviation.
[0103] In this embodiment, based on the maximum allowable deviation values for pressure, flow rate, and current, the pressure deviation is divided by the maximum allowable deviation value to obtain a normalized pressure deviation value; the flow rate deviation is divided by the maximum allowable deviation value to obtain a normalized flow rate deviation value; and the current deviation is divided by the maximum allowable deviation value to obtain a normalized current deviation value. Through normalization calculation, the dimensional differences of the original deviations are eliminated, and the deviations of different physical quantities are unified to a relative scale of 0 to 1, avoiding the situation where a certain deviation accounts for too much or too little of the cost function due to different dimensions. The maximum allowable deviation values for pressure, flow rate, and current are determined based on the safety margin and rated range of the actuator in cementing operations.
[0104] Step S3023: Based on the stage index and trend index, determine the numerical point that is closest to the corresponding three normalized values through preset coefficient rules, and read the value at the corresponding numerical point to calculate the weighted coefficients for pressure, flow rate and current deviation.
[0105] In this embodiment, the coefficient rule includes three independent calculation formulas, which are used to calculate the weighted coefficients for the deviations of pressure, flow rate, and current, respectively. For example, the pressure deviation weighted coefficient... The formula is: Base Item + Stage Correction Item × Stage Index + Trend Correction Item × Trend Index + Deviation Correction Item × Pressure Deviation Normalized Value. The Base Item, Stage Correction Item, Trend Correction Item, and Deviation Correction Item are set based on different abnormal trend types, corresponding actual control effects, and pressure, flow, and current deviation samples from historical cementing data, and are expressed as constants. The Stage Index, Trend Index, and Pressure Deviation Normalized Value are substituted into the formula for calculating the pressure deviation weighting coefficient. The same method is used to calculate the flow deviation weighting coefficient based on the Stage Index, Trend Index, and Flow Deviation Normalized Value. Similarly, the same method is used to calculate the current deviation weighting coefficient based on the Stage Index, Trend Index, and Current Deviation Normalized Value. These three deviation weighting coefficients are continuously adjusted as the Stage Index, Trend Index, and their respective normalized values change in real time. This ensures that when the rubber plug lags, the pressure deviation weighting coefficient automatically increases with the degree of lag to strengthen pressure control; and when the valve position is over-open, the flow deviation weighting coefficient automatically increases with the degree of over-opening to limit flow overshoot.
[0106] For example, assuming the current abnormal trend type is plug hysteresis, the weighting coefficients for pressure deviation are calculated as follows: base term 0.3, stage correction term 0.1, trend correction term 0.4, deviation correction term 0.2; weighting coefficients for flow deviation are calculated as follows: base term 0.4, stage correction term 0.1, trend correction term 0.3, deviation correction term 0.2; weighting coefficients for current deviation are calculated as follows: base term 0.5, stage correction term 0.1, trend correction term 0.2, deviation correction term 0.2; current stage index 0.37; trend index 0.82; normalized value for pressure deviation 0.65; normalized value for flow deviation 0.35; normalized value for current deviation 0.82. The weighting coefficients for pressure deviation are then calculated using the coefficient rules. Flow deviation weighting coefficient Current deviation weighting coefficient .
[0107] Step S303: Based on the weighted coefficients of the deviations of pressure, flow rate and current, and the deviations of pressure, flow rate and current, calculate the pressure term, flow rate term and current term, and construct the cost function for the current control cycle.
[0108] In this embodiment, the pressure deviation is squared, multiplied by the pressure deviation weighting coefficient, and the product is then multiplied by half to obtain the pressure term. The same method is used to calculate the flow rate and current terms. The pressure, flow rate, and current terms are summed to obtain a total value, which is used to construct the numerical expression of the cost function for the current control cycle. It should be noted that by introducing a factor of half into each term, the coefficient 2 generated after differentiating the squared terms in subsequent cost function calculations can be eliminated, thus simplifying the derivation process of the analytical solution for the correction parameters. This allows for faster online calculation of the valve opening correction and plug release time offset that minimize the cost function. Furthermore, during the calculation of the pressure, flow rate, and current terms, all multiplication operations are performed using a 32-bit floating-point format to ensure that the calculation accuracy still meets the cementing control requirements even when the numerical ranges of pressure, flow rate, and current deviations differ significantly, avoiding distortion of the proportion of the pressure, flow rate, or current terms in the cost function due to rounding errors.
[0109] Step S304: Using the valve opening correction amount and the rubber plug release time offset as variables to be determined, and substituting the predicted values of pressure, flow rate and current at future moments as the unknowns into the linear relationship, we obtain the quadratic expression of the cost function with respect to the variables to be determined.
[0110] The specific steps of step S304 are as follows:
[0111] Step S3041: Using the actual pressure value at the current moment as the pressure reference value, the actual flow rate as the flow rate reference value, and the actual current value as the current reference value, calculate the linear coefficients of the valve opening correction amount and the rubber plug release time offset for different reference values.
[0112] In this embodiment, the actual pressure, flow rate, and current values at the current moment are read as the pressure reference value, flow rate reference value, and current reference value, respectively. For the pressure reference value, linear coefficients are calculated for its effect on the valve opening correction and the rubber plug release time offset. First, a static gain coefficient and a time constant coefficient are set based on the physical characteristics of the plug valve and the rubber plug, as well as the actual operating conditions. The static gain coefficient is then linearized based on the current valve opening interval. This correction process is represented by linear interpolation calculation based on the valve opening. The corrected static gain coefficient is used as the linear coefficient for the pressure-valve opening correction. The time constant coefficient is then corrected based on the flow resistance characteristics corresponding to the current rubber plug position. The corrected time constant coefficient is used as... The linear coefficients for the pressure-to-response time offset of the rubber plug are obtained using the same method. The static gain coefficient of the flow rate to the valve and the time constant coefficient of the flow rate to the rubber plug are read from the parameter area. After correction based on the current operating conditions, the linear coefficients for the flow rate-to-valve opening correction and the flow rate-to-response time offset of the rubber plug are obtained. Similarly, the static gain coefficient of the current to the valve and the time constant coefficient of the current to the rubber plug are read from the parameter area. After correction based on the current motor load characteristics, the linear coefficients for the current-to-valve opening correction and the current-to-response time offset of the rubber plug are obtained. It should be noted that for static gain coefficients, such as the linear coefficient for the pressure-to-valve opening correction, this represents the change in pressure and flow rate when the valve opening changes by one unit. The static gain coefficient of pressure on the valve depends on the fluid resistance characteristics of the cement head manifold, while the static gain coefficient of current on the valve depends on the load characteristics of the plug valve's drive motor. This is obtained by measuring the rate of change of the current required to drive the valve under different pressure differentials. When the valve rotates against the fluid pressure, the motor current is proportional to the load torque, which in turn is related to the pressure differential across the valve. For time constant coefficients, such as the linear coefficient of pressure on the plug release time offset, this indicates the rate and magnitude of change in pressure, flow rate, or current when the plug release time changes. After the plug releases, the fluid passage opens, causing a pressure drop. The rate of pressure drop depends on fluid compressibility and pipe capacity. The pressure on the plug release time offset... The time constant coefficient of the quantity is obtained by recording the time required from the moment the pressure begins to drop to a certain scale when the rubber plug is released. After the rubber plug is released, the flow rate increases, and the rate of increase depends on the pump response and the movement speed of the rubber plug. The time constant coefficient of the flow rate with respect to the time offset of the rubber plug release is obtained by recording the flow rate rise curve and fitting the corresponding time constant coefficient. The time constant coefficient of the current with respect to the time offset of the rubber plug release is obtained by recording the transient waveform of the current when the stop pin on the cement head moves accordingly during the release of the rubber plug and the motor load changes. The valve position opening range is expressed as a percentage, from 0% to 100%, where 0% represents fully closed and 100% represents fully open.
[0113] For example, assuming the relationship between flow resistance characteristics and time constant coefficient is expressed as a ratio, the resistance is relatively small when the rubber plug position is between 0% and 20%, and the time constant coefficient for the pressure offset from the rubber plug release time is between 0.8 and 1.0. When the rubber plug position is between 20% and 80%, the resistance increases linearly, and the time constant coefficient increases from 1.0 to 1.5. The resistance is greatest when the rubber plug position is above 80%, and the time constant coefficient is between 1.5 and 2.0. The corrected time constant coefficient is obtained by calculating the sum of 1 and the correction factor and multiplying it by the time constant coefficient. The correction factor is set according to the relative position of the current pressure within the rated working pressure range of the equipment and changes monotonically with the current pressure, which physically conforms to the actual law of valve throttling effect under high pressure.
[0114] Step S3042: Multiply the linear coefficients by the valve opening correction and the rubber plug release time offset respectively to construct the pressure deviation expression, flow deviation expression and current deviation expression respectively.
[0115] In this embodiment, the linear coefficient of pressure on valve opening correction is multiplied by the valve opening correction to obtain a first product term. The linear coefficient of pressure on plug release time offset is multiplied by the plug release time offset to obtain a second product term. The first and second product terms are added to the pressure reference value to form a pressure deviation expression, which represents the predicted pressure value at a future time after applying the valve opening correction and plug release time offset. Using the same construction method, the linear coefficient of flow rate on valve opening correction is multiplied by the valve opening correction, and the linear coefficient of flow rate on plug release time offset is added. Multiplying the coefficient by the plug release time offset and adding the flow rate reference value yields the flow rate deviation expression. Multiplying the linear coefficient of the current-to-valve opening correction by the valve opening correction, adding the linear coefficient of the current-to-plug release time offset by the plug release time offset, and adding the current reference value yields the current deviation expression. These three deviation expressions correlate the two desired correction values with the predicted pressure, flow rate, and current values at future times, enabling the cement head controller to pre-assess the impact of different correction combinations on the system state, thereby achieving proactive dynamic adjustment and avoiding pressure or flow rate exceeding limits due to blind correction.
[0116] Step S3043: Square the pressure deviation expression, flow deviation expression, and current deviation expression respectively, multiply them by the corresponding pressure deviation weighting coefficient, flow deviation weighting coefficient, and current deviation weighting coefficient, and add them together to obtain a quadratic expression for the valve opening correction amount and the rubber plug release time offset.
[0117] In this embodiment, the pressure deviation expression for the future time is obtained by subtracting the expected pressure value from the pressure deviation expression; the flow deviation expression for the future time is obtained by subtracting the expected flow value from the flow deviation expression; and the current deviation expression for the future time is obtained by subtracting the expected current value from the current deviation expression. The pressure deviation expression is squared, multiplied by a pressure deviation weighting coefficient, and then multiplied by half to obtain a quadratic expression for the pressure term. Similarly, the flow deviation expression is squared, multiplied by a flow deviation weighting coefficient, and then multiplied by half to obtain a quadratic expression for the flow term. The current deviation expression is squared, multiplied by a current deviation weighting coefficient, and then multiplied by half to obtain a quadratic expression for the current term. The quadratic expressions for the pressure, flow, and current terms are added together to obtain the sum for the valve opening. The quadratic expressions for the correction amount and the rubber plug release time offset are expanded and merged to form the square term coefficients of the valve opening correction amount, the square term coefficients of the rubber plug release time offset, the cross product term coefficients of the two, the linear term coefficients, and the constant term. These coefficients are extracted and stored to form a bivariate quadratic function, which has a unique minimum point. By calculating the partial derivatives of the bivariate quadratic function with respect to the valve opening correction amount and the rubber plug release time offset, and setting them to zero, the optimal correction amount that minimizes the combined deviation of pressure, flow rate, and current at future moments is obtained. This allows pressure fluctuations, flow rate fluctuations, and mechanical load fluctuations during the cementing process to be suppressed to the lowest level, improving the smoothness of rubber plug movement and the accuracy of cement slurry injection.
[0118] Step S305: Calculate the partial derivatives of the quadratic expression with respect to the valve opening correction and the rubber plug release time offset, and set them to zero. Solve the equations simultaneously to obtain the optimal correction parameters.
[0119] In this embodiment, the coefficients of the quadratic expression with respect to the valve opening correction, the quadratic coefficient with respect to the stopper release time offset, the coefficient of the cross product of the valve opening correction and the stopper release time offset, the coefficient of the linear term with respect to the valve opening correction, the coefficient of the linear term with respect to the stopper release time offset, and the constant term are extracted. These six coefficients are assigned to six temporary variables. The partial derivative of the quadratic expression with respect to the valve opening correction is taken, keeping the stopper release time offset constant. The coefficient of the quadratic term of the valve opening correction is multiplied by two and then multiplied by the valve opening correction to obtain the first term. The coefficient of the cross product term is multiplied by the stopper release time offset to obtain the second term. Finally, the coefficient of the linear term of the valve opening correction is used as the third term. First, add the first, second, and third terms together and set the sum to zero to form the first equation. Next, take the partial derivative of the quadratic expression with respect to the plug release time offset, keeping the valve opening correction constant during differentiation. Multiply the coefficient of the quadratic term of the plug release time offset by two and then by the plug release time offset again to obtain the fourth term. Multiply the coefficient of the cross-product term by the valve opening correction to obtain the fifth term. Then, take the coefficient of the linear term of the plug release time offset as the sixth term. Add the fourth, fifth, and sixth terms together and set the sum to zero to form the second equation. This gives us a system of two linear equations in two variables concerning the valve opening correction and the plug release time offset. Multiply the first equation by twice the coefficient of the quadratic term of the plug release time offset, specifically written as A11. Valve opening correction amount A12 rubber stopper release time offset B1 and A21 Valve opening correction amount A22 rubber stopper release time offset B2, where A11 represents the quadratic coefficient of the valve opening correction (twice the original value), A12 represents the cross-product coefficient, B1 represents the linear coefficient of the negative valve opening correction, A21 represents the cross-product coefficient, A22 represents the quadratic coefficient of the rubber stopper release time offset (twice the original value), and B2 represents the linear coefficient of the negative rubber stopper release time offset. Calculate the determinant value D. A11 A22 A12 A21. If the absolute value of D is less than the preset minimum allowable threshold, it indicates that the equation system is close to singular under the current operating condition. Solving it alone may lead to excessive correction. In this case, both the valve opening correction and the rubber plug release time offset are set to zero to avoid drastic fluctuations in the control output. If the absolute value of D is greater than or equal to the minimum allowable threshold, then the determinant D1 is calculated separately. B1 A22 A12 B2, determinant D2 A11 B2 B1 A21, dividing D1 by D yields the valve opening correction, and dividing D2 by D yields the plug release time offset. These are the optimal correction parameters that minimize the cost function. The valve opening correction is added to the current actual valve opening value to determine if it exceeds the mechanical limit of the valve opening. If it does, it is limited to the limit boundary, and the plug release time offset is recalculated. Similarly, the plug release time offset is checked to see if it exceeds the time adjustment window allowed by the operation process. If it does, it is limited to the window boundary. Finally, the valve opening correction and plug release time offset, after being processed, are output as the correction parameters for this control cycle. This allows the cement head controller to accurately adjust subsequent valve actions and plug release timing based on these two parameters, thereby finding the optimal balance between pressure fluctuations, flow fluctuations, and mechanical load fluctuations. This improves the consistency of cementing quality and reduces the probability of complex downhole situations caused by improper operation. The minimum allowable threshold is set to a small positive number to ensure that when the two equations are linearly related, no invalid or excessive correction amount is output.
[0120] Step S4: The corrected parameters are superimposed into the cement head operation control process to generate the next control cycle execution command for cementing operation control.
[0121] The specific steps of step S4 are as follows:
[0122] Step S401: Add the correction parameter to the valve opening reference value and the rubber plug release time reference value recorded at the start of the current control cycle, respectively, to obtain the valve opening command value and the rubber plug release time command value.
[0123] In this embodiment, at the beginning of each control cycle, the actual valve opening value saved at the end of the previous control cycle is obtained and used as the valve opening reference value for the current control cycle. Simultaneously, the theoretical value of the rubber plug release time preset in the current operation process is used as the rubber plug release time reference value. The valve opening correction amount and rubber plug release time offset are read from the correction parameters. The valve opening correction amount and the valve opening reference value are added together. If the valve opening correction amount is negative, a valve opening command value less than the valve opening reference value is obtained. The valve opening command value is compared with the minimum and maximum opening limits allowed by the valve's mechanical structure. If the command value is less than the minimum opening limit, it is forcibly set to the minimum opening limit; if it is greater than the maximum opening limit, it is forcibly set to the maximum opening limit, ensuring the valve opening command value is within acceptable limits. The command value is always within the safe operating range. The rubber plug release time offset is added to the rubber plug release time reference value, which is stored as a hardware timer count. Similarly, the rubber plug release time command value is checked within a time window to ensure it is not earlier than the current time and not later than the latest release time allowed by the workflow. If it exceeds the window, it is limited to the window boundary. The valve opening command value, after being limited, is written to the valve control register in floating-point format, and the rubber plug release time command value is written to the comparison register in 32-bit integer format. The theoretical value of the rubber plug release time is set at the point when the cement slurry injection ends or begins to replace the drilling fluid, to ensure that the rubber plug can effectively scrape the cement slurry from the casing wall and achieve pressure. For example, for a 3000-meter well, if the displacement rate is 1.5m³... 3 / min, the rubber stopper descent time may be 15~30 minutes.
[0124] Step S402: Convert the valve opening command value into a voltage signal to control the actuator of the plug valve to rotate, write the plug release time command value into the controller of the cement head control system, and control the plug by outputting a trigger pulse.
[0125] In this embodiment, the valve opening command value is read from the valve control dedicated register. This value represents the desired valve opening as a percentage and is sent to the digital-to-analog converter (DAC). The DAC's internal reference voltage is set, for example, to 10V, corresponding to 100% valve opening. Therefore, the valve opening command value is divided by 100 and multiplied by 10V to obtain the target analog voltage value; for example, 38.0% opening corresponds to 3.80V. The DAC converts the digital quantity into a continuously changing analog voltage signal according to a set conversion rate, and outputs it to the analog input of the plug valve's servo driver via a shielded cable. At the port, after the servo driver receives the voltage signal, its internal comparison circuit compares this voltage with the actual voltage returned by the valve's current opening feedback potentiometer, generating a deviation signal. This deviation signal, after power amplification, drives a DC motor. The motor, through a reduction mechanism, rotates the valve stem of the plug valve, causing the valve opening to change towards the commanded value. Simultaneously, the valve opening feedback potentiometer continuously converts the actual opening into voltage and sends it back to the servo driver. The motor stops when the deviation between the actual opening and the valve opening command value is less than the dead zone. The plug release time command value is then read from the comparison register. The controller on the cement head has a hardware timer that continuously increments its count by one thousand units per millisecond. The value in the comparison register is compared with the current count of the hardware timer. When the hardware timer's count reaches or exceeds the rubber plug release command value stored in the comparison register, the comparison circuit outputs a high-level trigger signal. This trigger signal, after isolation and amplification, is sent to the solenoid valve coil of the stop pin actuator through the digital output port. The solenoid valve is energized, opening the hydraulic circuit and pushing the stop pin to quickly pull it out from under the rubber plug. After losing support, the rubber plug... The cement slurry pressure drives the downward movement of the cement head. The width of the trigger pulse is controlled by a hardware timer to ensure that the solenoid valve has enough time to complete the withdrawal of the stop pin before automatically cutting off the power. This avoids damage to the coil due to overheating from prolonged energization. By converting the valve opening command value into the actual mechanical position of the valve and the rubber plug release time command value into the actual time of stop pin withdrawal, the theoretical correction is reliably applied to the cement head physical equipment, enabling dynamic adjustment of the entire operation process. This effectively reduces the risk caused by delays or execution errors due to manual intervention. It should be noted that the cement head can be manually controlled by a portable PC.
[0126] exist Figure 3In this system, the wellhead controller can be connected to a portable PC remote control wirelessly or via wired connection, such as RS422 or LoRa wireless, with application layer communication protocols such as SMARTWELLBUS and communication protocols such as MODBUS, using LoRa or RS422 links. The portable PC remote control also uses wireless or wired connection to communicate with the backend PC server, such as via Wi-Fi or RJ45 network port, with communication protocols such as JSON command format, which is convenient for matching the JSON command format of the IoT MQTTS protocol. The operation process is that the operator controls the wellhead controller with the PC remote control or the backend PC server controls the wellhead controller.
[0127] Example 2
[0128] Please see Figure 4 One embodiment of the present invention provides an intelligent control system for cement head operations, comprising a sensing module, an anomaly detection module, a compensation and correction module, and a control module.
[0129] The sensing module is used to collect operational data during the cement head injection process, generate a working condition vector aligned with a unified time axis, and calculate the real-time pressure-flow ratio based on the working condition vector.
[0130] The anomaly detection module is used to compare the real-time ratio with the preset stage characteristic range, and combine the rubber plug position with the valve opening of the plug valve to determine the current operation stage and the type of abnormal trend.
[0131] The compensation and correction module is used to construct a cost function based on the current operating stage and abnormal trend type in each control cycle of the plug valve, combined with the measured values of pressure, flow rate and current. The correction parameters are obtained by calculating the valve opening correction amount and the plug release time offset that minimize the cost function.
[0132] The control module is used to superimpose the correction parameters into the cement head operation control process and generate the execution command for the next control cycle to control the cementing operation.
[0133] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.
[0134] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of the present invention without departing from the spirit and scope of the present invention, and all of these modifications are within the scope of protection of the present invention.
Claims
1. An intelligent control method for cementing head operations, characterized in that, include: Collect operational data during the cement head injection process, align it with a unified time axis to generate an operational condition vector, and calculate the real-time pressure-flow ratio based on the operational condition vector; The real-time ratio is compared with the preset stage characteristic range, and the current operation stage and abnormal trend type are determined by combining the position of the rubber plug and the valve opening of the plug valve. In each control cycle of the plug valve, a cost function is constructed based on the current operating stage and the type of abnormal trend, combined with the measured values of pressure, flow and current. The correction parameters are obtained by calculating the valve opening correction amount and the plug release time offset that minimize the cost function. The corrected parameters are superimposed into the cement head operation control process to generate the execution command for the next control cycle to control the cementing operation.
2. The intelligent control method for cement head operation according to claim 1, characterized in that, The data collected during the cementing head injection process is aligned with a unified time axis to generate a working condition vector. The real-time pressure-to-flow ratio is calculated based on this working condition vector, including: Collect the current value of the plug valve drive motor, the valve opening percentage, the pipeline pressure value, the sensor signal of the rubber plug downward movement, the cement slurry density and flow data, and generate a sampling data set; For parameters with inconsistent sampling times in the sampled data set, linear interpolation is performed using two adjacent sampled values to calculate the corresponding value at the current time and combine them to generate a working condition vector; Based on the latest collected pipeline pressure and flow data, calculate the difference between it and the corresponding value collected previously, and divide it by the time difference between the two collections to obtain the pressure change rate and flow change rate. The pressure change rate is divided by the flow rate change rate to obtain the real-time ratio of the pressure change rate to the flow rate change rate.
3. The intelligent control method for cement head operation according to claim 1, characterized in that, The process of comparing the real-time ratio with a preset stage characteristic range, combined with the position of the rubber stopper and the valve opening of the stopcock, to determine the current operating stage and the type of abnormal trend includes: The real-time ratio is compared sequentially with the upper and lower limits of the preset stage feature range corresponding to each work stage to determine the range in which the real-time ratio falls and to record the corresponding work stage identifier. The median of the characteristic range of the stage is used as a reference benchmark, and the absolute value of the difference between the ratio and the real-time value is used as the deviation. The operation stage and abnormal trend are correlated and processed based on the comparison between the deviation and the preset allowable fluctuation range.
4. The intelligent control method for cement head operation according to claim 3, characterized in that, The process of using the median of the stage characteristic range as a reference benchmark and calculating the absolute value of the difference between the median and the real-time ratio as the deviation, and then performing correlation processing between the operation stage and abnormal trends based on the comparison between the deviation and the preset allowable fluctuation range, includes: If the real-time ratio is greater than the median, the median is subtracted from the real-time ratio; if the real-time ratio is less than the median, the real-time ratio is subtracted from the median. The absolute value of the difference is taken as the deviation. Compare the deviation with the allowable fluctuation range. If the deviation is less than the allowable fluctuation range, the current operation stage is determined to be stable and without abnormalities. If the deviation is greater than or equal to the allowable fluctuation range, then based on the positive or negative direction of the deviation relative to the median and the current operation stage identifier, the abnormal trend of the rubber plug being ahead or behind, or the valve being too open or too closed will be output, and the corresponding abnormal suffix will be added to the operation stage identifier.
5. The intelligent control method for cement head operation according to claim 1, characterized in that, In each control cycle of the plug valve, a cost function is constructed based on the current operating stage and the type of abnormal trend, combined with the measured values of pressure, flow rate, and current. Correction parameters are obtained by calculating the valve opening correction amount and the plug release time offset that minimize the cost function, including: Based on the preset expected value set, the pressure deviation, flow deviation and current deviation are calculated by subtracting the measured values of pressure, flow rate and current respectively. The current operation stage and abnormal trend type are mapped to numerical indices respectively. At the same time, the pressure deviation, flow deviation, and current deviation are calculated by dividing the normalized value by their respective maximum allowable deviations. The deviation weighting coefficients of pressure, flow, and current are obtained by linear interpolation of neighboring points. Based on the weighted coefficients of the deviations of pressure, flow rate, and current, and the deviations of pressure, flow rate, and current, the pressure term, flow rate term, and current term are calculated, and the cost function of the current control cycle is constructed. By substituting the valve opening correction and the rubber plug release time offset as variables to be determined, and using the predicted values of pressure, flow rate and current at future moments as unknowns as linear relationships, we obtain a quadratic expression for the cost function with respect to the variables to be determined. Calculate the partial derivatives of the quadratic expression with respect to the valve opening correction and the rubber stopper release time offset, and set them to zero. Solve the equations simultaneously to obtain the optimal correction parameters.
6. The intelligent control method for cement head operation according to claim 5, characterized in that, The process involves mapping the current operational stage and abnormal trend type to numerical indices, calculating the normalized values of pressure deviation, flow rate deviation, and current deviation divided by their respective maximum allowable deviations, and obtaining the deviation weighting coefficients for pressure, flow rate, and current through linear interpolation of nearest neighbor points. This includes: The current operation stage is coded according to its name and abnormal trend type. The stage index and trend index are calculated by combining the valve opening degree, pressure change rate and flow change rate. Divide the pressure deviation, flow deviation, and current deviation by their respective maximum allowable deviation values to obtain the normalized values for pressure deviation, flow deviation, and current deviation. Based on the stage index and trend index, the numerical point that is closest to the corresponding three normalized values is determined by the preset coefficient rules, and the value at the corresponding numerical point is read to calculate the weighted coefficients of pressure, flow and current deviation.
7. The intelligent control method for cement head operation according to claim 6, characterized in that, The encoding process, based on the name of the current operation stage and the type of abnormal trend, combined with valve opening degree, pressure change rate, and flow change rate, yields a stage index and a trend index, including: Based on the name of the current operation stage and the type of abnormal trend, establish stage coding sequences and trend coding sequences respectively; The encoded value of the stage coding sequence is sequentially multiplied by the pressure change rate, flow change rate, and rubber plug position value, and all multiplications are summed to obtain the stage mapping value; The coded values in the trend coding sequence are sequentially multiplied by the valve opening, pressure change rate, and flow change rate, and all multiplications are summed to obtain the trend mapping value. Divide the stage mapping value by the length of the stage coding sequence and take the decimal part of the quotient as the stage index. Divide the trend mapping value by the length of the trend coding sequence and take the decimal part of the quotient as the trend index.
8. The intelligent control method for cement head operation according to claim 5, characterized in that, The process involves using the valve opening correction and the rubber plug release time offset as variables to be determined, and substituting the predicted future pressure, flow rate, and current values as unknowns into a linear relationship to obtain a quadratic expression for the cost function with respect to these two variables, including: Using the actual pressure value at the current moment as the pressure reference value, the actual flow rate as the flow rate reference value, and the actual current value as the current reference value, calculate the linear coefficients of the valve opening correction amount and the rubber plug release time offset for different reference values. By multiplying the linear coefficient by the valve opening correction and the rubber plug release time offset respectively, we can construct the pressure deviation expression, flow deviation expression, and current deviation expression respectively. By squaring the pressure deviation expression, flow rate deviation expression, and current deviation expression respectively, multiplying them by the corresponding pressure deviation weighting coefficient, flow rate deviation weighting coefficient, and current deviation weighting coefficient, and then summing them, we obtain a quadratic expression for the valve opening correction amount and the rubber plug release time offset.
9. The intelligent control method for cement head operation according to claim 1, characterized in that, The process of overlaying the corrected parameters into the cement head operation control flow to generate the execution command for the next control cycle for cementing operation control includes: The correction parameters are added to the valve opening reference value and the rubber plug release time reference value recorded at the beginning of the current control cycle, respectively, to obtain the valve opening command value and the rubber plug release time command value. The valve opening command value is converted into a voltage signal to control the actuator of the plug valve to rotate. The command value of the rubber plug release time is written into the controller of the cement head control system, and the rubber plug is controlled by outputting a trigger pulse.
10. An intelligent control system for cementing head operations, comprising implementing the intelligent control method for cementing head operations as described in any one of claims 1-9, characterized in that, It includes a perception module, an anomaly detection module, a compensation and correction module, and a control module: The sensing module is used to collect operation data during the cement head injection process, generate a working condition vector aligned with a unified time axis, and calculate the real-time pressure-flow ratio based on the working condition vector. The anomaly detection module is used to compare the real-time ratio with the preset stage characteristic range, and combine the rubber plug position with the valve opening of the plug valve to determine the current operation stage and the type of anomaly trend. The compensation and correction module is used to construct a cost function in each control cycle of the plug valve based on the current operating stage and the type of abnormal trend, combined with the measured values of pressure, flow and current. By calculating the valve opening correction amount and the plug release time offset that minimize the cost function, the correction parameters are obtained. The control module is used to superimpose the correction parameters into the cement head operation control process and generate the execution command for the next control cycle to control the cementing operation.