27
ME 144L Dynamic Systems and Controls Laboratory Department of Mechanical Engineering The University of Texas at Austin Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria Updated Summer 2012

Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

Embed Size (px)

Citation preview

Page 1: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Sensors and Data Acquisition:Two-Can System

Prof. R.G. Longoria

Updated Summer 2012

Page 2: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Electromechanical Sensors

• Resistive Sensors (thermistors, light, etc.)

• Capacitive Sensors

(stud sensor, humidity, …)

• Inductive and Magnetic Sensors

(proximity, distance, …)

• Piezolelectric Sensors (force…)

Page 3: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Interested in measuring level

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.

Page 4: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Many sensors are based on resistive

sensor concept

• The resistance of a uniform conductor is given by,

with ρ the resistivity, L the length and A the constant cross-sectional area through which current flows.

• Resistance changes either by a geometric (A, L) or material change (ρ) in the resistive element.

• Resistance can be directly measured (by an ohmmeter) or through a signal conditioning circuit (e.g., a voltage-divider)

R L Aρ=

Page 5: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Resistive sensors are easy to

condition

• Signal conditioning refers to the devices and

processes we use to modify and/or improve

nature of a sensor signal.

• Examples: filters, amplifiers, etc.

Voltage divider2

1 2out in

Rv v

R R=

+

By using a voltage divider, we can

transform the resistance change into

a voltage change which is more

readily measured.

Page 6: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

We use a pressure sensor that relies

on strain gauges (resistive)Most pressure sensors

feature a diaphragm that

responds to applied

pressure.

A sensing mechanism of

some type converts the

response to a proportional

electrical signal.

This diaphragm contacts

a small beam with strain

gauges.

This diaphragm in the PX409

pressure sensor is micro-

machined to include

piezoresistive strain gauges.

Page 7: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Page 8: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Emptying can measured with

pressure sensorVolume vs. Time for Can1

0

100

200

300

400

500

600

700

800

900

1000

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]

Vo

lum

e [

ml]

This is volume data during a one-can

emptying experiment collected using the

PX409 pressure sensor (calibrated for can

volume)

1 where

g AP gh Ah V C

A C g

ρρ

ρ= = = = ‘hydraulic capacitance’

1 psi ~ 28 in of water

Page 9: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Most modern voltage measurements are

made using a A/D converter

From “Using Your Meter”

by A.J. Evans, Master

Publishing, Inc., 1994.

Even the most basic

electrical measurement

device, the digital

multimeter (DMM) is

formed by an analog-to-

digital (A/D) converter.

A/D converters are found

on many devices, included

as part of modern

microcontrollers.

Page 10: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

General purpose data acquisition (DAQ)

devices include other functions

• Analog Output (AO)

– 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

Page 11: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

What do you need to know?

• Resolution and range

• How fast to sample*

• How many times to sample

• Device and configuration (MAX)

• Connecting the signals the right way

• What channels to sample

• How to deal with the data*

The lab experiments are meant to provide experience with these concepts.

General Concepts

Hardware Specific

Page 12: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

A/D Conversion: QuantizationSignal entering a computer must be discretized in

amplitude and time (sampling).

Contrast n = 3 versus n = 16

3

16

10

2

10

2

1.25

0.152

V

FS

n V

VV

mV

=∆ = =

=

Resolution:

Full-scale

voltage

Page 13: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

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 rate should be at least two times

the highest frequency present in the signal.

• Satisfying the Nyquist criterion helps ensure the

signal is ‘reconstructed’ properly.

Page 14: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

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.

You need to balance how fast you sample, how many samples

you store, etc.?

Page 15: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Data Acquisition in 144L

• Build DAQ VIs to acquire and graph voltage

signals from sensors and to support calibration.

• The VI should save waveforms to a

measurement file for post-processing.

• Analyze the data; relate to physical system

modeling results

• Identify key system parameters

Page 16: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

NI myDAQ

From NI myDAQ User Manual:

myDAQ works directly with NI ELVISmx Software Instruments

See: http://zone.ni.com/devzone/cda/tut/p/id/11420

Page 17: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

•myDAQ can be used with LabVIEW to create data acquistion and control VIs.

•This simple VI shows how DAQ Assist can be used to read from the DMM terminals

of myDAQ.

•See: http://zone.ni.com/devzone/cda/epd/p/id/6407

Using NI ELVISmx as DMM

http://zone.ni.com/devzone/cda/tut/p/id/11213#GetStarted

Page 18: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Using the Audio In/Out on

myDAQ

https://decibel.ni.com/content/docs/DOC-8435

This ‘power’ spectrum is computed using a digital Fourier transform. Essentially,

this power spectral density (PSD) gives a measure of signal power over frequency.

Page 19: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

myDAQ Equalizer Block Diagram

https://decibel.ni.com/content/docs/DOC-8435

Page 20: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

NI myDAQ Guitar Tuner

PC with LabVIEW

USB

NI myDAQ

Yamaha Silent

Nylon Guitar

Headphone

jack

Headphones

myDAQ audio

input

myDAQ audio

output

Compare

to tuner

Page 21: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Guitar Tuner Block Diagram

1. Select a time waveform

2. Send it to a tone

measurement VI (built-

in; slightly modified)

1

2

Page 22: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

In lab, measure the angular

displacement waveform using

myDAQ analog input and process

data using peak detection.

Back to this week’s lab…

It is possible to infer ‘total stored energy’ by

measuring the angular position.

The change in peak angle from cycle to cycle

implies loss in system energy.

Page 23: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Summary

• Experience with using simple sensors (off-the-

shelf)

• Use a known physical problem for purposeful

learning of DAQ usage, signal processing, etc.

• Take opportunity to experiment with very basic

LabVIEW VI for data collection.

• Experiment with myDAQ for quick data

acquisition, testing, and model improvement

Page 24: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Appendix

Page 25: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

NI myDAQ SpecificationsTwo Differential Analog Input and Analog Output Channels

(200 kS/s, 16 bit, +/- 10 Volts)

Access matched analog input and output channels in a +/- 10 volt range through the

screw terminal connectors or +/- 2 volt range through the 3.5mm audio jacks.

+5 , +15, and -15 Volt Power Supply Outputs (up to 500m Watts of Power)

USB powered for maximum mobility, myDAQ supplies enough power for simple

circuits and sensors.

Eight Digital Input and Digital Output Lines (3.3 Volt TTL-Compatible)

Use software-timed digital lines for interfacing both Low Voltage TTL (LVTTL) and 5

volt TTL digital circuits. Each line is individually selectable for input or output.

60 Volt Digital Multimeter (DMM) for Measuring Voltage, Current, and Resistance

The isolated DMM includes the capability to measure both AC and DC voltage and

current as well as resistance, diode voltage, and continuity.

Page 26: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Page 27: Sensors and Data Acquisition - Home - Department of …longoria/me344/lab1/L1C_Sensors… ·  · 2012-06-19Sensors and Data Acquisition: Two-Can System Prof. R.G. Longoria ... NI

ME 144LDynamic Systems and Controls Laboratory

Department of Mechanical EngineeringThe University of Texas at Austin

Other Potentiometric

Sensors

sliding

contact

• • •

∆x

defines resolution

xsliding

contact

L

slidingcontact

Resistance wire

1 3

2

R =

ρ L

A

1

3

2input

voltage

output

voltage

Basic circuit

Resistive(conductive)

element•wire-wound

•cermet•conductive plastic

Angular slider

1 2 3