Flow control method, device, electronic device and storage medium for mass flow meter
By monitoring the fluid characteristic data and dynamically optimizing the PID parameters and combining it with feedforward compensation, the control instability problem within a small flow range is solved, achieving higher precision and more stable flow control.
Patent Information
- Application Number
- CN202510797024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-06-16
AI Technical Summary
In the case of low flow, the mass flowmeter in the prior art cannot adapt to the changes in the dynamic characteristics of the fluid due to the fixed parameter PID control algorithm, resulting in unstable control, affecting the measurement accuracy and control effect.
By monitoring the fluid's characteristic data such as viscosity, temperature, and pressure, the PID parameters are dynamically optimized, and the optimal PID parameter combination is output in combination with the machine learning model to achieve closed-loop control. The PID controller output is adjusted in advance in combination with the feedforward compensation amount.
It improves the flow control stability and measurement accuracy within a small flow range, reduces measurement noise and control delay, and achieves more precise flow control.
Smart Images

Figure CN120295378B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of flow control technology, and in particular to a flow control method, device, electronic device and storage medium for a mass flow meter. Background Art
[0002] In various industrial applications, accurately controlling and measuring the mass flow of fluids is crucial to improving production efficiency and product quality. Mass flow meters in related technologies often use fixed-parameter PID control algorithms. While these algorithms can meet the control requirements of conventional flow ranges, they are significantly inadequate for low flow rates. For example, when the flow rate is less than 5% (or more) of the device's full scale, the fixed parameters cannot adapt to changes in the fluid's dynamic characteristics, resulting in overshoot or delayed response. The flow control accuracy is often limited by the device's sensitivity and the limitations of the control algorithm, leading to unstable control and thus affecting the overall measurement accuracy and control effect. Therefore, there is an urgent need for a mass flow meter control method that can dynamically optimize control parameters to address the shortcomings of existing technologies in low-flow control and improve control accuracy and stability. Summary of the Invention
[0003] In order to solve the above technical problems, the present application provides a flow control method, device, electronic device and storage medium for a mass flow meter.
[0004] In the first aspect, the present application provides a flow control method for a mass flowmeter, including: monitoring a first mass flow rate of a target fluid at a first moment, and determining whether the first mass flow rate is less than a preset flow threshold; when the first mass flow rate is less than the preset flow threshold, switching to a low flow control mode; in the low flow control mode, dynamically optimizing PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, wherein the set of characteristic data includes at least viscosity data of the target fluid, temperature data of the target fluid, and pressure data of the target fluid; and performing closed-loop control of the flow rate of the target fluid based on a set of PID control parameters.
[0005] By adopting the above technical solution, it is possible to switch to a small flow control mode under low flow conditions based on the comparison result of the first mass flow rate of the target fluid and the preset flow threshold. Specifically, the PID parameters are dynamically optimized based on a set of characteristic data of the target fluid, and then the flow rate of the target fluid is closed-loop controlled using the optimized set of PID control parameters. This can solve the problem of limited control accuracy of the fixed parameter PID control algorithm in a small flow range in related technologies, thereby achieving the effect of improving the stability of flow control.
[0006] Optionally, after performing closed-loop control on the flow of the target fluid based on a set of PID control parameters, the above method also includes: obtaining a second mass flow data set of the target fluid within the target time length, wherein the second mass flow data set includes the mass flow of the target fluid at multiple second moments, and the second moment is a moment later than the first moment and after the dynamic optimization of the PID parameters; when the second mass flow data set meets the preset conditions, exiting the low flow control mode.
[0007] By adopting the above technical solution, the second mass flow data set within the target time is obtained. When the data set meets the preset conditions, the low flow control mode is exited. The control mode can be flexibly switched according to the flow conditions, thereby improving the flow control stability and measurement accuracy within the small flow range. At the same time, the low flow control mode can be exited according to the flow status to achieve more reasonable flow control.
[0008] Optionally, when the second mass flow data set meets preset conditions, the low flow control mode is exited, including at least one of the following: when the mass flows included in the second mass flow data set are all greater than or equal to the preset flow threshold, and the target time length is greater than or equal to the preset time length threshold, the low flow control mode is exited; when the mass flows included in the second mass flow data set are all greater than or equal to the preset flow threshold, and the flow fluctuation standard deviation of the target fluid determined according to the second mass flow data set is less than the preset fluctuation threshold, the low flow control mode is exited.
[0009] By adopting the above technical solution, when the mass flow rates in the second mass flow data set are all greater than or equal to the preset flow threshold and the target time length is greater than or equal to the preset time length threshold, or when the mass flow rates in the second mass flow data set are all greater than or equal to the preset flow threshold and the flow fluctuation standard deviation of the target fluid determined according to the second mass flow data set is less than the preset fluctuation threshold, the low flow control mode is exited. This can achieve precise control of the small flow range of the mass flowmeter, avoid control instability problems caused by measurement noise and control delay, and at the same time, exit the low flow control mode in time when certain conditions are met, optimize the control process, and improve the overall measurement accuracy and control effect.
[0010] Optionally, PID parameters are dynamically optimized based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, including: using a trained machine learning model, inputting a set of characteristic data, a first mass flow rate and a target set flow rate, and outputting a recommended PID parameter combination; and determining the recommended PID parameter combination as a set of PID control parameters.
[0011] By adopting the above technical solution and utilizing a trained machine learning model, a set of characteristic data of the target fluid, a first mass flow rate, and a target set flow rate are input, and the recommended PID parameter combination can be dynamically output and determined as a set of PID control parameters. Finally, the target fluid flow rate is closed-loop controlled based on the set of PID control parameters. This can avoid the problems of unstable control and low measurement accuracy in a small flow range caused by the use of a fixed-parameter PID control algorithm in related technologies, and achieve more accurate and stable flow control in a small flow range.
[0012] Optionally, the machine learning model is trained in the following manner: obtaining a historical data set, wherein the historical data set includes multiple groups of mass flow sample data, each group of mass flow sample data includes viscosity data, temperature parameters, pressure parameters, actual flow, set flow and corresponding PID control parameters of a fluid; dividing the historical data set into a training set and a validation set; using the training set to train the initial model, using the validation set to evaluate the performance of the initial model, and adjusting the hyperparameters of the initial model to optimize the model performance; when the performance index of the initial model on the validation set reaches a preset threshold, ending the training, and using the initial model obtained at the end of the training as the machine learning model.
[0013] By adopting the above technical solution, the machine learning model is trained using the historical data set obtained containing characteristic data such as viscosity, temperature, and pressure, and the PID control parameters are dynamically optimized to perform closed-loop control of the target fluid flow. This can improve the flow control accuracy of the mass flow meter under a small flow range, reduce the impact of measurement noise and control delay, and make the control more stable; the initial model hyperparameters are evaluated and adjusted using the validation set to ensure that the model’s performance indicators on the validation set reach the preset threshold and serve as the final model, which can ensure the accuracy and reliability of the recommended PID parameter combination output by the machine learning model.
[0014] Optionally, the flow rate of the target fluid is closed-loop controlled based on a set of PID control parameters, including: obtaining a feedforward compensation amount based on a set of characteristic data of the target fluid and system operating condition data, wherein the feedforward compensation amount is used to compensate for the output of the PID controller; adjusting the output item of the PID controller in advance based on the feedforward compensation amount, and performing closed-loop control of the flow rate of the target fluid based on a set of PID control parameters.
[0015] By adopting the above technical solution, the feedforward compensation amount is obtained based on the characteristic data of the target fluid and the system operating condition data to compensate the PID controller output, the PID controller output item is adjusted in advance, and the target fluid flow is closed-loop controlled based on a set of PID control parameters. This can achieve more accurate and stable flow control for fluids in a small flow range, thereby improving the overall measurement accuracy and control effect.
[0016] Optionally, a feedforward compensation amount is obtained based on a set of characteristic data of the target fluid and system operating condition data, including: determining a first feedforward control item based on a set of characteristic data, and determining a second feedforward control item based on the system operating condition data, wherein the feedforward compensation amount includes the first feedforward control item and the second feedforward control item, the first feedforward control item is used to represent a first compensation amount for the temperature change of the target fluid to the output of the PID controller, the set of characteristic data includes the temperature data of the target fluid, the second feedforward control item is used to represent a second compensation amount for the ambient pressure change to the output of the PID controller, and the system operating condition data includes the ambient pressure data.
[0017] By adopting the above technical solution, the first feedforward control item is calculated based on the temperature data of the target fluid, and is used to compensate for the influence of temperature changes on the output of the PID controller. The second feedforward control item is calculated based on the ambient air pressure data, and is used to compensate for the influence of air pressure changes on the output of the PID controller. By respectively determining the compensation amount for the output of the PID controller due to the temperature change of the target fluid and the ambient air pressure change, the influence of measurement noise and control delay is effectively reduced, the flow control stability in a small flow range is improved, and the overall measurement accuracy and control effect are thereby improved.
[0018] Optionally, a first feedforward control item is determined based on a set of characteristic data, including: determining a first flow change value ΔQ1=a×ΔT based on the temperature change of the target fluid in the following manner, wherein a is the temperature coefficient and ΔT is the temperature change value of the target fluid; determining a first feedforward control item u1=k1×ΔQ1 according to the first flow change value in the following manner, wherein k1 is a first feedforward control gain; determining a second feedforward control item based on the system operating condition data, including: determining a second flow change value ΔQ2=b×ΔP based on the temperature change of the target fluid in the following manner, wherein b is the pressure coefficient and ΔP is the change value of the ambient air pressure data; determining a second feedforward control item u2=k2×ΔQ2 according to the second flow change value in the following manner, wherein k2 is a second feedforward control gain.
[0019] By adopting the above technical solution, the first flow change value is determined according to the formula based on the target fluid temperature change and the first feedforward control item is obtained. The second flow change value is determined according to the formula based on the ambient air pressure change and the second feedforward control item is obtained. The PID controller output can be compensated in advance and closed-loop control can be achieved, thereby solving the problem of unstable control in a small flow range, improving measurement accuracy and control effect, and at the same time, based on the second mass flow data set obtained subsequently, it is determined to exit the small flow control mode, thereby achieving flexible and efficient flow control.
[0020] In the second aspect of the present application, a flow control device of a mass flowmeter is also provided, including: a monitoring module, used to monitor a first mass flow rate of the target fluid at a first moment, and determine whether the first mass flow rate is less than a preset flow threshold; a switching module, used to switch to a small flow control mode when the first mass flow rate is less than the preset flow threshold; an optimization module, used to dynamically optimize PID parameters based on a set of characteristic data of the target fluid in the small flow control mode to obtain a set of PID control parameters, wherein the set of characteristic data includes at least viscosity data of the target fluid, temperature data of the target fluid and pressure data of the target fluid; a control module, used to perform closed-loop control of the flow rate of the target fluid based on a set of PID control parameters.
[0021] In a third aspect of the present application, an electronic device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor implements any one of the above method steps when executing the program.
[0022] In a fourth aspect of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium stores instructions. When the instructions are executed, any one of the above method steps is performed.
[0023] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages:
[0024] 1. Dynamically optimize PID parameters based on a set of characteristic data of the target fluid, and then use the optimized set of PID control parameters to perform closed-loop control on the flow of the target fluid. This can solve the problem of limited control accuracy of fixed parameter PID control algorithms in related technologies in a small flow range, making flow control more stable and improving overall measurement accuracy and control effect;
[0025] 2. It can flexibly switch the control mode according to the flow situation, improve the flow control stability and measurement accuracy within the small flow range, and can exit the small flow control mode according to the flow status to achieve more reasonable flow control;
[0026] 3. Based on the characteristic data of the target fluid and the system operating data, the feedforward compensation is obtained to compensate the PID controller output, the PID controller output item is adjusted in advance, and the target fluid flow is closed-loop controlled based on a set of PID control parameters. This can achieve more accurate and stable flow control for fluids in a small flow range, thereby improving the overall measurement accuracy and control effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of a flow control method of a mass flow meter provided in an embodiment of the present application;
[0028] Figure 2This is a schematic diagram of an improved PID control provided by an embodiment of the present application;
[0029] Figure 3 This is a structural block diagram of a flow control device of a mass flow meter provided in an embodiment of the present application;
[0030] Figure 4 This is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
[0031] Description of reference numerals: 400 - electronic device; 401 - processor; 402 - communication bus; 403 - user interface; 404 - network interface; 405 - memory. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0033] In the description of the embodiments of this application, words such as "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "for example" or "for instance" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "for example" or "for instance" is intended to present the relevant concepts in a concrete manner.
[0034] In the description of the embodiments of the present application, the term "plurality" means two or more. In addition, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprise," "have" and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0035] This application provides a flow control method for a mass flow meter, referring to Figure 1 , Figure 1 : is a flow chart of a flow control method of a mass flow meter provided in an embodiment of the present application, the method comprising:
[0036] Step S101, monitoring a first mass flow rate of a target fluid at a first moment, and determining whether the first mass flow rate is less than a preset flow rate threshold;
[0037] Step S102: When the first mass flow rate is less than a preset flow rate threshold, switching to a low flow rate control mode;
[0038] Step S103, in the low flow control mode, dynamically optimizing PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, wherein the set of characteristic data at least includes viscosity data of the target fluid, temperature data of the target fluid, and pressure data of the target fluid;
[0039] Step S104 , performing closed-loop control on the flow rate of the target fluid based on a set of PID control parameters.
[0040] Through the above steps, according to the comparison result of the first mass flow rate of the target fluid and the preset flow threshold, the low flow control mode can be switched to under low flow conditions. Specifically, the PID parameters are dynamically optimized based on a set of characteristic data of the target fluid, and then the flow rate of the target fluid is closed-loop controlled using the optimized set of PID control parameters. This can solve the problem of limited control accuracy of the fixed parameter PID control algorithm in a small flow range in the related art, thereby achieving the effect of improving the stability of flow control.
[0041] By monitoring the first mass flow rate of the target fluid, it is determined whether it is less than a preset flow rate threshold. If the first mass flow rate is less than the preset flow rate threshold, the system switches to a low-flow control mode. In the low-flow control mode, a set of characteristic data of the target fluid is used to dynamically optimize the PID parameters, and closed-loop control is performed based on the optimized PID parameters. The set of characteristic data includes the viscosity data, temperature data, and pressure data of the target fluid. The preset flow rate threshold can be 5% (or other values) of the full scale of the mass flow meter. Within the low-flow range, the fixed parameters of the PID control algorithm in related technologies are often difficult to adapt to complex changes in fluid characteristics and are easily affected by noise and delay. By introducing the characteristic data of the fluid (such as viscosity, temperature, and pressure) to dynamically optimize the PID parameters, the needs of low-flow control can be better met. In low-flow control mode, the proportional (P), integral (I), and differential (D) parameters of the PID controller are dynamically adjusted using an optimization algorithm (such as an adaptive control algorithm) using characteristic data such as the target fluid's viscosity, temperature, and pressure. Alternatively, a trained machine learning model can be used to generate an optimal set of PID control parameters. The machine learning model can be trained based on a large number of mass flow sample data sets. For example, the mass flow sample data set can include data on a variety of different fluid characteristics, actual flow rates, target flow rates, and corresponding PID control parameters. The machine learning model can establish a mapping relationship between different combinations of fluid characteristic data and PID parameter combinations. The optimized PID parameters can better adapt to changes in fluid characteristics within a low-flow range, thereby improving control accuracy and stability. Mass flow meters are typically equipped with actuators (such as valves and pumps) and feedback sensors. Combined with a controller, closed-loop control based on dynamic PID parameters can be achieved. Fluid characteristic data (viscosity, temperature, and pressure) are used to dynamically adjust the PID controller's proportional coefficient P (or Kp), integral time I (or Ti), and differential time D (or Td) to adapt to the impact of fluid characteristic changes on the control model at low flow rates. In this embodiment, the target fluid can be a liquid or a gas. This embodiment dynamically optimizes PID parameters to better adapt to changes in fluid properties within a small flow range, significantly improving control accuracy. The dynamic optimization method based on fluid property data can adapt to different fluid properties and operating conditions and has wide applicability. By precisely controlling fluid flow within a small flow range, it can improve production efficiency and product quality, and reduce resource waste and production defects caused by inaccurate flow control. By adjusting control parameters in real time to match fluid properties, the control error in the small flow range can be reduced to less than 50% of the conventional PID. Assuming a conventional error of ±3%, it can be reduced to ±1.5% after optimization. This reduces control oscillations caused by fluctuations in fluid properties (such as changes in viscosity due to temperature changes), improving stability in small flow scenarios.
[0042] Suppose a chemical production process requires precise control of the flow rate of a high-viscosity fluid with a flow rate range between 0.1 kg / h and 10 kg / h. Within this small flow range (e.g., less than 5% of the equipment's full-scale range), traditional fixed-parameter PID control algorithms struggle to achieve high-precision control and are susceptible to measurement noise and control delay. At a certain moment (the first moment), the monitored mass flow rate of the target fluid is 0.3 kg / h. Assuming the equipment's full-scale range is 10 kg / h, the flow rate at this moment is less than 5% of the full-scale range (i.e., 0.5 kg / h). The preset flow threshold is 0.5 kg / h, placing it within the low flow range. The system automatically switches to low-flow control mode. In low-flow control mode, the system collects a set of characteristic data for the target fluid, such as a viscosity of 1000 mPa·s (or 1000 cP), a temperature of 30°C, and a pressure of 1.5 bar. The system uses this characteristic data to dynamically calculate PID control parameters using a preset optimization algorithm (such as one based on an empirical formula or machine learning model). Assume the optimized PID parameters are: proportional coefficient (P) = 2.5, integral coefficient (I) = 0.1, and differential coefficient (D) = 0.5. The system performs closed-loop control of the target fluid flow based on these optimized PID parameters. The specific operation is as follows: Set the target flow rate, assuming it is 0.4 kg / h; Monitor and adjust the flow rate in real time. The system monitors the flow rate in real time and adjusts the fluid flow rate based on the output of the PID controller. For example, if the monitored flow rate is below 0.4 kg / h, the PID controller increases the output signal and adjusts the valve opening to bring the flow rate closer to the target value. Before optimizing the PID parameters, the system used fixed parameters (P=1.0, I=0.05, D=0.1) for control, resulting in large flow fluctuations and a control error of ±0.1 kg / h. After switching to low-flow control mode, the dynamically optimized PID parameters (P=2.5, I=0.1, D=0.5) reduced the flow control error to ±0.02 kg / h, significantly improving control accuracy. It should be noted that this is only an example.
[0043] In an optional embodiment, after performing closed-loop control on the flow of the target fluid based on a set of PID control parameters, the above method further includes: obtaining a second mass flow data set of the target fluid within a target time length, wherein the second mass flow data set includes the mass flow of the target fluid at multiple second moments, the second moment being a moment later than the first moment and after the dynamic optimization of the PID parameters; and exiting the low flow control mode when the second mass flow data set meets the preset conditions.
[0044] In the above embodiment, a second mass flow data set within the target time is obtained, and the low flow control mode is exited when the data set meets the preset conditions. The control mode can be flexibly switched according to the flow conditions, thereby improving the flow control stability and measurement accuracy within the small flow range. At the same time, the low flow control mode can be exited according to the flow status to achieve more reasonable flow control.
[0045] After completing closed-loop control of the target fluid flow rate through dynamically optimized PID parameters, a second mass flow data set is continuously collected within the target duration, and flow data at multiple moments is recorded. By analyzing this second mass flow data set, it is determined whether the flow has returned to stability or reached the normal flow level. When the data set meets the preset conditions, such as the flow rate is continuously above the threshold and maintained for a sufficient period of time, or the flow fluctuation standard deviation is less than the set value, it indicates that the system has left the low-flow condition or the control has stabilized. At this time, the low-flow control mode is exited and switched back to the normal control mode, avoiding excessive use of the low-flow control parameters in non-essential scenarios. Avoiding excessive use of the low-flow control mode reduces the frequency of actuator operation, extends the service life of the equipment, and reduces maintenance costs and energy consumption. That is, in the low-flow control mode, precise control is achieved through dynamic optimization of PID parameters. During the control process, the system continuously monitors the fluid mass flow data. When the flow rate gradually increases and stabilizes to a certain level, it determines whether to exit the low-flow control mode by determining whether the second mass flow data set meets the preset conditions. This process embodies a data-driven dynamic control strategy that can flexibly adjust the control mode according to actual operating conditions. By monitoring the second mass flow data set and determining whether the preset conditions are met, the system can flexibly switch between low-flow control mode and conventional control mode, avoiding unnecessary complexity; promptly exiting the low-flow control mode after the flow returns to normal can reduce the waste of computing resources and improve the overall operating efficiency of the system; by flexibly switching control modes, optimal control can be achieved within different flow ranges, further improving production efficiency and product quality.
[0046] Taking the above-mentioned preset flow threshold of 0.5kg / h as an example, after dynamically optimizing the PID parameters and performing closed-loop control for a period of time (target duration, for example, 10 minutes), the system collects mass flow data of the target liquid at multiple second moments to form a second mass flow data set. Assume that the second mass flow data set is as follows: 2nd minute (0.42kg / h), 4th minute (0.45kg / h), 6th minute (0.48kg / h), 8th minute (0.52kg / h), 10th minute (0.55kg / h), then determine whether the second mass flow data set meets the preset conditions, and then determine whether to exit the low flow control mode. In actual applications, when exiting the low flow control mode, you can enter the normal control mode and use a fixed-parameter PID algorithm for flow control, such as calling a pre-stored PID parameter group for flow control.
[0047] In an optional embodiment, when the second mass flow data set meets the preset conditions, the low flow control mode is exited, including at least one of the following: when the mass flows included in the second mass flow data set are all greater than or equal to the preset flow threshold, and the target time length is greater than or equal to the preset time length threshold, the low flow control mode is exited; when the mass flows included in the second mass flow data set are all greater than or equal to the preset flow threshold, and the flow fluctuation standard deviation of the target fluid determined according to the second mass flow data set is less than the preset fluctuation threshold, the low flow control mode is exited.
[0048] In the above embodiment, when the mass flow rates in the second mass flow data set are all greater than or equal to the preset flow threshold and the target time length is greater than or equal to the preset time length threshold, or when the mass flow rates in the second mass flow data set are all greater than or equal to the preset flow threshold and the flow fluctuation standard deviation of the target fluid determined according to the second mass flow data set is less than the preset fluctuation threshold, the small flow control mode is exited, which can achieve precise control of the small flow range of the mass flowmeter, avoid control instability problems caused by measurement noise and control delay, and at the same time, exit the small flow control mode in time when certain conditions are met, optimize the control process, and improve the overall measurement accuracy and control effect.
[0049] If, within the target duration, all mass flow data are greater than or equal to the preset flow threshold, and the target duration is greater than or equal to the preset duration threshold, the flow is considered to have stabilized within the normal range and the low-flow control mode can be exited. If all mass flow data are greater than or equal to the preset flow threshold and the standard deviation of the target fluid's flow fluctuation is less than the preset fluctuation threshold, the flow is considered to have stabilized and the low-flow control mode can be exited. The first exit condition is determined based on the absolute flow value and duration, while the second exit condition is determined based on the absolute flow value and flow stability. This avoids the problem of misjudgment due to instantaneous flow fluctuations, which can lead to frequent mode switching, when exiting based on a single flow threshold. The comprehensive judgment mechanism can flexibly adjust the exit conditions according to actual operating conditions, making the system more adaptable and suitable for different industrial scenarios. Through more accurate exit condition judgment, the low-flow control mode can be exited promptly after the flow returns to normal, reducing unnecessary complexity and improving the overall efficiency of the system. It can also effectively prevent frequent mode switching and premature or late exits, reduce overshoot and oscillation during the control process, and maintain the stability of system operation.
[0050] Taking the above-mentioned preset flow threshold of 0.5 kg / h as an example, assuming the second mass flow data set is as follows: the 2nd minute (0.52 kg / h), the 4th minute (0.55 kg / h), the 6th minute (0.58 kg / h), the 8th minute (0.60 kg / h), and the 10th minute (0.62 kg / h), all mass flow data are greater than or equal to 0.5 kg / h, and the target duration is 10 minutes, meeting the above-mentioned first exit condition; the average flow rate is 0.57 kg / h, and the calculated flow fluctuation standard deviation σ = 0.03 kg / h. Assuming the preset fluctuation threshold is 0.03 kg / h, this also meets the above-mentioned second exit condition. Based on the above data, the system meets either the first exit condition or the second exit condition, so the system will exit the low-flow control mode and switch back to the normal control mode.
[0051] In an optional embodiment, PID parameters are dynamically optimized based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, including: using a trained machine learning model, inputting a set of characteristic data, a first mass flow rate, and a target set flow rate, and outputting a recommended PID parameter combination; and determining the recommended PID parameter combination as a set of PID control parameters.
[0052] In the above embodiment, a trained machine learning model is used to input a set of characteristic data of the target fluid, a first mass flow rate, and a target set flow rate, and the recommended PID parameter combination can be dynamically output and determined as a set of PID control parameters. Finally, the target fluid flow rate is closed-loop controlled based on the set of PID control parameters. This can avoid the problems of unstable control and low measurement accuracy in a small flow range caused by the use of a fixed-parameter PID control algorithm in related technologies, and achieve more accurate and stable flow control in a small flow range.
[0053] The target fluid's characteristic data (e.g., viscosity, temperature, pressure), current mass flow rate (first mass flow rate), and target set flow rate are input into a trained machine learning model. Based on the input data, the machine learning model outputs a recommended PID parameter combination, which is then used as the actual PID control parameters. By learning the complex relationship between fluid characteristics and PID parameters from historical data, the machine learning model can dynamically adjust the PID parameters based on real-time input data, thereby achieving more precise flow control. The machine learning model of this embodiment simultaneously considers fluid characteristics (e.g., viscosity, temperature, and pressure data), the current flow state (e.g., the first mass flow rate), and the control target (e.g., the target set flow rate). Through multi-parameter collaborative optimization, it online outputs a PID parameter combination that matches the current operating conditions. This embodiment uses machine learning technology to exploit the complex nonlinear relationship between fluid characteristics, real-time flow rate, and optimal PID parameters. An initial machine learning model (e.g., a neural network, random forest, etc.) is trained by collecting historical datasets containing fluid characteristic data such as viscosity, temperature, and pressure, as well as actual flow rate, set flow rate, and optimal PID parameters under corresponding operating conditions. In low-flow control mode, the real-time collected fluid characteristic data, the current first mass flow rate, and the target set flow rate are input into the trained model. Based on the learned mapping relationship, the model outputs a PID parameter combination (proportional coefficient P, integral time I, differential time D) that is adapted to the current operating conditions and uses it as the actual control parameter to achieve dynamic optimization and adaptive adjustment of the PID parameters. The machine learning model can automatically learn the control laws under different fluid characteristics and operating conditions, and can adapt to changes in characteristics such as temperature and viscosity without human intervention, significantly improving the system's adaptive control capabilities under complex and changing operating conditions. Instead of the traditional manual trial-and-error parameter adjustment method, the model trained based on historical data can quickly output the optimal PID parameter combination, greatly shortening the system debugging time under new operating conditions and improving engineering application efficiency. By training the model with a large amount of historical data, it is possible to learn the complex relationship between fluid characteristics and PID parameters, thereby achieving more accurate parameter optimization; the machine learning model can dynamically adjust PID parameters according to real-time input data, has stronger adaptability, and can cope with complex working conditions; the introduction of machine learning technology enables the system to have learning and prediction capabilities, improves the intelligence level of the system, and provides a more efficient technical means for industrial automation control; through the dynamic optimization of PID parameters by machine learning models, it can better adapt to changes in fluid characteristics within a small flow range and significantly improve control accuracy.
[0054] In an optional embodiment, the machine learning model is trained in the following manner: obtaining a historical data set, wherein the historical data set includes multiple groups of mass flow sample data, each group of mass flow sample data includes viscosity data, temperature parameters, pressure parameters, actual flow, set flow and corresponding PID control parameters of a fluid; dividing the historical data set into a training set and a validation set; using the training set to train the initial model, using the validation set to evaluate the performance of the initial model, and adjusting the hyperparameters of the initial model to optimize the model performance; when the performance index of the initial model on the validation set reaches a preset threshold, ending the training, and using the initial model obtained at the end of the training as the machine learning model.
[0055] In the above embodiment, the machine learning model is trained using the acquired historical data set containing characteristic data such as viscosity, temperature, and pressure, and the PID control parameters are dynamically optimized to perform closed-loop control of the target fluid flow rate, which can improve the flow control accuracy of the mass flow meter under a small flow range, reduce the impact of measurement noise and control delay, and make the control more stable; the initial model hyperparameters are evaluated and adjusted using the validation set to ensure that the model is used as the final model after the performance indicators on the validation set reach the preset threshold, which can ensure the accuracy and reliability of the recommended PID parameter combination output by the machine learning model.
[0056] Acquire a historical data set containing multiple sets of mass flow sample data, each set of data including fluid viscosity, temperature, pressure, actual flow rate, set flow rate, and corresponding PID control parameters. For example, collect optimal PID parameters (obtained through expert manual tuning or system identification) under different operating conditions of temperature (20-60°C), pressure (0.1-0.5 MPa), and flow rate (10-50 mL / min), forming 1000 (or 10,000) sets of samples, such as temperature (35°C), pressure (0.2 MPa), viscosity (320 mPa.s), actual flow rate (25 mL / min), set flow rate (25 mL / min), and optimal PID parameters (P=0.85, I=10, D=2). This is only an exemplary set of sample data, and the historical data set may also include mass flow sample data with more different fluid characteristics, including the corresponding optimal PID parameter combination, as well as sample data that is not the optimal PID parameter combination. The historical data set is divided into a training set and a validation set. The training set is used for model training, and the validation set is used to evaluate model performance. The initial model is trained using the training set, and the model performance is evaluated using the validation set. According to the evaluation results of the validation set, the hyperparameters of the model are adjusted to optimize the performance. When the performance indicators of the model on the validation set reach the preset threshold, the training is terminated, and the final model is used as the machine learning model. That is, historical samples containing fluid properties (viscosity, temperature, pressure), flow status (actual flow, set flow) and corresponding PID parameters are collected to form a multidimensional input-output data set. The data set is divided into a training set and a validation set, which are used for model learning and generalization ability evaluation respectively. By iteratively optimizing the model hyperparameters (such as learning rate, tree depth, etc.), the error between the predicted PID parameters and the actual optimal parameters is minimized. When the performance of the model on the validation set (such as mean square error, R 2 When the value) reaches a preset threshold, training is stopped to ensure that the model is neither overfitting nor underfitting. In this way, the model can learn the complex relationship between fluid properties and PID parameters, thereby achieving precise parameter optimization. This embodiment trains the model with a large amount of historical data, which can learn the complex relationship between fluid properties and PID parameters, thereby achieving more precise parameter optimization; through the division of training sets and validation sets, as well as the evaluation of performance indicators, the reliability and stability of the model can be ensured, avoiding overfitting or underfitting problems; the machine learning model can dynamically adjust the PID parameters according to real-time data, has stronger adaptive capabilities, and can cope with complex changes in working conditions.
[0057] In an optional embodiment, the flow rate of the target fluid is closed-loop controlled based on a set of PID control parameters, including: obtaining a feedforward compensation amount based on a set of characteristic data of the target fluid and system operating condition data, wherein the feedforward compensation amount is used to compensate for the output of the PID controller; adjusting the output item of the PID controller in advance based on the feedforward compensation amount, and performing closed-loop control of the flow rate of the target fluid based on a set of PID control parameters.
[0058] In the above embodiment, a feedforward compensation amount is obtained based on the characteristic data of the target fluid and the system operating condition data to compensate for the PID controller output, the PID controller output item is adjusted in advance, and the target fluid flow is closed-loop controlled based on a set of PID control parameters. This can achieve more accurate and stable flow control for fluids in a small flow range, thereby improving the overall measurement accuracy and control effect.
[0059] Based on the characteristic data of the target fluid (such as viscosity, temperature, and pressure) and system operating data (such as environmental conditions and equipment status), a feedforward compensation is calculated. This feedforward compensation is used to compensate the output of the PID controller to adjust the control signal in advance. The calculated feedforward compensation is applied to the output of the PID controller to adjust the PID controller output in advance. Based on the feedforward compensation, the flow rate of the target fluid is closed-loop controlled in combination with the dynamically optimized PID control parameters. Feedforward compensation can predict and compensate for possible disturbances in advance, reducing the hysteresis of feedback control, thereby improving the response speed and stability of the control system. Related technologies cannot predict and compensate for disturbances in advance based on system operating conditions and fluid characteristics, resulting in reduced control accuracy. This embodiment uses feedforward compensation to adjust the output of the PID controller in advance, reducing the hysteresis of feedback control and improving the response speed of the control system. Feedforward compensation can effectively reduce the impact of disturbances on the system and, combined with the optimized PID parameters, further improve the stability of the control system. By combining feedforward control and closed-loop control, the flow rate of the target fluid can be more accurately controlled, especially within a small flow range, significantly improving control accuracy. This embodiment adopts the principle of feedforward-feedback composite control, introducing a feedforward compensation mechanism based on PID closed-loop control. PID control in related technologies relies on feedback information and reacts slowly to sudden disturbances, resulting in poor control effectiveness. Feedback control alone cannot effectively respond to known external disturbances or internal changes, and can easily lead to overshoot or oscillation. The feedforward compensation mechanism allows adjustments to be made before disturbances occur, significantly shortening the system's response time and reducing control delays. Preemptive compensation for known interference factors (such as temperature changes and air pressure changes) makes the control system more resilient to external disturbances and internal changes, maintaining high control accuracy. In applications with extremely high precision requirements, such as low-flow control, feedforward compensation can significantly reduce errors caused by fluid characteristics or environmental changes, improving overall control quality. Combining feedforward compensation with PID feedback control avoids the overshoot or oscillation that can result from relying solely on feedback control, making the system more stable and reliable.
[0060] In an optional embodiment, a feedforward compensation amount is obtained based on a set of characteristic data of the target fluid and system operating condition data, including: determining a first feedforward control item based on a set of characteristic data, and determining a second feedforward control item based on the system operating condition data, wherein the feedforward compensation amount includes the first feedforward control item and the second feedforward control item, the first feedforward control item is used to represent a first compensation amount for the temperature change of the target fluid to the output of the PID controller, the set of characteristic data includes the temperature data of the target fluid, the second feedforward control item is used to represent a second compensation amount for the ambient pressure change to the output of the PID controller, and the system operating condition data includes the ambient pressure data.
[0061] In the above embodiment, the first feedforward control item is calculated based on the temperature data of the target fluid and is used to compensate for the influence of temperature changes on the output of the PID controller. The second feedforward control item is calculated based on the ambient air pressure data and is used to compensate for the influence of air pressure changes on the output of the PID controller. By respectively determining the compensation amount for the output of the PID controller due to the temperature change of the target fluid and the ambient air pressure change, the influence of measurement noise and control delay is effectively reduced, the flow control stability in a small flow range is improved, and the overall measurement accuracy and control effect are improved.
[0062] For the temperature data of the target fluid, by establishing a correlation model between temperature change and flow change, the first feedforward control item is calculated to compensate for the impact of changes in fluid properties (such as viscosity and density) caused by temperature change on flow control; temperature change refers to the change in temperature at the current moment relative to the system's preset reference temperature; for the ambient air pressure data, a corresponding relationship between air pressure change and flow change is constructed to obtain the second feedforward control item to offset the interference of ambient air pressure fluctuations on fluid pressure balance and flow; air pressure change refers to the change in ambient air pressure at the current moment relative to the system's preset reference ambient air pressure; after superimposing these two feedforward control items, they are used as the total feedforward compensation to pre-adjust the PID controller output, and work in conjunction with PID feedback control to achieve precise control of flow. Compensation is generated in advance based on temperature and pressure changes, and adjustments are made before disturbances actually affect flow. Compared with traditional feedback control, response time is shortened by approximately 40%, achieving fast and stable flow control. By introducing a feedforward compensation mechanism based on temperature and pressure changes, corresponding adjustments can be made before disturbances occur, greatly shortening the system's response time and reducing control delays. Preemptive compensation for known interference factors (such as temperature changes, pressure changes, etc.) makes the control system more resistant to external disturbances and internal changes, maintaining high control accuracy. This strategy can flexibly adapt to different fluid characteristics and environmental conditions. Whether in high-temperature and high-pressure scenarios or environments with frequent pressure changes, the feedforward control items can be dynamically adjusted to ensure that the mass flow meter maintains good control performance under all operating conditions. Figure 2 This is a schematic diagram of an improved PID control provided in an embodiment of the present application, which refers to a feedforward control strategy, adjusts the output of the PID controller in advance, synthesizes the output term of the PID controller with the feedforward compensation amount (such as superposition), that is, mathematically fuses the feedback output of the PID controller with the feedforward output of the feedforward compensator, and outputs the final actuator drive signal. Other contents about the PID controller are common knowledge in the field and will not be repeated here.
[0063] In an optional embodiment, a first feedforward control item is determined based on a set of characteristic data, including: determining a first flow change value ΔQ1=a×ΔT based on the temperature change of the target fluid in the following manner, wherein a is the temperature coefficient and ΔT is the temperature change value of the target fluid; determining a first feedforward control item u1=k1×ΔQ1 according to the first flow change value in the following manner, wherein k1 is a first feedforward control gain; determining a second feedforward control item based on the system operating condition data, including: determining a second flow change value ΔQ2=b×ΔP based on the temperature change of the target fluid in the following manner, wherein b is the pressure coefficient and ΔP is the change value of the ambient air pressure data; determining a second feedforward control item u2=k2×ΔQ2 according to the second flow change value in the following manner, wherein k2 is a second feedforward control gain.
[0064] In the above embodiment, the first flow change value is determined according to a formula based on the change in target fluid temperature to obtain the first feedforward control item, and the second flow change value is determined according to a formula based on the change in ambient air pressure to obtain the second feedforward control item. The PID controller output can be compensated in advance and closed-loop control can be achieved, thereby solving the problem of unstable control in a small flow range, improving measurement accuracy and control effect, and at the same time, judging to exit the small flow control mode based on the second mass flow data set obtained subsequently, thereby achieving flexible and efficient flow control.
[0065] Based on the target fluid's temperature change ΔT and the temperature coefficient a, a first flow rate change value ΔQ1 = a × ΔT is calculated. Based on the first flow rate change ΔQ1 and the first feedforward control gain k1, a first feedforward control term u1 = k1 × ΔQ1 is calculated. Based on the ambient pressure change ΔP and the pressure coefficient b, a second flow rate change value ΔQ2 = b × ΔP is calculated. Based on the second flow rate change ΔQ2 and the second feedforward control gain k2, a second feedforward control term u2 = k2 × ΔQ2 is calculated. Temperature change ΔT indirectly causes flow change ΔQ1 by affecting fluid viscosity (such as temperature increase leads to viscosity decrease), α is the temperature-flow sensitivity coefficient (which can be calibrated experimentally or derived from the mechanism), and the first feedforward control term u1=k1×ΔQ1 is used to offset the impact of temperature change on flow in advance; ambient air pressure change ΔP directly affects fluid pressure balance (such as air pressure increase leads to increased gas density), β is the air pressure-flow sensitivity coefficient, and the second feedforward control term u2=k2×ΔQ2 is used to compensate for the interference of air pressure fluctuations on flow; u1 and u2 are superimposed to form the total feedforward compensation, which is superimposed with the PID controller output and then driven to achieve "predictive" compensation for measurable disturbances. This embodiment transforms complex fluid dynamics relationships into easily implementable parameterized models through linear approximation (ΔQ = coefficient × change), reducing computational complexity and making it suitable for low-cost embedded controllers. The feedforward control term acts immediately upon disturbances, shortening the settling time by 30%-50% compared to pure PID control (for example, the time it takes for the system to stabilize from oscillation to stability during a temperature step change is reduced from 8 seconds to 4 seconds). In low-flow scenarios, dynamic compensation for temperature and pressure disturbances reduces flow control error from ±3% of full scale to within ±1%, meeting the high-precision requirements of fields such as precision chemicals and medical infusion. By separately quantifying the effects of temperature and ambient pressure changes on flow and calculating compensation accordingly, this embodiment significantly improves control accuracy, particularly within low-flow ranges. Combining feedforward compensation with closed-loop control enables more precise flow control, further enhancing production efficiency and product quality. In the above embodiment, the temperature data in a set of characteristic data is used as the first feedforward control item as an example. The first feedforward control item can also be fluid viscosity data or pressure data. Similarly, the above second feedforward control item is used as an example of the change in ambient air pressure. The system operating condition data can also be pipeline pressure difference, pump speed, valve opening, etc.
[0066] As an example, assume that a fluid needs to be controlled at 10 ml / min during production, representing approximately 2% of the flowmeter's full scale. The fluid exhibits significant temperature variations (viscosity is 300 cP at 20°C, dropping to 100 cP at 40°C). Furthermore, the ambient air pressure in the production workshop fluctuates within a ±5 kPa range. Traditional PID control suffers from a flow control error of ±8% when subjected to temperature or pressure fluctuations, failing to meet the ±2% accuracy requirement. A feedforward-feedback composite control strategy achieves high-precision and stable control. The collected fluid characteristic data includes current temperature T = 25°C, current viscosity μ = 250 cP, and ambient pressure P = 101.3 kPa (with a reference pressure of 101 kPa and ΔP = +0.3 kPa). The mass flowmeter obtains the current flow rate Q1 = 9.8 mL / min in real time, while the target flow rate Q0 = 10 mL / min. The first feedforward control term (temperature compensation) is calculated as follows: Based on the temperature-flow relationship fitted with historical data, the temperature coefficient a is determined to be 0.2 mL / (min·°C). The temperature change ΔT is calculated as T - the reference temperature (20°C) = 5°C. The first flow change ΔQ1 is calculated as a × ΔT = 0.2 × 5 = 1 mL / min. The first feedforward control gain k1 is 0.8, and the first feedforward control term u1 is calculated as k1 × ΔQ1 = 0.8 mL / min. The second feedforward control term (barometric pressure compensation) is calculated as follows: the pressure coefficient b = 0.05 mL / (min·kPa). The barometric pressure change ΔP = 0.3 kPa. The second flow change ΔQ2 is calculated as b × ΔP = 0.05 × 0.3 = 0.015 mL / min. The second feedforward control gain k2 is 1, and the second feedforward control term u2 is calculated as k2 × ΔQ2 = 0.015 mL / min. Total feedforward compensation: u = u1 + u2 = 0.8 + 0.015 = 0.815 mL / min. It should be noted that in practical applications, the PID output can be dimensionless, such as a percentage, used as a control signal to control an actuator, such as indicating the actuator's opening or speed. The PID controller output can also be directly expressed in flow units, such as ml / min (or kg / h). This design is often used in scenarios where flow is directly controlled. The PID controller output is directly expressed as a flow setpoint, used to control a flow control valve or pump speed. For example, a PID controller output of 50 kg / h indicates that the system needs to adjust the flow rate to 50 kg / h. The PID controller output can also be a voltage or current signal used to drive an actuator. For example, a 0-10V signal (0V indicates a fully closed valve, 10V indicates a fully open valve) or a 4-20mA signal (4mA indicates a fully closed valve, 20mA indicates a fully open valve).
[0067] As another example, suppose an electronics manufacturing plant needs to precisely control the flow rate of a high-purity cleaning fluid used to clean semiconductor wafers. The flow rate of this cleaning fluid ranges from 0.1 kg / h to 10 kg / h. Traditional fixed-parameter PID control algorithms struggle to achieve high-precision control within this small flow range (e.g., less than 5% of the equipment's full-scale range). At a certain moment (the first moment), the target cleaning fluid's mass flow rate is monitored to be 0.3 kg / h. Assuming the equipment's full-scale range is 10 kg / h, the flow rate is less than 5% of the full-scale range (i.e., 0.5 kg / h), falling within the small flow range. The system automatically switches to low-flow control mode. In low-flow control mode, the system dynamically optimizes the PID parameters based on the cleaning fluid's characteristic data (such as viscosity, temperature, and pressure). Assume that the optimized PID parameters are: proportional coefficient (P) = 2.5, integral coefficient (I) = 0.1, and differential coefficient (D) = 0.5. Based on these optimized PID parameters, the system performs closed-loop control of the cleaning fluid flow rate, ensuring the flow rate remains stable near the target value. The system further combines the feedforward control mechanism to calculate the feedforward compensation amount based on the characteristic data of the cleaning fluid and the system operating data, assuming that the current temperature of the cleaning fluid is 30°C and the ambient pressure is 1.5 bar. The system calculates the feedforward compensation amount according to the following formula. The first feedforward control term (based on temperature change): Assuming the temperature change ΔT = 30°C-25°C = 5°C, the temperature coefficient a = 0.02 (determined according to empirical formulas or experimental data), the first flow change value ΔQ1 = a×ΔT = 0.02×5 = 0.1 kg / h, and the first feedforward control gain k1 = 1.2, then the first feedforward control term u1 = k1×ΔQ1 = 1.2×0.1 = 0.12. The second feedforward control term (based on ambient pressure changes): pressure change ΔP = 1.5 bar - 1.0 bar = 0.5 bar (assuming the target pressure is 1.0 bar), pressure coefficient b = 0.03 (determined according to empirical formulas or experimental data), second flow change value ΔQ2 = b × ΔP = 0.03 × 0.5 = 0.015 kg / h, second feedforward control gain k2 = 1.5, second feedforward control term u2 = k2 × ΔQ2 = 1.5 × 0.015 = 0.0225, the unit of the above temperature coefficient a is kg / (h·℃), the unit of the pressure coefficient is kg / (h·bar), the first feedforward gain k1 and the second feedforward gain k2 are both coefficients used to scale the compensation amount, with the unit being % / (kg / h). In this way, after compensating the PID control output, the output is a control signal for controlling the actuator, such as controlling the opening of a valve.
[0068] The embodiments of the present application can achieve at least the following technical effects: the mass flow rate of the target fluid can be monitored, and when the flow rate is less than a preset flow rate threshold, it can switch to a small flow rate control mode, and can handle small flow rate situations in a targeted manner to avoid the influence of equipment sensitivity and algorithm limitations on small flow rate control; in the small flow rate control mode, the PID parameters are dynamically optimized based on the characteristic data of the target fluid, which can reduce the influence of measurement noise and control delay and improve control stability; the target fluid flow rate is controlled through closed-loop control, which can improve the control accuracy in the small flow range and the overall measurement accuracy and control effect.
[0069] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application will be described in detail below with reference to specific embodiments.
[0070] In order to solve the problem of improving the control accuracy and stability of the mass flowmeter under low flow conditions, the embodiment of the present application proposes the following solution:
[0071] Specific examples:
[0072] A) First, the system starts the initialization process, which includes setting initial parameters, calibrating sensors, and activating control modules;
[0073] B) Then, the mass flow rate of the fluid is monitored in real time, and a predetermined low flow rate threshold is used to determine whether to enter a low flow rate control mode;
[0074] C) Then, if the monitored flow rate is lower than the preset threshold, the system automatically switches to the low-flow control mode. In this mode, an improved PID control algorithm is adopted, which introduces an adaptive parameter adjustment mechanism to improve the sensitivity to small flow changes;
[0075] D) In low flow control mode, the system dynamically adjusts PID parameters according to the actual flow of the fluid to optimize control response speed and stability;
[0076] E) Finally, the system continues to monitor and adjust until the flow rate returns to the normal range and automatically exits the low flow control mode.
[0077] Furthermore, in order to solve the problem of PID parameter selection in small flow control mode, a machine learning algorithm is used to predict the optimal PID parameter combination. The model is trained through historical data to calculate the PID parameters that best suit the current fluid characteristics in real time.
[0078] The implementation is as follows:
[0079] The online learning module collects mass flow data on fluid characteristics and operating conditions in real time to construct a training dataset;
[0080] Use supervised learning algorithms, such as support vector machines or neural networks, to establish PID parameter prediction models based on a large amount of experimental data;
[0081] Run the prediction model in real time, input the current fluid characteristics and operating conditions, and output the recommended PID parameter combination;
[0082] Dynamically adjust the parameters of the PID controller to adapt to changes in different fluid characteristics and operating conditions, and improve the accuracy and stability of small flow control.
[0083] In order to further improve the stability and response speed of small flow control, a feedforward control strategy was introduced. By analyzing fluid characteristics and external environmental factors, possible flow change trends can be predicted in advance, adjustments can be made in advance, and the lag effect can be reduced.
[0084] The implementation is as follows:
[0085] Analyze the fluid's viscosity, temperature, pressure and other characteristics, as well as external environmental factors such as temperature changes and air pressure fluctuations, and establish a mathematical model between fluid characteristics and flow rate change trends;
[0086] Monitor the above variables in real time, input the current values into the mathematical model, and predict the possible trend of flow in the future;
[0087] According to the prediction results, the output of the PID controller is adjusted in advance to reduce the control response time and improve the foresight and stability of the control.
[0088] The technical effects are as follows:
[0089] Because of the adaptive PID parameter adjustment mechanism, the control accuracy and stability under low flow conditions are significantly improved;
[0090] Because it combines machine learning algorithms to dynamically optimize PID parameters, it can more flexibly respond to changes in different fluid characteristics and operating conditions, improving the level of intelligent control;
[0091] Because a feedforward control strategy based on fluid characteristics and external environmental factors is introduced, control lag can be reduced, the ability to respond quickly to flow changes can be improved, and the overall control performance of the system can be further enhanced.
[0092] The present application also provides a flow control device for a mass flow meter, such as Figure 3 As shown, Figure 3 : is a structural block diagram of a flow control device of a mass flow meter provided in an embodiment of the present application, the device comprising:
[0093] A monitoring module 31 is configured to monitor a first mass flow rate of the target fluid at a first moment and determine whether the first mass flow rate is less than a preset flow rate threshold;
[0094] A switching module 32 is configured to switch to a low flow control mode when the first mass flow rate is less than a preset flow rate threshold;
[0095] an optimization module 33 for dynamically optimizing PID parameters based on a set of characteristic data of the target fluid in a low flow control mode to obtain a set of PID control parameters, wherein the set of characteristic data includes at least viscosity data of the target fluid, temperature data of the target fluid, and pressure data of the target fluid;
[0096] The control module 34 is configured to perform closed-loop control on the flow rate of the target fluid based on a set of PID control parameters.
[0097] It should be noted that the above embodiments provide systems that implement their functions using only the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0098] The present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed, any one of the above-mentioned method steps is executed.
[0099] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0100] This application also discloses an electronic device. Figure 4 As shown, Figure 4 The electronic device 400 may include: at least one processor 401 , at least one communication bus 402 , a user interface 403 , at least one network interface 404 , and a memory 405 .
[0101] The communication bus 402 is used to implement the connection and communication between these components.
[0102] The user interface 403 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 403 may also include a standard wired interface and a wireless interface.
[0103] The network interface 404 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0104] Processor 401 may include one or more processing cores. Processor 401 utilizes various interfaces and circuits to connect various components within the electronic device (e.g., a server). It executes instructions, programs, code sets, or instruction sets stored in memory 405, and accesses data stored in memory 405 to perform various server functions and process data. Optionally, processor 401 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). Processor 401 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display; and the modem handles wireless communications. It is understood that the modem may also be implemented as a separate chip, rather than integrated into processor 401.
[0105] Among them, the memory 405 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 405 includes a non-transitory computer-readable storage medium. The memory 405 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 405 may also optionally be at least one storage device located away from the aforementioned processor 401. Refer to Figure 4 The memory 405 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for a flow control method of a mass flow meter.
[0106] exist Figure 4 In the electronic device 400 shown, the user interface 403 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 401 can be used to call an application program of a flow control method of a mass flow meter stored in the memory 405. When executed by one or more processors 401, the electronic device 400 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited to the described order of actions, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0107] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed device or system can be implemented in other ways. For example, the device or system embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0109] The foregoing is merely an exemplary embodiment of the present disclosure and is not intended to limit the scope of the present disclosure. In other words, any equivalent variations and modifications made in accordance with the teachings of the present disclosure are still within the scope of the present disclosure. Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the disclosure herein.
[0110] This application is intended to cover any modifications, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field not described in the present disclosure.
Claims
1. A flow control method for a mass flow meter, characterized in that: include: monitoring a first mass flow rate of a target fluid at a first moment, and determining whether the first mass flow rate is less than a preset flow rate threshold; When the first mass flow rate is less than the preset flow rate threshold, switching to a low flow rate control mode; In the low flow control mode, dynamically optimizing PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, wherein the set of characteristic data at least includes viscosity data of the target fluid, temperature data of the target fluid, and pressure data of the target fluid; performing closed-loop control on the flow rate of the target fluid based on the set of PID control parameters; The closed-loop control of the flow rate of the target fluid based on the set of PID control parameters includes: obtaining a feedforward compensation amount based on a set of characteristic data of the target fluid and system operating condition data, wherein the feedforward compensation amount is used to compensate for the output of the PID controller; adjusting the output item of the PID controller in advance based on the feedforward compensation amount, and performing closed-loop control of the flow rate of the target fluid based on the set of PID control parameters; Based on a set of characteristic data and system operating condition data of the target fluid, a feedforward compensation amount is obtained, including: determining a first feedforward control item based on the set of characteristic data, and determining a second feedforward control item based on the system operating condition data, wherein the feedforward compensation amount includes the first feedforward control item and the second feedforward control item, the first feedforward control item is used to represent a first compensation amount for a temperature change of the target fluid to an output of a PID controller, the set of characteristic data includes temperature data of the target fluid, the second feedforward control item is used to represent a second compensation amount for a change in ambient air pressure to an output of the PID controller, and the system operating condition data includes ambient air pressure data.
2. The method according to claim 1, characterized in that After performing closed-loop control on the flow rate of the target fluid based on the set of PID control parameters, the method further includes: Acquire a second mass flow data set of the target fluid within a target duration, wherein the second mass flow data set includes the mass flow of the target fluid at a plurality of second moments, the second moments being moments later than the first moment and after the dynamic optimization of the PID parameters; When the second mass flow data set meets a preset condition, the low flow control mode is exited.
3. The method according to claim 2, characterized in that When the second mass flow data set meets a preset condition, exiting the low flow control mode includes at least one of the following: When the mass flows included in the second mass flow data set are all greater than or equal to the preset flow threshold, and the target duration is greater than or equal to the preset duration threshold, exiting the low flow control mode; When the mass flows included in the second mass flow data set are all greater than or equal to the preset flow threshold, and the flow fluctuation standard deviation of the target fluid determined based on the second mass flow data set is less than the preset fluctuation threshold, the low flow control mode is exited.
4. The method according to claim 1, wherein Dynamically optimize PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, including: Using a trained machine learning model, inputting the set of characteristic data, the first mass flow rate, and the target set flow rate, outputting a recommended PID parameter combination; The recommended PID parameter combination is determined as the set of PID control parameters.
5. The method according to claim 4, characterized in that The machine learning model is trained in the following way: Acquire a historical data set, wherein the historical data set includes multiple groups of mass flow sample data, each group of the mass flow sample data includes viscosity data, temperature parameters, pressure parameters, actual flow rate, set flow rate and corresponding PID control parameters of a fluid; Dividing the historical data set into a training set and a validation set; Using the training set to train the initial model, using the validation set to evaluate the performance of the initial model, and adjusting the hyperparameters of the initial model to optimize model performance; When the performance index of the initial model on the validation set reaches a preset threshold, the training is terminated, and the initial model obtained at the end of the training is used as the machine learning model.
6. A flow control device for a mass flow meter, characterized in that: include: a monitoring module, configured to monitor a first mass flow rate of the target fluid at a first moment, and determine whether the first mass flow rate is less than a preset flow rate threshold; A switching module, configured to switch to a low flow control mode when the first mass flow rate is less than the preset flow rate threshold; an optimization module, configured to dynamically optimize PID parameters based on a set of characteristic data of the target fluid in the low flow control mode to obtain a set of PID control parameters, wherein the set of characteristic data at least includes viscosity data of the target fluid, temperature data of the target fluid, and pressure data of the target fluid; a control module, configured to perform closed-loop control on the flow rate of the target fluid based on the set of PID control parameters; The control module is configured to perform closed-loop control on the flow rate of the target fluid based on the set of PID control parameters in the following manner: Based on a set of characteristic data of the target fluid and system operating condition data, a feedforward compensation amount is obtained, wherein the feedforward compensation amount is used to compensate for an output of a PID controller; an output item of the PID controller is adjusted in advance based on the feedforward compensation amount, and a closed-loop control is performed on the flow rate of the target fluid based on the set of PID control parameters; Wherein, based on a set of characteristic data and system operating condition data of the target fluid, a feedforward compensation amount is obtained, including: determining a first feedforward control item based on the set of characteristic data, and determining a second feedforward control item based on the system operating condition data, wherein the feedforward compensation amount includes the first feedforward control item and the second feedforward control item, the first feedforward control item is used to represent a first compensation amount for the temperature change of the target fluid to the output of the PID controller, the set of characteristic data includes the temperature data of the target fluid, the second feedforward control item is used to represent a second compensation amount for the ambient pressure change to the output of the PID controller, and the system operating condition data includes ambient pressure data.
7. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is performed.
Citation Information
Patent Citations
Mass flowmeter control method and device, electronic equipment and storage medium
CN118192677A
Electromagnetic valve accurate control method based on flow dynamic adjustment
CN119244805A
PID (Proportion Integration Differentiation) parameter calibration method and device of mass flow controller
CN119472236A