Introduction to Microprocessor & Digital Logic

ME262 Introduction to Microprocessor & Digital Logic (Sensor and Sensor Technology) Summer 2008 Introduction to Microprocessor and Digital Logic, ME...
Author: Shannon Sparks
5 downloads 0 Views 1MB Size
ME262

Introduction to Microprocessor & Digital Logic (Sensor and Sensor Technology) Summer 2008

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

1

What is sensor? A measuring device to measure a physical quantity. It is also known as a feedback control unit.

+ ∑

Controller

Power Electronics

D/A

Actuators

PC, Control Unit

A/D

Signal Conditioner

Sensors

Close-loop Process Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

2

Type of Sensors Variables

Sensors

Sound

Microphone

Temperature

Thermocouple, Radiation Thermometer

Light

Phototransistor

Force/torque

Strain gauge Piezoelectric Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

3

Variables

Sensors

Position/angle

Encoder, LVDT, Capacitors, Potentiometer, Hall Sensors

Velocity

Tachometer, Encoder

Acceleration

Accelerometer, Piezoelectric, indirectly from position sensors

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

4

Position and Velocity Sensor In this course, we study three type of sensors: Electrical Tachometer, Potentiometers, and optical Encoder. The emphasize is on encoders.

Electrical Tachometer A permanent Magnet DC motor is used to measure the velocity.

Output Voltage

Permanent Magnet DC Motor

Shaft Speed

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

5

Potentiometer Potentiometers or variable resistors can be used for position measurements. They can be used for translational and rotational velocity. They are temperature dependant and they are not useful for velocity measurement. They are susceptible to wear and noise.

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

6

Optical Encoder Two type of encoders are available in large: 1. Absolute encoder 2. Incremental encoder These two types can be rotary or linear. A digital optical encoder is a device that converts motion into a sequence of digital pulses. By counting a single bit or by decoding a set of bits, the pulses can be converted to relative or absolute position measurements. Most encoders are composed of a glass or plastic code part with a photographically deposited radial or linear pattern organized in tracks. As radial/linear lines in each track interrupt the beam between a photoemitterdetector pair, digital pulses are produced. Before we explain the structure of these encoders, we define a special coding called “Gray Coding”. Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

7

Gray Code An ordering of 2 n binary numbers such that only one bit changes from one entry to the next. Gray codes for 4 or more bits are not unique.

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

8

Absolute Encoder The optical disk of the absolute encoder is designed to produce a digital word that distinguishes N distinct positions of the shaft. For example, if there are 8 tracks, the encoder is capable of producing 256 distinct positions or an angular resolution of 1.406 (360/256) degrees. The most common types of numerical encoding used in the absolute encoder are gray and binary codes. The linear patterns and associated timing diagrams are what the photo-detectors sense as the code disk circular with the shaft. Disadvantage: Needs a larger disk or strip for higher resolution

Binary Absolute Encoder

Resolution of 360/8 = 45 Deg.

http://www.kavlico.com/index_home.html

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

9

Gray Absolute Encoder

http://www.heidenhain.com/ phaise2/posps.html

Resolution of 360/210 = 0.350

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

10

4-bit Gray code absolute encoder disk track patterns

4-bit Binary code absolute encoder disk track patterns

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

11

4-Bit gray and natural binary codes Decimal code

Rotation range (deg.)

Binary code

Gray code

0

0-22.5

0000

0000

1

22.5-45

0001

0001

2

45-67.5

0010

0011

3

67.5-90

0011

0010

4

90-112.5

0100

0110

5

112.5-135

0101

0111

6

135-157.5

0110

0101

7

15.75-180

0111

0100

8

180-202.5

1000

1100

9

202.5-225

1001

1101

10

225-247.5

1010

1111

11

247.5-270

1011

1110

12

270-292.5

1100

1010

13

292.5-315

1101

1011

14

315-337.5

1110

1001

15

337.5-360

1111

1000

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

12

Incremental Encoder 

  

Incremental encoders operate by means of a grating moving between a light source and a detector. They need a reference for position measurement. Higher resolution can be obtained easier. Needs a decoder to detect direction and position/velocity.

http://www.kavlico.com/index_home.html

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

13

Decoding 01

01

CU

A B

CU

A

CD 11

B

00

00

11 CD

A

CD CU

B

10

10 A

2X decoding

1X decoding B 01

A

CU

B

CU

CD

CD

00

11

Counter Clockwise Rotation CD

CD

CU

A

CU 10

B Clockwise Rotation

4X decoding

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

14

Incremental encoder disk patterns

Results of X1, X2, X4 decoding Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

15

The quadrature signals A and B can be decoded to yield the direction of rotation as shown in last page figure. Decoding transitions of A and B by using sequential logic circuits in different ways can provide three different resolutions of the output pulses: 1X, 2X, 4X. 1X resolution only provides a single pulse for each cycle in one of the signals A or B, 4X resolution provides a pulse at every edge transition in the two signals A and B providing four times the 1X resolution. The direction of rotation (clockwise or counter-clockwise) is determined by the level of one signal during an edge transition of the second signal.

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'08

16