Freescale Semiconductor Application Note Document Number:AN4625 Rev. 0, 10/2012 DSC MC56F84xxx in the motor control application by: Arendarik Stanislav Contents 1 Introduction 1 Introduction................................................................1 3-phase high voltage or low voltage motors are used in large number of applications. The various types of motors require a various control algorithms, which are often very complex. Freescale offers a family of Digital Signal Controllers (DSC) MC56F84xxx dedicated for control of complex motor control algorithms. One of the latest DSC is 100MHz 32-bit MC56F84789. For the successful control of the application the DSC peripherals must be utilized and properly connected to the power hardware control and feedback signals. 2 Key peripherals dedicated for motor control applications...............................................................1 3 Power Stage Structures.............................................2 4 2 Key peripherals dedicated for motor control applications The two eFlexPWM modules PWMA and PWMB for the control signal generation • up to 12 output PWM channels • 16-bit resolution for edge, center aligned or asymmetrical PWM • Independent control of both edges of each PWM output • Independently programmable PWM output polarity • Independent top and bottom deadtime insertion © 2012 Freescale Semiconductor, Inc. 5 3.1 Motor Inverter...............................................2 3.2 Interleaved PFC Stage....................................3 3.3 Current and Voltage Measurement..................................................4 Hardware Connections..............................................4 4.1 Power Supply and DSC's JTAG Interface connection.......................................5 4.2 One 3-Phase Motor without PFC Stage...............................................................5 4.3 One 3-Phase Motor with PFC Stage...............................................................7 4.4 Two 3-Phase Motors with PFC Stage...............................................................8 Conclusion.................................................................9 Power Stage Structures • Each complementary pair can operate with its own frequency and deadtime values • The PWMA supports NanoEdge placement with 312 ps high resolution Two independent 12-bit high speed cyclic ADC for the analog signal measurements: • 8-channel external input each • 300 ns conversion speed • Each ADC has ability to scan and store up to 8 conversion results • • • • • • • • 1 x 24-channel 16-bit SAR ADC 1 x 24-channel 16-bit SAR ADC One quadrature decoder Two periodic interval timers Two programmable delay blocks One 12-bit DAC Four high speed comparators with 6-bit DACs for comparator reference Dual inter-module crossbar switch enabling user configuration of data path between internal modules and between internal modules and GPIO pins. This DSC with large FLASH (up to 256 KB) and RAM (up to 32 KB) memories is running at 100 MHz. It is powered from +3.3 V power supply and it has the 5 V tolerant I/O pins. DSC is able to control two 3-phase motors together with one common power factor control (PFC) stage simultaneously. The suggested connections for the one or two 3-phase motors optionally with PFC stage are proposed below. 3 Power Stage Structures Let's start with the design of the key parts of typical power stage. • Motor inverter • Interleaved PFC • Current and voltage feedback measurement. 3.1 Motor Inverter The basic hardware connection for one motor is shown in Figure 1. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 2 Freescale Semiconductor, Inc. Power Stage Structures DC-Bus +15V PWM1_AT PWM1_BT PWM1_CT PWM1_AB PWM1_BB PWM1_CB Q1 GAT GBT GCT Gate drivers GAT Q5 GCT VoutA VoutB VoutC GAB GBB GCB Q2 GAB R4 GND Q3 GBT Q4 GBB 3~ Q6 GCB IsA+ IsB+ IsC+ R1 IsA– R2 IsB– R3 IsC– Is_DCB– Is_DCB+ Figure 1. 3-Phase Motor Connection The Figure 1 shows the basic internal connection of the 3-phase power module typical for motor control application. The input gate driver block receives the control signals from the control DSC and generates the control signals for the IGBTs or MOSFETs. This stage is usually able to accept the control signals of the 3.3 V to 5 V level. The block of the gate drivers is powered from the +12 V to +15 V power supply (Vdd). The 3-phase bridge of the power MOSFETs or IGBTs is powered from the high voltage DC-Bus line (100V DC to 400V DC). 3.2 Interleaved PFC Stage The PFC stage is commonly used to improve the efficiency of the power consuming from the power line. The power factor is decreased by the current spikes when the DC-Bus capacitors are charged from the standard diode bridge rectifier. The PFC stage maintains the mains current nearly sine shape, thus the power factor is close to 1. Vin L1 D1 L2 D2 DC-Bus +15V Q1 PWM1_PFC1 PWM1_PFC2 Q2 Dual gate driver Is1_PFC+ R1 Is1_PFC– + C1 Is2_PFC+ R2 Is2_PFC– GND Figure 2. Interleaved PFC Stage The basic structure of the interleaved PFC stage is shown in Figure 2. The input to the PFC stage is the Vin voltage. It is the power line AC voltage rectified by the diode bridge. Vin is the pulsating DC voltage. This voltage is measured by the control DSC. The DSC generates the PWM control signals for the power MOSFETs in order to consume sine shape current from the power line. The high frequency switching currents are sensed by the current sense resistors R1 and R2, then amplified and measured by the ADC module of the DSC. The output DC-Bus voltage is usually stabilized at level about 380V DC. The DC-Bus voltage provides power for the motor inverter. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 Freescale Semiconductor, Inc. 3 Hardware Connections 3.3 Current and Voltage Measurement The current and voltage measurement is the key factor for the proper control of the motor. The currents of the each phase are sensed by the power current sense resistors. The voltage on the each sensing resistor is amplified by the measurement amplifier. The structure of this current sense amplifier is shown in Figure 3. The amplification factor is suggested to be lower than 10. Voltage levels are typically measured by the simple voltage divider, which scales the high voltage to proper level acceptable by the processor. The voltage dividers for phase B and C are like for the phase A in Figure 3. +3.3VA DC-Bus Vin-RECT R14 R5 VoutA R11 IsA– R1 R8 R3 U3 – R15 R12 V-DCB C5 R16 C4 GNDA C1 R9 Vin R13 V-A C3 GNDA IsA+ R2 R10 +1,65Vref GNDA + R4 V+ V– R7 I-A C2 R6 GNDA Figure 3. Voltage dividers and current sense amplifier for phase A The input components R1, R2 and C1 form the noise filter. The voltage reference +1.65 V enables the measurement of currents of the both polarities. For the DC-Bus current measurement this reference voltage is equal to zero. Then the only positive current polarity is measured. At the output of this amplifier is the simply low pass filter which improves the measurement accuracy. The output of this filter is connected to the ADC input of the DSC. 4 Hardware Connections This section describes the DSC MC56F84xxx connections for the various configurations of the motor control application. The field oriented control (FOC) is mostly used for control of the 3-phase generic motors. The control algorithm requires the simultaneous (at the same time) measurement of the currents of the two phases of the 3-phase system. This task can be accomplished by the two ADC modules in the DSC. The measured values are processed by the DSC software algorithm. The control algorithm then generates the 3-phase PWM signals for the power stage control. The basic control algorithm is shown in Figure 4. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 4 Freescale Semiconductor, Inc. Hardware Connections wreq Ramp Speed control + Q-Current control torque PI controller – Field control + PI controller – DC-Bus/measured Uq a,b Ud + d,q PI controller – Ua Ub a,b,c PWM-C PWM-B PWM-A a,b DC-Bus ripple elimination D-Current control flux a,b I,a I,b d,q q est west DC-Bus a,b,c 3-phase power stage la lb a,b Back-EMF observer Tracking observer 3~ Figure 4. Basic Control Block for PMSM The control DSC MC56F84xxx is able to manage all these tasks for simultaneous control of the two motors with PFC stage together. The following sections describe the suggested hardware connection for one and two motor control with PFC stage. 4.1 Power Supply and DSC's JTAG Interface connection The DSC's power supply pins and JTAG connection for DSC is shown in Figure 5. Please meet the basic power supply rules for the layout design – place the blocking capacitors as close to DSC's power supply pins as possible. +3.3V +3.3V 7 43 67 96 31 +3.3VA C8 0.1u 32 16 35 93 GNDA C9 C10 C11 C12 C13 C14 C15 0.1u 0.1u 0.1u 0.1u 2.2u 2.2u 2.2u 8 44 66 97 15 VDD1 VDD2 VDD3 VDD4 VDDA VSSA VCAP1 VCAP2 VCAP3 R1 47k TDI TDO TCK TMS RESET 100 98 1 99 2 VSS1 VSS2 VSS3 VSS4 VSS5 R2 47k 1 3 5 7 9 11 13 J1 R3 47k 2 4 6 8 10 12 14 JTAG MC56F84789_LQFP-100 GND Figure 5. DSC's power supply pins and JTAG connection. 4.2 One 3-Phase Motor without PFC Stage This is the simplest motor control application usually used for the low power (< 100W) application. The power limitation is due to valid regulation – the only low power motor control applications can be used without PFC stage. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 Freescale Semiconductor, Inc. 5 Hardware Connections DC-Bus AC line Diode bridge 3-Ph. inverter motor 1 Control PMSM Feedback Sensorless FOC control motor 1 Application control Application SW DSC MC56F84xxx Figure 6. One Motor Control without PFC Stage The block schematic of the power circuit for the one motor control without PFC stage is shown in Figure 6. The power supply schematic is shown in Figure 7. DC-Bus AC1 L RV1 N Input filter –DC – +15V +3.3V +3.3VA C2 2n2 +DC + AC2 + C3 C1 2n2 470u L1 Auxiliary DC/DC C4 10u C5 Bead 0.1u L2 C6 0.1u C7 2.2u GND Bead PE GND GNDA Figure 7. Power supply without PFC The measured currents and voltages are scaled by the voltage dividers and measurement amplifiers and connected to the control DSC as in Figure 8. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 6 Freescale Semiconductor, Inc. Hardware Connections I-A I-B V-A V-B I-DCB 22 23 24 25 21 20 19 17 I-A I-C V-C ANA0 ANA1 ANA2 ANA3 ANA4 ANA5 ANA6 ANA7 33 34 36 42 30 29 28 26 V-DCB ANB0 ANB1 ANB2 ANB3 ANB4 ANB5 ANB6 ANB7 18 14 13 37 PWM1_AT PWM1_AB PWM1_BT PWM1_BB PWM1_CT PWM1_CB 69 68 75 74 83 82 DC-Bus PWM1_AT PWM1_AB PWM1_BT PWM1_BB PWM1_CT PWM1_CB VoutA MOSFETs VoutB + drivers VoutC Figure 1. 85 PWM1_D1 84 PWM1_D2 PWM2_AT PWM2_AB PWM2_BT PWM2_BB PWM2_CT PWM2_CB 3~ GND 71 70 79 78 73 72 Voltage dividers Current sense amplifiers Figure 3. ANC16 ANC17 ANC18 ANC19 MC56F84789_LQFP-100 Figure 8. Measurement and control signals for one 3-phase motor without PFC 4.3 One 3-Phase Motor with PFC Stage This configuration is often used for the high power motor control application. For higher power the interleaved PFC stage is used. DC-Bus AC line Interleave PFC Control 3-Ph. inverter motor 1 Feedback Control Feedback Sensorless FOC control motor 1 Interleave PFC control Application control PMSM Application SW DSC MC56F84xxx Figure 9. One Motor Control with PFC Stage The main 3-phase motor with the PFC stage connection is in Figure 9. The main power circuit for the one motor control with PFC stage connection is shown in Figure 10. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 Freescale Semiconductor, Inc. 7 Hardware Connections Vin-RECT Interleave PFC Figure 2. AC1 L RV2 Input filter –DC – N +15V DC-Bus +3.3V +3.3VA C21 2n2 L4 +DC + Auxiliary DC/DC AC2 PWM1_PFC1 PWM1_PFC2 IPFC1 IPFC2 Bead C23 0.1u C22 2n2 C20 + 470u GND C18 10u C24 0.1u C19 2.2u L3 Bead PE GND GNDA Figure 10. Power supply with interleaved PFC stage The DSC power supply circuits and JTAG connection are the same as in previous configuration. It is shown in Figure 5. The measured currents and voltages are processed by the measurement amplifiers and connected to the control DSC as in Figure 11. Vin-RECT DC-Bus Interleaved PFC stage PWM1_PFC1 Figure 2. Vin Voltage PWM1_PFC2 dividers V-DCB Figure 3. I-PFC1 I-PFC2 I-A I-B V-A V-B I-DCB I-PFC1 I-A I-C V-C Vin V-DCB I-PFC2 GND Current sense amplifiers Figure 3. 22 23 24 25 21 20 19 17 33 34 36 42 30 29 28 26 18 14 13 37 ANA0 ANA1 ANA2 ANA3 ANA4 ANA5 ANA6 ANA7 ANB0 ANB1 ANB2 ANB3 ANB4 ANB5 ANB6 ANB7 PWM1_AT PWM1_AB PWM1_BT PWM1_BB PWM1_CT PWM1_CB 69 68 75 74 83 82 PWM1_AT PWM1_AB PWM1_BT PWM1_BB PWM1_CT PWM1_CB VoutA MOSFETs VoutB + drivers Figure 1. VoutC 3~ 85 PWM1_PFC1 PWM1_D1 84 PWM1_PFC2 PWM1_D2 PWM2_AT PWM2_AB PWM2_BT PWM2_BB PWM2_CT PWM2_CB 71 70 79 78 73 72 ANC16 ANC17 ANC18 ANC19 GND Voltage dividers Current sense amplifiers Figure 3. MC56F84789_LQFP-100 Figure 11. Measurement and control signals for one 3-phase motor with PFC The difference to previous is only the PFC stage control PWMs and PFC currents measurement. 4.4 Two 3-Phase Motors with PFC Stage This configuration is mostly used in the heating, ventilating and air conditioning (HVAC) appliances. This configuration comprises the two PMSM with PFC stage as shown in Figure 12. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 8 Freescale Semiconductor, Inc. Conclusion 3-Ph. inverter motor 2 DC-Bus Control Interleave PFC AC line Control Feedback 3-Ph. inverter motor 1 Feedback Control Application control PMSM #1 Feedback Sensorless FOC control motor 1 Interleave PFC control PMSM #2 Sensorless FOC control motor 2 Application SW DSC MC56F84xxx Figure 12. Dual Motor Control with PFC Stage The hardware connection of the ADC and PWM pins of the control DSC is in Figure 13. GND Vin-RECT DC-Bus Interleaved PFC stage PWM1_PFC1 Figure 2. Vin Voltage PWM1_PFC2 dividers V-DCB Figure 3. I-PFC1 I-PFC2 GND Current sense amplifiers Figure 3. I1-A I1-B I2-A I2-B I-PFC1 V1-A V1-B I-DCB1 22 23 24 25 21 20 19 17 I1-A I1-C I2-A I2-C I-PFC2 V1-C Vin I-DCB2 33 34 36 42 30 29 28 26 V2-A V2-B V2-C 18 14 13 37 ANA0 ANA1 ANA2 ANA3 ANA4 ANA5 ANA6 ANA7 ANB0 ANB1 ANB2 ANB3 ANB4 ANB5 ANB6 ANB7 PWM1_AT PWM1_AB PWM1_BT PWM1_BB PWM1_CT PWM1_CB 69 68 75 74 83 82 PWM1_AT PWM1_AB PWM1_BT PWM1_BB PWM1_CT PWM1_CB 85 PWM1_PFC1 PWM1_D1 84 PWM1_PFC2 PWM1_D2 PWM2_AT PWM2_AB PWM2_BT PWM2_BB PWM2_CT PWM2_CB 71 70 79 78 73 72 ANC16 ANC17 ANC18 ANC19 MC56F84789_LQFP-100 PWM2_AT PWM2_AB PWM2_BT PWM2_BB PWM2_CT PWM2_CB MOSFETs + drivers Figure 1. VoutA VoutB VoutC 3~ Voltage dividers Current sense amplifiers Figure 3. GND MOSFETs + drivers Figure 1. VoutA VoutB VoutC 3~ Voltage dividers Current sense amplifiers Figure 3. Figure 13. Measurement and control signals for two 3-phase motors with PFC 5 Conclusion The application note suggests the proper connection of the DSC MC56F84xxx for motor control applications. Particularly it deals with ADC, PWM, current sensing and other necessary connections of pins of DSCs. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 Freescale Semiconductor, Inc. 9 Conclusion The main peripherals for this application are the ADC and PWM modules. The ADC module is used for all voltage/currents measurements. The ADC measurement moment must be properly set due to switching noise elimination. The ADC module provides many options for the right sampling time synchronization with the generated PWM signals. The PWM module generates the control signals for the power driver. The right consideration must be done for each application regarding the package pinout. The lowest pin count package (48 LQFP) meets the minimum requirements for one PMSM control. The largest package (100 LQFP) can be used for the dual motor control with PFC stage. The internal cross-bar supports flexibility for the final pinout configuration for the each package. DSC MC56F84xxx in the motor control application, Rev. 0, 10/2012 10 Freescale Semiconductor, Inc. How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, EL516 2100 East Elliot Road Tempe, Arizona 85284 +1-800-521-6274 or +1-480-768-2130 www.freescale.com/support Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) www.freescale.com/support Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064 Japan 0120 191014 or +81 3 5437 9125 email@example.com Asia/Pacific: Freescale Semiconductor China Ltd. Exchange Building 23F No. 118 Jianguo Road Chaoyang District Beijing 100022 China +86 10 5879 8000 firstname.lastname@example.org Document Number: AN4625 Rev. 0, 10/2012 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductors products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any liability, including without limitation consequential or incidental damages. "Typical" parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals", must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claims alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical characteristics as their non-RoHS-complaint and/or non-Pb-free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale's Environmental Products program, go to http://www.freescale.com/epp. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © 2012 Freescale Semiconductor, Inc.