Incorporating National Instruments LabVIEW into

advertisement
Incorporating National Instruments LabVIEW
into an Intermediate Laboratory Experience
Steven C. Sahyun
Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin 53190
Abstract
Equipment
A novel approach to the Intermediate Physics Laboratory is to use the
resources of the Synchrotron Radiation Center (SRC) national
laboratory located in Stoughton, WI and run by the University of
Wisconsin - Madison. [1] Students collect data at the laboratory in
person and remotely through the use of a Web interface. This
experience relies heavily on the use of LabVIEW for data acquisition
and remote instrument control. To provide students with a better
understanding of how the process occurs, the first three weeks of the
course are devoted to learning LabVIEW in order to collect data and to
control basic circuits. This poster will detail how LabVIEW is
incorporated into the course structure.
Students worked in pairs for three weeks at a computer workstation equipped with a computer
and a National Instruments NI-6009 USB interface unit. Each computer had LabVIEW 8.2
installed.
LabVIEW Virtual Instrument Result for “Exercise 2”
A department site license was acquired through a National Instruments grant. UWW College of
L&S Dean provided funds to purchase NI-6009 USB interface units for the laboratory
workstations. Small supplementary items (LEDs, photocells, motors) were purchased from
Radio Shack with instructional funds.
NI USB-6009 interface unit. 14-Bit, 48 kS/s
Multifunction Data Acquisition for USB. 8 analog input
Why LabVIEW?
channels, 14-bit resolution, 12 digital I/O lines, 2
analog outputs.
The “Front Panel” contains
Controls and Indicators
The “Block Diagram” contains the
program of components wired together.
SRC experiment and the need to learn LabVIEW
Result for Task 5: Run a small motor with LabVIEW.
The Synchrotron Radiation Center (SRC) is a highlight feature of the
Intermediate Physics Laboratory course at the University of
Wisconsin - Whitewater. Students have the opportunity to visit and
perform remote experiments at the SRC. The facility consists of an
electron accelerator and the Aladdin storage ring, and produces
intense, broad-spectrum electromagnetic radiation from infrared to xray frequencies.
A research station at the SRC, called Students
Performing Experiments Collaboratively Thorough
Remote Access (SPECTRA), is dedicated to
outreach programs. This research station enables
students to conduct local or remote experiments
and collect real-time data using LabVIEW and a
Web interface.
Instructional Practice
Because LabVIEW plays such an important role in
data acquisition and equipment control in the SRC
experiment, as well as at other laboratories and in
industry, it was decided to provide students an
opportunity to learn LabVIEW at the beginning of
this course to better prepare them as future
physicists.
Course Overview
A hands-on guided set of six exercises provided the structure for basic understanding of
the LabVIEW environment. This method was similar to that used at National Instruments
workshops where concepts would be introduced and then students would have time to
complete specific tasks. The guided exercises were tailored to the specific needs of I/O
functions that would be seen on equipment later in the semester. Many of the students
began with little or no programming and/or electronics knowledge. At the end of the three
week period, students were bread-boarding circuits and programming LabVIEW to control
a small motor and to acquire and record data.
The Intermediate Physics Laboratory is a two-credit semester-long
course. It meets twice a week for two hours each session for 15
weeks. The course is divided into a series of Lab Stations that the
students experience, usually in groups of 2 or 3.
Lab Station 1: Computer Interfacing.
(3 Weeks)
Students learn basics of LabVIEW
programming to acquire data and
control devices.
Photocell uncovered, Photocell covered,
Motor is off.
Motor is on.
Darlington circuit to increase
the current to the motor
LabVIEW front panel.
Topic
Exercise
Creating a Virtual Instrument
Exercise 0 - Perform a mathematical function on two numbers.
Working with Loops
Exercise 2 - Add a loop structure to convert the temperature from degrees Celsius
to Fahrenheit so that it will run until stopped.
Controls and data Types
Exercise 3 - Switches, lights, Boolean and conversion. Make this work.
Using loops and Charts
Exercise 4 – Build a vi to display a simulated “noisy” sine signal (Functions Þ
Express Þ Input) to a Waveform graph (Controls Þ Modern Þ Graph). Include
“Reset Signal” and variable time delay controls.
DAQ – Data Acquisition with the 6009
Student groups then rotate through the following lab stations
Lab Station 2:
Electron properties.
(2 Weeks)
Helmholtz coil field
mapping.
e/m ratio
Lab Station 3:
Magnetism
(2 Weeks)
Magnetic dipole
moment and torque
experiments and a
brief introduction to
vacuum systems.
Lab Station 4:Material
Properties.
(2 Weeks)
 Using a
spectrophotometer to
investigate materials.
 Scanning Tunneling
Microscope.
Exercise 5: Acquire and graph an input signal from a function generator. Start with
InputStarter.vi
Create and view 1 and 2D arrays
Analyzing and Logging Data
Exercise 6 – Create a vi that will record a graph’s data using the “Write to
Measurement File” subVI. Include a “Save” control connected to the “enable”
input.
Student Assignment for the 3-Week Lab Session
Physics 221: Intermediate Laboratory
Station 1 Assignment: Computer Interfacing
Millikan Oil Drop
Objectives:
SRC Experience:
(3 Weeks)
Students use the SRC for photoemission studies of materials
of their own choosing.
EFNMR Lab
(2 Weeks)
Previous literature show several examples of incorporating LabVIEW
into course structures. Essick [2] provides a complete full semester
course text and Moriarty [3] provides further details on how to tailor a
semester-long course for students who have had electronics courses.
However, the focus of this course is centered on the SRC project, and
LabVIEW is not the end, but a means. Also students taking this course
are mostly sophomore level, with no electronics experience so the full
semester courses previously described are not satisfactory.
Instead, a three week series of 6 two-hour classes was implemented
loosely based on the philosophy of Green [4] but with a lower level
cohort. The classes used a modified version of National Instrument’s
“Learn LabVIEW in 6 hours” as a presentation base but focused the
activities on the I/O nature of LabVIEW. This was followed by
independent student activities.
You will learn basic functions and methods for transferring data from devices to computers and use
computers to generate signals to remote devices. You will become acquainted with a digital storage
oscilloscope as well as the LabView program.
1.
2.
3.
Complete the Introduction to LabVIEW exercises.
Complete a LabVIEW program to graph and save data
Complete a LabVIEW program to create a Decimal to Binary converter; use two LED
lights connected to the NI-6009 interface to display the result.
4.
Use the NI-6009 interface to turn on a LED diode when triggered by a signal from a
photocell.
5.
Use the NI-6009 interface to run a small motor when triggered by a signal from a
photocell. This will require the use of a “Darlington” circuit.
6.
Create a LabVIEW program to acquire and save to a file the waveform produced by a
function generator.
Extra credit: Pass the LabVIEW fundamentals exam at
http://www.ni.com/training/labview_exam.htm
Supplemental LabVIEW material available on request.
Progress and programs will be kept track of in your Laboratory Notebook. At the end of the Lab Station,
you will turn in your notebook as well as a lab report detailing your activities. Grading will follow
guidelines of the rubrics handed out in the course syllabus.
LabVIEW block diagram controlling the circuit.
Because the USB 6009 interface unit does not provide enough current to
directly run the motor, students discover that they need to create a
Darlington circuit to increase the current. [A pre-lab assignment asked them
to research the use of a Darlington circuit and draw its circuit diagram.] In
this activity, students learn rudimentary breadboard and circuit design
skills, which they may not encounter unless they take an optional
electronics course.
The LabVIEW Virtual Instrument monitors the light level from a photocell
and sends a signal to the motor such that when the photocell’s signal is
below a critical value (when covered) the motor will operate.
CONCLUSION
The inclusion of a LabVIEW module appealed to the students. The
methodical buildup of skills provided the students with a straightforward
approach to learning the environment and they enjoyed the engineering
aspect of designing systems to accomplish a goal. A better appreciation of
the program occurred later in the semester when they again used it for
data collection in subsequent lab station experiments and more
importantly with their SRC project. By having this short introduction at the
beginning of the semester, they were able to understand this type of
computer aided data collection, rather than seeing it as a black box. This
understanding was also important when they needed to trouble-shoot data
errors with their remote data collection experiment at the SRC.
References
[1] Sahyun, S.C., Polak, J. M., Moore, C. J. Undergraduate student
laboratory experience at the Synchrotron Radiation Center. Am. J. Phys.
74, 987 (2006)
[2] Essick, J. Advanced LabVIEW Labs. Prentice Hall. (1999)
[3] Moriarty, P.J., et al. Graphical computing in the undergraduate
Laboratory: Teaching and interfacing with LabVIEW. Am. J. Phys. 71, 1062
(2003)
[4] Green, A. Introducing Students to LabVIEW without tying up the
semester. 2006 AAPT Summer Meeting, Syracuse, NY
The experiments conducted at the Synchrotron Radiation Center, University of
Wisconsin-Madison, is supported by the NSF Award No. DMR-0084402.
Funding for the UW-Whitewater Physics Departmental Site
License provided by the National Instruments Equipment
Grant Program.
National Instruments, NI, and LabVIEW are trademarks of National Instruments Corporation.
Download