You are on page 1of 59

Measurements and

Measuring Devices
MEC 232
Lecture_5
Data Acquisition

Instructor: Dr.Wessam Hussein.


Phone: 01063638071
Email: wessam@eaeat-academy.edu.eg
Office Hours: Monday – Wednesday – Thursday
Winter 2022
Connecting digital circuitry to sensor devices is simple
if the sensor devices are inherently digital themselves.
Switches, relays, and encoders are easily interfaced
with gate circuits due to the on/off nature of their
signals.

However, when analog devices are involved,


interfacing becomes much more complex. What is
needed is a way to electronically translate analog
signals into digital (binary) quantities, and vice versa.
An analog-to-digital converter, or ADC, performs the
former task while a digital-to-analog converter, or
DAC, performs the latter.
Data Acquisition
Most of mechatronic applications use computers,
microprocessor, microcontrollers….it is a must to know
how to interface analog world with the digital world.
Why?
1- Compact storage
2- data accuracy
3-Allows use of data and processing

1st Step:
Analog ----------Coded digital values (Sampling)
Data Acquisition
Data Acquisition
• A digital signal is an approximation of an analog one
• Levels of signal are sampled and converted to a discrete
bit pattern.
• Resistor networks can be used to convert digital signals
into analogue voltages
Step (discrete) approximation

“stair-step”
sample approximation
of original
signal

level

more samples give greater accuracy

time
hold time for sample
Data Acquisition

The Question is:


How fast I have to sample?????
Ans: as fast as you can…………..Need large
memory
Conversion of a.c. signals
• The A-D converters had no special problems with d.c.
• What about a.c. signals?
• Example consider reading room temperature and plotting against time
• Not possible to sample at every instant in time
• rate at which we take samples is known as the sampling rate
• sampling too fast can be
inefficient

temp

A3

A2

A1

time
Conversion of a.c. signals

• Sampling too slowly can cause information to be lost

temp

A2

A1

t1 t2 time
Sample Time vs Frequency

• Consider what happens when the signal


frequency is higher than the sampling
frequency.
voltage

time

sample frequency is number of samples / second


Conversion of a.c. signals
• Effects of under- voltage

sampling
– possible to interpolate
high frequency
components as low
frequency ones
– these errors are said to
be caused by aliasing time
Sample frequency must be at least
– important to preceed A- twice the highest signal frequency (2f
D converter with a low is also called the Nyquist Frequency).
pass filter to remove high
frequencies
– known as an anti-aliasing
filter
Example
•What is the maximum frequency of input signal that
can be converted by an A-D convertor with a
conversion time of 0.25 ms without aliasing?

•samples per second = 1000 / 0.25 = 4000 Hz

•Maximum frequency in input signal has to be half


this or 2kHz.
Quantizing Theory

Quantizing: Continuous analog-------discrete states


Coding: assigning a code to each state.
Resolution: # of bits used to approximate analog
values.
N = 2n
N ----- possible states

n ----- number of bits

Ex: 16 bits device………N = 216 states


Quantizing Theory
Quantizing: Continuous analog ------- discrete states
Coding : assigning a code to each state.
Analog-to-digital Conversion

Convert continuous signals to digital values


Requires 3 steps:

1.) Sample analog signal (Nyquist rate) Need a


minimum of 2 x max frequency of interest. Higher
sample rates, easier to reconstruct signal

2.) Hold analog sample value while conversion in


progress

3.) Convert analog value to digital value


Methods of analogue to digital conversion

• flash
• successive approximation
• Delta-Encoded Conversion
The Comparator
– Most A-D converters use a comparator as part of the
conversion process
– A comparator compares 2 signals A and B
• if A > B the comparator output is in one logic state (0, say)
• if B > A then it is in the opposite state (1, say)
– A comparator can be built using an op amp with no
feedback
analogue +
input

reference -
voltage
Flash Converter
• Uses a reference and a comparator for +
G

-
7V
each of the discrete levels represented +

in the digital output 6V -


F

• Number of comparators = number of +


E

quantisation levels 5V -

digital
• Not practical for more than 10 bit +
D
encoder
output

converters 4V
-

• generally fast but expensive


+
C

Converter Comparator Outputs Encoder Output 3V -

input
+
range (V) A B C D E F G B

<1 0 0 0 0 0 0 0 000 2V -
>1-2 1 0 0 0 0 0 0 001
>2-3 1 1 0 0 0 0 0 010 +
A
>3-4 1 1 1 0 0 0 0 011
>4-5 1 1 1 1 0 0 0 100
-
1V

>5-6 1 1 1 1 1 0 0 101 input signal


>6-7 1 1 1 1 1 1 0 110
>7 1 1 1 1 1 1 1 111
Successive Approximation A/D Converters
analogue input +
Vin Vc
-

comparitor
D-A Vd
Converter

Procedure
4-bit reg clock and
b b
3 2 1 0 b b control logic
1. Set MSB to 1
2. Test input, Vin, against DAC output, VDAC
3. If VDAC > Vin, reset bit to 0,
else bit = 1 (VDAC < Vin)
4. Move to next bit and repeat steps 1 - 3
The input is converted to digital value in n
steps, where n = the number of bits in digital signal
Successive Approximation A/D Converters
Example: an 8-bit successive approximation ADC is
presented with a analog value that has a value of
143. Use the successive approximation algorithm
given previously to determine the binary value.
Assuming that each test takes a single clock cycle,
determine the maximum conversion time for the
ADC, if it is clocked at 4.77 MHz. What is the
highest frequency that this system can convert and
accurately reproduce without folding or aliasing?
DAC Selection

•Resolutions (# of bits)
•Sampling rate.
•# of Channels.
•Dynamic response.
•Sampling Methods
•Types of Inputs…..
•Range
System Overview
Transducer Overview

Topics
• What is a Transducer?
• Types of Transducers
What is a Transducer?
Physical
Phenomena Signal

A transducer converts a physical


phenomena into a measurable signal
Signal Overview

Topics
• Types of Signals
• Information in a Signal
• State, Rate, Level, Shape, and
Frequency
Signal Classification
Your Signal

Digital Analog
Digital Signals
Your Signal

Digital
Two possible levels:
• High/On (2 - 5 Volts)
• Low/Off (0 - 0.8 Volts)
Two types of information:
• State
• Rate
Digital Signal Information
Your Signal

Digital
Analog Signals
Your Signal

Analog
Continuous signal
• Can be at any value with respect to
time
Three types of information:
• Level
• Shape
• Frequency (Analysis required)
Analog Signal Information
Your Signal

Analog

Analysis
Required
Signal Conditioning Overview

Topics
• Purpose of Signal Conditioning
• Types of Signal Conditioning
Why Use Signal Conditioning?

Noisy, Low-Level Signal Filtered, Amplified Signal

• Signal Conditioning takes a signal that is difficult for your DAQ device to
measure and makes it easier to measure
• Signal Conditioning is not always required
• Depends on the signal being measured
Amplification
• Used on low-level signals (i.e. thermocouples)
• Maximizes use of Analog-to-Digital Converter (ADC) range and increases accuracy
• Increases Signal to Noise Ratio (SNR)

Noise
Instrumentation
Amplifier

+
_ ADC
Lead Wires

Low-Level Signal External


Amplifier DAQ Device
DAQ Hardware Overview

Topics
• Types of DAQ Hardware
• Components of a DAQ device
• Configuration Considerations
Data Acquisition Hardware

Your Signal

DAQ Device
Computer

Cable

Terminal Block
DAQ Hardware turns your PC into a
measurement and automation system
Terminal Block and Cable

50 pin connector

Your Signal

Cable

Terminal Block
• Terminal Block and Cable route your signal to
specific pins on your DAQ device
• Terminal Block and Cable can be a combination
of 68 pin or 50 pin
DAQ Device

• Most DAQ devices have:


• Analog Input
• Analog Output
• Digital I/O
• Counters
DAQ Device
• Specialty devices exist for specific applications Computer
• High speed digital I/O
• High speed waveform generation
• Dynamic Signal Acquisition (vibration, sonar)
• Connect to the bus of your computer
• Compatible with a variety of bus protocols
• PCI, PXI/CompactPCI, ISA/AT, PCMCIA, USB, 1394/Firewire
Configuration Considerations
• Analog Input
• Resolution
• Range
• Gain
• Code Width
• Mode (Differential, RSE, or NRSE)
• Analog Output
• Internal vs. External Reference Voltage
• Bipolar vs. Unipolar
Resolution
• Number of bits the ADC uses to represent a signal
• Resolution determines how many different voltage changes can be measured

• Example: 12-bit resolution

• Larger resolution = more precise representation of your signal

# of levels = 2resolution = 212 = 4,096 levels


Resolution Example
• 3-bit resolution can represent 8 voltage levels
• 16-bit resolution can represent 65,536 voltage levels

16-Bit Versus 3-Bit Resolution


(5kHz Sine Wave)
10.00
111
8.75
110 16-bit resolution
7.50
101
6.25
Amplitude 100
3-bit resolution
(volts) 5.00
011
3.75
010
2.50
001
1.25
000
0 | | | | |
0 50 100 150 200
Time (ms)
Range

• Minimum and maximum voltages the ADC can digitize


• DAQ devices often have different available ranges
• 0 to +10 volts
• -10 to +10 volts
• Pick a range that your signal fits in
• Smaller range = more precise representation of your signal
• Allows you to use all of your available resolution
Range = 0 to +10 volts
(5kHz Sine Wave)
10.00
Range 8.75
111

Proper Range 7.50 110


• Using all 8 levels to 6.25 101
represent your Amplitude 100 3-bit resolution
signal 5.00
(volts) 011
3.75
010
2.50
001
1.25
000
0| | | | |
0 50 100 150 200
Time (ms)

Range = -10 to +10 volts


(5kHz Sine Wave)
10.00 Improper Range
111
7.50 • Only using 4
5.00
110 levels to
101 3-bit resolution represent your
2.50
100 signal
Amplitude
0
(volts) 011
-2.50
010
-5.00
001
-7.50
000
-10.00 | | | | |
50 100 150 200
Time (ms)
Gain
• Gain setting amplifies the signal for best fit in ADC range
• Gain settings are 0.5, 1, 2, 5, 10, 20, 50, or 100 for most devices
• You don’t choose the gain directly
• Choose the input limits of your signal in LabVIEW
• Maximum gain possible is selected
• Maximum gain possible depends on the limits of your signal and the chosen
range of your ADC
• Proper gain = more precise representation of your signal
• Allows you to use all of your available resolution
Gain Example
• Input limits of the signal = 0 to 5 Volts
• Range Setting for the ADC = 0 to 10 Volts
• Gain Setting applied by Instrumentation Amplifier = 2

Different Gains for 16-bit Resolution


(5kHz Sine Wave)
10.00
8.75
Gain = 2
7.50
6.25
Amplitude Your Signal
5.00
(volts) Gain = 1
3.75
2.50
1.25
0 | | | | |
0 50 100 150 200
Time (ms)
Code Width
• Code Width is the smallest change in the signal your system can detect (determined by
resolution, range, and gain)

• Smaller Code Width = more precise representation of your signal


• Example: 12-bit device, range = 0 to 10V, gain = 1
range
code width =
gain * 2 resolution
range 10
= = 2.4 mV
1*2 12
gain * 2 resolution

20
Increase range: = 4.8 mV
1* 212
10
Increase gain: = 24 mV
100 * 212
Grounding Issues
• To get correct measurements you must properly ground your system
• How the signal is grounded will affect how we ground the instrumentation
amplifier on the DAQ device
• Steps to proper grounding of your system:
• Determine how your signal is grounded
• Choose a grounding mode for your Measurement System

+
Signal Measurement
Source VS VM System
-
Measurement System
• Three modes of grounding for your +
Measurement System Measurement System
• Differential
• Referenced Single-Ended (RSE)
• Non-Referenced Single-Ended (NRSE)
-
• Mode you choose will depend on
how your signal is grounded
Differential Mode
Differential Mode
• Two channels used for each signal
• ACH 0 is paired with ACH 8, ACH 1 is paired with ACH 9, etc.
• Rejects common-mode voltage and common-mode noise

ACH (n)
+
VS
+
_ ACH (n + 8)
Instrumentation +
Amplifier
AISENSE
_
VM
AIGND
_

Measurement System
RSE Mode
•Referenced Single-Ended (RSE)
• Measurement made with respect to system ground
• One channel used for each signal
• Doesn’t reject common mode voltage

ACH (n)
+

ACH (n + 8) +
Instrumentation +
VS Amplifier
AISENSE
_
VM
_ AIGND
_

Measurement System
NRSE Mode
•Non-Referenced Single-Ended (NRSE)
• Variation on RSE
• One channel used for each signal
• Measurement made with respect to AISENSE not system ground
• AISENSE is floating
• Doesn’t reject common mode voltage
ACH (n)
+

ACH (n + 8) +
VS
Instrumentation +
Amplifier
_ AISENSE
_
VM
AIGND
_

Measurement System
General Data Acquisition Signal Flow
Digital Model
Sample Rate

• Determines how often conversions can


take place
• Specified in Hz
1
fs 
t
Where t is the time between samples
What does Aliasing Look Like?

Aliasing Applet
1. Wagon Wheel
2. Adjusting Input Frequency
3. Of Aliasing on a Signal
Sample and hold
performed
simultaneously
across all channels

Channels are scanned


sequentially and
passed to DAC

Values written to
memory

Process Starts Again

Signal 1 = 3.5 Signal 1 = 2.5


Signal 2 = 3.0 Signal 2 = 4.1
Signal 3 = 3.5 Signal 3 = 3.0

You might also like