You are on page 1of 4

ME 597D Spring 2009 HW_PWM

Name ________________________

1) Use an Arduino to provide a fixed rate TTL PWM signal as input to the motor speed control
circuit using a solid state relay (SSR) as shown below.
2) Use an optical tachometer to measure motor speed at several different duty cycles of PWM.
Note that you should measure motor voltage before each test to rescale speed if your battery
starts to droop.
3) Attach a plot that shows motor speed versus duty cycle (0 to 100%).

490 Hz from Arduino and


higher harmonics
4) What is the frequency of motor squeal at low duty cycles? ________________________
5) How would your plot change if you used a +24V battery?
a) about double rpm for same duty cycle
b) lower threshold for deadband

SSR

12V

brushed
DC motor
MY1016Z3

TTL GND

TTL PWM

ME 597D Spring 2009 HW_PWM

Name ________________________

400

MY1016Z3 motor speed [rpm]

350
300
12V
24V

250
200
150
100
50
0

10

20

30

40
50
60
Duty cycle [percent]

70

80

90

100

0.015

X: 491.4
Y: 0.00921

Amplitude

0.01

0.005

500

1000

1500
2000
2500
Frequency [Hz]

3000

3500

4000

ME 597D Spring 2009 HW_PWM


% hw_pwm.m - ME 597D motor PWM using Arduino homework
% HJSIII, 09.03.07
clear
% raw data
% Arduino PWM value (0 to 255), rpm at 12V, rpm at 24V
raw = [
0
0
0 ;
2
0
0 ;
3
0
26 ;
4
0
49 ;
5
18
94 ;
10
46 179 ;
20
77 213 ;
30
93 238 ;
40 110 273 ;
50 125 291 ;
60 137 307 ;
70 145 319 ;
80 153 327 ;
90 158 333 ;
100 163 340 ;
110 167 338 ;
120 171 344 ;
130 173 348 ;
140 176 351 ;
150 178 354 ;
160 179 357 ;
170 180 360 ;
180 181 363 ;
190 182 366 ;
200 183 368 ;
210 185 370 ;
220 191 374 ;
230 191 374 ;
240 191 374 ;
250 191 375 ;
255 191 375 ];
duty = 100 * raw(:,1) / 255;
rpm12 = raw(:,2);
rpm24 = raw(:,3);
% plot
figure( 1 )
clf
plot( duty,rpm12,'r', duty,rpm24,'g' )
xlabel( 'Duty cycle [percent]' )
ylabel( 'MY1016Z3 motor speed [rpm]' )
legend( '12V', '24V' )

Name ________________________

ME 597D Spring 2009 HW_PWM

Name ________________________

% pwm_fft.m - FFT of PWM squeal


% HJSIII, 09.03.07
clear
% read data
[ x, fs, bits ] = auread( 'pwm.au' );
n = length( x );
dt = 1 / fs;
% FFT
% MATLAB FFT scaled by 2/n - DC component scaled by 1/n
a = fft(x) * 2 / n;
% complex number - units [volts]
a(1) = a(1) / 2;
% units [volts]
amp = abs( a );
% units [volts]
phase = angle( a ) * 180 / pi;
% units [deg]
df = fs / n;
% units [Hz]
freq = [ 0:(n-1) ]' * df;
% units [Hz]
% plot amplitude
figure( 1 )
clf
plot( freq,amp )
axis( [ 0 4000 0 0.015 ] )
xlabel( 'Frequency [Hz]' )
ylabel( 'Amplitude' )

% units [Hz]

You might also like