NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
AN2355/D MC68HC908MR32 AN2356/D RS232 HC08MR32 AN2356 MC68HC08MR32 68HC908MR32 - Datasheet Archive
Application Note AN2355/D 11/2002 Freescale Semiconductor, Inc. Sensorless BLDC Motor Control on MC68HC908MR32 Software
Freescale Semiconductor, Inc. Application Note AN2355/D AN2355/D 11/2002 Freescale Semiconductor, Inc. Sensorless BLDC Motor Control on MC68HC908MR32 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 MC68HC908MR32 microcontroller unit (MCU). This system can 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 MC68HC908MR32 - Software Porting to Customer Motor (Motorola document order number AN2356/D 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 Motor Control BLDC Motor Targeted by This Application The brushless dc motor (BLDC motor) is also referred to as an electronically commutated motor. There are no brushes on the rotor, and commutation is 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 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) Freescale Semiconductor, Inc. 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 VOLTAGE 120° 120° Phase A PHASE A Phase B PHASE B Phase C PHASE C 30° 30° 90° 90° 150° 150° 210° 210° 270° 270° 330° 330° ELECTRICAL electrical ANGLE angle Figure 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 on MC68HC908MR32 MC68HC908MR32 2 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D 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 · Freescale Semiconductor, Inc. · 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 sequence changes. Phase Magnetic Flux Linkage Psi_A Psi_B Psi_C PH. A PH. B Phase Back EMF PH. C Ui_A PH. A Ui_B PH. B Atop Btop Ctop Cbot Abot PH. C SPEED REVERSAL Speed reversal Ui_C "NATURAL" COMMUTATION POINT "Natural" commutation point Bbot ACTING POWER SWITCH IN THE POWER STAGE Phase-Phase Back EMF Ui_AB Ui_BC Ui_CA AB BC CA Figure 3. BLDC Motor Back EMF and Magnetic Flux Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 3 Freescale Semiconductor, Inc. AN2355/D AN2355/D Freescale Semiconductor, Inc. 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. 3-Phase BLDC Power Stage 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. Why Sensorless Control? 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 position, 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 · Cost of the position sensors and wiring AC LINE VOLTAGE = M POWER STAGE POSITION SENSORS LOAD CONTROL SIGNALS SPEED SETTING POSITION FEEDBACK CONTROL UNIT MOTOR DRIVE Figure 4. Classical System Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 4 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D AN2355/D BLDC Motor Control Power Stage - Motor System Model In order to explain and simulate the idea of back-EMF sensing techniques a simplified mathematical model based on the basic circuit topology has been created. See Figure 5. Id0 + ud/2 = SAt S Bt SCt + Freescale Semiconductor, Inc. ud/2 = SAb ISa ISb S Bb ISc SCb - u VA u AB u BC u VB uVC uCA B uRb u Sb u0 uLb ubackEMF b O ubackEMF c uSa u uLa backEMF a A uRa uLc uSc uRc C 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 a real switching event and an ideal one (at the point where the phase-to-phase back-EMF crosses zero). The motor-drive model consists of a normal 3-phase power stage plus a brushless dc motor. Power for the system is provided by a voltage source (Ud). Six semiconductor switches (SA/B/C t/b), 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 on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 5 Freescale Semiconductor, Inc. AN2355/D AN2355/D Stator Winding Equations 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. i Sa Sa d = R S i Sb + d t Sb i Sc Sc u Sa u Sb Freescale Semiconductor, Inc. u Sc Equation 1 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. Indirect Back EMF Sensing 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 switches 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: S Ab, S Bt PWM 1 -1 u VA = + - u d, u VB = ± - u d 2 2 i Sa = i Sb = i, di Sa = di Sb = di Equation 2 i Sc = 0, di Sc = 0 u backEMF a + u backEMF b + u backEMF c = 0 The branch voltage uVc can be calculated using the above conditions, c u VC 1 = u Sc -3 u backEMF x di + ( L ac L bc ) - u VC dt Equation 3 x=a After evaluation the expression of the branch voltage uVc is as follows: di 3 1 u VC = - u backEMF c - ( L ac L bc ) -dt 2 2 Equation 4 Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 6 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D AN2355/D BLDC Motor Control The same expressions can also be found for phase A and B: di 3 1 u VA = - u backEMF a - ( L ba L ca ) -dt 2 2 Equation 5 di 3 1 u VB = - u backEMF b - ( L cb L ab ) -dt 2 2 Equation 6 Freescale Semiconductor, Inc. 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 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 Lcb = Lab, this general expressions can also be found: 3 u Vx = - u backEMFx where x = A ,B ,C 2 Equation 7 There are two necessary conditions which must be met: · Top and bottom switches (in diagonal) have to be driven with the same PWM signal · No 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 0360° 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. 0 30 60 90 120 150 180 210 240 270 300 330 360 390 uVA uSa - Back-EMF can 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 on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 7 Freescale Semiconductor, Inc. AN2355/D AN2355/D Effect of Mutual Inductance 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 sensing, 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. Freescale Semiconductor, Inc. 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. 0V 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. NOTE: 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 crossing point. Simple additional filtering helps to reduce ripples further. Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 8 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Freescale Semiconductor, Inc. AN2355/D AN2355/D BLDC Motor Control Figure 8. Detail of Mutual Inductance Effect Effect of Mutual Phase Capacitance The negative effect of mutual inductance is not the only one to disturb the 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 du/dt. The effect of the mutual capacitance can be studied using the model shown in Figure 9. Id0 A + ud/2 = C S At SBt C iCab u VA iC u Cba + = RC RC - ud/2 u Cac iC S Ab SBb C ISb RC - uVB uVC Cap C u Ccb B Figure 9. Mutual Capacitance Model Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 9 Freescale Semiconductor, Inc. AN2355/D 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: S Ab, S Bt PWM 1 1 1 1 u VA = - u d - u d, u VB = - u d - u d 2 2 2 2 i Cac = i Ccb = i C Equation 8 The voltage that disturbs the back-EMF sensing, utilizing the free (not powered) motor phase C, can be calculated based the equation: Freescale Semiconductor, Inc. u VC Cap 1 1 = - ( u Ccb + u Cac + 2R C ) ( u Ccb + R C ) = - ( u Cac u Ccb ) 2 2 Equation 9 The final expression for disturbing voltage can be found as follows: u VC Cap 1 1 1 C cb C ac 1 = - - - i C dt = - - i C dt 2 C ac C cb 2 C cb C ac 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. Figure 10. Distributed Back-EMF by Unbalanced Capacity Coupling Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 10 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D AN2355/D BLDC Motor Control Freescale Semiconductor, Inc. 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. Figure 11. Balanced Capacity Coupling NOTE: The configuration 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 on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 11 Freescale Semiconductor, Inc. AN2355/D AN2355/D An example of the possible implementation of the back-EMF sensing circuit is shown in Figure 12. +DC_BUS PHASE A PHASE B PHASE C 560k 560k 560k 560k 560k Freescale Semiconductor, Inc. 560k 560k 560k 1n 1n 2x27k 1n 2x27k 1n MUX + 2x27k + 560k + Back-EMF Sensing Circuit MUX COMMAND ZERO CROSSING DETECTION SIGNAL 2x27k Figure 12. Back-EMF Sensing Circuit Diagram As explained 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 015 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 MC68HC908MR32 MC68HC908MR32 12 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D AN2355/D Application Specification The comparator control and zero crossing signals plus the voltage waveforms are shown in Figure 13. Phase Selection MUX Command Freescale Semiconductor, Inc. Phase Comparator Output (Zero crossing edge) "Branch" Voltage (Interval of phase Back-EMF zero crossing detection) Reference Level Commutation Signal 90° Zero Crossing 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 · High-voltage hardware set - for variable line voltage 115230 Vac and medium power (phase current < 2.93A) · Low-voltage evaluation motor hardware set - for automotive voltage (12 V) and very low power (phase current < 4A) · Low-voltage hardware set - for automotive voltage (12 V or possibly 42 V) and medium power (phase current < 50A) Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 13 Freescale Semiconductor, Inc. AN2355/D 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 trapezoidal BLDC motor control star or delta! connected Sensorless with back-EMF zero crossing commutation control Freescale Semiconductor, Inc. Speed closed loop control Motoring mode Target Processor MC68HC908MR32 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 RS232 using PC computer) Targeted Hardware Software Configuration and Parameter Settings Software is prepared to run on three optional board and motor hardware sets: 1. High voltage hardware set at variable line voltage 115230 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) 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 according to the hardware board used Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 14 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D AN2355/D System Concept System Concept Refer to Figure 14 for the application block diagram. Three-Phase Inverter DC Bus Current & DC Bus Voltage Sensing Freescale Semiconductor, Inc. Power line 3-ph BLDC Motor 3 BEMF Voltage Zero Crossing Comparators 3 phase BLDC Power Stage MUX DC-Bus Voltage/ Current Temperature BEMF Zero Crossing signal Digital Inputs ADC Zero Crossing PC Master SCI MUX Command Digital Outputs PWM Generator with Dead Time Zero Crossing Time moment Zero Crossing Period, Position Recognition PWM Commutation Control Duty Cycle Commutation Period 1/T START STOP Actual Speed Required Speed Speed PI Regulator SPEED Required Alignment Current Actual Current Current PI Regulator (for Alignment) HC08MR32 HC08MR32 Figure 14. System Concept Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 15 Freescale Semiconductor, Inc. AN2355/D AN2355/D Freescale Semiconductor, Inc. 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 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 the sensed voltages to a 03.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 (03.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 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. Control Technique Sensorless Commutation Control This section concentrates on sensorless BLDC motor commutation with back-EMF zero crossing technique. 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 MC68HC908MR32 16 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D 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. Freescale Semiconductor, Inc. START MOTOR ALIGNMENT ALIGNMENT TIME EXPIRED? NO YES STARTING (BACK-EMF ACQUISITION) MINIMAL CORRECT COMMUTATIONS DONE? NO YES RUNNING Figure 15. Commutation Control Stages Alignment 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 commutation). 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 on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 17 Freescale Semiconductor, Inc. AN2355/D AN2355/D Freescale Semiconductor, Inc. The BLDC motor rotor position with flux vectors during alignment is shown in Figure 16. Figure 16. Alignment Running The commutation process is a series of states which assure: · The back-EMF zero crossing is successfully captured · The new commutation time is calculated · The commutation is performed The following processes need to be provided: · 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 motor 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 MC68HC908MR32 18 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D 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 Freescale Semiconductor, Inc. BEMF ZERO CROSSING DETECTED BETWEEN PREVIOUS COMMUTATIONS? NO CORRECTIVE CALCULATION 1. YES SERVICE OF COMMUTATION: PRESET COMMUTATION WAIT FOR PER_TOFF UNTIL PHASE CURRENT DECAYS TO ZERO BEMF ZERO CROSSING MISSED? BEMF ZERO CROSSING MISSED CORRECTIVE CALCULATION 2 CORRECTED SETTING OF COMMUTATION TIME YES NO BEMF ZERO CROSSING DETECTED? YES SERVICE OF RECEIVED BEMF ZERO CROSSING: CORRECTED SETTING OF COMMUTATION TIME NO NO HAS COMMUTATION TIME EXPIRED? HAS COMMUTATION TIME EXPIRED? NO YES YES MAKE MOTOR COMMUTATION Figure 17. BLDC Commutation with Back-EMF Zero Crossing Sensing Flowchart Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 19 Freescale Semiconductor, Inc. AN2355/D AN2355/D Running - Commutation Time Calculation Commutation time calculation is shown in Figure 18. T_Cmt[n-2] T_Cmt[n-1] T2[n-3] T2[n-2] n-1 n-2 T_Cmt[n] T2[n-1] T2[n] n 2*Per_ZCrosFlt[n-1] COMMUTATION IS PRESET Freescale Semiconductor, Inc. ZERO CROSSING DETECTION SIGNAL Per_ZCros[n] COMMUTATED AT PRESET TIME NO BACK-BMF FEEDBACK WAS RECEIVED CORRECTIVE CALCULATION 1. T_Cmt*[n+1] ZERO CROSSING DETECTION SIGNAL Per_ZCros[n-2] Per_ZCros0[n] = Per_ZCros[n-1] Per_HlfCmt[n] Per_ZCros[n] T_ZCros[n-1] BACK-EMF FEEDBACK RECEIVED AND EVALUATED T_ZCros[n] Per_Toff[n] T_Cmt*[n+1] COMMUTATED WHEN BACK-EMF ZERO CROSSING IS MISSED CORRECTION CALCULATION 2. ZERO CROSSING DETECTION SIGNAL Per_ZCros[n] Per_HlfCmt[n] 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 (T_ZCros[n]): Per_ZCros[n] = T_ZCros[n] - T_ZCros[n-1] = T_ZCros[n] - T_ZCros0 Per_ZCrosFlt[n] = (1/2*Per_ZCros[n]+1/2*Per_ZCros0) HlfCmt[n] = 1/2*Per_ZCrosFlt[n]- Advance_angle = = 1/2*Per_ZCrosFlt[n]- C_CMT_ADVANCE*Per_ZCrosFlt[n]= Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 20 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D 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_ZCros0 >8) This syntax is used to generate optimal code using the MUL instruction. Freescale Semiconductor, Inc. PWM Duty Cycle 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, PVAL6L are set proportionally to the PWM modulus register PMOD = MCPWM_MODULUS constant (100% duty cycle is when PVALx = PMOD). The PWM_Val_Max variable is: PWM_Val_Max = DUTY_PWM_MAX*MCPWM_MODULUS This variable is used for scaling of the regulator output OutReg_U8. The registers PVAL1H, PVAL1L through PVAL6H, PVAL6L are loaded with PWM_Val calculated from OutReg_U8: PWM_Val = PWM_Val_Max*OutReg_U8/256 U8/256 This calculation is provided with macro umul_16x8_macro. Timers Timer 1 and timer 2 are implemented using MC68HC08MR32 MC68HC08MR32 timers. Timer 3 is a software virtual timer using time base of timer 1. 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 = TACNTH and TACH1L = TACNTL. With each interrupt, the registers TACH1H and TACH1L are loaded with the new value, T1 = T1+PER_CS_T1, where T1+PER_CS_T1 is a 16-bit addition with no saturation. So, the constant interrupt period PER_CS_T1 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 µs. The timer 1 interrupt function is provided by the TIMACh1_Int () function. Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 53 Freescale Semiconductor, Inc. AN2355/D 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. 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). · Freescale Semiconductor, Inc. · The timer A channel 3 (timer 2) interrupt is called whenever TACH3H = TACNTH and TACH3L = TACNTL. So, the registers TACH3H and TACH3L 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 µs. The timer 2 interrupt function is provided by function TIMACh3_Int(). References 1. Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 - Software Porting to Customer Motor (document order number AN2356/D AN2356/D), Motorola 2002 2. Motion Control Development Tools found on the World Wide Web at: http://e-www.motorola.com 3. Motorola Embedded Motion Control MC68HC908MR32 MC68HC908MR32 Control Board User's Manual, (document order number MEMCMR32CBUM/D MEMCMR32CBUM/D), Motorola 2000 4. Motorola Embedded Motion Control 3-Phase AC BLDC High-Voltage Power Stage User's Manual (document order number MEMC3PBLDCPSUM/D), Motorola 2000 5. Motorola Embedded Motion Control Optoisolation Board (document order number MEMCOBUM/D), Motorola 2000 6. Motorola Embedded Motion Control Evaluation Motor Board User's Manual (document order number MEMCEVMBUM/D), Motorola 2000 7. 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 on MC68HC908MR32 MC68HC908MR32 54 Software Description For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. AN2355/D AN2355/D References 8. User's Manual for PC Master Software, Motorola 2000, found on the World Wide Web at: http://e-www.motorola.com 9. 68HC908MR32 68HC908MR32, 68HC908MR16 68HC908MR16 Advance Information (document order number MC68HC908MR32/D MC68HC908MR32/D), Motorola Freescale Semiconductor, Inc. 10. Low Cost High Efficiency Sensorless Drive for Brushless DC Motor using MC68HC MC68HC(7)05MC4 05MC4 (document order number AN1627 AN1627), Motorola Sensorless BLDC Motor Control on MC68HC908MR32 MC68HC908MR32 MOTOROLA Software Description For More Information On This Product, Go to: www.freescale.com 55 Freescale Semiconductor, Inc. AN2355/D 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 Freescale Semiconductor, Inc. ASIA/PACIFIC: Information in this document is provided solely to enable system and software 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: 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 1-800-521-6274 suitability of its products for any particular purpose, nor does Motorola assume any HOME PAGE: liability arising out of the application or use of any product or circuit, and specifically http://motorola.com/semiconductors 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 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. 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 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 AN2355/D Rev. 0 11/2002 For More Information On This Product, Go to: www.freescale.com