Example: stock market

Brushless DC Motor Control Made Easy

2002 Microchip Technology 1AN857 INTRODUCTIONThis application note discusses the steps of developingseveral controllers for Brushless motors. We cover sen-sored, sensorless, open loop, and closed loop is even a controller with independent voltage andspeed controls so you can discover your Motor s char-acteristics code in this application note was developed withthe Microchip PIC16F877 PICmicro Microcontroller, inconjuction with the In-Circuit Debugger (ICD). Thiscombination was chosen because the ICD is inexpen-sive, and code can be debugged in the prototype hard-ware without need for an extra programmer oremulator. As the design develops, we program the tar-get device and exercise the code directly from theMPLAB environment. The final code can then beported to one of the smaller, less expensive, PICmicro microcontrollers. The porting takes minimaleffort because the instruction set is identical for all PICmicro 14-bit core devices.

A brushless motor is constructed with a per-manent magnet rotor and wire wound stator poles. Electrical energy is converted to mechanical energy by the magnetic attractive forces between the permanent magnet rotor and a rotating magnetic field induced in the wound stator poles.

Tags:

  Permanent, Magnet, Permanent magnets, Per manent magnet, Manent

Information

Domain:

Source:

Link to this page:

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

Other abuse

Transcription of Brushless DC Motor Control Made Easy

1 2002 Microchip Technology 1AN857 INTRODUCTIONThis application note discusses the steps of developingseveral controllers for Brushless motors. We cover sen-sored, sensorless, open loop, and closed loop is even a controller with independent voltage andspeed controls so you can discover your Motor s char-acteristics code in this application note was developed withthe Microchip PIC16F877 PICmicro Microcontroller, inconjuction with the In-Circuit Debugger (ICD). Thiscombination was chosen because the ICD is inexpen-sive, and code can be debugged in the prototype hard-ware without need for an extra programmer oremulator. As the design develops, we program the tar-get device and exercise the code directly from theMPLAB environment. The final code can then beported to one of the smaller, less expensive, PICmicro microcontrollers. The porting takes minimaleffort because the instruction set is identical for all PICmicro 14-bit core devices.

2 It should also be noted that the code was bench testedand optimized for a Pittman N2311A011 Brushless DCmotor. Other motors were also tested to assure that thecode was generally of a BLDCF igure 1 is a simplified illustration of BLDC Motor con-struction. A Brushless Motor is constructed with a per- manent magnet rotor and wire wound stator energy is converted to mechanical energy bythe magnetic attractive forces between the permanentmagnet rotor and a rotating magnetic field induced inthe wound stator poles. FIGURE 1:SIMPLIFIED BLDC Motor DIAGRAMSA uthor:Ward BrownMicrochip Technology DC Motor Control Made EasyAN857DS00857A-page 2 2002 Microchip Technology this example there are three electromagnetic circuitsconnected at a common point. Each electromagneticcircuit is split in the center, thereby permitting the per- manent magnet rotor to move in the middle of theinduced magnetic field.

3 Most BLDC motors have athree-phase winding topology with star connection. Amotor with this topology is driven by energizing 2phases at a time. The static alignment shown inFigure 2, is that which would be realized by creating anelectric current flow from terminal A to B, noted as path1 on the schematic in Figure 1. The rotor can be madeto rotate clockwise 60 degrees from the A to B align-ment by changing the current path to flow from terminalC to B, noted as path 2 on the schematic. The sug-gested magnetic alignment is used only for illustrationpurposes because it is easy to visualize. In practice,maximum torque is obtained when the permanent mag-net rotor is 90 degrees away from alignment with thestator magnetic field. The key to BLDC commutation is to sense the rotorposition, then energize the phases that will produce themost amount of torque.

4 The rotor travels 60 electricaldegrees per commutation step. The appropriate statorcurrent path is activated when the rotor is 120 degreesfrom alignment with the corresponding stator magneticfield, and then deactivated when the rotor is 60 degreesfrom alignment, at which time the next circuit is acti-vated and the process repeats. Commutation for therotor position, shown in Figure 1, would be at the com-pletion of current path 2 and the beginning of currentpath 3 for clockwise rotation. Commutating the electri-cal connections through the six possible combinations,numbered 1 through 6, at precisely the right momentswill pull the rotor through one electrical the simplified Motor of Figure 1, one electrical revo-lution is the same as one mechanical revolution. Inactual practice, BLDC motors have more than one ofthe electrical circuits shown, wired in parallel to eachother, and a corresponding multi-pole permanent mag-netic rotor.

5 For two circuits there are two electrical rev-olutions per mechanical revolution, so for a two circuitmotor, each electrical commutation phase would cover30 degrees of mechanical CommutationThe easiest way to know the correct moment to com-mutate the winding currents is by means of a positionsensor. Many BLDC Motor manufacturers supplymotors with a three-element Hall effect position sensor element outputs a digital high level for 180electrical degrees of electrical rotation, and a low levelfor the other 180 electrical degrees. The three sensorsare offset from each other by 60 electrical degrees sothat each sensor output is in alignment with one of theelectromagnetic circuits. A timing diagram showing therelationship between the sensor outputs and therequired Motor drive voltages is shown in Figure 2:SENSOR VERSUS DRIVE TIMINGA+V-VFloatB+V-VFloatC+V-VFloatHLHL HLS ensor ASensor BSensor 2002 Microchip Technology 3AN857 The numbers at the top of Figure 2 correspond to thecurrent phases shown in Figure 1.

6 It is apparent fromFigure 2 that the three sensor outputs overlap in sucha way as to create six unique three-bit codes corre-sponding to each of the drive phases. The numbersshown around the peripheral of the Motor diagram inFigure 1 represent the sensor position code. The northpole of the rotor points to the code that is output at thatrotor position. The numbers are the sensor logic levelswhere the Most Significant bit is sensor C and the LeastSignificant bit is sensor A. Each drive phase consists of one Motor terminal drivenhigh, one Motor terminal driven low, and one Motor ter-minal left floating. A simplified drive circuit is shown inFigure 3. Individual drive controls for the high and lowdrivers permit high drive, low drive, and floating drive ateach Motor terminal. One precaution that must betaken with this type of driver circuit is that both high sideand low side drivers must never be activated at thesame time.

7 Pull-up and pull-down resistors must beplaced at the driver inputs to ensure that the drivers areoff immediately after a microcontoller RESET, when themicrocontroller outputs are configured as high imped-ance precaution against both drivers being active atthe same time is called dead time Control . When an out-put transitions from the high drive state to the low drivestate, the proper amount of time for the high side driverto turn off must be allowed to elapse before the low sidedriver is activated. Drivers take more time to turn offthan to turn on, so extra time must be allowed to elapseso that both drivers are not conducting at the sametime. Notice in Figure 3 that the high drive period andlow drive period of each output, is separated by a float-ing drive phase period. This dead time is inherent to thethree phase BLDC drive scenario, so special timing fordead time Control is not necessary.

8 The BLDC commu-tation sequence will never switch the high-side deviceand the low-side device in a phase, at the same time. At this point we are ready to start building the motorcommutation Control code. Commutation consists oflinking the input sensor state with the correspondingdrive state. This is best accomplished with a state tableand a table offset pointer. The sensor inputs will formthe table offset pointer, and the list of possible outputdrive codes will form the state table. Code developmentwill be performed with a PIC16F877 in an ICD. I havearbitrarily assigned PORTC as the Motor drive port andPORTE as the sensor input port. PORTC was chosenas the driver port because the ICD demo board alsohas LED indicators on that port so we can watch theslow speed commutation drive signals without anyexternal test driver requires two pins, one for high drive andone for low drive, so six pins of PORTC will be used tocontrol the six Motor drive MOSFETS.

9 Each sensorrequires one pin, so three pins of PORTE will be usedto read the current state of the Motor s three-outputsensor. The sensor state will be linked to the drive stateby using the sensor input code as a binary offset to thedrive table index. The sensor states and Motor drivestates from Figure 2 are tabulated in Table 3:THREE PHASE BRIDGETo A-VM+VMA HighcontrolA LowcontrolTo B-VM+VMB HighcontrolB LowcontrolTo C-VM+VMC HighcontrolC LowcontrolAN857DS00857A-page 4 2002 Microchip Technology 1:CW SENSOR AND DRIVE BITS BY PHASE ORDERS orting Table 1 by sensor code binary weight results in Table 2. Activating the Motor drivers, according to a state tablebuilt from Table 2, will cause the Motor of Figure 1 to rotate clockwise. TABLE 2:CW SENSOR AND DRIVE BITS BY SENSOR ORDERC ounter clockwise rotation is accomplished by driving current through the Motor coils in the direction opposite of thatfor clockwise rotation.

10 Table 3 was constructed by swapping all the high and low drives of Table 2. Activating the motorcoils, according to a state table built from Table 3, will cause the Motor to rotate counter clockwise. Phase numbers inTable 3 are preceded by a slash denoting that the EMF is opposite that of the phases in Table 3:CCW SENSOR AND DRIVE BITSThe code segment for determining the appropriate drive word from the sensor inputs is shown in Figure CSensor BSensor AC High DriveC Low DriveB High DriveB Low DriveA High DriveA Low Drive11010001102100100100311010000140100 0100150110110006001010010 PinRE2RE1RE0RC5RC4RC3RC2RC1RC0 PhaseSensor CSensor BSensor AC High DriveC Low DriveB High DriveB Low DriveA High DriveA Low Drive60010100104010001001501101100021001 0010011010001103110100001 PinRE2RE1RE0RC5RC4RC3RC2RC1RC0 PhaseSensor CSensor BSensor AC High DriveC Low DriveB High DriveB Low DriveA High DriveA Low Drive/6001100001/4010000110/5011100100/2 100011000/1101001001/3110010010 2002 Microchip Technology 5AN857 FIGURE 4.