Current Control in A CCCA Converter Via Microcontroller
Current Control in A CCCA Converter Via Microcontroller
Current Control in A CCCA Converter Via Microcontroller
Bachelor Thesis
Author:
Jorge Suárez Porras
Supervisor:
Aurelio García Cerrada
Madrid
January 2020
The current energy system for the production, distribution and consumption of
electricity from power plants mainly uses non-renewable resources as raw mate-
rials. These plants produce and distribute energy in alternating current through
a complex mesh that interconnects consumers and producers. The control in the
production and management of energy in these non-renewable systems is widely
extended and is widely known, so its control is, today, safe. However, there is a
strong trend towards obtaining energy from renewable raw materials, such as solar,
hydraulic, wave energy, wind energy ... etc. These new energy sources are being
implemented in the form of microgrids (micro-grids) [1], so that they can meet
certain demands for electrical energy locally, for example, to industrial complexes,
residential neighborhoods, hospitals ... etc [2]. Since they are directly connected to
the large distribution network, the operating modes are severely restricted based on
the state of the network. For this reason, if the distribution network stops supplying
power to consumers, these renewable sources of energy are disconnected from the
network for safety reasons[3], and do not help to alleviate the incident. Further
development of better technologies for these connections with the distribution net-
work, together with development of batteries and energy storage, will significantly
help to establish more renewable sources of energy in the electric system, making
it gradually, evolve to a more ecological, efficient and green energy model. One of
the main technologies used to carry out a connection of renewable energy sources to
the large distribution network are the electronic power converters DC - AC voltage
source (or Voltage Source Converter and Current Source Converter
Given the nature of the project (intended for teaching), the low voltages that
are operated and due to the ease of handling and programming of the control and
its subsequent implementation, it was decided to use a VSC that has GaN MOS-
FETS as a particularity. Gallium nitride or GaN is currently used [4] for circuit
breakers intended for certain applications [5]. These switches fall within the so-
called “forbidden band ” or “ broadband ” (wide-bandgap semiconductors or WBG
semiconductors) and with them it is intended to improve the switching frecuency
(increasing it), reduce conduction losses and achieve higher blocking voltages than
those obtained with Si (Silicon) switches (which is theoretically limited to about
6.5kV) [6]. In this document, first of all, it will be described what is the main objec-
I
tive of the project. The mathematical approach used to control VSCs is discussed
below. Next, the fundamentals of this type of converters will be described; what
they are, how they are used and controlled, what they are made of ... etc. Later,
the electronic converter that has been used in the project will be shown, as well as
the microcontroller and the components that have been used to build the prototype.
Finally, a series of controls will be studied, showing simulations in continuous and
discrete times, and their experimental validation in the prototype.
Keywords
Inverter, VSC, Current Control, Park Transform, LAUNCHPADXL - F28379D,
TMS320F28379D, BOOSTXL - 3PhGaNInv.
II
Contents
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I
Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . II
1 Introduction 1
1.1 Project Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 Device Control 23
4.1 System equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Three-phase variables and reference systems . . . . . . . . . . . . . . 25
4.3 Model in d-q axes of a three-phase inductance . . . . . . . . . . . . . 29
4.4 Base Magnitudes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
III
7 Experimental Results 99
8 Budget 108
8.1 Materials Budget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
8.2 Labor Budget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
8.3 Total Budget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Bibliography 110
C Files 128
IV
List of Figures
2.1 Schematic of a three-phase VSC. Vdc is the direct input voltage, Va0,
Vb0 and Vc0 are the alternating output voltages. . . . . . . . . . . . 3
2.2 PWM generation by comparing with a triangular [11] . . . . . . . . 4
2.3 Space Vector Voltages [10] . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Diagram of a MOSFET transistor a) channel n and b) channel p. [13] 5
2.5 a) Diagram of a channel n and b) MOSFET transistor Diagram of a
channel MOSFET transistor. [13] . . . . . . . . . . . . . . . . . . . . 6
2.6 Diagram of a BJT transistor in direct conduction [15] . . . . . . . . 6
2.7 IGBT diagram as a a) BJT b) MOSFET . . . . . . . . . . . . . . . . 7
2.8 Conduction band of semiconductor materials [13]. . . . . . . . . . . . 8
2.9 Hypothetical short circuit of phase A. . . . . . . . . . . . . . . . . . 8
2.10 On and off time of a semiconductor . . . . . . . . . . . . . . . . . . . 9
2.11 Time when a branch is short-circuited. . . . . . . . . . . . . . . . . . 9
2.12 Analog circuit made to satisfy the required dead time. . . . . . . . . 10
2.13 Service factor definition . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.14 Scheme of a VSC feeding a load. Vdc is the controllable DC input
voltage. T1 to T6 are the switches triggered with the microprocessor.
Va0, Vb0 and Vc0 are the alternating output voltages and ia, ib and
ic the currents through the load. L and R is the load that is fed. . . 12
2.15 Prototype functional diagram. . . . . . . . . . . . . . . . . . . . . . . 13
2.16 Synchronization of the ADC with PWM with a single shot per cycle. 14
2.17 ADC synchronization with PWM with double shot per cycle. . . . . 15
V
3.9 Filter LC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.10 Filter LCL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.11 Scheme of three-phase inverter with RL load. . . . . . . . . . . . . . 22
4.1 Circuit vector scheme. Va0, Vb0 and Vc0 are the inverter output
voltages. Va, Vb and Vc the voltages determined by the control and
ia, ib and ic the measured currents. . . . . . . . . . . . . . . . . . . . 23
4.2 Clarke transformation. . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3 Transformada de Park. . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4 Current control diagram in d-q axes [25] . . . . . . . . . . . . . . . . 29
VI
5.19 Open-loop response with constant phase margin with PI control in
continuous time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.20 Open-loop response with constant crossover pulsation with continuous-
time PI control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.21 Configuration applied to the simulator with a PI Control. Identical
to the one used in the simulator. The development is described in
Appendix B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.22 Scope of a simulator with a PI control. The PID block is implemented
in discrete time. It can be observed in the jumps that occur in the
dq axes when their reference is zero, that the variations in the q axis
are disturbances in the d axis and vice versa. The simulation control
values are listed in Table 5.4 . . . . . . . . . . . . . . . . . . . . . . . 55
5.23 d-axis current reference tracking error plot with a PI Control. Hard-
ware implementation. The axis values are scaled to 0.1 of the actual
value in pu. It is observed that the coil saturates for values higher
than 3pu (Approx. 6.1A). . . . . . . . . . . . . . . . . . . . . . . . . 57
VII
6.24 Conjunto LaunchPad con VSC con la conexión en la parte inferior.
Vista lateral. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.25 Conjunto LaunchPad con VSC con la conexión en la parte inferior.
Vista en perspectiva. . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.26 Encapsulated VSC and Launchpad. DC voltage input. . . . . . . . . 77
6.27 Encapsulated VSC and Launchpad. AC voltage outputs and USB
connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.28 Encapsulated VSC and Launchpad. Oscilloscope pins. . . . . . . . . 79
6.29 Simulink ePWM block. TI C2000 library. . . . . . . . . . . . . . . . 80
6.30 PWM generation form options in Simulink’s ePWM block [47] . . . 82
6.31 Simulink ePWM block. TI C2000 library. . . . . . . . . . . . . . . . 83
6.32 Diagram of the PWM nomenclature in Simulink for the VSC con-
nected to the LaunchPad at the bottom (Section 6.2.2). . . . . . . . 84
6.33 ePWMxA configuration. . . . . . . . . . . . . . . . . . . . . . . . . 85
6.34 Final appearance of the ePWM Block. The input is the duty cycle
in seconds or in clock cycles. . . . . . . . . . . . . . . . . . . . . . . 85
6.35 Counter Compare configuration tab. . . . . . . . . . . . . . . . . . . 86
6.36 ePWMxB Configuration. . . . . . . . . . . . . . . . . . . . . . . . . 86
6.37 ePWMxB configuration from DeadBand Unit tab. . . . . . . . . . . 87
6.38 Configuration of ADC startup synchronized with ePWM. . . . . . . 87
6.39 VSC PWM enable configuration. . . . . . . . . . . . . . . . . . . . . 88
6.40 ePWMB tab configuration to obtain signals by PWM. . . . . . . . . 89
6.41 Configuration tab Counter Compare to obtain signals by PWM. Coun-
ters CMPA and CMPB. . . . . . . . . . . . . . . . . . . . . . . . . . 89
6.42 Configuration tab Counter Compare to obtain signals by PWM. Coun-
ters CMPA and CMPB. . . . . . . . . . . . . . . . . . . . . . . . . . 90
6.43 Deadband Unit tab configuration to obtain signals through PWM. . 90
6.44 Final appearance of the ePWM Block to obtain signals. The input
signals are the duty cycle. . . . . . . . . . . . . . . . . . . . . . . . . 90
6.45 Simulink ADC block. TI C2000 Library. . . . . . . . . . . . . . . . . 91
6.46 ADC Block Configuration. . . . . . . . . . . . . . . . . . . . . . . . . 92
6.47 DAC simulink block. TI C2000 Library. . . . . . . . . . . . . . . . . 93
6.48 Difference in PWM - DAC output measurements. . . . . . . . . . . . 94
6.49 Current through one phase, output through the DAC, through the
PWM and measured with a current clamp. . . . . . . . . . . . . . . 94
6.50 Block diagram to obtain a signal through the DAC or PWM. Actual
1.5V average value may vary. . . . . . . . . . . . . . . . . . . . . . . 95
6.51 Saturated signal through DAC output port. . . . . . . . . . . . . . . 96
6.52 Solver tab configuration for prototype implementation. . . . . . . . . 97
6.53 Hardware Implementation configuration tab for prototype implemen-
tation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
VIII
7.2 Three-phase currents through the coils. The identification of the
signals is shown in detail in the figure. See table 7.1. . . . . . . . . . 100
7.3 Three-phase currents through the saturated coils. . . . . . . . . . . . 101
7.4 Three-phase currents through the inductances with d-axis reference
current in the form of pulses. Reference Iq = 0. The identification
of the signals is shown in detail in the figure. . . . . . . . . . . . . . 102
7.5 Three-phase currents through the inductances with d-axis current
reference in sinusoidal shape of 4Hz frequency. The identification of
the signals are shown in detail in the figure. Iq reference = 0. . . . . 103
7.6 Detail of the three-phase currents through the coils with a 4Hz fre-
quency sinusoidal d-axis current reference. The identification of the
signals are shown in detail in the figure. Iq reference = 0. . . . . . . 104
7.7 Three-phase currents through the inductances. Time response of d-
axis and q-axis current. Application of references simultaneously.
The identification of the signals are shown in detail in the figure. . . 105
7.8 Three-phase currents through the inductanced. Time response of d-
axis and q-axis current inversely applied. The identification of the
signals are shown in detail in the figure. . . . . . . . . . . . . . . . . 106
7.9 Three-phase currents through the inductances. Time response of q-
axis current. Id reference = 0. The identification of the signals are
shown in detail in the figure. . . . . . . . . . . . . . . . . . . . . . . 107
IX
Chapter 1
Introduction
1
system. This implementation must be done, nowadays, through electronic power
converters. Any advance, analysis, design, test or development that contributes
to the understanding of these systems will facilitate this necessary transition of
the energy model. This project has been written having in mind that, as Carl
Sagan says in The Demon-Haunted World [7], “the method of science, as stodgy
and grumpy as it may seem, is far more important than the findings of science.”.
1.2 Objectives
The objective of this project is to carry out a closed-loop current control of a
three-phase inductance to illustrate the connection of a VSC (Voltage Source Con-
verter) to the electrical network in the application of renewable energies. The result
obtained in this project is intended to be used for teaching in various subjects re-
lated to undergraduate and master’s power electronics at the Universidad Pontificia
Comillas.
2
Chapter 2
The voltage source converters are power electronic devices, which are based on the
switching of power semiconductor devices, which transform a direct input voltage
into an alternating output voltage.
Electronic voltage source power converters allow, if the input has a variable
voltage, at the output a variable voltage can be obtained through the system gain.
However, if there is a constant voltage at the input, a variable voltage can also be
obtained at the output if the VSC is controlled by pulse width modulation [8], being
this a DC-AC converter such as developed in this project.
The basic scheme of the system is shown in Fig. 2.1.
Figure 2.1: Schematic of a three-phase VSC. Vdc is the direct input voltage, Va0,
Vb0 and Vc0 are the alternating output voltages.
3
2.1 Brief description of the PWM
The VSC control technique by means of pulse width modulation (PWM), allows
obtaining a voltage whose fundamental harmonic will be of variable amplitude (al-
ternating), starting from a fixed input voltage (continuous). A PWM output con-
sists of pulses of switching frequency and fixed magnitude, but variable pulse width
[9]. However, there are cases in which the switching frequency can be variable, as in
the mitigation of audible noise in certain power electronics applications. A PWM
output can be generated by two main techniques, comparison of a sinusoidal with
a triangular one, as in Fig. 2.2 and by means of PWM in spatial vectors (Space
Vector Pulse Width Modulation or SVPWM ), represented in Fig. 2.3. This last
technique, SVPWM, is adapted to the switching of power transistors (see Section
2.2), depending on the load to which the VSC [10] is connected.
4
2.2 Power Transistors
Power transistors are switches that can be turned on (shorted) or off (open circuit)
using a control signal. Nowadays, given the great evolution of these devices in the
industry, switching between the active and inactive states at speeds much higher
frequencies is easier than before, which facilitates the incorporation of transistors in
electronic converters of power DC - AC, as well as AC - CC [8]. Three of the major
groups into which the vast world of power transistors can be divided are described
below.
In the event that the substrate is not accessible (and this always happens in
power electronics), Fig. 2.5 shows its symbology.
5
Figure 2.5: a) Diagram of a channel n and b) MOSFET transistor Diagram of a
channel MOSFET transistor. [13]
[14]. In Fig. 2.6 [15] a transistor of this type is shown in direct conduction. A BJT
transistor needs current in B as long as it has to be active (conducting).
BJTs were popular in DC-AC converters in the 1975-1985 decade, but have
been superseded by MOSFETs in low-voltage, low-medium power applications or
by IGBTs in medium-high voltage and medium-high power applications, or by other
switches in very high voltage and power applications [8].
6
IGBTs than in MOSFETs. An IGBT transistor has a high input impedance and low
conduction losses when active [14]. By behaving in a similar way to a combination
between a BJT and a MOSFET, its representation can be made as BJT (Fig. 2.7-a)
or as MOSFET (Fig. 2.7-b) .
7
Figure 2.8: Conduction band of semiconductor materials [13].
Therefore, since the switches do not turn on and off instantaneously, the turning
on of each switch in each branch must be delayed, so that the complementary
8
semiconductor has time to completely turn off, as can be seen in Fig. 2.11. This
prevents two switches on the same branch conducting simultaneously. This effect is
called dead time
9
2.2.6 Analog Method
Analogously, the phase shift necessary to cover the Dead Time described in Section
2.2.5, can be carried out by means of a simple analog circuit as shown in Fig. 2.12.
Figure 2.12: Analog circuit made to satisfy the required dead time.
10
Figure 2.13: Service factor definition
D = ton /T (2.1)
With:
11
Figure 2.14: Scheme of a VSC feeding a load. Vdc is the controllable DC input
voltage. T1 to T6 are the switches triggered with the microprocessor. Va0, Vb0
and Vc0 are the alternating output voltages and ia, ib and ic the currents through
the load. L and R is the load that is fed.
12
Figure 2.15: Prototype functional diagram.
13
Figure 2.16: Synchronization of the ADC with PWM with a single shot per cycle.
14
Figure 2.17: ADC synchronization with PWM with double shot per cycle.
15
Chapter 3
Connection of electronic
voltage converters to the grid
The grid-feeding format is used to control the power that circulate through the
grid, consuming or generating active or reactive power, in a fixed or variable way
[19]. It must be perfectly synchronized with the local network to which is desired
to connect [21]. It is modelled as a current source connected in parallel with a large
impedance, Fig. 3.2.
Finally, the grid-supporting format can control the frequency and amplitude of
the output voltage, using a model based on an AC voltage source in series with an
16
Figure 3.2: VSC connected in grid-feeding format [22]
impedance, as shown in Fig. 3.3, or control the power of the network by modeling
a current source in parallel with a load, as shown in Fig. 3.4. The grid-supporting
format consists of acting either on the injected or consumed power using the grid
voltage and frequency measurements (grid-supporting-feeding), or on the voltage
and frequency based on the active and reactive power measurements of the net-
work (grid-supporting-forming) [23]. Active power is strongly related to the grid
frequency, while reactive power is related to the voltage profile [24].
17
Figure 3.4: Diagram of a converter in grid-supporting-feeding format with current
source model [23].
18
3.1 Grid synchronization
The synchronization of the DC - AC electronic converters with the network is es-
sential for their correct operation. This synchronization depends primarily on the
VSC operating format. When the VSC is connected to the grid, the operating fre-
quency is determined by the grid frequency, instead, operating in island or isolated
mode, the operating frequency will be a reference imposed by the VSC operator. In
case of being connected to the network, the synchronization is done through a syn-
chronization block PLL [19] (Phase-Locked Loop), see Fig. 3.5. This block consists
of a sinusoidal reference follower, which reproduces the frequency of the electrical
network at the output, in Fig. 3.5, the angle θ. It can seen in Fig. 3.6 how a PLL
would be used in a VSC, operating in grid-forming format [20], [25].
19
Figure 3.7: MSRF-PLL linearized model [27].
20
3.2 Some simple filters
Today there is a strong trend in the application of VSC when integrating renewable
energy sources to the electrical system, which operates in alternating magnitudes.
Such connection to the electrical network requires the implementation of filters to
be able to generate triphasic waves that are synchronized with the network and
that suppress the harmonics [28]. Filters range from the simplest such as L, LC
and LCL filters [20], [29], [30], to filters of much greater complexity. In the present
prototype an L filter will be used. Furthermore, it will be merely experimental,
without connecting the converter to the electrical network.
However, the use of VSC is also extended to the control of electric motors, which,
due to their construction, are strongly inductive loads. This makes it unnecessary
to install filters at the VSC outlet in many occasions.
The modeling of the electrical network is carried out assuming that it is equiv-
alent to a three-phase load. The application of connecting the VSC to the network
does require the use of filters, the ones listed below being the simplest,
1. Filter L. When supplying a passive load with a filter L like the one in Fig. 3.8
at the inverter output, the current through each of the phases is controlled.
2. Filter LC. When supplying a passive load with an LC filter like the one in
Fig. 3.9 at the inverter output, the three-phase voltage that supplies the load
is controlled.
3. Filter LCL. When feeding a passive load with an LCL filter like the one in
Fig. 3.10 at the inverter output, the current of each of the phases flowing
through the coil connected to the load is controlled. [31], [32].
The prototypes will be as can be seen in Fig. 3.11. The series resistance displayed
in each phase represents the resistance of the coil wire.
21
Figure 3.9: Filter LC.
22
Chapter 4
Device Control
Figure 4.1: Circuit vector scheme. Va0, Vb0 and Vc0 are the inverter output
voltages. Va, Vb and Vc the voltages determined by the control and ia, ib and ic
the measured currents.
The control to be designed will calculate the voltage to be applied to the load,
in Fig. 4.1, the voltages Va , Vb and Vc . In (4.1) the system equations is shown. In
them, Va0 , Vb0 and Vc0 are the output voltages of the VSC.
23
Va0 = Va + VN 0 → Va = Va0 − VN 0
Vb0 = Vb + VN 0 → Vb = Vb0 − VN 0 (4.1)
Vc0 = Vc + VN 0 → Vc = Vc0 − VN 0
Va = L · di
dt + R · ia
a
Vb = L · di
dt + R · ib
b
(4.4)
Vc = L · di
dt + R · ic
c
Va + Vb + Vc = 0 (4.5)
1 Obtained from the notes of the Power Electronics Applications course. Last access:
12/18/2018. Accessible to students enrolled in the subject at the Universidad Pontificia de Comil-
las.
24
And substituting and operating (4.7) in (4.6):
1 ma · Vdc ma · Vdc
VN 0 = · (3 · )= (4.8)
3 2 2
Being:
1. vi the voltage of phase i at a given instant of time.
2. V̂i phase i peak voltage.
The base change matrix that results from Fig. 4.2, again ignoring the zero
sequence component, is
25
Figure 4.2: Clarke transformation.
cos(0) cos(2π/3) cos(−2π/3)
Ca,b,c→α,β = (4.11)
sin(0) sin(2π/3) sin(−2π/3)
1 −1/2 −1/2
Ca,b,c→α,β = p p (4.12)
0 (3)/2 − (3)/2
1 p0
t
Ca,b,c→α,β = Cα,β→a,b,c = −1/2 p(3)/2
(4.13)
−1/2 − (3)/2
26
Figure 4.3: Transformada de Park.
be fixed, an angle θ, or, if the rotation is constant, the axes can rotate at angular
speed ω. The graphical representation can be seen in Fig. 4.3.
The Park transformation that translates the orthonormal axes α, β to axes dq
can be expressed in the forms
ud cos(θ) sin(θ) uα
= (4.14)
uq − sin(θ) cos(θ) uβ
ud cos(ωt) sin(ωt) uα
= (4.15)
uq − sin(ωt) cos(ωt) uβ
And the step matrix that relates the initial coplanar axes A, B and C with the new
axes d, q is:
cos(ωt) sin(ωt)
Pa,b,c→d,q = Ca,b,c→α,β (4.16)
− sin(ωt) cos(ωt)
27
And substituting (4.12) into (4.16)
Since the coplanar vectors in A, B , C may not have the same magnitude as
in the dq axes, a homothecy is applied to (4.17), also including the component
homopolar:
With:
−1 (Adj(Pa,b,c→d,q ))t
Pd,q→a,b,c = Pa,b,c→d,q,0 = (4.19)
|Pa,b,c→d,q |
More representative, transforming a vector (xa , xb , xc ) into one (xd , xq , x0 ) would
be of the form:
2
( 23 ) cos(ωt − 2π/3) ( 23 ) cos(ωt + 2π/3)
xd ( 3 ) cos(ωt) xa
3 3 3 (4.20)
xq = K −( 2 ) sin(ωt) −( 2 ) sin(ωt − 2π/3) −( 2 ) sin(ωt + 2π/3) xb
x0 a a a xc
In this way, having the previous matrices, three-phase models can be written in
a simple way in only two Cartesian coordinates (omitting the homopolar sequence).
Thus, a vector that rotates at a constant speed around a fixed point in a static
coordinate system can be converted into a fixed vector in another reference system
that rotates at said constant speed around the same fixed point.
The prototype that is designed and manufactured in this project is the one that
consists of a VSC connected to a three-phase coil. The variable to control will be
28
the current through the phases, which, taken to axes d − q, consists of the control
of the variables id and iq , thus making a current control design [36].
With the power-invariant Park transform, the instantaneous active and reactive
powers are [37]:
p = vd · id + vq · iq (4.21)
q = vd · iq − vq · id (4.22)
Let (4.23) be the equation that governs the behavior of the coil voltages on the
abc axes. va , vb and vc being the voltages to which the coils are subjected in each
29
phase.
va ia ia
vb = R · ib + L · d ib (4.23)
dt
vc ic ic
Applying the transformation matrix (4.19), results (4.24) (for simplicity Pd,q→a,b,c =
P)
vd id id
d
P · vq = R · P · iq + L · P · iq (4.24)
dt
v0 i0 i0
ac clearing voltage matrices in (4.24):
vd id id
d
−1
|P {z· P} · vq
= P −1 · R · P · iq + P −1 · L · P · iq (4.25)
dt
I33 v0 i0 i0
Operating the matrix operations and solving the voltages in (4.25):
d(L·i )
vd = R · id + dt d − ω1 · L · iq
(4.26)
d(L·iq )
vq = R · iq + dt + ω1 · L · id
The equations of (4.26) can be written in values per unit, defining:
v i
vpu = Ub , ipu = Ib , Sb = 3Ub Ib
U2
Lpu = LLb , Rpu = ZRb , Zb = 3 Sbb (4.27)
Z =L ω , ω ω1
b b b 1,pu = ωb
So the voltage equations of the inductance and series resistance are obtained in
the following values per unit:
d(Lpu ·id,pu )
ωb · vd,pu = ωb · (Rpu · id,pu ) + dt − ωb (ω1 · Lpu · iq,pu )
(4.28)
d(Lpu ·iq,pu )
ωb · vq,pu = ωb · (Rpu · iq,pu ) + dt + ωb (ω1 · Lpu · id,pu )
Observing the behavior of (4.26), it is verified that in the transient regime,
the magnitudes of axes d and q are influenced by each other. However, in steady
state the d axis components only depend on the q axis components and the q axis
components only depend on the d axis components [39].
vd = −ω1 · L · iq (4.29)
vq = ω1 · L · id (4.30)
30
4.4 Base Magnitudes
It is necessary to determine a series of base electrical quantities, since later on, a
PID regulator will be designed both in continuous time and in discrete time. Using
the technical documentation of the [40] components, we know that the nominal
voltage of the inverter, at its direct voltage input, is Vdc = 48V . The maximum
current of the VSC is Imax
inverter
= 10A. The inductances admit a maximum current
of Imax = 5A. The inductance of the coils (per phase) are L = 5.881mH. The
L
Vdc = 48V
Vb = Vp−p = 29.28V
Ib = 2.5A
p
Sb = (3) · Vb · Ib
Vb
Zb =
Ib
ωb = 2 · π · f = 2 · π · 50
Zb
Lb =
ωb
31
Chapter 5
Controls on variables have been used for centuries to control all kinds of variables.
The first controls were carried out in an analog way, using mechanisms [41]. Today,
the vast majority of controls are implemented digitally. The implementation of a
control digitally requires a computer (or microcomputer) to perform all the perti-
nent operations. (See Section 6.1). There are many types of variable controls, from
proportional, integral, and differential (PID) controls, or state-space controls, using
state feedback to more complex control topologies.
In this project, a PI control will be carried out on the current of the inductances,
however, it is possible to carry out complete PID controls [36], even though these
systems can be very noisy due to the commutation of the semiconductors (harmful
using a differential control). The design of a PI control in a rotational axis system
d − q provides a null error in permanent regime in reference tracking [31] under
constant disturbances.
The transfer function between reference (R) and output (Y ) of every system is
defined as in (5.1) in continuous time using the Laplace variable (s).
R(s)
F (s) = (5.1)
Y (s)
Let be the block diagram of a continuous time system represented in Fig. 5.1, in
which, the designed control is C(s), the plant of the system is P (s) and the feedback
is H(s). Likewise:
• r(t): is the reference signal of the control.
32
• e(t): is the error between the measurement of the output (ym (t)) and the
output (y(t)).
The transfer function between reference and open-loop output is called G(s), see
(5.2). While the transfer function between reference and output in closed loop is
called F (s), see (5.3).
P (s)
F (s) = C(s) · (5.3)
1 + G(s)
The design of PID controls is done by temporal response or frequency response.
The response of both controls depending on the values of the parameters of the
designed control. Among the main questions to take into account will be, regarding
its temporal response for a PI control, analyzing its response to a step in reference
in closed loop:
• Tracking error.
• Overshoot.
And regarding its frequency response, analyzing the open-loop Black diagram:
• Gain margin.
• Oscillating pulsation.
33
The frequency response design is related to its temporal response by:
34
Figure 5.3: Block diagram of a PI control in parallel format.
µ=1
K = µ · Kp
Ti = µ · I
Obtaining the transfer functions in open loop and closed loop between reference
and output will be carried out by executing a simulink file, represented in Fig.
5.4, in which a simulink model will be implemented a coupling and decoupling of
the inductances in dq axes. In this way, when executing the Matlab script that
compiles the simulink file, the transfer functions in said axes will be obtained, as
well as the plant in continuous time. However, it is necessary to determine some
base quantities (see Section 4.4) for the components, such as inductances, resistors,
voltages, currents, etc.
35
Figure 5.4: Simulink to obtain the plant in continuous time.
36
5.1.1 Design of a PI control in discrete time
The design of a PI control in discrete time can be done in different ways:
• Through the discretization of a control in continuous time.
37
The discretization method used will be that of the derivative in advance of the
integral (forward Euler), whose definition is shown in (5.7) 1 , where k represents
the current moment and k − 1 the moment a sampling period (Ts ) behind.
Z k·Ts Z (k−1)·Ts
y[k] = u(τ ) dτ ' u(τ ) dτ + u · [k − 1] · Ts (5.7)
0 0
Being,
Z (k−1)·Ts
u(τ ) dτ = y · [k − 1] (5.8)
0
And applying the Z transform results in the equality of the equation,
1 z −1 · Ts Ts
= = (5.9)
s 1 − z −1 z−1
In this way, the applied control, using (5.9), we discretize the control in z.
Determining the sampling period is not trivial, since, as explained in Section
2.4.1, the sampling period needs to be greater than the period of a PWM cycle.
Therefore, if we want the inverter to commute at a frequency fc , that is, for the
commutation period to be Tc = f1c , the sampling period must be:
Ts = k · Tc (5.10)
To avoid unwanted effects in the sampling, working below the nyquist frequency,
thus avoiding aliasing, we will calculate the sampling period of (5.10) with k = 3, so
that the ADC starts the conversion of values every three periods of PWM switching,
therefore we will have that the sampling period will be,
1 1
Ts = k · Tc = 3 · =3· = 0.3ms (5.11)
fc 10kHz
Considering therefore a sampling period of Ts = 0.3ms and a crossover pulse of
ωo = 500rad/s (used in the simulations, this value may be different),
1 Obtained from the notes of the Digital Control course. Last access: 06/20/2019. Material
accessible to students enrolled in the subject of Digital Control at the Universidad Pontificia de
Comillas.
38
The application of (5.9) to the transfer function in continuous time of the PI
control developed in Section 5.1, that is to say, discretizing the control of (5.5 ) on
page 35, results:
z−1 Ts
I+ Ts I+ z−1
C(z) = Kp · z−1 = Kp · (5.12)
I· Ts
I
The Simulink block that allows the software and hardware implementation of
the PID control is shown in Fig. 5.6. Such figure shows how the value of the integral
has to be entered in such a way that it responds to the behavior of the equations
described above.
• Outputs of the scopes. Both in the format of theoretical quantities and those
that would be obtained by the oscilloscope when executing the program on
the LaunchPad.
39
• References in d and q axes.
In this simulator, the base quantities described in Section 4.4 have been introduced.
The way to enter the options described above is done through an interface (identical
to the one used for the hardware in the prototype) such as those shown in Fig. 5.7.
Figure 5.7: Interface for simulator configuration. Identical to that used in the
prototype hardware. The development is described in Appendix B
The configuration of the Simulink parameters will be done as shown in Fig. 5.8.
It should be noted that for the simulation to run correctly, the value of the
Fixed Step must necessarily be a value smaller than the shortest period the system
has and must be a sub-multiple divisor of its own. Since the smallest period is the
switching period, of 1e−4s, the Fixed Step time that simulates the system correctly,
with a good quality in the outputs, with a reasonable simulation time, of 1e − 6s.
40
Figure 5.8: Simulator parameter settings.
41
5.3 P Control
5.3.1 Design of a control P. Continuous time.
The design equations of a continuous time P control by frequency response are
described below.
ω0 = −180 + φm − ∠P (5.13)
1
K = (5.14)
|P (ω0 )|
(5.15)
Testing different values for the phase margin of (5.14), we obtain the different
temporal and stability responses in open loop of Fig. 5.9, 5.10 and 5.11.
Figure 5.9: Time response of the d axis of a P Control in continuous time. Id pulse
= 1 in 0.3s. Pulse of Iq = 1 in 0.8s.
The results of the phase and profit margins are shown in Table5.1:
42
Figure 5.10: Time response of the q axis of a P Control in continuous time. Pulse
of Id = 1 in 0.3s. Pulse of Iq = 1 in 0.8s.
43
Phase Margin (φm ) Crossover Pulsation(ω0 ) P control Gain (K)
15º 8867 rad/s 7.7138
30º 7155.3 rad/s 6.2255
45º 5463.8 rad/s 4.755
60º 3816.7 rad/s 3.3238
44
5.3.2 Control P Simulator. Discrete Time.
Applying a configuration like the one that can be seen in Fig. 5.12, the outputs
that can be seen in Fig. 5.13 are obtained. Table 5.2 shows the data of the control
applied to the simulator. It can be seen that there is an error in the permanent
reference tracking regime in d − q axes because it is a proportional control, without
an integrator.
Variable Value
Phase margin (φm ) 30º
Reference weighting (b) 1
Proportional Gain (K) 0.5
Modulation Index (m) 0.5
Table 5.2: Table with the values of a Control P applied to the simulator.
45
Figure 5.12: Configuration of a simulator with a control P. Identical to the one used
in the simulator. The development is described in Appendix B.
46
Figure 5.13: Scope of a simulator with a P control. The simulink PID block is
implemented in discrete time. The simulation control values are listed in Table 5.2
47
5.3.3 Implementation of a Control P in the prototype.
The implementation of a P Control necessarily implies the permanent existence of a
reference tracking error. D-axis tracking error data was taken experimentally, with
different d-axis reference values and zero q-axis reference. The prototype operating
conditions are recorded in Table 5.3. In all of them, a phase margin φm = 30º has
been used. The decoupling explained in Section 4.3 of the page 29, makes that the
current of axis q does not vary with the reference of axis d, in this way, the output
of Iq will always be 0 in permanent regime when the reference of Iq is 0. However,
since the d axis represents a disturbance in the q axis and vice versa, and applying
a P control, a following error is produced and therefore the output of Iq is different
0 in steady state. Likewise, the supply voltage of the VSC was 48V.
48
Figure 5.14: Graph of the reference following error of the d axis current with a
Control P. Hardware implementation. The y-axis data is scaled 0.1 of the pu value.
49
5.4 PI Control
5.4.1 PI Control Design
The control will be designed through its frequency response, using the continuous-
time plant obtained in Section 5.1. The frequency response design equations for a
PI control will be:
φc −180 + φm − ∠P (ω0 )
= (5.17)
1
Ac = (5.18)
|P (ω0 )|
90 + φc
I = tan( ) (5.19)
ω0
I · ω0
K = Ac · p (5.20)
1 + (I · ω0 )2
(5.21)
The design of the integral proportional control, that is, of the variables of the
control transfer function in (5.22) will be designed by adjusting the crossover pul-
sation and phase margin parameters. The procedure to follow will be iteration to
adjust the crossover pulsation and phase margin values to the optimal values.
1+I ·s
Cserial (s) = Kp · (5.22)
I ·s
Since there are two values that can vary, in the first instance the phase margin
value will be varied. Fig. 5.15, 5.16, 5.17 and 5.18,show the different temporal
responses in continuous time that we can have, taking, for example, four different
values for the phase margin (keeping the crossover pulsation constant) and another
four different values for the crossover pulsation (keeping the phase margin constant)
.
Likewise, Fig. 5.19 and 5.20 are Black diagrams that allow analyzing the stability
of the open loop system.
50
Figure 5.15: Id temporal response with constant phase margin with PI control in
continuous time. Id pulse = 1 in 0.3s. Pulse of Iq = 1 in 0.8s.
Figure 5.16: Temporal response of Iq with constant phase margin with PI control
in continuous time. Id pulse = 1 in 0.3s. Pulse of Iq = 1 in 0.8s.
51
Figure 5.17: Id temporal response with constant crossover pulsation with PI control
in continuous time. Id pulse = 1 in 0.3s. Pulse of Iq = 1 in 0.8s.
52
Figure 5.19: Open-loop response with constant phase margin with PI control in
continuous time.
Figure 5.20: Open-loop response with constant crossover pulsation with continuous-
time PI control.
53
5.4.2 PI Control Simulator
For the simulation of the PI control, a configuration like the one in Fig. 5.21 will
be applied to the interface created for the simulator.
The simulator output, applying the configuration of Fig. 5.21 is the one that
54
can be observed in Fig. 5.22. It can be observed in the jumps that occur in the
axes when their reference is zero, that the variations in the q axis are disturbances
in the d axis and vice versa. The values of the PI control applied to the simulator
are those described in Table 5.4:
Variable Value
Phase Marging (φm ) 50
Crossover pulsation (ω0 ) 500
Reference weighting (b) 1
Proportional gain (K) 0.2582
Integral constant (I) 0.0013
Modulation index (m) 0.5
Table 5.4: Table with the values of a PI Control applied to the simulator.
Figure 5.22: Scope of a simulator with a PI control. The PID block is implemented
in discrete time. It can be observed in the jumps that occur in the dq axes when
their reference is zero, that the variations in the q axis are disturbances in the d
axis and vice versa. The simulation control values are listed in Table 5.4
55
5.4.3 Implementation of a PI Control in the prototype.
All control designed in continuous time, necessarily, is executed in discrete time in
the microcontroller. Next, Table 5.5 shows the conditions in which the PI control
was implemented in the prototype. In all of them, a nominal supply voltage of 48V
was applied, and a q-axis reference current of 0. In all cases a phase margin of 50
is applied, a crossover pulsation of 500rad/s , and a modulation index of 0.5.
In Fig. 5.23 a graph is shown with the data from Table 5.5.
56
Figure 5.23: d-axis current reference tracking error plot with a PI Control. Hard-
ware implementation. The axis values are scaled to 0.1 of the actual value in pu.
It is observed that the coil saturates for values higher than 3pu (Approx. 6.1A).
57
Chapter 6
1 Obtained from the notes of the Microprocessors course. Last access: 01/09/2020. Accessible
material for students enrolled in the Microprocessors subject at the Universidad Pontificia de
Comillas.
58
peripherals had to be done through i2c, which increased the complexity of Matlab
/ Simulink diagrams.
It will be in the microcontroller where the designed controls will be run in real
time. (See Section 5). These controls will be designed in Matlab - Simulink.
In Fig. 6.3 you can see the various families of controllers of the TMS320 family
until nowadays.
6.1.2 TMS320F28739D
The microcontroller used in the project is from the manufacturer Texas Instruments,
model TMS320F28379D. Analyzing the nomenclature of the microcontroller [44],
59
Figure 6.3: Evolution of the TMS320 family [44].
Among its main operating characteristics, the following [40] should be high-
lighted:
• 32-bit dual core.
• Internal clock at 200MHz.
60
6.1.3 LAUNCHPADXL - F28379D
The LAUNCHPADXL - F28379D used in the project is shown in Fig. 6.4 and
6.5, from the manufacturer Texas Instruments, a model of the microcontroller that
incorporates, the TMS320F28379D, shown assembled in the LaunchPad in Fig. 6.6
and 6.7, within the C2000 Microcontrollers series.
The pins are located in such a way that the LaunchPad board attaches directly
to the VSC BOOSTXL-3PhGaNInv, and programming is greatly simplified.
The input and output pins of the microcontroller are shown in Fig. 6.8, 6.9 and
6.10.
61
Figure 6.6: LAUNCHXL - F28379D [45]
62
Figure 6.9: LAUNCHXL - F28379D Pinout left side in a detailed view [46]. The
DAC outputs for which there is a block in the Simulink toolbox are outlined.
63
Figure 6.10: LAUNCHXL - F28379D Pinout right side in a detailed view [46]. Pins
for which there is no specific Simulink block and cannot be used with said library
as DAC are outlined.
64
6.1.4 Pinout Rectification
Fig. 6.8, 6.9 and 6.10 show the generic pins for the TMS320F28379D micro-
controller, however the LAUNCHPADXL - F28379D has some differences in its
PINOUT. There are certain modifications that have been found when developing
the project, listed below:
1. The ADCINA0 pin can behave as an ADC or as a DAC-A (boxed in Fig. 6.9).
2. The ADCINAq pin can behave as an ADC or as a DAC-B (boxed in Fig. 6.9).
3. The DAC1, DAC2, DAC3 and DAC4 pins are not accessible from a Simulink
library block (boxed in the Fig. 6.10).
• The programming of the PWMs that trigger the semiconductors of the VSC.
Next, Simulink module will be used, belonging to Matlab, which will be imple-
mented in the microcontroller and will run in real time on it.
There are specific libraries and files for this board (and others from the same
manufacturer) available in a toolbox in SIMULINK. The different Simulink blocks
for the C2000 LaunchPad series processors are shown in Fig. 6.11. Within these,
the prototype is developed with the LaunchPad F28379D, therefore, the F2837xD
library is used, displayed in Fig. 6.12. When compiling the Matlab and Simulink
files, a code is generated using the manufacturer’s own compiler. This code is what
runs on the LaunchPad. To install the necessary toolbox, see Appendix A.
65
Figure 6.11: Texas Instruments C2000 Processor Toolbox. [47]
66
Figure 6.12: Texas Instruments LaunchPad F2837xD Toolbox. [47]
67
6.2 VSC BOOSTXL-3PhGaNInv
The VSC that will be used in the project is from the manufacturer Texas Instru-
ments, model BOOSTXL-3PhGaNInv, shown in Fig. 6.13 and 6.14.
• Supply voltage between 12V and 60V. The nominal supply voltage is 48V.
• Semiconductors MOSFETs of gallium nitride.
• Current sensors per phase with peak currents between ± 16.5A. Three resis-
tors, which were 5m Omega, have been changed for 15m Omega, to increase
the precision of current measurement, with the three changed resistors in Fig.
6.13.
• Compatible with C2000 MCU (MicroController Unit) series evaluation boards.
68
Figure 6.14: BOOSTXL-3PhGaNInv bottom view.
The components that appear in Fig. 6.15 and that need to be explained are the
LMG5200 and the INA240.
The LMG5200 is a device that contains the semiconductors that want to be con-
trolled. Each device contains two FETS (Section 2.2). Each of the FETS has the
ability to withstand continuous voltage up to 80V and voltage spikes up to 100V.
Likewise, it is capable of conducting up to 10A of current. All technical information
can be found in [49]. Regarding the turn-off and turn-on time of semiconductors,
explained in Section 2.2.5, the behavior of semiconductor activation and deactiva-
tion can be observed in Fig. 6.16-a. Then, Fig. 6.16-b represents the activation
zone in detail.
The semiconductors contained in the device are controlled by a driver built into
it. It can be read in the LMG5200 datasheet [49] that the driver that controls the
on and off of the semiconductors is capable of generating a dead time (Section 2.2.5)
of 2ns. This great speed in semiconductors is due to the fact that they are made of
gallium nitride (GaN), which, as described in Section 2.2.4, is substantially faster
in conducting electrons than the most common ones such as silicon cite seven.
The INA240 is an electronic device that amplifies the current flowing through
69
Figure 6.15: BOOSTXL-3PhGaNInv function diagram [48].
the phases in output voltage format, with properties such as rejection of noise from
PWM switching [51]. A functional diagram of the system is shown in Fig. 6.17.
This device comes by default with a measurement resistance (Rs in (6.1)) of
5mΩ. However, if the currents to be measured are too small, the precision of the
measurement can be increased by modifying this resistance for another of higher
value, so that at the same value of current through said resistance, a higher voltage
is obtained at the output. In this project, the resistance of 5m Omega is changed
to a resistance of 15m Omega (boxed in Fig. 6.13), increasing the value of the
measurement by three. Likewise, the gain value of the INA240 integrated in the
inverter, of 20V / V, makes the INA240 that is used the INA240A1, as can be seen
in Fig. 6.18.
Let the electronic circuit of the INA240 be parametric in Fig. 6.19.
The relationship between the differential input V1 − V2 and the output Vo is
70
Figure 6.16: LMG5200 in a) off mode and b) on mode [50].
71
Figure 6.19: INA240 electronic circuit. [49]
R VS
VA = VS =
R+R 2
R2 + R4 R3 R4 R1 R2 + R4
Vo = V1 − V2 + VA (6.2)
R2 R1 + R3 R2 R1 + R3 R2
In (6.2) it can be observed that the value of the output voltage will consist of a
positive mean value, as well as a relationship between the resistances that multiply
V1 and V2 such that the gain depends of the INA240 used, shown in Fig. 6.18.
72
6.2.1 BOOSTXL - 3PhGaNInv Pinout
BOOSTXL - 3PhGaNInv pinout is shown in Fig. 6.20 and 6.21.
73
6.2.2 LaunchPad - VSC interconnection
There are two ways to connect the LAUNCHPADXL F28379D with the BOOSTXL-
3PhGaNInv, shown in Fig. 6.22 and 6.23.
Figure 6.22: LaunchPad set with VSC with the connection on top.
Figure 6.23: LaunchPad set with VSC with the connection on bottom.
Table 6.1 2 must be taken into account the main connections between the
LaunchPad F28379D and the BOOSTXL - 3PhGaNInv when it is connected in
2 The limitations described in Section 6.1.4
74
the upper or lower part 3 .
Table 6.1: Connections between the LaunchPad F28379D and the BOOSTXL-
3PhGaNInv depending on the Upper-Lower connection.
The format used in this project is to connect the LaunchPad with the VSC at
the bottom to facilitate later its encapsulation and access to output terminals to
obtain measurements. Figures 6.24 and 6.25 show more views of the assembly used
in the prototype.
3 It is taken as a reference to say Upper or Lower : Upper, the VSC immediately next to the
input microusb cable; Bottom, VSC away further microusb cable input.
75
Figure 6.24: Conjunto LaunchPad con VSC con la conexión en la parte inferior.
Vista lateral.
Figure 6.25: Conjunto LaunchPad con VSC con la conexión en la parte inferior.
Vista en perspectiva.
76
The prototype of the VSC along with the Launchpad was encapsulated in such
a way that all measurements could be accessible. Likewise, since it is a teaching
prototype, safety bananas were used to avoid having access to high voltages and /
or currents, shown in Figs. 6.26 and 6.27. Pins in Fig. 6.28 are voltages between 0
and 3.3 V. Wires between pins are GNDs (Grounds) connected to the same GND
of the LaunchPad and VSC.
LED lights were also incorporated to monitor the status of the system, being in
open or closed loop, the type of control implemented and if the coils are coupled on
d − q axes.
77
Figure 6.27: Encapsulated VSC and Launchpad. AC voltage outputs and USB
connection.
78
Figure 6.28: Encapsulated VSC and Launchpad. Oscilloscope pins.
79
6.3 Prototype Software Configuration
This section deals with the different modules that make up the prototype in the
Simulink 4 . Everything needed to install in the Matlab package is described in
Appendix A.
The PWM works with an internal counter, so that while the counter does not
reach the service factor (this in clock cycles as well), the PWM output is high (ton )
and the rest of the switching period, the output is low (tof f ). First of all, the setting
of the PWM switching frequency is done taking into account the frequency of the
internal clock and pre-scaled of the microcontroller. This switching frequency must
be entered in the switching period format, in clock cycles or in seconds. If it is
entered in seconds, the microcontroller converts said value to clock cycles, so that
to reduce the computational load when compiling the code, it will be entered in the
form of clock cycles, according to (6.3):
F requencyClock
T imerP eriod = (6.3)
F requencyConm · P re − scale
Where,
• TimerPeriod: Switching period in clock cycles.
80
• FrequencyConm: Switching frequency in Hz.
81
Figure 6.30: PWM generation form options in Simulink’s ePWM block [47]
82
Figure 6.31: Simulink ePWM block. TI C2000 library.
83
Figure 6.32: Diagram of the PWM nomenclature in Simulink for the VSC connected
to the LaunchPad at the bottom (Section 6.2.2).
84
Figure 6.33: ePWMxA configuration.
Figure 6.34: Final appearance of the ePWM Block. The input is the duty cycle in
seconds or in clock cycles.
85
Figure 6.35: Counter Compare configuration tab.
86
Figure 6.37: ePWMxB configuration from DeadBand Unit tab.
87
These shots do not take effect on the BOOSTXL-3PhGaNInv board until PWM
is enabled. The PWMs are activated low on port J2-16 (See Fig. 6.21 on page
73). This pin corresponds to the GPIO 124 or GPIO 26 port of the microcontroller,
depending on the PWM that want to be used by the LAUNCHPADXL - F28379D,
depending on the relative connection between the microcontroller and the inverter
(See Section 6.2.2). In the simulink diagram, the system of Fig. 6.39 is implemented
to activate the PWM of the VSC.
Using the coupling method described in Section 6.2.2 on page 74, the VSC
PWMs are activated from GPIO port 26, by docking the VSC at the bottom of the
LaunchPad, i.e. the one used in this project.
88
Figure 6.40: ePWMB tab configuration to obtain signals by PWM.
Figure 6.41: Configuration tab Counter Compare to obtain signals by PWM. Coun-
ters CMPA and CMPB.
89
Figure 6.42: Configuration tab Counter Compare to obtain signals by PWM. Coun-
ters CMPA and CMPB.
Figure 6.43: Deadband Unit tab configuration to obtain signals through PWM.
Figure 6.44: Final appearance of the ePWM Block to obtain signals. The input
signals are the duty cycle.
90
6.3.3 ADC Module
In the present project, the ADC converters sample the currents through the phases.
The ADC block of the Simulink library for the TMS320F28379D microcontroller is
shown in Fig. 6.45.
Once the starting conversion procedure from the PWM block has been con-
figured, the ADC block is configured. It has two tabs: SOC Trigger and Input
Channerls. In the SOC Trigger menu we select the ADC module that will convert
the signal. This module must be chosen according to Table 6.1 on page 75.
The ADC resolution, given the way the data is collected, will be 12-bits. The
number at the beginning of the ADCs (SOC Number will have to be different among
all the ADCs (if not, a compilation error will occur). The SOCx Acquisition Window
is a value between 0 and 15. This value is, proportionally between 0 and 15, the
amount of time that the Sample and Hold of the ADC remains open reading the
measurement (0 not open, 15 fully open). The start of the ADC is caused by an
interruption of the PWM of that phase. In this way, Select in the SOCx trigger
source dialog the ePWMx ADCSOCA option (see Fig. 6.38). The ADC does not
trigger any action. Likewise, the ADC sampling time will be the same as the rest of
the blocks of the program (Sample Time = -1 ), that is, inherited from the Simulink
parameter settings (the switching period, see Section 6.3.8). The data type used
and that comes by default is uint16 , because then, the signal will be scaled and
corrected in the simulink, due to the fact that this signal is strictly positive. Finally,
the configuration of the three ADCs needed to sample the three currents from an
triphasic electronic converter, is shown in Fig. 6.46. Finally, select the channel
within the ADC module selected in the Input Channels tab, listed in Table 6.1 on
page 75.
91
Figure 6.46: ADC Block Configuration.
92
6.3.4 DAC Module
The DAC module of the microcontroller allows an analog signal to be obtained
through a terminal. The Simulink DAC module is the one shown in Fig. 6.47.
93
Figure 6.48: Difference in PWM - DAC output measurements.
Figure 6.49: Current through one phase, output through the DAC, through the
PWM and measured with a current clamp.
94
6.3.6 Getting a value from a DAC or PWM port
To obtain a signal through a DAC or PWM port, it is necessary to perform a series
of operations to ensure that the output signal is displayed correctly.
1. Scale the amplitude of the signal so that it does not exceed the limits of the
output. Limits are set between 0V and + 3.3V. Said value to which it is scaled
can vary depending on the value of the signal to be obtained.
2. Convert the signal to a value between 0 and 4096. This is done because the
Launchpad accepts 12-bit values in uint format. Since the most significant
bit is the sign bit, this results in a total of 211 = 2048 values (positive and
negative).
3. Set a mean value so that the entire signal is on the positive semi-axis.
A simulink block diagram is shown in Fig. 6.50 that is used in the simulator
and prototype software to obtain the output signals.
Figure 6.50: Block diagram to obtain a signal through the DAC or PWM. Actual
1.5V average value may vary.
In case the signal saturates in the saturation limits of the output voltage, in this
case through a DAC port, a signal could be obtained like the one shown in Fig.
6.51 [53].
95
Figure 6.51: Saturated signal through DAC output port.
In this way, if, for example, a d-axis current value of amplitude 1.8V is obtained,
a current in pu of:
1.8 − 1.5
V alueinpu = = 0.4pu
0.75
And subsitutying the previous value in (6.5),
2.5(A) · 0.4(pu)
Ia (A) = Ib (A) = Ic (A) = q = 0.81649A
3
2
5 This value may vary depending on whether the usb cable is connected to the computer or
due to other factors. It is recommended to take the mean value of the signal when the reference
is null (and therefore the mean value is constant).
96
6.3.8 Build program into the Launchpad
Before uploading the code to the LaunchPad, it is necessary that the 48V voltage
source is not supplying voltage to the LaunchPad. Otherwise, the code will not be
debugged and an error will appear. It will be necessary to determine a value for
the Fixed-Step of the Solver tab. This value must be the smallest time value used
in the system. In the prototype, the smallest is the switching period of the PWMs.
Therefore, the Fixed-Step of the program will be the switching period. In Fig. 6.52,
the value of the variable Tpwm is 0.1ms.
97
Figure 6.53: Hardware Implementation configuration tab for prototype implemen-
tation.
98
Chapter 7
Experimental Results
Below are snapshots taken on the oscilloscope [54]. All tests were carried out
with a supply voltage of 48V.
Fig. 7.2 displays the waveform of three-phase currents in a normal operating
mode (rated current through the coils).
In the case that the VSC cannot supply a current or service factor necessary to
reach the values needed by the control, it saturates the control integral term and
the waveforms obtained are those shown in Fig. 7.3.
99
Figure 7.2: Three-phase currents through the coils. The identification of the signals
is shown in detail in the figure. See table 7.1.
Table 7.1: Table with the data in Fig. 7.2 with the three-phase currents.
100
Figure 7.3: Three-phase currents through the saturated coils.
101
Fig. 7.4 shows an integral control with a pulse-shaped d-axis reference.
Figure 7.4: Three-phase currents through the inductances with d-axis reference
current in the form of pulses. Reference Iq = 0. The identification of the signals is
shown in detail in the figure.
102
Fig. 7.5 shows an integral control with a 4Hz sinusoidal d-axis reference. Fig.
7.6 shows in detail the zone of change from positive to negative reference of Fig.
7.5.
Figure 7.5: Three-phase currents through the inductances with d-axis current ref-
erence in sinusoidal shape of 4Hz frequency. The identification of the signals are
shown in detail in the figure. Iq reference = 0.
103
Figure 7.6: Detail of the three-phase currents through the coils with a 4Hz frequency
sinusoidal d-axis current reference. The identification of the signals are shown in
detail in the figure. Iq reference = 0.
104
Fig. 7.7 shows the reference tracking temporal response Id and Iq at the same
time. It should be noted that the Id∗, Iq∗ (references) and Id signals were obtained
through a PWM port, while the Iq output was obtained through the DAC port,
thus, what is commented in Section 6.3.5 is observed, the DAC port lags more than
the PWM, as can be seen in Fig. 7.7. Likewise, the waveform of the currents can
be observed when a rising step is applied. The three-phase current shapes appear
noisy because the inductances work far below their nominal current (5A).
Figure 7.7: Three-phase currents through the inductances. Time response of d-axis
and q-axis current. Application of references simultaneously. The identification of
the signals are shown in detail in the figure.
Fig. 7.8 shows a PI control to which a rising step and a falling step are applied
simultaneously on d and q axes. A complex waveform appears at the point of
application of the references.
Fig. 7.9 shows the q-axis current reference tracking time response.
105
Figure 7.8: Three-phase currents through the inductanced. Time response of d-axis
and q-axis current inversely applied. The identification of the signals are shown in
detail in the figure.
106
Figure 7.9: Three-phase currents through the inductances. Time response of q-axis
current. Id reference = 0. The identification of the signals are shown in detail in
the figure.
107
Chapter 8
Budget
The cost of the prototype is detailed in Table 8.1. This does not include the mate-
rials used for the encapsulation of the system, since it is not required for the correct
functioning of the prototype.
108
8.2 Labor Budget
The cost of labor for the development of the project and prototype is detailed in
Table 8.2.
Table 8.2: Table with the budget of labor for the construction of the prototype.
109
Bibliography
110
[9] S. K. Sahoo, A. Ramulu, S. Batta, and S. Duggal, “Performance analysis and
simulation of three phase voltage source inverter using basic pwm techniques,”
in IET Chennai 3rd International on Sustainable Energy and Intelligent Sys-
tems (SEISCON 2012), Dec. 2012, pp. 1–7. doi: 10.1049/cp.2012.2223.
[10] T. Lifang, “Study of the svpwm converter bassed on tms320f24x,” in 2013
Third International Conference on Intelligent System Design and Engineering
Applications, Jan. 2013, pp. 1316–1319. doi: 10.1109/ISDEA.2012.311.
[11] S. Singh and A. Tiwari, “Simulation and comparison of spwm and svpwm
control for two level inverter,” Mar. 2017.
[12] B. J. Baliga, “Power semiconductor device figure of merit for high-frequency
applications,” IEEE Electron Device Letters, vol. 10, no. 10, pp. 455–457, Oct.
1989, issn: 1558-0563. doi: 10.1109/55.43098.
[13] L. Boylestad Robert L. y Nashelsky, Electrónica: Teoría de Circuitos y Dis-
positivos Electrónicos, 10th ed. Pearson Education, 2009, isbn: 978-607-442-
292-4.
[14] E. C. Niehenke, “The evolution of transistors for power amplifiers: 1947 to to-
day,” in 2015 IEEE MTT-S International Microwave Symposium, May 2015,
pp. 1–4. doi: 10.1109/MWSYM.2015.7166768.
[15] U. Müter, C. Sammler, S. Fahlbusch, S. Klötzer, and K. F. Hoffmann, “Com-
parison of driving concepts for silicon carbide bipolar junction transistors,”
in 2016 18th European Conference on Power Electronics and Applications
(EPE’16 ECCE Europe), Sep. 2016, pp. 1–9. doi: 10 . 1109 / EPE . 2016 .
7695636.
[16] A. Mohapatra, S. Bhawal, and K. Hatua, “A si igbt and sic mosfet hybrid shunt
active filter,” in 2018 IEEE International Conference on Power Electronics,
Drives and Energy Systems (PEDES), Dec. 2018, pp. 1–6. doi: 10 . 1109 /
PEDES.2018.8707561.
[17] P. Wellmann, “Power electronic semiconductor materials for automotive and
energy saving applications – sic, gan, ga2o3, and diamond,” Zeitschrift für
anorganische und allgemeine Chemie, vol. 643, Oct. 2017. doi: 10 . 1002 /
zaac.201700270.
[18] Tiago Kommers Jappe, S. A. Mussa, and Richard Henry Sutter Rosendo,
“Synchronous state machine inner fpga controlling pfc boost converter,” in
2010 IEEE International Symposium on Industrial Electronics, Jul. 2010,
pp. 1097–1102. doi: 10.1109/ISIE.2010.5636865.
[19] J. Rocabert, A. Luna, F. Blaabjerg, and P. Rodríguez, “Control of power
converters in ac microgrids,” IEEE Transactions on Power Electronics, vol. 27,
no. 11, pp. 4734–4749, Nov. 2012, issn: 1941-0107. doi: 10.1109/TPEL.2012.
2199334.
111
[20] Thanh-Vu Tran, Tae-Won Chun, Hong-Hee Lee, Heung-Geun Kim, and Eui-
Cheol Nho, “Control for grid-connected and stand-alone operations of three-
phase grid-connected inverter,” in 2012 International Conference on Renew-
able Energy Research and Applications (ICRERA), Nov. 2012, pp. 1–5. doi:
10.1109/ICRERA.2012.6477348.
[21] S. Reichert, G. Griepentrog, and B. Stickan, “Comparison between grid-feeding
and grid-supporting inverters regarding power quality,” in 2017 IEEE 8th In-
ternational Symposium on Power Electronics for Distributed Generation Sys-
tems (PEDG), Apr. 2017, pp. 1–4. doi: 10.1109/PEDG.2017.7972536.
[22] J. Liu, “Studies on improving dynamic performance of microgrids by apply-
ing virtual synchronous generator control to distributed generators,” Ph.D.
dissertation, Osaka University, Jan. 2016, p. 2.
[23] B. Arbab-Zavar, E. Palacios-Garcia, J. Vasquez, and J. Guerrero, “Smart
inverters for microgrid applications: A review,” Energies, vol. 12, no. 840,
p. 11, Mar. 2019.
[24] H. Niu, M. Jiang, D. Zhang, and J. Fletcher, “Autonomous micro-grid opera-
tion by employing weak droop control and pq control,” in 2014 Australasian
Universities Power Engineering Conference (AUPEC), Sep. 2014, pp. 1–5.
doi: 10.1109/AUPEC.2014.6966519.
[25] A. Rizqiawan, P. Hadi, and G.Fujita, “Development of grid-connected inverter
experiment modules for microgrid learning,” Energies, vol. 12, no. 476, pp. 2–
15, Feb. 2019. doi: 10.3390/en12030476.
[26] L. Yu, R. Li, and L. Xu, “Distributed pll-based control of offshore wind tur-
bines connected with diode-rectifier-based hvdc systems,” IEEE Transactions
on Power Delivery, vol. 33, no. 3, pp. 1328–1336, Jun. 2018, issn: 1937-4208.
doi: 10.1109/TPWRD.2017.2772342.
[27] B. Meersman, J. De Kooning, T. Vandoorn, L. Degroote, B. Renders, and
L. Vandevelde, “Overview of pll methods for distributed generation units,”
in 45th International Universities Power Engineering Conference UPEC2010,
Aug. 2010, pp. 1–6.
[28] A. H. Fahad and M. S. Reza, “Single-phase shunt active power filter using
parabolic pwm for current control,” in 2019 IEEE 7th International Confer-
ence on Smart Energy Grid Engineering (SEGE), Aug. 2019, pp. 134–138.
doi: 10.1109/SEGE.2019.8859868.
[29] N. Panten, N. Hoffmann, and F. W. Fuchs, “Finite control set model predictive
current control for grid-connected voltage-source converters with lcl filters:
A study based on different state feedbacks,” IEEE Transactions on Power
Electronics, vol. 31, no. 7, pp. 5189–5200, Jul. 2016, issn: 1941-0107. doi:
10.1109/TPEL.2015.2478862.
112
[30] X. Bao, F. Zhuo, Y. Tian, and P. Tan, “Simplified feedback linearization con-
trol of three-phase photovoltaic inverter with an lcl filter,” IEEE Transactions
on Power Electronics, vol. 28, no. 6, pp. 2739–2752, Jun. 2013, issn: 1941-
0107. doi: 10.1109/TPEL.2012.2225076.
[31] N. He, D. Xu, Y. Zhu, J. Zhang, G. Shen, Y. Zhang, J. Ma, and C. Liu,
“Weighted average current control in a three-phase grid inverter with an lcl
filter,” IEEE Transactions on Power Electronics, vol. 28, no. 6, pp. 2785–2797,
Jun. 2013, issn: 1941-0107. doi: 10.1109/TPEL.2012.2219322.
[32] H. Niu, M. Jiang, D. Zhang, and J. Fletcher, “Autonomous micro-grid opera-
tion by employing weak droop control and pq control,” in 2014 Australasian
Universities Power Engineering Conference (AUPEC), Sep. 2014, pp. 1–5.
doi: 10.1109/AUPEC.2014.6966519.
[33] C. Jian-ming, “Study on traffic flow simulation model based on kirchhoff’s
law,” in 2010 WASE International Conference on Information Engineering,
vol. 3, Aug. 2010, pp. 418–421. doi: 10.1109/ICIE.2010.277.
[34] C. J. O’Rourke, M. M. Qasim, M. R. Overlin, and J. L. Kirtley, “A geometric
interpretation of reference frames and transformations: Dq0, clarke, and park,”
IEEE Transactions on Energy Conversion, vol. 34, no. 4, pp. 2070–2083, Dec.
2019, issn: 1558-0059. doi: 10.1109/TEC.2019.2941175.
[35] P. Krause, O. Wasynczuk, and S. Sudhoff. John Wiley and Sons, Ltd, 2013,
632 pp., isbn: 9781118524336.
[36] M. Murali, A. Gokhale, A. V. Pandey, and E. Sharma, “Modelling, design
and comparison of pi and pid controllers for static synchronous compensator
(statcom),” in 2016 IEEE 1st International Conference on Power Electronics,
Intelligent Control and Energy Systems (ICPEICES), Jul. 2016, pp. 1–6. doi:
10.1109/ICPEICES.2016.7853563.
[37] T. Suyata and S. Po-Ngam, “Simplified active power and reactive power con-
trol with mppt for three-phase grid-connected photovoltaic inverters,” in 2014
11th International Conference on Electrical Engineering/Electronics, Com-
puter, Telecommunications and Information Technology (ECTI-CON), May
2014, pp. 1–4. doi: 10.1109/ECTICon.2014.6839804.
[38] X. Shen, J. Zheng, S. Zhu, and Lian Shu, “D-q axis decoupling parameter iden-
tification strategy for the grid-connected inverter of photovoltaic generation
system,” in 2012 China International Conference on Electricity Distribution,
Sep. 2012, pp. 1–4. doi: 10.1109/CICED.2012.6508671.
[39] A. Jana, P. K. Gayen, P. K. Dhara, and R. Garai, “Simultaneous active and
reactive power control of single-phase grid connected battery storage system,”
in 2017 Devices for Integrated Circuit (DevIC), Mar. 2017, pp. 289–293. doi:
10.1109/DEVIC.2017.8073954.
[40] Tms320f2837xd dual-core delfino microcontrollers, English, Texas Instruments,
222 pp., December, 2013.
113
[41] S. Bennett, “Development of the pid controller,” IEEE Control Systems Mag-
azine, vol. 13, no. 6, pp. 58–62, Dec. 1993, issn: 1941-000X. doi: 10.1109/
37.248006.
[42] L. Balasevicius, A. Kunickaite, and V. S. Janusevicius, “Discrete-time pid con-
troller design in programmable logical controllers,” in 2007 4th IEEE Work-
shop on Intelligent Data Acquisition and Advanced Computing Systems: Tech-
nology and Applications, Sep. 2007, pp. 86–90. doi: 10.1109/IDAACS.2007.
4488380.
[43] P. Papamichalis, Introduction to the TMS320 Family of Digital Signal Pro-
cessors. CRC Press LLC, 1999, isbn: 978-607-442-292-4.
[44] Tms320 dsp development support reference guide, English, Texas Instruments,
430 pp., May, 1998.
[45] Launchxl-f28379d overview, English, Texas Instruments, 30 pp., August, 2016.
[46] Meet the tms320f28739d launchpad development kit, English, Texas Instru-
ments, 2017, 7 pp., 2017.
[47] MATLAB, version 9.6.0.1214997 (R2019a). Natick, Massachusetts: The Math-
Works Inc., 2020.
[48] Boostxl-3phganinv evaluation module, English, Texas Instruments, 41 pp.,
June, 2017.
[49] Lmg5200 80-v, 10-a gan half-bridge power stage, English, Texas Instruments,
29 pp., March, 2015.
[50] Using the lmg5200: Gan half-bridge power stage evm, English, Texas Instru-
ments, 41 pp., March, 2015.
[51] Ina240 high- and low-side, bidirectional, zero-drift, current-sense amplifier
with enhanced pwm rejection, English, Texas Instruments, 41 pp., July, 2016.
[52] 48-v three-phase inverter with shunt-based in-line motor phase current sensing
reference design, English, Texas Instruments, 41 pp., November, 2016.
[53] Osciloscopios digitales de la serie ds1000d/e, Spanish, version UGA07107-
1110, RIGOL, 168 pp.
[54] Dl850e/dl850ev scopecorder user’s manual, English, 7th, version IM DL850E-
02EN, Yokogawa, 210 pp.
114
Appendix A
Installation of the Embedded Coder Support Package for Texas Instruments C2000
Processors requires the following system requirements:
• Have Matlab R2017a or later versions installed, although there are versions
of this package that can be run in Matlab from versions 2014a to 2019b.
• The operating system must be Windows, it is not available for MacOS or
Linux.
In the pop-up window that appears, find the package: Embedded Coder Support
Package for Texas Instruments C2000 Processors. In Fig. A.1 the main screen of
the package to be installed is shown.
The installation of the package for C2000 Microcontrollers requires the previous
Matlab packages been installed:
• Simulink.
• Embedded Coder.
• Matlab Coder.
• Simulink Coder.
Fig. A.2, A.3 and A.4 show the following screens in setup. In all the necessary
ones, click on Continue and Setup Now.
115
Figure A.1: Matlab Add-Ons menu.
116
Figure A.3: Library Configuration window 2 C2000 Processors.
117
In Fig. A.5 the screen in which you have to choose the LaunchPad processor of
the prototype (or failing that, the one you want to use) is shown, in this case, it is
installed for the processor TI Delfino F2837xD.
Once the screen in Fig. A.6 is reached, the components that appear in the
window and are described in Table A.1 must be installed.
118
Programme Description
TI controlSUITE 1 Sotfware and Development Tools
TI Code Composer Studio 2
TI Compiler
TI C2000Ware 3 Documentation for C2000 Microcontrollers
119
Figs. A.7, A.8 and A.9 show the web pages where the programs are downloaded.
120
Figure A.9: TI C2000Ware downloading page..
121
Finally, once the three programs have been downloaded, returning to the package
installer in the Matlab pop-up window, we locate the installed programs, shown in
Fig. A.10, A.11 and A.12.
122
Appendix B
Simulator Interface
The development of the simulator interface has the objective of facilitating the
modification of the environment and simulation conditions by the user. To create
the interface, the following steps must be followed:
First of all, the simulink variables must be created, which will be modified from
the interface that will be developed later. To do this, access the Tools> Model
Explorer tab on the top bar of Simulink. In the window that opens, access the
Model Workspace * option. In it, show the Data Objects variables. In it, create
the variables with the names assigned in the simulink blocks. Select the Argument
option so that the interface can modify its values after initialization.
Second, a subsystem of the entire simulink diagram set is created: It can be done
by selecting everything and pressing ctrl + G or right button, Create Subsystem from
Selection. Next, a system mask is created: Right-clicking on the subsystem Mask>
Create Mask. Once Create Mask has been clicked, a window will appear with the
appearance of Fig. B.2.
The Parameters and Dialog tab allows the modification of the tabs, dialog boxes,
options, variable names, etc., of the interface box. In Fig. B.3 the parts that make
up this tab are detailed.
The variables contained in the interface must be allowed to be modified internally
in simulink. This is done by leaving the Tuneable option set to on. In the Property
Editor> Popup Options option, the options contained in the dialog box are modified.
Each option in a different row, as seen in Fig. B.4. When an option is selected in
123
Figure B.1: Creation of variables for the interface.
the dialog box, the variable associated with that dialog box takes the value of the
row number of the Popup Options.
Once the interface of the window with the dialog boxes has been created, its
behavior is programmed. This is done in the Initialization tab. In this tab, you
124
Figure B.3: Parameters and Dialog tab settings and descriptions.
program with code in Matlab language, the value that the simulink variables will
take when the options in the dialog boxes have been selected. The name of the
variables associated with the dialog boxes can be seen on the left side in the Dialog
Variables section. In Fig. B.5 an example of programming a pop-up dialog box
with seven options is shown.
Once the mask interface has been created, the behavior of the prototype simu-
lator and hardware can be modified from the mask interface.
125
Figure B.4: Popup Options tab settings and descriptions.
126
Figure B.5: Initialization tab settings and descriptions..
127
Appendix C
Files
128
Appendix D
129
Goal 9: Industry innovation and infrastructure.
Electronic power converters DC-AC voltage sources with PWM are used to connect
to the electrical network, energy storage systems such as flywheels or batteries.
Likewise, they can be used to optimize vastly extended and relatively inefficient
processes of the current energy system, such as the use of PWM to optimize the
cooling pumps of thermal power plants, thus favoring the transition to a more
efficient and cleaner energy system.
Likewise, the development of new materials in science and industry help advance
the technological capacity of these systems, thus increasing their efficiency. Mate-
rials such as gallium nitride that today is being widely investigated, and of which
the switches (MOSFETs) of the VSC of the prototype of the present project are
composed.
130