31
1 Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University College of Engineering Perlis , Malaysia Contact no: 04 9798442 Email: [email protected]

1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

Embed Size (px)

Citation preview

Page 1: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

1

Sensors and MeasurementsPenderia & Pengukuran

ENT 164

Signal Processing Elements

Hema C.R.School of Mechatronics Engineering

Northern Malaysia University College of EngineeringPerlis , Malaysia

Contact no: 04 9798442Email: [email protected]

Page 2: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

2

What is a signal?Signal: A physical variable whose value varies with respect to time or space.

Continuous time signal: When the value of the signal is

available over a continuum of time

Discrete time signal: When the value of the signal is

available only at discrete instants of time

0

t0

Continuous time signal

Discrete time signal

Page 3: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

3

Signal Processing

Output from conditioning elements are in the form of dc or ac voltage / current. Certain calculations [signal processing] are to be performed on these output signals, in order to establish the value of variable being measured

Signal Processing

Element

Data Presentation

Element

Output from Signal Conditioning Elements

Output

Measured Value

Page 4: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

4

Digital Signal Processing

A / D CONVERSION

DIGITALSIGNAL

PROCESSING

D / A CONVERSION

Analog Signal

DATAPRESENTATION

DIGITAL OR

ANALOG

Analog Signal

Sensing Element

Page 5: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

5

Digital Signal Processing: Advantages

Digital signal processing has a number of advantages compared with analog signal processing

Robustness: digital signal processing is insensitive to process variations, supply voltage change, temperature variation, interference and aging.

Programmability: Digital signal processing algorithms can be changed easily by changing the coefficients or software codes.

Flexibility: Some signal processing algorithms have extra degree of freedom implemented in digital such as linear phase filter.

Digital comes from the French which means numeric

Page 6: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

6

Analog to Digital Conversion [A / D]

Sampling

Quantisation

Page 7: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

7

Sampling

Sampling is the process of representing a continuous signal y(t) by a set of samples taken at discrete intervals of time [sampling interval]

Niyi ,...,2,1, T

Sampling Frequency Tf s 1

Page 8: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

8

Nyquist Sampling Theorem

For to be an adequate representation of , should satisfy the conditions of the Nyquist sampling theorem

A continuous signal can be represented by and reconstituted from a set of sample values provided that the number of samples per second is at least twice the highest frequency present in the signal

)(tys)(ty

sf

MAXs ff 2

Page 9: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

9

Aliasing

Phenomenon of two different signals being constructed from a given set of samples values is referred to as aliasing

If the sampling components occupy the same frequency range as the original signal and it is impossible to filter them out and reconstitute the signal

MAXs ff 2

Hzf 1

Page 10: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

10

Quantisation In a sampled signal value of can take any value in the signal range of to . In quantisation sample voltages are rounded either up or

down to one of Q quantisation values or levels where q = 0,1,2,…,Q-1. If and then

there are (Q-1) spacings occupying span of The spacing width or quantisation interval is

therefore:

iyMINy MAXy

MINy MAXy0V

1QVqV

V

MINyV 0 MAXQ yV 1

MINMAX yy

qV

1

Q

yyV MINMAX

Page 11: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

11

Quantisation produces an error

termed as quantisation error.

The maximum quantisation error is therefore or expressed as percentage of span

iqq yVe

iy

qe

2

V

2

V

MAXqe

2/V

MINMAX yy

%)1(2

100%100

)(2

Qyy

Ve

MINMAX

MAXq

Maximum percentage quantisation Error

Page 12: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

12

Frequency to

Digital Conversion

Page 13: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

13

Frequency to Digital Conversion

A.C. voltage → Signal from sensing elements or conditioning elements.

• Tachogenerator• Electrical oscillator• Flow meters

Conversion of frequency to digital output

Frequency MeasurementPeriod Measurement

Page 14: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

14

Frequency Measurement Frequency is measured by counting number of pulses during fixed time interval.

Set counters to zero, load

number then counting

interval

TfNT

Nf

ss

ss

Frequency Measurement Principle

Frequency Measurement

SystemC

C

f

NT

CN

Page 15: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

15

Clock pulses are input to clock counter which counts down to zero

Signal pulses are input to signal counter, this counts until clock counter reaches zero, when count is stopped.

Signal count is then

Signal count is proportional to input frequency

Resolution is limited to signal count. At low frequencies percentage resolution is poor

C

Css f

NfN

1

Page 16: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

16

Period Measurement• Period of the signal is measured by

counting the number of clock pulses within .

• The number of o f positive going

edges is counted giving

ST

ST

CN

SCC

C

CS

TfN

f

NT

Period measurement Principle

Period measurement System

Page 17: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

17

Digital to

Analog Converters

Page 18: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

18

Binary Weighted Resistor Network DAC give an analog output which is proportional to the 8 bit binary input signal.

An OPamp is used to sum the currents which are either zero or nonzero depending on bit equal 0 or 1

70

61

16

07

070707

067

067

22...

22

2,...,

2

...

0

...

bbbbV

R

RV

bR

Vib

R

Vi

iiiRV

R

Vi

but

iiiIi

REFF

OUT

REFREF

FOUT

F

OUTF

F

Page 19: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

19

R-2R Ladder Network

Current distribution is obtained with only two values of resistance, R and 2R

70

61

25

16

07

0011556677

22...

2222

256,128,...,8,4,2

0

1

bbbbbiRV

biibiibiibiibii

downswitchb

upswitchb

FOUT

i

i

Page 20: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

20

Analog to

Digital Converters

Page 21: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

21

Dual Slope Converter

Input is a continuous voltage not sampled voltage

These converters are used in digital voltmeters and indicators.

01

00

1

1

VV

VV

C

C

Page 22: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

22

Control logic, switches Vin onto the Integrator V1 is a positive ramp with slope proportional to Vin, output of comparator is 0

At end of fixed time V1 is proportional to Vin.

Control logic switches ref voltage –Vref onto integrator and resets the counter to 0.

The integrator output is a negative ramp with fixed rate of decrease

Time taken by V1 to decrease to 0 is proportional to Vin.

During this time control logic routes clock pulses to the counter and the counter increments.

When V1 fall to 0 comparator output Vc changes to 1 and the count is stopped.

Count is proportional to fall time and therefore to Vin and the parallel digital output signal is proportional to the count

Page 23: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

23

Successive Approximation ADC

Method involves making successful guesses at the binary code corresponding to input voltage

The trial code is converted to an analog voltage using DAC

Comparator decides whether the guess is too high or too low

Page 24: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

24

Flash or Parallel ADC

In Flash ADC there are Q-1 comparators in parallel and Q-1 corresponding voltage levels V1 to VQ-1

In each comparator q, the input sample value yi is compared with the corresponding voltage level Vq.

If yi is less than or equal to Vq the output is zero corresponding to 0.

If yi is greater than Vq the output is non-zero corresponding to a 1

qiCq

qiCq

VyV

VyV

,1

,0

Page 25: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

25

Comparator provide a Q-1 digit parallel input to a priority coder which generates an n-digit binary parallel output code corresponding to the values of q.

Advantages : short conversion time

Disadvantage: large number of comparators

Page 26: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

26

Computer and

Microcontroller Systems

Page 27: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

27

General Computer SystemComputer System

Input DevicesCentral Processing UnitOutput DevicesExternal Storage Devices

Central Processing UnitAlso known as Microprocessor

MicroprocessorMicrocontroller

                

Page 28: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

28

MicroprocessorThree main parts

Control UnitControls processing of instructions by providing control and time signals

Arithmetic Logic UnitArithmetic operations and Logic operations

Data registerStores

Instructions

Addresses

Data

  

  

Output Devices 

Input Devices

 

Backing Storage 

Data Flow

Memory

Processor

Central Processing Unit

ALU & CU

Page 29: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

29

Read Only Memory [ROM]Permanent Storage, unique address, instructions storage, read only

Random Access Memory [RAM]Temporary Storage, unique address, read and write, instructions and data storage

Input/Output InterfacePorts to connect external devicesSerial, parallel

Address BusOne-way flow of address codes to

memory and I/O ports• Data Bus

Two-way flowData from I/P , RAM to MicroprocessorInstruction from ROM to MicroprocessorResults to RAM or O/P

Control BusTwo-way flowSends clock signal to co-ordinate

information transferReceives information on status of

elements

Page 30: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

30

Microprocessor LayoutProcessor divided into two units

Executive UnitExecutes instructions

Bus Interface Unit [BIU]Interfaces computer busesFetch informationRead/write - data /results

EU Control SystemFetches instruction from instruction queue

Arithmetic Logic UnitPerforms arithmetic and logic operations

Data RegisterStores data [before and after operations]

Flag registerStatus flag of arithmetic operations

Pointer and Index RegisterCreates an address in BIU

Bus Control LogicFetches next instruction and places them in instruction queue

Address Segment register and Instruction PointerCreates parts of instruction address

Address Summing BlockCombines all addresses to create full address of next instruction to be fetched

Layout of Typical Microprocessor

Page 31: 1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University

31

MicrocontrollerSingle Chip

ProcessorMemoryI/O

8bit MicrocontrollerCPUMemoryFour parallel portsTwo serial ports12 MHz ClockSingle busTwo 4K EPROMS

Non volatileTwo 128 byte RAM

Volatile

Layout of a Microcontroller