You are on page 1of 10

Assignment #1

Linear Control System


Topic: Control Analysis

Semester: 5th
Session: 2020-24
Submitted To:
Dr. Imran Khan Yousufzai
Submitted By:
Sawera Akhtar
Muzzamil Sajjad
Roll No:
ELEN51F20R002
ELEN51F20R012

Department of Electrical Engineering


College of Engineering & Technology
University of Sargodha
Q2) Validate the simulation diagram using Simulink. Use the
input signal as given in Fig. 1? (This step should be mentioned
with code/Simulink diagram) and supporting figures (shaft
position, shaft velocity, armature current and applied voltage). )
Ans:
Ramp function:
function [x]=rampp(lim1,lim2,N,t_shift)
t=lim1:1/N:lim2;
x = zeros(size(t));
x=((t-t_shift).*(t>=t_shift));
end
Code:
t=0:1:20;
[V]=0.1*(rampp(0,20,1,0)-rampp(0,20,1,-(-10)));
plot(t,V,'linewidth',2)
grid on;
axis([0 20 0 1.5]);
xlabel('\fontname{times New Roman} Time(sec)','FontSize',13);
ylabel('\fontname{times New Roman} Voltage(volts)','FontSize',13);
title('\fontname{times New Roman} Applied Voltage');
Applied Voltage
1.5

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:

You might also like