0% found this document useful (0 votes)
30 views14 pages

Lab 2 Report

This document summarizes an electrical engineering student's laboratory experiment on identifying a DC motor's transfer function in the frequency domain. The student applied sinusoidal inputs at various frequencies to the motor and measured the outputs. Frequency response data was obtained and compared to the theoretical transfer function. A time delay was then included to better match the experimental results.

Uploaded by

Deniz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views14 pages

Lab 2 Report

This document summarizes an electrical engineering student's laboratory experiment on identifying a DC motor's transfer function in the frequency domain. The student applied sinusoidal inputs at various frequencies to the motor and measured the outputs. Frequency response data was obtained and compared to the theoretical transfer function. A time delay was then included to better match the experimental results.

Uploaded by

Deniz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

LAB-2 DC Motor in Frequency Domain

Deniz Erkan
Department of Electrical and Electronics Engineering, Bilkent University, 06800 Ankara, Turkey

1.Introduction

The main goal of this lab is to identify a physical DC motor in frequency domain by sinusoidal signals
such as in the preliminary work. This lab contains of 3 parts. In the first part, we generate the transfer
function found in the lab-1. In the second part, with sending sinusoidal inputs to hardware setting to DC
motor system and get the responses for each angular frequency. For the last past, Pade approximation
used for comparison of part-2 with given delayed transfer function.

2. Laboratory Content

Q1.

The transfer function of previous lab was

14.165
G ( s )=
0.137 s+1

With given code in the Q1 A is equal to 103.394 and B is equal to 7.299.

Fig.1: Bode plot of corresponding G(s) with given code

Q2.

In the second part we are asked to obtain the bode plot by applying sinusoidal input with certain angular
frequencies and duration times and compare them with theoretical calculations. The amplitudes of the
applied input signals were 0.1, 0.3, 1, 3, 10, 30 and 100 rad/sec with 70, 70, 25, 25, 10, 10 and 10s
duration time. In this report we are going to plot angular frequencies with 0.3, 3 and 30 rad/sec and plot
all the 7 data points with original bode plot.
Fig.2: Input sinusoidal signal (red) and DC motor response (blue) for angular frequency equal to 0.3 rad/s

Fig.3: Experimental and Theoretical Bode plot when angular frequency equal to 0.3 rad/s
Fig.4: Data point for theoretical points when angular frequency equal to 0.3 rad/s

Fig.5: Input sinusoidal signal (red) and DC motor response (blue) for angular frequency equal to 3 rad/s

Fig.6: Experimental and Theoretical Bode plot when angular frequency equal to 3 rad/s
Fig.7: Data point for theoretical points when angular frequency equal to 3 rad/s

Fig.8: Input sinusoidal signal (red) and DC motor response (blue) for angular frequency equal to 30 rad/s
Fig.9: Experimental and Theoretical Bode plot when angular frequency equal to 30 rad/s

Fig.10: Data point for theoretical points when angular frequency equal to 30 rad/s
Fig.11: Experimental and Theoretical Bode plot for angular frequency values 0.1, 0.3, 1, 3, 10, 30 and
100 rad/sec

As we look at the fig.11 the experimental and theoretical values are really close to each other. The
difference could be caused by the noise error during the measurements. The major error happened
when angular frequency at w = 100 rad/sec and w = 30 rad/sec. The major error happened due to delay
of 10 ms time delay.

Q3.

Since the system has a time time of 10 ms, Pade approximation used to generate Gdelayed(s) transfer
function. For the second part we obtained a single graph with three bode plots; original G(s) transfer
function in the first question, experimental and theoretical bode plot for 7 different angular frequencies
and Gdelayed(s) transfer function.
Fig.12: Bode plot for Gdelayed(s) transfer function

Fig.13: Fig.12 graph on top of fig.11

From fig.13 we can see that time delay does not affect the magnitude plot of the G delayed(s) transfer
function as we learned. On the other hand, time delay does affect the phase plot of the G delayed(s)
transfer function as we learned also. The pade approximation values are close to the delayed function
than the non-delay transfer function. This situation occurred due to we add delay to the theoretical plot.
3.Conclusion

The main goal of this lab is to observe transfer function characteristic both theoretical and experimental
bode plots. Then, add delay to theoretical bode plot to make it closer to experimental bode plots. As the
first part, we obtained the bode plot of transfer function of previous lab work. In the second part, by
applying sinusoidal input signal with seven different angular frequencies to obtain experimental bode
plot. As we seen in the figures the experimental bode plot is closed to theoretical bode plot with some
minor delay errors. The maximum error occurred at when angular frequency is 100 rad/sec because of
delay margin increases as we reach to higher values of angular frequency. For the last part, time delay is
added to the theoretical bode plots to compared it with experimental bode plot. As seen in the figures,
the bode plot with time delay is closer to the experimental bode plot. With this part we ensure that the
system has definitely has time delay.

APENDIX

w = logspace(-1,2,100);
for k = 1:100
s = 1i * w(k);
G(k) = 103.394/ (s+7.299);
end
subplot(2,1,1)
semilogx(w,20*log10(abs(G)));
grid on
title('Bode Plot - Magnitude');
xlabel('Frequency (rad/s)');
ylabel('Magnitude (dB)');
subplot(2,1,2)
semilogx(w,angle(G)*180/pi)
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%0.1 frequency
angular_frequency = 0.1;
duration = 70;
t = 0:0.01:duration;
input = 10*sin(angular_frequency * t);
output = out.velocity.Data;

Input = fft(input);
Output = fft(output);
[Kinput,indexin] = max(abs(Input));
[Koutput,indexout] = max(abs(Output));
Mag = Koutput / Kinput;
Pin = angle(Input(indexin));
Pout = angle(Output(indexout));
Phase = Pout - Pin;
plot(t,input);
hold on
plot(t,output);
title('Angular Frequency = 0.1');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(0.1, 20*log10(Mag), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');

subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(0.1, Phase*180/pi, 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%0.3 frequency
angular_frequency1 = 0.3;
duration = 70;
t1 = 0:0.01:duration;
input1 = 10*sin(angular_frequency1 * t1);
output1 = out.velocity1.Data;
time1 = out.velocity1.Time;

Input1 = fft(input1);
Output1 = fft(output1);
[Kinput1,indexin1] = max(abs(Input1));
[Koutput1,indexout1] = max(abs(Output1));
Mag1 = Koutput1 / Kinput1;
Pin1 = angle(Input1(indexin1));
Pout1 = angle(Output1(indexout1));
Phase1 = Pout1 - Pin1;

plot(t1,input1);
hold on
plot(t1,output1);
title('Angular Frequency = 0.3');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(0.3, 20*log10(Mag1), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');

subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(0.3, Phase1*180/pi, 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%1 frequency
angular_frequency2 = 1;
duration2 = 25;
t2 = 0:0.01:duration2;
input2 = 10*sin(angular_frequency2 * t2);
output2 = out.velocity2.Data;
time2 = out.velocity2.Time;

Input2 = fft(input2);
Output2 = fft(output2);
[Kinput2,indexin2] = max(abs(Input2));
[Koutput2,indexout2] = max(abs(Output2));
Mag2 = Koutput2 / Kinput2;
Pin2 = angle(Input2(indexin2));
Pout2 = angle(Output2(indexout2));
Phase2 = Pout2 - Pin2;

plot(t2,input2);
hold on
plot(t2,output2);
title('Angular Frequency = 1');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(1, 20*log10(Mag2), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');

subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(1, Phase2*180/pi, 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%3 frequency
angular_frequency3 = 3;
duration3 = 25;
t3 = 0:0.01:duration3;
input3 = 10*sin(angular_frequency3 * t3);
output3 = out.velocity3.Data;
time3 = out.velocity3.Time;

Input3 = fft(input3);
Output3 = fft(output3);
[Kinput3,indexin3] = max(abs(Input3));
[Koutput3,indexout3] = max(abs(Output3));
Mag3 = Koutput3 / Kinput3;
Pin3 = angle(Input3(indexin3));
Pout3 = angle(Output3(indexout3));
Phase3 = Pout3 - Pin3;

plot(t3,input3);
hold on
plot(t3,output3);
title('Angular Frequency = 3');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(3, 20*log10(Mag3), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');

subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(3, Phase3*180/pi, 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%10 frequency
angular_frequency4 = 10;
duration4 = 10;
t4 = 0:0.01:duration4;
input4 = 10*sin(angular_frequency4 * t4);
output4 = out.velocity4.Data;
time4 = out.velocity4.Time;

Input4 = fft(input4);
Output4 = fft(output4);
[Kinput4,indexin4] = max(abs(Input4));
[Koutput4,indexout4] = max(abs(Output4));
Mag4 = Koutput4 / Kinput4;
Pin4 = angle(Input4(indexin4));
Pout4 = angle(Output4(indexout4));
Phase4 = Pout4 - Pin4;
plot(t4,input4);
hold on
plot(t4,output4);
title('Angular Frequency = 10');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(10, 20*log10(Mag4), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');

subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(10, Phase4*180/pi, 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%30 frequency
angular_frequency5 = 30;
duration5 = 10;
t5 = 0:0.01:duration5;
input5 = 10*sin(angular_frequency5 * t5);
output5 = out.velocity5.Data;
time5 = out.velocity5.Time;

Input5 = fft(input5);
Output5 = fft(output5);
[Kinput5,indexin5] = max(abs(Input5));
[Koutput5,indexout5] = max(abs(Output5));
Mag5 = Koutput5 / Kinput5;
Pin5 = angle(Input5(indexin5));
Pout5 = angle(Output5(indexout5));
Phase5 = Pout5 - Pin5;

plot(t5,input5);
hold on
plot(t5,output5);
title('Angular Frequency = 30');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(30, 20*log10(Mag5), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');
subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(30, (Phase5*180/pi) - ( 360), 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%100 frequency
angular_frequency6 = 100;
duration6 = 10;
t6 = 0:0.01:duration6;
input6 = 10*sin(angular_frequency6 * t6);
output6 = out.velocity6.Data;
time6 = out.velocity6.Time;

Input6 = fft(input6);
Output6 = fft(output6);
[Kinput6,indexin6] = max(abs(Input6));
[Koutput6,indexout6] = max(abs(Output6));
Mag6 = Koutput6 / Kinput6;
Pin6 = angle(Input6(indexin6));
Pout6 = angle(Output6(indexout6));
Phase6 = Pout6 - Pin6;

plot(t6,input6);
hold on
plot(t6,output6);
title('Angular Frequency = 100');
ylabel('RPM(Blue) and Voltage(Red)');
xlabel('t');

subplot(2,1,1);
semilogx(w,20*log10(abs(G)));
hold on;
semilogx(100, 20*log10(Mag6), 'rx');
grid on;
title('Bode Plot - Magnitude');
ylabel('Magnitude (dB)');

subplot(2,1,2);
semilogx(w,angle(G)*180/pi)
hold on;
semilogx(100, (Phase6*180/pi) , 'rx');
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

%q3

w = logspace(-1,2,100);
for k = 1:100
s = 1i * w(k);
Gd(k) = (103.394 (1-0.005*s))/ ((1+0.005*s)(s+7.299));
end
subplot(2,1,1)
semilogx(w,20*log10(abs(Gd)));
grid on
title('Bode Plot - Magnitude');
xlabel('Frequency (rad/s)');
ylabel('Magnitude (dB)');
subplot(2,1,2)
semilogx(w,angle(Gd)*180/pi)
grid on;
title('Bode Plot - Phase');
xlabel('Frequency (rad/s)');
ylabel('Phase (degrees)');

You might also like