Data Acquisition Overview 1 Using LabVIEW to acquire, analyze and record data.
-
Upload
berenice-fletcher -
Category
Documents
-
view
222 -
download
5
Transcript of Data Acquisition Overview 1 Using LabVIEW to acquire, analyze and record data.
Data Acquisition Overview
1
Using LabVIEW to acquire, analyze and record data
Data Collection
One shot
vs. time
Using the while loop
Using the DAQ for timing
2
DAQ set up for both
Choose RSE or differential, usually the latter
Choose voltage range to match your expected inputs
3
DAQ set up for while
Collect one sample
DAQ set up for DAQ timing
Collect N samples
Put controls on the front panel for rate and number of points
Timing
4
Saving Data
Use the Write to Measurement vi
For one shots or while loop control set up: Append to File
One File onlyOne header onlyOne time column only
General set up
For DAQ timing: Use next available file name.
5
Power Spectra
Use Spectral Analysis
Set to power spectrum, linear
Use DAQ timing
Number of points must be a power of 2, N = 2k
Sampling frequency (rate) must be high enough that half the frequency,the so-called Nyquist frequency,
exceeds the highest expected frequency
6
(Maximum sampling frequency for USB6009 is 48 kHz)
7
Zero Offset
Correct using a high pass filter
Install a control for the cut-off frequency
Aliasing
Test for by changing the sampling frequency
Other Power Spectra Issues
8
Power spectra amplitudes and frequencies
Use the Peak Detector vi
Create controls for threshold and peak/valley
Create indicators for number detected, locations and amplitudes(but see below)
Wire the output of the Spectral Analysis vi to the X (input) terminalof the Peak Detector
Optional: Multiply the output of the locations terminal by rate/(number of points)
to convert location to frequency
9
DAQ
Filter
Spectrum
Peaks
File
Raw data
The spectrum
I think we can record peaks as well,but I haven’t done it yet.
Spectral Analysis Schematic
10
Data Analysis Overview
What to do with your data when you’ve got itsitting in an Excel file
11
Possible tasks
Calibration, interpolation
Deducing constants in a theory
Deducing a theory
Characterizing variation in material properties
12
Calibration, interpolation
Generally a polynomial trendline is good enough
Assess the fit using R2, which you get for free, but which isn’t as good as
Standard deviation of the fit
€
s =
y i − y i( )2
i
∑n − k
(We have not explored techniques by which we can choose a “best” k.)
13
Characterization of Material Properties
You can use interpolation if you are fully ignorant
You can fit models if you have one
If you have time, energy and intuition, you can perhaps dream up a model
and assess it!
We looked at the Andrade model for the viscosity of water
14
Deducing Constants in a Theory
Write out the theory
Beat your data into a form that you can fit in Excel
Find the trendline
Convert back to theory
Assess the result using s.
15
Bernoulli Example
Theory:
€
h = h0 − CD
AE
AT
2gh0 t +1
2gCD
2 AE
AT
⎛
⎝ ⎜
⎞
⎠ ⎟
2
t 2
€
Plot h vs. t and fit a quadratic equation.
Calculate s for the fit
Is s consistent with the expected errors in the data?
Do the two values of CD you calculate agree with each other?
16
Cooling Curve Example
Theory:
€
T = Tf + Ti − Tf( )e−kt
You need to know, measure or estimate Tf.
Plot ln(T-Tf) vs. t
Fit a linear trendline: m = -k and b = ln(Ti-Tf)
Assess the fit in the original data:
€
s =
Ti − T i( )2
i
∑n − 2
€
T = exp b − mt( )
17
Deducing a Theory (Boyle’s Law)
Plot the data and look at it
18
Looks good, but what is it?
It’s not linear
You can make a polynomial fit, but . . .
there’s no physics in that — not a good idea
Note: p = 0 —> V —> ∞; V —> 0 —> p —> ∞.
A power law might be a good thing; plot ln(p) vs. ln(V).
19
20
Nice trendline (which you should assess)
The linear term is the exponent, looks like -1.
Carry on with the hypothesis pV = constant.
(We did this and I won’t do it again here.)