Top Banner
Mr. Manoj Rajale UNIT III Data Acquisition & Microcontroller System
64

Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

May 05, 2018

Download

Documents

truongque
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Mr. Manoj Rajale

UNIT –III

Data Acquisition & Microcontroller

System

Page 2: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Syllabus

Interfacing of Sensors / Actuators to DAQ system,

Bit width, Sampling theorem, Sampling Frequency,

Aliasing, Sample and hold circuit,

ADC (Successive Approximation),

DAC (R-2R),

Current and Voltage Amplifier.

Page 3: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Objectives1. Understand key elements of Mechatronics system,

representation into block diagram

2. Understand concept of transfer function, reduction and

analysis

3. Understand principles of sensors, its characteristics,

interfacing with DAQ microcontroller

4. Understand the concept of PLC system and its ladder

programming, and significance of PLC systems in industrial

application

5. Understand the system modeling and analysis in time domain

and frequency domain.

6. Understand control actions such as Proportional, derivative

and integral and study its significance in industrial

applications.

Page 4: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Outcomes

1. Identification of key elements of mechatronics system and its

representation in terms of block diagram

2. Understanding the concept of signal processing and use of

interfacing systems such as ADC, DAC, digital I/O

3. Interfacing of Sensors, Actuators using appropriate DAQ

micro-controller

4. Time and Frequency domain analysis of system model (for

control application)

5. PID control implementation on real time systems

6. Development of PLC ladder programming and implementation

of real life system

Page 5: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Introduction-DAQ is first step in any automated system. Data means Signal

obtained by transducer.

In electronics, an analog-to-digital converter (ADC, A/D, A–D,

or A-to-D) is a system that converts an analog signal, such as a

sound picked up by a microphone or light entering a digital

camera, into a digital signal.

An ADC may also provide an isolated measurement such as

an electronic device that converts an input

analog voltage or current to a digital number proportional to

the magnitude of the voltage or current.

A digital-to-analog converter (DAC) performs the reverse

function; it converts a digital signal into an analog signal.

Page 6: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Interfacing of Sensor / Actuator to DAQ

Mechanical

SystemSensors

Actuators

Amplifying

Electronics

Amplifying

Electronics

Control System

Micro-controller or

Computer

Data Acquisition

System

Data Acquisition

System

Page 7: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

What is Analog / Digital Signal ?

Page 8: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Steps in DAQ1. The sensor measures behavior of system

2. The output from the sensor is conditioned (amplified,

filtered, etc.).

3. The conditioned analog signal is digitized using an analog-

to-digital converter (ADC)

4. The digital information is acquired, processed and

recorded by the computer.

5. The computer may then modify the system by outputting

control signals. The digital control signals are converted

to analog signals using a digital-to-analog converter (DAC).

6. The analog signals are conditioned (e.g. amplified and

filtered) appropriately for an actuator

7. The actuator interacts with the system to give desired

response

Page 9: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Interfacing of Sensor / Actuator to DAQ

Page 10: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Interfacing of Sensor / Actuator to DAQ

Page 11: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Analog - Digital Converter

Analog-Digital Conversion Process

Engineering signals are continuous.

Eg: voltage that varies over time; a chemical reaction rate that

depends on temperature, etc.

ADC and DAC allow digital computers to interact with these

signals.

Page 12: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

How does ADC Work?Converts an analog voltage level to a digital number

Digital Numbers can be effectively handled by microcontrollers, analog

levels

Digital numbers are non-fractional

Page 13: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

How does ADC Work?

Page 14: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

An electronic integrated circuit which transforms a signal

from analog (continuous) to digital (discrete) form.

Analog signals are directly measurable quantities.

Digital signals only have two states. For digital computer, we

refer to binary states, 0 and 1.

Microprocessors can only perform complex processing on

digitized signals.

ADC Provides a link between the analog world of

transducers and the digital world of signal processing and

data handling.

Page 15: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Application of ADC

ADC are used virtually everywhere where an analog

signal has to be processed, stored, or transported in

digital form.

Some examples of ADC usage are digital volt meters, cell

phone, thermocouples, and digital oscilloscope.

Microcontrollers commonly use 8, 10, 12, or 16 bit ADCs.

In aircrafts control system, industrial processes

Page 16: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Important in DAQ

1. Resolution (bits) & bit width

i. Precision of A to D conversion process is

dependent upon the number (n) of bits the ADC

of DAQ is used.

ii. The higher the resolution, the higher the

number of division, the voltage range is broken

into (2n), and therefore, the smaller detectable

voltage changes.

2. Sampling rate

Page 17: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Resolution-The smallest change in analog signal that will result in a change in

the digital output.

Resolution defines the number of possible output states

ΔV = Resolution

Vr = Reference voltage range

N = Number of bits in digital output.

2N = Number of states.

8-bit converter has 28 = 256 states

10-bit converter has 210 = 1024 states

12-bit converter has 212 = 4096 states

Higher resolution = less quantization error

Page 18: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Resolution1-bit analog to

digital conversion

2-bit analog to

digital conversion

3-bit analog to

digital conversion

Page 19: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Example 1

Page 20: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Sampling-

Reduction of continuous signal to discrete signal

Page 21: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Example-1

(1) (2)

(3)(4)

Sampling Freq=

Page 22: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Example-2

(1) (2)

(3)(4)

Sampling Freq=

Page 23: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Nyquist Criterion-

Why is this Sample Frequency Important?

The Nyquist criterion states that, in order to prevent undesired

aliasing, one must sample a signal at a rate equal to at

least twice its bandwidth.

Example

ffs

2

:TheoremNyquist per As

Page 24: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system
Page 25: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Proper and Improper Sampling

ffs

2

:Theorem

Nyquist per As

fs- number of

samples

obtained in one

second

f- highest freq

Page 26: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Aliasing• Aliasing results into a different signal when reconstructed from

samples taken from a continuous signal

Actual

Signal

Reconstructed

Signal

Page 27: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Aliasing Example

Page 28: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Quantizing: in binary

Partitioning the reference signal

range into a number of discrete

quanta, then matching the input

signal to the correct quantum.

Encoding:

Assigning a unique digital code

to each quantum, then

allocating the digital code to the

input signal.

Analog Signal Digital output in binary

Analog to digital conversion is a two-step process:

Page 29: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

(1) (2)

(3)

Page 30: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

(1)(2)

(3)

Page 31: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

(1) (2)

(3)

Page 32: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Sampling rate Bit Width

Page 33: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

There are two ways to best improve the accuracy of

A/D conversion:1. increasing the resolution which improves the accuracy in

measuring the amplitude of the analog signal.

2. increasing the sampling rate which increases the maximum

frequency that can be measured.

ImprovedLow Accuracy

Page 34: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system
Page 35: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system
Page 36: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Sample and Hold Operation

Sample and Hold Circuit

SHA is used in ADC, to stabilize the voltage while it is being

converted to a digital value

SHA consists of a voltage holding capacitor and a voltage follower

When the switch is closed, the output voltage is equal to the input

voltage

When the switch is open, capacitor holds the voltage corresponding to

the last sampled value

Page 37: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Types of A/D Converters

1. Dual Slope A/D Converter

2. Successive Approximation A/D Converter

3. Flash A/D Converter

4. Delta-Sigma A/D Converter

5. Other-

Voltage-to-frequency, staircase ramp or single slope, charge

balancing or redistribution, switched capacitor, tracking, and

synchro or resolver

Page 38: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Example-

Analog signal

SamplingSam

plin

g

& h

old

ingIncrease sampling

rate for smoother

curve

Page 39: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont…..

Quantizing

analog signal

Page 40: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Least Significant Bit (LSB) and Most

Significant Bit (MSB)

Page 41: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Successive Approximation Register type ADC

SAR type ADC

The SAR is initialized so that the MSB

is equal to a 1.

This code is fed into the DAC, which

then supplies the analog equivalent of

this digital code into the comparator

circuit for comparison with the

sampled input voltage.

If this analog voltage exceeds Vin the

comparator causes the SAR to reset

this bit; otherwise, the bit is left a 1.

Then the next bit is set to 1 and the

same test is done, continuing this until

every bit in the SAR has been tested.

The resulting code is the digital

approximation of the sampled input

voltage

Page 42: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Uses a n-bit DAC to compare DAC and original analog results.

Uses SAR supplies an approximate digital code to DAC of Vin.

Comparison changes digital output to bring it closer to the input value.

Uses Closed-Loop Feedback Conversion

Page 43: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

SAR ADC

Page 44: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Advantages

1. Medium accuracy compared to

other ADC types

2. Good tradeoff between speed

and cost

3. Capable of outputting the

binary number in serial (one bit

at a time) format.

Disadvantages

1. Higher resolution required

2. successive approximation

3. ADC’s will be slower

Page 45: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Example 1

For a 10 bit ADC with a Vref =1volts, find the

digital equivalent of Vin=0.6

Page 46: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont….

For MSB i.e. bit 9

1. V= Vref / 2n

2. Compare V with Vin

i. If Vin is greater than V , turn MSB on i.e. =1

ii. If Vin is less than V , turn MSB off i.e. = 0

3. Vin =0.6V and V1= Vref / 21 =0.5

4. Since Vin> V, 0.6> 0.5, MSB is turned on i.e. = 1

0.5

Vref

Vin = 0.6v

MSB LSB

10 Bit sytem

Page 47: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont….

For MSB 1 i.e. bit 8

1. Compare Vin=0.6 V to V2=V1 + Vref/22

= 0.5 + 0.25 = 0.75V

1. Since 0.6<0.75, MSB 1 is turned off i.e = 0

For MSB 2 i.e. bit 7

1. Compare Vin=0.6 V with V3=(V1+Vref/23)= 0.625

2. Since 0.6<0.625, MSB 2 is turned off i.e = 0

Page 48: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont….

For MSB 3 i.e. bit 6

1. Go to the last bit that caused it to be turned on

(In this case MSB-1) and add it to Vref/16, and

compare it to Vin

2. Compare Vin to V4= V1 + Vref/24= 0.5625

3. Since 0.6>0.5625, MSB 3 turned on =1

Page 49: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont…. This process continues for all the remaining bits

Thus, the digital equivalent of Vin=0.6 is: 1001100110

volts5995.0

000195.00039.0000312.00625.0005.01

1024

10

512

11

256

11

128

10

64

10

32

11

16

11

8

10

4

10

2

111

1024

1

512

1

256

1

128

1

64

1

32

1

16

1

8

1

4

1

2

10123456789

out

out

out

refout

V

V

V

bbbbbbbbbbVV

Page 50: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Digital -Analog Conversion

Properly weighted voltages are summed

together to yield the analog output.

Three weighted voltages are summed.

The three-bit binary code is

represented by the switches

Thus, if the binary number is 110,

the center and bottom switches are

on, and the analog output is 6 volts.

In actual use, the switches are

electronic and are set by the input

binary code.

Page 51: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

R-2R Digital - Analog Converter

4 Bit Digital-Analog Converter using R-2R

Approach

Page 52: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Ex. Convert 0001 to analog signal

Page 53: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont……

Page 54: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont……

=V1R/(2R) =

Page 55: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont……

Page 56: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont……

Page 57: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Cont……

Page 58: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Digital - Analog Converter

For binary input 1111, voltage V0 is then equal to:

In generic terms, for a four bit DAC, the equivalent

analog output is given by:

16

1

8

1

4

1

2

1sout VV

16

1

8

1

4

1

2

10123 bbbbVV sout

Page 59: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Example 1

An 8-bit R-2R DAC has a Vref of 10 Volts. The binary input is

10011011. Find the analog output voltage.

volts0546.6

0039.000781.000312.00625.0005.010

256

11

128

11

64

10

32

11

16

11

8

10

4

10

2

1110

256

1

128

1

64

1

32

1

16

1

8

1

4

1

2

101234567

out

out

out

refout

V

V

V

bbbbbbbbVV

Page 60: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

OR

An 8-bit R-2R DAC has a Vref of 10 V. The binary input is

10011011. Find the analog output voltage.

Page 61: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Op amplifier

Page 62: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Inverting type op amplifierIn which the output is exactly 1800 out of phase

with respect to input (i.e. if you apply a positive

voltage, output will be negative).

Applying KCL at inverting node we get

i1= (Vi-Vs)/Ri and i2= (Vs-Vo)/Rf

Vs= 0 (Virtual ground)

Let,

i1 = i2

(Vi-0)/Ri = (0-Vo)/Rf

Voltage gain Av = Vo/ Vi = – Rf /Ri

i1

i2

Vs

Page 63: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system
Page 64: Mechatronics in Manufacturing · UNIT –III Data Acquisition ... 3. Understand principles of sensors, its characteristics, ... Identification of key elements of mechatronics system

Non-inverting type op amplifier

In which the output is in phase with respect to input (i.e. if you

apply a positive voltage, output will be positive ).

Applying Ohms at inverting node we get,

i1 + i2=0

(Vi/R1+(Vi-Vo)/Rf = 0

Vi(1/R1+1/Rf) - V0/Rf =0

Voltage gain Av = Vo/ Vi = (1+ Rf/Ri)