Multiphase flow rate and pressure adjusting method based on decoupling control
By constructing the BP neural network model and combining the PID control algorithm, the problem of slow adjustment speed in the traditional multiphase flow adjustment method is solved, and the rapid and precise adjustment of the multiphase flow flow and pressure is achieved, which improves the control accuracy and stability.
Patent Information
- Application Number
- CN202310612461.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-27
- Publication Date
- 2024-11-29
AI Technical Summary
Traditional multiphase flow and pressure adjustment methods cannot achieve fast and precise adjustment, and the adjustment speed is slow, mainly because traditional PID controllers cannot effectively deal with the time lag caused by multivariable systems and nonlinear behavior.
Using a decoupling control method, a BP neural network model including input layer, intermediate layer and output layer is constructed, and the system parameters and feedback parameters of the PID controller are used as inputs and outputs. Combined with the PID control algorithm, the neural network model is trained. Adjust the parameters of the PID controller to realize automatic adjustment of multi-phase flow flow and pressure.
The decoupled control signal reduces interference between different phases, adapts to multivariable, highly nonlinear and time-varying, improves the accuracy and stability of valve control, and achieves rapid and precise adjustment of multiphase flow flow and pressure.
Smart Images

Figure CN119045577A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of gas-liquid two-phase and oil-gas-water multiphase flow, and specifically to a method for automatically and quickly regulating the flow rate and pressure of a multiphase flow. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.
[0003] Automatic adjustment of the flow rate and pressure of the multiphase flowmeter standard device is a key link to improve the calibration efficiency of the standard device, increase uncertainty, and realize intelligent calibration of the flowmeter. With the development of big data and artificial intelligence technology, a solution combining various coupling and prediction models has been proposed for the multi-parameter coupling problem of multiphase flow. Through the modeling and solution of the oil, gas and water three-phase flow mixture, a three-phase dynamic model considering pressure fluctuations is established based on the fluid volume-discrete unit coupling model. By solving the momentum equation, the two-way coupling of the three-phase fluid and pressure is realized, and the pressure and flow of the oil, gas and water multiphase flow device are automatically, accurately and efficiently adjusted. In past studies, the multiphase flow system is usually regarded as a whole because there are great challenges in modeling and control.
[0004] At present, the traditional method for automatic regulation of multiphase flow and pressure is mainly based on the PID controller of the mathematical model, in which the mathematical model is established by the empirical formula. In the multiphase flow system, the interference between the phases in the multiphase flow will cause the flow between adjacent phases to be coupled, and the traditional PID controller cannot handle the multivariable system, which will affect the measurement and control accuracy of the single component of the PID controller. In addition, the complexity of multiphase flow is mainly due to its nonlinear behavior, so in the multiphase flow system, there is often a large time lag phenomenon, and the traditional PID controller can only reflect the current control state, but cannot directly consider the influence of the lag phenomenon, resulting in slow flow and pressure regulation.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may contain information that does not constitute prior art. Summary of the invention
[0006] In view of this, the present disclosure provides a multiphase flow rate and pressure regulation method based on decoupling control to solve the problem that traditional multiphase flow rate and pressure regulation methods cannot achieve fast and accurate regulation and have slow regulation speed.
[0007] To achieve the above-mentioned purpose of the invention, the multiphase flow rate and pressure regulation method based on decoupling control includes:
[0008] Constructing a BP neural network model including an input layer, an intermediate layer and an output layer, using the set system parameters and the output feedback parameters of the PID controller control system as neurons of the input layer, and using the proportional gain, integral time constant and differential time constant of the PID controller as neurons of the output layer;
[0009] The neural network model is combined with the control algorithm of the PID controller to train the neural network, and the trained PID controller is used to regulate the multiphase flow rate and pressure.
[0010] In the present disclosure and possible embodiments, the system parameters are fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal and phase content; and the feedback parameters are system error and interval error.
[0011] In the present disclosure and possible embodiments, the neural network establishes a 32×2 weight matrix through 9 neurons in the input layer, 32 neurons in the middle layer, and 3 neurons in the output layer, and the initial weight matrix is established using random numbers.
[0012] In the present disclosure and possible embodiments, the neural network is trained using existing samples in a database, wherein the data in the database include fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal, phase content, and system error and interval error of a PID controller.
[0013] In the present disclosure and possible embodiments, the output signal of the neural network PID controller is normalized and adjusted to between 0 and 1.
[0014] In the present disclosure and possible embodiments, the normalization formula is:
[0015] d(t)=k+kpu(t)+ki∫0 τ u(τ)dτ+kddtdu(t)
[0016] Among them, k is the middle position of the valve duty cycle, kp, ki, kd are the output layer parameters of the above neural network, and u(τ) is the output value of the above PID controller.
[0017] In the present disclosure and possible embodiments, the normalized output signal is converted into a duty cycle, and the valve opening value is adjusted using the duty cycle.
[0018] The present disclosure has the following beneficial effects:
[0019] The multiphase flow and pressure regulation method based on decoupling control disclosed in the present invention establishes an artificial neural network model and combines it with a PID control algorithm, and utilizes the trained neural network model to decouple multiple variables of the multiphase flow. The decoupled control signal can reduce the interference between different phases and the influence of variables such as the flow and pressure of each phase, and can better adapt to actual working conditions for controlling the flow and pressure of the multiphase flow, and handle the multivariable, highly nonlinear and time-varying nature of the multiphase flow, minimize the mutual interference between various parameters between the phases and the flow and pressure to be controlled, realize multivariable decoupling control under complex flow conditions, and improve the control accuracy and stability of the valve, thereby achieving the purpose of precise control of the multiphase flow and pressure; and the decoupled control signal weakens the influence of many disturbances, thereby reducing the time required for the control process, and achieving the purpose of automatic and rapid regulation of the multiphase flow and pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0021] Figure 1 It is a design principle diagram of the multiphase flow rate and pressure regulation method based on decoupling control disclosed in the present invention. DETAILED DESCRIPTION
[0022] The present disclosure is described below based on embodiments, but it is worth noting that the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. However, for the parts that are not described in detail, those skilled in the art can also fully understand the present disclosure.
[0023] At the same time, unless the context clearly requires otherwise, the words "include", "comprises" and similar words throughout the specification and claims should be interpreted as inclusive rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".
[0024] In order to solve the problem of limited regulation accuracy and slow regulation speed of traditional multiphase flow and pressure regulation methods, the design principle of the present invention is as follows: Figure 1 As shown:
[0025] An initial neural network model is built according to the PID adjustment algorithm and the values of various parameters of the multiphase flow meter. The neural network is embedded in the PID adjustment process, and the PID controller is adjusted by the output parameters of the neural network, thereby achieving the purpose of fast and accurate adjustment of flow and pressure.
[0026] Based on the above invention concept, and drawing on the conventional technical means in this field, the technical solution design ideas of the present invention are as follows:
[0027] In order to ensure the accuracy and scalability of neural network training, a database required for multiphase flow and pressure control model is established. The above database collects the actual operating parameters of the oil, gas and water multiphase flow meter standard during the adjustment process. The fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal, phase content and the above neural network PID controller control system output feedback parameters: system error e(k), interval error Δe(k) are used as the nine neuron parameters of the neural network input layer. The nine neuron parameters are decoupled through the neural network. The activation function ReLU function is used in the training process, and the decoupled output of each neuron parameter in the above input layer is realized through the above forward transfer. The decoupled kp, ki, and kd fitting values are used as the three neuron parameter values of the output layer of the neural network, and kp, ki, and kd are input into the PID controller to control the output signal output, and the signal is converted according to the valve opening range. The converted signal is used as the valve opening value to adjust the flow.
[0028] After the three neuron parameters of the output layer are fitted each time, the back propagation algorithm is used to calculate the gradient of each parameter. Among them, the random inactivation algorithm is used, and the neurons are randomly inactivated each time the forward calculation is trained. In the error transmission process, the algorithm uses the chain rule to calculate the contribution of each parameter to the error, so as to obtain the gradient of each parameter. Finally, the parameters are updated according to the gradient. After the parameters are updated, the next round of neural network training is carried out using the next sample in the above database, and finally the optimal neural network is obtained. The above optimal neural network can realize the decoupling of the nine neuron parameters of the input layer and output the fitting values of the three neuron parameters of the decoupled output layer. The standard root mean square error is used as a loss function for network adjustment to evaluate the network control performance during the control process, and the network structure is adjusted according to the evaluation results to achieve the expected results.
[0029] Combined with the above model, the characteristics of complex interactions and unpredictable flow properties of multiphase flow can be overcome; using the neural network model, the nine neuron parameters of the complex input layer of the multiphase flow are decoupled by forward transmitting and training the above weight matrix, and the three neuron parameters kp, ki, and kd of the output layer after decoupling by the above neural network are input into the PID controller, and the PID controller is converted to control the valve, thereby realizing a method for automatic and rapid adjustment of multiphase flow and pressure.
[0030] Example
[0031] according to Figure 1The design principle of the multiphase flow rate and pressure regulation method based on decoupling control of the present invention is shown. The multiphase flow rate and pressure regulation method based on decoupling control specifically adopted in the embodiment of the present invention includes: step S10: constructing a BP neural network model including an input layer, an intermediate layer and an output layer, using the set system parameters and the output feedback parameters of the PID controller control system as the neurons of the input layer, and using the proportional gain, integral time constant and differential time constant of the PID controller as the neurons of the output layer; step S20: combining the neural network model with the control algorithm of the PID controller and training the neural network, and using the trained PID controller to regulate the multiphase flow rate and pressure.
[0032] Specifically, the adjustment method of the embodiment of the present disclosure is further explained.
[0033] Step S10: construct a BP neural network model including an input layer, an intermediate layer and an output layer, using the set system parameters and the output feedback parameters of the PID controller control system as neurons of the input layer, and using the proportional gain, integral time constant and differential time constant of the PID controller as neurons of the output layer, as follows:
[0034] 1. Establish the input layer of the three-layer BP neural network. The input layer contains 9 neurons. These 9 neurons contain 7 system parameters: fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal, phase content, and the neural network PID controller controls the system output with 2 feedback parameters: system error e(k) and interval error Δe(k).
[0035] 2. The proportional gain kp, integral time constant ki and differential time constant kd are used as the three neuron parameters of the output layer of the neural network. These three neuron parameters of the output layer are used as the flow pressure control signals of the PID controller.
[0036] After being decoupled by the trained neural network, these three neuron parameters can be used as control signals to independently control the three phase flow valves of oil, gas and water, so that when controlling one of the valves, it will not be affected by other phases and variables.
[0037] 3. Establish the weight matrix between the input layer and the middle layer, and between the middle layer and the output layer of the BP neural network model; specifically, establish a 32×2 weight matrix through 9 neurons in the input layer, 32 neurons in the middle layer, and 3 neurons in the output layer, and the initial weight matrix is established using random numbers.
[0038] The ReLU function is used as the activation function in the forward propagation process, which can decouple the parameters in the above input layer and output the three neuron parameters in the above output layer.
[0039] Step S20: combining the neural network model with the control algorithm of the PID controller and training the neural network, and using the trained PID controller to regulate the multiphase flow rate and pressure, as follows:
[0040] 1. The kp, ki, and kd parameters of the output layer of the neural network model in step S10 are used as the input of the PID controller, and the output signal of the PID controller is controlled by these three parameters; because the output signal is a decoupled control signal, it can help the system cope with complex situations and speed up control.
[0041] 2. Normalize the output signal of the PID controller to adapt to the valve opening range.
[0042] Because the output signal of the neural network PID controller cannot be used directly to control the valve, the signal needs to be normalized and adjusted to between 0 and 1 to adapt to the valve opening range, so as to adjust the flow through the valve actuator. The normalization formula used is as follows:
[0043] d(t)=k+kpu(t)+ki∫0 τ u(τ)dτ+kddtdu(t);
[0044] Among them, k is the middle position of the valve duty cycle, kp, ki, kd are the output layer parameters of the neural network, and u(τ) is the output value of the PID controller.
[0045] As a preferred solution of the present invention, conventional technical means in the art are further used to convert the normalized signal into a duty cycle, and the duty cycle is used to adjust the valve opening value to perform flow regulation.
[0046] 3. Train the neural network.
[0047] (1) In order to ensure the accuracy of the neural network fitting results, a large amount of experimental data is required for neural network training. For this purpose, a database required for the multiphase flow control training model is established. Specifically, a multiphase flow meter test device is used to conduct flow control experiments, and the required data is screened to establish a multi-parameter database; the database collects the actual operating parameters collected by the sensors of the oil, gas and water multiphase flow meter standard device during the adjustment process, and saves these parameters through the MySQL database management system. The above database specifically includes the fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal, phase content, and neural network PID controller control system output feedback parameters: system error e(k) and interval error Δe(k).
[0048] (2) Use the existing data in the above database to train the above neural network PID controller. The specific training process is as follows:
[0049] The embodiments of the present disclosure may train the neural network by conventional techniques in the art, and the present disclosure does not impose any particular limitation thereto, as long as any existing neural network training method is applicable to the neural network established by the embodiments of the present disclosure.
[0050] The training of neural networks can usually be divided into two steps: one is forward propagation and the other is back propagation. The forward propagation of the neural network starts from the input layer to the output layer: forward propagation starts from the input layer (Layer 1) and passes the input feature x to the output layer. i , is linearly transformed by multiplying it with the weight matrix W and adding the bias term b:
[0051] z=Wx i +b
[0052] Then the above result z is used as the input of the activation function ReLU to obtain the output a after activation, and the results of each layer of the neural network are continuously calculated to finally obtain the output. In the forward calculation process, the input features are decoupled and output, and the decoupled network output layer data is obtained as the control signal source.
[0053] Back propagation is to calculate the partial derivatives (gradients) of the weights and bias terms of each layer in the opposite direction based on the loss function mean square error MSE. During the error transmission process, the algorithm uses the chain rule to calculate the contribution of each parameter to the error, thereby obtaining the gradient of each parameter. Finally, according to the gradient optimization algorithm Adam, the mean and variance of the gradient are calculated, the gradient is corrected, and finally the weights and bias terms are updated. The core is the chain derivation rule of the loss L for each parameter of each layer.
[0054] Each time, a fixed number of data from the above database is selected to be input into the model for training. A random deactivation algorithm is used in the training. During the forward calculation of each training, the neurons are randomly deactivated to obtain the fitting values of the output layer parameters. The random deactivation algorithm can prevent overfitting of the system. The standard root mean square error is used as a loss function to judge the fitting ability of the neural network PID controller on the test set after the training of the above database data, and an early stopping mechanism is adopted. If there is no obvious change in the loss during training, the training is terminated and the weight is saved. The decoupling information is correspondingly saved in the weight matrix after training. The decoupled output signal can avoid the influence of other variables on the corresponding valve of the currently controlled phase flow, thereby speeding up the control of the device.
[0055] 4. The trained neural network is used to collect the input layer parameters under the current working conditions. The parameters of the nine neurons in the corresponding input layer are input into the neural network model. The three neuron parameters in the output layer are fitted through the neural network. The fitted output parameters are input into the PID controller. The valve is controlled through the conversion to achieve flow and pressure control.
[0056] The present invention adopts the above scheme, establishes an artificial neural network model and combines it with the PID control algorithm. Through neural network decoupling and PID control, the multivariable, highly nonlinear and time-varying properties of multiphase flow are processed, which can better adapt to actual working conditions and minimize the mutual interference between various parameters between phases and the flow pressure to be controlled. It realizes multivariable decoupling control under complex flow conditions and improves accuracy and stability.
[0057] The above-described embodiments are only embodiments of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present disclosure. It should be noted that, for a person of ordinary skill in the art, without departing from the concept of the present disclosure, several variations, equivalent substitutions, improvements, etc. may be made, all of which fall within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the attached claims.
Claims
1. A multiphase flow rate and pressure regulation method based on decoupling control, characterized in that: include: Constructing a BP neural network model including an input layer, an intermediate layer and an output layer, using the set system parameters and the output feedback parameters of the PID controller control system as neurons of the input layer, and using the proportional gain, integral time constant and differential time constant of the PID controller as neurons of the output layer; The neural network model is combined with the control algorithm of the PID controller to train the neural network, and the trained PID controller is used to regulate the multiphase flow rate and pressure.
2. The multiphase flow rate and pressure regulation method based on decoupling control according to claim 1 is characterized in that: The system parameters are fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal and phase content; the feedback parameters are system error and interval error.
3. The multiphase flow rate and pressure regulation method based on decoupling control according to claim 2 is characterized in that: The neural network establishes a 32×2 weight matrix through 9 neurons in the input layer, 32 neurons in the middle layer and 3 neurons in the output layer, and the initial weight matrix is established using random numbers.
4. The multiphase flow rate and pressure regulation method based on decoupling control according to claim 3 is characterized in that: The neural network is trained using samples already in a database, wherein the data in the database include fluid density, fluid viscosity, fluid temperature, fluid velocity, fluid pressure, flow meter output signal, phase content, and system error and interval error of a PID controller.
5. The multiphase flow rate and pressure regulation method based on decoupling control according to claim 4 is characterized in that: The output signal of the neural network PID controller is normalized and adjusted to between 0 and 1.
6. The multiphase flow rate and pressure regulation method based on decoupling control according to claim 5 is characterized in that: The normalization formula is: <h2 style=";text-align:left;direction:ltr">d(t) = k + kpu + ki ∫ 0<h2 style=";text-align:left;direction:ltr"> τ <h2 style=";text-align:left;direction:ltr"> u(τ)d+kddtdu(t) Among them, k is the middle position of the valve duty cycle, kp, ki, kd are the output layer parameters of the above neural network, and u(τ) is the output value of the above PID controller.
7. The multiphase flow rate and pressure regulation method based on decoupling control according to claim 6 is characterized in that: The normalized output signal is converted into a duty cycle, and the valve opening value is adjusted using the duty cycle.
