A filling equipment control method and system based on time pressure method
By adopting a filling equipment control method based on time-pressure, combined with multi-closed-loop pressure control, dynamic time compensation, and adaptive predictive control, the problems of low filling accuracy and poor stability are solved, achieving high-precision, high-stability, and highly adaptable filling effects, which are suitable for industries such as pharmaceuticals, food, and chemicals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG JINGSHIWEI OPTICAL TECHNOLOGY CO LTD
- Filing Date
- 2026-05-15
- Publication Date
- 2026-06-12
AI Technical Summary
Existing filling technologies suffer from low precision, poor stability, and insufficient adaptability, especially when dealing with liquids of different viscosities and adapting to complex environmental changes, making it difficult to meet the high requirements of modern precision filling.
A time-pressure-based control method for filling equipment is adopted. Through the synergistic effect of dual closed-loop pressure control, dynamic time compensation, three-level control architecture and adaptive algorithm, combined with multi-closed-loop pressure control system, dynamic time compensation, adaptive predictive control and game theory multivariate collaborative optimization, high precision, high stability and strong adaptability are achieved.
It significantly improves filling accuracy and stability, adapts to liquids of different viscosities and complex working conditions, reduces the need for frequent parts replacement during production changes, improves system response speed and operating efficiency, and meets the requirements for high-precision filling.
Smart Images

Figure CN122194705A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of liquid filling technology, specifically to a filling equipment control method and system based on the time-pressure method, which is particularly suitable for precision filling applications in the pharmaceutical, food, and chemical industries. Background Technology
[0002] Current filling technologies primarily employ volumetric or gravimetric methods, which suffer from several technical drawbacks. Traditional volumetric filling accuracy is typically ±2-3%, insufficient for demanding applications such as precision pharmaceutical manufacturing. Filling liquids of varying viscosities often requires changing metering pumps or flow meters of different specifications, leading to low changeover efficiency. Furthermore, variations in ambient temperature and pressure fluctuations can cause significant fluctuations in filling volume, resulting in noticeable accuracy drift over extended periods. In addition, traditional control methods are slow to respond, lack real-time dynamic adjustment capabilities, and adaptive learning abilities, necessitating frequent manual parameter adjustments.
[0003] While existing filling equipment employs the time-pressure method, these devices suffer from limitations such as single-variable pressure control, inaccurate time compensation, and a lack of multi-variable collaborative optimization, failing to meet the high precision and stability requirements of modern precision filling. They are particularly inadequate in handling liquids of varying viscosities and adapting to complex environmental changes, making it difficult to maintain filling accuracy without reducing speed.
[0004] With increasing automation in production and rising product quality requirements, the market demands higher filling accuracy, stability, and adaptability, which traditional filling technologies can no longer meet. Therefore, developing a control method for filling equipment with high precision, high stability, and strong adaptability has significant practical importance and application value. Summary of the Invention
[0005] The purpose of this invention is to provide a filling equipment control method and system based on the time-pressure method. Through the synergistic effect of dual closed-loop pressure control, dynamic time compensation, three-level control architecture and adaptive algorithm, it solves the problems of low filling accuracy, poor stability and insufficient adaptability in the prior art.
[0006] This invention provides a filling equipment control method based on time-pressure method, comprising:
[0007] Obtain the target filling volume, liquid type, and environmental parameters; determine the initial pressure setpoint and initial filling time reference value based on the target filling volume and liquid type; calculate the compensation coefficient according to the environmental parameters and compensate and correct the initial pressure setpoint to obtain the compensated pressure setpoint.
[0008] Based on the compensated pressure setpoint, a target pressure is established using a multi-closed-loop pressure control system. Stable pressure control is achieved through closed-loop collaborative operation, resulting in a stable filling pressure.
[0009] Based on the stable filling pressure, the action delay time of the filling valve is measured, a historical filling error compensation database is established, historical compensation parameters are calculated and error trends are predicted, and the final filling time is calculated based on the initial filling time reference value, the action delay time, the historical compensation parameters and the error trend to obtain the dynamically compensated filling time.
[0010] The filling operation is performed based on the dynamically compensated filling time, and the actual filling volume is collected as the measurement value of the current cycle. The filling error is calculated and stored in the error compensation database. After each preset number of fillings is completed, parameter self-tuning is performed to establish a system dynamic model. Predictive control algorithm is used to optimize parameters. The future output is predicted at the current moment. The objective function is defined to minimize the error between the predicted output and the expected output. The optimal control sequence is solved by rolling optimization and implemented. In the next cycle, prediction and optimization are performed again based on the new measurement value to obtain the optimized control parameters.
[0011] Furthermore, the outer loop control of the multi-closed-loop pressure control system includes:
[0012] The pressure error is calculated based on the compensated pressure setpoint and the real-time detected filling pressure. The outer loop control output is calculated using a PID algorithm with a preset outer loop control cycle. The PID algorithm includes a combination of proportional, integral, and derivative terms to obtain the initial PID control output.
[0013] An anti-integral saturation mechanism is set for the initial PID control output. When the initial PID control output reaches a preset limit threshold, the accumulation of the integral term is stopped and the amplitude of the initial PID control output is limited to obtain the amplitude-limited PID control output.
[0014] The pressure reference value preset based on the target filling volume is used as feedforward compensation. The limited PID control output is added to the feedforward compensation to obtain the outer loop pressure adjustment command.
[0015] Furthermore, the inner loop control of the multi-closed-loop pressure control system includes:
[0016] Based on the outer ring pressure regulation command, a valve position feedback control is used to drive the proportional valve and detect the valve core position of the proportional valve in real time. The difference between the valve core position and the target valve position corresponding to the outer ring pressure regulation command is calculated to obtain the valve position error signal.
[0017] Based on the valve position error signal, the valve opening adjustment amount is calculated through a fast control algorithm. The control cycle of the fast control algorithm is shorter than the preset outer loop control cycle, and an initial valve opening adjustment command is obtained.
[0018] A pressure change rate limit is set for the initial valve opening adjustment command. The rate of change of the initial valve opening adjustment command is constrained within a preset pressure change rate range by a speed limiting process, resulting in a speed-limited valve opening adjustment command.
[0019] Based on the valve opening adjustment command after the speed limit is set, the proportional valve is driven to execute, thereby obtaining the stable filling pressure.
[0020] Further, the step of calculating the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters, and the error trend to obtain the dynamically compensated filling time includes:
[0021] The position of the valve core of the filling valve is monitored in real time by a sensor. The opening delay time from the issuance of the control signal to the start of valve core action and the closing delay time from the issuance of the closing signal to the complete closure of valve core are recorded. The opening delay time and the closing delay time are added together to obtain the action delay time.
[0022] Historical filling data is extracted from the error compensation database, the error between the actual filling amount and the target filling amount for each filling is calculated, the corresponding time compensation amount is calculated based on the error, and the average of multiple time compensation amounts is obtained to obtain the historical average compensation time. The error in the historical filling data is analyzed and the error change trend value is obtained by using the weighted moving average method. The historical average compensation time and the error change trend value are combined to obtain the historical compensation parameter.
[0023] Based on the initial filling time baseline value, the first correction is made in combination with the historical average compensation time in the historical compensation parameters, and then the trend prediction correction is made according to the error change trend value to obtain the filling time after historical data correction.
[0024] Based on the target filling volume, the stable filling pressure, and the preset flow coefficient, the theoretical filling time under the current working conditions is calculated. The theoretical filling time is then weighted and fused with the historical data-corrected filling time to obtain the fused filling time.
[0025] The dynamically compensated filling time is obtained by adding the fused filling time to the action delay time.
[0026] Furthermore, the steps of the parameter self-tuning and predictive control algorithm include:
[0027] When the cumulative filling count reaches the preset filling count, the parameter self-tuning algorithm is activated to establish a discrete state space model. Historical data is extracted from the error compensation database, and the system parameters are identified online using the recursive least squares algorithm. The system matrix and control matrix of the discrete state space model are then updated to obtain the updated system dynamic model.
[0028] Based on the updated system dynamic model, the system state at the current moment is obtained. According to the state transition equation of the updated system dynamic model and the preset control input sequence, the filling pressure and filling volume at each moment within the preset sampling period are predicted sequentially using an iterative calculation method as the predicted output at each moment. The predicted outputs at each moment are combined in chronological order to obtain the predicted output sequence.
[0029] Based on the predicted output sequence, the deviation between the predicted output and the corresponding expected output at each time step in the predicted output sequence is calculated. The increment between the control quantities at adjacent time steps in the control input sequence is calculated. An objective function is constructed such that the objective function includes the weighted sum of squares of the deviation and the weighted sum of squares of the increment. The optimization problem of minimizing the objective function is solved by a quadratic programming method to obtain the optimized control sequence.
[0030] The first control variable in the optimized control sequence is extracted as the actual control output of the current cycle and implemented into the filling system. In the next control cycle, new measurement values are collected to update the system state. Based on the new measurement values and the updated system state, the prediction and optimization process is re-executed to form a closed-loop feedback of rolling optimization, thereby obtaining the optimized control parameters.
[0031] Furthermore, a dynamic constraint tightening function based on contraction analysis is added to the predictive control algorithm, including:
[0032] The Jacobian matrix of the system is calculated based on the discrete state-space model. The Jacobian matrix is decomposed to obtain the maximum singular value. The contraction rate at the current moment is calculated based on the maximum singular value. The contraction rate characterizes the convergence speed of the system's state trajectory, and the system contractility evaluation index is obtained.
[0033] Based on the system contractility evaluation index, a contraction rate threshold is set to divide the contraction rate range into multiple convergence levels. The corresponding constraint tightening coefficient is determined according to the convergence level to which the current contraction rate belongs, thus obtaining the dynamic constraint tightening coefficient.
[0034] Based on the dynamic constraint tightening coefficient, the tightened constraint range is calculated to obtain the dynamic tightened constraint conditions.
[0035] Based on the constraints after dynamic tightening, a contraction penalty term is added to the objective function. The optimal control sequence is obtained by solving the optimization problem with dynamic constraints, resulting in optimized control parameters with contraction analysis and constraint tightening functions.
[0036] Furthermore, the steps of calculating the shrinkage rate and adjusting the constraint strategy include:
[0037] At the beginning of each control cycle, the current filling pressure and current filling volume are collected as current state data. Based on the system matrix of the discrete state space model and the current state data, the Jacobian matrix is calculated. The Jacobian matrix is decomposed using a decomposition algorithm to obtain singular value vectors. The maximum singular value is extracted from the singular value vectors, the shrinkage rate is calculated, and the shrinkage rate is filtered to obtain the filtered shrinkage rate as the system shrinkage evaluation index at the current moment.
[0038] Set multi-level shrinkage rate thresholds, determine the convergence level based on the relationship between the filtered shrinkage rate and each shrinkage rate threshold, and set the corresponding constraint tightening coefficient to obtain the constraint tightening coefficient corresponding to the current convergence level.
[0039] The constraint tightening coefficients are updated smoothly using a filter to obtain smoothed constraint tightening coefficients;
[0040] Based on the smoothed constraint tightening coefficient, the tightened pressure constraint range and time constraint range are calculated to obtain a smooth dynamic constraint adjustment strategy.
[0041] Furthermore, the predictive control algorithm is enhanced with a game theory-based multivariate collaborative optimization function, including:
[0042] The filling control system is divided into multiple subsystems, and each subsystem is defined as a game participant. Decision variables and local cost functions are defined for each game participant. The local cost function includes a tracking error term, a coupling term, and a control smoothness term, thus obtaining a game theory model.
[0043] Historical filling data is extracted from the error compensation database, the historical filling data is preprocessed, and a response mapping function for each decision variable is established using machine learning methods to obtain the optimal response mapping model.
[0044] Based on the local cost function in the game theory model, the sensitivity coefficient of each decision variable to filling error is calculated using the sensitivity analysis method. According to the magnitude of the sensitivity coefficient, the decision variables are divided into dominant variables and subordinate variables. A game structure is established in which the dominant variable is optimized first and the subordinate variable is adjusted in response, thus obtaining the dominant-subordinate relationship.
[0045] Based on the dominant-subordinate relationship and the optimal response mapping model, a game-theoretic optimization framework is used to iteratively calculate the optimal values of the dominant and subordinate variables. When the change in the iterative values of both the dominant and subordinate variables is less than a preset convergence threshold, convergence is determined. The iterative values of the dominant and subordinate variables at the time of convergence are combined to obtain the optimized control parameters with game-theoretic multivariate collaborative optimization function.
[0046] Furthermore, the steps of establishing the optimal response mapping model and the game optimization process include:
[0047] A neural network is constructed to establish the optimal response mapping model. The historical filling data is used as training data. The neural network is trained using a supervised learning method. A loss function is defined and the neural network parameters are iteratively updated through an optimization algorithm until convergence, thus obtaining the trained optimal response mapping model.
[0048] Based on the trained optimal response mapping model, the contribution value of each decision variable to the filling error is calculated. The decision variables are ranked according to the contribution value. The decision variables ranked at the top of the preset proportion are determined as dominant variables and the decision variables ranked at the bottom of the preset proportion are determined as subordinate variables, thus obtaining the dominant-subordinate relationship.
[0049] Initialize the initial values of the dominant variable and the dependent variable, enter the iterative loop to execute the optimization step, optimize the dominant variable first to obtain the dominant variable iterative value in each iteration, and then calculate the optimal response value of the dependent variable based on the dominant variable iterative value through the trained optimal response mapping model as the dependent variable iterative value to obtain the hierarchical optimization iterative result;
[0050] Calculate the changes in the iterative values of the dominant variable and the subordinate variable. When the changes in the iterative values of both the dominant variable and the subordinate variable are less than a preset convergence threshold, convergence is determined. Extract the iterative values at the time of convergence to obtain the control parameters for game theory optimization.
[0051] Furthermore, a piecewise affine approximation modeling method is applied to the discrete state-space model, including:
[0052] The system working area is divided into multiple dimensions based on the range of system working parameters. The results of the multiple dimensions are combined to obtain multiple working sub-regions. Each working sub-region is determined by multiple parameter sub-intervals, thus obtaining the system working area division result.
[0053] Historical filling data is extracted from the error compensation database. The working sub-region to which the historical filling data belongs is determined based on the parameter values in the historical filling data and assigned to the corresponding working sub-region. An affine state space model is established for the historical filling data in each working sub-region and the model parameters are identified to obtain the affine model parameters of each working sub-region.
[0054] The current state is collected during the control cycle, the distance from the current state to each working sub-region is calculated, and several working sub-regions with the smallest distance are selected as active regions to obtain a set of active regions.
[0055] The weight function value is calculated and normalized for each active region in the set of active regions. The affine model parameters of each active region are weighted and combined to obtain the piecewise affine approximation model used in the current control cycle.
[0056] Furthermore, the subsystem decomposition and distributed optimization process in the piecewise affine approximation modeling method includes the following steps:
[0057] Based on the physical structure of the filling system, the filling control system is decomposed into multiple subsystems. State variables and control inputs are defined for each subsystem, and coupling variables between subsystems are defined to obtain the subsystem decomposition structure.
[0058] A piecewise affine model is established for each subsystem in its corresponding working sub-region. The piecewise affine model describes the relationship between the state variables of the subsystem and the control input and coupling variables through the state transition equation, thus obtaining the piecewise affine model of each subsystem.
[0059] A local optimization problem is set for each subsystem. The objective function of the local optimization problem includes a state tracking error term and a control cost term. The constraints of the local optimization problem include the state transition equation and input-output constraints of the piecewise affine model. Thus, the local optimization problem of each subsystem is obtained.
[0060] A distributed coordination optimization method is adopted to solve the problem. A consistency constraint is introduced to require that the estimated values of the coupling variables of each subsystem are consistent. Iterative optimization is performed until convergence. During the iteration process, each subsystem solves the local optimization problem in parallel. The coordination center updates the consensus estimate of the coupling variables. When the amount of change in the iteration is less than the preset convergence threshold, convergence is determined and the control sequence of each subsystem is extracted to obtain the distributed optimization result.
[0061] The present invention also provides a filling equipment control system based on the time-pressure method, comprising:
[0062] The parameter acquisition module is used to acquire the target filling volume, liquid type and environmental parameters, determine the initial pressure setpoint and initial filling time reference value based on the target filling volume and liquid type, calculate the compensation coefficient according to the environmental parameters and compensate and correct the initial pressure setpoint to obtain the compensated pressure setpoint.
[0063] The multi-closed-loop pressure control module is used to establish a target pressure based on the compensated pressure setpoint using a multi-closed-loop pressure control system, and to achieve stable pressure control through closed-loop collaborative operation, thereby obtaining a stable filling pressure.
[0064] The dynamic time compensation module is used to measure the action delay time of the filling valve based on the stable filling pressure, establish a historical filling error compensation database, calculate historical compensation parameters and predict error trends, and calculate the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters and the error trend to obtain the dynamically compensated filling time.
[0065] The adaptive optimization control module is used to perform filling operations based on the dynamically compensated filling time and collect the actual filling volume as the measurement value of the current cycle, calculate the filling error and store it in the error compensation database, perform parameter self-tuning after each preset number of fillings, establish a system dynamic model, use predictive control algorithm to optimize parameters, predict future output at the current moment, define an objective function to minimize the error between the predicted output and the expected output, solve for the optimal control sequence through rolling optimization and implement it, and re-predict and optimize based on the new measurement value in the next cycle to obtain the optimized control parameters.
[0066] The beneficial technical effects of this invention include:
[0067] Through the synergistic effect of multiple technologies, the problems of low accuracy, poor stability, and insufficient adaptability of traditional filling technologies are effectively solved, resulting in significant technological benefits. The dual closed-loop pressure control system, combining anti-integral saturation and feedforward compensation, achieves high-precision and stable control of filling pressure, keeping pressure fluctuations within a minimal range. Dynamic time compensation accurately calculates valve action delays, and by combining historical error trends with weighted fusion of theoretical calculations, the accuracy of time control is greatly improved. Adaptive predictive control, combined with contraction analysis dynamic constraints, achieves real-time parameter optimization through rolling optimization, effectively suppressing accuracy drift caused by environmental disturbances and equipment aging. Game theory multivariate collaborative optimization and piecewise affine modeling adapt to liquids of different viscosities and diverse operating conditions, eliminating the need for frequent parts replacement during production changes, and the self-tuning algorithm reduces manual intervention. At the same time, distributed optimization reduces computational complexity, improves system response speed and operating efficiency, and achieves filling accuracy far superior to traditional methods. Attached Figure Description
[0068] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 A flowchart illustrating the filling equipment control method based on the time-pressure method is provided for this invention.
[0070] Figure 2 This invention provides a schematic diagram of the structure of a filling equipment control system based on the time-pressure method. Detailed Implementation
[0071] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0072] Example 1:
[0073] like Figure 1 As shown, the present invention provides a filling equipment control method based on the time-pressure method, comprising:
[0074] Step S1: Obtain the target filling volume, liquid type and environmental parameters; determine the initial pressure setting value and the initial filling time reference value based on the target filling volume and the liquid type; calculate the compensation coefficient according to the environmental parameters and compensate and correct the initial pressure setting value to obtain the compensated pressure setting value.
[0075] Step S2: Based on the compensated pressure setpoint, a target pressure is established using a multi-closed-loop pressure control system. Stable pressure control is achieved through closed-loop collaborative operation to obtain a stable filling pressure.
[0076] Step S3: Based on the stable filling pressure, measure the action delay time of the filling valve, establish a historical filling error compensation database, calculate historical compensation parameters and predict error trends, calculate the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters and the error trends, and obtain the dynamically compensated filling time.
[0077] Step S4: Based on the dynamically compensated filling time, perform the filling operation and collect the actual filling volume as the measurement value of the current cycle. Calculate the filling error and store it in the error compensation database. After each preset number of fillings, perform parameter self-tuning, establish a system dynamic model, and use a predictive control algorithm to optimize the parameters. Predict the future output at the current moment, define the objective function to minimize the error between the predicted output and the expected output, solve for the optimal control sequence through rolling optimization and implement it. In the next cycle, predict and optimize again based on the new measurement value to obtain the optimized control parameters.
[0078] Specifically, firstly, the basic parameters for the filling task are obtained through a human-machine interface or a host computer system. The operator inputs the target filling volume, which can be precisely set from microliters to larger volumes and flexibly adjusted according to different product requirements. Simultaneously, the operator selects or inputs liquid type information, including liquid name, density, viscosity, and temperature sensitivity. These parameters are pre-set for commonly used liquids; for new liquids, the operator needs to provide detailed physical property data or obtain it through the system's auxiliary measurement functions. Environmental parameters are also automatically collected through built-in temperature, humidity, and pressure sensors to obtain the current ambient temperature, humidity, and pressure values. These parameters will be used for subsequent compensation calculations.
[0079] After obtaining the basic parameters, the initial process parameters are retrieved from the formula database. The formula database is the core knowledge base of the system, storing the optimal process parameters for different liquids under various filling volume conditions. Based on the input target filling volume and liquid type, the system precisely matches the closest formula record and extracts the corresponding initial pressure setpoint and initial filling time baseline value. For records with a perfect match, the stored parameters are used directly; for those with a partial match, an interpolation algorithm is used to calculate appropriate parameter values. For example, if the database contains records for 100 ml and 200 ml, and the target is 150 ml, the corresponding parameters will be generated through linear or non-linear interpolation.
[0080] Environmental compensation calculations are a crucial step in ensuring filling accuracy. The differences between current environmental parameters and standard conditions are analyzed, with particular attention to temperature. Temperature changes significantly affect the physical properties of liquids, such as density, viscosity, and surface tension, thus impacting flow resistance and actual flow rate. Based on a temperature sensitivity model of the liquid, the changes in physical properties caused by temperature deviations are calculated and then converted into pressure compensation coefficients. For example, when the ambient temperature is higher than the standard temperature, the liquid viscosity typically decreases, requiring a reduction in filling pressure; conversely, a decrease requires an increase in pressure. The initial pressure setpoint is multiplied by the calculated compensation coefficient to obtain the compensated pressure setpoint, which will serve as the actual target value for the pressure control system.
[0081] Pressure control is a fundamental aspect of time-pressure filling. A multi-closed-loop pressure control architecture is employed, including a main pressure control loop and multiple auxiliary control loops. The main pressure control loop targets a compensated pressure setpoint, using a precision pressure sensor to monitor the actual pressure in the filling pipeline in real time, calculates the pressure deviation, and outputs a control signal through an advanced control algorithm. The control algorithm employs adaptive PID control, which automatically adjusts the proportional, integral, and derivative parameters based on the system's response characteristics, ensuring rapid response and stable control.
[0082] The auxiliary control loops include feed pressure control, valve position control, and liquid level balance control. These loops work in conjunction with the main loop to maintain the stability of the filling system. Feed pressure control ensures that the liquid entering the filling system has a stable source pressure, reducing external disturbances; valve position control precisely adjusts the opening of the pressure regulating valve to achieve fine-tuning of the pressure; and liquid level balance control maintains the stability of the liquid level in the intermediate buffer tank, avoiding pressure fluctuations caused by level changes. These control loops employ a hierarchical coordination strategy, with the main loop issuing control objectives and the auxiliary loops responsible for execution and feedback, forming a complete control closed loop.
[0083] A segmented control strategy is employed during the pressure build-up process: in the initial rapid approach phase, the system quickly approaches the target pressure area with a large step size; in the fine adjustment phase, the control step size is reduced to precisely adjust to the target pressure; in the stable maintenance phase, a precision control mode is entered to actively suppress various disturbance factors and ensure that the pressure fluctuates stably near the target value by no more than ±0.2%. The entire pressure build-up and stabilization process is typically completed within 200-500 milliseconds, creating stable conditions for subsequent precise filling.
[0084] After the pressure stabilizes, the action delay time of the filling valve is measured. High-precision timing analysis technology is used to record the time difference between the issuance of the control signal and the actual completion of the valve's action. The measurement process consists of two parts: opening delay measurement and closing delay measurement. First, a short-pulse valve opening signal is issued, and simultaneously a precision timer is started. The actual start time of liquid flow is detected by a flow sensor or photoelectric sensor, and the opening delay time is calculated. Then, a valve closing signal is issued, and the moment when the liquid stops flowing is detected again by a sensor, and the closing delay time is calculated. These two delay times are analyzed together to generate a valve action delay characteristic model under the current operating conditions, providing a precise compensation basis for subsequent time control.
[0085] The historical filling error compensation database forms the foundation for the system's self-learning. After each filling cycle, the actual filling volume is measured using a high-precision electronic balance or flow meter, compared with the target filling volume to calculate the error, and all parameters during the filling process are recorded, including pressure curves, temperature, filling time, and actual measurement results. This data is stored in a structured format in the error compensation database, forming the system's experience knowledge base. The database employs a time-series storage structure, supporting efficient time-dimensional queries and analysis, facilitating the identification of long-term trends in system performance.
[0086] Based on accumulated historical data, historical compensation parameters are calculated. Filling records under the same or similar conditions from the most recent N times (typically 20-50 times) are extracted from the database. Statistical analysis methods are applied to calculate the mean, standard deviation, and distribution characteristics of systematic errors. These statistical parameters reflect the system's stability under current operating conditions, providing a basis for compensation calculations. Time series analysis methods, such as exponentially weighted moving average, autoregressive integral moving average (ARIMA), or long short-term memory networks (LSTM), are also applied to perform trend analysis on historical error sequences, identifying patterns of system performance changes over time and predicting potential future error trends. This forward-looking analysis enables the system to anticipate and compensate for predictable but yet-to-occur error changes, significantly improving control accuracy.
[0087] The calculation of the final filling time is a multi-factor comprehensive optimization process. First, starting with the initial filling time baseline, basic compensation is performed by incorporating measured action delay times to ensure the actual valve opening time meets theoretical requirements. Then, average error compensation from historical compensation parameters is applied to correct system stability deviations. Next, forward-looking compensation is performed based on error trend predictions to address dynamic changes in system performance. Specific current conditions, such as real-time liquid temperature, viscosity, and environmental fluctuations, are also considered for fine-tuned compensation adjustments. Finally, the calculated filling time is validated to ensure it remains within a reasonable range and prevents over-adjustment due to abnormal compensation. This multi-level, comprehensive time calculation process ensures that the final dynamically compensated filling time has high accuracy and adaptability.
[0088] The filling execution stage is the implementation phase of the control method. Based on the dynamically compensated filling time calculated, the opening and closing of the filling valve are precisely controlled. The filling execution employs sophisticated timing control technology with a time resolution of 0.1 milliseconds, ensuring that the timing of the control signal issuance precisely matches the calculation time. During the filling process, various parameters are monitored in real time, including actual pressure curves, flow curves, and cumulative volume estimates. By comparing these real-time data with historical standard patterns, anomalies can be detected promptly, and countermeasures can be taken, such as interrupting abnormal filling or triggering alarm prompts. After filling is completed, the actual filling volume is measured using built-in or externally connected high-precision metering equipment, and the precise values are recorded for subsequent analysis and optimization.
[0089] Filling error calculation and data storage are crucial aspects of closed-loop control. The actual filling volume is compared with the target filling volume to calculate the absolute and relative errors. Relative error, usually expressed as a percentage, is a primary indicator for evaluating filling accuracy. The calculated errors are validated to eliminate potential measurement anomalies. The error values, along with complete filling parameters, are then stored in the error compensation database. The stored data includes comprehensive information such as filling timestamp, target filling volume, actual filling volume, error value, liquid type, filling pressure curve, environmental conditions, and valve response characteristics, providing detailed data support for subsequent analysis and optimization.
[0090] Parameter self-tuning is the core mechanism for continuous system optimization. A predetermined threshold for the number of filling cycles is set, typically 50-100. When the cumulative number of filling cycles reaches this threshold, the parameter self-tuning process is automatically triggered. The self-tuning process first comprehensively analyzes historical data in the error compensation database to evaluate the effectiveness of the current control strategy and the changing trends of system performance. Based on the analysis results, a dynamic system model reflecting the current operating characteristics is established. The system model uses state-space representation, which can accurately describe the dynamic relationship between input variables (such as pressure settings, valve control signals, etc.) and output variables (such as actual filling volume, pressure response, etc.). Model parameters are identified from historical data using recursive least squares or maximum likelihood estimation methods, enabling them to adapt to slow changes in system characteristics.
[0091] Based on the established system dynamic model, model predictive control (MPC) algorithm is applied for parameter optimization. MPC is an advanced control strategy that can predict the future behavior of the system based on a model and optimize the control sequence to achieve optimal performance. At the current moment, based on the latest system state and dynamic model, the output response of the system is predicted over several future time steps. The prediction process considers the dynamic characteristics of the system, constraints, and the effects of external disturbances, generating a detailed sequence of predicted future behaviors.
[0092] A comprehensive objective function is defined, quantifying the control objective and optimization direction. The objective function typically includes two main parts: the sum of squared errors between the predicted and desired outputs, and the sum of squared changes in the control inputs. The former measures control accuracy, while the latter measures control stability and energy consumption. Weighting coefficients are assigned to different objectives, balancing accuracy and stability according to actual needs. For example, for pharmaceutical filling with high precision requirements, the error term might have a higher weight; for beverage filling requiring high production speeds, the weight for control stability might be relatively lower.
[0093] Optimization is the mathematical process of finding the optimal control parameters. Efficient quadratic programming algorithms or interior-point methods are used to solve the optimization problem, considering various constraints (such as pressure limits, valve opening range, and rate of change limits) to find the control sequence that minimizes the objective function. The optimization result is a series of future control inputs, including pressure setpoint, filling time parameters, and controller gain. The system follows the rolling optimization principle, executing only the first step of the optimization sequence, i.e., applying the most recently optimized control parameters.
[0094] In the next control cycle, new measurements are acquired, the current state estimate is updated, and then prediction and optimization calculations are re-executed to obtain the updated control sequence. This rolling optimization strategy effectively addresses model errors and external disturbances, continuously adjusting the control strategy based on the latest information to maintain optimal control performance. As the control cycle progresses, operational experience is continuously accumulated, control parameters are optimized, and a closed-loop, self-improving control system is formed.
[0095] An adaptive learning mechanism was also implemented to continuously optimize the control strategy. By analyzing historical control effects and system response characteristics, key parameters of the MPC controller, such as the prediction and control time domain lengths, objective function weights, and model update frequency, were automatically adjusted. For control strategies with good performance, the adjustment range was gradually reduced to stabilize in the optimal region; for situations where performance deteriorated, the exploration range was expanded to find new optimal strategies. This adaptive learning ensures that the system can cope with various changing factors and always maintain optimal control performance.
[0096] Ultimately, the optimized control parameters are applied to the actual filling process, guiding the system to perform high-precision filling operations. Continuous monitoring of the control effect, evaluation of optimization results, and feedback of the results to the learning system form a complete closed-loop optimization mechanism. Through this continuous learning and self-improvement process, the system can adapt to various challenges such as equipment aging, environmental changes, and the introduction of new products, consistently maintaining high-precision filling performance.
[0097] The filling equipment control method of this invention achieves high-precision, high-stability, and high-adaptability liquid filling through precise multi-closed-loop pressure control, dynamic time compensation, and model-predictive parameter optimization. This method comprehensively applies modern control theory, data analysis technology, and intelligent algorithms, overcoming the limitations of traditional filling methods and meeting the stringent requirements of modern high-precision filling. It is particularly suitable for fields such as pharmaceuticals and fine chemicals where extremely high filling accuracy is required.
[0098] Example 2:
[0099] In this embodiment, the outer loop control of the multi-closed-loop pressure control system includes:
[0100] The pressure error is calculated based on the compensated pressure setpoint and the real-time detected filling pressure. The outer loop control output is calculated using a PID algorithm with a preset outer loop control cycle. The PID algorithm includes a combination of proportional, integral, and derivative terms to obtain the initial PID control output.
[0101] An anti-integral saturation mechanism is set for the initial PID control output. When the initial PID control output reaches a preset limit threshold, the accumulation of the integral term is stopped and the amplitude of the initial PID control output is limited to obtain the amplitude-limited PID control output.
[0102] The pressure reference value preset based on the target filling volume is used as feedforward compensation. The limited PID control output is added to the feedforward compensation to obtain the outer loop pressure adjustment command.
[0103] Specifically, the outer loop control of the multi-closed-loop pressure control system is responsible for stabilizing the overall system pressure, providing a stable pressure foundation for high-precision filling. The outer loop control adopts a hierarchical control architecture, decomposing pressure control into multiple levels to ensure a balance between system stability and response speed.
[0104] First, the actual filling pressure in the pipeline is acquired in real time using high-precision pressure sensors. These sensors have a high accuracy of ±0.05%FS and a high sampling frequency of 1000Hz, ensuring the capture of minute pressure fluctuations. The acquired pressure signal undergoes digital filtering to remove high-frequency noise and electromagnetic interference. This system employs multi-stage Kalman filtering technology to process the raw pressure signal. This technology not only effectively suppresses noise but also preserves the dynamic characteristics of the pressure signal, avoiding the phase lag problem present in traditional filtering methods. The actual filling pressure after filtering is compared with the compensated pressure setpoint calculated in the previous step to calculate the current pressure error.
[0105] Based on the calculated pressure error, an adaptive PID algorithm is used to calculate the outer-loop control output. This PID algorithm is an enhanced version of the standard PID algorithm, including basic proportional, integral, and derivative terms, while introducing an adaptive parameter adjustment mechanism. The proportional term provides an immediate response based on the current error magnitude, the integral term accumulates historical errors to eliminate steady-state deviations, and the derivative term predicts the error change trend to improve dynamic response and stability. The PID parameters are dynamically adjusted according to the error magnitude and rate of change; when the error is large, the proportional gain is increased to accelerate the response speed, and when the error decreases, the proportional gain is decreased to avoid overshoot. The outer-loop control period is set to 10ms, which ensures sufficient control accuracy without excessively consuming system computing resources.
[0106] The anti-integral saturation mechanism in outer-loop control is a key technology for solving the common integral saturation problem in traditional PID control. When large disturbances or sudden changes in the setpoint occur, the integral term can easily accumulate to a very large value, leading to prolonged saturation of the control output, causing slow system response and severe overshoot. Anti-integral saturation is achieved using the conditional integral method. Specifically, the initial PID control output value is continuously monitored. When the output reaches a preset limit threshold (usually set to 90% of the actuator's physical limit), the control algorithm automatically stops the accumulation of the integral term while maintaining normal operation of the derivative and proportional terms. When the output returns to within the limit threshold, the integral term resumes normal accumulation. An upper limit value for the integral term is also set to prevent it from exceeding a reasonable range under any circumstances. Through this mechanism, normal operation can be quickly restored in the face of large disturbances, avoiding prolonged control failure.
[0107] To further improve system response speed, feedforward compensation technology is introduced into the outer loop control. A preset pressure reference value is obtained as the feedforward compensation signal based on the target filling volume through a lookup table. These reference values are empirical data obtained from numerous filling experiments, reflecting the optimal working pressure for different filling volumes. A three-dimensional lookup table is established, with input parameters including the target filling volume, liquid type, and filling speed requirement, and the output being the corresponding pressure reference value. The introduction of feedforward compensation enables the system to quickly adjust to a position close to the target state when the setpoint changes, significantly reducing the settling time and overshoot caused by pure feedback control. In practical applications, the feedforward compensation value typically provides more than 80% of the control action, with the remaining portion finely adjusted by PID feedback control to eliminate errors.
[0108] Feedforward-feedback combined control is the core control strategy of this system. The limited PID control output (feedback part) is added to the feedforward compensation to form the final outer-loop pressure regulation command. This combination integrates the fast response characteristics of feedforward control and the precise tracking capability of feedback control, achieving high-precision and high-stability control of the filling pressure. The outer-loop pressure regulation command serves as the setpoint input for the inner-loop control, guiding the execution of the inner-loop valve position control. Furthermore, a dynamic weight adjustment mechanism adjusts the weight distribution of feedforward and feedback control according to the operating state. Under steady-state conditions, the feedback control ratio is increased to improve accuracy, while during dynamic changes, the feedforward control ratio is increased to improve response speed.
[0109] Pressure transient control is a unique and advanced function of this system, specifically designed to handle pressure transients during the filling start-up and stop phases. During the filling start-up phase, pressure ramp-up control is employed. By setting a reasonable pressure rise rate (typically 0.5-2 bar / s, automatically adjusted according to liquid characteristics), a smooth pressure build-up is achieved, preventing liquid splashing and bubble formation caused by sudden pressurization. During the filling stop phase, a pre-closing strategy is used, initiating pressure reduction in advance as the target filling volume approaches, coordinated with valve closing action, to achieve precise filling termination control. These special phase control strategies are seamlessly integrated with the main control algorithm, ensuring consistent and stable pressure control throughout the entire filling process.
[0110] The outer-loop control also includes an adaptive adjustment function, which can automatically adjust control parameters based on the real-time response of the system. By analyzing the characteristic parameters of the pressure response curve (such as rise time, overshoot, and settling time), it determines whether the current control parameters are optimal. When poor performance is detected, a parameter self-tuning program is triggered, which uses pattern recognition and neural network algorithms to calculate control parameters more suitable for the current operating conditions and smoothly transitions to the new parameter settings. This function enables the system to adapt to changes in different liquid properties and environmental conditions, maintaining optimal control performance.
[0111] Example 3:
[0112] In this embodiment, the inner loop control of the multi-closed-loop pressure control system includes:
[0113] Based on the outer ring pressure regulation command, a valve position feedback control is used to drive the proportional valve and detect the valve core position of the proportional valve in real time. The difference between the valve core position and the target valve position corresponding to the outer ring pressure regulation command is calculated to obtain the valve position error signal.
[0114] Based on the valve position error signal, the valve opening adjustment amount is calculated through a fast control algorithm. The control cycle of the fast control algorithm is shorter than the preset outer loop control cycle, and an initial valve opening adjustment command is obtained.
[0115] A pressure change rate limit is set for the initial valve opening adjustment command. The rate of change of the initial valve opening adjustment command is constrained within a preset pressure change rate range by a speed limiting process, resulting in a speed-limited valve opening adjustment command.
[0116] Based on the valve opening adjustment command after the speed limit is set, the proportional valve is driven to execute, thereby obtaining the stable filling pressure.
[0117] Specifically, the inner loop control is the second level of the multi-closed-loop pressure control system. It focuses on precisely executing the pressure control commands issued by the outer loop, achieving rapid and accurate establishment and maintenance of filling pressure through fine control of proportional valves. The inner loop control adopts a high-speed response architecture to ensure precise adjustment of valve positions and stable flow control.
[0118] First, the external loop pressure regulation command is converted into the target valve position signal for the proportional valve. This conversion process is based on the system's built-in valve characteristic model, which describes the relationship between valve opening and flow rate and pressure. Multiple valve characteristic models are supported, including linear, equal percentage, and quick-opening models, which can be configured according to the actual valve type used. For a specific valve, a self-learning program is executed to build a customized characteristic curve. By measuring flow and pressure data at different opening degrees, a high-precision valve characteristic model is generated using polynomial fitting or piecewise linear interpolation methods. This personalized modeling method overcomes characteristic changes caused by valve manufacturing errors and long-term use, providing a more accurate valve position-pressure mapping relationship.
[0119] Accurate measurement of the proportional valve spool position is fundamental to inner-loop control. A high-precision linear displacement sensor is used to detect the spool position in real time, achieving a resolution of 0.01 mm and a response time of less than 1 ms. The position detection technology is selected based on different application scenarios; linear variable differential transformer (LVDT) technology is used for high-precision applications, while Hall effect sensors are used for cost-sensitive applications. The position signal is amplified and filtered by a dedicated signal processing circuit and then acquired by a high-speed A / D converter before being input to the control system. The difference between the detected actual spool position and the target valve position is calculated to obtain the valve position error signal, which serves as the main input for inner-loop control.
[0120] Based on the valve position error signal, the inner loop control employs a fast-response control algorithm to calculate the valve opening adjustment. This algorithm uses an improved proportional-derivative (PD) control strategy, specifically designed for the rapid and precise positioning of actuators. The proportional term of the algorithm directly responds to the current position error, while the derivative term adjusts the rate of position change. By appropriately setting the parameters, both rapid response and avoidance of overshoot and oscillation can be achieved. The inner loop control period is set to 1ms, much shorter than the outer loop's 10ms period. This high-frequency control allows the system to complete multiple fine adjustments to the valve position within the outer loop control period, achieving high-precision control of the valve position. Compared with traditional PID control, this dedicated fast control algorithm has the advantages of low computational load and strong anti-interference capability, making it particularly suitable for controlling electromechanical actuators such as filling valves.
[0121] Valve response characteristic compensation is a key technology in inner-loop control, used to overcome nonlinear characteristics such as friction, clearance, and inertia in valve mechanical systems. An advanced friction compensation algorithm has been implemented, capable of accurately identifying and compensating for the effects of static and Coulomb friction. For static friction, an adaptive gain breakthrough strategy is employed to provide a sufficiently large driving force to overcome static friction before the valve begins to move; for dynamic friction, the frictional force is estimated in real time and a corresponding compensation term is added to the control output. Furthermore, dead-zone compensation is implemented by adding a small-signal amplification stage to the control signal, effectively reducing the control dead zone caused by mechanical clearance and improving control accuracy under small-signal conditions.
[0122] Pressure change rate limiting is a unique function of inner-loop control and directly affects the stability of the filling process. A change rate constraint is set on the initial valve opening adjustment command, and rate limiting ensures smooth and controllable pressure changes. Specifically, in each control cycle, the change in valve position commands between two adjacent commands is calculated. When the change exceeds a preset threshold, the change is limited within that threshold range, and a new valve opening adjustment command is generated. The pressure change rate limiting parameter is automatically adjusted according to different stages of filling. A smaller change rate limit is used during the start and end of filling to ensure a smooth transition, while a larger change rate limit is used during the stable filling stage to improve response speed. This mechanism effectively suppresses pressure fluctuations and liquid splashing, which is particularly important for filling liquids that are prone to foaming or vaporization.
[0123] Furthermore, adaptive rate-of-change control was implemented for liquids of varying viscosities. For high-viscosity liquids, the upper limit of the allowable rate of change was automatically reduced to prevent flow instability caused by sudden pressure changes; for low-viscosity liquids, a larger rate of change limit was adopted to improve system response speed. A liquid characteristic database was maintained, recording the optimal rate of change parameters for different liquids. When a new liquid is identified, the optimal parameters are automatically determined through a trial run program and stored in the database. This adaptive adjustment based on liquid characteristics greatly enhances the system's adaptability to different liquids.
[0124] The actuator drive is the final link in the inner-loop control. Based on the calculated valve opening adjustment command after speed limiting, the actuator's movement is controlled by a high-precision proportional amplifier or PWM driver. Various types of actuators can be selected according to application requirements; high-response servo motors are used in precision control applications, while precision stepper motors or proportional electromagnetic actuators are used in standard applications. The drive circuit employs closed-loop current control technology to ensure precise control of the actuating torque, improving positioning accuracy and disturbance rejection capability. It also implements a driver self-diagnostic function, capable of detecting abnormal states such as driver overheating, overcurrent, and communication interruption, and taking timely protective measures to improve system reliability.
[0125] The inner and outer loop control systems together constitute a complete dual-closed-loop pressure control system. The outer loop is responsible for pressure setpoint tracking and overall system dynamic control, while the inner loop focuses on precisely executing valve position adjustments to establish the required pressure. This hierarchical control architecture achieves an organic combination of macroscopic pressure stability and precise microscopic adjustment, providing a stable and reliable pressure foundation for high-precision filling. Through the coordinated operation of the inner and outer loops, a stable filling pressure can be established within 0.1 seconds, with pressure stability better than ±0.2%, meeting the stringent requirements of the highest precision filling.
[0126] Example 4:
[0127] In this embodiment, the step of calculating the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters, and the error trend to obtain the dynamically compensated filling time includes:
[0128] The position of the valve core of the filling valve is monitored in real time by a sensor. The opening delay time from the issuance of the control signal to the start of valve core action and the closing delay time from the issuance of the closing signal to the complete closure of valve core are recorded. The opening delay time and the closing delay time are added together to obtain the action delay time.
[0129] Historical filling data is extracted from the error compensation database, the error between the actual filling amount and the target filling amount for each filling is calculated, the corresponding time compensation amount is calculated based on the error, and the average of multiple time compensation amounts is obtained to obtain the historical average compensation time. The error in the historical filling data is analyzed and the error change trend value is obtained by using the weighted moving average method. The historical average compensation time and the error change trend value are combined to obtain the historical compensation parameter.
[0130] Based on the initial filling time baseline value, the first correction is made in combination with the historical average compensation time in the historical compensation parameters, and then the trend prediction correction is made according to the error change trend value to obtain the filling time after historical data correction.
[0131] Based on the target filling volume, the stable filling pressure, and the preset flow coefficient, the theoretical filling time under the current working conditions is calculated. The theoretical filling time is then weighted and fused with the historical data-corrected filling time to obtain the fused filling time.
[0132] The dynamically compensated filling time is obtained by adding the fused filling time to the action delay time.
[0133] Specifically, firstly, valve action delay time refers to the time difference between the issuance of a control signal and the actual completion of the valve action, including both opening and closing delay times. Accurate measurement of these delay times is crucial for filling accuracy, as even small time errors can lead to significant filling volume deviations, especially under high-pressure, high-flow-rate filling conditions.
[0134] High-precision position sensors are used to monitor the valve spool position of the filling valve in real time. These sensors are mounted on key moving parts of the filling valve and can track the actual position of the valve spool with micron-level accuracy. Commonly used position sensing technologies include linear variable differential transformers (LVDTs), Hall effect sensors, or photoelectric encoders; the appropriate sensing solution is selected based on the specific valve structure and accuracy requirements. Sampling frequencies up to 10kHz ensure the capture of valve spool movement details at the millisecond level or even faster.
[0135] The opening delay time is measured from the moment the valve opening control signal is issued until the moment the position sensor detects that the valve core has begun to move significantly. A threshold detection method is used to determine the precise moment when the valve core movement begins; that is, when the change in valve core position exceeds a preset threshold (usually 0.5% of full scale), the valve core is considered to have started to move. The opening delay time is mainly affected by factors such as the energization response of the solenoid coil, mechanical friction, and hydrostatic pressure. For different models and specifications of filling valves, the delay time may range from a few milliseconds to tens of milliseconds.
[0136] The measurement of the closing delay time begins from the moment the valve closing control signal is issued and ends when the position sensor confirms that the valve spool has fully returned to the closed position. Determining the closing process is complex, involving not only monitoring whether the valve spool position returns to the preset zero position but also analyzing the stability of the position curve to ensure that the valve spool is truly stationary and not in a slow crawling state. The closing delay time is typically longer than the opening delay time, especially when handling high-viscosity liquids, where the viscous resistance of the liquid significantly prolongs the closing time during valve closure.
[0137] The measured opening and closing delay times are added together to obtain the total action delay time. This time parameter will be used as an important compensation value in subsequent filling time calculations. The validity of each measurement result will be verified, and obvious outliers will be eliminated to improve measurement reliability. Furthermore, the delay time will be remeasured periodically (usually every 100 fillings) or when key parameters such as liquid type and filling pressure change, to adapt to dynamic changes in system characteristics.
[0138] To improve the accuracy of valve action measurement, several enhancement technologies have been implemented: a temperature compensation mechanism monitors valve temperature and adjusts the delay time estimate based on a preset temperature-delay mapping relationship; pressure dependence analysis studies the correlation between filling pressure and delay time, establishing a pressure-delay time model for dynamic compensation; and wear adaptation tracks the number of valve uses and the trend of delay time changes to predict changes in delay characteristics due to mechanical wear. These technologies collectively ensure accurate delay time measurement results under various operating conditions.
[0139] Second, historical compensation parameters are time adjustment factors calculated based on past filling records, used to compensate for stability errors and trends in the system. These parameters reflect the performance characteristics of the filling system in actual operation and are key information for achieving accurate filling.
[0140] First, historical filling data is extracted from the error compensation database. Data selection follows the principle of similarity, prioritizing historical records with similar conditions to the current filling task (such as the same liquid type, similar filling volume, similar environmental conditions, etc.). The system typically selects the most recent N (usually 20-50) filling records that meet the criteria as the basis for analysis, ensuring both the temporal relevance of the data and a sufficient sample size for statistical analysis. For filling tasks involving new products or under special conditions, the system will find the closest analogous case from existing data through similarity analysis, or perform a small number of test fillings to establish an initial data foundation.
[0141] For each historical record, the error between the actual filling volume and the target filling volume is calculated. The error is calculated as a relative error, i.e., (actual volume - target volume) / target volume, expressed as a percentage. This relative error representation allows for effective comparison of data at different filling volume levels. The extracted historical error data undergoes preprocessing, including outlier detection and data standardization. Outlier detection uses a modified Z-score method or box plot method to identify and remove data points that significantly deviate from the normal range; data standardization transforms the error values to a standard distribution for easier subsequent statistical analysis.
[0142] Based on the processed error data, the corresponding time compensation amount is calculated. This calculation is based on a model relating filling volume error to filling time, estimating how much adjustment in filling time is needed to compensate for the observed filling volume error. This conversion process utilizes the characteristic that, under a given pressure, filling volume and filling time are approximately proportional. Based on the current stable filling pressure, liquid characteristics, and valve flow characteristics, a sensitivity coefficient for filling volume to time is established. The filling volume error is then divided by this coefficient to obtain the corresponding time compensation amount.
[0143] Statistical processing is performed on the calculated time compensation amounts to obtain the historical average compensation time. This statistical processing not only calculates a simple arithmetic mean but also considers the time decay characteristics of the data, meaning that more recent filling data has higher reference value. An exponentially weighted average method is used to assign weights to historical data that decay over time, more accurately reflecting the current characteristics of the system. For example, data from the most recent 10 fillings may account for more than 60% of the total weight, while the weight of earlier data gradually decreases. This time-weighted method allows the system to respond more sensitively to slow changes in system characteristics.
[0144] In addition to the average compensation time, it is also necessary to analyze the trend of error changes. The error trend reflects the evolution of system performance over time and is crucial for predicting future filling behavior. A weighted moving average method is used to analyze the trend of historical filling errors. The weighted moving average is a commonly used time series smoothing technique that reduces the impact of random fluctuations and extracts the underlying trend of the data by weighting and averaging data points within a certain window.
[0145] In practice, a sliding window size is set (typically 10-15 filling cycles). A linear weighting function is applied to the error data within the window, with the latest data at the end of the window having the highest weight and the earliest data at the beginning of the window having the lowest weight. A weighted average is calculated for multiple consecutive window positions to obtain a smoothed error sequence. Then, linear regression analysis is used to analyze the slope of this sequence, yielding the error trend value. This trend value represents the average change in error per unit of filling cycles and is an important indicator for predicting future filling behavior.
[0146] Error trend analysis also includes trend significance testing. Statistical hypothesis testing methods (such as t-tests) are used to assess whether the observed trend is statistically significant or merely random fluctuation. Only trends that pass the significance test will be used in subsequent time compensation calculations to avoid overreacting to random fluctuations. Trend stability is also analyzed; if a sudden change or reversal in the trend is detected, system anomaly analysis is triggered to check whether external factors (such as changes in equipment status, raw material batch changes, etc.) have caused significant changes in system behavior.
[0147] By combining historical average compensation time with error change trend values, a complete set of historical compensation parameters is formed. These parameters not only reflect the current average performance of the system but also contain dynamic information on changes in system performance, providing a comprehensive historical reference for subsequent filling time calculations.
[0148] Third, after obtaining the historical compensation parameters, the filling time will be calculated and corrected in multiple stages. Combining historical experience data and theoretical models, the final accurate filling time will be obtained.
[0149] The first stage is historical data correction based on the initial filling time baseline. The initial filling time baseline is a standard reference time obtained from the formula database, representing the theoretical time required to achieve the target filling volume under ideal conditions. The first correction is performed by applying the historical average compensation time to this baseline. This step compensates for system stability errors, such as actual deviations in valve flow coefficients and differences between liquid characteristics and standard conditions—long-standing systematic deviations.
[0150] The second stage is trend prediction correction. Based on the error change trend value, the potential additional error in the current filling process is predicted, and the corresponding time compensation is calculated. Trend prediction uses a linear extrapolation method, that is, subtracting the order of historical data points from the current filling order, multiplying by the trend value, to obtain the predicted additional error. This prediction is particularly suitable for situations where system characteristics change slowly, such as gradual equipment wear or slow changes in liquid properties with the environment. The predicted additional error is also converted into a time compensation amount through a filling volume-time sensitivity coefficient, applied to the filling time corrected in the first stage, to obtain the filling time corrected from historical data.
[0151] The trend forecast correction also considers the factor of forecast reliability decay. Recognizing that forecast uncertainty increases with forecast distance, a reliability decay function is introduced to dynamically adjust the weight of trend forecasts based on the distance between the current filling point and the historical data center. The greater the forecast distance, the lower the weight of trend forecasts; the closer the forecast distance, the higher the weight of trend forecasts. This adaptive weighting strategy prevents system instability caused by over-forecasting while preserving the forward-looking value of trend forecasts.
[0152] The third stage is the calculation of the theoretical filling time. Based on the target filling volume, stable filling pressure, and preset flow coefficient, the theoretical filling time under the current operating conditions is calculated. The theoretical calculation is based on fluid mechanics principles, considering fundamental principles such as Bernoulli's equation and valve flow characteristics. Specifically, a modified valve flow equation is used to calculate the theoretical flow rate under a given pressure difference and valve characteristics, and then the target filling volume is divided by the theoretical flow rate to obtain the theoretical filling time.
[0153] The flow coefficient is a key parameter in theoretical calculations, representing the valve's flow capacity under standard conditions. A database of flow coefficients is maintained for different types of filling valves and liquids with varying viscosity ranges, and these coefficients are continuously optimized using actual filling data. For common liquids, flow coefficients are directly retrieved from the database; for novel liquids or liquids with special viscosity conditions, interpolation or similarity analysis is used to generate approximate flow coefficients, ensuring the applicability of theoretical calculations.
[0154] Theoretical calculations also consider correction factors for liquid properties. For non-Newtonian fluids (such as certain polymer solutions and suspensions), the system introduces shear rate-related correction terms to capture the unique rheological behavior of liquids under high-speed flow conditions. For easily compressible or gas-containing liquids, the system adds a compressibility correction factor to account for the effects of volume changes caused by pressure variations. These advanced corrections ensure the accuracy of theoretical calculations under various complex liquid conditions.
[0155] The fourth stage involves the integration of historical data and theoretical calculations. A weighted fusion strategy is employed, combining the corrected filling time from historical data with the theoretical filling time to obtain the integrated filling time. The weighting coefficients are dynamically determined based on the quality and reliability of the historical data: when historical data is abundant and highly consistent, historical data has a larger weight; when historical data is scarce or highly dispersed, theoretical calculations have a larger weight. The system uses the standard deviation of historical errors as a measure of data consistency; the smaller the standard deviation, the higher the weight of historical data; the larger the standard deviation, the higher the weight of theoretical calculations.
[0156] Weighted fusion is not a simple linear combination, but rather employs an adaptive Bayesian fusion framework. Historical data correction and theoretical calculations are treated as two independent sources of time estimation, each with its own uncertainty estimate (variance). The fusion process weights these two estimates by the inverse of their uncertainties, producing a comprehensive estimate with minimal variance. This uncertainty-based fusion method fully leverages the complementary advantages of multi-source information, preserving the value of historical experience while incorporating the universality of theoretical models to generate more reliable time estimates.
[0157] The fusion process also includes an anomaly detection mechanism. If the historical data correction results differ significantly from the theoretical calculation results (typically exceeding 20%), an anomaly warning will be triggered, indicating to the operator that there may be a system anomaly or incorrect parameter settings. In anomaly situations, the weight of theoretical calculations will be automatically increased, and reliance on potentially unreliable historical data will be reduced to ensure the robustness of system behavior.
[0158] The fifth stage is action delay time compensation. The merged filling time is added to the previously measured action delay time to obtain the final dynamically compensated filling time. Action delay time compensation is a crucial step, ensuring that the actual opening duration of the filling valve precisely matches the calculated ideal filling time. In actual execution, a valve closing command is issued in advance, ensuring that the valve closes precisely at the ideal moment after accounting for the closing delay, achieving accurate metering.
[0159] Furthermore, a dynamic delay compensation strategy is implemented. Traditional methods simply add the measured action delay time directly to the calculation time, but this ignores the dynamic changes in delay characteristics. By monitoring the valve status in real time, the actual delay time under current conditions is dynamically predicted, paying particular attention to key factors affecting delay characteristics such as valve temperature, continuous operating time, and liquid viscosity. For example, when an increase in valve temperature is detected, the system anticipates an increase in the resistance of the solenoid coil, leading to a longer response time, and will correspondingly increase the delay compensation; when handling high-viscosity liquids, an increase in valve closing resistance is anticipated, leading to an increase in closing delay compensation. This dynamic delay compensation strategy ensures accurate time control under various operating conditions.
[0160] The final dynamically compensated filling time is a high-precision control parameter that comprehensively considers multiple factors. It combines information from various sources, including initial reference values, historical experience data, trend predictions, theoretical calculations, and action delay measurements. Through multi-stage calculations and intelligent fusion, it generates the optimal filling time setting. This time parameter is directly used to control the actual opening time of the filling valve, ensuring high-precision liquid metering in complex and variable working environments.
[0161] After each filling cycle, the actual filling results and calculation process are recorded in the database, forming a closed-loop feedback mechanism. This data is not only used to verify the effectiveness of the current compensation strategy, but also serves as the historical data basis for subsequent fillings, continuously optimizing system performance. Through this continuous learning and self-improvement mechanism, the system can adapt to various challenges such as equipment aging, environmental changes, and the introduction of new products, maintaining high-precision filling performance at all times.
[0162] The dynamic filling time compensation method is one of the core technologies of this invention. It achieves high-precision control of filling time by combining precise measurement of valve characteristics, in-depth analysis of historical data, intelligent prediction of system trends, and theoretical calculations. This multi-factor, multi-stage comprehensive compensation strategy overcomes the limitations of simple and crude time control in traditional filling methods, providing reliable technical support for high-precision filling. It is particularly suitable for precision filling applications in demanding fields such as pharmaceuticals and fine chemicals.
[0163] Example 5:
[0164] In this embodiment, the steps of the parameter self-tuning and predictive control algorithm include:
[0165] When the cumulative filling count reaches the preset filling count, the parameter self-tuning algorithm is activated to establish a discrete state space model. Historical data is extracted from the error compensation database, and the system parameters are identified online using the recursive least squares algorithm. The system matrix and control matrix of the discrete state space model are then updated to obtain the updated system dynamic model.
[0166] Based on the updated system dynamic model, the system state at the current moment is obtained. According to the state transition equation of the updated system dynamic model and the preset control input sequence, the filling pressure and filling volume at each moment within the preset sampling period are predicted sequentially using an iterative calculation method as the predicted output at each moment. The predicted outputs at each moment are combined in chronological order to obtain the predicted output sequence.
[0167] Based on the predicted output sequence, the deviation between the predicted output and the corresponding expected output at each time step in the predicted output sequence is calculated. The increment between the control quantities at adjacent time steps in the control input sequence is calculated. An objective function is constructed such that the objective function includes the weighted sum of squares of the deviation and the weighted sum of squares of the increment. The optimization problem of minimizing the objective function is solved by a quadratic programming method to obtain the optimized control sequence.
[0168] The first control variable in the optimized control sequence is extracted as the actual control output of the current cycle and implemented into the filling system. In the next control cycle, new measurement values are collected to update the system state. Based on the new measurement values and the updated system state, the prediction and optimization process is re-executed to form a closed-loop feedback of rolling optimization, thereby obtaining the optimized control parameters.
[0169] Specifically, parameter self-tuning and model predictive control (MPC) algorithms are the core technologies for achieving adaptive optimization of the system. These algorithms can automatically adjust control parameters based on system operating data, predict future behavior, and optimize control strategies, significantly improving filling accuracy and system stability.
[0170] The parameter self-tuning process is first triggered by counting the cumulative number of fillings. A preset filling count threshold is set (usually 50-100 times). When the cumulative filling count reaches this threshold, the parameter self-tuning algorithm is automatically started. This count-based triggering mechanism ensures that the system has sufficient operational data for model identification, while avoiding system instability caused by excessively frequent self-tuning. In addition to count-based triggering, triggering methods based on time intervals (e.g., every 8 hours) or performance degradation (e.g., filling accuracy exceeding the preset range three times consecutively) are also supported. Users can configure these methods according to their actual production needs.
[0171] The discrete state-space model is the mathematical foundation of this algorithm, describing the dynamic characteristics of the system in a standard form. This model consists of a system matrix, a control matrix, an output matrix, and a direct transfer matrix, which respectively describe the natural evolution of the system state, the influence of control inputs on the system state, the mapping relationship from system state to output, and the direct impact of control inputs on output. In a filling system, the system state typically includes key variables such as filling pressure, filling flow rate, and valve position; control inputs include valve control signals and pressure settings; and the system output is the actual filling volume. This state-space description clearly expresses the relationship between internal system state changes and external performance, providing a mathematical basis for subsequent predictive control.
[0172] Recursive Least Squares (RLS) is an efficient online parameter identification method used to identify the parameters of a state-space model in real time. The core idea of RLS is to continuously update the model parameters by minimizing the squared error between the model's predicted output and the actual measured output. Compared to batch least squares, RLS uses a recursive approach, processing only the latest data points at a time, significantly reducing the computational load. Historical filling data, including control input sequences, actual filling volumes, and pressure curves, is extracted from an error compensation database. The optimal model parameters are then calculated using the RLS algorithm to update the system matrix and control matrix of the discrete state-space model.
[0173] To improve the identification effect, several enhancement techniques are employed. First, a forgetting factor mechanism is implemented, introducing a decay coefficient into the recursive formula to make the algorithm more sensitive to new data and able to quickly adapt to changes in system characteristics. A covariance matrix reset strategy is also used; when poor convergence of parameter estimates or near-singularity of the covariance matrix is detected, the covariance matrix is automatically reset to prevent the algorithm from getting trapped in local optima or numerical instability. Furthermore, a data filtering mechanism is implemented, selecting only data with high signal-to-noise ratio and sufficient excitation for model identification, improving the accuracy of parameter estimation. Through these enhancement techniques, the model parameters that best match the dynamic characteristics of the current filling system can be accurately identified under various operating conditions.
[0174] The core of model predictive control is to predict future behavior and optimize control decisions based on a system model. At the beginning of each control cycle, the current system state is acquired, including key variables such as filling pressure, valve position, and cumulative filling volume. These states are obtained through high-precision sensor measurements and, after filtering and state estimation, form a complete system state vector. Based on the updated system dynamic model, future system behavior is predicted using iterative calculation methods through state transition equations and a preset control input sequence.
[0175] The prediction process is implemented as follows: A prediction time domain is defined (typically 10-20 sampling periods). Within this time domain, based on the current state and the dynamic model, the system state and output (filling pressure and filling volume) at each future time point are calculated sequentially. The calculation uses a recursive approach: first, the state at the next time point is calculated, then the state at the next time point after that is calculated based on that state, and so on until the prediction time domain ends. The predicted outputs at each time point are combined in chronological order to form a complete predicted output sequence, providing a basis for subsequent optimization.
[0176] Prediction accuracy is crucial to MPC performance, and multi-model fusion technology is employed to improve it. Specifically, multiple dynamic models with different structures and parameters are maintained simultaneously, such as linear models, Hammerstein models, and Wiener models. Each model performs predictions independently, and then weights are calculated based on the historical prediction accuracy of each model. The prediction results from each model are then weighted and fused to obtain a more accurate overall prediction. This method fully leverages the complementary advantages of different models, improving prediction accuracy while maintaining computational efficiency.
[0177] Constructing the objective function is the core step in optimizing control. Based on the predicted output sequence, the deviation between the predicted output and the desired output at each time step is calculated, along with the increments between control quantities at adjacent time steps in the control input sequence. The objective function consists of two main parts: the weighted sum of squares of the deviations and the weighted sum of squares of the increments. The sum of squares of the deviations reflects control performance; a smaller sum indicates more accurate tracking of the setpoint. The sum of squares of the increments reflects control stability; a smaller sum indicates smoother control action, reducing wear on actuators and excessive disturbances to the system.
[0178] Different weighting coefficients are used to balance these two objectives. For the deviation term, the weight gradually decreases as the prediction time moves further away from the current time, reflecting a higher requirement for near-term control accuracy. For the incremental term, different weights are set according to different control variables. Key variables (such as filling pressure) are given higher weights to ensure their smooth changes, while secondary variables are given lower weights, allowing for more flexible adjustments. The weights are also dynamically adjusted according to the operating status. For example, the penalty for the deviation term is increased during the filling start-up and end phases to emphasize tracking accuracy; the penalty for the incremental term is increased during the stable filling phase to emphasize smooth operation.
[0179] Constraints are a key feature that distinguishes MPC from traditional control methods. Multiple constraints are set during the optimization process: physical constraints, such as valve opening limits and maximum pressure limits, to ensure that control commands do not exceed the physical capabilities of the actuators; safety constraints, such as pressure change rate limits and minimum pressure limits, to ensure operation within safe ranges; and performance constraints, such as filling volume overshoot limits and settling time requirements, to ensure that filling quality requirements are met. These constraints are directly reflected in the constraints of the optimization problem, ensuring that the optimization result is practically feasible and meets the needs of various aspects of the system.
[0180] Quadratic programming is an effective method for solving MPC optimization problems. Since the objective function is quadratic (containing squared terms of deviation and increment) and the constraints are linear, the entire optimization problem can be expressed as a standard quadratic programming problem. The system employs an improved interior-point method to solve the quadratic programming problem. This method features fast convergence and good numerical stability, and can complete the solution within the control cycle (typically 50ms), meeting the requirements of real-time control. Furthermore, it implements adaptive computational complexity management by dynamically adjusting the lengths of the prediction and control time domains, reducing the computational load while ensuring control performance, and adapting to control hardware platforms with different performance characteristics.
[0181] Rolling optimization is a key feature of MPC (Multi-Control Programming). Only the first control variable in the optimized control sequence is executed, and this is implemented as the actual control output for the current cycle in the filling system. In the next control cycle, new measurements are collected, the system state is updated, and then the entire prediction and optimization process is executed again based on the new state. This rolling optimization strategy can respond promptly to changes in system state and external disturbances, providing closed-loop feedback control and significantly improving the system's robustness and adaptability.
[0182] To improve optimization efficiency, a warm-start technique was implemented. This involves using a shifted version of the previous optimization result as the initial solution in each optimization, accelerating the solution process. A multi-threaded parallel computing architecture was also employed, distributing prediction and optimization across different threads to fully utilize the performance of modern multi-core processors and improve computational efficiency. These techniques ensure that the MPC algorithm completes all calculations within a finite control cycle, achieving real-time control.
[0183] The combination of parameter self-tuning and the MPC algorithm forms an adaptive and predictive control system that can automatically optimize control parameters based on historical operating data, predict future system behavior, and make optimal control decisions. This advanced control technology significantly improves filling accuracy and system stability, enabling the system to adapt to changes in different liquid properties and environmental conditions, reducing the need for manual adjustments, and improving production efficiency and product quality consistency.
[0184] Example 6:
[0185] In this embodiment, a dynamic constraint tightening function based on contraction analysis is added to the predictive control algorithm, including:
[0186] The Jacobian matrix of the system is calculated based on the discrete state-space model. The Jacobian matrix is decomposed to obtain the maximum singular value. The contraction rate at the current moment is calculated based on the maximum singular value. The contraction rate characterizes the convergence speed of the system's state trajectory, and the system contractility evaluation index is obtained.
[0187] Based on the system contractility evaluation index, a contraction rate threshold is set to divide the contraction rate range into multiple convergence levels. The corresponding constraint tightening coefficient is determined according to the convergence level to which the current contraction rate belongs, thus obtaining the dynamic constraint tightening coefficient.
[0188] Based on the dynamic constraint tightening coefficient, the tightened constraint range is calculated to obtain the dynamic tightened constraint conditions.
[0189] Based on the constraints after dynamic tightening, a contraction penalty term is added to the objective function. The optimal control sequence is obtained by solving the optimization problem with dynamic constraints, resulting in optimized control parameters with contraction analysis and constraint tightening functions.
[0190] Specifically, the core of contraction analysis is the real-time assessment of the system's dynamic characteristics. The Jacobian matrix is calculated using a discrete state-space model. This matrix describes the relationship between the system's rate of change and state variables, representing the system's local linearization. The Jacobian matrix is calculated based on the state transition equations of the system model, obtained by taking partial derivatives with respect to each state variable. In practical implementation, due to the nonlinear characteristics of the filling system, a numerical difference method is used to calculate the Jacobian matrix. This involves applying small perturbations to each state variable near the current operating point, observing the changes in the system response, and thus estimating the partial derivative values. This numerical method avoids the complexity of analytical differentiation while ensuring sufficient accuracy.
[0191] Singular value decomposition (SVD) is a key technique for analyzing the Jacobian matrix. The calculated Jacobian matrix is decomposed into a product of three matrices: a left singular vector matrix, a singular value diagonal matrix, and the transpose of the right singular vector matrix. The elements of the singular value diagonal matrix are arranged in descending order, and the largest singular value has a special physical meaning, representing the magnification factor in the most unstable direction. A fast SVD algorithm is used for computation. This algorithm directly solves for the largest singular value through an iterative method, avoiding the computational overhead of full SVD and improving real-time performance.
[0192] The shrinkage rate is a key indicator for measuring system stability and convergence speed. The shrinkage rate at the current moment is calculated based on the maximum singular value, defined as 1 minus the normalized maximum singular value. When the shrinkage rate is close to 1, it indicates that the system is highly stable and the state converges rapidly to the equilibrium point; when the shrinkage rate is close to 0, it indicates that the system is approaching a critical stable state and converges slowly; when the shrinkage rate is negative, it indicates that the system is in an unstable state and will deviate from the equilibrium point. The calculation of the shrinkage rate takes into account the nonlinear characteristics of the system, and a global shrinkage assessment is obtained by calculating and interpolating at multiple operating points.
[0193] To improve the reliability of shrinkage rate calculation, multiple sampling averaging and outlier filtering techniques were employed. Within each control cycle, multiple samples were taken at different time points to calculate multiple shrinkage rate values. Outliers were removed, and the average value was taken to reduce the influence of random factors. A Kalman filter was also used for dynamic filtering of the shrinkage rate, effectively suppressing noise interference and extracting the true trend of system characteristic changes. These techniques yielded reliable shrinkage evaluation indicators, providing a solid foundation for subsequent constraint adjustments.
[0194] Convergence level classification is the foundation for achieving dynamic constraint tightening. Multiple contraction rate thresholds (e.g., 0.9, 0.7, 0.5, 0.3) are preset to divide the contraction rate range into multiple convergence levels. For example, when the contraction rate is greater than 0.9, it is classified as "extremely fast convergence"; when the contraction rate is between 0.7 and 0.9, it is classified as "fast convergence"; and so on, until the contraction rate is less than 0.3, which is classified as "slow convergence". Based on the convergence level to which the current contraction rate belongs, the corresponding constraint tightening coefficient is determined. A higher convergence level results in a larger constraint tightening coefficient, meaning the system can use stricter constraints; a lower convergence level results in a smaller constraint tightening coefficient, requiring more lenient constraints to ensure stability.
[0195] The constraint tightening coefficient is calculated using a piecewise function mapping, with different calculation methods corresponding to different convergence levels. For example, for the "extremely fast convergence" level, the coefficient can be set to 0.8-0.9; for the "fast convergence" level, the coefficient can be set to 0.6-0.7; and for the "slow convergence" level, the coefficient can be set to 0.3-0.4. The system calculates the precise constraint tightening coefficient through linear interpolation based on the specific position of the contraction rate within its respective interval, achieving a smooth transition. This hierarchical strategy enables the system to dynamically adjust the control strategy according to the current stability status, maximizing control accuracy while ensuring stability.
[0196] Dynamic constraint tightening is the core of this function. Based on the calculated constraint tightening coefficient, the original constraints are adjusted. Original constraints include upper and lower limits for control variables, upper and lower limits for state variables, and rate-of-change limits. Constraints are tightened in the following ways: for upper limit constraints, the difference between the original upper limit and the current operating point is multiplied by the tightening coefficient to obtain the tightened upper limit; for lower limit constraints, the difference between the current operating point and the original lower limit is multiplied by the tightening coefficient to obtain the tightened lower limit. This method allows the constraint range to maintain its original constraint center while dynamically adjusting its width according to system convergence.
[0197] To avoid control instability caused by abrupt changes in constraints, a constraint smooth transition mechanism is implemented. Newly calculated constraints are not immediately and fully applied; instead, they are gradually transitioned to the constraints from the previous cycle through a weighted average. The weight coefficients are dynamically adjusted according to the system state change rate; larger weights are used for rapid transitions when state changes are slow, while smaller weights are used for smooth transitions when state changes are drastic. This smooth transition strategy avoids control oscillations caused by abrupt changes in constraints, ensuring stable system operation.
[0198] The contraction penalty term extends the objective function to further enhance system stability. A contraction-related penalty term is added to the original objective function, calculated based on the distance from the system state to the target state and the contraction rate. When the system is far from the target state and the contraction rate is low, the penalty term has a larger weight, forcing the system to adopt a more conservative control strategy; when the system is close to the target state or the contraction rate is high, the penalty term's weight decreases, allowing the system to perform more aggressive optimization. The introduction of the contraction penalty term ensures that the optimization process considers not only control performance but also system stability, achieving a better balance between the two.
[0199] Solving optimization problems with dynamic constraints is the final step in the technical implementation. The tightened constraints and enhanced objective function are substituted into the optimization solver, and the quadratic programming problem is solved using the interior-point method or the active set method to obtain the optimal control sequence that satisfies the tightened constraints. To improve efficiency, sparsity processing of the optimization problem is implemented. Utilizing the sparse structure of the state transition matrix and constraint matrix significantly reduces computational load and memory requirements. The system also employs analytical gradient calculation methods to avoid the inaccuracies of numerical gradients, improving the accuracy and convergence speed of the optimization solution.
[0200] The dynamic constraint tightening function based on shrinkage analysis can intelligently adjust the control strategy according to the current operating status, maximizing control performance while ensuring stability. This function is particularly suitable for transitional stages in the filling process, such as start-up and shutdown, where the system's dynamic characteristics change significantly and the shrinkage rate fluctuates markedly. The dynamic constraint tightening function can provide adaptive control protection, avoiding overshoot and instability. At the same time, tightening the constraints during the stable filling stage improves accuracy, achieving optimal control throughout the entire process.
[0201] Example 7:
[0202] In this embodiment, the steps of calculating the shrinkage rate and adjusting the constraint strategy include:
[0203] At the beginning of each control cycle, the current filling pressure and current filling volume are collected as current state data. Based on the system matrix of the discrete state space model and the current state data, the Jacobian matrix is calculated. The Jacobian matrix is decomposed using a decomposition algorithm to obtain singular value vectors. The maximum singular value is extracted from the singular value vectors, the shrinkage rate is calculated, and the shrinkage rate is filtered to obtain the filtered shrinkage rate as the system shrinkage evaluation index at the current moment.
[0204] Set multi-level shrinkage rate thresholds, determine the convergence level based on the relationship between the filtered shrinkage rate and each shrinkage rate threshold, and set the corresponding constraint tightening coefficient to obtain the constraint tightening coefficient corresponding to the current convergence level.
[0205] The constraint tightening coefficients are updated smoothly using a filter to obtain smoothed constraint tightening coefficients;
[0206] Based on the smoothed constraint tightening coefficient, the tightened pressure constraint range and time constraint range are calculated to obtain a smooth dynamic constraint adjustment strategy.
[0207] Specifically, at the beginning of each control cycle, current state data is first collected as the basis for contraction analysis. High-precision pressure sensors and flow meters measure filling pressure and cumulative filling volume in real time. These signals are digitally filtered to form a current state data vector. State data acquisition employs synchronous sampling technology to ensure that data from all sensors are acquired at the same time, avoiding state estimation errors caused by time asynchrony. For state variables that cannot be directly measured, a state observer is used for estimation, reconstructing a complete state vector based on measurable variables and the system model. The state observer uses a Kalman filter structure, enabling it to provide optimal state estimation even in the presence of measurement noise.
[0208] Jacobian matrix calculation is a crucial step in evaluating the local dynamic characteristics of a system. The Jacobian matrix is calculated based on the system matrix from the discrete state-space model and the current state data. The Jacobian matrix represents the partial derivatives of the system state derivatives with respect to state variables, describing the local linearization characteristics near the current operating point. Considering the nonlinear characteristics of the filling system, the Jacobian matrix changes with the operating point, therefore it needs to be recalculated in each control cycle. The central difference method is used for numerical differentiation. Two small perturbations, one positive and one negative, are applied to each state variable, and the corresponding changes in the state derivatives are calculated. The average value is then used to obtain an approximate value of the partial derivative. The magnitude of the perturbation is adaptively selected, large enough to overcome numerical errors, yet small enough to ensure the local linearization assumption holds.
[0209] Singular value decomposition (SVD) is a mathematical tool for analyzing the properties of the Jacobian matrix. It involves processing the Jacobian matrix using a decomposition algorithm to obtain singular value vectors. In practical implementations, since only the maximum singular value is needed, the power iteration method is used to directly calculate the maximum singular value, eliminating the need for complete SVD and significantly reducing computational complexity. The core idea of the power iteration method is to repeatedly apply the matrix to random initial vectors, utilizing the property that the singular vector corresponding to the maximum singular value gradually becomes dominant, thus quickly estimating the maximum singular value. The system's convergence condition is set to a relative error of less than 0.1% between two adjacent iterations, typically achieving the required accuracy within 5-10 iterations.
[0210] Shrinkage rate calculation employs normalization, mapping the maximum singular value to a standard shrinkage rate range. The specific formula is: shrinkage rate equals 1 minus the ratio of the maximum singular value to the system characteristic scale. The system characteristic scale is a pre-determined normalized parameter based on the system's physical characteristics, enabling comparison between filling systems of different specifications. The shrinkage rate typically ranges from -0.5 to 1, where 1 represents extremely high stability, 0 represents critical stability, and negative values indicate local instability. To improve the reliability of the shrinkage rate estimation, the calculation results are filtered, using a low-pass filter to remove high-frequency fluctuations and extract the true trend of system characteristic changes. The filter time constant is set according to the system's dynamic response speed, typically 3-5 control cycles, effectively suppressing noise without excessively delaying the response to changes in system characteristics.
[0211] Convergence level determination is the basis for constraint adjustment decisions. A multi-level shrinkage rate threshold is preset, dividing the entire shrinkage rate range into five levels: extremely fast convergence (shrinkage rate > 0.9), fast convergence (0.7-0.9), normal convergence (0.5-0.7), slow convergence (0.3-0.5), and near-critical (< 0.3). The current convergence level is determined by comparing the filtered shrinkage rate with each threshold. The determination process employs a hysteresis comparator structure, using different determination values when crossing the threshold upwards and downwards, avoiding frequent level switching caused by fluctuations in the shrinkage rate near the threshold. For example, a shrinkage rate exceeding 0.75 is required to move from normal convergence to fast convergence, while a shrinkage rate below 0.65 is required to move from fast convergence to normal convergence. This design enhances the stability of the system's determination.
[0212] The constraint tightening coefficient is set using a hierarchical mapping strategy, with different convergence levels corresponding to different ranges of tightening coefficients. Specifically, the mapping relationships are: extremely fast convergence corresponds to a tightening coefficient of 0.9-1.0, fast convergence to 0.7-0.9, normal convergence to 0.5-0.7, slow convergence to 0.3-0.5, and near-critical convergence to 0.1-0.3. Within each interval, the precise constraint tightening coefficient is calculated using linear interpolation based on the relative position of the contraction rate and the interval boundary. This fine-grained division allows the system to smoothly transition between different control strategies, avoiding abrupt changes in control behavior. In special cases, such as when the contraction rate is negative (indicating temporary instability), the system automatically enters protection mode, setting the constraint tightening coefficient to its minimum value (usually 0.1) and triggering an alarm to indicate potential system anomalies.
[0213] Smooth updates to constraint tightening coefficients are a key technique for ensuring control continuity. Instead of directly using newly calculated constraint tightening coefficients, a smooth transition is achieved through a low-pass filter. The filter is mathematically represented as: the current coefficient equals the product of the previous cycle's coefficient and the smoothing coefficient, plus the product of the newly calculated coefficient and a minus one smoothing coefficient. The smoothing coefficient is typically set to 0.7-0.9 to ensure sufficiently gradual coefficient changes and avoid abrupt changes in the control strategy. The filter's time constant is dynamically adjusted based on the system response characteristics: a larger time constant (5-8 cycles) is used during the filling stabilization phase to ensure high smoothness; a smaller time constant (2-3 cycles) is used during transitional phases such as filling start-up and shutdown to allow for faster response to changes in system characteristics. This adaptive smoothing strategy provides an appropriate response speed to system changes while ensuring control continuity.
[0214] Constraint range calculation is the step of converting the tightening coefficient into actual control constraints. Based on the smoothed constraint tightening coefficient, the specific ranges of pressure constraints and time constraints are calculated separately. Pressure constraints include the upper and lower limits of filling pressure and the rate of change limit, while time constraints include the adjustment range of filling time and response time requirements. Constraint tightening adopts the center contraction principle: with the current operating point as the center, the original constraint range is reduced proportionally according to the tightening coefficient. For example, for the upper pressure limit constraint, the tightened upper limit is equal to the current pressure plus the difference between the original upper limit and the current pressure multiplied by the tightening coefficient; the lower limit constraint is handled similarly. This center contraction method ensures that constraint adjustments do not cause abrupt changes in control output, while appropriately tightening the control range according to system stability.
[0215] The practical application of the constraint range takes safety margins into account. A minimum safety interval is set for each constraint to ensure that even under maximum tightening, the control still has sufficient room to cope with disturbances. For example, the upper pressure limit constraint retains at least 0.5 bar of adjustment space after tightening, ensuring that it can respond to external disturbances without violating the constraint conditions. A constraint asymptotic function is also implemented: as the target state is approached, the constraint gradually tightens, creating conditions for precise control; when moving away from the target or subjected to disturbances, the constraint automatically loosens, providing greater adjustment space. This dynamic balancing strategy achieves an optimal balance between ensuring system stability and control precision.
[0216] The final output of the dynamic constraint adjustment strategy is a complete set of smoothly changing constraints, including state variable constraints (such as pressure range), control variable constraints (such as valve opening range), and rate of change constraints (such as pressure change rate limit). These constraints are directly applied to the optimization process of model predictive control, guiding the system to find the optimal control sequence while ensuring stability. A constraint log recording function is also implemented to continuously monitor the history of constraint changes and the active status of constraints, providing data support for system performance analysis and anomaly diagnosis.
[0217] Shrinkage rate calculation and constraint adjustment strategy is one of the key innovations of this invention. It enables the system to intelligently adjust the control strategy according to the real-time operating status, maximizing control performance while ensuring stability. This strategy is particularly suitable for complex filling systems with nonlinear characteristics and time-varying parameters. It can adaptively respond to changes in different liquid properties, environmental conditions, and equipment states, providing optimal control performance under all operating conditions. Practical application results show that the filling system using this strategy significantly improves system stability and disturbance resistance while maintaining high accuracy, reducing control oscillations and overshoot, and making the filling process smoother and more reliable.
[0218] Example 8:
[0219] In this embodiment, a game theory-based multivariate collaborative optimization function is added to the predictive control algorithm, including:
[0220] The filling control system is divided into multiple subsystems, and each subsystem is defined as a game participant. Decision variables and local cost functions are defined for each game participant. The local cost function includes a tracking error term, a coupling term, and a control smoothness term, thus obtaining a game theory model.
[0221] Historical filling data is extracted from the error compensation database, the historical filling data is preprocessed, and a response mapping function for each decision variable is established using machine learning methods to obtain the optimal response mapping model.
[0222] Based on the local cost function in the game theory model, the sensitivity coefficient of each decision variable to filling error is calculated using the sensitivity analysis method. According to the magnitude of the sensitivity coefficient, the decision variables are divided into dominant variables and subordinate variables. A game structure is established in which the dominant variable is optimized first and the subordinate variable is adjusted in response, thus obtaining the dominant-subordinate relationship.
[0223] Based on the dominant-subordinate relationship and the optimal response mapping model, a game-theoretic optimization framework is used to iteratively calculate the optimal values of the dominant and subordinate variables. When the change in the iterative values of both the dominant and subordinate variables is less than a preset convergence threshold, convergence is determined. The iterative values of the dominant and subordinate variables at the time of convergence are combined to obtain the optimized control parameters with game-theoretic multivariate collaborative optimization function.
[0224] Specifically, this method treats the filling system as a complex system composed of multiple interdependent subsystems. It coordinates the decision variables of each subsystem using a game theory framework to achieve overall optimal control. This method effectively overcomes the limitations of traditional centralized control in handling multivariable coupled systems, improving the system's control accuracy and stability.
[0225] The first step in implementing this method is to divide the filling control system into subsystems. Based on its physical structure and functional characteristics, the system is divided into several interrelated subsystems, such as a pressure control subsystem, a flow control subsystem, and a time control subsystem. Subsystem division follows the principle of clear physical meaning and stronger internal coupling than external coupling, ensuring that the divided subsystems have both clear physical meaning and are easy to solve in a distributed manner. For example, the pressure control subsystem includes pressure sensors, proportional valves, and related controllers, responsible for establishing and maintaining filling pressure; the flow control subsystem includes flow meters, flow regulating valves, and related controllers, responsible for monitoring and controlling the filling flow rate; and the time control subsystem is responsible for controlling the opening and closing timing of the filling valves.
[0226] Within the framework of game theory, each subsystem is defined as a player in the game, possessing its own decision variables and evaluation metrics. Decision variables are parameters that the subsystem can directly control. For example, decision variables for a pressure control subsystem include the target pressure value and the position of the pressure regulating valve; decision variables for a flow control subsystem include the target flow rate and the opening degree of the flow regulating valve; and decision variables for a time control subsystem include the valve opening time and the valve closing time. These decision variables collectively affect the overall performance of the filling system.
[0227] The local cost function is a key indicator for evaluating the quality of decisions made by various game participants. The local cost function of each subsystem typically comprises three main components: a tracking error term, a coupling term, and a control smoothness term. The tracking error term measures the deviation between the subsystem's state and the desired state, such as the difference between actual and target pressure. The coupling term reflects the impact of the subsystem's decisions on other subsystems, such as the impact of pressure changes on flow rate. The control smoothness term penalizes drastic changes in control signals, preventing overly aggressive control that could lead to system instability. A specific local cost function is tailored for each subsystem, balancing the importance of different objectives.
[0228] To ensure that the cost function accurately reflects the system characteristics, its specific form is designed based on physical principles and historical data. For example, the cost function of the pressure control subsystem might include a squared term for the pressure error, a squared term for the pressure change rate, and cross-terms coupled with the flow subsystem; the cost function of the flow subsystem might include a flow error term, a flow stability term, and coupling terms with the pressure and time subsystems. A carefully designed cost function can guide each subsystem to consider the overall system performance while pursuing its local objectives.
[0229] Historical filling data forms the foundation for establishing the response mapping model. Rich historical filling data is extracted from the error compensation database, recording the correspondence between various control variables, state variables, and filling results under different operating conditions. The extracted data includes, but is not limited to: filling pressure curves, flow curves, valve opening and closing times, actual filling volume, ambient temperature, and liquid characteristic parameters. This raw data undergoes a series of preprocessing steps, including outlier detection and removal, missing value imputation, data standardization, and noise reduction filtering. Outlier detection uses statistical analysis and clustering techniques to identify data points deviating from the normal range; data standardization transforms variables of different dimensions to the same scale, facilitating subsequent analysis; noise reduction filtering removes random noise from the data using wavelet transform or Kalman filtering techniques, extracting the true signal.
[0230] Optimal response mapping models are crucial for understanding the interactions between subsystems. These models describe how a subsystem adjusts its optimal decisions based on the decisions of other subsystems, forming the foundation for game theory optimization. The system employs machine learning methods to construct these mapping relationships, particularly deep neural networks, support vector regression, or Gaussian process regression. During model training, the system uses historical decision variables as input and the corresponding optimal response values as output, optimizing model parameters by minimizing prediction errors. For example, a model can be trained to predict the optimal parameter settings for flow control under given pressure parameters, or the optimal filling time settings under given flow and pressure conditions.
[0231] Model evaluation and validation are crucial steps in ensuring mapping accuracy. Cross-validation is employed to evaluate model performance. The dataset is divided into training and test sets; the model is trained on the training set and its prediction accuracy is validated on the test set. Multiple performance metrics, such as root mean square error, mean absolute error, and coefficient of determination, are used to comprehensively evaluate model quality. Only high-quality models that pass validation are used in subsequent optimization processes. To improve model generalization ability, regularization techniques and ensemble learning methods, such as random forests or gradient boosting trees, are implemented to enhance the model's prediction accuracy under new conditions.
[0232] Sensitivity analysis is a scientific method for determining the importance of variables. This study combines local and global sensitivity analysis to calculate the influence of each decision variable on filling error. Local sensitivity analysis assesses the impact of variable changes near the current operating point by calculating the partial derivatives of filling error with respect to each decision variable. Global sensitivity analysis, using analysis of variance or the Sobol index, considers the combined impact of variables across their entire range. These analytical results are synthesized into sensitivity coefficients, quantifying the contribution of each variable to system performance.
[0233] Based on the sensitivity analysis results, decision variables are divided into dominant and subordinate variables. Dominant variables are those that have the most significant impact on filling accuracy, typically including filling pressure and key time parameters; subordinate variables are secondary influencing factors and can be adaptively adjusted based on the dominant variables. Generally, the top 20%-30% of variables with the highest sensitivity coefficients are identified as dominant variables, and the remaining variables are considered subordinate variables. This hierarchical strategy greatly simplifies the complexity of the optimization problem and makes the optimization process more efficient.
[0234] The dominant-subordinate game structure is a special type of Stackelberg game model where the dominant variable, acting as the "leader," makes the first decision, and the subordinate variables, acting as the "followers," make the optimal response based on the dominant variable's decision. This hierarchical decision structure reflects the actual influence relationships between variables, making the optimization process more consistent with the physical characteristics of the system. In practical implementation, the dominant variable is optimized first, and then, based on the optimization result of the dominant variable, the optimal value of the subordinate variable is determined using an optimal response mapping model.
[0235] The game optimization framework employs an iterative solution strategy, gradually approaching the Nash equilibrium (the optimal solution of the game) through multiple iterations. In each iteration, the dominant variable is first optimized based on the current value of the dependent variable, resulting in an updated value for the dominant variable. Then, based on the updated dominant variable, the optimal response value of the dependent variable is calculated using the optimal response mapping model. This process is repeated until the changes in both the dominant and dependent variables are less than a preset convergence threshold, indicating that the system has reached a relatively stable equilibrium state.
[0236] To accelerate the convergence process, several technical improvements were adopted. During iteration, a relaxation factor was used to adjust the step size of variable updates to avoid oscillations or divergence; a multi-starting-point strategy was adopted for initial value selection, starting iterations from multiple different initial points and selecting the result with the minimum final cost; convergence judgment not only considered the amount of change in variables but also monitored the changing trend of the cost function value to ensure that it truly converges to a local optimum rather than a saddle point.
[0237] The control parameters optimized using game theory are the final result of collaborative optimization. This set of parameters reflects the optimal coordination state among the subsystems, enabling the overall system to achieve optimal performance while satisfying the local objectives of each subsystem. The optimization results include the optimal settings of the dominant variables (such as optimal filling pressure and optimal valve opening time) and the optimal response values of the subordinate variables (such as pressure rise rate and flow control parameters). These parameters are directly applied to the actual control system to guide the execution of the filling process.
[0238] It also implements an online parameter adjustment mechanism, fine-tuning control parameters based on real-time feedback during the filling process to further improve control accuracy. For example, when a continuously excessive filling volume is detected, the filling time parameter will be appropriately reduced; when pressure fluctuations exceed expectations, the pressure control parameter will be adjusted to enhance stability. This closed-loop optimization strategy enables the system to adapt to minor changes in the production process and maintain optimal control performance.
[0239] The game theory-based multivariate collaborative optimization function is one of the key innovations of this invention. Through subsystem decomposition and hierarchical optimization strategies, it effectively addresses the complex control problems of multivariate systems, achieving overall system-wide collaborative optimality. Compared to traditional centralized control methods, this method offers higher computational efficiency and stronger robustness, making it particularly suitable for handling filling systems with strong coupling characteristics. It can ensure control accuracy while also considering system stability and control smoothness.
[0240] Example 9:
[0241] In this embodiment, the steps of establishing the optimal response mapping model and the game optimization process include:
[0242] A neural network is constructed to establish the optimal response mapping model. The historical filling data is used as training data. The neural network is trained using a supervised learning method. A loss function is defined and the neural network parameters are iteratively updated through an optimization algorithm until convergence, thus obtaining the trained optimal response mapping model.
[0243] Based on the trained optimal response mapping model, the contribution value of each decision variable to the filling error is calculated. The decision variables are ranked according to the contribution value. The decision variables ranked at the top of the preset proportion are determined as dominant variables and the decision variables ranked at the bottom of the preset proportion are determined as subordinate variables, thus obtaining the dominant-subordinate relationship.
[0244] Initialize the initial values of the dominant variable and the dependent variable, enter the iterative loop to execute the optimization step, optimize the dominant variable first to obtain the dominant variable iterative value in each iteration, and then calculate the optimal response value of the dependent variable based on the dominant variable iterative value through the trained optimal response mapping model as the dependent variable iterative value to obtain the hierarchical optimization iterative result;
[0245] Calculate the changes in the iterative values of the dominant variable and the subordinate variable. When the changes in the iterative values of both the dominant variable and the subordinate variable are less than a preset convergence threshold, convergence is determined. Extract the iterative values at the time of convergence to obtain the control parameters for game theory optimization.
[0246] Specifically, neural network modeling is the primary method for constructing optimal response mapping models. Employing a multilayer perceptron (MLP) or deep neural network (DNN) architecture, the complex nonlinear relationships between decision variables are represented as connection weights within the neural network. The network structure typically includes an input layer, multiple hidden layers, and an output layer. The number of nodes in the input layer is the same as the number of dominant variables, and the number of nodes in the output layer is the same as the number of dependent variables. The design of the hidden layers depends on the problem complexity and the amount of data. For example, for a moderately complex filling system, 2-3 hidden layers might be used, each containing 20-50 neurons, employing ReLU or sigmoid activation functions to introduce nonlinear characteristics and capture the complex relationships between variables.
[0247] To address the prevalent temporal characteristics in filling systems, recurrent neural networks (RNNs) or long short-term memory (LSTM) networks were employed. These network structures effectively capture the temporal dependencies between historical values of control variables and the current optimal response, making them particularly suitable for modeling dynamic characteristics in the filling process, such as liquid flow inertia and time-varying phenomena like pressure fluctuations. LSTM networks, through their unique gating mechanism, can selectively memorize long-term and short-term information, making them especially effective for modeling the long- and short-term dynamics of filling systems.
[0248] The neural network training employs a supervised learning method, using input-output pairs from historical filling data as training samples. Input data includes historical values of dominant variables, such as filling pressure and valve control signals; output data consists of the optimal values of corresponding dependent variables, such as flow control parameters and compensation time. The goal of the training process is to minimize the difference between the network's predicted output and the actual optimal response, which is quantified by a loss function. Mean squared error (MSE) or mean absolute error (MAE) is typically used as the loss function; the former is more sensitive to large errors, while the latter is more robust to outliers.
[0249] The training process employs efficient algorithms such as mini-batch gradient descent or the Adam optimizer, iteratively updating network parameters through backpropagation. To prevent overfitting, various regularization techniques are used, including L1 / L2 regularization, dropout, and early stopping. L1 / L2 regularization encourages the network to learn simpler models by adding weight penalty terms to the loss function; dropout randomly shuts down some neurons during training to prevent the network from becoming overly dependent on specific neuron paths; and early stopping monitors validation set performance and promptly stops training when the validation error begins to increase, thus avoiding overfitting.
[0250] The network architecture and hyperparameter selection employ automated tuning methods. Techniques such as grid search, random search, or Bayesian optimization are used to find the optimal combination within a predefined hyperparameter space. Evaluation metrics include prediction error on the validation set, model complexity, and training time, among other factors. The automated tuning process typically occurs during the pre-deployment preparation phase, and the optimal hyperparameter configuration found will be used for actual model training.
[0251] After model training, a comprehensive evaluation and interpretability analysis are performed on the neural network. In addition to traditional prediction accuracy metrics, techniques such as feature importance analysis and partial dependency graphs are employed to reveal the mechanisms by which input variables influence the output. Feature importance analysis quantifies the relative importance of each input variable by perturbing the input variables and observing the changes in the output; partial dependency graphs show the average response trend of the output when a specific input variable changes, helping to understand the nonlinear relationships between variables. These analyses not only improve the model's interpretability but also provide a scientific basis for subsequent classification of decision variables.
[0252] Calculating the contribution of decision variables is a crucial step in determining the dominant-subordinate relationship from a data-driven perspective. Based on the trained neural network model, the contribution of each decision variable to filling error is calculated. Calculation methods include gradient-based sensitivity analysis, permutation-based feature importance assessment, and SHAP (Shapley Additive exPlanations) value calculation. The SHAP value method is particularly suitable for evaluating the contribution of variables in complex models. It is based on the Shapley value concept in cooperative game theory, calculating the average marginal contribution of each variable to the model's predictions.
[0253] Variable ranking and determination of dominant-subordinate relationships are crucial steps in optimizing structural design. Decision variables are ranked in descending order based on their calculated contribution values. Typically, the top 20%-30% of variables are identified as dominant variables, with the remaining variables designated as subordinate variables. This ratio can be dynamically adjusted based on system characteristics and actual needs. For example, in a filling system, filling pressure and filling time usually exhibit the highest contribution values and are identified as dominant variables; while secondary factors such as pressure rise rate and flow control parameters are designated as subordinate variables. Furthermore, the correlation between variables is analyzed to avoid selecting highly correlated variables as dominant variables simultaneously, preventing redundancy and instability in the optimization process.
[0254] Dominant-subordinate game optimization employs an iterative solution strategy, with initialization serving as the starting point of the iteration process. Multiple methods are used to determine the initial values of variables, including the historical optimum method, the centroid method, and random initialization. The historical optimum method uses the parameters that performed best in historical data as initial values; the centroid method selects the center point of the feasible region of the variables as the starting point; and random initialization randomly selects multiple starting points within the feasible region, executing the optimization process in parallel and selecting the solution with the optimal final result. This multi-starting-point strategy effectively avoids the risk of getting trapped in local optima and increases the probability of finding the global optimum.
[0255] Iterative optimization is the core process in game theory problem-solving, employing a hierarchical optimization strategy. In each iteration, dependent variables are first fixed, and the dominant variable is optimized. The optimization of the dominant variable typically uses efficient algorithms such as gradient descent, quasi-Newton methods, or conjugate gradient methods, aiming to minimize the comprehensive cost function that includes all relevant factors. After the dominant variable optimization is complete, the system obtains the updated value of the dominant variable and passes it as the iteration value to the next step.
[0256] The optimal response of the dependent variable is calculated using the previously trained neural network model. The updated dominant variable values are input into the neural network, and the network performs forward propagation to calculate the corresponding optimal response value for the dependent variable. This calculation process is highly efficient, avoiding the computational burden of performing complex optimizations separately for the dependent variable. The generalization ability of the neural network ensures that it can predict reasonable dependent variable responses even when faced with dominant variable values not seen in the training data.
[0257] Iterative convergence is determined based on the changes in variables and the improvement of the objective function. The relative changes between two consecutive iterations of the dominant and dependent variables are calculated. Iterative convergence is considered achieved when the changes in all variables are less than a preset convergence threshold (typically 0.1%-1%). The trend of the objective function value is also monitored; when the improvement in the objective function falls below a threshold for several consecutive iterations, this serves as an auxiliary convergence criterion. This dual convergence determination ensures reliable termination of the optimization process, avoiding premature stopping or invalid iterations.
[0258] To accelerate the convergence process, several acceleration techniques were employed. Dynamic step size adjustment automatically adjusts the optimization step size based on the improvement trend of the objective function, using a larger step size initially to quickly approach the optimal region, and a smaller step size for finer searching later. The momentum method incorporates historical gradient information to help the optimization process escape local minima and accelerate convergence in flat regions. The direction reset strategy resets the search direction when inefficiency is detected, avoiding wasting computational resources on inefficient paths.
[0259] Verification of the game-theoretic optimization results is a crucial step in ensuring the effectiveness of the optimization. The optimized control parameters are applied to simulation models or experimental systems to evaluate actual filling accuracy and stability. Verification metrics include the average error, standard deviation, and maximum deviation of the filling volume, comprehensively reflecting control performance. Parameter sensitivity is also analyzed to assess the impact of small parameter changes on control performance, ensuring the robustness of the optimization results. Only optimized parameters that have passed rigorous verification are applied to actual production.
[0260] Closed-loop optimization is key to maintaining optimal system performance over the long term. As equipment ages, the environment changes, or new products are introduced, system performance may fluctuate, and existing optimization parameters may no longer be optimal. The system implements a periodic optimization update mechanism, periodically re-executing the game-theoretic optimization process to update control parameters. Triggering conditions include reaching a threshold for cumulative filling counts, control performance indicators falling below a threshold, or significant changes in system configuration. This closed-loop optimization strategy ensures that the system always maintains optimal control performance and adapts to various internal and external changes.
[0261] The optimal response mapping model and game-theoretic optimization process constitute the core control framework of this invention. Through data-driven modeling methods and hierarchical optimization strategies, high-precision collaborative control of the filling system is achieved. This method not only has theoretical advantages but also demonstrates significant performance improvements in practical applications, making it particularly suitable for handling modern filling systems with multivariate coupling and complex dynamic characteristics.
[0262] Example 10:
[0263] In this embodiment, a piecewise affine approximation modeling method is used for the discrete state-space model, including:
[0264] The system working area is divided into multiple dimensions based on the range of system working parameters. The results of the multiple dimensions are combined to obtain multiple working sub-regions. Each working sub-region is determined by multiple parameter sub-intervals, thus obtaining the system working area division result.
[0265] Historical filling data is extracted from the error compensation database. The working sub-region to which the historical filling data belongs is determined based on the parameter values in the historical filling data and assigned to the corresponding working sub-region. An affine state space model is established for the historical filling data in each working sub-region and the model parameters are identified to obtain the affine model parameters of each working sub-region.
[0266] The current state is collected during the control cycle, the distance from the current state to each working sub-region is calculated, and several working sub-regions with the smallest distance are selected as active regions to obtain a set of active regions.
[0267] The weight function value is calculated and normalized for each active region in the set of active regions. The affine model parameters of each active region are weighted and combined to obtain the piecewise affine approximation model used in the current control cycle.
[0268] Specifically, the piecewise affine approximation modeling method is an effective technique for dealing with nonlinear systems. By decomposing the global nonlinear system into a combination of multiple local linear (or affine) models, it retains the computational simplicity of linear models while accurately describing the nonlinear characteristics of the system.
[0269] System working region partitioning is a fundamental step in piecewise affine modeling. The operating characteristics of a filling system are typically influenced by multiple parameters, such as filling pressure, liquid viscosity, and ambient temperature. Based on the value ranges of these key parameters, the entire working region is partitioned in multiple dimensions. The partitioning method must ensure that the system exhibits approximately linear behavior within each sub-region while avoiding computational burden due to an excessive number of sub-regions. Two main partitioning strategies are employed: uniform partitioning and adaptive partitioning. Uniform partitioning divides the range of each parameter into a predetermined number of intervals, which is simple and intuitive but may lead to some regions being partitioned too finely or too coarsely. Adaptive partitioning dynamically adjusts the partitioning density according to the system's nonlinearity, using finer partitions in highly nonlinear regions and coarser partitions in near-linear regions.
[0270] Partitioning the multidimensional parameter space is the core challenge of working region partitioning. For a system with n parameters, if each parameter is divided into m intervals, it will generate m... n The number of sub-regions increases exponentially with the number of parameters. To control computational complexity, dimensionality reduction techniques such as parameter importance screening and principal component analysis were employed, subdividing only key parameters while coarsely dividing or merging secondary parameters. An online adaptive region partitioning function was also implemented, dynamically adjusting region boundaries based on real-time operational data to ensure the rationality and effectiveness of the partitioning.
[0271] A typical example of working zone division for a filling system is as follows: Pressure is divided into three zones: low pressure (0-2 bar), medium pressure (2-4 bar), and high pressure (4-6 bar); viscosity is divided into three zones: low viscosity (0-100 cP), medium viscosity (100-1000 cP), and high viscosity (1000-5000 cP); and temperature is divided into three zones: low temperature (5-15℃), normal temperature (15-25℃), and high temperature (25-35℃). This three-dimensional division results in 27 working sub-zones, each representing a specific combination of working conditions, such as the "low pressure-low viscosity-normal temperature" zone.
[0272] The allocation of historical filling data forms the data foundation for constructing the regional model. Rich historical filling data is extracted from the error compensation database, including operating parameters, control inputs, and system response records under various working conditions. For each historical data point, its corresponding sub-region is determined based on its parameter values, and it is then assigned to the dataset of that region. To ensure the accuracy of data allocation, the relationship between the parameter values of the data points and the boundaries of each region is precisely calculated, with particular attention paid to data points located near region boundaries. Data points located on multiple region boundaries may be simultaneously assigned to multiple adjacent regions and given appropriate weights in subsequent model construction.
[0273] Data allocation employs a soft allocation strategy, meaning a data point can belong to multiple sub-regions simultaneously, but membership decays with distance. This soft allocation method effectively addresses the model discontinuity problem caused by hard boundaries, making the system's behavior at region boundaries smoother and more natural. Membership degree calculation typically uses a distance-based Gaussian kernel function or trigonometric function; the closer to the center of the sub-region, the higher the membership degree; the farther the distance, the lower the membership degree, until it drops to zero.
[0274] Affine state-space models are mathematical tools for describing the dynamic behavior of a system within a subregion. For each operating subregion, a local affine state-space model is established based on historical data assigned to that region. The affine state-space model is an extension of the standard linear state-space model, containing additional constant terms that more accurately approximate the behavior of a nonlinear system near its operating point. The mathematical form of the model includes state update equations and output equations; the former describes the evolution of the system state over time, and the latter describes the relationship between the observed output and the system state.
[0275] Model parameter identification is a crucial step in determining the specific form of the affine model. Methods such as least squares, recursive least squares, or maximum likelihood estimation are used to identify model parameters based on historical data. During parameter identification, the system considers data quality and representativeness, assigning lower weights to noisy or atypical data points to improve the reliability of the identification results. To prevent overfitting, a regularization term is introduced in parameter identification to balance model complexity and fitting accuracy, ensuring the model has good generalization ability.
[0276] The completeness and accuracy of the sub-region models are crucial to the overall modeling effect. A model quality assessment mechanism is implemented, evaluating the predictive accuracy of each sub-region model through cross-validation. When the amount of data in a sub-region is insufficient or the model prediction error exceeds a threshold, data augmentation or model reconstruction procedures are triggered. Data augmentation can be achieved through methods such as data migration from similar regions, physical model-assisted generation, or interpolation extrapolation; model reconstruction may involve strategies such as adjusting the model structure, introducing nonlinear terms, or merging similar regions. These mechanisms ensure that the segmented model covers the entire workspace, whether for common operating conditions or edge cases.
[0277] Determining the current state and selecting activation regions are the first steps in online model application. In each control cycle, sensor data is collected to obtain current state information, including key variables such as filling pressure, flow rate, liquid temperature, and environmental parameters. Based on this state information, the distance from the current working point to each working sub-region is calculated. Distance calculation typically uses weighted Euclidean distance, assigning different weights to different parameters according to their importance; for example, parameters with a greater impact on filling accuracy (such as pressure) are given higher weights. Based on the calculated distances, several sub-regions with the smallest distances are selected as activation regions, forming an activation region set. The number of activation regions is a system configuration parameter, typically selecting 3-5 closest sub-regions to strike a balance between model accuracy and computational efficiency.
[0278] Weight function calculation is crucial for achieving smooth model switching. For each sub-region in the set of active regions, its weight function value is calculated. The weight reflects the correlation between the current operating point and that sub-region. Weight calculation uses an inverse distance function or a Gaussian kernel function to ensure that sub-regions closer in distance have larger weights and those farther apart have smaller weights. The calculated raw weights are normalized so that the sum of the weights of all active regions is 1, forming a standard convex combination weight. This distance-based weight calculation method ensures a smooth transition between sub-regions, avoiding control discontinuities caused by switching.
[0279] The weighted combination of piecewise affine models is a core step in online model generation. The parameters (including the system matrix, input matrix, output matrix, and constant terms) of each affine model in the activation region are weighted according to normalized weights to obtain a comprehensive affine model describing the current operating point. This weighted combination method not only mathematically guarantees the continuous change of model parameters but also enables the model to smoothly transition between different operating sub-regions, effectively overcoming the discontinuities and instabilities that may result from simple switching.
[0280] In practical applications, model parameter smoothing may also be implemented. When the operating point moves from one sub-region to another, the model parameters do not change instantaneously, but rather gradually transition through low-pass filtering or smooth interpolation. This smoothing further enhances the system's stability under changing operating conditions, preventing control oscillations caused by abrupt changes in model parameters. It also limits the parameter update frequency, avoiding model jitter caused by frequent fluctuations of the operating point near the boundary, ensuring the smooth operation of the control system.
[0281] Online updates of the piecewise affine approximation model are a crucial mechanism for maintaining model accuracy. During operation, new runtime data is continuously collected, and the model parameters for each sub-region are updated periodically. The update process employs an incremental learning method, combining new and historical data and updating model parameters through a recursive least squares algorithm, eliminating the need for complete retraining. This online learning mechanism enables the model to adapt to slow changes in system characteristics, such as performance variations caused by equipment aging, seasonal changes, or long-term wear and tear, maintaining the model's long-term effectiveness.
[0282] The piecewise affine approximation modeling method provides a computationally efficient and practical mathematical description for complex nonlinear filling systems. This method combines the simplicity of linear models with the expressive power of nonlinear models, achieving an accurate description of global nonlinear behavior through local linearization and weighted combination. This modeling approach provides a reliable system model for subsequent predictive control and optimization calculations, and is a crucial technical foundation for achieving high-precision filling control.
[0283] Example 11:
[0284] In this embodiment, the steps of subsystem decomposition and distributed optimization in the piecewise affine approximation modeling method include:
[0285] Based on the physical structure of the filling system, the filling control system is decomposed into multiple subsystems. State variables and control inputs are defined for each subsystem, and coupling variables between subsystems are defined to obtain the subsystem decomposition structure.
[0286] A piecewise affine model is established for each subsystem in its corresponding working sub-region. The piecewise affine model describes the relationship between the state variables of the subsystem and the control input and coupling variables through the state transition equation, thus obtaining the piecewise affine model of each subsystem.
[0287] A local optimization problem is set for each subsystem. The objective function of the local optimization problem includes a state tracking error term and a control cost term. The constraints of the local optimization problem include the state transition equation and input-output constraints of the piecewise affine model, thus obtaining the local optimization problem of each subsystem.
[0288] A distributed coordination optimization method is adopted to solve the problem. A consistency constraint is introduced to require that the estimated values of the coupling variables of each subsystem are consistent. Iterative optimization is performed until convergence. During the iteration process, each subsystem solves the local optimization problem in parallel. The coordination center updates the consensus estimate of the coupling variables. When the amount of change in the iteration is less than the preset convergence threshold, convergence is determined and the control sequence of each subsystem is extracted to obtain the distributed optimization result.
[0289] Specifically, subsystem decomposition and distributed optimization are effective strategies for dealing with large-scale complex systems. By decomposing the overall system into multiple relatively independent subsystems and using distributed algorithms to coordinate the solution, the computational complexity is significantly reduced, and the solution efficiency and system scalability are improved.
[0290] The first step in subsystem decomposition is to identify the natural boundaries of the system based on its physical structure. A filling control system typically comprises several physically independent but functionally interconnected parts, such as pressure control loops, flow control loops, and time control units. System decomposition follows the principle of "high cohesion and low coupling," meaning that the correlation between components within each subsystem is high, while the correlation between subsystems is as low as possible. The decomposition process comprehensively considers factors such as physical connections, signal transmission paths, and the similarity of control objectives to ensure the rationality and effectiveness of the decomposition.
[0291] A typical filling system can be broken down into the following subsystems: a pressure control subsystem, responsible for establishing and maintaining filling pressure, including pressure sensors, pressure regulating valves, and pressure controllers; a flow control subsystem, responsible for monitoring and regulating filling flow, including flow meters, flow valves, and flow controllers; a time control subsystem, responsible for the timing control of filling valve opening and closing, including timers, filling valves, and sequence controllers; and a container handling subsystem, responsible for container positioning and movement control, including conveyors, positioning mechanisms, and related controllers. This function-based decomposition clearly reflects the physical components of the system and facilitates distributed implementation.
[0292] The definition of state variables and control inputs is fundamental to constructing a subsystem model. Each subsystem has its own set of state variables and control inputs. State variables describe the internal state of the subsystem; for example, the state variables of a pressure subsystem include filling pressure and pressure change rate. Control inputs are variables that the subsystem can directly adjust, such as the opening command of a pressure regulating valve. The selection of state variables and control inputs must fully describe the dynamic characteristics of the subsystem while also considering the actual measurable and controllable physical quantities to ensure the model's practicality and feasibility.
[0293] Coupled variables are key links connecting subsystems, reflecting their mutual influence. For example, the coupling variable between the pressure and flow subsystems is pipeline pressure, which is both the output of the pressure subsystem and affects the behavior of the flow subsystem; the coupling variable between the flow and time subsystems might be cumulative flow, which determines the valve closing time of the time subsystem. By identifying these key coupling points, an information exchange mechanism between subsystems can be established, laying the foundation for subsequent coordinated optimization.
[0294] The handling of coupled variables employs a replication technique. A local copy of the coupled variable is created in each subsystem, and the subsystem performs computations and decisions based on its own local copy. To maintain consistency, a consistency constraint is introduced, requiring all subsystems to eventually reach a consensus on the estimates of the shared coupled variable. This approach transforms the originally tightly coupled system into a loosely coupled distributed structure, where each subsystem can perform local computations relatively independently, exchanging information only when coordination is needed.
[0295] Piecewise affine models are mathematical tools for describing the dynamic behavior of subsystems. For each subsystem, a piecewise affine model is established within the corresponding working subregion to describe the relationship between the subsystem state and the control input and coupling variables. The model form includes state transition equations and output equations. The former describes the relationship between the next state and the current state, control input, and coupling variables; the latter describes the mapping relationship between the observed output and the state. Due to the use of the piecewise affine approximation modeling method in the previous embodiments, even if the subsystem itself has nonlinear characteristics, it can be accurately described by a piecewise linear model.
[0296] The identification of subsystem model parameters employs a distributed data processing strategy. Global historical data is divided into multiple data subsets according to subsystems, and each subsystem independently performs the parameter identification process based on its own data subset. For coupled data involving multiple subsystems, a data sharing and collaborative identification mechanism is implemented to ensure that cross-subsystem dynamic characteristics can be accurately captured. Model identification uses the same methods as in the previous embodiments, including least squares, recursive least squares, or maximum likelihood estimation, but the computation process is distributed across multiple processing units, significantly improving computational efficiency.
[0297] The setting of local optimization problems is the foundation of distributed problem solving. A local optimization problem is set up for each subsystem, with the goal of minimizing the local cost function while satisfying local constraints. The local cost function typically consists of two main parts: a state tracking error term and a control cost term. The state tracking error term measures the deviation between the subsystem state and the desired state, such as the squared difference between the actual pressure and the target pressure; the control cost term penalizes drastic changes in control inputs, such as the sum of squares of valve opening changes, to prevent overly aggressive control that could lead to system instability.
[0298] Local optimization constraints include state transition equation constraints and physical constraint constraints. State transition equation constraints ensure that the optimization result conforms to the dynamic characteristics of the system and are the core constraints of the optimization problem. Physical constraint constraints reflect the physical boundaries of the actual system, such as valve opening range, pressure upper and lower limits, and flow rate change limits. These constraints together define the feasible region of local optimization, ensuring that the optimization result is not only performance-optimized but also practically feasible.
[0299] Distributed coordination optimization is a key technique for solving multi-subsystem coupling problems. This paper employs a distributed optimization framework based on the Alternating Direction Multiplier Method (ADMM) or the Distributed Lagrangian Relaxation Method. Through iterative solutions, the local optimization results of each subsystem are coordinated to achieve a globally consistent solution. Consistency constraints are introduced during the coordination process, requiring each subsystem to have consistent estimates of shared coupling variables, ensuring the coherence and physical rationality of the global solution.
[0300] The consistency constraints are handled using the augmented Lagrange method. The consistency constraints are transformed into penalty terms in the objective function using Lagrange multipliers, thus converting the constrained problem into an unconstrained optimization problem. The augmented terms include linear and quadratic penalty terms. The linear penalty term is implemented using Lagrange multipliers, while the quadratic penalty term directly penalizes the squared error of consistency violations. This approach makes the problem decomposition more natural while ensuring the convergence and stability of the solution process.
[0301] The iterative solution process of distributed optimization consists of three main steps: a local optimization step, a coupling variable update step, and a Lagrange multiplier update step. In the local optimization step, each subsystem independently solves its own local optimization problem based on the current coupling variable estimates and Lagrange multipliers. In the coupling variable update step, the coordination center collects the local optimization results of each subsystem and calculates the globally consistent estimates of the coupling variables. In the Lagrange multiplier update step, the Lagrange multipliers are updated according to the degree of consistency violation, and the penalty weights are adjusted. These three steps are executed cyclically until the system reaches convergence.
[0302] Parallel computing is a key technology for improving the efficiency of distributed optimization. It fully utilizes the parallel computing capabilities of modern multi-core processors or multi-processor systems, distributing the local optimization calculations of each subsystem to different computing units for simultaneous execution. This parallel processing strategy significantly improves computational efficiency, especially for large-scale systems, where computation time can be reduced linearly. Furthermore, a computational load balancing mechanism is implemented, dynamically adjusting resource allocation based on the computational complexity of the subsystem to ensure maximum utilization of each computing unit.
[0303] Convergence is the termination condition for distributed optimization. The system monitors the changes in all variables and the degree of consistency violations in each iteration. When these metrics are all below a preset convergence threshold, the optimization process is considered converged. The convergence threshold is set to consider both optimization accuracy requirements and computational efficiency, typically within the range of 0.1%-1%. The system also implements a maximum iteration limit and an early stopping mechanism to prevent infinite iterations when convergence is difficult, ensuring the time constraints of real-time control.
[0304] Control sequence extraction is the final output step of distributed optimization. After the optimization process converges, control sequences are extracted from the local optimization results of each subsystem, especially the control commands at the current moment for actual execution. The control sequences contain control predictions for multiple future moments, but according to the rolling optimization principle, only the control commands at the current moment are executed, and the solution is recalculated in the next cycle. This rolling optimization strategy effectively addresses model errors and external disturbances, improving the robustness and adaptability of the control system.
[0305] Coordinating the results of distributed optimization is crucial to ensuring overall system consistency. Although each subsystem performs local optimization, the final control commands must form a coordinated overall solution. A global control coordinator checks and adjusts the control outputs of each subsystem, eliminating potential conflicts or inconsistencies. For example, when the pressure and flow subsystems issue different control commands to the same valve, the coordinator generates the final coordinated control command based on predefined priority rules or a weighted fusion method.
[0306] Subsystem decomposition and distributed optimization are efficient methods for handling complex filling systems. By decomposing the global problem into multiple local problems and solving them collaboratively, computational complexity is significantly reduced, and the scalability and robustness of the system are improved. This method is particularly suitable for handling modern filling systems with obvious modular structures and multi-objective optimization needs, and can meet the efficiency requirements of real-time computation while ensuring control performance. Practical applications show that compared with traditional centralized optimization methods, this method is not only faster in computation, but also has significant advantages in system expansion, fault isolation, and maintenance upgrades, providing a practical technical path for high-precision control of large-scale complex filling systems.
[0307] Example 12:
[0308] like Figure 2 As shown, the present invention also provides a filling equipment control system based on the time-pressure method, comprising:
[0309] The parameter acquisition module 10 is used to acquire the target filling volume, liquid type and environmental parameters, determine the initial pressure setting value and the initial filling time reference value based on the target filling volume and the liquid type, calculate the compensation coefficient according to the environmental parameters and compensate and correct the initial pressure setting value to obtain the compensated pressure setting value.
[0310] The multi-closed-loop pressure control module 20 is used to establish a target pressure based on the compensated pressure setpoint using a multi-closed-loop pressure control system, and achieve stable pressure control through closed-loop collaborative operation to obtain a stable filling pressure.
[0311] The dynamic time compensation module 30 is used to measure the action delay time of the filling valve according to the stable filling pressure, establish a historical filling error compensation database, calculate historical compensation parameters and predict error trends, calculate the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters and the error trend, and obtain the dynamically compensated filling time.
[0312] The adaptive optimization control module 40 is used to perform filling operations based on the dynamically compensated filling time and collect the actual filling volume as the measurement value of the current cycle, calculate the filling error and store it in the error compensation database, perform parameter self-tuning after each preset number of fillings, establish a system dynamic model, use predictive control algorithm to optimize parameters, predict future output at the current moment, define an objective function to minimize the error between the predicted output and the expected output, solve for the optimal control sequence through rolling optimization and implement it, and re-predict and optimize based on the new measurement value in the next cycle to obtain the optimized control parameters.
[0313] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A filling equipment control method based on time-pressure method, characterized in that, include: Obtain the target filling volume, liquid type, and environmental parameters; determine the initial pressure setpoint and initial filling time reference value based on the target filling volume and liquid type; calculate the compensation coefficient according to the environmental parameters and compensate and correct the initial pressure setpoint to obtain the compensated pressure setpoint. Based on the compensated pressure setpoint, a target pressure is established using a multi-closed-loop pressure control system. Stable pressure control is achieved through closed-loop collaborative operation, resulting in a stable filling pressure. Based on the stable filling pressure, the action delay time of the filling valve is measured, a historical filling error compensation database is established, historical compensation parameters are calculated and error trends are predicted, and the final filling time is calculated based on the initial filling time reference value, the action delay time, the historical compensation parameters and the error trend to obtain the dynamically compensated filling time. The filling operation is performed based on the dynamically compensated filling time, and the actual filling volume is collected as the measurement value of the current cycle. The filling error is calculated and stored in the error compensation database. After each preset number of fillings is completed, parameter self-tuning is performed to establish a system dynamic model. Predictive control algorithm is used to optimize parameters. The future output is predicted at the current moment. The objective function is defined to minimize the error between the predicted output and the expected output. The optimal control sequence is solved by rolling optimization and implemented. In the next cycle, prediction and optimization are performed again based on the new measurement value to obtain the optimized control parameters.
2. The method according to claim 1, characterized in that, The outer loop control of the multi-closed-loop pressure control system includes: The pressure error is calculated based on the compensated pressure setpoint and the real-time detected filling pressure. The outer loop control output is calculated using a PID algorithm with a preset outer loop control cycle. The PID algorithm includes a combination of proportional, integral, and derivative terms to obtain the initial PID control output. An anti-integral saturation mechanism is set for the initial PID control output. When the initial PID control output reaches a preset limit threshold, the accumulation of the integral term is stopped and the amplitude of the initial PID control output is limited to obtain the amplitude-limited PID control output. The pressure reference value preset based on the target filling volume is used as feedforward compensation. The limited PID control output is added to the feedforward compensation to obtain the outer loop pressure adjustment command.
3. The method according to claim 2, characterized in that, The inner loop control of the multi-closed-loop pressure control system includes: Based on the outer ring pressure regulation command, a valve position feedback control is used to drive the proportional valve and detect the valve core position of the proportional valve in real time. The difference between the valve core position and the target valve position corresponding to the outer ring pressure regulation command is calculated to obtain the valve position error signal. Based on the valve position error signal, the valve opening adjustment amount is calculated through a fast control algorithm. The control cycle of the fast control algorithm is shorter than the preset outer loop control cycle, and an initial valve opening adjustment command is obtained. A pressure change rate limit is set for the initial valve opening adjustment command. The rate of change of the initial valve opening adjustment command is constrained within a preset pressure change rate range by a speed limiting process, resulting in a speed-limited valve opening adjustment command. Based on the valve opening adjustment command after the speed limit is set, the proportional valve is driven to execute, thereby obtaining the stable filling pressure.
4. The method according to claim 3, characterized in that, The step of calculating the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters, and the error trend to obtain the dynamically compensated filling time includes: The position of the valve core of the filling valve is monitored in real time by a sensor. The opening delay time from the issuance of the control signal to the start of valve core action and the closing delay time from the issuance of the closing signal to the complete closure of valve core are recorded. The opening delay time and the closing delay time are added together to obtain the action delay time. Historical filling data is extracted from the error compensation database, the error between the actual filling amount and the target filling amount for each filling is calculated, the corresponding time compensation amount is calculated based on the error, and the average of multiple time compensation amounts is obtained to obtain the historical average compensation time. The error in the historical filling data is analyzed and the error change trend value is obtained by using the weighted moving average method. The historical average compensation time and the error change trend value are combined to obtain the historical compensation parameter. Based on the initial filling time baseline value, the first correction is made in combination with the historical average compensation time in the historical compensation parameters, and then the trend prediction correction is made according to the error change trend value to obtain the filling time after historical data correction. Based on the target filling volume, the stable filling pressure, and the preset flow coefficient, the theoretical filling time under the current working conditions is calculated. The theoretical filling time is then weighted and fused with the historical data-corrected filling time to obtain the fused filling time. The dynamically compensated filling time is obtained by adding the fused filling time to the action delay time.
5. The method according to claim 4, characterized in that, The steps of the parameter self-tuning and predictive control algorithm include: When the cumulative filling count reaches the preset filling count, the parameter self-tuning algorithm is activated to establish a discrete state space model. Historical data is extracted from the error compensation database, and the system parameters are identified online using the recursive least squares algorithm. The system matrix and control matrix of the discrete state space model are then updated to obtain the updated system dynamic model. Based on the updated system dynamic model, the system state at the current moment is obtained. According to the state transition equation of the updated system dynamic model and the preset control input sequence, the filling pressure and filling volume at each moment within the preset sampling period are predicted sequentially using an iterative calculation method as the predicted output at each moment. The predicted outputs at each moment are combined in chronological order to obtain the predicted output sequence. Based on the predicted output sequence, the deviation between the predicted output and the corresponding expected output at each time step in the predicted output sequence is calculated. The increment between the control quantities at adjacent time steps in the control input sequence is calculated. An objective function is constructed such that the objective function includes the weighted sum of squares of the deviation and the weighted sum of squares of the increment. The optimization problem of minimizing the objective function is solved by a quadratic programming method to obtain the optimized control sequence. The first control variable in the optimized control sequence is extracted as the actual control output of the current cycle and implemented into the filling system. In the next control cycle, new measurement values are collected to update the system state. Based on the new measurement values and the updated system state, the prediction and optimization process is re-executed to form a closed-loop feedback of rolling optimization, thereby obtaining the optimized control parameters.
6. The method according to claim 5, characterized in that, The predictive control algorithm is enhanced with a dynamic constraint tightening function based on contraction analysis, including: The Jacobian matrix of the system is calculated based on the discrete state-space model. The Jacobian matrix is decomposed to obtain the maximum singular value. The contraction rate at the current moment is calculated based on the maximum singular value. The contraction rate characterizes the convergence speed of the system's state trajectory, and the system contractility evaluation index is obtained. Based on the system contractility evaluation index, a contraction rate threshold is set to divide the contraction rate range into multiple convergence levels. The corresponding constraint tightening coefficient is determined according to the convergence level to which the current contraction rate belongs, thus obtaining the dynamic constraint tightening coefficient. Based on the dynamic constraint tightening coefficient, the tightened constraint range is calculated to obtain the dynamic tightened constraint conditions. Based on the constraints after dynamic tightening, a contraction penalty term is added to the objective function. The optimal control sequence is obtained by solving the optimization problem with dynamic constraints, resulting in optimized control parameters with contraction analysis and constraint tightening functions.
7. The method according to claim 6, characterized in that, The steps of the shrinkage rate calculation and constraint adjustment strategy include: At the beginning of each control cycle, the current filling pressure and current filling volume are collected as current state data. Based on the system matrix of the discrete state space model and the current state data, the Jacobian matrix is calculated. The Jacobian matrix is decomposed using a decomposition algorithm to obtain singular value vectors. The maximum singular value is extracted from the singular value vectors, the shrinkage rate is calculated, and the shrinkage rate is filtered to obtain the filtered shrinkage rate as the system shrinkage evaluation index at the current moment. Set multi-level shrinkage rate thresholds, determine the convergence level based on the relationship between the filtered shrinkage rate and each shrinkage rate threshold, and set the corresponding constraint tightening coefficient to obtain the constraint tightening coefficient corresponding to the current convergence level. The constraint tightening coefficients are updated smoothly using a filter to obtain smoothed constraint tightening coefficients; Based on the smoothed constraint tightening coefficient, the tightened pressure constraint range and time constraint range are calculated to obtain a smooth dynamic constraint adjustment strategy.
8. The method according to claim 5, characterized in that, The predictive control algorithm is enhanced with a game theory-based multivariate collaborative optimization function, including: The filling control system is divided into multiple subsystems, and each subsystem is defined as a game participant. Decision variables and local cost functions are defined for each game participant. The local cost function includes a tracking error term, a coupling term, and a control smoothness term, thus obtaining a game theory model. Historical filling data is extracted from the error compensation database, the historical filling data is preprocessed, and a response mapping function for each decision variable is established using machine learning methods to obtain the optimal response mapping model. Based on the local cost function in the game theory model, the sensitivity coefficient of each decision variable to filling error is calculated using the sensitivity analysis method. According to the magnitude of the sensitivity coefficient, the decision variables are divided into dominant variables and subordinate variables. A game structure is established in which the dominant variable is optimized first and the subordinate variable is adjusted in response, thus obtaining the dominant-subordinate relationship. Based on the dominant-subordinate relationship and the optimal response mapping model, a game-theoretic optimization framework is used to iteratively calculate the optimal values of the dominant and subordinate variables. When the change in the iterative values of both the dominant and subordinate variables is less than a preset convergence threshold, convergence is determined. The iterative values of the dominant and subordinate variables at the time of convergence are combined to obtain the optimized control parameters with game-theoretic multivariate collaborative optimization function.
9. The method according to claim 8, characterized in that, The steps involved in establishing the optimal response mapping model and the game optimization process include: A neural network is constructed to establish the optimal response mapping model. The historical filling data is used as training data. The neural network is trained using a supervised learning method. A loss function is defined and the neural network parameters are iteratively updated through an optimization algorithm until convergence, thus obtaining the trained optimal response mapping model. Based on the trained optimal response mapping model, the contribution value of each decision variable to the filling error is calculated. The decision variables are ranked according to the contribution value. The decision variables ranked at the top of the preset proportion are determined as dominant variables and the decision variables ranked at the bottom of the preset proportion are determined as subordinate variables, thus obtaining the dominant-subordinate relationship. Initialize the initial values of the dominant variable and the dependent variable, enter the iterative loop to execute the optimization step, optimize the dominant variable first to obtain the dominant variable iterative value in each iteration, and then calculate the optimal response value of the dependent variable based on the dominant variable iterative value through the trained optimal response mapping model as the dependent variable iterative value to obtain the hierarchical optimization iterative result; Calculate the changes in the iterative values of the dominant variable and the subordinate variable. When the changes in the iterative values of both the dominant variable and the subordinate variable are less than a preset convergence threshold, convergence is determined. Extract the iterative values at the time of convergence to obtain the control parameters for game theory optimization.
10. The method according to claim 5, characterized in that, The discrete state-space model is modeled using a piecewise affine approximation method, including: The system working area is divided into multiple dimensions based on the range of system working parameters. The results of the multiple dimensions are combined to obtain multiple working sub-regions. Each working sub-region is determined by multiple parameter sub-intervals, thus obtaining the system working area division result. Historical filling data is extracted from the error compensation database. The working sub-region to which the historical filling data belongs is determined based on the parameter values in the historical filling data and assigned to the corresponding working sub-region. An affine state space model is established for the historical filling data in each working sub-region and the model parameters are identified to obtain the affine model parameters of each working sub-region. The current state is collected during the control cycle, the distance from the current state to each working sub-region is calculated, and several working sub-regions with the smallest distance are selected as active regions to obtain a set of active regions. The weight function value is calculated and normalized for each active region in the set of active regions. The affine model parameters of each active region are weighted and combined to obtain the piecewise affine approximation model used in the current control cycle.
11. The method according to claim 10, characterized in that, The steps of subsystem decomposition and distributed optimization in the piecewise affine approximation modeling method include: Based on the physical structure of the filling system, the filling control system is decomposed into multiple subsystems. State variables and control inputs are defined for each subsystem, and coupling variables between subsystems are defined to obtain the subsystem decomposition structure. A piecewise affine model is established for each subsystem in its corresponding working sub-region. The piecewise affine model describes the relationship between the state variables of the subsystem and the control input and coupling variables through the state transition equation, thus obtaining the piecewise affine model of each subsystem. A local optimization problem is set for each subsystem. The objective function of the local optimization problem includes a state tracking error term and a control cost term. The constraints of the local optimization problem include the state transition equation and input-output constraints of the piecewise affine model, thus obtaining the local optimization problem of each subsystem. A distributed coordination optimization method is adopted to solve the problem. A consistency constraint is introduced to require that the estimated values of the coupling variables of each subsystem are consistent. Iterative optimization is performed until convergence. During the iteration process, each subsystem solves the local optimization problem in parallel. The coordination center updates the consensus estimate of the coupling variables. When the amount of change in the iteration is less than the preset convergence threshold, convergence is determined and the control sequence of each subsystem is extracted to obtain the distributed optimization result.
12. A filling equipment control system based on the time-pressure method, characterized in that, include: The parameter acquisition module is used to acquire the target filling volume, liquid type and environmental parameters, determine the initial pressure setpoint and initial filling time reference value based on the target filling volume and liquid type, calculate the compensation coefficient according to the environmental parameters and compensate and correct the initial pressure setpoint to obtain the compensated pressure setpoint. The multi-closed-loop pressure control module is used to establish a target pressure based on the compensated pressure setpoint using a multi-closed-loop pressure control system, and to achieve stable pressure control through closed-loop collaborative operation, thereby obtaining a stable filling pressure. The dynamic time compensation module is used to measure the action delay time of the filling valve based on the stable filling pressure, establish a historical filling error compensation database, calculate historical compensation parameters and predict error trends, and calculate the final filling time based on the initial filling time reference value, the action delay time, the historical compensation parameters and the error trend to obtain the dynamically compensated filling time. The adaptive optimization control module is used to perform filling operations based on the dynamically compensated filling time and collect the actual filling volume as the measurement value of the current cycle, calculate the filling error and store it in the error compensation database, perform parameter self-tuning after each preset number of fillings, establish a system dynamic model, use predictive control algorithm to optimize parameters, predict future output at the current moment, define an objective function to minimize the error between the predicted output and the expected output, solve for the optimal control sequence through rolling optimization and implement it, and re-predict and optimize based on the new measurement value in the next cycle to obtain the optimized control parameters.