Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Chapter 8 Parallel Port Interfaces KyungHee Univ. 2-0 8.4 Transistors Used for Computer-Controlled Current Switches 전류 제어 Switch(BJT) KyungHee Univ. 2-1 8.4 Transistors Used for Computer-Controlled Current Switches KyungHee Univ. 2-2 8.4 Transistors Used for Computer-Controlled Current Switches KyungHee Univ. 2-3 8.5 Computer-Controlled Relays, Solenoids, and DC Motors 8.5.1 Introduction to Relays KyungHee Univ. 2-4 8.5.1 Introduction to Relays 제어 회로와 다른 전원으로 구동하는 Relay의 예 KyungHee Univ. 2-5 8.5.1 Introduction to Relays KyungHee Univ. 2-6 8.5.2 Electromagnetic Relays Basics KyungHee Univ. 2-7 8.5.2 Electromagnetic Relays Basics KyungHee Univ. 2-8 8.5.2 Electromagnetic Relays Basics KyungHee Univ. 2-9 8.5.3 reed Relays KyungHee Univ. 2-10 8.5.4 Solenoids KyungHee Univ. 2-11 8.5.4 Solenoids KyungHee Univ. 2-12 8.5.5 Pulse-Width Modulated DC Motors DC 모터의 속도 제어( 모터에 가해지는 실효 전력을 제어 함)를 위하여 펄스 폭 변조 기술 을 사용 한다. KyungHee Univ. 2-13 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-14 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors Table 8.12 Maximum voltage parameter for typical snubber diodes KyungHee Univ. Diode 1N4001 Maximum voltage (V) 50 1N914 75 1N4002 100 1N4003 200 1N4004 400 1N4005 600 1N4006 800 1N4007 1000 2-15 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-16 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-17 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-18 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-19 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-20 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-21 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-22 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-23 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-24 8.5.6 Interfacing EM Relays, Solenoids, and DC Motors KyungHee Univ. 2-25 DC Motor and Stepper Controller L298N Current Sensing Motor Supply Voltage A Out Out Vs 1 2 1 2 3 4 470uF 35V In 1 5 Logic Supply Enable A 6 In GND Vs 2 7 8 9 Current Sensing Enable In 3 10 B 11 In Out 4 12 13 2 7414 1 + - 2W06 2 1 + 4 2W06 Vs 3 104 1 2 3 4 5 6 GND Dir1 En1 Dir2 En2 Vcc In Put Control Signal Connector KyungHee Univ. 14 15 +Vout 2 Motor 2 -Vout2 4 Vs Supply Voltage GND B 4 7414 3 2 +Vout 1 Motor 1 -Vout1 Out 3 1 + Vs Supply Voltage GND Dual Full-Bridge Driver L298 High voltage : 46V high current : 4A Dual full-bridge driver Accept standard TTL logic levels Drive inductive loads such as • Relays, Solenoids, DC and, Stepping motors KyungHee Univ. 2-27 L289 Block Diagram M KyungHee Univ. M 2-28 8.5.7 Solid-State Relays KyungHee Univ. 2-29 8.5.7 Solid-State Relays KyungHee Univ. 2-30 8.5.7 Solid-State Relays KyungHee Univ. 2-31 8.6 Stepper Motors KyungHee Univ. 2-32 8.6.1 Stepper Motors Example KyungHee Univ. 2-33 8.6.1 Stepper Motors Example Table 8.13 Stepper motor sequence PORTB Output A A’ B B’ 10 Activate Deactivate Activate Deactivate 9 Activate Deactivate Deactivate 5 Deactivate Activate Deactivate Activate 6 Deactivate Activate Activate Deactivate KyungHee Univ. Activate 2-34 8.6.1 Stepper Motors Example KyungHee Univ. 2-35 Program 8.24. A double circular linked list used to control the stepper motor. // 6811 or 6812 const 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 index StateType 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 KyungHee Univ. 2-36 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 } } KyungHee Univ. // Move 1.8 degrees counterclockwise void 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 } 2-37 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(); } } } KyungHee Univ. 2-38 8.6.2 Basic Operation KyungHee Univ. 2-39 8.6.2 Basic Operation KyungHee Univ. 2-40 8.6.2 Basic Operation KyungHee Univ. 2-41 8.6.2 Basic Operation KyungHee Univ. 2-42 8.6.2 Basic Operation KyungHee Univ. 2-43 8.6.2 Basic Operation KyungHee Univ. 2-44 8.6.2 Basic Operation KyungHee Univ. 2-45 8.6.2 Basic Operation KyungHee Univ. 2-46 8.6.3 Stepper Motor Hardware Interface KyungHee Univ. 2-47 8.6.3 Stepper Motor Hardware Interface KyungHee Univ. 2-48 8.6.3 Stepper Motor Hardware Interface KyungHee Univ. 2-49 8.6.3 Stepper Motor Hardware Interface KyungHee Univ. 2-50 8.6.4 Stepper Motor Shaft Encoder KyungHee Univ. 2-51 8.6.4 Stepper Motor Shaft Encoder KyungHee Univ. 2-52 8.6.4 Stepper Motor Shaft Encoder KyungHee Univ. 2-53 KyungHee Univ. 2-54 KyungHee Univ. 2-55 KyungHee Univ. 2-56 KyungHee Univ. 2-57 KyungHee Univ. 2-58 KyungHee Univ. 2-59 KyungHee Univ. 2-60 KyungHee Univ. 2-61