You are on page 1of 10

PID controller tuning methods: a novel teaching approach

A.O¶Dwyer, School of Control Systems and Electrical Engineering, Dublin Institute of Technology, Kevin St., Dublin 8. e-mail: aidan.odwyer@dit.ie Abstract: This paper discusses an approach to the teaching of PID controller tuning methods to final year bachelors degree and taught masters students in control engineering at Dublin Institute of Technology, Ireland. The method involves analytically calculating the gain margin, phase margin and maximum sensitivity for PI and PID controlled systems whose process is modeled in first order lag plus time delay (FOLPD) form. Students can examine the performance of many tuning rules from graphical results, allowing insight to be developed as to the most rational choice of the tuning rule for the application. Some preliminary work done to develop an expert system to allow a greater automation of the procedure for recommending a tuning rule, for user defined requirements, is also described. 1. Introduction The ability of proportional integral (PI) and proportional integral derivative (PID) controllers to compensate most practical industrial processes has led to their wide acceptance in industrial applications. It has been stated, for example, that 98% of control loops in the pulp and paper industries are controlled by PI controllers (Bialkowski, 1996) and that, in more general process control applications, more than 95% of the controllers are of PID type (Åström and Hägglund, 1995). The requirement to choose either two or three controller parameters has meant that the use of tuning rules to determine these parameters is popular. The author has tabulated 219 such tuning rules in the literature to specify the PI controller terms, with 381 tuning rules defined to specify the PID controller parameters (O¶Dwyer, 2003). Though the use of tuning rules is practically important, it is a challenge to allow students to gain perspective on the advantages and limitations inherent in the method. Traditionally, the topic has been taught by briefly considering the major classes of tuning rule methods, followed by a more detailed study, often in the laboratory, of one or more tuning rules (typically the process reaction curve tuning method of Ziegler and Nichols (1943) and the ultimate cycle method of Ziegler and Nichols (1942)). A number of textbooks offer a more comprehensive approach (e.g. Ogunnaike and Ray (1994), Marlin (2000), Wilkie et al. (2002), Seborg et al. (2004)), though the tuning rule methods discussed are presented in a stand-alone manner. To the authors¶ knowledge, no textbook gives a comprehensive approach to choosing a tuning rule based on a performance specification and knowledge of the process to be controlled. This paper will describe such an approach to tuning rule selection taught at the Dublin Institute of Technology to students taking control engineering as an option subject in both the final year of the fouryear honours Batchelor of Engineering (B.E.) degree in Electrical/Electronic Engineering and the one-year taught Masters of Engineering (M.E.) degree in Advanced Engineering. The process is modeled as a first order lag plus time delay (FOLPD) model, and compensated by PI or PID controllers whose parameters are specified using appropriate tuning rules. The gain margin, phase margin and maximum sensitivity of the compensated system, as the ratio of time delay to time constant of the process varies, are analytically determined. The results of the analytical calculations are plotted and are used by the students to judge the performance and robustness of the compensated system, the appropriateness of the tuning rule for a given process and the range of time delay to time constant ratios over which it is sensible to apply various tuning rules. The teaching approach is based on research work previously published by Ho et al. (1995), (1996) and O¶Dwyer (1998), (2001). The paper is organised as follows. The formulae taught to the students for analytically calculating the gain margin, phase margin and maximum sensitivity, for the PI compensated process, are developed in Section 2. Graphical results showing the performance and robustness of FOLPD processes, compensated with sample PI and PID tuning rules, are shown in Section 3. In Section 4, a tuning rule that achieves constant gain and phase margins for all values of delay is outlined. Section 5 outlines some work done on an expert system implementation of the method, for teaching purposes. Conclusions of the work are drawn in Section 6. 2. The analytical calculation of gain margin, phase margin and maximum sensitivity ± PI controller

5T  tan 1 [p Ti  tan 1 [p Tm  [p X m !  T From Equation (10). as is shown in Figures 1a and 1b.e. the following sets of equations are obtained: (4) J m ! arg c ( j[ g ) m ( j[ g )  T m m m m c ( j[ p ) where [g and [ p are given by c ( j[ g ) m ( j[ g ) ! 1 m arg c ( j[ p ) From Equation (3). from Equations (5) and (8). 2003). m c 1  [g Ti 2 2 [g Ti 1  [g Tm lso.e. Then  j[X c ( j[ Ti  1) me (3) m ( j[) c ( j[) ! 1  j[Tm j[Ti From the definition of gain and phase margin. £             .The controller and process model are respectively given by ¨ 1 ¸ © ¹ c (s ) ! c ©1  Ti s ¹ ª º m ( s) ! e  sX (2) 1  sTm The controller is a so-called ideal PI controller. n approximate analytical solution may be obtained if the following approximation for the arctan function is made: T T T tan 1 x } x . m ( j[) c ( j[) ! m c 1  [2 Ti 2 2 [Ti 1  [ Tm Therefore. x 1 and tan 1 x }  .5T  tan 1 [g Ti  tan 1 [g Tm  [g Xm with [g given by the solution of Equation (6) i. [ g may be determined analytically to be [g ! Ti 2 2 m c 1  2 2 m c  1 Ti  4 2 2 2Ti Tm n analytical solution of Equation (12) (to determine [p ) is not possible. 98 tuning rules have been defined for the control of processes modeled in FOLPD form using this controller (O¶Dwyer.  0. x "1 (14) 4 2 4x This is quite an accurate approximation. from Equation (4) J m ! T  0. m m ( j[p ) c ( j[p ) with [p given by the solution of Equation (7) i.

.

    ¡ ¡ ! 1 ¡ ¡ ? 2 2 2 ! ¡ ¡ ¡ ! 1 m ( j[ p ) !  T ’  0.5T  tan 1 [Ti  tan 1 [Tm  [X m !1 ¡ ¡ ? [p Ti m c                 ¡ ¢ ¡ ¡ (1) ¡ ¡ A ( j[ p ) (5) (6) (7) A ¢ ¡ ¡ £ £ (8) (9) (10) 1  [p Tm 1  [p Ti 2 2 2 2 (11) (12) 2 2 2 m c Tm 2 (13) .

are s (i) s 2  4 X m  Ti 2 from Equations (15) to (18).Figure 1a: Arctan x and its approximation (Equation 14) arctan x approximation Figure 1b: % error in taking approximation (Equation 14) to arctan(x) Considering Equation (12). It is defined as follows: 1 ax (19) max all [ 1 m ( [) c ( [) For a FOLPD process model controlled by a PI controller. together with the formula for [ p that may be determined analytically for each of these cases.0) point on the Rl-Im axis. The maximum sensitivity is the reciprocal of the shortest distance from the Nyquist curve to the (-1. These possibilities. four possibilities present themselves if the approximation in Equation (14) is to be used.      (iv) (18) 4X m .

[ p Tm 1 : [p 2.Tm  Ti The gain and phase margin of the compensated system. [ p Tm 1 : [p  © (iii) [ p Ti  1. [ p Tm " 1 : [ p Tm ¦ § (ii) © ¨ [ p Ti " 1. (13) and the relevant approximation for [ p   [ p Ti 1. may be calculated by applying Equations (9). (11). as a function of X m Tm . for each of the tuning rules.

0.25 Tm Ti ¦ § § § § ¥ [p Ti " 1. [p Tm " 1 : [ p ¤ 2 ¨ 1 1  4 Xm ©  ©T T m ª i 4X m ¸ ¹ ¹ º Xm ¤ ¤ (15) .

0.25 Tm Xm (16) (17)  .

ISE reg and ITAE reg refer to the tuning rules for regulator applications that minimise the integral of absolute error criterion. that many tuning rules may be applied at ratios of time delay to time constant greater than that normally recommended. where the gain margin. Figures 8 to 15 show gain and phase margin comparisons between corresponding PI and PID controller tuning rules. 2003). the difference between the phase margins is less clear cut. y The decision between the use of a PI and PID controller to compensate the process. together with the desired trade-off between performance and robustness. One example may be seen in Figures 5 to 7. it is striking that the ISE based tuning rules have generally the smallest gain margin and have also a small phase margin. using these controllers (O¶Dwyer. ¨ 1 ¸¨ 1  sTd ¸ ¹ © ¹© (19) c (s ) ! c ©1  Ti s ¹© 1  sETd ¹ ª ºª º ¸ ¨ 1 (20)  Td s¹ ©1  Ti s º ª 88 tuning rules have been defined for the control of processes. 1967). This suggests that these PID tuning rules should provide a greater degree of performance than the corresponding PI tuning rules. compensated by the classical PID controller structure. IAE reg. Z-N refers to the process reaction curve method of Ziegler and Nichols (1942). phase margin and maximum sensitivity of FOLPD process models. which is compatible with application experience. The MATLAB package has been used in the simulations. but may be less robust. it is interesting. in a straightforward manner. phase margin and maximum sensitivity (associated with the use of the PID tuning rule for obtaining minimum IAE in the regulator mode) tends to level out when the ratio of time delay to time constant is greater than 1. over the ratios of time delay to time constant taken. however. Simulation results Space considerations dictate that only representative simulation results may be provided. depends on the ratio of time delay to time constant in the FOLPD model. These controller structures are given by equations (19) and (20). y Comparing the individual tuning rules. In these results. normally.1) are used (Figures 5 to 7). c ( s) ! c 3. The results in Figures 4 and 7 confirm these comments. phase margin and maximum sensitivity vary as the ratio of time delay to time constant varies. modeled in FOLPD form. the tuning rule is used when the ratio is less than 1 (Murrill. an extensive set of simulation results covering many of the PI controller and PID controller tuning rules are available (O¶Dwyer. Figures 2 to 7 show how gain margin. though. as expected. if some PI tuning rules are used (Figures 2 to 4) and corresponding PID tuning rules for the classical controller structure (with E = 0. On the other hand. suggesting that this is a less robust tuning strategy. These results would allow the following general points to be outlined in the classroom: y It is clear that the gain margin is generally less when the PID rather than the PI tuning rules are considered. It turns out.5  tan 1 [Tm  tan 1 [Ti  [X m (21) The maximum sensitivity may be calculated over an appropriate range of frequencies corresponding to phase lags of 1000 to 2600 . it is clear from Figures 8 and 9 that there is a significant degradation of performance when using the PID tuning rule of Witt and Waggoner (1990) and the PI tuning rule of Ziegler and Nichols (1942) for large ratios of time delay to time constant. respectively.m ( [) c ( [) ! 1  [ 2 Ti 2 2 2 1  [ Tm and arg? m ( [) c ( [)A! 0. as defined by Murrill (1967) for PI tuning rules and Kaya and Scheib (1988) for PID tuning rules based on the classical controller structure. and the ideal PID controller structure (with some approximation). The method can be extended to the determination of the gain margin. respectively. that the analytical method explored allows the calculation of a far wider range of gain and phase margins for PI controllers. the integral of squared error criterion and the integral of time multiplied by absolute error criterion. W-W refers to the process reaction curve method of Witt and Waggoner (1990). it is also true  c "         ! ! m [Ti (20) . 2000). y No general conclusion can be reached as to the best tuning rule (as expected).

2 1.4 0. Figure 2: Gain margin 4 120 Figure 3: Phase margin Figure 4: Maximum sensitivity 8 3.2 0.5 100 3 .2 1.4 0.2 1.= W-W * = IAE reg + = ITAE reg o = ISE reg 1.2 0.4 0.4 0.6 0.4 1.6 1.8 2 Ratio of X m to Tm Figure 8: Gain margin comparison 4 Ratio of X m to Tm Ratio of X m to Tm Figure 9: Phase margin comparison 120 3.2 1.4 1.5 100 Ratio of X m to Tm Figure 6: Phase margin 90 80 70 60 50 40 6 5.6 1.6 0.8 2 0 0 0.5 20 1 0 0.8 1 1.2 0.5 3 .= Z-N * = IAE reg + = ITAE reg o = ISE reg 100 7 6 80 5 2.8 1 1.= W-W PID o = Z-N PI 80 2.6 0.5 3 2.6 1.4 1.6 0.5 60 4 2 40 3 1.that stability tends to be assured when a PI controller is used (O¶Dwyer.6 1.4 1.8 2 Ratio of X m to Tm Ratio of X m to Tm .5 2 1.8 2 0 0 0.4 0.5 60 2 40 1.2 0.8 2 0.4 1.8 2 1 0 0.8 1 1.4 1.6 1.4 1.4 0.6 0.2 1.2 0.2 0.4 0.8 2 0 0 0.8 1 1.8 1 1.6 1.8 1 1.2 1. Thus.5 4 3.8 1 1.5 30 20 10 1 0 0.5 20 2 1 0 0.2 0.6 1.8 2 Ratio of X m to Tm Figure 5: Gain margin 2.8 1 1.5 5 4.2 1.4 0.6 0.6 0.2 1. 2000).5 1 0 Ratio of X m to Tm Figure 7: Maximum sensitivity 2 .4 1.6 0.2 0. a cautious design approach is to use a PI controller.6 1. particularly at larger ratios of time delay to time constant.

4 Ratio of X m to Tm Figure 15: Phase margin comparison 100 90 80 70 60 50 40 30 20 10 .6 2.4 1.8 1 1.6 1.8 2 Ratio of X m to Tm Figure 12: Gain margin comparison 2.6 1.2 0.8 1.2 1.6 0.6 0.6 1. Design of tuning rules m to Tm Ratio of X m to Tm .6 2.6 0.Figure 10: Gain margin comparison 3 2.2 1.4 1.2 1 0 0.2 0.8 2.2 1.2 0.6 0.6 1.8 2 Ratio of X m to Tm Figure 14: Gain margin comparison 3 2.4 2.5 30 20 10 1 0 0.6 1.= IAE reg PID o = IAE reg PI 80 70 60 50 40 30 20 10 0.8 1 1.2 2 1.4 1.6 0.2 0.8 2 0 0.2 2 1.6 1.4 1.6 0.8 2.5 100 90 Figure 13: Phase margin comparison .4 1.8 1 1.8 2 0 100 90 Figure 11: Phase margin comparison .8 1 1.2 1.2 1.4 0.4 0.8 1 1.2 0.8 2 0 0.8 1 1.4 0.2 1 0 0.4 0.4 0.4 1.6 1.2 0.6 1.8 2 Ratio of X to achieve constant gain 4.8 1.4 1.= ISE reg PID o = ISE reg PI 2 80 70 60 50 40 1.4 1.4 2.= ITAE reg PID o = ITAE reg PI 0.2 1.

and phase margins for all values of delay Normally. % # tan 1 [p Ti  tan 1 [p Tm  [p X m # $ $ $ $ $ % # $ # ( # # # ) ) # 0 %# '( $% $% # % ) ) 1 %# & # m ¨ K c ©1 © ª 1 ¸ ¹ Ti s ¹ º (Equation 9) 2 2 1 (Equation 10) 2 2 2 (Equation 11)  (Equation 12) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) . K m e  sX G m (s ) 1 sTm with From Section 2. the gain and phase margins of the compensated systems tend to increase as the time delay increases. outlined below.5  K m K c Xm Tm Finally. is also taught to the students.5  [p X m  [p 2X m i. a similar method.e. Equations (1) and (2) apply i.e.5 tan 1 [g Ti  tan 1 [g Tm  [g Xm K m K c 1 [g Ti [g Ti 1 [g Tm 2 with [g given by the solution of 2 and Am [pTi K m Kc 1 [p Tm 1 [p Ti 2 with [p given by the solution of  0.5T  a Some typical tuning rules are shown in Table 1. However. For the FOLPD process model and the PI controller. it is possible to design a PI tuning rule that facilitates the achievement of a constant gain and phase margin as the time delay of the process model varies. Substituting Equation (24) into Equation (11) gives Am Tm 2K m K c Xm Substituting Equation (22) into Equation (10) gives 1 m c [g Tm i. [g ! m c Tm Substituting Equations (22) and (27) into Equation (9) gives J m ! 0.5 If K c and Ti are designed as follows: Kc aTm K m Xm and Ti Tm Then Equation (12) becomes 0. m G c (s)  0. is taught to the students.e. substituting Equation (21) into Equation (25) gives m ! T 2a and substituting Equation (21) into Equation (28) gives J m ! 0. Ti Tm . this tuning rule has the structure: K c aTm K m X m . for the design of a similar tuning rule for the classical PID controller of a FOLPD process model. supporting the common view that PI and PID controllers are less suitable for the control of dominant time delay processes. This new tuning rule design.

was used to return a recordset of matching tuning rules. to provide the user with a friendly and intuitive interface. If the system finds fewer tuning rules than a low threshold value. Though the graphical results based on this data gives students a good insight into the usefulness of the tuning rules (at larger time delays. Figure 16: Main User Screen . in addition. The process of retrieval starts when the Execute button is clicked.Table 1: Typical PI controller tuning rules ± FOLPD process model a T3 T4 T6 Kc 1. based on gain and phase margin specifications that are also covered in the courses. Conclusions The paper has reported on the teaching of PI and PID controller tuning methods by determining the performance and robustness of a PI and PID controlled FOLPD process. together with a recommendation. Limited comparisons of the tuning rules are possible. A Structured Query Language (SQL) query. Thus. as the ratio of time delay to time constant varies. A VB DBGrid object.0 5. bound to the data control object. for most of the 98 PI controller tuning rules for FOLPD process models (O¶Dwyer. data has been defined as MATLAB variables representing gain margin and phase margin values. the appropriateness of the tuning rule for a given process and the range of time delay to time constant ratios over which it is sensible to apply the tuning rule. using Bode plots. using parameters from the input text boxes. The upper portion of this screen is used as an input interface. The gain margin and phase margin data.524 Tm K m X m Ti Tm Tm Tm Am Jm T6 T4 T3 1. was used to display the recordset. was first exported to a Microsoft Access database file. or more tuning rules than a high threshold value. A Microsoft Visual Basic (VB) front end was developed using intrinsic VB controls. some preliminary work on the development of an expert system was carried out. the sheer volume of results generated means that a more automatic means of comparing the tuning rules would be useful. for each tuning rule. the plotted results allow the students to understand immediately.0 3. In short.785Tm K m X m 0. A secondary SQL query using the tuning rule number returned by the first query. though it could be put on a Local Area Network (LAN) or a Wide Area Network (WAN). phase margin and maximum sensitivity. The expert system will then indicate the PI tuning rules that fit the criteria. The expert system reported facilitates student motivation as well as providing a platform for further project work. The right hand panels in the lower half of the user screen (Figure 16) were used to display this information.047 Tm K m Xm 0. the required gain and phase margins and an acceptable variation (called tolerance on Figure 16) on the gain and phase margins. the performance and robustness of the compensated system. it is on the same PC as the VB application). The method allows an analytical approach to be taken to the evaluation for a large number of tuning rules. Finally. then the user is prompted to widen or narrow the default gain and phase margin variation of 10%. outputing the gain margin and phase margin associated with each rule. On correct completion of a logon process. The expert system asks the user to input the desired range of gain and phase margin of the compensated system. the main user screen.e. for example). with the parameters of the controllers determined by a variety of tuning rules. The database is local to the VB programme (i. is loaded and a connection to the Microsoft Access database is made using a VB data control object. associated with each tuning rule. as is shown in Section 3. The development of the analytical procedure increases student understanding of the concepts of gain margin. the method complements iterative methods of controller design. was used to access another database containing the tuning rule sources and the formulae associated with each tuning rule. respectively. It consists of a set of text boxes and labels into which the user may enter the ratio of delay to time constant (TD/TC on Figure 16). 2000). 6. Expert system implementation In Section 3.5 2. shown in Figure 16. the approach outlined clarifies the topic of tuning rule selection and informs subsequent laboratory work.

4. Mc-Graw-Hill. J.P. E. Seborg. B.L... (2002).G. W. Imperial College Press. Hang. and Ray. W. Ireland. Handbook of PI and PID controller tuning rules.B.K.. T. and Nichols.K. Ogunnaike. R. Gan. Edgar. Ireland.. IEEE Transactions on Control Systems Technology. (1996). O. Levine. Control Engineering (July 1988).C. Ireland.. (1994). Kaya. Research Triangle Park... ed.C. T. D. and Mellichamp. Design and Tuning (Instrument Society of America. Proc. and Katebi. and Scheib. P.E. Control Engineering: an introductory course. modeling and control. 1996).A. Process dynamics and Control. Process Control: designing processes and control systems for dynamic performance.G. Hydrocarbon Processing (June 1990). 2000) O¶Dwyer. Boca Raton. Wilkie. 473-477. 2001). Transactions of the ASME. T. Palgrave Ltd. 2nd Edition). J. July. 2nd edition. Proc.S. Ziegler. N. Murrill. Johnson. and Hägglund. D. W. (1995). Automatic control of processes (International Textbook Co. Florida. W. (2004). 245248.L. Bialkowski. 64.B.. and Nichols. (1942).. (1943). Oxford University Press. Wiley.D. Maynooth. 96-100. W.References Åström. (CRC/IEEE Press. Appendix 1: Glossary of symbols and abbreviations used in the paper . R.. 1219-1242. O¶Dwyer. and Zhou. pp. and Ang. PID Controllers: Theory. North Carolina. A.. Irish Signals and Systems Conference (National University of Ireland.W. J. Irish Signals and Systems Conference (Dublin Institute of Technology.J. IEEE Transactions on Control Systems Technology. Transactions of the ASME. Tay. 3.J. N. Ziegler.. 74-78. A. Ho. A. C. 62-65. Process dynamics. J. E. Marlin. 1967) O'Dwyer. 227-234. (1996). 1998). in The Control Handbook. 2nd edition. 759-768. M. K. Witt.B. A. A. T. O¶Dwyer.E. and Waggoner. Technical Report AOD-00-12 (Dublin Institute of Technology. 433-444. (2000).H. (1995). Ho. S. (2003).F.

FOLPD model = First Order Lag Plus time Delay model G c ( s) = PID controller transfer function G m (s) = Process model transfer function g I E = integral of absolute error = ISE = integral of squared error = ITAE = integral of time multiplied by absolute error = M max = maximum value of closed loop sensitivity PI controller = proportional integral controller PID controller = proportional integral derivative controller s = Laplace variable Td = Derivative time of the controller Ti = Integral time of the controller Tm = Time constant of the FOLPD process model J m = phase margin X m = time delay of the process model [ = angular frequency 3 4 4 2 m = gain margin ´ e(t ) dt 0 ´ g e 2 ( t )dt 0 ´ t e( t) dt 0 g c m = Proportional gain of the controller = Gain of the process model .