Adaptive adjustment method of digital PID controller
By independently adjusting the PID controller parameters using an adaptive adjustment method, the problems of complex manual setting and high computational load of PID controllers in PLCs are solved, achieving fast, simple, and universal automatic adjustment suitable for various controlled objects.
Patent Information
- Application Number
- CN201980103194.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-27
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2039-12-27
AI Technical Summary
In programmable logic controllers, manually setting PID controller parameters is complex and time-consuming, especially when the sensor and actuator are far apart. Existing automatic adjustment methods have high computational load and lack versatility.
An adaptive adjustment method is adopted, and the adjustment equations of PID controller parameters Kp, Ki, and Kd are derived through reverse engineering. Each parameter is adjusted independently, and an incremental PID algorithm is used to limit the amount of parameter modification to ensure smooth decay and reduce the demand for computing resources.
It achieves fast, simple and universal automatic adjustment of PID controller parameters, reduces computational load, is applicable to various controlled objects, and does not require preliminary evaluation of mathematical models.
Smart Images

Figure CN114981731B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the rapid automatic adjustment of parameters of a digital proportional-integral-derivative (PID) controller for the automation of process flows using programmable logic controllers. Background Technology
[0002] Programmable Logic Controllers (PLCs) are widely used in many fields for process automation. A PLC typically consists of a CPU and several input and output signal modules. These electronic modules are used to process signals from digital and analog sensors and control the drive of various compressors, pumps, or valves.
[0003] In industrial applications, it is often necessary to maintain constant temperature, pressure, and liquid or gas volume in specific areas of a factory through automatic control. All of these can be achieved using a PID controller, which has proven its reliability and versatility through long-term application.
[0004] If the temperature or pressure sensor is located near the actuator (valve or pump), or if the actuator has little effect on the sensor, manually setting the parameters of the PID controller is not complicated.
[0005] However, manually setting PID controller parameters becomes more complex and introduces significant delays when the sensor is far from the actuator. For example, the superheat temperature of the refrigerant in a cooler is controlled simultaneously by two values from temperature and pressure sensors. In these or other cases, manual parameterization of the PID controller requires considerable experience and a deep understanding of the production equipment. Therefore, equipment capable of automating these tasks would be highly useful.
[0006] Solving the automatic adjustment problem of a PID controller is akin to searching for the optimal solution. A crucial factor is determining the initial parameters of the PID controller, such as K. p K i K d (that is, the proportion K) p Integral Action K i and differential action K d (coefficient), which serves as the starting point for the adaptive adjustment method.
[0007] Scientific papers and inventions on this topic tend to favor automatic adjustment methods for PID controllers based on fuzzy logic mechanisms, aiming to achieve high-quality results. However, considering the following characteristics, the overall value requirement for this solution is also high.
[0008] The mathematical approach of fuzzy logic has a relatively high computational load. PLCs are typically used to automate various tasks in technical processes, and several PID controllers can be used simultaneously to achieve this. If fuzzy logic mechanisms with PID controllers are used to modify control variables for a long period of time, even for modern PLCs, the cumulative computational load can be very high.
[0009] - Relevance to specific problems: The rule set of fuzzy inference methods, as well as the function parameters for fuzzification and defuzzification, are usually chosen to solve a specific problem. This can lead to a lack of generality in the solution.
[0010] There are also alternative solutions, with the appropriate method matched to the complexity of the controlled object. In this regard, an adaptive regulation process typically consists of two phases [1,2]. In the first phase, a closed-loop control is set at the stability boundary using the Ziegler-Nichols method.
[0011] In [1], only the two cases where the controlled object may be second-order or third-order are considered. Therefore, in the second stage, the necessary methods for adjusting the PID controller parameters were selected: the pole placement algorithm, the Banyász-Keviczky algorithm, or the Dahlin algorithm. The conclusion of [1] shows that this automatic adjustment method was only tested on second-order and third-order controlled objects.
[0012] In [2], only one problem was addressed: the automatic adjustment of the PID controller parameters for the heat exchanger. To this end, an enhanced Ziegler-Nichols rule was used in the second stage, but the choice of modification coefficients was not disclosed. Summary of the Invention
[0013] The purpose of this invention is to automate the process flow of a programmable logic controller by rapidly and automatically adjusting the parameters of a PID controller through simulated feedback of actual values.
[0014] This invention is based on nine regulation equations derived through reverse engineering of a PID controller. The PID controller parameter K... p K i and K d The adaptive regulation is performed independently over time, meaning that only one PID parameter is modified at any given time point t. This characteristic is reflected in the equations derived from the adaptive regulation method. Therefore, it is not permissible to modify the parameters of all three PID controllers simultaneously. In some regulation equations, additional constraint coefficients are employed to ensure a smooth decay of the adaptive regulation method, preventing sudden modifications to the PID controller parameters in the final stages.
[0015] Features of this invention:
[0016] - Adaptive adjustment methods are relatively simple, independent of other methods and algorithms, mathematically balanced (i.e., require the least amount of computational resources), and easy to implement.
[0017] Setting up a PID controller using this method does not require preliminary evaluation of the controlled object or the establishment of a mathematical model. This also means that the method has good versatility and is not tied to a specific controlled object.
[0018] Potential application limitations:
[0019] - The convergence of this method depends on the PID controller parameter K. p K i and K d Given initial values, it is similar to the minimum search algorithm in optimization problems. Attached Figure Description
[0020] All features that highlight the novelty of this invention are described in detail in the appended claims. However, the elements of the invention are set forth in the following detailed description, accompanied by drawings illustrating the best mode for carrying out the invention.
[0021] Figure 1 Adjusting the time scale of the PID controller
[0022] Figure 2A Flowchart of Adaptive Adjustment Method for PID Controller (Start)
[0023] Figure 2B Flowchart of Adaptive Adjustment Method for PID Controller (End)
[0024] Figure 3 Closed-loop control
[0025] Figure 4 .1 Controlled object's response to the step function
[0026] Figure 5 .2 The response of the controlled object to the step function
[0027] Figure 6 .3 Controlled object's response to the step function
[0028] Figure 7 Response of controlled object No. 4 to the step function
[0029] Figure 8 The response of controlled object No. 5 to the step function Detailed Implementation
[0030] The following detailed description, accompanied by drawings, refers to the best mode for carrying out the invention, not a simplified form. All modifications and additions contained in the claims are disclosed in the relevant claims.
[0031] The following is the best mode for implementing this invention.
[0032] This invention relates to the adaptive regulation of a PID controller described by standard equations, as shown below [3]:
[0033]
[0034] in:
[0035] y t It is the control variable for time t;
[0036] e t It is the set value w and the actual value x t The control error at time t is calculated using the formula e. t =w–x t ;
[0037] K p It is the proportionality coefficient;
[0038] K i It is the integral action coefficient;
[0039] K d It is the differential action coefficient.
[0040] The PID controller (1) is the foundation of reverse engineering, from which the parameter K can be derived. p K i and K d The regulating equation. The characteristics of this derivation method are reflected in the following sequentially arranged steps:
[0041] Step 01: Eliminate the integral directly used in the PID controller. This can be achieved by differentiating both sides of equation (1) with respect to time t [3]:
[0042]
[0043] Step 2: Fix two of the three PID controller parameters at any point in time t. To simplify the derivation of the regulation equation as much as possible, the three PID controller parameters K... p K i and K d The two values in K are used as fixed values in turn. That is, K i and K d K at time t p K is treated as a fixed value in the adjustment equation. pand K d K at time t+1 i K is used as a fixed value in the adjustment equation. p and K i K at time t+2 d In the regulation equation, it is used as a fixed value. Therefore, all three PID controller parameters K p K i and K d The adaptive adjustment is performed time-separated, meaning that only one PID parameter is modified at any point in time t. To separate the parameter changes over time and determine the iteration steps, three additional exponents are used: k represents K... p m represents K i n represents K d (See Figure 1 With these exponents, the final form of the PID controller (2) is:
[0044]
[0045] Step 3: Derive the calculation coefficient K p Adjustment steps for value dK p k The equation.
[0046] Therefore, parameter K p k It is represented by (3), and the equation is differentiated according to time t.
[0047]
[0048] in:
[0049] dy t The change of the control variable over time t is determined as dy. t =y t -y t-1 ;
[0050] d 2 y t It is the control variable y t The second differential over time t is calculated using the formula d. 2 y t =dy t -dy t-1 ;
[0051] de t The control error e at time t t The first differential of is calculated using the formula de. t =e t –e t-1 ;
[0052] d 2 e t The control error e at time t t The second differential of d is calculated using the formula d. 2 e t =e t –2·e t-1 +e t-2 ;
[0053] d 3 e t The control error e at time t t The third differential of is calculated using the formula d. 3 e t =e t –3·e t-1 +3·e t-2 –e t-3 ;
[0054] K i m-1 It is the integral action coefficient of iteration step m-1;
[0055] K d n-1 It is the differential action coefficient of the iteration step n-1.
[0056] Step 4: Determine a rule to adjust the scaling factor K in iteration step k. p ,as follows:
[0057]
[0058] in:
[0059] K p k-1 It is the scaling factor for iteration step k-1;
[0060] α p k The scaling factor K in iteration step k p Adjustment speed.
[0061] Equation (5) restricts the parameter K p The maximum modification amount is ±0.5 to prevent the uncontrollability of the adjustment method.
[0062] Step 5: Derive the calculation proportionality coefficient K p Adjustment speed α p k The equation is given. Therefore, equation (5) is substituted into (3) to control the error e. t This is expressed by the derived equation. Considering that as t→+∞, e tThe limit is 0, α p k The derived equation represents:
[0063]
[0064] The characteristic of this equation is the parameter α. p k There is an additional limit in the range of 0.0001 to 1, depending on the control error e. t This ensures a smooth decay of the adaptive adjustment method in the final stage. Furthermore, it prevents the control error e from... t The proportionality coefficient K is close to zero p The sudden modification.
[0065] Step 6: Derive the integral action coefficient K i Adjustment steps for value dK i m The equation. Therefore, the parameter K... i m It is represented by (3), and the equation is differentiated according to time t.
[0066]
[0067]
[0068] Step 7: Define a rule and adjust the integral action coefficient K in iteration step m. i As shown below:
[0069]
[0070] in:
[0071] α i m K is the integral action coefficient in iteration step m. i Adjustment speed.
[0072] Equation (8) restricts the parameter K i The maximum modification amount is ±0.5 to prevent the uncontrollability of the adjustment method.
[0073] Step 8: Derive the integral action coefficient K i Adjustment speed α i m The equation is as follows. Therefore, equation (8) is substituted into (3), and the control error de is expressed from the derived equation. t The first-order differential of . Considering that as t→+∞, de t The limit is 0, α i mThe derived equation represents:
[0074]
[0075] The characteristic of this equation is the parameter α. im There is an additional limit in the range of 0.0001 to 1, depending on the control error e. t This ensures a smooth decay of the adaptive adjustment method in the final stage. Furthermore, it prevents the control error e from... t When it approaches zero, the integral action coefficient K i A sudden change occurred.
[0076] Step 9: Derive the calculation of the differential action coefficient K d Adjustment steps for value dK d n The equation. Therefore, the parameter K... d n It is represented by (3), and the equation is differentiated according to time t.
[0077]
[0078] Step 10: Determine a rule to adjust the differential action coefficient K in iteration step n. d As shown below:
[0079]
[0080] in:
[0081] α d n The differential action coefficient K in iteration step n d Adjustment speed.
[0082] Equation (11) restricts the parameter K d The maximum modification amount is ±0.5 to prevent the uncontrollability of the adjustment method.
[0083] Step 11: Derive the calculation of the differential action coefficient K d Adjustment speed α d n The equation is given. Therefore, equation (11) is substituted into (3) to control the error e. t This is expressed by the derived equation. Considering that as t→+∞, e t The limit is 0, α d n The derived equation represents:
[0084]
[0085] The characteristic of this equation is the parameter α.d n There is an additional limit in the range of 0.0001 to 1, depending on the control error e. t This ensures a smooth decay of the adaptive adjustment method in the final stage. Furthermore, it prevents the control error e from... t When the differential action coefficient K approaches zero d A sudden change occurred.
[0086] Step 12: Select a digital PID controller. The incremental PID algorithm is the most suitable variant of this adaptive control method (see [4], page 1085).
[0087]
[0088] in:
[0089] dy t+1 It is the change of the control variable at time t+1;
[0090] dt is the sampling time of the digital PID controller.
[0091] In this equation, the PID controller parameter K p K i and K d The actual value is always used at time t.
[0092] The incremental PID algorithm was chosen based on the following criteria:
[0093] -Control error e t Directly integrated into the control variable y t In practice, this makes the control variable y... t It can be forcibly modified as needed without explicitly correcting the integrator to achieve seamless functionality (unlike positional PID algorithms).
[0094] at last, Figure 2A and Figure 2B The flowchart shown integrates and arranges the equations for automatically adjusting the digital PID controller into a series of steps to fully explain the specification of this invention.
[0095] Invention Demonstration
[0096] To illustrate this specification, the invention is demonstrated using mathematical models of some controlled objects.
[0097] Figure 3 This demonstrates a closed-loop control with negative feedback, consisting of a PID controller and a controlled object.
[0098] To demonstrate the invention, an adaptive digital PID controller developed for a PLC using the programming language SCL (Structured Control Language [5]) (see Appendix A) and some transfer functions were used as the controlled object (see Table I).
[0099]
[0100] Table I. Transfer function G(s) of the controlled object in the Laplace s-domain
[0101] Since the Laplace s-domain transfer function G(s) cannot be directly used in a PLC, it must first be converted into an equivalent equation in the time domain. Therefore, the transfer function G(s) is first converted from the Laplace s-domain to a similar discrete z-domain transfer function using the MATLAB function c2d, with a sampling time dt = 0.1 seconds (see Table II).
[0102]
[0103]
[0104] Table II. Z-domain equivalent transfer function for sampling time dt = 0.1 seconds
[0105] Then the transfer function in the z-domain is converted into a recursive equation in the time domain, as detailed below (see [4], pages 443 and 444):
[0106]
[0107] in:
[0108] y t It is the control variable of the PID controller at time t;
[0109] x t It is the response of the controlled object to the control variable, that is, the simulated sensor value at time t.
[0110] All polynomial parameters (14) of the simulated controlled object are shown in Table III.
[0111]
[0112]
[0113] Table III. Polynomial parameters of the transfer function of the controlled object (14)
[0114] By simulating a closed-loop control (see...) Figure 3 The simulation was performed on a computer-aided PLC simulator. The simulation results for the mathematical models of all controlled objects in Table I are shown in Table IV. Where T... i It is the reset time, determined by T.i =K p / K i It is concluded that T d It is the differential time, given by T d =K d / K p The conclusion is that all experiments were conducted with the initial parameter K. p =1, K i =1, K d This was performed with a value of 1 and a sampling time dt = 0.1 seconds. A step function 0→1 was used as the activation trigger.
[0115]
[0116] Table IV. Parameters of the Digital PID Controller Obtained Using the Adaptive Adjustment Method
[0117] References
[0118] [1] Vladimir Bobal et.al., "AUTO-TUNING OF DIGITAL PID CONTROLLERSUSING RECURSIVE IDENTIFICATION", Adaptive systems in Control and SignalProcessing, June 16, 1995 (1995-06-16), pp.359-364, XP055754038, Great Britain,ISBN:978-0-08-042375-3.
[0119] [2] Sukede Abhijeet Kishorsingh et al., "Auto tuning of PIDcontroller", 2015International Conference on Industrial Instrumentation and Control (ICIC), IEEE, May 28-30, 2015, pp.1459-1462, XP033170865.
[0120] [3]"Three Types of PID Equations", http: / / bestune.50megs.com / typeABC.htm
[0121] [4] Lutz H., Wendt W., "Taschenbuch der Regelungstechnik mit MATLAB undSimulink", 10., Auflage,Verlag Europa-Lehrmittel,Haan-Gruiten,2014.
[0122] [5]International standard IEC 61131-3:2013.Programmable controllers-Part 3:Programming languages.
[0123] [6]Lin Feng,Brandt Robert D.,Saikalis George,“Self-tuning of PIDControllers by Adaptive Interaction”,Proceedings of the 2000 American ControlConference,pp.3676-3681.
[0124] [7]Y.Chen et al.,“Design of PID Controller of Feed Servo-System Basedon Intelligent Fuzzy Control”,Key Engineering Materials,Vol.693,pp.1728-1733,2016.
[0125] [8]X.Wang et al.,“Simulation Research of CNC Machine Servo SystemBased on Adaptive Fuzzy Control”,Advanced Materials Research,Vol.819,pp.181-185,2013.
[0126] [9]T.Boone et al.,“PID Controller Tuning Based on the Guardian MapTechnique”,International Journal of Systems Applications,Engineering&Development,Vol.9,pp.192-196,2015.
[0127]
[10] Dipraj, Dr. AKPandey, "Speed Control of DCServo Motor By FuzzyController", International Journal of Scientific & Technology Research, Vol. 1, Issue 8, pp. 139-142, 2012.
[0128] Industrial applicability
[0129] This invention is suitable for automation systems of industrial equipment with programmable logic controllers (PLCs), where individual adjustment of PID controller parameters is required to control the production process. Appendix A. Source code of the adaptive digital PID controller.
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
Claims
1. A method of adaptive adjustment of parameters of a digital PID controller, characterized in that K is represented using a cycle counter and three additional exponents k. p m represents K i and n represent K d As an iterative step, by adjusting the actual value x t The simulated feedback modifies only one PID parameter K at any time point t. p K i or K d In closed-loop control, the cyclic sequence of operations performed is equal in time intervals, and nine regulation equations derived through reverse engineering of a digital PID controller are used, namely: 1) Adjustment step value dK of the proportionality coefficient K in iteration step k at time t p Adjustment equation for the proportionality coefficient K pk Adjustment equation for the proportionality coefficient K wherein: dt is the sampling time of the digital PID controller; dy t is the control variable change for time t, determined as dy t = y t – y t-1 , d 2 y t is the control variable y t The second derivative at time t is calculated as d 2 y t = dy t -dy t-1 , e t is a set value w and an actual value x t The control error at time t is calculated as e t = w - x t , de t is the first derivative of the control error e t at time t, which is calculated as de t = e t - e t-1 , d 2 e t is the second derivative of the control error e t of time t, which is calculated as d 2 e t = e t - 2 · e t-1 + e t-2 , d 3 e t is the third derivative of the control error e t of time t, which is calculated as d 3 e t = e t - 3 · e t-1 + 3 · e t-2 - e t-3 , K im-1 is the integral action coefficient of iteration step m-1, K dn-1 is the differential action coefficient of iteration step n-1, 2) the adjustment speed a of the proportionality coefficient K in the iteration step k at the time t p the adjustment equation of the adjustment speed a of the proportionality coefficient K pk the adjustment equation of the adjustment speed a of the proportionality coefficient K wherein: K pk-1 is the scaling factor of iteration step k-1, 3) the scaling factor K in iteration step k p the governing equation: 4) the adjustment step value dK of the integral action coefficient K at time t of iteration step m i im the adjustment equation: 5) Calculate the integral action coefficient K in iteration step m at time t i the adjustment speed a im the adjustment equation: 6) Iterating the integral action coefficient K in step m i Regulation equation: 7) the adjustment step value dK of the differential action coefficient K at time t of iteration step n d the adjustment equation: dn the adjustment equation: 8) the differential action coefficient K in iteration step n at time t d the adjustment speed a of the dn adjustment equation: 9) the differential action coefficient K in iteration step n d regulation equation:
2. The method of adaptive adjustment of parameters of a digital PID controller according to claim 1, characterized in that PID controller parameters K p , K i and K d are adaptively adjusted in equal time intervals in a loop comprising the following series of steps: S01: Start S02: Reset a time index t to 0 and set the time counter to 0 seconds S03: Set k = 0 p the iteration step k is reset to 0 S04: Set K i m = 0 S05: Set K d the iteration step n to 0 S06: When k = 0, the scaling factor K is set to the initial value p is set to the initial value S07: When m = 0, the integral action coefficient K is set to the initial value i is set to the initial value S08: When n = 0, the differential action coefficient K is set to the initial value d is set to the initial value S09:K p the iteration step k is increased by 1 S10:K i the iteration step m is increased by 1 S11:K d the iteration step n is increased by 1 S12: Reset the iteration counter to 0 S13: At time t, control variable y t is set to 0 S14: change the control variable by dy t At time t set to 0 S15: Change the control variable at time t+1 by dy t+1 Set to 0 S16: Increase a time index t by 1 and increase the time counter by a sampling time dt S17: Calculate the set value w and the actual value x t the actual control error e between the set value w and the actual value x at time t t is e t = w - x t S18: If the time index t > 3, go to step S19, otherwise go back to step S13 S19: If the absolute value of the actual control error e t is lower than a specified threshold value, go to step S41, otherwise go to step S20 S20: Evaluate if the iteration counter is between 0-2: if its value is 0, go to step S21; if its value is 1, go to step S25; or if its value is 2, go to step S29 S21: Calculate the adjustment step value dK of the proportionality coefficient K in iteration step k at time t p pk : wherein: d 2 y t is the control variable y t the second derivative at time t, calculated as d 2 y t = dy t -dy t-1 ; de t is the first derivative of the control error e t at time t, which is calculated as de t = e t - e t-1 ; d 2 e t is the second derivative of the control error e t of time t, which is calculated as d 2 e t = e t - 2 · e t-1 + e t-2 ; d 3 e t is the third derivative of the control error e t of time t, which is calculated as d 3 e t = e t - 3 · e t-1 + 3 · e t-2 - e t-3 ; K im-1 is the integral action coefficient of iteration step m-1 ; K dn-1 is the differential action coefficient of iteration step n-1 S22: Calculate the scaling factor K in iteration step k at time t p adjustment speed a pk : wherein: K pk-1 is the scale factor of iteration step k-1 S23: Adjust the scale factor K in iteration step k p : S24: Go to step S32 S25: Calculate the integral action coefficient K in iteration step m at time t i of the adjustment step value dK im : S26: Calculate the integral action coefficient K in iteration step m at time t i adjustment speed a im : S27: adjust the integral action coefficient K in iteration step m i : S28: Go to step S32 S29: Calculate the differential action coefficient K in iteration step n at time t d of the adjustment step value dK dn : S30: Calculate the differential action coefficient K in iteration step n at time t d adjustment speed a dn : S31: Adjust the differential action coefficient K in iteration step n d : S32: Increase the iteration counter by 1 S33: If the iteration counter < 3, go to step S38, otherwise go to step S34 S34:K p the iteration step k is increased by 1 S35:K i the iteration step m is increased by 1 S36:K d the iteration step n is increased by 1 S37: Reset the iteration counter to 0 S38: PID controller parameters K at time t are used p , K i , and K d actual values, the control variable change dy t+1 at time t+1 is calculated according to the incremental PID algorithm S39: Modify the control variable y at time t t : y t = y t-1 + dy t+1 S40: Return to step S16 S41: End.