Professional Documents
Culture Documents
Semester: 5th
Session: 2020-24
Submitted To:
Dr. Imran Khan Yousufzai
Submitted By:
Sawera Akhtar
Muzzamil Sajjad
Roll No:
ELEN51F20R002
ELEN51F20R012
1
Voltage(volts)
0.5
0
0 2 4 6 8 10 12 14 16 18 20
Time(sec)
Simulink Model:
Applied Voltage:
Current:
Shaft Velocity:
Shaft Position:
Q4)Test the above (both in MATLAB and Simulink) i.e., find its open loop step and impulse
response? (This step should be mentioned with code and associated figures (step response and
impulse response both plotted vs time))
Code:
J = 3e-5;
B = 3.5e-6;
K = 0.0274;
R = 4;
L = 2.75e-6;
num = [K];
den = [L*B+R*J K*B+R*B 0];
G_open_loop = tf(num, den)
figure(1)
step(G_open_loop)
xlabel('\fontname{TIMES NEW ROMAN} Time(sec)','FontSize',13);
ylabel('\fontname{TIMES NEW ROMAN}Voltage (Volts)','FontSize',13);
title('\fontname{TIMES NEW ROMAN} Open Loop step Response ','FontSize',13)
xlim([0 20])
figure(2)
impulse(G_open_loop)
xlabel('\fontname{TIMES NEW ROMAN} Time(sec)','FontSize',13);
ylabel('\fontname{TIMES NEW ROMAN} Voltage (Volts)','FontSize',13);
title('\fontname{TIMES NEW ROMAN} Open Loop Impulse Response ','FontSize',13)
Simulink:
Step Response:
Output:
Impulse Response:
Output: