Lecture Slides

Download Report

Transcript Lecture Slides

ME 322: Instrumentation Lecture 19

March 4, 2015 Professor Miles Greiner LabVIEW program, A/D converter characteristics, actual measured grounded output, Input resolution error

Announcements/Reminders

Please fully participate in each lab and complete the Lab Preparation Problems

– For the final you will repeat one of the last three labs, solo, including performing the measurements, and writing Excel, LabVIEW and PowerPoint. – The labs help prepare you for the final • • HW 7 due Friday Lab 6 (wind tunnel) this week – Please see schedule on WebCampus and be on time – Bring Excel from HW 6 – How are things going in lab this week so far?

LabVIEW

• • • LabVIEW is available in the Engineering Computer Center (ECC) You can buy LabVIEW on the web for around $20, but you don’t have to – http://www.studica.com/us/en/National-Instruments-students-ni-labview-mydaq/labview student-edition/779252 02.html?utm_source=google&utm_medium=ppc&kpid=371806&gclid=COPM1Pym bwCFdBqfgodUF4A4A If you purchases it, you will need to download and install DAQmx after installing LabVIEW to use the Measurement I/O icons we use in class – http://www.ni.com/dataacquisition/nidaqmx

LabVIEW Five Main Acquisition Steps

Measurement I/O, NI DAQmx 1) Create a channel 2) Timing 3) Start Process 4) Read Data analog waveform – – – 1 Channel N-Samples Output voltage – convert to ̊ C 5) Clear the test Programming; Dialog and User Interface simple error handler • • • In this class we give and modify example LabVIEW programs.

The intent is to help you quickly learn to perform data acquisition programing. However, we don’t deal with structured programming.

LabVIEW program

Computer Data Acquisition (DAQ)

• • • • • Sensors detect measurands and produce signals – Voltages, currents, resistances, pulses,… Conditioners convert those output signals to moderately large voltages Multiplexer (MUX) sweeps channel-to-channel and feeds individual signals, at different times, to the Analog-to-Digital (A/D) converter A/D converter samples real voltages (7.674337…V) and converts them to integers (0, 1, 2,…) that the digital computer can work with.

Computer programs store and/or process the data – In ME 322: LabVIEW and DAQmx drivers

• • •

How “could” an A/D Converters work?

V RU 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 V ST x V x V Measured x V RL 0 I OUT = 1 T S I OUT t = 2 2T S I OUT = 5 3T S One “method:” Saw Tooth Compare (not really used) – Function generator produces ramps from V RL to V RU within period T S – Converter break T S into M (= 2 N , N = integer) equal sub-steps – I OUT for each time step is the first sub-step when V ST ≥ V MEASURED To interpret I OUT –

V

Digitized = V RL + (I OUT + 1/2 )[(V RU -V RL )/M] ± (1/2)(V RU -V RL )/M

Uncertainty decreases as M = 2 N increase, and/or FS = V RU -V RL decreases Measurement is associated with center of time period – Time uncertainty: ±T S /2

Characteristics of A/D Converters

• • Full-scale range V RL ≤ V ≤ V RU – FS = V RU - V RL – For myDAQ the user can chose between two full-scale ranges • ± 2 V, ± 10 V • for Lab 7, 0 to 2.5 V, which range is used?

Number of Bits (in its digital word) N – The A/D converter breaks the full scale range into 2 N ranges – – For myDAQ, N = 16, 2 16 = 65,536 sub What does this mean?

• For example, a 2 bit word __ __ , in which each bit can be 0 or 1 • Has 2 2 = 4 combinations: 00, 01, 10, 11 • These are the digital signals (words) the A/D converter passes to the computer

Sampling Rate

• • • Sampling Frequency – f S = samples converted to digital per second [Hz] Sampling Period – T S = 1/ f S ; timed required to find I OUT myDAQ – (f S ) max = 200,000 Hz, T S = 0.000,005 sec = 5 m sec – User can chose lower rates – If both channels are used, then (f S ) max = ?

Hz

myDAQ Absolute Voltage Uncertainty

(0.11%FS) (0.19%FS) (0.12%FS) (0.22%FS) • • More information myDAQ – user guide, page 36-38 – http://wolfweb.unr.edu/homepage/greiner/teaching/MECH322Instrumentation/Labs/Lab%2007%20Boiling %20Water%20Temperature/Lab7%20Index.htm

Demonstration – Short myDAQ Analog Input 1 and observe signal • What “should” the reading be when shorted? – In my office: • ±10 V range: V ~ -0.0008 to -0.0026 V = 1.7 ± 0.9 mV (0.009% FS) • • ±2 V range: V ~ -0.0003 to -0.0009 V = 0.6 ± 0.3 mV (0.02% FS) Is it larger at higher voltages? – Same in class?

Example

For a ±10 Volt, N = 2 bit A/D converter, what digitized voltages will it report for -∞ < V < +∞?

– – – M = 2 N • • Break input range into __ steps I OUT = __ sub-ranges can be 0, 1, 2, 3 Step size = uncertainty?

𝑉 𝑅𝑈 −𝑉 𝑅𝐿 𝑀 = How do we interpret I 10𝑉 −(−10𝑉) OUT 2 2 = 20𝑉 4 = 5 𝑉 (V Digitized ) and what is its 3 A/D Converter Transfer Function 2 1 0 -15 -10 -5 0 V IN [volts] 5 10 15

Input Resolution Error

• • • 𝐼𝑅𝐸 = 1 2 𝐹𝑆 2 𝑁 = 𝑉 𝑅𝑈 −𝑉 𝑅𝐿 2 𝑁+1 At edge of range 𝐼𝑅𝐸 → ∞ – Don’t go there! (by design) IRE quantifies the random error from digitization process – IRE decreases (improves) as • N increases • • 𝐼𝑅𝐸 𝐹𝑆 = 1 2 𝑁+1 For N = 16, 𝐼𝑅𝐸 𝐹𝑆 = 1 2 17 = 7.6 × 10 −6 , IRE = 0.000,76%FS

• • •

A/D Converter Characteristics

Full-scale range V RL ≤ V ≤ V RU – FS = V RU - V RL – For myDAQ the user can chose between two ranges • ±10 V, ±2 V (FS = 4 or 20 V) Number of Bits N – – Resolves full-scale range into 2 N sub-ranges Smallest voltage change a conditioner can detect: • D V = FS/2 N – For myDAQ, N = 16, 2 16 • • ±10 V scale: ±2 V scale: = 65,536 D V = 0.000,31 V = 0.31 mV = 310 m V D V = 0.000,076V = 0.076mV = 76 m V Sampling Rate f S – = 1/T For myDAQ, (f S ) MAX S = 200,000 Hz, T S = 5 m sec

• • • •

Input Resolution Error

The reported voltage is the center of the digitization sub-range in which the measured voltage is found to reside. – So the maximum error is half the sub-range size.

Inside the FS voltage range – 𝐼𝑅𝐸 = 1 2 𝐹𝑆 2 𝑁 = 𝑉 𝑅𝑈 −𝑉 𝑅𝐿 2 𝑁+1 At edge or outside of FS range – – 𝐼𝑅𝐸 → ∞ To avoid this, estimate the range of voltage that must be measured before conducting an experiment, and choose appropriate A/D converter and/or signal conditioners. The IRE is the uncertainty caused by the digitization process

Scale ±10 Volts ±2 Volts

myDAQ Uncertainties

Absolute Accurcacy 23 ° C Absolute Accurcacy 18-28°C 22.8 mV 4.9 mV 0.1% FS 38.9 mV 8.6 mV 0.2% FS Measurd Shorted Voltage Error Input Resolution Error (IRE) 2.4 mV 0.9 mv 0.15 mV 0.03 mV 0.01 -0.02% FS 0.0008% FS • • What are these?

– AA: Maximum error of the voltage measurement reported by the manufacturer for all voltage levels • At different temperatures – – MSVE: Maximum error measured at V = 0V for one device IRE: Random error due to digitization process Which one do you think characterizes voltage uncertainty?

Example (cont)

Break Range into 4 Steps Input Range (V) -10 to -5 -5 to 0 0 to 5 5 to 10 How to interpret I out 𝑉 𝑜𝑢𝑡𝐷 and its error 1 = 𝐼 𝑜𝑢𝑡 + 2 = 𝐼 𝑜𝑢𝑡 + 1 2 𝑉 𝑟𝑢 2 − 𝑉 𝑁 𝑟𝑙 5 𝑉 + −10 𝑉 B 2 00 01 10 11 I in B 10 0 1 2 3 + 𝑉 𝑟𝑙 V out (V) -7.5

-2.5

2.5

7.5

Eror ∞ ± 2.5

± 2.5

Transfer Function

First Order: Generic Where

Example

Second Order

ζ ≡ damping ration ω n ≡ natural frequency without damping

Example

Second Order