Home

BLDC Motor Control with Hall Sensors Driven by DSC

image

Contents

1. System concept no y VCC Vector B baa VCC cba 101 Hall Sensor State VCC VCC f Vector F Vector C ON PhC PhB cba a i 001 NCC es connected VCC inadai Vector E Cera Vector D cba 011 Figure 14 Commutation vector definition for clockwise direction BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 18 Freescale Semiconductor Inc System concept 3 7 3 Definition of commutation table In the application software the commutation vectors are defined as entries 0 7 in Table 5 Any Hall sensor pattern provides the pointer to the table of commutation vectors For this example Table 5 shall be used The Hall sensor patterns 0 000 and 7 111 indicate a fault because such combinations are not available during the normal operation Such states can be caused either by a disconnected Hall sensor interface or through malfunctioning In these cases the output channels are switched off or the output signals are put into a safe state in order to protect the drive Table 5 Commutation table Hall sensor pattern result Commutation vector CW Commutation vector CCW 0 OFF OFF 1 F Cc 2 D A 3 E B 4 B E 5 A D 6 C F 7 OFF OFF BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 19 System concept 0 60 120 180 240 300 360 Hall signal P
2. Freescale Semiconductor Document Number AN4413 Application Note Rev 0 11 2011 BLDC Motor Control with Hall Sensors Driven by DSC using TWR 56F8257 and TWR MC LV3PH Boards by Pavel Sustek Systems Application Engineer Microcontroller Solutions Group Contents 1 Introd uction 1 Ua I seikiasiccccsasscavesanseosavesneessbeassnvavavbasaeccsoaves 1 This application note describes the design of a three phase Systemi MERON ph ON aiaiai 2 Brushless DC BLDC motor drive based on Freescale s MC56F8257 digital signal controller DSC The application design incorporates the advantages of DSC peripherals for motor control SyS CONCEP E eaa nanaii aeran aR 8 Software deserenan ona 21 Summary and Conclusions esseceeseeeeeeeevees ae nH On A N BLDC motors are very popular in a wide array of applications Compared to a DC motor the BLDC motor uses an electric commutation replacing the mechanical commutator and making it more reliable than the DC motor In BLDC motors rotor magnets generate the rotor s magnetic flux allowing BLDC motors to achieve higher efficiency Therefore BLDC motors may be used in high end white goods such as refrigerators washing machines dishwashers etc high end pumps fans and other appliances that require high reliability and efficiency EIAI D EN IET EE NA IRE E A 27 The concept of the application is to create a speed closed loop BLDC driver using a Hall position sensor It
3. no voltage is applied to the motor windings When the application is in the Run state the motor speed can be controlled either by the Up Down buttons on the board or by the FreeMASTER software on the PC FreeMASTER software The FreeMASTER software also displays a control page as shown in Figure 10 real time values of application variables and their time behaviour using scopes Free MASTER software was designed to provide an application debugging diagnostic and demonstration tool for the development of algorithms and applications It runs on a PC connected to the TWR 56F8257 via a USB cable A small program resident in the microprocessor communicates with the FreeMASTER software to return status information to the PC and process control information from the PC BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 9 System concept F BLDC_HS_demo_TWR56F8257 pmp FreeMASTER DER File Edit View Explorer Item Project Tools Help suloj eA 22 es Main Switch a STOP Application State STOP_STATE Faults Q FAULT Clear Fault OFF r MC33937 Statur Register 0 b 00000000 Demo Required Spe Duty Cycle D Direction of Rotation Counterclockwise Actual Speed Required Speed 0 Required speed ramp output 0 DC Bus Voltage commands stimulators Done R5232 COM9 speed 9600 Figure 10 Application FreeMASTER control page 3 3 Used peripherals The pres
4. of 214 rpm wherein the application is limited to 250 rpm expressed by the constant N_MIN Speed PI controller constants are set in App nit routine Constant values are tuned using the FreeMASTER control page 5 Summary and conclusions This application note provides the user with a description of the demo application BLDC motor with speed closed loop using Hall sensors and guides how to measure and implement a commutation table for a BLDC motor with Hall sensors The application source code is written with aspect of simplicity and legibility to enable rapid code porting to any DSC member 6 References e TWR MC LV3PH User s Guide TWRMCLV3PHUG available at http www freescale com e User Manual for Freescale s Tower Board TWR 56F8257 TWR56F8257UM available at http www freescale com e Three Phase BLDC Motor Control Using MC56F8257 User s Guide BLDC56F8257UG available at http www freescale com DSP56800E QuickStart User s Manual available at http www freescale com e MC33937 Three Phase Field Effect Transistor Pre driver available at http www freescale com BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 27 How to Reach Us Home Page www freescale com Web Support http www freescale com support USA Europe or Locations Not Listed Freescale Semiconductor Technical Information Center EL516 2100 East Elliot Road Tempe Arizona 85284 1 800 521 6274 o
5. serves as an example of a BLDC motor control system design using one of the latest member of Freescale DSCs It also illustrates an intelligible implementation of a BLDC control technique using DSC features This application note also includes basic motor theory system design concept hardware implementation and DSC software design including the FreeMASTER visualization tool N 2011 Freescale Semiconductor Inc v w freescale System description 2 System description This application consists of three parts This document describing the application and its usage e Application codee e FreeMASTER control page The hardware used in this application note is based on a three phase BLDC PMSM low voltage motor control drive board tower module TWR MC LV3PH that provides a broad solution for testing and developing low power drives and demos and on a TWR 56F8257 board See Figure 1 It demonstrates MC56F8257 and MC33937 devices and provides a hardware tool to help develop motor control application Figure 1 Application concept See a detailed description including the hardware specification in the User Manual for Freescale s Tower Board TWR 56F8257 TWR56F8257UM available at http www freescale com and the low voltage power stage TWRMCLV3PHUM in TWR MC LV3PH User s Guide TWRMCLV3PHUG available at http www freescale com BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 2 Freescale
6. the FreeMASTER variable window 3 5 Overcurrent level The overcurrent signal is connected via TWR Elevator IRQ_A B62 pin to GPIO_C2 pin of MC56F8257 device This pin is internally connected via XBAR to the PWM FAULTO signal that handles the fault by PWM hardware See Figure 11 The overcurrent level can be set in the range of 0 8 A by the trimmer R37 on TWR MC LV3PH The maximum current value can be set by turning the trimmer left The user can find the level when the motor is running while the trimmer is turned left until red LED is lit It is recommended to set the trimmer to somewhat higher level so that the motor can run at the maximum speed TWR MC LV3PH MC33937 MC56F8257 FAULT_0O R10 DC Bus Shunt 1 65V ref TWR 56F8 257 Figure 11 Overcurrent protection connection 3 6 BLDC motor with Hall sensors The enclosed motor is a low voltage LINIX 45ZWN24 40 The motor can be controlled using Hall sensor techniques The motor characteristics are in Table 1 Table 1 LINIX motor parameters Rated voltage Vi 24 V Rated speed 4000 rpm Rated power p 40 W Continuous current log 2 34 A Number of pole pairs pp 2 BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 13 System concept 3 7 Commutation table definition of specific BLDC motor The definition of the correct commutation table is the key point of the application porting for the customer
7. 90 as possible to get the maximum generated torque Therefore the motor requires electronic control for proper operation BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 3 System description Voltage Urea PhaseA Uses Useg Phase B E E E E a Uses HU nce Phase C f Uses 30 60 90 120 150 180 210 240 270 300 330 Electrical angle Figure 3 Voltage strokes applied to the three Phase BLDC motor at full duty cycle For the common three phase BLDC motor a standard three phase power stage is used See Figure 4 The power stage utilizes six power transistors that operate either in an independent or complementary mode In both the modes the three phase power stage energizes two motor phases concurrently The third phase is unpowered Thus six possible voltage vectors are applied to the BLDC motor using the pulse width modulation PWM technique There are two basic types of power transistor switching schemes independent and complementary Both the switching modes are able to work in bipolar or unipolar mode The present application utilizes the unipolar complementary independent combine PWM mode Phase A Phase B Phase C Figure 4 Three phase H bridge BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 4 Freescale Semiconductor Inc System description 2 3 Commutation Commutation provides the creation of a rotationa
8. FAULT e Fault 0 signal with high level detection e Automatic fault clearing e PWM_A PWM1_A and PWM2_A channels disabled and output pins set to high level if a fault is detected e PWMO0_B PWM1_B and PWM2_B channels disabled and output pins set to low level if a fault is detected e Fault input filter disabled BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 11 System concept 3 3 4 ADC The ADC module is configured for DC bus voltage sampling and conversion as follows e Input clock IPBus 10 6 MHz e Sample 0 set to DC bus voltage channel ANBO e Triggered parallel scan mode e SYNCO input or PWM trigger connected via XBAR as trigger source 3 3 5 SCI Serial communication interface channel 1 SCI1 is used for FreeMASTER communication between the MCU board and PC The module configuration is as following e Baud rate 9600 bit s Divisor 390 Fine tune 5 e Enabled receiver and transmitter e Other setting by default 3 3 6 SPI SPI is a four wire interface used for MC33937 3 phase predriver configuration and status reading The module configuration is as follows e Input clock IPBUs 128 468 75 kHz e Falling edge SCLK polarity e Master SPI mode 3 3 7 FreeMASTER The FreeMASTER application is not a DSC peripheral but its embedded driver is configured from QuickStart Graphical Configuration tool as one of the peripherals The driver has following configuration e
9. SCII communication interface e Polling Mode interrupt processing e Up to a maximum of eight variables as per the enabled Scope feature 3 4 User interface The application has one of the following interfaces e Up Down buttons on TWR 56F8257 e FreeMASTER running on PC connected to TWR 56F8257 via USB cable After power supply is plugged in TWR MC LV3PH the motor is prepared to run The required speed setting and on off functions can be processed either through the buttons or from the FreeMASTER control page e Pressing SW1 button sets the clockwise direction of the motor e Pressing SW2 button sets the counterclockwise direction of the motor e Further pressing the buttons increases or decreases the required speed within the speed limit 4800 4800 rpm e To stop the motor both SW1 and SW2 have to be pressed simultaneously The FreeMASTER control page enables to set the required speed and switch the motor on off Also through the Demo mode the required speed value is set according to the defined speed profile BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 12 Freescale Semiconductor Inc SSS ____ aS System concept If an application fault is detected the red FAULT LED on TWR MC LV3PH is lit and the fault indicator on the FreeMASTER control page indicates the fault state The actual fault can be cleared either by pressing Reset button in case the FreeMASTER is not used or by setting Clear Fault variable in
10. Semiconductor Inc System description 2 1 Target motor theory A BLDC motor is a rotating electric machine where the stator is a classic three phase winding with concentrated coils and the rotor has surface mounted permanent magnets See Figure 2 Stator Stator winding in slots Shaft Rotor Air gap Permanent magnets Figure 2 BLDC motor cross section In this respect the BLDC motor is equivalent to a reversed DC commutator motor in which the magnet rotates while the conductors remain stationary In the DC commutator motor the current polarity is altered by the commutator and brushes Unlike the brushless DC motor the polarity reversal is performed by power transistors switching in synchronization with the rotor position Therefore BLDC motors always incorporate the external position sensors known as Hall sensors to sense the actual rotor position or the position can be detected without sensors using BEMF zero cross detection method 2 2 Digital control of a BLDC motor The BLDC motor is driven by rectangular voltage strokes coupled with the given rotor position as depicted in Figure 3 The stator flux interacts with the rotor flux generated by a rotor magnet and defines the torque and thus the speed of the motor The voltage strokes must be properly applied to two phases of the three phase winding system based on the rotor position so that the angle between the stator flux and the rotor flux is kept as close to
11. alization function calling of peripherals used in the application e FMSTR_Init e FreeMASTER embedded driver initialization based on setting in the GCT panel e archEnablelInt e Global interrupt flag enabled The application background main loop incorporates the state machine fault detection and FreeMASTER polling function calling See Figure 16 BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 21 Software design IsrHallSensorA DSC Initialization QT_A1 edge capture Enable Interrupts IsrHallSensorB QT_A2 edge capture State Machine IsrHallSensorC Fault Detection FreeMASTER Poll IsrQTA3Compare Figure 16 Application main flow The application state machine incorporates four states as depicted in Figure 17 e AppInit e Runs MC33937 3 phase predriver configuration via SPI For more details see TWR MC LV3PH User s Guide TWRMCLV3PHUG available at http www freescale com BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 22 Freescale Semiconductor Inc Software design e Sets speed controller constants e Reads DC bus voltage e AppStop e Checks whether the nonzero speed command is set either from FreeMASTER or by pressing push buttons to set motor rotation direction e AppRun e Increases or decreases the required speed based on the state of push buttons e Allows motor reversing e Updates the PWM regis
12. combination of switch states 4 3 Commutation process The motor commutation is processed once a Hall sensor edge is captured The new switching state is set according to the commutation table defined in application constants commutationTableMask and commutationTableSWC based on actual Hall sensor status Every 60 electrical is called the CommutationHS routine where e One motor phase is turned off e The second phase with positive polarity is used for PWM complementary signal generation e The last phase with negative polarity is set to the state where the top transistor is turned off and the bottom transistor is turned on using the PWM Deadtime source register The immediate change of output PWM waveform enables the Force event which is generated at the end of the commutation routine The PWM technique where one pair of transistors work in a complementary mode and the other in an unipolar mode is called Combined Complementary Independent Unipolar PWM switching It is the best choice for MOSFET H Bridge which eliminates losses in freewheeling diodes utilizing a MOSFET as a diode without threshold voltage See Figure 18 The figure shows the connections of a BLDC motor without a phase which is turned off in a commutation period Transistors Q1 and Q2 run in complementary mode whereas Q3 is turned off and Q4 is turned on during this period Following commutation the transistor pairs will be set to a new state according to the predefined commutati
13. ent BLDC application uses only the essential peripherals for control technique implemented in the application code e Analog to digital converter ADC e Quad timer QTimer e Pulse width modulation PWM e XBAR e Serial peripheral interface SPI e Serial communication interface SCI Other peripherals are disabled A peripheral initialization is done using Freescale QuickStart tool which offers simple to use interface for all device peripheral settings For more details read TWR MC LV3PH User s Guide TWRMCLV3PHUG available at http www freescale com Detailed descriptions of used peripherals are in the following sections 3 3 1 QTimer A MC56F8257 QTimer module A is configured as following e QTIMER_AO e Runs at frequency 468 75 kHz or IPB clock 128 BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 10 Freescale Semiconductor Inc System concept e Captures both the edges of input TO e Generates the input edge ISR with priority 0 IsrHallSensorA e QTIMER_AlI e Runs at frequency 468 75 kHz or IPB clock 128 e Captures both the edges of input T1 e Generates the input edge ISR with priority 0 IsrHallSensorB e QTIMER_A2 e Runs at frequency 468 75 kHz or IPB clock 128 e Captures both the edges of input T2 e Generates the input edge ISR with priority 0 IsrHallSensorC e QTIMER_A3 e Runs at frequency 3 75 MHz or IPB clock 16 e Counts until compare and reinitializes e Generates a 10 ms loop u
14. errupt with priority level 2 e Calls commutation routine e Clears the Capture flag e IsrQTA3Compare e Uses QTimer_A3 module enables the Compare interrupt with priority level 0 e Calls CheckManuallInterface routine e Calculates the actual speed value based on motor direction e Performs ramp function of the required speed BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 24 Freescale Semiconductor Inc Software design e Calculates output duty cycle utilizing PI speed controller e Clears the Compare flag e Reads status registers of three phase predriver MC33937 e Reads the value of DC Bus voltage Apart from state machine and interrupt service routines the application includes following functions e CheckManualInterface e Runs in 10 ms loop e Checks status of Up Down push buttons e Sets status bits accordingly e FaultDetection e Runs in background loop e Checks the DC bus voltage value for overvoltage and undervoltage fault e Checks PWM_FAULT0 flag connected to MC33937 for overcurrent detection Turns fault LED on if a fault is detected e Sets Error state e CommutationHS e Enters from all the three Hall sensor capture ISRs e Decodes Hall sensor input state e Negates the Hall sensor state for opposite motor direction e Updates the Mask register based on the Hall sensor state e Sets software control in the Deadtime source register to a PWM pair based on Hall sensor state Applies the Force event to change the
15. ervoltage undervoltage and overcurrent is implemented in the application The main application state machine runs in the background loop together with a fault detection routine manual interface processing and FreeMASTER polling function calling The application concept can be understood by means of three main functions e Speed controller function The speed controller function is called every 10 ms using Timer 3 ISR Hall sensor edges are captured using Timers 0 2 and commutation function is called accordingly The comparison between the required speed command and the actual speed calculated from Hall sensor signals generates speed error The speed error enters the PI speed controller that generates a voltage amplitude The PWM generation process calculates a system of three phase voltages of required amplitude including dead time and finally the three phase PWM motor control signals are generated e Fault detection and protection The application accommodates fault protection DC bus current is evaluated by the predriver MC33397 and in case any fault like overcurrent desaturation or undervoltage etc is detected a fault signal is generated After a fault is detected the predriver immediately disables the PWM output In case of undervoltage the predriver enters the fault state as well If any of the above mentioned faults occur the motor control PWM outputs are disabled in order to protect the drive When the application is in the Stop state
16. haseA fd f O J J lt Hall signal f 0O Do pP 0o Phase B Hall signal PhaseC O Poo 0 J lt voltage NL Phase A voltage L ELN ded ft ee Phase B voltage Phase C Figure 15 Motor timing diagram The motor timing diagram shown in Figure 15 can be summarized as follows BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 20 Freescale Semiconductor Inc Software design e For clockwise direction Read the motor timing diagram from to left to right The Hall signal Phase B low high transition comes at 120 electrical depicted as red dotted line The PWM Phase B is turned off and Phase C is on with positive duty cycle during this transition e For counterclockwise direction Read the motor timing diagram from left to right and the polarity of phases will be swapped Therefore if Phase A is in negative polarity from 60 to 180 for the clockwise direction it will be in positive polarity for the counterclockwise direction 4 Software design This section describes the software design of the BLDC motor drive application The system processing is interrupt driven with the application state machine running in background The software is described in terms of the following e Main Software Flow Chart e Application Interrupts 4 1 Main software flow chart After a reset the application performs the following routines and enters the endless main loop e PeripheralCoreInit e Initi
17. l field As mentioned earlier for proper operation of a BLDC motor it is necessary to keep the angle between the stator and rotor flux as close to 90 as possible Total six possible stator flux vectors can be obtained with a six step control The stator flux vector must be changed at specific rotor positions which are usually sensed by the Hall sensors The Hall sensors generate three signals that also consist of six states Each of the Hall sensors states correspond to a certain stator flux vector All the Hall sensors states with corresponding stator flux vectors are illustrated in Figure 5 abc 001 PhA 010 abc Hall sensor abc outputs 110 Figure 5 Stator flux vectors at six step control The next two figures depict the commutation process The actual rotor position in Figure 6 corresponds to the Hall sensors state ABC 110 Phase A is connected to the positive DC bus voltage by transistor Q1 Phase B is connected to the ground by transistor Q6 and Phase C is unpowered As soon as the rotor reaches a certain position the Hall sensors state changes its value from ABC 110 to ABC 100 See Figure 7 A new voltage pattern is selected and applied to the BLDC motor As shown in Figure 6 and Figure 7 it is difficult to keep the angle between the rotor flux and the stator flux precisely at 90 in a six step control technique while using the six step control technique The actual angle varies from 60 to 120 The co
18. limit of power supply to 20 30 of nominal motor current e Choose the direction of the motor rotation to be clockwise counterclockwise e Connect one out of the three motor phases to the positive terminal as shown in the first row of Table 2 e Connect the remaining two phases to the negative terminal All the phases are always supplied BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 14 Freescale Semiconductor Inc System concept Table 2 illustrates the required phases to be powered for the desired sector and the example of sensor output for the given BLDC motor The sectors I VI correspond to the sectors shown in Figure 13 Table 2 Hall sensor pattern definition Powered phase Sensor output of the motor U U 1 0 1 U U U U 1 0 0 U U U 1 1 0 U U U 0 1 0 U U U 0 1 1 U U U 0 0 1 BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 15 System concept VCC VCC VCC cha 104 Hall Sensor State VCC VCC PO ad M 01 j am Fi VCC FA VCC VCC f VCC Figure 13 Commutation sector definition 3 7 2 Definition of commutation vector When the Hall sensor patterns are defined the corresponding commutation vectors can also be defined For each of the sectors I VI the corresponding commutation vector A F and Hall sensor pattern are defined Table 3 sh
19. mmutation process is repeated per each 60 electrical degrees and is critical to change the switching pattern as fast as possible after a Hall sensor edge is detected Any deviation causes torque ripples resulting in speed variation BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 5 System description VCC PhA PhC kii no Actual flux vector connected VCC Figure 6 Situation right before commutation counterclockwise motion VCC PhA Phe f PhB New flux vector ka VCC connected Figure 7 Situation right after commutation BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 6 Freescale Semiconductor Inc Ty System description 2 4 Speed control The commutation ensures the proper rotor rotation of the BLDC motor while the motor speed depends only on the amplitude of the applied voltage which is adjusted using the PWM technique The required speed is controlled by a speed controller which is implemented as a conventional proportional integral PI controller See Figure 8 The difference between the actual and required speeds is input to the PI controller which then based on this difference controls the duty cycle of the PWM pulses corresponding to the voltage amplitude required to maintain the desired speed Power Stage irt Hall Sensors Figure 8 Speed controller The speed controller calculates the PI algorithm After the transformatio
20. n into a discrete time domain using an integral approximation with the Backward Euler method the numerical PI controller can be calculated using the following equations idk uplk uk uplk Kc Ak ult ulk 1 Ker da where e k Input error in step k w k Desired value in step k m k Measured value in step k u k Controller output in step k UpK Proportional output portion in step k uik Integral output portion in step k u k 1 Integral output portion in step k 1 T Integral time constant T Sampling time Ke Controller gain BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 7 System concept 3 System concept 3 1 System outline The system is designed to drive a three phase BLDC motor The application meets the following performance specifications e Speed control of a BLDC motor using Hall sensors e Targeted at TWR 56F8257 MCU Board TWR MC LV3PH Low Voltage Power Stage TWR ELEV and LINIX 45ZWN24 40 BLDC motor Features of the control technique e Low voltage BLDC motor control with speed closed loop e Bidirectional rotation e Two quadrant operation e Capability to start from any motor position without rotor alignment e Minimum speed of 300 rpm e Maximum speed of 4000 rpm limited by power supply e Manual interface with Up Down push button control and LED indication FreeMASTER co
21. ntrol interface with speed set up feature e FreeMASTER monitor e FreeMASTER Graphical Control Page to set the required speed actual motor speed start stop status and fault status e FreeMASTER Speed Control Scope to observe the required ramp and actual speeds and applied voltage e DC bus overcurrent overvoltage and undervoltage fault protection 3 2 Application description A standard system concept is chosen for the motor control function See Figure 9 The system incorporates the following hardware e TWR 56F8257 board e TWR MC LV3PH board e Tower Elevator e LINIX 45ZWN24 40 BLDC motor with Hall sensors e Power Supply 24 V DC 3 7 A For detailed description of a hardware configuration see TWR MC LV3PH User s Guide TWRMCLV3PHUG available at http www freescale com The DSC MC56F8257 runs the main control algorithm The three phase PWM output signals for a three phase inverter are generated according to feedback signals from Hall sensors and input variables See Figure 9 BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 8 Freescale Semiconductor Inc System concept Hall Sensor Signals BDM or _ Speed R5232 Command Processing Input capture TWR 56F8257 Figure 9 Application concept The required speed of a connected BLDC motor might be set either by using the onboard push buttons or the FreeMASTER control page The detection of three main faults namely ov
22. on table BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 25 Software design Q2 l PWM1 ae ee OFF o OFF PVWM3 i i w PVM period i Q1 PWM Q2 Q1 Q4 ON Deadtime ON Q1 i pwo j OFF Figure 18 PWM switching 4 4 Speed processing The first input value of the speed processing is set either by the Up Down push buttons or FreeMASTER control page as the f16SpeedCommand variable This variable is passed to f16SpeedRequired based on the motor direction and minimal speed The ramp function calculates output f16SpeedRamp using the input variable f16SpeedRequired The variable f 16SpeedRamp enters the speed controller as a desired value The second input value is calculated using a period between the two edges of Hall sensor A The output of the formula is the actual speed value f76SpeedActual which enters the speed controller The speed controller is implemented as a PI controller library function in parallel form GFLIB_ControllerPIp The output of the controller is a duty cycle which is put to the PWM value registers The speed process is shown in Figure 19 peed Command Desired Speed Speed Calculation Hall Sensor A Signal Actual Speed PWM Signals Figure 19 Speed processing BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 26 Freescale Semiconductor Inc Summa
23. ows the vectors for clockwise direction of rotation that ensures the variation of real angle from 60 to 120 See Commutation The Hall sensor BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 16 Freescale Semiconductor Inc System concept pattern considered as a binary number results in a decimal number from 1 to 6 For example 101 in binary form corresponds to the decimal number 5 From Table 3 it can be seen that commutation vector B corresponds to the decimal Hall sensor pattern 4 commutation vector A corresponds to number 5 and so on The graphical interpretation of commutation vectors is illustrated in Figure 14 Table 3 Clockwise direction Commutation vector vector Vector Hall sensor pattern definition sensor Hall sensor pattern definition definition Hall sensor VocB VocB A 5 Mees Vines NC B 1 0 0 4 Noes NC Niece C 1 1 0 6 NC vo Vpcs D 0 1 0 3 Vpcs Anca NC E 0 1 1 2 Vises NC Apos F 0 0 1 1 Table 4 Counterclockwise direction Commutation vector vector Vector Hall sensor pattern definition sensor Hall sensor pattern definition definition Hall sensor VDcB VDcB D 5 Noes NC Vpcs C 0 0 1 1 Voce Anes NC B 0 1 1 3 NC VpcB VbcB A 0 1 0 2 VpcB NC VpcB F 1 1 0 6 Vee Nica NC E 1 0 0 4 BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 17
24. r 1 480 768 2130 www freescale com support Europe Middle East and Africa Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen Germany 44 1296 380 456 English 46 8 52200080 English 49 89 92103 559 German 33 1 69 35 48 48 French www freescale com support Japan Freescale Semiconductor Japan Ltd Headquarters ARCO Tower 15F 1 8 1 Shimo Meguro Meguro ku Tokyo 153 0064 Japan 0120 191014 or 81 3 5437 9125 support japan freescale com Asia Pacific Freescale Semiconductor China Ltd Exchange Building 23F No 118 Jianguo Road Chaoyang District Beijing 100022 China 86 10 5879 8000 support asia freescale com For Literature Requests Only Freescale Semiconductor Literature Distribution Center 1 800 441 2447 or 1 303 675 2140 Fax 1 303 675 2150 LDCForFreescaleSemiconductor hibbertgroup com Document Number AN4413 Rev 0 11 2011 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductors products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Freescale Semiconductor reserves the right to make changes without further notice to any products herein Freescale Semiconductor makes no warranty representation or guarantee regarding the suitability of it
25. ry and conclusions 4 4 1 Speed constants and scaling All speed constants are related to the maximum value defined in N_MAX 5000 rpm Calculations are done in the factional format 1 15 in range from 1 to 1 The actual speed value is calculated using a period between Hall sensor edges and a scale constant which enables time value conversion to speed value The actual speed is calculated using the following equation PERIOD TO SPEED f16SpeedActual yightspaioad Speriod where PERIOD_TO_SPEED is calculated as following _ IPBCLK 60 PERIOD_TO_SPEED V MAXOT PRESCLR POLE PAIRS where for LINIX 45ZVN24 40 BLDC motor e IPBCLK 60 000 000 Hz e N_MAX 5000 rpm e QT_PRESCLR 128 e POLE_PAIRS 2 PERIOD_TO_SPEED 1406 The constant value PERIOD_TO_SPEED mentioned above expresses that for theoretical maximum measurable speed of 5 000 rpm the period is 1406 clocks of QTimer A3 For lower speeds the numbers of clocks are higher which suggests that the variable f 6SpeedActual is always in the range from 1 to 1 The period is measured between the falling and rising edges of a Hall sensor signal and equals the half period of an electric revolution To get the full electrical period the measured clock number has to be multiplied by 2 This is included in the PERIOD_TO_SPEED constant This range corresponds to mechanical speed range 5 000 to 5000 rpm The minimal measurable speed is limited to 32 767 clocks which correspond to a speed
26. s products for any particular purpose nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit and specifically disclaims any liability including without limitation consequential or incidental damages Typical parameters that may be provided in Freescale Semiconductor data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Freescale Semiconductor does not convey any license under its patent rights nor the rights of others Freescale Semiconductor products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application Buyer shall indemnify Freescale Semiconductor and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or
27. sing the compare value of 37 499 e Generates the compare ISR with priority 2 IsrQT3Compare 3 3 2 XBAR An XBAR peripheral enables peripheral interconnectivity using 30 dedicated channels The application is configured as following e Channel 6 ADCA Trigger e PWMO0_TRIG_COMB signal is used for ADC hardware synchronization e Channel 21 PWM module FAULTO e GPIO_C2 GPIO_E4 pins are used to connect external fault signal from MC33937 predriver to the ePWM fault 3 3 3 Enhanced Flex PWM eFlexPWM ePWM is a dedicated peripheral enabling the generation of three phase PWM signals connected via MC33937 predriver to MOSFET H bridge The three PWM submodules used are configured as follows e PWM_0 e IPBus clock source e Running frequency of 16 kHz with 62 5 us period Modulo 3750 with 11 bit resolution e Complementary mode with 1 us deadtime e PWM reload and synchronization signals generated every period from this module e Trigger 4 enabled to provide synchronization with ADC module via XBAR e High side switch PWM_A output in negative polarity e Low side switch PWM_B output in positive polarity e PWM_1 and PWM_2 e PWM_O clock source e Running frequency of 16 kHz with 62 5 us period e Modulo 3750 with 11 bit resolution e Complementary mode with 1 us deadtime e PWM reload and synchronization signals generated every period from PWM_0 module e High side switch PWM_A output in negative polarity e Low side switch PWM_B output in positive polarity e PWM
28. specific BLDC motor The aim of the process is the definition of the commutation pattern that is generated at the MCU ports according to the sensed Hall sensor pattern Hall sensors detect the rotor flux so their actual state is not influenced by stator current The Hall effect outputs in BLDC motors divide the electrical revolution into three equal sections of 120 electrical In this so called 120 configuration the Hall states 111 and 000 never occur Hall sensors are aligned phase to phase to the back EMF voltage See Figure 12 The process of definition has the following steps 1 Definition of Hall sensor pattern for each commutation sector 2 Definition of commutation vector for each Hall sensor pattern 3 Definition of commutation table according to the s w implementation H a Hall sensors i U a Figure 12 BLDC motor back EMF and Hall sensors patterns 3 7 1 Definition of Hall sensor pattern The Hall sensor pattern corresponding to the BLDC motor sector needs to be defined This can be done by supplying all the three phases with a combination of positive and negative voltage that causes the motor to move to the given sector and observing the Hall sensor signals when the motor settles The following steps describe a simple method which can be used to define the Hall sensor pattern e Mark all the motor phases as A B and C and Hall sensor outputs as H1 H2 and H3 in the desired order e Set the current
29. ter e AppError e Disables PWM outputs Transition between the main states is performed using the following four transient states e ApplInitToStop e Goes to the Stop state e AppStopToRun e Sets the motor direction e Sets the initialized output vector e Updates the PWM register e Enables PWM outputs e AppRunToStop e Enters when the main switch is turned off in the FreeMASTER control page or both the push buttons are pressed simultaneously e Clears variables e Disables PWM e AppErrorToStop e Clears variables e Tests fault clear variable e Turns fault LED off BLDC Motor Control with Hall Sensors Driven by DSC Rev 0 11 2011 Freescale Semiconductor Inc 23 Software design Init to Stop gt Error to Stop Stop To Run ERROR Run To Stop Figure 17 Application state machine 4 2 Application interrupts and routines Four interrupt service routines ISR execute the 10 ms control loop and capture three Hall sensor edges Tasks performed in each ISR are described below e IsrHallSensorA e Uses QTimer_AO module enables the Input Capture interrupt with priority level 2 e Calls commutation routine e Calculates the period between two edges of Hall sensor A e Clears the Capture flag e IsrHallSensorB e Uses QTimer_A1 module enables the Input Capture interrupt with priority level 2 e Calls commutation routine e Clears the Capture flag e IsrHallSensorC e Uses QTimer_A2 module enables the Input Capture int
30. unauthorized use even if such claims alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part RoHS compliant and or Pb free versions of Freescale products have the functionality and electrical characteristics as their non RoHS complaint and or non Pb free counterparts For further information see http www freescale com or contact your Freescale sales representative For information on Freescale s Environmental Products program go to http www freescale com epp Freescale and the Freescale logo are trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners 2011 Freescale Semiconductor Inc ey freescale K

Download Pdf Manuals

image

Related Search

Related Contents

Hewlett Packard Enterprise 120GB Value Endurance M.2 ProLiant ML/DL  CC-QS023 - Rockwell Automation  Cytokeratin 5 + Cytokeratin 14  

Copyright © All rights reserved.
Failed to retrieve file