ThePIC18F2331/2431/4331/4431familyofmicro-

controllershaveperipheralsthataresuitableformotor

controlapplications.Theseperipheralsandsomeof

theirprimaryfeaturesare:

•PowerControlPWM(PCPWM)

-Upto8outputchannels

-Upto14-bitPWMresolution

-Center-alignedoredge-alignedoperation

-HardwareshutdownbyFaultpins,etc.

•QuadratureEncoderInterface(QEI)

-QEA,QEBandIndexinterface

-Highandlowresolutionposition

measurement

-VelocityMeasurementmodeusingTimer5

-Interruptondetectionofdirectionchange

•InputCapture(IC)

-Pulsewidthmeasurement

-Differentmodestocapturetimeronedge

-Captureoneveryinputpinedge

-Interruptoneverycaptureevent

•High-SpeedAnalog-to-DigitalConverter(ADC)

-Twosampleandholdcircuits

-Single/Multichannelselection

-SimultaneousandSequentialConversion

mode

-4-wordFIFOwithflexibleinterrupts

Inthisapplicationnote,wewillseehowtousethese

featurestocontrolaBrushlessDC(BLDC)motorinopen

loopandinclosedloop.RefertotheMicrochipapplica-

tionnote,“AN885,BrushlessDC(BLDC)Motor

Fundamentals”(DS00885),forworkingprinciplesof

BrushlessDCmotorsandbasicsofcontrol.Also,to

obtainmoreinformationonmotorcontrolperipheralsand

theirfunctions,refertothePIC18F2331/2431/4331/4431

DataSheet(DS39616).AN899BrushlessDCMotorControlUsingPIC18FXX31MCUsAuthor:PadmarajaYedamaleHARDWAREMicrochipTechnologyInc.APICDEMMCdemoboardwasusedtodevelop,testanddebugthemotorcontrolcode.ThePICDEMINTRODUCTIONMChasasingle-phasediodebridgerectifier,convert-ingACinputtoDCandapowercapacitorbankthatThePIC18F2331/2431/4331/4431familyofmicro-keepsastableDCbus.A3-phaseIGBT-basedinverter

使用PIC18FXX31 MCU 控制无刷直流电机

使用PIC18FXX31 MCU 控制无刷直流电机