Home

AN2355: Sensorless BLDC Motor Control on MC68HC908MR32

image

Contents

1. 1 Microsoft is a registered trademark of Microsoft Corporation in the United States and or other countries Sensorless BLDC Motor Control on MC68HC908MR32 MOTOROLA Software Description 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D PC Master Software The application interface data variables used for the exchange between the BLDC Control MCU BLDC control MCU software and PC master software are shown in Table 3 Software These variables are used for status sensing and control PC master software Communication accesses these bytes directly from their physical memory addresses Variables Table 3 PC Master Software API Variables Representing Name Type Range Description Sys3 Sys3_Def y o 8flags System variable 3 Motor_Ctrl Motor_Ctrl_Def 8flags Motor control variable Motor_Status Motor Status Def O 8flags Motor status variable Failure Failure_Def O 8flags Failure variable Sp Input 08 lt 0 255 gt Speed input variable used for required speed calculation Speed_Range_Max_RPM U16 O lt d Speed range maximum Speed Max RPM U16 O psc Maximal speed limit Speed Min RPM U16 lt 01555885 Minimal speed limit rpm Commut_Rev U8 lt 0 255 gt Commutations per motor revolution lt Curr_Range_Max_cA Curr 58 Curr Range cA dc bus current Curr Range Max cA S16 lt 32768 32767 gt Curr
2. ZERO CROSSING DETECTION SIGNAL Per ZCros n lt Figure 18 BLDC Commutation Time with Zero Crossing Sensing The following calculations are made to calculate the commutation time T2 n during the Running state Service of commutation The commutation time T2 n is predicted T2 n T Cmt n 2 Per ZCrosFlt n 1 If 2 Per ZCrosFlt Per Cmt Max then result is limited at Per Cmt Max Service of received back EMF zero crossing The commutation time T2 n is evaluated from the captured back EMF zero crossing time ZCros n Per ZCros n Per ZCrosFlt n HlfCmt n T ZCros n T ZCros n 1 T ZCros n 1 2 Per ZCros n 1 2 Per ZCrosO 1 2 Per ZCrosFlt n Advance angle 1 2 Per ZCrosFlt n C CMT ADVANCE Per ZCrosFlt n T ZCrosO Sensorless BLDC Motor Control on MC68HC908MR32 20 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Control Technique Coef HlfCmt Per ZCrosFlt n The best commutation was get with Advance angle 60Deg 1 8 7 5Deg which means Coef HlfCmt 0 375 at Running state with default s w setting Per Toff n 1 Per ZCrosFlt Coef Toff and Per Dis minimum Coef Toff 0 375 at Running state Per Dis 150 with default s w setting Per ZCrosO Per ZCros n T ZCrosO0 lt T_ZCros n T2 n T ZCros n HlfCmt n I
3. Main data flow is displayed in Figure 22 The processes are described in the following subsections The process provides measurement of analog values using ADC The measured inputs are dc bus current dc bus voltage and speed input The measurement is provided by the measurement handler The state diagram is explained in State Diagram The process reads the start stop switch and provides start condition and clear failure decisions as explained in Stand By and Fault State Sensorless BLDC Motor Control MC68HC908MR32 32 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description PC MASTER SOFTWARE PC Mode Start Ctrl Switch_Start Running A D CONVERTERS TIMER 1 PROCESS SPEED INPUT DC BUS VOLTAGE AND DC BUS CURRENT MEASUREMENT START STOP SWITCH START STOP SWITCH READING AND START STOP DECISION Sp_Input VOLTAGE CURRENT PROCESS ALIGNMENT STARTING RUNNING CONTROL PROCESS FAULT CONTROL FAULT STOP Volt_Max_Fault Curr_Max_Fault FFLAG1 FFLAG2 Figure 22 Main Data Flow Part1 Process Fault Control process provides fault control and fault stop as described in Fault State Fault Stop Stand By Align State Back EMF Acquisition State and Running State The processes alignment starting and running control are displayed in Figure 23 The processes are descr
4. 54 2 Equation 8 lech lc The voltage that disturbs the back EMF sensing utilizing the free not powered motor phase C can be calculated based the equation 1 1 2 Uceb Ucae 2Rc S 2 z Ucep Equation 9 The final expression for disturbing voltage can be found as follows 2 fic at Ce tone e ic dt Equation 10 Equation 10 expresses the fact that only the unbalance of the mutual capacitance not the capacitance itself disturbs the back EMF sensing When both capacities are equal they are balanced the disturbances disappear This is demonstrated in Figure 10 and Figure 11 Tek BIRR Single Seq 2 50MS s Ch Zoom 1 0 Vert 0 18 Hore Chl y 00 MEE 00V 2005 Che gH V Figure 10 Distributed Back EMF by Unbalanced Capacity Coupling Sensorless BLDC Motor Control on MC68HC908MH32 10 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D BLDC Motor Control Channel 1 in Figure 11 shows the disturbed branch voltage while the other phase channel 2 is not affected because it faces balanced mutual capacitance The unbalance was purposely made by adding a small capacitor on the motor terminals in order to better demonstrate the effect After the unbalance was removed the branch voltage is clean without any spikes Single Seq mia i
5. unsigned int BIT4 1 BIT4 RESERVED unsigned int 5 1 BIT6 RESERVED unsigned int BIT6 1 BIT6 RESERVED unsigned int ClearFail 1 BIT7 Clear failure Status B ClearFall w s xsse x pes pv ystartocrl char R Motor Ctrl Def PC master software Motor Control Flags Definition typedef union struct unsigned int Switch_Start 1 BITO Switch START STOP set to START Flag unsigned int Running 1 BIT1 Motor is running Alignment Start or Running state unsigned int BIT2 1 BIT2 RESERVED unsigned int 120 1 BIT3 120 V DC Bus detected only for HV DC Bus unsigned int BIT4 1 BIT4 RESERVED unsigned int BIT5 1 BIT5 RESERVED unsigned int BIT6 1 BIT6 RESERVED unsigned int BIT7 1 BIT7 RESERVED B V120 Running Switch Start char R Motor Status Def PC master software Motor Status Flags register Definition typedef union struct unsigned int OverCurrent 1 BITO Over Current Failure unsigned int OverHeating 1 BIT1 Over Heating unsigned int VoltageFailure 1 BIT2 Over Voltage unsigned int BIT3 ds BIT5 RESERVED unsigned int BIT4 ich BIT4 RESERVED unsigned int BIT5 12 BIT6 RESERVED unsigned int BoardIdFail 12 BIT6 pcb Identification Fai
6. 11 2002 For More Information On This Product Go to www freescale com
7. Control on MC68HC908MR32 Software Porting to Customer Motor Motorola document order number AN2356 D The required BLDC motor voltage system commutation is provided using the MC68HCO08MR32 PWM block The zero crossing selection is provided by setting port F pins PTF1 PTF3 connected to the multiplexer As shown in Data Flow the commutation and back EMF zero crossing selection process is split into two actions 1 Preset BLDC commutation and BEMF zero crossing selection 2 Set BLDC commutation and BEMF zero crossing selection In each phase of the 6 step commutation two PWM channels bottom and top switch are active and the other four PWM channels are logical 0 The commutation preset is accomplished by setting the buffered registers PVAL1H PVAL1L through PVAL6H PVALEL To preset the active PWM channel the MSB bits of the dedicated PVALXH registers are set to 0 To preset the PWM channel to the logical 0 the MSB bits of the dedicated PVALXH registers are set to 1 This is due to the signature bit functionality as described in 68 908 32 68HC9908MH 160 Advance Information Motorola document order number MC68HC908MR32 D This commutation preset is provided by the function Commut In Commut the function field Set PWM P Step Cmt calls one of Shft PWMO 5 functions according to P Step Cmt value so the PVALXH registers are set as required This will not effect the PWM signals until LDOK bit is set Also the back EMF ze
8. DONE DONE ERROR HANDLER DONE PHASE HAS BEEN COMMUTATED PC_F 1 RECEIVED THE ZERO CROSSING EVENT ICR_F 1 DONE DONE SERVICE OF COMMUTATION SERVICE OF RECEIVED BACK EMF ZERO CROSSING FEEDBACK IRRECOVERABLE COMMUTATION ERROR OVER CURRENT 2 TIM A CH3 INTERRUPT ye PWM RELOAD INTERRUPT PWM CENTER COMMUTATION ISR PHASE HAS BEEN TIMER TIM A INTERRUPT COMMUTATED PC_F 1 CURRENT MEASUREMENT BEMF ZERO CROSSING SENSING ISR IS DONE CURRENT MEASUREMENT 1 ISR ht Figure 32 Running State Sensorless BLDC Motor Control on MC68HC908MH32 MOTOROLA Software Description 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Stop State When motor stop is required the PWM signals are disabled and the power switches are switched off The state diagram for this state is shown in Figure 33 MOTOR STOP IS REQUIRED STOP F 1 TIM A CH1 INTERRUPT MOTOR IS STOPPED CURRENT MEASUREMENT PWM IS OFF IS DONE CURRENT MEASUREMENT CMD_F 1 ISR it lee Figure 33 STOP State Sensorless BLDC Motor Control MC68HC908MH32 50 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description Fault State If over voltage over current or commutation fault occurs the motor contr
9. Description Service of Commutation As already explained the motor phase commutation is performed in the OC interrupt service routine The phase commutated flag PC_F 1 indicates this action to the scheduler which allows the performed commutation to be serviced Detailed explanation of this state is in Processes Commutation and Zero Crossing Preset and Set Service of Received Back EMF Zero Crossing The back EMF zero crossing is detected by PWM middle function block Then the appropriate flag captured received the zero crossing event ICR_F is set by PWM centre interrupt service routine This indicates to the scheduler that the zero crossing event must be served The following actions are taken 1 Commutation parameters are recalculated more precisely based on the received feedback 2 Commutation time is preset to the output compare register of timer 2 For a better understanding of how the commutation process works see Sensorless Commutation Control see Starting Commutation Time Calculation BEMF Zero Crossing Sensing Interrupt Service Routine This ISR is used to evaluate the back EMF zero crossing Back EMF is evaluated here in order to synchronize zero crossing capture with the middle of central aligned PWM This technique rejects the noise caused by PWM from the back EMF signal When this ISR is initiated then three samples of the zero crossing input BEMF IN are taken and the state is evaluated Based on the expected
10. Figure 5 the branch voltage of phase B can be sensed between the power stage output B and the zero voltage level Thus back EMF voltage is obtained and the zero crossing can be recognized When Lop Lap this general expressions can also be found uy 5 UpackEMEx Where x A B C Equation 7 There are two necessary conditions which must be met and bottom switches in diagonal have to be driven with the same PWM signal current goes through the non fed phase that is used to sense the back EMF Figure 6 shows branch and motor phase winding voltages during a 0 360 electrical interval Shaded rectangles designate the validity of the equation Equation 7 In other words the back EMF voltage can be sensed during designated intervals m Back EMF be sensed Figure 6 Phase Voltage Waveform However simple this solution looks in reality it is more difficult because the sensed branch voltage also contains some ripples Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description 7 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Effect of Mutual Inductance NOTE As shown in previous equations Equation 4 through Equation 6 the mutual inductances play an important role here The difference of the mutual inductances between the coils which carry the phase current and the coil used for back EMF sensi
11. MOTOROLA Software Description 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D INTERRUPT PWMRELOAD l BEMF ZERO CROSSING SENSING ISR SENSE ZERO CROSSING INPUT TAKE 3 2 INPUT SAMPLES BEMF STATE 51652 52553 BEMF state V_TASC fal edge NO V_TASC ris edge NO YES SET ZERO CROSSING GET SET ICR F ZERO CROS GET T_ZCROS TIMER2 TIME INTERRUPT 1 TIM A CH1 CURRENT MEASUREMENT ISR START ADC DC BUS CURRENT CHANNEL SERVE VIRTUAL TIMER3 CURR VALUE FROM ADC IF CURR gt CURR FAULT SET F OVERCUR FLAG SET NEXT ADC CHANNEL CHNL m C INTERRUPT TIMER 2 TIM A CH3 COMMUTATION ISR FCMTE F COMMUTATION ENABLED DO MOTOR COMMUTATION STEP TIMER 1 CURRENT SENSING TO PWM SYNCHRONIZATION SET PC F PHASE COMMUTATED T CMT TIMER 2 ACTUAL TIME ZERO CROSSING SELECTION Figure 27 Software Flowchart Interrupts Sensorless BLDC Motor Control MC68HC908MR32 40 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description State Diagram The motor control application can be in one of the eight states shown in Figure 28 Each of thes
12. duty cycle The speed controller works with the constant execution sampling period PER T3 RUN US A detailed explanation is provided in Processs Speed Control The application can be controlled in two basic modes Manual mode master software mode In manual mode it is controlled by an on board start stop switch and speed potentiometer In PC master mode it is controlled from a computer using PC master software In both modes the individual variables can be observed using the PC master software Sensorless BLDC Motor Control MC68HC908MR32 26 Software Description MOTOROLA For More Information On This Product Go to www freescale com PC Master Software Communication with PC Master Software Specifications PC Master Software BLDC Control MCU Software API Communication Commands Freescale Semiconductor Inc AN2355 D Application Control PC master software was designed to provide the debugging diagnostic and demonstration tools for developing algorithms and applications It consists of components running on PCs and parts running on the target MCU connected by an RS232 serial port A small program is resident in the MCU that communicates with the PC master software to parse commands return status information and process control information from the PC The PC master software uses Microsoft Internet Explorer as a user interface on the PC SCI communication protocol with a default of 9 6 Kbau
13. edge V TASC2 ELS2A ELS2B and the evaluated state of the BEMF IN pin the zero crossing event is verified If it is accepted then the captured time is stored in variable T ZCros and the PWM ISR is finished The appropriate flag captured received the zero crossing event ICR F is set Current Measurement Interrupt Service Routine The output compare function is used to synchronize initiating the dc bus current sampling with the PWM cycle and also for the commutation timing Error Handler If the BLDC motor is controlled properly commutation events must be locked to the back EMF zero crossing feedback When that feedback is lost commutation time is derived from previous commutation events If feedback does not recover during a defined number of commutations constant MaxkErr then the situation is evaluated as irrecoverable commutation error and the fault state is entered Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Running State Measurement Handler The measurement handler assures that the measurement process is done in the right order The dc bus voltage speed command and temperature are scanned sequentially After the state has run three times all the values for dc bus current dc bus voltage speed input and temperature are updated dc bus current is scann
14. generates 3 phase PWM signals for motor control as can be seen on the data flow analysis shown in Figure 22 and Figure 23 Data Flow Software Variables Important system variables are listed in Table 4 and Defined Constants Table 4 Software Variables Name Type Representing Range Description Sys1 Sys1 Def 8flags System variable 1 Speed Min U8 U8 lt 0 Speed Range Max RPM Minimal speed system units Sp Input U8 lt 0 255 gt Speed input variable used for required speed calculation Coef_Speed_Inp Coeficient Sp Inp to Speed Desired calculation Speed Desired U8 0 Speed Range Max RPM Desired speed PIParamsScl 08 Speed Structure Speed PI regulator parameters Minimal commutation period of the speed range Per Speed MAX Range U16 UNIT PERIOD T2 US at Speed Range Max RPM Per ZCrosFIt U16 UNIT PERIOD T2 US Zero crossing period filtered T2 U16 union UNIT PERIOD T2 US Timer 2 variable T ZCros U16 UNIT PERIOD T2 US Zero crossing time n T ZCrosO U16 union UNIT_PERIOD_T2_US Zero crossing time n 1 T_Cmt U16 UNIT PERIOD T2 US Commutation time lt Curr_Range_Max_cA Curr S8 Range cA dc bus current Curr Range Max Curr Align S8 Curr Range cA Required current during alignment state PIParamsScl S8 Currr Structure Current PI regulator parameters Sensorless BLDC Motor Control MC68HC908MR32 MO
15. on MC68HC908MR32 42 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description CURRENT MEASUREMENT AND CURRENT CALIBRATION WHEN PWM IS OFF CURRENT IS HIGHER THAN LIMIT ERROR IN HARDWARE DONE START CONDITION TEST START CONDITION START SWITCH CHANGED FROM STOP TO START OR START AND PC MODE AND START CTRL OVER VOLTAGE OR UNDER VOLTAGE SPEED INPUT AND DC BUS VOLTAGE MEASUREMENTS DONE Figure 29 Stand by State Speed input and dc bus voltage measurements The dc bus voltage is measured after the start switch is turned ON This prevents the measurement being disturbed by the power turn ON Where that dc bus voltage is not within the limits the control flow enters into the fault state Sensorless BLDC Motor Control on MC68HC908MH32 MOTOROLA Software Description 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Align State In the align state the rotor position is stabilized by applying PWM signals to only two motor phases no commutation When preset time out expires then this state is finished See Figure 30 m RUN CONDITION STOP F 0 CURRENT MEASUREMENT IS DONE CURRENT CONTROLLER ALIGN TIME OUT CMD F 1 2 CMD_F 0 IRRECOVERABLE OVER CURRENT CY D TIMER TIM A CH1 INT
16. period between zero crossings Per ZCrosFlt Estimated period of commutation filtered Per HlfCmt Period from zero crossing to commutation half commutation The required commutation timing is provided by setting commutation constants Coef COEF TOFF Sensorless BLDC Motor Control on MC68HC908MHR32 MOTOROLA Software Description 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Starting Back EMF Acquisition The back EMF sensing technique enables a sensorless detection of the rotor position however the drive must be first started without this feedback This is due to the fact that the amplitude of the induced voltage is proportional to the motor speed Hence the back EMF cannot be sensed at a very low speed and a special start up algorithm must be performed In order to start the BLDC motor the adequate torque must be generated The motor torque is proportional to the multiplication of the stator magnetic flux the rotor magnetic flux and the sine of the angle between these magnetic fluxes It implies for BLDC motors the following 1 The level of phase current must be high enough 2 The angle between the stator and rotor magnetic fields must be 90 30 The first condition is satisfied during the alignment state by maintaining dc bus current at a level sufficient to start the motor In the starting back EMF acquisition state the same
17. power stage The drivers provide the level shifting that is required to drive high side switch PWM technique is used to control motor phase voltage Sensorless This section concentrates on sensorless BLDC motor commutation with Commutation back EMF zero crossing technique Control In order to start and run the BLDC motor the control algorithm has to go through the following states Alignment Starting Back EMF Acquisition Running Sensorless BLDC Motor Control on MC68HC908MR32 16 Software Description MOTOROLA For More Information On This Product Go to www freescale com Alignment Freescale Semiconductor Inc AN2355 D Control Technique Figure 15 shows the transitions between the states First the rotor is aligned to a known position then the rotation is started without the position feedback When the rotor moves back EMF is acquired so the position is known and can be used to calculate the speed and processing of the commutation in the running state START MOTOR ALIGNMENT ALIGNMENT TIME EXPIRED STARTING BACK EMF ACQUISITION MINIMAL CORRECT COMMUTATIONS DONE NO E je RUNNING Figure 15 Commutation Control Stages Before the motor starts there is a short time depending on the motor s electrical time constant when the rotor position is stabilized by applying PWM signals to only two motor phases no commutat
18. values of dc bus current dc bus voltage and speed command are updated Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description 45 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D PWM DUTY CYCLE IS LEFT AT VALIE FOUND BY THE CURRENT CONTROLLER DURING THE ALIGN STATE FIRST COMMUTATION DONE COMMUTATIONS ARE LOCKED TO THE BACK BMF FEEDBACK START_F 0 CURRENT MEASUREMENT IS DONE SECOND COMMUTATION CMD_F 1 CURRENT MEASUREMENT DONE IS DONE DONE MEASUREMENTS HANDLER MEASUREMENTS HANDLER rA ERROR HANDLER DONE PHASE HAS BEEN COMMUTATED PC 1 RECEIVED THE ZERO CROSSING EVENT DONE 21 DONE DONE SERVICE OF COMMUTATION SERVICE OF RECEIVED BACK EMF ZERO CROSSING FEEDBACK IRRECOVERABLE COMMUTATION ERROR IRRECOVERABLE OVER CURRENT TIMER TIM CH3 INTERRUPT PWM RELOAD INTERRUPT PWM CENTER BEMF ZERO CROSSING SENSING ISR PHASE HAS BEEN E CURRENT MEASUREMENT 272 COMMUTATED IS DONE Fel CMD_F 1 CURRENT MEASUREMENT 5 PC_F 1 ISR See e COMMUTATION ISR TIM A CH1 INTERRUPT Figure 31 Back EMF Acquisition Sensorless BLDC Motor Control MC68HC908MH32 46 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software
19. 020 00 22 NATURAL COMMUTATION POINT 4 ACTING POWER SWITCH IN THE POWER STAGE fone a Wns Cop eee ee PPS Figure 3 BLDC Motor Back EMF and Magnetic Flux Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D 3 Phase BLDC Power Stage Why Sensorless Control The filled areas in the tops of the phase back EMF voltage waveforms indicate the intervals where the particular phase power stage commutations occur The power switches are cyclically commutated through the six steps therefore this technique is sometimes called six step commutation control The crossing points of the phase back EMF voltages represent the natural commutation points In normal operation the commutation is performed here Some control techniques advance the commutation by a defined angle in order to control the drive above the pulse width modulator PWM voltage control The voltage for 3 phase BLDC motor is provided by a 3 phase power stage controlled by digital signals Its topology is the one as for the AC induction motor refer to Figure 5 The power stage is usually controlled by a dedicated microcontroller with on chip PWM module As explained in the previous section rotor position must be known in order to drive a brushless dc motor If any sensors are used to detect rotor po
20. 6 Figure 25 Main Software Flowchart In the Stand By state function the start stop switch is checked using StSWReadSiart function The DecideStaSto function is called to decide if the application should start The start condition differs if manual or PC master software mode is set When in manual mode PCMode 0 the start condition is the switch in the start position When PC master software mode PCMode 1 the start condition is a start request from PC master software StartCtrl 1 In both modes Stop_F is cleared when the software evaluates the start condition When Stop_F is cleared the software checks the over voltage condition and the application starts The system Alignment and Starting Back EMF Acquisition states are provided by Alignment and Start functions in the code_start c file both are called from main The functionality during the start and running state is described in Sensorless Commutation Control During the starting back EMF acquisition state the commutation time preset calculations are prepared in the StrtCmtPreset function and commutation time set calculations are provided by the StrtCmtSet function Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Y ALIGNMENT STATE TIME ALIGNMENT TIMER3
21. ECTIVE CALCULATION 2 CORRECTED SETTING OF COMMUTATION TIME BEMF ZERO CROSSING MISSED SERVICE OF RECEIVED BEMF BEMF ZERO CROSSING LLL ZERO CROSSING CORRECTED SETTING DETECTED OF COMMUTATION TIME NO HAS COMMUTATION TIME EXPIRED HAS COMMUTATION TIME EXPIRED YES y MAKE MOTOR COMMUTATION Figure 17 BLDC Commutation with Back EMF Zero Crossing Sensing Flowchart Sensorless BLDC Motor Control on MC68HC908MR32 MOTOROLA Software Description 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Running Commutation time calculation is shown in Figure 18 Commutation Time Calculation T_Cmt n 2 T Cmt n 1 T Cmt n T2 n 3 T2 n 2 T2 n 1 T2 n n 1 n 2 Y 2 Per ZCrosFlt n 1 Y COMMUTATION IS PRESET 4 ZERO CROSSING DETECTION SIGNAL Per ZCrosO n c COMMUTATED AT PRESET TIME NO BACK BMF FEEDBACK WAS RECEIVED CORRECTIVE CALCULATION 1 Per ZCros n T_Cmt n 1 ZERO CROSSING DETECTION SIGNAL BACK EMF FEEDBACK Per HlfCmt n RECEIVED AND EVALUATED Per ZCros n 2 Per ZCros n 1 Per ZCros n gt a a a T_ZCros n 1 T ZCros n Per Toff n T Cmt n 1 a Y COMMUTATED WHEN BACK EMF aped ZERO CROSSING IS MISSED CORRECTION CALCULATION 2 Per HlfCmt n lt
22. ED Co CORRECTIVE CALCULATION 2 Per Toff n 4 gt Per HlfCmt n Figure 21 Calculation of the Commutation Times During the Starting Back EMF Acquisition State Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Starting Commutation Time Calculation Speed Control Application Control Even the sub states of the commutation process in the starting acquisition state remain the same as in the running state The required commutation timing depends on application state starting state running state So the commutation time calculation is the same as that described in Running Commutation Time Calculation but the following computation coefficients are different coefficient Coef HlfCmt 0 125 with advanced angle Advance angle 60Deg 3 8 22 5Deg at Starting state Coef Toff 0 5 at Running state Per Dis 150 with default s w setting The speed close loop control is provided by a well known PI regulator The required speed is calculated from speed input variable as explained in Process Desired Speed Setting The actual speed is calculated from the average of two back EMF zero crossing periods time intervals received from the sensorless commutation control block The speed regulator output is a PWM
23. ERRUPT OVER CURRENT DETECTION ALIGN TIME OUT EXPIRED CURRENT MEASUREMENT ISR CURRENT MEASUREMENT IS DONE F 1 Figure 30 Align State Scheduler The scheduler handles the state transitions in the align state The dc bus current measurement is done in OC interrupt service routine in order to keep synchronization with PWM cycle After measurement is made the scheduler allows calculation by the current controller and the over current detection The CMD_F current measurement done flag indicates that the new value of dc bus current is ready to be processed by the current controller The time out software timer 3 of this state is defined in the software by the constants PER_T_ALIGN and PER_BASE_T3_ ALIGN Sensorless BLDC Motor Control MC68HC908MR32 44 Software Description MOTOROLA For More Information On This Product Go to www freescale com Back EMF Acquisition State Freescale Semiconductor Inc AN2355 D Software Description Current Controller The current controller subroutine is called every PER CS T1 US us 128 us with default software setting after a new value of the dc bus current has been obtained CMD F 1 It sets all six PVALx register pairs to get the right PWM ratio for the required current Timer 1 Interrupt Once the synchronization of OC function with the PWM cycle has been achieved it must be maintained because the current measurement is initiated here Over Curren
24. Freescale Semiconductor Inc Application Note ej a MOTOROLA jon intelligence everywhere digital dn Sensorless BLDC Motor Control on MC68HC908MR32 Software Description By Libor Prokop and Leos Chalupa Roznov System Application Laboratory Roznov Czech Republic General Description This application note describes 3 phase sensorless brushless dc BLDC motor control with back EMF electromotive force zero crossing sensing The application serves as an example of a sensorless BLDC motor control system using Motorola s MC68HC908MR32 microcontroller unit MCU This system be easily ported to other derivatives of the M68HC908MRx Family The application note also illustrates the use of dedicated motor control on chip peripherals The application note gives a view on brushless dc motor control It describes the application system concept with sensorless control techniques The main part of this document gives a detailed description of the software for the BLDC sensorless back EMF zero crossing application For application software use and parameter configuration to a customer motor refer to the complementary application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor Motorola document order number AN2356 D That application note will also help to decide if the software and control method shown is suitable for a specific customer application BLDC
25. Motor Control BLDC Motor The brushless dc motor BLDC motor is also referred to as an electronically Targeted by This commutated motor There are no brushes on the rotor and commutation is Application performed electronically at certain rotor positions The stator magnetic circuit is usually made from magnetic steel sheets Stator phase windings are inserted in the slots distributed winding as shown in Figure 1 or it can be wound as one coil on the magnetic pole Magnetization of the permanent magnets and their displacement on the rotor are chosen in such a way that the back EMF Motorola Inc 2002 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D the voltage induced into the stator winding due to rotor movement shape is trapezoidal This allows a rectangular shaped 3 phase voltage system see Figure 2 to be used to create a rotational field with low torque ripples STATOR STATOR WINDING IN SLOTS SHAFT ROTOR AIR GAP PERMANENT MAGNETS Figure 1 BLDC Motor Cross Section The motor can have more than just one pole pair per phase This defines the ratio between the electrical revolution and the mechanical revolution The BLDC motor shown has three pole pairs per phase which represent three electrical revolutions per one mechanical revolution VOLTAGE PHASE A PHASE B PHASE C ELECTRICAL ANGLE 30 90 150 210 270 330 F
26. Motorola 2002 Motion Control Development Tools found on the World Wide Web at http e www motorola com Motorola Embedded Motion Control MC68HC908MR32 Control Board User s Manual document order number MEMCMR32CBUM D Motorola 2000 Motorola Embedded Motion Control 3 Phase AC BLDC High Voltage Power Stage User s Manual document order number MEMC3PBLDCPSUM D Motorola 2000 Motorola Embedded Motion Control Optoisolation Board document order number MEMCOBUM D Motorola 2000 Motorola Embedded Motion Control Evaluation Motor Board User s Manual document order number MEMCEVMBUM D Motorola 2000 Motorola Embedded Motion Control 3 Phase BLDC Low Voltage Power Stage User s Manual document order number MEMC3PBLDCLVUM D Motorola 2000 Sensorless BLDC Motor Control MC68HC908MR32 54 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D References 8 Users Manual for PC Master Software Motorola 2000 found on the World Wide Web at http e www motorola com 9 68HC908MR32 6BHC908MR16 Advance Information document order number MC68HC908MR32 D Motorola 10 Low Cost High Efficiency Sensorless Drive for Brushless DC Motor using MC68HC 7 05MC4 document order number AN1627 Motorola Sensorless BLDC Motor Control on MC68HC908MR32 MOTOROLA Software Description 55 For More Information On This Product Go to www freescale c
27. NO APPLY VOLTAGE CURRENT CONTROL LOOP YES IF STOP OR FAULT CONDITION STOP MOTOR FAULT STATE EXIT RUNNING STATE STOP MOTOR Stop_F Flag or Failure WAIT UNTIL FAULT CLEAR NO y APPLICATION INITIALIZATION CURRENT OFFSET CALIBRATION SYSTEM REGISTERS INITIALIZATION PWM INITIALIZATION TIMER 1 CURRENT SENSING TO PWM STARTING ACQUISITION STATE PWM INCREMENT OF SYNCHRONIZATION STARTINCROUTREGSS ADC MEASUREMENT INIT SET SPEED REGULATOR INTEGRAL PORTION ACCORDING TO CUR RENT REGULATOR ra FIRST COMMUTATION STEP STAND BY SECOND COMMUTATION STEP STATE ACQUISITION STATE MOTOR Y COMMUTATION LOOP CHECKSTART STOP SWITCH IF LCNTR FOKSUCCESSIVE FPCMASTER S W MODE CORRECT COMMUTATIONS CHECK STARTCTRL FLAG EXIT STARTING AQ STATE F RUN CONDITIONS F STOP OR FAULT CONDITION SET STOP FFLAG STOP MOTOR EXIT RUNNING STATE YE NO DC Bus over voltage RUNNING YES SETTIMER PERIOD FOR SPEED REGULATOR VIRTUAL TIMER3 SETFAILURE B VOLTAGEFAILURE MOTOR COMMUTATION CONTROL LOOP MOTOR SPEED CONTROL LOOP IF STOP OR FAULT CONDITION STOP MOTOR EXIT RUNNING STATE Stop_F Flag or Failure YES Figure 26 Main Software Flowchart Main Software Loop Sensorless BLDC Motor Control MC68HC908MH32 38 Software D
28. S RUNNING MOTOR IS STARTING AT STEADY STATE CONDITION WITH REGULAR BACK EMF FEEDBACK STATOR ROTOR MAGNETIC FIELD CREATED BY PM ALIGNMENT STATE The rotor position is stabilized by applying PWM signals to only two Pd wW b motor phases BORDER OF STATOR POLE b ROTOR MOVEMENT 17 DIRECTION OF STARTING BACK EMF ACQUISITION COMMUTATION The two fast faster then the rotor can move commutations are applied to create an angular difference of the stator magnetic field and rotor magnetic field PHASE CURRENT ZERO CROSSING PHASE WINDING EDGE INDICATOR The back EMF feedback is tested When the back EMF zero crossing is recognized the time of new commutation is evaluated Until at least two successive back EMF zero crossings are received the exact commutation time can not be calculated Therefore the commutation a is done in advance in order to assure that successive back EMF zero crossing events would not be missed RUNNING After several back EMF zero crossing events the exact commutation time is calculated The commutation process is adjusted Motor is running with regular back EMF feedback Figure 19 Vectors of Magnetic Fields Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Figure 20 demonstrates the back EMF during the start up
29. TOROLA Software Description 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Table 4 Software Variables Continued Name Type Representing Range Description Volt VOLT RANGE MAX U8 VOLT RANGE MAX dc bus voltage V TASC2 U8 Back EMF zero crossing expecting edge V MUX 08 Preset value of back EMF zero crossing phase multiplexer Process Measurement Start Stop Switch Reading and Start Stop Decision Type S8 signed 8 bit U8 unsigned 8 bit S16 signed 16bit U16 unsigned 16bit union 16 bits access or 2 8bit access The system registers Sys1 flags are described by definitions of Sys3_Def typedef union struct unsigned int PC_F 1 BITO Phase Commutation Flag unsigned int Off_F x de BIT1 Offset timeout flag Offset timeout can be measured unsigned int ICR_F 1 BIT2 Input Capture was succesfuly Received Flag unsigned int Rmp_F 1 BIT3 Speed Ramp Flag motor ramping unsigned int Stop_F 1 BIT4 Motor is going or is stopped unsigned int Strt F 1 BIT5 Start Phase Flag unsigned int Run F i 214 BIT6 Motor Running with back EMF feedback Flag unsigned int FOK F 4 21 BIT7 Feedback within the righ time Flag B FOK F Run F Strt F Stop F Rmp F PC F char R Sys1 Def System register 1 Definition
30. The amplitude of the back EMF varies according to the rotor speed During the starting back EMF acquisition state the commutation is done in advance In the running state the commutation is done at the right moments PHASE BACK EMFS BACK EMF ZERO CROSSINGS EB d 4 i t 4 f REAL COMMUTATION PATTERN WHEN POSITION IS ESTIMATED FIRST SECOND THIRD __ mti STARTING BACK EMF ACQUISITION ii Figure 20 Back EMF at Start Up Sensorless BLDC Motor Control MC68HC908MH32 24 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Control Technique Figure 21 illustrates the sequence of the commutations during the starting back EMF acquisition state The commutation times T2 1 and T2 2 are calculated without any influence of back EMF feedback The commutation time calculations are explained in the following section T Cmt 1 T cmt 2 T 3 T2 1 T2 2 T2 n 1 2 n 3 Y 2 Per zCrosFlt n 1 2 Per_CmtStart 4 k eau COMMUTATION IS PRESET ZERO CROSSING DETECTION SIGNAL COMMUTATED AT PRESENT TIME NO BACK EMF FEEDBACK WAS RECEIVED CORRECTIVE CALCULATION 1 T ZCros 0 T2 n ZERO CROSSING DETECTION SIGNAL COMMUTED WHEN CORRECT BACK EMF FEEDBACK Per HlfCmt n B RECEIVED AND EVALUATED 6 gt T ZCros n T2 n Y ZERO CROSSING ZERO CROSSING 5 MISS
31. al and input output variables are located in the structure PlParamsScl S8 Curr The current controller works with a constant execution sampling period The period is timed by timer1 with the constant PER CS T1 US The processes commutation and zero crossing preset and set provides the BLDC commutation and zero crossing selection Here the BLDC commutation means generation of the six step commutation which creates the voltage system shown in Figure 2 The required BLDC motor voltage system and commutation is provided using the MC68HCO8MR32 PWM block The zero crossing selection means the selection of the required zero crossing phase as described in Indirect Back EMF Sensing and Back EMF Sensing Circuit The zero crossing selection is provided by the multiplexer setting As shown in Figure 23 the commutation and back EMF zero crossing selection process is split into two actions Preset commutation and zero crossing selection The preset means setting the buffered registers and RAM variables for commutation e Set commutation and zero crossing selection The setting means loading the registers with buffered variables The implementation is described in Implementation Notes BLDC Commutation and Zero Crossing Selection The main software flowchart incorporates the main routine entered from the reset and interrupt states The main routine includes initializing the MCU and the main loop The flowcharts are shown in Figure 25 Figure 26 an
32. ation Initialization Besides the main loop there are three interrupts timer 1 timer 2 and PWM reload interrupts They are described in Figure 27 Interrupt Timer 1 is periodically called with period PER CS 1 The interrupt function provides dc bus current measurement and virtual timer 3 service where timer 1 is providing the timer 3 time base When over current is discovered the OVC F flag is set Finally the ADC is set according to the Nxt Chnl variable to prepare speed potentiometer or temperature sensing This interrupt is provided by the TIMACh1 Int function Interrupt Timer 2 sets commutation actions If commutation is enabled CmtE F flag is set the following actions are done PWM commutation step e Synchronization of timer 1 for current measurement with PWM Phase commutated flag PC is set Actual time from timer counter register commutation time is recorded in T Cmt This interrupt is provided by the TIMACh3 Int function Interrupt PWM Reload provides back EMF zero crossing sensing The zero crossing input is sampled 2 or 3 times The back EMF state value is compared with expecting rising falling edge If the value corresponds with expecting edge the zero crossing get flag ICR F is set and the actual time from timer counter register zero crossing time is recorded in T ZCros This interrupt is provided by PWMMC_Int function in code isr c Sensorless BLDC Motor Control MC68HC908MR32
33. cording to the hardware board used Sensorless BLDC Motor Control on MC68HC908MHR32 14 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D System Concept System Concept Refer to Figure 14 for the application block diagram DC Bus Current amp DC Bus Voltage Sensing Power line 3 BEMF Voltage Zero Crossing Comparators DC Bus Voltage Zero MUX Current Crossing Command Temperature signal PWM Digital Digital A Outputs Generator with 20 Dead Time Crossing Zero Crossing Time moment Zero Crossing i iti Commutation Period Position iti Control Recognition Commutation Period START STOP Required Speed Speed PI SPEED Regulator Required Actual Alignment Current Current Current PI Regulator JU TTT TTT Alignment HCOSMR32 Figure 14 System Concept Sensorless BLDC Motor Control on MC68HC908MH32 MOTOROLA Software Description 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Control Technique 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 processed in order to commutate the energized phase pair and contro
34. d Figure 27 MCU Initialization is entered only after system reset It provides initialization of system registers ports and CPU clock The MCU Initialization is provided in MCUInit function After MCU Initialization the Application Initialization is executed as Applnit function which performs the following actions First the zero current offset of the dc bus current measurement path is calibrated This offset on the ADC input should be 1 65 V at zero current This is implemented in the hardware design in order to be able to measure negative and positive current values The status registers are initialized and PWM generator is started Also timer 1 is started at the right moment to be synchronized with the PWM Sensorless BLDC Motor Control MC68HC908MHR32 36 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description generator This way the current measurement is executed at the defined moment of the PWM signal MCU INITIALIZATION SYSTEM REGISTERS INITIALIZATION PORTS INITIALIZATION PLL CPU CLOCK INITIALIZATION PC MASTER SOFTWARE PORT INITIALIZATION APPLICATION INITIALIZATION CURRENT OFFSET CALIBRATION SYSTEM REGISTERS INITIALIZATION PWM INITIALIZATION TIMER 1 CURRENT SENSING TO PWM SYNCHRONIZATION ADC MEASUREMENT INITIALIZATION MAIN S W LOOP SEE HGURE 2
35. d is used for communication as described in User s Manual for PC Master Software Motorola 2000 found on the World Wide Web at http e www motorola com PC master software controls and senses the status of the application with PC master software BLDC demonstration suitcase communication commands master software BLDC demonstration suitcase communication bytes After reset the BLDC control MCU software is in manual mode In order to control the system from PC master software it is necessary to set PC master software mode and then to provide the MCU software control from PC master software via application interface variables Commands defined for the BLDC control MCU software are listed in Table 2 The commands are very simple If the software executes the command it responds with OK byte 00 If it is unable to execute the command it responds with failed code 55 The commands Set PC master software mode Set manual mode can only be executed when the START STOP switch on the demonstration suitcase is set to STOP and the motor is stopped Otherwise a failed response is sent Table 2 PC Master Software Communication Commands Command Data Code Bytes Demo Respons Suitcase Action Byte Response Command Description Set PC master software mode Setting of PC master 00 OK n IONS software mode 55 Failed 00 OK Set manual mode 02 None Setting of manual mode 55 Failed
36. da i ch2 Zoom 1 0X Vert 0 1 Hore Chi Bie 300 2004s 12 0 EV Figure 11 Balanced Capacity Coupling NOTE Theconfiguration of the phase windings end turns has significant impact therefore it needs to be properly managed to preserve the balance in the mutual capacity This is important especially for prototype motors that are usually hand wound Failing to maintain balance in the mutual capacitance can easily disqualify such a motor 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 also insignificant Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Back EMF Sensing An example of the possible implementation of the back EMF sensing circuit is Circuit shown in Figure 12 DC_BUS PHASEA PHASEB PHASE C 560k 560k 560k 5 Ssu 2 560k AAA A AVN 560k 560k A AA amp A A IN NAIVIN 7 1n RB gt 5 I Tin bel MUX ZERO e 4 CROSSING L DETECTION n ak 220 om p SEE Bo c MUX COMMAND Figure 12 Back EMF Sensing Circuit Diagram As expla
37. e states is described in the subsections following the figure RESET INITIALIZE APPLICATION STAND BY STATE PWM DISABLED RUN CONDITION START SWITCH IS ON AND PCMode 0 OR PCMode AND StartCtrl AND SWITCH IS ON Stop F 20 CLEAR FAILURE START SWITCH SET OFF OR PCMode AND CLEAR FAIL FAILURE 0 ALIGN STATE PWM ENABLED OVER CURRENT ni TIMEOUT EXPIRED FAULT STATE PWM DISABLED IRRECOVERABLE COMMUTATION ERROR BACK EMF ACQUISITION STATE COMMUTATION PWM ENABLED COMMUTATION IS LOCKED WITH BACK EMF FEEDBACK RUNNING STATE COMMUTATION PWM ENABLED OVER VOLTAGE STOP STATE PWM DISABLED MOTOR STOP IS REQUIRED Stop_F 1 DONE Figure 28 Application State Transitions Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 41 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Initialize MCU Initialize Application Stand By This state is entered after the MCU is reset and performs the following actions MCU ports are configured for the application Some application system variables are initialized e MCU clock PLL is locked Hardware boards used are identified and parameters initialized master communication software is initialized with SCI port ADC is initialized and the state is exited This state is used as an applicat
38. ed with a constant time period in the current measurement ISR but the over current condition is evaluated in the main software loop After a defined number 1 Cnt of successive over current events the control flow enters into the fault state The BLDC motor is run with regular feedback The speed controller is used to control the motor speed by changing the value of PWM duty cycle Figure 32 shows the state transitions Measurements Handler Explained in Back EMF Acquisition State Service of Commutation Explained in Back EMF Acquisition State Service of Received Back EMF Zero Crossing Explained in Back EMF Acquisition State The difference is that the commutation parameters are recalculated with different constants see Running Commutation Time Calculation BEMF Zero Crossing Interrupt Service Routine Explained in Back EMF Acquisition State Current Measurement Interrupt Service Routine Explained in Back EMF Acquisition State Error Handler Explained in Back EMF Acquisition State Over Current Explained in Back EMF Acquisition State Sensorless BLDC Motor Control MC68HC908MR32 48 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc oE MOTOR STOP IS REQUIRED AN2355 D Software Description TIME OUT PISIS SPEED CONTROL T3 F 21 CURRENT MEASUREMENT IS DONE MEASUREMENTS HANDLER DONE Palio CMD_F 1
39. ent range maximum A 10 2 A 10 2 S8 signed 8 bit U8 unsigned 8 bit S16 signed 16bit U16 unsigned 16bit The system registers Sys3 Motor_Ctrl Motor_Status Failure flags are described by definitions of Sys3_Def Motor_Ctrl_Def Motor_Status_Def Failure Def typedef union struct unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned B Alignment PCMode char R Sys3 Def int int int int int int int int HV 1 BITO High Voltage board Flag LV 1 Low Voltage board EVMm 1 BIT2 EVMm board BIT3 1 BIT3 RESERVED PCMode 1 BIT4 PCMaster manual mode Flag BITS 2 BIT5 RESERVED BIT6 1 BIT6 RESERVED Alignment 1 EVMm BIT7 Alignment state Proceeding V HV Sensorless BLDC Motor Control MC68HC908MR32 28 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Application Control System register 3 Definition typedef union struct unsigned int StartCtrl 1 Switch Start set to START Flag unsigned int 1 RESERVED unsigned int BIT2 1 BIT2 RESERVED unsigned int BIT3 1 5 RESERVED
40. er Speed MAX Range and zero crossing period Per_ZCrosFIt_T2 Actual speed rpm Speed Range RPM Per Speed MAX Range Per ZCrosFIt T2 The variable Commut Rev can be used for calculation of the BLDC motor commutation period Commutation Period s 60 Actual Speed rpm Commut Rev The variable Curr Range Max cA determines scaling of the current variables So the actual dc bus current is dc bus current A Curr 256 Curr Range Max cA 100 The hardware consists of the controller board accommodating MC68HC908MR32 power stage board and motor It is based on modular system boards as shown in Application note entitled Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor Motorola document order number AN2356 Dedicated board manuals they can be found on the Motorola web site at http motorola com semiconductors Sensorless BLDC Motor Control MC68HC908MR32 30 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description Software Description This section describes the design of the software blocks of the drive The software will be described in terms of Data Flow Main Software Flowchart State Diagram For more information on the control technique used see Control Technique The control algorithm obtains values from the user interface and sensors processes them and
41. escription MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Software Description When the start is successfully completed the Running function is called from main During the Running state the commutation time preset calculations are provided by the CmtPreset function and commutation time set calculations are provided by the CmtSet function During the Running Start or Alignment states the DecideStop function is called to check drive stop conditions and can set the Stop F flag When the stop flag is set the MotorStop function is called to stop the motor and running start or alignment state is left The software enters stand by state Also the commutation error Cntr Err MAX ZC ERR and over current OverCurrent flag 1 fault are checked in ERRHndl and OVCurrent functions during the Running Start or Alignment states If any error is detected the function MotorStop function is called Then the software enters Fault state through the Fault function This is only left when the failures are cleared variable Failure 0 This decision is provided DecideCleSto function called from ErrorStop In manual control the failures are cleared by setting the Start Stop switch to Stop In case of PC master software control the failures are cleared by the ClearFail flag from the software When the failures are cleared the software enters Applic
42. f no back EMF zero crossing was captured during preset commutation period T2P n then Corrective Calculation 1 is made T Z0ros H lt CmtT n 1 Per ZCros n T ZCros n T ZCros n 1 T ZCros n T ZCrosO Per ZCrosFlt n 1 2 Per ZCros n 1 2 Per ZCrosO0 HlfCmt n 1 2 Per ZCrosFlt n Advance angle Coef HlfCmt Per ZCrosFlt n The best commutation was get with Advance angle 60Deg 1 8 7 5Deg which means Coef HlfCmt 0 375 at Running state Per Toff n 1 Per ZCrosFlt Coef Toff and Per Dis minimum Per ZCrosO Per ZCros n T ZCrosO0 lt T ZCros n f back EMF zero crossing is missed then Corrective Calculation 2 is made T ZCros n CmtT n Toff n Per ZCros n T ZCros n T ZCros n 1 T ZCros n T ZCrosO Per ZCrosFlt n 1 2 T ZCros n 1 2 T ZCrosO0 HlfCmt n 1 2 Per ZCrosFlt n Advance angle Coef HlfCmt Per ZCrosFlt n The best commutation was get with Advance angle 60Deg 1 8 7 5Deg which means Coef HlfCmt 0 375 at Running state Per ZCrosO Per ZCros n T 2 0 lt T_ZCros n Where T Cmt time of the last commutation T2 Time of the Timer 2 event for Timer Setting T ZCros Time of the last zero crossing T ZCros0 Time of the previous zero crossing Per Toff Period of the zero crossing off Per ZCros Period between zero crossings estimates required commutation period Per 7 50 Pervious
43. g point Simple additional filtering helps to reduce ripples further Sensorless BLDC Motor Control MC68HC908MR32 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D BLDC Motor Control Single ja 2 80 5 rj Chi zoom 1 0 Vert 2 235 00 Vv 100 C Figure 8 Detail of Mutual Inductance Effect Effect of Mutual The negative effect of mutual inductance is not the only one to disturb the Phase Capacitance back EMF sensing So far the mutual capacitance of the motor phase windings was neglected in the motor model since it affects neither the phase currents nor the generated torque Usually the mutual capacitance is very small Its influence is only significant during PWM switching when the system experiences very high didt The effect of the mutual capacitance can be studied using the model shown in Figure 9 Uvc Cap Figure 9 Mutual Capacitance Model Sensorless BLDC Motor Control on MC68HC908MR32 MOTOROLA Software Description 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Let us focus on the situation when the motor phase A is switched from negative dc bus rail to positive and the phase B is switched from positive to negative This is described by these conditions Equation 8 Sap PWM 1 1 1 1 i Uya 5a gt jue
44. ibed in the following subsections Process Back EMF Back EMF zero crossing process provides Crossing zero crossing sampling in synchronization with PWM ensin 9 Evaluates the zero crossing Records its time in T ZCros Further explanation is provided in Data Flow and Figure 27 Sensorless BLDC Motor Control on MC68HC908MR32 MOTOROLA Software Description 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D TIMER 2 BACK EMF ACTUAL TIME ZERO CROSSING INPUT Sp_Input Speed_Min_U8 Coef Speed Inp PROCESS DESIRED SPEED SETTING V TASC2 CORRECTIVE CALCULATION 1 OF COMMUTATION PARAMTERS CORRECTIVE CALCULATION 2 OF COMMUTATION PARAMETERS ACCELERATION PROCESS BACK EMF ZERO CROSSING SENSING 2 when regular eedback can not beused T ZCros COMMUTATION HAS BEEN PERFORMED FLAG Erde PC Speed Desired 5 08 Speed PROCESS COMUTATION TIMES CALCULATION NN TIMER 2 Per Speed MAX Range Per ZCrosFIt PROCESS PRESET COMMUTATION AND ZERO CROSSING PROCESS SPEED CONTROL PWM MODULE VIRTUAL TIMER 3 V TASC2 TIMER2 TIMEOUT PROCESS ACTUAL TIME SET COMMUTATION AND PROCESS ALIGNMENT CONTROL ZERO CROSSING SELECTION TIMER1 INIT Cur
45. igure 2 3 Phase Voltage System The easy to create rectangular shape of applied voltage ensures the simplicity of control and drive But the rotor position must be known at certain angles in order to align the applied voltage with the back EMF voltage induced due to movement of the PM The alignment between back EMF and commutation events is very important In this condition the motor behaves as a dc motor and Sensorless BLDC Motor Control MC68HC908MR32 2 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D BLDC Motor Control runs at the best working point Thus simplicity of control and good performance make this motor a natural choice for low cost and high efficiency applications Figure 3 shows a number of waveforms Magnetic flux linkage Phase back EMF voltage Phase to phase back EMF voltage Magnetic flux linkage can be measured However in this case it was calculated by integrating the phase back EMF voltage which was measured on the non fed motor terminals of the BLDC motor As can be seen the shape of the back EMF is approximately trapezoidal and the amplitude is a function of the actual speed During speed reversal the amplitude changes its sign and the Phase Magnetic Flux Linkage Phase Back EMF Phase Phase Back EMF phase sequence changes L Y Chott
46. ined in the theoretical part of this application note the phase zero crossing event can be detected at the moment when the branch voltage of a free phase crosses the half dc bus voltage level The resistor network is used to step down sensed voltages down to a 0 15 V voltage level The comparators sense the zero voltage difference in the input signal The multiple resistors reduce the voltage across each resistor component to an acceptable level A simple RC filter prevents the comparators from being disturbed by high voltage spikes produced by IGBT switching The multiplexer MUX selects the phase comparator output which corresponds to the current commutation stage This zero crossing detection signal is transferred to the timer input pin Sensorless BLDC Motor Control on MC68HC908MHR32 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Application Specification The comparator control and zero crossing signals plus the voltage waveforms are shown in Figure 13 Phase Selection Te AEH 12 ks s p cm MUX Command CEU PPUPSRT PR F be ro mda 4 boi EN Phase Comparator Output i Zero crossing edge 341 ee ee a ee ee he Branch Voltage Interval of phase Back EMF zero crossing detection Reference Level Commutation Signal Zero Cro
47. ion The current controller keeps current within predefined limits This state is necessary in order to create a high start up torque When the preset time out expires then this state is finished The current controller subroutine with PI regulator is called to control dc bus current It sets the correct PWM ratio for the required current The current PI controller works with constant execution sampling period This period should be a multiple of the PWM period in order to synchronize the current measurement with PWM Current controller period n PWM frequency Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Running The BLDC motor rotor position with flux vectors during alignment is shown in Figure 16 Alignment flux vector Phase B Starting flux vector Figure 16 Alignment The commutation process is a series of states which assure back EMF zero crossing is successfully captured The new commutation time is calculated The commutation is performed The following processes need to be provided e BLDC motor commutation service Back EMF zero crossing moment capture service Calculation of commutation time Interactions between these commutation processes From diagrams an overview of how the commutation works can be understood After commuting the m
48. ion reset called following a return from fault or stop states In this state the following actions are done Current measurement path calibrated and checked for error Some application system variables initialized e Some MCU peripherals are configured timer OC function PWM e PWM outputs for motor control are turned OFF e Timer 1 Tim Ch1 is synchronized with the PWM cycle e Speed input dc bus voltage and temperature measurement is initialized e Ready LED is turned ON and the state is exited State diagram for this software is shown in Figure 29 Current measurement and current calibration when PWM is OFF Before testing of the start switch dc bus current is measured when PWM is OFF This way the dc bus current measurement path is calibrated The calibrated value OffsetO Curr is used for the final current calculation This offset on the ADC input should ideally be 1 65 V at 0 dc bus current If the sensed value exceeds the limit Offset Max Curr when PWM is OFF this indicates some hardware error and the control flow enters into the fault state Start condition test The start condition is tested If in manual mode PCMode 0 the start condition is a movement in the switch from stop to start In PC master software mode PCMode 1 the start condition in switch start position and StartCtrl 1 If start condition valid then Strt_F is set Stop F is cleared and the next state entered Sensorless BLDC Motor Control
49. is provided by the TIMACh1 Int function Sensorless BLDC Motor Control on MC68HC908MR32 MOTOROLA Software Description 53 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Timer 2 Timer 2 is provided by timer A channel 3 set in output compare mode In this mode the registers TACH3H and TACH3L are used for setting the output compare value T2 References TACNTH and TACNTL form a 16 bit timer A counter with infinite counting 16 bit roll over The actual time is sensed from TACNTH and TACNTL base e g time of the commutation T Cmt The timer A channel 3 timer 2 interrupt is called whenever TACH3H TACNTH and TACNTL So the registers and are loaded with the T2 variable value The value T2 e g T2 T Cmt Per HlfCmt is calculated using a 16 bit addition with no saturation So the time duration up to 65 536 UNIT PERIOD T2 US from actual time TACNTH TACNTL can be timed at any TACNTH TACNTL timer A counter value The timer unit UNIT PERIOD T2 US of timer A is determined by the MCU bus frequency 8 MHz with 4 MHz oscillator and default software setting and timer prescaler set in TASC So the default software value is 2 us The timer 2 interrupt function is provided by function TIMACh3 Sensorless BLDC Motor Control on MC68HC908MR32 Software Porting to Customer Motor document order number AN2356 D
50. l the phase voltage using pulse width modulation The back EMF zero crossing detection enables position recognition The resistor network is used to step down the sensed voltages to a 0 3 3 V voltage level In order to filter high voltage spikes produced by the switching of the IGBTs MOSFETs zero crossing detection is synchronized with the middle of a central aligned PWM signal by the software The software selects by MUX command the phase comparator output that corresponds to the current commutation step The MUX circuit selects this signal which is transferred to the MCU Input The voltage drop resistor is used to measure the dc bus current which is chopped by the PWM The signal obtained is rectified and 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 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 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
51. lure unsigned int ErrCmt 1 BIT7 error Commutation B ErrCmt VoltageFailure OverHeating OverCurrent char R Failure Def Failure Flags register Definition Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Hardware Description Table 3 declares if the variable is used as an output or input from the BLDC control MCU software side The variable is described and the unit defined When PC master software mode is set the system start and stop is controlled by StartCtrl flag in Motor Ctrl variable When the application enters the fault state the variable Failure displays the fault reason Setting the ClearFail flag Motor Ctrl will exit the fault state The Sp_Input variable is used for speed control In PC master software mode it can be modified from PC master software otherwise it is set according to speed potentiometer value Desired speed rpm Sp_Input 255 Speed_Max_RPM Speed_Min_RPM Speed_Min_RPM So the required motor commutation period is determined by the Speed_Max_RPM and Speed_Min_RPM variables These are chosen according to which optional board and motor set by the BLDC control MCU software The variable Speed_Range_Max_RPM determines scaling of the speed variables The actual speed of the motor can be calculated from P
52. ng causes the PWM pulses to be superimposed onto the detected back EMF voltage In fact it is produced by the high rate of change of phase current transferred to the free phase through the coupling of the mutual inductance Figure 7 shows the real measured branch voltage The red curves highlight the effect of the difference in the mutual inductances This difference is not constant Figure 7 Mutual Inductance Effect Due to the construction of the BLDC motor both mutual inductances vary They are equal at the position that corresponds to the back EMF zero crossing detection The branch waveform detail is shown in Figure 8 Channel 1 in Figure 8 shows the disturbed branch voltage The superimposed ripples clearly match the width of the PWM pulses and thus prove the conclusions from the theoretical analysis The effect of the mutual inductance corresponds well in observations carried out on the five different BLDC motors These observations were made during the development of the sensorless technique 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 wounded on separate poles shows minor presence of the effect of mutual inductance However noticeable this effect it does not degrade the back EMF zero crossing detection because it is cancelled at the zero crossin
53. ol PWM s are disabled and control enters the fault state where it remains until RESET or clear failure start switch set OFF or PCMode amp ClearFail The fault state is indicated by the Red LED diode blinking Clear Failure Test The failure Failure 0 is tested In manual mode PCMode 0 the switch in the stop position clears the failure In PC master software mode PCMode 1 the failure is cleared by ClearFail flag or the switch in the stop position If start condition is valid Strt F is set Stop F is cleared and the next state entered See Figure 34 TIM A CH1 INTERRUPT MOTOR IS STOPPED PWM IS OFF WAIT FOR DONE CLEAR FAILURE CURRENT MEASUREMENT IS DONE CMD F 1 M e CURRENT MEASUREMENT ISR OR RESET C CLEAR FAILURE TEST ERROR INDICATION RED LED IS BLINKING CLEAR FAILURE START SWITCH SET OFF OR PCMODE amp CLEARFAIL FAILURE 0 OR RESET Figure 34 Fault State Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 51 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Implementation Notes Software Files BLDC Commutation and Zero Crossing Selection Preset BLDC Commutation and BEMF Zero Crossing Selection Set BLDC Commutation and BEMF Zero Crossing Selection The software files and structure are described in an application note entited Sensorless BLDC Motor
54. om Freescale Semiconductor Inc AN2355 D HOW TO REACH US USA EUROPE LOCATIONS NOT LISTED Motorola Literature Distribution P O Box 5405 Denver Colorado 80217 1 303 675 2140 or 1 800 441 2447 JAPAN Motorola Japan Ltd SPS Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 3569 ASIA PACIFIC Motorola Semiconductors H K Ltd Silicon Harbour Centre 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 TECHNICAL INFORMATION CENTER 1 800 521 6274 HOME PAGE http motorola com semiconductors Information in this document is provided solely to enable system and software implementers to use Motorola 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 Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola 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 Motorola data sheets and or specifications can and do vary in different application
55. ortionally to the PWM modulus register PMOD MCPWM MODULUS constant 10096 duty cycle is when PVALx PMOD The PWM Val Max variable is Val DUTY MAX MCPWM MODULUS This variable is used for scaling of the regulator output OutReg 08 The registers PVAL1H PVAL1L through PVAL6H PVAL6L are loaded with Val calculated from OutReg 08 PWM Val Val Max OutReg U8 256 This calculation is provided with macro umul 16x8 macro Timer 1 and timer 2 are implemented using MC68HCO8MR3z2 timers Timer is a software virtual timer using time base of timer 1 Timer 1 is provided by timer A channel 1 set in output compare mode In this mode the registers TACH1H and TACH1L are used for setting the output compare value T1 TACNTH and TACNTL form a 16 bit timer A counter with an infinite counting 16 bit roll over The timer A channel 1 interrupt is called whenever TACH1H and TACH1L TACNTL With each interrupt the registers TACH1H and are loaded with the new value T1 1 _ CS 1 where T1 PER CS 1 is a 16 bit addition with no saturation So the constant interrupt period PER CS 1 of the timer T1 interrupts is generated The timer unit UNIT PERIOD T1 US of timer A is determined by the MCU bus frequency 8 MHz with a 4 MHz oscillator and default software setting and timer prescaler set in TASC So the default software value is 2 us The timer 1 interrupt function
56. otor phases there is a time interval Per Toff n when the shape of back EMF must stabilized after the commutation the fly back diodes are conducting the decaying phase current therefore sensing of the back EMF is not possible Then the new commutation time T2 n is preset The new commutation will be performed at this time if the back EMF zero crossing is not captured If the back EMF zero crossing is captured before the preset commutation time expires then the exact calculation of the commutation time T2 n is made based on the captured zero crossing time T ZCros n The new commutation is performed at this new time Sensorless BLDC Motor Control on MC68HC908MR32 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Control Technique If for any reason the back EMF feedback is lost within one commutation period corrective actions are taken in order to return to the regular states The flowchart explaining the principle of BLDC commutation control with back EMF zero crossing sensing is shown in Figure 17 COMMUTATION DONE lt BEMF ZERO CROSSING DETECTED BETWEEN PREVIOUS COMMUTATIONS YES SERVICE OF COMMUTATION PRESET COMMUTATION NO CORRECTIVE CALCULATION 1 WAIT FOR PER TOFF UNTIL PHASE CURRENT DECAYS TO ZERO BEMF ZERO CROSSING MISSED CORR
57. pezoidal BLDC motor control star or delta connected Sensorless with back EMF zero crossing commutation control Speed closed loop control Motoring mode Target Processor MC68HC908MR32 Software Language C language with some arithmetical functions in assembler Application Control Manual interface start stop switch speed potentiometer control LED indication PC master software remote interface via RS232 using PC computer Targeted Hardware Software is prepared to run on three optional board and motor hardware sets 1 High voltage hardware set at variable line voltage 115 230 Vac software customizing file const_cust_hv h 2 Low voltage evaluation motor hardware set software customizing file const_cust_evmm h 3 Low voltage hardware set software customizing file const cust lv h Software Configuration and Parameter Settings Configuration to one of the three required hardware is provided by an include of the dedicated software customizing file the software pack contains the files const cust hv h const cust lv h const cust evm h with predefined parameter settings for running on one of the optional board and motor hardware sets The required hardware needs to be selected in code fun c file by one of these files include When software is configured for a different customer motor the software configuration for any motor is provided in the dedicated customizing file ac
58. r_Align BACK EMF PlParamsScl S8 Curr ZERO CROSSING MULTIPLEXER Figure 23 Main Data Flow Part 2 Alignment Starting Running Control Sensorless BLDC Motor Control on MC68HC908MH32 34 Software Description MOTOROLA For More Information On This Product Go to www freescale com Process Commutation Time Calculation Corrective Calculation 1 Corrective Calculation 2 Process Desired Speed Setting Processs Speed Control Freescale Semiconductor Inc AN2355 D Software Description These processes provide calculations of commutation time intervals periods Per_ZCros Per_ZCrosFIt from captured time T_Cmt T_ZCros T_ZCros0 and sets Timer 2 with variable T2 These calculations are described in Starting Commutation Time Calculation and Running Commutation Time Calculation The desired speed held in register Speed_ Desired is calculated from the following formula Speed Desired Sp Input Coef Speed Inp 255 Speed_Min_U8 The general principle of the speed PI control loop is illustrated in Figure 24 REFERENCE PWM SPEED SPEED DUTY CYCLE Speed Desired ERROR PI OutReg 08 CONTROLLED ___ gt CONTROLLER SYSTEM ACTUAL MOTOR SPEED 256 Per Speed MAX Range Per ZCrosFIt T2 Figure 24 Closed Loop Control System The speed closed loop control is characterized by the feedback of the actual motor speed The actual motor speed is calculated f
59. ro crossing selection preset is provided in this function by setting V MUX variable according to P Step Cmt value The commutation set is provided in timer 2 interrupt function TIMACh3 Int in the code isr c file The PWMEN is toggled and LDOK bit set in order to immediately restart the PWM generator and reload the PWM with the buffered PVAL1H PVAL1L through PVAL6H PVALE6L registers Then the back EMF zero crossing selection set is provided by setting PORTF according to V MUX variable Sensorless BLDC Motor Control MC68HC908MR32 52 Software Description MOTOROLA For More Information On This Product Go to www freescale com BLDC Speed Control and Calculation Desired Speed Calculation PWM Duty Cycle Timers Timer 1 Freescale Semiconductor Inc AN2355 D Implementation Notes Desired speed calculation and PWM duty cycle setting is quite simple but there are some C language syntax tricks Also the scaling aspect needs to be taken into consideration The 8 bit value Speed_Desired is calculated using 8 bit multiplication of two 8 bit variables Sp Input and Coef Speed Inp The syntax is unsigned char Sp_Input Coef_Speed_Inp gt gt 8 This syntax is used to generate optimal code using the MUL instruction PWM duty cycle is set for all six PWM channels according to regulators output OutReg_U8 The maximal duty cycle is at OutReg_U8 255 The registers PVAL1H PVAL1L through PVAL6H PVALGL are set prop
60. rom zero crossing period Actual motor speed 256 Per Speed MAX Range Per ZCrosFIt T2 This information is compared with the reference set point and the error signal is generated The magnitude and polarity of the error signal corresponds to the difference between the actual and desired speeds Based on the speed error the PI controller generates the corrected motor voltage in order to compensate for the error The speed regulator parameters gain internal and input output variables are located in the structure PlParamsScl U8 Speed The speed controller works with a constant execution sampling period The period is timed by timer 3 with the constant PER T3 RUN US PWM duty cycle is set for all six PWM channels according to regulator output OutReg_U8 The maximum duty cycle is at OutReg_U8 255 The implementation is described in Implementation Notes BLDC Speed Control and Calculation Sensorless BLDC Motor Control MC68HC908MR32 MOTOROLA Software Description 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Process Alignment Control Processes Commutation and Zero Crossing Preset and Set Main Software Flowchart The process alignment control controls the current Curr using the PI regulator during alignment state see State Diagram The dc bus current is regulated to required value Curr_Align The current regulator parameters gain intern
61. s and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Motorola does not convey any license under its patent rights nor the rights of others Motorola 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 Motorola product could create a situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola 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 Motorola was negligent regarding the design or manufacture of the part MOTOROLA Motorola and the Stylized M Logo are registered in the U S Patent and Trademark Office digital dna is a trademark of Motorola Inc All other product or service names are the property of their respective owners Motorola Inc is an Equal Opportunity Affirmative Action Employer Motorola Inc 2002 AN2355 D Rev 0
62. sition sensed information must be transferred to a control unit see Figure 4 Therefore additional connections to the motor are necessary This may not be acceptable for some applications There are at least two reasons why you might want to eliminate the position sensors Inability to make additional connections between position sensors and the control unit e Cost of the position sensors and wiring 7 9 POSITION AC LINE VOLTAGE B POWER STAGE 3 M SENSORS LOAD CONTROL SIGNALS SPEED POSITION FEEDBACK SETTING CONTROL UNIT MOTOR DRIVE Figure 4 Classical System Sensorless BLDC Motor Control MC68HC908MR32 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D BLDC Motor Control Power Stage In order to explain and simulate the idea of back EMF sensing techniques a Motor System Model simplified mathematical model based on the basic circuit topology has been created See Figure 5 Una Figure 5 Power Stage Motor Topology The second goal of the model is to find how the motor characteristics depend on the switching angle The switching angle is the angular difference between areal 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 normal 3 phase po
63. ssing Signal Figure 13 The Zero Crossing Detection Application Specification The concept of the application is that of a speed closed loop drive using back EMF zero crossing technique for position detection The system for BLDC motor control consists of hardware and software The application uses universal Modular Motion Control Development Hardware boards povided by Motorola for customer development support For hardware board descriptions refer to References 3 4 5 6 and 7 There are three board and motor hardware sets for the application e High voltage hardware set for variable line voltage 115 230 Vac and medium power phase current 2 93A e Low voltage evaluation motor hardware set for automotive voltage 12 V and very low power phase current 4A e Low voltage hardware set for automotive voltage 12 V or possibly 42 V and medium power phase current 50A Sensorless BLDC Motor Control MC68HC908MHR32 MOTOROLA Software Description 13 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D The application software is practically the same for all three hardware platforms needing only to be modified to include one of three constant customizing files containing hardware and motor parameter settings The application specifications are listed in Table 1 Table 1 Application Specifications Control Algorithm 3 phase tra
64. t Detection The dc bus current is periodically sensed and the over current condition is evaluated After a defined number successive over current events CNTR the control flow enters into the fault state The back EMF acquisition state provides the functionality described in Starting Back EMF Acquisition and Starting Commutation Time Calculation Figure 31 shows the state transitions for the state First Commutation After the align state time out expires voltage is applied to another phase pair The first commutation is made and the PWM duty cycle is constant This value has been defined by the current controller during the Aalign state The calculation of the commutation time is explained in Starting Commutation Time Calculation Second Commutation The commutation time T2 is calculated from the previous commutation time and the start commutation period Per CmtStart This time is set to timer 2 Then the new PWM multiplexer logic data is readied for when the commutation interrupt performs the next commutation The calculation of the commutation time is explained in Starting Commutation Time Calculation Measurements Handler As explained in Scheduler and Over Current Detection the dc bus current is scanned and over current condition is evaluated Where there is an over current the control enters the fault state see Fault State The voltage and the speed commands are scanned too When this state is finished the
65. tches in the diagonal are controlled using the same signal so called hard switching PWM technique The motor phases A and B are powered and phase C is free having no current So the phase C can be used to sense the back EMF voltage This is described by the following conditions SA Sg PWM 221 Uva 20 Uyg 5 Ua is lgy 1 dig dig di ij 0 dig 0 Equation 2 UpackEMF a UbackEMF b UbackEMF c 9 The branch voltage uy can be calculated using the above conditions 1 di Ug 3 gt UbackEMF x Lac m Equation 3 After evaluation the expression of the branch voltage uy is as follows 3 1 di 2 z Lac m Lim Equation 4 Sensorless BLDC Motor Control MC68HC908MR32 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D BLDC Motor Control The same expressions can also be found for phase A and B 3 1 di 2 UbackEMF a 5 bos Leet Equation 5 3 1 di 5UbackEMF b 5 Le La Equation 6 The first member in the equation Equation 6 demonstrates the possibility to indirectly sense the back EMF between the free not powered phase terminal and the zero point defined at half of the dc bus voltage see Figure 5 Simple comparison of these two levels can provide the required zero crossing detection As shown in
66. value of PWM duty cycle is used as the one which has stabilized the dc bus current during the align state The second condition is more difficult to fulfill without any position feedback information After the alignment state the stator and the rotor magnetic fields are aligned 0 angle Therefore two fast commutations faster than the rotor can follow must be applied to create an angular difference in the magnetic fields see Figure 19 The commutation time is defined by the start commutation period Per CmtStart This allows starting the motor such that minimal speed defined by state when back EMF can be sensed and is achieved during several commutations while producing the required torque Until the back EMF feedback is locked the commutation process explained in Running assures that commutations are done in advance so that successive back EMF zero crossing events are not missed After several successive back EMF zero crossings e Exact commutation time can be calculated e Commutation process is adjusted Control flow continues to the Running state The BLDC motor is then running with regular feedback and the speed controller can be used to control the motor speed by changing the PWM duty cycle value Sensorless BLDC Motor Control on MC68HC908MHR32 22 Software Description MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Control Technique MOTOR I
67. wer stage plus a brushless dc motor Power for the system is provided by a voltage source Six semiconductor switches yp controlled elsewhere allow the rectangular voltage waveforms see Figure 2 to be applied The semiconductor switches and diodes are simulated as ideal devices The natural voltage level of the whole model is put at one half of the dc bus voltage This simplifies the mathematical expressions Sensorless BLDC Motor Control MC68HC908MH32 MOTOROLA Software Description 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc AN2355 D Stator Winding Equations Indirect Back EMF Sensing The BLDC motor is usually very symmetrical All phase resistances phase and mutual inductances flux linkages can be thought of as equal to or as a function of the position with a 120 displacement The electrical BLDC motor model then consists of a set of the following stator voltage equations Equation 1 Usa 154 Ysa f Equation 1 Use Yso The task of this section is to explain the background of the back EMF sensing and to demonstrate how the zero crossing events can be detected Parasitic effects that negatively influence the back EMF detection are discussed and their nature analyzed Let us assume a usual situation where the BLDC motor is driven in six step commutation mode using PWM technique where both top and bottom swi

Download Pdf Manuals

image

Related Search

Related Contents

DECOR 902/LEEDS  Aastra 480i User Manual  EVBUM2249 - AD984X Timing Generator Board User's Manual  Dell Command    Woodstock W1752 User's Manual  社内報みち H26.5  Mode d`emploi - Comité départemental de Rugby de la Gironde  Manual de instrucciones  Server Sun Enterprise 220R Manuale dell`utente  

Copyright © All rights reserved.
Failed to retrieve file