Comparing PI Tuning Methods in a Real Benchmark Temperature Control System

This paper demonstrates a number of PI controller tuning methods being used to tune a temperature controller for a real air heater. Indices expressing setpoint tracking and disturbance compensation and stability margin (robustness) are calculated. From these indices and a personal impression about how quick a method is to deliver the tuning result and how simple it is to use, a winning method is identified.


Introduction
The PI (proportional plus integral) controller function is 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 assumes PI control (not PID).
The continuous-time PI controller function is as follows: where u is the control signal (the controller output), e = r − y is the control error, where r is the reference or setpoint and y is the process output variable (process measurement), K c is the controller gain, and T i is the integral time.K c and T i are the controller parameters which are 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 time-constant) 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.Consequently, in this paper the sampling time is not regarded as a tuning parameter.This paper compares a number of methods for tuning PI controllers using the following measures: 1. Performance related to setpoint tracking and disturbance compensation.
2. Robustness against parameter changes in the control loop.
3. How quick the tuning procedure can be accomplished, and how simple the method is to use.
Numerous studies about simulated control systems exist, for example O'Dwyer (2003) and Seborg et al. (2004).However, in this paper only experiments on a physical system will be used as the basis of the comparison of the tuning methods.The system is a laboratory scale air heater, cf.Section 2. It is particularly valuable to see various methods being applied to a physical system because such a system will always differ -more or less -from the underlying model or assumptions of the controller tuning method.So, applying a method to a physical system is real testing.Of course, it would 2 The Experimental Setup The physical system used in the experiments is the air heater laboratory station shown in Fig. 1.The temperature of the air outlet is controlled by adjusting the control signal to the heater. 1 The fan speed can be adjusted manually with a potentiometer.Changes of the fan speed is used as process disturbance.The voltage drop across the potentiometer is used to represent this disturbance. 2Fig. 2 shows a block diagram of the temperature control system.
The nominal operating point of the system is temperature at 34 o C and fan speed potentiometer position 1 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.
at 2.4 V (corresponding to a relatively low speed).The measurement filter is a time-constant filter with timeconstant 0.5 s.To demonstrate the setpoint tracking the setpoint is changed from 34 to 35 o C, and -thereafter -to demonstrate the disturbance compensation, the fan speed (air flow through the pipe) is changed from minimum (i.e.indicating voltage of 2.4 V) to maximum (5.0 V).The temperature control system is implemented with National Instruments LabVIEW running on a PC.

The Methods to be Compared
In general, both experimental (model-free) and modelbased controller tuning methods are available.In this presentation methods of both these classes will be tested, but among the model-based methods only those methods which can be applied without automatic system identification functions are compared (like prediction error estimation methods, and subspace estimation methods).This is because it is my view that system identification tools should not be used unless the user has knowledge about the basic theoretical foundation of such methods and is able to evaluate different estimated models, and few practitioning control engineers have such knowledge.In other words: The mathematical model to be used in the tuning method must be simple and easy to estimate manually from experiments, e.g.reading off gain, time-constant and time-delay models from a step response of the process to be controlled.
Auto-tuners are not evaluated in this paper.
The following methods are compared: Open-loop methods, which are methods based on experiments on the open-loop system (i.e. on the process itself, independent of the controller, which may be present or not): • Skogestad's Model-based method (or: the SIMC method -Simple Internal Model Control) Skogestad (2003Skogestad ( , 2004) -both the original method and a modified method with reduced integral time for faster disturbance compensation.
Closed-loop methods, which are methods based on experiments on the already established closed-loop system (i.e. the feedback control system): • Ziegler-Nichols' Ultimate Gain method (or the Ziegler-Nichols' Closed-Loop method) Ziegler and Nichols (1942).
• Relay method (using a relay function to obtain the sustained oscillations as in the Ziegler-Nichols' method), Åström and Hägglund (1995).
Each of these methods are described in their respective subsections of Section 5 of this paper.
The above list of tuning methods contains wellknown methods (i.e.often refered to in literature), and also some methods which I personally find interesting.

Measures for Comparing the Tuning Methods
The measures for comparing the different methods of PI controller tuning are as follows: 1. 2. Robustness against parameter changes in the control loop is in terms of stability robustness against parameter variations in the control loop.An adjustable gain, K L , is inserted into the loop (between the controller and the process, in the LabVIEW program).Nominally, K L = 1.For each of the tuning methods, the K L value that brings the control system to the stability limit (i.e. the responses are sustained oscillations) is found experimentally.This K L value is then the gain margin, ∆K, of the control loop.
It might be interesting also to insert an adjustable time-delay, T delay , into the loop (between the controller and the process, in the LabVIEW program) and find experimentally the time-delay increase in the loop which brings the control system to the stability limit.(This is closely related to finding the phase margin of the control loop in a frequency response analysis.)However, to simplify the analysis, only the gain margin is considered here.
3. How quick and simple a given method is to use.For a tuning method to be attractive to a user it must give good results, but it must also be easy to use (i.e. it must not require lots of calculations) and the experiments must not take too long time.
Both the quickness and the simplicity of each of the methods are evaluated with a number ranging from 10 (best) to 0.

Controller Tunings and Results
The subsequent sections describe the controller tuning principle and the actual tuning and results for each of the selected tuning methods.The results are summarized in Table 3.

Skogestad's Method
Skogestad's PID tuning method Skogestad (2003Skogestad ( , 2004) ) (or: the SIMC method -Simple Internal Model Con-trol) is a model-based tuning method where the controller parameters are expressed as functions of the process model parameters.The process model is assumed to be a continuous-time transfer function.It is assumed that the control system tracking transfer function T (s), which is the transfer function from the setpoint to the (filtered) process measurement, is approximately a "time-constant with time-delay" transfer function: where T C is the time-constant of the control system to be specified by the user, and τ is the process time delay which is given by the process model (the method can however be used for processes without time delay, too).Fig. 3 shows the response in y mf after a step in the setpoint y SP for Eq. ( 3).By equating tracking transfer function given by Eq. ( 3) and the tracking transfer function for the given process, and making some simplifying approximations to the time-delay term, the controller becomes a PID controller or a PI controller for the process transfer function assumed.
As will be shown later in the present section, a "timeconstant with time-delay" transfer function describes the dynamic properties of the air heater quite well: which is the model we will use.(The other process models are given in Skogestad (2003Skogestad ( , 2004)).)According to Skogestad, for this process the controller is a PI-controller tuned as follows: (5) Originally, Skogestad sets the factor c to This gives good setpoint tracking.But the disturbance compensation may become quite sluggish.In most process control loops the disturbance compensation is the most important task for the controller.To obtain faster disturbance compensation, you can try e.g.c = 2.The drawback of such a reduction of c is that there will be somewhat more overshoot in the setpoint step response, and that the stability of the control loop will be somewhat reduced (the stability margins will be reduced).Both values of c (4 and 2) will be tried in this paper.
Skogestad suggests setting the closed-loop system time-constant to Application to the air heater To find a proper transfer function model, the process was excited by a step change of 0.3 V, from 1.5 V to 1.8 V, see Fig. 4. The response indicates that a proper model is "timeconstant with time-delay" as given by Eq. ( 4).From the step response the following values were found4 K = 5.7 o C/V; T = 60 s; τ = 4.0 s (9) For the controller tuning Eq. ( 8) is used: The PI controller parameters are 11) = min [60, 4 (4 + 4)] = 32.0 s (13) Fig. 5 shows control system responses with the above PI settings.Fig. 6 shows the responses with this gain increase.
One interesting observation is that the actual timeconstant (63% response time) as seen from Fig. 5 is approximately 5 sec, which corresponds well with the specified time-constant of 4 sec.
Finally, to try to obtain faster disturbance compensation with a reduced integral time, let's set Now we get The controller gain is as before: Fig. 7 shows control system responses with the above PI settings.Thus, by setting c = 2 instead of 4, the setpoint tracking is worse, but the disturbance compensation is better.The gain margin is only a little worse with c = 2.

Ziegler-Nichols' Process Reaction
Curve method Ziegler and Nichols (1942) designed two tuning rulesknown as the Ultimate Gain method and the Process Reaction Curve method -to give fast control but with acceptable stability.They used the following definition of acceptable stability: The ratio of the amplitudes of subsequent peaks in the same direction (due to a step change of the disturbance or a step change of the setpoint in the control loop) is approximately 1/4.
The Ziegler-Nichols' Process Reaction Curve method (Ziegler and Nichols (1942)) is based on characteristics of the step response of the process to be controlled (i.e. the open-loop system).The PID parameters are calculated from the response in the (filtered) process measurement y mf after a step with height U in the control variable u.From the step response in y mf , read off the equivalent dead-time or lag L and the rate or slope R, see Fig. 8.After this step response test, the controller parameters are calculated with the formulas in Table 1.

Application to the air heater
To tune the PI controller, data from the open-loop experiment recorded for Skogestad's method is used, cf.Section 5.1.The process parameters are given by Eq. ( 9).The time-delay is The slope R can be calculated as the initial slope of the step response.For a first order system, The PI settings become  The setpoint response indicates that the stability is poor.However, the disturbance response indicated that the stability is ok.The latter is due to the fact that the increased fan speed (increased air flow) reduces the process gain and the process time-delaythereby improving the stability of the control loop.
The IAE indices and the gain margin are IAE s = 19.5;IAE d = 8.6; ∆K = 1.2 = 1.6 dB (24) 5.3 Hägglund-Åstrøm's Robust Tuning Hägglund and Åstrøm (2002) have derived PI controller tuning rules for "integrator with time-delay" processes and "time-constant with time-delay" processes giving maximum performance given a requirement on robustness.The air heater looks like a "timeconstant with time-delay" process.Assuming the process model is the PI controller settings according to Hägglund and Åstrøm are as follows:

Application to the air heater
To tune the PI controller, model parameters Eq. ( 9) are used.The PI settings become K c = 0.76 (28) The Ziegler-Nichols' Ultimate Gain method is based on experiments executed on an established control loop (a real system or a simulated system): 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 controller is tuned using K cu and P u in the formulas shown in Table 2.
Table 2: Formulas for the controller parameters in the Ziegler-Nichols' closed loop method.
Application to the air heater Fig. 11 shows the oscillations in the temperature response with the ultimate gain The period of the oscillations is The PI parameter values become

Tyreus-Luyben's Tuning Method
The Tyreus and Luyben's tuning method Luyben and Luyben (1997) is based on oscillations as in the Ziegler-Nichols' method, but with modified formulas for the controller parameters to obtain better stability in the control loop compared with the Ziegler-Nichols' method.For a PI controller they suggest Application to the air heater Applying the same data as for the Ziegler-Nichols' Ultimate Gain method, cf.Section 5.4, we get Fig. 13 shows control system responses with the above PI settings.

Relay-Based Tuning Method
Åstrøm-Hägglund's relay-based method Åström and Hägglund (1995)) can be regarded as a practical implementation of the Ziegler-Nichols' Ultimate Gain method.
In the Ziegler-Nichols' method it may be time-consuming to find the ultimate gain K cu .This problem is eliminated with the relay-method of Åstrøm-Hägglund.The method is based on using a relay controller -or on/off controller -in the place of the PID controller to be tuned during the tuning.Due to the relay controller the sustained oscillations in control loop will come automatically.These oscillations will have approximately the same period as if the Ziegler-Nichols' closed loop method were used, and the ultimate gain K cu can be easily calculated, as explained below.
The parameters of the relay controller are the "high" (or "on") and the low (or "off") control values, U high and U low , respectively.Once they are set, the amplitude A of the relay controller is If "large" oscillation amplitude is allowed, you can set (assuming that the control signal is scaled in percent) and But there may be no relay controller in the control system!You can turn the PID controller into a relay controller with the following settings: As already mentioned, with the relay controller in the loop, sustained oscillations come automatically.The ultimate gain of the relay controller can be calculated as: where A e = E is the amplitude of the oscillatory control error signal, and A u = 4A/π is the amplitude of the first harmonic of a Fourier series expansion of the square pulse train on the output of the relay controller.
So, after the relay controller is set into action, you read off the ultimate period P u from any signal in the loop, and also calculate the ultimate gain K cu with Eq. ( 45).Finally, the controller parameters can be calculated using the Ziegler-Nichols' formulas given in Table 2. 5  Application to the air heater The high and low control signals are, according to their physical limits: and According to Eq. ( 41) the relay amplitude is Fig. 14 shows the oscillations in the tuning phase.
From Fig. 14 we find the ultimate period (which is almost equal to the period found with the ultimate gain in Ziegler-Nichols' method).The amplitude of the control error is appoximately The ultimate gain becomes, cf.Eq. ( 45), 5 The experiments show (at least with the PID Advanced controller in LabVIEW) that the period of the oscillations are smaller than expected when the PID controller is turned into a Relay controller by setting Kc very large, e.g.1000, and T i also very large.Probably this problem is due to the antiwindup function combined with the P control action of the controller.In the experiments accomplished for this paper, the anti-windup function was de-activated by setting the max and min control signal limits to very high values: 1000 and -1000, respectively.By doing this, the same amplitude and period of the oscillations as with an ideal relay function were obtained.
Figure 14: Relay-tuning method: Responses in the control system with relay controller.
The PI parameter values become 52) Fig. 15 shows control system responses with the above PI settings.
15: Relay tuning method: Responses in the control system.

Setpoint Overshoot Method
The Setpoint Overshoot method (Shamsuzzoha et al. (2010)) is based on Skogestad's SIMC method.The method is similar to the Ziegler-Nichols' Closed-Loop method Ziegler and Nichols (1942), but it is faster to use and does not require the system to approach instability with sustained oscillations.The method requires one closed-loop step setpoint response experiment using a P-controller.The method is as follows: Start by using a Pcontroller with gain K c0 , and apply a setpoint change of amplitude ∆y SP .K c0 should be selected so that you get a proper overshoot in the setpoint response (in the process output).A typical value is claimed to be 0.3.From the setpoint response you read off the maximum response, y max , and the steady-state response, y (∞), and the time to reach the peak, t p .Assume that the process output has value y 0 before the setpoint change.From these quantities the actual overshoot is calculated: Also the relative steady-state change of the process output is calculated: (To avoid waiting for the response to settle at a steadystate value, Shamsuzzoha et al. ( 2010) suggests the estimate y (∞) = 0.45 (y max + y min ) where y min is the value of an assumed undershoot in the response.)Define the following parameters: (F = 1 for "fast robust control" corresponding to T C = τ in Skogestad's SIMC method, but use F > 1 to detune), and The PI parameter settings are Application to the air heater Fig. 16 shows the closed-loop response to a setpoint step change of amplitude ∆y SP = 1.0 o C with a Pcontroller with gain which gives a stable response and a reasonable overshoot.From the responses we find the actual overshoot as We read off the peak time as The PI parameter settings become = min [(69.4, 34.2)] = 34.2s (67) Fig. 17 shows control system responses with the above PI settings.

Good Gain Method
The Good Gain method 6 Haugen ( 2010) is a simple method based on experiments with a P-controller, like 6 The author is responsible for this name.
in the Ziegler-Nichols' Ultimate Gain method and the Setpoint Overshoot method.Like in the latter method, the system is not brought into marginal stabililty during the tuning, which is beneficial.The theoretical background of the method is described in detail in Haugen (2010)7 The tuning procedure described in the following assumes a PI-controller.First, the process should be brought close to the specified operation point with the controller in manual mode.Then, ensure that the controller is a P-controller with K c = 0 (set T i = ∞ and T d = 0).Switch the controller to automatic mode.Find a good gain, K cGG , by trial-and-error which gives the control loop good stability as seen in the response in the measurement signal due to a step in the setpoint.It is assumed a response with a small overshoot and a barely observable undershoot (or the opposite, if the setpoint step is negative) represents good stability.A proper value of the integral time T i is (hopefully) where T ou is the time between the first overshoot and the first undershoot of the step response (a step in the setpoint) with the P-controller, see Fig. 18.
Figure 18: Reading off the time between the first overshoot and the first undershoot of the step response with P controller.
Due to the inclusion of the integral term, the control loop will get somewhat reduced stability than with the P-controller only.This can be compensated for by reducing K c to e.g.80% of the original value: Application to the air heater Fig. 19 shows the closed-loop response to a setpoint step change with a P-controller with gain Figure 19: Good Gain method: Response with Pcontroller with gain K cGG = 1.4.
The half-period is The PI parameter values become     of the methods are evaluated with a number ranging from 0 to 10 (best).
Comments to Table 3: • Setpoint tracking: A small/large value of IAE s indicates relatively fast/slow setpoint tracking.The Setpoint Overshoot method, Skogestad's method, and the Relay method give relatively fast setpoint tracking.The Ziegler-Nichols' Process Reaction Curve method and Skogestad's method with reduced integral time (c = 2 in Eq. ( 17)) gives relatively poor setpoint tracking.
Note that in most process control systems the setpoint has a constant value, so fast setpoint tracking is not an important feature in these control systems.
• Disturbance compensation: A small/large value of IAE d indicates relatively fast/slow disturbance compensation.The Ziegler-Nichols' Process Reaction Curve method, the Ziegler-Nichols' Ultimate-Gain method, and the Relay method give relatively fast disturbance compensation.The Tyreus-Luyben's method, the Setpoint Overshoot method, and the Hägglund-Åstrøm's method give relatively poor disturbance compensation.Skogestad's method with reduced integral time gives faster disturbance compensation than the original Skogestad's method.
• Gain margin: Methods which result in gain margin ∆K less than 2.0 are here regarded as giving too poor (not acceptable) robustness against a gain increase. 8The Ziegler-Nichols's methods, and the Relay method give too poor robustness.The Tyreus-Luyben method and the Hägglund-Åstrøm method give the highest robustness.
• Quickness (indicated with the Q value).This refers to how quick the controller tuning procedure can be accomplished.The quickness depends of course on the speed of dynamic response of the process to be controlled: If the process is sluggish, the tuning may take a long time.For a given process, the quickness depends on how long the data must be gathered for the tuning.
In this respect the Relay method is regarded as the quickest method, because the oscillations come automatically, without any trial-and-error.Also the open-loop methods -the Skogestad's method, the Ziegler-Nichols' Process Reaction Curve, and the Hägglund-Åstrøm method -are regarded as relatively quick because only one experiment is needed (the step response).Among these the Ziegler-Nichols' Process Reaction Curve is somewhat quicker because it does not require the process to reach steady-state.The Setpoint Overshoot method and the Ziegler-Nichols' Ultimate-Gain method, and also the Good Gain method, are regarded as relatively slow methods because they require trial-and-error.
• Simplicity (indicated with the S value): This refers to how simple the method is to use.A method is simple if the number of parameters needed to be calculated is small, if the tuning formulas are simple, and if the tuning method is easy to understand.In this respect the Setpoint Overshoot method is less simple than the other methods.The procedure of the open-loop methods is simple, but the underlying theory of Skogestad's method is not straightforward since insight into systems theory is needed 9 .The Relay method may be difficult to apply because an on/off function must be inserted into the control loop during the tuning.The Ziegler-Nichols' Ultimate-Gain method (and the Tyreus-Luyben's method) may be a little difficult to use because the user has to carefully make sure that the control signal does not reach its maximum and minimum values during the experiment.The simplest method is the Good Gain method. 10 8 Of course, this is a personal view. 9It is however fair to claim that everyone who is going to work with controller tuning should be familiar with this theory. 10The motivation behind the Good Gain method is to simplify PI controller tuning.The favourable evaluation of the Good Gain method regarding its simplicity is honest in the present paper and supported by feedback from students who have In certain processes safety must also be taken into account when controller tuning methods are judged as it may be crucial that certain process variables -e.g.pressure, temperature, level, position -do not come too close to safety limits.However, in the present benchmark system safety is not an issue.Tuning methods with potential safety issues are the open-loop methods because the process output variable may depart too far from the operating point during the input step experiment.Also the Ziegler-Nichols' Ultimate-Gain method (and the Tyreus-Luyben's method) and the Relay method may cause safety problems because of the oscillatory response required.
From the above considerations, which method is the best method?As a basis for a conclusion, here are short comments about each of the methods, focusing on the drawbacks of the method (a necessary condition for a method to be useful is that it has no important drawbacks): • Skogestad's Model-based method: Drawback is sluggish disturbance compensation.
• Skogestad's Model-based method with smaller integral time for faster disturbance compensation: No important drawbacks.
• Ziegler-Nichols' Process Reaction Curve method: Drawback is poor stability margin.
• Ziegler-Nichols' Ultimate Gain method: Drawbacks are small stability margin, that the method may not be quick to use because it requires trial-and-error, and that the user has to make sure that the control signal does not reach its maximum and minimum values during the experiement.
• Tyreus-Luyben's method: Drawbacks are sluggish disturbance compensation, that the method may not be quick to use because it requires trial-and-error, and that the user has to make sure that the control signal does not reach its maximum and minimum values during the experiement.
• Relay method: Drawbacks are a too small stability margin, and that the method can be difficult to apply in practical systems due to lack of an on/off function in the controller.
used the method in several lab assignments.However, the evaluation may be biased since the method is developed by the author.
• Setpoint Overshoot method: Drawbacks are too sluggish disturbance compensation and relatively poor quickness and simplicity.
• Good Gain method: Drawback is that the method may not be quick to use because of trialand-error to find a good value of the controller gain.The method is very simple to use.
Skogestad's method with reduced integral time ( c = 2 in ( Eq. 17)) is here ranged as the best method.It has no serious drawbacks.It gives acceptable setpoint tracking and disturbance compensation, acceptable stability margin, and is quick and simple enough to use. 11

Conclusions
This paper has demonstrated a number of PI controller tuning methods being used to tune a temperature controller for a real air heater.Indices expressing setpoint tracking and disturbance compensation, and stability margins (robustness) were calculated.From these indices and a personal impression about how quick and simple a method is to use, a winning method has been identified from the tests reported in this paper and general considerations, namely the the Skogestad's method (with a modified integral time tuning for faster disturbance compensation).

Figure 1 :
Figure 1: The air heater lab station with NI USB-6008 analog I/O device.

Figure 3 :
Figure 3: Step response of the specified tracking transfer function Eq. (3) in Skogestad's PID tuning method.

Figure 8 :
Figure 8: Ziegler-Nichols' open loop method: The equivalent dead-time L and rate R read off from the process step response.

T
i = 3.3 • L = 3.3 • 4 s = 13.2 s (23) (Reading off R more directly from Fig. 4 gives R = 0.025 o C/s, and K c = 2.7.)Fig. 9 shows control system responses with the above PI settings.

Figure 9 :
Figure 9: Ziegler-Nichols' Process Reaction Curve method: Responses in the control system.

Figure 12 :
Figure 12: Ziegler-Nichols' Ultimate Gain method: Responses in the control system.

Figure 16 :
Figure 16: Setpoint Overshoot method: The responses with a P-controller with gain K c0 = 1.8.

Figure 17 :
Figure 17: Setpoint Overshoot method: The responses in the control system.

T
Fig. 20 shows control system responses with the above PI settings.

Figure 20 :
Figure 20: Good Gain method: The responses in the control system.

Ti 4 Table 1 :
Ziegler-Nichols'open loop method: Formulas for the controller parameters.

Table 3 :
Results for different PI controller tunings.