0% found this document useful (0 votes)
4 views14 pages

Lab Session 8 Atif

The lab report details the steady-state performance analysis of a control system, focusing on time response and the effect of gain. It includes MATLAB code for simulating system responses, calculating DC gain, and determining steady-state errors. The report also discusses dominant poles, zeros, and compares performance parameters between actual and approximated systems.

Uploaded by

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

Lab Session 8 Atif

The lab report details the steady-state performance analysis of a control system, focusing on time response and the effect of gain. It includes MATLAB code for simulating system responses, calculating DC gain, and determining steady-state errors. The report also discusses dominant poles, zeros, and compares performance parameters between actual and approximated systems.

Uploaded by

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

LAB REPORT

LINEAR CONTROL SYSTEM


Submitted by: ATIF KHAN (RP22-EE-434)

Submitted to: ENGR. RASMIA IRFAN


Lab Session # 08
Title of lab:

STEADY-STATE PERFORMANCE ANALYSIS OF


CONTROL SYSTEM
OBJECTIVES
 To explore the time response of the control system.
 To examine the effect of gain on the time response of the control system.

SECTION-1
Consider the unity feedback with the system:
10𝑠 + 20
𝐺(𝑠) =
𝑠 2 + 10𝑠
The triangular input can be observed using lsim function as follow:

Response of this system to the ramp:


numg=[10 20];
deng=[1 10 0];
sysg=tf(numg,deng);
sys=feedback(sysg,1);
t=[0:0.1:8.2];
v1=[0:0.1:2];
v2=[2:-0.1:-2];
v3=[-2:0.1:0];
u=[v1,v2,v3];
[y,T]=lsim(sys,u,t);
plot(T,y,t,u);
xlabel('Time(sec)');
ylabel('Amplitude');
grid on;

Sketch the output in the space provided


DC GAIN:
The steady state of the system, or simply the DC Gain of the system, is determined by evaluating the transfer
function of the system at zero frequency, i.e. the value of s in the transfer function must be zero. For example
if a closed loop system is characterized bu the transfer function:

The dc gain of the system is:

Thus, K is the dc gain of the system.


In MATLAB the dc gain of the system can be obtained by using the function dcgain(sys), where sys is the
transfer function of the system.
Consider the system below, plot the actual output of the open loop system due to the step input.
MATLAB Code:
num=[2 5];
den=[1 4 5 0];
sys=tf(num,den);
step(sys);
xlabel('TIme(sec)');
ylabel('Output');
grid on;
dcgain(sys)
s= stepinfo(sys);
steady_state_value = dcgain(sys);
steady_state_error = 1 - steady_state_value;
fprintf('Steady-State Error: %.2f\n', steady_state_error);

STEP RESPONSE:

DC GAIN:

STEADY STATE ERROR:


SIMULINK OUTPUT:

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:

STEADY STATE ERROR:

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

DOMINANT POLES AND SECOND ORDER EQUATIONS

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:

num = 62.5 * [1 2.5];


den = conv([1 6 25], [1 6.25]);

G = tf(num, den);

poles = pole(G);
zeros = zero(G);

disp('Poles of the system:');


disp(poles);
disp('Zeros of the system:');
disp(zeros);

figure;
[y, t] = step(G);
stepinfo_data = stepinfo(G);

overshoot = stepinfo_data.Overshoot;
settling_time = stepinfo_data.SettlingTime;

disp(['Overshoot: ', num2str(overshoot), '%']);


disp(['Settling Time: ', num2str(settling_time), ' seconds']);

% Plot step response


subplot(1,2,1); % Create subplot for step response
step(G);
title('Step Response of G(s)');
xlabel('Time (seconds)');
ylabel('Output');
grid on;

% Plot poles and zeros in the S-plane


subplot(1,2,2);
pzmap(G); % MATLAB built-in function to plot poles and zeros
title('Pole-Zero Plot of G(s)');
xlabel('Real Axis');
ylabel('Imaginary Axis');
grid on;

% Mark poles (x) and zeros (o) on the plot


hold on;
plot(real(poles), imag(poles), 'rx', 'MarkerSize', 10, 'LineWidth', 2); % Poles
as red X
plot(real(zeros), imag(zeros), 'go', 'MarkerSize', 10, 'LineWidth', 2); % Zeros
as green O
legend('Poles (X)', 'Zeros (O)');
hold off;

ZEROS AND POLES PLOT:


STEP RESPONSE:

OVERSHOOT AND SETTLING TIME:

As an approximation we neglect the 3rd pole and again find the response of the system.

MATLAB Code:

num = 62.5 * [1 2.5];


den = conv([1 6 25], [1 6.25]);

% Create the original transfer function


G_original = tf(num, den);

% Find original poles


poles_original = pole(G_original);
disp('Original Poles:');
disp(poles_original);

% Neglect the third pole (assumed to be the least significant one)


% Keeping only the quadratic denominator (dominant poles)
num_new = num; % Numerator remains the same
den_new = [1 6 25]; % Removed the (s + 6.25) term

% Create the new approximate transfer function


G_approx = tf(num_new, den_new);

% Find new poles and zeros


poles_new = pole(G_approx);
zeros_new = zero(G_approx);

% Display new poles and zeros


disp('Approximated System Poles:');
disp(poles_new);
disp('Approximated System Zeros:');
disp(zeros_new);

% Compute step response characteristics


figure;
[y, t] = step(G_approx); % Get step response data
stepinfo_data = stepinfo(G_approx); % Get system characteristics

% Extract overshoot and settling time


overshoot = stepinfo_data.Overshoot;
settling_time = stepinfo_data.SettlingTime;

% Display overshoot and settling time


disp(['Overshoot (Approx): ', num2str(overshoot), '%']);
disp(['Settling Time (Approx): ', num2str(settling_time), ' seconds']);

% Plot step response


subplot(1,2,1);
step(G_approx);
title('Step Response (Approximated System)');
xlabel('Time (seconds)');
ylabel('Output');
grid on;

% Plot poles and zeros in the S-plane


subplot(1,2,2);
pzmap(G_approx);
title('Pole-Zero Plot (Approximated System)');
xlabel('Real Axis');
ylabel('Imaginary Axis');
grid on;
% Mark poles (x) and zeros (o) on the plot
hold on;

plot(real(poles_new), imag(poles_new), 'rx', 'MarkerSize', 10, 'LineWidth', 2); % Poles as red X


plot(real(zeros_new), imag(zeros_new), 'go', 'MarkerSize', 10, 'LineWidth', 2); % Zeros as green O
legend('Poles (X)', 'Zeros (O)');
hold off;
OVERSHOOT AND SETTLING TIME:

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)

Approximated system (ignoring pole -50):


100
𝐺(𝑠) =
(𝑠 + 1)(𝑠 + 2)

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]);

% Create the original transfer function


G_original = tf(num, den);

% Find original poles


poles_original = pole(G_original);
disp('Original Poles:');
disp(poles_original);

% Neglect the third pole (assumed to be the least significant one)


% Keeping only the quadratic denominator (dominant poles)
num_new = num; % Numerator remains the same
den_new = conv([1 1],[1 2]); % Removed the (s + 6.25) term

% Create the new approximate transfer function


G_approx = tf(num_new, den_new);

% Find new poles and zeros


poles_new = pole(G_approx);
zeros_new = zero(G_approx);

% Display new poles and zeros


disp('Approximated System Poles:');
disp(poles_new);
disp('Approximated System Zeros:');
disp(zeros_new);
% Compute step response characteristics
figure;
[y, t] = step(G_approx); % Get step response data
stepinfo_data = stepinfo(G_approx); % Get system characteristics

% Extract overshoot and settling time of original system


stepinfo_data_O = stepinfo(G_original);
overshoot_O = stepinfo_data_O.Overshoot;
settling_time_O = stepinfo_data_O.SettlingTime;

% Get system characteristics


disp(['Overshoot (Original): ', num2str(overshoot_O), '%']);
disp(['Settling Time (Original): ', num2str(settling_time_O), ' seconds']);

% Extract overshoot and settling time of approx system


overshoot = stepinfo_data.Overshoot;
settling_time = stepinfo_data.SettlingTime;

% Display overshoot and settling time


disp(['Overshoot (Approx): ', num2str(overshoot), '%']);
disp(['Settling Time (Approx): ', num2str(settling_time), ' seconds']);
% Plot step response
subplot(1,2,1);
step(G_approx);
title('Step Response (Approximated System)');
xlabel('Time (seconds)');
ylabel('Output');
grid on;
% Plot poles and zeros in the S-plane
subplot(1,2,2);
pzmap(G_approx);
title('Pole-Zero Plot (Approximated System)');
xlabel('Real Axis');
ylabel('Imaginary Axis');
grid on;
% Mark poles (x) and zeros (o) on the plot
hold on;
plot(real(poles_new), imag(poles_new), 'rx', 'MarkerSize', 10, 'LineWidth', 2); % Poles as red X
plot(real(zeros_new), imag(zeros_new), 'go', 'MarkerSize', 10, 'LineWidth', 2); % Zeros as green O
legend('Poles (X)');
hold off;

POLES AND ZEROS:


STEP RESPONSE:

RESULT
The steady state performance analysis of control system has been successfully done.

You might also like