why digital? - transducers: analog output. - analog … · why digital? - transducers: analog...

51
Digital instrumentation principles 1 DIGITAL INSTRUMENTATION PRINCIPLES WHY DIGITAL? - Transducers: analog output. - Analog to digital: - precision - values not changed during processing - signal processing using micro-processing.

Upload: vuonghuong

Post on 18-Aug-2018

261 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 1

DIGITAL INSTRUMENTATION PRINCIPLES

WHY DIGITAL?

- Transducers: analog output.

- Analog to digital:

- precision - values not changed during processing - signal processing using micro-processing.

Page 2: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 2

- Analog signal is converted into a digital signal: sampling and hold.

Page 3: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 3

• Switch is closed (sampling phase), delay • Switch is opened (holding phase), delay

Page 4: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 4

• Delay on switching from hold to sample (acquisition time). • Binary digits 1 or 0,

o '1' (high): Vcc down to +2V, o '0' (low): 0V up to +0.8V

Page 5: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 5

THE SAMPLING THEOREM

“A continuous signal can be represented completely by, and reconstructed from, a set of instantaneous measurements or samples of its voltage which are made at equal spaced times. The interval between such samples must be less than one-half of the period of the highest-frequency component in the signal”.

Convert an analog signal into digital samples and convert them back into original signal provided the number of samples per second is more than twice the highest frequency in the signal.

Page 6: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 6

Suppose the signal contains a higher frequency than we expected, so that in fact the number of samples per second is less than twice that frequency. We then get what is known as aliasing.

Page 7: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 7

• Instrumentation signal is a varying voltage (not a regularly repeating waveform).

• By Fourier analysis, any such shape can be shown to be a summation of a constant term (DC voltage) and sine waves of various amplitudes and frequencies.

Page 8: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 8

ANALOG TO DIGITAL CONVERSION

1. Single-slope or single-ramp A/D converter

. Simple

. Cheap

. Comparatively slow

. Inaccuracy

Page 9: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 9

2. Dual-slope A/D converter

Cancels out inaccuracy due to variations in clock frequency or ramp slope by using two ramps in a count-up, count-down process.

Page 10: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 10

. Accuracy is unaffected by drift (upward and downward ramps are affected equally).

. High-frequency noise disappears in the integration

. Changes in the analog input signal during the integration period are averaged out.

. Slow speed (digital voltmeters and applications does not require fast conversion).

Page 11: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 11

3. Successive-approximation A/D converter

Faster than the ramp type

- Set 1 starting from MSB, - Compare: < analog, retain 1, else =0, - Continue to lower bits

Page 12: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 12

4. Parallel, simultaneous or “flash” A/D converter

Fastest converter of all

Page 13: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 13

. n-bit converter requires (2n-1) comparators (additional bit doubles comparators).

. Single integrated circuit chip.

. Limit is 11 bits (12-bit resolution=two 11- bit chips in series)

. 8-bits is a more usual size (255 comparators, 20 million A/D conversions per second.

Page 14: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 14

A/D Consideration:

• Saturation error (full scale, upper/lower limits)

• Resolution and quantization error

� full scale/2n

• Conversion errors (non-linearity, zero-offset, scale error)

• Sample rate

• Signal conditioning for A/D conversion (prevent aliasing: filter removes >fs/2)

Page 15: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 15

DIGITAL TO ANALOG CONVERSION

R-2R ladder

Page 16: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 16

Page 17: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 17

. types

. resolution

. speed (settling time: time it takes for a full scale input to be converted to within half of the least significant bit (1/2 LSB)).

. The number of bits also determines the resolution.

. Each additional bit in the binary number doubles the number of steps in the graph, and so halves the (theoretical) maximum error in the output voltage.

. The actual maximum error depends also on the stability of the reference voltage applied to the chip and the stability of the resistors in the switching circuit.

Page 18: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 18

A COMPLETE DIGITAL SYSTEM

. First LPF filters out high-frequency noise and prevent aliasing,

. Digital filter between the A/D and D/A converters

. A digital filter more precise than the analog version

Page 19: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 19

. Never get absolutely perfect reproduction of the input signal at the output

. Process of sampling changes a smooth analogue curve into an approximation composed of steps made up of horizontal and vertical lines

. Superimpose the approximation onto the original curve will show the divergence between them is a maximum at the sharp corners of the steps

. By working from sample voltages, noise is introduced (quantization noise)

. Lower quantization noise: reduce the height of the steps by increasing the number of voltage levels at which the LSB changes by 1, and this will require more digits in the digital conversion of the voltage samples.

Page 20: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 20

Example:

1. Question 4: (20 marks) – Final 2001

Consider the circuit in a temperature measurement below. The A/D is a 5-bit successive-approximation A/D converter type with an analog span of 0 to 10V, find the input voltage of the A/D converter. The thermistor, RT, has a resistance of 2K at 20OC and the coefficient β is assumed to be constant at 1650, find temperature of the thermistor.

)TT

(

T eRR 0

11

0

−−−−ββββ====

_ +

1M

1M

10M

10M

12V

5-bit A/D 0-10V

4.7K 4.7K

4.7K RT

tOC= ?

MSB

LSB

1 0 0 1 1

?

V2 V1

Page 21: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 21

Data-acquisition systems (DAS)

• Measurement system quantifies and stores data.

• Dedicated microprocessor systems continuously perform their programming instructions to: � measure, � store, � interpret, � provide process control without any intervention.

Page 22: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 22

• Microprocessors have I/O ports to interface with other devices to measure and to output instructions.

• Programming allows for operations such as, which sensors to measure, and when and how often, and for data reduction.

• Programming can allow for decision-making and feedback to control process variables.

Signal flow scheme for an automated data-acquisition system

Page 23: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 23

• Personal computer-based data-acquisition systems:

♦ Hybrid systems combining a data-acquisition package with both the microprocessor and human interface capability of a personal computer (PC).

♦ Using a dedicated microprocessor (handling repetitive tasks involving measurement, recording, and control and portable.)

♦ Direct serial or parallel communication with a host computer is possible.

♦ Availability and flexibility

♦ Data can be recorded

♦ Computer can be used to interface with control equipment, make programmed decisions to control the measured process, to send data over a network line, to reduce the data into results, and to write the final report.

Page 24: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 24

DAS Components:

1. Signal conditioning:

a. Filters: analog or digital

b. Amplifiers or attenuators:

Page 25: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 25

c. Shunt circuits

2. Analog multiplexers

Page 26: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 26

3. A/D converter

4. D/A converter

5. Digital Input-Output:

1 or 0 , level voltages depend on interfaces (TTL, CMOS: 1.8V, 3.3V, 5V, ...)

6. Central Processing Unit: microporcessor

Speed (clock and bus size) Stand alone (direct application uP)

7. Memory

RAM, ROM, external memory

Page 27: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 27

8. Central Bus

9. Buffers

Small amounts of pre-assigned RAM. Holding tank (between 2 devices operating at different speeds).

Page 28: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 28

Data conversion in a process control system

Page 29: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 29

Analog meets digital

Page 30: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 30

Analog Input-Output Communications

1. Data-Acquisition boards

Page 31: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 31

2. Single- and Differential-Ended Connections

3. Special signal conditioning modules

4. Data-acquisition triggering

5. Data transfer

Page 32: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 32

A strain-gauge interface (on-board Wheatstone bridge). Gauges are connected by wires to the interface

Page 33: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 33

A 16-Bit, 200-kHz PCI Data Acquisition Board

• 16-bit, 200-kHz A/D converter

• 100% digital calibration

• DMA bus mastering for synchronous analog I/O, digital I/O, and counter inputs

• Up to four 16-bit, 100-kHz analog outputs with infinite continuous waveform output capability

• 40 digital I/O lines, can be scanned synchronously or asynchronously with analog inputs

• Four counter/pulse input channels can be scanned synchronously or asynchronously with analog inputs

• Two timer/pulse output channels

Page 34: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 34

• The PC

• DAQ Hardware

• Software

• Signal Conditioning

• Transducers

Page 35: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 35

DAQ Hardware:

- Analog inputs:

o Number of Channels

o Sampling Rate

o Resolution

Digitized Sine Wave with a Resolution of Three Bits

o Range

o Settling Time (changing between channels, signal strength, …)

o Noise (proper shielding, layout technique,…)

Page 36: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 36

- Analog outputs (D/A):

o Settling time

o Slew rate

o Resolution

- Digital I/O (communications)

- Timing I/O:

o Counter resolution (number of bits)

o Clock frequency

Page 37: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 37

DAQ Software:

Software transforms the PC and the DAQ hardware into a complete data acquisition, analysis, and display system (LabVIEW)

National Instruments created VI Logger application software to aid users in data logging applications

Page 38: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 38

Automobile Lubricant Test Application showing a SCXI Chassis and LabVIEW running on a Macintosh

Page 39: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 39

Digital Input-Output Communications

• Standards to communicate between digital devices

• Serial (bit by bit) or parallel (byte by byte)

• Handshake (interface procedure)

• Signal levels

Page 40: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 40

1. Serial Communications RS-232C

• Protocol allows two-way communication by using two single-ended signal (+) wires: TRANSMIT and RECEIVE, between data-communications equipment (DCE) and data-terminal equipment (DTE).

• A signal GROUND wire allows signal return (-) paths.

• The remaining wires in the original standard are used to access the state of the telephone lines, if needed.

Page 41: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 41

• Minimum number of wires required between DTE and DCE equipment is the three-wire connection (TRANSMIT, RECEIVE, and GROUND lines)

Standard RS-232C assignments to a 25-pin connector

Page 42: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 42

• Communication between similar equipment, DTE to DTE or DCE to DCE, requires only the nine lines

Standard serial connections between DTE and DTE or DCE to DCE equipment

Page 43: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 43

• Data are sent in successive streams of information, 1 bit at a time.

• Value of each bit is represented by an analog voltage pulse (1 and 0) distinguished by two equal voltages of opposite polarity in the range of 3-25V.

• Communication rates are measured in baud, (number of signal pulses per second).

• A typical transmission is 10 serial bits:

♦ 1 start bit, 7-or 8-bit data stream, 1 or no parity bit, terminated by 1 or 2 stop bits.

• The start and stop bits form the serial "handshake"

• The start bit allows for synchronization of the clocks of the two communicating devices

• The parity bit allows for limited error checking.

• Asynchronous transmission: information may be sent at random intervals.

Page 44: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 44

Page 45: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 45

2. RS-422A/423A/449/485

• 37-pin connector and differential-ended connections to reduce noise,

• Rates up to 2-M baud

• Distances up to 1000 m.

• +5V TTL pulse signal to distinguish between a 1-bit (+2 to +5.5V) and a 0-bit (-0.6 to +0.8V).

• RS-485 protocol allows for multidrop (allows up to 32 to 255 devices on one line) operation that is well suited to local area networks (LANs).

Page 46: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 46

RS449 / V.11 RS-449

Page 47: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 47

3. Universal Serial Bus

• Permit peripheral expansion for up to 128 devices

• Support low to medium transfer rates from 1.5Mbs up to 12Mbs.

• Supports a "hot swap": allows to plug in without reboot.

Page 48: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 48

4. Parallel Communications GPIB (IEEE-488)

• General purpose interface bus (GPIB)

• High-speed parallel interface

• 16-wire bus with a 24-wire connector.

• 8 data lines

• 8 lines for bus management and handshaking (two-way control communication)

• 8 lines are used for grounds and shield.

• Bit parallel, byte serial communication at data rates up to 1 Mbyte/s

• GPIB devices: Listeners, Talkers, and/or Controllers

Page 49: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 49

Page 50: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 50

Page 51: WHY DIGITAL? - Transducers: analog output. - Analog … · WHY DIGITAL? - Transducers: analog output. - Analog to digital: ... Convert an analog signal into digital samples ... ¤

Digital instrumentation principles 51

2. Example:

The above arrangement is used to measure the velocity of a moving vehicle. The waveform shown at the input display is the output of the D/A converter (data from the A/D connects directly to the D/A). Ignore quantization error, find the A/D output word. Sketch analog input voltage waveform at the input of the A/D converter, the input of amplifier A and the accelerometer output. The accelerometer has an inversion factor of 0.25V/m/s2 (i.e., 250mV corresponds to 1m/s2). Find the final velocity of the vehicle if its initial velocity is 100Km/h and sketch the velocity display of the vehicle.

_ +

100K

5µµµµF

Accelerometer 8-bit A/D, 0-10V

µµµµP and D/A

Input display

? ? ?

6.6V

0 10 t(s)

Velocity Display

. . . .

0 10 t(s)

Km/h

?

MSB

LSB

A

Gain=100

?