AN205561 F²MC-8FX Family MB95200 Series 8-Bit Microcontroller BLDC Motor Back EMF 120° Driver Method Associated Part Family: MB95200 Series This document describes the BLDC (Brushless DC) motor back EMF 120° driver method used by MB95330H Series. Contents 1 2 3 4 Introduction .................................................................. 1 Background Description .............................................. 1 2.1 Description of Multi-pulse Generator ................... 1 2.2 Back EMF Description ........................................ 5 Hardware Design Description ...................................... 8 3.1 System Block Diagram Description ..................... 8 3.2 Position Detection Resolver ................................ 9 Firmware Principles and Theory ................................ 11 4.1 Firmware Main Flowchart .................................. 11 4.2 Sensorless Startup ............................................ 12 4.3 Transition from Startup to Normal Run ............. 15 1 4.4 Normal Run ....................................................... 16 5 Notes on Using Back EMF Driver method ................. 20 5.1 Relationship between Driving Patterns and Position Detection ..................................................... 20 5.2 Notes on Operation of DTTI Input Control ........ 20 5.3 Advantage or Disadvantage of Sensorless Control ....................................................................... 20 6 Additional Information ................................................ 21 Document History............................................................ 22 Introduction This document describes the BLDC (Brushless DC) motor back EMF 120° driver method used by MB95330H series 8-bit microcontroller. 2 Background Description This section describes the multi-pulse generator (MPG) and back EMF 120° driver BLDC motor. 2.1 Description of Multi-pulse Generator The multi-pulse generator consists of a 16-bit PPG timer, a 16-bit reload timer and a waveform sequencer. By using the waveform sequencer, 16-bit PPG timer output signal can be directed to multi-pulse generator output (OPT5 to OPT0) according to the input signal of multi-pulse generator (SNI2 to SNI0). Meanwhile, the OPT5 to OPT0 output signal can be terminated by DTTI input in case of emergency. The OPT5 to OPT0 output signals are synchronized with the PPG signal in order to eliminate the unwanted glitch. www.cypress.com Document No. 002-05561 Rev. *A 1 MB95200 Series BLDC Motor Back EMF 120° Driver Method 2.1.1 Block Diagram of Multi-pulse Generator Figure 1. Block Diagram of Multi-pulse Generator Figure 1 shows the block diagram of multi-pulse generator. 16-bit PPG Timer The 16-bit PPG timer is used to provide the PPG signal for waveform sequencer. Details of 16-bit PPG timer are described in Hardware Manual of MB95330H Series. www.cypress.com Document No. 002-05561 Rev.*A 2 MB95200 Series BLDC Motor Back EMF 120° Driver Method 16-bit Reload Timer The 16-bit reload timer is used to act as interval timer for waveform sequencer. Details of 16-bit reload timer are described in Hardware Manual of MB95330H Series. Waveform Sequencer The waveform sequencer is the core of multi-pulse generator, which can generate various waveforms. 2.1.2 Registers of Multi-pulse Generator Figure 2. Registers of Multi-pulse Generator (Continued) www.cypress.com Document No. 002-05561 Rev.*A 3 MB95200 Series BLDC Motor Back EMF 120° Driver Method (Continued) Figure 2 shows registers of multi-pulse generator. For more detailed information, please refer to Chapter 24 in Hardware Manual of MB95330H Series. www.cypress.com Document No. 002-05561 Rev.*A 4 MB95200 Series BLDC Motor Back EMF 120° Driver Method 2.2 Back EMF Description 2.2.1 Back EMF Generation Based on simple physical theory, when there is a relative motion between a conductor and a magnetic field, the current will flow through the conductor and a potential difference is generated. Figure 3. Motor Relative Motion by Potential Difference Apply the same principle to a brushless DC motor and user can find the induced current on the phase coil which is open. Study the above situations and monitor the marker A and A’ in the “Before” and “After” respectively, user can recognise the induced current and its direction. www.cypress.com Document No. 002-05561 Rev.*A 5 MB95200 Series BLDC Motor Back EMF 120° Driver Method 2.2.2 M o t o r C o m p l e t e R e vo l u t i o n By applying the same analysis, below shows a motor rotating mechanism on the complete revolution. Figure 4. Motor Rotating Mechanism on the Complete Revolution By detecting the rising and falling edge of induced voltage on the opened phase coil terminal, communication can be done electronically, it is the basic principle how sensorless control of brushless DC motor can work. www.cypress.com Document No. 002-05561 Rev.*A 6 MB95200 Series BLDC Motor Back EMF 120° Driver Method 2.2.3 Back EMF Modeling In order to understand how the back EMF is useful in the implementation, it is important to study the 3 phase back EMF modelling. Figure 5. 3 Phase Back EMF Modelling From the above explanation, we can see an important fact that the voltage on the opened terminal is equal to half of the power supply VCC at zero crossing. Therefore, in order to recognise the time of zero crossing, the voltage on the terminal of phase coil is compared with the VCC/2. However, since the VCC is very high, VCC/2 level and the voltage from the terminal are scaled down to a suitable level so that it can be fed to the comparator. www.cypress.com Document No. 002-05561 Rev.*A 7 MB95200 Series BLDC Motor Back EMF 120° Driver Method 3 Hardware Design Description This section describes system hardware design. 3.1 System Block Diagram Description The basic configuration of a sensorless controlled brushless DC motor system is shown below. Figure 6. System Block Diagram MB95330 The basic components are: IGBT-IPM IGBT-IPM (intelligent power module) consists of an IGBT model and a signal driver circuit. It is connected to the MCU output port and 3 phase brushless DC motor. Position resolver This circuit consists of a simple potential divider and isolators. It captures the potential from phase coils and is compared with a fixed voltage. Through the isolators are connected to the input port of MCU. MB95330 Core of the sensorless control, which accepts output from position resolver and drives the IPM through the isolators. IPM power supply IPM can supply current to its upper arms switches and lower arm switches. Main power supply Provides a stable high DC voltage to drive the motor or compressor. www.cypress.com Document No. 002-05561 Rev.*A 8 MB95200 Series BLDC Motor Back EMF 120° Driver Method 3.2 Position Detection Resolver 3.2.1 Position Detection Circuit Design One of the critical circuitry is the position resolver; it must be very precise to differentiate a few micro-volt signals. Figure 7. Position Detection Resolver Circuit Design Comparators Low offset type can give more precise position detection timing. Practically, protection diode circuit for each input is used to avoid exceeding signal swinging. Resistors The resistors should be kept stable when temperature changes. Low tolerance type should be used and the precision is at least 1%. The precision of these resistors is critical to sensorless control. Decoupling capacitors PWM noise from the phase voltage should be decoupled before being fed to the MCU. Therefore, each comparator input should build in a decoupling capacitor. www.cypress.com Document No. 002-05561 Rev.*A 9 MB95200 Series BLDC Motor Back EMF 120° Driver Method 3.2.2 P o t e n t i a l D i vi d e r The high voltage on the terminal should be scaled down by a carefully designed potential divider circuitry. Figure 8. 3 Phase Back EMF Potential Divider Circuitry Above is the potential divider used in the implementation. Resistors with low tolerance and special values such as 523 Ω and 2.26 kΩ are used to realize a precise potential divider. Precision is very critical to the sensorless control, an insufficient precision design generally leads to unstable startup. U, V and W are connected to the 3 phase terminal. P is connected to the positive terminal of power supply, the 470 kΩ, 2.26 kΩ and 523 Ω resistors create a scaled down value of VCC/2. www.cypress.com Document No. 002-05561 Rev.*A 10 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4 Firmware Principles and Theory The section describes firmware operation principles and theory. 4.1 Firmware Main Flowchart When the rotor stops, the rotor position is unknown because of the missing of position sensor, so the back EMF measurement does not work. Figure 9. Flow Chart of Startup Motor Rotor There are 2 stages before entering normal running status. Sensorless startup The rotor may rotate opposite to the desired direction for a short moment, or even very seldom fail to startup, in this case, user can perform forced startup. Forced startup can be implemented easily by small code size and is very suitable to control brushless DC compressor. User can try startup again by retry function when the compressor starts abnormally. Judgement of normal running state This judgment algorithm ensures the compressor is running perfectly and is suitable to enter normal running. www.cypress.com Document No. 002-05561 Rev.*A 11 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.2 Sensorless Startup 4.2.1 S t a r t u p D r i vi n g P a t t e r n Here is the driving pattern used for sensorless startup. Figure 10. Driving Pattern Used for Sensorless Startup Although the pattern is simple to be implemented, the sensorless startup is very reliable. The compressor always starts up successfully without any retry. A – B is the mask-off time which MCU external interrupts are disabled. B – A’ is the time which MCU external interrupts are enabled. www.cypress.com Document No. 002-05561 Rev.*A 12 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.2.2 Back EMF Zero Crossing Detection In sensorless startup, the back EMF generated at the very first moment is extremely small. Below is a captured waveform showing the back EMF in the terminal and the scaled down VCC/2 level. Figure 11. Back EMF Zero Crossing Detection Back EMF zero crossing happens when the minimum point has a value lower than that of E/2. www.cypress.com Document No. 002-05561 Rev.*A 13 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.2.3 S t a r t u p Al g o r i t h m There is a simple algorithm used in startup stage. Figure 12. Simple Algorithm Used in Startup Stage Change state Change state when there is a back EMF zero crossing interrupt or a preset timer timeout. Preset timer value ranges from 50 ms to 200 ms tested according to the compressor used. Change to normal run The state change is monitored for about 10 - 30 electrical cycles, if the deviation of the duration is not too much, it is assumed the compressor is running smoothly. www.cypress.com Document No. 002-05561 Rev.*A 14 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.3 Transition from Startup to Normal Run In the implementation, only the state change duration of last electrical cycle is considered. Figure 13. Ensure Electrical Cycle’s Value of Startup to Normal Run A simple formula below can be used to ensure the value of last 6 items does not exceed the smallest deviation value. Tmax < k * Tmin Where Tmin and Tmax are the minimum value and maximum value of the 6 items, k is a constant and the range of k is from 5 to 10. www.cypress.com Document No. 002-05561 Rev.*A 15 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.4 Normal Run 4.4.1 D r i vi n g P a t t e r n The normal-run consists of 12 different driving patterns and 6 different states. Below shows the relationship between the driving patterns and the expected interrupts from the position detection circuit. Marker explanation: A : position detection interrupts B : change state C : change chopping-arm D : position detection interrupt enable A’ : next position detection interrupts A – B: commutation delay B – C: change arm delay C – D: change arm mask-off period Figure 14. Driving Pattern of Normal Run www.cypress.com Document No. 002-05561 Rev.*A 16 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.4.2 Real Time Parameters Some real-time parameters are very important in normal running status and are critical to the motor operation. Figure 15. In Fact Drive Pattern of the Motor Operation Commutation delay It is the state change delay after the position detection interrupts. This parameter depends on the characteristics of the target motor and current rotational speed. 0 to 30 electrical degrees are typical practical value. This parameter usually used to fine the efficiency and torque at different speed. Position detection mask Position detect interrupt is masked off just after arm changes, an unwanted interrupt may happens at that time. Position detection ready Starting from that time, position detection interrupt is possible to interrupt the MCU. www.cypress.com Document No. 002-05561 Rev.*A 17 MB95200 Series BLDC Motor Back EMF 120° Driver Method 4.4.3 Ar m C h o p p i n g T e c h n i q u e The use of arm chopping to capture rising or falling edge of back EMF is critical. Here describes how to capture rising and falling edge of back EMF using appropriate chopping arm. Rising edge detection Lower arm chopping will cause the voltage on the opened terminal to exceed the middle reference level, and generates a lot of unwanted interrupts, MCU input interrupt is masked off at this moment. Upper arm chopping will cause the voltage on the opened terminal to exceed the middle reference level only when the back EMF is really zero-crossing, it is a valuable instance to MCU. Figure 16. Rising Edge Detection Waveform of Back EMF Falling edge detection Upper arm chopping will cause the voltage on the opened terminal to exceed the middle reference level, and generates a lot of unwanted interrupts, MCU input interrupt is masked off at this moment. Lower arm chopping will cause the voltage on the opened terminal to exceed the middle reference level only when the back EMF is really zero-crossing, it is a valuable instance to MCU. www.cypress.com Document No. 002-05561 Rev.*A 18 MB95200 Series BLDC Motor Back EMF 120° Driver Method Figure 17. Falling Edge Detection Waveform of Back EMF www.cypress.com Document No. 002-05561 Rev.*A 19 MB95200 Series BLDC Motor Back EMF 120° Driver Method 5 Notes on Using Back EMF Driver method The section describes notes on using BLDC motor Back EMF 120° Driver method. 5.1 Relationship between Driving Patterns and Position Detection The relationship between the driving patterns and the expected interrupts from the position detection circuit varies depending on BLDC motor, so user should first find the relationship of them, and then set registers in code. 5.2 Notes on Operation of DTTI Input Control In system, the DTTI over current protection should be enabled. The OPT5 to OPT0 is fixed at the inactive level when the low input level is placed at the DTTI pin. Even while the output is fixed at the inactive level by the input of the DTTI pin, the timer keeps running, the position detection function does not stop and the data transfer from the output data buffer register (OPDBR) to the output data register (OPDR) is continued for waveform generation, but no waveform is output to the OPT5 to OPT0 pins. 5.3 Advantage or Disadvantage of Sensorless Control 5.3.1 Ad va n t a g e o f S e n s o r l e s s C o n t r o l BLDC motor back EMF 120° driver is sensorless control. The system has no position sensor of hardware design. It drives BLDC motor which has position sensor or position sensorless motor. As a result, the system debases difficulty of hardware design. 5.3.2 D i s a d va n t a g e o f S e n s o r l e s s C o n t r o l The system has no position, so user should calculate the back EMF to find current position of motor by position detection triggered. As a result, the system increases operation of software design and increases difficulty of firmware design. www.cypress.com Document No. 002-05561 Rev.*A 20 MB95200 Series BLDC Motor Back EMF 120° Driver Method 6 Additional Information For more information on Cypress MB95200 products, please visit following website: http://www.cypress.com/MB95200 www.cypress.com Document No. 002-05561 Rev.*A 21 MB95200 Series BLDC Motor Back EMF 120° Driver Method Document History Document Title: AN205561 – F²MC-8FX Family MB95200 Series 8-Bit Microcontroller BLDC Motor Back EMF 120° Driver Method Document Number: 002-05561 Revision ECN Orig. of Change Submission Date ** - CBZH 04/30/2009 Initial release 05/13/2009 Modify according Document Feedback 05/10/2016 Migrated Spansion Application Note MCU-AN-500042-E-11 to Cypress format. *A 5266026 www.cypress.com CBZH Description of Change Document No. 002-05561 Rev.*A 22 MB95200 Series BLDC Motor Back EMF 120° Driver Method Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. PSoC® Solutions Products ARM® Cortex® Microcontrollers cypress.com/arm PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Automotive cypress.com/automotive Cypress Developer Community Clocks & Buffers cypress.com/clocks Interface cypress.com/interface Lighting & Power Control cypress.com/powerpsoc Memory cypress.com/memory PSoC cypress.com/psoc Touch Sensing cypress.com/touch USB Controllers cypress.com/usb Wireless/RF cypress.com/wireless Forums | Projects | Videos | Blogs | Training | Components Technical Support cypress.com/support PSoC is a registered trademark and PSoC Creator is a trademark of Cypress Semiconductor Corporation. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com © Cypress Semiconductor Corporation, 2009-2016. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including Spansion LLC (“Cypress”). This document, including any software or firmware included or referenced in this document (“Software”), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress’s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”). A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products. Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners. www.cypress.com Document No. 002-05561 Rev.*A 23