0% found this document useful (0 votes)
14 views12 pages

Experiment Name:: Analysis of Effect of Input Waveform, Loop Gain, and System Type Upon Steady-State Errors

lab
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)
14 views12 pages

Experiment Name:: Analysis of Effect of Input Waveform, Loop Gain, and System Type Upon Steady-State Errors

lab
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/ 12

Experiment name:

Analysis of Effect of Input Waveform, Loop Gain, and System Type upon Steady-State
Errors

Objective:
To verify the effect of the input waveform, loop gain, and system type upon steady-state
errors

Apparatus:
MATLAB software
Code:
clc;
clear all;
close all;
s=tf('s');
% System type
G1=((100*s^3+1500*s^2+6200*s+4800)/
(s^5+32*s^4+367*s^3+1776*s^2+3024*s)); %Type I System

ts1 = feedback(G1,1,-1);

% Input definition
t = 0:0.1:20;
R0=(t>=0); %Unit Step
R1=t; %Unit Ramp
R2=0.5.*t.*t; %Parabola

% For step input

y1 = lsim(ts1,R0,t); %Response of Type I system to Step input


e1=R0'-y1; %Error of Type I system to Step input

% For ramp input

yy1 = lsim(ts1,R1,t); %Response of Type I system to Ramp input


ee1=R1'-yy1; %Error of Type I system to Ramp input

% For parabolic input

yyy1 = lsim(ts1,R2,t); %Response of Type I system to Parabolic input


eee1=R2'-yyy1; %Error of Type I system to Parabolic input

figure(1)
subplot(311),plot(t,y1,'r',t,R0,'b',
t,e1 ,'k'),xlabel('Time(sec)'),ylabel('Amplitude'),ylim([0,1.5]),legend(
'Output','Input','Error'),title('Step response - type 1')
subplot(312),plot(t,yy1,'r',t,R1,'b', t,ee1 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Ramp
response - type 1')
subplot(313),plot(t,yyy1,'r',t,R2,'b', t,eee1,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Para
bolic response - type 1')
Output:

From the graph, we can also observe that,

• For a step input, the error is becoming close to zero, so we can count it as zero.
• For a ramp input, the error is approximately 0.63 (constant) along the time axis.
• for a parabolic input, the error is increasing continuously and it will become
infinity.

So, after observing these steady-state errors from the graph, we can confirm that it is a
type-1 system.
Code:
clc;
clear all;
close all;
s=tf('s');
% System type
G0=((100*s^3+1500*s^2+6200*s+4800)/(s^4+32*s^3+367*s^2+1776*s+3024));
%Type 0 System
G1=((100*s^3+1500*s^2+6200*s+4800)/
(s^5+32*s^4+367*s^3+1776*s^2+3024*s)); %Type I System
G2=((100*s^3+1500*s^2+6200*s+4800)/
(s*(s^5+32*s^4+367*s^3+1776*s^2+3024*s))); %Type II System
ts0 = feedback(G0,1,-1);
ts1 = feedback(G1,1,-1);
ts2 = feedback(G2,1,-1);

% Input definition
t = 0:0.1:20;
R0=(t>=0); %Unit Step

y0 = lsim(ts0,R0,t); %Response of Type 0 system to Step input


e0=R0'-y0; %Error of Type 0 system to Step input
y1 = lsim(ts1,R0,t); %Response of Type I system to Step input
e1=R0'-y1; %Error of Type I system to Step input
y2 = lsim(ts2,R0,t); %Response of Type II system to Step input
e2=R0'-y2; %Error of Type II system to Step input
figure(1)
subplot(311),plot(t,y0,'r',t,R0,'b',
t,e0 ,'k'),xlabel('Time(sec)'),ylabel('Amplitude'),ylim([0,1.5]),legend(
'Output','Input','Error'),title('Step response - type 0')
subplot(312),plot(t,y1,'r',t,R0,'b',
t,e1 ,'k'),xlabel('Time(sec)'),ylabel('Amplitude'),ylim([0,1.5]),legend(
'Output','Input','Error'),title('Step response - type 1')
subplot(313),plot(t,y2,'r',t,R0,'b',
t,e2 ,'k'),xlabel('Time(sec)'),ylabel('Amplitude'),ylim([0,1.5]),legend(
'Output','Input','Error'),title('Step response - type 2')
stepinfo(y0)
stepinfo(y1)
stepinfo(y2)

Output:
Step Info
 Type-0 system:
Rise Time: 0.5937
Settling Time: 22.4531
Settling Min: 0.6135
Settling Max: 0.8266
Overshoot: 34.7374
Undershoot: 1.8097e-14
Peak: 0.8266
Peak Time: 2
Steady-State Error: 0.3865

 Type-1 system:
Rise Time: 0.5937
Settling Time: 22.4531
Settling Min: 0.6135
Settling Max: 0.8266
Overshoot: 34.7374
Undershoot: 1.8097e-14
Peak: 0.8266
Peak Time: 2
Steady-State Error: ~0

 Type-2 system:
Rise Time: 0.5937
Settling Time: 22.4531
Settling Min: 0.6135
Settling Max: 0.8266
Overshoot: 34.7374
Undershoot: 1.8097e-14
Peak: 0.8266
Peak Time: 2
Steady-State Error: ~0

Code:
clear all;
close all;
s=tf('s');
% System type
G0=((100*s^3+1500*s^2+6200*s+4800)/(s^4+32*s^3+367*s^2+1776*s+3024));
%Type 0 System
G1=((100*s^3+1500*s^2+6200*s+4800)/
(s^5+32*s^4+367*s^3+1776*s^2+3024*s)); %Type I System
G2=((100*s^3+1500*s^2+6200*s+4800)/
(s*(s^5+32*s^4+367*s^3+1776*s^2+3024*s))); %Type II System
ts0 = feedback(G0,1,-1);
ts1 = feedback(G1,1,-1);
ts2 = feedback(G2,1,-1);

% Input definition
t = 0:0.1:20;
R1=t; %Unit Ramp

yy0 = lsim(ts0,R1,t); %Response of Type 0 system to Ramp input


ee0=R1'-yy0; %Error of Type 0 system to Ramp input
yy1 = lsim(ts1,R1,t); %Response of Type I system to Ramp input
ee1=R1'-yy1; %Error of Type I system to Ramp input
yy2 = lsim(ts2,R1,t); %Response of Type II system to Ramp input
ee2=R1'-yy2; %Error of Type II system to Ramp input
figure(2)
subplot(311),plot(t,yy0,'r',t,R1,'b', t,ee0 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Ramp
response - type 0')
subplot(312),plot(t,yy1,'r',t,R1,'b', t,ee1 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Ramp
response - type 1')
subplot(313),plot(t,yy2,'r',t,R1,'b', t,ee2 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Ramp
response - type 2')

Output:
• Type-0 system: Steady-State Error: ~∞
• Type-1 system: Steady-State Error: 0.63
• Type-2 system: Steady-State Error: ~0

Question :4
The system’s parabolic response for each of the three type is given below:

Code:
clear all;
close all;
s=tf('s');
% System type
G0=((100*s^3+1500*s^2+6200*s+4800)/(s^4+32*s^3+367*s^2+1776*s+3024));
%Type 0 System
G1=((100*s^3+1500*s^2+6200*s+4800)/
(s^5+32*s^4+367*s^3+1776*s^2+3024*s)); %Type I System
G2=((100*s^3+1500*s^2+6200*s+4800)/
(s*(s^5+32*s^4+367*s^3+1776*s^2+3024*s))); %Type II System
ts0 = feedback(G0,1,-1);
ts1 = feedback(G1,1,-1);
ts2 = feedback(G2,1,-1);

% Input definition
t = 0:0.1:20;
R2=0.5.*t.*t; %Parabola

% For parabolic input


yyy0 = lsim(ts0,R2,t); %Response of Type 0 system to Parabolic input
eee0=R2'-yyy0; %Error of Type 0 system to Parabolic input
yyy1 = lsim(ts1,R2,t); %Response of Type I system to Parabolic input
eee1=R2'-yyy1; %Error of Type I system to Parabolic input
yyy2 = lsim(ts2,R2,t); %Response of Type II system to Parabolic input
eee2=R2'-yyy2; %Error of Type II system to Parabolic input
figure(3)
subplot(311),plot(t,yyy0,'r',t,R2,'b',t,eee0 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Para
bolic response - type 0')
subplot(312),plot(t,yyy1,'r',t,R2,'b', t,eee1,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Para
bolic response - type 1')
subplot(313),plot(t,yyy2,'r',t,R2,'b',t,eee2 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),legend('Output','Input','Error'),title('Para
bolic response - type 2')

Output:
• Type-0 system: Steady-State Error: ~∞
• Type-1 system: Steady-State Error: ~∞
• Type-2 system: Steady-State Error: 0.63

Question: 5
We can find the theoretical values of steady state errors from the lab sheet of software
experiment 2:

The steady-state error in the ‘Type-0’ system


Measured Values from graphs -
Step Input - 0.3865
Ramp Input - ∞
Parabolic input - ∞
Theoretical Values –
Step Input - constant
Ramp Input - ∞
Parabolic input - ∞

The steady-state error in the ‘Type-1’ system


Measured Values from graphs -
Step Input - 0
Ramp Input – 0.63
Parabolic input - ∞
Theoretical Values –
Step Input - 0
Ramp Input - constant
Parabolic input - ∞

The steady-state error in the ‘Type-1’ system


Measured Values from graphs -
Step Input - 0
Ramp Input – 0
Parabolic input – 0.6292
Theoretical Values –
Step Input - 0
Ramp Input – 0
Parabolic input – constant

So, we can say the theoretical value of steady state error for each type of the system match
the value we obtained.

You might also like