data acquisition and interfacing (section 4.5) lecture 18

58
Data Acquisition and Interfacing (Section 4.5) Lecture 18

Upload: caitlin-morrison

Post on 21-Jan-2016

220 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Data Acquisition and Interfacing (Section 4.5)

Lecture 18

Page 2: Data Acquisition and Interfacing (Section 4.5) Lecture 18

5-axis teaching robot – Chan Hian Full

Page 3: Data Acquisition and Interfacing (Section 4.5) Lecture 18

System Set-up

Interfacing card installed in CPU

Page 4: Data Acquisition and Interfacing (Section 4.5) Lecture 18

PCL-812PG

PCL-839

Page 5: Data Acquisition and Interfacing (Section 4.5) Lecture 18

drivers

Mechanical parts – transmission, stepper motors

Page 6: Data Acquisition and Interfacing (Section 4.5) Lecture 18

PC-based Process Control Monitoring System - Chai Song Ling

Page 7: Data Acquisition and Interfacing (Section 4.5) Lecture 18

System Set-up

PC and Data Acquisition System

Page 8: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Data Acquisition system – sensor and signal conditioner

Page 9: Data Acquisition and Interfacing (Section 4.5) Lecture 18
Page 10: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 11: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Data Acquisition SystemBlock Diagram

Page 12: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 13: Data Acquisition and Interfacing (Section 4.5) Lecture 18

TransducersSense physical phenomena and translate it into

electric

signals.

Examples:

• Temperature• Pressure• Light• Force

• Displacement• Level• Electric signals• ON/OFF switch

Page 14: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Signal Conditioning

Electrical signals are conditioned so they can be used by an analog input board. Types of signal conditioner:

– Amplification– Isolation– Filtering– Linearization

Page 15: Data Acquisition and Interfacing (Section 4.5) Lecture 18
Page 16: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Analog to Digital (A/D) Converter

• Input signal• Sampling rate• Throughput

• Resolution• Range• Gain

Page 17: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 18: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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.

Page 19: Data Acquisition and Interfacing (Section 4.5) Lecture 18

• 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

Page 20: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 21: Data Acquisition and Interfacing (Section 4.5) Lecture 18

• 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

Page 22: Data Acquisition and Interfacing (Section 4.5) Lecture 18

A/D Converter: Sampling Rate

• Aliasing– Acquired signal gets distorted if sampling

rate is too small.

Page 23: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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.

Page 24: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Analog to Digital Conversion for a 3-bit ADC

Page 25: Data Acquisition and Interfacing (Section 4.5) Lecture 18

A/D Converter: Resolution

Page 26: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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.

Page 27: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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?

Page 28: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Answer

• The resolution:

mV 8.92

10

2 10

VVnFS

Page 29: Data Acquisition and Interfacing (Section 4.5) Lecture 18

• 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

Page 30: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 31: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 32: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 33: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 34: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 35: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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?

Page 36: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 37: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 38: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 39: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 40: Data Acquisition and Interfacing (Section 4.5) Lecture 18

http://www.chassis-plans.com/PDF/T4I_Reference_Manual.pdf

Page 41: Data Acquisition and Interfacing (Section 4.5) Lecture 18

A schematic diagram of Data Acquisition System

Page 42: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 43: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 44: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 45: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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.

Page 46: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 47: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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.

Page 48: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 49: Data Acquisition and Interfacing (Section 4.5) Lecture 18

LabVIEW 8.0 (Software)

Analog input Block Diagram

Figure 7: Analog input part of the block diagram

Page 50: Data Acquisition and Interfacing (Section 4.5) Lecture 18

50

LabVIEW 8.0 (Software)

Analog and Digital Output Block Diagram

Figure 8: Analog and Digital output part of the block diagram

Page 51: Data Acquisition and Interfacing (Section 4.5) Lecture 18

04/21/23 51

LabVIEW 8.0 (Software)VI (Virtual Instrument) front panel

Page 52: Data Acquisition and Interfacing (Section 4.5) Lecture 18

PREPARED BY:

MOHD RAZIMAN BIN MUHAMMAD

SUPERVISOR:

DR. ROBIAH AHMAD

Page 53: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Figure 7: DIY anemometer

Figure 8: Irradiance sensor

Figure 6: Temperature and humidity sensor

Page 54: Data Acquisition and Interfacing (Section 4.5) Lecture 18

PLACING SENSOR

Figure 9: Sensor placing on rain shelter house

Page 55: Data Acquisition and Interfacing (Section 4.5) Lecture 18

Figure 10: Block diagram for data

collection

Figure 11: Front panel for data

collection

COLLECTING DATA

Page 56: Data Acquisition and Interfacing (Section 4.5) Lecture 18

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

Page 57: Data Acquisition and Interfacing (Section 4.5) Lecture 18

KPCI-3108

Page 58: Data Acquisition and Interfacing (Section 4.5) Lecture 18

End of Lecture 18