data acquisition and interfacing (section 4.5) lecture 18
TRANSCRIPT
Data Acquisition and Interfacing (Section 4.5)
Lecture 18
5-axis teaching robot – Chan Hian Full
System Set-up
Interfacing card installed in CPU
PCL-812PG
PCL-839
drivers
Mechanical parts – transmission, stepper motors
PC-based Process Control Monitoring System - Chai Song Ling
System Set-up
PC and Data Acquisition System
Data Acquisition system – sensor and signal conditioner
Introduction
A data acquisition system consists of many components that are integrated to:
• Sense physical variables (use of transducers)• Condition the electrical signal to make it
readable by an A/D board • Convert the signal into a digital format
acceptable by a computer• Process, analyze, store, and display the
acquired data with the help of software
Data Acquisition SystemBlock Diagram
Flow of information in DAQ
1. Input transducer – measure physical quantity2. Output from transducer – conditioned i.e. amplify, filter,
conversion3. Conditioned analog signal – digitized using ADC4. Digital information – acquired, process and record by
computer5. Modify physical signal, digital output converted to
analog by DAC6. Analog signals are conditioned7. Output transducer interact with physical variables
TransducersSense physical phenomena and translate it into
electric
signals.
Examples:
• Temperature• Pressure• Light• Force
• Displacement• Level• Electric signals• ON/OFF switch
Signal Conditioning
Electrical signals are conditioned so they can be used by an analog input board. Types of signal conditioner:
– Amplification– Isolation– Filtering– Linearization
Analog to Digital (A/D) Converter
• Input signal• Sampling rate• Throughput
• Resolution• Range• Gain
Graph humidity inside rain shelter house versus time start from 12 am on March 22, 2009 until 12 am on March 23, 2009
Graph temperature inside rain shelter house versus time start from 12 am on March 22, 2009 until 12 am on March 23, 2009
A/D Converter: Input Signal• Analog
– Signal is continuous– Example: strain gage. Most transducers
produce analog signals
• Digital– Signal is either ON or OFF– Example: light switch.
• The data is acquired by an ADC using a process called sampling.
• Sampling a analog signal - taking a sample of the signal at discrete times.
A/D Converter: Sampling
A/D Converter: Sampling Rate
• Determines how often conversions take place.
• The higher the sampling rate, the better.Analog Input
4 Samples/cycle
8 Samples/cycle
16 Samples/cycle
• This rate at which the signal is sampled - sampling frequency.
• Sampling frequency - determines the quality of the analog signal that is converted.
• Higher sampling frequency achieves better conversion of the analog signals
• A signal of lower frequency is generated from such a process (this is called aliasing).
• Shannon theorem:• Sampling rate is at least twice the highest
frequency so that the sample gives the original form of the signal
A/D Converter: Sampling Rate
• Aliasing– Acquired signal gets distorted if sampling
rate is too small.
Analog-to-Digital ConversionAnalog-to-Digital Conversion
An ADC converts an analog voltage to a digital number.
The digital number represents the input voltage in discrete steps with finite resolution.
ADC resolution is determined by the number of bits that represent the digital number.
Analog to Digital Conversion for a 3-bit ADC
A/D Converter: Resolution
Resolution
• The resolution = is a function of number of bits ADC uses to represents digital data
• The higher the resolution, the higher voltage range is broken into, and therefore, the smaller the detectable voltage change.
• A 8 bit ADC gives 256 levels (2^8) compared to a 12 bit ADC that has 4096 levels (2^12).
• Hence, 12 bit ADC will be able to detect smaller increments of the input signals then a 8 bit ADC.
• LSB or least significant bit is defined as the minimum increment of the voltage that a ADC can convert
• E.g. - For full scale input signal of 10V, the LSB for a 3-bit ADC corresponds to 10/2^3=1.25V. However, for a 12 bit ADC, LSB = 10/2^12=10/4096=2.44mV.
Exercise 1
• An ADC with word length of 10 bits. If the input analogue signal range is 10 V, what is the resolution of this ADC?
Answer
• The resolution:
mV 8.92
10
2 10
VVnFS
• LSB varies with the operating input voltage range of the ADC.
• If the full scale of the input signal is 10V than the LSB for a 3-bit ADC corresponds to 10/2^3=1.25V
• For a 12 bit ADC, LSB= 10/2^12 =10/4096 =2.44mV.
Resolution of ADC, X axis is analog input
BitsBits
The smallest unit in digital signal is the bit, a contraction of the more descriptive phase of binary digit.
A bit is a single element in digital signal, having only two possible states: on (indicating 1indicating 1) or off (indicating 0indicating 0).
OffOff00
OnOn11
BytesBytesBits are organized into larger units called bytes, the basic unit of information in a computer system.
A basic byte contains 8 bits. The total amount of information it can convey
is 228 8 (=256) possible combinations.
OffOff00
OnOn11
OffOff00
OffOff00
OffOff00
OffOff00
OnOn11
OffOff00
1 byte = 8 bit = 2 nibble
2-byte = 16 bit, 4-byte = 32bit1 Kbyte = 1×210byte = 1024 byte1 Mbyte = 1×210×210= 1,018,576byte
1GB = 230
1TB = 240
Analog-to-Digital Converter Analog-to-Digital Converter TheoryTheory
N-bitADC
AnalogInput
N-bitDigital Output
Analog Input Signal0 Volt
1 Volt
Digital Output Code
. 5 V
. 25 V
. 75 Volt
000001010011100101110111
3-bit ADC Scale
. 125
. 375
. 625
. 875
Step Size = = 0.125 V
32
1
2
1
N
Example of Encoding (8-bit Example of Encoding (8-bit system)system)
Data Bus Line D7 D6 D5 D4 D3 D2 D1 D0
Value 27
(128) 26
(64) 25
(32) 24
(16) 23
(8) 22
(4) 21
(2) 20
(1)
Decimal Value 167
Binary Code 1 0 1 0 0 1 1 1
Encoding (8-bit Bus, 0-5 V Encoding (8-bit Bus, 0-5 V Input)Input)
Analog Input (V) Decimal Number Digital Output
0 0 0000 0000
1.2 0011 1101
3.7 10111101
5 255 1111 1111
612.612550.5
2.1
18976.1882550.5
7.3
Exercise 2
• Consider a thermocouple giving an output of 0.5 mV/0C. What will be the word length required when its output passes through an ADC if temperatures from 00 to 2000C are to be measured with resolution of 0.50C?
Answer• The full scale output from sensor:
200 0.5= 100 mV
• With word length n, this voltage is divided into
100/2n mV steps
• For a resolution of 0.50C, we must be able to detect a signal from sensor 0.5 0.5=0.25mV
• Thus, the word length:
0.25 = 100/2n; n = 8.6• 9-bit word length is required
Numbering system – binary, decimal, hexadecimalDecimal Hexadecimal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
Numbering system – binary, decimal, hexadecimal
010111101011010100102= • 26214410 + 6553610 + 3276810 + 1638410 + 8192 +
204810 + 51210 + 25610 + 6410 + 1610 + 210 = 38792210
• Compare this to the conversion to hexadecimal, where each group of four digits can be considered independently, and converted directly:
010111101011010100102=• 0101 1110 1011 0101 00102=• 5 E B 5 216 = 5EB5216
Elementary Bus StructureElementary Bus Structure
Micro-processor
MonitorROM
OptionalUser ROM
System& UserRAM
UserInput/Output
Address Bus
Data Bus
KeyboardSystem
Input/OutputDisplay
Addr bus – which addr to go
Data bus – data from CPU to addr
Control bus – command from CPU
http://www.chassis-plans.com/PDF/T4I_Reference_Manual.pdf
A schematic diagram of Data Acquisition System
Example of Computer DAQ Example of Computer DAQ SystemSystem
Computer
TimerDigital ControlCircuit
Trigger
Interrupt
Parallel/SeriesInput Port
Parallel/SeriesOutput Port
A/D
D/A
Filter+
-S/H
Sensor
Bridge
InstrumentationAmplifier
InputStrobe
Display
Control
Output Strobe
DAQ Board
Multiplexer• Device where computer reads information from various
channel one at a time• Electronic switch• Computer instruct MUX select particular channel and the
data are read and processed• E.G. electronic MUX – DG508ACJ – 8 i/p channel each
ahs 3 bit address for selection
Sample and hold• Take the snapshot of the sensor signal
and hold the value
• Switch connect the capacitor and the capacitor hold the value until the new sample is acquired
Data Acquisition Software
• It can be the most critical factor in obtaining reliable, high performance operation.
• Transforms the PC and DAQ hardware into a complete DAQ, analysis, and display system.
• Different alternatives:– Programmable software.– Data acquisition software packages.
Programmable Software
• Involves the use of a programming language, such as:– C++, Visual C++– BASIC, Visual Basic + Add-on tools (such
as VisuaLab with VTX)– Fortran– C#
• Advantage: flexibility• Disadvantages: complexity and steep
learning curve
Data Acquisition Software
• Does not require programming.
• Enables developers to design the custom instrument best suited to their application.
• Examples: TestPoint, SnapMaster, LabView, DADISP, DASYLAB, etc.
48
Induction Motor Data Acquisition – Wong Kien Fatt
To acquire input-output data for the model structure
Figure 1: Actual photo of the whole experiment setup
LabVIEW 8.0 (Software)
Analog input Block Diagram
Figure 7: Analog input part of the block diagram
50
LabVIEW 8.0 (Software)
Analog and Digital Output Block Diagram
Figure 8: Analog and Digital output part of the block diagram
04/21/23 51
LabVIEW 8.0 (Software)VI (Virtual Instrument) front panel
PREPARED BY:
MOHD RAZIMAN BIN MUHAMMAD
SUPERVISOR:
DR. ROBIAH AHMAD
Figure 7: DIY anemometer
Figure 8: Irradiance sensor
Figure 6: Temperature and humidity sensor
PLACING SENSOR
Figure 9: Sensor placing on rain shelter house
Figure 10: Block diagram for data
collection
Figure 11: Front panel for data
collection
COLLECTING DATA
Figure 33: Alarm on when humidity inside rain shelter
exceed limit
Figure 34: Alarm on when
temperature inside rain shelter
exceed limit
Alarm on when humidity exceed 50%
Alarm on when humidity exceed 50%
Alarm on when temperature exceed 31°C
Alarm on when temperature exceed 31°C
PROGRAM: ALARM
KPCI-3108
End of Lecture 18