Home

Sensorless BLDC Motor Control on MC68HC908MR32 Software

image

Contents

1. _ bldc_zerocrosO8MR32 sources code_fun c program C language functions e _ bIldc_zerocrosO8MR32 sources code_fun h program C language functions header _ bldc_zerocrosO8MR32 sources const h main program definitions _ bIidc_zerocrosO8MR32 sources mr32io h MC68HC908MR32 registers definitions file Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D e _ bIldc_zerocrosO8MR32 sources mr32_bit h MCHC908MR32 register bits definitions file _ bldc_zerocrosO8MR32 sources bldc08 c main program _ bldc_zerocrosO8MR32 sources code_start c motor alignment and starting oback EMF acquisition state functions _ bldc_zerocrosO8MR32 sources code_start h motor alignment and starting back EMF acquisition state function header _ bldc_zerocrosO8MR32 sources code_run c motor running state function _ bldc_zerocrosO8MR32 sources code_run h motor running state function header e _ bldc_zerocrosO8MR32 sources code_isr c program interrupt functions _ bldc_zerocrosO8MR32 sources code_isr h program interrupt functions header _ bldc_zerocrosO8MR32 sources ram c general RAM definitions _ bldc_zerocrosO8MR32 sources ram h general RAM declarations header _ bldc_zerocrosO8MR32 sources ram_bit h general
2. SP SPEED_PIREG_P_GAIN 2 wae Equation 12 MUST_CHANGE_15_EXPER define SPEED_PIREG_I_GAINSCALERIGHT 0 Range lt 0 8 gt MUST_CHANGE_16_EXPER define SPEED _PIREG_I_GAIN 64 Range lt 0 255 gt KI where the current regulator integral gain is SPEED_PIREG_I_GAINSCALERIGHT Equation 13 SPEED_PIREG_I_GAIN 2 These constants can be calculated according to regulators theory The speed sampling regulator execution period is PER_T3_RUN_US 2 560 ms at default software setting Another recommended solution is experimental setting NOTE SPEED_PIREG_P_GAINSCALELEFT SPEED_PIREG_P_GAIN SPEED_PIREG_I _GAINSCALERIGHT SPEED_PIREG_I_GAIN can be evaluated with PC master software tuning file tuning_bldc pmp We suggest using PC master software with tuning file tuning_bldc pmp for regulator parameters evaluation You can use this procedure ik Ensure that the start up and commutation parameters were set properly Start up Constants and Maximal Commutation Period in const_cust_x h Set const_cust_x h SPEED_PIREG_P_GAINSCALELEFT 0 SPEED_PIREG_P_GAIN 0 SPEED_PIREG_I_GAINSCALERIGHT 7 SPEED_PIREG_I_GAIN 0 Ensure that COMMUT_REV SPEED_RANGE_MAX_RPM SPEED_MAX_RPM are set properly in const_cust_x h Set SPEED_MIN_RPM as required should be SPEED_MIN_RPM gt SPEED_MAX_RPM 5 for
3. Label for changes which must be set changed when adapting software for a motor the setting can be done experimentally MUST_IF_HW_CHANGE_nn Label for changes which must be set changed when a power stage board different from high voltage power board is used CAN_CHANGE_nn Label for changes which can be set changed when adapting software for a motor but usually the setting is not needed CAN_CHANGE_nn_EXPER Label for changes which can be set changed when adapting software for a motor but usually the setting is not needed the setting can be done experimentally Sensorless BLDC Motor Control on MC68HC908MR32 28 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Labels in the File const h Parameters File Selection NOTE Software Customizing to Power Stage NOTE Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor The other parameters like motor PWM frequency and current sampling period can be set in the file const h The required steps are marked CAN_CHANGE_FPWM_n Label for definitions which should be modified when changing PWM frequency CAN_CHANGE_PERCURSAMP_n Label for definitions which should be corrected when changing current sampling period Let s follow the next sections or the labels in the
4. 128 us at default software and PWM frequency setting CNTR_OVC should normally not be changed Lower value of CNTR_OVC secures a fast safer over current switch off High value of CNTR_OVC secures an unexpected over current switch off 0x04 The current during alignment state before motor starts A MUST_CHANGE_1_EXPER define CURR_ALIGN_A 0 55 Range lt 0 CURRENT_RANGE_MAX_A gt It is recommended that nominal motor current value be set Sometimes when power source is not able to deliver the required current it is necessary to set a lower value then nominal motor current CURR_ALIGN_A can be evaluated with PC master software tuning file tuning_bldc pmp It might also be necessary to set the current PI regulator constants MUST_CHANGE_2_EXPER define CURR_PIREG_P_GAINSCALELEFT 0 Range lt 0 8 gt MUST_CHANGE_3_EXPER define CURR_PIREG_P_GAIN 128 Range lt 0 255 gt where the current regulator proportional gain is KP CUR_P IREG_P_GAIN 2CURR_OUREG_P_GAINSCALELEFT Equation 4 MUST_CHANGE_4_ EXPER define CURR_PIREG_I_GAINSCALELEFT 0 Range lt 0 8 gt Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D
5. NOTE MUST_CHANGE_5 EXPER define CURR_PIREG_I_GAIN 64 Range lt 0 255 gt where the current regulator integral gain is KP CUR_PIREG I_GAIN 2CURR_PIREG_I_GAINSCALELEFT Equation 5 These constants can be calculated according to regulators theory The current sampling regulator execution period is PER_CS_T1_US 128 us at the default software setting Normally it does not need to be changed if change is required see PWM Frequency and Current Sampling Period Setting Another recommended solution is an experimental setting CURR_PIREG_P_GAINSCALELEFT CURR_PIREG_P_GAIN CURR_PIREG_I_GAINSCALELEFT CURR_PIREG_I_GAIN can be evaluated with PC master software tuning file tuning_bldc pmp We suggest using PC master software with tuning file tuning_bldc pmp for regulator parameters evaluation You can use this procedure 1 Set const_cust_x h CURR_PIREG_P_GAINSCALELEFT 0 CURR_PIREG_P_GAINO CURR_PIREG_I_GAINSCALELEFT 0 CURR_PIREG_ I_GAIN 0 2 Temporarily change the software in code_start c file label TUNING_1 enable goto Align it will cause infinite time for alignment state where the current is tuned 3 Build and run the code see Software Execution Build Execute from Evaluation Board 4 Start the PC master software tuning project 5 Select Current Parameters Tuning subproject see Software Parameters Tuning with PC Master Software Project File in order to be ab
6. We suggest using PC master software with tuning file tuning_bldc pmp for start up parameters evaluation You can use this procedure 1 10 Ensure that the Alignment current and regulator were properly set Alignment Current and Current Regulator Setting in const_cust_x h Ensure that PER_DIS_US and COEF_HLFCMTT are properly set in const_cust_x h Set define PER_CMT_START_US in const_cust_x h according to Table 6 Ensure PER_CMT_START_US lt PER_CMT_MAX_US 2 Set define START_INCR_OOUTREG 20 0 in const_cust_x h In order to disable speed regulator temporarily change the software by clearing speed regulator parameters define SPEED_PIREG_P_GAIN 0 64 define SPEED_PIREG_I_GAIN 0 in const_cust_x h file Build and run the code see Software Execution Build and Execute from Evaluation Board Start the PC master software tuning project Select Start Parameters Tuning subproject see Software Parameters Tuning with PC Master Software Project File in order to be able to modify the start parameters You can see the actual zero crossing commutation period on the Start Parameters Tuning New Scope or measure the phase a b andc voltages on a real oscilloscope Sensorless BLDC Motor Control on MC68HC908MR32 40 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Custo
7. 3000 0 Range lt 0 infinity gt Determines scaling of speed variables SPEED_ RANGE_MAX_RPM must be changed for any motor accommodation as the software calculates the internal speed variables using this constant For proper speed control it is important to set SPEED_RANGE_MAX_RPM higher then maximal actual motor speed even during speed transient Sensorless BLDC Motor Control on MC68HC908MR32 42 Software Porting to Customer Motor For More Information On This Product Go to www freescale com NOTE CAUTION Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor Maximal speed of the drive rpm MUST_CHANGE_11 define SPEED_MAX_RPM 2500 0 Range lt 0 SPEED_RANGE_MAX_RPM gt SPEED _MAX_RPM determines the maximal desired speed It must be changed for any motor accommodation The software calculates the internal speed variables using SPEED _RANGE_MAX_RPM constant For proper speed control it is important that SPEED_MAX_RPM and SPEED_RANGE_MAX_RPM constants relation must be set according to the following equation SPEED_MAX_RPM lt SPEED_RANGE_MAX_RPM Equation 10 Minimal speed of the drive rom MUST_CHANGE_12_EXPER define SPEED_MIN_RPM 500 0 Range lt 0 SPEED_RANGE_MAX_RPM gt SPEED_MIN_RPM determines the minimal desired speed It must be changed for any motor accommodation The minimal speed is also
8. 8 You can see the actual speed and desired speed on the Speed Parameters Tuning New Scope or measure the phase voltage period on real oscilloscope 9 Set PC master software control mode and start motor see Application Control and PC Master Software Remote Operating Mode 10 Set the speed to the middle of minimal and maximal speed Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 45 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Increase step by step the proportional gain SPEED_PIREG_P_GAIN with PC master software until speed noise or oscillation appears or up to 128 If SPEED_PIREG_P_GAIN is set to 128 increase proportional gains in SPEED_PIREG_P_GAINSCALELEFT further with PC master software steps 0 1 2 8 otherwise leave SPEED_PIREG_P_GAINSCALELEFT as 0 Increase step by step the integral gain SPEED_PIREG_ _ GAIN with PC master software up to current oscillation or noise or up to 128 If SPEED _PIREG_I_ GAIN is set to 128 do further integral gain increases to SPEED_PIREG_Il_GAINSCALELEFT with PC master software steps 6 5 4 0 otherwise leave SPEED_PIREG_ _GAINSCALELEFT as 7 You can further evaluate the setting of the regulator parameters in order to get a smoother current waveform until the
9. Customer Motor Most important software settings are described in previous sections but for some applications PWM frequency must be modified It is described in PWM Frequency and Current Sampling Period Setting Once you set the speed control and the motor is running in all start speed up and slow down conditions the software parameters are set for the motor Remember that all parameters are set in const_cust_x h Then it is possible to program the FLASH memory of the MC68HC908MR32 device PWM frequency and current sampling period settings are not usually needed The PWM frequency also affects the current sampling period Consequently the current regulation setting should be done while understanding their mutual dependency Therefore the PWM frequency setting is provided in the file const h instead of const_cust_x h For the PWM frequency setting follow the label CAN _CHANGE_FPWM_n in const h file The PWM frequency setting is provided by CAN_CHANGE_FPWM_1 define SET_PER_PWM 32 0 Range lt 1 255 gt The final PWM period is defined by setting SET_PER_PWM The PWM period us is PWM period PERIOD_PWM_US SET_PER_PWM 2 Equation 14 With default software setting oscillator clock etc The final PWM frequency HZ is 6 10 PWMirequency 5ceT PER PWM Equation 15 With default software setting Settings for some important PWM frequencies are listed in Table 7 Table 7 PWM Frequency Sett
10. Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Controller Board Controller board settings are the same for all hardware platforms Settings 9 Jumpers JP3 and JP7 must be connected with the other jumpers disconnected See Figure 7 PC Master S W START STOP SPEED RS232 switch eea to evaluation hinf nA jehai board Te oe connect indication Mite 4 E JP13 mm LEDs Ai add ade i See to power m stage board Figure 7 Controller Board EVM Board Settings EVM board settings are the same for all hardware platforms CAUTION Remember the MMDS MCU clock must be set to 4 MHz Change the crystal oscillator or set oscillator W1 to MMDS and set for 4 MHZ in the debugger Software Setup In order to run the sensorless BLDC application the following software is needed e Metrowerks compiler for HC08 installed on your PC computer e Sensorless BLDC application HC08 software files located in bldc_zerocrosO8MR2z2 directory Sensorless BLDC Motor Control on MC68HC908MR32 16 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Application Hardware and Software Configuration For application PC master software remote control the following software is needed e PC master software for PC installed on your PC computer e Sensorless BLDC application PC master software contro
11. PWM period SET_PER_CS us PER_CS_T1_US PERIOD_PWM_US SET_PER_CS us Time period from a PWM reload event middle of central aligned PWM to current sampling time shift of A D conversion with PWM us CAN_CHANGE_PERCURSAMP_n define PER_PWM_CS_US 5 0 Range lt PERIOD_PWM_US 2 PERIOD_PWM_US 2 gt Usually it is not recommended to change PER_PWM_CS_US but it can be evaluated when there are problems with back EMF zero crossing noise It is necessary to set SET_PER_CS according to the following equation _PERIOD_PWM_US lt PER PWM CS US lt PERIOD_PWM_US 2 2 Equation 17 Sensorless BLDC Motor Control on MC68HC908MR32 48 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Conclusion References Freescale Semiconductor Inc AN2356 D Conclusion If all the points in Introduction to Software Parameters Setting and Tuning for Customer Motor are done the software should be customized to customer motor If the software customizing of your motor was not successful it is recommended that you read Software Suitability Guide for Customer Application and Motor since the software may not be suitable for some applications Some important recommendations can also be found under the Caution and Note labels in this Application Note 10 Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355
12. Semiconductor Inc AN2356 D Software The software is provided with three parameters sets files const_cust_hv h Parameters Setting const_cust_evmm h and const_cust_lv h configured for three hardware and Follow up motor kits HV LV and EVM as was described before But the software can be configured for other 3 phase trapezoidal BLDC motors or possibly other hardware board parameters The motor control drive usually needs setting tuning for e Current voltage parameters e Dynamic parameters The parameter configurations must be set in source code before compilation However some parameters can also be temporarily changed using PC master software experimental setting Finally when an appropriate parameter value is found it can be set in the source code The software parameters settings are described in the subsections below and in the software code by comments You should proceed with some steps to customize the software according to your motor or hardware characteristics The source code is commented with descriptive labels to simplify the process Labels in the Files Most of the software parameter settings are provided in one of these files const_cust_hv h const_cust_hv h const_cust_evmm h or const_cust_lv h The required steps const_cust_evm h are marked const_cust_lv h MUST_CHANGE_nn Label for changes which must be set changed when adapting software for a motor MUST_CHANGE_nn_EXPER
13. System Configuration Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 13 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D All the system parts are supplied and documented according to the following references EVM1 Modular Development System with EMO8MR32 Daughter Board Supplied as KITMMDS08MR32 Described in Manual supplied with kit U1 Controller Board for MC68HC908MR32 Supplied as ECCTR908MR32 Described in MC68HC908MR32 Control Board User s Manual Freescale document order number MEMCMR32CBUM D see References 3 M1 1B23810 Motor Supplied in kit with 1B23810 Motor as ECMTREVAL Evaluation Motor Board Kit U2 3 Phase AC BLDC Low Voltage Power Stage Supplied in kit with 1B23810 Motor as ECMTREVAL Evaluation Motor Board Kit Described in Freescale Embedded Motion Control Evaluation Motor Board User s Manual Freescale document order number MEMCEVMBUM D see References 6 For a description of the hardware boards see References 3 6 which can be found on the World Wide Web at http www freescale com Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Application Hardware and Software Configuration Low Voltage The
14. Tuning subproject see Software Parameters Tuning with PC Master Software Project File in order to be able to modify the current regulator You can see the actual current and required alignment current on the Current Parameters Tuning New Scope or measure the powered motor coil current on real oscilloscope Set PC master software control mode and start motor see Application Control and PC Master Software Remote Operating Mode Observe the current transient at Alignment start then stop motor or reset software Then modify the regulator parameters with PC master software as in steps 8 9 10 and 11 Repeat steps 21 to 23 until regulation is improved Open const_cust_x h and modify the regulator parameters with the final variable values evaluated with PC master software Build the code see Software Execution and Build The last Alignment setting constant is Alignment Time period ms MUST_CHANGE_6_EXPER define PER_T_ALIGN_MS 1000 0 Range lt 0 PER_BASE_T3_ALIGN_US 1000 255 gt This period can be set experimentally This constant can also be evaluated using PC master software tuning file This period must be high enough to let the rotor stabilize during Alignment state It is recommended that you begin with large values such as 20 000 ms then it can be lowered The period should be set to ensure that the rotor and therefore also the current is stabilized at the end of Alignment st
15. be done Maximal limit of dc bus voltage V CAN_CHANGE_1 define VOLT_MAX_FAULT_V 380 0 Range lt 0 VOLT_RANGE_MAX gt VOLT_MAX_FAULT_V determines the maximal voltage when the drive fault state should be entered So the constants VOLT_MAX_FAULT_V must be set according to maximal voltage limit of the motor or the power stage using the lower value Therefore the setting of this constants is also mentioned in Voltage Setting Hardware Customizing under a different label MUST_IF_HW_CHANGE_ 33 It should be changed when there are problems with over voltage Minimal limit of dc bus voltage V CAN_CHANGE_2_ EXPER define VOLT_MIN_FAULT_V 100 0 Range lt 0 VOLT_RANGE_MAX gt VOLT_MIN_FAULT_V determines the minimal voltage when the drive fault state should be entered So the constants VOLT_MIN_FAULT_V must be set according to minimal voltage limits of the motor application It should be changed when there are problems with under voltage dc bus voltage threshold mains 120V 230V V CAN_CHANGE_10 define VOLT_120_THRESHOLD_V 150 Range lt 0 VOLT_RANGE_MAX gt 120 V voltage threshold setting should only be used for high voltage hardware It determines if 120 or 230 V mains voltage will be detected by software But the VOLT_120_THRESHOLD_V detection has no importance for the software functionality For low voltage hardware the VOLT_120 THRESHOLD_V should be set to 0 Most of current l
16. chip peripherals The system for BLDC motor control consists of hardware and software The application uses universal modular motion control development hardware boards which are provided by Freescale for customer development support For a description of these hardware boards refer to References 3 4 5 6 7 and the World Wide Web at http www freescale com There are three board and motor hardware sets for the application 1 High Voltage Hardware Set For variable line voltage 115 230 Vac and medium power phase current lt 2 93 A 2 Low Voltage Evaluation Motor Hardware Set For automotive voltage 12 V and very low power phase current lt 4 A 3 Low Voltage Hardware Set For automotive voltage 12 V or possibly 42 V and medium power phase current lt 50 A The application software is practically the same for all three hardware platforms The only modification needed is to include one of three constants that customize the hardware and motor parameter settings The software written in C language specifications are listed in Table 1 A useful feature of the software is serial communication with PC master software protocol via RS232 The PC master software is PC computer software which allows reading and setting of all the system variables and can also run html script pages to control the application from the PC Another feature of the BLDC control software is on line parameter modification with PC master s
17. d a ed Figure 9 PC Master Software Control Window Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D NOTE NOTE NOTE NOTE The following control actions are supported e Setting PC master software manual control mode PC Master Mode Radio button Application control from PC master software requires that PC master software control mode must be set Before changing PC master software manual control mode by PC Master Mode Radio button the controller board START STOP switch must be set to STOP This is a protection feature that prevents the motor from unexpected starts e Start the motor Start Motor button To start the motor with PC master software control mode two conditions must be fulfilled START STOP switch on the controller board must be set to START and Start Motor button on PC master software control page must be pressed down Stop the motor Stop Motor button e Set the required speed of the motor via bar graph e Clear failures Clear Failures button PC master software displays the following information e Required speed of the motor e Actual speed of the motor e dc bus current e Temperature of the power stage e Fault status no fault over voltage under voltage or over current in dc bus e Motor status running stopped Hardware boar
18. system configuration for low voltage hardware set is shown in Figure 6 Hardware Set tee Configuration apie 40w flat PC Master ribbon cable 3ph AC BLDC Low Voltage Power Stage ECLOVACBLDC 12 GND Controller Board HC908MR32 ECCTR908MR32 12VDC KITMMDS08MR32 ECMTRLOVBLDC PC Computer Not Connected Not Connected RS232 emulator Figure 6 Low Voltage Hardware System Configuration All the system parts are supplied and documented according to the following references e EVM1 Modular Development System with EMO8MR32 Daughter Board Supplied as KITMMDS08MR32 Described in Manual supplied with kit U1 Controller Board for MC68HC908MR22 Supplied as ECCTR908MR32 Described in MC68HC908MR32 Control Board User s Manual Freescale document order number MEMCMR32CBUM D see References 3 e U2 3 Phase AC BLDC Low Voltage Power Stage Supplied as ECLOVACBLDC Described in Freescale Embedded Motion Control 3 Phase BLDC Low Voltage Power Stage User s Manual Freescale document order number MEMC3PBLDCLVUM D3 see References 7 e MB1 Motor Brake SM40N SG40N Supplied as ECMTRLOVBLDC For a description of the hardware boards see References 3 7 which can be found on the World Wide Web at htto www freescale com Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 15 For More
19. 0 V or 55 0 V Maximal output current 50 0 A Motor Characteristics Motor type 6 poles three phase star connected BLDC motor EM Brno SM40N Speed range 3000 rpm at 12 V Maximum electrical power 150 W Phase voltage 3 6 5 V Phase current 17A Drive Characteristics Speed range lt 2500 rpm Input voltage 12 Vdc Maximum dc bus voltage 15 8 V Protection Over current over voltage and under voltage fault protection Load Characteristic Type Varying Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Software Suitability Guide for Customer Application and Motor Minimal Application Speed NOTE Maximal Application Speed NOTE Voltage Close Loop As it is known the back EMF voltage is proportionally dependent on motor speed Since the sensorless back EMF zero crossing sensing technique is based on back EMF voltage it has some minimal speed limitations The motor start up is solved by starting back EMF acquisition state but minimal operation speed is limited The minimal speed depends on many factors of the motor and hardware design and differs for any application This is because the back EMF zero crossing is disturbed and effected by the zero crossing comparator threshold as explained below and in the Eff
20. D Motion Control Development Tools found on the World Wide Web at http e www freescale com Freescale Embedded Motion Control MC68HC908MR32 Control Board User s Manual document order number MEMCMR32CBUM D Freescale 2000 Freescale Embedded Motion Control 3 Phase AC BLDC High Voltage Power Stage User s Manual document order number MEMC3PBLDCPSUM D Freescale 2000 Freescale Embedded Motion Control Optoisolation Board document order number MEMCOBUM D Freescale 2000 Freescale Embedded Motion Control Evaluation Motor Board User s Manual document order number MEMCEVMBUM D Freescale 200 Freescale Embedded Motion Control 3 Phase BLDC Low Voltage Power Stage User s Manual document order number MEMC3PBLDCLVUM D Freescale 2000 User s Manual for PC Master Software Freescale 2000 found on the World Wide Web at http e www freescale com 68HC908MR32 6BHC908MR16 Advance Information document order number MC68HC908MR32 D Freescale Low Cost High Efficiency Sensorless Drive for Brushless DC Motor using MC68HC 7 05MC4 document order number AN1627 Freescale Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Sensorless BLDC Motor Control on MC68HC908MR32 50 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Sem
21. EED potentiometer The RUN STOP switch enables disables motor spinning The yellow LED will light whenever the application software correctly executes so it will also light when motor spinning is disabled or at a fault state When motor spinning is enabled and starts spinning alignment or starting oack EMF acquisition state only the yellow LED lights When motor rotation is enabled and the motor runs with speed close loop running state the green LED lights yellow LED also lights e If an over current or over voltage fault occurs the internal fault logic is asserted and the application enters a fault state indicated by a red LED blinking yellow LED lights This state can be exited only by an application RESET or setting RUN STOP switch to STOP It is strongly recommended that you inspect the entire application to locate the source of the fault before starting again Sensorless BLDC Motor Control on MC68HC908MR32 20 Software Porting to Customer Motor For More Information On This Product Go to www freescale com PC Master Software Remote Operating Mode NOTE Freescale Semiconductor Inc AN2356 D Application Hardware and Software Configuration In the PC master software remote operating mode the drive is controlled remotely from a PC through the serial communication interface SCI channel of the MCU device via an RS 232 physical interface The drive is enabled by the RUN STOP switch which can be u
22. Freescale Semiconductor Application Note AN2356 D 11 2002 Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor By Libor Prokop and Leos Chalupa Roznov System Application Laboratory Roznov Czech Republic General Description System Concept This application note describes using the software for 3 phase sensorless brushless dc motor BLDC control with back EMF zero crossing The software is designed for Motorola s MC68HC908MR32 microcontroller unit MCU and dedicated for motor control however it could be easily ported to other derivatives of the MC68HC 9 08MRx Family This application note serves as a guide for application software use and parameter configuration for a customer motor It also helps to decide if the software and control method is suitable for the specific customer application For a more detailed view of brushless dc motor control application system concepts control techniques and software description refer to the complementary application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355 D The application block diagram is shown in Figure 1 The sensorless rotor position technique detects the zero crossing points of back EMF induced in the motor windings The phase back EMF zero crossing points are sensed while one of the three phase windings is not powered The information obtained is processe
23. Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor elit a aef Mane wedi Salome fie eee al fi Le Tees AF A jro OS E ma a in a d n m SN Actial Curent CURR ALIGHA Spa 2 Sheet Fh bara Turing 050 p ti Pira aN l1 ee i F i Speed Pare Tuning L fjernet nina gast I Azi6 02N 0 15 4 p40 4 IN click here to display pus oscilloscope sinen SE SFT SSD steam SYAN puuma Time me on eo 02 carer a 1 5 C CIRA AED F GUN TURA HETG P ANEDE TIRA HEEG aani Guns HREJ J TUSE Pen T nan Ha modify values here Figure 14 PC Master Software Parameters Tuning Control Window NOTE The software parameters can be temporarily modified and evaluated using the PC master software tuning file But the parameter settings are not stored in the non volatile memory after reset the software loads parameters from const_cust_x h file When you finish the software parameters evaluation you must open one of the const_cust_hv h const_cust_evmm h and const_cust_lv h files and manually modify the parameters according to the final variable values evaluated otherwise you will get default setting after the MCU reset Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 27 For More Information On This Product Go to www freescale com Freescale
24. MC68HC908MR32 Software Porting to Customer Motor 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Decision on the Application Suitability CHECK MINIMAL APPLICATION SPEED CHECK MAXIMAL MOTOR SPEED OK Selection of the Power Stage HV INCLUDE CONST_CUST_HV H INTO CODE_FUN C FILE Modified H W INCLUDE APPROPRIATE CONST_CUST_X H INTO CODE_FUN C FILE EVM LV INCLUDE CONST_CUST_LV H INTO CODE_FUN C FILE INCLUDE CONST_CUST_EVMM H INTO CODE_FUN C FILE y Y LV for 42V SET DUTY PWM _MAX MODIFY R207 R522 R523 R524 SET VOLT_HW_MAX T SET VOLT FN MAX SET VOLT MAX FAULT V SET VOLT_MAX FAULT_V SET CURR HW MAX A IN CONST_CUST_LV H FILE SET CURR HW MN A SET CURR MAX FAULT A OK Voltage and Current Settings SET MAXIMAL FAULT VOLTAGE VOLT_MAX_FAULT_V SET MINIMAL FAULT VOLTAGE VOLT_MIN FAULT _V SET VOLT 120 THRESHOLD V ONLY FOR HV SET MAXIMAL FAULT CURRENT CURR_MAX_FAULT_A SET NUMBER OF CURRENT FAULTS CNTR_OVC ie Alignment Current and Regulator Settings SET ALIGNMENT STATE CURRENT CURR_ALIGN_A SET CURRENT REGULATOR CURR _PIREG_P_GAINSCALELEFT CURR_PIREG P_GAIN CURR _PIREG_ _GAINSCALELEFT CURR _PIREG GAIN i Start Up C
25. NGE_4 Customizing define CURR_HW_MAX_A 2 93 Range lt 0 infinity Minimal measurable current determined by hardware current sensing A MUST_IF_HW_CHANGE_5 define CURR_HW_MIN_A 2 93 Range infinity 0 gt CURR_HW_MAX_A and CURR_HW_MIN_A must be changed when current sensing range is different from default hardware Sensorless BLDC Motor Control on MC68HC908MR32 30 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Example of Software Customizing to Hardware Software Customizing to Motor Voltage and Current Settings NOTE Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor Maximal limit of dc bus current allowable for the hardware A MUST_IF_HW_CHANGE_6 define CURR_MAX_FAULT_A 1 5 Range lt 0 CURRENT _RANGE_MAX_A gt CURR_MAX_FAULT_A determines the maximal current when the drive fault state should be entered So it must be set to the maximum current allowed for the power stage or the motor see also Maximal and Minimal Current Limits Setting Let s have low voltage power stage ECLOVACBLDC modified to 42 V from 12 V as described in its documentation So software must be customized for hardware changes Because of low voltage set the const_cust_lIv h must be modified 1 Maximal PWM duty cycle remains the same define DUTY_PWM_MAX 0 942 2 Modified maximal measurable vol
26. OR MUTUAL CAPACITANCE EFFECT MEASURE FREE PHASE BACK EMF VOLTAGE FOR THE MOTOR INDUCTANCE CAPACITANCE EFFECT Decision on the Application Suitability CHECK MINIMAL APPLICATION SPEED CHECK MAXIMAL MOTOR SPEED Figure 12 Follow up for Software Customizing Trouble Shouting Sensorless BLDC software is provided with a PC master software project file for on line software parameters tuning see Figure 13 This file supports e Remote application control e Key software parameters modification for Current parameters tuning Start up parameters tuning Speed parameters tuning e PC master software oscilloscope windows with required variables The remote application control uses the same control page as described in PC Master Software Remote Operating Mode Moreover the tuning file incorporates subprojects for a dedicated system variables setting and PC master software oscilloscope windows for watching dedicated parameters variables For software parameter tuning with PC master software it is necessary to have PC master software installed on your PC computer Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D click here for Current click here for Start click here for Speed Parameters Tuning Parameters Tuning Parameters Tuning ening hik ao
27. RAM bits definitions header _ bldc_zerocrosO8MR32 sources ram_cust_param c RAM variables for software customizing definitions _ bldc_zerocrosO8MR32 sources ram_cust_param h RAM variables for software customizing header declarations _ bldc_zerocrosO8MR32 sources tab_cust c constants tables definitions _ bldc_zerocrosO8MR32 sources tab_cust h constants tables definitions header e _ bldc_zerocrosO8MR32 sources pcmaster c PC master software communication subroutines _ bIdc_zerocrosO8MR32 sources pcmaster h PC master software communication subroutines header _ bldc_zerocrosO8MR32 sources code_asm asm program assembler functions _ bldc_zerocrosO8MR32 sources code_asm h program assembler functions header _ bldc_zerocrosO8MR32 prms default prm linker command file Sensorless BLDC Motor Control on MC68HC908MR32 18 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Application Hardware and Software Configuration Application PC Master The application PC master software control files are Software Control Files bIde_zerocrosO8MR32 pc_master BLDC pmp PC master software project file bldc_zerocrosO8MR32 pc_master source directory with PC master software control page files Software Execution Build To build the BLDC sensorless with the back EMF zero crossing appli
28. R_PIREG_P_GAINSCALELEFT as 0 10 Increase step by step the integral gain CURR_PIREG_I_ GAIN with PC master software up to current oscillation or noise or up to 128 11 IfCURR_PIREG_I_ GAIN is set to 128 do further integral gain increases to CURR_PIREG_ _GAINSCALELEFT with PC master software steps 0 1 2 8 otherwise leave CURR_PIREG_ _ GAINSCALELEFT as 0 Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 You can further evaluate the setting of the regulator parameters in order to get a smoother current waveform or until the regulation seems to be performing well Open const_cust_x h and modify the regulator parameters with the final variable values evaluated with PC master software Change the software back to normal in code_start c file label TUNING_1 remove goto modify as comment goto Align it will allow finishing Alignment state when alignment period ends Build the code see Software Execution Build You can also tune regulator dynamic characteristics of current transients steps 17 to 26 or finish the regulators tuning Run the code see Software Execution and Execute from Evaluation Board Start the PC master software tuning project Select Current Parameters
29. _PERIOD_T2_US gt Usually it is not recommended to change PER_CMT_MAX_US The change is only necessary if the commutation period at start up is to long Alignment to Start Increment of the regulators output CAN_CHANGE_7_EXPER define START_INCR_OOUTREG 20 0 Range lt 128 127 gt START_INCR_OOUTREG should not necessarily be changed for a motor accommodation It can be set experimentally If the motor has a low torque increase the value If the motor starts with a high speed then slows down by regulator decrease the value NOTE START_INCR_OOUTREG can be evaluated with PC master software tuning file tuning_bldc pmp Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 39 For More Information On This Product Go to www freescale com NOTE Freescale Semiconductor Inc AN2356 D Number of successive feedbacks necessary to enter the Running state CAN_CHANGE_8_EXPER define I_CNTR_FOK 0x03 Range lt 0 255 gt The motor starts spinning with Starting Back EMF Acquisition state The software enters regular Running state with speed regulation after _ CNTR_FOK back EMF successive commutation steps are done Usually it is not recommended to change CNTR_FOK but it can be evaluated when there are problems with motor start up L CNTR_FOK can be evaluated with PC master software tuning file uning_bldc pmp
30. ac software customizing file const_cust_hv h e Low voltage evaluation motor hardware set software customizing file const_cust_evmm h e Low voltage hardware set software customizing file const_cust_lv h Software Configuration and Parameters Setting Configuration to one of the three required hardware sets is provided by inclusion of dedicated software customizing files The software pack contains the files const_cust_hv h const_cust_lv h and const_cust_evm h with predefined parameter settings for running on one of the optional board and motor hardware sets The required hardware must be selected in code_fun c file by one of these files include Where software is configuration for different customer motors the software configuration for any motor is provided in the dedicated customizing file according to the hardware board used PWM frequency 15 626 kHz with default software setting possibly changeable in const h file Sensorless BLDC Motor Control on MC68HC908MR32 4 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Hardware and Drive Specifications High Voltage Hardware Set Specification Freescale Semiconductor Inc AN2356 D Drive Specification The other system specifications are determined by hardware boards and motor characteristics The boards and their connections are shown in Hardware Configuration The hardware set specifications
31. amplified 0 3 3 V with 1 65 V offset The internal MCU analog to digital A D converter and zero crossing detection are synchronized with the PWM signal This synchronization avoids spikes when the IGBTs or MOSFETs are switched and simplifies the electric circuit Sensorless BLDC Motor Control on MC68HC908MR32 2 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Drive Specification Software Specification Freescale Semiconductor Inc AN2356 D Drive Specification During the rotor alignment state the dc bus current is controlled by the current PI regulator In the other states motor running the phase voltage PWM duty cycle is controlled by the speed PI regulator The A D converter is also used to sense the dc bus voltage and the drive temperature The dc bus voltage is stepped down to a 3 3 V signal level by a resistor network The six IGBTs copack with built in fly back diode or MOSFETs and gate drivers create a compact power stage The drivers provide the level shifting that is required to drive the high side switch The PWM technique is used to control motor phase voltage The concept of the application is that of a speed closed loop drive using back EMF zero crossing technique for position detection It serves as an example of a sensorless BLDC motor control system using Motorola s MC68HC908MR32 MCU It also illustrates the usage of dedicated motor control on
32. an the theoretical calculation This is due to the response time of the hardware back EMF zero crossing sensing Therefore the default software setting is COEF_HLFCMT 0 375 Normally COEF_HLFCMT should only be changed if you need a different commutation angle time from back EMF zero crossing to commutation For example for motor field weakening The relation between COEF_HLFCMT and the commutation can also be defined by Advance_angle which is the electrical angle shift from ideal commutation Advance_angle 30 D ZC Cmt angle 3 2 2 Equation 7 1 Advance_angle 60 Advance_angle 15 for COEF_HLFCMT 0 25 Advance_angle 7 5 for COEF_HLFCMT 0 375 Advance_angle 0 for COEF_HLFCMT 0 5 COEF _HLFCMT Equation 8 The relation between back EMF zero crossing and the commutation is explained in the Running Commutation Time Calculation section of the complementary application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355 D Constants defining start up need to be changed according to the drive dynamics Start Commutation Period us MUST_CHANGE_8_EXPER define PER_CMT_START_US 4000 0 Range lt 0 PER_CMT_MAX_US 2 gt PER_CMT_START_US is the period used to calculate the first start commutation period Sensorless BLDC Motor Control on MC68HC908MR32 38 Software Porting to Custo
33. ardware and motor platforms High Voltage Hardware Set Configuration e Low Voltage Evaluation Motor Hardware Set Configuration Low Voltage Hardware Set Configuration The hardware setups are shown in Figure 4 Figure 5 and Figure 6 These setups are described in following subsections see Hardware and Drive Specifications for each platform characteristics The supplied controller boards for MC68HC908MR32 ECCTRMR32 allows two possibilities for software execution 1 MMDS Evaluation Board KITMMDSMR32 Using a real time debugger supplied with the Metrowerks compiler the evaluation board is connected to the controller board ECCTRMR32 via an emulator connector This solution is recommended for software evaluation 2 Programmed MCU MC68HC908MR32 Where a daughter board module with MC68HC908MR3z2 processor is plugged into the controller board ECCTRMR32z2 instead of the emulator cable the processor must be programmed in an external programmer This solution is recommended for demonstration purposes and final tests Figure 4 Figure 5 and Figure 6 show the configuration with MMDS evaluation board A detailed description of the individual boards can be found in comprehensive user s manuals belonging to each board see References 3 4 5 6 7 8 Each user s manual incorporates the schematic of the board description of individual function blocks and bill of materials The individual boards can be ordered from Fre
34. are discussed in the following subsections This hardware set is dedicated for medium power phase current lt 2 93 A and main voltage The specifications for a high voltage hardware and motor set are listed in Table 2 The hardware operates on both 230 Vac and 115 Vac mains Table 2 High Voltage Hardware Set Specifications Hardware Boards 230 Vac or 115 Vac Characteristics Input voltage Maximum dc bus voltage 407 V Maximal output current 2 93A Motor Characteristics Motor type 6 poles three phase star connected BLDC motor EM Brno SM40V Speed range 2500 rpm at 310 V Maximum electrical power 150 W Phase voltage 3 220 V Phase current 0 55 A Drive Characteristics Speed range lt 2500 rpm determined by motor used Maximum dc bus voltage 380 V Optoisolation Required Protection Over current over voltage and under voltage fault protection Load Characteristic Type Varying Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 5 For More Information On This Product Go to www freescale com Low Voltage Evaluation Hardware Freescale Semiconductor Inc AN2356 D This hardware set is dedicated for 12 V voltage and very low power phase current lt 4 A The specifications for a low voltage evaluation hardware and For More Information On This Product Go
35. ate Sensorless BLDC Motor Control on MC68HC908MR32 36 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Software Customizing to Motor Commutation and Start up Control Setting NOTE Commutation Parameters NOTE Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor When all voltage and current settings are done the motor commutation and start up parameters need to be set For settings which must be done follow the labels MUST_CHANGE_nn MUST_CHANGE_EXPER_nn in file const_cust_x h For changes which can be done but usually are not necessary follow the labels CAN_CHANGE_nn CAN _CHANGE_EXPER_nn in file const_cust_x h Thanks to the Freescale patented start up technique the start parameters setting is quite simple and reliable However in order to reliably start the motor the commutation control constants must be properly set Detailed description starts here Commutation time period to discharge coil current us MUST_CHANGE_7 define PER_DIS_US 300 0 Range lt 0 minimal commutation period COEF_TOFF gt It is the maximal allowed current decay period determined by motor winding and maximal current Must be PER_DIS_US lt minimal motor commutation period us COEF_TOFF where COEF_TOFF is commutation Toff period coefficient from const h file explained in the complementary app
36. cation open the bldc_zerocross mcp project file and execute the Make command as shown in Figure 8 This will build and link the application and all needed Metrowerks libraries Metrowerks CodeWarrior File Edit Search Mima Debug DSP56800 Window Help ia ATA Boca Add Files Create New Group Fie Rrepracess W Codec Precommile Borinie ot Hey v Fie m Disassemble lt BG Depender Sassemiule BSC Sources Bring Up To Date Ctrl U go E codec 12 files heck sprntar Mikr Stop emid Ei Break m mes am a m a Figure 8 Execute Make Command Execute from To execute the application from MMDS evaluation board KITMMDSMR32 Evaluation Board choose the Project Debug command in the Code Warrior IDE This will start real time debugger load firmware and application software to evaluation board MMDS The application should then be started from the real time debugger IDE by the Run Start command For more help with these commands refer to the CodeWarrior tutorial documentation located in the CodeWarrior installation directory NOTE Remember the MMDS MCU clock must be set to 4 MHz Change the crystal oscillator or set oscillator W1 to MMDS and set 4 MHz in the real time debugger MMDS0508 target signals 4 MHz Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 19 For More Information On This Product Go to www freescale com Freescale Semiconducto
37. d identification is not implemented in the software Therefore the PC master software control window displays Power Stage board Optoisolation board Not Recognized If the fault status is different from the no faults when over current over voltage or under voltage fault the red LED blinks and the motor is stopped This state can be exited by application RESET or Clear Failures button on the PC master software control page It is strongly recommended that you inspect the entire application to locate the source of fault before starting it again Sensorless BLDC Motor Control on MC68HC908MR32 22 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor Introduction to Software Parameters Setting and Tuning for Customer Motor This section describes how to modify the software parameters for any BLDC motor and some hardware adaptations The software parameters can be evaluated from a PC computer using PC master software so the first subsection describes tuning the PC master software project file A follow up for software customizing to a customer motor is shown in Figure 10 e Before starting the software modification for a customer motor and application it is recommended that you check the application and motor suitability This is explained in Software Suitability G
38. d in order to commutate the energized phase pair and control the phase voltage using pulse width modulation The back EMF zero crossing detection enables position recognition The resistor network is used to step down sensed voltages to a 0 3 3 V level Zero crossing detection is synchronized with the middle of center aligned PWM signals by the software in order to filter high voltage spikes produced by switching the IGBTs MOSFETs The software selects by MUX command the phase comparator output that corresponds to the current commutation step The multiplexer MUX circuit selects this signal which is then transferred to the MCU input Freescale Semiconductor Inc 2004 All rights reserved e Po freescale semiconductor Freescale Semiconductor Inc AN2356 D DC Bus Current amp DC Bus Voltage Sensing Power line 3 BEMF Voltage Zero Crossing Comparators DC Bus Voltage BEMEF Zero Current Crossing Temperature signal PWM Generator with os Dead Time Crossing Zero Crossing Time moment SS Zero Crossing Period Position Recognition Commutation Period START STOP Required Speed Speed PI SPEED Regulator Required Alignment Current Current p jCurrent PI gt Regulator JT TT TTT j for Alignment HC08MR32 Figure 1 System Concept The voltage drop resistor is used to measure the dc bus current which is chopped by the pulse width modulator PWM The signal obtained is rectified and
39. ded 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 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 the failure of the Freescale Semiconductor p
40. determined by the back EMF zero crossing technique Usually SPEED_MIN_RPM 0 07 to 0 5 SPEED_MAX_RPM Equation 11 Therefore for low speed requirements minimal speed SPEED_MIN_RPM must be evaluated experimentally SPEED_MIN_RPM can be evaluated with PC master software tuning file tuning_bldc pmp Minimal PWM Duty cycle limit CAN_CHANGE_11 define DUTY_PWM_MIN 0 250 Range lt 0 1 gt DUTY_PWM_MIN determines minimal PWM duty cycle limit and in this way it restricts minimal voltage on the motor Therefore DUTY_PWM_MIN must be changed if its default setting creates a higher voltage than is physically necessary to run with a speed close to SPEED_MIN_RPM If the motor is unable to run down to the speed set inSPEED_MIN_RPM then decrease DUTY_PWM_MIN constant Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Speed PI regulator constants Range lt 0 8 gt MUST_CHANGE_13_EXPER define SPEED_PIREG_P_GAINSCALELEFT 0 MUST_CHANGE_14_ EXPER define SPEED_PIREG_P_GAIN 128 Range lt 0 255 gt where the current regulator proportional gain is EED_PIREG_P_GAINSCALELEFT
41. e mutual inductances between the coils which carry the phase current and the coil used for back EMF sensing causes the PWM pulses to be superimposed onto the detected back EMF voltage Figure 3 shows the real measured branch voltage The red curves highlight the effect of the difference of the mutual inductances This difference is not constant Figure 3 Mutual Inductance Effect Due to the construction of the BLDC motor both mutual inductances vary and they are equal at the position that corresponds to the back EMF zero crossing detection The BLDC motor with stator windings distributed in the slots has technically higher mutual inductances than other types Therefore this effect is more significant On the other hand the BLDC motor with windings wound on separate poles shows minor presence of the effect of mutual inductance However noticeable this effect itdoes not degrade the back EMF zero crossing detection because it is cancelled at the zero crossing point Additional simple filtering helps to reduce ripples further Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Application Hardware and Software Configuration Application Hardware and Software Configuration Hardware Configuration NOTE As mentioned the software can be configured to run on one of the three h
42. ect of Mutual Inductance and Effect of Mutual Phase Capacitance sections of the complementary application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355 D Usually the minimal speed for reliable operation is from 7 to 20 of the motor s nominal speed The maximal motor speed is limited by the minimal commutation period 60 10 i _ MeximalsPeecliPm ia commutation period lusi COMMUT PEN Equation 1 COMMUT_REV commutations per motor revolution must be set according to rotor poles COMMUT_REV Sp Equation 2 where p rotor poles The minimal commutation period is determined by execution time of the software With default software settings and COEF_HLFCMT 0 450 it is 333 us as shown in Table 1 So for example the 4 pole 3 phase motor can be controlled up to the maximal speed of 15 015 rpm Using PC master software in the application increases the minimal commutation time This is due to the execution of PC master software routine In this case the minimal execution time is 520 ms The minimal commutation period could be decreased using pure assembler code instead of C coding As shown in Application Hardware and Software Configuration the speed control is based on voltage close loop control This should be sufficient for most applications Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor For Mo
43. escale as a standard product Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D High Voltage The system configuration for a high voltage hardware set is shown in Figure 4 Hardware Set Configuration 12VDC PC Computer RS232 GND PC Master 40w flat ribbon U2 cable U3 3ph AC BLDC High Voltage Power Stage 40w flat ribbon cable Controller Board HC908MR32 ECCTR908MR32 Optoisolation Board ECOPT 100 240VAC 49 61 Hz ECOPTHIVACBLDC KITMMDSO8MR32 oj x a a ECMTRHIVBLDC PC Computer Not Connected Not Connected RS232 emulator Figure 4 High Voltage Hardware System Configuration All the system parts are supplied and documented according to the following references e EVM1 Modular Development System with EMO8MR32 Daughter Board Supplied as KITMMDSO08MR32 Described in Manual supplied with kit e U1 Controller Board for MC68HC908MR32 Supplied as ECCTR908MR32 Described in MC68HC908MR32 Control Board User s Manual Freescale document order number MEMCMR32CBUM D see References 3 e U2 3 Phase AC BLDC High Voltage Power Stage Supplied in kit with optoisolation board as ECOPTHIVACBLDC Described in 3 Phase AC Brushless DC Hig
44. h Voltage Power Stage User s Manual Freescale document order number MEMC3PBLDCPSUM D see References 4 Sensorless BLDC Motor Control on MC68HC908MR32 12 Software Porting to Customer Motor For More Information On This Product Go to www freescale com NOTE Low Voltage Evaluation Motor Hardware Set Configuration Freescale Semiconductor Inc AN2356 D Application Hardware and Software Configuration e U3 Optoisolation Board Supplied with 3 phase AC BLDC high voltage power stage as ECOPTHIVACBLDC Or supplied alone as ECOPT ECOPT optoisolation board Described in Optoisolation Board User s Manual Freescale document order number MEMCOBUM D see References 5 It is strongly recommended to use opto isolation optocouplers and optoisolation amplifiers during development time to avoid any damage to the development equipment e MB1 Motor Brake SM40V SG40N Supplied as ECMTRHIVBLDC For a description of the hardware boards see References 3 4 5 which can be found on the World Wide Web at http www freescale com The system configuration for a low voltage evaluation motor hardware set is shown in Figure 5 PC Computer RS232 PC Master 40w flat U2 ribbon U1 Controller Board HC908MR32 ECCTR908MR32 Evaluation Motor Board M1 ECMTREVAL KITMMDSO8MR32 1B23810 PC Computer RS232 emulator Figure 5 Low Voltage Evaluation Motor Hardware
45. iconductor Inc AN2356 D References Sensorless BLDC Motor Control on MC6BHC908MR32 Software Porting to Customer Motor 51 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc How to Reach Us Home Page www freescale com E mail support freescale com USA Europe or Locations Not Listed Freescale Semiconductor Technical Information Center CH370 1300 N Alma School Road Chandler Arizona 85224 1 800 521 6274 or 1 480 768 2130 support freescale com 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 support freescale com 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 Hong Kong Ltd Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 800 2666 8080 support asia freescale com For Literature Requests Only Freescale Semiconductor Literature Distribution Center P O Box 5405 Denver Colorado 80217 1 800 441 2447 or 303 675 2140 Fax 303 675 2150 LDCForFreescaleSemiconductor hibbertgroup com AN2356 D Information in this document is provi
46. imits settings do not necessarily need to be done Current offset limit for fault during calibration initialization V CAN _CHANGE_4 define OFFSET_MAX CURR_V 1 65 0 225 Range lt 0 5 gt When PWM is off the default hardware determined offset should be 1 65 V The actual offset is checked during current calibration The fault offset limit should be OFFSET_MAX_CURR_V Default h w offset minimal allowed offset error Equation 3 OFFSET_MAX_CURR_V should only be changed if there are over current problems during current offset calibration at MCU initialization Sensorless BLDC Motor Control on MC68HC908MR32 32 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Alignment Current and Current Regulator Setting NOTE Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor Maximal limit of dc bus current A CAN_CHANGE_3 define CURR_MAX_FAULT_A 1 5 Range lt 0 CURRENT_RANGE_MAX_A gt CURR_MAX_FAULT_A should be changed for a motor with maximal allowable current lower than the board Initial value for OVer Current Counter CAN_CHANGE_5 define I_CNTR_OVC Range lt 0 255 gt _ CNTR_OVC determines the number of current samples with current value gt CURR_MAX_FAULT_A needed before entering the drive fault state The current sampling period is PER_CS_T1_US
47. ing SET PER PWM FREQUENCY Pind PERIOD PWN US 16 0 31 250 Hz 32 us 25 0 20 000 Hz 50 us 32 0 default 15 625 Hz 64 us 128 0 3 90625 Hz 256 us Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D CAUTION Current Sampling Period Current Sampling Instant Current measurement sampling period is synchronized with PWM Therefore changing PWM frequency automatically changes the current sampling period This apart from other things effects the current regulator Therefore after changing PWM frequency changing or checking current sampling period is strongly recommended Current sampling period should usually be changed in two cases 1 When PWM frequency is changed 2 Motors with externally low electrical constant If the motor electrical constant is lower than default current sampling period of 128 us the current regulator may not work properly For current sampling period setting follow the label CAN_CHANGE_PERCURSAMP_n in const h file Current sampling period setting is provided by CAN _CHANGE_FPWM_n CAN CHANGE _PERCURSAMP_n tdefine SET _PER_CS 2 0 Range lt 1 gt The final current sampling period us is Current sampling period PWM period SET_PER_CS Equation 16 current sampling period
48. l files located in bldc_zerocrosO8MR32 pc_master directory Both the HCO8 and PC master software control files for the sensorless BLDC application are delivered together in the bldc_zerocrosO8MR32 directory It consists of files listed in Application HC08 Software Files Application HC08 The application HC08 software files are Software Files e bIde_zerocrosO8MR32 bldc_zerocross mep application project file bldc_zerocrosO8MR32 sources const_cust_hv h definitions for software customizing for high voltage 230 115 Vac power board e bldc_zerocrosO8MR32 sources const_cust_evm h definitions for software customizing for EVM motor board 12 V low power _ bldc_zerocrosO8MR32 sources const_cust_lv h definitions for software customizing for low voltage 12 Vdc power board NOTE Change the code_fun c file to include include one of const_cust_hv h const_cust_evmm h or const_cust_lv h files according to the hardware platform used See Table 5 Table 5 Required Software Configuration for Dedicated Hardware Platform Hardware Dedicated Required Software Platform Customizing File Configuration include const_cust_hv h High voltage hardware const_cust_hv h into code fun c done with default software setting include const_cust_evmm h into code fun c Low voltage evaluation const_cust_evmm h motor hardware include const_cust_lv h Low voltage hardware const_cust_lv h into code fun c
49. le to modify the current regulator 6 You can see the actual current and required alignment current on the Current Parameters Tuning New Scope or measure the powered motor coil current on real oscilloscope 7 Set PC master software control mode and start the motor see Application Control and PC Master Software Remote Operating Mode Sensorless BLDC Motor Control on MC68HC908MR32 34 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor LE Set ae ber Geet ioe amom siaj aeii st alet fal fT 16 ai fe E arla oie e mla _ Actual Curent CURR ALIGN A O46 gan 4 oas d gao click here to display Click here for i 025 control page Current F Parameters aan Tuning ait a10 lcli k here to display i aas oscilloscope i cuRF HRG P GNH CURR AREG PGA amk Pea ANH oar Pra i aE rm Tae Startins modify values here Figure 15 PC Master Software Current Parameters Tuning Window 8 Increase step by step the proportional gain CURR_PIREG_P_GAIN with PC master software until current noise or oscillation appears or up to 128 9 If CURR_PIREG_P_GAIN is set to 128 do further proportional gain increase CURR_PIREG_P_GAINSCALELEFT with PC master software steps 0 1 2 8 otherwise leave CUR
50. lication note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355 D If PER_DIS_US is too high it can cause commutation errors at high speed Half Commutation advancing Coefficient CAN_CHANGE_9 define CORF_HLFCMT 0 375 Range lt 0 1 gt COEF_HLFCMT multiplied by commutation period determines the time from back EMF zero crossing to motor commutation So it sets the electrical angle from back EMF zero crossing to motor commutation step The software controls BLDC motor with a 6 step commutation six commutations per one electrical rotation which means 60 between commutations For ideal commutation with no advancing no field weakening the back EMF zero crossing should be just in the middle between commutations which Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Start up Constants and Maximal Commutation Period means that the electrical angle ZC Cmt angle between back EMF zero crossing and commutation is 30 Z2C Cmt_ angle 60 ZC Cmt angle 15 for COEF_HLFCMT 0 25 ZC Cmt angle 22 5 for COEF_HLFCMT 0 375 ZC Cmt angle 30 for COEF_HLFCMT 0 5 COEF_HLFCMT Equation 6 In the real system the ZC Cmt angle is a little bit greater th
51. mer Motor ES ape BLS menor on Ra D EE Garerd Parmesan Tun fit Fees Scope MS Stet Peete Urey 22 3 Seog rareciers Suny r 7590 Click here to display Click here for 3 control page Start 1 s000 Parameters f Tuning click here to display maf oscilloscope 22800 22760 N 29250 23800 2aM0 24000 mai 24500 Time rms D0 Pinari ioar dee pe iar Stop dar bao Em PTa T ala a 400 4 m n PE OST SIART ira Hi mnis L miar a Cues 6 DEC Loon Cit oe 3 SEC inn _ Erca Pana de a Lon Ema a a modify values here Figure 16 PC Master Software Start Parameters Tuning Window 11 SetPC master software control mode see Application Control and PC Master Software Remote Operating Mode 12 Start motor see Application Control and PC Master Software Remote Operating Mode 13 If the software signalizes errors usually commutation error clear the errors stop the motor and change PER_CMT_START_US increase or decrease by PC master software 14 Repeat step 13 until the motor starts well If the motor starts against a high start up torque or if Alignment state current is low it is recommended to change START_INCR_OOUTREG by PC master software If it is a problem to start the motor then CNTR_FOK can also be changed from default 0x03 but not recommended Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 41 For More Informa
52. mer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor PER_CMT_START_US period must be changed for any motor accommodation It can be set experimentally If the motor displays errors during Starting Back EMF Acquisition state beginning Running state or has a low start up torque DO decrease or increase the PER_CMT_START_US value Table 6 shows typical setting examples Must be PER _CMT_START_US lt PER_CMT_MAX_US 2 NOTE Setting this constant is an empirical process It is difficult to use a precise formula because there are many factors involved which are difficult to obtain in the case of a real drive motor and load mechanical inertia motor electromechanical constants and sometimes also the motor load So they need to be set with a specific motor PER_CMT_START_US can be evaluated with PC master software tuning file tuning_bldc pmp Table 6 Start up Period Typical First to Second Second to Third Motor Size Commuiation Commutation PER CMT START US Step Period Step Period Slow motor high load and sei 8000 0 us 8 ms 8 16 ms motor mechanical inertia Fast motor high load and de Ai 2000 0 ps 2ms 2 4 ms motor mechanical inertia Maximal commutation period limit us CAN_CHANGE_6_EXPER define PER_CMT_MAX_US 65536 0 Range lt 0 65535 UNIT
53. ng to Customer Motor 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Maximal PWM Duty Cycle Voltage Setting Maximal PWM duty cycle MUST_IF_HW_CHANGE_1 define DUTY_PWM_MAX 0 96 Range lt 0 1 gt Proportional value of maximal PWM duty cycle is determined by power stage boards used DUTY_PWM_MAX must be set for any hardware customizing Some hardware boards need maximal duty cycle lt 1 in order to charge high side drivers for power inverters Maximal measurable voltage determined by hardware voltage sensing V Hardware MUST_IF_HW_CHANGE_2 Customizing define VOLT_HW_MAX 407 0 Range lt 0 infinity VOLT_HW_MAX must be changed when voltage sensing range is different from default hardware Maximum limit of dc bus voltage allowable for the hardware V MUST_IF_HW_CHANGE_3 define VOLT_MAX_FAULT_V 380 0 Range lt 0 VOLT_RANGE_MAX gt VOLT_MAX_FAULT_V determines the maximal voltage when the drive fault state should be entered So the constant VOLT_MAX_FAULT_V must be set according to maximal voltage limit of the power stage or the motor using the lower value Therefore setting this constant is also mentioned in Maximal and Minimal Voltage Limits Setting under a different label CAN_CHANGE_ 1 Current Setting Maximal measurable current determined by hardware current sensing A Hardware MUST_IF_HW_CHA
54. oftware which can be used for software parameter tuning to a customer motor Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Table 1 Software Specifications Control Algorithm 3 phase trapezoidal BLDC motor control star or delta connected Sensorless with back EMF zero crossing commutation control Speed closed loop control Motoring mode Target Processor MC68HC908MR32 Language C language with some arithmetical functions in assembler Compiler Metrowerks ANSI C cC Compiler for HCO8 Application Control Manual interface start stop switch speed potentiometer control LED indication PC master software remote interface via RS232 using PC computer MCU Oscillator Frequency 4 MHz with default software setting MCU Bus Frequency 8 MHz with default software setting Minimal BLDC Motor Commutation Period Without PC Master Software Communication 333 us with default software setting and COEF_HLFCMT 0 450 Minimal BLDC Motor Commutation Period with PC Master Software Control 520 us with default software setting and COEF_HLFCMT 0 450 Targeted Hardware Software is prepared to run on three optional board and motor hardware sets e High voltage hardware set at variable line voltage 115 230 V
55. ontrol Settings SET COIL DISCHARGE PERIOD PER DIS US SET COMMUTATION ADVANCING COEFFICIENT COEF_HLFCMT SET COMMUTATION START PERIOD PER_CMT_START_US AND MAXIMAL PER_CMT_MAX_US SET ALIGNMENT TO START INCREMENT START_INCR_OOUTREG SET NUMBER OF SUCCESSIVE BEMF ZERO CROSSINGS TO ENTER RUNNING STATE _CNTR_FOK ye Speed Control Settings SET COMMUTATIONS PER ROTOR MECHANICAL REVOLUTION COMMUT_REV SET MAXIMAL SPEED VARIABLES RANGE SPEED RANGE MAX RPM SET MAXIMAL REQUIRED SPEED SPEED MAX RPM SET MINIMAL REQUIRED SPEED SPEED MN RPM SET SPEED REGULATOR CONSTANTS CURR_PIREG_P_GAINSCALELEFT CURR_PIREG_P_GAIN CURR_PIREG GAINSCALELEFT CURR_PIREG_ _GAIN Figure 10 Follow up for Software Customizing to Customer Motor Sensorless BLDC Motor Control on MC68HC908MR32 24 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Software Parameters Tuning with PC Master Software Project File NOTE Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor PWM Frequency and Current Sampling Period Setting SET PWM FREQUENCY SET_PER PWM SET CURRENT SAMPLING PERIOD SET_PER_CS SET PERIOD FROM PWM RELOAD TO CURRENT SAMPLING SET_PER_CS Figure 11 Follow up for Advanced Software Customizing Decision on the Motor Suitability MEASURE FREE PHASE BACK EMF VOLTAGE FOR THE MOT
56. p Pinis F PE Master Mode Start Show Pehl car Motor Running Required 1400 rr Speed 1395 mm mm period TESS is DC bus current mA Temperature 740C Failures Ma Fie lures speed 135mm camm perbadi 25355 4008 click nere Identified hardware pel qanin Ds a tea z5 Om On pao ae control page CELI HOGER Lind m ra OE orn L CORR PIRDG F GNH E 3 in DERFRA GUMSLUE i tec tition OER PFEIL SAH f Tih Prii AHALE PER_1_ALIGH_FE PiE huik ffl modify variables here Figure 13 PC Master Software Parameters Tuning Control Window Start the PC master software parameters tuning application oldc_zerocrosO8MR32 pc_master tuning_bldc pmp After you start the PC master software you can choose which parameters you are going to tune current start up soeed parameters see Figure 13 Then you can press control page to make the control window visible and provide control in the same way as in PC Master Software Remote Operating Mode Or you can display the oscilloscope window see Figure 14 You can then modify the variable values in the variable window Figure 14 which is visible for both control page or oscilloscope page turned on The variables can be modified according to their defined limits Sensorless BLDC Motor Control on MC68HC908MR32 26 Software Porting to Customer Motor For More Information On This Product Go to www freescale com
57. r Inc AN2356 D NOTE Execute from Pre programmed MCU NOTE Application Control Manual Operating Mode NOTE Once the application is running move the RUN STOP switch to the RUN position and set the required speed with the SPEED potentiometer If successful the BLDC motor will be spinning If the RUN STOP switch is set to the RUN position when the application starts toggle the RUN STOP switch between the STOP and RUN positions to enable motor spinning This is a protection feature that prevents the motor from starting when the application is executed from CodeWarrior When the software is built the S record file bldc_zerocrosO8mr32_MMDS sx is generated in bldc_zerocrosO8MRB82 bin bldc_zerocrosO8mr32_MMDS sx The software must be built see Build to generate by linker the bldc_zerocros0 amp mr32_MMDS sx file last update This S record file can be used for programming of MC68BHC908MR32 MCU devices An external programmer e g Freescale M68HCO08 serial programmer must be used to program the device The programmed MCU with MC68HC908MR32 daughter board module can then be plugged into the controller board ECCTRMR3z2 instead of the emulator cable This BLDC sensorless motor control application can operate in two modes 1 Manual Operating Mode 2 PC Master Software Remote Operating Mode In the manual operating mode the drive is controlled by the RUN STOP switch and the required speed is set by the SP
58. re Information On This Product Go to www freescale com Motor Suitability Effect of Mutual Phase Capacitance Freescale Semiconductor Inc AN2356 D Software Suitability Guide for Customer Application and Motor Back EMF zero crossing sensing is achievable for most of BLDC motors with a trapezoidal back EMF However for some BLDC motors the back EMF zero crossing sensing can be problematic since it is affected by unbalanced mutual phase capacitance and inductance It can disqualify some motors from using sensorless techniques based on the back EMF sensing As described in the complementary application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355 D the mutual phase capacitances play an important role in the back EMF sensing Usually the mutual capacitance is very small Its influence is only significant during the PWM switching when the system experiences very high du dt The effect of mutual capacitance is shown in Figure 2 Channel 1 shows an example of the disturbed branch voltage caused by unbalanced mutual capacitance The other phase channel 2 is not affected because it faces balanced mutual capacitance An important conclusion from the complementary application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Description Freescale document order number AN2355 D is the fact that only the unbalance of the mutual capaci
59. regulation seems to be performing well Open const_cust_x h and modify the regulator parameters with the final variable values evaluated with PC master software Start motor see Application Control and PC Master Software Remote Operating Mode Set minimal desired speed If the displayed real speed is not able to go down to the desired minimal speed it is necessary to decrease minimal PWM duty cycle DUTY_PWM_MIN in const_cust_x h Then you can tune dynamic characteristics of speed regulators steps 18 to 29 or finish tuning the regulators Start motor see Application Control and PC Master Software Remote Operating Mode Set minimal speed Set maximal speed and observe the speed transient Set minimal speed and observe the speed transient Then modify the regulator parameters with PC master software as in steps 11 to 14 Change SPEED_MIN_RPM if problems occur at low speed Repeat steps 21 to 25 until regulation is improved Open const_cust_x h and modify the regulator parameters with the final variable values evaluated with PC master software Build the code see Software Execution and Build Sensorless BLDC Motor Control on MC68HC908MR32 46 Software Porting to Customer Motor For More Information On This Product Go to www freescale com PWM Frequency and Current Sampling Period Setting PWM Frequency Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for
60. reliable commutation at low speed Sensorless BLDC Motor Control on MC68HC908MR32 44 Software Porting to Customer Motor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Introduction to Software Parameters Setting and Tuning for Customer Motor Pe DR pa ore pm Deka ten amom silaj Hala e mabial wi fe OOOO E a alela Ae E mia Spe BLD ragion n HR 2 L Curent Parmeatans Tung r Ga Fars Scope Acia Speed Desired Speed _ Rag i EE t Stat Preh Darang ED Fea Mepa 14 j 1 _ S a Ba 5 Seped Pararecters Miriy pt o gt hep coe 0a ga DT click here to i control page gos Click here for ga 7 Speed oa ER pe a click here to display Parameters oscilloscope Tuning oz 0 q 500 14705 100g 16250 16800 18780 18000 e260 Time ms ares en Poti ke Bart OE career 20 _ afa 0G Parsatkriei T ip Tomina 5j SEEC PEG P ai 1 i SRED FEG P DA ACALE bai srt REG 1 GA iz s EE aT 5 c Br SAE A APA m modify values here Figure 17 PC Master Software Speed Parameters Tuning Window 5 Build and run the code see Software Execution Build and Execute from Evaluation Board 6 Start the PC master software tuning project 7 Select Speed Parameters Tuning subproject see Software Parameters Tuning with PC Master Software Project File in order to be able to modify the current regulator
61. roduct 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 lt freescale semiconductor AN2356 D Rev 0 11 2002 For More Information On This Product Go to www freescale com
62. sed to safely stop the application at any time For the PC master software remote control it is necessary to have PC master software installed on your PC computer Start the PC master software application bldc_zerocrosO8MR32 pc_master BLDC pmp After you start the PC master software press control page to make the control window visible Figure 9 illustrates the PC master software Control Window After you start the PC master software the algorithm block description window appears instead of the PC master contro window therefore press control page If the PC master software project pmp file is unable to control the application it is possible that the wrong load map bin bldc_zerocrosO8 amp mr32_MMDS map file has been selected PC master software uses the load map to determine addresses for global variables being monitored Once the PC master project has been launched this option may be selected in the PC master window under Project Select Other Map FileReload jls Me E oe up fee Ami hii sujo zas saal E ali click here to display control page aul fe rie i Denied ey ny khta Orch ystem Labor miar Pamor p Bock Oreck Bepul MOTOAOLA 3ph BLDC motor on HC9O08MR32 Start aE Bibi minter Stopped piis DC bus current fam Temperature 141 5 C r PC feligarher Mod Praise KF z 53i Ne slune Paver abiga boan Mii teoa Sptcleblation basi Notesi COPE
63. source code to customize the software As explained before see Software Setup one of the following files is used for most of software parameters configuration bldc_zerocrosO8MR32 sources const_cust_hv h definitions for software customizing for high voltage 230 115 Vac power board bldc_zerocrosO8MR32 sources const_cust_evm h definitions for software customizing for EVM motor board 12 V low power bldc_zerocrosO8MR32 sources const_cust_lv h definitions for software customizing for low voltage 12 Vdc power board According to hardware used the designated file see Table 5 must be selected by including bldc_zerocrosO8MR32 sources code_fun c program c language functions The following parameter settings will be provided in the selected file Therefore it will be referred to as const_cost_x h in the following sections The hardware boards parameters customizing is provided in the const_cust_x h file Skip this section when standard modular motion control development hardware boards are used without any changes When low voltage power stage ECLOVACBLDC is configured for 42 V some const_cust_x h changes are needed For setting follow the labels MUST_IF_HW_CHANGE_nn in file const_cust_x h from nn 1 Detailed description starts here An example of software customizing to power stage is shown in Example of Software Customizing to Hardware Sensorless BLDC Motor Control on MC68HC908MR32 Software Porti
64. tage is 55 V so set define VOLT_HW_MAX 55 0 3 Maximum limit of dc bus voltage should be set according to motor or application requirements but VOLT _MAX_FAULT_V gt 42V define VOLT _MAX FAULT_V 63 0 4 Board modified to 42 V has maximal measurable current unchanged define CURR_HW_MAX_A 2 93 define CURR_HW_MIN_A 2 93 5 Maximum limit of dc bus current should remain unchanged or set according to motor or application requirements define CURR_MAX_FAULT_A 45 0 When the software parameters are set for the hardware you should follow the settings in Software Customizing to Motor Voltage and Current Settings The software parameter settings according to customer motor are described in this section First of all voltage and current settings need to be done For settings which must be done follow the labels MUST_CHANGE_nn and MUST_CHANGE_EXPER_nn in file const_cust_x h where nn 1 For changes which can be done but usually are not necessary follow the labels CAN_CHANGE_nn and CAN_CHANGE_EXPER_nn in file const_cust_x h Detailed description starts here Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D Maximal and Minimal Voltage Limits Setting Maximal and Minimal Current Limits Setting Most of voltage limit settings do not necessarily need to
65. tance not the capacitance itself disturbs the back EMF sensing With both capacities equal they are balanced the disturbances disappear Tek BIR Single Seq 2 50MS s Che Zoot 1 0 Vert 0 18 Hore Chi 5 00 Be 5 00 200us Che J E V Figure 2 Disturbed Back EMF by Unbalanced Capacity Coupling Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D NOTE CAUTION Effect of Mutual Inductance NOTE CAUTION Note that the configuration of the end turns of the phase windings has a significant impact Therefore it must be properly managed to preserve the balance of the mutual capacity This is especially important for prototype motors that are usually hand wound Channel 1 in Figure 2 shows an example of the disturbed branch voltage which can cause impossible back EMF zero crossing sensing Failing to maintain balance of the mutual capacitance can easily disqualify such motors from using sensorless techniques based on the back EMF sensing Usually the BLDC motors with windings wound on separate poles show minor presence of the mutual capacitance Thus the disturbance is insignificant The negative effect on back EMF sensing of mutual inductance is not to such a degree as unbalanced mutual capacitance However it can be noticed on the sensed phase The difference of th
66. tion On This Product Go to www freescale com Freescale Semiconductor Inc AN2356 D 15 Ifthe motor starts and continues running after you repeatedly start stop the start up parameters are set properly 16 Open const_cust_x h and modify parameters with the final variable values PER_CMT_START_US START_INCR_OOUTREG evaluated with PC master software 17 Change the software back to normal set speed regulator parameters to define SPEED _PIREG_P_GAIN 64 define SPEED _PIREG_I_ GAIN 0 in const_cust_x h file to enable speed regulation 18 Build the code see Software Execution and Build Software When the motor commutation setting is done the speed control parameters Customizing to need to be set Motor Speed Control Setting For settings which must be done follow the labels MUST_CHANGE_nn MUST_CHANGE_EXPER_nn in file const_cust_x h For changes which can be done but usually are not necessary follow the labels CAN_CHANGE_nn CAN_CHANGE_EXPER_nn in file const_cust_x h Number of commutations per motor revolution MUST_CHANGE_9 define COMMUT_REV 18 0 Range lt 0 255 gt COMMUT_REV period must be changed for any motor accommodation Set the number of commutations according to the number of rotor poles there are six commutations for one electrical angle revolution Therefore 6 motor poles 2 COMMUT_REV Equation 9 Maximal speed range rpm MUST_CHANGE_10 define SPEED RANGE_MAX_RPM
67. to www freescale com Set Specification motor set are listed in Table 3 It is targeted first of all to software evaluation with small motors Table 3 Low Voltage Evaluation Hardware Set Specifications Hardware Boards Input voltage 12 Vdc Characteristics Maximum dc bus voltage 16 0 V Maximal output current 4 0A Motor Characteristics Motor type 4 poles three phase star connected BLDC motor Speed range lt 5000 rpm at 60 V Maximal line voltage 60 V Phase current 2A Output torque 0 140 Nm at 2 A Drive Characteristics Speed range lt 1400rpm Input voltage 12 Vdc Maximum dc bus voltage 15 8 V Protection Over current over voltage and under voltage fault protection Load Characteristic Type Varying Sensorless BLDC Motor Control on MC68HC908MR32 6 Software Porting to Customer Motor Freescale Semiconductor Inc AN2356 D Drive Specification This hardware set is dedicated for medium power phase current lt 50 A and automotive voltage The specifications for a low voltage hardware and motor Low Voltage Hardware Set Specification set are listed in Table 4 The hardware power stage board is dedicated for 12 V but can be simply configured to a 42 V supply described in documentation for the ECLOVACBLDC board The supplied motor is targeted for 12 V Table 4 Low Voltage Hardware Set Specifications Hardware Boards Characteristics Input voltage 12 Vdc or 42 V Maximum dc bus voltage 16
68. uide for Customer Application and Motor The Parameters File Selection must be made according to Hardware Configuration used Ifamodified hardware power stage is used the appropriate constants in const_cust_x h file must be set as described in Software Customizing to Power Stage e If alow voltage board with a modification for 42 V is used the constants VOLT_HW_MAX and VOLT_MAX_FAULT_V must be changed If one of the three standard power stages is used the software customizing to power stage is not needed e For software customizing to customer motor and application a setting must be made as explained in Software Customizing to Motor Voltage and Current Settings Alignment Current and Current Regulator Setting Software Customizing to Motor Commutation and Start up Control Setting Software Customizing to Motor Speed Control Setting Accomplishing the above steps should be sufficient for most applications However in some cases there may be a need for advanced software customizing see Figure 11 with changes to motor PWM frequency or to the current regulator sampling period as explained in PWM Frequency and Current Sampling Period Setting If there s still a problem running the motor check if the motor is suitable for sensorless control with back EMF zero crossing See Figure 12 as described in Motor Suitability Then again check the application suitability Sensorless BLDC Motor Control on

Download Pdf Manuals

image

Related Search

Related Contents

see manual    CNC Portable flame/plasma Cutting Machine  Manual Fenix Maxi  EDITION NUMERIQUE 2015  TimeStorm User`s Manual - LinuxLink  French Remote Keypad Installation Manual  Manual de Instalación original  TE-ML 13 - CI-Portal - ZF Friedrichshafen AG  Teléfone Sem Fio 2,4 GHz Expandível com  

Copyright © All rights reserved.
Failed to retrieve file