PRE_LAB_1
PRE_LAB_1
Deniz Erkan
Department of Electrical and Electronics Engineering, Bilkent University, 06800 Ankara, Turkey
2. Laboratory Content
1) Ke
Question 1:
Ke
Torque Formula: Kt
Mechanical Equations: Ke s2
θ’’ θ’’
1)
2)
θ’’ Kt θ
To determine the order of a transfer function we should
find the s’s power in the denominator. In our case s
Where θ(t) is the output function and υ(t) is the input prime is equal to 2. So this transfer function is second or-
function. der. In the question, it is asked to find first order approxi-
mation. To obtain first order transfer function L = 0 τ = 0.137 s
which will make .
H(s) = =
and
Yss = 98
Fig. 2: Original Velocity Plot
To find the gain we have to dive Yss value to magnitude
of the input value. In our case magnitude value of the in-
put is equal to 6.
K = 16.33
3. Conclusion
The main goal of this pre-lab is to het familiar with
MATLAB Simulink function using given data set. In the
first part, I suggest a way to calculate transfer function
with given input r(t) = 6 u(t). Then using the same logic,
I wrote the MATLAB part to compare the results of
transfer function and filter H(s).
APPENDIX
MATLAB Code
Fs = 10000; % 10 kHz
Ts = 1 / Fs;
numerator = 1;
denominator = [0.001, 1];
H = tf(numerator, denominator); %h(s)
syms s
syms x
filtered_velocity = filter(Hd.num{1}, Hd.den{1}, y);
filtered_velocity_Laplace = laplace(filtered_velocity, s);
L = laplace(6 * heaviside(x));
L1 = 1 / L;
figure(1)
plot(t,transfer_function);
title('Transfer Function T(s)');
xlabel('Time');
ylabel('Transfer Function');
figure(2)
plot(t, y);
title('Original Velocity Data');
xlabel('Time');
ylabel('Velocity');
figure(3)
plot(out.simout1);
title('Output via H(s) Filter');
figure(4)
plot(out.simout2);
title('Output via T(s)');
t_start = 2;
t_end = 10;
t_interval = (t >= t_start & t <= t_end);
yss = round(mean(y(t_interval)));
K = yss / 6;
time_constant = 0.05;
tau = y(501);