A data-driven PID controller parameter optimal setting method
Patent Information
- Application Number
- CN202610920232.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-24
- Publication Date
- 2026-08-18
AI Technical Summary
基于强化学习(RL)的方法对于工业应用而言过于复杂,进而导致停机和效率降低
通过将非线性系统转化为带非线性不确定项的线性模型,并通过优化PID参数以最小化跟踪误差,这使得通过最小化跟踪误差来整定 PID参数成为可能,并给出鲁棒稳定性的保证;可以在未知扰动下保证精确的输出跟踪,从而提升系统性能和稳定性。
Smart Images

Figure CN122592876A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of PID control technology, and in particular to a data-driven method for optimal parameter tuning of a PID controller. Background Technology
[0002] PID controllers are the core of industrial control and are widely used in power generation, automation, HVAC, automotive, and pharmaceutical industries. Optimizing PID parameters (K_P, K_I, K_D) to achieve optimal performance is challenging in dynamic systems with varying loads or operating conditions, and traditional methods cannot adapt to these changes.
[0003] Among existing methods for optimizing PID parameters, Ziegler-Nichols (ZN) tuning is static and often fails in dynamic systems, potentially leading to overshoot or instability. Adaptive methods introduce estimation errors and require persistent excitation, increasing computational overhead. Reinforcement learning (RL)-based methods are too complex for industrial applications, resulting in downtime and reduced efficiency. Summary of the Invention
[0004] This invention addresses the technical problems existing in the prior art by providing a data-driven optimal tuning method for PID controller parameters. This invention proposes a data-based optimization technique that uses closed-loop input-output data to tune the PID gain, achieving optimization by minimizing error fluctuations and ensuring stability, without requiring a precise system model.
[0005] According to a first aspect of the present invention, a method for optimal tuning of parameters of a data-driven PID controller is provided, comprising: Step 1: Construct a nonlinear dynamic system model for the PID controller control system; the nonlinear dynamic system model describes the input-output relationship of the system at the sampling points in the form of discrete-time difference equations. Step 2: Approximate the nonlinear dynamic system model as a second-order linear model near the operating point; Step 3: Determine the linearization coefficients of the second-order linear model near the operating point based on the system's historical input and output data; Step 4: Based on the second-order linear model, with the goal of minimizing the tracking error, the PID parameters are updated in parallel using current data and historical data until the set iteration stopping condition is met.
[0006] Based on the above technical solution, the present invention can also be improved as follows.
[0007] Optionally, the formula for the nonlinear dynamic system model in step 1 is: ; Where k represents the sampling time, This is the system output at time k. and The output autoregressive coefficients, which describe the inertia and damping of the system dynamics, and The input gain coefficient is used to describe the effect of the control input on the output. These are the error feedforward coefficients used to capture the effect of errors on the output. The setpoint feedforward coefficient is used to predict the impact of setpoint changes; This is the control input from the previous moment; Set the point for the previous moment; This represents the tracking error from the previous moment.
[0008] Optionally, the formula for the second-order linear model is: ; ; ; z represents the unit time delay operator. This indicates that the signal is delayed by one sampling period. To capture nonlinear uncertainties related to modeling errors, nonlinearity, time-varying dynamics, and disturbances.
[0009] Optionally, step 3 includes: The process value PV is predicted periodically using a GRU neural network based on the lag characteristics of historical input-output data within the current operating window, according to a set step size; the lag characteristics include: error lag and setpoint lag; The steady-state error is determined based on the process value PV, and the operating point is determined based on the steady-state error. The coefficients of the second-order linear model at the operating point are calculated by performing linear regression on the GRU prediction results. , , and .
[0010] Optionally, step 4 includes: Step 401: Determine the predetermined setpoint. Use the parameters from the previous moment. Calculate PID control law ; control law The output is obtained by applying the second-order linear model. ; The parameters ; This is the proportionality coefficient parameter. For the integral coefficient parameter, These are the differential coefficient parameters; Step 402, Set control target ,in, Given a constant; Step 403, Construct constraints ,satisfy ; Calculate the uncertainties from the previous time step: ; Step 404: Construct and calculate the maximum sensitivity M_s constraint and the complementary sensitivity M_t constraint; Step 405: Construct and calculate the adaptive gain update law to update each parameter; Step 406: Let time k = k + 1. If the iteration stopping condition is met, output K; otherwise, repeat steps 3-4.
[0011] Optionally, in step 404, the formulas for calculating the maximum sensitivity M_s and the complementary sensitivity M_t are as follows: ; ; in, ; .
[0012] Optionally, in step 405, the adaptive gain update law is: ; in, The adjustment factor is an approximation of the trace of the information matrix. , >0 represents the ReLU-arctan form, ReLU(.) = max(., 0); The updated parameters include: , , , and stack S_M; ; Update stack S_M to satisfy the condition: .
[0013] Optionally, in step 405, the objective of updating the parameters is to minimize the average variance cost:
[0014] J represents the mean squared tracking error. The goal is to minimize fluctuations and stop tuning when the error falls below a certain threshold to meet the quality control requirements of the generator set.
[0015] Optionally, the iteration stopping condition set in step 4 is:
[0016] ; in, This represents the PID parameters output after the iteration stops; , To set the threshold, N represents the number of sliding window steps used to determine convergence.
[0017] Optionally, after obtaining the optimal PID controller parameters in step 4, OPC communication is implemented through KepServer to read and write PID data and store it in the time series database InfluxDB.
[0018] The present invention provides a data-driven PID controller parameter optimization method, the beneficial effects of which include: By transforming the nonlinear system into a linear model with nonlinear uncertainties and optimizing the PID parameters to minimize the tracking error, it becomes possible to tune the PID parameters by minimizing the tracking error and provides a guarantee of robust stability. This ensures accurate output tracking under unknown disturbances, thereby improving system performance and stability.
[0019] The GRU neural network is used to predict process values (PV) based on lag characteristics. The coefficients are then approximated by linear regression on the GRU prediction results, and the model is periodically updated online using recent data. This introduces adaptability to time-varying nonlinear uncertainties and disturbances, improving model accuracy without requiring continuous excitation.
[0020] By reformulating the optimization problem with new variables and constraints, the solution process is simplified, reducing computational costs compared to iterative or evolutionary algorithms, thus enabling real-time applicability in dynamic systems.
[0021] By combining recursive optimization with parallel learning, and iteratively tuning PID parameters using both current and historical data, the need for continuous excitation is eliminated. This allows for effective tuning of PID parameters without the need for continuous excitation, reducing reliance on large amounts of experimental data and making the method more practical for industrial applications.
[0022] By using operational data to calculate the true value of the nonlinear uncertainty term at the previous sampling time, estimation errors can be reduced when facing frequently changing uncertainties, which is different from traditional adaptive or perturbation estimation methods.
[0023] Two adjustment factors, the maximum sensitivity Ms and the complementary sensitivity Mt, are set for robust stability. These two adjustable factors control the convergence rate of the optimization algorithm. When the maximum sensitivity Ms and the complementary sensitivity Mt approach their upper bounds, these factors decrease, thereby ensuring the robust stability of the closed-loop system.
[0024] OPC communication is implemented through KepServer, allowing PID data to be read and written from the MANTRA system and stored in the time-series database InfluxDB. Seamless real-time data acquisition, querying, and export to CSV are possible, enabling tuning algorithms to run on real online industrial data, rather than simulation or offline datasets. Features such as retry mechanisms, timeout settings, and data verification improve reliability in noisy or unstable environments, solving problems encountered in practical applications.
[0025] Using matplotlib-based real-time animation, various parameters are plotted, and a set of performance metrics are calculated and displayed, providing actionable insights into system behavior and facilitating diagnosis and tuning verification in real-world scenarios. Attached Figure Description
[0026] Figure 1 A flowchart of a data-driven PID controller parameter optimization method provided by the present invention; Figure 2 A flowchart illustrating an embodiment of a data-driven PID controller parameter optimal tuning method provided by the present invention; Figure 3 This is a flowchart illustrating the overall tuning process of a PID controller in a MANTRA system, as provided in an embodiment of the present invention. Detailed Implementation
[0027] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0028] Figure 1 A flowchart of a data-driven PID controller parameter optimization method provided by the present invention is shown below. Figure 1 As shown, the tuning method includes: Step 1: Construct a nonlinear dynamic system model for the PID controller control system. The nonlinear dynamic system model describes the input-output relationship of the system at the sampling points in the form of discrete-time difference equations, and will be converted into a linear model affected by nonlinear uncertainties in subsequent steps through controller driving.
[0029] Step 2: Approximate the nonlinear dynamic system model as a second-order linear model near the operating point.
[0030] Step 3: Determine the linearization coefficients of the second-order linear model near the operating point based on the system's historical input and output data; Step 4: Based on the second-order linear model, with the goal of minimizing the tracking error, the PID parameters are updated in parallel using current data and historical data until the set iteration stopping condition is met.
[0031] This invention provides a data-driven method for optimal tuning of PID controller parameters. It transforms a single-input, single-output nonlinear system with unknown disturbances into a linear model affected by nonlinear uncertainties through controller-driven operation. This makes it possible to tune the PID parameters by minimizing the tracking error and guarantees robust stability. By combining recursive optimization with parallel learning, and iteratively tuning the PID parameters using both current and historical data, the need for continuous excitation is eliminated, resulting in a significant improvement over traditional adaptive control methods.
[0032] Example 1
[0033] Embodiment 1 provided by this invention is an embodiment of a data-driven PID controller parameter optimal tuning method provided by this invention, such as... Figure 2 The diagram shown is a flowchart of an embodiment of a data-driven PID controller parameter optimal tuning method provided by the present invention, combined with... Figure 1 and Figure 2 It can be seen that embodiments of this tuning method include: Step 1: Construct a nonlinear dynamic system model for the PID controller control system; the nonlinear dynamic system model describes the input-output relationship of the system at the sampling points in the form of discrete-time difference equations. In one possible embodiment, the formula for the nonlinear dynamic system model in step 1 is: ; Where k represents the sampling time, This represents the system output (process value PV) at the current time k. and The output autoregressive coefficients, which describe the inertia and damping of the system dynamics, and The input gain coefficient is used to describe the effect of the control input on the output. These are the error feedforward coefficients (extended terms) used to capture the effect of errors on the output. The setpoint feedforward coefficient (extended term) is used to predict the impact of setpoint changes. This is the control input from the previous moment.
[0034] Set for the previous moment.
[0035] This represents the tracking error from the previous moment.
[0036] In practice, the nonlinear dynamic system model is a discrete-time single-input single-output (SISO) model. Discrete-time means that the system state is updated only at fixed sampling times k=0,1,2,... rather than changing continuously, with a sampling period of T_s. This formula is both a discrete-time formula and a data-driven model formula for the system.
[0037] By using operational data to calculate the true value of the nonlinear uncertainty term at the previous sampling time, estimation errors can be reduced when facing frequently changing uncertainties, which is different from traditional adaptive or perturbation estimation methods.
[0038] Step 2: Approximate the nonlinear dynamic system model as a second-order linear model near the operating point; In one possible implementation, the formula for the second-order linear model is: ; ; ; z represents the unit time delay operator, i.e. This indicates that the signal is delayed by one sampling period. To capture nonlinear uncertainties related to modeling errors, nonlinearity, time-varying dynamics, and disturbances.
[0039] Step 3: Determine the linearization coefficients of the second-order linear model near the operating point based on the system's historical input and output data; In one possible embodiment, step 3 includes: The process value PV is predicted periodically using a GRU neural network based on the lag characteristics of historical input-output data within the current operating window, according to a set step size; the lag characteristics include: error lag and setpoint lag; The steady-state error is determined based on the process value PV, and the operating point is determined based on the steady-state error. The coefficients of the second-order linear model at the operating point are calculated by performing linear regression on the GRU prediction results. , , and .
[0040] In practice, the GRU neural network serves as a gated recurrent unit, with ridge regression used as a backup when necessary. , , and And newly added , It updates online every 100 steps using recent data. This introduces adaptability to time-varying nonlinear uncertainties and perturbations, improving model accuracy without requiring continuous excitation.
[0041] By using a GRU model to dynamically predict and update the system coefficients every 100 steps based on recent running data ( , , , , , This enables better modeling of time-varying nonlinear uncertainties and disturbances. Compared with static offline linear models, it can reduce tracking errors in dynamic environments; training metric examples: GRU achieves an MSE of approximately 43.51 on the training set, R0... 2 It is approximately 0.9298, thus enabling more accurate PID tuning without the need for continuous excitation.
[0042] The operating point refers to the state of a system under a certain steady-state operating condition. It is typically determined in the following ways: 1) When the system output y(k) remains relatively stable over a period of time (with a change less than a given threshold), it can be considered to be near the operating point; 2) In engineering practice, it can be determined by observing whether the difference between the process value PV and the setpoint SP (i.e., the steady-state error SSE) approaches zero; 3) In this method, the operating point is automatically determined by actual operating data—the GRU model and ridge regression utilize historical input-output data within the current operating window to estimate the linearization coefficients near the current operating point online. , , , , and It updates every 100 steps, so there is no need to manually specify a fixed working point in advance, but rather it adaptively follows the actual operating state changes of the system.
[0043] This second-order ARX (AutoRegressive with eXogenous input) model approximates plant dynamics: .
[0044] Furthermore, the addition of error and setpoint terms enables predictive control without prior plant knowledge. In adaptive PID, this model is used to predict the output for error decomposition, thereby supporting parallel learning (separating known dynamics from the error to be adapted).
[0045] Step 4: Based on the second-order linear model, with the goal of minimizing the tracking error, the PID parameters are updated in parallel using current data and historical data until the set iteration stopping condition is met.
[0046] In one possible embodiment, step 4 includes: Step 401: Determine the predetermined setpoint. Use the parameters from the previous moment. Calculate PID control law ; control law Applying it to a second-order linear model yields the output. ; parameter ; This is the proportionality coefficient parameter. For the integral coefficient parameter, These are the differential coefficient parameters; In practical implementation, the discrete PID control law is as follows: ; The closed-loop system is:
[0047] Because the setpoints y_sp and v(k) (uncertainty / perturbation) change frequently, they usually need to be readjusted to obtain optimal performance.
[0048] Step 402, Set control target ,in, Given a constant; Step 403, Construct constraints ,satisfy ; Calculate the uncertainties from the previous time step: ; ;
[0049] In specific implementation, among them Let the regression vector be composed of finite differences of error. , , These correspond to the finite difference forms of proportional, integral, and differential terms, respectively. This is a compensation term to absorb changes in the setpoint and model residuals; and To use first-order / second-order backward differences with integral / differential terms, For the corresponding proportional item, These vectors are used to correct the setpoint ramp and model residuals; they are stored on a stack to form parallel terms. The prediction error decomposition can then be obtained: .
[0050] in, Expressing proportional finite difference, For integral approximation, For differential approximation, and This method absorbs setpoint variations, ARX prediction output increments, and residuals. v(k) captures nonlinear uncertainties. Accurate calculation of v(k) from historical data reduces estimation errors and improves tuning accuracy. The method further enhances robustness when considering explicit disturbances such as load changes in the power system.
[0051] Step 404: Construct and calculate the maximum sensitivity M_s constraint and the complementary sensitivity M_t constraint; In one possible embodiment, in step 404, the formulas for calculating the maximum sensitivity M_s and the complementary sensitivity M_t are as follows: ; ; in, ; .
[0052] Two adjustable factors control the convergence rate of the optimization algorithm. When the maximum sensitivity (Ms) and complementary sensitivity (Mt) approach their upper bounds (Ms≤1.6, Mt≤1.5), these factors will decrease, thereby ensuring the robust stability of the closed-loop system.
[0053] Step 405: Construct and calculate the adaptive gain update law to update each parameter; In one possible embodiment, in step 405, the adaptive gain update law is: ; in, The approximation of the trace of the information matrix is given by the recursive update formula: initial value ; This is used to normalize the parameter update step size, ensuring stable convergence on edge devices without consuming excessive computational resources; among them, the adjustment factor , >0 represents the ReLU-arctan form, ReLU(.)=max(.,0); The updated parameters include: , , , and stack S_M; ; Update stack S_M to satisfy the condition: .
[0054] By updating the stack S_M to select historical data, the minimum feature value is kept above a certain activation threshold, thereby ensuring the richness of information required for parallel learning and avoiding the need for continuous activation.
[0055] In one possible embodiment, in step 405, the objective of updating the parameters is to minimize the average variance cost:
[0056] J represents the mean squared tracking error. The goal is to minimize fluctuations and stop tuning when the error falls below a certain threshold to meet the quality control requirements of the generator set.
[0057] The core approach involves recursive updates with parallel learning terms (current + historical terms), combining offline linear models with online closed-loop data. The closed-loop equation is reconstructed into a regression form, treating the PID gain as a parameter to be estimated. Recursive gradient optimization with parallel learning is employed, and historical data stacks are utilized to increase information content. The convergence rate is controlled by an adjustment factor to meet robust stability constraints.
[0058] This update iteratively minimizes the cost J, converging to a near-optimal PID without continuous stimulus. r is used to approximate the trace of the information matrix and reduce computational cost, normalizing the update to ensure stable convergence on edge devices without excessive CPU consumption. A parallel summation term leverages past stimuli to accelerate convergence. Adjustment factor , Reduce update aggressiveness as you approach the stability boundary to prevent oscillations.
[0059] The conditions for continued rewards in step 4 are: .
[0060] In one possible embodiment, step 406, setting time k=k+1, determines whether the iteration stopping condition is met and outputs K; otherwise, steps 3-4 are repeated.
[0061] The iteration stopping condition set in step 4 is:
[0062] ; in, This represents the PID parameters output after the iteration stops; , To set the threshold, N represents the number of sliding window steps used to determine convergence. That is, the algorithm is considered to have converged when the tracking error meets the threshold condition within N consecutive steps.
[0063] This convergence criterion is used to detect steady state: a stop or log is triggered when gain drift is negligible and recent costs are low, preventing meaningless continuous updates and thus saving resources for continuous evaluation in edge computing environments.
[0064] like Figure 3 The diagram shown is a flowchart illustrating the overall tuning process of a PID controller in a MANTRA system according to an embodiment of the present invention. Figures 1-3 It can be seen that, in one possible embodiment, after obtaining the optimal PID controller parameters in step 4, OPC communication is implemented through KepServer to read and write PID data from the MANTRA system and store it in the time series database InfluxDB.
[0065] It enables reliable, fault-tolerant data acquisition (including retries and data verification) of the MANTRA system, facilitating scalable deployment. This bridges the gap between theoretical tuning and practical applications, reduces downtime caused by modeling errors, and ensures continuous operation in critical manufacturing sectors.
[0066] OPC communication is implemented through KepServer to read and write PID data from the MANTRA system and store it in the time-series database InfluxDB. This enables seamless real-time data acquisition, querying, and export to CSV, allowing tuning algorithms to run on real online industrial data, rather than simulation or offline datasets. Features such as retry mechanisms, timeout settings, and data verification improve the reliability of deployment in noisy or unstable environments, solving problems in practical applications.
[0067] In practical implementation, matplotlib's real-time animation can be used to plot setpoint (SP), process value (PV), control variable (CO), and PID parameters, providing real-time visualization and comprehensive performance metrics. Simultaneously, a set of performance metrics (IAE, ISE, ITAE, TV, MSE, RMSE, MAE, rise time, steady-state time, overshoot, steady-state error, etc.) can be calculated and displayed. This provides actionable insights into system behavior, facilitating diagnosis and tuning verification in real-world scenarios.
[0068] This invention provides a data-driven PID controller parameter optimization method, offering several integral / time-domain performance quantification formulas for evaluating closed-loop response. Common metrics include: rise time (tr), steady-state time (ts, 2% band), overshoot (OS), and steady-state error (SSE). These metrics are used to quantify the closed-loop response: the integral term penalizes sustained or large errors (IAE / ISE / ITAE weighted over time), TV (total variation) is used for control output smoothness, statistical error is used for prediction quality assessment, and transient specifications (rise / steady-state / overshoot / steady-state error) are used for step response fidelity. Incremental updates enable real-time monitoring.
[0069] The present invention provides a data-driven PID controller parameter optimization method, the beneficial effects of which include: By transforming the nonlinear system into a linear model with nonlinear uncertainties and optimizing the PID parameters to minimize the tracking error, it becomes possible to tune the PID parameters by minimizing the tracking error and provides a guarantee of robust stability. It can guarantee accurate output tracking (|e(k)| ≤ δ1) under unknown disturbances, thereby improving system performance and stability compared to traditional PID tuning.
[0070] The GRU neural network is used to predict process values (PV) based on hysteresis characteristics. The coefficients are then approximated by linear regression on the GRU prediction results and updated online every 100 steps using recent data. This introduces adaptability to time-varying nonlinear uncertainties and disturbances, improves model accuracy, and eliminates the need for continuous excitation.
[0071] By reformulating the optimization problem with new variables and constraints, the solution process is simplified, reducing computational costs compared to iterative or evolutionary algorithms, thus enabling real-time applicability in dynamic systems.
[0072] By combining recursive optimization with parallel learning, and iteratively tuning PID parameters using both current and historical data, the need for continuous excitation is eliminated. This allows for effective tuning of PID parameters without the need for continuous excitation, reducing reliance on large amounts of experimental data and making the method more practical for industrial applications.
[0073] By using operational data to calculate the true value of the nonlinear uncertainty term at the previous sampling time, estimation errors can be reduced when facing frequently changing uncertainties, which is different from traditional adaptive or perturbation estimation methods.
[0074] Two adjustment factors, the maximum sensitivity Ms and the complementary sensitivity Mt, are set for robust stability. These two adjustable factors control the convergence rate of the optimization algorithm. When the maximum sensitivity Ms and the complementary sensitivity Mt approach their upper bounds, these factors decrease, thereby ensuring the robust stability of the closed-loop system.
[0075] OPC communication is implemented through KepServer to read and write PID data from the MANTRA system and store it in the time-series database InfluxDB. This enables seamless real-time data acquisition, querying, and export to CSV, allowing tuning algorithms to run on real online industrial data, rather than simulation or offline datasets. Features such as retry mechanisms, timeout settings, and data verification improve the reliability of deployment in noisy or unstable environments, solving problems in practical applications.
[0076] Using matplotlib-based real-time animation, setpoint (SP), process value (PV), control variable (CO), and PID parameters are plotted, while a set of performance metrics is calculated and displayed, providing actionable insights into system behavior and facilitating diagnosis and tuning verification in real-world scenarios.
[0077] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0078] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0079] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0080] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0082] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0083] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for optimal parameter tuning of a data-driven PID controller, characterized in that, The tuning method includes: Step 1: Construct a nonlinear dynamic system model for the PID controller control system; the nonlinear dynamic system model describes the input-output relationship of the system at the sampling points in the form of discrete-time difference equations. Step 2: Approximate the nonlinear dynamic system model as a second-order linear model near the operating point; Step 3: Determine the linearization coefficients of the second-order linear model near the operating point based on the system's historical input and output data; Step 4: Based on the second-order linear model, with the goal of minimizing the tracking error, the PID parameters are updated in parallel using current data and historical data until the set iteration stopping condition is met.
2. The tuning method according to claim 1, characterized in that, The formula for the nonlinear dynamic system model in step 1 is: ; Where k represents the sampling time, This is the system output at time k. and The output autoregressive coefficients, which describe the inertia and damping of the system dynamics, and The input gain coefficient is used to describe the effect of the control input on the output. These are the error feedforward coefficients used to capture the effect of errors on the output. The setpoint feedforward coefficient is used to predict the impact of setpoint changes; This is the control input from the previous moment; Set the point for the previous moment; This represents the tracking error from the previous moment.
3. The tuning method according to claim 2, characterized in that, The formula for the second-order linear model is: ; ; ; z represents the unit time delay operator. This indicates that the signal is delayed by one sampling period. To capture nonlinear uncertainties related to modeling errors, nonlinearity, time-varying dynamics, and disturbances.
4. The tuning method according to claim 3, characterized in that, Step 3 includes: The process value PV is predicted periodically using a GRU neural network based on the lag characteristics of historical input-output data within the current operating window, according to a set step size; the lag characteristics include: error lag and setpoint lag; The steady-state error is determined based on the process value PV, and the operating point is determined based on the steady-state error. The coefficients of the second-order linear model at the operating point are calculated by performing linear regression on the GRU prediction results. , , and .
5. The tuning method according to claim 3, characterized in that, Step 4 includes: Step 401: Determine the predetermined setpoint. Use the parameters from the previous moment. Calculate PID control law ; control law The output is obtained by applying the second-order linear model. ; The parameters ; This is the proportionality coefficient parameter. For the integral coefficient parameter, These are the differential coefficient parameters; Step 402, Set control target ,in, Given a constant; Step 403, Construct constraints ,satisfy ; Calculate the uncertainties from the previous time step: ; Step 404: Construct and calculate the maximum sensitivity M_s constraint and the complementary sensitivity M_t constraint; Step 405: Construct and calculate the adaptive gain update law to update each parameter; Step 406: Let time k = k + 1. If the iteration stopping condition is met, output K; otherwise, repeat steps 3-4.
6. The tuning method according to claim 5, characterized in that, In step 404, the formulas for calculating the maximum sensitivity M_s and the complementary sensitivity M_t are as follows: ; ; in, ; 。 7. The tuning method according to claim 5, characterized in that, In step 405, the adaptive gain update law is: ; in, The adjustment factor is an approximation of the trace of the information matrix. , >0 represents the ReLU-arctan form, ReLU(.) = max(., 0); The updated parameters include: , , , and stack S_M; ; Update stack S_M to satisfy the condition: 。 8. The tuning method according to claim 7, characterized in that, In step 405, the objective of updating the parameters is to minimize the average variance cost: J represents the mean squared tracking error. The goal is to minimize fluctuations and stop tuning when the error falls below a certain threshold to meet the quality control requirements of the generator set.
9. The tuning method according to claim 1, characterized in that, The iteration stopping condition set in step 4 is: ; in, This represents the PID parameters output after the iteration stops; , To set the threshold, N represents the number of sliding window steps used to determine convergence.
10. The tuning method according to claim 1, characterized in that, After obtaining the optimal PID controller parameters in step 4, OPC communication is implemented through KepServer to read and write PID data and store it in the time series database InfluxDB.