Lab Report 8
Lab Report 8
Lab Report 8
LAB # 08
Class BEE-5D
Lab Assessment
Objective:
• To find steady state errors and static error constants.
• Verify the results using MATLAB.
• Design controller system Gain to obtain specified characteristics.
Introduction:
Steady-state error is defined as the difference between the input and output of a
system in the limit as time goes to infinity (i.e. when the response has reached the steady
state). The steady-state error depends on the type of input (step, ramp, etc) as well as the
system type (0, I, or II).
The system type is defined as the number of pure integrators in a system. Steady state
error relates to system types as:
Input
System Error
Step Ramp Parabolic
Steady State Error
1/(1+Kp) 1/Kv 1/Ka
Formula
Type 0
Static Error Kp =
systems Kv = 0 Ka = 0
Constant constant
Error 1/(1+Kp) infinity infinity
Type 1
Error 0 1/Kv infinity
systems
Type 2
Error 0 0 1/Ka
systems
In-lab:
Task 1:
For the following systems find the static error constants, and then steady state
error for the following inputs:
i. r(t) = u(t), unit step
ii. r(t) = 20*t*u(t)
iii. r(t) = 5*t^2*u(t)
a)
clc
close all
clear all
s=tf('s')
G1 = (500*(s+2)*(s+5))/((s+8)*(s+10)*(s+12)); % part a
T = feedback(G1,1);
t= 0:0.1:10 ;
figure(1)
kp=dcgain(G1)
Estep= 1/(1+kp)
step (T,t,'--') % plotting step
title('step input part a')
ut= heaviside(t);
ramp= 20.*t.*ut ;
figure(2)
kv=dcgain(s.*G1)
Eramp= 1/kv
lsim(T,ramp,t,'--') % plotting ramp
title('ramp input part a')
parabola = 5.*(t.^2).*ut ;
figure(3)
ka=dcgain((s^2).*G1)
Eparabola= 1/ka
lsim(T,parabola,t,'--') % plotting parabola
title('parabola input part a')
b)
clc
close all
clear all
s=tf('s')
ut= heaviside(t) ;
ramp= 20.*t.*ut ;
figure(5)
kv=dcgain(s.*G2)
Eramp= 1/(kv)
lsim(T,ramp,t,'r') % plotting ramp
title('ramp input part b')
parabola = 5.*(t.^2).*ut ;
figure(6)
ka=dcgain((s^2).*G2)
Eparabola= 1/(ka)
lsim(T,parabola,t,'r') % plotting parabola
title('parabola input part b')
c)
s=tf('s')
G3= (500.*(s+2)*(s+5)*(s+6)*(s+7))/(s^2*(s+8)*(s+10)*(s+12));%part c
T=feedback(G3,1);
t= 0:0.1:10 ;
figure(7)
kp=dcgain(G3)
Estep= 1/(1+kp)
step (T,t,'green') % plotting step
title('step input part c')
t= 0:0.1:1 ;
ut= heaviside(t);
ramp= 20.*t.*ut ;
figure(8)
kv=dcgain(s.*G3)
Eramp= 1/kv
lsim(T,ramp,t,'green') % plotting ramp
title('ramp input part c')
parabola = 5.*(t.^2).*ut ;
figure(9)
ka=dcgain((s^2).*G3)
Eparabola= 1/ka
lsim(T,parabola,t,'green') % plotting parabola
title('parabola input part c')
Table of Errors
For the following systems (i) and (ii), do the following tasks:
a) Find the value of k for which system yields e(t=infinity)=10%, verify using MATLAB.
Is the system stable at that gain?
b) From the MATLAB estimate the value of k for which the system yields minimum
e(t=infinity) (system should stay stable)?
i.
s=tf('s')
ut= heaviside(t);
ramp= 20.*t.*ut
figure()
kv=dcgain(s.*G)
Eramp= 1/kv
lsim(T,ramp,t) % plotting ramp
parabola= 20.*(t.^2).*ut ;
figure()
ka=dcgain((s^2).*G)
Eparabola= 1/ka
lsim(T,parabola,t,'r') % plotting parabola
title('parabola input part c')
Comments: Increasing the ’k’ increases the overshoot and by decreasing the value of ‘k’
increases the steady state time and decreases the overshoot.
ii.
s=tf('s')
ut= heaviside(t);
ramp= 20.*t.*ut;
figure()
kv=dcgain(s.*G)
Eramp= 1/kv
lsim(T,ramp,t); % plotting ramp
parabola= 5.*(t.^2).*ut;
figure()
ka=dcgain((s^2).*G)
Eparabola= 1/ka
lsim(T,parabola,t,'green') % plotting parabola
title('parabola input part c')
Comments: Value of ‘k’ should be bigger than 189. As we increase the value of ‘k’, the
overshoot decreases.
Comments: In these tasks, same objective of predicting the system type is followed. (i)
represents the type 1 system whereas, (ii) represents no type.
Post Lab Tasks
Lab Task 3:
• Normal Input
num = [1];
denum = [1 1 0];
sys = tf(num,denum);
t = 0:0.1:10;
u = heaviside(t);
k = 70;
f = feedback(k*sys, 1, -1)
step(f,'r')
• Reference Input
k = 70;
num = k*[1];
denum = [1 1 0];
sys = tf(num,denum);
t = 0:0.1:10;
u = heaviside(t);
f = feedback(1, sys, -1)
step(f)
• Disturbance Input
k = 70;
num = [1];
denum = [1 1 0];
sys = tf(num,denum);
t = 0:0.1:10;
u = heaviside(t);
f = feedback(-sys, k, 1)
step(f)
• Reference + Disturbance Input
k = 70;
num1 = k*[1];
denum1 = [1 1 0];
sys1 = tf(num1,denum1);
t = 0:0.1:10;
u = heaviside(t);
f1 = feedback(1, sys1, -1)
num2 = [1];
denum2 = [1 1 0];
sys2 = tf(num2,denum2);
f2 = feedback(-sys2, k, 1)
lsim(f1,f2,u,t);
Comments: In this task, we are given with Simulink figure and we have to show response of
reference input, Disturbance input and as well as reference + disturbance input. And we figures
and matlab code shows their responses.
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performa /6
nce
Results /3
Critical /1
Analysis
Comments
In this lab, we learnt to find the system type manually and by observing the
graph. If the system is giving finite error on application of step at input,
then it is a type 0 system. If a system is giving finite error for ramp input,
then it is type 1 system and type 1 system will show zero error for step
input. If a system is giving finite error for parabolic input, then it is a type 2
system and a type 2 system will show zero error for step and ramp input.
In short, current type system will show zero error for all the lower types’
systems w.r.t that type. Error is, basically, the difference between input
and output. Furthermore, to improve error, relation between an unknown
variable and its effect on error was observed as well.
At last we have performed post lab in which we have learned another type
of response. We have found reference input, Disturbance input as well as
their sum.