Flow control method and device of mass flow meter, electronic equipment and storage medium

By monitoring the fluid flow in the mass flowmeter and switching to the small flow control mode, dynamically optimizing the PID parameters and combining machine learning and feedforward compensation, the control accuracy and stability problems under small flow are solved, and more efficient flow control is achieved.

CN120295378AActive Publication Date: 2025-07-11BEIJING JINGLIANG TECH CO LTD

Patent Information

Application Number
CN202510797024.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-07-11
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

In the case of small flow rates, the existing mass flowmeter cannot adapt to changes in the dynamic characteristics of the fluid due to the fixed parameter PID control algorithm, resulting in limited control accuracy and stability.

Method used

By monitoring the mass flow of the fluid, switching to the small flow control mode, and dynamically optimizing the PID parameters based on the characteristic data of the fluid, combining the machine learning model and feedforward compensation for closed-loop control.

Benefits of technology

Improves flow control accuracy and stability in a small flow range, reduces measurement noise and control delays, and achieves more accurate flow control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295378A_ABST
    Figure CN120295378A_ABST
Patent Text Reader

Abstract

The invention provides a flow control method and device of a mass flowmeter, electronic equipment and a storage medium, and relates to the technical field of flow control, the method comprises the steps of monitoring a first mass flow of a target fluid at a first moment, and judging whether the first mass flow is smaller than a preset flow threshold or not; under the condition that the first mass flow is smaller than a preset flow threshold value, switching to a small flow control mode; under the small-flow control mode, PID parameters are dynamically optimized based on a set of characteristic data of the target fluid, a set of PID control parameters are obtained, and the set of characteristic data at least comprises viscosity data of the target fluid, temperature data of the target fluid and pressure data of the target fluid; and performing closed-loop control on the flow of the target fluid based on the group of PID control parameters. By implementing the technical scheme provided by the invention, the effect of improving the stability of flow control is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of flow control, and particularly relates to a flow control method, device, electronic device, and storage medium for a mass flowmeter. Background Art

[0002] In various industrial applications, accurately controlling and measuring the mass flow rate of fluids is crucial for improving production efficiency and product quality. Most mass flowmeters in related technologies adopt a PID control algorithm with fixed parameters. Although it can meet the control requirements for conventional flow ranges, it has obvious deficiencies in the case of small flow rates. For example, when the flow rate is less than 5% (or other values) of the full scale of the device, the fixed parameters cannot adapt to the changes in the dynamic characteristics of the fluid, resulting in overshoot or response lag. The control accuracy of the flow rate is often limited by the sensitivity of the device itself 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 flowmeter control method that can dynamically optimize control parameters to solve the deficiencies of the prior art in small flow rate control and improve control accuracy and stability. Summary of the Invention

[0003] To solve the above technical problems, the present application provides a flow control method, device, electronic device, and storage medium for a mass flowmeter.

[0004] In a first aspect, the present application provides a flow control method for a mass flowmeter, including: monitoring the 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; in the case where the first mass flow rate is less than the preset flow threshold, switching to a small flow rate control mode; in the small flow rate 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, where 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.

[0005] By adopting the above technical solution, according to the comparison result between the first mass flow rate of the target fluid and the preset flow threshold, the small flow rate control mode can be switched in the case of small flow rates. 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 subjected to closed-loop control using the optimized set of PID control parameters, which can solve the problem that the control accuracy of the fixed-parameter PID control algorithm is limited in the small flow rate range and achieve the effect of improving the stability of flow rate control.

[0006] Optionally, after performing closed-loop control on the flow rate of the target fluid based on a set of PID control parameters, the above method further includes: obtaining a second mass flow rate data set of the target fluid within a target time period, where the second mass flow rate data set includes the mass flow rates of the target fluid at multiple second moments, and the second moment is a moment later than the first moment and after dynamically optimizing the PID parameters; and exiting the small flow rate control mode when the second mass flow rate data set meets a preset condition.

[0007] By adopting the above technical solution, obtaining the second mass flow rate data set within the target time period and exiting the small flow rate control mode when the data set meets the preset condition can flexibly switch the control mode according to the flow rate situation, improve the flow rate control stability and measurement accuracy within the small flow rate range, and at the same time can exit the small flow rate control mode based on the flow rate state to achieve more reasonable flow rate control.

[0008] Optionally, exiting the small flow rate control mode when the second mass flow rate data set meets a preset condition includes at least one of the following: exiting the small flow rate control mode when the mass flow rates included in the second mass flow rate data set are all greater than or equal to a preset flow rate threshold and the target time period is greater than or equal to a preset time period threshold; exiting the small flow rate control mode when the mass flow rates included in the second mass flow rate data set are all greater than or equal to a preset flow rate threshold and the standard deviation of the flow rate fluctuation of the target fluid determined according to the second mass flow rate data set is less than a preset fluctuation threshold.

[0009] By adopting the above technical solution, exiting the small flow rate control mode when the mass flow rates in the second mass flow rate data set are all greater than or equal to the preset flow rate threshold and the target time period is greater than or equal to the preset time period threshold, or when the mass flow rates in the second mass flow rate data set are all greater than or equal to the preset flow rate threshold and the standard deviation of the flow rate fluctuation of the target fluid determined according to the second mass flow rate data set is less than the preset fluctuation threshold, can achieve precise control of the small flow rate 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 rate control mode in a timely manner when certain conditions are met, optimize the control process, and improve the overall measurement accuracy and control effect.

[0010] Optionally, dynamically optimizing the PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters includes: using a trained machine learning model, inputting a set of characteristic data, the first mass flow rate, and the 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, using the trained machine learning model, inputting a set of characteristic data of the target fluid, the first mass flow rate, and the target set flow rate, the recommended PID parameter combination can be dynamically output and determined as a set of PID control parameters. Finally, based on this set of PID control parameters, the closed-loop control of the target fluid flow rate is carried out, which can avoid the problems of unstable control in the small flow rate range and low measurement accuracy caused by using the PID control algorithm with fixed parameters in the related technology, and achieve more accurate and stable flow control in the small flow rate range.

[0012] Optionally, the machine learning model is trained in the following way: Obtain a historical data set, where the historical data set includes multiple sets of mass flow rate sample data, and each set of mass flow rate sample data includes the viscosity data, temperature parameter, pressure parameter, actual flow rate, set flow rate, and corresponding PID control parameters of a fluid; Divide the historical data set into a training set and a validation set; Use the training set to train the initial model, evaluate the performance of the initial model using the validation set, and adjust the hyperparameters of the initial model to optimize the model performance; When the performance index of the initial model on the validation set reaches the preset threshold, end the training, and use the initial model obtained at the end of the training as the machine learning model.

[0013] By adopting the above technical solution, training the machine learning model using the obtained historical data set containing characteristic data such as viscosity, temperature, and pressure, dynamically optimizing the PID control parameters to carry out closed-loop control of the target fluid flow rate, can improve the flow control accuracy of the mass flow meter in the small flow rate range, reduce the influence of measurement noise and control delay, and make the control more stable; Using the validation set to evaluate and adjust the hyperparameters of the initial model, ensuring that the model is used as the final model after the performance index on the validation set reaches the preset threshold, can ensure the accuracy and reliability of the machine learning model outputting the recommended PID parameter combination.

[0014] Optionally, carrying out closed-loop control of the flow rate of the target fluid based on a 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, where the feedforward compensation amount is used to compensate the output of the PID controller; Adjusting the output term of the PID controller in advance based on the feedforward compensation amount, and carrying out 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, obtaining the feedforward compensation amount based on the characteristic data of the target fluid and system operating condition data to compensate the output of the PID controller, adjusting the output term of the PID controller in advance, and carrying out closed-loop control of the target fluid flow rate based on a set of PID control parameters, can perform more accurate and stable flow control for fluids in the small flow rate 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 term based on the set of characteristic data, and determining a second feedforward control term based on the system operating condition data, where the feedforward compensation amount includes the first feedforward control term and the second feedforward control term. The first feedforward control term is used to represent the first compensation amount of 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 term is used to represent the second compensation amount of the ambient air pressure change to the output of the PID controller. The system operating condition data includes the ambient air pressure data.

[0017] By adopting the above technical solution, the first feedforward control term is calculated based on the temperature data of the target fluid and is used to compensate for the influence of temperature change on the output of the PID controller. The second feedforward control term is calculated based on the ambient air pressure data and is used to compensate for the influence of air pressure change on the output of the PID controller. By separately determining the compensation amounts of the PID controller output 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 the small flow range is improved, and thus the overall measurement accuracy and control effect are improved.

[0018] Optionally, determining the first feedforward control term based on a set of characteristic data includes: determining a first flow change value ΔQ1 = a×ΔT according to the temperature change of the target fluid, where a is the temperature coefficient and ΔT is the temperature change value of the target fluid; determining the first feedforward control term u1 = k1×ΔQ1 according to the first flow change value, where k1 is the first feedforward control gain; determining the second feedforward control term based on the system operating condition data includes: determining a second flow change value ΔQ2 = b×ΔP according to the temperature change of the target fluid, where b is the pressure coefficient and ΔP is the change value of the ambient air pressure data; determining the second feedforward control term u2 = k2×ΔQ2 according to the second flow change value, where k2 is the 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 temperature change of the target fluid, and then the first feedforward control term is obtained. The second flow change value is determined according to the formula based on the ambient air pressure change, and then the second feedforward control term is obtained. The output of the PID controller can be compensated in advance and closed-loop control can be achieved, solving the problem of unstable control in the small flow range, improving the measurement accuracy and control effect. At the same time, based on the second mass flow rate data set obtained subsequently, the small flow control mode is judged to exit, realizing flexible and efficient flow control.

[0020] In the second aspect of the present application, a flow control device for a mass flowmeter is further provided, including: a monitoring module, configured to monitor the first mass flow of a target fluid at a first moment and determine whether the first mass flow is less than a preset flow threshold; a switching module, configured to switch to a small flow control mode when the first mass flow is less than the preset flow threshold; an optimization module, configured to dynamically optimize PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters in the small flow control mode, where 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; and a control module, configured to perform closed-loop control on the flow of the target fluid based on the set of PID control parameters.

[0021] In the third aspect of the present application, an electronic device is further provided, including a memory and a processor. A computer program is stored on the memory, and when the processor executes the program, the method steps of any one of the above are implemented.

[0022] In the fourth aspect of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium stores instructions, and when the instructions are executed, the method steps of any one of the above are executed.

[0023] In summary, one or more technical solutions provided in the present application have at least the following technical effects or advantages: 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, which can solve the problem that the control accuracy of the fixed-parameter PID control algorithm is limited in the small flow range in the related art, make the flow control more stable, and improve the overall measurement accuracy and control effect; 2. Can flexibly switch the control mode according to the flow situation, improve the flow control stability and measurement accuracy in the small flow range, and at the same time can exit the small flow control mode according to the flow state to achieve more reasonable flow control; 3. Obtain a feedforward compensation amount based on the characteristic data of the target fluid and the system working condition data to compensate the output of the PID controller, adjust the output term of the PID controller in advance, and perform closed-loop control on the flow of the target fluid based on a set of PID control parameters, which can perform more accurate and stable flow control for the fluid in the small flow range, and thus improve the overall measurement accuracy and control effect. Description of the Drawings

[0024] Figure 1 is a flowchart of a flow control method for a mass flowmeter provided by an embodiment of the present application; Figure 2 is a schematic diagram of an improved PID control provided by an embodiment of the present application; Figure 3It is a structural block diagram of a flow control device of a mass flowmeter provided by an embodiment of the present application; Figure 4 It is a schematic structural diagram of an electronic device disclosed by an embodiment of the present application.

[0025] Description of reference numerals: 400 - electronic device; 401 - processor; 402 - communication bus; 403 - user interface; 404 - network interface; 405 - memory. Detailed implementation manners

[0026] 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 accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.

[0027] In the description of the embodiments of the present application, words such as "for example" or "for illustration" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "for example" or "for illustration" is intended to present relevant concepts in a specific manner.

[0028] In the description of the embodiments of the present application, the meaning of the term "a plurality" refers to two or more. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly indicating the technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0029] The present application provides a flow control method for a mass flowmeter. Refer to Figure 1 , Figure 1 It is a flowchart of a flow control method for a mass flowmeter provided by an embodiment of the present application. The method includes: Step S101, monitoring the first mass flow rate of the target fluid at the first moment and determining whether the first mass flow rate is less than a preset flow threshold; Step S102, switching to the small flow control mode when the first mass flow rate is less than the preset flow threshold; Step S103, in the small flow control mode, dynamically optimizing the PID parameters based on a set of characteristic data of the target fluid to obtain a set of PID control parameters, where the set of characteristic data at least includes the viscosity data of the target fluid, the temperature data of the target fluid, and the pressure data of the target fluid; Step S104, perform closed-loop control on the flow rate of the target fluid based on a set of PID control parameters.

[0030] Through the above steps, according to the comparison result between the first mass flow rate of the target fluid and the preset flow rate threshold, the small flow rate control mode can be switched in the case of small flow rates. Specifically, the PID parameters are dynamically optimized based on a set of characteristic data of the target fluid, and then the optimized set of PID control parameters is used to perform closed-loop control on the flow rate of the target fluid, which can solve the problem that the control accuracy of the fixed-parameter PID control algorithm is limited in the small flow rate range and achieve the effect of improving the stability of flow rate control.

[0031] By monitoring the first mass flow rate of the target fluid, it is determined whether it is less than a preset flow threshold. If the first mass flow rate is less than the preset flow threshold, the small flow control mode is switched to; in the small 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; a set of characteristic data includes viscosity data, temperature data, and pressure data of the target fluid. The preset flow threshold can be 5% (or other values) of the full scale of the mass flowmeter. In the small flow range, the fixed parameters of the PID control algorithm in the related technology are often difficult to adapt to complex fluid characteristic changes and are easily affected by noise and delay. By introducing the characteristic data of the fluid (such as viscosity, temperature, pressure) to dynamically optimize the PID parameters, it can better meet the requirements of small flow control. In the small flow control mode, using the characteristic data such as viscosity, temperature, and pressure of the target fluid, the proportional (P), integral (I), and derivative (D) parameters of the PID controller are dynamically adjusted through an optimization algorithm (such as an adaptive control algorithm), or a set of optimal PID control parameters are generated using a trained machine learning model, and 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 various different fluid characteristic data, the actual flow rate of the fluid, the predetermined flow rate, and the corresponding PID control parameters; the machine learning model can construct a mapping relationship between different fluid characteristic data combinations and PID parameter combinations; the optimized PID parameters can better adapt to the fluid characteristic changes in the small flow range, thereby improving the control accuracy and stability. The mass flowmeter is usually equipped with actuators (such as valves, pumps) and feedback sensors, and combined with the controller, closed-loop control based on dynamic PID parameters can be achieved. The proportional coefficient P (or denoted as Kp), integral time I (or denoted as Ti), and derivative time D (or denoted as Td) of the PID controller are dynamically adjusted using the fluid characteristic data (viscosity, temperature, pressure) to adapt to the influence of fluid characteristic changes on the control model under small flow. The target fluid in this embodiment can be a liquid or a gas. Through dynamically optimizing the PID parameters in this embodiment, it can better adapt to the fluid characteristic changes in the small flow range and significantly improve the control accuracy; the dynamic optimization method based on fluid characteristic data can adapt to different fluid characteristics and working conditions changes and has wide applicability; by accurately controlling the fluid flow rate in the small flow range, the production efficiency and product quality can be improved, and the resource waste and production defects caused by inaccurate flow control can be reduced. By adjusting the control parameters in real time to match the fluid characteristics, the control error in the small flow range can be reduced to less than 50% of the conventional PID. Assuming the conventional error is ±3%, it can be reduced to ±1.5% after optimization; the control oscillation caused by fluid characteristic fluctuations (such as viscosity change caused by temperature change) is reduced, and the stability in the small flow scenario is improved.

[0032] Suppose that in a chemical production process, it is necessary to precisely control the flow rate of a high-viscosity fluid, and the flow rate range of this fluid is between 0.1 kg / h and 10 kg / h. In the small flow rate range (such as when the flow rate is less than 5% of the full scale of the equipment), it is difficult for the traditional fixed-parameter PID control algorithm to achieve high-precision control and is easily affected by measurement noise and control delay. At a certain moment (the first moment), the measured mass flow rate of the target fluid is 0.3 kg / h. Assuming that the full scale of the equipment is 10 kg / h, at this time the flow rate is less than 5% of the full scale (i.e., 0.5 kg / h), that is, the preset flow rate threshold is 0.5 kg / h, which belongs to the small flow rate range, and the system automatically switches to the small flow rate control mode; in the small flow rate control mode, the system collects a set of characteristic data of the target fluid. For example, the viscosity of the fluid is 1000 mPa·s (or 1000 cP), the temperature of the fluid is 30 °C, and the pressure of the fluid is 1.5 bar. The system uses these characteristic data to dynamically calculate the PID control parameters through a preset optimization algorithm (such as an empirical formula or a machine learning model). Suppose the optimized PID parameters are: proportional coefficient (P) = 2.5, integral coefficient (I) = 0.1, derivative coefficient (D) = 0.5; the system performs closed-loop control on the flow rate of the target fluid based on the optimized PID parameters. The specific operations are as follows: set the target flow rate, assume the target flow rate is 0.4 kg / h; monitor and adjust in real time, the system monitors the flow rate in real time and adjusts the flow rate of the fluid according to the output of the PID controller. For example, if the monitored flow rate is lower than 0.4 kg / h, the PID controller will increase the output signal and adjust the valve opening to make the flow rate close to the target value. Before optimizing the PID parameters, the system uses fixed parameters (P = 1.0, I = 0.05, D = 0.1) for control, and the flow rate fluctuates greatly, and the control error is ±0.1 kg / h; after switching to the small flow rate control mode, the dynamically optimized PID parameters (P = 2.5, I = 0.1, D = 0.5) reduce the flow rate control error to ±0.02 kg / h, significantly improving the control accuracy. It should be noted that this is only an example here.

[0033] In an alternative embodiment, after performing closed-loop control on the flow rate of the target fluid based on a set of PID control parameters, the above method further includes: obtaining a second mass flow rate data set of the target fluid within a target time period, where the second mass flow rate data set includes the mass flow rates of the target fluid at multiple second moments, and the second moment is a moment later than the first moment and after dynamically optimizing the PID parameters; exiting the small flow rate control mode when the second mass flow rate data set meets a preset condition.

[0034] In the above embodiments, a second mass flow rate data set within a target duration is obtained, and when the data set meets a preset condition, the small flow control mode is exited. The control mode can be flexibly switched according to the flow conditions, improving the flow control stability and measurement accuracy within the small flow range. At the same time, the small flow control mode can be exited based on the flow state, achieving more reasonable flow control.

[0035] After completing the closed-loop control of the target fluid flow rate with dynamically optimized PID parameters, continuously collect the second mass flow rate data set within the target duration, record the flow rate data at multiple moments, and judge whether the flow rate has recovered to stability or reached the normal flow rate level by analyzing the second mass flow rate data set. When the data set meets the preset conditions, such as the flow rate continuously being higher than the threshold and maintaining for a sufficient duration, or the standard deviation of the flow rate fluctuation being less than the set value, it indicates that the system has exited the small flow condition or the control tends to be stable. At this time, exit the small flow control mode and switch back to the normal control mode to avoid the overuse of small flow control parameters in non-necessary scenarios; avoid the overuse of the small flow control mode, reduce the action frequency of the actuator, extend the service life of the equipment, and reduce the maintenance cost and energy consumption. That is, in the small flow control mode, precise control is achieved by dynamically optimizing the PID parameters. During the control process, the system continuously monitors the mass flow rate data of the fluid. When the flow rate gradually increases and stabilizes to a certain level, it is determined whether to exit the small flow control mode by judging whether the second mass flow rate data set meets the preset conditions. This process reflects a data-driven dynamic control strategy that can flexibly adjust the control mode according to the actual working conditions. By monitoring the second mass flow rate data set and judging whether it meets the preset conditions, the system can flexibly switch between the small flow control mode and the normal control mode, avoiding unnecessary complexity; exiting the small flow control mode in a timely manner after the flow rate returns to normal can reduce the waste of computing resources and improve the overall operation efficiency of the system; by flexibly switching the control mode, optimal control can be achieved within different flow rate ranges, further improving the production efficiency and product quality.

[0036] Taking the above preset flow rate threshold of 0.5 kg / h as an example, after dynamically optimizing the PID parameters and performing closed-loop control for a period of time (the target duration, such as 10 minutes), the system collects the mass flow rate data of the target liquid medicine at multiple second moments to form a second mass flow rate data set. Suppose the second mass flow rate data set is as follows: at the 2nd minute (0.42 kg / h), at the 4th minute (0.45 kg / h), at the 6th minute (0.48 kg / h), at the 8th minute (0.52 kg / h), at the 10th minute (0.55 kg / h), and then judge whether the second mass flow rate data set meets the preset conditions, and further judge whether to exit the small flow control mode. In practical applications, when exiting the small flow control mode, the normal control mode can be entered, and a PID algorithm with fixed parameters is used for flow rate control. For example, a pre-stored PID parameter group is called for flow rate control.

[0037] In an optional embodiment, when the second mass flow rate data set meets a preset condition, the small flow control mode is exited, including at least one of the following: when the mass flow rates included in the second mass flow rate data set are all greater than or equal to a preset flow rate threshold and the target duration is greater than or equal to a preset duration threshold, the small flow control mode is exited; when the mass flow rates included in the second mass flow rate data set are all greater than or equal to a preset flow rate threshold and the standard deviation of the flow rate fluctuation of the target fluid determined according to the second mass flow rate data set is less than a preset fluctuation threshold, the small flow control mode is exited.

[0038] In the above embodiment, when the mass flow rates in the second mass flow rate data set are all greater than or equal to the preset flow rate threshold and the target duration is greater than or equal to the preset duration threshold, or when the mass flow rates in the second mass flow rate data set are all greater than or equal to the preset flow rate threshold and the standard deviation of the flow rate fluctuation of the target fluid determined according to the second mass flow rate data set is less than the preset fluctuation threshold, the small 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 small flow control mode in a timely manner when certain conditions are met, optimize the control process, and improve the overall measurement accuracy and control effect.

[0039] If, within the target duration, all mass flow rate data are greater than or equal to the preset flow rate threshold and the target duration is greater than or equal to the preset duration threshold, it is considered that the flow rate has stabilized within the normal range and the small flow control mode can be exited; if all mass flow rate data are greater than or equal to the preset flow rate threshold and the standard deviation of the flow rate fluctuation of the target fluid is less than the preset fluctuation threshold, it is considered that the flow rate has tended to be stable and the small flow control mode can also be exited; the first exit condition is judged from the dimensions of the absolute value of the flow rate and the duration, and the second exit condition is judged from the dimensions of the absolute value of the flow rate and the flow rate stability, avoiding misjudgment caused by instantaneous flow rate fluctuations when judging exit only based on a single flow rate threshold, resulting in frequent mode switching; the comprehensive judgment mechanism can flexibly adjust the exit conditions according to the actual working conditions, making the system more adaptable and applicable to different industrial scenarios. Through more precise judgment of the exit conditions, the small flow control mode can be exited in a timely manner after the flow rate returns to normal, reducing unnecessary complexity and improving the overall efficiency of the system; at the same time, it can also effectively prevent frequent mode switching and premature or late exit, reduce overshoot and oscillation during the control process, and maintain the stability of the system operation.

[0040] Taking the above preset flow threshold of 0.5 kg / h as an example, assume the following second mass flow data set: at 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 first exit condition; the average flow is 0.57 kg / h, and the calculated standard deviation of flow fluctuation σ = 0.03 kg / h. Assuming the preset fluctuation threshold is 0.03 kg / h, this also meets the above second exit condition. Based on the above data, the system meets any one of the first exit condition and the second exit condition, so the system will exit the small flow control mode and switch back to the conventional control mode.

[0041] In an alternative embodiment, a set of PID control parameters is dynamically optimized based on a set of characteristic data of the target fluid, including: using a trained machine learning model, inputting a set of characteristic data, the first mass flow, and the target set flow, and outputting a recommended PID parameter combination; determining the recommended PID parameter combination as a set of PID control parameters.

[0042] In the above embodiment, by using a trained machine learning model, inputting a set of characteristic data of the target fluid, the first mass flow, and the target set flow, a recommended PID parameter combination can be dynamically output and determined as a set of PID control parameters. Finally, based on this set of PID control parameters, closed-loop control of the target fluid flow is performed, which can avoid the problems of unstable control in the small flow range and low measurement accuracy caused by using a PID control algorithm with fixed parameters in the related art, and achieve more accurate and stable flow control in the small flow range.

[0043] Input the characteristic data of the target fluid (such as viscosity, temperature, pressure), the current mass flow rate (the first mass flow rate), and the target set flow rate into the trained machine learning model. The machine learning model outputs a recommended combination of PID parameters based on the input data, and determines the recommended combination of PID parameters output by the model as the PID control parameters actually used. By learning the complex relationship between fluid characteristics and PID parameters in historical data, the machine learning model can dynamically adjust the PID parameters according to real-time input data, thereby achieving more accurate flow control. The machine learning model of this embodiment simultaneously considers fluid characteristics (such as viscosity, temperature, pressure data), the current flow state (such as the first mass flow rate), and the control target (such as the target set flow rate), and online outputs a combination of PID parameters that matches the current working condition through multi-parameter collaborative optimization. This embodiment is based on machine learning technology to explore the complex non-linear relationship between fluid characteristics, real-time flow rate, and optimal PID parameters. By collecting a historical data set containing characteristic data such as fluid viscosity, temperature, pressure, as well as the actual flow rate, set flow rate, and optimal PID parameters under corresponding working conditions, train the initial machine learning model (such as neural network, random forest, etc.). In the small flow control mode, input the real-time collected fluid characteristic data, the current first mass flow rate, and the target set flow rate into the trained model. The model outputs a combination of PID parameters (proportional coefficient P, integral time I, derivative time D) that adapts to the current working condition based on the learned mapping relationship, 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 rules under different fluid characteristics and working conditions, adapt to changes in characteristics such as temperature and viscosity without manual intervention, and significantly improve the adaptive control ability of the system under complex and changeable working conditions; replace the traditional manual trial-and-error parameter adjustment method, and the model trained based on historical data can quickly output the optimal combination of PID parameters, greatly shortening the system debugging time under new working conditions and improving the 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 the PID parameters according to real-time input data, has stronger adaptability, and can cope with complex working condition changes; introducing machine learning technology enables the system to have learning and prediction capabilities, improves the intelligent level of the system, and provides a more efficient technical means for industrial automation control; by dynamically optimizing the PID parameters through the machine learning model, it can better adapt to the changes in fluid characteristics within the small flow range and significantly improve the control accuracy.

[0044] In an alternative embodiment, the machine learning model is trained as follows: Obtain a historical data set, where the historical data set includes multiple sets of mass flow rate sample data, and each set of mass flow rate sample data includes viscosity data, temperature parameters, pressure parameters, actual flow rate, set flow rate, and corresponding PID control parameters of a fluid; Divide the historical data set into a training set and a validation set; Use the training set to train an initial model, evaluate the performance of the initial model using the validation set, and adjust 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, end the training, and use the initial model obtained at the end of the training as the machine learning model.

[0045] In the above embodiment, the machine learning model is trained using the obtained 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 on the target fluid flow rate, which can improve the flow control accuracy of the mass flowmeter in the small flow rate range, reduce the influence of measurement noise and control delay, and make the control more stable; Using the validation set to evaluate and adjust the hyperparameters of the initial model to ensure that the model is used as the final model after the performance index on the validation set reaches the preset threshold can ensure the accuracy and reliability of the machine learning model to output the recommended PID parameter combination.

[0046] Obtain a historical dataset containing multiple sets of mass flow sample data. Each set of data includes the viscosity, temperature, pressure, actual flow rate, set flow rate of the fluid, and the corresponding PID control parameters. For example, collect the optimal PID parameters (obtained through expert manual tuning or system identification) under different temperature (20 - 60 °C), pressure (0.1 - 0.5 MPa), and flow rate (10 - 50 mL / min) conditions to form 1000 (or 10000) 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), optimal PID parameters (P = 0.85, I = 10, D = 2). This is only an exemplary set of sample data. The historical dataset can also include more mass flow sample data with different fluid characteristics, including the corresponding optimal PID parameter combinations, as well as sample data that is not an optimal PID parameter combination. Divide the historical dataset into a training set and a validation set. The training set is used for model training, and the validation set is used to evaluate the model performance. Use the training set to train the initial model and use the validation set to evaluate the model performance. According to the evaluation results of the validation set, adjust the hyperparameters of the model to optimize the performance. When the performance index of the model on the validation set reaches the preset threshold, end the training, and use the finally obtained model as the machine learning model. That is, collect historical samples containing fluid characteristics (viscosity, temperature, pressure), flow rate status (actual flow rate, set flow rate), and the corresponding PID parameters to form a multi-dimensional input-output dataset. Divide the dataset 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.), minimize the error between the predicted PID parameters and the actual optimal parameters. When the performance of the model on the validation set (such as mean square error, R 2 value) reaches the preset threshold, stop the training to ensure that the model is neither overfitting nor underfitting. In this way, the model can learn the complex relationship between fluid characteristics and PID parameters, thereby achieving precise parameter optimization. In this embodiment, by training the model with a large amount of historical data, the complex relationship between fluid characteristics and PID parameters can be learned, thereby achieving more precise parameter optimization; through the division of the training set and the validation set, and 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 adaptability, and can cope with complex working condition changes.

[0047] In an alternative embodiment, closed-loop control of the flow rate of a target fluid is performed 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, where the feedforward compensation amount is used to compensate the output of the PID controller; pre-adjusting the output term of the PID controller 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.

[0048] In the above embodiment, obtaining a feedforward compensation amount based on the characteristic data of the target fluid and system operating condition data to compensate the output of the PID controller, pre-adjusting the output term of the PID controller, and performing closed-loop control of the flow rate of the target fluid based on a set of PID control parameters can perform more accurate and stable flow rate control for fluids in a small flow rate range, thereby improving the overall measurement accuracy and control effect.

[0049] Based on the characteristic data of the target fluid (such as viscosity, temperature, pressure) and the system operating condition data (such as environmental conditions, equipment status), a feedforward compensation amount is calculated. This feedforward compensation amount is used to compensate the output of the PID controller to adjust the control signal in advance; apply the calculated feedforward compensation amount to the output term of the PID controller to adjust the output of the PID controller in advance; on the basis of feedforward compensation, combined with the dynamically optimized PID control parameters, perform closed-loop control on the flow rate of the target fluid; through feedforward compensation, possible disturbances can be predicted and compensated in advance, reducing the hysteresis of feedback control, thereby improving the response speed and stability of the control system. In the related technology, it is impossible to predict and compensate disturbances in advance according to the system operating conditions and fluid characteristics, resulting in a decrease in control accuracy; in this embodiment, through feedforward compensation, the output of the PID controller can be adjusted 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. Combined with the optimized PID parameters, it further improves the stability of the control system; by combining feedforward control and closed-loop control, the flow rate of the target fluid can be controlled more accurately, especially in the small flow rate range, and the control accuracy can be significantly improved. This embodiment adopts the feedforward-feedback compound control principle and introduces a feedforward compensation mechanism on the basis of PID closed-loop control. The PID control in the related technology relies on feedback information and reacts slowly when facing sudden disturbances, resulting in poor control effects. Relying solely on feedback control cannot effectively cope with known external disturbances or internal changes, easily leading to overshoot or oscillation phenomena. Through the feedforward compensation mechanism, corresponding adjustments can be made before the disturbance occurs, greatly shortening the response time of the system and reducing the control delay; compensating known interference factors (such as temperature changes, air pressure changes, etc.) in advance, making the control system more resistant to the influence of external disturbances and internal changes and maintaining a high control accuracy; in application scenarios with extremely high precision requirements such as small flow rate control, feedforward compensation can significantly reduce the errors caused by fluid characteristics or environmental changes and improve the overall control quality; combining feedforward compensation with PID feedback control avoids the overshoot or oscillation phenomena that may be caused by simply relying on feedback control, making the system more stable and reliable.

[0050] In an alternative embodiment, based on a set of characteristic data of the target fluid and system operating condition data, a feedforward compensation amount is obtained, including: determining a first feedforward control term based on the set of characteristic data, and determining a second feedforward control term based on the system operating condition data, where the feedforward compensation amount includes the first feedforward control term and the second feedforward control term. The first feedforward control term is used to represent the first compensation amount of 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 term is used to represent the second compensation amount of the environmental air pressure change to the output of the PID controller. The system operating condition data includes the environmental air pressure data.

[0051] 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.

[0052] 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 reference temperature preset by the system; 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 reference ambient air pressure preset by the system; 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. Generate compensation in advance based on temperature and pressure changes, and make adjustments before the disturbance actually affects the flow. Compared with traditional feedback control, the response time is shortened by about 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 the disturbance occurs, greatly shortening the system's response time and reducing control delays. Compensate for known interference factors (such as temperature changes, pressure changes, etc.) in advance, so that the control system can better resist the influence of external disturbances and internal changes, and maintain high control accuracy. This strategy can flexibly adapt to different fluid characteristics and environmental conditions. Whether it is a high-temperature, high-pressure scenario, or an environment 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 It 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.

[0053] In an optional embodiment, determining a first feedforward control term based on a set of characteristic data includes: determining a first flow rate change value ΔQ1 = a×ΔT according to the temperature change of the target fluid, where a is the temperature coefficient and ΔT is the temperature change value of the target fluid; determining the first feedforward control term u1 = k1×ΔQ1 according to the first flow rate change value, where k1 is the first feedforward control gain; determining a second feedforward control term based on system operating condition data, including: determining a second flow rate change value ΔQ2 = b×ΔP according to the temperature change of the target fluid, where b is the pressure coefficient and ΔP is the change value of the ambient air pressure data; determining the second feedforward control term u2 = k2×ΔQ2 according to the second flow rate change value, where k2 is the second feedforward control gain.

[0054] In the above embodiment, the first flow rate change value is determined according to the formula based on the temperature change of the target fluid, and then the first feedforward control term is obtained. The second flow rate change value is determined according to the formula based on the ambient air pressure change, and then the second feedforward control term is obtained. The output of the PID controller can be compensated in advance and closed-loop control can be achieved, solving the problem of unstable control in the small flow rate range, improving the measurement accuracy and control effect. At the same time, based on the second mass flow rate data set obtained subsequently, it is judged to exit the small flow rate control mode, realizing flexible and efficient flow rate control.

[0055] Based on the temperature change ΔT of the target fluid and the temperature coefficient a, calculate the first flow rate change value ΔQ1 = a × ΔT. According to the first flow rate change value ΔQ1 and the first feedforward control gain k1, calculate the first feedforward control term u1 = k1 × ΔQ1; based on the ambient air pressure change ΔP and the pressure coefficient b, calculate the second flow rate change value ΔQ2 = b × ΔP. According to the second flow rate change value ΔQ2 and the second feedforward control gain k2, calculate the second feedforward control term u2 = k2 × ΔQ2. The temperature change ΔT indirectly causes the flow rate change ΔQ1 by affecting the fluid viscosity (e.g., an increase in temperature leads to a decrease in viscosity). α is the temperature-flow sensitivity coefficient (which can be calibrated through experiments or derived from mechanisms). The first feedforward control term u1 = k1 × ΔQ1 is used to offset the influence of temperature change on the flow rate in advance; the ambient air pressure change ΔP directly affects the fluid pressure balance (e.g., an increase in air pressure leads to an increase in gas density). β is the air pressure-flow sensitivity coefficient. The second feedforward control term u2 = k2 × ΔQ2 is used to compensate for the interference of air pressure fluctuations on the flow rate; superimpose u1 and u2 to form the total feedforward compensation amount, which is superimposed with the output of the PID controller to drive the actuator, realizing the "predictive" compensation for measurable disturbances. In this embodiment, the complex fluid mechanics relationship is transformed into an easily implementable parametric model through linear approximation (ΔQ = coefficient × change amount), reducing the computational complexity and being applicable to low-cost embedded controllers; the feedforward control term acts immediately when the disturbance occurs. Compared with pure PID control, the adjustment time can be shortened by 30% - 50% (e.g., when there is a temperature step change, the time for the system to change from oscillation to stability is reduced from 8 seconds to 4 seconds); in the small flow rate scenario, by dynamically compensating for temperature / air pressure disturbances, the flow rate control error can be reduced from ±3% full scale to within ±1%, meeting the high-precision requirements in fields such as precision chemical engineering and medical infusion. In this embodiment, by quantifying the influence of temperature change and ambient air pressure change on the flow rate respectively and calculating the compensation amount accordingly, the control accuracy can be significantly improved, especially in the small flow rate range; by combining feedforward compensation and closed-loop control, more accurate flow rate control can be achieved, further improving production efficiency and product quality. In the above embodiment, the temperature data in a set of characteristic data is taken as an example for the first feedforward control term. The first feedforward control term can also be fluid viscosity data or pressure data; similarly, in the above, the second feedforward control term takes the ambient air pressure change as an example, and the system operating condition data can also be pipeline pressure difference, or pump speed, or valve opening degree, etc.

[0056] As an example, assume that in production, the flow rate of a certain fluid needs to be controlled at 10 ml / min, and this flow rate accounts for approximately 2% of the full scale of the flowmeter. This fluid varies significantly with temperature (the viscosity is 300 cP at 20°C and drops to 100 cP at 40°C), and the ambient air pressure in the production workshop fluctuates within a range of ±5 kPa. When the temperature or air pressure changes, the flow control error of traditional PID control reaches ±8%, which cannot meet the accuracy requirement of ±2%. Through the feedforward-feedback composite control strategy, high-precision stable control is achieved. The currently collected fluid characteristic data includes the current temperature T = 25°C, the current viscosity μ = 250 cP, the ambient air pressure P = 101.3 kPa (the reference air pressure is 101 kPa, ΔP = +0.3 kPa), the mass flowmeter obtains the current flow rate Q1 = 9.8 mL / min in real time, and the target set flow rate Q0 = 10 mL / min. The calculation of the first feedforward control term (temperature compensation) is as follows: Based on historical data fitting the temperature-flow relationship, the temperature coefficient a = 0.2 mL / (min·°C) is determined; the temperature change ΔT = T - reference temperature (20°C) = 5°C is calculated; the first flow rate change value ΔQ1 = a × ΔT = 0.2 × 5 = 1 mL / min; the first feedforward control gain k1 = 0.8, and the first feedforward control term u1 = k1 × ΔQ1 = 0.8 mL / min is calculated. The calculation of the second feedforward control term (air pressure compensation) is as follows: The pressure coefficient b = 0.05 mL / (min·kPa); the air pressure change ΔP = 0.3 kPa; the second flow rate change value ΔQ2 = b × ΔP = 0.05 × 0.3 = 0.015 mL / min; the second feedforward control gain k2 = 1, and the second feedforward control term u2 = k2 × ΔQ2 = 0.015 mL / min is calculated. The total feedforward compensation amount: u = u1 + u2 = 0.8 + 0.015 = 0.815 mL / min. It should be noted that in practical applications, the output of the PID can be dimensionless, such as a percentage, for the control signal of the control actuator, such as representing the opening or speed of the actuator; the output of the PID controller can also be directly expressed in flow rate units such as ml / min (or kg / h). This design is usually used in scenarios where the flow rate is directly controlled, and the output of the PID controller is directly expressed as the flow rate set value for controlling the flow regulating valve or the rotational speed of the pump; for example, when the PID controller outputs 50 kg / h, it means that the system needs to adjust the flow rate to 50 kg / h. The output of the PID controller can also be a voltage or current signal for driving the actuator. For example, for a 0 - 10V signal: 0V means the valve is fully closed, 10V means the valve is fully open; for a 4 - 20mA signal: 4mA means the valve is fully closed, 20mA means the valve is fully open.

[0057] As another example, assume that an electronic manufacturing factory needs to precisely control the flow rate of a high-purity cleaning liquid for cleaning semiconductor wafers. The flow rate range of this cleaning liquid is between 0.1 kg / h and 10 kg / h. In the small flow rate range (such as when the flow rate is less than 5% of the full scale of the equipment), it is difficult for the traditional fixed-parameter PID control algorithm to achieve high-precision control. At a certain moment (the first moment), the measured mass flow rate of the target cleaning liquid is 0.3 kg / h. Assuming the full scale of the equipment is 10 kg / h, at this time the flow rate is less than 5% of the full scale (i.e., 0.5 kg / h), which belongs to the small flow rate range, and the system automatically switches to the small flow rate control mode. In the small flow rate control mode, the system dynamically optimizes the PID parameters according to the characteristic data of the cleaning liquid (such as viscosity, temperature, pressure). Assume that the optimized PID parameters are: proportional coefficient (P) = 2.5, integral coefficient (I) = 0.1, derivative coefficient (D) = 0.5; the system performs closed-loop control on the flow rate of the cleaning liquid based on these optimized PID parameters to ensure that the flow rate is stable near the target value. The system further combines a feedforward control mechanism to calculate the feedforward compensation amount according to the characteristic data of the cleaning liquid and the system operating condition data. Assume that the current temperature of the cleaning liquid is 30°C and the ambient air 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): Assume that 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 rate change value ΔQ1 = a × ΔT = 0.02 × 5 = 0.1 kg / h, 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 air pressure change): The air pressure change ΔP = 1.5 bar - 1.0 bar = 0.5 bar (assuming the target air pressure is 1.0 bar), the pressure coefficient b = 0.03 (determined according to empirical formulas or experimental data), the second flow rate change value ΔQ2 = b × ΔP = 0.03 × 0.5 = 0.015 kg / h, the second feedforward control gain k2 = 1.5, the second feedforward control term u2 = k2 × ΔQ2 = 1.5 × 0.015 = 0.0225. The unit of the above temperature coefficient a is kg / (h·°C), the unit of the pressure coefficient is kg / (h·bar), and both the first feedforward gain k1 and the second feedforward gain k2 are coefficients used to scale the compensation amount, with the unit of % / (kg / h). In this way, after compensating the PID control output, the output is the control signal for the control actuator, such as the opening degree of the control valve.

[0058] 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. When the flow rate is less than the preset flow rate threshold, it switches to the small flow rate control mode, which can specifically handle the small flow rate situation and avoid the influence of the limitations of equipment sensitivity and algorithms 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. By performing closed-loop control on the flow rate of the target fluid, the control accuracy in the small flow rate range and the overall measurement accuracy and control effect can be improved.

[0059] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The present application will be specifically described below in conjunction with specific embodiments.

[0060] To solve the problem of improving the control accuracy and stability of the mass flowmeter under small flow rate conditions, the embodiments of the present application propose the following solutions: Specific example: A) First, the system starts the initialization process, including setting initial parameters, calibrating sensors, and activating the control module; B) Then, the mass flow rate of the fluid is monitored in real time, and it is judged whether to enter the small flow rate control mode through a preset small flow rate threshold; C) Next, if the monitored flow rate is lower than the preset threshold, the system automatically switches to the small flow rate control mode. In this mode, an improved PID control algorithm is adopted, in which an adaptive parameter adjustment mechanism is introduced to improve the sensitivity to small flow rate changes; D) In the small flow rate control mode, the system dynamically adjusts the PID parameters according to the actual flow rate of the fluid to optimize the control response speed and stability; E) Finally, the system continuously monitors and adjusts until the flow rate returns to the normal range and automatically exits the small flow rate control mode.

[0061] Furthermore, to solve the problem of PID parameter selection in the small flow rate 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 are most suitable for the current fluid characteristics in real time.

[0062] The implementation method is as follows: The online learning module collects the mass flow rate data under the fluid characteristics and operating conditions in real time to construct a training data set; A supervised learning algorithm, such as support vector machine or neural network, is used to establish a PID parameter prediction model based on a large amount of experimental data; The prediction model is run in real time, and the current fluid characteristics and operating conditions are input, and the recommended PID parameter combination is output; 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.

[0063] To further enhance the stability and response speed of small flow control, a feedforward control strategy is introduced. By analyzing fluid characteristics and external environmental factors, it predicts the possible flow change trend in advance, makes adjustments in advance, and reduces the lag effect.

[0064] The implementation method is as follows: Analyze the characteristics of the fluid such as viscosity, temperature, pressure, etc., as well as factors such as temperature changes and air pressure fluctuations in the external environment, and establish a mathematical model between fluid characteristics and flow change trends; Real-time monitor the above variables, input the current values into the mathematical model, and predict the possible flow change trend in the future for a period of time; According to the prediction results, pre-adjust the output of the PID controller, reduce the control response time, and improve the forward-looking and stability of the control.

[0065] The technical effects are as follows: Because an adaptive PID parameter adjustment mechanism is adopted, the control accuracy and stability under small flow conditions are significantly improved; Because machine learning algorithms are combined to dynamically optimize PID parameters, it can more flexibly cope with changes in different fluid characteristics and operating conditions, and improve the intelligent level of control; Because a feedforward control strategy based on fluid characteristics and external environmental factors is introduced, it can reduce control lag, improve the rapid response ability to flow changes, and further enhance the overall control performance of the system.

[0066] This application also provides a flow control device for a mass flowmeter, as Figure 3 shown, Figure 3 is a structural block diagram of a flow control device for a mass flowmeter provided by an embodiment of this application. The device includes: A monitoring module 31, which is used to monitor the first mass flow of the target fluid at the first moment and determine whether the first mass flow is less than a preset flow threshold; A switching module 32, which is used to switch to the small flow control mode when the first mass flow is less than the preset flow threshold; An optimization module 33, which is 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, where 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 34, which is used to perform closed-loop control on the flow of the target fluid based on a set of PID control parameters.

[0067] It should be noted that when the system provided in the above embodiments realizes its functions, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is 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 belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.

[0068] This application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed, the method steps described in any one of the above are executed.

[0069] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM), random access memories (RAM), mobile hard disks, magnetic disks, or optical discs and other media that can store computer programs.

[0070] This application also discloses an electronic device. As Figure 4 shown, Figure 4 is a schematic structural diagram of an electronic device disclosed in an embodiment of this application. 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.

[0071] Among them, the communication bus 402 is used to realize the connection and communication between these components.

[0072] Among them, the user interface 403 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 403 may further include a standard wired interface and a wireless interface.

[0073] Among them, the network interface 404 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0074] Among them, the processor 401 may include one or more processing cores. The processor 401 is connected to various parts within the entire electronic device (such as a server) through various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 405, and by invoking the data stored in the memory 405, it performs various functions of the server and processes data. Optionally, the processor 401 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 401 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 401 and may be implemented separately by a single chip.

[0075] Among them, the memory 405 may include random access memory (RAM) and may also include 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, code, code sets, or instruction sets. The memory 405 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch control function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 405 may also be at least one storage device located far from the aforementioned processor 401. Refer to Figure 4 , in the memory 405, as a computer storage medium, there may be included an operating system, a network communication module, a user interface module, and an application program for a flow control method of a mass flowmeter.

[0076] In Figure 4In the electronic device 400 shown, the user interface 403 is mainly used to provide an interface for the user to input and obtain the data input by the user. The processor 401 can be used to call an application program of a flow control method of a mass flowmeter stored in the memory 405. When executed by one or more processors 401, the electronic device 400 is caused to execute one or more of the methods as described in the foregoing embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be adopted in other sequences 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 essential to the present application.

[0077] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0078] In several implementation manners provided by the present 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 illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some service interfaces. The indirect couplings or communication connections of the devices or units can be in electrical or other forms.

[0079] The foregoing are only exemplary embodiments of the present disclosure and should not be used to limit the scope of the present disclosure. That is, all equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. After considering the disclosure of the specification, those skilled in the art will easily think of other implementation manners of the present disclosure.

[0080] The present application aims to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not recorded in the present disclosure.

Claims

1. A flow control method for a mass flowmeter, characterized in that, Including: Monitoring the first mass flow rate of the target fluid at a first moment and determining whether the first mass flow rate is less than a preset flow rate threshold; Switching to a small flow rate control mode when the first mass flow rate is less than the preset flow rate threshold; In the small flow rate 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, where 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.

2. The method according to claim 1, wherein 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: Obtaining a second mass flow rate data set of the target fluid within a target duration, where the second mass flow rate data set includes the mass flow rates of the target fluid at a plurality of second moments, and the second moment is a moment later than the first moment and after dynamically optimizing the PID parameters; Exiting the small flow rate control mode when the second mass flow rate data set meets a preset condition.

3. The method according to claim 2, wherein Exiting the small flow rate control mode when the second mass flow rate data set meets a preset condition includes at least one of the following: Exiting the small flow rate control mode when the mass flow rates included in the second mass flow rate data set are all greater than or equal to the preset flow rate threshold and the target duration is greater than or equal to a preset duration threshold; Exiting the small flow rate control mode when the mass flow rates included in the second mass flow rate data set are all greater than or equal to the preset flow rate threshold and the standard deviation of the flow rate fluctuation of the target fluid determined according to the second mass flow rate data set is less than a preset fluctuation threshold.

4. The method according to claim 1, wherein Dynamically optimizing 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 a target set flow rate, and outputting a recommended PID parameter combination; Determining the recommended PID parameter combination as the set of PID control parameters.

5. The method according to claim 4, wherein The machine learning model is trained through the following method: Obtaining a historical data set, where the historical data set includes multiple sets of mass flow rate sample data, and each set of mass flow rate sample data includes viscosity data of a fluid, temperature parameters, pressure parameters, actual flow rate, set flow rate, and corresponding PID control parameters; Dividing the historical data set into a training set and a validation set; Using the training set to train an initial model, evaluating the performance of the initial model using the validation set, and adjusting 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.

6. The method according to claim 1, characterized in that, Performing closed-loop control on the flow rate of the target fluid based on the set of PID control parameters, including: Based on a set of characteristic data of the target fluid and system operating condition data, a feedforward compensation amount is obtained, where the feedforward compensation amount is used to compensate the output of the PID controller. Based on the feedforward compensation amount, the output term of the PID controller is adjusted in advance, and based on the set of PID control parameters, the flow rate of the target fluid is closed-loop controlled.

7. The method according to claim 6, wherein Obtaining a feedforward compensation amount based on a set of characteristic data of the target fluid and system operating condition data includes: Determining a first feedforward control term based on the set of characteristic data and a second feedforward control term based on the system operating condition data, where the feedforward compensation amount includes the first feedforward control term and the second feedforward control term. The first feedforward control term is used to represent the first compensation amount of 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, and the second feedforward control term is used to represent the second compensation amount of the ambient air pressure change to the output of the PID controller, and the system operating condition data includes the ambient air pressure data.

8. A flow control device for a mass flowmeter, characterized in that, Includes: A monitoring module for monitoring the first mass flow rate of the target fluid at the first moment and determining whether the first mass flow rate is less than a preset flow rate threshold; A switching module for switching to a small flow rate control mode when the first mass flow rate is less than the preset flow rate threshold; An optimization module for dynamically optimizing PID parameters based on a set of characteristic data of the target fluid in the small flow rate control mode to obtain a set of PID control parameters, where the set of characteristic data at least includes the viscosity data of the target fluid, the temperature data of the target fluid, and the pressure data of the target fluid; A control module for performing closed-loop control on the flow rate of the target fluid based on the set of PID control parameters.

9. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 7.

10. 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 7 is executed.

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

  • Intelligent control method and system for pressurization and flow stabilization of sealing-tape machine pipeline

    CN119620663A

  • Multivariable adaptive feedforward controller

    WO1993004412A1

Cited By

  • High-throughput cell three-dimensional culture equipment and cell culture method

    CN120866061A

  • Flow control method and system, electronic equipment and storage medium

    CN121325983A

  • Semiconductor cleaning equipment temperature control system based on self-adaptive PID (Proportion Integration Differentiation) algorithm

    CN121568535A