Analysis of Discrete Root Locus and PID Controller Design

Verified

Added on Β 2022/12/26

|19
|3285
|62
Project
AI Summary
This project delves into the analysis and design of control systems using discrete root locus and PID controllers. The student begins by discretizing a continuous-time system, deriving the closed-loop transfer function in discrete form using the zero-order hold (ZOH) method and a sampling period of 0.01 seconds. Root locus analysis is then performed on both the continuous and discrete systems, with the student investigating the impact of gain variations on system stability and step response characteristics. The project explores the effects of different sampling frequencies on the discrete system's behavior, including the relationship between sampling rate and gain bandwidth. Finally, the student designs a discrete PID compensator using the Tustin method, implemented in Matlab Simulink, and analyzes its impact on the closed-loop system's performance, comparing the compensated and uncompensated systems in terms of root locus plots and step responses. The analysis includes detailed discussions on system stability, steady-state error, and the influence of poles and zeros on the system's transient response.
Document Page
Discrete Root locus and PID controller 1
Student
Professor
Control System
Date
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Discrete Root locus and PID controller 2
a) Discretizing the system
Closed loop transfer function in discrete form using sampling period of 0.01 sec and β€˜ZOH’ method
clc
clear all
%----------------------------------------------
%---Continuous transfer function------------
s=tf('s');
A=1.8;
B=0.35;
%------Transfer function of the valve model-------
Gv=1/(s+4);
%-----Transfer function of the chemical heating model
Gm=1/(s^2+A*s+B);
%------Open loop tranafer function of the system
fprintf('The open loop continuous transfer function\n')
G=Gv*Gm
%--Closedloop transfer function of the system
fprintf('The closed loop continuous transfer function\n')
G_cl=feedback(G,1)
%poles/zeros of the closed loop continuous transfer function
fprintf('poles and zeros of the closed loop of G_cl\n')
[p,z]=pzmap(G_cl)
%---Discrete closed loop transfer function of the system
z=tf('z');
%---Sampling time
Ts=0.01;
%----Closed loop discrete tranfer function
fprintf('The closed loop discrete transfer function\n')
G_cl_z=c2d(G_cl,Ts,'zoh')
%----Poles and zeros of discrete transfer function
fprintf('poles and zeros of the closed loop of G_cl_z\n')
[p,z]=pzmap(G_cl_z)
%----------------------------END---------------
The open loop transfer function of the system is
𝐺 = 1
𝑠3+5.8𝑠2+7.5𝑠+1.4
Closed loop continuous transfer function is
Document Page
Discrete Root locus and PID controller 3
𝐺𝑐𝑙(𝑠) = 1
𝑠3+5.8𝑠2+7.5𝑠+2.4
Poles and zeros of 𝐺𝑐𝑙(𝑠)
Poles (βˆ’4.1021, βˆ’1.2172, βˆ’0.4806)
No zeros
Closed loop discrete transfer function is
𝐺𝑐𝑙(𝑧) = (1.643𝑧2+6.476𝑧+1.596)Γ—10βˆ’7
𝑧3βˆ’2.943𝑧2+2.887π‘§βˆ’0.9436
Poles and zeros of 𝐺𝑐𝑙(𝑧)
Poles (0.9952,0.9879, 0.9598)
Zeros (βˆ’3.6784, βˆ’0.2641)
b) Performing root locus analysis on the continuous system and discrete system.
%----START OF THE CODE-----------------
clc
clear all
%----------------------------------------------
%---Continuous transfer function------------
s=tf('s');
A=1.8;
B=0.35;
%------Transfer function of the valve model-------
Gv=1/(s+4);
%-----Transfer function of the chemical heating model
Gm=1/(s^2+A*s+B);
%------Open loop tranafer function of the system
fprintf('Minimum and maximum gain\n');
K1=0.05 %Minimum gain
K2=41.9 % Maximum gain
%--Closedloop transfer function of the system with minimum gain
fprintf('Closed loop rlocus with K=0.05 \n')
G1=feedback( K1*Gv*Gm,1);
figure,rlocus(G1)
title('RLOCUS OF THE CONTINUOUS CLOSED LOOP SYSTEM WITH
K=0.05')
grid on
[p,z]=pzmap(G1)
fprintf('Step response with K=0.05 \n')
Document Page
Discrete Root locus and PID controller 4
step(G1)
title('STEP RESPONSE WITH K=0.05')
stepinfo(G1)
%--------------------------------------------------------
%--cLOSED LOOP SYSTEM WITH k=41.9
%---------------------------------------------------------
fprintf('Closed loop rlocus with K=41.9 \n')
G2=feedback( K2*Gv*Gm,1);
figure,rlocus(G2)
title('RLOCUS OF THE CONTINUOUS CLOSED LOOP SYSTEM WITH
K=41.6')
grid on
[p,z]=pzmap(G2)
fprintf('Step response with K=41.9 \n')
step(G2)
title('STEP RESPONSE WITH K=41.9')
stepinfo(G2)
%----------END OF THE CODE-----------------
Fig 1: Rlocus of the continuous closed loop system with K=41.9
The root locus of the continuous system has poles and zeros located at;
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Discrete Root locus and PID controller 5
π‘ƒπ‘œπ‘™π‘’π‘ (𝑛) = {βˆ’4.1021, βˆ’1.2172, βˆ’0.4806}
There are no zeros , π‘π‘’π‘Ÿπ‘œπ‘ (𝑛) = π‘›π‘œπ‘›π‘’
The total number of asymptotes from the diagram above is 3.
𝐴 = 3
Theoretically, total number of asymptotes is calculated using total number of poles and zeros as
shown in the formula below.
𝐴 = 𝑛 βˆ’ π‘š β†’ 3 βˆ’ 0 = 3
Angles of asymptotes are
π‘ž0 = 60
π‘ž1 = 300
π‘ž2 = 180
Centroid of asymptotes from the plot is approximately
πΆπ‘’π‘›π‘‘π‘Ÿπ‘œπ‘–π‘‘ β‰ˆ βˆ’2
Theoretically, centroid is calculated as
πΆπ‘’π‘›π‘‘π‘Ÿπ‘œπ‘–π‘‘ =
βˆ‘π‘›βˆ’βˆ‘π‘š
π‘›βˆ’π‘š = (βˆ’4.1021βˆ’1.2172βˆ’0.4806)
3 = βˆ’1.933
For stability with varying gain, the minimum and maximum value of gain (K) is as shown from
the figure below.
Document Page
Discrete Root locus and PID controller 6
Fig 2: Rlocus of the continuous closed loop system with k=0.05
From fig 2, it can be deduced that the minimum value of gain K should be greater than zero.
𝐾 > 0
When 𝐾 = 0.05, then poles and zeros of the closed loop continuous system are located at
π‘ƒπ‘œπ‘™π‘’π‘ (𝑛) = {βˆ’4.0054, βˆ’1.5626, βˆ’0.2316}
There are no zeros , π‘π‘’π‘Ÿπ‘œπ‘ (𝑛) = π‘›π‘œπ‘›π‘’
The closed loop system has real poles located to the LHP(Left Hand Plane). This denotes that
stability of the system is stable. On addition, step response of the closed loop system is non-
oscillatory since all poles are real. The step response of the system with K=0.05 is as shown
below.
Document Page
Discrete Root locus and PID controller 7
Fig 3: Step response of the continuous closed loop system with K=0.05
However, steady state error of the system to step response is so large since the system
stabilizes at 0.035.
𝑠𝑠 =1βˆ’0.035
1 Γ— 100% = 96.5%
Where 𝑠𝑠 𝑖𝑠 π‘‘β„Žπ‘’ π‘ π‘‘π‘’π‘Žπ‘‘π‘¦ π‘ π‘‘π‘Žπ‘‘π‘’ π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ.
The maximum gain K was determined by shifting position of the pole along the asymptote 600
as shown in fig 1. The maximum gain was approximately found to be;
𝐾 = 41.9
The closed loop root locus of the continuous transfer function with estimated maximum value
of K=41.9 is as shown in the figure below.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Discrete Root locus and PID controller 8
Fig 4: Rlocus of the continuous closed loop system with K=41.9
The system has poles and zeros located at;
π‘ƒπ‘œπ‘™π‘’π‘ (𝑛) = {
βˆ’5.7881
βˆ’0.006 βˆ’ 𝑗2.7351
βˆ’0.006 + 𝑗2.7351
There are no zeros , π‘π‘’π‘Ÿπ‘œπ‘ (𝑛) = π‘›π‘œπ‘›π‘’
Existence of complex poles introduces oscillatory transient response that stabilizes after some
time. The step response of the system at maximum gain is as shown below.
Document Page
Discrete Root locus and PID controller 9
Fig 5: Step response of the continuous closed loop system with K=41.9
The system, as previously described, oscillates with percentage overshoot greater than 100%.
However, with higher gain, the steady state error has been tremendously reduced to zero.
Therefore, low gain reduces percentage overshoot but increases the steady state error while
higher gain reduces steady state error but introduced oscillations in the step response.
The closed loop transfer function was discretized using β€˜Zero Order Hold’ (ZOH) method at
various sampling time represented by (10𝐻𝑧, 100𝐻𝑧 π‘Žπ‘›π‘‘ 500𝐻𝑧) respectively as in the
Matlab script below.
%------START OF THE CODE--------------
clc
clear all
%----------------------------------------------
%---Continuous transfer function------------
s=tf('s');
A=1.8;
B=0.35;
%------Transfer function of the valve model-------
Gv=1/(s+4);
%-----Transfer function of the chemical heating model
Gm=1/(s^2+A*s+B);
%--Closedloop transfer function of the system with minimum gain
fprintf('Closed loop transfer function\n')
Document Page
Discrete Root locus and PID controller 10
Gs=feedback(Gv*Gm,1);
%---Discrete closed loop transfer function of the system
z=tf('z');
%---Sampling times conversted from frequencies----
Ts1=1/10; % 10Hz
Ts2=1/100; %100Hz
Ts3=1/500; %500Hz
%----Closed loop discrete tranfer function--------
fprintf('The closed loop discrete transfer functions\n');
%----Transfer at 10Hz-----------------------------
Gz1=c2d(Gs,Ts1,'zoh')
figure,rlocus(Gz1)
title('RLOCUS AT T=10Hz')
[p,z]=pzmap(Gz1)
%----Transfer at 100Hz-----------------------------
Gz2=c2d(Gs,Ts2,'zoh')
figure,rlocus(Gz2)
title('RLOCUS AT T=100Hz')
[p,z]=pzmap(Gz2)
%----Transfer at 500Hz-----------------------------
Gz3=c2d(Gs,Ts3,'zoh')
figure,rlocus(Gz3)
title('RLOCUS AT T=500Hz')
[p,z]=pzmap(Gz3)
%------------END------------------
The results obtained when the above code was executed are;
At sampling time of 10Hz
The discrete closed loop transfer function of the system is as shown below.
𝐺𝑧1 = 0.0001445𝑧2+0.0005014𝑧+0.0001082
𝑧3βˆ’2.502𝑧2+2.064π‘§βˆ’0.5599
The root locus of the system is as shown below.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Discrete Root locus and PID controller 11
Fig 7: Rlocus of discrete closed loop system with 10Hz sampling frequency.
Poles and zeros of the discrete system are;
π‘ƒπ‘œπ‘™π‘’π‘ (𝑛) = {
0.9531
0.8854
0.6635
π‘π‘’π‘Ÿπ‘œπ‘ (π‘š) = {βˆ’3.2379
βˆ’0.2311
At sampling time of 100Hz
The discrete closed loop transfer function of the system is as shown below.
𝐺𝑧1 = (1.643𝑧2+6.476𝑧+1.596)Γ—10βˆ’7
𝑧3βˆ’2.943𝑧2+2.887π‘§βˆ’0.9436
The root locus of the system is as shown below.
Document Page
Discrete Root locus and PID controller 12
Fig 8: Rlocus of discrete closed loop system with 100Hz sampling frequency.
Poles and zeros of the discrete system are;
π‘ƒπ‘œπ‘™π‘’π‘ (𝑛) = {
0.9952
0.9879
0.9598
π‘π‘’π‘Ÿπ‘œπ‘ (π‘š) = {βˆ’3.6784
βˆ’0.2641
At sampling time of 500Hz
The discrete closed loop transfer function of the system is as shown below.
𝐺𝑧1 = (1.329𝑧2+5.303𝑧+1.322)Γ—10βˆ’9
𝑧3βˆ’2.988𝑧2+2.977π‘§βˆ’0.9886
The root locus of the system is as shown below.
chevron_up_icon
1 out of 19
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]