
Registration Number: 180123717
save as ( fig , ’ Q1_G p_mar gin . png ’);
fig = fi gure (2) ;
step ( Gcl ) ; % step re spo nse to the closed - loop system
st epi nfo ( Gcl ) % system per form ance values
save as ( fig , ’ Q1_ Gp_s tep . png ’);
%% Design req uirem ents
PO = 10; % per cent age o vers hoot
zeta = log (100/ PO ) / sqrt ( pi ^2+ ( log (100/ PO ) ) ^2 ); % d amping ratio
PM_d = round (100* zeta ) +1; % d esi red PM
%% Obta inin g the gain K that meets the desired PM_d
K = 1 0 ^(8. 0 3/20 ) ; % the gain 8.03 obtain ed from the bode plot
Gp1 = K* Gp ; % new u ncomp ensat e d plant
fig = fi gure (11) ;
marg in ( Gp1 ) ;
save as ( fig , ’ Q1_Gp 1_K_ma r gin . png ’);
Step 2. The digital uncompensated plant G
z1
of G
p1
can be calculated using a zero-order
holder with a sampling time T
s
= 0.01.
G
z1
= 1.01 · 10
−3
z − 0.99
z
2
− 1.99z + 0.99
(7)
In Fig. 3 it can be seen that the continuous and discrete plant are almost similar. Also, the
settling time has been reduced but the steady state error is too big.
Figure 3: Step response of Gz1 and Gp1
The following Matlab scripts simulates the previous results.
%% Dig ita l unc o mpens ated s ystem with the new gain K
Ts = 0.01; % sampli ng time
Gz1 = c2d ( Gp1 , Ts , ’ zoh ’); % co nve rt the con tinu os time plant Gp2 to the
% discret e time domain with the zero order holder
Gp1_ cl = fe edback ( Gp1 ,1) ; % closed - loop system in conti nuos time
Gz1_ cl = fe edback ( Gz1 ,1) ; % closed - loop system in discrete time
fig = fi gure (3) ;
step ( Gp1_cl , Gz1_cl ) ; % step respo nse of both cont inu os and d isc ret e sy ste ms
save as ( fig , ’ Q1_G pz_K_ s tep . png ’);
st epi nfo ( Gz1_cl ) % system per forma nce v alues
Step 3. With the desired phase margin, the value of β can be calculated as follows,
P M
act
−P M
d
+ θ = arctan
β − 1
2
√
β
(8)
3