Lab 6
Lab 6
Lab 6
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
EME 107B – SPRING 2007<br />
Week of May 14 th – May 18 th , 2007<br />
<strong>Lab</strong> 6: DC Motor System Identification<br />
1. Format of lab report<br />
For this lab report, you are required not only to follow the lab report guidelines posted on the<br />
class web site, but also to have the following items:<br />
• introduction<br />
• summary of procedure<br />
• presentation of results<br />
• discussion<br />
2. Scope of this lab<br />
Improve understanding of a DC motor.<br />
3. Things to prepare beforehand<br />
You will need to download two files: AnalyzeTachoData.vi and lab2.vi from the course web site.<br />
4. Background<br />
The web site ‘How stuff works’ has an article by Marshall Brain with a lot of details and pictures<br />
that should clarify the concept of electric motors and show some of the applications that use<br />
them.<br />
(begin article from Howstuffworks.com)<br />
1
disassembly sequence<br />
4
(end article from Howstuffworks.com)<br />
Your objective in this lab is to identify the parameters (Ra, La, km, K, τelectrical, τoverall) of a DC<br />
motor using step response testing.<br />
The motor is represented by the following model (Figure 1):<br />
ea(t)<br />
Ra<br />
La<br />
T(t)=kmia(t)<br />
Figure 1: Electromechanical model of a DC motor<br />
The labeled items are<br />
ea(t) = input voltage<br />
Ra = resistance<br />
La = inductance<br />
ia(t) = current<br />
eb(t) = back emf<br />
T(t) = torque<br />
ω(t) = shaft angular velocity<br />
J = moment of inertia<br />
b = viscous damping coefficient<br />
km = torque constant<br />
7<br />
ω(t)<br />
ia(t) eb(t)= kmω(t)<br />
J<br />
b
Equations<br />
We start with two equations, one electrical and the other mechanical. Summing the loop voltages<br />
gives:<br />
dia<br />
(t)<br />
(1) La + R ai<br />
a (t) = ea<br />
(t) − eb<br />
(t)<br />
dt<br />
Summing the torques present at the motor’s output shaft gives<br />
(2) J ω&<br />
(t) + bω(<br />
t)<br />
= T(t)<br />
Equations (1) and (2) are two first-order ODE’s. They are related by the motor’s torque-current<br />
relationship and by the back-emf produced by the motor rotation:<br />
(3) T(t) = kmia(t)<br />
(4) eb(t) = kmω(t)<br />
Note that the same constant (km) appears in both equations (3) and (4). This is only true if we use<br />
SI units. Two constants (called the motor torque constant and the back-emf (electromotive force)<br />
coefficient) are required when English units are used.<br />
The motor’s time response has two time constants (τ) – we’ll call these an electrical and a<br />
mechanical time constant. The electrical time constant is almost always a lot faster than the<br />
mechanical time constant, and is often neglected in modeling the motor dynamics. This is called a<br />
dominant-pole approximation, and is a useful approach to simplifying the model.<br />
To test this assumption, the electrical time constant can be measured by locking the motor shaft in<br />
place. Then eb = kmω(t) = 0, and equation (1) simplifies to:<br />
dia<br />
(t)<br />
(5) La + R ai<br />
a (t) = ea<br />
(t)<br />
dt<br />
If we apply a voltage step to the motor (ea(t) = ea for t > 0), we expect to see an exponential<br />
La<br />
ea<br />
response with a time constant given by τ = and a steady-state current of i ss = . We can<br />
R a<br />
R a<br />
use measurements of τ and iss to determine Ra and La.<br />
When the motor shaft is unlocked, we can use steady-state measurements of the input current,<br />
motor speed, and applied voltage to determine the torque constant (km) and the viscous damping<br />
coefficient (b). In steady-state, all the derivative terms in equations (1) and (2) are zero, so we<br />
have:<br />
(6) k mωss<br />
= ea<br />
− R ai<br />
a, ss<br />
k mi<br />
a, ss<br />
(7) ωss<br />
=<br />
b<br />
The final parameter to be measured is the motor’s moment of inertia, J. If the electrical time<br />
constant is very fast, the dynamic model for the motor is simplified by neglecting the first term in<br />
equation (1):<br />
(8) i (t) =<br />
e (t) − e (t)<br />
R a a a b<br />
8
Then we can find the motor torque by substituting equations (3) and (4) into equation (8):<br />
2<br />
k m k m<br />
(9) T()<br />
t = ea<br />
() t − ω()<br />
t<br />
R a R a<br />
Finally, if we substitute equation (7) into equation (2), we have the following relationship<br />
between the motor speed and the input voltage:<br />
2<br />
b + k m k m<br />
(10) Jω& () t + ω()<br />
t = ea<br />
() t<br />
R a R a<br />
As a result, if we apply a voltage step to the motor (ea(t) = ea for t > 0), we expect to see an<br />
exponential response with a time constant given by:<br />
(11)<br />
5. Motor and Power Amplifier Overview<br />
b + k<br />
τ =<br />
JR<br />
Since the ELVIS prototyping board cannot output enough current to drive the motor, the power<br />
amplifier is used to buffer your output voltage. The power amplifier has a gain of approximately<br />
2 V/V, so if the input voltage is 1 V, the output from the power amplifier is 2V. The power<br />
amplifier has a current sensor which can be used to measure the current applied to the motor. The<br />
current sensor output can be measured at the red test point (labeled VCURR+). The current<br />
sensor has a gain of 2 V/A, so if the voltage measured at VCURR+ is 1V, the output current is<br />
500 mA.<br />
The motor contains a tachometer (literally, ‘measurement of speed’). The angular speed is<br />
computed from the tachometer’s RMS voltage output using the following relationship:<br />
(12) ω [rad/sec] = 52.4 [Volts RMS]<br />
6. Procedure<br />
A. Measure the motor’s electrical characteristics<br />
In this part of the lab, you will measure the motor’s electrical time constant to determine the<br />
armature inductance La.<br />
1. First, use the DMM to measure the armature resistance, Ra. Insert two test leads with minihook<br />
or alligator-clip ends into the DMM front panel on the current side (not the voltage<br />
side). Attach the test leads to the motor input wires. Set the DMM for resistance<br />
measurements by selecting the Ω key. Make multiple measurements (>4) at different motor<br />
shaft angles. Average the values and record this as Ra below. Since this is a low resistance,<br />
the ELVIS DMM isn’t particularly accurate. You will compute the resistance again below.<br />
2. Now, turn off the power to your prototyping board and make sure that the power amplifier is<br />
plugged in and turned off. Make the electrical connections shown in Figure 2 below. Connect<br />
the BNC1 connector on the ELVIS breadboard to the input of the power amplifier with a<br />
BNC cable. Connect the motor input wires to the screw terminals on the output side of the<br />
power amplifier. Next, connect the current sensor using mini-hook test leads connected to<br />
9<br />
a<br />
2<br />
m
Banana C and D on the breadboard. Attach the mini-hooks to the VCURR+ and AGND test<br />
points on the Power Amplifier. Finally, connect the tachometer to Banana A and B using<br />
banana leads.<br />
3. Make the following jumpers on the Elvis prototyping board:<br />
• DAC0→BNC1+ GND→BNC1-<br />
• DAC1→Oscilloscope - Trigger<br />
• Banana A→ACH0+ Banana B→ACH0-<br />
• Banana C→ACH1+ Banana D→ACH1-<br />
Current Sensor<br />
Tachometer<br />
Elvis<br />
BNC 1<br />
Banana C<br />
Banana D<br />
Banana A<br />
Banana B<br />
BNC Cable<br />
Banana Leads<br />
VIN<br />
Test Points<br />
VCURR<br />
AGND<br />
Figure 2: Electrical connections.<br />
4. Lock the motor shaft so that you can measure the electrical time constant. Use the screw<br />
provided to lock the shaft in place.<br />
5. Create test and triggering waveforms as illustrated below using the Waveform Editor. The<br />
triggering waveform will be used to trigger the oscilloscope slightly before the rising-edge on<br />
the test waveform, which will be applied to the motor through the power amplifier. The test<br />
waveform amplitude is 0.5 V in order to produce a 1 V output from the power amplifier.<br />
Triggering waveform, 5V amplitude<br />
1 s<br />
a. Open the Arbitrary Waveform Generator SFP in ELVIS, then select the Waveform Editor<br />
key and make the following settings on the Waveform Editor:<br />
• Units: Hz<br />
• Sample Rate: 10000.0<br />
• Segment duration to 2 sec.<br />
b. First create a test waveform that has peak amplitude of 0.5V. Select the New Component<br />
key to add a component. Make the following settings for this component:<br />
• Function Library: Square.<br />
• Amplitude: 0.25 V<br />
• Offset: 0.25 V<br />
10<br />
Power Amplifier<br />
Banana Leads<br />
Screw Terminals<br />
VOUT<br />
AGND<br />
Test waveform, 0.2V amplitude<br />
t<br />
Motor<br />
Wires<br />
DC<br />
Motor<br />
Jacks<br />
Red<br />
Black
• Frequency (Hz): 0.5<br />
c. Click on FILE>>Save As and save the waveform to a waveform data file (.wdt format).<br />
d. Repeat for a triggering waveform. Select the New Component key to add a component.<br />
Make the following settings for this component:<br />
• Function Library: Square<br />
• Amplitude: 2.5 V<br />
• Offset: 2.5 V<br />
• Frequency (Hz): 0.5<br />
• Phase: 4.0<br />
• Duty Cycle (%): 1.0000<br />
e. Click on FILE>>Save As and save the waveform to a waveform data file (.wdt format).<br />
6. You will run three tests of the motor response using input amplitudes of 3V, 4V, and 5V. In<br />
the Arbitrary Waveform Generator SFP adjust the update rate to be 10,000 S/s. Load the test<br />
waveform into DAC0 and adjust the Gain to 3. Load the trigger waveform into DAC1. Press<br />
the Play All soft key.<br />
7. Turn on the Prototyping Board Power and the power amplifier.<br />
8. Start Oscilloscope SFP. Set the source for channel A to ACH1. Select the Display ON<br />
softkey. Adjust the timebase to 2 ms/div and set the Vertical Scale to 200 mV/div. Set the<br />
trigger source to TRIGGER and the slope to descending.<br />
9. Press the single key and press the log key. Save the data as (.txt).<br />
10. Press the Stop All soft key in the Arbitrary Waveform Generator, increase the gain to 4 and<br />
press the play all key then repeat step 11. Adjust the gain to 5 and repeat.<br />
11. Open the 3 files in excel. Convert the current sensor voltage into current in Amperes. Plot the<br />
current versus time for the three input voltages on the same plot. Make sure to label your<br />
axes. Hand in the plot with your lab write-up.<br />
12. Compute the 63% rise time (τ) and the steady-state current for each plot and record them in<br />
the table below. Calculate the armature resistance (Ra) from the steady-state current and the<br />
input voltage. Average for the three voltages. Given that τ = La/Ra compute La and average<br />
for the 3 voltages.<br />
B. Determine the system time constant τ<br />
In this part of the lab you will measure the system time constant and use it to calculate the<br />
motor’s moment of inertia.<br />
1. Remove the screw and allow the output shaft to rotate freely.<br />
2. Now, you will test the motor time response with three input amplitudes: 4V, 5V, and 6V. Set<br />
the DAC0 gain in the Arbitrary Waveform Generator to 4 and press play.<br />
3. View the Oscilloscope SFP in ELVIS. Set the source for channel A to ACH0. Adjust the<br />
timebase to 200 ms/div and set the Vertical Scale to 1 V/div.<br />
4. Press the Single key and press the Log key. Save the data as (.txt).<br />
11
5. Repeat for gains of 5 and 6.<br />
6. Download and open the file AnalyzeTachoData.vi from the course website. Input the sample<br />
period for your data the dt control. If you’re not sure what this is, you can open any of your<br />
.txt files and read the dt value in Excel.<br />
7. Run this vi and open one of your data files. It will then ask you to input a name to save the<br />
data. The data saved is after the input data has been rectified and filtered. You will see two<br />
waveform graphs. The first one shows the data exactly as it was read in. The second one is the<br />
rectified and filtered data.<br />
8. Experiment with the filter block in the VI. The default filter is a 3 rd -order butterworth filter<br />
with a 25 Hz cutoff frequency. Try adjusting cutoff frequency to a lower and higher<br />
frequency. What do you observe? Next, try changing the filter order. Does this have any<br />
effect on your result?<br />
9. Open the filtered data in Excel. Plot all three on the same graph, determine the 63% rise times<br />
and record the values in the table below. Make sure to label the axis and hand in the plots<br />
with your lab write up.<br />
C. Create a VI to make steady-state measurements of current & motor speed vs voltage<br />
In this part of the lab you will write a VI based on the VI from <strong>Lab</strong> 2 (lab2.vi) to automatically<br />
measure the steady-state speed and input current of the motor as the input voltage is increased.<br />
This time, instead of graphing the results you will store the RMS tachometer voltage and the<br />
mean input current to a file for later analysis.<br />
1. Open your VI from <strong>Lab</strong> 2 or use the file downloaded from the class web site. Save it under a<br />
new file name. A picture of the changes that you will make to the block diagram is shown in<br />
Figure 3.<br />
input voltage<br />
Figure 3: Wiring the DAQ Assistant to the Write LVM File VI.<br />
2. Go to the block diagram and delete the XY graph, the Build XY Graph and the two To<br />
DDT vi’s. In their place, create a block to store the data to a <strong>Lab</strong>view measurement (LVM)<br />
file. Go to Functions»Output and place a Write LVM block outside the While Loop. Select<br />
Save to one file and check Ask user to choose file. Under X Values Column select One<br />
Column Only. Leave the default settings for all the other values.<br />
12
3. Place a Merge Signals block next to the data input on the Write LVM from<br />
Functions»Signal Manipulation. Use the mouse to resize the block to give it three inputs.<br />
This will allow you to store three columns of data in the file (the input voltage, the mean<br />
current input, and the RMS tachometer reading).<br />
4. Change the Time Delay in the second frame of the stacked sequence. Use a delay that is at<br />
least 3τ so that the motor will have reached a steady speed before you make any<br />
measurements.<br />
5. Modify the DAQ Assistant Express VI in the third sequence frame to measure 250 samples of<br />
the tachometer and current sensor outputs. To do this, make the following configurations in<br />
the DAQ Assistant configuration wizard:<br />
• In addition to measuring the voltage on ai0 (ACH0), add a new voltage measurement<br />
to measure ai1 (ACH1).<br />
• In the Task Timing section, select N Samples.<br />
• Set the Samples to Read to 250, and set the sample rate to 5000 samples/sec.<br />
6. The DAQ Assistant you created will produce 250 samples per channel with each iteration. We<br />
will first convert the data into two arrays with 250 samples each. Go back to the block<br />
diagram, right click and select Functions»Signal Manipulation and choose From DDT.<br />
Place this in the while loop and select 2D array of scalars – columns are channels then<br />
click ok. Wire the output of the DAQ Assistant to the input of the From DDT. Add an Index<br />
Array block and split the 2D array into two 1D columns as was done in <strong>Lab</strong> 3.<br />
7. We will store only the RMS value of the tachometer output and the mean value of the current<br />
sensor output. Right click and select the RMS block from the menu: Functions»All<br />
Functions»Analyze»Mathematics»Prob and Stat. Place this in the while loop and wire the<br />
first data array (from ACH0) to the RMS block. Repeat the process to create a Mean block<br />
and wire it to the second data array (from ACH1).<br />
8. Wire the output voltage (which used to be connected to the X-axis of the XY graph) to the top<br />
terminal on the Merge Signals block. Wire the output of the Mean block and the RMS block<br />
to the border of the While loop. Right click on the two new loop tunnels at the border of the<br />
While loop and select “Enable Indexing.” Wire these loop tunnels to the second and third<br />
inputs to the Merge Signals block. <strong>Lab</strong>view will automatically create To DDT blocks to<br />
convert the signals to Dynamic Data Type.<br />
9. Save your completed VI.<br />
Testing<br />
1. Make the following front panel settings of the VI: Vmin = 1.5 V, Vmax = 3.25 V, Nsteps = 7.<br />
2. Press the Run key. When your program is complete, you will be prompted to save your data<br />
to a file.<br />
3. Open the file with Excel and check the data. Your current sensor and tachometer readings at<br />
Vin = 0.4V, 0.5V and 0.6V should agree with the steady-state values from Part B. If they do<br />
not, there probably something wrong with your VI. Ask your TA for help.<br />
13
4. In the Excel spreadsheet, make three new columns to convert your measured data into the<br />
armature voltage (ea), the steady-state current (ia,ss) and motor speed (ωss) using the<br />
conversion factors for the power amplifier (5 V/V), the current sensor (2 V/A) and the<br />
tachometer (52.4 rad/sec/V).<br />
5. Make a plot with ωss on the y-axis and ia,ss on the x-axis. Using eq. (7), the slope of this line is<br />
equal to (km/b). Find the slope, label the axes of this plot and save it to hand in with your<br />
report.<br />
6. Create an additional column to compute (ea - Ra ia,ss). Make a second plot with ωss on the xaxis<br />
and ea - Ra ia,ss on the y-axis. Using eq. (6), the slope of this line is equal to km. Find the<br />
slope, label the axes of this plot and save it to hand in with your report.<br />
7. Write-up<br />
In your typed lab report, indicate the following information by including tables such as those<br />
shown below.<br />
A. Electrical Characteristics<br />
Ra = ________Ω Measured<br />
Power Amp<br />
Output, ea<br />
[V]<br />
3<br />
4<br />
5<br />
Armature<br />
Current,<br />
ia,ss [mA]<br />
Average:<br />
B. Determining System Time Constant<br />
14<br />
Ra<br />
[Ω]<br />
Step Input (V) τ<br />
4<br />
5<br />
6<br />
Average<br />
τ<br />
[ms]<br />
La<br />
[mH]<br />
Compare the electrical time constant to that of the overall system. Is it a good assumption to<br />
neglect the electrical time constant?
C. Measuring the Motor Steady State Response<br />
Attach the two plots for ia,ss vs. ωss and for ωss vs. (ea - Ra ia,ss). Use the slopes of these lines to<br />
calculate:<br />
km [N-m/A] = _______<br />
b [N-m/(rad/sec)] = ________<br />
Use your measurements of τ, km, Ra and b to calculate the motor inertia from eq. (11):<br />
J [kg-m 2 ] = ________<br />
Use your measurements of km, Ra, and ωss to calculate the maximum value of Torque from eq.<br />
(9):<br />
T [N-m] = _________<br />
Finally calculate the horsepower of your motor.<br />
H [horsepower] = 0.05294 T[N-m] ωss[rad/s]<br />
H = _________<br />
15