Vous êtes sur la page 1sur 8

Pulse Width Modulation (PWM)

Unit Peperiksaan, Bahagian Pengurusan Akademik, Jabatan Pendaftar

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

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

-PIC18 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 (P1A, P1B, P1C, P1D; (RD4-RD7) as shown in Figure below.

DC motor Control with ECCP

Circuit of Full Bridge Application Pg666

DC Motor

ECCP control register, pg 667


Period (PR2)

Duty Cycle
(ECCPR1L) Pg 586

Example pg 668; Full implementation of the PWM for ECCP module.


CLRF TRISD MOVLW D100 MOVWF PR2 MOVLW D50 MOVWF ECCPR1L MOVLF 0XCF MOVWF ECCP1CON MOWLW 0X24 MOVWF T2CON AGAIN CLRF TMR2 BCF PIR1, TMR2IF WAIT BTFSS PIR1, TMR2IF 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

Vous aimerez peut-être aussi