You are on page 1of 4

STUDY ON PID PARAMETERS TUNING METHOD BASED ON

MATLAB/SIMULINK

Suping Li, Quansheng Jiang


Chaohu University
Chaohu 238000, China
e-mail:lsp2006l002@126.com
Abstract-

Enormous

calculation

of

proportional-integral

derivative (PID) controller parameters tuning with analytic


methods is an important problem demanding prompt solution.
=

Parameters tuning based on Matlab/Simulink is simplicity,


visual manipulation method which leaves out above program.
According to the Ziegler-Nichols

(Z-N) method,

this paper

1
Kp (l + - + Tn s )
0s

(2)

Where is the proportional gain K , the integral gain K, ,


p

introduces how to reduce and validate the PID controller

the derivative gainKd, the integral time constant 1; and the


derivative time constant Td .

parameter with the help of MATLAB tool taking a certain


control model as an example. The simulation results show the
effectiveness of this method and can be fit for application in the

A. PID Controller Parameters

engineering.

Keywords- MatlablSimulink; Z-N method;

The"three-term" functionalities are highlighted by the


following.

The proportional term-reducing the rise time and


will reduce, but never eliminate, the steady-state
error. Its output is proportional to input error signal
which provides an overall control action proportional
to the error signal. While the steady-state errors will
highlight if there is only proportional term in the
control system.

The integral term-eliminating steady-state errors


through low-frequency compensation by an
integrator but it may affect the transient response
that makes the transient response worse.

The derivative term-increasing the stability of the


system, reducing the overshoot, and improving the
transient response. Its output proportional to the
derivative of input error signal and improves
transient
response
through
high-frequency
compensation by a differentiator.
The individual effects of these three terms on the closed
loop performance are summarized in Table I [5] For optimum
performance K , K., (or T)
and Kd (or Td) are manually
,
p

PID contro

Parameters tuning
1.

INTRODUCTION

The PID control offers the simplest and yet most efficient
solution for many real world control problems with its three
term functionality covering treatment. Since the invention of
PID control in 1910 (largely owning to Elmer Sperry's ship
autopilot), and the Zieler-Nichols' (Z-N) straight forward
1]
tuning methods in 1942 , the popularity of PID control has
grown tremendously. The science of automatic control has
kinds of control schemes with the development of
technology. However, more than 90% of industrial
controllers are still implemented based around PID
algorithms, particularly at lowest levels [2], as no other
controllers match the simplicity, clear functionality,
t3
applicability, and ease of use offered by the PID controller ]
Matlab/Simulink is an interactive tool for modeling,
simulating, and analyzing dynamics ystems [4] It has been
assisting engineers to design and test system models for
different fields of engineering and enables engineers to build
graphical block diagrams, evaluate system performance, and
refine their designs. It provides a deep understanding of
system parameters and how they affect its performance.
This paper presents PID fundamentals and software
modules developed in Matlab/Simulink for tuning PID
controllers. To begin with, Section II highlights PID
fundamentals and crucial issues. Section III moves to focus
on implementing of Matlab/Simulink in PID tuning control.
Section IV is the conclusion of this paper.
II.

dependent in tuning.

TABLE 1. EFFECTS OF INDEPENDENT P,


Closed Loop

Rise Time

Overshoot

Response
Increasing

K"

Decrease

Increase

I AND D TUNING

Setting

Sready

Time

State Error

Stability

Small

Decrease

Degrade

Large

Degrade

Increase
Increasing

Small

Increase

Increase

Decrease

Decrease

Decrease
Increasing Kd

Small
Decrease

Decrease
Minor

hnprove

Change

Readers may refer to [6] and [7] for detailed discussions


on the use of various PID structures. Nonetheless, controller
parameters are tuned such that the closed-loop control
system would be stable and would meet given objectives [5]

RELATED WEORK

A standard PID controller is known as the"three-term"


controller, whose transfer function is generally written in the
"parallel form" given by (1) or the"ideal form" given by (2).

978-1-61284-486-2/11/$26.00 2011 IEEE

408

As for engineering stability methods can not be realized


in actual engineering which are limited by the productive
technology. While with Matlab/Simulink PID controller
method, the tuning parameters relation curve of the
controller can be computed and drawn as well as simulate
the controlling process to obtain the optimal tuning
parameters.
This paper will show you the characteristics of the
proportional (P), the integral (1), and the derivative (D) and
how to use them to obtain the desired response.

An excellent summary on PID tuning methods can be


[8-12]
found in
However, no tuning method so far can replace
the simple Z-N method in terms of familiarity and ease of
[13]
use to start with
B. Ziegler-Nichols Tuning Method Simulation Prodedure

The Ziegler-Nichols method is a simple and clear PID


controller tuning method and it was developed by John G.
Ziegler and Nathaniel B. Nichols. It is implemented by
setting the I and D gains to zero and "P" gain is increased
until the output of the control loop oscillates with constant
amplitude. Then the oscillation period are used to set the P, I,
and D gains.
The steps taken to simulate PID parameters tuning with
Ziegler-Nichols method are as following:

Set the controller to P-only mode, that is to say


assign the integral gain K 0 ; the derivative
,
L
gainKd 0 and the controller gainK
p

A.

Tuning Simulation of Three-Order System

For example, parameters tuning of a three-order system


considering a feedback controller system and the following
transfer functions:
G (s)
Gm (s)

Gv(s)

Set the controller gain, K up slowly and observe the


p
output response. When K results in a sustained
p
periodic oscillation in the output, mark this critical
value of KpasKu' the ultimate gain. Also, measure
the period of oscillationpu' referred to as the ultimate
period.
Using K and P ' Ziegler and Nichols tuning method
u
u
prescribes the following values forK , Td and T, as
p
[15]
in table II

TABLE I!.

KINDS OF CONTROLLER PARAMETERS


K

Control Type
P
PI
classic PIn
Pessen Integral
Rule
Some
overshoot
no overshoot

iz

Ku/2.2
6K
K

ic
ic
ic
10
10

33

2K

Kd

10

ic

10

;;;

1.2K

p.

;;;
;;;

K.P

;;;

K.P

2K

p.

2.5K
2K

p.

;;;

2K

p.

p.

/s

O. 15K.P.

;{
;{

K.P

The Zlegler-Nlchols tunmg rule glves PID loops best


disturbance rejection performance. Some applications wish
to instead minimize or eliminate overshoot while Ziegler
Nichols tuning rule yields an aggressive gain and overshoots,
and for this Z-N is inappropriate.
III.

1)

=
=

1/(7 s + 1)(3s + 1)

(3)

1/(9s + 1)

(4)
(5)

1.0

Develop the process model including the controller

algorithms in Simulink.

In this tutorial, we will consider the following unity


feedback system:

Figure 1.

A unity feedback control system

Plant:
A
system
to
be
controlled.
Controller: Provides the excitation for the plant that designed
to control the overall system behavior.
Calculate the PID controller setting using the Ziegler
Nichols Tuning method then it is verified in
Matlab/Simulink. Open a new Simulink window and drag
and-drop all necessary blocks to simulate the process.
2)
Seting PID parameters names
PID parameters can be given by clicking"gain" model or
writing in"command window" and simulation time can be
chosen clicking"parameters" menu. Generally, the longer
that simulation time, the higher of precision and higher
resolution curve will be obtained. Given the lack of
resolution of Simulink, so we can move the simulation
results to"workspace". After that, the simulation results will
be analyzed by plotting the simulating curve.
The controller parameters must be defined. Figure 2
clarifies the model develop in Simulink to simulate the
feedback controller system. Double clicking the three models:
"gain", "gainl" and"gain2", inputting" K ", "K " and
p

respectively. Then input: Kd = 1 ; K = 0 ; Kd = 0 in


,
Mat lab Window to initialize above three parameters. Having
done the simulation control settings, click"start simulation"
button to begin simulation.
"

PID CONTROLLER USING SIMULINK

PID controller is very popular and widely used in many


[14]
applications . The combination of the three terms gives the
controller the advantages over other conventional controllers.
It is important to mention that it is not necessary to
implement all three terms if any simple combination
provides a good and accepted output response.

409

"

Kd

controlling effect is not good. So the prop oral parameter K

should be decreased to simulate repeat and the simulating


curve shown in figure 6.

Figure 2.

Three-order system simulation block diagram

3)
Tuning PID parameters
In step 3, PID tuning is realized according to Ziegler
Nichols method.

Figure 6.

The tuned step response of three-order system

The amended system is improved comparing with figure

6. Setting time is shortened and the overshoot is also reduced.

As a result, an intuitively understanding of the control


system can be obtained in Matlab/Simulink interface which
is benefit for actual engineering control.
Figure 3.

Three-order system simulation curve before tuning

B.

There is none overshoot in the system step response of


figure 3, so the proportion parameter P should be added to
obtain the overshoot. While the system is stable, PID
parameters can be tuned in Ziegler-Nichols method.
Tum the controller gain K , up slowly and observe the

..... :!;Q !I
g_
. -l:.:. ...J :

Figure 7.

.L.,;.J
.. .

"'.

,.....0:.... '

;.

,...

Two-order system simulation block diagram

Firstly, obtain the sustained periodic oscillation t=3.7


seconds
which
is
brought
into
the
tuning
method:K =2. Lt=7.6;K=0.95 K ILK=0.075*t*KP
p
p

output response. Note that this requires changing K in step


p

increments and waiting for a steady state in the output.


Generally, initializing larger K (setting 80 ) to obtain a non-

to

obtain
related
parameters
K = 1.8; K, = 0.2624;Kd = 0.455
p

stable output. Then take picking medium method to find


critical gain. Given the first gain number is 40, if it is still
increasing oscillation output, then taken 20 as the next gain
setting or taken 60. The critical gain can be taken in this way.
Sustained periodic oscillation can be obtained directly in
Matlab/Simulink shown in figure 4; the ultimate gain
K means critical value K

Figure 8.

as

following:

The tuned step response of two-order system

From the above figure 8, we can obtain the conclusion


that setting time of the system is only 10 seconds and there is
almost none overshoot. The tuning effect is hard to obtain. In
the actual engineering control, a good tuning system
obtained with above Simulink tuning parameters.

Figure 4.

-r:: .

Tuning Simulation of Two-Order System

Sustained oscillation step response curve

C. Tuning Simulation of one-order system

At present, K is 10. The time interval of two peaks is

While

about 20 seconds which means the period of oscillation P '


u

1_
5s+ 1

is the transform of the control system and it

is a one-order system. The step response of the steady system


is shown in figure 9.

referred to as the ultimate period is 20 seconds.


Next step, using the values of the ultimate gain K ' and
u

the ultimate period p. ' Ziegler and Nichols method


prescribes the following values for K" T and T , depending
[
n
on the type of controller. Also the system step response is
shown in figure 5.

Figure 9.

The tuned step response of one-order system

It shows that as for one-order system, a good tuning


effect will be obtained with proporal control.
IV.

Figure 5.

CONCLUTION

Matlab/Simulink software package has been asslstmg


engineers to design and test stem models for different fields
of engineering. A procedure for tuning PID controllers with
Matlab/Simulink is proposed. It is shown how MATLAB
can interact easily with Simulink to implement the Ziegler
Nichols Tuning method. The three case studies demonstrated

The step response of three-order system

From figure 5 we can see that setting time of the system


is 20 seconds, overshoot is greater than 40%. Comparing
with some mechanic-electronic controlling system, the

410

that Matlab/Simulink is a powerful and easy-to-use tool to


tune PID controllers.
The approach presented in this work can be enhanced
considerably the learning progress of process control. An
enormous set of process models can be implemented in
Simulink and the behavior of the control systems can be
analyzed very easily. It provides a deep understanding of
system parameters and how they affect its performance.
Engineering students and engineers can build their model
and test it before implementing it in the real process. This
will enhance students' knowledge and make them familiar
with the MATLAB environment.
REFERENCES
[1]

IG.ZieglerandN.B.Nichols, "Optimum settings for


controllers," Trans.ASME, voI.64, pp. 759-768,1942.

automatic

[ 2]

"PIDControl,"in the Control Handbook, W.S. Levine, Ed.Piscataway,


NJ: IEEE Press,1996,pp. 198-209.

[3]

L.Wang, T.J.D.Barnes, and W. RCluett, "Newfrequency-domain


design method for PID controllers,"Proc. Inst.Elect.Eng.D-Control
TheoryAppI., vo1.l42, no.4, pp. 265-27l,1995.

[4]

l1,XsaJl. MATLAB lIium'&it[M] . :g:OOIl1iIi\I.:l!\&H,


200l.

[5]

Kiam Heong Ang, Gregory Chong, and Yun Li. PID Control System
Analysis, Design, and Technology. IEEE Transactions on control
system system techonology,13(4),2005.

[6 ]

IP.Gerry, "AcomparisonofpIDcontrolalgorithms, ControlEng " vo1.34,


no.3,pp.l02-l05,Mar. 1987.

[7 ]

A.KayaandT.J. Scheib, "Tuning of PID controls of different structures,


ControlEng " vo1.35, no. 7, pp.62-65, Jui. 1988.

[8 ]

K.J. Astr6mandT.Hagglund, PID Controllers: Theory, Design, and


Tuning. Research TrianglePark,NC: Instrument Soc.Amer, 1995.

[ 9]

RGorez, "AsurveyofpIDauto-tuningmethods,"J.A,
pp.3-l0,1997.

vo1.38, no. 1,

[10] "Digitalcontrol: past, present and future of PID control," in Proc.


IFAC Workshop, IQuevedo and T.Escobet,Eds. ,Terrassa, Spain,
Apr.-7,2000.
[ll] A.O'Dwyer, Handbook of Piand PID Controller Tuning Rules.
London,U. K.: Imperial College Press,2003.
[12] Co, Tomas; Michigan Technological University (February 13, 2004).
"Ziegler-Nichols
Closed
Loop
Tuning''.http://www.chem.mtu. edu/-tbco/cm4l6/zn.html. Retrieved
2007-06-24.
[13]
[14]

JIl'lJ'j,:6tMU1# PID lIiulJlIfJ.E1JYtfII.J 1:li}fJ1:[J] . !3 ZliJ1.t


:f5t*}i\Zffl, 24(ll),2005.
5iHz:..':':. PID lIiulJlIfJ.E[1] . ;f4:f5Hj'HI*.7fb'f, 17(29),

2007.

[15] Co, Tomas; Michigan. Ziegleer-Nichols Closed Loop Tuning [1] .


Technological
University,
February
13,
Retrieved
2004.http://www.chem.mtu.edu/-tbco/cm4l6/zn.htmi.
2007-06-24.

Project supported by National Natural Science


of
and
Foundation
51005025
China
)
Provincial Natural Science Foundation of Anhui
Cl1040606M114 )

411

You might also like