3-Phase PMSM FOC Control 32-BIT MICROCONTROLLER FM3 Family APPLICATION NOTE Publication Number FM3_AN709-00015 Revision 1.0 Issue Date Feb 26, 2015 A P P L I C A T I O N 2 N O T E FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Target products This application note describes the following products: Series FM0+ / FM3 / FM4 Series Feb 26, 2015, FM3_ AN709-00015-1v0-E Product Number All products 3 A P P L I C A T I O N N O T E Table of Contents Target products ....................................................................................................................................... 3 Table of Contents.................................................................................................................................... 4 Figures .................................................................................................................................................... 5 Tables ..................................................................................................................................................... 6 1. Introduction ...................................................................................... Error! Bookmark not defined. 1.1 Purpose 7 1.2 Definitions, Acronyms and Abbreviations ............................................................................ 7 1.3 Document Overview ............................................................................................................ 7 2. Structure of a 3-Phase PMSM and Motor Driving Principle ............................................................ 8 2.1 Motor Category ................................................................................................................... 8 2.2 Structure of a 3-Phase PMSM ............................................................................................. 8 2.3 Driving principle of 3-Phase PMSM ..................................................................................... 9 3. FOC Control ................................................................................................................................. 12 3.1.1 FOC Principle ................................................................................................... 12 3.1.2 FOC Control Structure ...................................................................................... 13 4. Core Modules ............................................................................................................................... 15 4.1 Coordinate Transformation ................................................................................................ 15 4.2 PI Regulator ...................................................................................................................... 16 4.2.1 Introduction....................................................................................................... 16 4.2.2 Formula ............................................................................................................ 17 4.3 SVPWM 18 4.3.1 Synthesis of a Space Vector............................................................................. 18 4.3.2 Basic Vector Conduction Time.......................................................................... 21 4.3.3 Sector Number Calculation............................................................................... 23 4.4 Sensor-less Position Observer .......................................................................................... 24 5. Mathematical Model of a 3-Phase PMSM .................................................................................... 26 6. Additional Information ................................................................................................................... 28 4 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Figures Figure 2-1: Motor Category...................................................................................................................... 8 Figure 2-2: Structure of a 3-phase PMSM .............................................................................................. 9 Figure 2-3: Stator Magnetic Field of A 3-phase PMSM .......................................................................... 9 Figure 2-4: Stator Magnetic Field of a 3-Phase PMSM When ๐๐ก = 0° ............................................... 10 Figure 2-5: Stator Magnetic Field of a 3-Phase PMSM When ๐๐ก = 60° ............................................. 10 Figure 2-6: Stator Magnetic Field of a 3-Phase PMSM When ๐๐ก = 90° .............................................. 11 Figure 3-1: Brush DC Motor Decoupled Control.................................................................................. 12 Figure 3-2: The Coupled Magnetic Flux of A PMSM ............................................................................ 13 Figure 3-3: FOC Control Diagram ......................................................................................................... 14 Figure 4-1: Coordinate Transformation ................................................................................................ 16 Figure 4-2: PI-regulator Transfer Function ........................................................................................... 17 Figure 4-3: Output of PI Regulator ........................................................................................................ 17 Figure 4-4: PI Regulator with Output Limitation .................................................................................. 17 Figure 4-5: 3-phase Full Bridge Inverter ............................................................................................... 18 Figure 4-6: Basic Voltage Vectors ......................................................................................................... 20 Figure 4-7: Sector Numbers .................................................................................................................. 21 Figure 4-8: Vector Synthesis ................................................................................................................. 21 Figure 4-9: Conduction Time of Basic Vectors .................................................................................... 22 Figure 4-10: Assign the Conduction Time of Basic Vectors by an Up-down Counter...................... 23 Figure 4-11: PLL Estimatorโs Block Schematic ................................................................................... 24 Feb 26, 2015, FM3_ AN709-00015-1v0-E 5 A P P L I C A T I O N N O T E Tables Table 1 : Eight Switching Statuses and Voltages ...................................................................................... 19 Table 2 : Voltages in ฮฑ-ฮฒ Coordinate ........................................................................................................ 19 Table 3 : Sector Number Calculation ........................................................................................................ 23 6 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E 1. Introduction 1.1 Purpose This document describes the FOC control of a 3-phase PMSM. The following contents are included: 1.2 1.3 ๏ท The structure of a 3-phase PMSM and motor driving principle ๏ท FOC control system ๏ท Core modules ๏ท Mathematical model of a 3-phase PMSM Definitions, Acronyms and Abbreviations PMSM Permanent Magnetic Synchronous Motor SVPWM Space Vector Pulse Width Modulation FOC Field Oriented Control Document Overview The rest of document is organized as the following: Section Error! Reference source not found.Error! Reference source not found. explains Error! Reference source not found.. Section 2 explains Structure of a 3-Phase PMSM and Motor Driving Principle. Section 3 explains Inverse Clark transformationError! Reference source not found.. Section 4 explains Inverse Park transformation. Section 5Error! Reference source not found. explains Mathematical Model of a 3-Phase PMSM. Section 6Error! Reference source not found. explains Additional Information. Feb 26, 2015, FM3_ AN709-00015-1v0-E 7 A P P L I C A T I O N N O T E 2. Structure of a 3-Phase PMSM and Motor Driving Principle 2.1 Motor Category Synchronous motors can be divided into several different types. The figure below shows a simple classification tree of electric motors. In this document, the FOC control of 3-phase PMSM is to be introduced, which is highlighted with the green color in below figure. Figure 2-1: Motor Category 2.2 Structure of a 3-Phase PMSM A 3-phase PMSM is mainly composed of two parts: the stator and the rotor. At stator side, the 3-phase windings are coiled on the stator core. The windings of 3 phases are separately placed by the rule of 120 degrees angle to generate a round rotating magnetic field (Fs) when a 3-phase AC current goes through the 3-phase windings. The separated 3-phase winding placed by the rule of 120 degrees angle is named as 3-phase symmetric winding. At rotor side, one or more pairs of permanent magnetic poles are mounted to offer a constant rotor magnetic field (Fr). 8 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Figure 2-2: Structure of a 3-phase PMSM Because Fs is a rotating magnetic field, the Fr will be dragged and follow the Fs. If the Fr cannot catch up with Fs, the rotor will rotate continuously. If the 3-phase current in 3-phase windings disappears, the Fs will disappear at the same time, and the rotor will stop. 2.3 Driving principle of 3-Phase PMSM To keep rotor rotating, a continuous rotating stator magnetic field is necessary. Assume the 3-phase AC current can be expressed as: ๐๐ด๐ = ๐ผ๐ sin(๐๐ก) โฆ (2.3 โ 1) ๐๐ต๐ = ๐ผ๐ sin(๐๐ก โ 120°) โฆ (2.3 โ 2) ๐๐๐ = ๐ผ๐ sin(๐๐ก โ 240°) โฆ (2.3 โ 3) The 3-phase AC current goes through stator 3-phase winding, so three magnetic fields are created. By the formula of F= ๐๐ , the three magnetic fields can be expressed as: Figure 2-3: Stator Magnetic Field of A 3-phase PMSM FC FB FA ๐น๐ด = ๐น๐ด๐ = ๐๐ผ๐ sin(๐๐ก) โฆ (2.3 โ 4) ๐น๐ต = ๐น๐ต๐ = ๐๐ผ๐ sin(๐๐ก โ 120°) โฆ (2.3 โ 5) ๐น๐ถ = ๐น๐๐ = ๐๐ผ๐ sin(๐๐ก โ 240°) โฆ (2.3 โ 6) Feb 26, 2015, FM3_ AN709-00015-1v0-E 9 A P P L I C A T I O N N O T E By observing the synthesis magnetic F in different timing modes, which is combined by ๐น๐ด , ๐น๐ต , ๐๐๐ ๐น๐ , it is easy to understand the rotating principle of stator magnetic field. 1. ๐๐ก = 0° Figure 2-4: Stator Magnetic Field of a 3-Phase PMSM When ๐๐ก = 0° FC F FB ๐น๐ด = ๐น๐ด๐ = 0 โฆ (2.3 โ 7) ๐น๐ต = ๐น๐ต๐ = โ ๐น๐ถ = ๐น๐๐ = โ3 ๐๐ผ๐ โฆ (2.3 โ 8) 2 โ3 ๐๐ผ๐ โฆ (2.3 โ 9) 2 3 ๐น = ๐๐ผ๐ , (๐กโ๐ ๐๐๐๐๐๐ก๐๐๐ ๐๐ ๐ โ๐๐ค๐ ๐๐ ๐๐๐๐ข๐๐ ๐๐๐๐ฃ๐) โฆ (2.3 โ 10) 2 2. ๐๐ก = 60° Figure 2-5: Stator Magnetic Field of a 3-Phase PMSM When ๐๐ก = 60° FB FA F ๐น๐ด = ๐น๐ด๐ = โ3 ๐๐ผ๐ โฆ (2.3 โ 11) 2 ๐น๐ต = ๐น๐ต๐ = โ โ3 ๐๐ผ๐ โฆ (2.3 โ 12) 2 ๐น๐ถ = ๐น๐๐ = 0 โฆ (2.3 โ 13) 3 ๐น = ๐๐ผ๐ , (๐กโ๐ ๐๐๐๐๐๐ก๐๐๐ ๐๐ ๐ โ๐๐ค๐ ๐๐ ๐๐๐๐ข๐๐ ๐๐๐๐ฃ๐) โฆ (2.3 โ 14) 2 10 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N 3. N O T E ๐๐ก = 90° Figure 2-6: Stator Magnetic Field of a 3-Phase PMSM When ๐๐ก = 90° FB FC FB F ๐น๐ด = ๐น๐ด๐ = ๐๐ผ๐ โฆ (2.3 โ 15) 1 ๐น๐ต = ๐น๐ต๐ = โ ๐๐ผ๐ โฆ (2.3 โ 16) 2 1 ๐น๐ถ = ๐น๐๐ = โ ๐๐ผ๐ โฆ (2.3 โ 17) 2 3 ๐น = ๐๐ผ๐ , (๐กโ๐ ๐๐๐๐๐๐ก๐๐๐ ๐๐ ๐ โ๐๐ค๐ ๐๐ ๐๐๐๐ข๐๐ ๐๐๐๐ฃ๐) โฆ (2.3 โ 18) 2 From the synthetic magnetic field F in different timing modes, it is obviously known that F is a rotating vector 3 and furthermore the magnitude of F is a constant( ๐๐ผ๐ ). Now we can get a conclusion that a round rotating 2 magnetic field is created if a 3-phase AC current goes through a 3-phase symmetric winding. Feb 26, 2015, FM3_ AN709-00015-1v0-E 11 A P P L I C A T I O N N O T E 3. FOC Control 3.1.1 FOC Principle Brush DC motor is the conventional DC motor with a long history. A big advantage of the brush DC motor is that its torque control and magnetizing control are decoupled, which makes brush DC motor easy to control. The brush DC motor decoupled control is shown in below figure. Figure 3-1: Brush DC Motor Decoupled Control The magnetizing is controlled by magnetizing current (๐ผ๐ ), and the torque is controlled by torque current (๐ผ๐ ). The direction of the magnetizing magnetic field is parallel with d-axis (vertical direction), and the direction of the torque magnetic field is parallel with q-axis (horizontal direction). So these two magnetic fields do not influence each other. That is to say, it is decoupled between the 2 magnetic fields and motorโs magnetizing and torque can be adjusted individually. For example, the torque control formula is ๐๐ = ๐ถ๐ โ ๐ผ๐ , which means torque is only controlled by torque current ๐ผ๐ . The condition of PMSM motor control is much more complex than a brush DC motor. The magnetic field of a 3-phase symmetry winding is a coupled magnetic field. We can discover the complex coupled relationship from the torque control formula. 12 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Figure 3-2: The Coupled Magnetic Flux of A PMSM 1 ๐[๐ฟ๐ด๐ต๐ถ ] ๐๐ = ๐๐ [๐ผ๐ด๐ต๐ถ ]๐ [๐ผ๐ด๐ต๐ถ ] โฆ (3.1.1 โ 1) 2 ๐๐ ๐ฟ๐ด [๐ฟ๐ด๐ต๐ถ ] = [๐๐ต๐ด ๐๐ถ๐ด ๐๐ด๐ต ๐ฟ๐ต ๐๐ถ๐ต ๐๐ด๐ถ ๐ผ๐ด ๐๐ต๐ถ ] (๐ ๐๐ ๐๐ข๐ก๐ข๐๐ ๐๐๐๐ข๐๐ก๐๐๐๐), [๐ผ๐ด๐ต๐ถ ] = [๐ผ๐ต ] ๐ฟ๐ถ ๐ผ๐ถ From the expression of Te, it is easy to understand that the torque is determined by all 3-phase inductances (including self-inductance and mutual-inductance) and currents. Obviously, the torque control seems much more complex than a brush DC motor. Coordinate transformation is just the way to simplify the PMSM torque control. By coordinate transformation, a PMSM control model is converted from A-B-C coordinate to d-q coordinate. The torque control formula is also converted into d-q coordinate, the formula is: 3 ๐๐ = ๐๐ ๐๐ ๐ผ๐ โฆ (3.1.1 โ 2) 2 The simple formula in d-q coordinate makes the PMSM torque control as easy as a brush DC motor. 3.1.2 FOC Control Structure From the description above, the FOC core thinking is to make the torque control of PMSM as easy as a DC brush motor by a motor rotor magnetic field orientation technology. In the technology, the coordinate transformation method turns the motor module from the u-v-w coordinate to the rotational d-q coordinate, and the d-q coordinate rotational speed is the same as the stator magnetic field rotational speed. Then the control of a PMSM is simplified and the control performance is almost same as a DC brush motor. Some PID regulators are added to adjust the motor output following the given input. By setting different PID parameters, system gets different dynamic and static performance. SVPWM technology is applied to accept the driving voltage in ฮฑ-ฮฒ coordinate and output a set of switching instruction to control the 6 switches in full bridge inverter. Feb 26, 2015, FM3_ AN709-00015-1v0-E 13 A P P L I C A T I O N N O T E Position and speed estimator is designed to observe the real time motor speed through the motor driving voltage and current. The estimated motor speed is compared with the expected speed, and the comparison result serves as the input of the speed PI regulator. The estimated rotor position angle is used by the coordinate transformation unit. Figure 3-3: FOC Control Diagram ฯre + f - PI Iqref + Park-1 Vq - d,q PI Vฮฑ ThreePhase Bridge SVPWM Idref + PI Vd ฮฑ,ฮฒ Vฮฒ - A C Iq Isฮฑ d,q Id ฮฑ,ฮฒ Isฮฒ Park ฮธestim ฯm Position and speed Estimator Isฮฒ Isฮฑ Vฮฒ Vฮฑ B Ib ฮฑ,ฮฒ a,b,c Ic Clark e R Software 14 Hardware FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E 4. Core Modules 4.1 Coordinate Transformation The coordinate transformation includes Clark transformation and Park transformation. On the contrary, the inverse coordinate transformation includes inverse Clark transformation and inverse Park transformation. 1. Clark transformation It changes a quantity in A-B-C coordinate to ฮฑ-ฮฒ coordinate. 1 ๐ฅ๐ผ [๐ฅ ] = [ 1 ๐ฝ โ3 2. 0 2 ] [ ๐ฅ๐ด ] โฆ (4.1 โ 1) ๐ฅ๐ต โ3 Park transformation It changes a quantity in ฮฑ-ฮฒ coordinate to d-q coordinate. ๐ฅ๐ ๐๐๐ ๐ [๐ฅ ] = [ ๐ โ๐ ๐๐๐ 3. ๐ ๐๐๐ ๐ฅ๐ผ ] [ ] โฆ (4.1 โ 2) ๐๐๐ ๐ ๐ฅ๐ฝ Inverse Clark transformation It changes a quantity in ฮฑ-ฮฒ coordinate to A-B-C coordinate. 1 ๐ฅ๐ด [๐ฅ ] = [ 1 ๐ต โ 2 0 ๐ฅ ๐ผ โ3] [๐ฅ ] โฆ (4.1 โ 3) ๐ฝ 2 ๐ฅ๐ถ = โ๐ฅ๐ด โ ๐ฅ๐ต โฆ (4.1 โ 4) 4. Inverse Park transformation It changes a quantity in d-q coordinate to ฮฑ-ฮฒ coordinate. ๐ฅ๐ผ ๐๐๐ ๐ [๐ฅ ] = [ ๐ฝ ๐ ๐๐๐ โ๐ ๐๐๐ ๐ฅ๐ ] [ ] โฆ (4.1 โ 5) ๐๐๐ ๐ ๐ฅ๐ The following figures show the progress of coordinate transformation. Feb 26, 2015, FM3_ AN709-00015-1v0-E 15 A P P L I C A T I O N N O T E Figure 4-1: Coordinate Transformation Clark Inverse Clark 1. FABC , F๏ก๏ข , Fdq -- Synthesis magnetic field Park 2. ๏ทs1 , ๏ท๏ก๏ข , ๏ทdqs -- Magnetic field rotating speed 3. ๏ทs1 ๏ฝ ๏ท๏ก๏ข ๏ฝ ๏ทdqs Inverse Park 4.2 PI Regulator 4.2.1 Introduction The PI regulator is composed of a proportional regulator and an international regulator, which mainly has two functions: (1) To assure a fast response when the input is changed; (2) To assure the output follows the given input. The PI regulator keeps the output follow the expected output by a comparing error between the expected output and the real output. The P-value is to make a fast output response to the comparing error, and the I-value is to decrease the stable output error. Its transfer function can be expressed as follows. 16 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Figure 4-2: PI-regulator Transfer Function expected output PI regulator causes a fluctuating output, fluctuating amplitude is decreasing. After some regulating periods, the output follows the expected output with a very small fluctuation around the expected output value. Figure 4-3: Output of PI Regulator expected output 4.2.2 Formula The mathematic formula of PI regulator is: ๐ก ๐ข(๐ก) = ๐๐ ๐(๐ก) + ๐๐ โซ ๐(๐)๐๐ โฆ (4.2 โ 1) 0 Usually the formula can be changed to the discrete field and expressed by the incremental algorithm. โ๐ข(๐) = ๐๐ [๐(๐) โ ๐(๐ โ 1)] + ๐๐ ๐(๐) โฆ (4.2 โ 2) ๐ข(๐) = ๐ข(๐ โ 1) + โ๐ข(๐) โฆ (4.2 โ 3) Generally, an output limitation is defined to limit the output into a legal range. Figure 4-4: PI Regulator with Output Limitation Feb 26, 2015, FM3_ AN709-00015-1v0-E 17 A P P L I C A T I O N N O T E expected output ๐ข(๐) = ๐ข(๐ โ 1) + โ๐ข(๐) โฆ (4.2 โ 4) ๐ข(๐) = ๐ข๐๐๐ฅ , ๐๐ ๐ข(๐) > ๐ข๐๐๐ฅ โฆ (4.2 โ 5) ๐ข(๐) = ๐ข๐๐๐ , ๐๐ ๐ข(๐) < ๐ข๐๐๐ โฆ (4.2 โ 6) 4.3 SVPWM 4.3.1 Synthesis of a Space Vector SVPWM is a method to generate a round rotational voltage vector by controlling the status of 6 switches , (๐๐ด, ๐๐ด,, ๐๐ต, ๐๐ต, ๐๐ถ, ๐๐ถ, ) in the 3-phase full bridge inverter. Figure 4-5: 3-phase Full Bridge Inverter Below figure lists 8 switching statuses (1 โ switch is closed, 0 โ switch is opened) and the relative voltages. 18 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Table 1 : Eight Switching Statuses and Voltages Through the Clark transformation, those voltages are equally converted to ฮฑ-ฮฒ coordinate. Table 2 : Voltages in ฮฑ-ฮฒ Coordinate Feb 26, 2015, FM3_ AN709-00015-1v0-E 19 A P P L I C A T I O N N O T E Then 6 basic voltage vectors and 2 zero vectors are got. Figure 4-6: Basic Voltage Vectors ๏ข V120 (010) 0(111) V60 (110) 0(000) ๏ก V0 (100) V180 (011) V240 (001) V300 (101) Because motor is driven by a magnetic field created by the 3-phase stator winding, letโs see the relationship between the voltage and the magnetic field. A winding follows below voltage-flux formula. ๐๐โ๐ โฆ (4.3.1 โ 1) ๐๐ก ๐ข โ ๐ = ๐ ๐ ๐๐ + For the motor winding, if the motor rotational speed is not very low, the formula above can be simplified as: ๐ฃ๐ = ๐๐โ๐ โฆ (4.3.1 โ 2) ๐๐ก So we can get: ๐ก ๐โ๐ = โซ ๐ฃ๐ ๐๐ โฆ (4.3.1 โ 3) 0 From the table of โvoltages in ฮฑ-ฮฒ coordinateโ, it is easy to know all the basic voltages vectors are constants. So the formula above can become: ๐ ๐ ๐โ๐ = โซ ๐ฃ๐ ๐๐ก = ๐ฃ๐ โซ ๐๐ = ๐ฃ๐ × ๐ โฆ (4.3.1 โ 4) 0 0 It means that the stator magnetic field is created by the voltage added in motor stator winding. Furthermore, a longer time of voltage applying on winding causes a bigger magnetic field. In Figure 4-6: Basic Voltage Vectors, 6 basic voltage vectors divide the space into 6 numbers. It is numbered as follows (Voltage vectors are expressed as magnetic vectors). 20 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Figure 4-7: Sector Numbers ๏ข ฯs 120 (010) ฯs 60 (110) I V III 0 (111) ฯs 180 (011) ๏ก 0 (000) II IV ฯs 0 (100) VI ฯ s240 (001) ฯs 300 (101) โ ๐ × ๐ (๐ = 0, 60, 120,180,240,300) โฆ (4.3.1 โ 5) ๐โ๐ = ๐ In a control period T, if we divide the T into 3 parts: โ๐0 (๐๐๐ก๐๐๐ ๐ก๐๐๐ ๐๐ ๐0 ), โ๐60 (๐๐๐ก๐๐๐ ๐ก๐๐๐ ๐๐ ๐60 ). โ๐๐๐ข๐๐ (๐กโ๐ ๐ง๐๐๐ ๐ฃ๐๐๐ก๐๐๐ ๐๐๐ก๐๐๐ ๐ก๐๐๐), a magnetic field can be expressed as: โ 0 × โ๐0 + ๐ โ 60 × โ๐60 = ๐โ๐ 0 + ๐โ๐ 60 + ๐โ๐๐ข๐๐ โฆ (4.3.1 โ 6) ๐โ๐ = ๐ Below figure shows the synthesis magnetic vector. Figure 4-8: Vector Synthesis v60 (110) ๏น s 60 ๏ฝ v60 ๏ ๏t60 O ๏นs ๏น s 0 ๏ฝ v0 ๏ ๏t0 v0 (100) In above figure, it shows the synthesis vector in sector III. By the same way, the synthesis magnetic ๐โ๐ of any direction in every sector can be composed of the adjacent 2 basic vectors and the zero vectors. 4.3.2 Basic Vector Conduction Time Assuming the synthesis vector locates in the sector III, the conduction time can be calculated by the following method. Feb 26, 2015, FM3_ AN709-00015-1v0-E 21 A P P L I C A T I O N N O T E Figure 4-9: Conduction Time of Basic Vectors v60 (110) ๏น s 60 ๏ฝ v60 ๏ ๏t60 ๏น s ๏ฝ vs ๏ T (T ๏ฝ ๏t0 ๏ซ ๏t60 ๏ซ ๏tnull ) u s๏ข O ๏ฑ v0 (100) ๏น s 0 ๏ฝ v0 ๏ ๏t0 us๏ก From the table of: Eight Switching Statuses and Voltages, It is easy to know the basic vector amplitude is a 2 VDC ). 3 constant ( v0 ๏ฝ v60 ๏ฝ The synthesis vector ๐โ๐ is composed of ๐โ๐ 0 and ๐โ๐ 60 . ๏ฌ vs ๏ T ๏ cos ๏ฑ ๏ฝ v0 ๏ ๏t0 ๏ cos 0๏ฐ ๏ซ v60 ๏ ๏t60 ๏ cos 60๏ฐ ๏ฏ ๏ฏ vs ๏ T ๏ sin ๏ฑ ๏ฝ v0 ๏ ๏t0 ๏ sin 0๏ฐ ๏ซ v60 ๏ ๏t60 ๏ sin 60๏ฐ ๏ฏ 2 ๏ฏ โฆ (4.3.2 โ 1) ๏ญ v0 ๏ฝ v60 ๏ฝ VDC 3 ๏ฏ ๏ฏus๏ก ๏ฝ vs ๏ T ๏ cos ๏ฑ ๏ฏ ๏ฏ๏ฎus๏ข ๏ฝ vs ๏ T ๏ cos ๏ฑ It can be simplified as ๏ฌ 3 3 us๏ก ๏ญ us ๏ข ๏ฏ ๏t 0 2 2 ๏ฏ๏ฏ ๏ฝ VDC โฆ (4.3.2 โ 2) ๏ญT ๏ฏ ๏t 3us๏ข ๏ฏ 60 ๏ฝ VDC ๏ฎ๏ฏ T It means that the conduction time of basic vectors can be calculated from ๐ข๐ ๐ผ , ๐ข๐ ๐ฝ ๐๐๐ ๐๐๐ . If ๐ > โ๐60 + โ๐0 , the rest time is filled by the zero vectors. For other sectors, the conduction time of basic vectors can be got similarly. The condition time control of basic vectors can be done by the timer in MCU. Generally MCU offers an up-down counter. According to the counting value, we control the full bridge switches to assign the conduction time for each basic vector. 22 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E Figure 4-10: Assign the Conduction Time of Basic Vectors by an Up-down Counter FRT is an up-down counter in FMx series MCU. Npwm is FRTโs counting top value. ๐ข๐1 controls ๐๐ด and ๐๐ดโฒ . OCCP1 is the ๐ข๐1 toggle time. ๐ข๐3 controls ๐๐ต and ๐๐ตโฒ . OCCP3 is the ๐ข๐3 toggle time. ๐ข๐5 controls ๐๐ถ and ๐๐ถโฒ . OCCP5 is the ๐ข๐5 toggle time. 4.3.3 Sector Number Calculation According to the sector division, the sector number can be judged by the following table. Table 3 : Sector Number Calculation Sector Feb 26, 2015, FM3_ AN709-00015-1v0-E Condition ๐ฃ๐ฝ > โ3 |๐ฃ๐ผ | I ๐ฃ๐ฝ > 0, II ๐ฃ๐ผ > 0, ๐ฃ๐ฝ < 0, โ III ๐ฃ๐ผ > 0, ๐ฃ๐ฝ > 0, ๐ฃ๐ฝ < โ3 ๐ฃ๐ผ IV ๐ฃ๐ผ < 0, ๐ฃ๐ฝ < 0, ๐ฃ๐ฝ < โ3 ๐ฃ๐ผ V ๐ฃ๐ผ < 0, ๐ฃ๐ฝ > 0, โ ๐ฃ๐ฝ < โ3 ๐ฃ๐ผ ๐ฃ๐ฝ < โ3 ๐ฃ๐ผ 23 A P P L I C A T I O N VI 4.4 ๐ฃ๐ฝ < 0, โ N O T E ๐ฃ๐ฝ > โ3 |๐ฃ๐ผ | Sensor-less Position Observer The estimator has PLL structure. Its operating principle is based on the fact that the d-component of the Back Electromotive Force (BEMF) must be equal to zero at a steady state functioning mode. The block diagram of the estimator is presented in below figure. Figure 4-11: PLL Estimatorโs Block Schematic Park Eฮฑ Eฮฒ Ed ฮฑ,ฮฒ Eq LPF Edf Sign LPF Eqf d,q + ฮธestim - 1 ๐พ๐ท Integrator ฯmR Starting from the closed loop shown in Figure 4-2, the estimated speed (ฯmR) of the rotor is integrated in order to obtain the estimated angle, as shown in Equation 4.4-1: Equation 1: ๐๐๐ ๐ก๐๐=โซ ๐๐๐ ๐๐ก โฆ (4.4 โ 1) The estimated speed, ฯmR, is obtained by dividing the q-component of the BEMF value with the voltage constant, ฮฮฆ, as shown in Equation 4.4-2. Equation 2: ๐๐๐ = 1 ๐พ๐ท (๐ธ๐๐ โ sign(๐ธ๐๐ ) โ ๐ธ๐๐ ) โฆ (4.4 โ 2) Considering the initial estimation premise (the d-axis value of BEMF is zero at steady state) shown in Equation 2, the BEMF q-axis value, Eqf, is corrected using the d-axis BEMF value, Edf, depending on its sign. The BEMF d-q componentโs values are filtered with a first order filter, after their calculation with the Park transform, as indicated in Equation 4.4-3. ๐ธ๐ = ๐ธ๐ผ cos(๐๐๐ ๐ก๐๐ ) + ๐ธ๐ฝ sin(๐๐๐ ๐ก๐๐ ) Equation 3: { โฆ (4.4 โ 3) ๐ธ๐ = ๐ธ๐ฝ cos(๐๐๐ ๐ก๐๐ ) โ ๐ธ๐ผ sin(๐๐๐ ๐ก๐๐ ) With the fixed stator frame, Equation 4.4-4 represents the stators circuit equations. ๐ธ๐ผ = ๐๐ผ โ ๐ ๐ ๐ผ๐ผ โ ๐ฟ๐ ๐๐ผ๐ผ ๐๐ก Equation 4: { ๐๐ผ๐ฝ โฆ (4.4 โ 4) ๐ธ๐ฝ = ๐๐ฝ โ ๐ ๐ ๐ผ๐ฝ โ ๐ฟ๐ ๐๐ก In Equation 4, the terms containing ฮฑ โ ฮฒ were obtained from the three-phase systemโs corresponding measurements through Clarke transform. Ls and Rs represent the stator inductance and resistance per 24 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E phase respectively, considering Y (star) connected stator phases. If the motor is ฮ (delta) connected, the equivalent Y connection phase resistance and inductance should be calculated and used in the equations above. Feb 26, 2015, FM3_ AN709-00015-1v0-E 25 A P P L I C A T I O N N O T E 5. Mathematical Model of a 3-Phase PMSM FOC is a control theory based on coordinate transformation. In the d-q coordinate, the PMSM mathematical model can be described as below. ๐ฃ๐ = ๐ ๐ ๐๐ + ๐๐๐ โ ๐๐ ๐๐ โฆ (5 โ 1) ๐๐ก ๐ฃ๐ = ๐ ๐ ๐๐ + ๐๐๐ + ๐๐ ๐๐ โฆ (5 โ 2) ๐๐ก ๐๐ = 3 ๐ (๐ ๐ โ ๐๐ ๐๐ ) โฆ (5 โ 3) 2 ๐ ๐๐ ๐๐ = ๐ฟ๐ ๐๐ + ๐๐ โฆ (5 โ 4) ๐๐ = ๐ฟ๐ ๐๐ โฆ (5 โ 5) Where, ๐ฃ๐ โ voltage of d axis ๐ฃ๐ โ voltage of q axis ๐๐ โ current of d axis ๐๐ โ current of q axis ๐ฟ๐ โ inductance of d axis ๐ฟ๐ โ inductance of q axis ๐๐ โ magnetic linkage of d axis ๐๐ โ magnetic linkage of q axis ๐ ๐ โ motor stator phase resistor ๐๐ โ rotor rotational speed ๐๐ โ permanent magnetic linkage of rotor ๐๐ โ pole pairs In FOC method, it always keeps ๐๐ to zero so that the motor mathematical model can be simplified in the steady status. ๐ฃ๐ = ๐๐๐ โ ๐๐ ๐๐ โฆ (5 โ 6) ๐๐ก ๐ฃ๐ = ๐ ๐ ๐๐ + ๐๐๐ + ๐๐ ๐๐ โฆ (5 โ 7) ๐๐ก 3 ๐๐ = ๐๐ ๐๐ ๐๐ โฆ (5 โ 8) 2 ๐๐ = ๐๐ โฆ (5 โ 9) ๐๐ = ๐ฟ๐ ๐๐ โฆ (5 โ 10) From the equation above, the following results can be deduced: 26 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E 1. The magnetic exciting is independently determined by the permanent magnetic linkage (๐๐ ); 2. Torque is independently determined by the current on q axis (๐๐ ); So we can adjust only the current on q axis (๐๐ ) to control the torque which determines the motor rotational speed. Feb 26, 2015, FM3_ AN709-00015-1v0-E 27 A P P L I C A T I O N N O T E 6. Additional Information For more Information on Spansion semiconductor products, visit the following websites: English version address: http://www.spansion.com/Products/microcontrollers/ Please contact your local support team for any technical question America: [email protected] China: [email protected] Europe: [email protected] Japan: [email protected] Other: http://www.spansion.com/Support/SES/Pages/Ask-Spansion.aspx 28 FM3_ AN709-00015-1v0-E, Feb 26, 2015 A P P L I C A T I O N N O T E AN709-00015-1v0-E Spansion ๏ท Application Note FMx Family 32-BIT MICROCONTROLLER 3-Phase PMSM FOC Control Application Note March 2015 Rev. 1.0 Published: Spansion Inc. Edited: Communications Feb 26, 2015, FM3_ AN709-00015-1v0-E 29 A P P L I C A T I O N N O T E Colophon 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 any use that includes 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 any use where chance of failure is intolerable (i.e., submersible repeater and artificial satellite). Please note that Spansion will not be liable to 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 US Export Administration Regulations or the applicable laws of any other country, the prior authorization by the respective government entity will be required for export of those products. Trademarks and Notice The contents of this document are subject to change without notice. This document may contain information on a Spansion product under development by Spansion. Spansion reserves the right to change or discontinue work on any product without notice. The information in this document is provided as is without warranty or guarantee of any kind as to its accuracy, completeness, operability, fitness for particular purpose, merchantability, non-infringement of third-party rights, or any other warranty, express, implied, or statutory. Spansion assumes no liability for any damages of any kind arising out of the use of the information in this document. ® ® ® TM TM Copyright © 2014 Spansion. All rights reserved. Spansion , the Spansion logo, MirrorBit , MirrorBit Eclipse , ORNAND and combinations thereof, are trademarks and registered trademarks of Spansion LLC in the United States and other countries. Other names used are for informational purposes only and may be trademarks of their respective owners. 30 FM3_ AN709-00015-1v0-E, Feb 26, 2015