Project Report - Final
Project Report - Final
}
Where e(u,t) is the error signal which enters the PID controller, with the PID
controller parameters. For the system structure shown in Fig. 2, two setting strategies
are proposed: one for the set-point input and the other for the disturbance signal d(t).
In particular, three values of n are discussed, i.e., for n = 0, 1, 2. These three cases
correspond, respectively, to three different optimum criteria: the integral squared error
(ISE) criterion, integral squared time weighted error (ISTE) criterion, and the integral
squared time-squared weighted error (IST2E) criterion.
3.3.2 Automatic tuning of PID Controller:-
In 1984, Astrom and Hagglund proposed an automatic tuning method based on a
simple relay feedback test, using the describing function analysis, the critical gain and
the critical frequency of the system. This method is popularly known as Gain-phase
margin (G-P) method.
This topic was further studied and discussed by Ho, Hang, and Cao in the year 1995.
All this studies on the approach of optimal design of PID controller based on Gain
margin, phase margin have resulted in the following recommended range:
Gain Margin 2 5;
Phase Margin 30
o
70
o
And two important factors that have been considered are:
- ROBUSTNESS: larger the phase margin greater is the robustness of the
system.
Page | 29
- PERFORMANCE: lower the value of ISE better is the performance.
In this study on optimal design of PID Controller, we will be analysing the two
technique, on how they perform to the given specification or range discussed above.
The two methods are:
Method - 1 : Based on Gain and Phase margin i.e. numerical solution method.
Method 2 : Based on Gain-Phase margin tester method.
Both the method is based on First Order Plus Delay Time (FOPDT) process. It is
given by:
3.4 First order delay time process :-
A first-order system is one whose output y(t) is modelled by a first-order differential
equation.
1
In the Laplace Domain, general first-order transfer functions are described
by Equation:
Equation : First-Order Process
Dead time () is the time delay between the process and the sensor. The transfer
function for dead time is:
Cause of dead time is:
- Transportation lag
- Sensor lag
Effect of Dead Time on the system is:
Time delay occurs in the control system when there is a delay between command
response and the start of output response. The delay cause a decrease phase margin
which implies a lower damping ratio and a more oscillatory response for the close-
loop system. Further it decreases the gain margin thus moving the system to
instability [5].
-sL
p
K
G (s) = ( )e
1+sT
p
K
G (s) =
1+sT
-sL
p
G (s) = e
Page | 30
Pade approximation is used for approximation of dead time function in FOPDT
transfer function.
FOPDT models are the combination of a first-order process model with dead time.
Where,
K : process gain
T : process time constant
L : dead time constant
Frequency response of the dead time:
Fig 3.3
Example:
Thermal control system is a best example of FOPDT process. A heater takes time
delay to attain the temperature desired or the set-point.
How PID works for this process?
Only very control of temperature can be achieved by causing heater power to be
simply switched on and off according to an under or over temperature condition
respectively. Ultimately, the heater power will be regulated to achieve a desired
system temperature but refinement can be employed to enhance the control accuracy.
Such refinement is available in the form of proportional (P), integral (I), and
derivative (D) functions applied to the control loop. These functions, referred to as
-sL
p
K
G (s) = ( )e
1+sT
Page | 31
control terms can be used in combination according to system requirements. The
desired temperature is usually referred to as the set-point (SP).
Proportional (P) A form of anticipatory action which slows the temperature rise
when approaching set-point. Variations are more smoothly corrected but an offset will
occur (between set and achieved temperatures) as conditions very.
Average heater power over a period of time is regulated and applied power is
proportional to the error between sensor temperature and set-point (usually by time
proportioning relay switching). The region over which power is thus varied is called
the Proportional Band (PB) it is usually defined as a percentage of full scale.
.
Proportional + Integral + Derivative (PID) :-
Adding an integral term and derivative term to P control can provide automatic and
continuous elimination of any offset. Integral action operates in the steady state
condition by shifting the Proportional Band upscale or downscale until the system
temperature and set-point coincide.
It is clear from the above example that to achieve optimum temperature control use of
such PID technique is indispensible.
Thus next we will be studying two technique of optimal design of such PID controller
applied to similar First order plus delay time (FOPDT) process as mentioned above
and we will be analysing the performance of both the method. The controller so
designed would compensate for the instability induced by the delay time and endows
the system with robust safety margin in terms of gain and phase, as well greater
performance by reducing ISE.
Page | 32
Chapter 4 DESIGN OF PID CONTROLLER
4.1 METHOD I : Tuning based on Gain and Phase margin
4.1.1 Introduction:-
It is based on the approach to minimise a performance index i.e. ISE, IAE, ITAE, in
order to get an optimum design of PID controller. The performance index considered
here is ISE error, which is given by
ISE = }
0
e
2
(t) dt
Where, e(t) is error signal at time t.
Gain and Phase margin are used as Measure of Robustness and also the
Performance of closed-loop system. So such design is based on specifying the gain
and phase margin wisely to give the best of performance and robustness [7].
The recommended range of Gain and Phase margin according to Astrom and
Hagglund, 1995 is given by:
G.M. 2-5
P.M. 30
o
-70
o
4.1.2 Methodology:-
Various denotations used are as follows:
G
p
(s) = process transfer function.
Gc(s) = controller transfer function.
A
m
= gain margin.
m
= phase margin.
Page | 33
The PI controller transfer function is given as:
(1)
First order plus death-time process model given by:
(2)
From the basic definition of gain and phase margin following set of equations are obtained:
m
= arg [G
c
(jw
g
)G
p
(jw
g
) ] + (3)
A
m
= 1/(| G
c
(jw
p
)G
p
(jw
p
)|) (4)
Where w
g
and w
p
are given by
[G
c
(jw
g
)G
p
(jw
g
) ] = 1; (5)
Arg [G
c
(jw
p
)G
p
(jw
p
)] = -; (6)
From eqn.(1) and (2), forward loop transfer function is given by
c p i -sL
c p
i
K K (1+ sT)
G (s)G (s) = e
sT(1+sT)
(7)
Solving eqn (7) into (3) to (6) gives:
/2 + arc tan(w
p
T
i
) arc tan(w
p
T) - w
p
L = 0 (8)
p
2 2
m c p p i
2 2
p i
(w T +1)
A K K = w T
( w T +1)
(9)
2 2
g
c p g i
2 2
g i
(w T +1)
K K = w T
( w T +1)
(10)
m
= /2 + arc tan(w
g
T
i
) arc tan(w
g
T) w
g
L (11)
-sL
p
K
G (s) = ( )e
1+sT
c c
i
1
G (s) = K (1+ ).
sT
Page | 34
For a given process K
p ,
T, L , and specification of A
m
,
m
, eqn. (8) (11) can be
solved for the PI control parameter K
c
, T
i
, and crossover frequency w
g
, w
p
,
numerically but not analytically because of the presence of arc tan function.
However approximate analytical solution can be obtained if we make the following
approximation for the arc tan function.
Arc tan x ~ /2 /4x (|x|>1) (12)
The numerical solution of eqn. (8) (11) shows that for
L/T > 0.3 , T
i
~ T
Thus eqn. (9) and (10) can be reduced to,
A
m
K
c
K
p
= w
p
T (13)
K
c
K
p
= w
g
T (14)
Using the approximation in eqn. (12) for the arc tan function, eqn. (8) and (11) can
be approximate as
/2 - /(4w
p
T
i
)+ /(4w
p
T) - w
p
L = 0 (15)
m
= /2 /(4w
g
T
i
) + /(4w
g
T) w
g
L (16)
Solving eqn. (15) for w
p
,
/2- w
p
L = /(4w
p
T
i
) - /(4w
p
T)
- 2w
p
L =(T T
i
) / (2w
p
T
i
T)
4w
p
2
T
i
TL - 2w
p
T
i
T + T T
i
w
p
= (2T
i
T + \(4
2
T
i
2
T
2
- 16 T
2
T
i
L + 16 TT
i
2
L)) / (8 T
i
TL)
= (2T
i
T + \(4T
i
T [T
i
T - 4 TL + 4T
i
L])) / (8 T
i
TL)
= /4L + (\(T
i
T [T
i
T - 4 TL + 4T
i
L])) / (4 T
i
TL) (17)
Page | 35
Putting the value of w
p
in eqn. (13)
K
c
= w
p
T/(A
m
K
p
)
= [/4L + (\(T
i
T [T
i
T - 4 TL + 4T
i
L])) / (4 T
i
TL)]* T/(A
m
K
p
)
= [T
i
T + \(T
i
T [T
i
T - 4 TL + 4T
i
L])] / (4A
m
K
p
T
i
L) (18)
Solving eqn. (16) for w
g
,
/2 w
g
L-
m
= /(4w
g
T
i
) - /(4w
g
T)
2w
g
L- 2
m
= (T T
i
) / (2w
g
T
i
T)
4w
g
2
T
i
TL + w
g
(4T
i
T
m
- 2 T
i
T) + T T
i
= 0
w
g
= [2 T
i
T - 4T
i
T
m
+ \(B
2
4AC)] / (8 T
i
TL) (19)
where,
B
2
4AC = (16T
i
2
T
2
m
2
+ 4
2
T
i
2
T
2
- 16T
i
2
T
2
m
16 T
2
T
i
L + 16 TT
i
2
L)
Putting the value of w
p
in eqn. (14)
K
c
K
p
= w
g
T
[T
i
T + \(T
i
T [T
i
T - 4 TL + 4T
i
L])] / (4A
m
T
i
L)
= [2 T
i
T - 4T
i
T
m
+ \(B
2
4AC)] / (8 T
i
L) (20)
Eqn. (20) has T
i
in terms of known process parameters like T, L, and specified gain
and phase margin
m
, A
m
. So the value of T
i
can be calculated by numerical analysis
method. The value of this T
i
is then put into the eqn. (18) to get the corresponding
value of K
c
with given specification.
Page | 36
4.1.3 Computation:-
The procedure followed to calculate the value of K
c
and K
i
corresponding to the
specified G.m. and P.m using the above method is given below. For simplicity we have taken a
example of a case were,
A
m
= 3;
u
m
= 50;
4.1.4 Algorithm:-
Step 1: The first thing to do is to calculate the value of T
i
by numerical analysis method for
the given process parameters and a given specification of gain and phase margin. In
Matlab file pid.m all the known values corresponding to the FOPDT system is
entered. The value of T
i
is varied within a range of 0.1 to 5.0 and the value of it
corresponding to the minimum value on the R.H.S. is calculate. This value corresponds
to the T
i
value for the given specification. The code to do this job is as follows:
MATLAB CODE :-
function value = pid(tao)
Am=3;
L=0.5;
theta=50;
phi=(pi/180)*theta;
display(phi);
i1=1;
for Ti= 0.1:0.001:5.0
value1(i1)= (2*pi*Ti*tao*Am)- (4*Ti*tao*phi*Am)- (2*pi*Ti*tao)+
(16*Ti*tao*Am^2*(Ti*tao*phi^2+pi^2*Ti*tao/4-Ti*tao*pi*phi-pi*taon
*L+pi*Ti*L))^0.5 - (4*pi*Ti*tao*(pi*Ti*tao-4*tao+4*Ti))^0.5;
i1=i1+1;
end
[value,I]=min(value1);
display(value);
display(I);
Ti_value=0.9+(0.001*(I-1));
display(Ti_value);
Step 2: Function pid.m is run and result of tri_value gives the value of minimum
T
i
value corresponding to the given specification. The following operation is
performed on Matlab command window :
MATLAB Command Window:
>> pid(1)
Page | 37
phi =
0.8727
value =
0.0015
I =
688
Ti_value =
0.7870
ans =
0.0015
Step 3: The value of minimum T
i
obtained in step 2 is then put in M-file pid4Kc.m to get
the corresponding K
c
value. The code is given below:
MATLAB CODE:-
Am=5.0;
L=0.5;
Kp=1.0;
tao=1.0;
Ti=0.97;
display(Ti);
Kc= (pi*Ti*tao +(pi*Ti*tao*(pi*Ti*tao-
4*tao*L+4*Ti*L))^0.5)/(4*Ti*L*Am*Kp);
display(Kc);
Step 4: The M-file pid4Kc.m is run and the value of K
c
is obtained in MAtlab command
window.
OUTPUT:-
Ti =
0.7870
Page | 38
Kc =
1.0000
Step 5: The value obtained in step-4 gives the values of K
c
(taken as K
p
in the program) and T
i
respectively for the specified parameters. This value is put in the function exp2 written in M-
file exp2.m.To obtain the system transfer function i.e. G
o
(s)= Gc(s)*Gp(s).
MATLAB CODE:-
function tf = exp2(Kp,Ti)
syms s
Ki=Kp/Ti;
tf1=(s^4+13*s^3+60*s^2+48*s);
vpa(tf1,4);
tf=(s^3*Kp+s^2*(Ki-12*Kp)+s*(48*Kp-12*Ki)+48*Ki)/(tf1);
On running the above code on the Matlab command window we get the system forward
transfer function.
MATLAB Command Window:
>> exp2(1.000,0.7870)
ans =
(s^3-8444/787*s^2+25776/787*s+48000/787)/(s^4+13*s^3+60*s^2+48*s)
>> vpa(ans,4)
ans =
(s^3-10.73*s^2+32.75*s+60.99)/(s^4+13.*s^3+60.*s^2+48.*s)
Step 6: The system transfer function obtained in the step-5 is used to check for the actual G.M.
and P.M. using the Matlab function sisotool(sys). The code is given below,
MATLAB Command Window:
>> num = [1.0 -10.73 32.75 60.99]
Page | 39
num =
1.0000 -10.7300 32.7500 60.9900
>> den=[1 13 60 48 0]
den =
1 13 60 48 0
>> sys=tf(num,den)
Transfer function:
s^3 - 10.73 s^2 + 32.75 s + 60.99
---------------------------------
s^4 + 13 s^3 + 60 s^2 + 48 s
>> sisotool(sys)
OUTPUT:-
10
-2
10
-1
10
0
10
1
10
2
-90
0
90
180
270
P.M.: 50.9 deg
Freq: 1.13 rad/sec
Frequency (rad/sec)
P
h
a
s
e
(
d
e
g
)
-40
-30
-20
-10
0
10
20
30
40
G.M.: 9.29 dB
Freq: 3 rad/sec
Stable loop
Open-Loop Bode Editor for Open Loop 1 (OL1)
M
a
g
n
i
t
u
d
e
(
d
B
)
-15 -10 -5 0 5 10
-5
-4
-3
-2
-1
0
1
2
3
4
5
Root Locus Editor for Open Loop 1 (OL1)
Real Axis
I
m
a
g
A
x
i
s
Step 7: Actual values of G.M and P.M. are tabulated using the symbol *(asterisk) as a
superscript. All the data obtained above are also tabulated.
Page | 40
Step 8: The value of ISE error for the given specification can be obtained using SIMULINK.
Using it a model is designed to display the values of :
- ISE Error
- IAE Error
- Output of the PROCESS.
The above values are calculated with step input and step load disturbance .
4.1.5 Simulink Model:-
Transport
Delay
To Workspace
out
Subtract
Step
SQUARE
u
2
PID Controller
PID
OUTPUT
Integrator 2
1
s
Integrator 1
1
s
ISE Error
0.6699
IAE Error
1.194
Absolute
|u|
Transfer Function
1
s+1
Disturbance
Fig 4.1
Page | 41
Output of the process with PI controller is given below:
0 1 2 3 4 5 6 7 8 9 10
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
OUTPUT Vs TIME (Am=3:Phi=50)
Time
P
r
o
c
e
s
s
O
u
t
p
u
t
Fig 4.2
Page | 42
4.1.6 Project Report:-
TABULATION 4.1:-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In
degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
2.0
(6.02db)
30
1.3719
2.8252
0.5900
0.9446
27.5
5.17
35
1.4221
2.1878
0.6500
0.7107
30.7
5.40
40
1.4890
1.5458
0.7632
0.6263
36.1
5.72
45
1.5710
1.5710
1.0000
0.6062
45.0
6.08
50
1.6110
1.0739
1.5001
0.6031
50.6
6.24
55
-
-
-
-
-
-
60
-
-
-
-
-
-
65
-
-
-
-
-
-
70
-
-
-
-
-
-
Page | 43
TABULATION 4.2 :-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In
degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
3.0
(9.54db)
30
0.9146
1.5502
0.59
0.7492
40.4
8.69
35
0.9379
1.4887
0.63
0.6930
42.6
8.85
40
0.9574
1.4289
0.67
0.6838
44.9
8.99
45
0.9778
1.3580
0.72
0.6801
47.5
9.13
50
1.0080
1.2759
0.79
0.6699
51.0
9.30
55
1.0240
1.1636
0.88
0.6790
55.1
9.46
60
1.0470
1.0470
1.00
0.6742
60.0
9.61
65
1.0732
0.9018
1.19
0.6837
66.6
9.76
70
1.0994
0.7378
1.49
0.7193
74.9
9.90
Page | 44
TABULATION 4.3:-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In
degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
4.0
(12.04db)
30
-
-
-
-
-
-
35
0.7034
1.1165
0.63
0.7718
50.5
11.3
40
0.7181
1.0568
0.67
0.7667
52.5
11.5
45
0.7333
1.0184
0.72
0.7666
55.1
11.6
50
0.7437
0.9735
0.76
0.7742
57.1
11.7
55
0.7549
0.9319
0.81
0.7763
59.5
11.8
60
0.7680
0.8727
0.88
0.7829
62.6
12.0
65
0.7788
0.8197
0.95
0.7921
65.5
12.0
70
0.7913
0.7536
1.05
0.8085
69.4
12.2
Page | 45
TABULATION 4.4:-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In
degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
5.0
(13.97db)
30
-
-
-
-
-
-
35
0.5627
0.8931
0.63
0.8734
55.7
13.3
40
0.5744
0.8573
0.67
0.8752
57.4
13.8
45
0.5844
0.8230
0.71
0.8791
59.8
13.5
50
0.5950
0.7828
0.76
0.8863
62.2
13.7
55
0.6039
0.7455
0.81
0.8955
64.4
13.8
60
0.6116
0.7111
0.86
0.9062
66.6
13.9
65
0.6183
0.6794
0.91
0.9183
68.6
13.9
70
0.6252
0.6445
0.97
0.9341
70.9
14.0
Page | 46
4.1.7 Graphs and plots
Am=2: Phi = 45 Am=2: Phi = 50
Am=3: Phi = 45 Am=3: Phi = 60
Page | 47
Am=4: Phi = 50 Am=4: Phi = 60
Am=5: Phi = 50 Am=5: Phi = 60
Fig 4.3
Page | 48
4.2 METHOD II :- Gain-Phase margin tester method
4.2.1 Introduction :-
Gain margin and Phase margin plays an important role concerning the robustness of a
system. This method is being applied to a non-minimum phase plant containing an uncertain
delay time with specifications in terms of gain and phase. The gain-phase margin tester
method is adopted to test the stability boundary in the parameter plane (2-D) for any given
gain or phase margin specification. These margins serve as restriction to scheduling the
controller. Such method guarantees both relative and absolute stability margin. Such
parameter area in 2-D is used to achieve compromise between good tracking performance and
system robustness with respect to external disturbance [14].
4.2.2 Advantage:-
- System performance resulting from such tuning can be realized completely.
- Especially when delay time is uncertain, this method works effectively well [14].
- It avoids extensive or unnecessary on-line tuning and results in easier implementation.
- It can be applied to both stable and unstable systems of higher order.
4.2.3 Methodology:-
For a first order plus delay time non-minimum system, its transfer function is shown as
follows:-
(1)
Where, K = a constant.
T = tao- time constant.
L = delay time constant.
Notations:
Gp(s) = process transfer function.
Gc(s) = controller transfer function.
D(s) = external disturbance transfer function.
An Error- actuated PID controller has the transfer function:
-sL
p
K
G (s) = ( )e
1+sT
Page | 49
i
c p d
K
G (s) = K + + K s
s
. (2)
So, the forward open-loop transfer function is-
G
o
(s) = Gc(s)*Gp(s) = N(s)/D(s). (3)
By putting s = jw in equation (3), we get,
j
o o
G (s) = | G (jw) | e
u
(4)
Now putting eqn. (4) in eqn. (3) we get ,
j
o
N(jw)
D(jw) -
| G (jw) | e
u
(5)
Let,
A = 1/| G
o
(jw) | (6)
u = + 180 (7)
When, u = 0; A gives the value of the gain margin.
and when, A = 0; u gives the value of phase margin.
We can now define the gain-phase margin tester function as :
-j
F(jw) = D(jw) + A e * N(jw)
u
(8)
Eqn. (8) implies that the function F(jw) should always be equal to zero. This indicates that
the G.M. and the P.M. can be calculated from the characteristic equation.
Now by adding a so-called gain-phase margin tester A exp(-ju) into the system as shown in
the above fig.1., the characteristic equation is,
-j -sL
d
Ki K
1 + A e * (Kp + + K s) * ( e ) = 0
s 1+sT
u
(9)
Page | 50
Now putting ,A exp(-ju) = A cosu - jA sinu, K = 1 , T = 1,eqn. (8) and (9) give rise to
F(jw) = Xa(jw) + A(cos(u+wL) j sin(u+wL))*[KpX
b
(jw) + K
i
X
c
(jw) + K
d
X
d
(jw)] (10)
Where,
X
a
(jw) = -w
2
+jw ; (11)
X
b
(jw) = jw ; (12)
X
c
(jw) = 1 ; (13)
X
d
(jw) = -w
2
; (14)
Taking eqn. (10) into consideration we obtain two more eqn. by separating all real and
imaginary part of F(jw) and by putting u
1
= (u+wL) , K
d
= 0, we get,
F
r
(jw) = K
p
B
1
+ K
i
C
1
+ D
1
= Re(X
a
) + A cosu
1
(K
p
Re(X
b
) + K
i
Re(X
c
) + K
d
Re(X
d
))
+ A sinu
1
(K
p
Im(X
b
) + K
i
Im(X
c
) + K
d
Im(X
d
)) = 0 ; (15)
F
r
(jw) = K
p
B
2
+ K
i
C
2
+ D
2
= Im(X
a
) + A cosu
1
(K
p
Im(X
b
) + K
i
Im(X
c
) + K
d
Im(X
d
))
- A sinu
1
(K
p
Re(X
b
) + K
i
Re(X
c
) + K
d
Re(X
d
)) = 0 ; (16)
Where,
B
1
= A cosu
1
Re(X
b
) + A sinu
1
Im(X
b
) (17)
= wA sinu
1
C
1
= A cosu
1
Re(X
c
) + A sinu
1
Im(X
c
) (18)
= A cosu
1
D
1
= Re(X
a
) + A cosu
1
K
d
Re(X
d
)+ A sinu
1
K
d
Im(X
d
) (19)
= -w
2
w
2
K
d
A cosu
1
`
B
2
= A cosuIm(X
b
) - A sinu
1
Re(X
b
) (20)
= w A cosu
1
C
2
= A cosu
1
Im(X
c
) - A sinu
1
K
i
Re(X
c
) (21)
Page | 51
= - A sinu
1
D
2
= Im(X
a
) + A cosu
1
K
d
Im(X
d
) - A sinu
1
K
d
Re(X
d
) (22)
= w
Solving eqn. (15) and (16) we get the value of K
p
and K
i
as,
K
p
= (C
1
D
2
C
2
D
1
) / (B
1
C
2
B
2
C
1
) (23)
K
i
= (D
1
B
2
D
2
B
1
) / (B
1
C
2
B
2
C
1
) (24)
Parameter Pane analysis:-
By varying one of the parameters, A,u, and w, and fixing the others , it suffices to plot
the constant gain margin boundary ( A = constant , u = 0, w is varied over a range) and the
constant phase margin boundary ( A = 0 , u = constant, w is varied over a range) in the
parameter plane. The above locus representing the stability boundary of the system is plotted in
the K
p
-K
i
plane. Region left of the stability boundary, facing the direction in which w
increases, is the stable parameter area. The region characterizes all feasible control parameter
sets which guarantees the controlled system robust margin i.e. G.M. and P.M. of the system
[14].
4.2.4 Computation:-
The procedure followed to calculate the value of K
p
and K
i
corresponding to the
specified G.m. and P.m using the K
p
-K
i
plot is given below. For simplicity we have taken a
example of a case were,
A = 3;
u = 50;
4.2.5 Algorithm:-
Step 1: In the MATLAB, M-file j1_final2.m, all the known values corresponding to the
given FOPDT system is entered. Code for the case considered is :
MATLAB CODE:-
% PART -------------------> 1
% PM varying with a Constant GM Kp Vs Ki
Page | 52
% for theta 50
A=1.0;
theta=50.0;
T=0.5;
Kd=0.0;
format short;
phi=(pi/180)*theta;
i1=1;
for w=0.7:0.01:10.8
B1=A*sin(phi+w*T)*w;
C1=A*cos(phi+w*T);
D1=-(w^2)-A*cos(phi+w*T)*Kd*w^2;
B2=A*cos(phi+w*T)*w;
C2=-A*sin(phi+w*T);
D2=w;
Ki(i1)=(D1*B2-D2*B1)/(B1*C2-B2*C1);
Kp(i1)=(C1*D2-C2*D1)/(B1*C2-B2*C1);
i1=i1+1;
end;
plot(Kp,Ki,'b')
xlabel('Kp'); ylabel('Ki');
hold on
% % % PART ----------------------------------------->2
% % % GM varying with constant PM Kp Vs Ki
% %A=3.0;
A=3.0;
theta=0.0;
T=0.5;
Kd=0.0;
format short;
phi=(pi/180)*theta;
i1=1;
for w=0.7:0.01:10.8
B1=A*sin(phi+w*T)*w;
C1=A*cos(phi+w*T);
D1=-(w^2)-A*cos(phi+w*T)*Kd*w^2;
B2=A*cos(phi+w*T)*w;
C2=-A*sin(phi+w*T);
D2=w;
Ki(i1)=(D1*B2-D2*B1)/(B1*C2-B2*C1);
Kp(i1)=(C1*D2-C2*D1)/(B1*C2-B2*C1);
i1=i1+1;
end;
plot(Kp,Ki,'b:')
xlabel('Kp'); ylabel('Ki');
hold on
hold off
% PART ------------------------------------------>DISPLAY PART
xlabel('Kp'); ylabel('Ki');
title(' PLOT of Kp Vs Ki w- 0 to 10.8')
Page | 53
Step 2: The M-file j1_final2.m is run in the editor window. A plot is obtained between
K
p
Vs K
i
for a specified range of w. The plot is checked for the point of
intersection.
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.5
1
1.5
2
2.5
3
Kp
K
i
PLOT of Kp Vs Ki Am=3 and Phi = 50
data1
data2
Fig 4.4
Step 3: The point of intersection of the locus in the plot of K
p
Vs K
i
is located using a
command ginput(1) in the MATLAB command window. The window below shows the
same:
MATLAB Command Window:
>> ginput(1)
ans =
0.9405 1.2666
Page | 54
Step 4: The value obtained in step-3 gives the values of K
p
and K
i
respectively for the
specified parameters. This value is put in the function exp2 written in M-file exp2.m.
To obtain the system transfer function i.e. G
o
(s)= Gc(s)*Gp(s).
MATLAB Code:-
function tf = exp2(Kp,Ki)
syms s
tf1=(s^4+13*s^3+60*s^2+48*s);
vpa(tf1,4);
tf=(s^3*Kp+s^2*(Ki-12*Kp)+s*(48*Kp-12*Ki)+48*Ki)/(tf1);
OUTPUT:-
>> exp2( 0.9405,1.2666)
ans =
(1881/2000*s^3-50097/5000*s^2+37431/1250*s+37998/625)/(s^4+13*s^3+60*s^2+48*s)
>> vpa(ans,4)
ans =
(.9405*s^3-10.02*s^2+29.94*s+60.80)/(s^4+13.*s^3+60.*s^2+48.*s)
Step 5: The system transfer function obtained in the step-4 is used to check for the actual G.M.
and P.M. using the Matlab function sisotool(sys). The code is given below,
MATLAB Code:
>> num=[0.9405 -10.02 29.94 60.80]
num =
0.9405 -10.0200 29.9400 60.8000
>> den=[1 13 60 48 0]
den =
1 13 60 48 0
Page | 55
>> sys=tf(num,den)
Transfer function:
0.9405 s^3 - 10.02 s^2 + 29.94 s + 60.8
---------------------------------------
s^4 + 13 s^3 + 60 s^2 + 48 s
>> sisotool(sys)
OUTPUT:-
10
-2
10
-1
10
0
10
1
10
2
-90
-45
0
45
90
135
180
225
270
P.M.: 50 deg
Freq: 1.1 rad/sec
Frequency (rad/sec)
P
h
a
s
e
(
d
e
g
)
-40
-30
-20
-10
0
10
20
30
40
G.M.: 9.6 dB
Freq: 2.96 rad/sec
Stable loop
Open-Loop Bode Editor for Open Loop 1 (OL1)
M
a
g
n
i
t
u
d
e
(
d
B
)
-15 -10 -5 0 5 10
-5
-4
-3
-2
-1
0
1
2
3
4
5
Real Axis
I
m
a
g
A
x
i
s
Root Locus Editor for Open Loop 1 (OL1)
Step 6: Actual values of G.M and P.M. are tabulated using the symbol *(asterisk) as a
superscript. All the data obtained above are also tabulated.
Step 7: The value of ISE error for the given specification can be obtained using SIMULINK.
Using it a model is designed to display the values of :
- ISE Error
- IAE Error
- Output of the PROCESS.
The above values are calculated with step input and step load disturbance .
Page | 56
4.2.6 Simulink Model:-
Transport
Delay
To Workspace
out
Subtract
Step
SQUARE
u
2
PID Controller
PID
OUTPUT
Integrator 2
1
s
Integrator 1
1
s
ISE Error
0.683
IAE Error
1.255
Absolute
|u|
Transfer Function
1
s+1
Disturbance
Fig 4.5
OUTPUT:-
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
OUTPUT Vs TIME (Am=3:Phi=50)
Time
P
r
o
c
e
s
s
O
u
t
p
u
t
Page | 57
4.2.7 Project Report:-
TABULATION 4.5:-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
2.0
(6.02db)
30
1.1811
2.1327
0.553
0.7483
29.6
6.05
35
1.3597
1.9716
0.689
0.6604
35.0
6.08
40
1.4790
1.7800
0.830
0.6329
40.0
6.08
45
1.5720
1.5762
0.997
0.6072
44.9
6.07
50
1.6512
1.3569
1.216
0.5906
49.8
6.05
55
1.7070
1.1376
1.500
0.5868
54.8
6.08
60
1.7602
0.9046
1.945
0.6199
59.8
6.09
65
1.8085
0.6447
2.800
0.6738
65.0
6.10
70
1.8540
0.3647
5.080
0.8241
70.0
6.11
Page | 58
TABULATION 4.6-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
3.0
(9.54db)
30
-
-
-
-
-
-
35
0.4875
1.3746
0.3546
0.5906
35.0
9.57
40
0.7418
1.4391
0.5150
0.7721
40.0
9.58
45
0.8600
1.3669
0.6290
0.7369
45.0
9.59
50
0.9404
1.2666
0.7424
0.6830
50.0
9.62
55
1.004
1.1574
0.8670
0.6874
55.1
9.58
60
1.0472
1.0472
1.0000
0.6714
60.0
9.61
65
1.0848
0.9398
1.1543
0.6745
65.0
9.61
70
1.1157
0.8363
1.3340
0.6876
70.0
9.61
Page | 59
TABULATION 4.7:-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In
degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
4.0
(12.04db)
30
-
-
-
-
-
-
35
-
-
-
-
-
-
40
-
-
-
-
-
-
45
0.4816
1.0836
0.4440
0.9034
45.0
12.1
50
0.6061
1.0563
0.5730
0.8184
50.0
12.1
55
0.6789
0.9871
0.6870
0.8000
55.0
12.1
60
0.7303
0.9075
0.8047
0.7907
60.0
12.1
65
0.7678
0.8223
0.9337
0.7957
65.0
12.1
70
0.7998
0.7458
1.0720
0.8074
70.0
12.1
Page | 60
TABULATION 4.8:-
o
G.M.
(gain margin)
In db.
P.M.
(phase margin)
In
degrees.
Kc
(Proportional
Constant )
Ki
( integral
constant )
Ti
(Ti = Kp / Ki)
ISE
Integral square error
*
(actual P.M)
In degrees.
o
*
(actual G.M)
In db.
5.0
(13.97db)
30
-
-
-
-
-
-
35
-
-
-
-
-
-
40
-
-
-
-
-
-
45
-
-
-
-
-
-
50
0.3579
0.8599
0.4160
1.0180
50.0
14.0
55
0.4792
0.8486
0.5640
0.9334
55.0
14.0
60
0.5421
0.7912
0.6850
0.59124
60.0
14.0
65
-
-
-
-
-
-
70
-
-
-
-
-
-
Page | 61
4.2.8 Graphs and Plots:-
NOTE: Here, Data 1 Phase margin; Data 2 Gain margin
PLOT:-
Corresponding Outputs:
PLOT:-
Corresponding Output:
Page | 62
PLOT:-
Corresponding Output:-
PLOT:-
Corresponding Output:-
Fig 4.7
Page | 63
RESULT OF THE ANALYSIS AND COMPARISION
Reliability:-
Method -2 is more reliable than Method 1. The result obtained in the Method 2 is
almost near to accurate with minimal error. Method 1 doesnt show desired result
for low values of Phase margin.
Computational Simplicity:-
We can easily tune PID controller using Method 1 given the T
i
range is correctly
chosen. Though there is some ambiguity in the results for some particular values of
gain and phase margin. Citing one of such examples is the parameters value when
gain margin is equal to 2 and phase margin is equal to 60. The tuning procedure may
get cumbersome if the T
i
is not correctly chosen.
Whereas method -1 though quite lengthy is easy to compile and the results obtained is
almost satisfactory. The fact that data is being taken from a plot make it more valid.
Performance:-
The performance of both the method could be compared on the basis of ISE
performance index value. The lower the values, better is the performance of the
particular method.
From the tabulation it is quite clear that Method-2 gives lower values of ISE
performance index values for most of the cases. This stands as a prove to the fact that
Method -2 performs better than the Method-1.
Scope of Application:-
Method-2 has a wide range of scope of application. Two factors given below support
the fact that this method is more flexible then the latter one.
Page | 64
- Its applicable to both lower order as well as higher orders of process transfer
function.
- It gives more robust design parameter for a non-minimum phase system with
uncertain delay time.
Method-1 has got some limitation. They are:
- They are applicable to process having L/T value within a particular range i.e.
0.1 - 1.0.
- They are specified for only FOPDT process system and doesnt hold good for
higher order of process system
Validity of the Procedure:-
Both the method described above is based on well-grounded established theory.
Method-1 is based on gain and phase margin specification as formulated by Astrom
and Hagglund in 1995. But as the process is based on numerical analysis, it is not
accurate. The fact that we are searching for the value of T
i
that gives the minimum
value on the L.H.S., we may not determine the exact value T
i
desired.
Method-2 is based on the work of Shenton and Shafiei (1994) on graphical technique
for calculating PID control parameters. The procedure is based on graphical approach,
thus its validity cant be questioned. This very fact helps to determine the exact value
of PID controller parameter i.e. value of K
p
and K
i
.
Page | 65
CONCLUSION AND FUTURE SCOPE
(Process Control Simulator)PCS327 may be used at high speed for oscilloscope
observation or at a low speed for meter or chart recorder observation, speed selection
being achieved by independent controls on the process and the Controller [6]. When
the controller is set for low speed use it is suitable for the application of three-term
control to the Feedback process trainer PT326.The equipment is fully compatible with
all Feedback signal sources and all results may be observed on any laboratory
oscilloscope with direct coupled horizontal and vertical amplifiers. Some additional
features of the equipment are :-
- Simulated Distance-velocity lag(transport lag)
- Self-contained power supplies
- Integrated-circuit reliability
- Student-proof design
The fact that since last four decades there has been innumerable paper published on
PID control design speak for itself the importance and demand of such controller in
present day modern industry scenario. Despite of a huge number of theoretical and
application papers on tuning techniques of PID controllers, this area still remains open
for further research. There is a great scope of research into this field of control
system. But what lacks is the comparative analysis between different tuning
techniques. This study would thus surely come handy to such need of comparative
analysis and also help in understanding the changing trends in the field of PID
controller design. Few of the recent trends in the field of PID control design are
optimal design through graphical approach and minimisation of error due to
approximation in numerical analysis technique.
Page | 66
BIBLIOGRAPHY
[1] Shenton, A.T., & Shafiei, Z., Relative stability for control system with adjustable
parameters, J. of guidance, Control and Dynamics 17(1994) 304-310.
[2] Xue Dingyu, Chen Yang Quan and Atherton P. Derek ,"Linear Feedback Control".
[3] Ogata Katsuhiko, Modern control Engineering, fourth edition, 2002.
[4] Kuo C. Benjamin, Automatic Control System, seventh edition, October 2000.
[5] Wikipedia.org
[6] Process Control Simultor PCS 327 Manual,Feedback Instruments.
[7] Ho, W. K., Hang C. C. & Cao L. S., Tuning of PID controllers based on gain and
phase margin specifications. Automatica, 31(3)(1995),497-502.
[8] Astrom, K. J., & Hagglund, T. Automatic tuning of simple regulators with specifications on
phase and amplitude margins. Automatica, 20(1984), 645-651
[9] Ziegler, J. G., & Nichols, N. B. Optimum settings for automatic controllers.
Transactions of the ASME, 64(1942), 759-768.
[10] Ho, W. K., Hang, C. C., Zhou, J. H., Self-tuning PID control of a plant with
under-damped response with specifications on gain and phase margins. IEEE
Transactions on Control Systems Technology, 5 (4) (1997), 446-452.
[11] Ho, W.K., Xu, W., PID tuning for unstable processes based on gain and phase-margin
specifications, IEE Proc. Control Theory and Appl. 145 (5) (1998) 392-396.
Page | 67
[12] ] Ho, W. K., Lim, K. W., & Xu, W., Optimal gain and phase margin tuning for
PID controllers. Automatica, 34(8) (1998), 1009-1014.
[13] Ho, W.K., Lim K.W. , Hang C.C. , Ni L.Y. , getting more phase margin and performance
out of PID controllers. Automatica, 35 (1999), 1579-1585.
[14] Huang J. Ying, Wang Yuan-Jay, Robust PID Controller Design for Non-minimum phase
time delay systems, ISA Transaction 40 (2001) 31-39.
[15] Kealy Tony and ODwyer Aidan, Analytical ISE Calculation and Optimum Control
System Design, Proceedings of the Irish Signals and Systems Conference, University of
Limerick, July 2003, pp. 418-423.
[16] Wen Tan, Jizhen Liu, Tongwen Chen, Horacio J.Marquez , Comparison of some well-
known PID tuning formulas, Computers and Chemical Engineering 30 (2006) 14161423.
[17] Araki M., Control Systems, Robotics, and Automation Vol. II - PID Control -, Kyoto
University, Japan.