measurement and instrumentation_lecture6
TRANSCRIPT
-
8/12/2019 Measurement and Instrumentation_lecture6
1/47
MEASUREMENT AND INSTRUMENTATION
BMCC 3743
PC BASED
DATA-ACQUISITION SYSTEMS
Mochamad Safarudin
Faculty of Mechanical Engineering, UTeM
2010
-
8/12/2019 Measurement and Instrumentation_lecture6
2/47
2
Measurement process
Analogue signal conditioning - done
DIGITAL SIGNAL CONDITIONING
Sensor/transducerSignal
conditioning
Recorder/display/
processormeasurand
-
8/12/2019 Measurement and Instrumentation_lecture6
3/47
3
ANALOG AND DIGITAL
Most measurands originate in analog form
Analog signal varies smoothly in time, without discontinuty
Example: 220 V ac, 60 Hz power line voltage
Example of analog signal
Digital information is transmitted and processed in form of bits
Each bit defined by one or other of two predefined logic level
The time interval assigned to it called bit interval
Most common two logic states is predetermined voltage levels(say 0 and 5 V dc)
-
8/12/2019 Measurement and Instrumentation_lecture6
4/47
4
Why digital?
1. Digital electronics easier to designand fabricate
ex: IC, low cost, mass product
compare to capacitor etc
2. Ease of data recording, storage and
displayex: digital voltmeter provides a
direct numerical display
of voltage compared with analog
voltage that has to be
visually interpolated if the pointeris between two scales
3. Inherently noise resistant
-
8/12/2019 Measurement and Instrumentation_lecture6
5/47
5
COMPUTER AS AMEASUREMENT SYSTEM
-
8/12/2019 Measurement and Instrumentation_lecture6
6/47
6
Contents
Components of computersystems
Representing numbers in computersystems
Components of data-acquisitionsystems
Configuration of data-acquisitionsystems
-
8/12/2019 Measurement and Instrumentation_lecture6
7/47
7
Components of computer systems
CPU and RAM
Printer
Display
Mass storage
(disk drives)
Keyboard
Digital
input-output
(ports or expansion bus)
-
8/12/2019 Measurement and Instrumentation_lecture6
8/47
8
COMPUTERIZED DATA ACQUISITION SYSTEM
-
8/12/2019 Measurement and Instrumentation_lecture6
9/47
9
Typical computer components
Central processing unit (CPU)
Program (software)
Random access memory (RAM) - ROM
Mass storage systemmagnetic tape recorder,magnetic disk drive, optical disk drive
Display/monitor/screen
User input device (keyboard, mouse,joystick,etc)
Printers and plotters
-
8/12/2019 Measurement and Instrumentation_lecture6
10/47
10
Contents
Components of computer systems
Representing numbers in
computer systems Components of data-acquisition
systems
Configuration of data-acquisitionsystems
-
8/12/2019 Measurement and Instrumentation_lecture6
11/47
-
8/12/2019 Measurement and Instrumentation_lecture6
12/47
12
Examples (binary/decimal)
1. Convert the 8-bit binary number01011100 to decimal
2. Find the 8-bit binary number with thesame value as that of the decimal
number 92.
-
8/12/2019 Measurement and Instrumentation_lecture6
13/47
13
1. 01011100
N10=0(2
7
)+1(2
6
)+0(2
5
)+1(2
4
)+1(2
3
)+2(2
2
)+0(2
1
)+0(2
0
)=0+64+0+16+8+4+0+0
=92
2. By a series of divisions by 2
remainder2 92
2 46 0
2 23 0
2 11 12 5 1
2 2 1
2 1 0
0 1
LSB
MSB
Answer:
1011100 but weare asked for 8 bit:
01011100
-
8/12/2019 Measurement and Instrumentation_lecture6
14/47
14
Most commonly represented using:
2s complement binary
Procedure:
1. Convert the integer to binary as if it were positive
2. Invert all of the bitschange 0s to 1s and 1s to 0
3. Add 1 LSB to the final resulte.g.convert92 to an 8-bit 2s complement binary number
answer: from previous, 01011100
invert 10100011
+1 LSB 101000112 + 12 become 10100100
Note that, positive numbers always have 0as MSB and negativenumbers have 1 as MSB
In a computer often a special code is used : ASCIIAmerican
Standard Code for Information Interchange, e.g. k= 011010112=
10710
What about negative number?
-
8/12/2019 Measurement and Instrumentation_lecture6
15/47
15
ASCII Characters
-
8/12/2019 Measurement and Instrumentation_lecture6
16/47
16
Contents
Components of computer systems
Representing numbers in computer
systems
Components of data-
acquisition systems
Configuration of data-acquisitionsystems
-
8/12/2019 Measurement and Instrumentation_lecture6
17/47
17
Components of data-acquisition
systems
Multiplexer
Simultaneous sample-and-hold subsystem
ADCs DACs
-
8/12/2019 Measurement and Instrumentation_lecture6
18/47
18
Multiplexer (MUX) Works as an electronic switchcomputer
will ask MUX to select a particular channelto be read and processed, sequentially.
Can have crosstalk errors and transfer
accuracy.
Illustration of a multiplexer
In this figure, channel 1 is connected
-
8/12/2019 Measurement and Instrumentation_lecture6
19/47
19
Simultaneous sample-and-hold subsystem
Need to be used to record data from different channel of MUX, precisely at
the same time.
e.g. Measuring tire forces using 6 component force transducers
simultaneously
-
8/12/2019 Measurement and Instrumentation_lecture6
20/47
20
Analogue-to-Digital Converters
Converts continuous analogue waveform
into discrete digital signals
Examples: audio amplifiers, TV, output
voltage from transducers, etc
Output of ADCs has 2Npossible values
If N , no. of possible output states , henceresults more accurate
-
8/12/2019 Measurement and Instrumentation_lecture6
21/47
21
Types of ADCs
Unipolar single-slope integrating converter(ramp typequite slow, not very accurate)
Successive-approximations converter(quite fast
typical 12-bit completes a conversion in 1025s)
Parallel or flash or half-flash converter(thefastestcan be 10 ns, using lots of
comparators) Dual-slope integrating converter(used in digital
voltmeter)
-
8/12/2019 Measurement and Instrumentation_lecture6
22/47
22
Unipolar single-slope integrating converter
1. A fixed reference voltage is used to charge an integrator at a constant rate
2. The integrator output voltage then increase linearly with time
3. A digital clock (counter) is started at the same time that the charging is begun
4. The integrator output voltage is compared continuously with the analog input
voltage using a comparator
5. When the integrator voltage exceeds the analog input voltage, digital clock is
stopped
6. The count of the digital clock is the digital output of the A/D converter
-
8/12/2019 Measurement and Instrumentation_lecture6
23/47
23
Example
-
8/12/2019 Measurement and Instrumentation_lecture6
24/47
24
Formula to estimate A/D converter digital output
The output of a 2s-complement, given the analogue input voltage, is
where max. positive output is (2N/21) and max. negative output is
(-2N/2)
The output of an offset binary or simple binary converteris given by
where output will range from 0 to (2N-1) max.
2
22int
NN
rlru
rlio
VV
VVD
N
rlru
rlio
VV
VVD 2int
-
8/12/2019 Measurement and Instrumentation_lecture6
25/47
25
From example before, estimate the digital output for
6.115 V analog input to A/D converter
Example:
Answer:
Since this is a simple binary devices the second equation
is applicable:
10)78.9int(2010
0115.6int 4
xDo
-
8/12/2019 Measurement and Instrumentation_lecture6
26/47
26
Quantisation error
Resolution uncertainty(or treated as random
error, analogous to the reading error of a
digital display) due to output of ADC with
discrete steps, given by
Input resolution error=
The quantisation error is thus 0.5 LSB
voltsVV
N
rlru
25.0
-
8/12/2019 Measurement and Instrumentation_lecture6
27/47
27
Successive-approximations converter (most common type)
1. A series of known analog voltages are created and compared to the analog input
voltage
2. In the first trial, a voltage interval of one-half the input span is compared with
the input voltage3. If the input voltage is in the upper half of the range, the MSB is set to1; otherwise
it is set to zero
4. This process is repeated with an interval half the width of the interval used in the
first trail to determine the second MSB and so forth until LSB is determined
Successive aproximation
method for 4 bit A/D
converter
-
8/12/2019 Measurement and Instrumentation_lecture6
28/47
28
Example:
-
8/12/2019 Measurement and Instrumentation_lecture6
29/47
29
Example:
A 12-bit A/D converter has an input range of -10 to +10 V.
Find the resolution error of the converter for the analog input.
Answer:
Using above equation
00244.02
)10(105.0
12
errorresolutioninput
The resolution uncertainty of 0.00244 is the best that
can be achieved
Comment: if input voltage=0.1 V (low end of input range),
The quantization error would represent 2.5% of the reading,
which is probably not acceptable. The input signal should be
amplified probably before the signal enters the converter
-
8/12/2019 Measurement and Instrumentation_lecture6
30/47
30
Digital-to-Analogue Converters
Converts discrete digital signals into
continuous analogue waveform
Examples: To operate heaters or valves
under computer control
Similar specs as ADCs, i.e. depends on
no. of input bits, analogue output range
and conversion speed.
-
8/12/2019 Measurement and Instrumentation_lecture6
31/47
31
1. Rn=2nRf
2. When the switched is closed, inflows to the summing
bus
f
n
R
n
Rn
R
v
R
vi
2
3. The op-amp converts the currents to voltages
k
n
nfo iRv1
4 bit D/A converter
-
8/12/2019 Measurement and Instrumentation_lecture6
32/47
32
Example:
A digital code 1011 (equivalent to 11) for the circuit above
with Rf= 5 kW and vs=-10 V. then
i1=-1 mA
i2=0
i3=-1/4 mA
i4=-1/8 mASumming these currents and multiplying by Rfgives
Vo=6.875 V which is 11/16 of the full scale (ref) voltage
-
8/12/2019 Measurement and Instrumentation_lecture6
33/47
33
Contents
Components of computer systems
Representing numbers in computer
systems
Components of data-acquisition
systems
Configuration of data-acquisition systems
-
8/12/2019 Measurement and Instrumentation_lecture6
34/47
34
Configuration of data-acquisition
systems
Internal single board plug in system (PCI slot)
External system (USB, IEEE1394, Ethernet,
RS-232, GPIB)
Virtual Instruments (modular) ex: Labview
from NI
PC turns into digital storage oscilloscope
Data loggers (simpler and specialized)
ex: flight data recorder in airplane
Several configuration of DAS
-
8/12/2019 Measurement and Instrumentation_lecture6
35/47
35
INTERNAL SINGLE BOARD PLUG IN SYSTEM
PCI DAQ
-
8/12/2019 Measurement and Instrumentation_lecture6
36/47
36
EXTERNAL SYSTEM
USB DAQ from NI
-
8/12/2019 Measurement and Instrumentation_lecture6
37/47
37
VIRTUAL INSTRUMENTS
LABVIEW from NI
http://www.ni.com/images/labview/us/userinterfaces_large.jpg -
8/12/2019 Measurement and Instrumentation_lecture6
38/47
38
DATA LOGGER
-
8/12/2019 Measurement and Instrumentation_lecture6
39/47
39
EXAMPLE:
How many bits are required for a digital device to represent the decimal
number 27541 in simple binary? How many bits for 2s complement binary?
Solution:
The following table presents the maximum decimal number versus the number of bits for simple
binary:
No. Bits Max. Dec. No. Simple Binary
12 212-1 = 4095
13 213-1 = 819114 214-1 = 16383
15 215 -1 = 32767
16 216-1 = 65535
Consequently, 15 bits are needed to represent 27541 in simple binary. For a two's complement
binary number, the MSB will be zero so 16 bits will be required.
-
8/12/2019 Measurement and Instrumentation_lecture6
40/47
40
An A/D converter is to operate with a full-scale voltage of 10V. How many
bits should be employed to obtain a resolution of 0.01 %?
-
8/12/2019 Measurement and Instrumentation_lecture6
41/47
41
A 12-bit A/D converter has an input range of 8 V, and the output code is
offset binary. Find the output (in decimal) if the input is:
a. 4.2 Vb. -5.7 V
c. 10.9 V
d. -8.5
-
8/12/2019 Measurement and Instrumentation_lecture6
42/47
42
Solution:
(d) Since -8.5V falls outside the input range, D0will take the minimum value:
DV V
V V
in rl
ru rl
N
0 2
int
int.
int .
4 2 8
8 82
3123 2
3123
12
D012
5 7 8
8 82
int
.
int .5888
589
D0122 1 4095
N = 12
Vru = 8V
Vrl= -8V
Vin= input voltage(a)By second equation
(b)By second equation :
(c) Since 10.9V falls outside the input range, Dowill have the maximum output:
D0 0
-
8/12/2019 Measurement and Instrumentation_lecture6
43/47
43
A 12 bit A/D converter has an input range of 10V and an amplifier at the
Input with a gain of 10. The output of the A/D converter is in 2s complement
Format. Find the output of the A/D converter if the input to the amplifier is:
a. 1.5 Vb. 0.8 V
c. -1.5 V
d. -0.8 V
-
8/12/2019 Measurement and Instrumentation_lecture6
44/47
44
16382
22
)10(10
)10(8int
2
22int
1212
NN
rlru
rlin
oVV
VVD
16382
22
)10(10
)10(8int
2
22int
12
12
N
N
rlru
rlin
o VV
VVD
We need the first equation to solve this problem
(a)When the 1.5V signal is amplified with a gain of 10, it becomes 15V which exceeds the input range
of the A/D converter (it is saturated). According to the formula, the maximum output is 2N/2-1 = 212/2-1
= 2047
(b)With the gain of 10, the input becomes 8V. The output, in decimal, is then:
(c) When amplified, -1.5V results in an input to the A/D converter which is
below the input range (it is saturated). The largest negative output is2N/2 = -
2048
(d)With the amplifier, this voltage results in an input to the A/D of8V. The
output is then:
-
8/12/2019 Measurement and Instrumentation_lecture6
45/47
45
A 3.29 V signal is input to a 12 bit successive approximations converter withan input range of 0 to 10 V and simple binary output. Simulate the successive
approximation process to determine the simple binary output
-
8/12/2019 Measurement and Instrumentation_lecture6
46/47
46
The reference voltage increment is:
V input spanN 2102
0 002441412
.
Trial digital output (D0) D0V Pass/Fail Actual digital output
100000000000 (2048) 5.0 F
010000000000 (1024) 2.5 P 010000000000 (1024)
011000000000 (1536) 3.75 F 010000000000 (1024)
010100000000 (1280) 3.12 P 010100000000 (1280)
010110000000 (1408) 3.44 F 010100000000 (1280)
010101000000 (1344) 3.28 P 010101000000 (1344)
010101100000 (1376) 3.36 F 010101000000 (1344)
010101010000 (1360) 3.32 F 010101000000 (1344)
010101001000 (1352) 3.30 F 010101000000 (1344)
010101000100 (1348) 3.2901 F 010101000000 (1344)
010101000010 (1346) 3.286 P 010101000010 (1346)
010101000011 (1347) 3.289 P 010101000011 (1347)
The output is 010101000011 or 1347 in decimal.
-
8/12/2019 Measurement and Instrumentation_lecture6
47/47
47
Thank You
http://www.google.com.my/imgres?imgurl=http://www.newfreedownloads.com/imgs/2382-w520.jpg&imgrefurl=http://www.newfreedownloads.com/Screenshot-Instrumentation-Model-Kit.html&h=400&w=300&sz=37&tbnid=eIH90dYAd5wlzM:&tbnh=259&tbnw=194&prev=/images%3Fq%3Dinstrumentation%2Bimages&hl=en&usg=__Dw4Q9EcAvgIhfJX6wNFy_Y9bZLI=&sa=X&ei=rUJjTP_VF4OWuAP_3LSeCg&ved=0CBkQ9QEwAA