0% found this document useful (0 votes)
44 views187 pages

Control of Electric Drives - D. Ramírez

Uploaded by

Carlos Navarro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views187 pages

Control of Electric Drives - D. Ramírez

Uploaded by

Carlos Navarro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 187

Universidad Politécnica de Madrid

E SCUELA T ÉCNICA S UPERIOR DE I NGENIEROS


I NDUSTRIALES

C ONTROL OF E LECTRIC D RIVES

Course Notes

Author:
Dionisio Ramírez

May 2023
Chapter

1
Controlling an Electric Drive. An overview.

Dionisio Ramírez

Abstract

Control of electric drives is a multidisciplinary area that involves many subjects such
as physics, power electronics, electrical machines, control algorithms, low and high-
level programming in C-language, knowledge of hardware of microcontrollers, knowledge
about sensors such as Hall effect current and voltage sensors, encoders, resolvers, etc.
This first chapter is devoted to providing the reader with an overview of the different parts
involved in the feedback control of an electric drive, their tasks, alternatives, etc.

1.1. Feedback control system


Electrical machines (motors and generators alike) are controlled using electric drives
made up of an electronic converter and a control system (usually software implemented
in a microcontroller).
Fig. 1.1 shows a generic electric machine is controlled using a three-phase electronic con-
verter and a digital signal controller (DSC) or specialized microcontroller (MCU).

Figure 1.1. Generic block diagram of electrical machine control.


As can be seen, the MCU measures the stator current and voltage, as well as the speed
and rotor position. The former measurements are carried out using Hall effect sensors
(for both current and voltage), and the latter using an encoder or resolver.
The DSC or MCU is connected to the electronic converter by some kind of driver con-
nected to the leads of the IGBTS. The drivers provide electrical insulation between the
control (with a power supply of just 3.3 V) and the power system (with a DC link voltage
of 700 V or higher).
The control software is stored in internal or external memory (usually Flash memory)
whereas the results of the calculations are stored in real-time in internal RAM memory.
The microcontroller may also need communication buses (CAN, SPI, SCI, I2C, Ether-
net, etc.) to interface with other electronic devices such as Digital to Analog Converters
(DAC), displays, other microcontrollers, etc.
Finally, some type of user interface is also needed to send the speed, torque, magnetic
field, etc. references to the control system. The electronic converter more widely used in
this type of drive is a bidirectional DC/AC power converter made up of six IGBTs and six
diodes connected antiparallel.

1.2. Digital control


In the last century, many control systems were still implemented on hardware, using OP-
amps, resistors, and capacitors to build P-I controllers, filters, PWM signals, etc.
Nowadays, control systems are implemented as software in a microcontroller. There are
several important reasons for that, among them:

1. Software allows us to perform much more complex tasks than hardware. For ex-
ample, the Clarke and Park transforms must be implemented in software or digital
hardware.
2. Software is not affected by electrical noise and radiated electromagnetic interfer-
ence (EMI).
3. The modulation obtained using software can follow more complex rules, for exam-
ple, space vector PWM (SVPWM).

However, software-based control also presents some disadvantages or drawbacks:

1. The cycle time is normally limited by the sampling period, which is normally very
short.
2. The MCU must be powerful enough to compute the entire control algorithm (in-
cluding some iterative calculations to obtain trigonometric values used in the Park
transform) and the communication tasks before the next sampling begins.

In order to improve the throughput of the microcontrollers used in control tasks, the
classical Von Neumann architecture has been abandoned in favor of the modified Harvard
architecture, Fig. 1.2.
Since Von Neumann based CPUs have only one memory bank for both, program and
data, they have to operate in a very sequential way. For example, to carry out the addition
of two operands, the CPU has to fetch the operation code (contained in the instruction) in
memory, bring it to the CPU and decode the operation to carry out. Then it has to bring
the first operand from memory to an internal register. Next, it has to bring the second
operand from memory to another register. Finally, the CPU carries out the addition, ob-
tains the sum of both operands, and stores the result in another register.

Figure 1.2. Harvard architecture, modified to add I/O and peripherals.

By contrast, the Harvard architecture features two memory banks, one containing only
data and the other containing program and data. In addition, it features cache memory to
store repetitive instructions to avoid repetitive fetches in memory.
The addition of two operands is performed much faster than in Von Neumann architecture
since repetitive operation codes are stored in cache memory and the operand is fetched
and brought to the CPU at the same time, in parallel, accessing both data memory banks
at the same time.
Furthermore, Harvard-based CPUs are able to carry out one addition and one product in
the same (just one) clock cycle using the highly specialized MAC (multiplication and ac-
cumulation) instruction, which greatly accelerates the most used mathematical operation
in digital control.
The MCU throughput is a key factor in control systems due to the great number of math-
ematical operations that a control algorithm involves. In Fig. 1.3, an induction motor
vector control is shown. In this control diagram, all the control blocks are ultimately
programmed in C language in the microcontroller and must be computed between two
sampling times, which is a very short time interval.
Figure 1.3. Vector control of an induction motor.

In order to make programming efficiently easier, many manufacturers make available


custom code for the most common blocks, such as Clarke and Park transforms, speed
estimators, space vector modulators, etc. taking advantage of their knowledge about their
own CPU hardware, see Fig. 1.4.

Figure 1.4. Motor control diagram made up of custom-code blocks provided by


Texas Instruments.

Initially, MCUs were relatively simple, built around a fixed-point CPU and featuring
a limited number of peripherals. Over time, MCUs became increasingly complex, and
fixed-point CPUs were eventually replaced by floating-point CPUs with math coproces-
sor, large amounts of Flash memory and internal RAM, and peripherals and a secondary
core for communication with the user and other devices.
Three representative examples of MCUs designed specifically for control are shown in
Fig. 1.5, Fig. 1.6, and Fig. 1.7., from more simple to more complex.
The first MCU is a 32-bit single-core floating point microcontroller with modified Harvard
architecture. It features 16 ADC channels, two six-channel PWM outputs, an interface for
encoder, a great number of GPIOs, and communication buses like SPI, SCI, CAN, etc.
This MCU is optimized for processing, sensing, and actuation to improve closed-loop per-
formance in real-time control applications such as industrial motor drives; solar inverters
and digital power; electrical vehicles and transportation; motor control; and sensing and
signal processing.

Figure 1.5. 32-bit single-core MCU in a control card.

The second MCU is a 32-bit dual-core system-on-chip MCU with independent commu-
nication and real-time control subsystems. One core is similar to the one described above
but the second core is an ARM Cortex M3 microcontroller intended for communication
purposes.
The real-time control subsystem is based on Texas Instruments’ proprietary 32-bit floating-
point CPU and features the most flexible and high-precision control peripherals, including
PWMs with fault protection, and encoders and captures.
The communications subsystem is based on the industry-standard 32-bit Arm Cortex-M3
CPU and features a wide variety of communication peripherals, including Ethernet 1588,
USB OTG with PHY, Controller Area Network (CAN), UART, SSI, I2C, and an external
interface.
Figure 1.6. 32-bit dual-core MCU in a control card.

The third MCU is a real-time microcontroller of a family of scalable, ultra-low latency


devices designed for efficiency in power electronics, including but not limited to: high
power density, high switching frequencies, and supporting the use of GaN and SiC tech-
nologies.

Figure 1.7. 32-bit triple-core MCU in a control card.

It comprises a control subsystem (two cores) and a communication subsystem (one


core). The real-time control subsystem is based on a Texas Instruments 32-bit DSP core,
which provides 200 MHz of signal processing performance in each core for floating- or
fixed-point code running from either on-chip flash or SRAM. The CPU is further boosted
by the Trigonometric Math Unit (TMU) and VCRC (Cyclical Redundancy Check) ex-
tended instruction sets, speeding up common algorithms key to real-time control systems
(see last chapter in this course notes). Extended instruction sets enable IEEE double-
precision 64-bit floating-point math. Finally, the Control Law Accelerator (CLA) enables
an additional 200 MHz per core of independent processing ability.
Also, the thirty-two frequency-independent PWMs of the MCU enable control of multiple
power stages, from a 3-phase inverter to advanced multi-level power topologies.
This device also contains an independent Connectivity Manager (CM), based on the ARM
Cortex-M4 processor, that runs at 125 MHz. With its own dedicated flash and SRAM, the
CM allows fully independent control of the interfaces coming in and out of the MCU,
allowing maximum bandwidth for the control subsystem to focus on real-time control.

Field Programmable Gate Array (FPGA) based motor control


In the past two decades, motor control applications have been dominated by software-
based solutions implemented in DSPs due to the low cost and ease of programming.
However, these DSP solutions are facing increasing difficulties to respond to the ever-
increasing computational, functional, and timing specifications that modern industrial
and vehicular applications require [de Castro et al. 2011]. For instance, when single-core
DSP-based solutions need to incorporate complex and time-critical functions, e.g. multi-
motor control, the sequential processing of this approach decreases the controller perfor-
mance, which may compromise the application timing specification. Multi-core DSPs are
a possible alternative to address this concern, but they also add costs and interconnection
complexity. Consequently, in the last years, FPGAs, Fig. 1.8, received an increased inter-
est by the academy and industry as an option to offload time-critical tasks from the DSPs,
or even replace the DSPs control platform by a System on Chip (SOC) based on FPGAs.

Figure 1.8. Xilinx FPGA.

The main motivation behind the FPGA introduction lies in the following properties:

1. Fast processing (in the range of nanoseconds).

2. Typical computational delay (cycle time) of 100 ns.

3. Modularity and parallel capabilities.

4. Hardware reconfigurability for greater flexibility.

Parallel computation, high processing speed, and low computational delay enable a
reduction in execution times of the motor control algorithm, which can be explored to
increase the bandwidth of torque control.
Regarding hardware reconfigurability, the special modulation hardware blocks that multi-
level converters demand are a paradigmatic example of the limitations present in the fixed
DSP architecture. In this case, the FPGA hardware reconfigurability property is pivotal
to effectively solving the multi-level modulation problem by allowing the development of
custom PWM blocks in FPGA logic.

1.3. Control tasks carried out by the digital controller


The MCU of a control system has to perform a number of tasks sequentially. First, it
must measure the stator current and DC voltage and convert them into digital values.
Then, those values are usually digitally filtered and sent to the control algorithm. In a typ-
ical vector control, the next step uses the Clarke and Park transforms to obtain only two
values of the stator current, expressed on the d-q axes. These stator current components
are used by two proportional-integral controllers to obtain new voltage references, also on
the d-q axes. Finally, Finally, these references are added to a feedforward compensation
term and the result is sent to the space vector modulator, which triggers the IGBTs of the
electronic converter. In addition, the MCU has to measure the rotor speed (and sometimes
its position), remove the noise present in the measurement-calculation by digitally filter-
ing it, and send it to the speed control loop.

Digital filtering
Current and voltage measurements are obtained using Hall effect sensors, some auxiliary
circuitry, and the ADC converter present in the MCU. However, due to the EMI generated
by the PWM converters, the length of the cables, etc., there is always some high-frequency
noise present in the measurements. In addition, electronic circuits often add some offset,
or bias, to the signal converted by the ADC. Consequently, it is advisable to remove both
types of noise using digital filters, written in C language, before using the measurements
in the control loops.
The example of Fig. 1.9 shows a noisy signal (black) composed of the stator current (25
Hz), low-frequency noise (250 Hz), and high-frequency noise (1.500 Hz).

Figure 1.9. Noisy signal and the result obtained by two first-order low-pass filters.

After filtering the black signal using a first-order low-pass digital filter, the blue wave-
form is obtained, in which the high-frequency noise has already been removed. After a
second first-order digital low-pass filtering, the resulting red signal shows a clean wave-
form.
Coded in C language, a digital filter entails adding just one more line to the control code
(and saving the values used in this cycle for the next one).

Implementation of transfer functions


When programming a control code, it is sometimes necessary to reproduce the behavior
of a transfer function (in discrete time). For example, Fig. 1.10 shows the step response
of the rotor field vs. rotor current calculated by an MCU. This transfer function is used
by the MCU in the vector control of an induction motor.

Figure 1.10. Step response of a first-order transfer function, obtained using an MCU.

Again, programming a discrete transfer function entails adding only one more line of
code to the main program. Note in Fig. 1.10 the discrete steps that make up the system’s
response due to the digital nature of the control. The size of these steps is more noticeable
as the cycle time used by the digital control increases.

Another very common task is the implementation of Proportional-Integral controllers


in the discrete-time. Fig. 1.11 shows the step response of a first-order transfer function
changed using the corresponding discrete-time code programmed on an MCU.

Figure 1.11. Step response of a first-order transfer function in an MCU obtained


using a PI controller.
Trigonometric calculations
The long computation time required to obtain the trigonometric values used in the Park
transform, i.e., the sine and cosine of the reference frame angle, has always been a bottle-
neck for the CPU.
There have been many approaches to performing these calculations, from using standard
C functions to the interpolation of 256-value tables stored in ROM memory. Nowadays
some MCU feature hardware specifically designed to perform trigonometric calculations
or implement co-processors with a specific set of instructions to speed up the calculations.
Pulse width modulation
The last stage of every motor control system is the modulation of pulses to trigger the
IGBTs in an electronic converter, Fig. 1.13.
For that task, the MCUs use up/down digital counters to generate the carrier waveform
required, and the modulating signal is software generated, and the On/Off time of each
IGBT in an electronic converter is calculated using special routines such as the well-
known Space Vector Modulation (SVM).

Figure 1.12. The IGBTs making up an electronic converter are triggered by sym-
metrical modulated pulses calculated by the MCU.

Communications
Nowadays it is expected that the chosen MCU is able to perform basic chip-to-chip com-
munication (SPI, I2C), wireless communication (Ethernet), and more industry-specific
protocols such as those used in automotive applications (CAN), as well as featuring In-
ternet of Things (IoT) capabilities.

Figure 1.13. Communication buses in an MCU.


1.4. Measurement of electric current, voltage, angular speed, and position
The control of an electric machine requires knowledge of some physical variables such
as the stator current, DC link voltage, rotor speed, rotor position, etc. Which ones are
necessary depends on the chosen control strategy. For example, some algorithms are able
to estimate the rotor speed, making the rotor speed measurement unnecessary. In addition,
since the sum of the three stator currents is always zero, it is only necessary to measure
two of them. Also, it is not necessary to measure the three stator voltages since the MCU
can obtain their values from the DC voltage and the On/Off state of the IGBTs.
Hall effect sensors
The principle of the Hall effect, [Bürkel et al. 2003], was discovered by Edwin Hall in
1879 and states that if two opposite sides of a semiconductor are under a magnetic field
B and a current I flows through two other opposite sides, between the last two sides (see
Fig. 1.14) there is a voltage that satisfies:

VH = K · B · I (1.1)

where K is a constant.
A Hall effect sensor consists basically of a thin piece of rectangular p-type semiconductor
material such as gallium arsenide (GaAs), indium antimonide (InSb), or indium arsenide
(InAs).

Figure 1.14. Principle of the Hall effect.

Open-loop Hall Effect sensors are cost-effective, are small size, and consume minimal
power. Every current-carrying conductor (Fig. 1.15) generates a magnetic field, B, which
is concentrated in a magnetic circuit. This field can be measured in an air gap using the
Hall effect sensor. When the sensor is supplied with a constant current, the output voltage
is proportional to the magnetic flux and this, in turn, is proportional to the current.
Figure 1.15. Industrial grade Hall effect sensor.

Closed-loop sensors offer higher accuracy and speed to measure currents over a wider
range of frequencies. The secondary compensation coil is used to compensate the primary
conductor field so that the total flux is close to zero so it is always in the linear zone. The
circuit accepts DC and AC currents up to the frequency limit of the electronics. This
allows electrically isolated measurements of currents up to several hundred kHz.

Figure 1.16. High precision Hall effect sensor.

In Fig. 1.16, the current Ic is kept constant by the internal circuitry of the sensor, so
the output current, Is , is proportional to the input current, I p . The designer is asked to
calculate the RM value (resistance and power) to satisfy the control circuit requirements
(accepted voltage range, VM ).
Figure 1.17. Hall effect current sensor and a wire through it.

Voltages are measured indirectly by means of a proportional current through the toroid.
For this, the designer must calculate the value of the limiting resistor connected at the
input, between the voltage to be measured and the sensor, so that the maximum input
current is not exceeded, and the resistance that will provide VM at the output of the sensor,
Fig. 1.18. Hall effect voltage sensors offer excellent accuracy, very good linearity, low-
temperature drift, and high immunity to external interferences.

Figure 1.18. Hall effect voltage sensor with the resistances connected at the input
and the output of the sensor.

Incremental encoders
Incremental encoders are sensors for detecting rotary movements, Fig. 1.19. An LED
emits infrared light through a code wheel. When the shaft and the wheel spin, the light is
interrupted once and again, being detected and measured by the receiver. The downstream
electronic circuitry gives shape and amplifies the signals thus generated. The number of
output pulses is a measure of the angle of the encoder.
Figure 1.19. Principle of incremental encoders.

Figure 1.20. Incremental encoder.

Three signals are normally generated by the encoder: A, B, and Index. Signals A and
B are shifted by 90◦ , and depending on the direction of rotation signal A precedes signal
B or vice versa. The frequency of the pulses on the A or B output is directly proportional
to the encoder’s velocity (rate of position change) so higher frequencies indicate rapid
movement, whereas lower frequencies indicate slower speeds.
The Index signal consists of only one pulse at the beginning of each 360◦ and is used to
reset the pulse counter.
Resolvers
A brushless resolver is an electromagnetic sensor used to determine the mechanical angle
and velocity of a shaft or axle.
It consists of two rotary transformers. The first transformer, in blue in Fig. 1.21, is made
up of a primary coil located in the stator and fed with an excitation signal, say E0 · sin ωt.
This coil feeds the rotary primary of the second rotary transformer, in red in Fig. 1.21,
which is magnetically coupled to two 90◦ shifted coils (1 and 2) located in the stator,
resulting in a sine and cosine signals (E1 · sin ωt · sinθ and E1 · sin ωt · cosθ in Fig. 1.21).
The control obtains the arc-tangent and hence the rotor position angle, θ .
Figure 1.21. Resolver operating principle.

The advantages of resolvers include: accuracy, reliability, tolerance to misalignment,


robustness, durability.
The disadvantages of resolvers are: high price, weight, requires skillful specification &
implementation, and bulky.

Figure 1.22. An excitation signal is applied to the stator, which is coupled to


the rotating primary coil located in the rotor. This primary is connected to the
rotating secondary which, in turn, is magnetically coupled to two 90c irc shifted
coils located in the stator. The voltages in coils 1 and 2 are modulated by the
rotor position. The atan of the waveforms in coil 1 and coil 2 provides the rotor
angle, θ .

Another type of resolver is based on the reluctance variation that the shaft rotation
causes on the magnetic circuit, see Fig. 1.23. In this case, the rotor is not circular but
irregular, and the shape of its perimeter results in a sinusoidal electromotive force in coil
1 and coil 2. Variable reluctance resolvers are lower cost than brushless resolvers and
feature a simplified structure.
Figure 1.23. The excitation signal applied to the primary coil is modulated by the
variation in the magnetic circuit reluctance caused by the rotation of the rotor.
The atan of the waveforms in coil 1 and coil 2 provides the rotor angle, θ .

Retrieving the position angle from resolvers requires two steps. The first is to demod-
ulate the resolver outputs to recover the envelopes that represent the quadrature position
signals. The second is to compute the position angle.
The retrieving process of resolver signals to digital position angle value is usually referred
to as resolver to digital conversion, and the electronics interface that performs the conver-
sion is known as resolver to digital converter (RDC).

Resolvers are used in harsh environments and extreme applications such as feedback of
the servo motors, surface actuators, paper, and steel mills for speed and position feedback,
control systems of military vehicles, communication position systems, fuel systems of the
Jet engine, aeronautics (flap position), production of gas and oil, automotive applications
(cam/crankshaft position), electric vehicles.
Resolvers are widely used in vector control to split the vectors into their d-q components.
Chapter

2
The Three-Phase Two-Level Power Converter

Dionisio Ramírez

Abstract

The three-phase two-level power converter is by far the most widely used converter in the
field of control of electric drives.
This chapter addresses a basic control technique named pulse width modulation used to
operate this converter, and two particular cases of this technique: overmodulation, and
square-wave operation. For each case, the corresponding harmonic spectrum is shown,
and the pros and cons of the operating mode are discussed.

2.1. Introduction
Controlling the electrical machine of an electric drive in both steady state and transient
state requires the use of fully controlled power converters. This task is normally carried
out by a three-phase two-level power converter.
The most common way to control the power converter is to use it as a voltage source with
current feedback, also known as linear current source.
The desired sinusoidal output voltage is achieved from a DC voltage using a modulation
based on a high-frequency triangular carrier and a sinusoidal modulating wave, the former
generated by hardware and the latter by software.
As will be explained later, when the amplitude of the modulating wave is higher than
that of the carrier, the operating mode enters a zone known as overmodulation and the
harmonic spectrum worsens. If the amplitude of the modulating wave is high enough, the
operating mode changes to square wave, and the harmonic spectrum is even worse.
In vector control schemes, the amplitude of the modulating wave is usually controlled by
the output of two P-I controllers (after an inverse Park transform and an inverse Clarke
transform) so it is advisable to use a saturation as well as some type of anti wind-up
limitation.
If these precautions are not observed, in situations where any of the P-I controllers is not
able to reduce the error, its output increases unlimited, taking the operating mode of the
inverter from regular pulse width modulation to overmodulation, and finally to square-
wave. Moreover, the integral term might reach a very high value (with the risk to cause
a numerical overflow) which then takes a long time to reduce back to acceptable voltage
limits.
In this chapter, the recommended reading are chapter 7, sections 1.4 to 2.4, of [Kim 2017],
and chapter 8.4 of [Mohan et al. 1995].

2.2. Fundamentals
A three-phase two-level power converter is made up of a DC bus and six IGBTs with
anti-parallel diodes (to provide a discharging path to inductive loads), Fig. 2.1. The power
converter contains three arms, where two IGBTs are connected in series and triggered in
the opposite way (when the upper one is on the lower one is off and vice-versa) to avoid
a DC bus short-circuit.

Figure 2.1. Three-phase two-level power converter.

In this chapter, we will study the control technique known as sinusoidal pulse width
modulation (SPWM) and the three operating modes that it can give rise to.
In order to ease the study, we will only analyze one of the three arms of the power con-
verter and the voltage between its output terminal (denoted as "A" in Fig. 2.2) and the DC
middle point voltage, named pole voltage.

Figure 2.2. UA0 voltage defined in the right leg of the three-phase power converter.

The middle DC point is not connected to the load and therefore the load doesn’t see that
voltage, but only the line-to-line voltage, but this auxiliary voltage will make the analysis
easier, as we will see later. The pole voltage and the load phase voltage are not equal since
the neutral point is not connected to the middle point of the DC bus.
It is not possible to generate a sinusoidal waveform from a DC voltage using just six
switches (an IGBT can only be turned on or off ). To overcome this problem, the IG-
BTs are normally triggered using a modulation technique named pulse width modulation
(PWM).
The frequency of the output voltage can be changed by just changing the modulating wave
frequency in the C-code of the control system.

2.3. Sinusoidal Pulse Width Modulation (SPWM)


Sinusoidal pulse width modulation requires the use of a high-frequency triangular carrier
and a sinusoidal modulating wave, see Fig. 2.3 top.
On the one hand, the carrier is generated by the microcontroller using specific hardware
based on a highly configurable digital counter that runs independently of the CPU.
On the other hand, the sinusoidal modulating wave is calculated in each program cycle of
the control and is normally the result of two P-I outputs converted into three sinusoidal
waveforms through an inverse Park and an inverse Clarke transforms.
The carrier frequency is very important to the entire control system because it not only de-
termines the harmonic content of the output voltage but also imposes the analog to digital
sampling rate and the time available for the microcontroller CPU to run the control code
of the electric drive. In fact, that frequency is one of the first settings to be programmed
in the microcontroller configuration code and cannot be changed once the CPU starts run-
ning the control code.
The comparison between the carrier and the modulating wave determines when an IGBT
is turned on or off. Thus, according to Fig. 2.3 bottom, whenever the modulating wave
is higher than the carrier, TA+ is turned on and TA- turned off, and vice versa. If we
represent uA0 , the voltage alternates between two values: Ucc /2 and −Ucc /2 depending
on which IGBT, TA+ or TA- is turned on.
The resulting output voltage is a train of pulses of fixed frequency, Fig. 2.3 bottom, where
the average amplitude in a period changes according to a sinusoidal waveform. In the fig-
ure, the first harmonic of the output voltage is shown as a dashed line, [Mohan et al. 1995].
As we will see later, the rest of the harmonics are high-frequency, so they can be easily
filtered out.
Figure 2.3. Comparison between a triangular carrier and a sinusoidal modulating wave.

When the power converter is connected to the stator of an electrical machine, the wind-
ing inductance filters the current resulting in almost sinusoidal although still some high-
frequency low-amplitude harmonics remain. It is also usual to add an output filter to the
power converter in order to obtain a lower THD current and improve the machine’s per-
formance.
Fig. 2.4 shows a close-up of the comparison performed by the PWM hardware in a CPU-
independent process.

Figure 2.4. Detail of the PWM comparison.


From Fig. 2.4, the reader can readily obtain the average value of uA0 , [Mohan et al. 1995]

Ucontrol UDC
uA0 = (2.1)
Ûtri 2

According to Eq. (2.1), the average voltage uA0 depends on the modulating wave peak
amplitude, Ûcontrol , to the peak amplitude of the carrier, Ûtri ratio. Note that Ûtri is kept
constant by the digital counter and UDC is the DC bus voltage, usually constant, so the
average output voltage can be controlled by software by means of Ûcontrol .
The following ratio, where Ûtri is constant,

Ûcontrol
ma = (2.2)
Ûtri

is known as amplitude modulation ratio, and is used to calculate the average output
voltage for each peak value of the modulating wave:

UDC
uA0 = ma (2.3)
2

According to this equation, if Ûcontrol changes following a sinusoidal waveform, then


ma = Ma sinω t, and the pole voltage uA0 results sinusoidal

 
UDC
uA0 = Ma sinω t (2.4)
2

In SPWM, the amplitude of the carrier should always be higher than that of the modulating
wave.
When ma ≤ 1 the modulation is linear and changes in the modulation index produce
proportional changes in the output voltage, as shown in Fig. 2.5. In this case, the power
converter can be considered to be simply an almost ideal controlled voltage source.
If the modulating wave peak amplitude is higher than that of the carrier, 1 ≤ ma ≤ 1.27,
the inverter operates in an area known as overmodulation. In this area, some pulses in
the output voltage are lost and the behavior of the converter is no longer linear and the
resulting harmonic content worsens.
Finally, if ma ≥ 1.27, the inverter operates in an area where it is only capable to generate
square waves, and the effect of the modulation is lost.
Figure 2.5. first harmonic of UA0 relative to the DC voltage vs. modulation index.

The frequency modulation ratio, m f , is defined as:

ftri
mf = (2.5)
fcontrol

where ftri and fcontrol are the frequency of the carrier and the modulating waves respec-
tively.

Fig. 2.6 shows the harmonic spectrum obtained in the pole voltage measured between
the terminal "A" and the middle point of the DC bus for odd values of m f , where all the
harmonics gather around multiples of m f .

m f , m f ± 2, m f ± 4, m f ± 6, ...
2 m f ± 1, 2 m f ± 3, 2 m f ± 5, 2 m f ± 7, ...
(2.6)
3 m f , 3 m f ± 2, 3 m f ± 4, 3 m f ± 6, ...
4 m f ± 1, 4 m f ± 3, 4 m f ± 5, 4 m f ± 7, ...

Figure 2.6. Pole (phase-to-0) voltage spectrum.


2.4. Dead time
During the switching of two IGBTs of the same leg, the one being turned off needs some
time to fully open the circuit. Once this IGBT has finished the process, the complementary
IGBT can be turned on, but not before to avoid a short circuit on the DC bus, Fig. 2.7,
(left).
To ensure that the IGBTs on the same leg are not accidentally turned on simultaneously,
the driver or the microcontroller adds a dead time between the two switchings, Fig. 2.7
(right). Unfortunately, during the dead time, the output voltage deviates from the voltage
command, resulting in +Ucc or −Ucc depending on the sign of the phase current.

Figure 2.7. Left: turn-on and turn-off times. Right: dead time added to the pulses.
[Kim 2017].
2.5. Three Phase SPWM
The basic scheme of a three-phase SPWM generation system involves the use of three
sinusoidal modulating waves and a single high-frequency carrier.
The hardware of the microcontroller carries out independent comparisons between the
common carrier and each of the modulating waveforms, resulting in the pulse trains shown
in Fig. 2.8.
Note that the voltage actually applied to the stator is not the pole voltage but the line-
to-line voltage, because the load neutral point is not connected to the inverter. In fact,
the pole and phase voltages in the load are slightly different, and the modulating waves
correspond to the pole voltages, not to the phase voltages.

Figure 2.8. Three phase SPWM: top to bottom: common carrier signal and three
modulating waves; pole voltages, ua0 and ub0 ; phase-to-neutral voltage uan ; line-
to-line voltage uab .

There are only four possible values for the phase-to-neutral voltages: ±1/3UDC , ±2/3UDC .
The reason behind that is that there are only eight possible switching states for the IGBTs,
see Table 2.1, and each state connects the load as one of the six voltage dividers repre-
sented in Fig. 2.9. The states (0, 0, 0) and (1, 1, 1) lead to a zero output voltage.
By similar reasoning, from Fig. 2.9 the reader can readily derive that there are only three
possible values for the line-to-line voltage: +UDC , 0, and −UDC .
Pole state Pole voltage Phase voltage
S1 S2 S3 Ua0 Ub0 Uc0 Uan Ubn Ucn
0 0 0 − 21 UDC − 12 UDC − 12 UDC 0 0 0
0 0 1 − 21 UDC − 12 UDC + 12 UDC − 31 UDC − 13 UDC + 23 UDC
0 1 0 − 21 UDC + 12 UDC − 12 UDC − 31 UDC + 23 UDC − 13 UDC
0 1 1 − 21 UDC + 12 UDC + 12 UDC − 32 UDC + 13 UDC + 13 UDC
1 0 0 + 21 UDC − 12 UDC − 12 UDC + 32 UDC − 13 UDC − 13 UDC
1 0 1 + 21 UDC − 12 UDC + 12 UDC + 31 UDC − 23 UDC + 13 UDC
1 1 0 + 21 UDC + 12 UDC − 12 UDC + 31 UDC + 13 UDC − 23 UDC
1 1 1 + 21 UDC + 12 UDC + 12 UDC 0 0 0

Table 2.1. Pole and phase-to-ground voltages for each switching state (1=on, 0=off ).

Figure 2.9. Phase voltage for each pole state (1=on, 0=off ).

Some harmonics present in pole voltages, Fig. 2.6, are not present in the line-to-line
voltages, Fig. 2.10, since they cancel each other out, resulting in low-ripple current and
smooth torque in motor control.
In effect, provided m f is odd, line-to-line voltages do not have third harmonics because
they cancel each other out. For this reason, m f is usually selected as a multiple of 3. In
addition, the use of odd multiples of m f eliminates the even harmonics due to the sym-
metry of the three-phase PWM patterns.
From Fig. 2.6 and Fig. 2.10 it is clear that the higher m f , the higher the frequency of the
resulting harmonics. For 50 Hz modulating waves, common m f values range from 20 in
high-power converters to 400 in low-power converters.
However, while it may be tempting to choose a high switching frequency, as the resulting
harmonics will be of high frequency, making them easier to filter, that has a trade-off:
switching losses increase and this is a very limiting factor.

Figure 2.10. Line-to-line voltage spectrum.

The resulting current for a resistive-inductive load is sinusoidal but contains high-order
harmonics, as can be seen in Fig. 2.11. Due to the filtering effect of the load, the higher
the inductance, the lower will be the ripple of the resulting current and the higher the
phase shift.

Figure 2.11. Output current and phase voltage.

2.5.1. Overmodulation
When the peak value of the modulating wave exceeds the peak value of the carrier in
Fig. 2.3, some intersections are lost resulting in a lack of pulses in the center of the
waveform, as shown in Fig. 2.12.
Figure 2.12. Overmodulation; top: the modulating wave is higher than the carrier
so several intersection points are lost; middle and bottom: the resulting phase-
to-neutral and line-to-line voltage has fewer pulses at the middle of each semi-
period.

The most straightforward consequence is the presence of low-order harmonics difficult


to filter since the required filter would be big and heavy, see Fig. 2.13. The consequence
in motor control is the presence of low-frequency torque ripple in the rotor shaft.

Figure 2.13. Harmonic spectrum of the line-to-line voltage obtained with overmodulation.

Fig. 2.14 shows the phase voltage in the load and the resulting output current. The lack
of pulses in the central area of the phase voltage results in a higher first harmonic but also
in the presence of low-order harmonics.
Figure 2.14. Output current and phase voltage in square-wave modulation.

Overmodulation is rarely used but still, it has some practical use. For example, it allows
to obtain a higher amplitude for the first harmonic which results in a higher magnetic flux
in the motor. Consequently, the available torque is higher, which may be useful for starting
motors with low starting torque.

2.5.2. Square-wave modulation


When the amplitude of the modulating wave is high enough, the comparison with the
carrier does not result in any intersection point. As a result, each phase of the load is
periodically connected to the positive or negative poles of the DC bus for long periods of
the PWM cycle, and the resulting voltage dividers provide only four possible values for
the phase-to-neutral voltages, see Fig. 2.9 and Table 2.1: ± 13 UDC , ± 23 UDC .
Consequently, the output voltage becomes a square wave with no pulses present across the
period, neither in the phase voltage nor in the line-to-line voltage, as shown in Fig. 2.15.
In square-wave operation, the harmonic content is even worse than in overmodulation (it
is equivalent to not using PWM at all), and the inverter can not control the amplitude of
the a.c. output voltage unless the DC bus voltage is modified accordingly. Conversely,
the switching losses are low due to the low number of switches performed in each period.

Figure 2.15. Square-wave modulation. Top to bottom: Carrier and modulating


waves; phase-to-0; line-to-line voltage.
As can be seen in Fig. 2.16, the waveform of the line-to-line voltage contains the har-
monics 6 n ± 1 (n = 1, 2, 3, ...), whose amplitudes decrease inversely proportional to the
order of the harmonic and do not depend on the load.

Figure 2.16. Square-wave modulation. Harmonic spectrum of line-to-line voltage.

Fig. 2.17 shows the phase current (not to scale) obtained when the load is R-L. Note
that the current is not sinusoidal but at least it is alternating and it is possible to guess a
strong first harmonic as well as a number of low-order harmonics.

Figure 2.17. Output current and phase voltage in square-wave modulation and R-L load.

Finally, Fig. 2.18 shows the stator current in a squirrel-cage induction motor fed by an
inverter operating with square-wave modulation.
Figure 2.18. Output current and phase voltage in square-wave modulation and a
squirrel cage induction motor as load.

Conclusion
This chapter has shown how the amplitude of the output voltage is controlled by means of
the modulation index, and how the carrier frequency determines the harmonic spectrum
of output voltage.
Besides, it has been shown how an increasing modulating wave amplitude takes the op-
erating mode of the converter from a linear behavior to overmodulation, and finally to
square wave, worsening the harmonic spectrum of the output voltage.
The next chapter addresses a different technique to control the three-phase two-level
power converter, named space vector modulation, that presents several advantages over
the traditional PWM with few drawbacks.
Chapter

3
The Space Vector Modulator (SVM)

Dionisio Ramírez

Abstract

Space Vector Modulation (SVM) is a technique used in power converters to generate


the desired AC voltage from a DC bus. It has several advantages over classical sinu-
soidal Pulse Width Modulation (PWM), such as higher output voltage and lower switch-
ing losses, and only a few disadvantages such as a higher computational cost.
This chapter discusses the fundamentals of the SVM and develops the algorithm required
to implement it on an industrial microcontroller.

3.1. Introduction
Power converters used in motor control have long used PWM modulation, although this
technique presents several drawbacks. The most well-known is that it does not take full
advantage of the AC voltage generation capability of the converter, but there are other
software and hardware reasons that make sinusoidal PWM not very suitable for advanced
controls.
Although the hardware that generates the carrier signal in the microcontroller is unique
for the three output voltages, it is nevertheless necessary to use three comparators and
three modulating sinusoidal signals obtained by using an additional inverse Clarke Trans-
form.
However, the sinusoidal modulating waveform is not very suitable in vector control, where
the components of voltages and currents are expressed in the d-q reference frame, and are
theoretically constant. For example, in classical vector control, the P-I controllers of the
inner loop provide the components of the voltage to be modulated, which in steady state
are constant. Even after performing an inverse Park Transform, two 90◦ out of phase si-
nusoidal components are obtained, which cannot be used in sinusoidal PWM modulation.
Conversely, the SVM that we will study in this chapter directly uses the d-q or α-β com-
ponents of the reference voltage instead of three modulating waves. Also, the algorithm
provides the ton of each IGBT directly. However, as we will see, the PWM hardware of
the microcontroller is still necessary to translate the ton /to f f of each IGBT into actual
trigger signals.
The main advantage of SVM is threefold: it provides better utilization of the DC source
than PWM, minimizes the harmonic content of the output voltage, and lowers switching
losses. As a disadvantage, we can mention that a higher computational effort is required
from the microcontroller.
In this chapter, the recommended reading is chapter 7, section 2.4, of [Kim 2017].
The reader can review the concepts about space vectors in chapter 4 of [Yazdani and Iravani 2010],
and chapter 4, section 3.3, of [Kim 2017].

3.2. Fundamentals
Power converters consisting of six IGBTs only have eight possible switching states. If we
consider the three upper IGBTs (the state of the lower ones is always complementary), all
the possible switching states can be sorted in a table, see Fig. 3.1.

Figure 3.1. Eight possible switching states in a six-IGBTs power converter.

As we will see in the next section, each switching state generates an output voltage that
can be represented by a space vector. The resulting six active vectors and two zero vectors
can be represented in a regular hexagon in which the space is divided into four quadrants
(90◦ each) or six sectors (60◦ each), Fig. 3.2, and the zero vectors are placed at the center
of the hexagon.
Figure 3.2. The six active vectors make up a regular hexagon.

If the output voltage vector rotates 360◦ , the corresponding output voltage would be
sinusoidal three-phase. However, with this approach, it is not possible to obtain interme-
diate vectors located between the active vectors. That is the issue that SVM solves.
In a first approach, the reference vector will be obtained by means of a modulation that

− →
− →

uses three vectors: two adjacent active vectors, Vk and V k+1 , and one zero vector, V0 or


V7 . The two adjacent vectors allow to place the generated vector within a range of 60◦ , or
sector, see Fig. 3.3. The zero vector allows the magnitude of the resulting vector to be
adjusted.

Figure 3.3. Modulation of a reference vector placed into the first sector a) without
zero vector, b) with zero vector.

The reference vector is updated by the control code in each program cycle and is gen-
erated by the modulation hardware in the subsequent switching cycle. The three vectors

− →
− →

are applied by the inverter to the load sequentially: first Vk , then V k+1 , and finally V0 ,
see Fig. 3.4.
Figure 3.4. Firing signals of the three upper IGBTs for a reference vector located
into sector I.

Note that in Fig. 3.4, the sequence of vectors is repeated in the reverse order after half
a period. We will discuss this approach later.

General equation
Now, we will obtain a general equation for the active vectors generated by the power
converter.
The space vector definition that we will use is

− 2
u = uα + j u β = ua →

a 0 + ub →

a 1 + uc →

a2

(3.1)
3

where a = e j 3 = 1 120◦ and the space vector magnitude is equal to the peak value of
the sinusoidal voltage it represents.

Let us think of a power converter in which the switching state of the three upper IGBTs
is (ON, OFF, OFF), or (1,0,0), Fig. 3.5.

Figure 3.5. One upper IGBT is ON and two are OFF.


To make the space vector voltage derivation easier, we will consider the DC link mid-
point as the reference voltage (denoted by 0 in the figure) instead of the negative terminal.
That reference point is not relevant for the final result because we are looking for the
phase-to-phase voltages, which we will obtain by subtracting the phase-to-0 voltages.
With respect to the mentioned reference, the three output voltages are
1
UA 0 = + UDC
2
1
UB 0 = − UDC
2
1
UC 0 = − UDC
2
We can express the output voltage in a compact form by applying the space vector defini-
tion, Eq. 3.1  

− 2 1 0 1 j 23π 1 j 43π
u conv = UDC e − UDC e − UDC e (3.2)
3 2 2 2
which results in

− 2
u conv = UDC (3.3)
3
This voltage can be expressed in a more general way


− 2
u conv = UDC e0 (3.4)
3

As in the previous case, if the switching state of the three upper IGBTs is (1,1,0), Fig.
3.6, the output voltages are

Figure 3.6. Two upper IGBT are ON and one is OFF.

1
UA 0 = + UDC
2
1
UB 0 = + UDC
2
1
UC 0 = − UDC
2
If we express them as a space vector, the result is


− 2 π
u conv = UDC e j 3 (3.5)
3
From equations Eq. 3.4 and Eq. 3.5, we can conclude that it is possible to express all the
six active vectors by means of the following general equation


− 2 π
u conv k = UDC e j(k−1) 3
3
(3.6)

where k = 1, ..6.


The space vectors, Vk , are named after the value of k, see Fig. 3.2, and the zero vectors

− →

are V0 and V7 .

3.3. Optimized SVM


The modulation process can be carried out in such a way that additional benefits (besides
a higher output voltage) such as better harmonic content and lower switching losses are
obtained. In this new approach, two adjacent vectors and two zero vectors are used. The
sequence of vectors is repeated in the reverse order within each switching cycle, and the
transitions between states must be carried out by switching only one leg at a time.
The sequence of vectors to modulate the reference voltage is


1. The first state is always the zero vector V0 = (0, 0, 0).

− −−→
2. Then, the adjacent vectors Vk and Vk+1 are applied sequentially.


3. The third state is always the other zero vector V7 = (1, 1, 1).

4. The sequence is repeated in reverse order.

For example, to generate a reference vector located in Sector I (odd sectors), the sequence
of vectors throughout the switching cycle is

− → − → − → − → − → − → − → −
V0 , V1 , V2 , V7 , V7 , V2 , V1 , V0

However, to generate a reference vector located in an even sector, the sequence should be:

− → − →
− → − → − → − →
− → −
V0 , V k+1 , Vk , V7 , V7 , V k+1 , Vk , V0

Switching times
Once the application sequence of vectors has been established, it is necessary to calculate
the duration time of each vector.

− →

If the time during which V k is applied is higher than that of V k+1 , the resulting vector

− →

is located closer to V k than to V k+1 and vice-versa. Thus, it is possible to locate the
generated vector across the 60◦ of the whole sector.
The zero voltage vector makes it possible to adjust (reduce) the magnitude of the gener-
ated vector.
It is possible to calculate the duration times by averaging the voltage applied in a semi-
period Ts /2 and making it equal to the reference vector, as Eq. (3.7) shows

Z Ts /2
1 →

V re f dt =
Ts /2
0Z Z Z Z  (3.7)
l1 l2 l3 Ts /2
1  →
− →
− →
− →
− 
 V0 dt + Vk dt + V k+1 dt + V7 dt 
Ts /2  
0 l1 l2 l3

where l1 = T0 /2, l2 = T0 /2 + Tk , l3 = T0 /2 + Tk + Tk+1 , and T0 + Tk + Tk+1 = T2s . In



− → − →
− →
− −−→
addition, V0 = V7 = 0, V k+1 and Vk are constant, and Vre f is constant within the switching
cycle.
Substituting these values and finding the integrals, we obtain


− Ts →− →

V re f = Vk Tk + V k+1 Tk+1
2


Considering Eq. (3.6), V re f results in


− Ts 2 h
j (k−1) π3 j k π3
i
V re f = UDC Tk e + Tk+1 e
2 3
Separating now the real and imaginary parts of the vector
" ! #
cos (k−1) π kπ
  
uα Ts 2 3 cos 3
= UDC Tk + Tk+1 kπ (3.8)
uβ 2 3 sin (k−1)
3
π sin 3

Rearranging the equation


" #
cos (k−1) π kπ
  
uα Ts 2 3 cos 3 Tk
= UDC (3.9)
uβ 2 3 sin (k−1)
3
π
sin kπ
3
Tk+1

Finally, we obtain
√ " # 
sin k3π −cos k3π
 
Tk 3 Ts uα
=
Tk+1 2 UDC −sin (k−1)
3
π (k−1) π
cos 3 uβ
(3.10)
Note that the times provided by Eq. (3.10) are not the switching times of the IGBTs.
For example, in Fig. 3.4, IGBT 1 is in ON state during 2 T1 + 2 T2 + T0 , IGBT 2 during
2 T2 + T0 , and IGBT 3 during T0 .
The ON times are used by the PWM hardware to generate the trigger signals for the
IGBTs using a symmetrical triangular carrier (actually an up/down high-frequency digital
counter), Fig. 3.7.
In that figure, PRD is the maximum value of the digital counter and the Ton time of the
IGBTs is loaded by the microcontroller in the compare registers. A hardware comparator
provides the PWM outputs which are set to 1 when the triangular carrier exceeds the value
stored in the counter-compare registers. The ON times must be previously converted to
values proportional to the carrier period, PRD, for the comparison to work correctly.

Figure 3.7. Symmetric carrier and four compare values (Ton of the IGBTs). Texas
Instruments, [Incorporated 2020]

Switching pattern
Within each sector, the vectors used to carry out the modulation are always the same. For

− → − →
− →
− → −
example, in Sector I, the vectors used are V1 , V1 , and V0 whereas in Sector V, V5 , V6 , and


V0 are chosen.
The consequence of the fixed sequence of adjacent vectors is that, within each sector, the
switching pattern is fixed, see Fig. 3.8.
Figure 3.8. Switching pattern within each sector

Determination of the sector


To choose the two adjacent vectors that limit that sector, the SVM needs to know the sec-
tor in which the reference vector is located. The most straightforward solution to obtain
the grid voltage vector angle from the α-β coordinates is to use a trigonometric func-
tion. However, this solution presents several drawbacks: the trigonometric function and
the division require a high computational effort that increases the cycle time and limits
the PWM frequency. Moreover, the denominator, uα , has to always be different from zero.

However, there is a workaround that allows finding the angle by just several compar-
isons and products, and that is more suitable for the hardware of a DSP (Harvard archi-
tectures) and much faster.

The procedure is as follows:

• According to Fig. 3.2, each quadrant (90◦ ) is divided into 2 sectors (60◦ ) and it is
possible to find the quadrant in which the vector is located by checking the sign of
the reference vector coordinates. For example, if uα > 0 and uβ > 0, the quadrant
is the first.

• Then, the reference vector is in Sector I if the following is accomplished


 
uβ π π
θ = atan ≤ ; uβ ≤ uα tan ; uβ ≤ 3 uα
uα 3 3
• Otherwise, the reference vector is in Sector II.


Since 3 is not calculated in each program cycle but precalculated, this procedure is very
fast

SVM vs. other techniques


The SVM technique presents the following characteristics:

• The output voltage is 15% higher compared with classical PWM. For example, for
a DC link voltage of 565V , the RMS AC voltage provided by the SVM is 230V
whereas the PWM provides just 200V.
¯ =
In Fig. 3.9, the space vector magnitude located at the hexagon corners is OC
2/3UDC . However, the SVM can not use this magnitude because the space vec-
tor must be able to rotate in an inscribed circumference to generate a balanced
three-phase output voltage. Consequently, the SVM provides a maximum volt-
age magnitude of OA¯ = 2/3UDC cos 30◦ whereas the classical PWM provides only
¯ = 1/2UDC
OB

Figure 3.9. Comparison between the magnitude of the voltage vectors generated
by the SVM and the PWM.

• The SVM is implemented in a subroutine, meaning a higher computational effort


compared to PWM. This cost is around 16.5µs in a Texas Instruments F28335 mi-
crocontroller. However, the SVM makes the use of the inverse Clarke transform
unnecessary, which saves around 6µ in the same microcontroller.
Fig. 3.10 is very illustrative of the computing times involved in a typical control
code of a grid-connected power converter (the time spent by the atan2 function can
be reduced from 37µ to 5µ using an optimized routine provided by the manufac-
turer).
Figure 3.10. Approximated computational cost generated by the SVM compared
with other functions of a typical control code.

• The number of commutations in a switching period is just 4 whereas in classical


PWM with symmetric carrier is 6, which reduces the switching losses.

• Once the ton of each IGBT is calculated, the SVM uses the hardware of the PWM
to generate the pulses, Fig. 3.7.
Chapter

4
Vector Control of Grid Side Converters (GSC)

Dionisio Ramírez

Abstract

In renewable energy generation, electrical machines operating as generators need two


power converters: a machine-side converter (MSC) and a grid-side converter (GSC).
In this chapter, the GSC control is designed based on its terminal equations and the most
appropriate reference frame. Then, the PI controllers are calculated and the PLL, used in
the synchronization, is explained. Finally, the operating limits of the GSC are explored.

4.1. Introduction
The control of electric generators in applications such as wind energy, wave energy, etc.
normally comprises two power converters: the machine side converter (MSC) and the
grid side converter (GSC). The former controls the torque and magnetic field in the elec-
tric generator. The latter is responsible for delivering all the generated active power to the
grid and for controlling the reactive power exchanged between the system and the grid.
The control of the GSC is usually based on space vectors and designed to keep the DC
link voltage constant.
The frame of reference is chosen synchronized with the grid voltage, which angle is ob-
tained using a Phase Locked Loop (PLL).
In this chapter, the recommended reading is chapter 5 of [Ramirez et al. 2015].

4.2. Terminal equations of the GSC


In this section, we will obtain the electrical equations that model the GSC of Fig. 4.1
seen from its AC terminals. In this figure, the inductance and resistance of the step-up
transformer, filter, and electric line are lumped in an equivalent R and L, and ua , ub , uc are
the phase to ground grid voltages.
Figure 4.1. Grid side converter.

The terminal equations allow us to study the relationship between uconv d - id and be-
tween uconv q - iq , needed to design the control system. These equations can be obtained
by applying the second Kirchhoff’s law to the grid connection using the static reference
frame, α-β , shown in Fig. 4.2
−→

− −→ d iαβ →
u conv αβ = R iαβ + L +−
u αβ (4.1)
dt

Figure 4.2. Static reference frame (Clarke Transform) and rotating reference
frame (Park Transform).

If we express Eq. (4.1) in the rotating reference frame defined by the d-q axes yields



− −
→ jθ d idq e jθ →

u conv dq e = R idq e + L +−
u dq e jθ (4.2)
dt
Now, finding the derivative



− −
→ jθ jθ d idq dθ − →

u conv dq e = R idq e + e L +j L idq e jθ + →

u dq e jθ (4.3)
dt dt
and simplifying



− −
→ d idq −
→ −
u conv dq = R idq + L + jω L idq + →
u dq (4.4)
dt
Separating real and imaginary parts, we finally obtain
 
did
uconv d = R id + L − ω L i q + ud
dt
(4.5)

 
diq
uconv q = R iq + L + ω L i d + uq
dt
(4.6)

4.3. Electric power delivered to the grid


General equation
The power flowing into a three-phase grid is the instantaneous product of the voltages
and currents of that grid [Novotny and Lipo 1996]. In our case, the grid is assumed to
have three phases, the symbol ∗ denotes the complex conjugate, and → − 2π
a = e j 3 . We will


now find the relationship between the product of the space vectors →
−u grid and i grid , and
the active power.
The instantaneous total (real) power in the time domain is expressed as

P(t) = uan (t) ia (t) + ubn (t) ib (t) + ucn (t) ic (t) (4.7)

If we multiply the voltage vector and the complex conjugate vector of the current


− →
− 2  2
u grid i ∗grid = uan + →

a ubn + →

a 2 ucn ian + →

a 2 ibn + →
− 
a icn (4.8)
3 3
Taking the real part of this expression we find that
n →  

− − ∗o 4 1
Re u i = uan ia + ubn ib + ucn ic − [uan (ib + ic ) + ubn (ia + ic ) + ucn (ia + ib )]
9 2
(4.9)
If the three currents sum to zero, this expression becomes, finally


− o 2
Re →

n
u grid i ∗grid = (uan ia + ubn ib + ucn ic ) (4.10)
3
where (uan ia + ubn ib + ucn ic ) is the instantaneous power that represents the active power.
Therefore, assuming a three-phase grid without a return path (neutral wire), the instan-
taneous active power delivered to the grid calculated using space vectors can be written
as
3 n− →

P(t) = Re →
o
u grid i ∗grid (4.11)
2

It should be noted that P(t) has been obtained with no assumption on the frequencies or
the amplitudes of uabc and iabc so both of them may follow any arbitrary function of time.
Moreover, it is not needed that the frequencies of uabc and iabc are equal. Furthermore,
P(t) has been obtained with no assumption on the harmonic contents of uabc and iabc , and
it is valid under both transient and steady-state conditions [Yazdani and Iravani 2010].
Using a similar development, the instantaneous reactive power results in

3 n→ →

Im −
o
Q(t) = u grid i ∗grid (4.12)
2

and the instantaneous complex power


− 3− →

S (t) = P(t) + j Q(t) = →u grid i ∗grid (4.13)
2

In a balanced steady state, the instantaneous active and reactive powers have the same
expression as the conventional active and reactive powers.

Equation of power in the rotating reference frame


The apparent power of the grid connection can be obtained by multiplying the grid voltage
and current vectors


− 3 →
− →
−∗ 
S (t) = P(t) + j Q(t) = u grid i grid (4.14)
2

Substituting the space vectors


− 3  ∗ 
S (t) = ud + j uq id + j iq (4.15)
2

and operating them, we obtain


− 3  
S (t) = ud id + uq iq + j uq id − ud iq (4.16)
2

If now we take the frame of reference aligned with the grid voltage vector, Fig. 4.3, then
uq = 0 and we obtain a simplified equation


− 3 
S (t) = (ud id ) + j −ud iq (4.17)
2

This last equation shows that the active and reactive powers delivered by the inverter to
the grid can be regulated independently: id controls P and iq controls Q.

3
P(t) = (ud id ) (4.18)
2

3 
Q(t) = − ud iq (4.19)
2
Figure 4.3. Rotating reference frame synchronized with the grid voltage vector.

To obtain such a simple control it is necessary to measure the angle of the grid voltage
vector, θ . This angle can be obtained from the grid voltage components, uα , uβ , obtained
using the Clarke transform, see Fig. 4.3

θ = atan (4.20)

However, the most common method to obtain θ is to use a Phase Locked Loop (PLL). In
this frame of reference uq = 0 and the terminal equations finally become:
 
did
uconv d = R id + L − ω L i q + ud
dt
(4.21)

 
diq
uconv q = R iq + L + ω L id
dt
(4.22)

where R, L, ud , and ω are constant.

4.4. Block diagram


This section addresses the design of the GSC control system. The reader is advised to
consult sections 3.3 and 7.3.3 of [Yazdani and Iravani 2010] and sections 2.5 and 2.6 of
[Kim 2017] for a broader view of the subject and to review some basic aspects related to
control that are beyond the scope of these course notes.

According to Eq. (4.21) and Eq. (4.22) it is possible to control id and iq by means of
the voltage generated by the power converter uconv d and uconv q . The block diagram shown
in Fig. 4.4 depicts the current control derived from these equations.
Note that the cross-coupling terms added externally to the control loop cancel out the
cross-coupling effect of the filter reactance (steady state: ω), −ω L iq and +ω L id (can
be considered disturbances) so the transfer function is indeed very simple and the same
for both axes [Kim 2017][Mohan 2014].
In effect, if we consider the cross-coupling terms as perturbations that can be canceled
out by adding the corresponding feedforward compensation to the control loop, the rela-
tionship between uconv d -id and uconv q -iq is in both cases a first order transfer function. For
example, if uconv d changes in step, id will change according to the damped dynamics of a
first-order system.
Therefore, it is possible to control id and iq using two PI controllers that provide the re-
quired d-q voltage references to the SVM.

Figure 4.4. Block diagram of the inner control loop for both axes.

The complete block diagram, Fig. 4.5, is mainly obtained from the terminal equations,
Eq. (4.21), and Eq. (4.22). Overall, the control system works as follows: there is an outer
loop and two inner loops.
The outer loop controls the DC link voltage in such a way that, when the generated power
increases the DC voltage in the capacitor, the corresponding PI controller increases the
active power reference, P∗ .
The inner loops control the current in the d-q reference frame. When the power ref-
erences P∗ or Q∗ change, the corresponding transfer functions convert their values into
current references i∗d and i∗q . Then, the outputs of two PI controllers provide the voltage
references in the d-q reference frame.
Finally, the feedforward control (cross-coupling terms) is added in order to cancel out the
terms considered perturbations.
The synchronization with the grid voltage is achieved using a PLL. This synchronization
simplifies the control and makes independent control of active and reactive power possi-
ble.
Figure 4.5. Block diagram of FOC for GSCs.

Design of the inner loop controllers


The final control loop for both axes is shown in Fig. 4.6, where the inverter is simply
represented by the delay caused by the PWM pulses. This delay takes into account the
time elapsed from the moment the ton values are loaded into the compare registers until
the desired average voltage is effective at the inverter terminals.

Figure 4.6. Block diagram of the inner control loop of one axis.

Transfer function of the grid connection


From the d-q voltages standpoint, the transfer function of the grid connection is first order,
where R and L are the resistance and inductance of the filter and transformer altogether.
Expressing the transfer function in standard form we obtain
Id (s) Iq (s) 1
= = (4.23)
Ud (s) Uq (s) L s + R

Transfer function of the power converter


The power converter adds a small delay in the order of hundreds of microseconds. This
delay is caused by the time that elapses from the moment in which the value of the de-
sired voltage is loaded into the PWM compare register until the actual average voltage
effectively reaches that value as the PWM pulse evolves in time.
The delay is usually much shorter than the dynamic response time of the system to be
controlled, so its transfer function is usually neglected. Nevertheless, as we will see later
in this section, it has strong influence on the bandwidth of the grid connection control.

Transfer function of the Proportional Integral (PI) controller


The PI controller comprises a proportional term (P) and an integral term (I). The deriva-
tive term (D) is discarded because it amplifies the noise present in the measurements in
this type of application. The integral term guarantees that the current tracks the reference,
with zero steady-state error.
kintg
R (s) = k prop + (4.24)
s
Expressing the transfer function in standard form, we obtain

k prop s + kintg
R (s) = (4.25)
s

where k prop and kintg are the proportional and integral gains of the PI controller.

Open-Loop and closed-loop transfer functions


Considering the PI controller and the grid connection, the open-loop transfer function,
G◦ (s), is

k prop s + kintg 1
G◦ (s) = (4.26)
s Ls+R
or
 
kintg
k prop s + k prop
G◦ (s) = (4.27)
L s (s + R/L)
Normally, the pole is near the origin and corresponds to a slow natural response. To
improve the open-loop frequency response, the pole is usually canceled by the zero of the
PI controller. The gains are chosen to be kintg /k prop = R/L and k prop /L = 1/τi

1 1
G◦ (s) =   = (4.28)
L τi s
k prop s

where τi is the desired constant time in the closed-loop transfer function. And, the closed-
loop transfer function results in

1
G (s) = (4.29)
τi s + 1
The value of τi must be small (0.5 − 5ms) in order to obtain a fast dynamic response.
However, τi is directly related to the bandwidth, ωcc , of the closed-loop transfer function
(τi is the inverse of ωcc ). Since the changes in the current cannot be faster than the fre-
quency of the PWM pulses, the bandwidth of the whole grid connection control is limited
by the switching frequency of the power converter.
As a rule of thumb, the bandwidth of the closed-loop transfer function, ωcc = K prop /L, is
at least 10-25 times lower than the switching frequency.
For example, if we assume a bandwidth 10 times the switching frequency and a switch-
ing frequency of 5 kHz, the bandwidth results in ωcc = 500Hz, i.e. ωcc ≈ 3100 rad/s =
K prop /L = Kintg /R.

Phase Locked Loop (PLL)


The PLL, Fig. 4.7 is the most common method for the determination of the phase angle
and frequency of the grid voltage vector in smart grids.

Figure 4.7. Block diagram of a PLL.

Briefly, a PLL works as follows: after measuring the phase to ground voltages and
applying the Clarke and Park transforms, ud and uq are obtained. To get those values,
the Park transform needs the angle of the grid voltage vector, which is still unknown, so
initially, the values obtained for ud and uq are incorrect, as it is clearly shown in Fig. 4.8.
Figure 4.8. Evolution of u d and u q as the number of program cycles increases. In
gray color, u α and u β .

After some cycles, when the steady state is reached, the value of θ will be correct and,
consequently, uq = 0 and ud = |→ −u |, the PI controller output (added to |→

u |) will provide
the grid angular speed, and the integrator will provide the angle θ . Fig. 4.9 shows the
angle estimation vs, the line voltage ubc used as a reference for the angle (the estimated
angle of the grid voltage vector must match that of ubc ).

Figure 4.9. Evolution of α and the line voltage u bc as the number of program
cycles increases.

Note that in the comparator, the sign of the uq reference is negative whereas the sign of
the fed-back iq is positive. The reason is that, when εuq > 0, the calculated angular speed
must be reduced and vice-versa.

4.5. Operating limits of the GSC


The GSC is connected to the grid through an inductive filter and a step-up transformer.
The vector diagram corresponding to that connection is shown in Fig. 4.10 left. If we
multiply that diagram by the constant 3 ugrid /X, the result is the power diagram shown in
Fig. 4.10 right, [Ramirez et al. 2015].
Figure 4.10. left: diagram of the grid connection; right: P-Q diagram

Therefore, the vertical and horizontal axes of Fig. 4.10 left can be scaled proportionally
to power, like in Fig. 4.11, where k = X/3 ugrid .
In that figure, if we want to use the inverter to deliver to the grid a maximum active power
of P, keeping the reactive power to zero, we will need a certain maximum AC voltage
uconv to achieve it.
However, in the GSC, AC and DC voltages are closely related. For example, using sinu-
soidal PWM, the maximum magnitude of uconv is 1/2UDC and using SVM is 2/3UDC , so
for each maximum value of uconv there is a corresponding UDC value.
Thus, in Fig. 4.11, to deliver a maximum power P it is necessary for a maximum AC
voltage uconv , which in turn corresponds to UDC (2) . Therefore, the active power delivered
to the grid determines the needed DC bus voltage.

Figure 4.11. The maximum active power is related to the DC voltage.

Note that in this figure, the reactive power was kept to zero. However, if it is needed to
exchange reactive power with the grid, the resulting hypotenuse should be longer, mean-
ing that a higher DC voltage, UDC (3) , is needed, Fig. 4.12.
The safe operational area (SOA) of a GSC is limited by two main aspects. The first
one is the DC voltage since it limits the AC voltage that the power converter is able to
generate, and the second one is the rated current of the IGBTs that make up the power
converter, [Ramirez et al. 2015].
The gray area in Fig. 4.12 is the safe operation area (SOA) of the converter, where uconv

Figure 4.12. The simultaneous generation of P and Q requires a higher DC voltage.

is lower than the IGBTs rated voltage, uconv max , and the current is lower than the IGBTs
rated current, Imax .
Sometimes the SOA falls short of the application and it is necessary to increase it, for
example, to increase the reactive power exchanged with the grid. The most widely used
solution is to use a step-up transformer so that the grid voltage, ugrid seen from the power
converter is now lower, Fig. 4.13. As a result, the circle corresponding to the IGBTs rated
current limit is shifted to the left and the total gray area (SOA) is bigger.

Figure 4.13. The reduction of u g r i d increases the SOA area of the converter.

Another important consideration is how to split the inverter rated current between active
current and reactive current, where the following constraint must be accomplished

i2d + i2q ≤ (IGBT rated current)2 (4.30)

The needed relationship to obtain id from iq and vice versa can be obtained from the
equation of the circumference of Fig. 4.10 right
!2
u2grid  u u
grid conv 2

P2 + Q2 + 3 = 3 (4.31)
X X

After multiplying Eq. (4.31) by 2/ (3 ud ) we obtain


 ud 2  uconv 2
i2d + iq + 2 = 2 (4.32)
X X

Normally, preference for id is chosen due to economic considerations: the active power
delivered by the power plant must be as high as possible.
4.6. Appendix
Clarke transform
After measuring the stator currents, usually, the next step is to express them in the static
reference frame by applying the Clarke transform.

ix = ia
1
iy = √ (ib − ic )
3

Park transform
The stator currents are usually expressed in a rotating reference frame to obtain constant
components, id , iq , that can be easily controlled using a pair of PI controllers.

id = ix cosθ + iy sinθ
iq = iy cosθ − ix sinθ
Chapter

5
Vector Control of Three Phase Induction Motors
(IM)

Dionisio Ramírez

Abstract

The three-phase induction motor is asynchronous, meaning that the rotor speed is not
completely determined by the frequency of the stator currents but, instead, is influenced
by the load torque. Consequently, finding a suitable rotating reference frame that provides
constant components of the steady-state stator currents is more difficult than in other ma-
chines.
In this chapter, we will obtain the control system by expressing the electrical and mechan-
ical equations of the induction machine using space vectors. Then, the vector control
based on proportional-integral controllers and an inverter as a voltage source is finally
developed, drawing conclusions from those equations.

5.1. Introduction
As of now, induction motors are the workhorse of the industry. The development of
power electronics and microcontrollers made it possible to accurately control the torque
and magnetic field of this machine, which eventually replaced DC machines in all appli-
cations.
Currently, other machines such as permanent magnet synchronous motors are competing
with IMs in the market but they have some features that make them unique: robustness,
low price, and complete absence of maintenance. They have, yet, important disadvan-
tages such as the need for reactive power and a less accurate vector control than other
machines.
In this chapter, the recommended readings are: [Leonhard 2001], [Mohan 2014], and
[Novotny and Lipo 1996].

5.2. Electrical equations


The equivalent circuit of the three-phase induction motor comprises several windings that
are magnetically coupled so it is necessary to include these flux linkages in the electrical
analysis. If λas , λbs , λcs , are the flux linkages of each phase of the stator, the stator flux
linkage in the stator reference frame is

− 2
λas + a λbs + a2 λcs

λs = (5.1)
3


where λ s represents the magnitude and direction of the resulting stator flux linkage mea-
sured in the air gap of the motor.
Likewise, the rotor flux expressed in the rotor reference frame is

− 2
λar + a λbr + a2 λcr

λr = (5.2)
3
The electrical analysis begins with the application of Kirchhoff’s second law to each phase
of the stator, resulting in the following phase to neutral voltages uas , ubs , ucs
dλas
uas = Rs ias +
dt
dλbs
ubs = Rs ibs + (5.3)
dt
dλcs
ucs = Rs ics +
dt

where Rs is the stator resistance (denoted as R1 in classical steady state analysis).


In the same way, as with the flux linkages, it is possible to define a space vector for the
stator voltage

− 2
us = uas + a ubs + a2 ucs

(5.4)
3
Using this definition, the combination of the three voltage equations into a single compact
equation yields




− →
− d λs
us = Rs is + (5.5)
dt
Working in a similar way with the rotor voltage equations:



− d λr
0 = Rr ir + (5.6)
dt
where Rr is the rotor resistance (denoted as R2 in classical steady state analysis), and the
rotor windings are short-circuited.
For further developments, it is convenient to express the flux linkage as a function of the
stator, rotor, and mutual inductances, Ls , Lr , Lm .
Thus, in the stator reference frame

− →
− →

λs = Ls is + Lm ir e jε (5.7)

and, in the rotor reference frame



− →
− →

λr = Lr ir + Lm is e− jε (5.8)
Substituting Eq. (5.7) and Eq. (5.8) in Eq. (5.5) and Eq. (5.6), we obtain the following
two equations



− →
− d is d →− + jε 
us = Rs is + Ls + Lm ir e (5.9)
dt dt
(in the stator reference frame)



− d ir d →
− − jε 
0 = Rr ir + Lr + Lm is e (5.10)
dt dt

(in the rotor reference frame)

If the voltage equation for the stator





− →
− d λs
us = Rs is + (5.11)
dt

is expressed in a rotating reference frame where α is the angle with respect to the stator
reference frame, we obtain


− →
− d →
− jα 
us e jα = Rs is e jα + λs e (5.12)
dt
Finding the derivative of this last equation yields



− jα →
− jα jα d λs dα →
− jα 
us e = Rs is e + e +j λs e (5.13)
dt dt
Finally, in the new rotating reference frame, and naming ωk to its speed




− →
− d λs →

us = Rs is + + jωk λs (5.14)
dt



Note that j adds 90◦ to the angle of λs

These electrical equations must be complemented with the mechanical equation of torque.
The needed equation can be obtained, for example, from [Leonhard 2001] (where pole
pairs p = 1)
3 h→ − − jε ∗ i
− →
T = Lm Im is ir e (5.15)
2
The difference between the motor and load torque, together with the inertia (J), deter-
mines the rotor acceleration

dω r 3 − →
h→ − ∗ i
J = T − TLoad = Lm Im is ir e− jε − TLoad (5.16)
dt 2
Finally, the rotor speed can be calculated as


ωr = (5.17)
dt

Side note:
Assuming the same coil turns in the stator and rotor windings, the following leakage
coefficients are defined:
Ls = (1 + σs ) Lm = Lm + σs Lm (5.18)

where Lm is the mutual inductance, and σ Lm is the leakage inductance.

Lr = (1 + σr ) Lm (5.19)

and the total leakage factor is:

1
σ = 1− (5.20)
(1 + σr ) (1 + σs )

5.3. Electromagnetic Torque


In three-phase induction motors (or generators) with the number of pole pairs p = 1 and
the constant of the vector definition k = 2/3, the electromagnetic torque can be calculated
from the stator and rotor currents
3 h→− →− jε ∗ i
T = Lm Im is ir e (5.21)
2
where ε is the angle between the stator and rotor reference frames.
Shifting the mutual inductance, Lm to the parenthesis

3 h→ − → − ∗ i
T = Im is Lm ir e jε (5.22)
2
 → − ∗
Now, the value of the value of Lm ir e jε is obtained from the equation of the stator flux
linkages

− →
− →

λs = Ls is + Lm ir e jε (5.23)
which yields  →− jε ∗ →− →

Lm ir e = λs ∗ − Ls is ∗ (5.24)

that, substituted into the torque equation, Eq.(5.22), results in

3 h→− →
−∗ →
− ∗ i
T = Im is λs − Ls is (5.25)
2
Rearranging the Eq.(5.25) we obtain
3 → −→ −  3 → −→ − ∗
T = Im is λs − Im is is Ls (5.26)
2 2

−→ −
and considering that Im is is ∗ = 0, if the pole pairs is p ̸= 1, the equation for the torque
finally results in

3 −→
→ − 
T= p Im is λs ∗
2
(5.27)

Side note:
3  ∗
Im isα + jisβ λsα + jλsβ (5.28)
2

3  
Im isα + jisβ λsα − jλsβ (5.29)
2

3 
isβ λsα − isα λsβ = T (5.30)
2
As expected, we obtain the general equation of the torque.

5.4. Field Oriented Control (FOC)


The torque equation for a three-phase induction motor with one pole pair, p = 1, and
k = 2/3 is
3 h→
− →− − jε ∗ i
T = Lm Im is ir e (5.31)
2


However, the rotor is an electrically insulated circuit so ir can’t be directly measured and,
consequently, it is not possible to control the torque using this equation.


Alternatively, we could consider measuring the flux in the air gap, im , using Hall effect


sensors to obtain ir

− → − → −
im = is + ir e jε (5.32)
but this solution leads to a complex motor setup and is expensive.
There are other alternatives such as using the stator flux linkage. However, better results


are obtained using the rotor magnetizing current, imr , which includes all rotor flux link-
ages, expressed as a sum of electric currents.


The new rotor magnetizing current, imr , is defined in the stator reference frame as
−→ → − → − →

imr = is + ir e jε + σr ir e jε (5.33)

where


• is represents the rotor flux linkages generated by the stator currents.


• ir e jε represents the rotor flux linkages generated by the own rotor currents.


• σ ir e jε represents the rotor leakage flux.

or expressed in a more compact form


−→ → − →

imr = is + (1 + σr ) ir e jε (5.34)
−→
Now, using imr in the Eq. (5.31)

3 Lm h→
− −→ → − ∗ i
T= Im is imr − is (5.35)
2 (1 + σr )

−→ −
and considering that is is ∗ = 0

3 Lm h→
−− → i
T= Im is imr ∗ (5.36)
2 (1 + σr )
−→
Expressing imr = imr e jρ , see Fig. 5.1, it is obtained

3 Lm h→
− − jρ i
T= imr Im is e (5.37)
2 (1 + σr )

− −→
where is e− jρ represents the stator current in the frame of reference defined by imr , the
new axes named d-q, and ρ is the angle of that frame of reference, see Fig. 5.2.

Figure 5.1. i m r and the frames of reference.

Now, if we separate the real and imaginary parts in Eq. (5.37) in the d-q reference frame,
two new components of the stator current, isd and isq are obtained, see Fig. 5.2
h→
− − jρ i
Real is e = is cos δ = isd (5.38)
Figure 5.2. isd and i s q in the reference frame defined by i m r .

h→
− − jρ i
Im is e = is senδ = isq (5.39)
h→
− i
Substituting Im is e− jρ in Eq. (5.37)
 
3 Lm
T= isq imr = k isq imr (5.40)
2 1 + σr
That, in a more compact form, results in

T = k imr isq
(5.41)
where, if the number of pole pairs is p ̸= 1
3 Lm 3
k= p = p Ls (1 − σ ) (5.42)
2 (1 + σr ) 2

− −→
Note that, in steady state, is and imr rotate synchronously so that isd and isq are constant.
An important finding that can be drawn from Eq. (5.41) is that it is possible to control an
induction motor in a similar way to a DC motor
Torque = Magnetic f ield · Armature current (5.43)
where the magnetic field is now represented by imr and the role of the armature current is
assumed by isq

Now let us see how to control the magnetic field through imr .
Using the equation of the rotor in the rotor reference frame, Eq. (5.10)



− d ir d h→− − jε i
0 = Rr ir + Lr + Lm is e (5.44)
dt dt
−→
and the definition of imr in the stator reference frame
−→ → − →

imr = is + (1 + σr ) ir e jε (5.45)


and obtaining ir from Eq. (5.45)


− − → → −  e− jε
ir = imr − is (5.46)
(1 + σr )
Substituting Eq. (5.46) into Eq. (5.44), the following equation is obtained in the rotor
reference frame

e− jε − → → −
0 = Rr imr − is +
(1 + σr )
 " → − →
− →
#
Lr d i mr d i s − →
− 
e− jε − − jωr i mr − i s
1 + σr dt dt

− !
Lr d i s →

+ e− jε − jωr is (5.47)
(1 + σr ) dt

Lr
After some arrangements, and defining the rotor time constant as τr = , we obtain
Rr
−→

− d imr −→
is = τ r + (1 − jωr τr ) imr (5.48)
dt
−→
The current imr can be expressed in the stator reference frame as
−→
imr = imr e+ jρ (5.49)

and substituting it into Eq. (5.48), expressed in the stator reference frame results in


− d
imr e+ jρ + (1 − jωr τr ) imr e+ jρ

is = τr (5.50)
dt
Calculating the derivatives
 

− + jρ dimr dρ + jρ
is = τ e +j e imr + (1 − jωr τr ) imr e+ jρ (5.51)
dt dt

−→
and multiplying by e− jρ to change the frame of reference to that defined by imr

− − jρ dimr dρ
is e = τr + jτr imr + (1 − jωr τr ) imr (5.52)
dt dt
Finally, considering only the real part of Eq. (5.52)

dimr
τr + imr = isd
dt
(5.53)



The magnitude of the current i mr represents the magnetic field in the motor (except the
stator flux leakage). Therefore, according to Eq. (5.53), by controlling isd it is possible to
control the magnetic field in a similar way to a DC motor.
The time constant, τr , represents the delay in the response of the first-order transfer func-
tion corresponding to isd - imr , see Fig. 5.3. Its value can be as high as one second in
high-power motors.

Figure 5.3. Transfer function between i s d and i m r .

The angular speed of the reference frame is calculated from the imaginary part of Eq.
(5.52)
dρ isq
= ωmr = ωr +
dt τr imr
(5.54)

where the slip speed is


isq
ωslip = (5.55)
τr imr
that is highly dependent on the value of τr , which value is highly sensitive to the temper-
ature of the rotor.
Note that, at t = 0 the angle ρ is not known because at that time, the slip speed can’t be
calculated (isq and imr are calculated using ρ). A common workaround is to substitute
isq in Eq. (5.54) by the reference of isq provided by a PI controller, which provides a
continuously increasing value that helps the motor start-up. Also, to avoid a zero in the
denominator, a constant value of imr can be used at the start.

5.5. Terminal equations of the IM


The terminal equations are needed to analyze how the voltage in the d and q axes controls
the currents in the corresponding axes.
Applying Kirchhoff’s second law we obtain



− →
− d is d →
− + jε 
us = Rs is + Ls + Lm ir e (5.56)
dt dt
−→
Recalling the definition of imr
−→ → − →

imr = is + (1 + σr ) ir e jε (5.57)


and using it to remove ir from Eq. (5.56) as well as the definitions Eq. (5.18), Eq. (5.19),
Eq. (5.20), we obtain (see side note at the end of the chapter):

− −→

− →
− d is d imr
us = Rs is + σ Ls + (1 − σ ) Ls (5.58)
dt dt
Separating real and imaginary parts, we finally obtain the terminal equations

d isd d imr
usd = Rs isd + σ Ls − σ Ls ωmr isq + (1 − σ ) Ls
dt dt
(5.59)

d isq
usq = Rs isq + σ Ls + σ Ls ωmr isd + (1 − σ ) Ls ωmr imr
dt
(5.60)

Note that, in Eq. (5.59)

• usd and isd make up a first-order system. Therefore, the control of usd allows to
control isd .

• σ Ls ωmr isq is a cross-coupling term that must be canceled out by a feedforward


term.

d imr
• (1 − σ ) Ls is a known term, and = 0 in steady state.
dt

Likewise, in Eq. (5.60)

• usq and isq make up a first-order system. Therefore, the control of usq allows con-
trolling isq .

• σ Ls ωmr isd is a cross-coupling term that must be canceled out by a feedforward


term.

• (1 − σ ) Ls is a known term, ωmr must be calculated in every program cycle, and imr
keeps constant in steady state.

5.6. Block Diagram


The block diagram shows the control loops that make up the control system.
It consists of an inner loop where the current components are controlled and an outer loop
where the speed is controlled through the torque.
Figure 5.4. Block diagram of the FOC of an IM.

The external loop (slower) compares the measured (or estimated) speed with the refer-
ence speed and the error is input to a P-I controller, which provides the torque reference,
finally transformed into the isq reference.
In the inner loop (faster) the stator currents are measured and isd , isq is obtained by means
of the Clarke and Park transforms. The d component is used to obtain the actual value
of imr and the result is compared to its reference, whereas the error is taken to its P-I
controller. Likewise, the q component of the current is compared to the corresponding
reference and the error is taken to its P-I controller. The outputs of the internal controllers
are added to the decoupling terms and the result is expressed in the stator reference frame
by means of the inverse Park transform, which finally provides the reference voltage to be
generated by the SVM stage.
Note that, since there is a relative speed between the rotor magnetic field and the rotor
itself, ωslip , the location of the d-axis cannot be obtained by measuring the position of the
rotor and therefore only the rotor speed is measured.
Side note:
In this note it is detailed how to get to (5.58) from (5.56) and how to calculate the deriva-
−→
tive of imr in the stator reference frame.


− −→ → −!   →
− −→
d is d imr − is Lm d is Lm d imr
Ls + Lm = Ls − + (5.61)
dt dt 1 + σr 1 + σr dt 1 + σr dt
Multiplying and dividing some terms by (1 + σs )
  →
− −→
Lm (1 + σs ) d is Lm (1 + σs ) d imr
Ls − + (5.62)
(1 + σr ) (1 + σs ) dt (1 + σr ) (1 + σs ) dt

Considering that
Ls = Lm (1 + σs ) (5.63)
and
1
σ = 1− (5.64)
(1 + σr ) (1 + σs )
Ls becomes common factor
  →
− −→
1 d is 1 d imr
Ls 1 − + Ls (5.65)
(1 + σr ) (1 + σs ) dt (1 + σr ) (1 + σs ) dt

Simplifying

− −→
d is d imr
Ls σ + Ls (1 − σ ) (5.66)
dt dt
−→
d imr
Now we are going to calculate dt in the stator reference frame.
−→
d imr d
imr e jε

Ls = Ls (5.67)
dt dt
Finding the derivative
dimr d
Ls e jε + Ls imr e jε ( jε) (5.68)
dt dt
The term e jε places the derivative term on the axis d.
−→
d imr −→ dε
Ls + j Ls imr (5.69)
dt dt

−→
d imr −→
Ls + j Ls imr ωk (5.70)
dt
−−→
dimr −→
Therefore, the term Ls is on the axis d, and the term Ls imr ωk is on the axis q due
dt
to the 90◦ added by the imaginary term j.

Note that whenever a vector expressed in a rotating reference frame is derived, a new
term containing the angular speed of that reference frame is obtained.
Chapter

6
Permanent Magnet Synchronous Motors (PMSM)

Dionisio Ramírez

Abstract

The PMSM, either as a motor or generator, has become very popular in the world of re-
newable energy and electric mobility. In offshore wind generation, it provides high-power,
low-speed, gearbox-free generators with reduced maintenance. In electric vehicles, this
type of motor is often preferred over the induction motor because of its higher efficiency
and power density.
The torque in PMSMs is generated by the interaction between the rotor magnet field and
the magnetic field generated by the stator currents. In this chapter, we first obtain the
general equation of the torque, and then we obtain particular equations for the case of
surface magnets and for interior magnets.
This chapter is based on the theory that represents the magnetic field of the machine by
means of a winding d-q equivalent to the actual three-phase winding and, for the sake
of generality, all magnetic fields, including those of magnets, have been assumed to be
generated by windings.

6.1. Introduction
There are three types of three-phase synchronous machines and they are closely interre-
lated: Surface PMSM, Fig. 6.1 (a), Interior PMSM, Fig. 6.1 (b), and Synchronous Reluc-
tance Machine (SynRM), Fig. 6.1 (c).
In the former, the magnet torque is generated exclusively by the interaction of the rotor
(magnets) and stator (windings) fields. In this machine, the torque is controlled by acting
on the stator field through isq .
In the second one, an additional torque to the magnet torque generated by the stator and
rotor magnetic fields appears, which is called reluctance torque. In this case, the magnet
torque is still controlled by isq , but the additional reluctance torque depends on isq and isd ,
so the torque and field control is not independent.
Finally, in SynRM the torque is generated exclusively by the reluctance effect when the
stator and rotor field are misaligned. In this case, the torque control is performed by acting
on isq for a constant value of isd , and the general equation of the torque still applies.
The mathematical developments shown in this chapter assume the same conditions previ-
ously considered for the induction motor.

Figure 6.1. Three phase synchronous motors: (a) Surface-PMSM; (b) Interior-
PMSM; (c) Synchronous Reluctance (SynRM).

The PMSM (surface or interior magnets) is framed within the category of synchronous
machines and has the following advantages over other more common ones such as syn-
chronous or induction motors:

• Higher efficiency due to the absence of copper loss in the rotor.

• Better dynamic response due to a more accurate control.

• Higher power density (smaller size), Fig. 6.2.

• Lower maintenance since they do not use slip rings or exciter.

• Surface magnet motors are simple to build.

However, PMSMs also present some disadvantages:

• Higher production cost.

• Magnets critical sensitivity to temperature.

• Stator overvoltage at high speed.

• Interior magnet motors are complex to build.

• At start-up, the rotor position is not known, so the vector control needs a special
routine.
Figure 6.2. Power density comparison between several types of motors.

6.1.1. Evolution of electric drives over time


• At the beginning, electric drives were exclusively for DC motors since the low level
of development of microelectronics and power electronics made it impossible to
have adequate controls for AC machines. In contrast, the use of adjustable DC
voltage sources was widespread.

• In the early 1970s, microelectronics and power electronics made it possible the
widespread use of power converters with PWM and sophisticated controls such as
FOC, etc. for induction motors. However, this type of motor operates efficiently
in the 700-3,000 rpm range, so gearboxes are frequently needed (leading to higher
losses and higher maintenance) and machines with many pole pairs (low speed)
result very big.

• Nowadays, the growing trend is to avoid using gearboxes by using three-phase mo-
tors with permanent magnets in the rotor, Fig. 6.3.

Figure 6.3. Improvement of the efficiency of electric drives using PMSMs.


6.1.2. Applications
Three-phase permanent magnet motors and generators are being used today in the most
innovative developments:

• Wind generators: to remove the gearbox and to increase the rated power while
keeping a reasonable size and to reduce maintenance in offshore wind, Fig. 6.4.

Figure 6.4. Application to wind energy.

• Electric vehicles, Fig. 6.5: PMSMs offer many advantages including a high power-
to-weight ratio, high efficiency, rugged construction, low cogging torque, and the
capability of reluctance torque.

Figure 6.5. Application to electric mobility.

• Naval applications where their easy control and small size allow them to be installed
in submerged and steerable pods outside the ship’s hull, Fig. 6.6. In this type of
gearless steerable propulsion system, the electric drive motor can rotate through
360◦ which improves the maneuverability and operating efficiency. In addition, the
minimal noise and vibration also improve passenger and crew comfort.
Figure 6.6. Naval Applications: PMSM installed in pods for better maneuverability.

• State-of-the-art non-nuclear submarines, in which the PMSM is powered by a hy-


drogen fuel cell, Fig. 6.7 that allows the submarine to operate without atmospheric
oxygen (surfacing or using a snorkel). Air-independent propulsion (AIP) improves
submerged endurance, eliminates the need for intake and exhaust connections through
the surface, and reduces the chances of detection by visual, radar, or even thermal
methods.

Figure 6.7. Naval applications: installation of a PMSM in an S-80 Plus submarine.

6.2. Torque control


The torque of a synchronous permanent magnet machine is given by the general expres-
sion [Kim 2017]  
3  
Te = p  Lsd − Lsq isd isq + Lmd i f d isq  (6.1)

2 | {z } | {z }
reluctance torque magnet torque

where the first term is called reluctance torque and the second term is called magnet
torque:
3 
Treluctance = p Lsd − Lsq isd isq (6.2)
2
3
Tmagnet = p λ f d isq (6.3)
2
Fig. 6.8 shows both torques expressed as a function of the angle β which determines
if the whole current is used to generate torque or if a portion is used to weaken the rotor
magnetic field [Zhao et al. 2018]. As can be seen, if the whole stator current is used as
isq , the magnet torque is maximum and the reluctance torque is zero. As β increases,
the rotor magnetic field is weakened through isd < 0 and the reluctance torque becomes
positive, reaching the peak value when β = 45◦ .
Note that, as the reluctance torque increases, it makes up for the decrease in magnet
torque, and the total torque reaches its maximum value at an intermediate point. This
feature is used in electric vehicles to weaken the field of the rotor magnets at high speed
while providing extra torque by taking advantage of the reluctance effect created by the
asymmetrical design of the rotor. Thus, the reduction in the available magnet torque
caused by the rotor field weakening is compensated by the increase in the reluctance
torque.
It is interesting, however, that the maximum total torque is attained with the rotor partially
demagnetized, in other words, when the magnetic field generated by the stator windings
partially cancels out (weakens) the magnetic field provided by the rotor magnets. This
can be readily justified by having a look at Eq. (6.3) where, since in IPMSMs Lsq > Lsd ,
isd has to be negative for a positive reluctance torque to be added to the magnet torque.

Figure 6.8. top: magnet torque and reluctance torque vs. β ; bottom: vector
diagram of a PMSM. β is the angle between the q-axis and the stator current
vector, i s .

While the magnet torque term exists in motors with both asymmetrical (interior mag-
nets) and symmetrical (surface magnets) rotors, the reluctance torque term only exists in
those with no symmetry in the d and q axes of the magnetic circuit, Lsd ̸= Lsq , (interior
magnets), as Eq. (6.2) showed.
From Eq. (6.3), it is clear that the torque of symmetrical motors is controlled exclu-
sively by isq (Lmd i f d = λ f d represents the field generated by the magnets).
However, in asymmetrical motors, the mathematical expression for the torque contains a
term with isd and isq , Eq. (6.2) so the control of both torques is cross-coupled and they
cannot be controlled independently.
Therefore, to leverage the reluctance torque, it is necessary to find a set of isd , isq pairs


that maximize the torque keeping i s as low as possible, in a control strategy known as
Maximum Torque Per Ampere (MTPA). That set of pair of values is usually calculated
offline and stored in a lookup table in the microcontroller memory.
An alternative approach is to find a new reference system to attach the reference frame,
and that will be the magnetic field generated by the stator.

6.3. General equations of the flux linkages in synchronous machines


The equations of the stator winding flux linkages as a function of current in dq coordinates
take into account the flux linkages produced by the stator itself and the ones produced by
the rotor actually linked to the stator (not the leakage flux).
If we call λ f d the flux linkages of the magnets excluding the leakage flux, the stator flux
linkages can be expressed as
λsd = Lsd isd + λ f d (6.4)

and
λsq = Lsq isq (6.5)

where the stator inductances, expressed as a function of the mutual inductance and the
leakage inductance are
Lsd = Lmd + Lρs (6.6)

Lsq = Lmq + Lρs (6.7)

If we think of a field winding equivalent to the rotor magnets, it must have the same
magnetizing inductance Lmd as the stator winding, hence its equivalent inductance can be
written as
L f d = Lmd + Lρ f d (6.8)

where Lρ f d is the leakage inductance of the equivalent field winding, the flux linkages
equations of the rotor windings equivalent to the rotor magnets are

λrd = L f d i f d (6.9)

and
λrq = 0 (6.10)

where i f d is the DC current of the equivalent field winding of a synchronous machine.


Note that
λ f d = Lmd i f d (6.11)

and, therefore, it does not take into account the leakage term Lρ f d i f d .
6.4. General equation of the electromagnetic torque in synchronous machines
As demonstrated previously, Eq. (4.11), using the space vector definition and taking into
account the relation: isa + isb + isc = 0, the active power, P1 , in a balanced three-phase
system can be written as:
3 h → − i
P1 = Re → −
u s i s∗ (6.12)
2
So we need to calculate the stator voltage in order to derive the active power.
The application of Kirchhoff’s second law to the stator of the synchronous machine in the
static reference frame yields



− →
− d λ s αβ
u s αβ = Rs i s αβ + (6.13)
dt
If we choose a rotating reference frame



− jθr →
− jθr d λ s dq e jθr
u s dq e = Rs i s dq e + (6.14)
dt
Finding the derivative of the last term of Eq. (6.14)



− jθr →
− jθr jθr d λ s dq dθr →

u s dq e = Rs i s dq e + e +j λ s dq e jθr (6.15)
dt dt
Multiplying by e− jθr and simplifying the notation, we obtain the following equation in
the dq reference frame, and for p=1



− →
− dλs →

u s = Rs i s + + jωr λ s (6.16)
dt

Once we know the stator voltage, by substituting Eq. (6.16) into Eq. (6.12) and con-
sidering any synchronous speed, ωr (p=1) = p ωr
" →
− !#
3 →
− → −∗ dλs→ −∗ →
− →−∗
P1 = Re Rs i s i s + i s + j p ωr λ s i s (6.17)
2 dt

− → −  →
− → −  →
− → − 
Note that i s · i s∗ = |is |2 and that Re j λ s i ∗s = Im λ s∗ i s , therefore
" →
− ! #
3 dλs→−∗  →
−∗→ − 
P1 = Rs |is |2 + Re i s + Im p ωr λ s i s (6.18)
2 dt

The second term can be arranged as follows



−∗→
   
3 2 dλsd dλsq  − 
P1 = Rs |is | + isd + isq + Im p ωr λ s i s (6.19)
2 dt dt
resulting in " →
− #
3 →
− d λ s
 →
− →
− 
P1 = Rs |is |2 + i s + Im p ωr λ s∗ i s (6.20)
2 dt
The above terms represent the following active powers

P1 = PCu stator + Pstored in core + Pstator→rotor (6.21)

The first two terms are the same as in any inductor, copper losses, and energy stored in
the magnetic core (see Electric Machines, 2nd GITI course). Therefore, the third must be
the electrical power transferred to the rotor through the magnetic coupling.
Moreover, considering that in a PMSM PCu rotor = 0 and PFe rotor ≈ 0 (being synchronous),
the power entering the rotor is equal to the mechanical power and can be expressed as
3 →
− → − 
Pe = p ωr Im λ s∗ i s (6.22)
2
The instantaneous electromagnetic torque developed by an electric motor can be defined
as
Pe
Te = (6.23)
ωr
where Pe is the electromagnetic power and ωr is the mechanical angular rotor speed.
Finally, taking into account Eq. (6.23), the general expression for electromagnetic torque
becomes →
3 − → − 
Te = p Im λ ∗s i s (6.24)
2

− →

and in the d-q reference frame λ s∗ = λsd − j λsq and i s = isd + j isq

3 
Te = p λsd isq − λsq isd
2
(6.25)

this equation has been obtained using k = 2/3 in the Clarke transform.
Note that q
2
In case k = 3, the factor 3/2 must be changed to 1.
6.5. Surface Permanent Magnet Synchronous Machines (SPMSM)
6.5.1. Classification
In these machines, the magnets are placed on the surface of the rotor, around its whole
perimeter, as shown in Fig. 6.9, and fixed using strong adhesives.
The relative permeability of the material composing the magnets is typically in the range
of 1.02 to 1.2, so it is close to that of air. From this standpoint, the magnets can be
considered as part of the air gap between the stator and rotor.

Figure 6.9. Rotor structure of an SPMSM motor.

Since it is necessary to provide a physical space to accommodate the magnets, this re-
sults in motors with large air gaps, which increases the reluctance of the magnetic circuit
and reduces the flux.
The magnets are attached to the rotor surface using powerful adhesives.
Within the classification of synchronous motors, they are similar to the round rotor syn-
chronous motors since Lsd = Lsq .
The large air gap makes it necessary to use magnets based on either Samarium or Neodymium
(10 times more energy), although their price is high. This results in relatively small size
motors, even for a high number of poles, avoiding the increase of the diameter of syn-
chronous motors with salient poles.

6.5.2. Structure
The example in Fig. 6.10 corresponds to a salient pole rotor. In the initial case, the polar
pitch is 120 mm. To increase the number of poles, it is necessary to reduce the polar pitch,
so in order to maintain the N I, it is necessary to increase the rotor diameter. If the polar
pitch is reduced to 50 mm, the rotor diameter will be too large. A compromise solution
would be to leave it at 80 mm which limits the number of poles that can physically fit
around the perimeter of the rotor.
Figure 6.10. Rotor structure of a salient pole synchronous motor.

In the surface permanent magnet machine of Fig. 6.11, the polar pitch can be reduced
to 50 mm without losing flux due to the strength of the magnets, which makes it possible
to build rotors with a high number of poles. In addition, the elimination of the excitation
losses cancels out the extra cost of the magnets.
Therefore, surface-PMSM is the optimal design choice for multipole machines.

Figure 6.11. Rotor structure of an SPMSM.

6.6. Torque in nonsalient-pole synchronous machines (SPMSMs)


In synchronous motors with surface-mounted permanent magnets, the rotor can be consid-
ered magnetically round (non-salient) that has the same reluctance along any axis through
the center of the machine.
The stator d and q winding flux linkages can be expressed as follows
λsd = Ls isd + λ f d (6.26)
and
λsq = Ls isq (6.27)
where in Eq. (6.26) and Eq. (6.27), Ls = Lsd = Lsq = Lρs + Lm , and λ f d represents the flux
linkages of the stator d windings due to flux produced by the rotor magnets (recognizing
that the d-axis is always aligned with the rotor magnetic axis).
As is already known, the general equation for the torque is
3 
Tem = p λsd isq − λsq isd (6.28)
2
Substituting for the flux linkages in the above equation for a non-salient pole machine,
λsd = Ls isd + λ f d and λsq = Ls isq

3  3
Tem = p Ls isd + λ f d isq − p Ls isq isd (6.29)
2 2

Finally, we obtain

3
Tem = p λ f d isq
2
(6.30)

qequation has been obtained using k = 2/3 in the Clarke transform.


Note that this
2
In case k = 3, the factor 3/2 must be changed to 1.

6.6.1. Images of SPMSM

Figure 6.12. left: Low power SPMSM; right: low speed S-PMSG for wind generator.

Figure 6.13. Rotor of SPMS Generators.


Figure 6.14. Low-speed PMS Generator direct drive.

6.7. Interior Permanent Magnet Synchronous Machines (IPMSM)


In this type of machine, the magnets are embedded in the rotor iron, Fig. 6.15. Since the
permeability of ceramic (ferrite) and rare-earth (neodymium, samarium) based magnetic
materials is close to that of air, they represent a large air gap in the flux path through the
rotor [Jahns et al. 1986].

Figure 6.15. Internal structure of an IPMSM.

Embedding magnets in the rotor produces saliencies in the rotor’s magnetic circuit
that are not present in the surface magnet machine. For conceptualization purposes, the
internal magnet machine can be considered a hybrid of a reluctance machine and a surface
magnet machine.
Continuing with the theory that decomposes the machine field into two axes, the two flux
paths correspond to the d-q axes, as shown in Fig. 6.16.
Figure 6.16. Principal IPMSM magnetic paths a) d axis. b) q axis.

The magnetic flux generated by the magnets defines a radial d-axis through the center
of the magnets. Thus, while in the d-axis, the flux has to pass through the magnets (high
reluctance), in the q-axis it passes through the metal supports (low reluctance), denoted
as nonmagnetic spacers in Fig. 6.15.

Characteristics:

• The inductance in the q-axis is typically higher than that in the d-axis, Ld < Lq ,
which makes this machine different from the conventional salient-pole synchronous
machines, where Ld > Lq .

• The total available torque, see Fig. 6.8, is provided by the combination of two
torques of different nature: the magnet torque and the reluctance torque.

• The reluctance torque provided by the saliencies can be used to reduce the flux (and
magnet torque) to extend the speed range of the motor above the rated speed.

• From an economic standpoint, the effect of the saliencies can be used to reduce the
volume of magnetic material in the machine, which would otherwise be necessary
to achieve a certain rated power.

• This type of machine is more robust than the surface magnet machine.

• Embedding the magnets allows having a smaller air gap which results in higher
flux. In addition, for the same magnetic material, cheaper magnets can be used.

• The assembly of this type of machine is more expensive and complex.

• They are larger machines and, therefore, suitable only for a low number of poles
(higher speeds).
6.8. Torque in salient-pole synchronous machines (IPMSMs)
Synchronous machines with interior permanent magnets result in unequal reluctance along
the d- and q-axis.
In the stator dq windings
Lsd = Lmd + Lρs (6.31)
and
Lsq = Lmq + Lρs (6.32)
where the magnetizing inductance of the d winding is not equal to that of the q winding
(Lmd ̸= Lmq ) due to the salient nature of the rotor. However, both windings have the same
leakage inductance Lρs , which is not affected by the rotor structure.

The stator dq winding flux linkages are

λsd = Lsd isd + λ f d (6.33)

λsq = Lsq isq (6.34)


The rotor dq flux linkages are (L f d is the equivalent winding in the rotor)

λrd = L f d i f d (6.35)

and
λrq = 0 (6.36)
Substituting the stator flux linkages into the torque general equation, Eq. (6.24), we obtain

3   
Tem = p Lsd − Lsq isd isq + λ f d isq
2
(6.37)

where the term Lsd − Lsq isd isq is due to the saliency of the rotor (reluctance torque),
and the term λ f d isq is generated by the magnetic field of the magnets (magnet torque).

It is important to recall that λ f d only takes into account the flux shared by the stator
and rotor and excludes the leakage flux of the magnets.

qequation has been obtained using k = 2/3 in the Clarke transform.


Note that this
2
In case k = 3, the factor 3/2 must be changed to 1.
6.8.1. Images of IPMSMs
Fig. 6.17 shows three IPMSM rotors used in EVs.

Figure 6.17. Rotor of the IPMSMs of a) Volkswagen ID.4, b) Nissan Leaf, c) Tesla Model 3.

Fig. 6.18 shows the disassembled rotor of an IPMSM used in Tesla EVs.

Figure 6.18. Disassembled rotor used in Tesla EVs showing the interior magnets
and the rotor lamination.

Fig. 6.19 and Fig. 6.20 show flat wire hairpin windings used in some types of motors.
The main advantage is a higher slot fill factor that improves refrigeration, torque, and
power density, which ultimately can reduce the motor size for EV applications. This type
of winding is used, for example, in Volkswagen and BMW EVs.
Figure 6.19. Stator of a motor for electric vehicle realized using hairpin windings.

Figure 6.20. Hairpin flat winding.

Fig. 6.21 shows the stator windings used in IPMSMs of Tesla EVs.

Figure 6.21. Stator windings used in a Tesla EV.


6.9. Appendix
See [Mohan 2014] for further information related to the subjects addressed in this chapter.
From that reference:
Representation of stator mmf by equivalent dq windings:
At any instant of time, the air gap mmf distribution by three phase-windings can also be
produced by a set of two orthogonal
p windings: Fig. 6.22 (b).
The dq winding currents are 3/2 times the projections of the is (t) vector along the d-
and q-axis: Fig. 6.22 (c).

Figure 6.22. Equivalent d q stator windings

Representation of rotor mmf by equivalent dq winding currents, Fig. 6.23.

Figure 6.23. Equivalent d q rotor windings of a generalized salient pole syn-


chronous machine

Generalized salient-pole machine with rotor field excitation and nonidentical damper
windings along the d and the q axis, Fig. 6.24.
Figure 6.24. Equivalent d q stator and rotor windings of a generalized salient pole
synchronous machine.
Chapter

7
Vector Control of Three-Phase Permanent Magnet
Synchronous Motors (PMSM)

Dionisio Ramírez

Abstract

The vector control of a PMSM is not very different from that of a squirrel-cage motor,
except for the reference system chosen, which will be the rotor or stator field, and the
resulting cross-coupling terms.
The vector control (FOC) developed in this chapter assumes that the rotor position is
known, either because it is measured or because it is estimated by the control through
dedicated software. However, in motor operation, the rotor position is not known at the
very first moments of the startup, so a specialized function is needed to spin the rotor to a
known position before starting to apply the FOC.

7.1. Introduction
Vector control of surface PMSMs is carried out using the rotor magnetic field as the
reference frame, resulting in a very simple torque equation. Vector control of interior
PMSMs can be carried out using either the rotor magnetic field or the stator magnetic
field as the reference frame. However, in the former, field and torque control are not fully
independent, and in the latter, additional control is required in the rotor reference frame
to ensure that the torque control does not accidentally demagnetize the rotor magnets.
In this chapter, the recommended readings are: [Mohan 2014], [Novotny and Lipo 1996],
and [Pyrhöonen et al. 2016].

7.2. Field Oriented Control (FOC) of the SPMSM


When the PMSM rotates unloaded there is no voltage drop in the stator resistance and
inductance, so that the stator voltage matches the back electromotive force (back-EMF),
Eq. (7.1).
|→

u s | = |→

e 0| (7.1)

As Eq. (7.9) and Eq. (7.10) will show, in the unloaded machine, the b.e.m.f., →

e 0 , is
proportional to the variation of the magnetic flux, Eq. (7.2)


|→
−u s | = |→

e0 | = ωr λ f d (7.2)


where ωr is the rotor speed and λ f d represents the flux linkages due to the rotor magnets,
the value of λ f d can be readily obtained in the laboratory by measuring the rotor speed
and the stator voltage, preferably when the machine works as a generator.


Once determined λ f d , it is possible to calculate and control the torque of an SPMSM
using Eq. (6.3)
3
Te = p λ f d isq
2
(7.3)
where the Clarke transform has been calculated using k = 2/3 and p is the number of pole
pairs.
Therefore, for the machine to follow the torque reference, the microcontroller has to con-
trol isq through the power converter, Fig. 7.1. Positive values of isq correspond to the
operation as a motor and negative values as a generator.
At the same time, the reference of isd is usually kept to zero. Only if a field weakening is
necessary, the reference is negative, isd < 0, taking into account that there is a limit to de-
magnetization beyond which the process is irreversible and the magnets are permanently
damaged. Positive values of isd are not used as they cause the stator to generate a field
that strengthens the rotor field and causes higher iron losses.

Figure 7.1. Space vectors of a FOC for SPMSM that uses the rotor flux as the
frame of reference.

7.2.1. Terminal equations of the SPMSM


Now, we will obtain the terminal equations of the SPMSM that allow us to study the
relationship between usd - isd and usq - isq , as well as the resulting cross-coupling terms,
to design the control system.
The application of Kirchhoff’s second law to the stator in the static reference frame yields

− →


− →
− d λ s αβ →
− jθr →
− jθr d λ s dq e jθr
u s αβ = Rs i s αβ + → u s dq e = Rs i s dq e + (7.4)
dt dt
Deriving the last term of Eq. (7.4)



− jθr →
− jθr jθr d λ s dq dθr →

u s dq e = Rs i s dq e + e +j λ s dq e jθr (7.5)
dt dt
If we separate the real and imaginary parts
dλsd
uconvd = Rs isd + − ωr λsq
dt (7.6)
dλsq
uconvq = Rs isq + + ωr .λsd
dt

Now, using
λsd = Ls isd + λ f d (7.7)
and
λsq = Ls isq (7.8)
we finally obtain
disd
uconvd = Rs isd + Ls − ωr Ls isq
dt
(7.9)

disq
uconvq = Rs isq + Ls + ωr Ls isd + ωr λ f d
dt
(7.10)

Eq. (7.9) and Eq. (7.10) show that the relationship between the voltage applied to


the stator, →

u conv , and the stator current, is , corresponds to a 1st order transfer function,

− →

Rs i s + Ls d i s /dt. This fact means that it is possible to control the stator current through
the voltage applied by the converter although through a damped dynamic.
However, the cross-coupling terms −ωr Ls isq and +ωr Ls isd mean that, unfortunately,
the control on the d and q axes is not completely independent. The solution is to make the
control loop independent of these terms by calculating them externally and adding them
(feedforward compensation)in the final stage of the control loop.
Note that ωr λ f d is the back-EMF induced by the magnets in the stator windings.

7.2.2. Equivalent circuit


It is possible to study the SPMSM [Novotny and Lipo 1996][Mohan 2014] by means of a
generalized equivalent circuit. Fig. 7.2 shows the equivalent DC circuit broken down into
two circuits, one for each axis. Note that, in steady state, isd and isd are DC and that i f d is
always constant.

In the d-axis of the figure, the following equation is fulfilled


 
disd disd di f d
usd = Rs isd + Lρs + Lm + − ωr λsq (7.11)
dt dt dt
Figure 7.2. SPMSM equivalent circuit in the rotor reference frame.

di f d
Considering that = 0 and λsq = Ls isq
dt
disd
usd = Rs isd + Ls − ωr Ls isq (7.12)
dt
Note that this is the same result obtained for the terminal equation of the d-axis, Eq. 7.9.

In the rotor side:


 
Lm i f d + isd + Lρ f i f d = Lm isd + Lm + Lρ f i f d = Lm isd + λ f d (7.13)

Similarly, in the q-axis of the figure


 disq
usq = Rs isq + Lm + Lρs + ωr λsd (7.14)
dt
Considering that Lm + Lρs = Ls and that λsd = Ls isd + λ f d

disq 
usq = Rs isq + Ls + ωr Ls isd + λ f d (7.15)
dt
that, again is the same result obtained for the q-axis terminal equation, Eq. 7.10.

7.3. Block diagram


The block diagram is similar to that of vector control of any other three-phase machine. It
consists of an outer loop that controls the rotor speed through the electromagnetic torque
and an inner (double) control loop that controls the stator current in the d and q axes.
The feedforward terms are obtained from the terminal equations.
Note that in this machine the position of the rotor magnetic field is measured very accu-
rately with an encoder or resolver. Thus, the Park transform provides very accurate and
stable values of isd , isq compared to the results obtained in the induction machine, where
the slip estimation is always troublesome and not very accurate.
The magnetic field is controlled with isd = 0 from zero speed to rated speed. Only if the
rated speed is to be exceeded, a field weakening with isd < 0 is carried out. The rea-
son is to prevent the electromotive force (back-EMF) from damaging the stator winding
insulation and to avoid blocking the inverter when the back-EMF force reaches voltage
values similar to those generated by the inverter or, ultimately, to prevent the voltage on
the DC link capacitors from becoming too high (the back EMF charge them through the
anti-parallel diodes).

Figure 7.3. Block diagram of the FOC for SPMSMs.

Design of the inner loop controllers


As already mentioned, according to Eq. (7.9) and Eq. (7.10) it is possible to control isd
and isq by means of the voltage applied by the power converter, uconv d and uconv q . Note
that in Fig. 7.4, the cross-coupling terms added externally to the control loop cancel out
the effect of the actual rotational e.m.f., −ωr Ls isq and +ωr Ls isd + ωr λ f d (can be con-
sidered disturbances) so the transfer function is indeed very simple and the same for both
axes [Mohan 2014].
In motor drive systems, the back-EMF acts as a disturbance on the current control [Kim 2017].
Feedforward control is an effective way to rapidly eliminate its effect on the output. The
feedforward control predicts and compensates for the disturbance by adding it to the con-
trol input in advance but must be always used along with a feedback control.
The reference flux values are stored as a function of the rotor speed in a lookup table.
Figure 7.4. Block diagram of the inner control loop.

Now, let us consider the delay caused by the power converter. The final control loop
for both axes is shown in Fig. 7.5.

Figure 7.5. Block diagram of the inner control loop.

Transfer function of the electrical machine


From the d-q voltages standpoint, the transfer function of the machine is first order, where
Rs is the stator resistance and Ls = Lm + Lρs is the stator inductance.
Expressing the transfer function in standard form we obtain

Isd (s) Isq (s) 1 km


= = = (7.16)
Usd (s) Usq (s) Ls s + Rs s + 1/τm

where km is the gain and τm is the time constant

1
km =
Ls
(7.17)
Ls
τm =
Rs
This transfer function presents a dominant pole caused by 1/τm that must be canceled out
by the zero of the PI controller so as to impose the desired dynamics.
Transfer function of the power converter
The power converter adds a small delay of the order of hundreds of microseconds. This
delay is caused by the time that elapses from the moment in which the desired voltage
is loaded in the PWM hardware until the actual voltage effectively reaches that average
value as the PWM pulses evolve in time. As a consequence, the bandwidth of the closed-
loop transfer function has to be limited to a value at least 10-25 times lower than the
switching frequency, as discussed in section 4.4.
Transfer function of the Proportional Integral (PI) controller
The PI controller comprises a proportional term (P) and an integral term (I).
kintg
R (s) = k prop + (7.18)
s
Expressing the transfer function in standard form, we obtain

k prop s + kintg
R (s) = (7.19)
s
where k prop and kintg are the proportional and integral gains of the PI controller.

Transfer function of the inner loop (isd , isq )


Considering the PI controller and the grid connection, the open-loop transfer function,
G◦ (s), is
k prop s + kintg 1
G◦ (s) = (7.20)
s Ls s + Rs
or
 
kintg
k prop s + k prop
G◦ (s) = (7.21)
Ls s (s + Rs /Ls )
Normally, the pole is near the origin and corresponds to a slow natural response. To
improve the open-loop frequency response, the pole is usually canceled by the zero of the
PI controller. The gains are chosen to be kintg /k prop = Rs /Ls and k prop /Ls = 1/τi
1 1
G◦ (s) =   = (7.22)
Ls τi s
k prop s

where τi is the desired constant time in the closed-loop transfer function. And, the closed-
loop transfer function results in

1
G (s) = (7.23)
τi s + 1

As already discussed in section 4.4 the value of τi must be small (0.5 − 5ms) in order
to obtain a fast dynamic response. However, τi is directly related to the bandwidth, ωcc ,
of the closed-loop transfer function (τi is the inverse of ωcc ). Since the current changes
cannot be faster than the frequency of the PWM pulses, the bandwidth of the whole grid
connection control is limited by the switching frequency of the power converter.
As already mentioned, the bandwidth of the closed-loop transfer function, ωcc = K prop /Ls ,
has to be at least 10-25 times lower than the switching frequency.
For example, if we assume a bandwidth 10 times the switching frequency and a switch-
ing frequency of 5 kHz, the bandwidth results in ωcc ≈ 3100 rad/s = K prop /Ls = Kintg /Rs .
7.4. Field Oriented Control (FOC) of the IPMSM in the magnets reference
frame
IPMSMs can be controlled in a similar fashion as SPMSMs although isd and isq do not
provide independent control of torque and magnetic field. Moreover, in these machines,
the torque is generated by the combination of magnet torque and reluctance torque, where


the former depends exclusively on isq but the latter depends on both isd and isq . Since i s
is limited by the rated stator winding current, if isd < 0 to generate reluctance torque, the
isq limit would be lower, resulting in a lower magnet torque. As a result, it is clear that
coordinated values of isd and isq should be used.
The so-called Maximum Torque Per Ampere (MTPA) strategy provides an optimal use of
the stator current components, isd and isq , for each reference torque value, [Kim 2017],
[Pyrhöonen et al. 2016].

Maximum Torque Per Ampere (MTPA)


As we have already seen in Section 6.6, the torque in SPMSMs is exclusively controlled
by isq , whereas isd is only used to control the magnetic flux.

3
Tem = p λ f d isq (7.24)
2



In this case, the MTPA strategy will be to keep isd = 0 and use the full magnitude of i s
in isq .

However, the torque in IPMSMs depends on both, isq and isd , so it is necessary to es-
tablish a control strategy to leverage the reluctance torque by adding it to the magnet
torque.

3   
Tem = p Lsd − Lsq isd isq + λ f d isq (7.25)
2

Although there are several control strategies for IPMSM, the MTPA strategy is used in
most cases. Under this approach, isq and isd are calculated to provide the desired torque


while keeping minimum the magnitude of i s .
Fig. 7.6 shows in blue a curve that contains all the possible isd , isq pairs that generate
a given reference torque. In the same figure, the dashed circumference contains all the

− →

isd , isq pairs for a given i s . At the contact point of both graphs, the stator current i s 0
(in red) generates the desired torque and keeps the stator current at the minimum possible
value for that torque.
Figure 7.6. Determination of a point that provides a given torque with the mini-
mum stator current.

Fig. 7.7 shows a red curve representing the isd , isq pairs that satisfy the MTPA strategy
for any reference torque. This set of values provides the combination of magnet torque
and reluctance torque that matches the reference torque while keeping the stator current
minimal and it is normally calculated offline and stored in a lookup table in the memory
of the microcontroller.

Figure 7.7. Set of points that satisfy the MTPA strategy.


Finally, note that isd < 0 (weakening field) because Lsd − Lsq < 0 in the IPMSM
torque equation because in this way, the reluctance torque is added to the positive magnet
torque.
The procedure to obtain the set of isd , isq pairs is explained in chapter 5 of [Kim 2017].

7.5. Field Oriented Control (FOC) of the IPMSM in the stator field reference
frame
It is possible to obtain a FOC using the stator magnetic field instead of the rotor magnetic
field as the reference frame.
The general equation for the torque of a synchronous motor is
3 
Te = p λsd isq − λsq isd (7.26)
2
where the flux linkages of the stator along the axis d are


λsd = λ s cos δ (7.27)

and along the axis q are




λsq = λ s sin δ (7.28)

Figure 7.8. Space vectors of a FOC for IPMSM that uses the stator flux as the
frame of reference.

Substituting Eq. (7.27) and Eq. (7.28) into Eq. (7.26) we obtain
3 → − 
Te = p λ s isq cos δ − isd senδ (7.29)
2


Now, considering a new frame of reference, x, y aligned with the stator field, λ s , see
Fig. 7.8, the components of the stator current are


isx + j isy = i s,xy (7.30)
According to Fig. 7.8, the relationship between the current components, expressed in the
x-y and the d-q frames of reference is

− →

i s,xy = i s,dq e− jδ = isd + j isq (cos δ − j senδ )

(7.31)
where the imaginary part in the x-y frame of reference is

isy = isq cos δ − isd senδ (7.32)
Identifying terms in Eq. (7.29) and Eq. (7.32) we readily obtain a more compact expres-
sion of the torque
3 → −
Te = p λ s isy
2
(7.33)
To control the torque, the microcontroller of the drive will need to use the d-q reference
frame to obtain isd and isq to obtain λsd and λsq using the following two equations

λsd = Lsd isd + λ f d (7.34)

λsq = Lsq isq (7.35)




Then, the microcontroller will obtain the magnitude of λ s , needed in Eq. (7.33)


− q
2 +λ2
λ s = λsd sq
(7.36)

and the angle between both frames of reference needed to obtain isy in order to use it in
Eq. (7.33)
λsq
δ = arctg
λsd
(7.37)

7.5.1. Terminal equations of the IPMSM


Now, we will obtain the terminal equations of the IPMSM that allow to study the relation-
ship between usd - isd and between usq - isq to design the control system.
The application of the second Kirchhoff’s law to the stator yields



− →
− d λ s αβ
u s αβ = Rs i s αβ + (7.38)
dt
That, expressed in the d-q reference frame results in



− jθr →
− jθr d λ s dq e jθr
u s dq e = Rs i s dq e + (7.39)
dt
Now, by finding the derivative



− jθr →
− jθr jθr d λ s dq dθr →

u s dq e = Rs i s dq e + e +j λ s dq e jθr (7.40)
dt dt
and splitting the real and imaginary parts, the two following components are obtained

dλsd
usd = Rs isd + − ωr λsq (7.41)
dt

dλsq
usq = Rs isq + + ωr λsd (7.42)
dt
where the stator flux linkages in the d-axis are

λsd = Lsd isd + λ f d (7.43)

and in the q axis


λsq = Lsq isq (7.44)
Finally, substituting those flux linkages into Eq. (7.41) and Eq. (7.42) we obtain
 
disd
usd = Rs isd + Lsd − ωr Lsq isq
dt
(7.45)

 
disq 
usq = Rs isq + Lsq + ωr Lsd isd + λ f d
dt
(7.46)

The above equations can be represented by the following phasor diagram

Figure 7.9. IPMSM equivalent circuit in the rotor reference frame.

Eq. (7.46) and Eq. (7.46) show that it is possible to control isd through usd and isq
through usq (the relationship is a first-order transfer function) provided that the cross-
coupling terms are added externally. However, in this type of control, the control of the
magnet torque and the reluctance torque through isd and isq is not completely independent.
That independence is achieved using the stator flux as the frame of reference, although the
control over the magnetic field is lost, so the field weakening must be monitored to avoid
an irreversible demagnetization of the rotor magnets (note that, when Ttotal in Fig. 6.8 is
maximum, isd < 0, so the magnetic field is being weakened).
Note that →
−e 0 is the back-EMF generated by the magnets, λ f d , rotating at speed ωr . The
magnitude of →−
e 0 can become too high when the rotor speed is very high, as in electric
vehicles, making it necessary to weaken the field.
Let us obtain the relationship between isx and usx and between isy and usy so as to design


the control system in the stator flux reference frame, λs .
Taking the equation of the stator in d-q coordinates to the new stator flux reference frame
results in

− →
− d →− 
u sdq e− jδ = Rs i sdq e− jδ + λ sdq e− jδ (7.47)
dt
Splitting the real and imaginary components and considering that in this frame of refer-


ence λsy = 0 and λsx = λ s we obtain

d
usx = Rs isx + λs (7.48)
dt

usy = Rs isy + ωs λs (7.49)

where ωs is the rotational speed of the stator flux.


Therefore, there is a relationship between isx and usx and between isy and usy so that it is
possible to control the stator current through the stator voltage.
Furthermore, isx is aligned with λs so can be used to control the stator field (not the
magnets field) whereas isy controls the electromagnetic torque, although there is a cross-
coupled term due to isx .

d
usx = Rs isx + f (isx )
dt
(7.50)

usy = Rs isy + ωs f (isx )


(7.51)

7.5.2. Equivalent circuit


It is possible to study the IPMSM [Novotny and Lipo 1996][Mohan 2014] by means of a
generalized equivalent circuit. Recalling the stator flux linkages, where Lmd and Lmq are
the mutual inductances in d and q axes and Lρs the leakage flux, one circuit for each axis
is obtained, Fig. 7.10

λsd = Lmd + Lρs isd + Lmd i f d (7.52)


λsq = Lmq + Lρs isq (7.53)
Figure 7.10. IPMSM equivalent circuit in the rotor reference frame.

7.5.3. Block diagram of the IPMSM vector control


The block diagram when the reference frame is the rotor magnetic field is the same as
shown in Fig. 7.3 for the surface PMSM, but now the isd and isq values are obtained ac-
cording to the MTPA strategy.
The block diagram for the FOC in the stator field reference frame is very similar to that
of other three-phase machines [Novotny and Lipo 1996], Fig. 7.11.

Figure 7.11. Block diagram of the IPMSM vector control.

The main differences are:


• Two consecutive Park transforms are necessary.

• The first one takes the vectors to the rotor reference frame to obtain isd and isq .


These values are used to estimate λ s and δ .

• The value obtained for δ is used in a second Park transform that finally provides isx
and isy .



Fig. 7.11 shows a FOC that performs two Park transforms and estimates λ s and δ . The
power converter is a current-controlled PWM with a hysteresis band.
Chapter

8
Synchronous Reluctance Machine (SynRM)

Dionisio Ramírez

Abstract

This chapter is devoted to the study of the SynRM. First, the working principle of a simple
reluctance machine is explained and the torque equation is derived. Next, several types
of three-phase SynRM with more complex rotor structures are presented and discussed.
Finally, the field-oriented control algorithm for the three-phase SynRM is explained.

8.1. Introduction
The SynRM is a synchronous machine whose working principle is based on the reluctance
effect. The stator of the SynRM is exactly the same as that of any other three-phase
machine. However, this machine has neither rotor windings nor magnets, so the magnetic
field is generated exclusively by the stator windings. Consequently, the machine absorbs
reactive power and the torque is not generated by the interaction of the stator and rotor
fields.
Indeed, the torque generated by the SynRM is produced by the different reluctance in two
quadrature paths of the flux. Thus, to generate torque, the machine has to be asymmetrical
and have different magnetic characteristics in the d and q axes so all designs are oriented
in this direction.
The SynRM is becoming of great interest in recent years and represents a valid alternative
for electric and hybrid vehicles due to its simple and rugged construction. The main
advantage of the SynRM relies on the absence of the rotor cage losses or PM losses,
Fig. 8.1, allowing a continuous torque higher than the torque of an Induction Motor (IM)
of the same size. Other important features are:

1. The rotor is potentially less expensive than PM and IM motors.

2. The specific torque is acceptable and it is not affected by the rotor temperature.

3. The field-oriented control algorithm is simpler than those of IM drives.


However, also presents some drawbacks such as the noise and vibration caused by torque
ripple, and a total harmonic distortion (THD) higher than in other machines.

Figure 8.1. IM vs. SynRM losses:100% vs. 60%.

This machine is primarily used as a motor but, like all other synchronous machines,
it cannot start by itself when fed at grid frequency. To overcome this problem, the most
commonly used solutions are: adding a damper winding that works like a squirrel cage
during the start-up, adding assistance magnets embedded in the rotor, or using a variable-
frequency power converter.
There are three main types of SynRM: the basic rotor design that is improved using flux-
barriers in the rotor or an Axially-Laminated Anisotropic rotor SynRM (ALA-rotor Syn-
RMs), see Fig. 8.2.

Figure 8.2. Rotor structures of reluctance machines. a) Basic rotor design; b)


Flux barriers; c) Axially-Laminated Anisotropic rotor.

In this chapter, the recommended readings are: chapter 1 of [Kim 2017], chapter 11 of
[Nasar et al. 1993], chapter 10 of [Pyrhöonen et al. 2016], and Chapter 6 of [Boldea 1997].

8.2. Working principle


Let us take a look at the basic machine of Fig. 8.3, [Nasar et al. 1993][Kim 2017]. When
the stator is excited with any waveform, the rotor experiences torque except when the
rotor and stator axes are aligned (θ = 0).
If the stator is excited with a constant current, the rotor tends to move towards the position
of minimum reluctance corresponding to the minimum energy stored in the system.
The torque is due to the variation of the reluctance caused by the change of the rotor
position. More specifically, the torque generation is due to the variation of the magnetic
energy stored in the magnetic circuit as a function of position.
Figure 8.3. Basic SynRM.

The machine represented in Fig. 8.3 shows an elementary single-phase motor in which
the rotor and stator are arranged in such a way that the inductance variation of the wind-
ings with respect to the rotor position is sinusoidal, see Fig. 8.4.

Figure 8.4. Variation of inductance in a simple SynRm machine.

In effect, the variation of the inductance is twice the frequency of the variation of the
mechanical angle θ with the movement:

L(θ ) = L” + L′ cos 2θ (8.1)

For an excitation like:


i(t) = Im sin ω t (8.2)
The energy stored changes according to the rotor position:

1
Wm = L(θ ) i2 (8.3)
2
and the same applies to the flux linkage

λ (θ ) = L(θ ) i (8.4)
As it is known, the torque can be obtained by the general expression
dWm
Te = (8.5)

If we now express the torque as a function of the inductance and the current
1 2 dL (θ )
Te =
i (8.6)
2 dθ
For the inductance of Eq. (8.1) and the current defined in Eq. (8.2), the torque results in
Te = −Im2 L′ sin 2θ sin2 ω t (8.7)
When the rotor starts to rotate
θ = ωm t − δ (8.8)
where δ is the rotor position at t = 0, and the current is i (0) = 0.
Substituting Eq. (8.8) in Eq. (8.7) and using the trigonometric relationships
1
sin2 ϕ = (1 − cos 2ϕ) (8.9)
2
and
1 1
sin ϕ cos γ = sin (ϕ + γ) + sin (ϕ − γ) (8.10)
2 2
we obtain
 
1 2 ′ 1
Te = − Im L sin 2(ωm t − δ ) − {sin 2 (ωm t + ω t − δ ) + sin 2 (ωm t − ω t − δ )}
2 2
(8.11)
Each sin 2ϕ individually considered has a zero mean value. But if ω = ωm , we obtain
sin (−2 δ ) = −sin (2 δ ) which is not null.
The maximum torque is attained for δ = 45◦ and is called pull-out torque. If the load
torque exceeds this value, an unstable operation will result, which may cause the rotor to
stop.

At the frequency ω = ωm , the torque results in


1 2 ′
Te = I L sin 2δ (8.12)
4 m
According to Fig. 8.4 
′ Ld − Lq
L = (8.13)
2
so we finally obtain
1 2 
Te = Im Ld − Lq sin 2δ
8
(8.14)

Note that the need for the same rotor speed and electrical frequency, ω = ωm , to obtain
mechanical torque, implies that the SynRM is a synchronous machine. Also, during the
start at grid frequency ω ̸= ωm , so the average torque is zero, like in other synchronous
machines, and the SynRM is not able to self-start.
8.3. SynRM with flux barriers in the rotor
In this type of machine, the rotor lamination features a series of slots that represent an air
gap for the magnetic flux, and the stamped steel sheets are stacked to make up the iron
core of the rotor, Fig. 8.5.

Figure 8.5. left: stamped steel sheet with flux barriers; right: stacked sheets to
make up the iron core.

As a result, the reduced reluctance enhances the flux in one direction to which we will
associate the d-axis, see Fig. 8.6.
However, the magnetic flux is hindered in the quadrature direction, q-axis, due to the high
reluctance caused by the air gaps, called flux barriers.

Figure 8.6. One pole of a SynRM with flux-barriers: flux lines in the d axis.

The result is that the inductance in the d and in the q axes is very different, improving
the torque generation according to Eq. (8.14).

8.3.1. Working principle of the SynRM with flux-barriers in the rotor


To understand the SynRM with flux-barriers principle, take a look at Fig. 8.7. In this fig-
ure there is no load torque applied to the rotor shaft and the d-axis of the rotor is aligned
with the magnetic field represented by the flux linkages, λs . In this scenario, the rotor
spins at the synchronous speed, ω = ωm , the electromagnetic torque is Te ≈ 0, and the
rotor position is always that of minimum energy.

If a load torque is applied to the rotor shaft, the d-axis lags behind the magnetic field
but the rotor speed, after a transient, is still the synchronous speed, resulting in a non-
zero electromagnetic torque, Fig. 8.7. This is because the rotor attempts to return to the
position of minimum energy, with the d-axis aligned with the magnetic field.
In this scenario, the rotor rotates at synchronous speed and will generate motor torque,
provided that δ < 45◦ , up to a maximum value equal to the pull-out torque.

Figure 8.7. SynRM with flux-barriers: left: rotor aligned with λ ; right: the align-
ment is lost due to the load torque.

Sometimes a squirrel cage is added to the rotor in order to enable the SynRM to start
at grid frequency, resulting in the so-called line-start synchronous reluctance motor (LS-
SynRM). Fig. 8.8 shows the rotor structure of an LS-SynRM in which the squirrel cage
slots are placed on the outer side of the rotor, and the barrier is arranged on the inner
side of the rotor [Kim et al. 2020]. Because of this structure, LS-SynRM operates as IMs
at the asynchronous speeds, during the acceleration, and as a SynRM once it attains the
synchronous speed.
Figure 8.8. LS-SynRM: note the squirrel cage slots in the outer side of the rotor.

The rotor-cage slot area is small to assure high starting torque [Boldea 1997]. Once
in steady state, the higher resistance and leakage inductance produce the asynchronous
torque whereas the load torque reduces Lq as it depends on Ld − Lq , increasing the magnet
torque, thus ensuring both a stable operation.

8.4. Axially-Laminated Anisotropic rotor SynRM (ALA-rotor SynRMs)


The basic ALA rotor [Boldea 1997] is built by wounding a strip of cold-rolled grain-
oriented steel by standard core winding techniques. It is then cut, reassembled, and ma-
chined to a circular form, as shown in Fig. 8.9. No stamping is required, the rotor is
automatically subdivided along the line of direct-axis flux by the interlaminar insulation.
The advantage provided by the anisotropic properties of the material is the higher perme-
ance along the rolling direction than in the perpendicular direction.
The ALA-rotor SynRM, Fig. 8.9 and Fig. 8.10, presents outstanding characteristics de-
rived from the axial lamination and the anisotropy of the material used in the rotor.

Figure 8.9. ALA-rotor SynRM, pole pairs=1.


Figure 8.10. ALA-rotor SynRM, pole pairs=2.

The anisotropy and the lamination favor the magnetic flux in the d-axis, whereas the q-
axis path presents high reluctance, Fig. 8.11 [Isaac et al. 1999]. As a result, the difference
between the inductances Ld and Lq is high, which increases the electromagnetic torque,
Te .

Figure 8.11. Magnetic field distribution in an ALA-rotor SynRM, pole pairs=2.

8.5. Electrical model of a generic SynRM


The electrical model of a generic SynRM, in which there are no rotor windings or rotor
magnets, is formed by the following equations containing only stator terms, [Lipo 1991]:

dλsd
usd = Rs isd + − ωr λsq (8.15)
dt

dλsq
usq = Rs isq + + ωr λsd (8.16)
dt
Again, since there are no magnets or rotor windings, the flux linkages are due only to the
stator windings:
λsd = Lsd isd (8.17)
and in the q axis
λsq = Lsq isq (8.18)
where Lsd and Lsq contain both, the leakage and magnetizing components:
Lsd = Lmd + Lρ s (8.19)
and
Lsq = Lmq + Lρ s (8.20)
The terminal equations result in
disd
usd = Rs isd + Lsd − ωr λsq
dt
(8.21)

disq
usq = Rs isq + Lsq + ωr λsd
dt
(8.22)
The vector diagram (steady state) of a generic SynRM is shown in Fig. 8.12.

Figure 8.12. Vector diagram of a generic SynRM.

And, using the general torque equation for synchronous machines (without magnets in
the rotor), the reluctance torque results in
3   
Te = p Lsd − Lsq isd isq
2
(8.23)

Taking into account that in Fig. 8.12 the current components are isd = Im sinβ and
isq = Im cosβ as well as the trigonometric relationship sinβ cosβ = 21 sin2β , the torque can
be expressed as
3 
Te = p Lsd − Lsq Im2 sin 2β
 
4
(8.24)
The representation of the reluctance torque vs. stator current angle, β , is a double
frequency sine function, Fig. 8.13.

Figure 8.13. Torque vs. angle of a generic SynRM.

Note the reversibility of the torque because the machine can operate as a motor or as
a generator. Also note that, as the stator resistance increases, the maximum torque de-
creases and is attained earlier so the stable operating area narrows.

Direct start
In a direct start-up, oscillations appear below the synchronous speed and during self-
synchronization, Fig. 8.14. A Nyquist analysis shows that regions of instability appear
at low speeds as a consequence of inadequate damping. Furthermore, the instability in-
creases as the Ld/Lq ratio increases, although it favors the grid connection process.
This problem does not happen with variable speed systems with position control.

Figure 8.14. Dynamic torque-speed characteristic during the line start of a two-
pole SynRM.

Torque density If we compare the torque output of the reluctance synchronous machine,
with respect to an equivalent induction machine, we find that TSynRM = 0.97 TIM .
For the same stator, the reluctance machine presents approximately the same maximum
torque as the induction machine.

Power factor For a machine with an ALA rotor, the power factor angle when the maxi-
mum torque is attained is:
3 Lsd + Lsq
tanϕ = (8.25)
2 Lsd + Lsq

which provides a power factor of the order of cosϕ ≈ 0.66, which is a low value, as is the
case with induction machines.
However, if we wish to maximize the power factor, it turns out that values around cosϕ ≈
0.9 are achieved at the cost of a torque reduction.

8.6. PM assisted SynRM (PMA-SynRM)


The torque, efficiency, and power factor of a SynRM are inferior to those of a PMSM. To
improve performance, the rotor flux barriers of the SynRM can be improved by inserting
appropriate amounts of magnets, which results in a new type of machine where the reluc-
tance torque still dominates over the magnet torque and is known as Permanent Magnets
Assisted SynRM (PMA-SynRM) [Huynh and Hsieh 2017].
Conventional designs of PMA-SynRMs mostly follow the rule that the rotor maintains
circumferential symmetry such that two axes of symmetry, namely, the d and q axes, can
be defined, Fig. 8.15. Therefore, the magnetic torque becomes maximum when the cur-
rent vector is positioned 90◦ with respect to the magnet flux, while the reluctance torque
becomes maximum when the current vector lags the q-axis [Zhao et al. 2017]. Placing
the magnets on the q-axis causes a reduction of Lq because the magnetic flux in that
direction opposes the stator flux in that direction. As a result, the saliency ratio in-
creases.

Figure 8.15. Topology of the conventional PMA-SynRM (Basic model).

The permanent magnets included in the PMA-SynRM can be either ferrite or rare-
earth based magnets. Ferrite magnets provide a lower power factor and torque density
improvement and have a higher risk of demagnetization than rare-earth based magnets:
NdFeB (neodymium-iron-boron alloy), SmCo (samarium-cobalt magnet), etc.
The additional torque created by the permanent magnets is taken into account in the torque
equation of a SynRM, Eq. (6.37), by adding the term due to the magnets, λ f q isd , Eq. (6.3),
to Eq. (8.23) to obtain Eq. (8.26), in turn similar to Eq. (6.1).

3   
Te = p Lsd − Lsq isd isq + λ f q isd
2
(8.26)

Note that, as Eq. (8.27) shows, the flux linkage provided by the magnets, λ f q , is being
used to reduce the effect of the inductance Lsq in order to increase the saliency.

3   
Te = p Lsd isd isq − Lsq isq − λ f q isd (8.27)
2

Making some arrangements in Eq. (8.26) the result resembles Eq. (8.14) with an
additional term due to the magnets:
 
3 1  2
Te = p Lsd − Lsq Im sin 2β + λ f q Im cosβ = Tre + Tpm
2 2
(8.28)

where λ f q is the flux linkage of the stator q winding due to flux produced by the rotor
magnets, p is the pole number, Im is the peak value of stator current, β is the current
phase angle measured with respect to the q-axis, see Fig. 6.8, and Tre and Tpm are the
reluctance torque and magnetic torque, respectively.

The main advantages of PMA-SynRM are the following:

• Higher torque and power density.

• Higher efficiency.

• Higher torque per unit volume.

• Higher power factor.

• Lower drive rated power.

• Reduced size.

However, these machines have disadvantages:

• Higher cost and some manufacturing difficulties.

• Risk of magnetic demagnetization (especially with ferrites).

• Magnetic losses (at higher velocities).


8.7. Field Oriented Control (FOC) of SynRM
Field-oriented control in SynRM faces the problem that the reluctance torque of any syn-
chronous machine depends on both isd and isq , already shown in Eq. (6.2), so that a fully
independent control cannot be achieved [Boldea 1997]. However, as usual, torque and
magnetic field are the target variables to be controlled. The torque, Te , can be estimated
using the general equation for synchronous machines or the particularized one, and the
stator flux linkage, λs , is only that generated by the stator windings since there are no
windings or magnets in the rotor.
In all types of SynRM, the frame of reference is chosen aligned with the d-axis of the
magnetic flux, Fig. 8.16.

Figure 8.16. Example of a reference frame in an ALA-rotor SynRM.

Torque equation
The expressions of Te and λs in the d − q reference frame are:
3   
Te = p Ld − Lq isd isq (8.29)
2
q 2
λs = (Ld isd )2 + Lq isq − λ f q (8.30)
where λ f q = 0 for the SynRM and is not zero when permanent magnets are inserted along
the q-axis, (opposite to the stator flux in this direction) inside the rotor lamination (PMA-
SynRM).

Terminal equations of the SynRM

d isd 
usd = Rs isd + Lsd − ωr Lsq isq − λ f q
dt
(8.31)

d isq
usq = Rs isq + Lsq + ωr Lsd isd
dt
(8.32)
This set of equations is not different from that of the PMSM so it is possible to control
isd through usd and isq through usd provided that the cross-coupling terms are added to the
output of the PI controllers (feedforward control).
As in IPMSMs, neither the torque nor the stator flux linkages depend exclusively on
isd or isq . This fact poses the problem of choosing the best combination of reference
values for isd and isq . For fixed machine inductances Lsd and Lsq , in order to achieve the
maximum torque-per-ampere (MTPA) and high efficiency, the current components isd or
isq are recommended to be equal [Lipo 1991][Wang et al. 2014]:

Im
isd = isq = √ (8.33)
2

Thus, considering Eq. (8.33), the value of i∗sd and i∗sq can be obtained from the torque
equation:

s
4 Te∗ √ √
Im∗ =  = i∗sd 2 = i∗sq 2 (8.34)
3 p Lsd − Lsq

In case isd and isq are not considered to be equal, the corresponding isd -isq relationship
should be used.
The relationship between isd -isq is often expressed as a function of the angle β , [Boldea 1997].
Depending on the value chosen for β , the control may correspond to the fastest response,
to the maximum power factor in steady state, or to the maximum torque per ampere
(β = 1).
Another technique is using constant isd below the rated speed in applications where the
peak torque is required up to the maximum speed. For such applications, constant isd
control is the correct choice for transients in particular, although flux weakening is also
feasible.

Block diagram
From Eq. (8.31) and Eq. (8.32) , the feedforward compensation in the d and q axes are,
respectively, −ωr Lsq isq − λ f q and +ωr Lsd isd .
Figure 8.17. Block diagram of the FOC for SynRM and PMA-SynRM

8.8. IM, PMSM, and SynRM comparison [Wang et al. 2014]


Torque Equation of Induction Machine


If the d-axis is chosen to be aligned with the stator flux vector λs , then λqs = 0. As,
according to Faraday’s Law, rotor EMF is induced by the common flux (approximately

− →

λs ), rotor back EMF leads λs by 90◦ . When IM is operating at its rated values, the rotor


is mainly resistive so the rotor current, Ir , is almost in phase with rotor EMF, i.e. leading


the common flux (≈ λs ) by 90◦ and Idr ≈ 0. Under these conditions, the stator flux is
produced almost exclusively by Ids so λs =λds =Ld Ids

3  3
Te = p Iqs λds − Ids λqs = p Ld Ids Iqs (8.35)
2 2
Torque Equation of PM Machine
For a PMSM, the d-axis is always chosen to be aligned with the rotor magnetic field, so
λds = Ld Ids + λ f d and λqs Iqs , and the torque is

3  3  
Tim = p Iqs λds − Ids λqs = p Ld − Lq Ids Iqs + λ f d Iqs (8.36)
2 2
For a nonsalient-pole PM machine, Ld = Lq , and

3
Tpm = p λ f d Iqs (8.37)
2
Torque Equation of Synchronous Reluctance Machine
SynRM has a rotor with distinct saliency between d and q axes. As the stator MMF is the
only source of the magnetic field, then λds =Ld Ids and λqs =Lq Iqs , so
3  3 
Trm = p Iqs λds − Ids λqs = p Ld − Lq Ids Iqs (8.38)
2 2
Torque Production Capability Comparison
To compare the torque production capability of the above three types of machines in a fair
way, the same stator with the same air gap length is used and the same magnitude of the
input current Is is assumed.
The maximum torque for the Surface PMSM machine is obtained when

Iqs,pm = Is (8.39)

whereas for SynRM and IM



Ids,im = Iqs,im = Ids,rm = Iqs,rm = Is / 2 (8.40)

if the effect of the saturation is neglected.

After some arrangements and considerations, when the same current is applied, it can
be obtained that

Tim : Tpm : Trm ≈ 1 : 1.4 : 0.8 (8.41)

However, it is worth mentioning that the voltages required to supply the desired currents
of the three types of machines will be different if the flux linkage of them are different,
as the magnitude of back EMF is proportional to the magnitude of flux linkage when they
are rotating at the same speed.
The PMSM machine and the IM need approximately the same voltage, and the SynRM
requires the lowest voltage among them, The reason is that the induced back-EMF takes
the largest part of the voltage, and the voltage drop on resistance and stator leakage in-
ductance is neglectable.

For the same input voltage and current, the output power of the PMSM machine is
40% higher than that of the IM. The reason is that the power factor of the PMSM is 40%
higher than the value of the IM. This is obvious as the PMSM does not need magnetizing
current, Ids,pm = 0, while the IM is set to have comparable magnetizing current Ids,im and
load current Iqs,im .

As the flux linkage is aligned with the d-axis, the back EMF is aligned with the q-axis
and the input voltage is approximately the same as the back EMF. Therefore, the PMSM
has a power factor cosϕ pm ≈ 1, the IM has cosϕ im ≈ cos 45◦ = 0.7, and

cosϕ pm /cosϕ im ≈ 1.4 (8.42)


PMSMs and SynRMs only have stator copper losses, while IMs have both stator and ro-
tor copper losses. The iron losses of these three types of machines are approximately the
same, because the flux linkages, i.e. the values of field density in the iron, are approxi-
mately the same.

However, in general, the PMSM has the best torque production capability, and the SynRM
can be a strong competitor to the IM.
Chapter

9
Switched Reluctance Machine (SwRM)

Dionisio Ramírez

Abstract

This chapter studies the SwRM and its control. Unlike the machines previously studied,
the SwRM is not an AC machine but instead is powered by successively applying current
pulses to the stator windings.
After a brief introduction, the working principle is explained, both from the energy and
electrical point of view. Then, the terminal equations are obtained and a specific control
for this machine is explained. Finally, some rules for an efficient operation and the control
block diagram are given.

9.1. Introduction
Stepper motors are used for position control and don’t use any feedback since, by count-
ing the number of electrical pulses supplied and knowing the step angle of the motor, it is
possible to rotate the shaft the desired angle. In contrast, SwRMs are intended to provide
continuous rotation and they use position feedback, although it is possible to remove it.

Figure 9.1. Rotor of a switched reluctance machine.

Once the power electronics needed to control SwRMs became reasonably cheap, they
started to be used in many industrial applications such as washing machines and looms,
and highly demanding applications like the starter-generator of jet turbines in aircraft. The
main advantages of this machine are its simple and rugged construction, its redundancy,
and its suitability for high speed. Its disadvantages are the high level of noise and vibration
that generates.
In this chapter, the recommended readings are: chapter 22 of [Melkebeek 2018], and
chapter 11 of [Mohan 2014].

9.2. Working principle


The cross section of a four-phase SwRM, shown in Fig. 9.2, looks identical to a stepper
motor. This figure shows a six stator poles (three phases) and four rotor poles SwRM.
The windings of opposite stator poles are connected in series to form a phase that, when
excited, results in opposite N and S magnetic poles. The rotor has no windings.
In order to achieve a continuous rotation, each phase winding is excited and de-excited at
an appropriate rotor angle.
In Fig. 9.2 (a), only winding 1 is connected, and its winding current results in a high
magnetic flux due to the small air gap and reluctance, that keeps the rotor firmly in that
position.
In Fig. 9.2 (b), winding 1 has been disconnected, and winding 2 connected. Now, the air
gap is bigger, the magnetic flux has to go through a longer path and the reluctance is high.
As a result, an electromagnetic torque is obtained as the rotor tries to attain the lower
reluctance position.
Finally, in Fig. 9.2 (c), the rotor has already rotated 60◦ , and winding 2 keeps the rotor in
the new position.

Figure 9.2. Switching of a 6/4 SwRM operating as a motor.

Next, we will discuss the motor operation from the energy point of view using a λ − i
graph, where the rotor angle θ is a parameter, see Fig. 9.3.
At point 1 in this figure, the rotor pole is unaligned and a pulse of current is applied. In the
beginning, while the current in the winding increases swiftly, the magnetic flux increases
steadily. In this period, the rotor pole is far from the stator pole, so the reluctance is high,
and the iron core is not saturated,stores magnetic energy.
Once the current in the winding and the effect of the reluctance torque are high enough,
the rotor begins to rotate providing mechanical work, vertical path in the figure, and the
magnetic reluctance decreases as the two poles get closer, Fig. 9.4 (a).
At point 2, the poles are not yet aligned but the winding is disconnected because the
reluctance torque begins to decrease, and will be overlapped by the new reluctance torque
provided by the connection of the following winding.
From point 2, the operation point returns to point 1 along an intermediate path that does
not match any curve of θ as the rotor keeps rotating impulsed by the following pole,
Fig. 9.4 (b). During this period, from 2 to 1, there is an energy recovery through the
diodes of the power converter towards the power supply and the torque provided by the
pole is negative (opposed to the movement).

Figure 9.3. Complete cycle when the SwRM operates as a motor.

Figure 9.4. (a) Energy storage and positive mechanical work; (b) Energy recovery
and negative mechanical work.

Let us now take a look at the electrical variables depicted in Fig. 9.5. The rising slope
of the pulse of current is limited by the inductance of the stator pole winding but eventu-
ally the current becomes constant.
At first, the magnetic flux increases steadily as the current increases. When the current
becomes constant and the rotor begins to rotate, the magnetic reluctance decreases as the
poles get closer, so the flux begins to rise again. Roughly, when the current becomes
constant, the reluctance torque causes the rotor to spin.
However, as the two poles get closer, the reluctance effect decreases and so does the
reluctance torque. This is the moment when the currently connected phase must be dis-
connected in order to connect the next winding. This results in an overlap of the torque
provided by each phase plus a small torque ripple, as shown in the lower graph in Fig. 9.5.
The resulting ripple depends on the number of stator and rotor poles. A high number of
poles results in a lower ripple but requires a higher supply frequency for a given speed.
Finally, when the phase is disconnected, the winding discharges itself by sending energy
to the power supply. The energy recovery results in a torque reversal, now opposed to
the rotation, although it is more than canceled out by the positive torque generated by the
following pole.

Figure 9.5. Waveforms of one phase and total torque of an SwRM operating as a motor.

9.3. Terminal equation of the SwRM


The application of the second Kirchhoff’s law to the stator yields
dλs
us = Rs is + (9.1)
dt
If we now find the derivative, considering that λs (θ , i)
∂ λs ∂ is ∂ λs
us = Rs is + + ωr (9.2)
∂ i ∂t ∂θ
The second term is attributed to the variation of the flux, while the third term is attributed
to rotation. The second term is called transformer emf, and the third term is called rota-
tional emf and is proportional to the instantaneous angular velocity ω = dθ /dt.
Take into account that, in this machine, the flux changes due to the pulse of current but
also due to the rotation of the rotor, which reduces the reluctance, favoring the flux (the
current and magnetomotive force are constant while the rotor spins).
9.4. Control of SwRMs
In this machine, the torque is controlled through the current (magnetomotive force) be-
cause it controls the magnetic flux for a given reluctance. Therefore, the power converter,
Fig. 9.6, has to be able to control the current in each of the stator windings.

Figure 9.6. Four-phase power converter for SwRM.

Thus, as the DC link voltage is constant, the solution is to use PWM. To do so, the
control switches one of the IGBTs, say Q1, using PWM while keeping the other IGBT in
the same leg (Q1’) always on. When both IGBTs are on simultaneously, the stator current
increases. When Q1 is off, the stator current flows through the loop created by Q1’ and
D1’, and the current decreases slowly.
At high speeds, the back-emf is high and will limit the attainable current in the stator
winding and the torque. At low speeds, the back-emf is low, so it is advisable to use
PWM to keep the current slope under control.

Figure 9.7. Current control in one of the phases using PWM.

An efficient control requires

• accurate control of the switches.


• accurate measurement of the rotor position to provide the needed information to
control the switches.

• control of the average stator current to control the torque.

The switches of the active phase must be turned on at the right moment. For example, at
intermediate speeds, this will be at the start of the overlap of the rotor and stator poles.
The switches must be turned off not too early to avoid positive torque, and not too late to
avoid negative torques beyond alignment.
According to [Melkebeek 2018], in a 6/4 SwRM, where 90◦ means complete alignment
and 45◦ unalignment, normal control angles are

• 52.5◦ /82.5◦ for normal PWM.

• 37.5◦ /67.5◦ for high speed.

• 22.5◦ /67.5◦ for very high speed.

At low speeds, which may require PWM to control the current, turn-on and turn-off angles
are constant.
At high speed, the back-emf is high so the IGBTs have to be switched on earlier to give
the current time to rise.
Braking and generation modes are also possible.

9.5. Control block diagram


The information about the position of the rotor is needed to turn on/off the switches.
However, it can be measured using an encoder or estimated by dedicated software. In
effect, the flux linkage of a phase can be represented as a function of the phase current
for various values of the rotor position, as shown in Fig. 9.3. Using this information, the
microcontroller will be able to obtain the rotor position from the measured phase current
and the flux obtained by integrating the difference between the applied voltage and the
voltage drop across the winding resistance, as Fig. 9.8 shows.

Figure 9.8. Rotor speed estimation.

The block diagram of Fig. 9.9 summarizes the control system of an SwRM. The rotor
speed is obtained by deriving the rotor angle and compared with the reference speed. The
error is the input to a P-I controller that provides the reference current (torque reference).
Then, the control turns on/off the power converter switches to obtain the desired current.
Finally, the power converter applies the current pulses successively to the stator windings.
Figure 9.9. Control block diagram of an SwRM.
Chapter

10
Advanced Control Algorithms

Dionisio Ramírez

Abstract

Control of electrical machines theory is very broad and, in many cases, very complex.
This chapter covers the study of some of the advanced control systems most commonly
used. All of them are based on the space vector theory and all of them are intended
to be programmed in a microprocessor, usually using C language, so the corresponding
discrete difference equation models are obtained in this chapter.

10.1. Introduction
10.2. Deadbeat control of a surface permanent magnet synchronous motor
(SPMSM)
In discrete-time control theory, the dead-beat control problem consists of finding which
input signal must be applied to a system in order to bring the output to the steady state in
the minimum number of time steps [Zhang et al. 2017]. Such controls are called "dead-
beat" since they beat the state to a dead stop in, at most, the same number of time steps
as the dimension of the state vector. This corresponds to the placement of all the discrete
poles at the origin.
The deadbeat response has the following characteristics:

• Zero steady-state error.

• Minimum rise time.

• Minimum settling time.

• Less than 2% overshoot/undershoot.

• Very high control of the output signal.


The stator voltage of an SPMSM in the static reference frame (α and β axes) can be
expressed as



− →
− d λ s αβ
u s αβ = Rs i s αβ + (10.1)
dt

− →

where →−u s and i s are the stator voltage and current vectors, and Rs , λ s are the stator
resistance and stator flux, respectively. The stator flux linkages in the static reference
frame are →
− →



λ s αβ = Ls i s αβ + λ f d (10.2)
If the rotating reference frame, d-q, Fig. 10.1, is chosen aligned with the rotor magnetic
field (magnets) the following relationship is satisfied


u s αβ = →

u s dq e jωr t (10.3)

where ωr is the electrical rotor speed.


Substituting Eq. (10.3) into Eq. (10.1), we obtain

Figure 10.1. Static and rotating reference frames.

→
− d →
−  d →− jωr t 



u s dq e jωr t = Rs i s dq e jωr t + Ls i s dq e jωr t +

λf e (10.4)
dt dt
Simplifying e jωr t



− →
− d i s dq →

u s dq = Rs i s dq + Ls + jωr Ls i s dq + 0 − jωr λFdq (10.5)
dt

If the equation is split into the d and q axes λ f dq = λ f d
disd
usd = Rs isd + Ls − ωr Ls isq (10.6)
dt
disq
usq = Rs isq + Ls + ωr Ls isd + ωr λ f d (10.7)
dt
Note that ωr t is obtained from the rotor speed measurement using, for example, an en-
coder, and for that, the initial θ0 value should be determined either by design or using a
“parking mode”. This mode moves the rotor up to a known position by feeding the stator
winding with a low-frequency three-phase current until the encoder generates a pulse in
the INDEX terminal.

The electromagnetic torque in the synchronous reference frame can be calculated as

3 
Te = p λsd isq − λsq isd (10.8)
2

where Te and p are the electromagnetic torque and pole pairs.


Changing to discrete time, at instant k, us k+1 is the needed voltage to be generated during
the next switching period in order to obtain the desired i∗sq k+1 and i∗sd k+1 . Those currents
control, respectively, the torque and magnetic field value at instant k + 1. Therefore, the
stator voltage that makes the current attain the reference values after a switching period is

1 ∗ 
usd k = Rs isd k + Ls isd k+1 − isd k − ωr k Ls isq k
T
(10.9)

1∗ 
usq k = Rs isq k + Ls isq k+1 − isq k + ωr k Ls isd k + ωr k λ f d
T
(10.10)

The pair (usd k+1 , usq k+1 ) is the voltage


 vector to begenerated by the SVM during the next
switching period in order to obtain i∗sd k+1 , i∗sq k+1 .

10.3. Control block diagram

Figure 10.2. Block diagram of deadbeat control.


10.4. Experimental results

Figure 10.3. Dynamic response in an i s q step test.


10.5. Model Predictive Control (MPC) applied to SPMSMs
Predictive control systems for electric drives were started to develop in the late 1980s
to deal with the limitations of traditional control systems such as field-oriented control
(FOC) and direct torque control (DTC) methods. The performance of the conventional
DTC, based on a switching table, is related to the sample time of the microcontroller. As
a result, the ripple of the torque and other variables is high if a high sampling time is not
applied, in spite of the fact that the DTC method is fast and has a robust structure com-
pared to the FOC control. The FOC method, often present in the machine side converter
(MSC) and the grid side converter (GSC) of wind turbines, etc., features fixed switching
frequency and low power ripple. However, the control provides a relatively slow response
and is difficult to tune.

In recent years, different versions of MPC for voltage source converters have been ap-
plied to the control of renewable energy generators and electrical drives. In MPC, the
model of the system is considered, and according to a cost function and to the control
objectives, an optimal voltage vector (or several vectors) is chosen. That optimal voltage
vector corresponds to the switching state that minimizes the cost function and is generated
by the power converter in the following switching period.
This technique makes space vector modulation (SVM) unnecessary because MPC itself
provides the optimal switching times and phase-locked loop (PLL) is also unnecessary in
GSCs.
MPC provides other advantages such as fast dynamic response, superb reference tracking,
and low ripple in the currents. Nevertheless, it is sensitive to variations in the parameters
of the model on which it is based, mainly the stator inductance.

The first MPcs used only one vector per switching period, Fig. 10.4, aiming to acceler-
ate the assessment of the candidate vectors in the cost function, and removing the SVM
stage. Nevertheless, this modulation is very limited because it is not able to reproduce

− → −
intermediate values of →
−u re f (different to V 1 ... V 6 ) resulting from the cost function mini-
mization. Furthermore, the power converter works like a bang-bang voltage control across
the periods, the switching frequency is variable, and its behavior is clearly non-linear.


− → −
Figure 10.4. Modulation using 1 active vector ( V 0 ... V 7 ) per PWM period.
Using two vectors per period is another common practice aimed to accelerate the as-
sessment of all the possible combinations of adjacent vectors using the cost function. It
facilitates the use of a pre-calculated look-up table to save computing time. Other options
use only one active vector plus a zero vector, or choose to assess only one vector and the
second one is the adjacent active vector.
The pair of vectors are chosen in every program cycle either combining two active vectors
(6 possibilities) or one active vector and one zero vector (6 possibilities), Fig. 10.5. There-
fore, the number of possible combinations that must be assessed using the cost function
is higher than in the previous case.
This modulation only allows to reproduce the hexagonal perimeter, blue line in Fig. 9.3,
and, again, the power converter presents a non-linear behavior.


− → −
Figure 10.5. Modulation using 2 active vectors ( V 0 ... V 7 ) per PWM period.

The MPC for SPMSM that we will use in this section uses three vectors in each switch-
ing period, Fig. 10.6.

Figure 10.6. Modulation of →



u r e f in the first sector using three vectors per period.
In modulation, the zero vector is used to change the magnitude of the resulting vector.
Thus, it is possible to reproduce →

u re f across the entire blue area of the inscribed circle
shown in Fig. 10.7.

Figure 10.7. Three vectors per PWM period allows using the whole blue area
inside the inscribed circumference.

Once applied to the stator windings, each vector produces a different effect on the cur-
rent. In Fig. 10.8, the initial value of the stator current, represented by its d-q components,
has been denoted by X (k + 1). In green, blue, and pink have been represented the changes

− → − → −
that V i , V j , V 0 would produce on that current if they are applied for an entire period Ts .
The problem that MPC solves is to obtain the duration times for each vector in order to
reach the value X (k + 2) as accurately as possible.
The vector application sequence used to reach the value X (k + 2) from X (k + 1) in the

− → − → − → − → − → − → −
figure is: V 0 , V i , V j V 0 , V j , V i , V 0 .

Figure 10.8. Trajectory for each vector and trajectory when three vectors are
applied for the duration times calculated by the MPC.

From another point of view, Fig. 10.9 shows how different combinations of adjacent
vectors and the zero vector lead to different trajectories. MPC is capable to calculate the
duration times that minimize the tracking error of all trajectories so the one closest to the
reference (blue) is chosen (red).
Figure 10.9. Trajectory of i s q between t k + 1 and t k + 2 for each set of vectors, and
the closest to the reference trajectory (red).

Fig. 10.10 shows the concept of a Finite Control Set MPC (FCS-MPC or simply MPC),
where an accurate model of the load (a PMSM in this case) is required. Using this model
and the measurement of the stator currents, the predictive control calculates the trajecto-
ries (slopes) generated by each voltage vector.

Figure 10.10. Conceptual realization of an FCS-MPC.

Those trajectories are used to predict the next value of the stator current according to the
voltage vectors applied in the next switching period. The predictions and the references
are combined into a cost function that is minimized to find the combination of voltage
vectors that provides the lowest tracking error.
The cost function can be formulated to track almost any reference, but in the case of a
PMSM it is necessary to control the torque and magnetic field, so isd and isq are chosen
as references.
2
F (k + 1) = (isd (k + 1) − i∗sd (k))2 + isq (k + 1) − i∗sq (k) (10.11)

Finite Control Set MPC applied to an SPMSM


The SPMSM dynamic equations in the rotor rotating reference frame, d-q frame, can be
presented as

dλsd
usd = Rs isd + − ωr λsq (10.12)
dt
dλsq
usq = Rs isq + + ωr λsd (10.13)
dt
where us , is , λs , ωr , and Rs are stator voltage vector, stator current vector, stator flux, rotor
speed and stator resistance, respectively.
The stator flux of SPMSM in the d-q frame is

λsd = Ls isd + λ f d (10.14)

λsq = Ls isq (10.15)


where λ f d and Ls represent permanent magnet flux and stator inductance, respectively.
The torque equation can be expressed as

3 
Te = p λsd isq − λsq isd (10.16)
2
where Te and p are the electromagnetic torque and pole pairs. The derivative of current in
rotor reference frame can be obtained according to Eq. 10.12-Eq. 10.15 as

d 1 
isd = −Rs isd + ωr Ls isq + usd (10.17)
dt Ls
d 1 
isq = −Rs isq − ωr Ls isd − ωr λ f d + usq (10.18)
dt Ls
As a result, the stator current derivatives of SPMSM in the rotor frame can be obtained
from the machine parameters, rotor speed, permanent magnet flux, currents, and the MSC
voltage in the d-q frame.
The MSC can produce eight possible voltage vectors, expressed in the stator reference
α-β , according to the state of the six switches. These vectors are shown in Fig. 10.7. In
this figure, six sectors are defined by these vectors, and the stator and machine fluxes are

− →

shown as an example. Two of the eight vectors are the zero vectors ( V 0 , V 7 ) and the rest
are called active vectors.

− →−
The current slopes in the d-q axis for the eight possible voltage vectors ( V 0 ... V 7 ) are
derived as
1 
Sisd = −Rs isd + ωr Ls isq + usd (10.19)
Ls
1 
Sisq = −Rs isq − ωr Ls isd − ωr λ f d + usq (10.20)
Ls
where i and Sis denote the index of the voltage vector and current slope, respectively.
It is assumed that in the proposed control, four voltage vectors are applied in each switch-
ing interval, in which two of them are the zero vectors, and the two remaining vectors are
the active vectors. The voltage vector sequence in every period is specified according to
the corresponding voltage sector. The variation of stator current in the d-q frame at the
end of a switching interval can be expressed as

isd (k + 1) = isd (k) + Sda ta + Sdb tb + Sdc tc (10.21)


isq (k + 1) = isq (k) + Sqa ta + Sqb tb + Sqc tc (10.22)
where Sda , Sdb , Sdc , and Sdd are the current slopes in d axis for the respective voltage
vector sequence; Sqa , Sqb , Sqc , and Sqd represent the current slopes in q axis for the se-
lected vector sequence; ta , tb , tc , and td are the duration times of the corresponding voltage
vector sequence.
In order to minimize the error between the current and the reference value in the rotor
frame, the usual cost function used is
2
F (k + 1) = (isd (k + 1) − i∗sd (k))2 + isq (k + 1) − i∗sq (k) (10.23)

The duration time of each vector of Fig. 10.6 in an interval Tsw /2 can be obtained by
minimizing the cost function, ∂ F/∂ti = 0, which yields
ti
=
2
(isd (k) − i∗sd (k))(Sqa − Sqc ) + (isq (k) − i∗sq (k))(Sdc − Sda )
Sqa (Sdc − Sdb ) + Sqb (Sda − Sdc ) + Sqc (Sdb − Sda )
Ts (Sqa Sdc − Sqc Sda )
+
Sqa (Sdc − Sdb ) + Sqb (Sda − Sdc ) + Sqc (Sdb − Sda )

(10.24)

tj
=
2
(isd (k) − i∗sd (k))(Sqb − Sqa ) + (isq (k) − i∗sq (k))(Sda − Sdb )
Sqa (Sdc − Sdb ) + Sqb (Sda − Sdc ) + Sqc (Sdb − Sda ))
Ts (Sqb Sda − Sqa Sdc )
+
Sqa (Sdc − Sdb ) + Sqb (Sda − Sdc ) + Sqc (Sdb − Sda )

(10.25)

t0 = Ts − ti − t j
(10.26)
where Ts is the switching period.
Once the duration times have been obtained, the reference voltage vector, which must be
modulated in the next step, expressed in the stationary reference frame is

ti ⃗ t j ⃗ t0
⃗vre f = vre f α + jvre f β = ⃗Vi
+ V j + V0 (10.27)
Ts Ts Ts
We do not know beforehand which vectors minimize the cost function so it is necessary

− → − → −
to compute Eq. 10.24, Eq. 10.25, Eq. 10.26 for all the combinations of V i , V j , V 0 .
Once ti , t j , t0 are calculated for each trio, isq (k + 1) is calculated and F assessed. Finally,
the trio that minimizes F is chosen to be generated by the power converter.

10.6. Block diagram

Figure 10.11. Block diagram of an MPC for SPMSM.

10.7. Experimental results

Figure 10.12. Torque control of the SPMSM through i sq . Step response when ref-
erence changes from -4A to -6A. Note the fast-tracking of isq to the new reference
after the step. The i sd reference was set to zero.

Figure 10.13. Torque control of the SPMSM through i sq . Step response when
reference changes from -4A to -6A.
Figure 10.14. Stator current THD. The fundamental frequency is 1 0 . 2 2 Hz and its
magnitude is 7 . 8 1 .

The reader may find it useful to consult the following references related to MPC applied to
power converters: [Rodríguez et al. 2007][Rodriguez and Cortes 2012][Rodriguez et al. 2013],
[Wang et al. 2014][Kouro et al. 2009] [Blanco et al. 2021][Zarei et al. 2020].
10.8. Sensorless FOC of an SPMSM
Obtaining the position of a rotating rotor is critical for FOC. The Park transformation re-
quires the rotor position to obtain the angle between the rotor flux linkage and the α axis.
Originally, this information came from physical sensors, such as Hall-effect sensors, op-
tical encoders, etc. These sensors not only increase the system cost but also require main-
tenance. Later, the sensorless technique was developed intended to remove the need for
sensors, although some high-precision applications such as robotics still require encoders
since the error of the estimation is around 1 − 5%.

The idea of the sensorless technique is to estimate the rotor position angle using the
back emf, →−
es , expressed in the static reference frame (α and β axes). The typical algo-
rithm to do this is called a Slide Mode Observer (SMO) [Microchip 2007], chapter 9 of
[Kim 2017].

Speed estimation. Fundamentals


The Slide Mode Observer uses a theoretical model of the motor to obtain the stator current
and periodically corrects that model using the results of the measurements of those same
currents. In this application, the model is modified by changing the back electromotive
force, →

es . As a result, an accurate →

es is obtained, which is used to calculate the magnetic

− →

field angle ( es and λ f form exactly 90◦ ).
Finally, the speed is obtained from the measurement of the angle change at fixed time
intervals.

Firstly, we need to obtain the model of the motor.


The stator voltage of an SPMSM in the static reference frame can be expressed as




− →
− d λs
u s = Rs i s + (10.28)
dt

→− →

where →−u s and i s are the stator voltage and current vectors, and Rs , λ s are the stator
resistance and stator flux, respectively.
The stator flux linkages in that frame of reference are


− − →
→ −
λ s = Ls i s + λ f (10.29)

or

− →

λ s = Ls i s + λ f e j ωm t (10.30)



where λ f is the permanent magnet flux, Ls is the stator inductance, ωm is the electrical
rotor speed (magnets), and θ = ωm t is the angle of the magnetic field with respect to the
axis α.
Figure 10.15. Vector diagram of the rotor flux generated by the magnets.

Combining Eq. 10.28 and Eq. 10.30 we obtain





− →
− d is d
u s = Rs i s + Ls + λ f e j ωm t (10.31)
dt dt
If we now find the derivative



− →
− d is
u s = Rs i s + Ls + j ω m λ f e j ωm t (10.32)
dt
Splitting the equation into the α and β axes
disα
usα = Rs isα + Ls − λ f ωm sin ωm t (10.33)
dt
disβ
usβ = Rs isβ + Ls + λ f ωm cos ωm t (10.34)
dt
The back electromotive force, →

e s in the static reference frame can be expressed by

esα = −λ f ωm sin ωm t (10.35)

esβ = λ f ωm cos ωm t (10.36)


We can now rewrite Eq. 10.33 and Eq. 10.34 as
disα
usα = Rs isα + Ls + esα (10.37)
dt
disβ
usβ = Rs isβ + Ls + esβ (10.38)
dt
Using Eq. 10.37 and Eq. 10.38, the derivatives of current in the discrete-time can be
calculated as
1 1
(isα k+1 − isα k ) = (−Rs isα k + usα k − esα k ) (10.39)
T Ls
1  1 
isα k+1 − isβ k = −Rs isβ k + usβ k − esβ k (10.40)
T Ls
And the current at the instant k + 1, seen from the instant k is
 
Ts Ts
isα k+1 = 1 − Rs isα k + (usα k − esα k ) (10.41)
Ls Ls
 
Ts Ts 
isβ k+1 = 1 − Rs isβ k + usβ k − esβ k (10.42)
Ls Ls

Once the model of the motor has been established, the rotor speed and position can be
obtained using the procedure shown below:

• A seed value is chosen for the back emf, →



es .

• The next value of the stator current ,is k+1 , is estimated.

• After one program cycle, if is k+1 does not match the current measured by the ADC,
the estimated back emf must be increased or reduced as follows:
if i∗s k+1 > is measured then e∗s k+1 = e∗s k + K
if i∗s k+1 < is measured then e∗s k+1 = e∗s k − K

• The process continues until the estimated current matches the measured value (within
a certain margin of error). At this moment, the back emf is considered correct and
θ is obtained as
−esα k sin ω t
θk = arc tan = arc tan
esβ k con ω t
(10.43)

The angular speed ωm is calculated by measuring ∆θk every m samples and multiplying
the result by the conversion factor Ks :

m
ωm k = Ks ∑ [θk − θk−1]
k=1
(10.44)

Block diagram
Fig. 10.16 summarizes the angle and speed estimation algorithm. Both, the actual motor
and the digital model share the same input us . The resulting stator currents (actual mea-
sured and estimated) are compared and, depending on which one is bigger, the back emf,
es , is changed in ±K and the result filtered using a low-pass filter (LPF) to smooth the
changes. The new value for the back emf is e∗s ± ∆ es and will be used in the next program
cycle.
The resulting back emf, e∗s , is filtered and then used to calculate the rotor angle, θ ∗ , by
means of the trigonometric function arc tan ().
The rotor speed is estimated by calculating the rotor angle increments at a fixed time rate.
Finally, the delay introduced by the low-pass filters in the angle θ ∗ is compensated by
taking into account the rotor speed range at each moment, by means of an experimental
approximation.

Motor start-up
Since the sensorless FOC algorithm is based on the back emf estimation, a minimum
Figure 10.16. Block diagram of the speed estimator.

speed is needed to get the estimated back emf value. Therefore, the motor windings must
be energized at the appropriate angle. To handle this, a motor start-up subroutine is used,
Fig. 10.17.
When the motor is at standstill, and the start/stop button has been pressed, the DSP gen-
erates a series of sinusoidal voltages to get the motor spinning. The motor spins at a fixed
acceleration rate, and the FOC algorithm controls the currents isd and isq . The angle θ is
incremented based on the acceleration rate.
As shown in the Motor Startup block, the phase angle is incremented at a squared rate to
get a constant acceleration on the motor. Even if θ is being generated by the open loop-
state machine, the Field Oriented Control blocks are still being run and are controlling
torque component current and flux component current.
An external reference is used to set the desired torque required to start the motor.
The start-up subroutine provides a constant torque to start up the motor.
At the end of the startup ramp, the software switches over to closed-loop, sensorless con-
trol, taking θ from the position and speed estimator.
Figure 10.17. Block diagram of the start-up system.

Software State Machine


Fig. 10.18 shows the state machine used to run the sensorless FOC code in a microcon-
troller. There are three different States plus the Stop:

• Initialization State: From the reset, the registers of the peripherals (ADCs, PWM,
clock, etc.) are initialized and the motor remains stopped. Once the S2 button is
pressed, the variables are initialized (PI controllers, filters, etc.) and the interrupts
enabled.

• Start-up State: The program reads the torque reference, measures the stator cur-
rents, performs the Clarke and Park transforms to obtain isd and isq , runs the code
of the PI controllers and the inverse Park transform. Since the values of usd and usq
change slowly, the increment in a ramp of θ keeps the voltage vector, ual pha − ubeta
rotating. Finally, the SVM loads the new duty cycles into the PWM hardware.

• Sensorless FOC State: At every interrupt coming from the A/D converter, the pro-
gram reads the torque reference, measures the stator currents, performs the Clarke
and Park transforms to obtain isd and isq , estimates θ and ωm , compensates θ based
on the speed value, runs the code of the PI controllers and the inverse Park trans-
form, and finally, the SVM loads the new duty cycle values into the PWM hardware.
Figure 10.18. State machine of a Sensorless FOC.
Chapter

11
Implementation of control algorithms in a micro-
controller

Dionisio Ramírez

Abstract

Implementing control algorithms in a microcontroller requires expressing them in discrete


time. To this end, the chapter examines the definition of the z-transform and its relation
with the Laplace transform. The resulting relationship allows to translate differential
equations in continuous time into discrete time very easily, to finally write them in C
language in the microcontroller as a sequence of coefficients and ADC samples.
The chapter covers the implementation of the main stages of standard vector control in
C language in a generic microcontroller: digital filtering, direct and inverse Clarke and
Park transforms, discrete-time transfer functions, P-I controllers, and the SVM.

11.1. Introduction to the Z-transform


The Z-transform is used for the representation and analysis of discrete-time systems, in a
similar way as the Laplace transform for continuous-time systems [Chassaing 1998]. For
example, we can use the Laplace transform to solve a differential equation that represents
an analog filter, or the Z-transform to solve a difference equation that represents a digital
filter.
Consider an analog signal x (t) ideally sampled, xs (t)

xs (t) = ∑ x (t) δ (t − kT ) (11.1)
k=0

where δ (t − k T ) is the impulse (delta) function delayed by k T , T = 1/ fs is the sampling


period, and the function xs (t) is zero everywhere except at t = k T .
The Laplace transform of xs (t) is
Z ∞ Z ∞
−st
Xs (s) = xs (t) e dt = {x (t) δ (t) + x (t) δ (t − T ) + ...} e−st dt (11.2)
0 0
Using the property of the impulse function
Z ∞
f (t) δ (t − kT ) dt = f (kT ) (11.3)
0
Eq. 11.2 becomes

Xs (s) = x (0) + x (T ) e−s T + x (2T ) e−2s T + ... = ∑ x (nT ) e−ns T (11.4)
n=0

If we name z = es T in Eq. 11.4 becomes



X (z) = ∑ x (nT ) z−n (11.5)
n=0

If we leave the sampling period T implicit, then x (nT ) can be written as x (n), and Eq.
11.5 becomes

ZT {x (n)} = X (z) = ∑ x (n) z−n
n=0
(11.6)

which represents the Z-transform (ZT ) of x (n).


There is a one-to-one correspondence between x (n) and X (z), making the Z-transform a
unique transformation.
Difference equations
In discrete time, a transfer function is represented by a difference equation in a similar
fashion as a transfer function in continuous time is represented by a differential equation.
To solve a difference equation, we need to find the Z-transform of expressions such as
x (n − k), which corresponds to the kth derivative of an analog signal x (t). The order of
the difference equation is determined by the largest value of k. For example, k = 2 repre-
sents a second-order derivative.
 
dx(t) [x(n)−x(n−1)]
= x (n) − x (n − 1) ≡ 1 − z−1 X (z)

Side note: dt ≡ n−(n−1)

Using the definition of Z-transform given in Eq. 11.6, the z-transform of x (n) is

X (z) = ∑ x (n) z−n = x (0) + x (1) z−1 + x (2) z−2 + ... (11.7)
n=0

Then, the Z-transform of x (n − 1), which corresponds to a first-order derivative, (dx/dt),


is

ZT {x (n − 1)} = ∑ x (n − 1) z−n (11.8)
n=0
= x (−1) + x (0) z + x (1) z−2 + x (2) z−3 + ...
−1
(11.9)
= x (−1) + z−1 x (0) + x (1) z−1 + x (2) z−2 + ...

(11.10)
−1
= x (−1) + z X (z) (11.11)

where we used Eq. 11.7, and x (−1) represents the initial condition associated with a
first-order difference equation.
Therefore, the z-transform of an element delayed 1 sampling period, x (n − 1), is

ZT {x (n − 1)} = z−1 X (z) (11.12)

Similarly, the ZT of x (n − 2), equivalent to a second derivative is



ZT {x (n − 2)} = ∑ x (n − 2) z−n (11.13)
n=0
−1
= x (−2) + x (−1) z + x (0) z−2 + x (1) z−3 + ... (11.14)
= x (−2) + x (−1) z−1 + z−2 x (0) + x (1) z−1 + ...

(11.15)
= x (−2) + x (−1) z−1 + z−2 X (z) (11.16)

where x (−2) and x (−1) represent the two initial conditions required to solve a second-
order difference equation.
Therefore, the z-transform of an element delayed 2 sampling periods, x (n − 2), is

ZT {x (n − 2)} = z−2 X (z) (11.17)

Generalizing, the z-transform of an element delayed k sampling periods, x (n − k),


results in
k
ZT {x (n − k)} = z−k ∑ x (−m) zm + z−k X (z) (11.18)
m=1

If the initial conditions are all zero, then x (−m) = 0 for m = 1, 2, ..., k, and Eq. 11.18
reduces to
ZT {x (n − k)} = z−k X (z)
(11.19)
This equation establishes that an element delayed k samples in a sequence appears in the
Z-transform multiplied by z−k . For example, once the element x (n − 2) of the sequence
X (z) is transformed, it gives rise to the term z−2 X (z).
This property of the Z-transform is useful to rewrite a discrete-time equation in the z-
domain as a sequence of elements and vice-versa.

Example
As we will see later, the Z-transform of a P-I controller transfer function is
 
Ts z + 1
Us (z) = K p 1 + a Ue (z) (11.20)
2 z−1

If we rearrange the equation


   
a Ts a Ts
zUs (z) −Us (z) = K p + 1 zUe (z) + K p − 1 Ue (z) (11.21)
2 2
Dividing by z
   
−1 a Ts a Ts
Us (z) = z Us (z) + K p + 1 Ue (z) + K p − 1 z−1 Ue (z) (11.22)
2 2

since z−1 U (z) ≡ uk−1 and U (z) ≡ uk , we can rewrite the equation as a combination of
coefficients and samples
   
a Ts a Ts
us k = us k−1 + K p + 1 ue k + K p − 1 ue k−1 (11.23)
2 2

This expression allows a microprocessor to obtain the output of the PI controller at the
current instant, us k , from the current input, ue k , and the past output us k−1 and input ue k−1
values. In addition, programming this kind of mathematical expression in C language is
very straightforward.

11.2. Forward Euler integration


In discrete time, the derivative of x in a time period Ts can be calculated by means of finite
differences
∆x xk+1 − xk
= (11.24)
∆t Ts
provided that Ts is sufficiently small.
In the z-domain, the equivalent equation is

z−1
Y (z) = X (z) ≡ Y (s) = s X (s) (11.25)
Ts
Therefore the relationship between the derivative in the continuous and the discrete times
is
z−1
s≡ (11.26)
Ts
From this relationship, we can obtain the integral operator as

1 Ts
≡ (11.27)
s z−1

We can readily verify this relationship by integrating X(z), Fig. 11.1


Ts
Y (z) = X (z) (11.28)
z−1
Rearranging the equation we obtain

z−1
Y (z) = Ts X (z) (11.29)
1 − z−1
which is equivalent to
yk = yk−1 + Ts xk−1 (11.30)
where Ts xk−1 is the area of the rectangle defined by the sampling period, Ts , and the
previous value of the sequence of samples, xk−1 . Over time, the rectangles are added in
yk , and yk−1 represents the area until the instant k − 1.

Figure 11.1. Forward Euler integration.

Therefore, in this system, the signal sampled at instant k is held until the next sampling
instant, k + 1. The integration is approximated by accumulating rectangular areas.

11.3. Bilinear transformation. Rule of Tustin


Using the reasoning of the previous case, it is possible to obtain another method of inte-
gration based now on trapezoids.
Considering the Fig. 11.2, the area of the integral at instant k + 1 is

xk+1 + xk
yk+1 = yk + Ts (11.31)
2

In the z-domain, we can write

Ts
zY (z) = Y (z) + (z + 1)X (z) (11.32)
2

Rearranging the equation


Ts z + 1
Y (z) = X (z) (11.33)
2 z−1

Therefore, the integral in continuous time and in discrete time are expressed respectively
as
1 Ts z + 1
≡ (11.34)
s 2 z−1
Figure 11.2. Bilinear integration.

11.4. IMPLEMENTATION OF A VECTOR CONTROL IN A MICROCON-


TROLLER
Reading the ADC results
The first step in each control cycle is the measurement of the MSC or GSC currents and
voltages. The process is initiated by the PWM hardware by sending a "start of conversion"
(SOC) signal to the ADC at the very beginning of the PWM cycle. Note that the PWM
process and the ADC conversion are thus synchronized.
The conversion process takes several microseconds, after which the ADC hardware sends
an interrupt to the CPU. The CPU was waiting in a loop for that interrupt, so it will now
save the context in the Stack and jump to an Interrupt Service Routine (ISR) where it
reads the result registers and loads those values into the corresponding variables.
Once all the results have been read, the CPU clears the interrupt flags and returns to the
main loop, retrieving the context from the Stack.
In the case of the MSC, only two stator currents and the DC voltage are measured. The
reason is that the third one can be readily obtained by considering that ia + ib + ic =
0. In the case of the GSC, two grid voltages are additionally measured to obtain the
synchronization. The DC link voltage is measured to use its value in the pulse width
calculation in order to obtain higher accuracy. In addition, in the GSC the DC link voltage
is used to control the active power delivered to the grid.
In the example below, the ADC results, AdcxResult.ADCRESULTy, have the offset first
removed by subtracting a constant and then converted to amps or volts by multiplying
by a conversion factor. Also, a cast, ( f loat) is used to convert all unsigned int values to
obtain higher accuracy in the control algorithm.
1 //--------------------------------------------------------------------
2 // ELECTRICAL MEASUREMENTS
3 //--------------------------------------------------------------------
4 // AC current measurements: MSC and GSC
5 I_ac1=((float)Adc2Result.ADCRESULT8-1698.0)*0.00828180; //ADC2 B0
6 I_ac2=((float)Adc1Result.ADCRESULT0-1632.0)*0.00856428; //ADC1 A0
7
8 // AC voltage measurements: only GSC
9 V_ac1 =((float)Adc2Result.ADCRESULT9-1567.0)*0.421018; //ADC2 A3
10 V_ac2 = ((float)Adc2Result.ADCRESULT10-1567.0)*0.42252; //ADC1 A2
11
12 // DC voltage measurements: MSC and GSC.
13 Vdc = ((float)Adc1Result.ADCRESULT1)*0.36023; //ADC1 A1

Digital filter
The ADC results are digitally filtered due mainly for two reasons:

• ADC results usually present a small offset due to small deviations in the rated values
of the electronic used in the measurements. This offset is especially troublesome in
AC measurements since vector control expects zero offset signals, and the results
provided by the Park transform are deeply affected by constant offsets.

• EMI is often high in industrial facilities, where PWM converters often generate
noisy environments. As a consequence, the wires connecting the sensors to the
microcontroller are affected by electromagnetic noise resulting in noisy measure-
ments. This noise is present in the form of high-frequency signals that add to the
actual current measurement, so low-pass filters are useful for cleaning up measure-
ments and obtaining better motor operation.

The type of filter used in the control of electrical machines is known as Infinite Impulse
Response (IIR). Analog electronic filters composed of resistors, capacitors, and/or in-
ductors (and perhaps linear amplifiers) are examples of IIR filters. In this section, we
will reproduce the continuous-time transfer function of the low-pass R-C filter shown in
Fig. 11.3 in the microcontroller using its discrete-time equivalent.

Figure 11.3. Analog low-pass filter used as a model in the discretization.

The transfer function of the RC circuit in the continuous-time domain is


1
Y (s) = X (s) (11.35)
1 + ωs0

where ω0 = 1/RC is the cut-off frequency and ω0 = 2π f0 .


Using the Rule of Tustin, s ≡ T2s z−1
z+1 , to obtain the equivalent in the discrete-time domain,
we obtain
1
Y (z) = X (z) (11.36)
1 + ω02Ts z−1
z+1
Rearranging the equation
ω0 Ts ω0 Ts
2+ω0 Ts z + 2+ω0 Ts
Y (z) = X (z) (11.37)
z − 2−ω 0 Ts
2+ω0 Ts
Considering that z−1 Y (z) ≡ yk−1 and Y (z) ≡ yk , we finally obtain

ω0 Ts ω0 Ts 2 − ω0 Ts
yk = xk + xk−1 + yk−1 (11.38)
2 + ω0 Ts 2 + ω0 Ts 2 + ω0 Ts
The same reasoning can be used to obtain a first-order high-pass filter from the transfer
function of a C-R circuit. In this case, the result is

2 2 2 − ω0 Ts
yk = xk − xk−1 + yk−1 (11.39)
2 + ω0 Ts 2 + ω0 Ts 2 + ω0 Ts

The C-language code of both, a low-pass and a high-pass filter, is listed below.
1 //--------------------------------------------------------------------
2 // COEFFICIENTS for the Digital Filters
3 //--------------------------------------------------------------------
4 // AC VOLTAGES:
5 // LOW-PASS FILTER:
6 #define fc1 1000.0 // Cut-off frequency
7 #define w0_lp 2.0*3.14159*fc1
8 #define a0_lp w0_lp*T/(2.0+w0_lp*T)
9 #define a1_lp w0_lp*T/(2.0+w0_lp*T)
10 #define b0_lp (2.0-w0_lp*T)/(2.0+w0_lp*T)
11 //HIGH-PASS FILTER:
12 #define fc2 5.0 // Cut-off frequency
13 #define w0_hp 2.0*3.14159*fc2
14 #define a0_hp 2.0/(2.0+w0_hp*T)
15 #define a1_hp 2.0/(2.0+w0_hp*T)
16 #define b0_hp (2.0-w0_hp*T)/(2.0+w0_hp*T)
17 //--------------------------------------------------------------------
18 // VOLTAGE FILTERING
19 //--------------------------------------------------------------------
20 // AC voltage: High pass + Low pass filters
21 Uac1_n=a0_hp*V_ac1-a1_hp*V_ac1_1+b0_hp*Uac1_n_1; //Input: V_ac1
22

23 Vac1=a0_lp*Uac1_n+a1_lp*Uac1_n_1+b0_lp*Vac1_1; //Output: Vac1


24
25 V_ac1_1= V_ac1;
26 Uac1_n_1= Uac1_n;
27 Vac1_1= Vac1;

Fig. 11.4 shows the result obtained by two low-pass first-order IIR filters with a cut-off
frequency f0 = 200 Hz. The original noisy waveform (black) is numerically generated
by the microcontroller and represents a first harmonic (50 Hz), a low-frequency harmonic
(500 Hz), and a high-frequency harmonic (2 500 Hz). The first LP filter (blue) manages
to remove the high-frequency harmonic due to the large difference between the harmonic
and the cut-off frequencies. However, the low-frequency harmonic is still present in the
resulting waveform (blue). The second LP filter removes the high-frequency harmonic
completely (red), but the resulting waveform is shifted with respect to the fundamental
and the amplitude is not correct either.
Digital filters have to be carefully tuned since shifted signals are not allowed in real-
time control. The reason is that its instantaneous values are different from those of the
fundamental waveform. Unfortunately, sometimes the cutoff frequency cannot be selected
as close to the harmonic to be filtered as would be necessary.

Figure 11.4. Noisy signal and the result obtained by two low-pass IIR filters.

Clarke transform
After measuring the stator currents, usually, the next step is to express them in the static
reference frame by applying the Clarke transform.

ix = ia (11.40)
1
iy = √ (ib − ic ) (11.41)
3

1 //--------------------------------------------------------------------
2 // CLARKE TRANSFORM
3 //--------------------------------------------------------------------
4 i_x= i_a;
5 i_y= 0.57735*(i_b-i_c);

Park transform
The stator currents are usually expressed in a rotating reference frame to obtain constant
components, id , iq , that can be easily controlled by means of PI controllers.

id = ix cosθ + iy sinθ (11.42)


iq = iy cosθ − ix sinθ (11.43)

In a microcontroller, the calculation of any trigonometric function is time-consuming so


they must be calculated once and then reused.
1 //--------------------------------------------------------------------
2 // PARK TRANSFORM
3 //--------------------------------------------------------------------
4 cos_theta = cos(theta);
5 sin_theta = sin(theta);
6 id=ix*cos_theta+iy*sin_theta;
7 iq=iy*cos_theta-ix*sin_theta;

where θ is the angle of the d axis with respect to the static reference frame. In control of
MSCs it is measured using an encoder or a resolver attached to the shaft of the electrical
machine in control whereas in control of GSCs a PLL is used.

First order transfer functions


In some cases, it is necessary to use a first-order transfer function as part of the control
algorithm. Consider, for example, the difference equation for isd and imr in a squirrel cage
induction motor.
d imr
isd = imr + Tr (11.44)
dt
The Laplace transform yields
 
1
Imr (s) = Isd (s) (11.45)
1 + sTr
2 z−1
Now, we will transform it into discrete time using the Rule of Tustin: s ≡ Ts z+1

z (2Tr + Ts ) Imr (z) + (Ts − 2Tr ) Imr (z) = Ts z Isd (z) + Ts Isd (z) (11.46)
Dividing by z and taking into account that z−1 Imr (z) ≡ Imr k−1 and Imr (z) ≡ Imr k , we
obtain
2Tr − Ts Ts Ts
imr k = imr k−1 + isd k + isd k−1 (11.47)
2Tr + Ts 2Tr + Ts 2Tr + Ts
or
imr k = A imr k−1 + B isd k + B isd k−1 (11.48)
where the coefficients A and B are constant.
This equation can be typed directly in C language and compiled. However, it is necessary
for the microcontroller to store the current values imr k and isd k to use them as imr k−1 and
isd k−1 in the next program cycle.

1 //--------------------------------------------------------------------
2 // FIRST ORDER TRANSFER FUNCTION
3 //--------------------------------------------------------------------
4 imr_k= A*imr_k_1+ B*isd_k+ B*isd_k_1; // Difference equation
5 imr_k_1= imr_k; // Store y for the next cycle
6 isd_k_1= isd_k; // Store x for the next cycle

where the coefficients of the difference equation are calculated during the compilation
time using macros
1 #define Ts 100e^-6 // Example
2 #define Lr 0.01 // Example
3 #define Rr 0.1 // Example
4 #define Tr Lr/Rr // Rotor constant time
5 #define A (2*Tr-Ts)/(2*Tr+Ts) // Coefficient 1
6 #define B Ts/(2*Tr+Ts) // Coefficient 2
Rotor speed measurement
The rotor speed is measured in specialized hardware that interfaces two (or three) signals
from the encoder. As the encoder rotates, the two generated signals are shifted 90◦ out of
phase from each other. These are commonly called quadrature QEPA and QEPB signals.
The direction of rotation is obtained by the specialized hardware by checking the phase
shift between QEPA and QEPB. The clockwise direction for most encoders is defined as
the QEPA channel going positive before the QEPB channel and vice-versa.
The digital counter increments with pulses when the rotor rotates clockwise and decre-
ments when rotates counterclockwise.
The pulses sent by the encoder increment a digital counter. By subtracting the initial and
final values of the counter at a fixed time rate, and knowing the pulse/rev of the encoder,
it is possible to derive the rotor speed in pulses/s, i.e. rad/s.

1 //--------------------------------------------------------------------
2 // DIRECTION OF ROTATION (bit: 0=counterclockwise; 1=clockwise)
3 //--------------------------------------------------------------------
4 direction_of_rotation=EQep1Regs.QEPSTS.bit.QDF;
5 //--------------------------------------------------------------------
6 // ROTOR SPEED MEASUREMENT:
7 //--------------------------------------------------------------------
8 h++;
9 // Rotor speed is measured every fixed number of cycles:
10 if(h>=K){
11 h=0;
12 alfa_n=(int)EQep1Regs.QPOSCNT; //0-4096
13 //--------------------------------------------------------------------
14 // POSITIVE SPEED: Up timer.
15 //--------------------------------------------------------------------
16 if(direction_of_rotation==1){
17 if(alfa>=alfa_1){delta_n=(alfa-alfa_1);}
18 }
19 else {delta_n=(MAX-alfa_1+alfa);}
20 //--------------------------------------------------------------------
21 // NEGATIVE SPEED: Down timer.
22 //--------------------------------------------------------------------
23 if(direction_of_rotation==0){
24 if(alfa_1>=alfa){delta_n=-(alfa_1-alfa);}
25 }
26 else {delta_n=-(MAX-alfa+alfa_1);}
27 //--------------------------------------------------------------------
28 alfa_1=alfa;
29 }

P-I controller
Proportional Integral Derivative controllers, Fig. 11.5, are not used as such in the control
of electrical machines.
Figure 11.5. Structure of a PID controller in the continuous-time domain.

In this type of application, the derivative part is removed to avoid noise enhancement
in noisy measurements obtained in industrial environments. Therefore, only the propor-
tional and integral parts are implemented in a discrete PI controller.

Figure 11.6. Structure of a P-I controller in the discrete-time domain.

The transfer function of a PI controller in continuous time is


 
KI
Y (s) = KP + E (s) (11.49)
s
If we make some arrangements to express it in a more usual way
 
s+a
Y (s) = KP E (s) (11.50)
s
where a = KI /KP .
2 z−1
Using the Rule of Tustin: s ≡ Ts z+1 ,
we obtain
 
Ts z + 1
Y (z) = KP 1 + a E (s) (11.51)
2 z−1
or
aTs aTs
 
KP 2 + 1 z + KP 2 −1
Y (z) = E (z) (11.52)
z−1
Considering that z−1 Y (z) ≡ yk−1 and Y (z) ≡ yk , the equation becomes
   
aTs aTs
yk = yk−1 + KP + 1 ek + KP − 1 ek−1 (11.53)
2 2

A PI controller is programmed in C language using the following code


1 //--------------------------------------------------------------------
2 // PI CONTROLLER
3 //--------------------------------------------------------------------
4 yk= yk_1+ A*ek+ B*ek_1; // Difference equation
5 yk_1= yk; // Store y for the next cycle
6 ek_1= ek; // Store x for the next cycle

where the coefficients of the difference equation are calculated during the compilation
time using macros
1 //--------------------------------------------------------------------
2 // COEFFICIENTS for the PI controllers
3 //--------------------------------------------------------------------
4 #define Ts 100e^-6 // Example
5 #define KI 10.0 // Example
6 #define KP 20.0 // Example
7 #define a KI/KP // Constant
8 #define A KP*(a*Ts/2+1) // Coefficient 1
9 #define B KP*(a*Ts/2-1) // Coefficient 2

Anti wind-up P-I controller


When a PI controller cannot reduce the error, or the process to reduce it is too slow, the
PI integration term may increase too much and even produce an overflow. Furthermore,
when the output increases that much (winds-up), the integrator will take a long time to
reduce its term back to normal values. To avoid these problems, an anti wind-up system
is used, see Fig. 11.7.

Figure 11.7. Structure of a P-I controller.

The pseudo-code according to Fig. 11.7 is shown below


1 //--------------------------------------------------------------------
2 // PI CONTROLLER WITH ANTI WIND-UP
3 //--------------------------------------------------------------------
4 ek=yref_k-y_k // Error
5 if{uk<ulimit}{
6 uk=xk+KP*ek // xk is KI*integral of ek
7 }
8 else{
9 if{uk>Umax}{
10 u_limited=Umax; // Saturation
11 }
12 else if{uk<Umax}{
13 u_limited=-Umax; // Saturation
14 }
15 elimit_k=u_limited-uk; // Opposite sign to error ek
16 xk=xk_1+KI*ek+Kcorr*elimit; // Reduces the integral term
17 }

where Kcorr = KI/KP is experimentally obtained.

Inverse Park transform


The reference voltages in the d − q frame obtained from the PI controllers must be ex-
pressed in the static reference frame before being used by the space vector modulator.

ix = id cosθ − iq sinθ (11.54)


iy = id sinθ + iq cosθ (11.55)

1 //--------------------------------------------------------------------
2 // INVERSE PARK TRANSFORM
3 //--------------------------------------------------------------------
4 ix_ref=i_d*cos_theta-i_q*sin_theta;
5 iy_ref=i_d*sin_theta+i_q*cos_theta;

Space Vector Modulator (SVM)


The last stage of the control algorithm is the SVM, where the ton of the IGBTs are calcu-
lated and loaded into the hardware registers of the PWM.
1 //--------------------------------------------------------------------
2 // SPACE VECTOR MODULATOR
3 //--------------------------------------------------------------------
4 if(UX>=0&UY>=0){
5 if(UY<=1.732*UX){
6 SECTOR=1;
7 }
8 else{
9 SECTOR=2;
10 }
11 }
12 else if(UX<0&UY>0){
13 if(VY<=-1.732*VX){
14 SECTOR=3;
15 }
16 else{
17 SECTOR=2;
18 }
19 }
20 else if(VX<0&VY<=0){
21 ... etc.
22
23 switch (SECTOR){
24
25 case 1:
26 // Time of application of V1, in values per unit\\
27 T1=K20*(0.866*VX-0.5*VY);\\
28 // Time of application of V2, in values per unit\\
29 T2=K20*(VY);
30 // Time of application of V0, in values per unit\\
31 T0=0.5*T-T1-T2;
32

33 // ton of IGBT 1 top, in per unit


34 TonA=(T0+2*T1+2*T2)*f;
35 // ton of IGBT 2 top, in per unit
36 TonB=(T0+2*T2)*f;
37 // ton of IGBT 3 top, in per unit
38 TonC=T0*f;
39 break;
40
41 case 2:
42 T2=K20*(0.866*VX+0.5*VY);
43 T3=K20*(-0.866*VX+0.5*VY);
44 T0=0.5*T-T2-T3;
45
46 TonA=(T0+2*T2)*f;
47 TonB=(T0+2*T2+2*T3)*f;
48 TonC=T0*f;
49 break;
50

51 case 3:
52
53 ... etc.
54
55 // Load of the ton values expressed proportionally to Ts, in the
PWM compare registers
56 PWM1Regs.COMPARE = (int)(PERIOD*Ton_A);
57 PWM2Regs.COMPARE = (int)(PERIOD*Ton_B);
58 PWM3Regs.COMPARE = (int)(PERIOD*Ton_C);

11.5. Sequence of the control program in the microcontroller


In the microcontroller there are two processes taking place concurrently and synchronously.
One of them is carried out by the CPU and the another by the PWM hardware.
The PWM hardware provides the synchronization between both processes so that the
PWM pulse generation starts the ADC conversion by sending a "Start of Conversion" sig-
nal to the ADC hardware. At this moment, the PWM up/down counter starts to generate
the carrier for the modulation and the ADC starts the analog to digital conversion.
When the A/D conversion ends, an interrupt is sent to the CPU, which leaves the con-
trol loop, saves the context in the Stack, and enters the Interrupt Service Routine to read
the ADC results. The CPU clears up all the interrupt flags and comes back to the con-
trol loop, retrieving the context from the Stack. From this moment on, the CPU runs the
control code: digital filtering, Clarke and Park transforms, P-I controllers, inverse Park
transform, and SVM. When the control code ends, the new PWM values are loaded in the
PWM registers although they do not take effect until Ts . Until the period is reached, the
CPU usually remains in an infinite loop, waiting for the next interrupt, or performing aux-
iliary and slow tasks that can be split throughout several cycles (checking the temperature
protection of the power converter, etc.).

Figure 11.8. Diagram of the control process inside the microcontroller.


Chapter

12
Microcontrollers designed for control (MCU)

Dionisio Ramírez

Abstract

The improved performance and lower price of microcontrollers have been key to the use
of complex electrical machine control algorithms, developed many years earlier, in the
industry.
This chapter uses a widely used microcontroller to outline the main features of an MCU
specifically designed for control. After giving an overview of the internal architecture, the
most important peripherals are explained in more detail.

12.1. Introduction
Microcontrollers were traditionally designed to perform simple tasks where mathematical
calculations were not very important. They used to have an 8-bit CPU, a single memory
for data and code, some 8-bit ADCs, and some PWM outputs.
Later on, digital signal processors (DSPs) came on the market with a totally different ar-
chitecture (Harvard instead of Von Neumann) and very few peripherals, sometimes even
only a 24-bit ADC and one DAC converter. But their CPU featured a specialized architec-
ture oriented to perform multiplication and an accumulation in a single instruction (MAC)
and in only 1 clock cycle. MAC operation is massively used in discrete-time control sys-
tems since discrete transfer functions result from a sum of products of coefficients and
ADC samples so the DSPs proved to be well suited for control tasks.
Finally, the industry merged both, microcontrollers and DSPs, giving rise to the so-called
MCUs that feature 32-bit CPUs, up to 16 ADC inputs, 6-12 PWM outputs, high-resolution
PWM, interface for an encoder, a number of communication protocols (McBSP, SPI, SCI,
I2C, CAN, Ethernet), etc.

12.2. Overview of a microcontroller designed for control


The architecture of the MCUs differs according to the manufacturer, so in this chap-
ter, we are going to describe the Texas Instruments F28335, a worldwide used MCU,
[Incorporated 2020], Fig. 12.1.
According to the manufacturer, the main applications are: industrial AC inverter drives,
industrial servo amplifiers and controllers, computer numerical control (CNC) machining,
uninterruptible and server power supplies, telecom equipment power, solar inverters, etc.
Its main features Fig. 12.2, are: 32 floating point 150MHz CPU, 32Kx16 bit RAM,
256Kx16 bit Flash memory (including a protected area), and the following peripherals:

• General-Purpose Input/Output (GPIO): 88 pins that can be individually selected


to operate as digital I/O, referred to as GPIO, or connected to one of up to three
peripheral I/O signals.

• Analog to Digital Converter (ADC): 16 channels, 12-bit ADC core with built-in
dual sample-and-hold (S/H), simultaneous or sequential sampling modes, analog
input range from 0 V to 3 V, fast conversion time at 12.5 MHz, multiple triggers as
sources for the start-of-conversion (SOC) sequence: software, PWM, GPIO.

• Pulse Width Modulator (PWM): 12 PWM outputs to generate complex pulse width
waveforms with minimal CPU overhead or intervention in both commercial and
industrial equipment such as digital motor control, switch mode power supply con-
trol, uninterruptible power supplies (UPS), and other forms of power conversion.

• High-Resolution Pulse Width Modulator (HRPWM): extends the time resolution


capabilities of the conventionally derived digital pulse width modulator (PWM).
HRPWM is typically used when PWM resolution falls below 9 − 10 bits. This
occurs at PWM frequencies greater than 200 kHz when using a CPU/system clock
of 100 MHz. Although each application may differ, typical low-frequency PWM
operation (below 250 kHz) may not require HRPWM. It is intended for conversion
topologies such as single-phase and multi-phase buck, boost, and flyback.

• Quadrature encoder pulse (QEP): for direct interface with a linear or rotary incre-
mental encoder to get position, direction, and speed information from a rotating
machine.

• Capture (CAP): used in systems where accurate timing of external events is im-
portant such as speed measurements of rotating machinery (for example, toothed
sprockets sensed via Hall sensors), elapsed time measurements between position
sensor pulses, period and duty cycle measurements of pulse train signals, decod-
ing current or voltage amplitude derived from duty cycle encoded current/voltage
sensors.

• Watchdog Block: generates an output pulse whenever the watchdog up counter has
reached its maximum value. To prevent this, the control software must periodically
write a predetermined sequence into the watchdog key register which resets the
watchdog counter. Otherwise, the watchdog resets the MCU.

and communication hardware:

• Serial controller interface (SCI, or UART): for MCU-PC or MCU-MCU communi-


cation, as it can be used to communicate through an RS-232 port.
• Serial peripheral interface (SPI): a high-speed synchronous serial input and output
(I/O) port that allows a serial bit stream of programmed length to be shifted into
and out of the device at a programmed bit-transfer rate.

• Multichannel Buffered Serial Port (McBSP): allows direct interface to other DSPs,
codecs, and other devices in a system but is not intended to be used as a high-speed
interface. interface.

• Controller area network (CAN): a robust vehicle bus standard designed to allow mi-
crocontrollers and devices to communicate with each other’s applications without
a host computer. It is a message-based protocol, designed originally for multiplex
electrical wiring within automobiles to save on copper, but it can also be used in
many other contexts.

• Inter-Integrated Circuit (I2 C, or I2C): a synchronous, multi-controller/multi-target


(controller/target), packet switched, single-ended, serial communication bus in-
vented in 1982 by Philips Semiconductors. It is widely used for attaching lower-
speed peripheral ICs to microcontrollers in short-distance, intra-board communica-
tion.

• Direct Memory Access (DMA): transfers data from one address to another, without
CPU intervention, across the entire address range. For example, the DMA con-
troller can move data from the ADC conversion memory to RAM.

Figure 12.1. Texas Instruments F28335 pin layout.

Note in Fig. 12.1 that many pins have the aforementioned dual function: many general
purpose I/O (GPIO) can be set up for other functionalities such as CAN bus, PWM, SCI,
ECAP, EQEP, etc. By default, they are all digital outputs and it is the user’s responsibility
to configure them for other functionality.
In contrast, the ADC input pins (35-42 and 46-53) are specifically assigned to that func-
tion.

Figure 12.2. Hardware of the Texas Instruments F28335 microcontroller.


12.3. Analog-to-Digital Converter (ADC)
The ADC, [Incorporated 2020], is used at the beginning of each program cycle to obtain
the values of the currents and voltages at a fixed time rate.
The input analog voltage range is 0 − 3V and the digital value is derived by:

- Digital Value = 0 when analog input ≤ 0

- Digital Value = 4096 analog3 input when 0 < analog input ≤ 3

- Digital Value = 4095, when analog input > 3

- All fractional values are truncated.

The numerical value obtained from the conversion is not scaled in volts or amps, etc.
so it is the responsibility of the programmer to remove the possible offset and multiply
the result by the gain needed to express it in the desired units.
The ADC of the F28335 is built around a fast, 12-bit ADC module with a fast conversion
rate of up to 80 ns. A simplified functional block diagram of the ADC module is shown
in Fig. 12.3. Note that, although there are multiple input channels and two sample&hold
(S/H) circuits, there is only one converter in the ADC module. Once the conversion
is complete, the selected channel value is stored in the corresponding Result Register
(0 − 15).

Figure 12.3. Block diagram of the ADC module.


Simultaneous sampling mode
The 16 channels, labeled in blue in Fig. 12.3, are grouped into two blocks ADCIN A0
through A7 and ADCIN B0 through B7.
The 16 channels are configurable as two independent 8-channel modules, see Fig. 12.4.
In this mode, the channels are converted in pairs, two by two. The results are stored in
two groups: from Result Register 0 through 7, and from Result Register 8 through 15.

Figure 12.4. Block diagram of autosequenced ADC in cascaded mode.

Sequential sampling mode


The two independent 8-channel modules can be cascaded to form a 16-channel module,
see Fig. 12.5. In this mode, the sequencer selects the 16 channels successively, the chan-
nels are converted one by one and the results, ADCRESULT 0 through 15, are stored in
16 result registers, from Result Register 0 through 15.
Figure 12.5. Block diagram of autosequenced ADC with dual sequencers.

Multiple time-sequenced triggers


The analog to digital conversion begins when the ADC module receives a start of con-
version signal (SOC). This signal can be generated by several sources such as: a PWM
module, an external signal, a general-purpose internal timer, or by software.
In the example of Fig. 12.6, the ADC conversion is carried out twice a period. In this
case, both triggers are provided by the same digital counter (timer) of a PWM module.

Figure 12.6. Example of multiple PWM triggers to start the ADC sequencer.

The sequencers also allow the system to convert the same channel multiple times, al-
lowing the user to perform oversampling algorithms.

12.4. Pulse Width Modulator (PWM) Module


Each PWM module represents one complete PWM channel composed of two PWM out-
puts: PWMxA and PWMxB. Multiple PWM modules are instanced within a device as
shown in Fig. 12.7, [Incorporated 2020].
Each PWM instance is identical with one exception. Some instances include a hardware
extension that allows more precise control of the PWM outputs. This extension is the
high-resolution pulse width modulator (HRPWM).
As Fig. 12.7 shows, the PWM modules are chained together via a clock synchronization
scheme that allows them to operate as a single system when required. Each PWM module
provides an optional SOC signal for the ADC.
Each PWM module supports the following main features:

• Dedicated 16-bit time-base counter with period and frequency control.

• Two PWM outputs (PWMxA and PWMxB) per module.

• Asynchronous override control of PWM signals through software.

• Programmable phase-control support for lag or lead operation relative to other


PWM modules.

• Dead-band generation.

• Programmable trip zone on fault conditions.

• A trip condition can force either high, low, or high-impedance state logic levels at
PWM outputs.

• All events can trigger both CPU interrupts and ADC start of conversion (SOC).

Figure 12.7. Multiple synchronized PWM modules and the SOC signals for the ADC.

PWM Period and Frequency


The frequency of PWM events is controlled by the time-base period (TBPRD) register
and the mode of the time-base counter. Fig. 12.8 shows the period (Tpwm) and fre-
quency (Fpwm) relationships for the up-count, down-count, and up-down-count time-
base counter modes when the period is set to 4 (TBPRD = 4).
The time increment for each step is defined by the time-base clock (TBCLK) which is a
prescaled version of the system clock (SYSCLKOUT).
The time-base counter has three modes of operation selected by the time-base control
register (TBCTL):

• Up-Down-Count Mode: In up-down-count mode, the time-base counter starts from


zero and increments until the period (TBPRD) value is reached. When the period
value is reached, the time-base counter then decrements until it reaches zero. At
this point, the counter repeats the pattern and begins to increment.

• Up-Count Mode: In this mode, the time-base counter starts from zero and incre-
ments until it reaches the value in the period register (TBPRD). When the period
value is reached, the time-base counter resets to zero and begins to increment once
again.

• Down-Count Mode: In down-count mode, the time-base counter starts from the
period (TBPRD) value and decrements until it reaches zero. When it reaches zero,
the time-base counter is reset to the period value and it begins to decrement once
again.

Figure 12.8. Time-Base frequency and period.

Dead-Band Generator (DB) Submodule


The key functions of the dead-band module are:
· Generating appropriate signal pairs (PWMxA and PWMxB) with dead-band relationship
from a single PWMxA input.
· Programming signal pairs for:
– Active high (AH).
– Active low (AL).
– Active high complementary (AHC).
– Active low complementary (ALC).
· Adding programmable delay to rising edges (RED).
· Adding programmable delay to falling edges (FED).

The Dead-Band Polarity Settings allow addressing all the active high/low modes re-
quired by available industry power switch gate drivers. The waveforms for these typical
cases are shown in Figure

Figure 12.9. Dead-band waveforms for typical cases 0% < duty < 100%.

Trip-Zone (TZ) Submodule


The PWM outputs can be programmed to respond accordingly when external faults occur.
In effect, upon a fault condition, outputs PWMxA and PWMxB can be forced to one of
the following:

• High.

• Low.

• High-impedance.
• No action taken.

Up-down-count mode to generate symmetric PWM


The idea of multiple modules controlling a single power stage can be used in to the three-
phase inverter case. In such a case, six switching elements can be controlled using three
PWM modules, one for each leg of the inverter. Each leg must switch at the same fre-
quency and all legs must be synchronized. A master + two slaves configuration can easily
address this requirement. Fig. 12.10 shows how three PWM modules can control a 3-
phase inverter running a motor.

Figure 12.10. PWM modules for a three-phase inverter.

In the example of Fig. 12.11, the period of the up/down digital counter is set to 800 and
three different compare values are used: 500, 600, and 700, one for each leg.
Note that PWMxA and PWMxB are the trigger signals for the IGBTS of each leg, and
the programmed rising and falling deadbands, shaded in gray.
Figure 12.11. Resulting waveforms when the PWM modules are set to trigger
three-phase inverters.

In Fig. 12.11, the following acronyms have been used:


CA: Action when the counter equals the active Compare A register.
DBFED: Dead-Band Falling Edge Delay.
DBRED: Dead-Band Rising Edge Delay.

12.5. Quadrature encoder pulse (QEP) module


The QEP module is used for direct interface with a linear or rotary incremental encoder
to get the position, direction, and speed information from a rotating machine for use in a
high-performance motion and position-control system, [Incorporated 2020], chapter 9 of
[Kim 2017].

Optical encoders
A single track of slots patterns the periphery of an incremental encoder disk, as shown in
Fig. 12.12.
These slots create an alternating pattern of dark and light lines. The disk count is defined
as the number of dark/light line pairs that occur per revolution (lines per revolution). As
a rule, a second track is added to generate a signal that occurs once per revolution (index
signal: QEPI), which can be used to indicate an absolute position. Encoder manufacturers
identify the index pulse using different terms such as index, marker, home position, and
zero reference.
To derive direction information, the lines on the disk are read out by two different photo-
elements that "look" at the disk pattern with a mechanical shift of 1/4 the pitch of a line
pair between them. This shift is realized with a reticle or mask that restricts the view of
the photo element to the desired part of the disk lines. As the disk rotates, the two photo-
elements generate signals that are shifted 90◦ out of phase from each other. These are
commonly called the quadrature QEPA and QEPB signals. The clockwise direction for
most encoders is defined as the QEPA channel going positive before the QEPB channel
and vice-versa as shown in Fig. 12.13

Figure 12.12. Optical Encoder Disk.

The encoder wheel typically makes one revolution for every revolution of the motor
or the wheel may be at a geared rotation ratio with respect to the motor. Therefore, the
frequency of the digital signal coming from the QEPA and QEPB outputs varies propor-
tionally with the velocity of the motor. For example, a 2000-line encoder directly coupled
to a motor running at 5000 revolutions per minute (rpm) results in a frequency of 166.6
kHz, so by measuring the frequency of either the QEPA or QEPB output, the processor
can determine the velocity of the motor.

Figure 12.13. QEP Encoder Output Signal for Forward/Reverse Movement.

Measurement of high rotor speeds


The encoder count (position) is read once during each unit time event, notice variables
marked in blue in Fig. 12.14. The quantity [x(k) − x(k − 1)] is formed by subtracting the
previous reading from the current reading. Then the velocity estimate is computed by
multiplying by the known constant 1/T (where T is the constant time between unit time
events and is known in advance).
Estimation based on Eq. 12.1 has an inherent accuracy limit directly related to the resolu-
tion of the position sensor and the unit time period T. For example, consider a 500-line per
revolution quadrature encoder with a velocity calculation rate of 400 Hz. When used for
position the quadrature encoder gives a four-fold increase in resolution, in this case, 2000
counts per revolution. The minimum rotation that can be detected is, therefore, 0.0005
revolutions, which gives a velocity resolution of 12 rpm when sampled at 400 Hz. While
this resolution may be satisfactory at moderate or high speeds, e.g. 1% error at 1200 rpm,
it would clearly prove inadequate at low speeds. In fact, at speeds below 12 rpm, the
speed estimate would erroneously be zero much of the time.

xk+1 − xk ∆X
ωk (t) = = (12.1)
T T

where,
• ∆X:Unit position is defined by an integer multiple of quadrature edges.
• T : Elapsed time between unit position events.
• ωk :Velocity at time instant "k".

QEP Edge Capture Unit for low rotor speed measurement


The QEP peripheral includes an integrated edge capture unit to measure the elapsed time
between the position events as shown by the red dotted lines in Fig. 12.14. This feature
and Eq. 12.2 are used for low-speed to obtain an accurate measurement. It requires a
position sensor whose outputs provide a fixed interval pulse train, such as the aforemen-
tioned quadrature encoder. The width of each pulse is defined by motor speed for a given
sensor resolution.
Eq. 12.2 can be used to calculate motor speed by measuring the elapsed time between
successive quadrature pulse edges. However, this method suffers from the opposite limi-
tation, as does Eq. 12.1. A combination of relatively large motor speeds and high sensor
resolution makes the time interval ∆T small, and thus more greatly influenced by the timer
resolution. This can introduce considerable error in high-speed estimates.
For systems with a large speed range (that is, speed estimation is needed at both low and
high speeds), one approach is to use Eq. 12.2 at low speed and have the DSP software
switch over to Eq. 12.1 when the motor speed rises above some specified threshold.

X X
ωk (t) = = (12.2)
tk+1 − tk ∆T

where,
• X: Unit position is defined by an integer multiple of quadrature edges.
• ∆T : Elapsed time between unit position events.
• ωk : Velocity at time instant "k".
Figure 12.14. High-speed (blue) and low-speed (red) measurement.

The QEP inputs include two pins for quadrature-clock mode or direction-count mode,
an index (or 0 marker), and a strobe input.

• QEPA and QEPB: These two pins can be used in quadrature-clock mode or direction-
count mode:
– Quadrature-clock Mode: The QEP encoders provide two square-wave signals
(A and B) 90 electrical degrees out of phase whose phase relationship is used to
determine the direction of rotation of the input shaft and the number of QEP pulses
from the index position to derive the relative position information. For forward
or clockwise rotation, the QEPA signal leads QEPB signal and vice versa. The
quadrature decoder uses these two inputs to derive the direction of rotation, and this
information can be checked in one bit of the QEP registers.
– Direction-count Mode: In direction-count mode, direction and clock signals are
provided directly by the encoder. Some position encoders have this type of output
instead of quadrature output. In this case, the QEPA pin provides the clock input
and the QEPB pin provides the direction input.

• QEPI: Index or Zero Marker. The QEP encoder uses an index signal to assign an
absolute start position from which position information is incrementally encoded
using quadrature pulses. This pin is connected to the index output of the QEP
encoder to optionally reset the position counter for each revolution. This signal can
be used to initialize or freeze and store (latch) the position counter on the occurrence
of a desired event on the index pin.
• QEPS: Strobe Input. This general-purpose strobe signal can initialize or latch the
position counter on the occurrence of a desired event on the strobe pin. This signal
is typically connected to a sensor or limit switch to notify that the motor has reached
a defined position.

12.6. Enhancing the Computational Performance of Microcontrollers


The manufacturer Texas Instruments enhances the computational performance of its mi-
crocontrollers (MCU) by adding an array of integrated on-chip hardware math enhance-
ments that dramatically increase the performance of the MCU in many real-time applica-
tions [Schachter 2020]. The five key enhancements are:
• Floating-Point Unit (FPU).
• Control Law Accelerator (CLA).
• Trigonometric Math Unit (TMU).
• Fast Integer Division Unit (FINTDIV).

At the center of each MCU lies a fast fixed-point central processing unit (CPU) that on
its own provides excellent 32-bit processing capabilities. The FPU provides seamless
integration of floating-point hardware into the CPU. To augment this further, the CLA
provides an independent floating-point CPU operating at the full speed of the device and
it is designed to perform control law computations with minimal latency. This effectively
doubles the raw computing capabilities of the device. The TMU provides hardware sup-
port for common trigonometric math functions, while the FINTDIV enables fast integer
division operations.

Figure 12.15. System Block Diagram with Math Enhancements.

Floating-Point Unit (FPU)


Floating-point performance dramatically enhances the mathematical computation horse-
power used in signal processing and control algorithms.
Many control system designs typically start with simulation tools, where the algorithms
are developed with floating-point math. These algorithms can then easily be ported to a
microcontroller that has native floating point math support. Floating-point math provides
a large dynamic range, thereby making it easier to develop code compared to fixed-point
math. The programmer no longer needs to worry about scaling and saturation.
Additionally, robustness is improved since floating-point values do not wrap around the
number line on an overflow or underflow, as they would in fixed-point math. These char-
acteristics enable the high performance mathematical capabilities that are needed for ad-
vanced control systems.
The MCU feature a CPU that is designed around a 32-bit fixed-point accumulator-based
architecture. It utilizes the best features of digital signal processors and microcontroller
architectures. The addition of the FPU to the fixed-point CPU enables the MCUs to sup-
port hardware IEEE-754 single-precision floating-point format operations whereas the
compiler tools provide C programming support for the CPU which makes it easy to write
software, in addition to porting existing code.

Control Law Accelerator (CLA)


Real-time control systems require minimal latency where the time delay between sam-
pling, processing, and outputting must fit within a tight time window in order to meet
performance objectives.
This architecture would execute time-critical control loops concurrently with the main
CPU and free it up to perform other required tasks.
The CLA is a fully-programmable independent 32-bit floating-point hardware accelerator
that is designed for math-intensive computations and is designed to execute real-time con-
trol algorithms in parallel with the CPU, effectively doubling the computational perfor-
mance. Furthermore, the CLA approach eliminates jitter, and furthermore, the execution
time becomes deterministic. It supports eight independent tasks, each of which is mapped
back to an event trigger, such as a timer or the availability of an ADC result. Separate
tasks can be used to support multiple control loops or phases at the same time.
Some devices feature an enhanced version of the CLA with the option of running the
lowest priority task as a background task. Typical uses of the background task include
running continuous functions, such as communications and clean-up routines.

Trigonometric Math Unit (TMU)


The TMU is an extension of the FPU and enhances the instruction set of the CPU+FPU
by efficiently executing trigonometric and arithmetic operations that are commonly used
in control system applications. Similar to the FPU, the TMU is an IEEE-754 floating-
point math unit tightly coupled with the CPU. However, where the FPU provides general-
purpose floating-point math support, the TMU focuses on accelerating several specific
trigonometric math operations that would otherwise be quite cycle-intensive. These oper-
ations include sine, cosine, arctangent, divide, and square root.
The TMU can have a significant impact on many commonly used real-time control algo-
rithms such as:
• Park and Inverse Park Transforms.
• Space Vector Generation.
• dq0 and Inverse dq0 Transforms.
• FFT Magnitude and Phase Calculations.

For example, a Park Transform typically takes anywhere from 80 to more than 100 cycles
to execute on the FPU. With the TMU a Park Transform takes only 13 cycles, yielding an
85 percent improvement as compared to without the TMU.
In a typical system application, such as digital motor control (AC induction and perma-
nent magnet) and 3-phase solar applications, about a 1.4 times performance improvement
can be achieved using the TMU over just the FPU.

Fast Integer Division Unit (FINTDIV)


The FINTDIV extended instruction set optimally supports fast division operations com-
monly found in adaptive control systems for scaling parameters based on a variable. All
instructions execute in a single cycle and three types of integer division are supported
(Truncated, Modulus, Euclidean) of varying data type sizes (16/16, 32/16, 32/32, 64/32,
64/64) in unsigned or signed formats.
References
[Blanco et al. 2021] Blanco, M., Ramirez, D., Zarei, M. E., and Gupta, M. (2021). Dual
multivector model predictive control for the power converters of a floating owc wec.
International Journal of Electrical Power & Energy Systems, 133:107263.

[Boldea 1997] Boldea, I. (1997). Reluctance synchronous machines and drives, vol-
ume 34. Oxford Science Publications.

[Bürkel et al. 2003] Bürkel, R., Huber, H., and Rollier, S. (2003). Asic based closed-loop
transducers from 6 a up to 25 a nominal.

[Chassaing 1998] Chassaing, R. (1998). Digital Signal Processing: Laboratory Experi-


ments Using C and the TMS320C31 DSK. John Wiley & Sons Inc.

[de Castro et al. 2011] de Castro, R., Araujo, R. E., and Freitas, D. (2011). FPGA Based
Powertrain Control for Electric Vehicles. IntechOpen.

[Huynh and Hsieh 2017] Huynh, T. A. and Hsieh, M. F. (2017). Comparative study of
pm-assisted synrm and ipmsm on constant power speed range for ev applications. IEEE
Transactions on Magnetics, 53.

[Incorporated 2020] Incorporated, T. I. (2020). Tms320x2833x, tms320x2823x technical


reference manual.

[Isaac et al. 1999] Isaac, F. N., Arkadan, A. A., and El-Antably, A. (1999). Character-
ization of axially laminated anisotropic-rotor synchronous reluctance motors. IEEE
Transactions on Energy Conversion, 14.

[Jahns et al. 1986] Jahns, T. M., Kliman, G. B., and Neumann, T. W. (1986). Interior
permanent-magnet synchronous motors for adjustable-speed drives. IEEE Transac-
tions on Industry Applications, IA-22.

[Kim et al. 2020] Kim, H., Park, Y., Liu, H.-C., Han, P.-W., and Lee, J. (2020). Study on
line-start permanent magnet assistance synchronous reluctance motor for improving
efficiency and power factor.

[Kim 2017] Kim, S. H. (2017). Electric Motor Control: DC, AC, and BLDC Motors.

[Kouro et al. 2009] Kouro, S., Cortés, P., Vargas, R., Ammann, U., and Rodríguez, J.
(2009). Model predictive control - a simple and powerful method to control power
converters. IEEE Transactions on Industrial Electronics, 56.

[Leonhard 2001] Leonhard, W. (2001). Control of Induction Motor Drives. Springer,


Berlin, Heidelberg, 3rd. edition.

[Lipo 1991] Lipo, T. A. (1991). Synchronous reluctance machines-a viable alternative


for ac drives? Electric Machines and Power Systems, 19.

[Melkebeek 2018] Melkebeek, J. A. (2018). Electrical machines and drives: Fundamen-


tals and advanced modelling. Springer International Publishing AG, 1st edition.
[Microchip 2007] Microchip (2007). Sensorless field oriented control for permanent
magnet synchronous motors.

[Mohan 2014] Mohan, N. (2014). Advanced Electric Drives: Analysis, Control, and
Modeling Using MATLAB/Simulink, volume 9781118485.

[Mohan et al. 1995] Mohan, N., Undeland, T. M., and Robbins, W. P. (1995). Power
Electronics: Converters, Applications, and Design. Jhon Wiley & Sons, Inc.

[Nasar et al. 1993] Nasar, S. A., Boldea, I., and Unnewehr, L. E. (1993). Permanent
Magnet, Reluctance, and Self-Synchronous Motors. CRC Press, Inc.

[Novotny and Lipo 1996] Novotny, D. W. and Lipo, T. A. (1996). Vector Control and
Dynamics of AC Drives. Clarendon Press.

[Pyrhöonen et al. 2016] Pyrhöonen, J., Hrabovcová, V., and Semken, S. (2016). Electri-
cal Machine Drives Control: An Introduction. John Wiley & Sons Ltd.

[Ramirez et al. 2015] Ramirez, D., Herrero, L. C., de Pablo, S., and Martinez, F. (2015).
Statcom control strategies bt - static compensators (statcoms) in power systems.

[Rodriguez and Cortes 2012] Rodriguez, J. and Cortes, P. (2012). Predictive Control of
Power Converters and Electrical Drives.

[Rodriguez et al. 2013] Rodriguez, J., Kazmierkowski, M. P., Espinoza, J. R., Zanchetta,
P., Abu-Rub, H., Young, H. A., and Rojas, C. A. (2013). State of the art of finite control
set model predictive control in power electronics. IEEE Transactions on Industrial
Informatics, 9:1003–1016.

[Rodríguez et al. 2007] Rodríguez, J., Pont, J., Silva, C. A., Correa, P., Lezena, P., Cortés,
P., and Ammann, U. (2007). Predictive current control of a voltage source inverter.
IEEE Transactions on Industrial Electronics, 54.

[Schachter 2020] Schachter, K. W. (2020). Enhancing the computational performance of


the c2000 microcontroller family (spry288c).

[Wang et al. 2014] Wang, D., Lu, K., and Rasmussen, P. O. (2014). A general and intu-
itive approach to understand and compare the torque production capability of ac ma-
chines.

[Yazdani and Iravani 2010] Yazdani, A. and Iravani, R. (2010). Voltage-Sourced Con-
verters in Power Systems.

[Zarei et al. 2020] Zarei, M. E., Ramirez, D., Veganzones, C., and Rodriguez, J. (2020).
Predictive direct control of spms generators applied to the machine side converter of
an owc power plant. IEEE Transactions on Power Electronics, 35:6719–6731.

[Zhang et al. 2017] Zhang, X., Hou, B., and Mei, Y. (2017). Deadbeat predictive current
control of permanent-magnet synchronous motors with stator current and disturbance
observer. IEEE Transactions on Power Electronics, 32:3818–3834.
[Zhao et al. 2018] Zhao, W., Shen, H., Lipo, T. A., and Wang, X. (2018). A new hybrid
permanent magnet synchronous reluctance machine with axially sandwiched magnets
for performance improvement. IEEE Transactions on Energy Conversion, 33.

[Zhao et al. 2017] Zhao, W., Xing, F., Wang, X., Lipo, T. A., and Kwon, B. I. (2017). De-
sign and analysis of a novel pm-assisted synchronous reluctance machine with axially
integrated magnets by the finite-element method. IEEE Transactions on Magnetics,
53.

You might also like