isat 300 computer-based instrumentation (part 2) sampling and a/d converters 11/14/01

27
ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Upload: jessie-goodwin

Post on 12-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

ISAT 300

Computer-Based Instrumentation (part 2)

Sampling and A/D Converters

11/14/01

Page 2: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Sampling (In the context of polling)

•Filter input first

Page 3: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Sampling (In the context of polling)

•Then sample

Page 4: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Sampling of Time-Varying Signals (Measurands)

• When using a computerized data acquisition system, measurements are only made at a discrete set of times, not continuously.

• For example, a temperature or voltage reading (called a sample) may be taken every 0.1 s or every 2 min, and no information is taken for the time periods in between the samples.

Page 5: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Sampling of Time-Varying Signals (Measurands)

a) time-varying signal

(e.g., voltage)

b) signal being sampled

c) the sampled points

(dots)

d) signal can be reconstructed by connecting the dots

Page 6: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Sampling of Time-Varying Signals (Measurands)

• The rate at which measurements are made is known as the sampling rate, expressed in samples/sec or Hz.

• Incorrect selection of the sampling rate can lead to misleading results.

Page 7: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

The problem of aliasing

10 Hz inputsampled at11 Hz

Outputlooks like1 Hz !

Page 8: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

The problem of aliasing (continued)

10 Hz inputsampled at9 Hz

Outputlooks like1 Hz

Page 9: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

The problem of aliasing (continued)

10 Hz inputsampled at8 Hz

Outputlooks like2 Hz

Page 10: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

The problem of aliasing (continued)

10 Hz inputsampled at12 Hz

Outputlooks like2 Hz

Page 11: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

The alias frequency

10 Hz inputsampled at11 Hz

Outputlooks like1 Hz

actualsamplealias fff

Page 12: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

When does aliasing happen?

10 Hz inputsampled at11 Hz

Outputlooks like1 Hz

actualsample f2f

Page 13: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Another pathology

10 Hz inputsampled at5 Hz

Outputlooks like0 Hz (dc)

N

ff actual

sample

Beware if

Page 14: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Avoiding aliasing

To avoid aliasing, sample your signal at greater than twice the maximum frequency of interest. This is a minimum -- 10 X the maximum frequency of interest would be better.

Another way to state this rule is the Nyquist criterion:

see""can you frequency maximum 2

ff s

N

Page 15: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

The A/D converter--produces binary numbers

Page 16: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

A one-bit A/D converter

Vin

Vin > 5 V output = on “1”

Vin < 5 V output = off “0”

InputOutput

Page 17: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

A two-bit (unipolar) A/D converter

10.0 V

7.5 V

5.0 V

2.5 V

0 V0d

1d

2d

3d

N = 2

•Output has 2N possible values (error on page 78?)

Input Output

• Range?

• Span?

Page 18: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

A two-bit (unipolar) A/D converter

10.0 V

7.5 V

5.0 V

2.5 V

0 V0d

1d

2d

3d

N = 2

(Vru - Vrl) / 2N

•How big is each input bin?

Input Output

Page 19: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Input resolution error = Quantization error

10.0 V

7.5 V

5.0 V

2.5 V

0 V0d

1d

2d

3d

N = 2

0.5 (Vru - Vrl) / 2N

Page 20: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Sampling and A/D Conversion

a) An analog signal has been sampled and then converted to digital (2’s complement).

b) This quantization results in error.

Page 21: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Saturation

10.0 V

7.5 V

5.0 V

2.5 V

0 V0d

1d

2d

3d

N = 2

Vin = 12 V

Input

Output

Page 22: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

A two-bit (bipolar) A/D converter

5.0 V

2.5 V

0.0 V

- 2.5 V

- 5.0 V

0d

1d

-1d

-2d

N = 2

0.5 (Vru - Vrl) / 2N

Input Output (2’s complement)

Page 23: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Choosing an A/D converter--resolution

National Instrumentsmodel 16E-4

National Instrumentsmodel 16XE-50

12 bits

16 bits

Page 24: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Choosing an A/D converter--speed

National Instrumentsmodel 16E-4

National Instrumentsmodel 16XE-50

500 kS/s

20 kS/s

(kiloSamples/second)

Page 25: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Choosing an A/D converter--input range

National Instrumentsmodel 16E-4

National Instrumentsmodel 16XE-50

10 V

10 V

Page 26: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Calculating the digital output

• To estimate the digital output of an A/D converter, see page 81.• E.g., for a simple binary A/D converter:

N

rlru

rlinO VV

VVD 2int

Vin = analog input voltageVru = upper value of input rangeVrl = lower value of input rangeN = number of bitsDo = digital output (as a decimal number!)

Page 27: ISAT 300 Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01

Calculating the digital output

N

rlru

rlinO VV

VVD 2int

Example: 8-bit, simple binary A/D converter

Range is 0 to 5V. Input is 3.15V. Find output.

V145.3256

V 5161

0001101016128.161int256V 5

V 15.3int

V 5

2562 that so 8

bd

N

O

rlru

D

VV

N