Professional Documents
Culture Documents
Part 1:
Write a MATLAB m-file to read the measured combined system (gray box with DC
motor) frequency response results from Lab 2 Task 2
Sol.
clear
clc
%% Load Data
a=45000;
K1=a*10^0.5;
%z = 0.22;
%wn = 75*2*pi;
den1 = [1 a];
%num2 = [0 0 K2*wn^2]; %second order system (not
%% Connect in Series
%system
figure(1)
subplot(211)
xlabel('Frequency (rad/sec)')
ylabel('Magnitude (dB)')
grid on
subplot(212)
ylabel('Phase (deg)')
grid on
Observations and Results:
Discussion
The corner frequency, using the method of intersecting lines, was found to be 45000
rad/s for the Gray Box amplifier and 125 rad/s for the DC motor. Once higher
frequencies are achieved on either system the output provided drops exponentially. If
the DC motor behavior is analyzed further, and the corner frequency is converted
back into Hz, it isdetermined that if the motor turns faster than 19.9 rev/s it will
greatly lose efficiency. Using MATALB the transfer function for the Gray Box and
DC motor systems
were found to be:
Conclusions
Using MATLAB the corner frequencies for each system were found easily. Built
in MATLAB function made finding the transfer function for each system easy as well.
The Gray Box system was seen as a first order system while the DC motor was a
second order system.
Part 2:
1.Use a general second-order transfer function of the form below to model the
combined system.
2. Use the plotted Bode plot and data from Part 1 to;
DC Motor Script:
clear
clc
%% Load Data
m3=m-9.5;
K = .434;
z = 1.2;
wn = 20*2*pi;
%% Connect in Series
figure(1)
subplot(211)
xlabel('Frequency (rad/s)')
ylabel('Magnitude (dB)')
grid
subplot(212)
xlabel('Frequency (rad/s)')
ylabel('Phase (deg)')
grid
Discussion
After adjusting the values of z to best fit the measured results, we find the value of z =
1.9 which is as expected as the value of z should be greater than 0.707. Therefore, K =
1.287,wn = 189,z = 1.9
Conclusions
From this lab, using the Matlab code given below, we were able to adjust the
coefficients of our model to best fit the measured results for the overall system and we
plot the bode plots of our system response.