The following document contains information on Cypress products. AN706-00036-1v0-E 32-BIT MICROCONTROLLER MB9B100A/MB9B300A/MB9B400A/MB9B500A Series Space Vector Pulse Width Modulation TM ARM and Cortex-M3 are the trademarks of ARM Limited in the EU and other countries. AN706-00036-1v0-E All Rights Reserved. The contents of this document are subject to change without notice. Customers are advised to consult with FUJITSU sales representatives before ordering. The information, such as descriptions of function and application circuit examples, in this document are presented solely for the purpose of reference to show examples of operations and uses of Fujitsu semiconductor device; Fujitsu does not warrant proper operation of the device with respect to use based on such information. When you develop equipment incorporating the device based on such information, you must assume any responsibility arising out of such use of the information. Fujitsu assumes no liability for any damages whatsoever arising out of the use of the information. Any information in this document, including descriptions of function and schematic diagrams, shall not be construed as license of the use or exercise of any intellectual property right, such as patent right or copyright, or any other right of Fujitsu or any third party or does Fujitsu warrant non-infringement of any third-party’s intellectual property right or other right by using such information. Fujitsu assumes no liability for any infringement of the intellectual property rights or other rights of third parties which would result from the use of information contained herein. The products described in this document are designed, developed and manufactured as contemplated for general use, including without limitation, ordinary industrial use, general office use, personal use, and household use, but are not designed, developed and manufactured as contemplated (1) for use accompanying fatal risks or dangers that, unless extremely high safety is secured, could have a serious effect to the public, and could lead directly to death, personal injury, severe physical damage or other loss (i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, mass transport control, medical life support system, missile launch control in weapon system), or (2) for use requiring extremely high reliability (i.e., submersible repeater and artificial satellite). Please note that Fujitsu will not be liable against you and/or any third party for any claims or damages arising in connection with above-mentioned uses of the products. Any semiconductor devices have an inherent chance of failure. You must protect against injury, damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy, fire protection, and prevention of over-current levels and other abnormal operating conditions. If any products described in this document represent goods or technologies subject to certain restrictions on export under the Foreign Exchange and Foreign Trade Law of Japan, the prior authorization by Japanese government will be required for export of those products from Japan. The company names and brand names herein are the trademarks or registered trademarks of their respective owners. Copyright© 2011 FUJITSU SEMICONDUCTOR LIMITED all rights reserved 1 AN706-00036-1v0-E Revision History Rev Date Remark 1.0 Jul. 04, 2011 First Edition 2 AN706-00036-1v0-E Table of Contents Revision History.................................................................................................................... 2 Table of Contents.................................................................................................................. 3 1 Introduction.................................................................................................................... 4 2 SVPWM Theory ............................................................................................................. 4 2.1 Overview ................................................................................................................ 4 2.1 Theory .................................................................................................................... 6 2.2 SVPWM Actualize................................................................................................. 10 2.3 SVPWM Arithmetic in FM3 family......................................................................... 12 2.3.1 Make sure the Uref belong to which sector..................................................... 12 2.3.1 Determine open time of 2 adjacent basic vector............................................ 13 2.3.2 Calculate conduction time ............................................................................. 14 2.3.3 Create SVPWM waveform ............................................................................ 15 3 AN706-00036-1v0-E 1 Introduction This application note describes SVPWM function Theory, Block, Function, Flow, Sample, Parameter in FM3 family Inverter Platform. 2 SVPWM Theory Technical Background 2.1 Overview In motor theory, motor speed is defined by the formula: (1) Where f-Power frequency,p-pole pairs Through the formula ,speed regulate need change the power frequency or the motor pole pairs, and change power frequency easier than change motor pole pairs, so, at present, the great mass of motor speed regulate use frequency convert. How to change power frequency? Currently, use the type of: AC-DC-AC. It’s means, convert 3-phase power AC into DC, then, invert the DC into 3-phase AC and change frequency. First, define the 3-phase power AC interphase voltage is: √2 cos 2π/3 √2 cos 4π/3 √2 cos (2) Take this 3-phase AC voltage into stationary system (α-β): (The formulae deduce please reference the [AN] coordinate transform Clarke Transform formulae (12)) 2 3 ua 2 3 0.5ub √3 u 2 b 0.5uc √3 u 2 c √2 cos √2 sin (3) Take this into voltage space vector: us (4) In sine power: us √2 cos sin 4 √2 (5) AN706-00036-1v0-E This equation is a circularity in plural plane. So, in motor theory, invariableness’ voltage(U) and frequency, stator voltage space vector in plural plane move along with a circularity , and space vector move a cycle in a power frequency cycle. Figure 2-1, the line voltage space vector will move other circularity , it’s radius more than phase voltage circularity √3 ,and they have 30° phase angle. In stator 3-phase voltage space vector will move along with a circularity (start) into another circularity (stabile). The SVPWM use to regulate power frequency and draw a nice circularity part. Figure 2-1 5 through DC–AC AN706-00036-1v0-E 2.1 Theory SVPWM: Space Vector Pulse Width Modulation. Purpose: SVPWM can directly transform the stator voltage vectors from the two-phase α,β-coordinate system into pulse-width modulation (PWM) signals (duty cycle values). proverbial motor formulae is : U1 dψ1 dt R1 i1 (6) U1 is stator voltage vector, Ψ1 is stator flux vector, i1 is stator current vector. When U1 is a standard sine wave, that is the same size and direction continuous change, the trajectory is an ideal circle. So, U1 ψ1 R1 i1 dt (7) When R1 *i1<<U1: ψ1 U1 dt (8) Flux trajectory depends on voltage vector. So we can design the circuit of DC to 3-phase AC Figure 2-2 As shown in figure 2-2, in the circuit diagram, have 6 power switch a, b, c, a’, b’, c’ plot out they into 2 groups, S[ a,b,c] , S’[a’, b’, c’], they control the switch ON/OFF, and they mutex, Sx S S′ 1 0 It’s means each voltage vector is coded by the three-digit number and have eight possible switching states (vectors) are feasible. For example: Sx = [1, 0, 0]. 6 AN706-00036-1v0-E The point [a], [b’], [c’] switch ON, and [a’], [b], [c] switch OFF. UaN Udc , UbN UcN 0 UaN UbN Udc In motor theory, b c Take UaN Udc , UbN UcN b 0 c Udc 0 into the formula, Similarly, can calculate other switching states, below in Table 2-1. Table 1 Sa Sa Sa Vector UaN UbN UcN Ua Ub Uc 0 0 0 U0 0 0 0 0 0 0 1 0 0 U4 Udc 0 0 2Udc/3 - Udc/3 - Udc/3 1 1 0 U6 Udc Udc 0 Udc/3 Udc/3 - 2Udc/3 0 1 0 U2 0 Udc 0 - Udc/3 2Udc/3 - Udc/3 0 1 1 U3 0 Udc Udc - 2Udc/3 Udc/3 Udc/3 0 0 1 U1 0 0 Udc - Udc/3 - Udc/3 2Udc/3 1 0 1 U5 Udc 0 Udc Udc/3 - 2Udc/3 Udc/3 1 1 1 U7 0 0 0 0 0 0 Form formula (3) and (4), the voltage space vector formula: 2 3 us a Where exp j ua aub a2 uc a2 exp j 2π 3 (9) 4π 3 Take table 2-1 vector: U4 2 U 3 dc U2 2 2π Udc exp j 3 3 U1 2 π Udc exp j 3 3 U6 2 4π Udc exp j 3 3 U3 2 U exp jπ 3 dc 2 5π Udc exp j 3 3 U5 All of non-zero vectors have the same amplitude vectors angle is π , 3 60° for (10) example, 7 2 U 3 dc , and between f=50Hz, the vector border two change time: AN706-00036-1v0-E t 60 1 360 50 3.33ms . 8 AN706-00036-1v0-E Graphical representation of all combinations is the hexagon shown in Figure 2-3. There are six non-zero vectors, U0, U60, U120, U180, U240, U300, and two zero vectors, O000 and O111, defined in α, β coordinates. Figure 2-3 In figure 2-3, the red line plot out the hexagon into six sectors, every between border two vectors angle is 60°, the border two vectors and zero vector could compose random voltage vector. T 0 Uref dt Tx 0 Ux dt Tx Ty Tx T Uy dt Tx Ty U0 dt (11) Or Uref T Ux Tx Uy Ty U0 T0 (12) This formula means, in sector the voltage vector rotating course could plot out many small part , it’s have the same effect. So, in the interest of bring 3-phase sine AC voltage, use the voltage vector compose, begin from U4(100),every time compose from between increase a little increment, every increment could border two vectors and zero vector. Then the enactment voltage vector equivalent with the rotating voltage vector, and that all is SVPWM. The figure2-4 show the SVPWM transform course, a f = 50Hz single phase voltage transform into DC voltage, then transform into a f=100Hz 3-phase voltage. 9 AN706-00036-1v0-E DC AC AC Figure 2-4 2.2 SVPWM Actualize 3-phase AC voltage rotating speed : ω 2πf , rotating a cycle need time T=1/f, if carrier wave frequency is fs , the frequency ratio R =fs/f, it’s means voltage rotating plane plot out R unit increment , so the voltage vector increment angle is r 2π R 2πf fs 2πTs /T For example, need compose a voltage vector Uref , it’s station at I at sector first increment, then will use two non-zero vector(U4,U6) and two zero vector(U0,U7), shown the Figure 2-4. Figure 2-5 In stationary system 2-phase (α-β), the Uref with U4 angle is θ, then |Uref | |T4 U4 /Tz | |T6 U6 /Tz | π sin2π/3 sinθ sin 3 θ (13) Because: U4 U6 2 U 3 dc , the vector hold time is 10 AN706-00036-1v0-E π θ 3 mTs sin θ mTs sin 4 6 (14) √3|Uref | Udc Where m is SVPWM regulate ratio: Then zero vector hold time: For reduce the switch waste, every time only changes one phase switch state, and the best sequence is below the Table 2-2. Table 2 Uref I switch sequence sector (0°≤θ≤60°) 0-4-6-7-7-6-4-0 II sector (60°≤θ≤120°) 0-2-6-7-7-6-2-0 III sector (120°≤θ≤180°) 0-2-3-7-7-3-2-0 IV sector (180°≤θ≤240°) 0-1-3-7-7-3-1-0 V sector (240°≤θ≤300°) 0-1-5-7-7-5-1-0 VI sector (300°≤θ≤360°) 0-4-5-7-7-5-4-0 Then use the table 2-2 ,after voltage rotating a cycle, will have R unit compose vector, and in I sector have 3-phase voltage wave shown in figure2-5. Figure 2-6 11 AN706-00036-1v0-E 2.3 SVPWM Arithmetic in FM3 family In FM3 family Inverter platform SVPWM compose sine wave need have 4 steps: 1. Make sure the Uref belong to which sector. 2. To calculate X,Y,Z which are used to determine open time of 2 adjacent basic vector. 3. To determine each conduction time for 2 adjacent basic vector. 4. To determine To write OCCP register value to CH1,CH3,CH5 which used to create SVPWM waveform 2.3.1 Make sure the Uref belong to which sector Function Application Function: To calculate sector no. of SVPWM voltage vector. Function Name: CalcSectorNo C file name: SVPWM.C, SVPWM.H Function interface: INT8U CalcSectorNo(_stDataInFixAxis *pstDataInFixAxis //fixed 2-axis system) typedef struct { Q15_VAL32 alpha_Q15;// Q15_VAL32 beta_Q15;// }_stDataInFixAxis; Table 3 Item Inputs Outputs Name alpha beta SectorNo Description phase- alpha of fixed 2- phase phase- beta of fixed 2- phase Sector no. of SVPWM voltage vector The following code is example for this module. void example_ CalcSectorNo () { CurrentInFixAxis. alpha_Q15= INa;//Input alpha CurrentInFixAxis. beta_Q15= INb;//Input beta CalcSectorNo (&pstDataInFixAxis); OUTa= SectorNo; } 12 Format Q15_VAL32 Q15_VAL32 Q15_VAL32 AN706-00036-1v0-E 2.3.1 Determine open time of 2 adjacent basic vector Function Application Function: To calculate X,Y,Z which is used to determine open time of 2 adjacent basic vectors. Function Name: CalcDutyTime C file name: SVPWM.C, SVPWM.H void CalcDutyTime(_stDataInFixAxis *pstDataInFixAxis, _stXYZ *pstXYZ, INT8U WhichMFT, INT8U WhichFRTCh) typedef struct { Q15_VAL32 alpha_Q15; Q15_VAL32 beta_Q15; }_stDataInFixAxis; typedef struct { INT32S X; INT32S Y; INT32S Z; }_stXYZ; Table 4 Item Name Description Format alpha phase- alpha of fixed 2- phase Q15_VAL32 beta phase- beta of fixed 2- phase Q15_VAL32 Inputs WhichMFT Which MFT, valid value is MFT0, MFT1 INT8U WhichFRTCh Which FRT channel to configure INT8U X X is conduction time INT32S Outputs Y Y is conduction time INT32S Z Z is conduction time INT32S The following code is example for this module. void example_ CalcDutyTime () { pstDataInFixAxis. alpha_Q15= INa;//Input alpha pstDataInFixAxis. beta_Q15= INb;//Input beta WhichMFT=0; WhichFRTCh=0; CalcDutyTime (&pstDataInFixAxis,& pstXYZ, WhichMFT, WhichFRTCh); OUTa= pstXYZ->X; OUTb= pstXYZ->Y; OUTc= pstXYZ->Z; } 13 AN706-00036-1v0-E 2.3.2 Calculate conduction time Function Application Function: To determine each conduction time for 2 adjacent basic vectors. Function Name: CalcTon C file name: SVPWM.C, SVPWM.H void CalcTon(INT8U SectorNo, _stXYZ *pstXYZ, _stOnTimingOfUVW *pstOnTimingOfUVW, INT8U WhichMFT, INT8U WhichFRTCh) typedef struct { INT32S X; INT32S Y; INT32S Z; }_stXYZ; typedef struct { INT32S TU; INT32S TV; INT32S TW; }_stOnTimingOfUVW; Table 5 Item Inputs Name X Y Z SectorNo WhichMFT WhichFRTCh TU Outputs TV TW Description X is conduction time Y is conduction time Z is conduction time Sector no. of SVPWM voltage vector Which MFT, valid value is MFT0, MFT1 Which FRT channel to configure Conduction time of A phase connecting to DC power supply Conduction time of B phase connecting to DC power supply Conduction time of C phase connecting to DC power supply The following code is example for this module. void example_ CalcTon () { pstXYZ .X= INa; pstXYZ .Y = INb; pstXYZ .Z=INc; SectorNo=1; WhichMFT=0; WhichFRTCh=0; CalcTon (SectorNo ,& pstXYZ,& pstOnTimingOfUVW, WhichMFT, WhichFRTCh); OUTa= pstOnTimingOfUVW ->TU; OUTb= pstOnTimingOfUVW ->TV; OUTc= pstOnTimingOfUVW ->TW; } 14 Format INT32S INT32S INT32S INT8U INT8U INT8U INT32S INT32S INT32S AN706-00036-1v0-E 2.3.3 Create SVPWM waveform Function Application Function: To determine To write OCCP register value to CH1,CH3,CH5 which used to create SVPWM waveform Function Name: WriteCmpValToReg C file name: SVPWM.C, SVPWM.H void WriteCmpValToReg(INT8U WhichMFT, _stOnTimingOfUVW *pstOnTimingOfUVW) typedef struct { INT32S TU; INT32S TV; INT32S TW; }_stOnTimingOfUVW; Table 6 Item Name TU Inputs TV TW WhichMFT Description Conduction time of A, phase connecting to DC power supply Conduction time of B, phase connecting to DC power supply Conduction time of C phase connecting to DC power supply Which MFT, valid value is MFT0, MFT1 Format INT32S INT32S INT32S INT8U The following code is example for this module. void example_ WriteCmpValToReg () { pstOnTimingOfUVW .TU=INa; pstOnTimingOfUVW .TV=INb; pstOnTimingOfUVW .TW=INc; WhichMFT=0; WriteCmpValToReg (WhichMFT,& pstOnTimingOfUVW); } - End of File - 15