Model Predictive Control of Electric Drives -
Design, Simulation and
Implementation of PMSM Torque Control
LEVENTE ZSOLT PAP
KTH ROYAL INSTITUTE OF TECHNOLOGY
SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE
Model Predictive Control of Electric Drives - Design, Simulation and Implementation of PMSM Torque Control
Levente Zsolt Pap lzpap @kth.se
September 25, 2018
Abstract
The thesis deals with the design of a permanent magnet synchronous machine controller that is implemented on an embedded platform to replace the off-the-shelf controller currently being used in the electric race car of the KTH Formula Student team. Software implementation of the control algorithm was tested in laboratory environment on the hardware prototype of a 2-level three-phase voltage source inverter.
Field oriented control and finite control set model predictive control algorithms were implemented in simulation environment. The latter performed better in terms of reducing switching activity and torque ripple, but needs vastly more computational resources due to its nature of being an online optimization problem. Trade-off curve of phase current harmonic distortion and switching activity showed that the model prediction control algorithm performs better in the low frequency range (1-20 kHz). Obtained simulation results were used for power electronics component selection.
Field oriented control was implemented on a TMS320F28335 DSP. SPI communication was employed to configure gate driver circuits and perform error handling. The DSP program follows interrupt based organization and the main control loop runs on the variable frequency of the pulse width modulation.
Low voltage test results on three-phase inductive-resistive load showed that the controller outputs sinusoidal current. Efficiency measurement, high voltage and motor testing were hindered by interference from the Silicon-Carbide MOSFETs that prohibited correct operation of hardware.
Keywords
PMSM, Field Oriented Control, Model Prediction Control, Inverter, Electric Drive, DSP
Abstract
Den här uppsatsen handlar om designen och implementeringen av en motorstyrning för en permanen- magnetiserad synkronmotor, med syfte att ersätta standardmotorstyrningsenheten i KTH Formula Students tävlingsbil. Implementationen av styralgoritmen testades experimentellt tillsammans med en prototyptillverkad frekvensomriktare i labbmiljö.
Regleralgoritmer för field oriented control och finite control set model predictive control implementerades och testades i simuleringsmiljö. Den senare algoritmen visade sig prestera bättre i form av lägre vridmomentsoscillationer trots lägre switch-frekvens men den kräver samtidigt mer beräkningskraft.
Övertonsinnehållet (THD) i fasströmmarna som funktion av switchfrekvensen undersöktes för de båda regleralgoritmerna, algoritmen för model predictive control gav lägre THD vid lägre frekvenser (1-20 kHz).
Simuleringsresultaten användes för att motivera valet av komponenter till frekvensomriktaren.
Regleralgoritmen för field oriented control implementerades och testades experimentellt med hjälp av ett utvecklingskort (TMS320F28335) från Texas Instruments. SPI-kommunikation användes för att konfigurera drivkretsana samt för att utläsa felkoder. Experimentalla tester som utfördes på låg spänningsnivå visade att strömmen till lasten var sinusformad. Mätning av verkningsgrad och provning tillsammans med motorn på en högre spänningsnivå gick inte att genomföra på grund av att de snabba switchförloppen i kiselkarbidtransistorerna störde ut motorstyrningen.
Nyckelord
PMSM, Field Oriented Control, Model Prediction Control, Inverter, Electric Drive, DSP
Acknowledgement
This thesis could not have been carried out without the enormous support and help I had received from many great people. I would like to thank Christian Dubar for his guidance as a supervisor and the many hours he spent on putting his experience to work to help me succeed. I am grateful to Oskar Wallmark for giving me the chance to work in the facilities of the Department of Electric Power and Energy System at KTH. The kind and helpful members of the department always looked for ways to support our project and without them, safe testing would have been impossible. Special thanks to Stefan Bosnjak for his assistance in the laboratory. Furthermore, many thanks to Ragnar Tollin, my project partner, for his work on the hardware side and his great work attitude. I would like to thank Roger Ericsson and ÅF Digital Solutions AB for providing support, equipment and office space to write my thesis. Thanks to the people at ÅF headquarters for making the daily work smooth and fun. I would also like to thank Peter Witrén and Mattias Andersson for sharing their views on the project and giving helpful advice on how to proceed with design decisions.
Big thanks to Max Ahlberg and the entire KTH Formula Student Team for quickly answering the questions in connection with the project.
Nevertheless, I would like to thank the European Institute of Innovation and Technology for granting
me the scholarship to complete my master’s education at EIT Digital Master School. The inspiring people I
have met there enlightened my view on the future of technology and sparked my interest towards the digital
world. Finally, I would like to thank my family and friends for supporting me during this incredible two
year adventure which has come to an end now.
Contents
1 Introduction 1
1.1 Background . . . . 1
1.2 Problem description . . . . 2
1.3 Purpose . . . . 2
1.4 Goal . . . . 2
1.5 Method . . . . 2
1.6 Stakeholders . . . . 2
1.7 Delimitations . . . . 2
1.8 Requirements of KTH Formula Student Team . . . . 3
1.9 Outline . . . . 4
2 Theoretical Background 5 2.1 Modelling of Permanent Magnet Synchronous Machines . . . . 5
2.1.1 Magnetic Motive Force . . . . 6
2.1.2 Voltage equation . . . . 7
2.1.3 Stationary Reference Frame . . . . 8
2.1.4 Synchronous Reference Frame . . . . 9
2.1.5 Electromagnetic Torque . . . . 10
2.2 Voltage Source Inverter . . . . 12
2.3 Modulation Techniques . . . . 12
2.3.1 Pulsewidth Modulation . . . . 12
2.3.2 Space Vector Modulation . . . . 13
2.4 Control Methods . . . . 14
2.4.1 Vector Control/ Field Oriented Control . . . . 15
2.4.2 PI Controller Design for FOC . . . . 15
2.4.3 Discretization of Current Controller . . . . 19
2.4.4 Anti-windup Mechanism . . . . 20
2.4.5 Model Predictive Control . . . . 20
2.4.6 FCS-MPC Algorithm . . . . 23
3 Simulation Study of FOC and MPC in Matlab/Simulink 28 3.1 Machine and VSI Models . . . . 28
3.1.1 Permanent Magnet Synchronous Motor Model . . . . 28
3.1.2 Current Controller . . . . 29
3.1.3 PWM Generator . . . . 29
3.1.4 Voltage Source Inverter . . . . 30
3.2 Simulation of Field Oriented Control . . . . 30
3.3 Simulation of Model Predictive Control . . . . 32
3.3.1 Matlab Implementation of FCS-MPC Algorithm . . . . 32
3.3.2 Simulation Results . . . . 32
4 Implementation of PMSM Torque Controller 38 4.1 Selection of Embedded Architecture . . . . 38
4.2 Main Program Organization . . . . 39
4.2.1 System Initialization . . . . 40
4.2.2 Gate Driver Initialization through SPI . . . . 41
4.2.3 Inverter Protection Function . . . . 44
4.2.4 The FOC Control Loop . . . . 44
4.2.5 Error Handling (DIAG pins) . . . . 47
4.3 Peripheral Modules for Motor Control . . . . 47
4.3.1 Pulse-Width Modulation Module . . . . 47
4.3.2 Analogue to Digital Conversion Module . . . . 49
4.3.3 Encoder Module . . . . 50
5 Testing the Prototype 53
5.1 Hardware Setup of the Prototype . . . . 53
5.1.1 Protection of GPIO pins . . . . 54
5.2 Dummy Load Testing of the Controller . . . . 55
5.3 Investigation of Some H/W Related Problems . . . . 57
5.3.1 Register Error on Low Voltage Side . . . . 57
5.3.2 Register Error on Isolated Side . . . . 57
5.3.3 SPI Communication Error . . . . 58
6 Discussion and Conclusion 59 6.1 Future Work . . . . 59
6.1.1 Suggestions on Interference Problems . . . . 59
6.1.2 Further Testing . . . . 60
6.1.3 Implementation of MPC Torque Controller . . . . 60
A Appendix 63
List of Acronyms and Abbreviations
This document requires readers to be familiar with the following terms. For clarity they are summarized and a short description of them is given before presenting them in next sections.
PMSM Permanent Magnet Synchronous Machine
BLAC Brushless Alternate Current
DSP Digital Signal Processor
DSC Digital Signal Controller
MCU Microcontroller Unit
ICE Internal Combustion Engine
EV Electric Vehicle
VSI Voltage Source Inverter
PWM Pulsewidth Modulation
SPWM Sinusoidal Pulsewidth Modulation
SVM Space Vector Modulation
MMF Magnetive Motive Force
SISO Single Input Single Output
MIMO Multiple Input Multiple Output
MPC Model Predictive Control
FCS Finite Control Set
THD Total Harmonic Distortion
DMA Direct Memory Access
ADC Analog to Digital Converter
QEP Quadrature Encoder Pulse
GPIO General Purpose Input/Output
FPU Floating Point Unit
SPI Serial Peripheral Interface
CAN Controller Area Network
PIE Peripheral Interrupt Expansion
PLL Phase-locked Loop
CCS Code Composer Studio
1 Introduction
Electrification within the automotive industry is an important challenge of the 21
stcentury that could lead to significant reduction in air pollution and thus increase quality of life, especially in larger cities. As the industry moves from traditional internal combustion engine (ICE) powered drive systems to hybrid and fully electric drive systems, lot of development is needed from manufacturers to satisfy customer needs of operating range and reliability in case of regular road vehicle or performance in case of a racing application.
Battery production costs are falling as technology matures that provides a great foundation to the spreading of EVs and corresponding infrastructure such as charging stations.
Transition from ICE drives to electric means less emission of greenhouse gases, better quality of air in highly populated urban areas, the possibility of using renewable energy sources to power vehicles and so on. 23% of all CO
2emission related to energy is coming from transportation [1] and this number is only projected to rise 50% by 2030 and more than 80% by 2050 unless mass adoption of electric vehicles succeeds.
Today probably the biggest hindering factor is lack of infrastructure for vehicle charging which combined with low range capabilities of current EVs make them less attractive from comfort perspective than ICE vehicles. [2] proposes eRoads, an Inductive Power Transfer (IPT) system that could charge EVs directly from the road hence reducing energy storage elements in the vehicle. Many countries, including Sweden [3], are experimenting with such systems that indicates that the future of transportation is definitely electric.
An electric power train of an EV consists of a battery pack that is built from smaller energy storage cells, power electronics that handle transmission of electrical energy from the battery to the third component, the electric motor itself. This motor then converts electrical energy into mechanical energy that is used to accelerate the vehicle. The element between the battery and the motor is often referred to as motor controller or inverter. This device creates alternating voltage within the motor’s stator windings from the direct voltage of the battery. It consists of a voltage source inverter (VSI) that draws current through the windings of the motor. In case of the most common permanent magnet synchronous machine (PMSM) applications, the VSI is constructed from 3 half bridges connected in parallel to an input capacitor, a gate driver circuit that is switching the transistors in the VSI and a control board that measures related quantities, calculates the required control action, generates control signals accordingly and takes care of the communication with other systems in the car (e.g. torque request from accelerator pedal).
Given are a permanent magnet motor and a voltage source inverter to draw current through the motor phases, but to determine required switching activity for a given control objective a control algorithm is needed. Several ways of controlling a PMSM have been proposed [4][5][6] in literature. An overview of these methods is given in Section 2.3 highlighting the potential benefits and shortcomings of each scheme.
Improving the performance of the common way of PMSM control, field oriented control (FOC) is still an ongoing and an active research area with focus on achieving more accurate and precise control. Sensorless operation and online adjustment of control parameters due to parameter variations, magnetic saturation or stray-load losses are studied to create more robust control systems [7]. The concept of Model Predictive Control (MPC) for electric drive systems has been around since the early 2000s [6][8], but it has gained traction and sparked more and more interest among researchers [9][10][11] in the recent years as online computational burdens in embedded controllers seem to disappear due to advances in semiconductor devices.
Simple controller design, ease of customizability and inherent non-linearity forecast a fruitful future of MPC for electric drives.
In case of the KTH Formula Student car, the PMSMs are torque controlled and the drive is sensored.
The MCU receives a torque reference signal via CAN bus from either the accelerator pedal located at the driver’s feet or from the central computing unit when the car is driving itself. Then it is the task of the MCU to produce such an output torque on the shaft of the machine. Produced torque of a PMSM is proportional to the stator current, therefore in this project current control method is designed, studied and implemented.
1.1 Background
This thesis deals with the design, implementation and optimization of a custom built PMSM controller that will be used in a race car built by the students of KTH University of Technology. The race car itself is competing in the Formula Student [12] series, where student engineering teams apply the learning-by-doing principle while creating a cutting edge racing car. (The team AMZ currently holds the world record of 0-100 km/h acceleration with 1.513 seconds.)
The whole inverter project is carried out by the author and another thesis worker in close collaboration,
but with focusing on different parts of the system. ÅF AB provides technical supervision, office space and support throughout the project as a part of their sponsorship of the KTH Formula Student Team [13].
1.2 Problem description
Electric motors are used in many various applications with vastly different performance and characteristics requirements. The Formula Student competition also consists of different challenges such as drag race, slalom, endurance, cost, self driving abilities and so on. Given the set of requirements of the car and the drive system from the KTH FS Team, which control method and algorithm should be used to best optimize for a selected performance indicator?
1.3 Purpose
The thesis discusses common PMSM motor control techniques as well as embedded control architectures and investigates their effect on performance such as efficiency or speed. The aim of this thesis is to build deeper understanding of electric motor control in order to help further development and electrification of drive systems.
The thesis also describes the work with designing a prototype controller for the motors used by the KTH FS Team. This part serves as a practical guide for the future development, as the motor control system is designed to be as modular as it can be to make future development of subsystems easier.
1.4 Goal
Primary goal of the project to design and build a prototype motor controller that can be used by the KTH FS Team to replace their off-the-shelf motor controller and hence to introduce custom features like data collection or built in current and voltage limitations.
Nevertheless, an important goal is to build competence within the field that ÅF can use to satisfy their customers who are the advocates of electrification. To comply with energy saving trends and Formula Student regulations, the built motor controller should be able to operate in regenerative braking mode. In this case kinetic energy is transformed back into electric energy by the motor and flows back to the battery.
1.5 Method
First, a literature study is carried out to find the theoretical answer to the research question. After this, implementation of a simple control algorithm is done on a prototype to get familiar with the implementation platform and to fulfill the requirements of the KTH Formula Student Team. Once the prototype is tested and verified, more advanced control algorithms can be implemented on the same hardware to compare their performance.
1.6 Stakeholders
KTH Formula Student Team
The motor controller is built for the motors the team uses in the new electric race car. They supply the requirements and act as a final customer for the end product.
ÅF Technology
Provides technical support, funding and office workstation for the project. ÅF is interested in building competence within the field of EVs and electric motors to later use this knowledge for their customers.
KTH Department of Electric Power and Energy Systems
Supervises the thesis work from the academic point of view, provides technical guidance and offers laboratory for prototype assembling and testing.
1.7 Delimitations
This thesis is carried out as a two person project and therefore is divided into two parts. Figure 1 draws
the handover line between the two subsystems. Current thesis deals with the control and communication
module, hence power electronics (gate drivers, VSI board, input capacitor bank, furthermore high voltage
and current sensing) is part of the other thesis. However, these two topics are often interleaved and dependent
Power electronics
Control card Gate drivers Battery Power
Input Capacitor
Bank VSI Filter PMSM
Motor
Capacitor Bank
Measurements
Voltage Temp Current
PWM SPI Fault
management
ADC Inputs
ADC Motor Temp.
Digital Encoder Input
CAN DSC Transciever
Level Scaling for ADC Status Indicator
LEDs Galvanic Isolation
Rotor Position
&Motor Temp.
Position&Speed
Torque Request
Error & Statistics Project Handover Line
Figure 1: Overview of the proposed system. Project Handover Line defines the boundary between the responsibilities of the two people working on the project. Current thesis deals with the part below the line.
on each other therefore both theses may use information from the other. Just to mention an example, pre- programmed dead band of inverter leg switches in the DSP control software depends on the rise and fall times of employed switching devices that are chosen and evaluated in the other thesis.
1.8 Requirements of KTH Formula Student Team
KTH Formula Student contends in the Formula Student competition and therefore has to adhere to its rules and regulations [14]. The essence of the rules regarding the electric powertrain and thus requirements of the system for this project:
• Maximum power drawn from the battery must not exceed 80 kW.
• As this maximum 80 kW distributes between the two motor on the rear shaft, one motor controller should be designed for 40 kW continuous power and 60 kW peak power. Torque vectoring is used therefore it can happen that in a sharp turn, power is distributed unequally between the two motors.
• Battery voltage is 580.5 V DC available in the car. Maximum battery voltage allowed is 600 V DC.
• Hard coded voltage and current limits should be enforced by the controller. Internal motor controller/inverter signals must not exceed 620 V DC.
• The controller should be able to receive torque request from the control unit of the car via CAN communication. Requested torque can be negative as well.
• Controller should be able to send statistical data (motor and inverter temperature, etc.) and error
messages to the control unit of the car via CAN.
• Bidirectional energy flow should be made possible, that is, regenerative braking mode should be implemented.
• Water cooling is available on the car for the motor and for the inverter. High power switching devices should be water cooled.
Table 1: System parameters from KTH Formula Student
Parameter Value
Battery voltage 580.5 V
Number of motors 2
Motor type EMRAX 207
Nominal power per motor 40 kW
Peak power per motor 60 kW
Cooling system On-board water cooling
Cooling water maximum input temperature 50°C
Cooling flow rate 8 l/min
Table 2: EMRAX 207 Motor parameters from manufacturer datasheet [15]
Parameter Value
Peak motor power 80 kW
Maximum battery voltage 600 V
Maximal rotation speed 7000 RP M
Continuous motor torque 80 N m
Continuous motor current 100 A(rms)
Ld 125 µH
Lq 130 µH
Internal phase wire resistance at 25°C 12.0 mΩ
Magnetic flux - axial 0.0393 V s
Number of pole pairs 10
Motor inertia 256 kgcm2
Temperature sensor in the motor kty 81/210
1.9 Outline
Chapter 1 introduces the topic of the thesis and declares the goal and purpose of the work. Chapter
2 discusses theory of electric motors, control algorithms and the power electronic devices that are used
in electric drives. Chapter 3 explains how to build simulation models in Matlab/Simulink to perform
preliminary testing of two different control algorithms for the same PMSM. Controller design methods are
also discussed and simulation results are presented to compare vector control and model predictive control
strategies. Chapter 4 presents embedded controller architecture for electric motor control and discusses
implementation of the vector control algorithm on a chosen platform. Hardware and software components
of a prototype implementation are explained as well. Chapter 5 contains test evaluation of the implemented
system and discusses the problems that were encountered during laboratory work. Chapter 6 deals with
discussion of the obtained results throughout the project and discloses information on the remaining work.
2 Theoretical Background
Electric machines have been used for many years in the industry as actuators, engines or generators. The basic concept of all electric machine is the same - create magnetic fields in the stator and the rotor in such a way that the two interfere with each other, producing mechanical torque.
They can be classified into two main categories: direct current (DC) motors and alternating current (AC) motors. DC motors are most widely used as actuators, for example opening the door of a car, moving the windshield wiper blades or rolling down the windows. DC motors operate from direct voltage and draw direct current from the supply. AC machines operate from alternating voltage supply, therefore they can be fed with voltage rectified from the AC mains. AC machines have no brushes, less moving parts, require less maintenance, can operate in combustible environments, furthermore they have wider operating range.
Machinery and transport are among the mainstream application areas.
Another way to classify electric motors is how the magnetic field is generated in the rotor. In DC machines, current is mechanically commutated by a commutator ring that uses sliding brushes. By letting current flow through the rotor windings, a magnetic field is created that interacts with the one from the stator. Just when the resulting magnetive motive force would align the rotor and the stator, the commutator changes polarity in the rotor causing the rotor and the stator field to be out of alignment hence producing torque.
AC motors are electronically commutated and some of them require more sophisticated power electronics devices to run. AC Induction machines are asynchronous meaning that the rotor is lagging behind the stator, the speed difference is called slip. These machines use specially manufactured rotors that contain conductor poles that produce currents due to the changing magnetic field of the stator and the slip. According to Lorentz’s law, these currents will create a magnetic field that will in turn try to act against the magnetic field that causes them, hence producing torque. Self-excited or switched-reluctance motors are synchronous.
They contain a rotor cast of steel that has notches or teeth and this allows the rotor to lock in and rotate with the speed of stator’s magnetic field.
The third option is to equip the rotor with permanent magnets that produce the magnetic field. This can be exploited in synchronous motor designs. Stator windings produce magnetic field that enters the airgap and produces torque if the magnetic poles of the rotor and the stator are not aligned. This means that the stator voltage and current have to be controlled in order to produce continuous torque.
In electric vehicles there is no possibility of running the machines from alternating voltage supply, batteries are fitted in the cars that supply direct voltage and current. Hence, power electronics is needed to create alternating voltage from the DC voltage of the batteries. Such a device is called an inverter. Many topologies exist today, but for PMSMs, the most widely used one is the 2-level three phase voltage source inverter. They consists of three half bridge legs each containing two switching devices such as IGBTs or MOSFETs. In this thesis, a new generation of MOSFETs are going to be used, namely Silicon-Carbide (SiC) MOSFETs. Mass market adoption of SiCs has not happened yet due to high costs and limited manufacturing capabilities. However, academia [16] has proved that these devices have a bright future due to their superior performance. Lower losses within the switching circuit means less power and heat dissipation that decreases size of passive heat sinks or flow requirements of water cooling. Overall, this contributes to enhanced efficiency of SiC inverters that can exceed 99.5% [17].
Various control strategies exist today for PMSM control such as field oriented vector control, direct torque control and several variations of model predictive control, often combined with the former two. Each has their advantages and limitations, the best method is always chosen based on the requirements of the application. MPC algorithms however make it easy to implement combined control objectives and non- linear control. With the more and more powerful embedded computers, engineers and researchers now have enough computational resources at their disposal to develop advanced and novel controllers based on model prediction algorithms.
2.1 Modelling of Permanent Magnet Synchronous Machines
In the following, mathematical model of a three phase Y-connected PMSM will be explained. The model is
needed for future controller design and an essential element of any model prediction algorithm. The better
the model of the machine is, the more accurate control can be achieved.
Figure 2: Schematic cross section of PMSM
2.1.1 Magnetic Motive Force
PMSM consists of three phase Y-connected stator windings shifted by 120°electrical degrees along the perimeter as it can be seen in Figure 2. Due to the specially distributed windings in the stator, if sinusoidal current flows through the windings, sinusoid magnetic motive force (MMF) distribution is created according to Ampere’s law [18]. Currents flowing through the stator windings are
i
a(t) = I
scos(ωt + φ
0) (2.1)
i
b(t) = I
scos(ωt + φ
0− 2π/3) (2.2)
i
c(t) = I
scos(ωt + φ
0− 4π/3), (2.3)
where I
s, ω and φ
0are the amplitude, frequency and initial angle of the phase currents respectively. These phase currents produce the following phase MMF:
F
a(t) = N
si
a(t) = F
mcos(ωt + φ
0) (2.4) F
b(t) = N
si
b(t) = F
mcos(ωt + φ
0− 2π/3) (2.5) F
c(t) = N
si
c(t) = F
mcos(ωt + φ
0− 4π/3), (2.6) where F
m= N
sI
sis the peak magnitude of the MMF and N
sis the number of turns in the stator coils. At a certain position θ, which is the magnetic axis of phase a in Figure 2, MMF from the the different phase windings are
F
a(t) = F
mcos(0 − θ) (2.7)
F
b(t) = F
mcos(2π/3 − θ) (2.8)
F
c(t) = F
mcos(4π/3 − θ). (2.9)
The total resultant MMF at the position θ is the summation of Equations (2.7)-(2.9), that yields
F (t)
θ= F
a(t)cos(−θ) + F
b(t)cos(2π/3 − θ) + F
c(t)cos(4π/3 − θ). (2.10) From Euler’s Formula for complex numbers it follows that,
cos(−θ) = Re{e
−jθ} (2.11)
e
−jθ= cos(θ) − jsin(θ), (2.12)
and Equation (2.10) can be represented as
F (t)
θ= Re{F
a(t)e
−jθ+ F
b(t)e
−j(θ−2π/3)+ F
c(t)e
−j(θ−4π/3)}
= 3 2 Re{ 2
3 (F
a(t) + F
b(t)e
j2π/3+ F
c(t)e
j4π/3)e
−jθ}. (2.13)
Thus the space vector of the three phase peak MMF is
− → F (t) = 2
3 (F
a(t) + F
b(t)e
j2π/3+ F
c(t)e
j4π/3). (2.14) Substituting (2.4)-(2.6) into (2.14) gives a clearer and more expressive form of the peak MMF vector − →
F (t):
−
→ F (t) = 2
3 (F
a(t) + F
b(t)e
j2π/3+ F
c(t)e
j4π/3)
= 2
3 F
m{cos(ωt + φ
0) + cos(ωt + φ
0− 2π/3)e
j2π/3+ cos(ωt + φ
0− 4π/3)e
4π/3}
= F
me
j(ωt+φ0).
(2.15)
Equation (2.15) shows that − →
F (t) is a rotating vector in the complex plane. It is important to note that three phase quantities can be expressed as a rotating vector with constant magnitude, as this will be utilized later in the report. At any angle θ, the magnitude of the projection of − →
F (t) on the position θ is − → F (t)
θ.
−
→ F (0)
θ= F
mcos(θ). (2.16)
2.1.2 Voltage equation
With a similar approach to the three-phase MMF space vector derivation, three-phase stator current and voltage can be given as
−
→ i
s= 2
3 (i
a(t) + i
b(t)e
j2π/3+ i
c(t)e
j4π/3) (2.17)
−
→ v
s= 2
3 (v
a(t) + v
b(t)e
j2π/3+ v
c(t)e
j4π/3) (2.18) where v
a(t), v
b(t) and v
c(t) are the phase voltages (line to neutral) and i
a(t), i
b(t) and i
c(t) are the phase currents respectively.
In case of a PMSM, the stator flux is created by two different factors. First one is generated due to the current in the stator windings, the second however is created by the permanent magnets of the rotor. This can be seen in
− →
ϕ
s= L
s− →
i
s+ φ
mge
jθe, (2.19)
where − ϕ →
sis the stator flux space vector, L
sis the sum of leakage and mutual inductance, φ
mgis the amplitude of the flux induced by the permanent magnets of the rotor and θ
eis the electrical angle.
The stator voltage equation written in space vector form is
−
→ v
s= R
s− → i
s+ d− ϕ →
sdt , (2.20)
where − → v
sis the stator voltage, R
s− →
i
sis the voltage drop on the stator resistors and
d−dtϕ→sis the induced voltage due to the changing magnetic flux. Taking the derivative of the latter term from (2.19):
d− ϕ →
sdt = L
sd − → i
sdt + d(φ
mge
jθe) dt
= L
sd − → i
sdt + jω
eφ
mge
jθe.
(2.21)
Replacing the flux derivative in (2.20) with (2.21), the voltage equation of PMSM in vector form becomes
−
→ v
s= R
s− →
i
s+ L
sd − → i
sdt + jω
eφ
mge
jθe. (2.22)
i
i
di
si
i
qd q
e
Figure 3: Current Space Vectors in d − q and α − β Reference Frame
2.1.3 Stationary Reference Frame
The PMSM is a 3-phase machine with 3-phase voltage and current, as it was described in the previous section. However, controlling machine voltage and current in a 3-phase representation is quite challenging.
To simplify controller design, 3-phase quantities are transformed into different coordinate systems. One of them is the α − β complex stationary representation frame, that has its real (α) axis aligned with the magnetic axis of the coil of phase a (see Figure 2) and imaginary axis (β) in quadrature.
Voltage and current vectors in this representation are obtained by projecting the 3-phase vectors onto α and β axes:
−
→ v
s= v
α+ jv
β(2.23)
−
→ i
s= i
α+ ji
β, (2.24)
while the voltage equation in α − β reference frame comes from substituting (2.23) and (2.24) into (2.22) and separating real and imaginary quantities:
−
→ v
α= R
s− →
i
α+ L
sd − → i
αdt − jω
e(t)φ
mgsinθ
e(2.25)
−
→ v
β= R
s− →
i
β+ L
sd − → i
βdt + jω
e(t)φ
mgcosθ
e(2.26)
Clarke transformation is used to obtain voltage and current in α − β reference frame from the original three phase variables. It projects the three phase variables onto the stationary frame. The matrix equation describing the transformation of currents (similar for voltages) is
i
αi
βi
0
= C
i
ai
bi
c
= 2 3
1 −
12−
120
√ 3
2
−
√ 3 1 2
2 1 2
1 2
i
ai
bi
c
. (2.27)
C is the transformation matrix, i
0represents the zero sequence component of three phase currents and it is zero for balanced three phase systems. The factor
23is there in the equation to guarantee energy conservation. To obtain phase variables from variables in the stationary reference frame, inverse Clarke transformation is used:
i
ai
bi
c
= C
−1
i
αi
βi
0
=
1 0 1
−
12√3
2
1
−
12−
√ 3
2
1
i
αi
βi
0
. (2.28)
And it follows that
CC
−1= 2 3
1 −
12−
120
√3
2
−
√3 1 2
2 1 2
1 2
1 0 1
−
12√ 3
2
1
−
12−
√3
2
1
=
1 0 0 0 1 0 0 0 1
= I. (2.29)
It has to be noted that currents and voltages are still sinusoidal in the stationary reference frame, as there is a direct connection between the original three phase variables and them.
2.1.4 Synchronous Reference Frame
To describe currents and voltages with DC values for the ease of control, the choice of coordinate system is crucial. Scalar controlled variables greatly simplify controller design, as traditional linear controllers (PID) can only deal with such variables. However, calculating Park-Clarke transformation requires computational effort in every control step and accuracy of control loop depends also on the precision of rotor position sensing.
With the rapid development of Digital Signal Processors (DSPs) and dedicated hardware accelerators this challenge has been tackled by researchers and engineers.
Obtaining the synchronous reference frame from the stationary, α − β axes have to be rotated counter- clockwise on Figure 3 by θ
e, that is the rotor position angle. The rotor of the motor runs at the same speed as the supplying frequency of the stator in steady state, hence the name synchronous reference frame. It is also called d − q reference frame after the axes. The direct axis (d) is aligned with the rotating flux vector produced by the permanent magnets of the rotor and the q axis is in quadrature. Rotation of the α − β frame in counter-clockwise can be described by multiplication by e
−jθemathematically. The new space vectors in the d − q reference frame are
−
→ v
s0= − → v
se
−jθe= v
d+ jv
q(2.30)
−
→ i
s0= − →
i
se
−jθe= i
d+ ji
q, (2.31)
where − → v
s0and − →
i
s0are the voltage and current space vectors in the synchronous frame. Multiplying the voltage equation (2.22) by e
−jθeleads to
−
→ v
se
−jθe= R
s− →
i
se
−jθe+ L
sd − → i
sdt e
−jθe+ jω
eφ
mg. (2.32)
Considering, that
−
→ i
s0= − → i
se
−jθetaking the derivative of both sides and rearranging the equation:
d − → i
sdt e
−jθe= d − → i
s0dt + jω
e− →
i
s0(2.33)
From (2.32) and (2.33), the voltage equation in the d − q reference frame is
−
→ v
s0= R
s− →
i
s0+ L
sd − → i
s0dt + jω
eL
s− →
i
s0+ jω
eφ
mg. (2.34)
Substituting (2.30) and (2.31) into (2.34) leads to the dynamic model of PMSM in the d − q reference frame:
v
d= R
si
d+ L
sdi
ddt − ω
eL
si
q(2.35)
v
q= R
si
q+ L
sdi
qdt + jω
eL
si
d+ ω
eφ
mg. (2.36) The two parts were obtained by sorting real and imaginary variables into different equations.
The relationship between d − q reference frame and α − β reference frame is described by the Park
transformation as d − q frame is the rotating version of the α − β frame with ω
espeed. θ
edescribes the
mathematical connection between them, as it is the angle enclosed by them and also the electrical angle of
the rotor. Current and voltage relations are:
"
v
dv
q#
=
"
cosθ
esinθ
e−sinθ
ecosθ
e# "
v
αv
β#
(2.37)
"
i
di
q#
=
"
cosθ
esinθ
e−sinθ
ecosθ
e# "
i
αi
β#
, (2.38)
Calculating stationary reference frame values from synchronous, inverse Park transformation has to be applied:
"
v
αv
β#
=
"
cosθ
e−sinθ
esinθ
ecosθ
e# "
v
dv
q#
(2.39)
"
i
αi
β#
=
"
cosθ
e−sinθ
esinθ
ecosθ
e# "
i
di
q#
. (2.40)
To directly obtain synchronous reference frame values from three phase variables, combined Park-Clarke transformation can be used. Applying Clarke (2.27) and Park (2.38) to currents leads to:
"
i
di
q#
=
"
cosθ
ecos(θ
e−
2π3) cos(θ
e−
4π3)
−sinθ
e−sin(θ
e−
2π3) −sin(θ
e−
4π3)
#
i
ai
bi
c
. (2.41)
2.1.5 Electromagnetic Torque
The permanent magnets of the rotor are usually mounted either on the surface of the rotor or they are mounted inside the rotor structure. In the former case, due to the uniform air gap distribution d − q frame inductances are the same and equal to the phase inductance:
L
d= L
q= L
s. (2.42)
Stator flux in d − q is obtained by rotating flux vector in α − β frame by θ
e, that is:
− → ϕ
s0= − ϕ →
se
−jθe= L
s− → i
s0+ φ
mg, (2.43)
where φ
mgis the flux induced by the permanent magnets of the rotor. Expressed with d − q variables, the real and imaginary part of the previous equation becomes
ϕ
d= L
si
d+ φ
mg(2.44)
ϕ
q= L
si
q. (2.45)
As it can be seen from (2.45), φ
mgis aligned with the rotor and therefore its q axis component is zero.
Electromagnetic torque of a machine is calculated as the cross product of stator flux and current space vectors. In d − q frame it becomes
T
e= 2
3 Z
p− ϕ →
s0⊗ − → i
s0, (2.46)
where Z
pis the number of pole pairs. The cross product yields
− → ϕ
s0⊗ − →
i
s0=
ϕ
dϕ
q0
⊗
i
di
q0
=
0 0 ϕ
di
q− ϕ
qi
d