You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/268802558

Tuning of PID Controllers using Simulink

Article · January 2009

CITATIONS READS

3 7,851

1 author:

Hari om Bansal
Birla Institute of Technology and Science Pilani
70 PUBLICATIONS   366 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

hybrid electric vehicle View project

Power optimiation in Hybrid Electric Vehicle View project

All content following this page was uploaded by Hari om Bansal on 17 May 2017.

The user has requested enhancement of the downloaded file.


Com-2\E-drive 12-12-09

International Journal of Mathematical Modeling, Simulation and Applications


ISSN: 0973-8355 Vol. 2. No. 3, 2009 pp. 337-344

Tuning of PID Controllers


using Simulink
Hari Om Bansal
EEE Group, BITS, Pilani–333031, Rajasthan,
E-mail: hbansal@bits-pilani.ac.in hobansal@gmail.com

ABSTRACT This paper presents designing and analysis of various controllers. Tuning of
controller is a very important part of a control system and requires computer-based modeling to
improve system performance. In this work tinning of PID controller is done using MATLAB and
SIMULINK.
Keywords: ZNM, TUNING, PID, Simulink, MATLAB, GUI.

1. INTRODUCTION
A proportional-integral-derivative controller (PID controller) is a common feedback loop
component in industrial control systems. “Tuning” of controller is the adjustment/determination
of its parameters to the optimum values to achieve the desired response. The optimum behavior
on a process change or set point change varies depending on the application. Ziegler Nichols
method (ZNM) [1, 2] is one of the methods used for tuning of PID controller. In this, parameters
Kp, KI and KD are based on the gain (Ku) that causes a system with a P-only controller to be
marginally stable (“u” stands for “ultimate”). Based on situations either tuning of PID or PI is
done. The problem with PD tuning is that small amount of noise can cause large amount of
change in the output [3, 4].
Unlike simpler controllers, the PID can adjust process outputs based on the history and rate
of change of the error signal, which gives more accurate and stable control. PID controllers do not
require advanced mathematics and complicated optimal control algorithms to design [4] and can

Kp .e(t)

Desired state e(t) Control signal


Kr . e(t) M

KD . d e(t)
dt

Feedback Signal

Measured state

Fig. 1 Block diagram of a system with PID controller.

ch-8.p65 337 7/17/07, 3:03 PM


!!& International Journal of Mathematical Modeling, Simulation and Applications

be easily adjusted or tuned to the desired application. Various software tools are used for PID
tuning. In this paper MATLAB and SIMULINK [5, 6] is used for tuning. One example is taken to
explain the same. General block diagram of a control system with PID controller is shown in
Figure 1.
The transfer function of the most basic form of PID controller is:
K
C(s) = Kp + I + sKD (1)
s
where KP = Proportional gain, K1 = Integral gain and KD = Derivative gain and often called as
controller parameters.
The main characteristics of the closed-loop step response are rise time, overshoot, settling
time and steady state error. The effect of increasing the controller parameters is given in Table 1.

Table 1 Effect of increasing controller parameters


Parameter Rise Time Overshoot Settling Time S.S. Error
Kp Decrease Increase Small Change Decrease
KI Decrease Increase Increase Eliminate
Kd Small Change Decrease Decrease Small Change

2. TUNING OF PID CONTROLLERS


The basic meaning of PID Tuning is to find the optimum value of three unknown controller
parameters. ZNM [1, 2] is used here to tune PID controller. The steps followed in this method are:
1. Turn the controller to P-only, i.e., integral and derivative controls off.
2. Turn the controller gain, Kc, up, slowly in steps and observe the output response.
3. When value of Kc results in a sustained oscillation in the output (or close to it), this is
termed as Ku, the ultimate gain and corresponding period of oscillation (Pu), the ultimate
period, is also defined.
The values of Kc, tI and t,, are defined in [1] and shown in Table 2. As an alternative to
above, another set of tuning values have also been determined in [2, 3] for PI and PID, often
called the TLC tuning rules.  These values tend to reduce oscillatory effects and improve
robustness. Table 3 summarizes the rules for TLC tuning.

Table 2 Values for K c, tI and tD using ZNM


Kc JI JD
P control Ku/2
PI control Ku/2.2 Pu/1.2
PID control Ku/1.7 Pu/2 Pu/8

ch-8.p65 338 7/17/07, 3:03 PM


Hari Om Bansal !!'

Table 3 Values of tI and tD using TLC


Kc JI JD
PI control Ku/3.2 2.2 Pu
PID control Ku/2.2 2.2 Pu Pu/6.3

3. SIMULINK MODELING
SIMULINK is a MATLAB based software package for modelling, simulating, and analyzing
dynamical, linear and non-linear systems, modelled in continuous time, sampled time, or a
Disturbance
Controller Plant
+
Set +
C(s) G(s)
point

Fig. 2 Feedback control system.

PID + G(s)
+
Step Transfer
Pid function
controller Scope

Disturbance

Fig. 3 SIMULINK model.

hybrid of the two. SIMULINK provides a graphical user interface (GUI) for building models as
block diagrams, using click-and-drag mouse operations.
The layout of a typical feedback control system is illustrated in Figure 2. The SIMULINK
Model for plant is shown in Figure 3.

4. EXAMPLE
To explain the easiness and accuracy, one example is considered. Suppose close loop transfer
1
function of a system is: (2)
0.02 s^3 + 0.3s^2 + s + 1

ch-8.p65 339 7/17/07, 3:03 PM


!" International Journal of Mathematical Modeling, Simulation and Applications

Initially transfer function of plant is obtained with P-control only and then critical gain is
obtained.
Theoretically (for P control), it is obtained that plant would be unstable for
KP > 14 So Ker = 14

Fig. 4 Continuous cycling phenomena.

and the time period of sustained oscillations is Ter = 0.8885 sec


So corresponding PID control parameters are:
Kp = 0.6*14 = 8.4, ti = 0.5*0.8885 = 0.44425 and t, = 0.125*0.8885 = 0.111
In case of high percentage overshoot heuristically fine tune the control parameters.
At Ku = 14 the following graph results.

Fig. 5 Convergence at K = 13.5.


Figures 5 and 6 show the convergence and divergence phenomena respectively.

ch-8.p65 340 7/17/07, 3:04 PM


Hari Om Bansal !"

Fig. 6 Divergence at K = 14.5.

5. SIMULATION RESULTS
The parameters values obtained are:
Kcu = 1.75, Ku = 14 and Pu= 0.85 sec
Based on these values, PID parameters are:
Kp = 0.6*14 = 8.4, tI = 0.5*0.85 = 0.425 and t, = 0.125*0.85 = 0.10625
These parameters are same as obtained by theoretical calculations.
For PI Tuning the parameters obtained are:
Kp = 0.45*14 = 6.3 and tI = 0.85/1.2 = 0.70833
Thus, based on situations either PID or PI Tuning is used. The problem with PD tuning is
that small amount of noise can cause large amount of change in the output.
Table 4 gives the comparison of results obtained for various controllers. Figures (7-10) show
the response obtained for various controllers.
From Table 4 it is obvious that, PI control has highest gain for fixed parameters of system and
controller. One can choose either PI or PID controller to improve the system performance.

Table 4 Comparison of results obtained from various controls


S. No. Type of Control Gain Settling Time (sec.)
1 P 9.39 3.97
3 PD 9.43 3.73
5 PI 1.9 4.28
7 PID 0.81 4.01

ch-8.p65 341 7/17/07, 3:04 PM


!" International Journal of Mathematical Modeling, Simulation and Applications

System: sys
Time (sec): 3.81
Amplitude: 9.39

Fig. 7 Proportional control

System: sys System: sys


Time (sec): 0.88 Time (sec): 3.73
Amplitude: 12.1 Amplitude: 9.43

Fig. 8 Proportional derivative control.

ch-8.p65 342 7/17/07, 3:04 PM


Hari Om Bansal !"!

System: sys System: sys


Time (sec): 0.619 Time (sec): 4.28
Amplitude: 7.17 Amplitude: 1.9

Fig. 9 Proportional integral control.

System: sys System: sys


Time (sec): 0.138 Time (sec): 1.15
Amplitude: 49.3 Amplitude:–6.85

System: sys
Time (sec): 4.01
Amplitude: 0.81

Fig. 10 Proportional integral and derivative control.

6. CONCLUSION
PID Tuning is very important aspect in today’s Control Systems Design. Keeping the limitations
in mind, appropriate methods are used to find the PID control parameters. Ziegler Nichols
Method is used widely for PID tuning. Controller parameters are determined using MATLAB
and SIMULINK and compared with the theoretically results. For PI control, highest gain is
obtained for fixed parameters of system and controller. One can choose either PI or PID
Controller for improvement of system performance. KP is used to decrease rise time. KD is used to
reduce settling time and overshoot. The steady state error can be removed selecting proper K1.

ch-8.p65 343 7/17/07, 3:04 PM


!"" International Journal of Mathematical Modeling, Simulation and Applications

REFERENCES
1. Nagrath I.J. Gopal M., Control system engineering, New Age International Limited, (2007)
New Delhi.
2. Gould L.A., Chemical Process Control: Theory and Applications, Addison-Wesley,
Reading M.A. 1969.
3. Modelling, Simulation, and Control of Non-linear Dynamical Systems, Patricia Melin,
Oscar Castillo, Taylor & Francis, Inc., (2002).
4. Shlomo Engelberg, A Mathematical Introduction to Control Theory: Volume 2, Imperial
College Press, (2005).
5. Robert H. Bishop, Modern Control Systems Analysis & Design Using MATLAB &
Simulink, Addison-Wesley, (1997).
6. William C. and Messner, C, Control Tutorials for MATLAB and Simulink: A Web-based
Approach Addison-Wesley, (1998).

ch-8.p65 344 7/17/07, 3:04 PM


View publication stats

You might also like