Lab Session 8 Atif
Lab Session 8 Atif
SECTION-1
Consider the unity feedback with the system:
10𝑠 + 20
𝐺(𝑠) =
𝑠 2 + 10𝑠
The triangular input can be observed using lsim function as follow:
STEP RESPONSE:
DC GAIN:
Now construct the unity feedback system as the plant as shown below. Plot the actual output of the closed
loop system due to the step input.
MATLAB Code:
num=[2 5];
den=[1 4 5 0];
sys=tf(num,den);
G=feedback(sys,1)
step(G);
xlabel('TIme(sec)');
ylabel('Output');
grid on;
dcgain(G)
s= stepinfo(G);
steady_state_value = dcgain(G);
steady_state_error = 1 - steady_state_value;
fprintf('Steady-State Error: %.2f\n', steady_state_error);
STEP RESPONSE:
DC GAIN:
SIMULINK OUTPUT:
For a unity feedback system as shown below, the error function is determined by the equation and can
directly be found by the MATLAB.
To be able to determined the error function in MATLAB, we need first need to determined the vector
containing the input signal r(t), and the vector containing the actual output y(t). the next step is subtract r(t) to
y(t) to obtain the error function. MATLAB code below is an example that determines and plots the error of the
system as the function of time, from an input unit step function. The system is defined by the following model:
2𝑠 + 3
𝐺(𝑠) =
𝑠2 + 3𝑠 + 6
MATAB Code:
numg=[2 3];
deng=[1 3 6];
sysg=tf(numg,deng);
syst=feedback(sysg,1);
[out,t]=step(syst);
ref=ones(1,length(t));
err=ref-out;
plot(t,err);
grid on;
xlabel('Time(sec)');
ylabel('Output');
ERROR OUTPUT:
SECTION-2
Both zeros and poles affect the system response, but the dominant poles are the ones wjo have significant
amount of the impact on system response.
For the following transfer function:
62.5(𝑠 + 2.5)
𝐺(𝑠) =
(𝑠 2 + 6𝑠 + 25)(𝑠 + 6.25)
MATLB Code:
G = tf(num, den);
poles = pole(G);
zeros = zero(G);
figure;
[y, t] = step(G);
stepinfo_data = stepinfo(G);
overshoot = stepinfo_data.Overshoot;
settling_time = stepinfo_data.SettlingTime;
As an approximation we neglect the 3rd pole and again find the response of the system.
MATLAB Code:
Similarly for the following system, using second order approximation, compare the performance parameters
of the actual and approximated system.
Actual system :
100
𝐺(𝑠) =
(𝑠 + 1)(𝑠 + 2)(𝑠 + 50)
What is the change in the performance parameters that has been observed after ignoring the 3 rd pole?
MATLAB Code:
num = [100];
den1 = conv([1 1],[1 2]);
den = conv(den1,[1 50]);
RESULT
The steady state performance analysis of control system has been successfully done.