Professional Documents
Culture Documents
Lab 10 - Mechanical Motion: Goal: in This Experiment, Use The Power Capacity of The NI ELVIS II Variable Power
Lab 10 - Mechanical Motion: Goal: in This Experiment, Use The Power Capacity of The NI ELVIS II Variable Power
The ability to translate electrical signals into motion in the real world combined with the
ability to measure position can help you exploit the power of the computer to generate
computer automation the source of much of the modern worlds conveniences.
Goal: In this experiment, use the power capacity of the NI ELVIS II variable power
supply to run and control the speed of a small DC motor. Using a modified free space IR
link, build a tachometer to measure the speed of the motor. By combining the motor and
tachometer with a LabVIEW program, you can incorporate computer automation in the
system.
Required Soft Front Panels (SFPs)
Variable power supply (VPS)
Oscilloscope (Scope)
LabVIEW
Required Components
1 k resistor (brown, black, red)
10 k resistor (brown, black, orange)
IR LED/phototransistor module OR an IR LED and a separate Phototransistor
DC motor
Small punch or drill
Glue
Optional: Several combs with varying numbers of teeth per inch
1. On the protoboard, insert the components shown in the Figure 10.2 circuit
diagram.
Emitter
Detector
+5V
1k
10 k
+
To ACH4
-
Gnd
In the case of an LED/phototransistor module, an internal LED is used for the optical
source. Power it from the +5 V power supply through a 1 k current limiting resistor
Then connect a 10 k resistor from the phototransistor emitter to ground and connect the
same +5 V power supply to the phototransistor collector. The voltage developed across
the 10 k resistor is the phototransistor or tachometer signal.
2. Connect leads from the 10 k resistor to the AI 0+ and AI 0- pin sockets.
3. Select Scope from the NI ELVIS Instrument Launcher strip and select the
settings, as shown in Figure 10.3.
1. Cut a 2 in. diameter disk from a piece of thin but sturdy cardboard or plastic.
2. Cut a slot about 0.25 in. wide and 0.25 in. deep near the circumference of the
disk.
3. Punch or drill a small hole at the center point.
4. Glue the disk to the end of the motor shaft.
5. Mount the motor so that the slot lines up with the IR transmitter/receiver beam.
In operation, each revolution generates one pulse.
Emitter
VPS+
Detector
+5V
1k
10 k
+
To ACH4
-
Gnd
12 V DC Motor
Gnd
NOTE: You can also use the CD and motor of Lab 6. Instead of a small magnet
triggering the sensor, you can drill a hole about the size of the transmitter/receiver beam
(3 mm) near the edge of the CD. Align the IR sensor so that the beam passes through the
hole.
4. Read the pulse frequency (Freq:) from the measurement row CHO Meas: at
the bottom of the oscilloscope screen. Take frequency measurements for a
variety of power supply levels. A plot of frequency versus VPS voltage level
demonstrates the linearity of your rotary motion system.
5. Close NI ELVIS and all SFPs.
End of Exercise 10.4
You can convert the period measurement to revolutions per minute by inverting the
period to get frequency and multiplying by 60 to get rpm. For scaling, divide by 1000 to
get krpm.
NOTE: You can also use the Express template for Timing and Transitions Measurements
and get the frequency directly. Then convert the frequency to rpm as discussed above.
Run this VI and take your motor for a spin. See and hear how responsive the motor is to a
rapid change in the rpm setpoint.
Figure 10.10. LabVIEW Tachometer and Motor Control Circuit Front Panel
End of Exercise 10.5
If you are more familiar with control, you can use another VI (PID Autotuning.vi) to set
the initial PID parameters automatically. Then you can fine-tune the parameters to your
specific system. Search for additional LabVIEW PID resources at http://www.ni.com.
Figure 10.12. Setpoint (yellow) and RPM (red) Traces show Optimal Control PID in
Action
In Figure 10.12, the setpoint (yellow trace) is changed suddenly from 3300 to 4500 krpm.
The system rpm (red trace) responds by moving the motor speed smoothly and optimally
from the current setpoint to the target setpoint.