Example: confidence

AN899, Brushless DC Motor Control Using …

2004 Microchip Technology 1AN899 INTRODUCTIONThe PIC18F2331/2431/4331/4431 family of micro-controllers have peripherals that are suitable for motorcontrol applications. These peripherals and some oftheir primary features are: Power Control PWM (PCPWM)- Up to 8 output channels- Up to 14-bit PWM resolution- Center-aligned or edge-aligned operation- Hardware shutdown by Fault pins, etc. Quadrature Encoder Interface (QEI)- QEA, QEB and Index interface- High and low resolution position measurement- Velocity Measurement mode Using Timer5- Interrupt on detection of direction change Input Capture (IC)- Pulse width measurement- Different modes to capture timer on edge- Capture on every input pin edge- Interrupt on every capture event High-Speed Analog-to-Digital Converter (ADC)- Two sample and hold circuits- Single/Multichannel selection- Simultaneous and Sequential Conversion mode- 4-word FIFO with flexible interruptsIn this application note, we will see how to use thes

AN899 DS00899A-page 2 2004 Microchip Technology Inc. OPEN-LOOP CONTROL As seen in AN885, BLDC motors are electronically commutated based on the rotor position.

Tags:

  Using, Loops, Control, Motor, Brushless, Control loop, Brushless dc motor control using

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of AN899, Brushless DC Motor Control Using …

1 2004 Microchip Technology 1AN899 INTRODUCTIONThe PIC18F2331/2431/4331/4431 family of micro-controllers have peripherals that are suitable for motorcontrol applications. These peripherals and some oftheir primary features are: Power Control PWM (PCPWM)- Up to 8 output channels- Up to 14-bit PWM resolution- Center-aligned or edge-aligned operation- Hardware shutdown by Fault pins, etc. Quadrature Encoder Interface (QEI)- QEA, QEB and Index interface- High and low resolution position measurement- Velocity Measurement mode Using Timer5- Interrupt on detection of direction change Input Capture (IC)- Pulse width measurement- Different modes to capture timer on edge- Capture on every input pin edge- Interrupt on every capture event High-Speed Analog-to-Digital Converter (ADC)- Two sample and hold circuits- Single/Multichannel selection- Simultaneous and Sequential Conversion mode- 4-word FIFO with flexible interruptsIn this application note, we will see how to use thesefeatures to Control a Brushless DC (BLDC)

2 Motor in openloop and in closed loop. Refer to the Microchip applica-tion note, AN885, Brushless DC (BLDC) MotorFundamentals (DS00885), for working principles ofBrushless DC motors and basics of Control . Also, toobtain more information on Motor Control peripherals andtheir functions, refer to the PIC18F2331/2431/4331/4431 Data Sheet (DS39616).HARDWAREA PICDEM MC demo board was used to develop,test and debug the Motor Control code. The PICDEMMC has a single-phase diode bridge rectifier, convert-ing AC input to DC and a power capacitor bank thatkeeps a stable DC bus. A 3-phase IGBT-based inverterbridge is used to Control the output voltage from the DCbus.

3 Figure 1 shows the overall block diagram of Control circuit and power circuits are optically iso-lated with respect to each other. An on-board fly-backpower supply generates +5VD, with respect to thedigital ground used for powering up the Control circuit,including the PICmicro device. +5VA and +15VA aregenerated with respect to the power ground (negativeof DC bus). The feedback interface circuit is poweredby +5VA, while +15VA supplies power to the IGBT drivers located inside the Integrated Power Module(IPM).With the optical isolation between power and controlcircuits, programming and debugging tools can beplugged into the development board when main poweris connected to the board.

4 The board communicateswith a host PC over a serial port configured with an on-chip Enhanced USART. The on-board user interfacehas two toggle switches, a potentiometer and fourLEDs for this application note, the switch SW1 is used totoggle between Motor Run and Stop and SW2 is usedto toggle between the direction of Motor rotation. Eachpress of these buttons will change the state. A potenti-ometer is used for setting the speed reference. TheLEDs are used for indication of different states ofcontrol. Reference copies of the PICDEM MC schematics canbe found in Appendix B: Circuit Schematics .Author:Padmaraja YedamaleMicrochip Technology DC Motor Control Using PIC18 FXX31 MCUsAN899DS00899A-page 2 2004 Microchip Technology CONTROLAs seen in AN885, BLDC motors are electronicallycommutated based on the rotor position.

5 Each commu-tation sequence has two of three phases connectedacross the power supply and the third phase is leftopen. Using PWMs, the average voltage suppliedacross the windings can be controlled, thus controllingthe speed. In this section, we will see how the periph-erals on the PIC18 FXX31 can be used to Control aBLDC 1 shows a typical Control block diagram forcontrolling a BLDC PWM outputs from the PIC18 FXX31 Control thepower switches, Q0 to Q5. A matching driver circuitshould be used for supplying the required gate currentdrive for the power switches. As we have seen inAN885, the Hall Sensor signals may have 60-degree,or 120-degree, electrical phase difference to eachother.

6 A sequence table is entered in the programmemory based on the type of Hall Sensor sequence can be taken from the Motor data sequence may be different for clockwise andcounterclockwise following section explains how PCPWM, IC andADCs are used for open-loop 1:BLDC Motor Control BLOCK DIAGRAMACBPWM0Q0Q1Q2Q3Q4Q5 Hall AHall BDC+DC-FWD/REVREFD riverPWM1 PWM2 PWM3 PWM4 PWM5 PWM0 PWM1 PWM3 PWM5 PWM4 PWM2 NSSNIMAXIMOTORA mplifierComparator/FaultAPIC18 FXX31 RSHUNTAN0AN1IC1IC2IC3 Hall CIMOTORHall AHall BHall CRun/StopRxTx/FaultBTe m pAN8 PCGUI 2004 Microchip Technology 3AN899 Using THE INPUT CAPTURE MODULEHall Sensors A, B and C are connected to IC1, IC2 andIC3, respectively, on the Input Capture (IC) Input Capture module is used in Input Capture onState Change mode.

7 In this mode, the IC module inter-rupts every transition on any of the IC pins. Also,Timer5 is captured on every transition and cleared atthe beginning of the next clock cycle. The capturedTimer5 value is useful in determining the speed of themotor. Measuring the speed and controlling the motorin closed loop is discussed in detail in the section Closed-Loop Control Using Hall Sensors .Upon IC interrupt, in the IC Interrupt Service Routine,the status of all three input capture pins is read and thecombination is used to pick up the correct sequencefrom the 1 shows a typical switching sequence used to runthe Motor in the clockwise direction and Table 2 showsthe counterclockwise sequence.

8 These tables aretaken directly from the Motor data sheet(1).If the Motor you have uses a different sequence, itshould be entered in the firmware. Figure 2 shows therelationship between the Motor phase current and theHall Sensor inputs and the corresponding PWM signalsto be activated to follow the switching sequence, whichin turn, runs the Motor in the clockwise 1:SEQUENCE FOR ROTATING THE Motor IN CLOCKWISE DIRECTION WHEN VIEWED FROM NON-DRIVING ENDTABLE 2:SEQUENCE FOR ROTATING THE Motor IN COUNTERCLOCKWISE DIRECTION WHEN VIEWED FROM NON-DRIVING ENDNote 1: Motor Data SheetManufacturer: Bodine Electric CompanyType Number: 22B4 BEBLS eries: 3304 Web Site: NumberHall Sensor InputActive PWMsPhase CurrentABCABC1001 PWM1(Q1) PWM4(Q4)DC+OffDC-2000 PWM1(Q1) PWM2(Q2)DC+DC-Off3100 PWM5(Q5) PWM2(Q2)OffDC-DC+4110 PWM5(Q5) PWM0(Q0)DC-OffDC+5111 PWM3(Q3) PWM0(Q0)DC-DC+Off6011 PWM3(Q3) PWM4(Q4)OffDC+DC-Sequence NumberHall Sensor InputActive PWMsPhase CurrentABCABC1011 PWM5(Q5) PWM2(Q2)OffDC-DC+2111 PWM1(Q1) PWM2(Q2)DC+DC-Off3110 PWM1(Q1) PWM4(Q4)DC+OffDC-4100 PWM3(Q3) PWM4(Q4)OffDC+DC-5000 PWM3(Q3) PWM0(Q0)DC-DC+Off6001 PWM5(Q5) PWM0(Q0)DC-OffDC+AN899DS00899A-page 4 2004 Microchip Technology 2 is drawn with respect to Table 1.

9 The sequencenumber in Table 1 corresponds to 60 degrees of theelectrical cycle shown in Figure 2. For example, as seenin Sequence 1 in Table 1, the Hall Sensor input is set at 001 , which should activate Q1 and Q4. The corre-sponding PWMs (PWM1 and PWM4) are active duringthis 60-degree cycle. For the next 60-degree cycle, theHall Sensor input is 000 and Q1 (PWM1) and Q2(PWM2) are 2:HALL SENSOR INPUT VERSUS PHASE CURRENT0180360540720010101 ABCHallSensorInput1 Electrical Cycle1 Electrical CycleABCP haseCurrent0+-0+-0+-001 000100110 111011001 000100110 111011 HighsideSwitchLowsideSwitchPWM1Q1 PWM4Q4 PWM1Q1 PWM2Q2 PWM5Q5 PWM2Q2 PWM5Q5 PWM0Q0 PWM3Q3 PWM0Q0 PWM3Q3 PWM4Q4 PWM1Q1 PWM4Q4 PWM1Q1 PWM2Q2 PWM5Q5 PWM2Q2 PWM5Q5 PWM0Q0 PWM3Q3 PWM0Q0 PWM3Q3 PWM4Q41 Mechanical Cycle (with 2 pole pairs)Sequence NumberIC Interrupt123456123456** 2004 Microchip Technology 5AN899 Using THE PCPWM MODULEThe PCPWM module is used in Independent mode tocontrol the PWM output.

10 In this mode, three duty cycleregisters Control 6 PWM outputs, with two each havingthe same output; meaning the duty cycles on PWM0and PWM1 are controlled by the PDC0H:PDC0 Lregisters, the duty cycles on PWM2 and PWM3 arecontrolled by PDC1H:PDC1L registers and so at the sequence in Table 1 and Table 2,PWM0, PWM2 and PWM4 should be OFF any timethat PWM1, PWM3 and PWM5 are ON and vice order to keep the required PWMs active and to inhibitother PWMs from becoming active, the PWM overridefeature is used. The PCPWM module has a feature ofoverriding the PWM outputs based on the bit setting inthe Special Function Register, OVDCOND. The bits inthe OVDCOND register correspond directly to thePWM channel it is controlling.


Related search queries