Digital Measurements: Data Acquisition with LabView

Slides:



Advertisements
Similar presentations
Velleman Arbitrary Function Generator: Windows 7 by Mr. David Fritz
Advertisements

Experiment 17 A Differentiator Circuit
Introduction to the Oscilloscope Professor Ahmadi ECE 002.
1 Physics 434 Module 1 About the computers: –You can save VI’s on the local disk. put them into My Documents\your_name (But beware: no backup, no protection)
AOE 3054 Spectral Analysis & Programming Options.
Workshop 7 of 7 Welcome!. Today's Topics Data Acquisition MAX DAQ Assistant Express VI DAQmx API Create Task Configure Task Configure Trigger Start Task.
Measurement of Voltages and Currents
What have we learned so far?  When we apply a voltage, the capacitor will charge up to the applied voltage.  The capacitor charges up exponentially.
Introduction to electronics lab ENGRI 1810 Using: Solderless prototype board (white board) Digital multimeter (DMM) Power Supply Signal Generator Oscilloscope.
Calibration Procedure.  A winch calibration is completed via a linear interpolation between 2 points.  Requires 2 references  Known lower weight 
Using an FPGA to Control the Protection of National Security and Sailor Lives at Sea Brenda G. Martinez, Undergraduate Student K.L. Butler-Purry, Ph.D.,
EPOCH 1000 Series Procedure Phase Array Straight Beam Calibration
Experiment 11: An Inverting Amplifier
PC Applications Course LabVIEW: Laboratory Virtual Instrument Engineering Workbench Graphical Programming Easy to use Faster Development Time.
Laboratory 5: Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report / Presentation Closing.
EE311: Junior EE Lab Phase Locked Loop J. Carroll 9/3/02.
1 Lab Equipment. 2 TopicSlides DC Power Supply3-4 Digital Multimeter5-8 Function Generator9-12 Scope – basic controls13-20 Scope – cursors21-24 Scope.
USE OF THE OSCILLOSCOPE Modified from a presentation written by David Matzke by: Donald Wisniewski, Dawn Wisniewski, Huzefa Mamoola and Angela Nolte Under.
“Power Supply” Controls Voltage Difference in Voltage is set Output Current is “as requested” by attached device.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 12 Data Acquisition  Read Bishop, Chapter 8.  Lab #12 and Homework #12 due next week.
George Washington University DC Circuits Lab Professor Ahmadi ECE 002.
1 AC Measurements Using the Oscilloscope and Multimeter by Mr. David Fritz.
Lecture 6: Measurements of Inductance, Capacitance, Phase, and Frequency 1.
Purpose Learn how to use basic electronic equipment:
Physics 434 Module 3 - T. Burnett 1 Physics 434 Module 3 Acoustic excitation of a physical system.
Oscilloscope Tutorial
Introduction to the Oscilloscope Professor Ahmadi ECE002 George Washington University.
Institute Of Applied Technology ATE 1012 Grade 10 Eng. Rose Hasan.
Experiment 11: Non-Inverting Amplifier With Modifications that Require the Use of the Velleman Oscilloscope.
Virtual Instrumentation With LabVIEW
Experiment 12 Non-Inverting Amplifier. Experimental Procedure Clarification in Step 3 (Modeling) – To perform the DC Sweep in the sinusoidal voltage source.
V1: HMFR, V2: MFNB, 2007 LabView Seminar University of Puerto Rico Mayagüez Campus.
LabVIEW an Introduction
Introduction to LabVIEW
General Engineering Polytechnic University Laboratory 9: Electrical Filters.
Physics 145 Introduction to Experimental Physics I Instructor: Karine Chesnel Office: N319 ESC Tel: Office hours: on appointment.
TA: Chris Reilly Group 5: Benjamin, Ramie, Zachary, Dinal.
High Speed Data Converter University
Data Acquisition Data acquisition (DAQ) basics Connecting Signals Simple DAQ application Computer DAQ Device Terminal Block Cable Sensors.
George Washington University DC Circuits Lab Professor Ahmadi ECE 002.
LabVIEW and MatLab E80 Teaching Team February 5, 2008.
Analog Discovery Arbitrary Function Generator for Windows 7 by Mr
Instrumentation Overview Spring 2012 The laboratory is a controlled environment where we can measure isolated physical phenomena with a view to eventual.
EPOCH 1000 Series Procedure Phased Array Angle Beam Calibration
Vadodara Institute of Engineering kotanbi Active learning Assignment on Single phase AC CIRCUIT SUBMITTED BY: 1) Bhatiya gaurang.(13ELEE558) 2)
Physics 2225: Working With Electronic Equipment Purpose  Learn how to use basic electronic equipment: Digital multi meter Oscilloscope Function generator.
Introduction to LabVIEW 8.5
Lab 1 : Introduction to LabView 1 Southern Methodist University Bryan Rodriguez.
Introduction to the Oscilloscope Professor Ahmadi ECE 002.
Due DateWeek Experiment in Lab ManualTitle Pre-Lab Report Validation Post- Validation Report 3/13/20123/14/20123/17/20126To be distributedMake-up Lab for.
Velleman Oscilloscope: Windows 7 by Mr. David Fritz.
INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin.
Experiment 10: Inverting Amplifier With Modifications that Require the Use of the Velleman Oscilloscope.
Lecture 6: Measurements of Inductance, Capacitance, Phase, and Frequency 1.
Ethernet I/O Set-Up This presentation will step through a typical configuration of the DVT CON-IOE. Intellect 1.0 is used for the software portion.
Data Acquisition Device (DAQ) A DAQ is a cool little device that allows you to interface hardware to a computer. Here is what we will do:  Create a square.
Introduction to LabVIEW
Simple Circuits 1 st year physics laboratories University of Ottawa
Simple Circuits 1st year physics laboratories University of Ottawa
Simple Circuits 1st year physics laboratories University of Ottawa
EET 2259 Unit 12 Data Acquisition
Dr Andrew French P5/6 Winchester College
Introduction to the Oscilloscope
EET 2259 Unit 12 Data Acquisition
הודעות ריענון מהיר והרחבות Charts & Graphs גרף XY בניית מחולל אותות
McCrometer Nano Board Test Procedure
הודעות ריענון מהיר והרחבות דגימת אות Low-Level
Oscilloscopes HP 54600B Digital Oscilloscope Alex Jones COE 0501.
NI Data Acquisition (DAQ) Wiring and Connections
Presentation transcript:

Digital Measurements: Data Acquisition with LabView AOE 3054 Digital Measurements: Data Acquisition with LabView Credits to Borgoltz, Devenport, and Edwards for some content

Goals of the session Understand the basics of making the NI myDAQ work for controlling an experiment Build the data acquisition and control techniques needed to digitally run Experiment 6 in LabVIEW Basic scope Storing scope measurements Calibrating and ultimately controlling the function generator

Digital Measurements Lab Agenda Experiment 6 Digital introduction Measuring function generator input and beam response using myDAQ Calibrating function generators Find natural frequency of beam using myDAQ myDAQ Resolution Example Modify Homework codes

Experiment 6 Digital Introduction In the second Instrumentation Lab (Experiment 6a), you manually controlled a function generator to excite a beam and used an oscilloscope to measure the response of that beam. Week 5’s Instrumentation Lab is essentially a redo of the first Experiment 6, but will incorporate new digital measurement techniques to automate most of the data taking.

Experiment 6 Digital Introduction Specifically, you will be using the myDAQ to output a voltage signal that will control the function generator. The myDAQ will also measure the function generator output as well as the output from the proximeter. All operations will be controlled via Labview, using a code that builds off of the homework assignments and will be completed in Instrumentation Lab 4. Further details of Experiment 6 Digital can be found on the course website.

Digital Measurements Lab Agenda Experiment 6 Digital introduction Measuring function generator input and beam response using myDAQ Calibrating function generators Find natural frequency of beam using myDAQ myDAQ Resolution Example Modify Homework codes

Homework 3 VI Your Homework 3 VI’s utilized the 2 analog input channels on the myDAQ to measure two signals. We will use this code again to measure and display two signals- an excitation signal (function generator) and response signal (proximeter)

Connect Experiment 6 Components Connect the Function Generator to the power amplifier, using a BNC T-connector. Connect the Power Supply to the proximeter and set it up for the correct output voltage. Remember to take into account whether you are using the NEW or OLD proximeter. Refer to previous lecture slides for instructions on properly connecting the devices.

myDAQ Connections Connect your myDAQ to your computer using the USB port. Open LabView and your functional Homework 3 VI

myDAQ Connections BEFORE turning any of the equipment on, make sure that you do not supply more than 20V to the myDAQ through its analog inputs (myDAQ Overvoltage protection: +/-30V, 20 Vrms) This will require connecting the excitation and response signals to the oscilloscope and measuring amplitudes before connecting the myDAQ. A good first step is to turn the function generator amplitude control all the way down.

myDAQ Connections: Excitation Attach a BNC-to-BNC-probe connector to the T-connector on the function generator BNC to BNC probe (to oscilloscope) To Amplifier

myDAQ Connections: Excitation Attach the BNC-to-BNC connection from the function generator to a T-connector on CH1 of the oscilloscope, and a BNC-to-clipping-probe connector to the T-connector. From function generator BNC to clipping probe (to myDAQ)

myDAQ Connections: Excitation Clip the two ends of the probe to wires and attach to the myDAQ AI0 channel. Make sure the red clip goes to the 0+ channel, and black to the 0-. AI0+ AI0-

myDAQ Connections: Response To Ch2 on Oscilloscope Attach the output BNC connector of the proximeter to a BNC-to-clipping-probe connector using a T-connector Then connect the T-connector to Channel 2 on the oscilloscope Proximeter Output BNC to clipping probe (to myDAQ)

myDAQ Connections: Response Clip the two ends of the probe coming from the proximeter to wires and attach to the myDAQ AI1 channel. Make sure the red clip goes to the 1+ channel, and black to the 1-.

Final myDAQ Connections: Excitation+Response Function Generator Proximeter

Verify Connections Before turning equipment on, verify all of your connections are correct and set to the correct voltage. Ask your TA if you have any questions. Then disconnect the four clip-ons connecting the myDAQ. Verify that the function generator is set to output no more than 2 V.

Turn on Equipment Once the setup is verified, turn on the function generator, amplifier, multimeter, and power supply. Verify that the signals look good and within range on the oscilloscope. Once you established that both excitation and response are under 20V amplitude, turn all the equipment off. Reconnect the myDAQ. You can now turn the equipment back on, your myDAQ is ready for acquisition!

Using Homework 3 VI The Homework 3 VI and subVI should already be configured to read the correct channels on the myDAQ. Verify this by opening your subVI block diagram.

Verify myDAQ Channels Double click the DAQ Assistant Express VI. The following window then appears:

Verify myDAQ Channels Click the “Details” button under “Configuration”

Verify myDAQ Channels As expected, the myDAQ is reading the Excitation signal from channel AI0 and Response signal from AI1.

Set Test Conditions Close out of the DAQ Assistant screen and return to the Main VI front panel. Set the amplitude of the function generator signal up to about 2 V using the “AMPL” knob. Make sure it is pulled out (because when it is pushed in, it supplies a voltage up to 20 V). Set the frequency of the function generator to about 12 Hz.

Introduction to Aliasing Set your VI to take 10 samples at a rate of 10 Samples/s. The output should look similar to this:

Introduction to Aliasing Note that even though the excitation signal is set to 12 Hz, the sampling rate in LabView is too low to accurately resolve this signal. Likewise, the response cannot be accurately characterized either. This is known as aliasing, and was introduced in the previous homework. It will be discussed extensively in the next lecture and the 4th Instrumentation Lab, and is a major concern in signal analysis.

Grounding the myDAQ Some computers have grounding issues when using the myDAQ’s to measure a voltage, including older Fujitsu models. This causes noisy looking signals, such as that seen below:

Grounding the myDAQ To fix this problem, connect a banana to clipping probe cable from the “GND” of the Power Supply to the “AGND” port of the Analog Input section of the myDAQ. This leads to a much cleaner signal. A picture of an example connection is found on the next slide

Grounding the myDAQ Power Supply GND

Increase Sampling Rate Stop the program and increase the sampling rate to 1000 Samples/S, and increase the number of samples to 1000. Now, at this higher sampling rate, the correct signals can be determined (see front panel screenshot on next slide).

Increased Sampling Rate

Find Approximate Natural Frequency Adjust the function generator frequency until it reaches near the natural frequency. Note: It will be challenging to settle on the exact frequency. The function generators are sensitive. In this scenario, it is easiest to spot the natural frequency using the Lissajous plot. At the natural frequency, the Lissajous plot forms an ellipse with vertical and horizontal axes. Write down the frequency you settled on; we will come back to this later.

Front Panel at Natural Frequency Phase difference of 90 degrees Vertical ellipse.

Turn Off Equipment Shut off all of the equipment to prepare for the next phase of today’s lab.

Applications to Dynamic Beam Two inputs allow force and displacement voltages to be measured. Voltages converted to force and distance. Dynamic flexibility and spring constants measured at low frequencies and the result displayed. Data file saved and analyzed.

Digital Measurements Lab Agenda Experiment 6 Digital introduction Measuring function generator input and beam response using myDAQ Calibrating function generators Find natural frequency of beam using myDAQ myDAQ Resolution Example Modify Homework codes

What else is needed for Exp 6? We need a method for controlling the Function Generator! This will allow us to sweep through a range of frequencies and automate the experiment. To start understanding how to control the frequency generator, we will begin by calibrating it.

Varying Function Generator Frequency The function generator frequency can be varied by sending an analog output to the BNC connector on the front of the function generator. The DC voltage signal will be produced by the Analog Output of the DAQ. Varying the DAQ voltage will vary the output frequency of the function generator. Such set-up could be particularly useful to determine the natural frequency. Calibrating the Frequency Generator will produce the relationship between myDAQ voltage and output frequency. Now we need to set up the DAQ Assistant to Output an analog signal.

Rename Labview VI We will now build off of the code used so far in the lab. Save your current VI-the main VI from Homework 3-as a new file (i.e. Name_InstrumentationLab3, etc.)

Configuring the DAQ for Analog Output From the Block Diagram of your VI, Right click and select Input, DAQ Assistant.

Place VI on the Diagram

Configure the DAQ Assistant… Select generate signals, this is the output portion of the DAQ

Configure the DAQ Assistant… Select Analog output

Configure the DAQ Assistant… Select Voltage

Select physical output channel Select an output port

Configure the DAQ Assistant… If the window below does not show up, change the window size and the window should appear! Select 1 Sample from the generation mode, finished!

DAQ Assistant for Analog Output Now we need to create to input DC signal for the DAQ. This can be done by attaching a control to the data input…

DAQ Assistant for DC output Add a while loop around the DAQ Assistant for continuous output and then connect a stop button to the stop port on the DAQ and the stop button on the while loop so that the while loop will smoothly shut down the DAQ when you press stop. You are now ready to connect the myDAQ to the function generator.

Analog Output Terminals Connect bare wires to the A0 0 and AGND terminals on the DAQ by inserting the bare ends of the leads into the appropriate terminals and tightening the screw with the included screwdriver. Connect a BNC-to-clipping-probe connector to the DAQ (RED clip to the lead for A0 0 and a BLACK clip to the lead for AGND). Note that for all of these connections discussed today, either a BNC to alligator clip or BNC-to-clipping-probe connector will work

Process: How to control the function generator? You will use the DC DAQ output to obtain the relationship between the voltage supplied to the function generator and the frequency output by the generator. This relationship is called the gain or calibration. To do so, you will connect the DAQ analog output to the function generator input (VCF port) and use the calibration to control the generator with the DAQ.

Setup: How to control the function generator? Place a BNC T-connector on the VCF input of the function generator. Connect the analog output port you selected to the VCF input of the function generator using a BNC cable/alligator clip and the two leads in the myDAQ. On the other side of the T-connector, connect a BNC to BNC cable. From myDAQ BNC to BNC connector

Setup: How to control the function generator? You will want to connect your voltmeter to the DAQ as well. Disconnect the banana plug currently in the multimeter, which connected the power supply voltage to the proximeter. Insert a new banana plug to BNC connector and connect the BNC coming from the function generator VCF input to the multimeter. Using the LabView VI, vary the DC voltage output and see how the function generator frequency responds. Verify that the multimeter voltage matches the output voltage specified in LabView, and also specify that the frequency displayed on the function generators matches the frequency measured by the AI0 channel in the myDAQ (displayed as the “Excitation Frequency” on the VI front panel). From function generator VCF input Power supply to proximeter connection

Exercise: Calibrating the function generator The frequency of the function generator can be commanded based upon voltage You will open an Excel file to store information on the calibration (i.e. record voltage input and frequency output) Use the DAQ to control the function generator

Calibrating the function generator To determine this relationship, you need to do a calibration. You need to record the frequency output for different voltage inputs: Make sure your function generator is set to sine wave, with the RANGE knob set to a 10 Hz order of magnitude. Adjust the FREQUENCY knob to output a 14 Hz sine wave before beginning calibration. Run the DAQ VI and record the frequency from the DAQ for ~10-20 voltages. Adjust the input voltages between +/-2 V. This should lead to function generator frequencies from about .5 Hz up to about 27.5 Hz You will have to adjust your sampling scheme to obtain accurate readings. Record and plot the resulting data in excel and obtain the linear relationship, i.e. the calibration.

Calibrations The calibration curve should look something like this. y-intercept will be equal to the frequency the function generator was set to before calibrating. In this image, the function generator started at 10 Hz. Note that you will be starting at 14 Hz. The calibration curve should look something like this. The offset will be different depending on your station. This gives you a relationship between in the input voltage (x) and the frequency (y) and allows you to write a conversion between frequency and voltage. Thus in LabVIEW, the user can enter a frequency y and the VI will convert this value to voltage using (y-b)/m (if the calibration is y=mx+b) and then send this to the DAQ to control the function generator.

How to control the function generator with LabVIEW At this point, your code is set to provide a voltage from the DAQ to the function generator, which in turns produces a frequency output that is function of its calibration. Since you know the calibration equation, you will be able to change the code so that the user inputs a frequency that the code will convert to a voltage value to be fed to the function generator. You can therefore change the “Offset” control seen above using the arithmetic operations you learned for Homework 2 and the coefficients of the calibration you just measured.

How to control the function generator with LabVIEW You can use the sub-VI from Homework 2 to modify the “Offset” control in the current code. To confirm you have written your code and performed your calibration correctly, set a frequency in LabVIEW and measure the excitation signal on the scope. If you have done everything correctly, the two should match.

Digital Measurements Lab Agenda Experiment 6 Digital introduction Measuring function generator input and beam response using myDAQ Calibrating function generators Find natural frequency of beam using myDAQ myDAQ Resolution Example Modify Homework codes

Reconnect Equipment The myDAQ output voltage can control the output frequency of the function generator much more precisely than manually adjusting the knob. We will now try to more accurately measure the natural beam frequency. Disconnect the banana plug and BNC to BNC cable in the multimeter from the function generator calibration, and reconnect the banana plug linking the power supply to the proximeter input. Return the BNC to BNC cable to the wall rack.

Turn on Equipment Turn on the power supply and amplifier Using the LabView VI, adjust the desired frequency of the function generator to find the beam’s natural frequency. See how much closer to a phase of 90 degrees you can get, compared to manually adjusting the frequency knob.

Power Down Equipment Next, turn off all equipment, disconnect all cables and wires, and return all equipment to their respective storage locations. Leave two wires, a BNC-to-clipping-probe connector, and a BNC to BNC connector at your table.

Digital Measurements Lab Agenda Experiment 6 Digital introduction Measuring function generator input and beam response using myDAQ Calibrating function generators Find natural frequency of beam using myDAQ myDAQ Resolution Example Modify Homework codes

myDAQ Generate Sine Wave Next we will go through an example showing the limitations of a digital signal. You have seen that the myDAQ is capable of producing an analog signal through its analog output. So what if we were to try to replace the function generator altogether with the myDAQ? We will have the myDAQ generate a sine wave, and compare that to a sine wave generated by the function generator

myDAQ Resolution You have seen in class that the resolution of a digital to analog converter is a function of its number of bits and voltage range: 16 bit resolution, i.e. 2 16 = 65536 levels of distinguishing/generating a signal. At an analog output voltage range of -10 to 10 V, that means that the myDAQ can output voltages in increments of 20/65536 = 0.3 mV.

Download Code Download the OutputSineWave.vi from the Scholar site, under Resources-> Instrumentation->Lab 3

Connect Devices Use a BNC to BNC connector from the MAIN output port on the function generator to CH 1 on the oscilloscope. Connect two wires into the myDAQ for analog output, in the same manner as described on Slide 48. Use a BNC-to-clipping-probe to connect the wire terminals of the myDAQ to CH 2 on the oscilloscope. Make sure the red clip corresponds to the AO0 wire, and black clip to the AGND.

Device Connections

Run VI Turn on the oscilloscope and function generator. Set the function generator to an output frequency of about 4 Hz with a very low amplitude (always keep in mind the voltage limit on your DAQ). In the VI front panel, set the frequency at 4 Hz and amplitude to 0.02 V. Run the code, and adjust the oscilloscope screen to accommodate the signals.

Oscilloscope Display Function Generator Signal myDAQ Signal

Digital Resolution Limitations As you can see, the blue myDAQ signal is much choppier and noisier than the function generator signal. While the function generator can output a smooth sine wave, the myDAQ can only output voltages in increments of 0.3 mV. For a low amplitude signal such as this, the 0.3 mV resolution of the myDAQ can be a significant limitation. Consequently, the myDAQ is used to control the function generator (and automate the acquisition), rather than to replace it.

Digital Measurements Lab Agenda Experiment 6 Digital introduction Measuring function generator input and beam response using myDAQ Calibrating function generators Find natural frequency of beam using myDAQ myDAQ Resolution Example Modify Homework codes

Modify Homework/Lab 3 Code Modify today’s code to calculate the spring stiffness as well, using beam theory. Divide the forcing amplitude (in Newtons) by the response amplitude (in meters). Note that this is only valid at low frequencies. See slide 73 for block diagram screenshot.

Note: for those using the station with the -24VDC supply to the proximeter: There is a voltage divider on the proximeter drive that divides the output by 2 before you get to measure it. It is therefore required to multiply the response signal by 2 to recover the true displacement voltage. The proximeter calibration is 200mV/mils (as opposed to 106mV/mils for the older proximeters).

Final Modifications

Wrapping Up You can run your code for various frequencies and find if the values of k you obtain are consistent with Experiment 6a. We now have most of the building blocks for digitally controlling and measuring the beam response. Next lab, we will write code to fully automate the process and find the resonant frequency of the beam. To do this, we’ll have to learn about for loops and LabView data storage through arrays.