0% found this document useful (0 votes)
16 views8 pages

Lab 4-2

Uploaded by

u2108026
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views8 pages

Lab 4-2

Uploaded by

u2108026
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Bode plot analysis:

A Bode plot is the representation of the magnitude and phase of G(j*w) (where the frequency vector w
contains only positive frequencies).

num = 50;
den = [1 9 30 40];

% num = 16;
% den = [1 8 16];

%num = 16;
%den = [1 2 16];

sys = tf (num,den);

step(sys);

bode(sys);

Gain Margin & Phase Margin


The gain margin is defined as the change in open loop gain required making the system unstable. Systems
with greater gain margins can withstand greater changes in system parameters before becoming unstable in
closed loop.Unity gain in magnitude is equal to a gain of zero in dB.
The phase margin is defined as the change in open loop phase shift required making a closed loop system
unstable. The phase margin also measures the system's tolerance to time delay.
The point where 0 dB line and magnitude curb intersects each other in Magnitude diagram is called
, if a perpendicular line to 0 dB line is taken which goes through , and
intersects phase curb and -180 degree line in Phase diagram , then difference between those two
intersecting point is Phase Margin.
The point where -180 degree line and phase curb intersects each other in phase diagram is called
, if a perpendicular line to -180 degree line is taken which goes through
, and intersects magnitude curb and 0 dB line in magnitude diagram , then difference between those
two intersecting point is Gain Margin.
margin(sys)

This system is stable as gain and phase margin is positive, so, system will be stable if >
Now if gain = 100 is added
margin(100*sys);

Gain and phase margin both become negative. So system will be unstable if <
Bandwidth Frequency
The bandwidth frequency is defined as the frequency at which the closed-loop magnitude response is equal
to -3 dB.
num = 1;
den = [1 0.5 1];

sys = tf(num,den);
step(sys);
margin(sys);

From the bode plot, BW frequency is 1.48 rad/s for -3dB.


Let’s change the frequency
w = -3 w = 0.5

w = 1.4 w=3

Here, it can be seen if the frequency is too less or too more than BW frequency phase difference between
input and output signal become -180 degree means out of phase, resulting in unstable system.

Example -3

Design a controller for the system where G(s) =


The design must meet the following specifications:
• Steady state error = 0
• Maximum overshoot< 40%.
• Settling time < 2 secs.

num = 10;
den = [1.25 1];
sys = tf(num,den);
margin(sys)

Here at -3 dB the the frequency = 11.27 rad/s


For first order system,
w = -3 w = 0.5
BW frequency = Natural frequency, = 11.27 rad/s

So, Rise Time,


Here, Phase margin = , damping ratio = PM/100 , is only applicable for PM < 100
There will be no overshoot as it is a first order system.

sys_cl = feedback(sys,1);
step(sys_cl)

Here, it can be seen the step response came out as the prediction made from the bode plot
But the steady state error is almost 9%. To fix this , Gc(s) , a PI controller can be used.

Placing zero at 1 (a =1) to increase phase margin and adding gain of 5 to have a higher BW frequency
num = 10;
den = [1.25 1];
plant = tf(num,den);
numPI = 5*[1 1];
denPI = [1 0];
contr = tf(numPI,denPI);
margin(contr * plant, logspace(0,2))

sys_cl = feedback(contr * plant,1);


step(sys_cl)
Now, the steady state error is mitigated and all the design criteria are met.
Home Task - 2
The open-loop transfer function for this problem is:

Where,
 m=1000
 b=50
 U(s)=10
 Y(s)=velocity output
The design criteria are:
 Rise time < 5 sec
 Overshoot < 10%
 Steady state error < 2%
1. Find out the open-loop response and using a proportional controller find out the rise time, damping
ratio and steady-state error.
m=1000;
b=50;
u=10;
num=[1];
den=[m b];
cruise=tf(num,den);
step(cruise);
title("open loop response")
Kp = 500;
num_cl = Kp ;
den_cl = [m b+Kp];
cruise_cl = tf(num_cl,den_cl );
step(cruise_cl);

stepinfo(cruise_cl)

ans = struct with fields:


RiseTime: 3.9946
TransientTime: 7.1129
SettlingTime: 7.1129
SettlingMin: 0.8223
SettlingMax: 0.9085
Overshoot: 0
Undershoot: 0
Peak: 0.9085
PeakTime: 13.3131

desired_error = 0.02;
Kp_min = (1 / desired_error) - 1;
disp(['Minimum Kp for desired steady-state error: ', num2str(Kp_min)]);

Minimum Kp for desired steady-state error: 49

When Kp is very high:


 Rise time decreases, which improves system response speed.
 Overshoot might increase, potentially violating design criteria.
 The system could become less stable.

Zo = 0.00001;
Po = 0.000001;
lag_controller = tf([Zo, 1], [Po, 1]);

lag_compensated_tf = series(lag_controller, tf(Kp, [m, b + Kp]));


final_closed_loop_tf = feedback(lag_compensated_tf,1);

step(final_closed_loop_tf);
axis ([0 20 0 1.2])
title('Closed-loop Step Response with Lag Controller');
grid on;

stepinfo(final_closed_loop_tf)

ans = struct with fields:


RiseTime: 2.0924
TransientTime: 3.7258
SettlingTime: 3.7258
SettlingMin: 0.4286
SettlingMax: 0.4759
Overshoot: 0
Undershoot: 0
Peak: 0.4759
PeakTime: 6.9736

Discussion:
1. The Root-Locus Modeling experiment demonstrated the relationship between system stability,
transient response, and pole positions in the s-plane. Varying the gain provided insights into these
dynamics, but achieving optimal performance required additional fine-tuning.
2. Practical adjustments during the Root-Locus experiment revealed challenges in balancing stability
and transient response, emphasizing the need for iterative tuning to refine system behavior.
3. The Bode Plot Analysis experiment effectively showcased frequency-domain characteristics, such
as gain and phase margins. However, achieving an ideal balance between phase lag for stability and
response speed remained a significant challenge.
4. In the Lag Controller experiment for cruise control, steady-state error requirements were not met,
underscoring the need for better parameter tuning and the exploration of advanced compensator
designs to meet performance objectives

You might also like