The Good Gain Method for Simple Experimental Tuning of Pi Controllers

A novel experimental method – here denoted the Good Gain method – for tuning PI controllers is proposed. The method can be regarded as an alternative to the famous Ziegler-Nichols' Ultimate Gain method. The approach taken resembles the Ziegler-Nichols' method as it is based on experiments with the closed loop system with proportional control. However, the method does not require severe process upset during the tuning like sustained oscillations. Only well-damped responses are assumed. Furthermore, in the present study it is demonstrated that the approach typically gives better stability robustness comparing with the Ziegler-Nichols' method. The method is relatively simple to use which is beneficial for the user. A theoretical rationale based on second order dynamics is given.


Introduction
The PI (proportional plus integral) controller is probably the most frequently used controller function in practical applications.The PI controller stems from a PID controller with the D-term (derivative) deactived.The D-term is often deactivated because it amplifies random (high-frequent) measurement noise causing abrupt variations in the control signal.This paper presents a simple experimental method for tuning PI controllers.The method will here be referred to as the Good Gain method.The method can be applied to real processes without any knowledge about the process model.It can of course also be applied to simulated processes.
The method was first presented in Haugen (2010a), but without the theoretical rationale which is given in the present paper.The method is compared with a number of alternative PI tuning methods in a real benchmark test in Haugen (2010b).
The following continuous-time PI controller function is assumed: where u is the control signal (the controller output), u man is the manual control signal (the control bias), e = y sp − y m is the control error where y sp is the setpoint and y m is the process measurement, K c is the controller gain, and T i is the integral time.K c and T i are the controller parameters to be tuned.
In most practical applications the continuous-time PI controller is implemented as a corresponding discrete-time algorithm based on a numerical approximation of the integral term.Typically, the sampling time of the discrete-time controller is so small -compared to the dynamics (response-time or timeconstant) of the control system -that there is no significant difference between the behaviour of the continuous-time PI controller and the discrete-time PI controller.Concequently, in this paper the sampling time is not regarded as a tuning parameter.
Simplicity is a necessary feature of a tuning method aiming at practical use.The Good Gain method is a simple method.The famous Ziegler-Nichols' Ultimate Gain method Ziegler and Nichols (1942) is also a simple method.Comparing the Good Gain method with the famous Ziegler-Nichols' Ultimate Gain method, both methods require experiments with the established closed loop system with the PID controller running as a P (proportional) controller.Two main motivations for the Good Gain method, comparing with the Ziegler-Nichols' Ultimate Gain method -hereafter denoted the Ziegler-Nichols' method for simplicity, are: 1.It is not required that the control loop is brought to the stability limit during the tuning.In other words, it is not required that the control loop has sustained oscillations during the tuning.In stead, the control system is required to have good stability, i.e. there are well damped oscillations, during the tuning.
2. Improved resulting stability of the control system.The Ziegler-Nichols' method is designed to give an amplitude ratio between subsequent oscillations after a step change of a process disturbance equal to 1/4 -"one-quarter decay ratio".This is often regarded as poor stability.The Good Gain method typically gives better stability than the "one-quarter decay ratio".
The two arguments in favour of the Good Gain method would have little weight if the performance of the method was substantially worse.However, it turns out -as is demonstrated in this paper -that the performances of the two methods are not much different.
Shams's setpoint method Shamsuzzoha et al. ( 2010) is another method for PI controller tuning based on an experimental setpoint step response with P controller.From a single closed-loop setpoint step test three characteristic numbers must be obtained to calculate the PI settings: The overshoot, the time to the first peak, and the steady state change of the process measurement due to the setpoint step.The Good Gain method appears to be somewhat simpler than Shams's setpoint method as it requires only one characteristic number to be obtained from the setpoint step response, namely the time from the first overshoot to the subsequent undershoot.
Lots of PI(D) tuning methods exist.Lee et al. (1990) and Yuwana and Seborg (1982) are examples of closed loop tuning methods where a mathematical model of the process, or a model of the closed loop system, is estimated from data during P control operation.The controller is then tuned using the estimated model.The Good Gain method is different from such estimation-based methods as it requires no advanced data processing, only simple experiment(s) made by the user.
The outline of this paper is as follows: • In Section 2 the Good Gain tuning procedure is presented.
• In Section 3 two applications of the Good Gain method are presented.The applications are a real temperature control system for an air heater, and a simulated industrial level control system for a wood-chip tank.
• In Section 4 the theoretical rationale behind the method is presented.
• In Section 5 some limitations of the method are presented.
• In Section 6 a discussion is given.
• In Section 7 conclusions are given.

The Good Gain tuning procedure
The Good Gain method is applied to the established closed-loop system, see Figure 1.
Figure 1: The Good Gain method for PID tuning is applied to the established control system.
The tuning procedure is as follows: 1.With the controller in manual mode, bring the process to or close to the normal or specified operation point by adjusting the manual control signal u man .
2. Ensure that the controller is a P controller with K c = 0 (set T i = ∞ and T d = 0) 1 .Switch the controller into automatic mode.Increase K c until the control loop gets good stability as seen in the response in the process measurement signal, alternatively in the control signal, after the setpoint has been changed as a step.You may start with K c = 1 which is a good initial guess in many cases, and then increase (or descrease) it.It is here assumed that "good stability" corresponds to some overshoot and a barely observable undershoot (or vice versa if you apply a negative setpoint step change), see Figure 2.
Figure 2: The Good Gain method: Reading off the time, T ou , between the overshoot and the undershoot of the step response with P controller.
The controller gain value giving this good stability is denoted K c GG (good gain).
Note that for most systems (those which do not containt a pure integrator) there will be offset from setpoint because the controller during the tuning is just a P controller.This is illustrated in Figure 2.
Also note that it is important that the control signal is not driven to any saturation limit (maximum or minimum value) during the experiment.
If such limits are reached the K c value may not be a good one -probably too large to provide good stability when the control system is in normal operation.So, you should apply a relatively small step change of the setpoint (e.g.10% of the setpoint range), but not so small that the possible undershoot (or overshoot) can not be seen because of process disturbances or measurement noise.
3. Read off the time, T ou , from overshoot to under-shoot (or from undershoot to overshoot if you applied a negative setpoint step), see Figure 2. Calculate the integral time T i with 4. Because of the introduction of the I-term, the loop with the PI controller in action will probably get reduced stability compared with using the P controller only.To compensate for this, K c should be reduced somewhat.A reduction to 80% will probably work well: 5. Apply K c and T i calculated above to your controller.
6. Finally, check the stability of the control system with the above controller settings.This can be done by changing the setpoint as a step and concluding about the stability, wether it is acceptable or not, from the damping of the oscillations in the process measurement, or in the control signal.If you think that the system has poor stability, try increasing the integral time (say by 25%), possibly in combination with decreasing the controller gain (by say 25%).

Some applications with measures of performance and stability robustness
In the following subsections the Good Gain method and, for comparison, the Ziegler-Nichols' method will be applied to the following two cases which are assumed to be representative for many real systems: • A practical temperature control system for a laboratory air heater (Section 3.2).The process dynamics is roughly "time-constant with timedelay".
• A simulated level control system for an industrial wood-chip tank (Section 3.3).The process dynamics is "integrator with time-delay".
Quantitive measures of performance and stability robustness will be compared.These measures are defined in the following section.

Measures of performance and stability robustness
The measures for comparing the two methods of PI controller tuning are as follows: 1. Performance related to setpoint tracking and disturbance compensation: a) Setpoint tracking: The setpoint is changed as a step.The IAE (Integral of Absolute Error) index, which is frequently used in the literature to compare different control functions, is calculated over a proper time interval.The IAE index is defined as where t i is the initial time which is just before the setpoint step is applied, and t f is the final time which is after the response has settled.
The IAE index for the setpoint change is here denoted IAE s .We will say that the less IAE s value, the better control performance.
b) Disturbance compensation: When the system is at steady state with approx.zero control error, the process disturbance is changed as a step.The IAE index is calculated over a proper time interval, starting just before the step is applied and ending when the response has settled.This IAE index is here denoted IAE d .The less IAE d value, the better control performance.
2. Stability robustness against parameter changes in the control loop: The robustness is measured with the traditional stability margins, namely the gain margin, GM , and the phase margin, P M .These stability margins will be found directly from experiments, i.e. a mathematical model will not be used.Strictly, these stability margins are defined for linear models only, but it is assumed that the stability margins found experimentally for a practical system, as in the present study, do express stability robustness for such systems in a meaningful way.(The experimental approach may also be applied to a nonlinear system for which we know the model.) In the case of the simulated level control system a mathematical model of the control system is of course available, and it turns out that the model is even linear.In the case of the practical laboratory air heater it is possible to adapt a good inputoutput (transfer function) model to the process Haugen (2013).However, an experimental stability analysis will be applied in both cases.
In the present study the experimental stability analysis is implemented as follows: a) Calculation of gain margin GM : An adjustable gain, ∆K, is inserted into the loop (between the controller and the process), see Figure 3. Initially, ∆K = 1.For each of the tuning methods, the (ultimate) value ∆K u that brings the control system to the stability limit, so that the responses are sustained oscillations, is found experimentally (by trials).The gain margin is then b) Calculation of phase margin P M : An adjustable time-delay, ∆τ [s], is inserted into the loop (between the controller and the process), see Figure 3. Initially, ∆τ = 0.For each of the tuning methods, the (ultimate) value ∆τ u that brings the control system to the stability limit, i.e. causing sustained oscillations, is found experimentally.The period, P osc [s], of the oscillations is measured.The corresponding phase margin is Eq. ( 6) is derived in Appendix A. 3.2.Application: Practical temperature control system

System description
The physical system used in the experiments is the air heater laboratory station shown in Figure 4.The temperature of the air outlet is controlled by adjusting the control signal to the heater. 2The control system is implemented in LabVIEW (National Instruments) running on a PC.The fan rotational speed, and thereby the air flow, can be adjusted manually with a potentiometer.Changes of the air flow comprises a process disturbance giving an impact on the temperature.The voltage drop across the potensiometer is measured, and a corresponding value, F , in percent is calculated in the LabVIEW program.F represents the air flow disturbance.
The nominal operating point of the system is temperature at 35 o C and air flow F = 30 %.

Controller tuning with the Good Gain method
Figure 5 shows the setpoint step response with a Pcontroller with "good"gain From the response we find The supplied power is controlled by an external voltage signal in the range [0 V, 5 V] applied to a Pulse Width Modulator (PWM) which connects/disconnects the mains voltage (220 VAC) to the heater.The temperature is measured with a Pt100 element which in the end provides a voltage measurement signal.A measurement filter in the form of a time-constant filter with time-constant 0.5 s is used to attenuate temperature measurement noise.The National Instruments USB-6008 is used as analog I/O device.Additional information about the air heater is available at http://home.hit.no/˜finnh/airheater.The PI parameter values become T i = 1.5 • T ou = 1.5 • 11 = 16.5 s (12)

Controller tuning with the Ziegler-Nichols' Ultimate Gain method
The Ziegler-Nichols' Ultimate Gain method is based on experiments executed with an established control loop: The ultimate proportional gain K ċu of a P-controller, which is the gain which causes sustained oscillations in the signals in the control system (without the control signal reaching the maximum or minimum limits) must be found, and the ultimate (or critical) period P u of the sustained oscillations is measured.Then, the PI controller is tuned from K cu and P u with the following formulas: Figure 6 shows the sustained oscillations in the process measurement (temperature) during the tuning phase.
The controller gain, which is the ultimate controller gain, is The period of the oscillations is The PI parameter values become

Performance and stability robustness of the control system
Performance and stability robustness are measured from experiments as explained in Section 3.1.Table 1 summarizes the performance and robustness measures for Good Gain tuning and, for comparison, Ziegler-Nichols tuning.Performance: • Setpoint tracking: Figure 7 shows the response in T m when T sp is changed as a step with Good Gain tuning, and Figure 8 shows the response with Ziegler-Nichols tuning.The pertinent IAE s values are shown in Table 1.
From the IAE s values it can be concluded that setpoint tracking is somewhat better with Good Gain tuning than with Ziegler-Nichols tuning.This is apparently related to the reduced overshoot with the Good Gain method which in turn is related to better stability, see below (about stability robustness).
• Disturbance compensation: Figure 9 shows re-  From the pertinent IAE d values, it can be concluded that the disturbance compensation is better with Ziegler-Nichols tuning.This is not a surprise since Ziegler-Nichols' method generally aims at obtaining fast disturbance compensation.

Stability robustness:
The stability robustness of the control system with Good Gain tuning and with Ziegler-Nichols tuning are measured experimentally in terms of gain margin and phase margin as explained in Section 3.1.The results are shown in Table 1.The results tell that with Good Gain tuning both the gain margin (value 2.4) and the phase margin (36.0 o ) are within the acceptable limits stated by eqs.( 7) and (8).However, with Ziegler-Nichols tuning the gain margin (1.7) is on the lower limit, and the phase margin (22.8 o ) is not acceptable; it is too small.3.3.Application: Simulated level control system

System description
Figure 11 shows a level control system for a wood-chip tank with feed screw and conveyor belt which runs with constant speed. 34 The outflow from the tank acts as a disturbance on the wood-chip level which is the process variable to be controlled.
The level transmitter symbol (LT) represents a level sensor which produces a measurement signal in the range 0-100% corresponding to level 0-15 m, with a linear relation between % and m.The transmitter includes a measurement lowpass filter with time-constant 3 This example is based on an existing system in the paper pulp factory Södra Cell Tofte in Norway.The tank with conveyor belt is in the beginning of the paper pulp production line.The simulator for the level control system is based on a mass balance for the wood-chip in the tank.The simulator is implemented in LabVIEW.

Controller tuning
A PI controller is tuned with both the Good Gain method and the Ziegler-Nichols' method.(The simulated responses from the tuning phase are not shown here since they will not convey any new information.)The resulting PI settings are shown in Table 2.

Performance and stability robustness of the control system
Performance and stability robustness are measured from experiments as explained in Section 3.1.Table 2 summarizes the performance and robustness measures for Good Gain tuning and, for comparison, Ziegler-Nichols tuning.Table 2: Level control system: Performance and stability robustness measures with Good Gain (GG) tuning and Ziegler-Nichols (ZN) tuning.

Performance:
Figure 12 shows responses in the level control system with Good Gain tuning.
Both setpoint tracking and disturbance compensation are shown in the same plot: At time 220 min the setpoint is changed as a step from 10 to 11 m, and at time 320 min the disturbance (outflow) is increased as a step from 1500 kg/min to 1800 kg/min.The IAE s and IAE d values are shown in Table 2.
Figure 13 shows responses in the level control system with Ziegler-Nichols tuning.
The pertinent IAE s and IAE d values are shown in Table 2.
The IAE s values in Table 2 show that the setpoint tracking with Good Gain tuning is not much different to the setpoint tracking with Ziegler-Nichols tuning.
The IAE d values in Table 2 show that the disturbance compensation is better with Ziegler-Nichols tuning, which is to be expected since Ziegler-Nichols' method generally gives fast disturbance compensation.
Stability robustness: Figure 12: Responses in the level control system with Good Gain tuning.
The stability robustness of the control system with Good Gain tuning and with Ziegler-Nichols tuning are measured experimentally in terms of gain margin and phase margin as explained in Section 3.1.The results are shown in Table 2.The results tell that with Good Gain tuning both the gain margin (value 2.2) and the phase margin (31.1 o ) are within the acceptable limits stated by eqs.( 7) and ( 8).With Ziegler-Nichols tuning the gain margin (1.9) is acceptable, but the phase margin (25.0 o ) is not acceptable; it is too small.These results are (almost) the same as those found for the temperature control system in Section 3.2.

Theoretical rationale for the proposed tuning method
In the tuning phase of the Good Gain method the controller is a P controller.In the following it is assumed that the dynamics of the control loop with the P-controller is approximately as the dynamics of "an underdamped second order system", with the following transfer function from setpoint Y sp to process measurement Y m (capital letters represent Laplace transformed variables): Figure 13: Responses in the level control system with Ziegler-Nichols tuning.
Assume y sp is a step of amplitude A. It can be shown, using e.g. the Laplace transform, that the corresponding step response in y m is where ϕ = arcsin ζ (21) Figure 14 shows the step response eq.( 20) with ζ = 0.6 , ω 0 = 1, K = 0.6 (the actual value K is indifferent here), and A = 1.(This step response can easily be obtained numerically by simulating eq. ( 19) with e.g. the step function in MATLAB.) The parameter value ζ = 0.6 is selected because the step response of the second order system is then a damped oscillation with a clearly observable overshoot and a barely observable undershoot, as in the Good Gain method.From eq. ( 20) we see that the period of the damped oscillation is which is here assumed to be equal to the period P GG of the damped oscillations in the Good Gain method: T ou in the Good Gain method is equal to half of P d : Assuming that the oscillations are undamped, as in the Ziegler-Nichols' method, the period of the oscillations is Hence, the relation between the period of the damped oscillations with the Good Gain method and the undamped oscillations with the Ziegler-Nichols' method is In the Ziegler-Nichols' method T i is P ZN /1.2 which gives, using eq.( 29), The Good Gain method is designed to give somewhat better stability and better robustness than with the Ziegler-Nichols' method.Therefore, T i is increased somewhat compared with the Ziegler-Nichol's setting (30) to get the following T i -setting: In the Ziegler-Nichols' method the controller gain K c of a P-controller is where K cu is the ultimate gain.In the Ziegler-Nichols' method the gain of a PI-controller is In other words, the gain of the PI controller is set to 90% of the gain of the P-controller.This gain reduction compensates for the reduction of the stability of the loop that is a consequence of including the integral term.Along the same line the original controller gain of the Good Gain method should also be reduced.To relax the setting even more than in the Ziegler-Nichols' method, the gain is finally set to Eqs. ( 31) and ( 34) are the PI tuning formulas of the Good Gain method.

Limitation of the tuning method
Below is a list of three important processes given in the form of transfer functions from control variable u to process output (or measurement) y m for which the Good Gain method can not be used for controller tuning.The Ziegler-Nichols' Ultimate Gain method can not be used, either.Capital letters are used for Laplace transformed variables.
• Integrator without delay: One example of such a process is a liquid tank with outflow via a pump and inflow via a pump or valve which is manipulated by the level controller.
With P control with controller gain K c the controller transfer function from control error e = y sp − y m to control variable u transfer function is The transfer function from y sp to y m , denoted the closed loop transfer function (Seborg et al., 2004), becomes which is a time-constant system.The step response of H CL (s) can not oscillate, and hence, neither the Good Gain method nor the Ziegler-Nichols' method can be used for controller tuning.
• Time-constant without time-delay: One example of a time-constant without timedelay system is a liquid tank with outflow via a valve and inflow via a pump or valve which is manipulated by the level controller.(The valve in the outlet introduces a square-root valve function, but the linearized version of the model is a timeconstant without time-delay model.) The closed loop transfer function becomes which is a time-constant system.By the same reasons as above, neither the Good Gain method nor the Ziegler-Nichols' method can be used for controller tuning.
Comments to the two processes eqs.( 35) and ( 40): If there are additional dynamics due to for example a sluggish sensor, measurement filter, or actuator, or if there is some time-delay in either of these components, it will be possible to obtain an oscillatory response with a P controller.However, the period of these oscillations may be too small (if these additional dynamics are fast) to give useful PI settings; K c may get a very large value, and T i may get a very small value.This may give very aggressive control.Also, the control action may become very abrupt or "noisy" due to high amplification of measurement noise through the controller.
• Double-integrator: One example of a double-integrator is a ship at rest, i.e. without any damping forces from the environment, with u being the force acting on the ship and y m being the ship position (to be controlled).(H p (s) represents the ship dynamics in only one direction, e.g. the surge direction.) The closed loop transfer function becomes which is a second order system being marginally stable, and therefore oscillatory, for any value of the controller gain K c .It can be shown that PI control of the given H p (s) causes the control system to become unstable, and hence tuning of a PI controller makes no sense.(The control system can be stabilized with derivative action in the controller.) Each of the three processes eq. ( 35), (40), and (42) can be successfully tuned with e.g. the model-based SIMC PID tuning method, also known as Skogestad's method, Skogestad (2003Skogestad ( , 2004).5

Discussion
In the present paper the applicability of the Good Gain PI tuning method in terms of performance and stability robustness has been demonstrated on two different cases, one of which is a real (physical) process, and the other a simulated industrial level control system for a wood-chip tank.The process dynamics of these two cases are different as one case has time-constant with time-delay dynamics while the other has integrator with time-delay dynamics.
It may be of interest to further investigate the applicability of the Good Gain method on systems with different ratios of time-constant to time-delay.
The method is given a rationale in linear second order dynamics: It is assumed that such dynamics describe the process controlled by a P controller, as is the case in the tuning phase.However, the method is applicable also to other cases.The more general applicability is because the method is an experimental method -not a model-based method -where the user is involved in making the decision about what is the good gain value.

Conclusions
The Good Gain method for tuning PI controllers seems to satisfy the following very important requirements to a tuning method which aspires to be applied by practioners: • Simplicity • Avoiding severe process upset during the tuning (i.e.avoiding troublesome oscillations) • Acceptable performance • Acceptable stability robustness

Figure 3 :
Figure 3: An adjustable gain and time-delay are inserted into the loop to find the stability margins (gain margin and phase margin) experimentally.

Figure 4 :
Figure 4: Temperature control system for an air heater (laboratory rig).

Figure 5 :
Figure 5: Setpoint step response during tuning with the Good Gain method.

Figure 7 :
Figure 7: Temperature control system: Setpoint step response with Good Gain controller tuning.

Figure 8 :
Figure 8: Temperature control system: Setpoint step response with Ziegler-Nichols tuning.

Figure 9 :
Figure 9: Temperature control system: Disturbance step responses with Good Gain controller tuning.

Figure 10 :
Figure 10: Temperature control system: Disturbance step responses with Ziegler-Nichols tuning.

Figure 11 :
Figure 11: Level control system for a wood-chip tank.