PID (Proportion Integration Differentiation) controller parameter setting method and electronic equipment
By optimizing the target model and performance indicators based on historical data, the PID controller parameters are automatically adjusted, solving the problems of reliance on experience and cumbersome tuning processes in existing technologies, and achieving efficient and flexible PID controller parameter tuning.
Patent Information
- Application Number
- CN202511696074.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-13
AI Technical Summary
Existing PID controller parameter tuning methods rely on expert experience, have low automation levels, are difficult to adapt to different performance requirements, and are cumbersome to tune, which can easily lead to system instability and affect production efficiency and safety.
By acquiring historical operating data of the controlled object, a target model is established and initial PID controller parameters are determined. Performance indicators are calculated, and the objective function is dynamically adjusted based on the performance indicators. After multiple iterations of optimization, the optimized PID controller parameters are obtained.
It enables fully automatic, on-demand optimized PID controller parameter tuning without requiring expert experience, improving tuning accuracy and efficiency, adapting to different performance requirements, and avoiding the risk of system instability.
Smart Images

Figure CN121522993A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of PID control, and particularly relates to a tuning method of a PID controller parameter and an electronic device. BACKGROUND
[0002] At present, the tuning methods of the parameters of a proportional-integral-derivative (PID for short) controller mainly include the following two types: one type is an empirical formula or empirical rule-based tuning method, such as the Ziegler-Nichols method, the Cohen-Coon method and the like; and the other type is a model-based tuning method, such as the Lambda tuning method, the internal model control (IMC for short) tuning method and the like.
[0003] However, the empirical formula or empirical rule-based tuning method seriously depends on the on-site debugging experience of experts, the tuning process is tedious and full of subjectivity, and the degree of automation is low. For a slow-response industrial process (such as temperature control), it takes several hours to induce critical oscillation or obtain a high-quality step response, which seriously affects production efficiency. In addition, such a method usually adopts fixed tuning rules, and it is difficult to adapt to different performance requirements. The model-based tuning method usually adopts a unified tuning strategy, lacks diagnosis and targeted optimization of the unique performance bottleneck of the loop, and it is difficult to achieve individualized tuning according to the symptoms. And when the tuning results of the above two types of tuning methods do not meet the performance requirements, they still rely on the experience of technical personnel to repeatedly try and fit, lack of optimization guidance based on performance gradient or sensitivity analysis, not only low efficiency, but also easy to cause system instability due to parameter misadjustment, which constitutes a production safety risk. Therefore, the industry urgently needs a tuning method that does not need to rely on experience, has performance orientation, can adapt to different performance requirements, and has high precision, full automation and on-demand optimization. SUMMARY
[0004] The purpose of the embodiments of the application is to provide a tuning method of a PID controller parameter and an electronic device, and to realize high-precision, full-automatic and on-demand optimization of the tuning of the parameters of the PID controller.
[0005] To achieve the above-mentioned purpose, the embodiments of the application adopt the following technical solutions: In a first aspect, an embodiment of the present application provides a method for setting PID controller parameters, comprising: obtaining historical running data of a controlled object; determining a target model of the controlled object and target model parameters of the target model according to the historical running data; determining initial values of the PID controller parameters based on the target model parameters; calculating a performance index of a PID controller based on the historical running data, the target model and current values of the PID controller parameters; determining a target function of the PID controller according to the performance index; and performing multiple iterations of optimization on the PID controller parameters based on the initial values of the PID controller parameters and the target function, to obtain optimized target PID controller parameters.
[0006] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program or instructions stored in the memory and executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method for setting PID controller parameters according to the first aspect.
[0007] The above at least one technical solution adopted by the embodiments of the present application can achieve the following beneficial effects: In the process of setting the PID controller parameters, the embodiments of the present application determine the target model of the controlled object and the corresponding target model parameters according to the historical running data of the controlled object, determine the initial values of the PID controller parameters based on the target model parameters, calculate the performance index based on the historical running data, the target model and the current values of the PID controller parameters, then determine the target function according to the performance index, and perform multiple iterations of optimization on the PID controller parameters based on the initial values of the PID controller parameters and the target function, to obtain the optimized target PID controller parameters. The entire process does not need to rely on expert experience, and can automatically implement parameter setting. In the iteration process, the target function is dynamically adjusted according to the performance index, which realizes the closed-loop mapping from the “performance requirement” to the “control parameters”, i.e., the performance-oriented parameter setting, improves the setting precision and efficiency, and the dynamic adjustment mechanism makes the optimization process more flexible and intelligent, can perform targeted optimization according to different control requirements and performance bottlenecks, can adapt to different performance requirements, and realizes the on-demand optimization of parameter setting. BRIEF DESCRIPTION OF DRAWINGS
[0008] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the present application and illustrate the illustrative embodiments of the present application and their description serve to explain the present application, and do not constitute improper limitations on the present application. In the drawings: Figure 1 A flowchart of a method for setting PID controller parameters according to an embodiment of the present application is shown in FIG. 1; Figure 2A schematic diagram of a method for calculating an oscillation index provided by an embodiment of the present application; Figure 3 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0009] For the purpose, technical solutions and advantages of the present application to be clearer, the technical solutions of the present application will be described clearly and completely below in combination with the embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work, shall fall within the scope of protection of the present application.
[0010] The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, "and / or" in the present application means at least one of the connected objects, and the character " / " generally means that the front and rear associated objects are in an "or" relationship. It should be noted that the data involved in the present application are all obtained on the premise of obtaining user authorization.
[0011] The technical solutions provided by the embodiments of the present application will be described in detail below in combination with the drawings.
[0012] Figure 1 A flowchart of a method for setting PID controller parameters provided by an embodiment of the present application. As shown in Figure 1 the method for setting PID controller parameters of the present embodiment can specifically include the following steps: S101, obtaining historical running data of a controlled object.
[0013] In the embodiments of the present application, the execution subject of the method for setting PID controller parameters of the present embodiment is a PID controller parameter setting device, which can be arranged in an electronic device. The electronic device can be a terminal device or a server. The terminal device can be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, a vehicle-mounted device, etc.; the server can be a stand-alone server or a server cluster composed of multiple servers. For example, in the industrial field, the PID controller parameter setting device can be arranged in a PID controller.
[0014] The historical running data of the controlled object of the PID controller is collected and screened to obtain a data segment capable of effectively representing the dynamic characteristics of the controlled object, which is used for subsequent identification modeling (i.e., determining a target model).
[0015] Specifically, the historical running data can be collected and screened according to a pre-configured control mode (or motion mode) of the PID controller. The core running parameters related to the PID controller can be configured in a provided user interface or a configurable parameter file. The core running parameters can specifically include, but are not limited to, at least one of the following parameters: a controller algorithm type (such as a conventional PID, a differential-first PI-D, a proportional-differential-first I-PD, etc.), a control mode (such as a manual mode, an automatic mode), an upper and lower limit of a measurement value (Process Value, PV) range (PVH and PVL), an output constraint condition of an actuator, etc. The output constraint condition can specifically include an upper and lower limit of an amplitude of a manipulated variable (Manipulated Variable, MV) and a change rate limit, to ensure that the control output conforms to the physical and dynamic response capability of the field actuator.
[0016] Correspondingly, the step S101 of "obtaining the historical running data of the controlled object" can specifically include the following steps: obtaining the control mode of the PID controller; determining the collection time period and the collection type of the historical running data according to the control mode; and collecting the corresponding historical running data according to the collection time period and the collection type.
[0017] Specifically, when the control mode is the "manual mode", the collection time period of the historical running data is determined to be a time period in which the manipulated variable MV has a significant step change or a sufficient excitation effect, and the collection type is determined to be the manipulated variable MV data and the measurement value PV data. Therefore, the manipulated variable MV data and the measurement value PV data sequence in the time period in which the manipulated variable MV has the significant step change or the sufficient excitation effect are collected, to reflect the dynamic response characteristics under the open-loop condition.
[0018] When the control mode is the "automatic mode", the collection time period of the historical running data is determined to be a time period in which the set value (SetValue, SV) has a significant step change, and the collection type is determined to be the manipulated variable MV data, the measurement value PV data and the set value SV data. Therefore, the manipulated variable MV data, the measurement value PV data and the set value SV data in the time period in which the set value SV has the significant step change are collected, to capture the dynamic behavior of the system under the closed-loop control and the interaction characteristics of the controller and the control process.
[0019] To improve the quality of historical operation data and ensure the accuracy and robustness of the subsequent model identification (i.e., determining the target model) process, the acquired historical operation data can also be preprocessed before step S102 is performed. The preprocessing procedure can specifically include, but is not limited to, at least one of the following steps: 1) adopting appropriate smoothing filtering techniques to perform noise reduction processing on the measured value PV, the set value SV, and the manipulated variable MV data, to suppress random interference while retaining the dynamic characteristics of the system, and the filtering method can specifically include, but is not limited to, moving average filtering, wavelet analysis noise reduction method, etc.; 2) identifying and proposing obvious outliers in the data, which can be caused by sensor failure, communication packet loss, or external interference, and can be distinguished and corrected by statistical methods or residual analysis-based methods, including but not limited to 3σ criterion, IQR method, etc.; 3) using difference methods to reasonably supplement missing data, including but not limited to nearest neighbor difference, linear interpolation, spline difference, etc.; 4) normalizing or standardizing the data according to actual needs to eliminate the influence of dimension differences between different variables.
[0020] S102, determining the target model of the controlled object and the target model parameter of the target model according to the historical operation data.
[0021] In the embodiments of the present application, model identification of the controlled system is performed according to the historical operation data acquired in step S101 to establish a mathematical model that can accurately represent the dynamic characteristics of the controlled object, i.e., to determine the model applicable to the controlled object, denoted as the target model. In addition, the optimal model parameter, i.e., the target model parameter, to be used by the target model also needs to be determined.
[0022] Further, the step S102 of "determining the target model of the controlled object and the target model parameter of the target model according to the historical operation data" can specifically include the following steps: optimizing and fitting the model parameters of each candidate model according to the historical operation data; determining the fitting degree of each candidate model after optimization and fitting; determining the candidate model with the highest fitting degree as the target model; and determining the model parameter after optimization and fitting of the target model as the target model parameter.
[0023] In the embodiments of the present application, according to the common process characteristics in control engineering, the candidate model can specifically include, but is not limited to, a pure proportional model, a first-order model, a second-order model, and an integral model, etc. The formulas corresponding to the above-mentioned candidate models are shown in Table 1. The selection of the model structure is preliminarily determined according to the response characteristics of the controlled system, and is further verified in a data-driven manner.
[0024] Table 1 Formulas corresponding to candidate models
[0025] From Table 1, the model parameters of each candidate model can specifically include: process gain (K), time constant (T1 for a first-order model and T1 and T2 for a second-order model), and pure lag time (L).
[0026] The unknown model parameters of each candidate model can be optimized and fitted by using a nonlinear least squares method or the like, and the goal is to minimize the residual sum of squares between the simulation output value PV_sim of each candidate model and the actual measured value PV.
[0027] The fitting degree of each candidate model after optimization and fitting is determined, and specifically: to evaluate the fitting degree of different candidate model structures, multiple quantitative indicators can be introduced, including but not limited to the coefficient of determination (R_square) and the mean square error (Mean-Square Error, MSE).
[0028] The fitting degrees of each candidate model are comprehensively compared, and the candidate model with the highest fitting degree is finally selected as the mathematical model expression of the controlled object, that is, as the target model.
[0029] The model parameters after optimization and fitting corresponding to the target model are the target model parameters of the target model.
[0030] In S103, initial values of PID controller parameters are determined based on the target model parameters.
[0031] In the embodiments of the present application, the PID controller parameters are the control parameters of the PID controller, including the proportional gain Kp, the integral gain Ti, and the derivative gain Td. Based on the target model parameters determined in step S102, the initial values of the PID controller parameters are determined, that is, the initial value of the proportional gain Kp0, the initial value of the integral gain Ti0, and the initial value of the derivative gain Td0.
[0032] As a feasible implementation manner, the initial values of the PID controller parameters can be determined by using an empirical formula method based on the target model parameters determined in step S102. The empirical formula method can specifically include but is not limited to: Ziegler-Nichols method, Cohen-Coon method, Lambda method, internal model control (IMC) method, and the like. For example, the tuning formulas of each control parameter Kp, Ti, and Td corresponding to the internal model control (IMC) method are shown in Table 2 as follows: Table 2 Internal Model Control (IMC) Method
[0033] By using the above empirical formula method, the target model parameters (K, T1, T2, L) obtained by identification in step S102 are substituted into the tuning formulas of each control parameter Kp, Ti, and Td in Table 2, and the initial values Kp0, Ti0, and Td0 of each PID controller parameter are automatically calculated.
[0034] S104, calculate the performance index of the PID controller based on the historical running data, the target model and the current value of the PID controller parameters.
[0035] In the embodiments of the present application, the performance index of the PID controller can be calculated based on the historical running data obtained in step S101, the target model determined in step S102 and the current value of the PID controller parameters (the initial value of the PID controller parameters or the value after subsequent iterative optimization).
[0036] The performance index of the PID controller can specifically include, but is not limited to, at least one of the following indexes: a control responsiveness index, a control accuracy index and a control stability index.
[0037] The control responsiveness index can specifically include, but is not limited to, at least one of the following indexes: a rise time index Tr and a settling time index Ts.
[0038] Rise time (Tr): the time required for the output to rise from 10% to 90% of the set value, representing the rapidity of system response, calculated by the step response curve of the closed-loop response curve. The step response curve of the closed-loop response curve is obtained by the following steps: calling the target model to obtain the closed-loop response curve under the current value of the PID controller parameters.
[0039] Settling time (Ts): the shortest time required for the output to enter and remain within the range of ±2% (or other preset tolerance band) of the set value, reflecting the convergence speed of the system, calculated by the step response curve of the closed-loop response curve.
[0040] The control accuracy index includes at least one of the following indexes: an overshoot index OS, a coefficient of variation of deviation index COV and an integral error index.
[0041] Overshoot (OS): defined as the relative value of the difference between the response peak value and the set value, used to evaluate the relative stability of the system, calculated by the step response curve of the closed-loop response curve.
[0042] Coefficient of variation of deviation (COV): the standard deviation σ(Δ) of the deviation Δ in the evaluation period divided by the average value μ(Δ) of the deviation Δ, reflecting the fluctuation degree of the deviation of the PID controller relative to its average value.
[0043] COV = σ(Δ) / μ(Δ)
[0044] Integral error index: such as integral absolute error IAE, integral square error ISE and weighted time weighted absolute error ITAE, comprehensively reflecting the cumulative control deviation.
[0045]
[0046]
[0047]
[0048] in, e [ k ] indicates the discrete case, the first k The deviation between the actual output and the expected output.
[0049] The stability control index can specifically include the oscillation index (OI).
[0050] Oscillation Index (OI): An index used to characterize the degree of oscillation in a control system. It detects the periodicity and stability of signal oscillation by analyzing the zero-crossing time and integral absolute error (IAE) of the deviation signal. The OI index ranges from [0, 1] and is used to analyze the stability and periodicity of the signal. Ideally, the closer the index is to 0, the better.
[0051] Figure 2 This is a schematic diagram illustrating the calculation method of the oscillation index. The horizontal axis represents time t, in units of time, such as seconds. The vertical axis represents the absolute error e(t), in units of the same as the measured value PV. For example, if the measured value PV is a temperature measurement, then the vertical axis unit is temperature, such as degrees Celsius (°C).
[0052]
[0053]
[0054] ( ) / N in:
[0055]
[0056]
[0057]
[0058]
[0059]
[0060] in, Indicates no more than N All i In the middle, the number of times the following condition is satisfied: for positive error samples, the current integral absolute error (A) and the zero-crossing time interval ( ) is similar to the previous A and represents not more than represents not more than N all i Among them, the number of times satisfying the following conditions: for negative error samples, the current integral absolute error (B) and the zero-crossing time interval (T) are similar to the previous B and ) is similar to the previous B and represents not more than N represents the sum of the number of all peaks (positive error) and troughs (negative error) formed by the absolute error curve crossing zero in the observation window.
[0061] As can be seen from the above, in order to realize comprehensive evaluation and accurate diagnosis of the running quality of the PID control loop, the embodiments of the present application construct a multi-dimensional and quantifiable control performance index system, including response speed, control accuracy, control stability and the like. By signal processing and statistical modeling on historical or real-time running data (including set value SV, measured value PV, manipulated variable MV), the above performance indicators are automatically calculated.
[0062] S105, determining the target function of the PID controller according to the performance indicators.
[0063] In the embodiments of the present application, the target function can be determined according to each performance indicator and the corresponding target weight of each performance indicator.
[0064] The target function of the controller performance optimization is defined as a negative reward function R(St), and the closer its value is to zero (i.e. the smaller the absolute value), the better the closed-loop control performance. The reward function R(St) aims to quantify the comprehensive control quality of the system under the current state St, and is usually constructed as a weighted linear combination of multiple key time-domain performance indicators, in the form as follows:
[0065] Where w1, w2, w3, w4, w5, w6 are non-negative target weights (or target weight coefficients) corresponding to each performance indicator Tr, Ts, OS, COV, IAE and OI.
[0066] Further, the target weight can be obtained by the following steps: calculating the average performance defect degree PDI of each performance indicator; calculating the candidate weight of each performance indicator according to the average performance defect degree PDI ; normalizing the candidate weight to obtain the target weight .
[0067] All performance indicators are normalized, and the normalized performance indicators of the past N control times are analyzed to calculate the average performance defect degree PDI of each performance indicator, which is used to measure the overall deviation level of the performance indicator. The following takes the performance indicator oscillation index OI as an example to illustrate the calculation formula of the average performance defect degree PDI:
[0068] As can be seen from the average performance defect degree PDI calculation formula of the oscillation index OI, only when the overshoot of a response exceeds the acceptable threshold, the defect degree is counted. Similarly, the PDI of other indicators is defined.
[0069] To further enhance the response sensitivity of the system to serious performance defects, the initial defect degree is processed by non-linear amplification in the embodiments of the present application. Specifically, an exponential function is used to map PDI, where a is an adjustable constant, and the control amplification degree is usually taken as 2-5:
[0070]
[0071]
[0072]
[0073]
[0074]
[0075] This design makes the weight of a performance indicator in the objective function grow exponentially when the performance indicator deviates seriously from the expected level, thereby ensuring that the optimization process prioritizes the most urgent control bottlenecks. Then the candidate weight is normalized to obtain the target weight of each performance indicator.
[0076]
[0077] Then the target weight is substituted into the calculation formula of the above objective function R(St) to obtain the final objective function R(St).
[0078] S106, based on the initial value of the PID controller parameter and the objective function, the PID controller parameter is iteratively optimized multiple times to obtain the optimized target PID controller parameter.
[0079] In the embodiments of the present application, the optimization variable is set to the three core control parameters of the PID controller: x=[Kp,Ki,Kd] And according to the engineering experience or equipment capacity to set the upper and lower limits of each control parameter, form a constrained optimization space.
[0080] The PID controller parameters can be iteratively optimized multiple times based on the initial values of the PID controller parameters and the target function using a preset optimization algorithm to obtain target PID controller parameters. The optimization algorithm can specifically include but is not limited to at least one of the following algorithms: DE method, BFGS, L-BFGS-B method and LSSQP method. A single optimization algorithm can be used, or a hybrid optimization algorithm can be used, for example, DE method is used for rough search, and BFGS is used for fine convergence, which takes into account efficiency and accuracy.
[0081] After each iteration optimization, it is judged whether the optimization termination condition is met; if the optimization termination condition is met, the iteration optimization is ended, and the final PID controller parameters are determined as the target PID controller parameters; if the optimization termination condition is not met, the iteration optimization is continued.
[0082] Specifically, the optimization algorithm iteratively generates new candidate parameter combinations in the parameter space , , which represents the value of the control parameter after the kth iteration optimization, and each round executes the following operations: 1) Call the target model to obtain the closed-loop response curve under the control parameter ; 2) Calculate each performance index and substitute it into the target function; 3) Judge whether the optimization termination condition is met; 4) If the optimization termination condition is not met, generate the next group of candidate parameters according to the current target function and historical search information; 5) Repeat the above process until the optimization termination condition is met.
[0083] Further, the step of "judging whether the optimization termination condition is met" can specifically include the following steps: if at least one of the following conditions is met, it is determined that the optimization termination condition is met: 1) The change rate of the target function is lower than the preset change rate threshold ε1;
[0084] 2) The change amplitude of the PID controller parameters is less than the preset change amplitude threshold ε2;
[0085] 3) The number of iterations reaches the preset iteration number threshold. In order to avoid resource waste and control delay, when the number of iterations reaches the maximum optimization iteration number (i.e. the iteration number threshold), the iteration learning is forcibly stopped regardless of whether the convergence is completed (satisfies condition 2) or the performance is up to standard (satisfies condition 1).
[0086] It should be noted that, in order to further enhance the safety and practicability of the control strategy, the embodiments of the present application can introduce a dual mechanism of soft constraint and hard constraint: 1) Soft constraint: realized by the penalty term in the reward function.
[0087] 2) Hard constraint: enforced in the action execution phase to ensure that the control system always operates within the safe and feasible domain.
[0088] In summary, the method for setting PID controller parameters in the embodiments of the present application determines the target model and corresponding target model parameters of the controlled object according to the historical running data of the controlled object when setting the PID controller parameters, determines the initial value of the PID controller parameters based on the target model parameters, calculates the performance index based on the historical running data, the target model and the current value of the PID controller parameters, and then determines the target function according to the performance index, and iteratively optimizes the PID controller parameters based on the initial value of the PID controller parameters and the target function to obtain the optimized target PID controller parameters. The entire process does not need to rely on expert experience and can automatically realize parameter setting. The target function is dynamically adjusted according to the performance index in the iteration process, which realizes the closed-loop mapping from “performance requirement” to “control parameter”, i.e., performance-oriented parameter setting, improves the setting precision and efficiency, and the dynamic adjustment mechanism makes the optimization process more flexible and intelligent, can perform targeted optimization according to different control requirements and performance bottlenecks, can adapt to different performance requirements, and realizes on-demand optimization of parameter setting. A phased optimization strategy is adopted: the initial value of the PID controller parameters is calculated based on the empirical formula method, then the performance indexes are calculated based on the historical data and the target model, and finally the target function is dynamically adjusted according to these performance indexes and the PID controller parameters are optimized. This phased method simplifies the optimization process, improves the calculation efficiency, and avoids the complexity and risks that may be brought by global optimization. In addition, this phased method is also convenient for engineers to understand and operate, and improves the feasibility and convenience of practical application.
[0089] The embodiments of the present application also provide an electronic device. As shown in Figure 3As shown, the electronic device 300 can have a large difference due to different configurations or performances, and can include one or more processors 301 and memories 302, and the memories 302 can store one or more programs or instructions. The memories 302 can be temporary storage or persistent storage. The programs stored in the memories 302 can include one or more modules (not shown in the figure), and each module can include a series of computer executable instructions in the electronic device 300. Further, the processor 301 can be configured to communicate with the memory 302, and execute a series of programs or computer executable instructions in the memory 302 on the electronic device 300. The electronic device 300 can further include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input / output interfaces 305, and one or more keyboards 306.
[0090] In particular embodiments, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and the program or instruction is executed by the processor to implement the steps of any of the embodiments of the method for tuning PID controller parameters.
[0091] The electronic device of the embodiments of the present application, when tuning the PID controller parameters, determines the target model and the corresponding target model parameters of the controlled object according to the historical running data of the controlled object, determines the initial value of the PID controller parameters based on the target model parameters, calculates the performance indicators based on the historical running data, the target model, and the current value of the PID controller parameters, and then determines the target function according to the performance indicators, and iteratively optimizes the PID controller parameters based on the initial value of the PID controller parameters and the target function to obtain the optimized target PID controller parameters. The entire process does not need to rely on expert experience and can automatically implement parameter tuning. In the iteration process, the target function is dynamically adjusted according to the performance indicators, which realizes the closed-loop mapping from “performance requirements” to “control parameters”, i.e., the performance-oriented parameter tuning, improves the tuning accuracy and efficiency, and the dynamic adjustment mechanism makes the optimization process more flexible and intelligent, can be optimized for different control requirements and performance bottlenecks, can adapt to different performance requirements, and realizes the on-demand optimization of parameter tuning. A phased optimization strategy is adopted: first, the initial value of the PID controller parameters is calculated based on the empirical formula method, then the performance indicators are calculated based on the historical data and the target model, and finally the target function is dynamically adjusted according to the performance indicators and the PID controller parameters are optimized. This phased method simplifies the optimization process, improves the calculation efficiency, and avoids the complexity and risks that may be brought by global optimization. In addition, this phased method is also convenient for engineers to understand and operate, and improves the feasibility and convenience of practical application.
[0092] The embodiment of the present application further provides a readable storage medium, which stores one or more computer programs or instructions, and the programs or instructions can enable a processor in an electronic device to execute the steps of any PID controller parameter setting method embodiment described above when executed by the processor in the electronic device.
[0093] The readable storage medium of the embodiment of the present application, when setting PID controller parameters, determines a target model of a controlled object and corresponding target model parameters according to historical running data of the controlled object, determines initial values of the PID controller parameters based on the target model parameters, calculates performance indexes based on the historical running data, the target model and current values of the PID controller parameters, further determines a target function according to the performance indexes, and performs multiple iteration optimizations on the PID controller parameters based on the initial values of the PID controller parameters and the target function to obtain optimized target PID controller parameters. The whole process does not need to rely on expert experience and can automatically implement parameter setting. The target function is dynamically adjusted according to the performance indexes in the iteration process, which realizes closed-loop mapping from “performance requirements” to “control parameters”, that is, performance-oriented parameter setting, improves setting precision and efficiency, and the dynamic adjustment mechanism makes the optimization process more flexible and intelligent, can perform targeted optimization according to different control requirements and performance bottlenecks, can adapt to different performance requirements, and realizes on-demand optimization of parameter setting. A phased optimization strategy is adopted: initial values of the PID controller parameters are calculated based on an empirical formula method, then each performance index is calculated based on the historical data and the target model, and finally the target function is dynamically adjusted according to the performance indexes and the PID controller parameters are optimized. The phased method simplifies the optimization process, improves the calculation efficiency, and avoids the complexity and risks that may be brought by global optimization. In addition, the phased method is also convenient for engineers to understand and operate, and improves the feasibility and convenience of practical application.
[0094] The system, apparatus, module or unit described in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0095] For the convenience of description, the above apparatus is described in various units by functions. Of course, the functions of the units can be implemented in the same or more software and / or hardware when implementing the present application.
[0096] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0097] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.
[0098] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.
[0099] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.
[0100] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0101] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), optical storage, and / or flash memory. The memory is an example of computer readable storage media.
[0102] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0103] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device that includes the element.
[0104] The present application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types. The present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
[0105] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0106] The above merely provides an example of the present application, and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall fall into the scope of claims of the present application.
Claims
1. A method for tuning PID controller parameters, characterized in that, include: Obtain historical operational data of the controlled object; The target model of the controlled object and the target model parameters of the target model are determined based on the historical operating data. The initial values of the PID controller parameters are determined based on the target model parameters; Based on the historical operating data, the target model, and the current values of the PID controller parameters, calculate the performance index of the PID controller; The objective function of the PID controller is determined based on the performance indicators. Based on the initial values of the PID controller parameters and the objective function, the PID controller parameters are iteratively optimized multiple times to obtain the optimized target PID controller parameters.
2. The method according to claim 1, characterized in that, The acquisition of historical operational data of the controlled object includes: Obtain the control mode of the PID controller; Based on the control mode, the collection time period and collection type of the historical operation data are determined; The historical operational data is collected according to the collection time period and the collection type.
3. The method according to claim 1, characterized in that, The step of determining the target model of the controlled object and the target model parameters of the target model based on the historical operating data includes: The model parameters of each candidate model are optimized and fitted based on the historical operating data. Determine the degree of fit of each candidate model after optimization; The candidate model with the highest degree of fit is determined as the target model; The model parameters after optimization and fitting of the target model are determined as the target model parameters.
4. The method according to claim 1, characterized in that, The process of determining the initial values of the PID controller parameters based on the target model parameters includes: Based on the target model parameters, the initial values of the PID controller parameters are determined using an empirical formula method.
5. The method according to claim 1, characterized in that, The performance indicators include at least one of the following: control responsiveness indicators, control accuracy indicators, and control stability indicators; The control responsiveness metrics include at least one of the following metrics: rise time metric and settling time metric; The control accuracy index includes at least one of the following: overshoot index, coefficient of variation index of deviation, and integral error index; The control stability index includes the oscillation index.
6. The method according to claim 1, characterized in that, Determining the objective function of the PID controller based on the performance index includes: Calculate the average performance defect rate for each of the aforementioned performance indicators; Calculate the candidate weights for each performance index based on the average performance defect rate; The candidate weights are normalized to obtain the target weights; The objective function is determined based on each of the performance indicators and the corresponding target weights.
7. The method according to claim 1, characterized in that, The process of iteratively optimizing the PID controller parameters based on the initial values of the PID controller parameters and the objective function to obtain optimized target PID controller parameters includes: Based on the initial values of the PID controller parameters and the objective function, the PID controller parameters are iteratively optimized multiple times using a preset optimization algorithm to obtain the target PID controller parameters; the optimization algorithm includes at least one of the following algorithms: DE method, BFGS, L-BFGS-B method and LSSQP method.
8. The method according to claim 1, characterized in that, The process of iteratively optimizing the PID controller parameters based on the initial values of the PID controller parameters and the objective function to obtain optimized target PID controller parameters includes: After each iteration of optimization, determine whether the optimization termination condition is met; If the optimization termination condition is met, the iterative optimization ends, and the final PID controller parameters are determined as the target PID controller parameters. If the optimization termination condition is not met, the iterative optimization continues.
9. The method according to claim 8, characterized in that, The determination of whether the optimization termination condition is met includes: If at least one of the following conditions is met: the rate of change of the objective function is lower than a preset rate of change threshold, the magnitude of change of the PID controller parameters is less than a preset magnitude of change threshold, and the number of iterations reaches a preset number of iterations threshold, then the optimization termination condition is determined to be met.
10. An electronic device, characterized in that, include: A processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the PID controller parameter tuning method as described in any one of claims 1-9.
Citation Information
Patent Citations
Automatic safety setting method based on Gaussian process PID control parameter
CN111505936A
PID parameter setting method and system based on optimized path
CN113625549A
PID parameter setting method and device
CN116909129A
PID controller online setting method for industrial process
CN120122421A
Motor fuzzy PID parameter tuning method based on improved whale algorithm
WO2025160684A1