Last Updated 3/28/03 Week 10-11 Material
Data Acquisition BoardsTechese - DAQ cards perform D/A and A/D
English - Data Acquisition cards (the plug-in board you put in the back of the PC to acquire Electronic signals) perform Data-to-Analog and Analog-to-Digital Conversions.
Conceptually:
• Convert (transduce) measurable quantity (eg. Temperature) into an electrical signal (eg. a Voltage).
• Signal Conditioning (Signal Processing such as high/ low pass frequency filter to eliminate noise).
• Convert Voltage into format usable by computer (DAQ card)
• Analyze info with PC.
Last Updated 3/28/03 Week 10-11 Material
DAQ SignalsC lass ifyin g S ig n a ls
A D C A n a lys is(S p ec tru mA n a lyzer)
F req u en cyD om ain
F as t A /D C on(O sc illoscop e)
T im eD om ain
S low A D C /D A C(M otor S h aft)
D C
A n a log
C ou n ter o rT im er
(N u m b er o f P h o ton s )
P u lseTra in
TTL L in eD rive / R ead from
E lec tron ics
O ff-O n
D ig ita l
S ig n a ls
Last Updated 3/28/03 Week 10-11 Material
Signal ConditioningCommon Types:
Amplification, Transducer Excitation, linearization, Isolation, Filtering
Examples:
A photodetector produces a voltage between 0 and 50mV. The A/D board has a maximum input voltage of 10 volts with 8 bit resolution.
10/28 = 39 mV resolution Need to Amplify Signal
Last Updated 3/28/03 Week 10-11 Material
Signal Conditioning - examplesSwitching of High Voltages - Use optically isolated switches so that PC is not exposed to High Voltage, ground loop surges, etc.
Motor
High Voltage
LED powered by DAQ card
Last Updated 3/28/03 Week 10-11 Material
Signal GroundsRemember from Phys 121 that Voltages are measured relative to a reference (usually Ground).
Two types of Ground: Earth Ground and Reference Ground
Earth Ground: Potential of earth… infinite reservoir of charge (overall neutral). This is the safety or system ground that is used with the three prong AC power cord. A short circuit (eg.) to a toaster chassis will carry the current to earth ground so that the current does not go through a person to ground.
Reference Ground: Return path or signal common. Signal voltages measured relative to this ground.
Last Updated 3/28/03 Week 10-11 Material
Grounded and Floating SignalsWhen measuring voltages, you can measure then referenced to ground or in a differential mode (floating).
+-
Ground
Eg. an Oscilloscope orFunction Generator (3 prong AC cord)
+-
Eg. an electrical circuit with a Battery
Vs Vs
Ground
Last Updated 3/28/03 Week 10-11 Material
DAQ Measurement ConfigurationsIn configuring your DAQ board, you will use one of the three “standard” categories:
• Differential
• Referenced Single-Ended (RSE)
• Nonreferenced Single-Ended (NRSE)
Differential Method: Neither input is connected to a fixed reference (Ground). Uses Differential Amplifiers which produce a voltage relative to the Analog Input Ground (AIGND) which is the reference ground for the DAQ analog inputs.
Eg. Differential input (A-B) on the SR510 Lock-in Amplifier!
Last Updated 3/28/03 Week 10-11 Material
Differential Method - Configuration
Coaxial Cable If bias currents to large (two grounds too different), add 50k resistors from center pins of Coax to AIENSE
DAQ Card
Last Updated 3/28/03 Week 10-11 Material
Single End Reference
Coaxial Cable
DAQ Card
Last Updated 3/28/03 Week 10-11 Material
Single End - Non Referenced
If bias currents to large (two grounds too different), add 50k resistors from center pins of Coax to AIGND
DAQ Card
Last Updated 3/28/03 Week 10-11 Material
Why not Double End Reference?
GROUND LOOPS GENERATE NOISE!!!
Last Updated 3/28/03 Week 10-11 Material
Why are Ground loops bad?
They act as Antennas - Faraday’s Law/ Lenz Law of Induction
Instrumentation detects Ground Loop Voltages
Why use Coaxial (Shielded) cables?
• Gauss’s Law - If no net charge enclosed, no electric field
• One side grounded shield grounds noise from Antenna like pickup
Last Updated 3/28/03 Week 10-11 Material
Nyquist TheoromHow Fast do I need to Sample data?
• Nyquist - faster than twice the maximum frequency component in the signal to be acquired.
I’m belligerent and I don’t want to!
• Your data acquisition will have artifacts known as aliasing.
Generally, you will need to add a low pass filter to eliminate any frequencies which you can not accurately digitize to prevent aliasing.
Last Updated 3/28/03 Week 10-11 Material
Nyquist is too liberal!!!
-1.5
-1
-0.5
0
0.5
1
1.5
0 20 40 60 80 100 120
100 points
10 points
4 points
Unless you add a low-pass frequency filter before digitization : See Prof. Chang’s Lecture Notes.
Last Updated 3/28/03 Week 10-11 Material
DAQ Settings:Analog I/O -
• Analog to Digital Converters (Input to Computer)
• Digital to Analog Converters (Output from Computer)
Settings: Typically Configured by Jumper Cables (and software) on DAQ board
• ADC Input Range - Unipolar 0V to +10V - Bipolar ±5V- Bipolar ±10V (note reduced absolute Resolution)
for a 16 bit ADC, the voltage range is divided into 216 parts.
• ADC Input Mode - Differential, Ground Referenced Single End, Non-referenced single end.
Last Updated 3/28/03 Week 10-11 Material
DAQ Settings - cont.DAC Reference - Internal (factory setting) or External
DAC Polarity - Unipolar - binary mode, only positive integers
- Bipolar - Two’s Complement mode (default)
Connections to DAQ board
DAQ Board
Ribbon Cable
Breakout Box
User Wiring
AIGND
ACH0
DAC1OUT
Last Updated 3/28/03 Week 10-11 Material
Basic Labview DAQ VI’sFor Analog Input, there are three basic types of VIs:
Easy, Intermediate, and Advanced
Analogous VI’s for output!
Single Point Analog Input - Reads a single point as an immediate, non-buffered operation
Inputs - Device number (usually 0 unless you have more than 1 DAQ board). Set during DAQ configuration in Windows.
- Channel number to be digitized
Output - Measured voltage
Last Updated 3/28/03 Week 10-11 Material
Buffered Analog InputThe single point measurement VI has limitations:
• Lots of computation time required when VI called since VI must initialize DAQ board.
• No sense of timing for successive reads… can’t control when VI executes!
Better approach is to read successive data points into a predefined BUFFER. Intermediate VI’s offer more flexibility for reading in voltage waveforms.
Intermediate Vis: AI Clear, AI Config, AI Read, AI Single Scan AI Start
Last Updated 3/28/03 Week 10-11 Material
Intermediate VI’sConfiguration - Inputs are Device and Channel as well as BUFFER size
Start - This VI sets the scan rate, the number of scans to acquire, and the trigger conditions. The VI then starts an acquisition.
Scan rate is digitization rate: How many values are recorded per second.
Number of scans: How many values to read?
TOTAL time scan is (number of scans)/scan rate.
Trigger conditions: can be configured similar to Oscilloscope.
Last Updated 3/28/03 Week 10-11 Material
Intermediate VI’sRead from BUFFER - Read specified number of points from buffer (or all of them).
Output is Scaled Data - In units of Volts
Frees the DAQ board for use by other applications, deallocates memory for buffer etc.
Chain of commands...
Task ID
Error In/Out
Example VIs at end of Lecture
Last Updated 3/28/03 Week 10-11 Material
For Lazy/ High Level People Like meHigh Level Commands - (it slices, it dices, it does work of 4 VI’s!!)
Opens Device and Channels, reads values, and Returns values as outputs. (Single point, Multi Channel)
Opens Device and Channels, Read data into buffered array and outputs Buffered array. User Specifies Number of Scans, Scan Rate, Iteration, and Clear Acquisition condition.
Same as above, but continuously reads in a circular buffered array.
Last Updated 3/28/03 Week 10-11 Material
Iteration and Clear AcquisitionIteration is used to optimize operation when you execute this VI in a loop. When iteration is 0 (default), LabVIEW calls the AI Config VI to configure the channel. If iteration is greater than 0, LabVIEW uses the existing configuration, which improves performance. You usually wire this input to an iteration terminal.
Clear Acquisition determines whether the VI clears the task after reading the specified number of scans. You should pass a value of TRUE for this parameter when reading the last set of scans for a given acquisition. The default is TRUE, which means that if you leave this input unwired, the VI reads data only once. You normally wire this input to the terminating condition of a loop, so that when the loop finishes, the VI clears the acquisition.
Example VIs at end of Lecture
Last Updated 3/28/03 Week 10-11 Material
Testing out the DAQs• On Desktop (or START button), open up National Instruments Test and Measurement Icon.
• Click on Devices and Interfaces - You should see GPIB board, Serial interface (RS232), and DAQ card
• Click on DAQ card
• Gateway PCs- Lab-PC 1200AI
• Old PCs - Lab-PC+
• Open up test panels and follow instructions
• Connections on Breakout board - connects written on board for Lab-PC+
Last Updated 3/28/03 Week 10-11 Material
Connections - Lab-PC 1200AI
Acrobat Document
Sample Program - Data Acquisition
Sample Program - DAQ example 2
High level VIs
Intermediate level VIs
Acrobat Document
Last Updated 3/28/03 Week 10-11 Material
Introduction to Fast Fourier Transforms
Last Updated 3/28/03 Week 10-11 Material
Examples of FFT for Lab 13
Square Wave Generator
FFT Power Spectrum
0.00
Y
dt
t0
F requenc y D omain
frequenc y Interva l
sampling info
frequenc y
T ime D omain
1.0
-1.0
-0.5
0.0
0.5
1.00.0 500.0m
Time Domain
0.5
0.0
0.1
0.2
0.3
0.4
1.0k0.0 500.0
Frequency Domain
Last Updated 3/28/03 Week 10-11 Material
FFT - Negative and Pos components
0 .5
0 .0
0 .1
0 .2
0 .3
0 .4
1 .0 k0 .0 5 0 0 .0
DC frequency
Nyquist Freq
+ Freq - Freq
Last Updated 3/28/03 Week 10-11 Material
Note with FFT• Spectrum depends on whether input is sine wave, square wave, triangular wave
• FFT routines usually prefer the number of data points to be powers of 2.
• FFT routine DOES NOT NEED to know scale of x axis. You need to figure that out on your own!
FFT output is the same number of points as the input array.
So Frequency spacing of FFT output is f = 1/(total time).Eg. For a 1000 point array digitized at 1KHz, total time trace is 1 second so each point in FFT spectrum is separated by 1Hz. Frequency resolution depends on time of total trace.
Notice that FFT power peak shifts as number of cycles changes! In FFT example from previous slide. Why? Frequency Changes!!
Last Updated 3/28/03 Week 10-11 Material
AliasingImagine for the FFT VI example that the time duration of the waveform is always 1 second.
The Frequency control indicates the frequency of the input signal (in Hz).
The Sampling Rate control indicates the digitization rate of the input signal (in Hz).
Note that as we use Frequency=10 and decrease sampling rate from 1kHz to 20.01Hz that we always get a 10Hz signal in the power spectrum but other frequencies which depends on the sampling rate. WHAT IS THIS?
Artifact due to Aliasing! When Sampling rate is less than 20, (you can not do it with this example since the SQR wave VI is too smart) a new signal appears BELOW the f/2 Nyquist sampling limit!
Last Updated 3/28/03 Week 10-11 Material
Waveform data Type• The data type of choice for X-Y graphs!
• Specify t=0
• Specify t
• Specify voltage array
Behaves as a Cluster data type. Individual Waveforms pallete available for many manipulations of Waveforms.