Professional Documents
Culture Documents
University of Engineering & Technology Main Campus, Peshawar
University of Engineering & Technology Main Campus, Peshawar
LAB REPORT
[Subject: Control System]
Submitted by:
Rimsha Khan
Registration No:
17PWELE5059
Section: A
Submitted to:
Sir Babar Abbas
Department:
Electrical Power Engineering, University of engineering & technology
Peshawar, Main Campus.
LAB # 01
TITLE:
SOFTWARE:
MATLAB
MATLAB CODE:
TITLE:
MATLAB Codes and Plots for Step and Impulse Responses of Antenna Azimuth
System Using Transfer Function
SOFTWARE:
MATLAB
MATLAB CODE:
clc
clear all
close all
% Task no: 1
% part a: ploynomial decalration and multiplication
P1=[5 7 -9 0 2]
P2= [ 1 -3 6 2 1]
P3=conv(P1,P2)
% part b: when polynomail is given in factor form then
s=tf('s');
F=((s+2)*(s+5)*(s+6))
P4=poly([-2 -5 -6])
% part c : finding roots of a polynomial #
roots(P4)
% TASK NO 2: Partial fraction expansion in Matlab:
s=tf('s');
G=(s^2+2*s+3)/((s+1)^3)
num=[ 0 1 2 3]
den=[ 1 3 3 1]
[r p k]=residue(num,den)
% TASK NO 3: find root locus plot and bode plot using transfer function
s=tf('s')
G=(s^2-4*s+20)/((s+2)*(s+4))
num=[1 -4 20];
den=poly([-2 -4]);
figure(1)
step(num,den)
sys=tf(num,den)
figure(2)
rlocus(sys)
figure(3)
bode(sys)
% TASK NO 3:
% ( Part b) :
% Step and impulse response using transfer function
s=tf('s')
G=(s^2-4*s+20)/((s+2)*(s+4))
num=[0.2083]
den=[1 1.71 0]
% Task no 4:
% Impulse response of load and motor of antenna
% azimuth system using transfer function:
num=[0 0.2083];
den=[1 1.71 0]
syst1=tf(num,den)
impulse(syst1)
xlabel('time')
ylabel('y(t)')
title('Step impulse by transfer function')
grid on;
RESULT:
LAB 7
TITLE:
SOFTWARE:
MATLAB
MATLAB CODE:
clc
clear all
close all
A=[-101.71 -100;1 0];
B=[1 0]';
C=[0 20.83];
D=[0];
syst=ss(A,B,C,D)
figure(1)
step(syst)
xlabel('time')
ylabel('y(t)')
title('Step response by state space')
grid on
figure(2)
impulse(syst)
xlabel('time')
ylabel('y(t)')
title('Impulse response by SS')
grid on
t=0:0.05:10
A=[-1 -1;6.5 0];
B=[1 1;0 1];
C=[1 0;0 1];
D=[0];
figure(3)
step(A,B,C,D)
xlabel('time')
ylabel('y(t)')
title('Step response by SS')
grid on
t=0:0.05:10
A=[0 1 0;0 0 1;-10 -17 -8];
B=[0 0 0]';
C=[1 0 0];
D=[0];
y=initial(A,B,C,D,[2;1;0.5],t)
plot(t,y)
xlabel('time')
ylabel('y(t)')
title('Step response by state space')
grid on
figure(2)
impulse(syst)
xlabel('time')
ylabel('y(t)')
title('Impulse response by SS')
[num,den]=ss2tf([-101.71 -100;1 0],[1 0]',[0 20.83],0)
RESULT:
LAB 9
TITLE:
(A)To Obtain The Step Response For Transfer Function And State Space System In
Simulink
SOFTWARE:
MATLAB
Lab task A:
Overdamp system
Critically damp system
Underdamp system:
Undamped system:
Comparison:
, ,
Lead compensator:
Lag compensator: