Measurement, Sensors, and Data Acquisition in the Two-Can System Prof. R.G. Longoria Updated Fall 2010
Goal of this week s lab Gain familiarity with using sensors Gain familiarity with using DAQ hardware Build familiarity with LabVIEW for DAQ applications Build data collection VIs Learn how to capture waveforms Learn how to save data to a spreadsheet/measurement files Compare model and experiment results; improve model predictions
Discuss here Measurement and sensor concepts Data acquisition concepts Analyzing acquired data (signals) for specific purpose(s)
Measurement System Context S Power Flow Measurement System Outputs for Knowledge or Control Referent - a system attribute that appears relevant (e.g., state variables) Measurand (True Value) Sensor System Optional Aux. Power Transduced signal Signal Conditioning Auxiliary Power Signal or information Recorder/Indicator Processing Controller Measurand - a referent that is measurable Most modern measurement systems end up transforming measurands into electrical (or optical) form.
Sensor Concept Sensors provide a measurand by taking advantage of how material or geometric properties relate to changes in a measurable quantity. Measurand (True Value) Sensor System Optional Aux. Power Transduced signal This quantity is either directly or indirectly converted into a form useful for processing. Functional design around the sensing mechanism yields a usable output signal. Measurand (True Value) Primary System System interacting directly with process under measurement Secondary System Transduced signal
Types of Electromechanical Sensors Resistive Sensors Capacitive Sensors Inductive and Magnetic Sensors Piezolelectric Sensors
Electrical Signal Domains The conversion of a physical quantity into electrical form is often done to indicate a direct relation. For example, the voltage level may be directly related to pressure. In general, however, the information about the physical quantity can be encoded in the signal in many different ways. Three major ways to encode a physical signal: 1. analog - in which the magnitude of an electrical quantity is related to the information of interest 2. time - in which the time relationship between changes in signal level is related to the information of interest 3. digital - in which an integer number is represented by binary level signals
Electrical Signal Domains From Malmstadt, et al, Electronic Meas for Scientists analog - many electromechanical sensors are of this form; potentiometers, thermistors, etc. digital - counters, a/d converters, etc. time - some devices generate signals where frequency is a function of a physical quantity; e.g., a tachometer
Electrical Signal Domains Example: Thermistor digital thermometer From Malmstadt, et al, Electronic Meas for Scientists
ò Graduated Stem Pressure P m Example: Analog vs. Digital Tire Spring Spring Air C C Pressure Gauge dt 1 I T x x Calibrate for Pressure Piston/stem mass 0 Leakage Q l Valve Stem 1 valve R Air Leakage, Q l Tire Pressure P m E Digital tire gauge (Radio Shack)
Digital Tire Pressure Gauge Digital tire gauge (Radio Shack)
Level measurement in two-can Many ways to measure level in the two-can system. This is a resistive level sensor we ve built for the two-can system. Height goes as the inverse of resistance (or impedance) of the water between the probes. *As height drops, resistance goes up.
1 psi ~ 28 in of water Pressure Sensors Most pressure sensors feature a diaphragm that responds to applied pressure. This diaphragm contacts a small beam with strain gauges. A sensing mechanism of some type converts the response to a proportional electrical signal. This diaphragm in the PX409 pressure sensor is micromachined to include piezoresistive strain gauges.
Can Emptying Measured Volume [ml] 1000 900 800 700 600 500 400 300 200 100 0 Volume vs. Time for Can1 This is volume data during a one-can emptying experiment collected using the PX409 pressure sensor (calibrated for can volume) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Time [sec] ρg 1 A P = ρgh = Ah = V where C = hydraulic capacitance A C ρg
Digital data acquisition (DAQ) Basics about signals and how they are measured by data acquisition (DAQ) hardware that use analog-to-digital conversion (ADC). How to build simple programs in LabVIEW for acquiring signals, displaying the data, analyzing the data, and storing the data for later use.
A/D Converter in DMM Although it is not hard to find an analog multitester, digital devices are much more common. In a DMM, signal conditioners convert the quantity under measure into a voltage to be read by an A/D converter. From Using Your Meter by A.J. Evans, Master Publishing, Inc., 1994.
Computers rely on DAQ Data Acquisition (DAQ, dak ) hardware is used to form a communication interface between a computer and the real world. There is a lot of DAQ hardware available from very low cost to highend. Choose as needed for your application.
DAQ Functions Besides A/D Analog Output Generate DC Voltages General waveforms (Function Generator) Digital I/O General low (0V) and high (5V) pulses Read digital pulses Timing I/O Generate pulse trains (square waves) Read frequency, time values
What do you need to know? Resolution and range How fast to sample* How many times to sample General Concepts Device and configuration (MAX) Connecting the signals the right way What channels to sample How to deal with the data* Hardware Specific The lab experiments are meant to provide experience with these concepts.
Analog-to-Digital Conversion The A/D converter (ADC) converts an analog voltage into a binary number through the process of quantization. The ADC will have a full-scale voltage range over which it can operate. The number of bits will dictate how many discrete levels will be used to represent measured voltages. For example, an 8-bit converter with a full-scale voltage of 10 V will give you a resolution of 10V/256 which is 39.1 mv.
A/D Conversion Signal entering the computer must be discretized in amplitude as well as time (sampling). Contrast n = 3 versus n = 16 Resolution: VFS = n = 2 10V 3 2 10V 16 2 = 1.25V = 0.15mV
Choosing a sampling or scan rate (scans/sec, or Hz) The ADC samples according to a scan rate. How fast you sample should satisfy the Nyquist sampling theorem. The sampling frequency should be at least two times the highest frequency present in the signal. Not satisfying Nyquist criterion has implications in how the signal is reconstructed.
Selecting a sample rate Depending on your objective, you might choose scan rate to satisfy Nyquist criterion. But you might also want to have accuracy in time measurements. Can you see how you have to balance how fast you sample, how many samples you get, etc.?
Data Acquisition Usage in Lab Build a virtual instruments in LabVIEW to acquire and graph voltage signals from pressure sensors and to conduct calibration. The VI should save waveforms to a measurement file for post-processing. Analyze the data Use to arrive at improved estimates of K flow coefficients Compare to simulation results
Methods for finding K Simple one-can experiments, measuring volume and time to empty (last week) Use pressure (volume) data over time More accurate determination of critical heights, time values, etc. Captures volume-time characteristic (shape) Enables comparison to simulation directly or to analytical model
One-Can Experiments Case 2 dv Q in = 0. = 0 Q dv out or = K V dt dt Volume is a dynamic state. h Solution: Q out V constant K V ( t) = Vo t,0 t T 2 2 e 1 0.8 Vo Ko 2 0.6 2 t t τ eq 1 e 0.4 0.2 K = 1 V = 1 dv = K V dt Nonlinear can o 0 0 0.5 1 1.5 2 t Linear cans never empty dv = KeqV dt
Fitting Data to Analytical Solution The analytical solution is a quadratic equation: 2 2 K K 2 o o o V ( t) = V t = t K V t + V 2 4 There exist general routines that will fit experimental data (i.e., for volume over time) to polynomials of this form. Another approach is to derive a solution for K from minimizing the sum of the squared error, 2 de i 0 dk = K e = V V ( t ) = V V t 2 i i i o i This results in a formula for K that is a function of the volume-time data. 2
Comparison of Different Methods 10 x 10-4 8 6 4 measured LSE-1 LSE-2 Vo & Te Simulation results from using different K values are shown plotted with measured volume data. From LSE 2 0-2 0 5 10 15 20 25 30 You are expected to derive and test your own methods for finding K using this data.
How do I know my method works? Simulate the experimental data collection! Use your K values from the previous week s lab work.
Summary Use a known physical problem (two-can) for purposeful learning of DAQ usage, signal processing, etc. Experience with using pressure sensors (offthe-shelf) Take opportunity to experiment with very basic LabVIEW VI for data collection.