Pulse Width Modulation PWM Unit Peperiksaan Bahagian Pengurusan
Pulse Width Modulation (PWM) Unit Peperiksaan, Bahagian Pengurusan Akademik, Jabatan Pendaftar 1
Pulse Width Modulation (PWM) -Pulse-width modulation (PWM) is a very efficient way of providing intermediate amounts of electrical power between fully on and fully off. -PWM is so widely used in DC motor control 2
Drawback of using Pulse Width Modulation (PWM) in controlling the speed of DC motor 1)The microcontroller comes with the PWM circuitry embedded in the chip, we have to do is load the proper registers with the values of the high and low portions of the desired pulse. 2)For microcontroller without PWM circuitry, we must create the various duty cycle pulses using software. 3
H-Bridge Circuit -Widely used to control the rotation of DC motor -Most of the switches in H-Bridge circuit are designed using BJT or FET switches - We just focus on DC motor control with ECCP 4
DC motor Control with ECCP -PIC 18 comes with one standard Compare Capture PWM (CCP) and one Enhance CCP (ECCP) -ECCP allows the implementation of the H-Bridge for bi-directional control of the DC motor. -It uses 4 pins (P 1 A, P 1 B, P 1 C, P 1 D; (RD 4 -RD 7) as shown in Figure below. 5
Circuit of Full Bridge Application Pg 666 DC Motor 6
ECCP control register, pg 667 Period (PR 2) Duty Cycle (ECCPR 1 L) Pg 586 7
Example pg 668; Full implementation of the PWM for ECCP module. CLRF TRISD MOVLW D’ 100’ MOVWF PR 2 MOVLW D’ 50’ MOVWF ECCPR 1 L MOVLF 0 XCF MOVWF ECCP 1 CON MOWLW 0 X 24 MOVWF T 2 CON AGAIN CLRF TMR 2 BCF PIR 1, TMR 2 IF WAIT BTFSS PIR 1, TMR 2 IF BRA WAIT BRA AGAIN ; PORTD AS OUTPUT ; PERIOD ; DUTY CYCLE ; REVERSE FULL BRIDGE ; TURN ON TIMER ; START PULSE ; CLEAR FLAG ; WAIT FOR PERIOD ; DO IT AGAIN 8
- Slides: 8