How to use MCU to realize 3-Phase_PMSM_sensor-less_FOC control

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