Lab 4-2
Lab 4-2
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);
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);
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
num = 10;
den = [1.25 1];
sys = tf(num,den);
margin(sys)
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))
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)
desired_error = 0.02;
Kp_min = (1 / desired_error) - 1;
disp(['Minimum Kp for desired steady-state error: ', num2str(Kp_min)]);
Zo = 0.00001;
Po = 0.000001;
lag_controller = tf([Zo, 1], [Po, 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)
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