Home
Sensorless BLDC Motor Control Using MC9S08AW60
Contents
1. 9 Figure 4 2 MC9S08AW60 Evaluation Board View Mandatory Jumper Settings 4 2 2 Micro Power Board Freescale s embedded motion control series 3 phase micro power stage is a 12 V 3 A surface mounted power stage With one of the embedded motion control series control boards it provides a software development platform allowing algorithms to be written and tested without designing and building a power stage It supports algorithms using hall sensors and back EMF electromotive force signals for sensorless control The 3 phase micro power stage does not have any over current protection independent of the control board when using a lower impedance motor take care in its setup and use With the motor supplied in the kit the power output stage withstands a full stall condition without the need for over current protection Current measuring circuitry is set up for 8 25 A full scale In a 25 C ambient operation up to 3A continuous RMS output current is within the board s thermal limits 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 33 Hardware 2 RZ J1 y u e Ph a pu e Js fra 8 5 L 1 MOTOR 253 AA 28 CONNECTOR ipe scc HESS Lt eas cis cul m e 2 LY AL eve R37 R362 oa m FER 18 c17 nis a iL Dr T POWER UNI 3 SES CONNECTOR enD 12V rmx POWER SUPPLY gt ed CONNECTORS 12Udc Figure 4 3 Micro P
2. After the START STOP switch is in the START position the motor starts running with a minimum speed of 150 rpm or with a minimum DC bus current of 0 2 A based on the operational mode To increase decrease the speed DC bus current torque use the UP DOWN buttons The speed increment is 150 rpm and the maximal motor speed is 1200 rpm The DC bus current increment is 0 1 A and the maximal DC bus current is 2 A The default direction of rotation is clockwise rotation The default operational mode is speed mode The direction of rotation and operational mode cannot be changed manually To change the direction of rotation and operational mode use the FreeMASTER software 7 3 2 Remote Operation Remote operation can be provided by FreeMASTER software via the BDM interface For correct FreeMASTER software go to Project Option Comm and set communication via the plug in BDM module see Figure 7 2 If the BDM option is unavailable install the latest version of FreeMASTER on your computer 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 56 Freescale Semiconductor A gt Manual Remote Operation F BLDC BEMF DEMO S08AW60 pmp FreeMaster File Edit View Explorer Item Project Tools Help aloja eals uz Fe elle nal Sensorless BLDC New Scope EE Designed By t ilic Comm MAP Files Pack Dir HTML Pages Demo Mode Options Communication C Direct RS232 connection Pott cow
3. define START ACCELERATION 243 This value defines other commutation periods during start up see Section 3 3 5 2 The value is calculated as a constant from the range 0 1 multiplied by 256 Example If the acceleration constant is set at 0 95 and START PERIOD is set at 6000 then START ACCELERATION is 243 and start up periods are calculated as 3000 see note at START PERIOD 5700 5415 5145 4887 and 4643 define START SPEED 1610 This constant defines the motor speed after the start up sequence For scaling see Section 5 5 3 define START TORQUE 10 This constant defines the motor current torque after the start up sequence For scaling see Section 5 5 4 define START CMT NUMBER 6 This constant defines the number of start up commutation periods see Section 3 3 5 2 define STABILIZATION CMT NUMBER 6 This constant defines the number of stabilization commutation periods see Section 3 3 5 3 5 5 3 Speed Constants and Scaling The motor speed scaling for motor IB23810 can be calculated as 16777216 TPM2 PRESCALER 6 p O gpyy 0 a SCALED TPM2_INPUT_CLOCK 60 2 5 3 where TPM2_PRESCALER 128 TPM2_INPUT_CLOCK 20 MHz p number of pole pairs 2 for motor IB23810 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 46 Freescale Semiconductor Constant Calculation define MAX_SPEED 128
4. 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 51 Application Setup 6 2 Software Setup 6 2 1 Application Software Files The application software files are Asoftware DEMO bldc AW60 mocp application project file Asoftware DEMO sources main c main program AsoftwareNDEMO sources wmain h header file for main code Asoftware DEMO sources math c library of mathematical functions Asoftware DEMO sources math asm library of mathematical functions Asoftware DEMO sources math h header file for mathematical functions Asoftware DEMO sources STARTOS C start up code for HCS08 stationary 6 2 2 Application FreeMASTER Software Control Files The application FreeMASTER software control files are Asoftware DEMO FreemastenBLDC BEMF DEMO S08AW60 pmp FreeMASTER software project file software DEMO Freemasten source directory with FreeMASTER software control page files 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 52 Freescale Semiconductor AAA NS Software Setup 6 2 3 Application Build To build the sensorless BLDC demo application open the BLDC_AW60 mcp project file and execute the Make command Figure 6 5 This builds and links the application with all the required CodeWarrior libraries Freescale CodeWarrior main c B Hoc Bad main c to Project Add Files Create Group Targe
5. Designer Reference Manual Rev 0 1 40 Freescale Semiconductor Processes Description period is calculated and saved for speed calculation The new commutation event is then calculated and set to the timer TPM1 channel O as a new compare event 5 4 2 Process Torque and Speed Calculation Both torque and commutation periods are filtered to get suitable input values to the torque and speed PI controllers Both values are calculated as the averages from the last six commutation events Then the averaged commutation period is recalculated as the motor speed This process executes every 5 ms in the iss TM2 ChO Compare interrupt 5 4 3 Process Standstill Detection This process compares all six commutation periods If the difference between periods is higher than defined a standstill is detected It also detects incorrect commutation during start up or loss of synchronization between commutation sector and sensed back EMF voltage At any error the motor is stopped and the start up sequence is repeated This process executes every 5 ms in the isr TM2 ChO Compare interrupt 5 4 4 Process Commutation This process updates the variable pwm sector only The PWM update based on the new commutation sector is performed in the PWM Update process The commutation process is called on every new commutation event Therefore the execution period depends on the motor speed 5 4 5 Process Manual Interface This process checks the state of the input pins w
6. Manual Rev 0 1 Freescale Semiconductor 63 logic 1 A voltage level approximately equal to the input power voltage Vpp logic 0 A voltage level approximately equal to the ground voltage Vss LV Low Voltage 12 V DC MC9S08AWX A Freescale family of 8 bit MCUs suiitable for motor control PI controller Proportional Integral controller phase locked loop PLL A clock generator circuit in which a voltage controlled oscillator produces an oscillation which is synchronised to a reference signal PM Permanent Magnet PMSM Permanent Magnet Synchronous Motor PWM Pulse Width Modulation Reset To force a device to a known condition RPM Revolutions per minute SCI See serial communication interface module SCI software Instructions and data that control the operation of a microcontroller software interrupt SWI An instruction that causes an interrupt and its associated vector fetch timer A module used to relate events in a system to a point in time 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 64 Freescale Semiconductor How to Reach Us USA Europe Locations not listed Freescale Semiconductor Literature Distribution P O Box 5405 Denver Colorado 80217 1 800 521 6274 or 480 768 2130 Japan Freescale Semiconductor Japan Ltd SPS Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 8
7. PWM mode the top and bottom switches of a phase are operated independently over a commutation period If a top switch performs a PWM the bottom switch is off and vice versa In this mode the drive can operate in two quadrants the bipolar and unipolar switching are available Using independent bipolar switching has significant drawbacks The drive can work with discontinuous or continuos currents During the transition from discontinuous to continuous current the drive significantly changes its behavior tuning of the speed controller is very difficult and the drive exhibits low torque at a discontinuous current Using unipolar switching is not recommended due to problematic back EMF voltage and current sensing at narrow pulses Figure 3 2 through Figure 3 5 show details of one PWM period for the BLDC motor Phase A is connected to a positive DC bus voltage phase B is connected to a negative DC bus voltage Phase C is non fed and not shown The duty cycle is 50 percent 3 3 1 3 Conclusion The complementary bipolar switching is optimal for the selected back EMF voltage sensing method when implemented on the MC9S08AWOO The details of back EMF voltage sensing method are shown in Section 3 3 3 However there is one limitation when the complementary switching is implemented If the phase is disabled the TPM one pair of the timer channels is disabled by setting of ELSnB ELSnA bits to zero If the TPM timer channel is disabled the polarity of output
8. Up State Stabilization state Run state Error state INFINITE LOOP isr IRQ IRQ 5 3 Data Flow Overcurrent handling Figure 5 1 Main Software Flow Chart isr_TM1_Overflow TPM1 Overflow interrupt e Starts first ADC conversion in PWM period e Second sample pointer calculation e Saves first sample e Starts second conversion Updates PWM e Saves second sample Zero crossing detection isr TM2 Ch0 Compare TPM2 Ch0 Compare Updates new commutation sector isr TM2 Ch1 Compare TPM2 Ch1 Compare e Ramp generation Speed calculation Torque calculation Torque PI controller calculation e Speed PI controller calculation e Standstill detection e Manual interface handling The BLDC motor sensorless control drive control algorithm is described in Figure 5 2 flowcharts These variables contain the results of the analog to digital conversion PhA voltage PhB voltage e PhC voltage dcb voltage dcb current The zero crossing detection process compares the phase voltage to dcb voltage 2 The appropriate phase voltage is chosen based on pwm sector containing the actual commutation sector The result of zero crossing detection process defines the time difference for the next commutation saved in periodNextCommutation For further speed calculation individual commutation periods are also stored for every commutation in variables periodZC F PhA 3 Phase Brushless DC
9. complementary PWM mode the top and bottom switches of a phase are operated complementarily if one switch is on the other is off This mode must be used if four quadrant drive operation is required This mode needs dead time insertion between the top and bottom switches to avoid any phase short circuit The complementary switching can be implemented in a bipolar or unipolar manner The unipolar switching leads to lower switching losses and current ripple However from a back EMF perspective the bipolar switching is the better choice because this allows a duty cycle in the range of 50 percent to 100 percent It significantly simplifies the back EMF voltage and current sensing 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 23 System Concept Dead time ER ON Phase A PWMO j OEE Phase A PWM1 Phase B PWM2 ON Phase B PWM3 i OFF PWM period lt gt Figure 3 2 Complementary Bipolar Switching Patterns for BLDC Motor Dead time ae ON Phase A i PWMO OFF Phase A PWM1 Phase B PWM2 ON Phase B i PWM3 E OFF PWM period E Figure 3 3 Complementary Unipolar Switching Patterns for BLDC Motor 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 24 Freescale Semiconductor System Blocks Concept 3 3 1 2 Independent PWM Mode In independent
10. must be less than 1 a value within range 0 7 to 1 gives an approximate constant acceleration Another way is to define a start up table with period timing The initial period must be tuned based on load inertia The start up tuning is the heaviest task in the back EMF sensorless technique The tuning difficulty depends on the load type On a passive load where the load torque starts at 0 Nm and grows with the motor speed it is easy A more difficult situation can be observed on drives having non zero starting torque or a variable torque within one revolution such as compressors If load inertia is variable the number of starting flux vectors can be changed A number smaller than six brings about a more robust start up at variable load inertia however a number less than three leads to an unreliable start up In other cases the six starting flux vectors one electrical revolution seems to be an optimal value After the last flux vector executes back EMF voltage evaluation is enabled and the motor enters a sensorless mode 3 3 5 3 Stabilization The stabilization process immediately follows the start up sequence and is optional The purpose of this process is to stabilize the measured values As described in Section 3 3 4 the torque is calculated as the average value from the last six commutations the speed is calculated in the same manner Because the periods are unstable during the start up sequence the speed and torque values can be wrong
11. six steps The crossing points of the phase Back EMF voltages represent the natural commutation points In a normal operation the commutation is performed here Some control techniques lead the commutation by a defined angle to control the drive above the PWM voltage control VN ant ee son Phase Phase Back EMF 1 Mu JAA i ua id LA ce AABT ds eae A jj 1 ec oe boo ub 20202 TA qa O N EN A UN ANM Nr S NAME RUM IN ON A Sere NND ee n I dll cd Figure 2 3 BLDC Motor Back EMF and Magnetic Flux 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 13 Control Theory 2 2 Power Stage The voltage for a 3 phase BLDC motor is provided by a typical 3 phase power stage The MCU on chip TPM PWM module controls the 3 phase power stage which creates the desired switch control signals Figure 2 4 U DCB T Q5 PWM_Q1 gt PWM Q3 gt PWM Q5 gt C1 Q6 PWM Q2 gt PWM Q4 gt PWM Q6 E gt Phase A Phase B Phase C Figure 2 4 3 Phase BLDC Motor Power Stage 2 3 Mathematical Description of Brushless DC Motor 2 3 1 Power Stage Motor System Model To explain and simulate back EMF sensing techniques a simplified mathematical model based on the basic circuit topology is provided Figure 2 5 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manu
12. two speed and torque operational modes 7 2 BLDC Drive Operational Modes 7 2 1 Speed Operational Mode If the application is set to the speed operational mode the user can set the required speed manually or by the PC The DC bus current torque is automatically set to the maximal value of 2 A In this case the BLDC drive maintains the required speed until the maximum DC bus current torque is exceeded 7 2 2 Torque Operational Mode Similarly in torque operational mode the user can set the DC bus current torque of the BLDC motor The required value can be set by the UP DOWN buttons or remotely by the PC The speed limit is set to a maximal speed of 1200 rpm In this case the BLDC drive maintains the required DC bus current torque until the maximum BLDC motor speed is achieved The operational mode can be changed only when the motor is stopped START STOP switch is in the STOP position The default setting is speed operational mode 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 55 Sensorless BLDC Demo Operation 7 3 Manual Remote Operation Figure 7 1 Manual Interface 7 3 1 Manual Operation To run the BLDC motor switch the START STOP switch to the START position toward the middle of the controller board If the START STOP switch is in the START position when applying the power supply turn the switch to the STOP position before running the BLDC motor
13. z Speed 3500 z Timeouts Connect string drv 0 type 1 usb 1 chk 1 chki 2000 Build Note For DCOM based communication see also system settings Run DCOMCNFG Save settings to project file IV Save settings to registry use it as default Communication state on startup and on project load Open port at startup C Do not open port at startup Store port state on exit apply it on startup Store state to project file apply upon its load Advanced Cancel Apply Help Figure 7 2 FreeMaster Communication Settings The FreeMASTER software control page offers the same interface as the manual controls adds some other features such as the change of rotation direction operational mode settings and displays some additional status information Figure 7 3 To start a remote operation run the FreeMASTER software and open the project file located at Software DEMO Freemaster BLDC_BEMF_DEMO_S08AW60 pmp The remote operation is active when the START STOP switch is in the START position The values which can be changed are displayed in red The motor speed can be set to any value within the range of 150 to 1200 rpm The DC bus current torque can be set to any value within the range of 0 1 to 2 A The direction of rotation and operation modes can be changed only when the motor has stopped When you switch the START STOP switch to STOP position the motor stops and the remote control d
14. 1 3 3440 3569 Asia Pacific Freescale Semiconductor H K Ltd 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 Learn More For more information about Freescale Semiconductor products please visit http www freescale com DRMO086 Rev 0 1 01 2007 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor 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 its 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 and all liability including without limitation consequential or incidental damages Typical parameters which 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 r
15. 3 1 3 2 3 3 3 3 1 3 3 1 1 3 3 1 2 3 3 1 3 3 3 2 3 3 3 3 3 4 3 3 5 3 3 5 1 3 3 5 2 3 3 5 3 3 3 5 4 4 1 4 2 4 2 1 4 2 2 4 2 3 5 1 5 2 5 3 5 4 5 4 1 Chapter 1 Introduction INUOQUENSO acci actas doa qoe or Nd ora a COP ERU RU ORE UP IRE CDM AGO AECA O A Freescale MC9SO8AW60 Advantages and Features 00 0c cee eee Chapter 2 Control Theory Brushless DG Motor BLDG MOO seat ipt debes iaa a lb KR 06D MEET TIE I DII TII UT TREE TP ES Mathematical Description of Brushless DC Motor ooocoocccoccco eee eee Power Stage Motor System Model nannan RyRe E CRERATPERITERTREEYR O4 d bean Mathematical MOOL AAA Back EMF SEU pr ri ee eer ne re one rey wea Made Roda defe doa d RC e ER Chapter 3 System Concept Sos a MS o e A XR ORC RACER OD OREO RETR ELE EE ERE ER OR TES System Blocks Concept cia eodd PON AAA AAA AAA PWM Voltage Generation for Brushless DC Motor 0 000 ee eee eee Complementary PWM Mode 2 2 ciceciaseatencddad rc ee Independent PWM MODE coimas ie ie Sali EN A A ECT E A ied eset edkustid oid dq b er eine ead Back EMP Zero Crossing Sensing sicesecseleseRRLERRRR E EBERIERRRRERTRREEKRA Current CTORUM SONO go oe sedit tea eE a a OO ERE Eb eS obo edd iei Sensorless Dommutabon Comto s 20c cesses kee es rr Er ERES AAA US i ia eee verd Ado ee ee ee ere ee ee AAA c cq TTC eer ee a er eee wee eerie se eee eee eee eee re DUISBIUEAOD 422346 xrR d RERO RR OCER E ERG RAF AAA AA aw
16. 80 1200 RPM This constant defines the maximum required motor speed define MIN SPEED 1610 150 RPM This constant defines the minimal required motor speed define SPEED STEP 1610 150 RPM This constant defines the step increment fir the required motor speed This increment is used for increasing decreasing the required speed when the UP DOWN buttons are used define SPEED RAMP INCREMENT 50 5 5 4 Torque Constants and Scaling The current scaling on the micro power stage can be calculated as 0 2V A liscALEp liy 33V 1024 5 4 define MAX TORQUE 124 2 Amps This constant defines the maximal required motor current torque define MIN TORQUE 12 0 2 Amps This constant defines the minimal required motor current torque define TORQUE STEP 6 0 1 Amps This constant defines the step increment for the required motor current torque This increment is used for increasing decreasing the required motor current torque when the UP DOWN buttons are used 5 5 5 DC Bus Voltage Scaling The DC bus voltage scaling on the micro power stage can be calculated as 0 20625 V V VpcaiscALED VpcBivj 33y gt 1024 5 5 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 47 Software Design 3 Phase Brushless DC Motor Sensorless Control
17. DC KBI TPM compatible peripheral Header allowing users to attach their own port CE GPIO IIC SCI SPI compatible peripheral Header allowing users to attach their own ADC compatible peripheral Header allowing users to attach their own PWM compatible peripheral Header allowing users to attach their own KBl port G GPIO compatible peripheral Header allowing users to attach a ZigBee module or other SCI compatible peripheral On board power regulation from an external 12 V DC supplied power input Light emitting diode LED power indicator Six on board PWM monitoring LEDs One on board PWM fault monitoring LED One on board general purpose User LED UNI 3 motor interface DC bus voltage sensing DC bus current sensing Back EMF sensing Temperature sensing PWM BRAKE PFC and PWM signals Encoder hall effect interface Tacho generator interface PWM dead time insertion circuit DC bus over current and over voltage protection logic DC bus current peak detector and average value sensing Manual RESET push button General purpose push button for UP on GPIO PTG1 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor Component Descriptions e General purpose push button for DOWN on GPIO PTGO e General purpose toggle switch for START STOP control on GPIO PTC4 6 56 5 6 5 4 34 3 4 3 2 12 1 2 J21 J20
18. Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 38 Freescale Semiconductor Data Flow e periodZC_R_PhA e periodZC F PhB e periodZC HR PhB e periodZC F PhC e periodZC R PhC In every zero crossing event the value of dcb current is copied to the variables torque F PhA torque RH PhA lorque F PhB torque R PhB torque F PhC torque R PhC The variable torque Filtered is calculated as an average value of variables torque F PhA torque RH PhA lorque F PhB torque R PhB torque F PhC torque R PhC The commutation period is also filtered from variables and recalculated as the motor speed actual speed e periodZC F PhA e periodZC_R_PhA e periodZC_F_PhB e periodZC R PhB e periodZC_F_PhC e periodZC R PhC Both values are input into the speed and torque PI controllers as actual values The required values desiredSpeed slopedSpeed and torqueRequired are updated based on commands from the user A ramp limits the required speed to avoid exceeding the maximum motor current The resulting speed and torque PI Controllers duty cycle combined with the actual commutation sector pwm sector and the required direction of rotation direction define the duty cycle of every PWM channel 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 39 Software Design The application state machine sets its state AppS
19. Sensorless BLDC Motor Control Using MC9S08AW60 DRMO086 Rev 0 1 01 2007 freescale com z freescale semiconductor Sensorless BLDC Motor Control Using MC9S08AW60 Designer Reference Manual by Pavel Grasblum Freescale Czech Systems Center Roznov pod Radhostem Czech Republic To provide the most up to date information the revision of our documents on the World Wide Web are the most current Your printed copy may be an earlier revision To verify you have the latest information available refer to http www freescale com Freescale and the Freescale logo are trademarks of Freescale Semiconductor Inc This product incorporates SuperFlash technology licensed from SST O Freescale Semiconductor Inc 2007 All rights reserved 3 Phase BLDC Motor Sensorless Control using MC9SO8AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor Revision History The following revision history table summarizes changes contained in this document For your convenience the page number designators have been linked to the appropriate location Revision History Revision EP Page Date Level Description Number s November 2006 0 Initial release 62 pie 0 1 Changes in chapter 3 and 5 to reflect latest version of the software 62 3 Phase BLDC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 1 1 1 2 2 1 zn 2 3 2 3 1 2 3 2 2 3 3
20. Therefore the stabilization process executes This process lasts at least six additional periods where the motor is kept in an open loop During these additional periods the speed and torque values stabilize and the control loop can close 3 3 5 4 Run After the control loops close the motor enters the run state Here the motor remains at the desired speed or torque according to the selected operational mode and user commands Besides controlling the desired quantity the motor is checked for locked rotor This might happen when the motor is suddenly overloaded Standstill detection is performed as a comparison between the actual period and the average period If the difference is too high for a predefined time a standstill or incorrect commutation is detected If the actual period does not correspond to the applied voltage on the motor the error is indicated In the case of a standstill or incorrect commutation the motor stops and the start up sequence repeats 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 30 Freescale Semiconductor Chapter 4 Hardware 4 1 Hardware Implementation The BLDC sensorless application runs on Freescale s MC9SO8AWEO evaluation board micro power board and IB23810 motor NOTE This reference design demonstrates the application using low voltage power stages but can be adapted to high voltage power stages and applications 12V 12V Micro P
21. al Rev 0 1 14 Freescale Semiconductor Mathematical Description of Brushless DC Motor Ura Figure 2 5 Power Stage and Motor Topology The model goal is to discover how the motor characteristics depend on the switching angle The switching angle is the angular difference between a real switching event and an ideal one at the point where the phase to phase back EMF crosses zero The motor drive model consists of a 3 phase power stage plus a brushless DC motor A voltage source Ug provides the power for the system Six semiconductor switches Sa pjc yp controlled elsewhere allow the rectangular voltage waveforms to be applied Figure 2 2 The semiconductor switches and diodes are simulated as ideal devices The natural voltage level of the whole model is applied at half the DC bus voltage This simplifies the mathematical expressions 2 3 2 Mathematical Model The BLDC motor is usually symmetrical All phase resistances phase and mutual inductances and flux linkages can be thought of as equal to or as a function of the position with a 120 electrical degree displacement The electrical BLDC motor model then consists of the set of the following stator voltage equations 2 1 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 15 AN Control Theory The equations in 2 4 can be rewritten taking into account the motor phase resistance and the inductance Th
22. back EMF voltage When the phase disconnects from the DC bus a current continues flowing through the freewheeling diode The conduction time depends on the momentary load of the motor In some circumstances the conduction time is so long that it disallows the detection of back EMF voltage The conduction freewheeling diode connects the released phase to positive or negative DC bus voltage The next two steps detect current in the non fed phase 1 The first three samples after commutation are not considered for back EMF voltage detection due to transient event 2 The back EMF samples within the range of 0 percent to 20 percent 80 percent to 100 percent of the DC bus voltage are ignored When the back EMF voltage falls into the range of 20 percent to 80 percent of the DC bus voltage evaluation of zero crossing starts The back EMF voltage samples are compared with half DC bus voltage in relation to an expected positive or negative slope If zero crossing is recognized the new period and commutation event is calculated The zero crossing detection process can be seen in Figure 3 8 PWM Switching mu Ps A meu ud E mc 80 10096 of DCB Voltage Zero Crossing Phase Voltage V Back EMF voltage 0 2096 of DCB Voltage Freewheeling Figure 3 8 Zero Crossing Detection Process 3 3 4 Current Torque Sensing Besides the speed control mode the drive can run in torque control mode In this mode the torque is limited to the desir
23. c 4 2 6 1 Vsx T o gt UbackEMFx 1sx A i 1Sx x a x a where T internal motor torque no mechanical losses o 0 rotor speed and rotor position Vox magnetic flux of phase winding x 2 3 3 Back EMF Sensing The back EMF sensing technique is based on the fact that only two phases of a Brushless DC motor are energized at a time see Figure 2 2 The third phase is a non fed phase that can be used to sense the back EMF voltage Let us assume the situation where phases A and B are powered and phase C is non fed No current passes through this phase Assume the following conditions are met Sap Spi PWMswitching u T u u VA 2 d VB 72 d 2 7 sa Agp lg 0 dig 0 UbackEMFa UbackEMFb UbackEMFc 9 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor Control Theory The branch voltage uyc can be calculated when considering the above conditions 2 8 3 Uvc gt UbackEMFC Figure 2 6 illustrates that the branch voltage of phase C between the power stage output C and the natural voltage level can be sensed Therefore the back EMF voltage is obtained and the zero crossing can be recognized The general expression can be found by 2 9 3 Uyx 2 backEMFx where x A B C Two conditions must be met Top and bottom switch in diagonal must be driven by the same PWM signal No current is going through the non fed p
24. cated This operation is hidden from the application due to non intrusive debug support for the MC9S08AWSOO via the BDM interface 5 4 10 Process PWM Update The PWM update process generates the correct voltage pattern on the motor based on the actual PWM sector direction of rotation and required output voltage The process is called every 62 5 us in isr TM1 overflow The commutation table derives from back EMF voltage measured on the motor Figure 5 5 Besides the proper commutation pattern the back EMF sensing can be evaluated from Figure 5 5 For example the falling back EMF voltage of phase A must be evaluated for zero crossing if phase C connects to positive DC bus voltage and phase B connects to negative DC bus voltage The resultant commutation table includes sensing of the back EMF voltage as shown in Table 5 1 for counter clockwise direction and in Table 5 2 for clockwise direction 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 43 Software Design MCG Ib23810 BLDC motor Vector Number 1 2 3 4 5 0 Counter clockwise direction Phase A black yellow motor picture C TOP C TOP BTOP BTOP ATOP ATOP Phase B yellow cyan Phase State BBOT ABOT ABOT CBOT CBOT BBOT Phase C red violet AOFF BOFF COFF AOFF BOFF COFF lA Ch1 Duty 51 16 Chi 2 00V 2 00 V 9 Feb 2006 15 40 23 49 29 Figure 5 5 Motor Back EMF Mea
25. circuit IIC bus module to operate at up to 100 kbps e One 2 channel and one 6 channel 16 bit timer pulse width modulator TPM modules Selectable input capture output compare and edge aligned pulse width modulation PWM capability on each channel Each timer module may be configured for buffered centered PWM CPWM on all channels 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 8 Freescale Semiconductor Freescale MC9S08AW60 Advantages and Features 16 bit periodic interrupt timer PIT counter 8 pin keyboard interrupt KBI module Eight high current pins limited by package dissipation Software selectable pullups on ports when used as input selection is on an individual port bit basis during output mode pullups are disengaged Software selectable slew rate control on ports when used as inputs Master reset pin and power on reset POR Internal pullup on RESET and IRQ pins to reduce customer system cost 52 general purpose input output I O pins 64 pin low profile quad flat package LQFP and 64 pin quad flat package QFP Table 1 1 shows memory configuration of the MC9SO08AW6O family Table 1 2 shows peripheral availability according to package type Freescale Semiconductor Table 1 1 Memory Configuration Device Flash Memory RAM Package MC9S08AW60 63280 MC9S08AW48 49152 2048 ee MC9S08AW32 32768 eee MC9S08AW16 16384 1024 Table 1 2 Peri
26. dges Therefore the presented BLDC motor control application synchronizes the back EMF zero crossing detection with PWM The analog to digital conversion of phase branch voltages is triggered in the middle of a PWM pulse Then the voltage for back EMF is sensed at those moments when the non fed phase branch voltage is stabilized 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 26 Freescale Semiconductor System Blocks Concept The MC9SO8AWx is not equipped with synchronization of the TPM PWM and ADC modules Therefore several assumptions must be considered during the ADC sampling implementation The first limiting factor is the choice of PWM modulation From this perspective the complementary bipolar switching is the best choice This PWM switching can be implemented so the duty cycle is in the range of 50 percent to 100 percent at any time of motor operation It gives a good condition for ADC sampling because at least 1 4 of the PWM period is available for ADC sampling With unipolar switching the duty cycle starts from 0 percent This means that there is a limit on ADC sampling at narrow pulses regardless of whether hardware synchronization is available In this case a different sensing method must be chosen where the back EMF voltage is compared to zero instead of half DC bus voltage Secondly the TPM PWM module must be properly set to ensure ADC sampling at mid pulse See Figure 3 7 for the right
27. e mutual inductance between the two motor phase windings can be neglected because it is very small and has no significant effect for our abstraction level Usa isa d Vsa 2 1 Usp Rs Jigs q Yso Use isc Vsc The following set of equations is valid for the presented topology Usa Uya 7 Ug 2 2 Usp Uyg Uo ee Use Uyc Ug C c 1 ug 3 gt Uy x MITT 2 3 x A x a c 1 Usa 3 2UyA Uyg yc 2n UbackEMFx x a 2 4 1 Usb 73 2Uyg Uya Uyc UbackEMFx x a c 1 Uso 7 3 2Uyc Uva Uyg y UbackEMFx X a d where Ue Branch voltages between one power stage output and its natural zero Mousse Motor phase winding voltages O EE Phase back EMF induced in the stator winding i Differential voltage between the central point of the star connection of motor winding and the power stage natural zero lg nds Phase currents Rs Phase resistances 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 16 Freescale Semiconductor Mathematical Description of Brushless DC Motor E c ES 1 dis 2 5 Uva UbackEMFa 3 b3 Uyy x UbackEMFx Rgisa L dt Lx A x a zl 1 disp Uvp UbackEMFb 7 3 y Uy 2 UbackEMFx Reign E Lx A x a 4 pue C c 1 i dig Uyc UbackEMFe 7 3 Uy x UbackEMFx Rise L dE Lx A x a 4 where Ro L phase resistances and inductances The internal torque of the motor itself is defined as c
28. e rotor BLDC Brushless dc motor commutation A process that creates a rotational field by the switching of power transistors electronic replacement of brush and commutator commutator A mechanical device alternating the DC current in a DC commutator motor and providing rotation of a DC commutator motor COP Computer Operating Properly timer DC Direct Current DT see Dead Time DT Dead Time DT the short time that must be inserted between the turning off of one transistor in the inverter half bridge and the turning on of the complementary transistor due to the limited switching speed of the transistors duty cycle A ratio of the amount of time the signal is on versus the time it is off Duty cycle is usually represented by a percentage GPIO General Purpose Input Output Hall Sensors A position sensor giving six defined events each 60 electrical degrees per electrical revolution for a 3 phase motor HV High Voltage 115 V AC or 230 V AC interrupt A temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine input output I O Input output interfaces between a computer system and the external world A CPU reads an input to sense the level of an external signal and writes to an output to change the level on an external signal 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference
29. ed Chapter 4 Hardware Hardware Implemsnbtll uua ceu cub eI rd Ea redet Component DERG cu oaa bacs rx Pack ep ox EXE Pr Roo oe rac oe ded MCSS0B8AWSUO Evaluation Board iussus xs Ru RR X Y AAA Micro Power Boal esae zu dextezedkxtbi bx YEPEORSEY DeERIREEIGYGERIZOG EXPRRSOR PRA Motor IB23810 Produced by MOR diea AGE REOR RR AAN Chapter 5 Software Design IAE A LE TCLRESSC eee FETRbSLECUURIEET ESSO IER ES CE ast Mah Some PION CNR Lus cece hoy Rd reabierto ib DUE PINE Lada pd RAE EHEUR ECEOD ADORA ER HR AOS BARANDA PARANA Processos DESCUIDO s 1 43 9d AAA dolce ops A CO RUM eb do Process Zen Cibssina Detection A e VERE REIR E PEL E des pone UE 3 Phase BLDC Motor Sensorless Control Using MC9S08AW6O0 Rev 0 1 Freescale Semiconductor 5 4 2 5 4 3 5 4 4 5 4 5 5 4 6 5 4 7 5 4 8 5 4 9 5 4 10 5 5 5 5 1 5 5 2 5 5 3 5 5 4 5 5 5 6 1 6 2 6 2 1 6 2 2 6 2 3 6 2 4 fel pe rem Lee 7 3 7 3 1 7 3 2 Process Torque and Speed Calculation n nannan ne 41 Process Standstill Detection 1c cosccrcrrr doler raras APA TER 41 Process ORIO cca cacra ED ness ratio io id deed io da casas 41 al AA 41 Process Application State MISCO soscosirsidarrr ri A 41 Process Speed and Torque PI Controller 0 0 cc ccc eee eens 42 Process BOND cse steinn 4690654064454 064 6540605466465 045040 000 AAA ARA 43 Process ICI S TER A AEREA rere ee ere Serr A 43 Process PYM UBOSIG varia AAA ERED 43 Conciani AAA odds eRe S
30. ed value In BLDC motor theory the torque is proportional to motor current In six step control the current amplitude varies during the commutation period To get a stable value as the actual motor torque the current is sampled at a zero crossing event The resultant value is calculated as the average value from the last six commutation periods Therefore the acquired value can be used as the actual motor torque for the torque control loop This value cannot be used for current control cycle by cycle The IGBT driver performs over current limitation 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 28 Freescale Semiconductor System Blocks Concept 3 3 5 Sensorless Commutation Control This section presents sensorless BLDC motor commutation with the back EMF zero crossing technique To start and run the BLDC motor the control algorithm must go through these processes 1 Alignment 2 Start up 3 Stabilization 4 Run First the rotor is aligned to a known position without the position feedback When the rotor moves the back EMF is induced on the non fed phase and sensorless position detection can be employed As a result the position is known and can be used to calculate the speed and process the commutation in the run state 3 3 5 1 Alignment The main aim of alignment is to align the rotor to a known position This known position is necessary to start rotation in the proper direction and to ge
31. ee ees ee ee EH AER ER CR dene 45 Alignment Constants A TT TS TTE eee eee ede ees 45 SULLO cbt ba terencesenciebeatecss D EDDA RETO Ed debe Side cust 45 Speed Constants and PA 46 Tonus Constants and SCA cecs cc cece dreri otpa iad Eea a e a esse 47 DC Bus o AAA RAS XPREEEETERFERRRNGX EE 47 Chapter 6 Application Setup Hardware AAA X obo rr ee eee eee CUR RARE GE CAU RE ACRI 49 A IL QD t E 52 Applicaton Sotware MAA 52 Application FreeMASTER Software Control Files anaana aaan 52 a AA 53 Programming he MGU AAA paco 54 Chapter 7 Sensorless BLDC Demo Operation Applicaton ONO pride AAA AA 55 BLDC Drive Operational Modes erro Pre kerk r EERIE ERIAS AA 55 A ONES OER EI E Rd RR CA 55 IDs ie rung o CT CP Tm 55 Manual Remote Operation a sc oss nannan esse ech eseebeeseh rs AA 56 Manual GRA 2 mies db ato ribera bios iia td iia aire 56 Pe A A lit I aa TST 56 Appendix A References Appendix B Glossary 3 Phase BLDC Motor Sensorless Control Using MC9S08AW6O0 Rev 0 1 Freescale Semiconductor Chapter 1 Introduction 1 1 Introduction This designer reference manual describes a sensorless 3 phase brushless DC BLDC motor drive based on Freescale s MCISOBAW6O dedicated motor control device BLDC motors are very popular in a wide application area Because the BLDC motor lacks a commutator itis more reliable than the DC motor The BLDC motor also has advantages when compared to an AC induction motor Because it achieves a high
32. endershot JR and T J E Miller Magna Physics Publishing and Clarendon Press 1994 Sensorless Vector and Direct Torque Control P Vas 1998 Oxford University Press ISBN 0 19 856465 1 New York Sensorless BLDC Motor Control Using the MC68HC908MR32 DRM028 Freescale 2003 3 phase BLDC Motor Control with Sensorless Back EMF ADC Zero Crossing Detection using DSP 56F80x AN1913 Freescale 2005 3 Phase BLDC Motor Sensorless Control Using MC56F8013 DRM70 Freescale 2005 Brushless DC Motor Control using the MC68HC708MCA AN1702 John Deatherage and Jeff Hunsinger Freescale FreeMaster for Embedded Applications User Manual Freescale 2004 MC9S08AW60 Technical Data Sheet for MC9SO8AW60 48 32 16 MCUs Freescale 2006 MC9S08AW60 Controller Board Hardware User s Manual MC9SO8AW60CB_UM Freescale 2005 Three Phase Micro Power Stage Reference Manual MEMC3PMBLDCRM Freescale 2004 Freescale web page http www freescale com 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 61 62 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor Appendix B Glossary AC Alternating Current ADC See analogue to digital converter BDM Background Debug Mode interface allowing On Chip Emulation and Programming brush A component transferring electrical power from non rotational terminals mounted on the stator to th
33. er efficiency by generating the rotor magnetic flux with rotor magnets a BLDC motor is used in high end white goods such as refrigerators washing machines dishwashers high end pumps fans and in other appliances requiring high reliability and efficiency The concept of the application is a speed and torque closed loop BLDC drive using a sensorless back EMF zero crossing technique It is an example of a BLDC motor control design using a Freescale HCS08 family MCU This reference design includes basic motor theory system design concept hardware implementation and software design including the FreeMASTER software visualization tool Figure 1 1 Sensorless 3 Phase BLDC Motor Demo Using MC9S08AW60 3 Phase BLDC Motor Sensorless Control Using MC9SO8AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 7 Introduction 1 2 Freescale MC9S08AW60 Advantages and Features The MC9S08AWXx is a family of devices based on the high performance HCS08 core supporting 5 volt applications It is a highly integrated high performance family packed with valuable features e 16 60K flash memory e 1 2K RAM A flexible internal clock generator that eliminates the need for external components low voltage detection high performance analog to digital converter ADC serial communication modules etc The MC9S08AWX family performs well in a variety of environments and is qualified for automotive applications This fami
34. generated signal is uknown since the polarity is defined by ELSnB ELSnA bits Therefore the update of TPM channels must be done within first quarter of the PWM period starting from mid point of the PWM pulse The later update may cause generation of the incorrect PWM output during the commutation ON PhaseA PWMO Rod i ON Phase A PWM1 ee ON Phase B PWM2 NUN Li ON Phase B PWM3 OFF PWM period gt Figure 3 4 Independent Bipolar Switching Patterns for BLDC Motor 3 Phase BLDC Motor Sensorless Control Using MC9SO8AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 25 System Concept ON Phase A PWMO i OEF ON Phase A PWM1 OFF E ON Phase B i i PWM2 T d ON Phase B PWM3 i OFF PWM period lt gt Figure 3 5 Independent Unipolar Switching Patterns for BLDC Motor 3 3 2 ADC Sampling Mechanism Power stage PWM switching causes high voltage spikes on the phase voltages These voltage spikes are generated on the non fed phase because of mutual inductances and mutual capacitor couplings between motor windings Non fed phase branch voltage is then disturbed by PWM switching Figure 3 6 shows the effect on the non fed phase because of the mutual inductance Figure 3 6 Effect of Mutual Inductance on Back EMF The non fed phase branch voltage is disturbed at the PWM switching e
35. hase used to sense the back EMF Figure 2 6 shows branch and motor phase winding voltages during a 0 360 electrical interval Shaded rectangles designate the validity of the equation 2 9 Basically the back EMF voltage can be sensed during designated intervals This is more difficult in reality because the sensed branch voltage also contains some ripples 3 Phase BLDC Motor Sensorless Control Using MC9SO8AW60 Designer Reference Manual Rev 0 1 18 Freescale Semiconductor Mathematical Description of Brushless DC Motor O Back EMF can be sensed Figure 2 6 Phase Voltage Waveform 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 19 MA j Control Theory 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 20 Freescale Semiconductor Chapter 3 System Concept 3 1 System Specification The motor control system is designed to drive a 3 phase brushless DC BLDC motor in a speed and torque closed loop The application meets these performance specifications e Sensorless brushless DC motor control by back EMF zero cross sensing Targeted for the MC9S08AWXx platform Running on a low voltage 12 V 3 phase BLDC control development platform Control technique incorporates Sensorless control with speed and torque closed loop ADC converter for zero cross sensing Rotation in both directions Full 4 q
36. he error state and then into the stop state The ASM executes in the background loop 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 41 Software Design CPU RESET Stabilization Figure 5 3 Application State Machine 5 4 7 Process Speed and Torque PI Controller Figure 5 4 shows the general principle of the speed PI control loop Speed Torque desiredSpeed Error torqueRequired PI duty cycle Controlled Controller System actualSpeed torqueFiltered Figure 5 4 Closed Loop Control System The speed and torque closed loop control is characterized by the actual motor speed and torque feedback This information is compared with the reference set point and the error signal generates The 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 42 Freescale Semiconductor Processes Description magnitude and polarity of the error signal corresponds to the difference between the actual and desired speed torque Based on the speed torque error the Pl controller generates the corrected motor voltage to compensate for the error The application allows operation in two modes speed and torque Independent of the operational mode the speed and torque PI controllers are calculated The operational mode defines the required values of the speed and torque at start up only During start up if the d
37. here the START STOP switch and UP DOWN buttons are connected If a change is detected the particular status bit is set These status bits are evaluated in the application state machine The process executes every 5 ms in isr TM2 ChO0 Compare interrupt 5 4 6 Process Application State Machine The application state machine ASM consists of init stop alignment start up stabilization run and error states Figure 5 3 After an MCU reset the ASM goes through the init state to the stop state 1 Assoon as the user turns the START STOP switch to the START position the ASM goes into the alignment state where the motor is aligned to a known position 2 After a predefined time the ASM continues to the start up state 3 Atthe star up state the six commutations perform without feedback The start up table defines the timings between the communications 4 Afterthe start up state the ASM moves into the stabilization state where the measurements of the torque and speed are stabilized This state goes through the next six commutations where zero crossing is already employed 5 After the stabilization state the ASM moves into the run state where the control loop is closed 6 During the run state the Pl controllers accept and maintain requests for new speeds and torques If a standstill of the rotor is detected the ASM returns into the alignment state and tries to execute a new start up sequence In case of any fault the ASM moves into t
38. ights 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 the 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 and hold 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 unauthorized use even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part Freescale and the Freescale logo are trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners O Freescale Semiconductor Inc 2006 o 2 freescale semiconductor
39. isables The FreeMASTER software also displays some variables in the scope Figure 7 4 The FreeMASTER software defines a speed stimulator for an automatic demonstration of the sensorless BLDC demo To use the speed stimulator switch the START STOP switch to the START position The speed changes according to a predefined ramp 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 57 58 Sensorless BLDC Demo Operation SO a Haa 517 epmpzal 7 sie e E AA Run State ENUM VAL MIN MAX 14 117 V 0 1 Amps 150 RPM START ENUM Gockwise direction ENUM Speed Mode ENUM 150 RPM 2 0 Amps Figure 7 3 BLDC Demo Project in FreeMASTER 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor A gt Manual Remote Operation alala Hei pre abeto Te 114 gie Run State ENUM VAL MIN MAX 1 117 V 0 1 Armes 149 RPM START ENUM Clockwise direction ENUM Speed Mode ENUM 150 RPM 2 0 Amps Figure 7 4 Scope Variables During Enabled Stimulator 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 59 Sensorless BLDC Demo Operation 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 60 Freescale Semiconductor Appendix A References 10 11 Design of Brushless Permanent Magnet Motors J R H
40. l loop is closed During the run state requests for new speeds and torques are accepted and maintained by the PI controllers 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor System Blocks Concept e If a standstill of the rotor is detected the ASM goes again into the alignment state and tries to execute a new start up sequence In case of any fault the ASM returns to the error state and then into the stop state After a fault condition occurs the application switches to the fault state stops the motor and waits for the fault reset over the START STOP switch Beyond this the Free MASTER interface enables monitoring and adjustment of all system variables 3 3 System Blocks Concept 3 3 1 PWM Voltage Generation for Brushless DC Motor A 3 phase voltage system as described must be created to run the BLDC motor This is provided by 3 phase power stage with six power switches IGBTs or MOSFETs controlled by the MC9S08AW60 on chip TPM PWM module When generating PWM signals for the BLDC motor control application the bottom and top power switches of the non fed phase must be switched off See Figure 3 2 and Figure 3 3 For the BLDC motor control application PWM signals can be created in two ways Complementary PWM Mode Independent PWM mode Because of the flexible MC9S08AW60 TPM PWM module both modes are available 3 3 1 1 Complementary PWM Mode In
41. ly is suitable for appliance white goods industrial and automotive applications The HCS08 family incorporates these standard features e 40 MHz HCS08 CPU e HOC08 instruction set with BGND instruction Internal background debugging system Breakpoint capability to allow single breakpoint setting during in circuit debugging plus two more breakpoints in the on chip debug module e Debug module Contains two comparators nine trigger modules and eight deep FIFO for storing change of flow addresses and event only data Supports tag and force breakpoints e Support for up to 32 interrupt reset sources e System protection features Optional computer operating properly COP reset Low voltage detection with reset or interrupt Illegal opcode detection with reset Illegal address detection with reset some devices don t have illegal addresses The MC9S08AWSOO incorporates these features 60 Kbytes of on chip in circuit programmable flash memory with block protection and security options 2Kbytes of on chip RAM e 16 channel 10 bit analog to digital converter ADC Two serial communications interface SCI modules Serial peripheral interface SPI module External voltage monitor EVM allowing input level monitoring with selectable trigger point and interrupt generation e Clock source options including crystal resonator external clock or an internally generated clock with precision NVM trimming Inter integrated
42. main routine enters an endless loop which executes the application state machine consisting of initialization stop alignment start up run and error states The transition between the states depends on state of the START STOP switch UP DOWN buttons and drive status In the case of remote control besides the motor speed torque the operational mode and the rotation direction can be set from FreeMASTER Apart from the background loop the software incorporates the two periodic and two event interrupts TPM 1 overflow interrupt Execution period 62 5 us The routine starts ADC conversions provides a PWM update and zero crossing detection TPM 2 Ch0 compare interrupt Execution period event interrupt called every commutation The routine updates the commutation sector IRQ interrupt Execution period event interrupt called in the case of overcurrent detection The routine handles the DC bus overcurrent event TPM 2ch1 compare interrupt Execution period 5 ms The routine provides ramp generation speed torque PI controllers standstill detection and manual interface handling UP DOWN buttons RUN STOP switch 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 37 Software Design Main background Loop Initialize Peripheral initialization Application variable initialization ApplicationStateMachine Init state Stop state Alignment state Start
43. nerate maximal torque during start up During alignment all three phases are powered Phase A is connected to the positive DCB voltage and phases B and C are connected to the negative DCB voltage The resultant rotor position gives the same condition for start up regardless of rotational direction see Figure 3 9 The alignment time depends on the mechanical constant of the motor including load The time must ensure the rotor steady state at the end of the alignment process Vocs y c Phase A C Next flux vector 9 En gt e E Phase B Phase C gU xs xc Voce Voce Alignment flux vector Figure 3 9 Rotor Alignment 3 3 5 2 Start Up The back EMF technique can be used when the rotor is moving The start up process ensures the initial rotor movement followed by back EMF evaluation The start up process starts immediately after the 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 29 System Concept alignment process The first flux vector applied on the motor is orthogonal to the alignment flux vector The right flux vector is chosen based on the required direction of rotation Figure 3 9 The flux vector is applied for a period defined as a constant value during drive tuning The next five flux vectors follow to create a rotational field The period timing of all six periods is established by 3 1 Tugw K Tprevious 3 1 The constant k
44. ower Stage Board U2 MC9S08AW60 Evaluation Board U1 BDM to PC RS232 to USB Port PC Serial IB23810 Port Figure 4 1 Hardware Diagram with Micro Power Stage 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 31 Hardware 4 2 Component Descriptions 4 2 1 MC9S08AW60 Evaluation Board The MC9S08AW6O controller board is a versatile development card for developing real time software and hardware products to support a new generation of general purpose servo and motor control applications The power of the 8 bit MC9SO8AW60 MCU combined with the hall effect quadrature encoder interface PWM interface with dead time insertion circuit tacho generator interface for digital analog sensing motor over current logic and motor over voltage logic makes the MC9SO8AW60 controller board ideal for developing and implementing many motor controlling algorithms as well as for learning the MC9S08AW60 microcontroller architecture and instruction set MC9S08AW6O0 controller board main features 32 MC9S08AWO0 8 bit 3 3 V Microcontroller operating at 40 MHz BACKGROUND interface header for an external debug host target interface RS 232 interface with galvanic isolation for easy connection to a host computer or FreeMASTER development tool Header allowing users to attach their own port A GPIO compatible peripheral Header allowing users to attach their own port D GPIO A
45. ower Stage View Input connections are made via the 40 pin ribbon cable connector J1 Power connections to the motor are made on the output connector J4 Phase A B and C are labeled on the board Power requirements are met by a single external 12 V 4 A power supply Two connectors J2 and J3 are provided for the 12 V DC power supply While J2 is used for 12 V DC input J3 is used for 12 V DC output to power the controller board Both are located in a corner of the board Table 4 1 Electrical Characteristics of Micro Power Board Characteristic Symbol Min Typ Max Units Power Supply Voltage Vdc 10 12 16 V Quiescent Current loc 18 mA Minimum Logic 1 Input Voltage Vin 2 4 ES Maximum Logic 0 Input Voltage ViL 0 8 Input Resistance Rin 10 kQ Analog Output Range Vout 0 3 3 V Bus Current Sense Voltage IGense 200 mV A Bus Voltage Sense Voltage VBus 206 25 mV V Power MOSFET On Resistance Top Switch Rps on 60 70 ma Power MOSFET On Resistance Bottom Switch Rps on 170 200 ma Continuous Output Current Ip 3 Pulsed Output Current lom 15 A Total Power Dissipation Pdiss 2 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 34 Freescale Semiconductor 4 2 3 Motor IB23810 Produced by MCG The following motor is used by the BLDC sensorless application Other motors can be adapted
46. pherals Availability per Package Type Package Option Feature 64 pin 48 pin 44 pin ADC 16 ch 8 ch 8 ch lic yes IRQ yes KBH 8 7 6 SCH yes SCI2 yes SPI yes TPM1 6 ch 4 ch 4 ch TPM1CLK yes no no TPM2 2 ch TPM2CLK yes no no 1 O pins 54 38 34 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Introduction The key peripherals for 3 phase BLDC motor control are the TPM PWM module and an analog to digital converter ADC converter The MC9S08AWXx includes a 6 channel TPM1 and a separate 2 channel TPM2 The 6 channel TPM1 module allows the generation of any PWM pattern for any 3 phase motor control The TPM module features include Eight channels Each channel may be input capture output compare or buffered edge aligned PWM Rising edge falling edge or any edge input capture trigger Set clear or toggle output compare action Selectable polarity on PWM outputs Each TPM may be configured for buffered center aligned PWM CPWM on all channels Clock source to the prescaler for each TPM is independently selectable as the bus clock fixed system clock or an external pin Prescale taps for divide by 1 2 4 8 16 32 64 or 128 External clock inputs TPM1CLK for TPM1 and TPM2CLK for TPM2 only available in the 64 pin package 16 bit free running or up down CPWM count operation 16 bit modulus regi
47. positions The stator is usually made from magnetic steel sheets A typical cross section of a BLDC Motor is shown in Figure 2 1 The stator phase windings are inserted in the slots distributed winding or wound as one coil onto the magnetic pole Because the air gap magnetic field is produced by permanent magnets the rotor magnetic field is constant The magnetization of the permanent magnets and their displacement on the rotor is chosen so the back EMF the voltage induced into the stator winding due to rotor movement shape is trapezoidal This allows the DC voltage see Figure 2 2 with a rectangular shape to create a rotational field with low torque ripples Stator Stator winding in slots Shaft Rotor Air gap Permanent magnets Figure 2 1 BLDC Motor Cross Section The motor can have more than just one pole pair per phase The pole pair per phase defines the ratio between the electrical revolution and the mechanical revolution For example the shown BLDC motor Figure 2 2 has three pole pairs per phase which represent the three electrical revolutions per one mechanical revolution The rectangular easy to create shape of the applied voltage ensures the simplicity of control and drive However the rotor position must be known at certain angles to align the applied voltage with the back EMF The alignment between back EMF and commutation events is very important Under this condition the motor behaves as a DC motor and runs a
48. rive runs in speed operational mode the required speed is set to the minimal speed and torque to the allowed maximum Vice versa in torque operational mode the required torque is set to the minimum torque and the required speed is set to the maximum speed The lesser value of the PI controllers is chosen as the duty cycle and is applied to the motor To avoid the saturation of the integral parts of the PI controllers these parts are limited If the speed Pl controller output is applied to the output the torque Pl controller integral part is limited by the speed PI controller integral part and vice versa This type of cross limitation allows simultaneously running the drive under speed and torque limitations The speed torque PI controllers proportional and integral constants were set experimentally The Pl controllers execute every 5 ms in the isr TM2 ChO Compare interrupt 5 4 8 Process Ramp The ramp process slopes some quantities to ensure a smooth motor rotation The ramp process is used at start up to slope the alignment voltage and for the required motor speed The process is executed every 5 ms in the iss TM2 ChO Compare interrupt 5 4 9 Process FreeMASTER The FreeMASTER process is not part of the application software The BDM interface fully implements FreeMASTER communication so no additional software support is necessary to provide remote control FreeMASTER writes new values directly into data RAM where particular variables are lo
49. setting for the TPM PWM module The TPM PWM module is configured to run in center aligned mode In this case the overflow interrupt event is generated in the middle of each pulse The overflow interrupt starts the analog to digital conversion practically in the middle of the pulse The result of the conversion can be read on the conversion complete interrupt Because the A D converter has a single result register the conversion of more channels must be serviced in the same interrupt See Figure 3 7 for the sampling process TPM PWM Counter Zero crossing evaluation PWM period ON Phase A PWMO Dui ON Phase A PWM1 na Sampling point Overflow ADC conversion ISR PWM update Figure 3 7 TPM PWM to ADC Synchronization 3 3 3 Back EMF Zero Crossing Sensing Back EMF zero crossing is detected by sensing the motors non fed phase branch voltage uy in Section 2 3 3 and DC bus voltage ug using the ADC Refer to Section 2 3 Phase BLDC Motor Sensorless Control Using MC9SO8AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 27 System Concept To get the correct back EMF voltage two conditions must be met The same PWM signal drives top and bottom switches in diagonal No current is going through the non fed phase used to sense the back EMF The first condition is achieved by the TPM PWM module to ADC synchronization The second condition can be directly detected from the sensed
50. ster to control the counter range Timer system enable One interrupt per channel and a terminal count interrupt for each TPM module The ADC has the following features Linear successive approximation algorithm with 10 bits resolution Up to 28 analogue inputs Output formatted as 10 or 8 bit right justified Single or continuous conversion automatic return to idle after single conversion Configurable sample time and conversion speed power Conversion complete flag and interrupt Input clock selectable from up to four sources Operation in wait or stop3 modes for lower noise operation Asynchronous clock source for lower noise operation Selectable asynchronous hardware conversion trigger Automatic compare with interrupt for less than or greater than or equal to programmable value The ADC evaluates back EMF zero crossing detection without any external comparators and senses other analog quantities necessary for BLDC motor control 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor Chapter 2 Control Theory 2 1 Brushless DC Motor BLDC Motor The brushless DC motor BLDC motor is a rotating electric machine with a classic 3 phase stator like an induction motor the rotor has surface mounted permanent magnets lt is also referred to as an electronically commuted motor There are no brushes on the rotor and the commutation is performed electronically at certain rotor
51. surement and Evaluation Table 5 1 Commutation for Counter Clockwise Direction Vector Phase Voltage Number A B C Sensing 9 oom wce Nc Psectra 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 44 Freescale Semiconductor Constant Calculation Table 5 2 Commutation for Clockwise Direction Vector Phase Voltage Number A B C Sensing s eee poe we mecum 5 5 Constant Calculation 5 5 1 Alignment Constants define ALIGNMENT TIME 100 This value multiplied by 5 ms gives the alignment time define ALIGNMENT VOLTAGE 43 This value defines the alignment voltage level The value is tuned experimentally The conversion to volts can be done as 2 ALIGNMENT VOLTAGE DC 5 1 PWM_MODULO DC bus voltage 5 5 2 Start Up Constants define START PERIOD 6000 This value defines the first commutation period during start up The value is tuned experimentally The conversion to the time in seconds can be done as TPM2 PRESCALER START PERIOD TPM2_INPUT_CLOCK where TPM2_PRESCALER 128 TPM2_INPUT_CLOCK 20 MHz 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 45 Software Design Note The first period is calculated as START_PERIOD 2 The constant START PERIOD is used for calculating of other periods during start up
52. t edment OVEHay v P amp E Multilink Cyclone Pi te Design a E Sources i main h BA sdkmath asm B sdkmath c sdkmath h Make F7 L main 53 Includes stop Build Gtr Break B derivative h derivative inc of MCSSOBAWwED h Y MCSS085w60 inc H Libs H Project Settings Precompile Gan E Run Figure 6 5 Execute Make Command 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 53 AN Application Setup 6 2 4 Programming the MCU To download the software into microcontroller use an USB PARALLEL to BDM converter Before downloading new software stop the motor by the START STOP switch and execute the Debug command as shown in Figure 6 6 Freescale CodeWarrior main c ru Target edmentj Overlay D P amp E Multilnk Cyclone Pr Create Design Precomplle EE Sources B main h B sdkmath asm sdkmath c sdkmath h B mand BY derivative h BY derivative inc stop Build Gti Break MEA APOCO NOA fon La Figure 6 6 Execute Debug Command 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 54 Freescale Semiconductor Chapter 7 Sensorless BLDC Demo Operation 7 1 Application Control The BLDC motor control application can be controlled by the manual interface consisting of the START STOP switch and UP DOWN buttons Figure 7 1 or remotely by PC The BLDC drive can operate in
53. t the best working point Therefore the simplicity 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 11 Control Theory of control and performance makes the BLDC motor the best choice for low cost high efficiency applications 120 120 Phase A gt Phase B BEEN Phase C gt Electrical angle 30 60 90 120 150 180 210 240 270 300 330 0 30 Figure 2 2 3 Phase Voltage System for BLDC Motor Figure 2 3 shows the number of waveforms the magnetic flux linkage the phase back EMF voltage and the phase to phase back EMF voltage The magnetic flux linkage was measured by calculating the integration phase back EMF voltage which was measured on the non fed motor terminals of the BLDC motor The back EMF shape is approximately trapezoidal and the amplitude is a function of the actual speed During speed reversal the amplitude changes and its sign and the phase sequence change too 3 Phase BLDC Motor Sensorless Control Using MC9SO8AW60 Designer Reference Manual Rev 0 1 12 Freescale Semiconductor A Brushless DC Motor BLDC Motor The filled areas in the top of the phase back EMF voltage waveforms indicate the intervals where the particular phase power stage commutations are conducted The power switches are cyclically commutated through the
54. tate based on inputs from the manual interface standstill detection FreeMASTER interface and state variables not mentioned in main data flowchart phA_voltage phB_voltage phC_voltage dcb_voltage dcb_current periodZC R PhA torque R PhA periodZC F PhB torque F PhB Commutation Process periodZC R PhC torque R PhC pwm sector Standstill Speed Torque Detection Calculation Calculation AppState Gone m FreeMASTER duty cycle desiredSpeed e a ET Ramp Process Zero Crossing Detection periodNextCommutation periodZC F PhA torque F PhA periodZC R PhB torque R PhB periodZC F PhC torque F PhC Manual Interface stallError ActualSpeed TorqueFiltered Process Application State Machine Speed and Torque PI Controller Be PWM Hm Update Figure 5 2 Data Flowchart direction controlMode 5 4 Processes Description The main processes of the BLDC motor sensorless drive application can be in Figure 5 2 5 4 1 Process Zero Crossing Detection This process is called every 62 5 us in isr TPM1 Overflow interrupt The process is called after the second analog to digital conversion when a new sample of phase voltage is available This new sample is checked for appropriate voltage level and compared to the midpoint of the DC bus voltage Section 3 3 3 describes the zero crossing detection If zero crossing is detected the new commutation 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60
55. to the Component Descriptions application by defining and changing the motor related parameters See Figure 4 2 for motor specifications Table 4 2 Electrical Characteristics of MCG IB23810 Motor Characteristic Symbol Min Typ Max Units Reference Winding Voltage Vi 170 V Speed V o 6000 RPM 0 0840 Nm A Torque Constant Kt 11 90 oz in A Voltage Constant Ke 8 8 V krpm Terminal Resistance Ri 0 13 0 18 Q Winding Inductance L 6 8 mH Continuous Current les 1 8 A Number of Pole Pairs Jm 2 t 10 80 C Temperature Rating t 14 176 F 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 35 Hardware 3 Phase Brushless DC Motor Sensorless Control using MC9S08AW60 Designer Reference Manual Rev 0 1 36 Freescale Semiconductor Chapter 5 Software Design 5 1 Introduction This section describes the design of the drive s software blocks The software description is comprised of these topics Main software flow chart Section 5 2 Data flow Section 5 3 5 2 Main Software Flowchart The main software flowchart Figure 5 1 incorporates the main routine background loop entered from reset and interrupt states The main routine includes the initialization of the microcontroller and the main loop After initialization the
56. uadrant operation Start from any motor position with rotor alignment Manual interface START STOP switch up down push button control FreeMASTER software control interface motor START STOP speed torque setup FreeMASTER software remote monitor 3 Phase BLDC Motor Sensorless Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 21 errr System Concept 3 2 Sensorless Drive Concept The system concept is shown below Figure 3 1 Power Lina Superior On Board Programming System FreeMASTER START STOP Speed Torque Ua Down Other Purposes Figure 3 1 Drive Concept The basic operational theory of the system is as follows The background loop executes the application state machine ASM consisting of init stop alignment start up run and error states After an MCU reset the ASM goes through the init state to the stop state The START STOP switch and up down buttons are continuously monitored over the GPIO interface As soon as the user turns the START STOP switch to the START position the ASM goes into the alignment state where the motor is aligned to a known position After a predefined time the ASM continues to the start up state At start up the six commutations are performed without any feedback The timings among the commutations are defined by the start up table After start up the ASM goes into the run state where zero crossing is employed and the contro
57. using MC9S08AW60 Designer Reference Manual Rev 0 1 48 Freescale Semiconductor Chapter 6 Application Setup 6 1 Hardware Setup The sensorless BLDC demo is mounted onto a piece of acrylic glass that provides a fixed base for the BLDC motor the micro low voltage power stage and the MC9S08AW6O0 controller board see Figure 6 1 Figure 6 1 Sensorless BLDC Demo To operate the sensorless BLDC demo 1 2 3 Plug the low voltage output cable of the power supply to the micro power stage connector J2 Connect the BDM cable to connector J29 on the controller board The USB PARALLEL BDM convertor is necessary only for remote control from the PC and software update Connect the USB PARALLEL cable to the PC Check the jumper settings of J20 J21 and J22 on the controller board according to Figure 6 4 Connect the power supply to the main input cable the power LED D7 on the micro power stage 3 Phase BLDC Motor Control Using MC9SO8AW60 Designer Reference Manual Rev 0 1 Freescale Semiconductor 49 Application Setup and D3 on the controller board lights up The demo setup is shown in Figure 6 2 Figure 6 2 Sensorless BLDC Demo Setup 3 Phase BLDC Motor Control Using MC9S08AW60 Designer Reference Manual Rev 0 1 50 Freescale Semiconductor A sw Hardware Setup 09MUBOS52HM sa A ESI OOODOOO J C f x ye MEN UII E i Figure 6 3 Detail of BDM Connection
Download Pdf Manuals
Related Search
Related Contents
Life Fitness TREADMILL T3 User's Manual ART11301 60cm integrated hood User PeakTech_6145 Casio 2196 Watch User Manual MG3030 Module Hardware Design User Manual 取扱説明書 L05-S003-1103_1 PRIMERGY RX300 S5 - Fujitsu manual server SAXO SL 70 Manual do Usuário SI 300 Copyright © All rights reserved.
Failed to retrieve file