chapter 8 parallel port interfaces

62
KyungHee Univ. 2-1 Chapter 8 Parallel Port Interfaces Chapter 8 Parallel Port Interfaces

Upload: chloe

Post on 06-Jan-2016

51 views

Category:

Documents


2 download

DESCRIPTION

Chapter 8 Parallel Port Interfaces. 8.4 Transistors Used for Computer-Controlled Current Switches. 전류 제어 Switch(BJT). 8.4 Transistors Used for Computer-Controlled Current Switches. 8.4 Transistors Used for Computer-Controlled Current Switches. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-1

Chapter 8 Parallel Port InterfacesChapter 8 Parallel Port Interfaces

Page 2: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-2

8.4 Transistors Used for Computer-Controlled Current Switches

전류 제어 Switch(BJT)

Page 3: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-3

8.4 Transistors Used for Computer-Controlled Current Switches

Page 4: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-4

8.4 Transistors Used for Computer-Controlled Current Switches

Page 5: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-5

8.5 Computer-Controlled Relays, Solenoids, and DC Motors 8.5.1 Introduction to Relays

Page 6: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-6

8.5.1 Introduction to Relays

제어 회로와 다른 전원으로 구동하는 Relay 의 예

Page 7: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-7

8.5.1 Introduction to Relays

Page 8: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-8

8.5.2 Electromagnetic Relays Basics

Page 9: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-9

8.5.2 Electromagnetic Relays Basics

Page 10: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-10

8.5.2 Electromagnetic Relays Basics

Page 11: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-11

8.5.3 reed Relays

Page 12: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-12

8.5.4 Solenoids

Page 13: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-13

8.5.4 Solenoids

Page 14: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-14

8.5.5 Pulse-Width Modulated DC Motors

DC 모터의 속도 제어 ( 모터에 가해지는 실효 전력을 제어 함 ) 를 위하여 펄스 폭 변조 기술을 사용 한다 .

Page 15: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-15

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 16: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-16

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Diode Maximum voltage (V)

1N4001 50

1N914 75

1N4002 100

1N4003 200

1N4004 400

1N4005 600

1N4006 800

1N4007 1000

Table 8.12 Maximum voltage parameter for typical snubber diodes

Page 17: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-17

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 18: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-18

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 19: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-19

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 20: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-20

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 21: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-21

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 22: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-22

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 23: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-23

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 24: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-24

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 25: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-25

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 26: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-26

8.5.6 Interfacing EM Relays, Solenoids, and DC Motors

Page 27: Chapter 8 Parallel Port Interfaces

KyungHee Univ.

DC Motor and Stepper Controller

Current Motor Supply Logic CurrentSensing Voltage Enable Supply Enable Sensing

A Out Out Vs In A In GND Vs In B In Out Out B 1 2 1 2 3 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

1 2 3 4 5 6 GND Dir1 En1 Dir2 En2 Vcc In Put Control Signal Connector

+Vout 1Motor 1-Vout1

+Vout 2Motor 2-Vout2

VsSupplyVoltageGND

+-

470uF35V

104

1+

1+

2

4

3 3

4

2

Vs2W062W06

L298N

274141

474143

VsSupplyVoltageGND

Page 28: Chapter 8 Parallel Port Interfaces

Dual Full-Bridge Driver L298

High voltage : 46Vhigh current : 4ADual full-bridge driverAccept standard TTL logic levelsDrive inductive loads such as • Relays, Solenoids, DC and, Stepping motors

KyungHee Univ. 2-28

Page 29: Chapter 8 Parallel Port Interfaces

L289 Block Diagram

KyungHee Univ. 2-29

M M

Page 30: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-30

8.5.7 Solid-State Relays

Page 31: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-31

8.5.7 Solid-State Relays

Page 32: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-32

8.5.7 Solid-State Relays

Page 33: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-33

8.6 Stepper Motors

Page 34: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-34

8.6.1 Stepper Motors Example

Page 35: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-35

8.6.1 Stepper Motors Example

PORTBOutput

A A’ B B’

10 Activate Deactivate

Activate Deactivate

9 Activate Deactivate

Deactivate

Activate

5 Deactivate

Activate Deactivate

Activate

6 Deactivate

Activate Activate Deactivate

Table 8.13 Stepper motor sequence

Page 36: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-36

8.6.1 Stepper Motors Example

Page 37: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-37

Program 8.24. A double circular linked list used to control the stepper motor.

// 6811 or 6812const struct State{ unsigned char Out; // Output const struct State *Next[2]; // CW/CCW};typedef struct State StateType;typedef StateType *StatePtr;#define clockwise 0 // Next index#define counterclockwise 1 // Next indexStateType fsm[4]={ {10,{&fsm[1],&fsm[3]}}, { 9,{&fsm[2],&fsm[0]}}, { 5,{&fsm[3],&fsm[1]}}, { 6,{&fsm[0],&fsm[2]}}};unsigned char Pos; // between 0 and 199 StatePtr Pt; // Current State

Page 38: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-38

Program 8.25. Helper functions used to control the stepper motor.

// 6811 or 6812// Move 1.8 degrees clockwise void CW(void){ Pt = Pt->Next[clockwise]; // circular PORTB = Pt->Out; // step motor if(Pos==199){ // shaft angle Pos = 0; // reset } else{ Pos++; // CW }}

// Move 1.8 degrees counterclockwisevoid CCW(void){ Pt = Pt->Next[counterclockwise PORTB = Pt->Out; // step motor if(Pos==0){ // shaft angle Pos = 199; // reset } else{ Pos--; // CCW }}

// Initialize Stepper interface void Init(void){ Pos = 0; Pt = &fsm[0]; DDRB = 0xFF; // 6812 only}

Page 39: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-39

Program 8.26. High-level function to control the stepper motor.

// 6811 or 6812 void Seek(unsigned char desired){short CWsteps; if((CWsteps=desired-Pos)<0){ CWsteps+=200; } // CW steps is 0 to 199 if(CWsteps>100){ while(desired<>Pos){ CCW(); } } else{ while(desired<>Pos){ CW(); } }}

Page 40: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-40

8.6.2 Basic Operation

Page 41: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-41

8.6.2 Basic Operation

Page 42: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-42

8.6.2 Basic Operation

Page 43: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-43

8.6.2 Basic Operation

Page 44: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-44

8.6.2 Basic Operation

Page 45: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-45

8.6.2 Basic Operation

Page 46: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-46

8.6.2 Basic Operation

Page 47: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-47

8.6.2 Basic Operation

Page 48: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-48

8.6.3 Stepper Motor Hardware Interface

Page 49: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-49

8.6.3 Stepper Motor Hardware Interface

Page 50: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-50

8.6.3 Stepper Motor Hardware Interface

Page 51: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-51

8.6.3 Stepper Motor Hardware Interface

Page 52: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-52

8.6.4 Stepper Motor Shaft Encoder

Page 53: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-53

8.6.4 Stepper Motor Shaft Encoder

Page 54: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-54

8.6.4 Stepper Motor Shaft Encoder

Page 55: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-55

Page 56: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-56

Page 57: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-57

Page 58: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-58

Page 59: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-59

Page 60: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-60

Page 61: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-61

Page 62: Chapter 8 Parallel Port Interfaces

KyungHee Univ. 2-62