Self Tuning PID Contr Oller Using Ziegler Nichols Method For PR Ogr Ammable Logic Contr Oller S
Self Tuning PID Contr Oller Using Ziegler Nichols Method For PR Ogr Ammable Logic Contr Oller S
1 2 3
Electrical and Electronic Faculty,
Istanbul Technical University,
Maslak, Istanbul, Turkey
email: yucelent@itu.edu.tr 1 , kaymakci@elk.itu.edu.tr 2 , kurtulan@elk.itu.edu.tr 3
A lot of methods have been developed over the last forty
years for setting the parameters of a PID controller. Some In this paper, a selftuning PID Controller method is offered
of these methods are based on characterizing the dynamic using ZieglerNichols process reaction method for
response of the dynamic system to be controlled with a programmable logic controllers. The paper is organized in 6
firstorder model or secondorder model with a time delay sections. Section 2 briefly gives a general knowledge about
PID controllers. Section 3 describes ZieglerNichols
process reaction method and the method is formulated here.
At section 4 the self tuning PID Controller is presented and
the implementation of it within a PLC and the results over
this implementation is shown at section 5. Finally the paper
is summarized and concluded at section 6.
2 PID Con tr oller
Figur e 2: Smoothen of System Output Resp onse
A ProportionalIntegralDerivative controller or PID
controller is a common used controller in industrial control 2.2 Mathematics of PID Controller in Figur e 1
applications. The controller compares the measured process A commercial PID controller discrete time equation can be
output value (y) with the reference setpoint (r) value. The given like in (1). Although this type of PID structure is
difference or error signal (e) is then processed to calculate using in many industrial applications, it is sensitive to
the control signal for the manipulated process inputs so the disturbances and system uncertainties.
system output reaches the desired reference value. Unlike -1
Ts 1 - z
simpler control algorithms, the PID controller can adjust GPID = K P + K I + K D (1)
-1
process inputs based on the history and rate of change of the 1 - z Ts
error signal, which gives more accurate and stable control. More robust PID parameters can be given separate to use in
In this paper, a different structure of a PID controller is figure 1 like in (2). This zdomain equation is obtained form
used. sdomain equation with Tustin transform and trapezoid
integral approach for integral term [7].
GP = K C
-1
KC .Ts.(1 + z ) (2)
G I = -1
2.TI .(1 - z )
-1
K .TD .(1 - z )
G D =
Ts
Discrete time equations of PID can be given to use in
Figure 1 like in (3). In these equations, Ts is sampling
Figure 1: Stru ctur e of PID Con tr oller
period, and it can be chosen form 30 times of band width
2.1 The Structur e of th e PID Con tr oller in Figure 1 frequency, ws = 2p / Ts > 30 w BW [5].
As known, the derivative can be computed or obtained if
the error varying slowly. Since the response of the GP ( k ) = KC .e ( kT )
derivative to highfrequency inputs is much higher than its
response to slowly varying signals [13]. So the derivative KC . Ts
GI ( k ) = u ( k - 1) + [e ( kT ) + e ( kT - T )] (3)
output in Figure 1 is smoothened for highfrequency noises 2. T I
by using first order filter, and it uses output of the system
(y). The derivative which uses error signal can form high KC . T D
derivative output when the error signal has high frequency
GD ( k ) = [ e ( kT ) - e ( kT - T )]
Ts
components. Thus, in this paper the derivative input uses
the filtered output of the system. Here the filter smoothens These equations are directly adapted to Figure 1 and it can
the signal and suppresses the highfrequency noise due to be used in a microcontroller or PLC [9].
filter time (Tf) constant (Figure 2). In application, the Tf
should be bigger than Ts sampling period [6].
3 Ziegler Nichols Pr ocess Reaction M ethod
In figure 1, the integral signal is formed by the error
multiplied by gain (K) and divided by integral time, and Process reaction method is an experimental openloop
saturation difference divided by integral time. PID tuning method and is only applicable to openloop stable
controller is a robust controller and this structure puts systems. This method presented by Ziegler and Nichols is
forward a more robust controller. The saturation component based on process information in the form of the open loop
is necessary for discrete time controllers [8]. As said before, step response obtained from a bump test. This method can
this structure is used in a programmable logic controller, be viewed as a traditional method based on modeling and
and this controller has maximum and minimum borders. control. The ZieglerNichols tuning rules were developed to
The saturation component supplies not to reach any other give closed loop systems with good attenuation of load
point except the limit of maximum and minimum borders. disturbances. The design criterion was quarter amplitude
Thus, the control signal (u) is limited. decay ratio, which means that the amplitude of an
oscillation should be reduced by a factor of four over a
whole period. This corresponds to closed loop poles with a maximum slope (Figure 3), after then determine the
relative damping of about z = 0.2, which is too small [1]. parameters needed for Ziegler Nichols PRM, finally, use
tuning relations to generate PID constants [12]. The
diagram of this process is given in Figure 5.
From figures 6 and 7, ZieglerNichols process reaction Wait until the system output becomes stable, then
calculate PID parameters and connect feedback
method (PRM) always provides a responsible proportional
and PID controller to the system
gain for PID controller. This method not only gives good
performance but also is robust with respect to controller 4.2 Simula tion of SelfTuning PID Controller in a
parameter perturbations [11]. Pr ogra mmable Logic Contr oller
Siemens S7400 CPU 4122 DP PLC is used for testing this
algorithm, Within the program Simatic Manager
4 SelfTun ing PID Con tr oller
Professional a simulation toolbox is given. This simulation
PID parameters must be determined from dynamic system. toolbox is good for testing algorithm before applying it to a
As said before, system parameters change because of real system. Also a data collection program is written for
various reasons. If PID controller parameters remain the S7400 CPU 4122 DP which collects datas and transfers
same for a long time, the dynamic system could not be them to Microsoft Excel [10]. In addition, the Figures 2, 6
controlled by PID efficiently. Root locus method, bode and 7 are obtained from this data collection program.
frequency analysis method and some methods like this can
PRO GRAM
be used for this calculation. But these methods have Work with CO NTROL
complex mathematical calculations, and also system Recent New
Apply Step Signal
Parameters Parameters
feedback and system’s disturbations can not be measured
momentary without any error. In addition, system
parameters (like system gain) change due to environmental Cancellation of Is System Output NO
change. For these reasons, a selftuning PID controller is a System Feedback Stable ?
necessity because this type of a controller can be used in
different type of systems and environmental situations. YES
Steady State Ok ? NO
Moreover, a selftuning PID is a robust controller for
systems’ uncertain parts. Also for changing at system Calculate PID
Parameters
dynamics the controller adopts itself. Thus, using a self YES
tuning PID is reasonable rather than using any other PID
controller which has constant parameters [6]. Record System Input ReAttach System
and Output Feedback
5.2 Connecting System to PLC
PLC needs two input, one of them is system output (or
feedback), and reference signal, due to SelfTuning PID
controller program. Then program produces control signal
for thermal system. Reference and system output is
Figur e 10: System Response with SelfTun ing PID connecting to PLC’s analog inputs and control signal is sent
pa ra meters (R esponse to Squar e Step Input) from analog output to system. The connections are given in
Figure 12.
5 SelfTuning PID Con tr olled Indu str ia l Ther mal Reference
System
System Output PLC Control Signal
Refer ences
Figure 13: SelfTun ing Analysis in Therma l System
[1] Astrom K. J., Hagglund T., PID Controllers: Theory,
Design and Tuning, Instrument Society of America,
Research Triangle Park, NC, 1995.
[2] Atherton D. P., Majhi S., Limita tions of PID
Controllers, Proceedings of the American Control
Conference, pp. 38433847, June 1999.
[3] Friedland B., Advanced Control System Design,
Figure 14: Therma l System Response with SelfTuning PrenticeHall International Editions, 2001.
PID pa ra meters (R espon se to Squar e Step Input) [4] Hagglund T., A Dead Time Compansating Three Term
Controller, 9 th IFAC/IFORS Symp. On Identification
System Type : FODS and System Parameter Estimation, Budapest, Hungary,
System Dead Time : 0.2 sec 1991.
System Time Constant : 0.7 sec
Expected Settling Time : 2.1~3.5sec [5] Kurtulan S., Programmable Logic Controllers and
PID Gain (K) : 0.714 Applications, Bilesim, 1996.
PID Integral Time (Ti) : 0.400 [6] Marshall, J. E., Gorecki, H., Korytowski, A., Walton,
PID Derivative Time (Td) : 0.100 K., TimeDela y Systems: Stability and Performance
Settling Time : 2.2 sec Criteria with Applications, Ellis Horwood, NY, 1992.
Overshoot : 15%
L / t ratio : 0 < 0.29 < 1.07 [7] Middleton R. H., Goodwin G. C., Digital Control and
Estimation: A Unified Approa ch, PrenticeHall,
Table 1: Self Tuning PID Con tr oller R esults Englewood Cliffs, 1990.
for a Th er mal System
[8] Ogata, K., DiscreteTime Control Systems, Prentice
Hall, Englewood Cliffs, NJ, 1995.
6 Conclu sions
[9] Olsson G., Pianni G., Computer Systems for
In this article the ZieglerNichols process reaction method Automation and Control, Prentice Hall, 1992.
(PRM) based selftuning PID controller is presented and its
[10] Siemens, Simatic S7300 / 400 Programmable
application on a programmable logic controller is given. For
Controller System Manuel, 2000.
this purpose first of all at the implementation part industrial
PID algorithm is used where PID’s derivative input is taken [11] Silva G., Datta A., Bhattacharyya S. P., PID
from system output and filtered, so highfrequency signals’ Controllers for TimeDelay Systems, Birkhauser
effect is minimized. Then, integral term is confirmed to Boston, 2005.
obtain a more robust PID structure and finally the output of
PID is limited due to PLC’s maximum and minimum range. [12] Silva G., Datta A., Bhattacharyya S. P., On the
Secondly, ZieglerNichols method is given and together Stability a nd Controller Robustness of Some Popular
within robustness definition is defined. It can be seen that
PID Tuning Rules, IEEE Transactions on Automatic
Control, Vol.48, pp. 16381641, 2003.
most industrial systems are in the group of this robustness
limit, and due to fact that most industrial systems are [13] Yücelen T., Kaymakçı Ö., Kurtulan S., Digita l PID
usually modeled first order or second order dead time Controller Design with PLC for an Industrial Thermal
system at practice. ZieglerNichols PRM is simulated in System, 3 rd Automation Symposium, Denizli, Turkey,
section 4 for these types of systems and get in touch with 2005.
robustness definition.