Mirzahosseini Ramin 201711 PhD Thesis(1)
Mirzahosseini Ramin 201711 PhD Thesis(1)
Mirzahosseini Ramin 201711 PhD Thesis(1)
by
Ramin Mirzahosseini
Ramin Mirzahosseini
Doctor of Philosophy
Graduate Department of Electrical and Computer Engineering
University of Toronto
2017
This thesis develops an FPGA-based real-time simulation platform for power grids
including multiple Power Electronic Converters (PECs) and other classical components,
which in contrast to the classical systems do not include long transmission lines for
mathematical decoupling of systems for efficient simulation. Presence of short transmis-
sion lines creates a large set of network equations that can not be decoupled. Handling
the large admittance matrix, representing the large set of network equations, requires
floating-point numerical representation which is associated with large latencies and high
resource utilization in FPGAs. In addition, the presence of high switching frequency
PECs imposes small simulation time-step requirement and therefore high computational
burden. Accurate representation of PECs, using two-value resistor model, results in
time-variant admittance matrix which also increases computational burden.
This thesis proposes Reformulated Modified Nodal Analysis (RMNA) for solution of
network equations to enable (i) parallelism between the simulation task of solving network
equations and those of other power system component models to achieve small simula-
tion time-steps and (ii) design of a low-latency floating-point matrix-vector multiplication
hardware module to efficiently solve relatively large set of network equations associated
with systems targeted in this work. An FPGA-based partitioning method is proposed
to enable simulation of multiple PECs and representing power switches by two-value re-
sistor model without significantly increasing the computational burden. This overcomes
the issues associated with the existing real-time Associate Discrete Circuit (ADC) switch
ii
model, i.e., artificial switching loss and numerical oscillation. A new FPGA-based Elec-
trical Machine (EM) Constant-Parameter-Voltage-Behind-Reactance (CPVBR) model is
proposed to enable real-time simulation of different types of EMs, i.e., Induction Ma-
chine (IM), Synchronous Machine (SM) and Permanent Magnet Synchronous Machine
(PMSM), under all test scenarios and regardless of their dynamic saliency and system con-
figuration. Moreover, this thesis develops Inter-Hardware Universal Line Model (IHULM)
to enable parallel simulation of distribution system, which includes short transmission
lines, in the FPGA-based platform and the rest of the system in commercially available
simulation platforms, e.g., RTDS.
The platform developed in this work accurately simulates power grids with up to 160
nodes/outputs, four PECs, three EMs and one IHULM using a small real-time time-step
of 2.55µs. Moreover, it features fixed-hardware design to avoid FPGA code compilation
time. A model preparation script is developed to calculate the study system parameters
based on the modeling approaches devised in this work.
iii
To my parents, Maryam and Aliakbar
iv
Acknowledgements
I would like to express my sincere appreciation to my advisor, Professor Reza Iravani,
for his valuable and insightful supervision. Throughout my Ph.D. his knowledge and
professionalism inspired me and I am grateful to have had the opportunity to learn from
him and further my career with his guidance.
In addition, I would like to thank my Ph.D. examination committee members, Pro-
fessors Zeb Tate, Joshua A. Taylor, Olivier Trescases and Alireza Bakhshai for their
thoughtful feedback.
I acknowledge the generous financial support I received from Professor Iravani and
the University of Toronto.
v
Contents
1 Introduction 1
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Statement of the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Power System Analysis . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 Analyses of EMTs in Power System . . . . . . . . . . . . . . . . . 3
1.2.3 Real-Time Simulation of EMTs . . . . . . . . . . . . . . . . . . . 4
1.2.4 Existing Digital Real-Time Simulator (DRTS) platforms . . . . . 6
1.2.5 Motivation of this Work . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Research Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
vi
3.2.2 Nodal Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2.3 Combined Nodal and State-Space Formulation . . . . . . . . . . . 30
3.3 Proposed DRTS Architecture . . . . . . . . . . . . . . . . . . . . . . . . 32
3.4 FPGA-based Solution of Network Equations . . . . . . . . . . . . . . . . 33
3.4.1 Anti-parallel Patterns and Proposed Reformulation . . . . . . . . 35
3.4.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.5 Summary and Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 43
vii
5.5 Performance Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.5.1 Case I: IM Start-up . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.5.2 Case II: IM Transient Response . . . . . . . . . . . . . . . . . . . 94
5.5.3 Case III: PMSM Transient Response . . . . . . . . . . . . . . . . 95
5.5.4 Case IV: PMSM and Rectifier . . . . . . . . . . . . . . . . . . . . 97
5.5.5 Case V: SM and Rectifier . . . . . . . . . . . . . . . . . . . . . . 99
5.6 Summary and Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . 101
A EM Matrices 133
Bibliography 139
viii
List of Tables
3.1 Discrete admittance and history update coefficients for different branches 28
3.2 Resource utilization of differnet modules . . . . . . . . . . . . . . . . . . 44
ix
List of Figures
x
4.6 ADC switch model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.7 (a) A system embedding one PEC (b) The circuit seen from the PECSN 57
4.8 (a) The model of the PEC in the PEC simulation task, (b) The third step
of the proposed partitioning method . . . . . . . . . . . . . . . . . . . . 58
4.9 (a) Boost converter and (b) its discretized model . . . . . . . . . . . . . . 62
4.10 PEC Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.11 Computation engine for simulation of case studies embedding multiple PECs 65
4.12 Timing diagram of (a) computation engine modules (b) PUs in the PEC
module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.13 (a) Case study system embedding two PEC units (b) PEC unit model . 67
4.14 Simulation results of Case I, m1 = 0.4∠60◦ and m2 = 0.4∠0◦ , 1st (left)
column includes the FPGA-based DRTS real-time simulation results using
the proposed partitioning method, 2nd column contains the PSIM off-line
simulation results using the two-value resistor reference method and 3rd
column has the RTDS-based real-time simulation results using the ADC
method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.15 Simulation results of Case II, m1 = 0.4∠60◦ , m2 = 0.4∠0◦ and the gate
signals of both PECs are blocked at t=0.1s, 1st (left) column includes
the FPGA-based DRTS real-time simulation results using the proposed
partitioning method, 2nd column contains the PSIM off-line simulation
results using the two-value resistor reference method and 3rd column has
the RTDS-based real-time simulation results using the ADC method. . . 70
xi
5.10 Simulation results of Case I, i.e., IM start-up, m = 0.4. The left column
includes the results from FPGA-based method, based on the proposed
CPVBR model and using the proposed FPGA-based DRTS platform of
Fig. 5.8 with the real-time time-step of 4µs and the right column contains
the results from the reference method, i.e., based on VBR model and using
PLECs toolbox of MATLAB Simulink environment with ode23tb solver
and the relative error parameter set to 10−4 . . . . . . . . . . . . . . . . 95
5.11 Simulation results of Case II, i.e., IM transient response, a step change
from m = 0.4 to m = 0.5 is applied at t = 0.12s. The left column includes
the results from FPGA-based method, based on the proposed CPVBR
model and using the proposed FPGA-based DRTS platform of Fig. 5.8
with the real-time time-step of 4µs and the right column contains the
results from the reference method, i.e., based on VBR model and using
PLECs toolbox of MATLAB Simulink environment with ode23tb solver
and the relative error parameter set to 10−4 . . . . . . . . . . . . . . . . 96
5.13 Simulation results of Case III, i.e., PMSM transient response, a mechan-
ical torque of τm = 10N.m is applied the PMSM shaft at t = 3s. The
left column includes the results from FPGA-based method, based on the
proposed CPVBR model and using the proposed FPGA-based DRTS plat-
form of Fig. 5.8 with the real-time time-step of 4µs and the right column
contains the results from the reference method, i.e., based on VBR model
and using PLECs toolbox of MATLAB Simulink environment with ode23tb
solver and the relative error parameter set to 10−4 . . . . . . . . . . . . . 98
5.14 Simulation results of Case IV, i.e., PMSM and rectifier, a mechanical
torque of τm = −15N.m is applied to the PMSM shaft. The left column
includes the results from FPGA-based method, based on the proposed
CPVBR model and using the proposed FPGA-based DRTS platform of
Fig. 5.8 with the real-time time-step of 4µs and the right column contains
the results from the reference method, i.e., based on VBR model and us-
ing PLECs toolbox of MATLAB Simulink environment with ode23tb solver
and the relative error parameter set to 10−4 . . . . . . . . . . . . . . . . 99
xii
5.16 Simulation results of Case V, i.e., SM and Rectifier. The SM speed is
locked at synchronous speed and at t = 0s the field voltage is applied to
the filed winding. The left column includes the results from FPGA-based
method, based on the proposed CPVBR model and using the proposed
FPGA-based DRTS platform of Fig. 5.8 with the real-time time-step of
4µs and the right column contains the results from the reference method,
i.e., based on VBR model and using PLECs toolbox of MATLAB Simulink
environment with ode23tb solver and the relative error parameter set to
10−4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
xiii
6.13 Start up simulation results of Case II, grid connected DER. The receiving
end and sending end voltages of the transmission line are shown in first
and second row, respectively, and the DER three-phase currents are shown
in the third row. The left column includes the results from FPGA-based
method, based on the proposed real-time simulation platform with the
real-time time-step of 2.6µs and the right column contains the results from
the reference method, using PSCAD with the time-step of 2.6µs. . . . . . 121
6.14 Fault response simulation results of Case II, grid connected DER. The
receiving end and sending end voltages of the transmission line are shown
in first and second row, respectively, and the DER three-phase currents
are shown in the third row. A three-phase to ground fault is applied to
the grid voltage at t=0.5s and VSC gate signals are blocked at t=0.51s.
The left column includes the results from FPGA-based method, based on
the proposed real-time simulation platform with the real-time time-step of
2.6µs and the right column contains the results from the reference method,
using PSCAD with the time-step of 2.6µs. . . . . . . . . . . . . . . . . . 122
6.15 (a) Microgrid case study system embedding four DER units . . . . . . . 123
6.16 Simulation results of DER currents in the microgrid start-up. DER1 to
DER4 three-phase currents are shown in the first to fourth row, respec-
tively. The left column includes the results from FPGA-based method,
based on the proposed real-time simulation platform with the real-time
time-step of 2.6µs and the right column contains the results from the ref-
erence method, using PSIM with the time-step of 2.6µs. . . . . . . . . . . 124
6.17 Simulation results of IMs in the microgrid start-up. IM1 to IM3 three-
phase currents are shown in the first to third row, respectively. Fourth and
fifth row are respectively the electromagnetic torque and the mechanical
speed of the IMs. The left column includes the results from FPGA-based
method, based on the proposed real-time simulation platform with the
real-time time-step of 2.6µs and the right column contains the results from
the reference method, using PSIM with the time-step of 2.6µs. . . . . . . 125
6.18 Simulation results of DER currents in the microgrid fault study. DER1 to
DER4 three-phase currents are shown in the first to fourth row, respec-
tively. The left column includes the results from FPGA-based method,
based on the proposed real-time simulation platform with the real-time
time-step of 2.6µs and the right column contains the results from the ref-
erence method, using PSIM with the time-step of 2.6µs. . . . . . . . . . . 126
xiv
6.19 Simulation results of IMs in the microgrid fault study. IM1 to IM3 three-
phase currents are shown in the first to third row, respectively. Fourth and
fifth row are respectively the electromagnetic torque and the mechanical
speed of the IMs. The left column includes the results from FPGA-based
method, based on the proposed real-time simulation platform with the
real-time time-step of 2.6µs and the right column contains the results from
the reference method, using PSIM with the time-step of 2.6µs. . . . . . . 127
xv
List of Abbreviations
AB: Adam Bashforth
ADC: Associate Discrete Circuit
BE: Backward Euler
BRAM: Block RAM.
CHIL: Control Hardware-In-the-Loop
CLB: Configurable Logic Blocks
CPU: Central Processing Unit
CPVBR: Constant-Parameter-Voltage-Behind-Reactance
DER: Distributed Energy Resource
DRTS: Digital Real-Time Simulator
DSP: Digital Signal Processing
EM: Electrical Machine
EMF: Electromagnetic Force
EMT: Electromagnetic Transients
FE: Forward Euler
FEM: Finite Element Model
FIFO: First In First Out
FPGA: Field Programmable Gate Array
GPU: Graphical Processing Unit
HDL: Hardware Description Language
HF: High Frequency
HIL: Hardware-In-the-Loop
HLS: High-Level Synthesis
HPC: High Performance Computing
HuT: Hardware under Test
IHULM: Inter-Hardware Universal Line Model
IM: Induction Machine
LMS: Linear Multi-Step
LUT: Look-Up Tables
MB: MicroBlaze
MMC: Modular Multilevel Converter
MNA Modified Nodal Analysis
MUX: Multiplexer
NA: Nodal Analysis
PCI-E Peripheral Component Interconnect Express
xvi
PD: Phase Doamin
PEC: Power Electronic Converter
PHIL: Power-Hardware-In-the-Loop
PMSM: Permanent Magnet Synchronous Machine
PU: Process Unit
PV: Photovoltaic
QD: Quadrature-Direct
RMNA: Reformulated Modified Nodal Analysis
SIL: Software-In-the-Loop
SM: Synchronous Machine
SoC: System on Chip
TR: Trapezoidal
TS: Transient Stability
ULM: Universal Line Model
VBR: Voltage-Behind-Reactance
xvii
Chapter 1
Introduction
1.1 Background
Analysis of power system transients is a required step for design verification and perfor-
mance evaluation of power systems. Power system transients are divided into electromechanical-
and Electromagnetic Transients (EMTs). EMTs are changes in voltages and currents due
to small-signal and large-signal disturbances in the power system and are characterized
by their time-scales and/or natural frequencies of current and/or voltage waveforms.
Power system EMTs cover a wide frequency range, e.g., 0-2MHz, and different studies
target different span of this range. Control/protection related studies need to consider
frequencies from approximately 0.1Hz up to several tens of kHz.
Time-domain simulation is the most convenient way of studying EMTs for power
systems since analytical solution of the power system nonlinear equations is practically
impossible. Real-time simulation of EMTs is a class of time-domain simulation in which
the (voltage/current) waveforms during the study time-frame are reproduced at the same
speed as the actual phenomenon occurs.
Real-time simulation of the power system is a requirement for Hardware-In-the-Loop
(HIL) simulation where actual control/protection hardware platform and/or power de-
vices need to be tested before being installed in the power system. Emerging trends in
power systems, e.g., integration of renewable resources and energy storage systems into
the power system through Power Electronic Converters (PECs) have introduced many
challenges in real-time simulation, e.g., the need for small simulation time-step.
The Field Programmable Gate Array (FPGA) technology presents features to over-
come such challenges. This work aims to develop a real-time FPGA-based simulator
platform for real-time simulation with emphasis on the characteristics of emerging power
systems which embed large number of high switching frequency PECs. This Chapter
explains the basic concepts and highlights the existing shortcomings and methodology to
1
CHAPTER 1. INTRODUCTION
address them.
The remainder of this chapter is as follows. Section 1.2 elaborates on the statement of
the problem. First, power system transient analysis is briefly explained and simulation of
EMTs is described. Next, different types of real-time simulation of EMTs are explained.
Then, the characteristics/properties of the existing real-time simulators are summarized.
At the end of this section, the motivation for this thesis is presented. Section 1.3 explains
the research objectives based on the identified limitations. Section 1.4 provides the thesis
outline.
2
CHAPTER 1. INTRODUCTION
Long-term Dynamics
Transient Stability
Subsynchronous resonance
Switching
Lightning
transients under the umbrella of EMTs [6]. This thesis focuses on electromagnetic tran-
sients that are considered in control/protection related studies and are at frequencies
approximately within the bandwidth of 0.1Hz up to several tens of kHz.
The electromechanical transient studies are usually referred to as Transient Stability
(TS) studies, although TS is a subcategory of electromechanical transients. TS primarily
deals with angle stability of the power system which is the ability of the power system
to preserve synchronous operation of synchronous generators. For TS studies the power
system model is combination of algebraic and differential equations. Since in this class of
dynamics the frequency deviations are small, the phasor concept is used to represent the
power network by algebraic equations. Moreover, per-phase representation is adopted.
There is a large number of commercially available TS simulation software packages, e.g.,
PSS/E and DigSilent.
In contrast to TS analysis, for EMTs, each power system component is represented by
differential equations. For instance, long transmission lines are represented by frequency
dependent models and each PEC is modeled as a repetitive switching apparatus. Thus
instantaneous values of the system variables are obtained by solving the set of differen-
tial/algebraic equations representing the overall power system. The system model for
EMT studies is dominated by differential equations.
3
CHAPTER 1. INTRODUCTION
time-scale of the phenomenon is short and parasitic elements are of significant importance
and must be considered in the model [6].
Verifying performance of control and protection algorithms is one of the most impor-
tant applications of EMT analysis methods. In this context, instantaneous voltages and
currents are required to determine overvoltage and overcurrent stresses. Moreover, the
system behaviour in several cycles after the transient inception is required to investigate
the system recovery. The time-frame of such studies in the presence of PECs is within
tens of nanoseconds to several tens of milliseconds. This time-frame requires appropriate
component models to properly capture the associated physical phenomena.
Since analytical solution of the differential algebraic equations of a realistic-size power
system for the EMT study is practically impossible, therefore, the equations are solved
based on numerical approaches. This requires the component models to be discretized
using a numerical integration method. This approach is known as digital time-domain
simulation method and hereinafter we simply refer to it as simulation. Selection of
simulation time-step depends on the frequency of the phenomenon under investigation.
The simulation time-step to verify performance of control and protection algorithms is
approximately in the order of 0.5 to 50 microseconds.
If the actual elapsed time for performing the simulation at each time-step is longer
than the time-step, the simulation inherently only can be carried out in an off-line man-
ner. Otherwise it can be conducted in real-time. There are several commercially available
offline EMT simulation software packages, i.e., PSCAD, EMTP-RV, DigSilent and Sim-
PowerSystem. In addition to tailored software environment, real-time simulation also
requires specialized hardware platform. Real-time simulation and the existing real-time
simulation hardware and software platforms and their limitations are briefly explained
in the following sections.
4
CHAPTER 1. INTRODUCTION
and interfaced to the HuT by a signal conditioning hardware and the overall platform
called Control Hardware-In-the-Loop (CHIL). Fig. 1.2 shows the CHIL block diagram.
For CHIL tests the signal conditioning hardware mostly consists of Analog to Digital
converter (A/D) and Digital to Analog converter (D/A). However, additional amplifiers
might be needed in some CHIL applications, e.g., for protection relays that operate at
high current/voltage levels.
DRTS HuT
Performance evaluation of power apparatus, e.g., a PEC, also can be carried out
by DRTS particularly in view of the advent of new converter topologies/configurations
/applications and interfacing DRTS and power apparatus is gaining more attention. In
this scenario, the HuT is a power apparatus and the simulation platform is referred
to as Power-Hardware-In-the-Loop (PHIL) platform. For PHIL simulations, the signal
conditioning hardware is current and/or voltage amplifiers. It should be noted that in
a PHIL simulation the amplifiers should be able to sink or source power since there is a
real power exchange between the amplifier and the HuT.
To conduct all types of real-time simulation, i.e., SIL, CHIL and PHIL, the DRTS
must be capable of solving the overall system mathematical model, including the power
system models and the control/protection models. The solution of power system models is
more challenging than the solution of the control/protection models and the limitations
of the existing DRTSs is primarily in solution of the power system models. In this
thesis, a high performance DRTS architecture is devised to address the limitations of the
existing DRTS technologies. The envisioned DRTS has the capability to cooperate with
an existing real-time simulation platform to use its capability to solve control/protection
models and its signal conditioning hardware. In the following sections the existing DRTSs
are briefly explained and their limitations, particularly for the emerging power systems,
are highlighted.
5
CHAPTER 1. INTRODUCTION
6
CHAPTER 1. INTRODUCTION
The other simulators described in the following parts are the research-oriented devel-
opments which are not commercially used.
• The developments in [21] and [22] have achieved tens of nanoseconds computa-
tion time for simulation of Electrical Machiens (EMs) and PECs, based on the
ADC modeling approach for power switches. These developments are based on
fixed-point data representation. Fixed-point arithmetic does not provide adequate
accuracy especially for large study systems [10] [18].
• For motor drive applications there are several FPGA-based DRTS trials. In this
category, switching loss effect of the power semiconductors with linear approxima-
tion [23] or lookup tables, obtained based on actual experimental results of the
switch devices [24] are included in the simulation. The work done in [25] imple-
ments the EM model with different numerical representation is direct-quadrature
reference frame.
• The FPGA-based DRTS in [29] implements partitioning algorithm for PEC simula-
tion. It utilizes customized floating-point representation to achieve small simulation
time-step. This has been applied to a case study which includes one PEC.
• References [30] and [31] provide FPGA-based platform for the transmission line
model and the universal EM model, however, no PEC representation is considered.
7
CHAPTER 1. INTRODUCTION
220/20kV 220/20kV 1
1
2
2.8 km
2
4.9km
4.4 km
3
0.6 km 1
3
4 8
3.0km
9 1
0.6 km CHP 4
Fuel 2.0km
1 Cell
1
0.3 km
7
10
5 PEC
transformer
0.2 km bus
1.5 km Fuel Fuel 6
Cell Cell load
the correspondng simulation studies to partition the system and reduce the simulation
burden [13].
Furthermore, CHIL real-time simulation study is becoming an indispensable and es-
sential step to verify performance of control/protection algorithms prior to installation
in the power system, e.g., in the system of Fig. 1.3. The reason is that emerging control
and protection algorithms are more complicated than those of the established classical
power systems. Thus, to perform real-time simulation of power systems which include
switch-mode PECs, new requirements are imposed on DRTS platforms. These include:
• The need for a small simulation time-step to simulate switching transients of PECs.
Considering the switching frequency of the PECs in power system, e.g., 10 kHz, µs
range time-step is appropriate.
• Proper emulation of the EMs under different test scenarios and system configura-
tions with a small time-step. Classical Quadrature-Direct (QD) EM models fail to
8
CHAPTER 1. INTRODUCTION
efficiently emulate the EM behaviour in all test scenarios, e.g., rectifier mode of a
drive system [33].
• Capability to simulate systems with large number of nodes. The emerging power
systems, particularly distribution voltage-class systems, feature short transmission
lines which do not lend themselves to the travelling wave models. This results in
one set, rather than multiple partitioned sets, of equations describing the power
system model for EMT studies.
Commercial real-time simulation platforms, e.g., RTDS, use FPGAs for input/output
signal conditioning while Central Processing Unit (CPU) cards for computation [8] which
is a proven and mature approach for simulation of classical power systems. However, it
has major limitations to simulate emerging power systems at the presence of a large
number of switch-mode PECs due to the requirement for small simulation time-step,
e.g., 1µs. The reason is that the communication delay between the processing units is
usually larger than this time-step.
Geraphical Processing Unit (GPU) has also been used for high performance compu-
tation in power system studies, e.g, TS simulation [34]. However, the latency of the
Peripheral Component Interconnect Express (PCI-E) link of the GPU is larger than the
required time-step for simulation of emerging power systems. Therefore, GPU is not
considered as a computation device for DRTS applications.
Recently, FPGA has received significant attention for DRTS applications. FPGA pro-
vides reconfigurable hardware programming which enables development of application-
specific parallel computation engines. Moreover, all the data storage and computation is
done in one chip which enables use of small simulation time-steps.
FPGA features have resulted in multiple attempts for development of FPGA-based
DRTS to simulate power systems embedding PECs and EMs. However, such develop-
ments suffer from a set of basic shortcomings, as follows:
• It is not computationally feasible to change and solve new admittance matrix of
study system for every switching event, particularly when the simulation time-
step is small. Thus most real-time simulators use ADC approach that represent
a switch as fixed admittance configuration with a small capacitor or inductor for
on-off operation, respectively [10] [21] [35]. This leads to i) numerical oscillations in
simulation results and ii) unacceptably large switching loss, e.g., 3.7% of nominal
power for a 21-Pulse STATCOM with 1.4µs simulation time-step [10].
• All developments use classical direct-quadrature reference frame for EMs. This
model exhibits deficiency for simulating EMs for specific case studies and/or test
scenarios [33].
9
CHAPTER 1. INTRODUCTION
• The existing FPGA-based DRTSs do not target power systems that include a large
number of PECs and EMs. Reference [31] reports simulation of a large classical
power system in real-time, however, it does not include PECs.
Considering these limitations of the existing DRTS development efforts, one can con-
clude that the existing models and implementations lack the ability to accurately and
computationally-efficiently simulate the emerging power systems. Therefore, there is a
need to enhance both modeling approaches and FPGA-based implementation of the mod-
els. The main focus of this work is to address these shortcomings of the FPGA-based
DRTS, i.e., (i) development of PEC model for FPGA-based implementation, (ii) devel-
opment of proper FPGA-based EM models, and (iii) development of the FPGA-based
real-time simulator platform for the emerging power systems in the context of CHIL.
• Development of an FPGA-based DRTS platform for the power systems that include
multiple PECs and classical components. This requires:
10
CHAPTER 1. INTRODUCTION
11
CHAPTER 1. INTRODUCTION
A discretized model is deduced and the method to enable parallel processing of the EM
simulation task with other tasks in the computation engine is presented. An FPGA-based
EM module based on the proposed method is designed. Based on enhancement of the
computation engine with this module, simulation test cases are carried out to evaluate
performance of the proposed model and its implementation.
Chapter 6: Hardware Platform for Real-time Simulation of the Emerging
Power Systems
This chapter presents the hardware platform of the real-time simulator including
the FPGA-based computation engine and RTDS. This chapter also explains the ap-
proach, based on the use of transmission line model, to enable simulation of the emerging
power systems on the FPGA-based computation engine and the classical ones on RTDS.
Simulation-based case studies are carried out to evaluate the performance of the proposed
real-time simulator.
Chapter 7: Conclusions and Future Work
This chapter summarizes the work, highlights the conclusions, identifies contributions
and provides suggestions for future research.
12
Chapter 2
2.1 Introduction
The Field Programmable Gate Array (FPGA) was originally developed for digital design
prototyping purposes in late 1980s. Designs could be prototyped and debugged before
mass production. As the FPGA technology improved it became the popular comput-
ing device for applications to various fields, e.g., communication. However, in most of
the computational-intensive applications CPU technology was the main choice until it
was revealed that the clock speed of the processor would not be significantly increased
due to power consumption considerations. Since transistor count increase is achievable,
parallel architecture became the solution to increase computational power. FPGA gener-
ally provides a large amount of reconfigurable resources that can be configured to create
application-specific parallel computational engines to achieve performance goals that can
not be achieved by other parallel processing technologies, e.g., multi-core coprocessors.
This makes FPGA the main computation engine in many High Performance Computing
(HPC) applications [39]. Most of these applications feature low latency and high com-
putation power requirement. Power system and power electronics real-time simulation
applications share the same features [18] [40].
Unlike a processor, in which architecture of the Arithmetic Logic Unit (ALU) is fixed
and designed in a general-purpose manner to execute various operations, the FPGA
hardware resources can be configured to perform just the operations needed by the specific
application. This flexibility results in increased performance, however, it comes at the
cost of FPGA resource utilization. Thus an implementation of a desired algorithm is
evaluated based on both performance and resource utilization.
13
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
Different FPGA families from different vendors provide different resources available on
the FPGA chip. For example Virtex-7 is a family of Xilinx FPGAs accommodating
large amount of resources which are usually used for compute-intensive purposes. In this
work Xilinx’s VC7VX485T chip from this family is selected, therefore, the resources of
Virtex-7 family is explained in this chapter. The main FPGA resources are Configurable
Logic Blocks (CLBs), Digital Signal Processing (DSP) blocks and Block RAMs (BRAMs).
CLBs and DSPs, similar to a processor’s ALU, can be programmed to perform arithmetic
and logic operations including integer add, multiply, subtract and compare. Utilization
of BRAMs, CLBs and DSPs and performance indices, e.g., latency, are used to evaluate
the implementations of an algorithm. These three type resources are briefly described as
follows.
CLBs are the main FPGA resources for implementing sequential and combinational logic.
Fig. 2.1 illustrates the CLB arrangement in the FPGA. Each CLB element is connected
to a switch matrix for access to the general routing matrix. This provides routing to
the other FPGA resources. In addition, each CLB is connected to the other CLBs
through carry chain which is designed for implementing arithmetic logic functions with
high speed performance due to its dedicated hardware. A CLB element contains a pair
of slices. Every slice contains four 6-input look-up tables (LUT), eight storage elements
or Flip-Flops (FFs), wide-function multiplexers and carry logic.
14
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
Cout
CLB
Clock
Slice
Switch Matrix
Switch Matrix
Cin
Slice
Data
Data
Figure 2.1. CLB resource in Virtex-7 family.
A
+
B P
25*18
Multiplier
+ =
C
Pre-adder
15
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
In First Outs (FIFOs). Fig. 2.3 depicts the Xilinx FPGA block RAM. Each block can
have up to two ports which share the same data memory. Each BRAM contains 36Kb
of memory and can be segmented into two 18Kb blocks. This is the smallest block that
can be achieved. Larger blocks are obtained by simply cascading multiple BRAMs. Each
block can be either configured as dual port or single port RAM. Table 2.1 contains the
number of BRAM resources as well as other resources available on the VC7VX485T chip.
Data In
Address
Port A Data Out
Write Enable
Clock
Memory
Data In
Address
Port B Data Out
Write Enable
Clock
Table 2.1
Hardware Rsources available on VC7VX485T
16
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
where biti is the ith bit of the fraction, p is the number of bits in the fraction and
e = Exponent − 2N −1 , (2.2)
The FPGA was originally used to implement fixed-point algorithms. With the im-
provements of the Computer Aided Design (CAD) tools for FPGA programming and
increase in the hardware resources available on FPGA chips, implementation of floating-
point arithmetic on FPGA is becoming of more interest. However, understanding of the
floating-point arithmetic IP cores available from the FPGA vendors is essential for an
efficient compute-intensive design. This is due to the fact that inefficient utilization of
these IP cores will consume large amount of the FPGA resources and therefore limits the
performance.
Fig. 2.5 depicts the resource utilization and maximum clock frequency of the single
and double precision floating-point adder for Xilinx Virtex 7 family as a function of
latency [2]. Latency is the number of clock cycles it takes for the IP core to produce the
results. This is equal to the number of register stages in the data path which is referred
to as number of pipeline stages. The lines with circle marker are for double precision
adder IP core while the ones with square marker are for single precision adder IP core.
One can observe that the more the number of pipeline stages is, the more the maximum
clock frequency will be. Also more pipeline stages result in more FF utilization, however,
LUT utilization is nearly unchanged for IPs with different latencies. One can conclude
that double precision adder consumes approximately three times more LUTs and FFs
than a single-precision adder.
17
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
1000
Speed(MHz)
900 FFs
LUTs
800
700
600
Resource
500
400
300
200
100
0
2 4 6 8 10 12 14
Latency(clock cycles)
Figure 2.5. Resource utilization of floating-point adder IP core optimized for speed [2]
18
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
2.4.1 Unrolling
Unrolling a parallel algorithm in the context of FPGA-based HPC is to create multiple
instances of the same hardware unit and assign the same task to each hardware unit.
For instance, consider a floating-point vector addition of two vectors of length l. In a
completely unrolled case, the same number of floating-point adders can be instantiated.
Consider all the floating-point adder cores are configured to have 6 clock cycles latency.
Therefore, the latency of the completely unrolled vector addition will be 6 cycles. How-
ever, l times the FPGA resources of a floating-point adder IP core is required.
2.4.2 Pipelining
Pipelining is a technique to divide an algorithm into sequential steps, with each step
being performed in a special dedicated segment that operates concurrently with the other
segments. Each segment executes a part of the overall algorithm and passes the data
to the next one. The algorithm is finished when data is outputted by the last segment.
This enables the first segment to input a data set while the other data sets are being
processed in the middle segments.
Floating-point arithmetic IP core provided by FPGA vendors are pipelined. Consider
the vector addition example using one adder IP core. Each addition takes 6 clock cycles
to finish. Fig. 2.6(a) shows the timing of a simple vector addition of a + b = c, using one
floating-point adder IP instance. The hardware waits until each addition is completed
to start the next one. This approach is not efficient and doesn’t take advantage of the
existing parallelism in the vector addition and pipelining capability of the hardware.
Using a pipelined design, two vectors of length l can be added more efficiently. The
timing of the pipelined design is shown in Fig. 2.6(b). At each clock cycle a new data
set is inputted by the adder and after 6 cycles the corresponding addition result is ready.
The latency in this case is 6 + l. The increase in performance obtained from pipelining is
approximately proportional to the number of pipeline stages. However, this holds only
if data moves through the pipeline stages without any stalling. This is referred to as
stall-free pipeline.
Pipelining and unrolling are methods to exploit the parallelism in an algorithm which
can be respectively limited by data dependency between the tasks and the FPGA resource
limitation. Data dependency implies that each task cannot be started until the other task
has finished. An algorithms with data dependency might require to be reformulated to
overcome its anti-parallel pattern. For instance, there is data dependency in the floating-
point accumulation of a vector since each addition is not started until the previous
addition has been completed. This can be solved by reformulating the algorithm as
19
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
Clock
Input 1 a0 a1 a2 al
Input 2 b0 b1 b2 bl
6 clock cycles
Results c0 c1 cl
(a)
Clock
6 clock cycles
Results c0 c1 c2 c3 c4 c5 cl-12 cl-11 cl-10 cl-9 cl-8 cl-7 cl-6 cl-5 cl-4 cl-3 cl-2 cl-1
(b)
Figure 2.6. Timing of floating-point vector addition (a) without and (b) with pipelining.
follows.
l−1
X
Acc = x[i], (2.3)
i=0
where x is the input vector and Acc is the accumulation result. The drawback is that
it takes a certain number of clock cycles for the floating-point adder IP core to execute
each addition while the next addition requires the results from the previous ones. This
20
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
5
X
Acc = P acc[j], (2.4)
j=0
(l/6)−1
X
P acc[j] = x[6i + j]. (2.5)
i=0
This approach divides the accumulation process into two steps, first is the calculation of
six partial accumulations and second is the calculation of the final results by adding up
the partial accumulations. The first step can be executed in parallel with throughput of 1
data per clock cycle. Fig. 2.7 depicts the timing of this step. Every each six clock cycles,
the new data corresponding to each sub-vector is inputted. Based on this method in every
clock cycle that a new x[i] is inputted by the adder IP core, the corresponding P acc[j]
is ready to be added to it. Therefore, the step of calculating the partial accumulations
takes 6 × (l/6) = l cycles. The next step is to accumulate P acc[j]s. It takes 22 clock
cycles for the adder IP core to finish the second step. Therefore, the accumulation of a
vector of length l takes l + 22 clock cycles using one adder IP instance with 6 clock cycles
latency.
Clock
Input 2
Pacc0 Pacc5 Pacc0 Pacc5 Pacc0 Pacc5
Results l-6 clock cycles Pacc0 Pacc1 Pacc2 Pacc3 Pacc4 Pacc5
Other designs are possible to enable trade-off between performance and resource uti-
lization. Consider the case where two vector accumulations are carried out using one
floating-point adder IP core. The accumulations can be expressed by
l−1
X l−1
X
Acc1 = x1 [i] , Acc2 = x2 [i]. (2.6)
i=0 i=0
21
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
The same reformulation can be applied by dividing the algorithm into two steps. The
first step, i.e., calculation of the six partial accumulation terms for the two vectors, is
equivalent to calculating six partial accumulation of a vector x of length 2l given by
However, in the second step for each output, only three partial accumulations are added
to produce Acc1 and Acc2 . It takes 14 clock cycles for the adder IP core to finish the
second part. This results in total latency of 2l + 14 clock cycle. Table 2.2 contains
the latency and number of adder IP cores per vector accumulation for different designs.
The first design has the latency of 6l and every adder IP core can be used to execute
six vector accumulations. This design compromises speed to save hardware resources.
Conversely, the last design in which three adder IP instances are utilized to execute one
vector accumulation has lower latency but higher resource utilization. These designs offer
a trade-off between performance and resource utilization. Depending on the speed goals
and resource utilization constraints, throughout this work different accumulator designs
are used in different algorithms.
Table 2.2
Characteristics of Floating-Point Accumulator Designs
22
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
23
CHAPTER 2. FPGA-BASED HIGH PERFORMANCE COMPUTING
24
Chapter 3
3.1 Introduction
For simulation of power system EMTs, the power network is represented by set of differen-
tial and algebraic equations. The main course of this chapter is to design a floating-point
computation engine to solve such differential equations. The proposed computation en-
gine features (i) a fixed digital hardware independent of system topology, (ii) parallelism
between simulation tasks and (iii) efficient utilization of FPGA hardware resources.
Section 3.2 describes different formulation for power network representation for EMT
simulation. The features and drawbacks of different formulations are explained and the
one for FPGA-base implementation is introduced. Section 3.3 explains the structure of
the real-time simulation platform, the FPGA-based solution of the power system equa-
tions and its interface with the classical CPU-based RTDS real-time simulator. Section
3.4 describes further details of solving of the network equations using FPGA, explains
anti-parallel patterns and elaborates on the proposed reformulations to enable paral-
lelism. The design of the pipelined computation engine that exploits the enabled paral-
lelism is also provided.
25
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
embedding PECs, the repetitive switching of PECs prevents the solver from increasing
the time-step. Moreover, in real-time simulation fixed time-step method is preferred over
variable time-step method. Therefore, fixed time-step method is considered in this work.
The differential equations representing a power system model for EMT studies consti-
tute a stiff system. Therefore, implicit stiff numerical integration methods are employed
to obtain the simulation results at each time-step [44]. This leads to the solution of a
set of (possibly time-variant) linear equations at each time-step. Different formulations ,
i.e., state-space, nodal formulation and combined nodal and state-space can be adopted
for this purpose.
ẋ = Ac x + Bc u,
(3.1)
y = Cc x + Dc u.
Vector x contains state variables, i.e., capacitor voltages and inductor currents and u is
the vector of inputs. Subscript c indicates the continuous-time equations.
One feature of state-space formulations is that it can be solved by a general integration
method. A Linear Multi-Step (LMS) integration method can be used to carry out such
a task. For power system EMT analysis usually an implicit one-step LMS integration
method is used. Applying an implicit one-step LMS integration method, the discrete-time
equations are
where Md , Ad , Bd1 , Bd2 , Cd and Dd are discrete-time state-space matrices. In the case
of the commonly used Trapezoidal (TR) LMS integration method [4] these matrices are
26
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
2. Calculate discrete-time system matrices from (3.3) (if there is any change).
3. Solve (3.2) to find the state variables xn+1 .
4. Calculate the outputs yn+1 .
The main feature of the state-space formulation is that it enables eigenvalue analysis
of both continuous-time and the resulting discretized equations after applying the LMS
integration method. This is advantageous in selection of proper LMS integration method
and simulation time-step for a specific problem. State-space approach allows evaluation of
simulation stability and usage of iterative methods for real-time EMT simulation of PECs
[45]. The reason is that in the state-space formulation, the vector of unknowns is the
vector of state-variables, e.g., capacitor voltages and inductor currents. This quantities
do not dramatically change from one time-step to the next. This allows employing the
state variable vector from previous time-step xn as the initial guess for the iterations to
obtain xn+1 .
However, the state-space formulation suffers from complex process of assembling the
network equations. The reason is that organizing the network equations in solely dif-
ferential form is not straightforward. If a parameter changes during the simulation, it
will be a time consuming task to obtain the new set of differential equations. This has
consequently prevented state-space formulation to be employed in simulation of power
system EMTsm, specially in presence of PECs. SimpowerSystem [46] is the main off-line
EMT simulation software package that uses state-space formulation.
diL
L = vL . (3.4)
dt
Discretized form of (3.4), based on TR integration method, is
∆t n+1
in+1
L − inL = (v + vLn ), (3.5)
2L L
27
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
Table 3.1
Discrete admittance and history update coefficients for different branches
Branch Type cv ch g
∆t ∆t
Inductor L
1 2L
−4C 2C
Capacitor ∆t
−1 ∆t
4L∆t 2L−R∆t 1
Series RL (2L+R∆t)2 2L+R∆t 2L
R+ ∆t
−4C∆t 2RC−∆t 1
Series RC (2RC+∆t)2 (2RC+∆t) ∆t
R+ 2C
∆t n
in+1
h = inh + v
L (3.7)
= ch inh + cv v n ,
where ch and cv are the coefficients relating the magnitude of history current at time-
step n + 1 to inh and v n , i.e., the history current and the branch voltage at time-step n,
respectively.
For capacitors, series RL and series RC branches an expression analogous to (3.7) can
be obtained. The equivalent circuit of (3.7) is depicted in Fig. 3.1. Table 3.1 summarizes
the history current updating coefficients and the discrete admittances for different type
of dynamic branches.
v
vn+1
i R R
L C g ihn+1
L C
Figure 3.1. Continuous-time and discretized model of L, C, series RL and series RC branches
28
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
Using companion models of dynamic elements, the network model at each time-step is
a resistive network including voltage/current sources. The available methods to develop
the equations of such a network are Sparse Tableau [38], Nodal Analysis (NA) and Mod-
ified Nodal Analysis (MNA) [47]. NA and MNA result in smaller size matrices relative
to Sparse Tableau . Moreover, the matrices in NA and MNA are easily constructed by
inspection of the case study system netlist. Therefore, most of the power system EMT
analysis tools and circuit simulators use NA or MNA.
A feature of NA is that the resulting matrix is symmetric and its drawback is that it
can not include voltage sources in the formulation. Therefore, NA needs to introduce an
artificial series resistance for each voltage source. MNA enables inclusion of independent
and dependent voltage sources. Therefore, MNA is selected to form the network equations
in this work.
The network mathematical model based on MNA is [4]
" #" # " #
G Ag vn+1 un+1
i
n+1
= n+1 , (3.8)
Bg 0 ivs vs
| {z } | {z } | {z }
Y xn+1
node un+1
node
where
un+1
i = in+1
h + in+1
s . (3.9)
un+1
i is the nodal current injection vector. in+1
h and in+1
s are vectors of history and in-
dependent current sources entering the nodes, respectively. vn+1
s is the vector of voltage
n+1
sources, vn+1 and ivs are the vectors of unknown node voltages and voltage source cur-
rents, respectively. It is assumed that the dependent sources are either voltage-controlled
voltage sources or current-controlled current sources. Therefore, the bottom right sub-
matrix of the MNA matrix is 0. G is the conductance matrix, Ag and Bg are matrices
defining node incidence of the independent voltage sources and dependent sources. Equa-
tion (3.8) can be rewritten as
Yxn+1 n+1
node = unode , (3.10)
29
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
and leakage inductances. Fig. 3.2 (b) illustrates the corresponding discretized model.
The ideal transformer is modeled by dependent sources. The history current sources are
modeled by independent sources. The reason is that the each history current source at
each time-step is found from the data from the previous time-step. The ideal transformer
turns ratio and node incidences appear in matrices Ag and Bg .
3
1:n 1
1 3
v1 is
Rp Lp Ls Rs
Lm nis nv1
2 4 2 4
Transformer lumped element model Transformer discretized model
(a) (b)
Based on the discussion of this section, the steps to solve the network equation, based
on nodal formulation, include:
The main reason that nodal formulation is widely accepted for simulation of power
system EMTs, especially in the presence of switches where the admittance values in
the network model are repetitively changing, is that it easily lends itself to systematic
preparation of the network equations by inspection of the netlist file containing the con-
figuration of the study system. PSCAD, EMTP-RV and real-time RSCAD and HyperSim
EMT simulation software packages use nodal formulation. This thesis uses a combined
nodal and state-space formulation as described in the following section.
30
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
where unint is the vector of internal independent sources of the subsystem. unext is the
vector of independent voltage sources connected to the subsystem terminals and yn+1
is the vector of current outputs of the subsystem terminals. The vector of new state-
variables xn+1 can be deduced from the first row of (3.11) and substituted in the second
row to obtain yn+1 , i.e.,
history term
z }| {
yn+1 = Cd M−1 n n n n+1 n+1
d A d x + B u
d1int int + B u
d1ext ext + B u
d2int int + D u
dint int +
(3.12)
Cd M−1 n+1
d Bd2ext + Ddext uext .
| {z }
admittance matrix
Subsystem equivalent admittance matrix Yss and history current source vector in+1 hss can
be obtained from (3.12). In this formulation the main part of the system uses nodal
formulation. The subsystem admittance matrix Yss and the history current source vector
in+1 n+1
hss are respectively included in the admittance matrix Y and nodal injection vector unode
of the main system, i.e., (3.10). The equivalent circuit of (3.13) is depicted in Fig. 3.3.
The solution steps to solve network equation, using combined nodal and state-space
formulation, include:
31
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
yssn+1=issn+1
ihssn+1 uextn+1=vssn+1
Yss
The combined nodal and state-space formulation exhibits two features. First, it
can be employed to overcome the limitations of the pure state-space based algorithms
to simulate case studies containing variable parameters, e.g., circuit breakers [15] [16].
Second, in some cases the state-space model of the subsystem is already available. This
method enables the integration of such subsystem models into a software package that
is based on nodal formulation. Moreover, using this approach and separating parts of
the system into groups reduces the main system matrix size. This generally reduces
the computational burden since most of the algorithms in the solution of the network
equations are O(n2 ) or O(n3 ) where n is the dimension of the admittance matrix.
Frequency dependent of long transmission line models, i.e., those of overhead lines
and underground cables, are usually obtained in state-space form. In this work the
combined state-space and nodal formulation is employed to include the transmission line
frequency-dependent model into the main system model.
32
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
i2n+1 i1n+1
iw2n+1= iw1n+1=
ih2n+1 ih1n+1
v2n+1 Ytr f(v1n-nτ ,i1n-nτ) f(v2n-nτ ,i2n-nτ) Ytr v1n+1
mission lines are short. Therefore, in simulation of EMTs, lumped element models, e.g.,
PI section, are used [13] which does not provide parallelism property.
Figure 3.5(b) depicts the structure of the system equations for simulation of power
system EMTs. Short transmission line and high switching frequency PECs result in a
single large set of equations which requires to be solved with a small time-step. Figure
3.5(c) illustrates the envisioned hardware architecture for the DRTS platform in this
work. The single large set of equations representing the distribution level part of the
power system is solved in the FPGA. Transmission line travelling-wave model is employed
to interface this part of the power system model with the model of the host grid (often
classical part) which is simulated in the RTDS.
Section 3.4 describes the solution of single large set of equations representing the
network of the emerging power system. The line model and the corresponding FPGA-
base implementation are explained in chapter 6.
33
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
Transmission
Generation
Distribution
Fiber Optic
is constructed using the simulation modules and other digital modules to control and
interconnect them. These tasks are explained as follows.
Each simulation time-step needs to to solve (3.10). If matrix Y is time-variant, ma-
trix inversion is not used since it is computationally expensive . Instead, the two-step
LU factorization is used, i.e., (i) computing the L and U factors and (ii) forward- and
backward substitution [4]. However, in the small time-step real-time FPGA-based simu-
lation of EMTs, on-the-fly LU factorization, particularly in the case of large admittance
matrices, must be avoided [35]. If Y is time-invariant, the pre-calculated inverse matrix
or LU factors can be used. Time-invariant Y is generated by modeling techniques that
avoid admittance matrix variations during simulation which can introduce inaccuracies,
e.g., ADC power switch model [11]. The proposed techniques to maintain the admittance
matrix of the network invariant while maintaining the accuracy for simulation of PECs
and EMs are presented later in chapters 4 and 5, respectively.
Assuming time-invariant admittance matrix, the inverse matrix approach is employed
in this thesis. The reason is that forward- and backward substitution are inherently
sequential procedures and include division operation, therefore, FPGA-based low latency
34
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
execution of these algorithms, i.e., small simulation time-step is not achievable. However,
matrix-vector multiplication contains parallelism and can be exploited using unrolling
and pipelining. More importantly, task level parallelism can be enabled by reformulation
of matrix vector multiplication as explained in the following sections.
Considering a constant admittance matrix and a combined state-space and nodal
formulation, the simulation tasks are (i) independent current and voltage source calcu-
lation, (ii) updating the branch history current sources, (iii) updating the subsystem
history current sources, and (iv) solving the nodal equation using (3.10). Since matrix-
vector multiplication is chosen over forward- and backward substitution, task (iv) is to
carry out
−1 n+1
xn+1
node = Y unode . (3.14)
The structure of the nodal injection vector un+1node is not desirable for FPGA-based im-
plementation for two reasons. First, the structure of un+1
i part of un+1
node in (3.8) depends
on the network configuration. From the above four tasks, the first three contribute
to un+1
i . Thus the construction time of this vector is not deterministic and can be
a time-consuming task depending on system configurations, considering the latency of
floating-point arithmetic operations in FPGA environment. Second, the structure of
un+1
node prevents any parallelism between the first three tasks and the fourth. The reason
is that all the first three tasks must be completed before the fourth task can be started.
As described in the previous chapter, potential parallelism in an algorithm can be
enabled by reformulating the algorithm. To overcome the above two issues, the algorithm
is reformulated as follows. A new nodal injection vector bn+1
node is defined, i.e.,
n+1
bs
bn+1 = ih = KSI un+1
n+1
node node , (3.15)
n+1
bss
where KSI is the source incidence matrix, bn+1s is the vector of independent sources, in+1
h
is the vector of branch history currents and bn+1
ss is the vector of subsystem history current
sources. KSI provides a desirable order in vector bn+1 node . It should be noted that each
n+1
entry of vector bnode is associated with only one voltage or current source, however, each
entry of vector un+1
i is a summation of current sources connected to the corresponding
node which is configuration-dependent.
For the new reformulation, the vector of unknowns xn+1
node is calculated by
35
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
n+1
xn+1
node = HRM N A bnode , (3.16)
where HRM N A is the proposed Reformulated Modified Nodal Analysis (RMNA) matrix
and defined by
HRM N A = KSI Y−1 . (3.17)
One of the objectives of this thesis is to design the DRTS independent of the com-
ponents connectivity to avoid hardware code re-compilation for each study system. The
second and third task require the voltage across each branch to carry out (3.7). How-
ever, the connectivity and therefore the positive- and negative node of each branch vary
depending on the system configuration.This can be resolved by including the history cur-
rent updating task in the matrix-vector multiplication task [35]. However, such method
results in larger matrix dimensions. Matrix-vector multiplication task is the main FPGA
resource consuming task as shown in the next section and therefore larger matrix dimen-
sions increases the overall FPGA resource consumption.
In this work the flexibility of FPGA-based design is leveraged to provide sequential
input data for a separate small history current updating module, irrespective of the
connectivity of the system under consideration. This is enabled by using Multiplexers
(MUXs) that contain data associated with the connectivity of the system.
The dimension of matrix HRM N A in (3.16) is nx × nb as compared with that of the
state-of-the-art method [35], i.e., (nx + nb ) × nx where nx and nb are the length of vectors
n+1
xn+1
node and bnode , respectively. Therefore, the proposed technique reduces the FPGA
resource consumption and consequently larger size systems can be simulated.
The proposed reformulation offers three advantages. First, it enables fixed hardware
architecture design irrespective of the connectivity of the study system. The reasons are
(i) the structure of vector bn+1
node is not dependent on the network configuration and (ii)
MUXs (as it will be in the next part) provide the branch voltages for the history current
updating module based on connectivity of the system. Second, the dimension of the
matrix-vector multiplication is kept relatively small, therefore, larger size systems can
be can be accommodated by the same FPGA, as compared to other approaches. Third,
36
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
3.4.2 Implementation
This part presents the implementation of the modules to carry out the independent source
calculation, history current updating and matrix-vector multiplication tasks.
where
sin(φn+1 (i)) stype (i) = 1
scn+1 (i) = (3.19)
1 stype (i) = 0,
and
0 < i < l1 + 1. (3.20)
where l1 is the maximum number of independent sources in the system. For DC sources
stype (i) = 0 and for AC sinusoidal sources stype (i) = 1. The phase for the ith source,
φn+1 (i), is obtained by
φn+1 (i) = 2πfs ∆t + φn (i). (3.21)
1200 n+1
φn+1
int (i) = [ φ (i)]. (3.22)
2π
37
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
bsn+1(i)
(Δt,as,stype,φ0,fs)
0
Δt φn+1(i) φn+1int(i)
-2π <x < float to
2πfs(i)
2π int
Sin(φn+1(i))
φn(i)
scn+1(i)
1199 bsn+1(i)
1.0
stype(i)
as(i)
The latency of the designed module is 47 clock cycles with the throughput of one data
per clock cycle. This implies that 47 clock cycles after the module is activated, it outputs
bn+1
s (i) at the rate of one data per clock cycle.
Based on (3.7) and Table 3.1 for each dynamic branch, at time-step n + 1 the history
current update module calculates in+1
h (i) by
in+1 n n n
h (i) = cv (i)(vp (i) − vn (i)) + ch (i)ih (i), (3.23)
where
p1 (i) and p2 (i) are respectively positive and negative node number and of the ith dynamic
branch.
38
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
History current update module inputs xnnode (p1 (i))s and xnnode (p2 (i))s from the pre-
vious time-step calculation results, i.e., time-step n, in a sequential pattern. This is to
enable pipelining in this module which requires sequential access pattern to data. More-
over, vectors p1 (i) and p2 (i) vary for different systems based on the connectivity of the
network. In the matrix-vector multiplication module design, xnnode (i)s are produced in a
parallel pattern. Therefore, a data bus is considered for xnnode .
Vector xnnode has a parallel write- and random-access read pattern. To handle the
random access read- and parallel write-pattern two Multiplexers (MUXs) are considered.
Figure 3.7 depicts the MUXs and the history current update module. These multiplexers
output xnnode (p1 (i))s and xnnode (p2 (i))s. Vectors p1 and p2 are constant parameters of the
study system which are calculated and written in the MUXs prior to simulation. Figure
3.7(b) depicts the pipelined structure of the history current update module that carries
out (3.23). Vectors cv , ch and i0h are the module parameters that are calculated and
written in it prior to the start of the simulation.
MUXs
xnoden(0)
xnoden(1)
xnoden(p1(i))
ihn+1(i)
p1 , p2 xnoden(p2(i)) (cv,ch,ih0)
ihn(i)
ch(i)
xnoden(p1(i)) ihn+1(i)
n
v (i)
xnoden(p2(i))
cv(i)
Based on (3.16), matrix-vector multiplication carries out the simulation task and consists
of nx vector dot product processes that can be conducted in parallel. The ith process is
the dot product of vector bn+1
node and i
th
row of matrix HRM N A , i.e.,
39
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
nb
X
xn+1
node (i) = HRM N A (i, j) × bn+1
node (j). (3.25)
j=1
Dot product processes can be carried out using floating point multiplier IP core and
floating-point accumulator. Depending on selected accumulator design from Table 2.2,
one or multiple numbers of vector dot product processes can be assigned to a PU, con-
sisting of a floating-point accumulator and a floating-point multiplier. This enables a
trade-off between resource consumption and module latency. In this design, each PU is
assigned to perform one dot-product process.
Fig. 3.8 shows the hardware design of the matrix-vector multiplication module. Ma-
trix HRM N A is calculated prior to the simulation and each row HRM N A (i, :) is saved in a
separate BRAM. As mentioned before, each xn+1 node (i) is calculated using one PU.
PU0
xnoden+1(0)
HRMNA(:,0)
PUj
n+1
bnode (i) xnoden+1(i)
HRMNA(:,j)
PUnx-1
xnoden+1(nx-1)
HRMNA(:,nx-1)
HRMNA(i,j)
xnoden+1(i)
bnoden+1(i)
The floating-point adder and multiplier IP cores provided by Xilinx can be configured
to use combination of DSP and CLB resources. For instance, the single precision floating-
point adder IP core can be configured to be (i) solely implemented using CLBs, (ii)
40
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
implemented using CLBs and two DSPs or (iii) implemented using CLBs and three DSPs.
More DSP utilization in an IP core reduces the CLB utilization, however, it increases
the number of pipeline stages and therefore latency of the IP core. This is an important
consideration since matrix-vector multiplication is the most resource consuming module.
It should be noted that maximizing the DSP utilization for this module uses a very small
portion of the available DSP resources on the FPGA. All multipliers and adders of this
module are configured for maximum DSP usage.
The accumulators designed in Table 2.2 are based on floating-point adder IP core
with 6 clock cycles latency. However, the latency of the Xilinx floating-point adder and
multiplier IP cores with maximum DSP utilization are 9 and 7 clock cycles, respectively.
Using these adder and multiplier IP core configuration, the latency of the floating-point
accumulator design with throughput of one data per clock cycle, similar to the fourth
design in the table 2.2, is nb + 44 where nb is the input vector size. Considering 7 clock
cycles latency of the multiplier, the latency of dot-product calculation PU is nb + 51.
Since each dot product is assigned to a separate PU, as shown in Fig. 3.8, the latency of
the matrix-vector multiplication module is also nb + 51.
To interconnect, initialize, control and change the parameters of the modules which carry
out simulation tasks, accessories are also required. Fig. 3.9 depicts the diagram of the
computation engine hardware proposed to solve the network equations. A MicroBlaze
(MB) soft processor is instantiated in the design to initialize and change parameters of the
modules. The dashed arrows are connections for the communication between the modules
and MB. The solid arrows are data streams. Vectors bn+1 s and in+1
h are concatenated to
n+1
form RMNA injection vector bnode .
Timing diagram of the computation engine is shown in Fig. 3.10. At t = tn+1 0 time-
step n + 1 starts. Since calculation of independent source values do not require any
information from the vector of unknowns from the previous time-step n, the indepen-
dent source calculation module can start before the time-step n + 1 starts. This module
starts at t = tn+1
−1 . After τ1 clock cycles and at the beginning of the time-step n + 1, i.e.,
t = t0 , this module starts streaming its output bn+1
n+1
s . At t = tn+1
0 the history current
source update module and the matrix-vector multiplication module, due to the enabled
parallelism, start operating in parallel. At t = tn+1
1 independent source calculation mod-
n+1
ule completes outputting bs and the history source update module starts streaming its
output in+1 n+1
h . When this module completes outputting ih , i.e., t = t2
n+1
, matrix-vector
n+1
multiplication module has completely processed input vector bnode and starts adding the
partial floating-point accumulation terms. It takes the matrix-vector multiplication mod-
41
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
Soft Processor
MicroBlaze
MUXs
Matrix Vector xnode(0)
Multiplication
1
Independent source bs bnode
calculation p1 , p2
xnode(p1(i)) HRMNA b
History current update
ih
2
xnode(p2(i)) Concat
2 4
ule τM ACC = 51 clock cycles to perform this final stage of the floating-point accumulation
as described in part 2.4.3.
time
l1 l2
nb
The minimal time-step ∆tmin is the minimum number of clock cycles in which the
computation engine can finish the simulation. Timing diagram shows that in the proposed
scheduling of the simulation tasks, the minimal time-step is the latency of the matrix-
42
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
However, this requires stall-free pipelining of the computation engine. stall in pipelining
is when the the module that consumes data is ready to receive the data but the producer
module has not produced it yet. It should be mentioned that the opposite is not an issue
and can be handled by implementing First-In-First-Out (FIFO) digital hardware. To
have a stall-free pipeline, the latency of the modules should satisfy:
τ1 ≤ τ4 ,
τ2 ≤ l1 , (3.27)
l1 + l2 = nb ,
43
CHAPTER 3. FPGA-BASED SOLUTION OF NETWORK EQUATIONS FOR EMT
SIMULATION
Table 3.2
Resource utilization of differnet modules
• The structure of the computation engine is fixed, i.e., for a new study system the
parameters of the system, corresponding to each module, are calculated and written
in the module by the MB in the computation engine
• The matrix-vector multiplication module is the dominant resource consuming mod-
ule. The proposed reformulation and the computation engine design result in rela-
tively small matrix dimensions, compared to the existing fix-hardware computation
engines, and therefore enables simulation of larger power systems.
• The scheduling between tasks enables design of a stall-free pipeline. Therefore, the
minimal time-step is only determined by the latency of the matrix-vector multipli-
cation module.
44
Chapter 4
4.1 Introduction
Power switches are represented by behavioral models for simulation of power system
EMTs, thus, presence of High Frequency (HF) PECs in the power system introduces
challenges in terms of real-time simulation of system EMTs. The main purpose of this
chapter is to devise efficient simulation methods and design the corresponding floating-
point hardware modules to enable simulation of multiple PECs. The envisioned simu-
lation method (i) enables simulation of multiple PECs without the need to drastically
increase the simulation time-step or resource utilization, (ii) enables embedding PEC
models into the network model by modifying the RMNA matrix described in the previous
chapter, (iii) does not impose unnecessarily small simulation time-steps to compensate
for errors introduced by the existing real-time modelling methods, (iv) enables parallel
operation of its corresponding digital hardware module, with other hardware modules,
in the FPGA-based computation engine, as devised in the previous chapter.
This chapter is organised as follows. Section 4.2 explains the proposed approach and
a method to avoid “ringing” phenomenon in this work. Section 4.3 explains implemen-
tation of the two-value resistor model in terms of the proposed FPGA-based DRTS in
this work and highlights issues associated with (i) variable admittance matrix and (ii)
iterative process of identifying switch states. Section 4.4 proposes a novel FPGA-based
partitioning method for simulation of PECs to overcome these challenges and applies the
method to multiple PECs. Section 4.5 presents the design of the proposed PEC module,
45
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Table 4.1
Multi-step numerical integration methods
k−1
X k−1
X
αj xn−j = ∆t βj f (xn−j , tn−j ), (4.1)
j=−1 j=−1
where αj and βj are constant coefficients of the method, k is the number of steps of the
integration method, x and f (xn−j , tn−j ) are the state variable and the input function of
the system of differential equations, respectively. The LMS integration method of (4.1) is
called explicit if β1 = 0 and implicit otherwise. Trapezoidal (TR), Backward Euler (BE),
Forward Euler (FE) and Adam- Bashforth two-step (AB) widely adopted LMS integration
methods. TR and BE are implicit while FE and AB are explicit methods. Table 4.1
provides equations defining these methods. Implicit methods have higher computational
burden since they impose solution of multiple sets of linear equations at each time-step.
However, they provide higher accuracy and stability of simulation results.
The accuracy of each LMS integration method is defined by its order, i.e., the or-
der of local truncation error as a function of time-step. TR and AB are second-order
46
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
methods while FE and BE are first-order methods [4]. Higher order provides smaller lo-
cal truncation error and under certain conditions, including numerical stability, smaller
accumulated error and more accurate simulation results [49].
The region of absolute stability criterion relates the stability of the simulation results
to the time-step for a specific LMS integration method. The region of absolute stability
regarding each of the four aforementioned methods is shown in Fig. 4.1. This is usually
presented for ∆t = 1. The area is expanded by the factor of 1/∆t for time-steps different
than 1. The simulation result of an LMS integration method, at a specific time-step, is
stable if the time-step is adequately small , therefore, the region of absolute stability is
adequately large to encompass the eigenvalues of the system in case of a linear system [4].
In case of a non-linear system, eigenvalues of the Jacobian matrix should locate inside
this region.
If the region of absolute stability of a method covers the left-half-plane, then that
method is Absolutely stable (A-stable). This means the simulation results are stable re-
gardless of the time-step size. The region of absolute stability for BE also covers part of
the right-half-plane which implies BE produces stable results for some differential equa-
tions with unstable poles and is referred to as “artificial damping” of BE [4]. However,
TR produces stable simulation results if and only if the differential equations contain
stable poles since the region for TR only covers the left-half-plane. However, the regions
of FE and AB fail to encompass the left-half-plane [4]. This implies that for differential
equations with high frequency eigenvalues, e.g., a large resistor in series with an inductor,
explicit methods result in instability which is the reason explicit methods are not used
for simulation of stiff systems, e.g., those of power system EMTs.
Most simulation software packages use TR because of its accuracy and stability prop-
erties. However, TR suffers from ringing problem [4]. Consider switch S and inductor L
combination of Fig. 4.2(a) and assume S should be turned off due to either natural- or
forced commutation process. Fig. 4.3 depicts the inductor current, history current and
voltage obtained from TR and BE. Solid and dashed lines are responses based on the
ideal and the two-value resistor switch models, respectively. The inductor voltage and
the history current source exhibit oscillatory behaviour, i.e., the ringing phenomenon,
subsequent to the switch turn-off based on TR, however, BE provides damping in one
time-step.
To solve the ringing issue one approach is to use a more damped method, e.g., BE, for
a limited number of time-steps when ringing is detected and then use TR [4]. However,
this procedure is not computationally affordable in real-time simulation since it requires
handling variable admittance matrices. Therefore, another solution is proposed and
adopted in this thesis as follows.
47
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
t=tn
t=tn
RON ROFF
S L
gL
ROFF IhL
(b) (a)
This work employs TR as the main integration method for most of the models except
those of the inductors connected to switching nodes. These inductor models are dis-
cretized based on BE. The discretized model of an inductor L based on BE is the same
2L
as the discretized model of the inductor based on TR in parallel with a resistance of ∆t .
48
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Time-step
Inductor Current
Inductor History
Current Source
Inductor Voltage
(TR) (BE)
2L
Therefore, the proposed solution is the same as adding resistance of ∆t in parallel with
each inductor that is connected to a switching node and discretizing the overall system
model based on TR. Since TR is A-stable this approach does not introduce instability
problems.
49
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
The two-value resistor model represents an open status by a large resistance and
the closed status by the switch equivalent on-state resistance. This approach retains
the dimension of the admittance matrix unchanged. However, each time a switch state
changes, the admittance matrix changes. Most of circuit simulation software packages,
including power system EMT simulation software packages, use LU decomposition for
solution of linear equations. The change of admittance matrix results in new set of linear
equations and therefore requires on-the-fly LU factorization. Repetitive switch state
changes of PECs, and particularly those of HF PECs, require small simulation time-
step. This implies that real-time simulator is required to carry out LU factorization in a
short interval, i.e., shorter than the simulation time-step which drastically increases the
computation burden. This is the first reason that two-value resistor model for real-time
simulation of systems including HF PECs is not the preferred model.
The two-value resistor model, requires identifying the switch states at each time-step.
Identifying the switch state for forced commutations is straight forward, however, finding
the state for natural commutations involves evaluation of a set of variables. The switch
state , considering the convention shown in Fig.4.5, is
n+1 n+1
where gSW is the switch gate signal at the current time-step. For a diode switch gSW is
50
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
always zero. One observes from (4.2) that the switch state at time-step n + 1 depends
on the switch current and voltage of the same time-step. The switch current and voltage
depend on its state and also the state of the other switches. This implicit relationship
requires several iterations to determine switch states after a switching event. These
iterations must be carried out within the short time-step of real-time simulation process
and is the second reason that two-value resistor model is not a viable option for real-time
simulation.
This thesis, in contrast to the above arguments, (i) uses the two-value resistor model
to represent switches of HF PECs for real-time simulation and (ii) proposes a novel
partitioning method to overcome the above highlighted issues associated with the variable
admittance matrix and the switch state.
iSW
vSW
The ADC model [11] represents switch on and off states by an inductor and a capacitor,
respectively. A series resistor is added to the switch off-state capacitor to damp out
the oscillations due to the artificial RLC circuit constructed by the on- and off-state
representation of the switches. The discrete admittance of the on-state inductance and
off-state series RC branch are the same. Thus there is no admittance matrix change due
to the switch state change.
Fig. 4.6 depicts the ADC switch model. The model parameters are listed in Table 4.2
for the Trapezoidal (TR) and the Backward Euler (BE) integration methods. The ADC
model capacitor and inductor are larger than the actual switch parasitic elements and
result in artificial oscillations. Therefore, BE is usually employed to damp the artificial
oscillations caused by the non-realistic elements since BE features artificial damping [21].
The switch history current source in the ADC switch model, at time-step n + 1, is [11]
51
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Table 4.2
ADC switch model parameters
sn+1 n+1 n n n n
SW = gSW ||(s̄SW (vSW < 0) + sSW (iSW < 0)). (4.4)
Based on (4.4), the switch state at time-step n + 1 only depends on the switch current
n
and voltage from the previous time-step, i.e., vSW and inSW . Therefore, identifying the
switch states in ADC model is relatively straightforward as compared to that of two-value
n
resistor model. However, vSW and inSW and the oscillations caused by the artificial RLC
circuit can cause switch state oscillations.
ihSW
RSW
Switch off gSW
CSW
ihSW
Switch on LSW gSW
Furthermore, the ADC model requires selection of (i) the switch admittance gSW and
(ii) damping ratio σSW . For a specific time-step, selecting gSW is equivalent to selecting
the on-state inductance. To prevent artificial oscillations, one approach is to increase
σSW . Increasing σSW , corresponding to a selected inductance value, increases the off-
state capacitance and consequently the artificial switching loss. After each transition the
history current source is reset, therefore, the energy stored in the capacitor or inductor is
ignored. This results in artificial switching loss. The off/on and on/off artificial switching
52
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
losses are respectively proportional to the capacitance and inductance of the ADC model.
Therefore, increasing the capacitance and inductance of the ADC model increase the net
artificially-induced switching loss.
Based on the discussion above, there is a trade-off between minimizing the artificial
switching loss and preventing oscillations. One approach to damp the oscillations while
keeping the artificial switching loss whithin an acceptable range is to determine the
switch parameters by setting the energy loss of the on/off and off/on transitions to be
the same for the damping ratio of 0.85 < σ < 1.333 [10]. This range ensures damping
out the HF oscillations caused by the RLC circuit constructed by the on- and off-state
representation of switches in a PEC. The energy loss at each transition depends on
the corresponding voltage and current. Since it is impractical to consider currents and
voltages at all transitions, rated current and voltage of the PEC are considered. This
results in artificial switching loss of 3.7% of the rated power for a 21-pulse STATCOM
simulated with the time-step of 1.4µs [10]. Although 1.4µs is a relatively small time-
step, this loss is associated with unreal transients [29] and is not acceptable for many
case studies, e.g., those of Photovoltaic (PV) systems, especially for higher switching
frequencies.
In some applications, the ADC model is employed for switches that are not being
repetitively switched on and off, e.g., circuit breakers. Therefore, the artificial switching
loss is not a concern and thus the switch parameters are selected only to minimise oscilla-
tions [51]. Moreover, the status of a circuit breaker is determined by a separate external
signal and there is no need to account for natural commutation process. Therefore, in
this work ADC model is only used to represent non-repetitive switching events.
Partitioning methods are used to divide the power system mathematical model into
subsystems so they can be solved in parallel at each time-step and thus to reduce the
computational time. Since most algorithms for solving linear equations are O(n2 ) to
O(n3 ), where n is the size of the system matrix, thus, partitioning the equations into
m subsets of size n/m reduces the computational burden for solving each subset and
therefore that of the overall system. Based on evaluation of the partitioning methods for
simulation of PECs this section proposes a novel FPGA-based partitioning method.
Partitioning can be devised at modeling, discretization or solution stages. Therefore,
we categorize partitioning methods for simulation of PECs into three groups.
53
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Modeling-level Partitioning
Discretization-level Partitioning
The differential equations describing power system components are discretized based on
stiff implicit LMS integration methods. If an explicit LMS method is used for a specific
branch, then the branch discretized model has zero element stamp in the admittance
matrix, e.g., that of a capacitor branch is only a voltage source. In this case, if the
capacitor is grounded, then the capacitor node voltage is a known variable at each time-
step. Moreover, if all the terminal nodes of a subsystem are connected to ground by
capacitor branches, then applying an explicit LMS method to these capacitor branches
partitions the subsystem equations from those of the rest of the system. This method
depends on the system configuration, since presence of capacitors is required.
Forward Euler (FE) explicit method can be used for discretization of the differential
equation of the shunt capacitors and series inductors for partitioning [55]. However, FE
as explained in section 4.2, suffers from instability and inaccuaracy issues and can result
in artificial oscillatory behaviour. Moreover, discretizing three-phase inductor branches,
using explicit methods, creates a current source cutset which violates the unique solv-
ability criteria of the network equations [4]. Therefore, discretization-level partitioning
is not suitable for three-phase PEC systems and not used in this work.
Solution-level Partitioning
Discretizing the differential equations of a system without transmission lines, using im-
plicit LMS methods, creates a single set of equations. Solution-level partitioning seeks
tearing this set of equations into two or more subsystems of equations as follows. At
each simulation time-step an equivalent circuit of each envisioned subsystem is found.
Then, all subsystem equivalent circuits are integrated and an equivalent of the overall
system is created. By solving the latter equivalent the voltage/current variables at the
54
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
terminals of each subsystem are calculated. Then, these voltage/current variables are fed
back to their corresponding subsystems as independent sources. Finally, the subset of
equations describing each subsystem is solved. GENE [28], MATE [56] , Diakoptics [57]
are examples of solution-level partitioning and share the same conceptual methodology
in solving a single set of linear equations.
In this thesis we propose a new method, for simulation of PECs, based on the solution-
level partitioning concept in which switches are represented by two-value resistor model.
The novelty of this method is in (i) the definition of the subsystems which facilitates
overcoming the difficulties associated with implementing the two-value resistor model for
systems that embed multiple PECs, (ii) being well-suited for FPGA-based implementa-
tion and (iii) the method of calculating the network equivalent for each subsystem which
enables parallelism between all tasks in the devised DRTS. This method is explained in
the following subsection.
The proposed method is based on defining each PEC Switching Network (PECSN) as a
subsystem. The rest of the system model, including the PEC energy storage elements,
i.e., capacitors and inductors, are considered as part of the “system network ”. The
proposed partitioning method comprises three steps, i.e.,
• Obtaining the equivalent circuit of the system external to each PECSN subsystem.
• Solving the equations of each PECSN, using the equivalent circuit, to obtain the
PECSN subsystem terminal variables.
• Using the resulting terminal variables of all PECSNs to solve network equations.
The following subsections describe the procedure to carry out these steps. The first
and third steps are carried out by matrix-vector multiplication task/module defined in
Chapter 3. However, the second step requires definition of a new task and therefore the
design of a new hardware module. We call this task and its corresponding hardware
module PEC simulation task and PEC module, respectively.
Assume a network which includes only one PEC, linear branches and independent sources.
Fig. 4.7(a) and (b) illustrate an example of such a system and its network discretized
55
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Matrices Heq and YN eq are constant matrices and are determined by applying node
elimination to the network admittance matrix. bn+1 node is the RMNA injection vector
defined by (3.15). The equivalent of the network external to the PECSN is characterized
by its equivalent admittance matrix and the equivalent source vector ( YN eq , bn+1
eq ).
Since there is only linear branches in the circuit external to the subsystem, matrix
YN eq is constant, however, bn+1
eq must be determined in each time-step. To do so, ac-
n+1
cording to (4.6), vector bnode is required. This vector is produced only during time-step
n + 1. However, if only dynamic branches exist in the network, it can be calculated one
time-step ahead, i.e., at time-step n, as follows.
If only dynamic branches exist in the network, then based on (3.7) vector bn+1
node can
be expressed in a matrix form as
n+1
bnode = Ch bnnode + Cv xnnode , (4.7)
bn+1
eq = HeqRM N A bnnode , (4.8)
Since bn+1eq can be calculated as a function of nodal injection vector at time-step n, i.e.,
n
bnode , it can be computed one time-step ahead. This is enabled by incorporating matrix
56
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Network
(a)
io1
v1n+1 vo3n+1
vo2n+1 i1n+1
vo1n+1 i2n+1
i3n+1
(b)
Figure 4.7. (a) A system embedding one PEC (b) The circuit seen from the PECSN
57
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
h iT
n+1 n+1
terminal variables veq ieq as described in the following subsection. One time-step
ahead calculation of bn+1
eq enables parallelism between PEC simulation task and other
tasks defined in Chapter 3.
SW5
v1n+1 SW1n+1 SW3
isw1
io1n+1 vo3n+1
vo2n+1
(YNeq ,beqn+1)
(a)
v1n+1
io1n+1
vo2n+1 v n+1
vo1n+1 o3
(b)
Figure 4.8. (a) The model of the PEC in the PEC simulation task, (b) The third step of the proposed
partitioning method
58
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
where Y0Conv (s) is the admittance matrix corresponding to the PEC switch state vector
s. If a switch is on (or off), then its corresponding entry in the vector sn+1 is 1 (or 0).
Based on (4.5) and (4.11), PECSN terminal variables, considering switch state sn+1 , is
obtained by " #
in+1
o
= HConv (sn+1 )bn+1
eq , (4.12)
vn+1
o
where
HConv (sn+1 ) = (Y0Conv (sn+1 ) − Y−1 −1
N eq ) . (4.13)
To find switch state vector sn+1 , switch currents are also required. The vector of switch
currents is " #
n+1
i
in+1
SW = MSW (s
n+1
) on+1 , (4.14)
vo
where MSW (s) is the switch incidence matrix in the switching network containing switch
admittances. From (4.14) and (4.12) the switch current vector is
in+1
SW = HSW (s
n+1
)bn+1
eq , (4.15)
where
HSW (sn+1 ) = MSW (sn+1 )HConv (sn+1 ). (4.16)
Equations (4.12) and (4.15) relate the network equivalent source vector bn+1
eq to PEC
terminal variable vector and PEC switch current vector, respectively.
First step within the PEC simulation task is to determine switch states, using (4.15),
as follows. In general, individual switch states are determined based on (4.2). This
usually requires more than one iteration since a switch state transition, e.g., a change
in a gate signal, causes changes in the state of other switches. One of the advantages
of defining each PECSN as a separate subsystem is that each switch only affects the
switches internal to the same subsystem and not switches in other subsystems. The
approach taken in this thesis is to determine the state of PEC switches as one vector,
rather than examining each individual switch state.
PEC switch state vector sn+1 is affected by two factors, i.e., (i) switch gate signals
(only for the forced commutated switches) and (ii) state variables of the system, i.e.,
inductor currents and capacitor voltages. Vector bn+1
eq represents the net effect of inductor
59
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
currents and capacitor voltages of the overall network on PECSN. Thus we determine
the state of PEC switches as follows.
A combined switch and diode is assumed as one switch pair, therefore, asserting a
gate signal implies that the switch pair is on regardless of its current direction. At the
beginning of time-step n + 1 the gate signal vector gn+1 is used as the initial guess for the
state of PEC switches. The equivalent vector sources bn+1 eq and gn+1 are used to obtain
switch currents. To determine a switch state, signs of both switch current and voltage
are required. Since a switch is represented by the two-value resistor model, current and
voltage of each switch are proportional. Therefore, switch current sign is the same as
switch voltage sign. Considering the switch voltage and current convention in Fig. 4.5,
PEC switch state vector is determined by
sn+1 = (in+1
SW < 0)||g
n+1
. (4.17)
Once the switch states are known, PEC terminal variable vector can be obtained based
on (4.12), i.e., " #
n+1
io
bn+1
Conv = n+1
= HConv (sn+1 )bn+1
eq . (4.18)
vo
This completes PEC simulation task, i.e., the second step in the proposed solution-level
partitioning. To summarise, steps within PEC simulation task are:
Since execution of PEC simulation task takes longer than those of the other two tasks,
i.e., independent source calculation task and history current update task, its outputs are
scheduled as the last entries of the RMNA injection vector.
60
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
This section explains generalization of the proposed partitioning method for applications
to multiple PECs. For each PECSN, the equivalent circuit is characterized by an equiv-
alent admittance matrix and an equivalent source vector, i.e., YN eq and bn+1
eq . For each
n+1
PECSN, vector beq is calculated using matrix HeqRM N A by (4.10). Matrices HeqRM N A
and YeqN , corresponding to each PEC, are theoretically functions of other PEC switch
states. In this section we introduce provisions to provide constant YN eq and HeqRM N A
for a system that includes multiple PECs.
For the analysis of power system EMTs, simulation time-step must be about 50-100
times smaller than the smallest switching period, i.e., for 10kHz switching frequency,
this requires simulation time-steps in the range of 1µs. Discretizing the PEC inductor
and capacitor branch equations using a time-step imposed by this constraint satisfies
∆t 2C
gLconv = << 1, gCconv = >> 1. (4.20)
L ∆t
For example consider a 10kHz boost converter and its discretized model of Fig. 4.9.
The discrete admittance seen from the output of the converter for on- and off-states of
the diode are
L ∆t 2C
goutON = (( + RON )|| )−1 = 1000.01, goutOF F = = 1000.00. (4.21)
∆t 2C ∆t
One can observe this admittance is negligibly changed. Therefore, the admittance of the
equivalent circuit of the system external to another PECSN is also negligibly changed
by this switch status change in the boost converter. During each time-step each network
variable interacts with the other variables in direct way, i.e., affecting their values of
the same time-step, which is represented by admittance matrix, and indirect way, i.e.,
affecting their values of the next time-steps, which is represented by history current
sources. In this work it is assumed that the changes in the equivalent circuit of the
system external to each PECSN, due to a switch status change in another PECSN, can be
considered indirect. The main reason is that PECs are designed such that the switching
process of each PEC is independent of the other PECs. This enables use of constant
YeqN i , Heqi and therefore HeqRM N Ai matrices for each PECSN which is explained as
follows.
Consider a system embedding multiple PECs. Each PECSN is replaced by its terminal
voltage/current sources. Then node elimination for each PECSN is carried out while the
other switching networks are replaced by their corresponding voltage/current sources.
61
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
gout
D
L
C 100µH
500µF
(a) (b)
Figure 4.9. (a) Boost converter and (b) its discretized model
where bn+1
Conv is h iT
bn+1
Conv = bn+1 n+1
Conv1 ...bConvm . (4.23)
bn+1
Convi is the i
th
PEC terminal variable vector. Vector of equivalent sources for ith PEC,
bn+1
eqi , is
bn+1 n
eqi = HeqRM N Ai bnode , (4.24)
Matrix Chi is a diagonal matrix which is defined similar to Ch of (4.7). The only difference
in the m PEC case as compared with the single PEC case is that vector bnnode contains
other PECs terminal variables bnConvj s. Chi entries corresponding to bn+1 n+1
Convi and bConvj
(j 6= i) are set to 0 and 1, respectively. This implies that to obtain constant HeqRM N Ai
and YeqN i for each bn+1 n
eqi , other PECSNs are represented by bConvj (j 6= i) and other
branches are represented by their updated history current sources at time-step n + 1.
Based on the above development, the generalized partitioning method for a system
including m PECs is deduced. First the equivalent source vector for each PECSN can be
obtained, i.e.,
n
xnode HRM N A
bn+1 H
eq1 eqRM N A1 n
= bnode . (4.26)
: :
bn+1
eqm HeqRM N Am
62
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Second, the PECSN terminal variables for each PEC are obtain by carrying out PEC
simulation task. The third step is to use these PEC switching terminal variables to solve
the network solutions. This is carried out by considering RMNA injection vector of (4.22)
and (4.23).
To carry out the PEC simulation task for each PEC, a separate PEC module is added
to DRTS as explained in Chapter 3 and the hardware design of this module is explained
in the following section.
63
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
The design of PEC module is shown in Fig. 4.10. Steps one to three of PEC simulation
task, as defined in Section 4.4.3, are respectively assigned to PU1 to PU3. Since the first
and third steps are matrix-vector multiplications and inherently sequential, thus PU1 and
PU3 are designed to share the same floating-point cores. This reduces hardware resource
consumption and improves design efficiency. To save HConvi (si ) and HSW i (si ) for all
permutations of si , they are unrolled to vectors hConvi and hSW i , respectively. These
vectors are parameters of the ith PEC and depend on both the PEC topology/parameters
and system configuration and therefore are calculated prior to simulation by a MATLAB
script and written in BRAMs in the PEC module by MB soft-processor.
PECi
beqin+1
bconvin+1
g n+1 (hSWi,hconvi)
1 3
n+1
beqi iSW n+1
s n+1
bconvin+1
n+1 n+1 2 n+1 n+1
HSWi(g )beqi Hconvi(s )beqi
n+1
g
PU2 conducts the second step of the PEC simulation task based on (4.17) and uses a
dedicated floating-point comparison IP core. All floating-point comparisons are carried
out by the same core, using pipelining approach.
Fig. 4.11 depicts the computation engine which embeds four PEC modules. The
simulation task for each PEC is carried out based on one module per PEC. A MUX
is implemented to stream vector bn+1
eqi to the i
th
PEC module from the results of the
matrix-vector multiplication.
The overall latency of the PEC module, τ5 , is 120 clock cycles for PEC topologies up
to 6 switches. Fig. 4.12 shows the timing diagram of the PEC module and other modules
in the computation engine. For a stall-free pipeline, the latency of the modules should
64
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Soft Processor
MicroBlaze
MUXs
Matrix Vector
Independent source bs Multiplication
calculation
vn , vp bnode
ih
History current update HRMNA b x
2
HRMNA beq
beqi bconvi
PECi
PEC
bconv4
PEC4 Concat
Figure 4.11. Computation engine for simulation of case studies embedding multiple PECs
satisfy
τ1 ≤ τ4 ,
τ2 ≤ l1 ,
(4.27)
τ5 ≤ (l1 + l2 ),
l1 + l2 + l5 = nb ,
where l5 is the length of vector bn+1 conv . To integrate the PEC modules into the design
presented in chapter 3 and satisfy the stall-free conditions, the same independent source
calculation and matrix-vector multiplication modules are used. This indicates the size of
bn+1 n+1 n+1
node is 135, as described in chapter 3. To incorporate bconv in vector bnode , instead the
length of vector in+1 h is shortened by l5 . The maximum number of PECs is considered
to be four and each PEC is represented by the maximum of four sources, therefore, the
length of bn+1 n+1
conv , l5 , is 16. Thus the length of the new vector ih , l2 , is 93.
The minimal time-step is:
The design meets 160MHz timing constraints after implementation and bitstream gen-
eration. Therefore, the minimum time-step is 1.1625µs. Any larger time-step, e.g., 2µs
can be achieved by keeping the simulation modules halted for adequate number of clock
cycles.
Hardware utilization of each PEC module which is designed for simulation of a PEC,
65
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
l1 l2 l5
bconvn+1 τ5
bs(1) b(135)
τMACC
bnoden+1
τ4
a)
t-1n+1 t0n+1 t1n+1 t2n+1 t3n+1 t4n+1
Minimal time-step t-1n+2 t0n+2
Figure 4.12. Timing diagram of (a) computation engine modules (b) PUs in the PEC module
Table 4.3
Resource utilization of the PEC module
with the maximum of 6 switches, is shown in Table 4.3. Since PU1 and PU2 share
floating-point cores to maximize design efficiency, separate resource utilization for each
PU is not possible. One can observe that resource utilization for each PEC module is
fairly small. The bottleneck for resource utilization of this module, similarly to other
modules, is LUT utilization. However, this module consumes only about 1% of the total
available LUTs on a VC7VX485T chip.
66
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
VSC Ldc
DC 300V
AC System
Ldc
370V
DC 300V
(a)
LDC RDC
Llp Lls
CDC
rf Cf LConv
(b)
Figure 4.13. (a) Case study system embedding two PEC units (b) PEC unit model
The simulation case studies are conducted based on three approaches, i.e., (i) the
proposed partitioning method with the time-step of 2µs using the FPGA-based DRTS
platform, (ii) based on two-value resistor switch model with time-step of 2µs using PSIM
off-line simulation package to provide a reference solution and (iii) based on ADC switch
model with the time-step of 2.9µs using the RTDS-based real-time simulation platform.
Two case studies are conducted as follows.
67
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Table 4.4
Parameters of the PEC station
column shows the RTDS-based real-time simulation results using ADC model. The first
and second rows are respectively three-phase AC-side currents of PEC1 and PEC2 and
the last row includes DC-side currents.
The three-phase AC-side currents, i.e., the first row of Fig. 4.14, experience tran-
sients and then reach steady state. Figure 4.14 shows that these currents have identical
behaviour as obtained by the three simulation platforms. However, the DC-side current
simulation results reveals deficiency of the ADC method. The active power exchange for
PEC2 should be close to zero since m2 = 0.8∠0◦ . Therefore, the DC-side current of PEC2
should be close to zero. It is evident that this is the case in the PSIM-based reference
results and those of the proposed partitioning method. However, the ADC-based results
indicate around 50A which is due to the artificial switching loss of the ADC method. For
PEC2 the DC-side current in the PSIM-based reference results and those of the proposed
partitioning method is around 60A. However, this current is around 100A from the ADC-
based method which is also due to the artificial switching loss. Figure 4.14 also shows
that the DC-side current from the proposed partitioning method exhibit similar transient
and steady state behaviour as those of the PSIM-based reference results, however, results
from the ADC method exhibit different dynamic and steady state behaviour.
68
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
0 0 0
50 50 50
0 0 0
Figure 4.14. Simulation results of Case I, m1 = 0.4∠60◦ and m2 = 0.4∠0◦ , 1st (left) column includes the
FPGA-based DRTS real-time simulation results using the proposed partitioning method, 2nd column
contains the PSIM off-line simulation results using the two-value resistor reference method and 3rd
column has the RTDS-based real-time simulation results using the ADC method.
69
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
50 50 50
iabcPEC1(A)
0 0 0
0 0 0
0.08 0.1 0.12 0.14 0.16 0.08 0.1 0.12 0.14 0.16 0.08 0.1 0.12 0.14 0.16
0 0 0
−50 −50 −50
−100 −100 −100
−150 −150 −150
0.08 0.1 0.12 0.14 0.16 0.08 0.1 0.12 0.14 0.16 0.08 0.1 0.12 0.14 0.16
Time(s) Time(s) Time(s)
Figure 4.15. Simulation results of Case II, m1 = 0.4∠60◦ , m2 = 0.4∠0◦ and the gate signals of both
PECs are blocked at t=0.1s, 1st (left) column includes the FPGA-based DRTS real-time simulation
results using the proposed partitioning method, 2nd column contains the PSIM off-line simulation results
using the two-value resistor reference method and 3rd column has the RTDS-based real-time simulation
results using the ADC method.
This chapter presents the approach to avoid ringing phenomenon by discretizing the
model of the inductors connected to switching nodes using BE integration method. It
also proposes a novel FPGA-based partitioning method to overcome the challenges as-
sociated with the implementation of two-value resistor model for FPGA-based real-time
simulation which is achieved by considering each PECSN as one subsystem. The method
is generalized for application to systems including multiple PECs and features parallel
processing capability for the PEC simulation task and the other tasks in the simulation
of the network, as explained in the previous chapter. Based on this method, a PEC hard-
ware module is designed, using FP numerical representation, and replicated to enhance
the FPGA-based DRTS for real-time simulation of systems embedding multiple PECs.
70
CHAPTER 4. FPGA-BASED REAL-TIME SIMULATION OF POWER
ELECTRONIC CONVERTERS (PECS) FOR EMT ANALYSIS
Simulation case studies are conducted based on three approaches, i.e., (i) the approach
based on the proposed partitioning method using the FPGA-based DRTS platform, (ii)
the approach based on two-value resistor switch model using PSIM off-line simulation
package to provide a reference solution and (iii) the approach based on ADC power switch
model using the RTDS-based real-time simulation platform and it is shown that the
proposed partitioning method and FPGA-based DRTS outperform the approach based
on ADC model. The advantages of the proposed partitioning method and FPGA-based
DRTS are:
71
Chapter 5
FPGA-Based Simulation of
Electrical Machines (EMs) for EMT
Analysis
5.1 Introduction
Electrical Machines (EMs) are indispensable power components of power systems and
there are multiple EM models, with different degrees of details, for different types time-
domain analysis of power systems. For EMT simulation studies lumped element models
adequately emulate system-level behaviour of EMs. The main course of this chapter is
to develop an FPGA-based EM model/module to enable real-time simulation of systems
that embed multiple EMs, regardless of configuration and parameters of the system. The
proposed model/module (i) is compatible with the partitioning algorithm and DRTS de-
scribed in the previous chapter to accommodate EM hardware module into the devised
DRTS, (ii) can operate in parallel with the rest of modules in the devised DRTS to enable
small simulation time-step, (iii) can accurately emulate behaviour of EMs regardless of
EM parameters, system configuration and under all operating scenarios and (iv) is ca-
pable of representing different types of EMs, i.e., Induction Machine (IM), Synchronous
Machine (SM), and Permanent Magnet Synchronous Machine (PMSM), using the same
hardware with appropriate parameters to avoid hardware code re-compilation and effi-
cient FPGA resource utilization.
Section 5.2 describes different EM models and interfacing techniques for power system
EMT simulation and identifies advantages and disadvantages of each model in terms of
FPGA-based real-time simulation and concludes that (i) Constant-Parameter-Voltage-
Behind-Reactance (CPVBR) model suits FPGA-based real-time simulation and (ii) is
72
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
compatible with the RMNA formulation and the proposed partitioning method described
in Chapters 3 and 4, respectively. Section 5.3 proposes a CPVBR-based EM model that
is tailored for FPGA-based real-time simulation and adopts a novel LMS integration
method for EMs with dynamic saliency, i.e., L”d 6= L”q . Based on the proposed model,
discretized EM model is developed and EM simulation task defined. Section 5.4 presents
the corresponding EM hardware module to carry out this task. This module is used to
enhance the FPGA-based DRTS for real-time simulation of EMs. Section 5.5 presents
simulation case studies using the enhanced FPGA-based DRTS. Section 5.6 concludes
and highlights contributions of this chapter.
Depending on the objectives, different EM models are utilized for EMT analysis. Finite
Element Models (FEMs) are used for core loss analysis and/or evaluation of new EM
designs [58]. This level of details is neither necessary nor computationally feasible for
system-level EMT studies where the focus is mostly on the behaviour of EMs in terms
of their interactions with other power system components.
System-level EM models for EMT studies are categorized as Phase Doamin (PD)
models, Quadrature-Direct (QD) models and Voltage-Behind-Reactance (VBR) models.
These models are mathematically equivalent, however, due to the different choices of state
variables, input/output variables and structure, they feature different characteristics for
digital time-domain simulation, e.g., accuracy, input-output compatibility with the other
compnenet models and computational efficiency [59]. PD and VBR are direct models and
QD is an indirect model which requires an interfacing technique to enable its integration
into the host power system model. This section evaluates these models and interfacing
methods to devise a suitable modeling approach to represent EMs in the DRTS in this
thesis.
5.2.1 PD Model
73
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
where subscript abcs denotes stator coordinate and subscript qdr denotes rotor coordinate
and flux linkages are " # " #" #
λabcs Lss Lsr (θ) iabcs
= . (5.2)
λqdr LTsr (θ) Lrr iqdr
| {z }
L(θ)
One can observe that inductance matrix L(θ) is a function of rotor position θ. The
electromagnetic torque in the PD model is expressed by
" #T " #
1 iabcs ∂ iabcs
τe = L(θ) , (5.3)
2 iqdr ∂θ iqdr
dθ
= ω, (5.4)
dt
dω P Bf
= (τe − τm ) − ω. (5.5)
dt 2J J
The main advantage of PD model is its direct interface to the network. This implies
no interfacing algorithm is required for a PD model since the stator variables, the same
as those of the other power system component models, are directly in abcs coordinates.
Equations (5.2) and (5.3) indicate that EM model is mathematically non-linear.
Therefore, the differential equations describing EM electrical and mechanical dynam-
ics are a set of coupled and non-linear differential equations. Thus their direct solution
requires an iterative method which necessitates multiple LU factorization at each time-
step. Since discretized admittance matrix of network contains admittance matrix of EM
model, at each time-step a change in rotor position changes the PD model inductance
matrix and consequently the network admittance matrix. This requires on-the-fly LU
factorization and is a major drawback for real-time analysis since it significantly increases
the computational burden.
Another drawback of PD model is that this model makes the system more numeri-
cally more stiff and therefore necessitates smaller time-step to achive same accuracy as
compared to other EM models [59] [62]. Due to these drawbacks, PD model is not used
in this thesis.
5.2.2 QD Model
The QD model [1] resolves the rotor-position-dependent admittance matrix limitation of
the PD model by transferring the stator variables from abcs coordinates to qd0 coordi-
74
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
where
cos(θ) cos(θ − 32 ) cos(θ + 23 )
2
T(θ) = sin(θ) sin(θ − 32 ) sin(θ + 23 ) . (5.7)
3 1 1 1
2 2 2
It should be noted that QD model considers q-, d - and also zero sequence components.
Based on this transformation, (5.1), (5.2) and (5.3) respectively become [1]
" # " # " # " #
vqd0s iqd0s d λqd0s λr
=R + + ωr , (5.8)
vqdr iqdr dt λqdr 0
" # " #
λdq0s iabcs
= LQD , (5.9)
λqdr iqdr
and
3P
τe = (λmd iqs − λmq ids ). (5.10)
4
In general the differential equations of a system containing EMs are non-linear, there-
fore, a general Newton iterative method [4] can be used to solve these equations. EMTP-
RV uses such an approach [33], however, iterative methods are not feasible for real-time
simulation due to their excessive computational burden and unpredictable number of
iterations. There are three approaches to interface a QD model with that of the rest of
the system in abcs coordinate, without iterative process, as follows.
Based on this approach, at each time-step EM terminal voltages from the previous time-
step simulation results (in abc coordinates) are transformed into the dq0 coordinates,
using predicted mechanical variables and used to calculate the machine three-phase cur-
rents in the QD model. Then, these currents are injected into the network. This method
is simple yet it is prone to instability and inaccuracy [33].
To enhance numerical stability, it uses additional parallel resistive or capacitive snub-
ber branches [33]. The effect of snubber branches can be compensated using another
current source. The numerical instability issue is more significant when EM terminals
are almost open circuit [33], e.g., the EM is connected to a diode rectifier bridge or
equivalently a two-level VSC with blocked gate signals.
The existing FPGA-based real-time simulators use the QD model with current injec-
tion interface approach for its simplicity [18] [22] [31]. However, QD model with current
75
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
injection interface fails to simulate EMs under all system configurations and operational
scenarios, therefore, is not used in this work.
This approach interfaces the equivalent circuit of discretized EM equations with dis-
cretized model of the rest of the system [33]. Since the power system is represented in
abc frame, this approach requires the EM QD model in the abc frame. If the q- and d -
axis resistances of the discretized EM QD model are the same, then the EM discretized
admittance in the abc frame is time-invariant. However, if they are different, e.g., due to
rotor saliency, the resulting admittance is time-variant. To address the time-varying ad-
mittance issue the average of the two resistances is considered on both axes [63]. On each
axis a voltage source is used to compensate the difference caused by this approximation.
The values of the voltage sources depend on the stator currents. Predicted stator current
values are used to calculate these voltage sources which adversely affects accuracy of the
simulation results and numerical stability [33]. Therefore, prediction-based interface is
also avoided in this work.
Compensation method [64] interfaces the machine model with that of the rest of the
system in a similar way a non-linear circuit model is interfaced with a linear circuit. At
each time-step the network equivalent in abc frame is calculated and transferred to qd0.
Then, the network equivalent model is interfaced with the EM model and the stator
currents are calculated. These currents are injected into the network, as ideal current
sources, in the same time-step. This interfacing method is mathematically precise, how-
ever, calculation of the network equivalent circuit in qd0 frame can be computationally
expensive, especially in the presence of PECs which repetitively change the network
equivalent admittance matrix. This process can not be computationally afforded in real-
time simulation and therefore is not used in this work.
d
v abcs = Rs iabcs + L” (θ) iabcs + e”abcs . (5.11)
dt
76
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
VBR models [59] [65] [66] [67] separate dynamics of fast and slow state variables, i.e.,
stator current and rotor flux linkage variables, respectively. Since e”abcs is a function of
slow rotor variables, i.e., flux linkages and mechanical variables, the use of one time-step
delay in calculation of the sub-transient voltages is applicable.
vabcs e"abc
iabcs RS L"(θ)
VBR and PD models are direct methods, however, VBR models impose less compu-
tational burden and provides better eigen-structure [59], i.e., can use a larger time-step
as compared to PD models for the same degree of accuracy.
The main drawback of VBR models is that inductance matrix L” (θ) is rotor-position-
dependent. The reason is that sub-transient inductances of d- and q-axis, due to dynamic
saliency, are not necessarily the same.. In case of an IM, the sub-transient inductances are
equal, therefore, matrix L” is not rotor-position-dependent. This reduces computational
burden and constitutes Constant-Parameter-VBR (CPVBR) model. CPVBR model is
not readily applicable to EMs with unequal sub-transient inductances. There are two
existing approaches to obtain CPVBR model for EMs, as follows.
The first approach adds an extra fictitious winding in either d or q axes [68]. The wind-
ing inductance is selected such that the resulting sub-transient inductances are the same.
The winding resistance must be considered large enough not to impact low-frequency
dynamics of the EM [3]. However, a large winding resistance makes the model more
numerically stiff and therefore reduces simulation accuracy. More importantly, there are
high frequency discrepancies between the actual EM model and its CPVBR model as
a result of fictitious winding [68]. This approach is not used in this work since high
frequency dynamics of EMs are also of importance, especially in system configurations
where EM is interfaced with high switching frequency PECs.
The second approach moves time-varying part of the sub-transient inductance to
the sub-transient voltage terms which are calculated by one time-step delay [69] [66].
The time-step delay applied to stator voltage/current variables is equivalent to using an
explicit LMS integration method and thus can lead to numerical instability, especially
for system configuration with numerically stiff equations, e.g., an EM with large dynamic
77
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
saliency connected to a three-phase diode rectifier. Therefore, this approach is also not
used in this thesis since one of the objectives is to emulate EM behaviour regardless of
the EM parameters and system configurations.
• Provide a general and consistent model structure such that its fixed hardware mod-
ule design is able to represent different types of EMs, i.e., IM, PMSM and SM just
by changing the module parameters and without the need for re-compilation of the
hardware code.
To fulfil the first requirement, i.e., parallel operation of EM module and other modules
in DRTS, the EM module must start its computation at the beginning of each time-step.
Since electrical inputs of a CPVBR model, i.e., stator currents from previous time-step
and field voltage are available at the beginning of each time-step, therefore, CPVBR
models also fulfil the first requirement.
The PEC simulation algorithm of Section 4.4 is based on the assumption that the
network connecting the PECSNs has constant parameters. Since a CPVBR model does
not contradict with constant admittance matrix representation of the network, this as-
sumption is not violated. Thus a CPVBR model also meets the second requirement.
Stator equations of a EM based on CPVBR model are represented by constant-
parameters which in this work are a part of the network. The fixed hardware matrix-
vector multiplication module, designed in Chapter 3 to solve the network equations,
accommodates these equations, however, to fulfil the third requirement a fixed hardware
78
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
module to solve the rotor equations is required. This necessitates a general form of rotor
equations capable of representing different types of EMs, which is explained in the next
subsection.
To fulfil the fourth requirements, a novel approach based a new numerically stiff
LMS integration method is adopted to obtain CPVBR model for system configuration
with numerically stiff equations, e.g., an EM with large dynamic saliency connected to a
three-phase diode rectifier. This approach is presented in Subsection 5.3.2.
d
vsq = rs isq + ωλsd + λsq
dt
d
vsd = rs isd − ωλsq + λsd (5.12)
dt
d
vs0 = rs is0 + λs0 ,
dt
79
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
q axis d axis
(a) SM
ωλ ds iqs ωλ qs
rs Lls Llrq1 rrq1 ids rs Lls Llrq1 rrq1
imag
vqs Lmq vds Lmd
q axis d axis
(b) PMSM
ωλ ds iqs ωλ qs
rs Lls Llrq1 rrq1 ids rs Lls Llrq1 rrq1
q axis d axis
(c) Single- cage IM
q axis d axis
(d) Double- cage IM
Figure 5.2. The model of different types of EMs in qd coordinates, (a) Synchronous Machine, (b)
Permanent-Magnet Synchronous Machine including two damper windings, (c) Single-cage Induction
Machine, (d) Double-cage Induction Machine
and
d
0 = rrq1 iqr1 + λqr1
dt
d
0 = rrd1 idr1 + λdr1
dt (5.13)
d
0 = rrq2 iqr2 + λqr2
dt
d
vf = rrd2 idr2 + λdr2 ,
dt
80
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
q axis d axis
λrq1 λrq2
λmq = L”mq (iqs + + ),
Lrq1 Lrq2
(5.14)
λrd1 λrd2 λmag
λmd = L”md (ids + + + ),
Lrd1 Lrd2 Lmd
where sub-transient flux linkages λ”q and λ”d , as functions of rotor flux linkages, are
λrq1 λrq2
λ”q = L”mq ( + ),
Lrq1 Lrq2
(5.17)
λrd1 λrd2 λmag
λ”d = L”md ( + + ),
Lrd1 Lrd2 Lmd
81
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
d λrq1 − λmq
λrq1 = − rrq1 ,
dt Lrq1
d λrd1 − λmd
λrd1 = − rrd1 ,
dt Lrd1
(5.19)
d λrq2 − λmq
λrq2 = − rrq2 ,
dt Lrq2
d λrd2 − λmd
λrd2 = − rrd2 + vf .
dt Lrd2
λmq and λmd are not state-variables, therefore, they are expressed as functions of the EM
state-variables based on (5.14), i.e,
λr = Arλ r + Br ur
λ̇
(5.21)
yλ = Crλ r + Dr ur ,
where h iT
λ r = λqr1 , λdr1 , λqr2 , λdr2 , (5.22)
h iT
¯
ur = isq , isd , λmag , vf , isd , (5.23)
h iT
” ”
yλ = λmq λmd λq λd . (5.24)
Matrices Ar , Br ,Cr and Dr are given in Appendix A. Equation (5.21) enables designing
a fixed hardware EM module to represent different types of EMs for FPGA-based real-
time simulation. The magnetizing flux linkages λmq and λmd , and the sub-transient flux
linkages λ”q and λ”q , are considered as output variables of (5.21) to facilitate calculation
82
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
d ”
vsq = rs isq + ω(L”d isd + λ”d ) + (L isq + λ”q ),
dt q
d
vsd = rs isd − ω(L”q isq + λ”q ) + (L”d isd + λ”d ), (5.25)
dt
d
vs0 = rs is0 + (Lls is0 ),
dt
which can be expressed in a voltage-behind-reactance form, i.e.,
d ”
vsq = rs isq + ωL”d isd + L isq + e”q ,
dt q (5.26)
d
vsd = rs isd − ωL”q isq + L”d isd + e”d ,
dt
d ”
e”q = ωλ”d + λ
dt q (5.27)
d
e”d = −ωλ”q + λ”d .
dt
where
cos(θ) sin(θ) 1
T−1 (θ) = cos(θ − 23 ) sin(θ − 32 ) 1 . (5.29)
cos(θ + 23 ) sin(θ + 32 ) 1
Based on (5.28), the voltage-behind-reactance expression of (5.26) can be transferred to
abcs coordinates as
d
v abcs = rs iabcs + L” (θ) iabcs + e”abcs , (5.30)
dt
83
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
where
L” +L” L” +L” L” +L”
Ls + mq 3 md − mq 3 md − mq 3 md
L”mq +L”md L” +L” L” +L”
L” (θ) =
− 3
Ls + mq 3 md − mq 3 md
L” +L” L” +L” L”mq +L”md
− mq 3 md − mq 3 md Ls + 3
(5.31)
2π 2π
cos(2θ) cos(2θ − ) cos(2θ + )
L”d − L”q 2π
3
4π
3
+ cos(2θ − 3 ) cos(2θ − ) cos(2θ) .
3 3
cos(2θ − 2π
3
) cos(2θ) cos(2θ + 4π
3
)
If EM does not have dynamic saliency, i.e., L”q = L”d , then the rotor-position-depenent
term of (5.31) is zero and therefore (5.30) can be rewritten as [3]
d d
vabcs = rs iabcs + L”q iabcs + L0 3is0 + e”abcs , (5.32)
dt dt
which can be represented by the constant-parameter circuit of Fig. 5.4 [3]. However,
this is not possible for EMs with dynamic saliency, i.e, L”q 6= L”d . A method to obtain
CPVBR model for such EMs is explained in the next subsection.
ea” Lq” rs
L0 eb”
ec”
Figure 5.4. The constant parameter interface for CPVBR model [3]
84
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
d ”
e”q2 = ωλ”d + λ + ω(L”d − L”q )isd
dt q (5.34)
d
e”d2 = −ωλ”q + λ”d .
dt
where a is the parameter of the method and its first and second characteristic polynomial
[4] are respectively defined by
The method is zero-stable since ρ(z) satisfies the root condition, i.e., the roots of ρ(z),
z1 = 1 and z2 = (1 − a), are either inside or on the unit circle with multiplicity of 1. This
method is also consistent [4] since
Satisfying the root condition and consistency indicates the proposed method is conver-
gent, i.e., it produces accurate results as ∆t → 0 [4].
An LMS integration method for numerically stiff differential equations, e.g., those of
power system EMTs, must be stiffly stable. An LMS integration method is stiffly stable
if its region of absolute stability covers a region similar to that of Fig. 5.5 [4]. The
region of absolute stability for the proposeed LMS integration method is obtained by
investigating its third characteristic polynomial [4] π(z, ĥ), i.e.,
85
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
jb
-c
-jb
Figure 5.5. Region of absolute stability requirement for a stiffly stable LMS integration method [4]
−2
−1 −1
0 0
1 1
2
−1 0 1 2 3 −1 0 1 2 3
a=0.5 a=0.66
−1
−1
−0.5
0 0
0.5
1
1
−1 0 1 2 −1 0 1 2
a=0.8 a=0.99
Figure 5.6. Region of absolute stability of the proposed LMS for different values of parameter a
86
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
The sub-transient inductor on the d - axis L”d , is discretized based on (5.39) using a =
L”d
L”
< 1, i.e.,
q
n+1
L”d − L”q n n−1
vhLd = (isd − isd ). (5.41)
∆t
ihLdn+1
iL vL vLdn+1
L isdn+1
gLd vhLdn+1
Continuous-time inductor Inductor discretized model circuit equivalent
model using the proposed LMS
n+1
The above discussion shows that, using the proposed method while vhLd is considered
n+1
as part of the sub-transient voltage ed2 , then the inductor L”d in (5.33) can be replaced by
L”q . Therefore, the rotor-position-dependent matrix term in (5.31) is zero, i.e., CPVBR
model is obtained for EMs with dynamic saliency.
The proposed CPVBR model enables the explicit calculation of the sub-transient
voltages en+1
abc since they are only functions of the state-variables, i.e., these voltages can
be calculated only using the data from the previous time-step, i.e., n. Therefore, the EM
simulation task can be carried out in parallel with the other tasks in RMNA formulation
which is explained in the following section.
87
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
ω 0n+1 = 2ω n − ω n−1 ,
(5.42)
θ0n+1 = 2θn − θn−1 .
To solve the state-space equation of (5.21) the input variables of (5.23) must be found in
n+1
which λmag and vf are input variables of the EM model, however, insq , insd and i¯sd are
n
not and must be obtained from iabc , based on
and
n+1
i¯sd = insd − in−1
sd , (5.44)
λ n+1
r = ADrλ nr + BDr unr ,
(5.45)
yn+1
λ = CDrλ nr + DDr unr ,
Ar ∆t −1 Ar ∆t
ADr = (I − ) (I + ),
2 2
Ar ∆t −1
BDr = (I − ) Br ∆t, (5.46)
2
CDr = Cr ADr ,
DDr = Cr BDr + Dr .
3P n+1 n
τen+1 = (λ i − λn+1 n
mq isd ), (5.47)
4 md sq
88
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
which is used to obtain the rotor speed ω n+1 , by discretizing (5.5), using TR method,
i.e.,
ω n+1 = cω1 ω n + cω2 (τen+1 − τm
n+1
), (5.48)
where
∆tBf −1 ∆tBf
cω1 = (1 + ) (1 − ),
2J 2J (5.49)
∆tBf −1 ∆tP
cω2 = (1 + ) ,
2J 2J
and rotor angle by
θn+1 = θn + ∆tω n+1 . (5.50)
where matrices Ce1 , Ce2 (ω) and De (ω) are given in Appendix A. It should be noted that
n+1
matrix De (ω) is defined such that the term vhLd in (5.41) is added to e”d2 , as described
in Subsection 5.3.2. Finally, we obtain sub-transient voltages in abc coordinates by
”n+1
e abc = T−1 (θn+1 )eeqd2
”n+1
. (5.52)
EM simulation task is to carry out (5.42) to (5.52) which include the following steps:
It should be mentioned that carrying out (5.42) does not require any data from the
solution of network equations in the previous time-step, therefore, it is carried out at
the end of the previous time-step which enhances the parallelism between the EM task
and the other task in the FPGA-based DRTS. The next section presents the EM module
89
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
90
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
MUXs
Matrix Vector
Independent source bs Multiplication
calculation
vn , vp bnode
bh & ihSW
History current update HRMNA
2 b x
HeqRMNA beq
Subsystem history bss
calculation
bconv
PEC
bem Concat
iabc
EM τe ω θ
a)
1 vqd n 2 5
vabcn 3
Ce1 eqd n+1 6
subtract eabcn+1
n+1
iabcn T(θ ) urn yrn+1
iqd n
ADr BDr
n+1
Ce2(ω ) T (θn+1)
-1
De(ωn+1)
CDr DDr θn+1
vfn+1 ωn+1
λrn+1
z-1
λmag
4
τen+1
(cω1,cω2) θn+1
τmn+1
P
ωn+1
7
Extrapolate
b)
Figure 5.8. (a) The computational engine including the EM modules, (b) The PUs in the EM module
n+1
flux linkages λn+1
mq and λmd from PU3 to calculate electromagnetic torque τe
n+1
from
n+1
(5.47). Mechanical torque is read from EM module port and mechanical speed ω and
n+1 n+1 n+1
angle θ are calculated based on (5.48) and (5.50). PU4 also writes ω , θ and
τen+1 directly to the outputs of EM module.
PU5 calculates sub-transient voltages in qd coordinates. First, speed-dependent en-
tries of matrices Ce2 and De are updated using mechanical speed from PU4. Then, the
2 × 13 matrix-vector multiplication of (5.51) is performed.
91
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
Table 5.1
Resource utilization of the EM module
PU6 conduct transformation of (5.52) and uses the pre-saved values of the six trigono-
metric functions, similar to PU1. PU6 receives mechanical angle θn+1 and obtains
where h iT
bn+1
EM = en+1 n+1 n+1
abc(1) , eabc(2) , eabc(3) . (5.56)
92
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
out based on two methods, i.e., (i) reference method, based on VBR model and using
PLECs toolbox of MATLAB Simulink environment with ode23tb solver for which the
relative error parameter is set to 10−4 , and (ii) real-time FPGA-based method, using the
proposed CPVBR model and the proposed FPGA-based DRTS platform of Fig. 5.8 with
the time-step of 4µs.
In the second method for each case study a separate netlist file is created and read
by a MATLAB script. All system parameters, e.g., network matrices, PEC matrices and
EM parameters are calculated by the script and written to their corresponding module
by MB soft-processor. It should be noted that same FPGA-based DRTS hardware is
used for all case studies and only the contents of BRAMs in modules of the DRTS are
changed by MB soft-processor. The above settings for the two methods are kept the
same for all case studies and the results are presented in the following subsections.
LDC RDC
CDC IM
VDC
The system initial condition and input mechanical torque of the IM are set to zero. At
t = 0s PWM gate signals of the VSC are enabled with the modulation index of m = 0.4
at 50Hz to drive the IM.
Figure 5.10 depicts the simulation results based on the two methods described above
and includes three-phase stator currents, speed, electromagnetic torque and DC current.
The right column contains the results from the reference method, i.e., based on VBR
model and using PLECs toolbox of MATLAB Simulink environment and the left column
includes the results from the FPGA-based method, i.e., based on the proposed CPVBR
model and using the proposed FPGA-based DRTS platform of Fig. 5.8.
93
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
Table 5.2
Parameters of the PEC and IM
The system experiences start-up transients. The three-phase current amplitudes in-
crease to provide electromagnetic torque for the IM shaft to accelerate. The IM shaft
speed reaches steady state and at the same time the electromagnetic torque settles to
zero. The DC current also exhibits a transient behaviour to provide the power require
from the IM to accelerate its shaft and settles back to a zero at steady state.
Figure 5.10 illustrates that the results from the proposed FPGA-based method closely
match those from the reference method for all electrical and mechanical variables and
indicates that the proposed CPVBR model and EM module can accurately simulate IM
transient and steady state behaviour in real-time. Moreover, it shows the proposed EM
CPVBR model and EM module are compatible with the PEC model developed in this
thesis. The DC current from the FPGA-based method has the same transient and steady
state behaviour as that of the reference method and indicates that the PEC model does
not suffer from artificial power losses that are induced by ADC model.
94
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
FPGA based method Reference
500 500
iabcIM(A)
0 0
−500 −500
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
400 400
Speed (rad/sec)
300 300
200 200
100 100
0 0
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
1000 1000
800 800
Torque (N.m)
600 600
400 400
200 200
0 0
−200 −200
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
300 300
200 200
Idc (A)
100 100
0 0
−100 −100
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Figure 5.10. Simulation results of Case I, i.e., IM start-up, m = 0.4. The left column includes the results
from FPGA-based method, based on the proposed CPVBR model and using the proposed FPGA-based
DRTS platform of Fig. 5.8 with the real-time time-step of 4µs and the right column contains the results
from the reference method, i.e., based on VBR model and using PLECs toolbox of MATLAB Simulink
environment with ode23tb solver and the relative error parameter set to 10−4 .
torque and DC current. Subsequent to the modulation index step change the electrical
and mechanical variables of the system experience transients. The step change in modu-
lation index, or equivalently increase in the IM terminal voltage amplitude, increases the
three-phase currents and therefore electromagnetic torque.
Figure 5.11 shows that the IM transient response from the proposed FPGA-based
method closely match those from the reference method for all electrical and mechanical
variables and further confirms accurate performance of the proposed CPVBR model and
the proposed FPGA-based DRTS for simulation of the IM.
95
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
FPGA−based method Reference
200 200
100 100
iabcIM(A)
0 0
−100 −100
−200 −200
0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2
325 325
320 320
Speed (rad/sec)
315 315
310 310
305 305
300 300
0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2
200 200
100 100
Torque (N.m)
0 0
−100 −100
−200 −200
−300 −300
0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2
100 100
50 50
Idc (A)
0 0
−50 −50
−100 −100
0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2
Figure 5.11. Simulation results of Case II, i.e., IM transient response, a step change from m = 0.4 to
m = 0.5 is applied at t = 0.12s. The left column includes the results from FPGA-based method, based
on the proposed CPVBR model and using the proposed FPGA-based DRTS platform of Fig. 5.8 with
the real-time time-step of 4µs and the right column contains the results from the reference method, i.e.,
based on VBR model and using PLECs toolbox of MATLAB Simulink environment with ode23tb solver
and the relative error parameter set to 10−4 .
LDC RDC
to 157.07rad/s and 0.4 in 2 seconds, respectively. After the PMSM speed reaches
157.07rad/s, a step mechanical torque of τm = 10N.m is applied to the PMSM shaft
at t = 3s.
Figure 5.13 depicts the PMSM behaviour obtained from the FPGA-based method on
96
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
Table 5.3
Parameters of the PEC and PMSM
the left column and those from the reference method on the right column. Subsequent to
the mechanical torque step change, the system exhibits an oscillatory transient response
to compensate for the increased mechanical torque. Figure 5.13 shows that the simulation
results from the FPGA-based method matches those from the reference method for all
electrical and mechanical variables. This indicates that the proposed CPVBR model, EM
module and therefore the proposed FPGA-based DRTS can precisely simulate PMSM in
real-time. Moreover, this case study confirms that the EM module can represent different
types of EMs, e.g., IM and PMSM, using the same hardware module only by changing
the parameters in the BRAMs of the module.
97
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
FPGA based method Reference
20 20
iabcIM(A) 10 10
0 0
−10 −10
−20 −20
2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14 2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14
250 250
Speed (rad/sec)
200 200
150 150
100 100
50 50
0 0
2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14 2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14
30 30
Torque (N.m)
20 20
10 10
0 0
2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14 2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14
20 20
10 10
Idc (A)
0 0
−10 −10
2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14 2.98 3 3.02 3.04 3.06 3.08 3.1 3.12 3.14
Time(s) Time(s)
Figure 5.13. Simulation results of Case III, i.e., PMSM transient response, a mechanical torque of
τm = 10N.m is applied the PMSM shaft at t = 3s. The left column includes the results from FPGA-based
method, based on the proposed CPVBR model and using the proposed FPGA-based DRTS platform of
Fig. 5.8 with the real-time time-step of 4µs and the right column contains the results from the reference
method, i.e., based on VBR model and using PLECs toolbox of MATLAB Simulink environment with
ode23tb solver and the relative error parameter set to 10−4 .
The PMSM shaft speeds up until the back electromagnetic force (EMF) of the PMSM
reaches the level that can inject three-phase currents to the DC-link capacitor through
the anti-parallel diodes of the VSC. The three-phase currents produce a counter electro-
magnetic torque and therefore prevent the shaft speed from further speed-up. The shaft
speed reaches final value of 421rad/s at steady state.
Figure 5.14 shows that the PMSM transient simulation results from the FPGA-based
method matches those from the reference method for all electrical and mechanical vari-
ables. This case study also indicates that the CPVBR model and EM module can rep-
resent EMs with relatively high degree of dynamic saliency connected to a three-phase
diode rectifier.
98
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
FPGA based method Reference
iabcIM(A) 10 10
0 0
−10 −10
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
500 500
Speed (rad/sec)
400 400
300 300
200 200
100 100
0 0
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
10 10
Torque (N.m)
0 0
−10 −10
−20 −20
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
10 10
0 0
Idc (A)
−10 −10
−20 −20
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Time(s)
Time(s)
Figure 5.14. Simulation results of Case IV, i.e., PMSM and rectifier, a mechanical torque of τm =
−15N.m is applied to the PMSM shaft. The left column includes the results from FPGA-based method,
based on the proposed CPVBR model and using the proposed FPGA-based DRTS platform of Fig. 5.8
with the real-time time-step of 4µs and the right column contains the results from the reference method,
i.e., based on VBR model and using PLECs toolbox of MATLAB Simulink environment with ode23tb
solver and the relative error parameter set to 10−4 .
99
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
LDC RDC
vf' SM
VDC
Fig. 5.16 indicates that the SM and rectifier system simulation results obtained from
FPGA-based method closely match those from the reference method. In addition, it
confirms that the the CPBVR model and EM module can represent SMs regardless of
its parameter, e.g., relatively high dynamic saliency and system configuration, e.g., a
three-phase diode rectifier connected to SM terminals.
100 100
iabcIM(A)
0 0
−100 −100
−200 −200
0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2
0 0
Torque (N.m)
−200 −200
−400 −400
−600 −600
−800 −800
0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2
0 0
−50 −50
Idc (A)
−100 −100
−150 −150
−200 −200
0 0.05 0.1 0.15 0.2 0 0.05 0.1 0.15 0.2
Time(s) Time(s)
Figure 5.16. Simulation results of Case V, i.e., SM and Rectifier. The SM speed is locked at synchronous
speed and at t = 0s the field voltage is applied to the filed winding. The left column includes the results
from FPGA-based method, based on the proposed CPVBR model and using the proposed FPGA-based
DRTS platform of Fig. 5.8 with the real-time time-step of 4µs and the right column contains the results
from the reference method, i.e., based on VBR model and using PLECs toolbox of MATLAB Simulink
environment with ode23tb solver and the relative error parameter set to 10−4 .
100
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
Table 5.4
Parameters of the SM and Rectifier system
• The proposed EM model keeps the network admittance matrix constant which
101
CHAPTER 5. FPGA-BASED SIMULATION OF ELECTRICAL MACHINES (EMS)
FOR EMT ANALYSIS
102
Chapter 6
6.1 Introduction
Previous chapters proposed FPGA-based modules for PECs, EMs and electrical network
which collectively form an FPGA-based DRTS. The modules are based on modeling
approaches that are tailored to overcome the challenges associated with integrating re-
newable energy sources into power system. This chapter proposes a platform to conduct
real-time simulation studies of such power systems. The platform includes a model prepa-
ration script and a hardware platform. The model preparation script is a MATLAB code
that reads a netlist file and prepares parameters of each module in the FPGA-based
DRTS and the hardware platform includes the FPGA-based DRTS, RTDS and a PC
that runs the script. FPGA-based DRTS provides capability to simulate distribution
system and Inter-Hardware Universal Line Model (IHULM) enables connection of this
system to the rest of power system that is simulated in RTDS.
This chapter is organized as follows. Section 6.2 introduces IHULM concept, de-
fines the associated IHULM task in the context of FPGA-based DRTS and identifies
parallelism among the task steps. Section 6.3 presents the corresponding FPGA-based
hardware design of the IHULM module. Section 6.4 presents the real-time simulation
platform including the hardware platform and the model preparation script. Section 6.5
presents results of real-time simulation studies using the proposed platform. Section 6.6
highlights contributions and summarises this chapter.
103
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
where subscripts s and r denote sending-end and receiving-end, respectively, and all
quantities are in frequency-domain. Figure 6.1 shows transmission line model and Y c (s)
is the characteristic admittance matrix defined by
p
Y c (s) = Z (s)−1 Z (s)Y
Y (s), (6.2)
where Z (s) and Y (s) are the series impedance and shunt admittance per unit length,
respectively. l is the length of the line.
Is(s) Ir(s)
Matrices Y c (s) and H (s) are not rational transfer functions and thus prevent step-
104
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
where aY i s are the poles and R Y i s are their corresponding residue matrices.
Approximation of H (s), however, is more complicated due to the presence of multiple
modes. Therefore, H c (s) is decomposed into mode functions using modal decomposition,
i.e., [70]
T −1 (s),
H (s) = T (s)diag([eλ1 (s)l ... eλnM (s)l ])T (6.5)
where λi s and T (s) are eigenvalues and matrix of right eigenvectors of Y Z (s), respectively,
and nM is the number of modes. An approximation of the propagation matrix is defined
by [48]
nM X nH
X R Hji −τj s
H (s) ' H f (s) = ( e ), (6.6)
j=1 i=1
s − aHji
where τj is the j th mode time-delay and aHji is the ith pole of the j th mode function,
defined by
hj (s) = eλj (s)l+τj s . (6.7)
To simulate the line model in time-domain, based on (6.1), one needs to implement
where
and sign * represents time-domain convolution. hY f (t) and hf (t) are respectively the
impulse responses of Y f (s) and H f (s). Implementation of the convolutions, i.e., hY f
105
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
is ir
iYs ihs=hf*(iYr+ir) iYr
vs hYf hYf vr
ihr=hf*(iYs+is)
a) IHULM Concept
irn+1
isn+1
ihsn+1 ihYrn+1
ihYsn+1 hf
vsn+1 vrn+1
GY hf GY
ihrn+1
Represented in Represented in
FPGA-based DRTS RTDS
b) Discretized IHULM
106
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
domain, i.e.,
diiY i
= aY ii Y i + R Y iv s , (6.11)
dt
which can be discretized using TR, i.e.,
i n+1 n n n+1
Y i = aY dii Y i + G Y div s + G Y div s , (6.12)
where
∆taY i RY i
∆tR
1+ 2 2
aY di = ∆taY i
, G Y di = . (6.13)
1− 2
1 − ∆ta2 Y i
Rewriting (6.12) in the form of a history current source and a parallel admittance results
in
i n+1 n+1 n+1
Y i = i hY i + G Y div s , (6.14)
and
n+1 n n
i hY i = aY dii hY i + D Y div s , (6.15)
where
GY di .
D Y di = (1 + aY di )G (6.16)
in+1 n+1
Y s = GY v s + in+1
hY s , (6.17)
where nY
X
G0 +
G Y = (G G Y di ), (6.18)
i=1
and nY
X
i n+1
hY s = i n+1
hY i . (6.19)
i=1
107
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
g13
g12
g23
g11 g22 g33
using
The hf convolution processes, regarding both ends of the line, are also carried out
in FPGA-based DRTS as shown in Fig. 6.2 (b). Time-domain realization of the term
corresponding to each pole in (6.6) is
diiHji
= aHjii Hji + R Hjiu s (t − τj ), (6.21)
dt
where
u s (t) = i r (t) + i Y r (t). (6.22)
in+1 n n−τDj
Hji = aHdjii Hji + D Hjiu s , (6.23)
108
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
where
∆taHji
1+ 2 R Hji
∆tR τj
aHdji = ∆taHji
, D Hji = ∆taHji
, τDj = . (6.24)
1− 1− ∆t
2 2
where nH
X
i n+1
hsj = i n+1
Hji . (6.26)
i=1
n+1 n+1
in+1
us = i hs − i hY s ,
n+1 n+1
(6.27)
i n+1
ur = i hr − i hY r .
Based on the above discussion, the steps for IHULM simulation task include:
The first four steps are convolution processes and can be conducted in parallel since they
only require data from previous time-step, i.e., the IHULM simulation task can be carried
out in parallel with other tasks in the FPGA-based DRTS. The result of the first four
steps are used by step 5 to obtain output currents. A hardware module to implement
this task is designed based on floating-point numerical representation and explained in
Section 6.3.
109
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
The first four steps of the IHULM task are matrix-vector convolutions, i.e., two hf and
two hY f convolutions. hf convolution imposes more computational burden than that of
hY f since the number of modes, nM , is more than one and in this work considered to be
nM = 3, i.e., the same as the number of conductors. The maximum number of poles in
fitting process of Yc (s) and hj (s) is considered to be 6, i.e., nH = nY = 6. These indicate
that hf convolution requires 3 times more computational burden than hY f convolution.
Figure 6.4(a) depicts the IHULM hardware module in which a PU is considered for each
step in IHULM task.
Steps one and three are similar to steps two and four, respectively, and therefore have
identical PUs. Moreover, step three/four comprises three convolutions corresponding to
three mode functions hj (s) (j = 1 to 3) which are similar to step one/two. The first
four steps can be conducted in parallel and their outputs are inputs to the fifth step.
Therefore, the latency of PU1 and PU3 should be the same to reduce the overall latency
of the IHULM module. Thus PU3 is designed to have three hardware units, identical to
PU1, so it has the same latency as PU1.
i n+1
hY i = [aY diI D Y di ][iinhY i v ns ]T . (6.28)
PU3 inputs the current u ns and saves it in a BRAM. A separate hardware unit, similar
n−τ
to PU1, is considered for each mode which inputs u s Dj and calculates i n+1
hsj . PU4 has
n n+1
an identical design to PU3 and inputs u r and outputs i hsj s.
110
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
FPMACC1
Matrix-Vector Mult
FPADD
DYd0(i,j) DYd1(i,j) FPMACC1
Mux
aYd0(i) aYd1(i) FPMULT
FPMACC1
Partial Acc 0
vsn(i)
Demux
Partial Acc 1
Mux
ihY0n(i), ihY1n(i) FPMACC1
Partial Acc 6
BRAMs
ihYs n+1
vsn
BRAMs Matrix-Vector Mult
BRAMs
PU3 Convolution
usn-τD1
6 ihs1n+1 ius n+1
e-sτD1 Input Select Matrix-Vector Mult FPACC2
Mode 1
usn 6
e-sτD2 Input Select Matrix-Vector Mult
Mode 2
6 ihs2n+1
e-sτD3 Input Select Matrix-Vector Mult
Mode 3
PU2 Convolution
BRAMs
ihYs n+1
vrn
BRAMs Matrix-Vector Mult
BRAMs
PU4 Convolution
usn-τD1
6 ihs1n+1 iur n+1
e-sτD1 Input Select Matrix-Vector Mult FPACC2
Mode 1
urn 6
e-sτD2 Input Select Matrix-Vector Mult
Mode 2
6 ihs2n+1
e-sτD3 Input Select Matrix-Vector Mult
Mode 3
(a)
Figure 6.4. (a) IHULM FPGA module containing 5 PUs to carry out steps 1 to 5 of the IHULM
simulation task. (b) FP Multiply and Accumulate (FPMACC) units similar to the first design in Table
2.2 (c) Matrix-vector multiplication containing three FPMACC units. (d) The input select for matrix-
vector multiplication unit based on the order shown Fig. 6.5
111
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
DYd1(i,j)
aYd1 0 0 ihY1n
0 aYd1 0
ihY1n+1
0 0 aYd1
vsn
ihY2n
aYd2 0 0
0 aYd2 0 ihY2n+1
0 0 aYd2
vsn
DYd2(i,j)
Figure 6.5. The order of inputs for the vector-matrix multiplications in FPMACC1, shown in red arrow
Table 6.1
Resource utilization of IHULM Module
112
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
From PC
JTAG MicroBlaze
Soft- Processor
AXI
MUXs
Interconnect Matrix Vector
Independent source bs Multiplication
calculation Module
vn , vp bnode
bh & ihSW
History current update HRMNA b
2 x
Module
HeqRMNA beq
bss
PWM Module PEC Module
bconv
IH-ULM module
EM
bem
EM Module
θ & ω & τel
AXI
Data Stream
113
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
Table 6.2
Resource utilization of modules in the FPGA-based DRTS
RTDS interface module receives data from the transceiver module and sends it to
the corresponding modules. It sends the modulation indices to the PWM modules,
mechanical torques and field voltages to EM modules and unr to IHULM module. It
sends the receiving-end IHULM current source in+1
r and selectable output variables, i.e.,
node voltages or branch currents, to RTDS at each time-step for monitoring and/or
control purposes.
Control algorithms are carried out in RTDS rather than FPGA since it is nearly
impossible to devise a general structure for control algorithms to enable fixed hardware
module design. However, PWM generation can be efficiently carried out in hardware,
i.e., FPGA, with less burden and lower latency than in RTDS. Therefore, modulation
indices, are calculated in RTDS and sent to the PWM module in the FPGA-based DRTS
to generate PWM signals.
Module resource utilization and latency of the modules are given in Table 6.2. Ta-
ble 6.2 shows that the matrix-vector multiplication is the dominant resource consuming
module among all simulation and accessory modules and uses 33% and 41% of available
LUTs and FF paris, respectively.
AXI interconnection enables access to BRAMs and registers that contain a module
parameters for MB. In Table 6.2 these shared BRAMs are reported as part of AXI
interconnection, rather than the module. Therefore, for instance, the number of BRAMs
for PEC module is zero because all the BRAMs in this module are shared by AXI
114
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
interconnection.
Total LUT and FF pairs utilizations are 73% and 79%. However, 96% (70806 out
of 73694) of all available slices are utilized and, as Fig. 6.7 illustrates, the implemented
design is placed across the entire VC7VX485T chip.
Latency is only defined for simulation modules and the total latency of the FPGA-
based DRTS is determined by the matrix-vector multiplication module which is designed
to carry out a 138 × 160 matrix vector multiplication in which FP accumulator design
issimilar to the fifth design in Table 2.2.
The FPGA-based DRTS can simulate a power system with up to 160 outputs/nodes,
four PECs, three EMs, one IHULM, 96 dynamic branches and 14 independent sources in
real-time and operates at 120MHz, therefore, minimum real-time time-step is 2.54167µs,
regardless of size of the system. Eight independent sources can be sent from RTDS to
enable representing power components that can be modeled as independent sources, e.g.,
Solar-PV units and Batteries.
Time-step control module coordinates operation of six simulation modules, i.e., inde-
pendent source-, history current source-, PEC-, IHULM-, EM- and Matrix-vector multi-
plication module to ensure their parallel stall-free operation. Figure 6.8 illustrates timing
diagram of parallel operation of simulation modules where minimum time-step is
115
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
τ1 ≤ τ6 ,
τ2 ≤ 2l1 ,
τ3 ≤ 2(l1 + l2 ),
(6.30)
τ4 ≤ 2(l1 + l2 + l3 ),
τ5 ≤ 2(l1 + l2 + l3 + l4 ),
l1 + l2 + l3 + l4 + l5 = nb ,
where nb = 138. Equation (6.30) enforces sufficient condition to have a stall-free pipeline
design, i.e., the data consumer module should not wait for the output(s) of data pro-
ducer(s).
tn
τ6=Δtmin tn+1
τ1
History Current Source Module
τ2
PEC Module
τ3
IH_ULM Module
τ4
CPVBR-based EM Module Processing data
τ5 Inputting data
Matrix-Vector Mult Module Outputting data
time τACC
Figure 6.8. Timing diagram of parallel operation of simulation modules in FPGA-based DRTS
116
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
Order of Execution
Calculation of RMNA matrix
and Module parameters
Preparation of Intermediate Netlist Calculating system matrix
Find
IH-ULM (GY , aHdijs , DHijs, aYdis, DYdjs)
Replace each PECSN by its terminal For each PEC For ith PEC find:
voltage/current sources find:
PEC Matrices Yeqi, HCONVi(s),
Y’conv(s)
HSWi(s)
and HeqRMNAi
Figure 6.9. Model preparation algorithm diagram including three steps, 1st step (column) is to prepare
the intermediate netlist file, 2nd step is to find module parameters and RMNA matrix and 3rd step is to
obtain the network equivalent parameter of PECSNs. The process required for each component model
is shown in the corresponding row.
The first step reads the system netlist file and creates an intermediate netlist by re-
placing each PECSN by its voltage/current source representation, as explained in Section
4.4, and each EM by its CPVBR model interface circuit, as described in Section 5.3.
The second step provides discretized models of the dynamic branches from the in-
termediate netlist, including those of CPVBR model interface circuit and transmission
line and constitutes matrices Y and HRM N A . Moreover, it calculates parameters of each
module, e.g., EM matrices and parameters corresponding to different PUs in each EM
module of Fig. 5.8. For each PEC, the admittance matrix of the corresponding PECSN
Y0Convi (s) is calculated for all permutation of its switch states.
Third step obtains matrices Heqi and Yeqi and therefore HeqRM N Ai for each PEC.
These matrices and HRM N A s are used to form the system matrix of (4.26). Finally, for
each PEC, it calculates HConvi (s), HSW i (s), using Heqi , Yeqi and Y0Convi (s) , according
to Section 4.4.
The module parameters are used by MB soft-processor to run a software application,
117
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
developed in Xilinx SDK environment, and configure each module using its corresponding
parameters via AXI interconnection.
The receiving end is open and a step DC voltage of 220kV is applied to phase a of the
sending end at t = 0s. Figure 6.11 illustrates simulation results from the FPGA-based
method using the proposed IHULM and those of the reference method, using PSCAD.
Time-delays of this line is around t = 1ms, as shown in Appendix B. The wave from
sending end reaches the receiving end after around 1ms and causes voltage transients.
This wave goes back and reaches the sending end at around t = 2ms and cause voltage
transients on phases b and c. Figure 6.11 shows that results from the FPGA-based
method closely matches those of the reference method.
118
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
Reference method
400 400
200 200
0 0
−200 −200
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Sending end voltages(kV)
300 300
200 200
100 100
0 0
−100 −100
−200 −200
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Time(s) Time(s)
Figure 6.11. Simulation results of overhead line energization. The left column includes the results from
FPGA-based method, based on the proposed real-time simulation platform with the real-time time-step
of 2.6µs and the right column contains the results from the reference method, using PSCAD, based on
its phase domain model, with the time-step of 2.6µs.
Table 6.3
DER unit parameters
119
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
(a)
10MW
LDC rDC
Lls rTs Lls rTs Lf rf
CDC
Cf
(b)
Figure 6.12. (a) Grid connected DER study system (b) DER unit model
The modulation index of the VSC is set to m = 0.5∠15◦ with respect to the AC
system. The initial voltage of the DC-link capacitor is set to 1200V and the other initial
conditions are set to zero.
Figure 6.13 presents the start-up transients of the system using the FPGA-based
method and the reference method. Voltages at the receiving end, i.e., the end represented
in RTDS, start from zero, however, it takes around 1ms for the voltage waves to reach
the sending end due to the transmission line delay.
A three-phase to ground fault is applied to the grid terminal at t=0.5s to study the
DER current transients and the simulation results are presented in Fig. 6.14. Subse-
quent to the fault inception, the DER three-phase currents increase and at t=0.51s the
gate signals of the VSC are blocked. Figure 6.14 shows that, after the gate signals are
blocked, the DER currents go to zero through the anti-parallel diodes of the VSC. Figure
6.14 indicates that the results from the FPGA-based method closely match those of the
reference method.
120
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
200 200
0 0
−200 −200
−400 −400
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Sending end voltages(kV)
400 400
200 200
0 0
−200 −200
−400 −400
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
2 2
DER currents(kA)
1 1
0 0
−1 −1
−2 −2
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Time(s) Time(s)
Figure 6.13. Start up simulation results of Case II, grid connected DER. The receiving end and sending
end voltages of the transmission line are shown in first and second row, respectively, and the DER
three-phase currents are shown in the third row. The left column includes the results from FPGA-based
method, based on the proposed real-time simulation platform with the real-time time-step of 2.6µs and
the right column contains the results from the reference method, using PSCAD with the time-step of
2.6µs.
Microgrid start-up
In this scenario the microgrid of Fig. 6.15 experiences start-up transients. The modula-
tion indices of DER1 to DER4 are set at m1 = 0.4∠30◦ , m2 = 0.4∠45◦ , m3 = 0.4∠30◦
and m4 = 0.4∠45◦ and angles are with respect to the AC system voltage. It should be
noted that 30◦ offset is considered because of the ∆Y transformer phase-shift.
121
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
200 200
0 0
−200 −200
−400 −400
0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55
400 400
200 200
0 0
−200 −200
−400 −400
0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55
4 4
DER currents(kA)
2 2
0 0
−2 −2
−4 −4
0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55
Time(s) Time(s)
Figure 6.14. Fault response simulation results of Case II, grid connected DER. The receiving end and
sending end voltages of the transmission line are shown in first and second row, respectively, and the
DER three-phase currents are shown in the third row. A three-phase to ground fault is applied to the
grid voltage at t=0.5s and VSC gate signals are blocked at t=0.51s. The left column includes the results
from FPGA-based method, based on the proposed real-time simulation platform with the real-time time-
step of 2.6µs and the right column contains the results from the reference method, using PSCAD with
the time-step of 2.6µs.
Figure 6.16 shows the three-phase currents of four DERs. The left column is the
results from FPGA-based method and the right column is the results from the reference
method. Four DER three-phase currents reach steady-state after about 100ms. DER1
and DER3 generate output voltages with the same fundamental frequency and angle,
however, DER1 steady-stat current amplitude is less than DER3 as it is electrically
further away from the grid voltage. The same conclusion can be drawn comparing DER2
and DER4 currents. Figure 6.16 also shows that DER currents from FPGA-based method
favourably match those of the reference method.
Figure 6.17 depicts start-up transients of IMs. The left column includes the results
from FPGA-based method and the right column shows the results from the reference
method. It illustrates that each IM draws around 400A (peak) three-phase currents to
provide start-up torque. All IMs have identical mechanical and electrical parameters
and it takes around 1.3s to reach their steady-state, however, IM3 draws slightly larger
122
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
200kVA
150kW
DER2
500kVA
T2
200kVA 27kV/600V
150kW 150kW
AC System
IM2 50hp
T6 DER3
27kV 460V 500kVA
T3
27kV/600V
27kV
DER4
200kVA 500kVA
150kW T4
27kV/600V
Figure 6.15. (a) Microgrid case study system embedding four DER units
currents and reaches the steady state speed slightly faster than the other two IMs as it
is electrically closer to the grid. Figure 6.17 indicates the results from the FPGA-based
method closely matches those of the reference results.
Three-phase fault
123
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
Table 6.4
Microgrid 50hp IM parameters [1]
500 500
0 0
−500 −500
−1000 −1000
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
2000 2000
DER2 currents(A)
1000 1000
0 0
−1000 −1000
−2000 −2000
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
1000 1000
DER3 currents(A)
500 500
0 0
−500 −500
−1000 −1000
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
2000 2000
DER4 currents(A)
1000 1000
0 0
−1000 −1000
−2000 −2000
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Time(s) Time(s)
Figure 6.16. Simulation results of DER currents in the microgrid start-up. DER1 to DER4 three-phase
currents are shown in the first to fourth row, respectively. The left column includes the results from
FPGA-based method, based on the proposed real-time simulation platform with the real-time time-step
of 2.6µs and the right column contains the results from the reference method, using PSIM with the
time-step of 2.6µs.
124
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
0 0
−500
0 0.5 1 1.5 −500
0 0.5 1 1.5
500 500
IM2 currents(A)
0 0
−500
0 0.5 1 1.5 −500
0 0.5 1 1.5
500 500
IM3 currents(A)
0 0
−500 −500
−1000
0 0.5 1 1.5 −1000
0 0.5 1 1.5
1000 1000
IM3
EM torque
−500
0 0.5 1 1.5 −500
0 0.5 1 1.5
Time(s)
200 200
Speed(rad/sec)
IM3
150 IM2 150
100 IM1
100
50 50
0
0 0.5 1 1.5 0
0 0.5 1 1.5
Time(s)
Time(s)
Figure 6.17. Simulation results of IMs in the microgrid start-up. IM1 to IM3 three-phase currents are
shown in the first to third row, respectively. Fourth and fifth row are respectively the electromagnetic
torque and the mechanical speed of the IMs. The left column includes the results from FPGA-based
method, based on the proposed real-time simulation platform with the real-time time-step of 2.6µs and
the right column contains the results from the reference method, using PSIM with the time-step of 2.6µs.
125
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
1000 1000
0 0
−1000 −1000
−2000 −2000
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.48 1.5 1.52 1.54 1.56 1.58 1.6
2000 2000
DER2 currents(A)
1000 1000
0 0
−1000 −1000
−2000 −2000
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.48 1.5 1.52 1.54 1.56 1.58 1.6
2000 2000
DER3 currents(A)
1000 1000
0 0
−1000 −1000
−2000 −2000
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.48 1.5 1.52 1.54 1.56 1.58 1.6
2000 2000
DER4 currents(A)
1000 1000
0 0
−1000 −1000
−2000 −2000
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.48 1.5 1.52 1.54 1.56 1.58 1.6
Time(s) Time(s)
Figure 6.18. Simulation results of DER currents in the microgrid fault study. DER1 to DER4 three-phase
currents are shown in the first to fourth row, respectively. The left column includes the results from
FPGA-based method, based on the proposed real-time simulation platform with the real-time time-step
of 2.6µs and the right column contains the results from the reference method, using PSIM with the
time-step of 2.6µs.
the real-time time-step of 2.55µs. The model preparation script is a MATLAB code that
reads the netlist file of a study system and prepares parameters required by the FPGA-
based DRTS, using component modeling approaches explained in this thesis. Three real-
time simulation studies were conducted using the proposed real-time simulation platform
and results were compared against those of an off-line simulation package.
In summary, the main features of the proposed IHULM and real-time simulation
platform include:
126
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
200 200
0 0
−200
−200
−400
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 −400
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64
IM2 currents(A)
400 400
200 200
0 0
−200
−200
−400
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 −400
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64
IM3 currents(A)
400 400
200 200
0 0
−200
−200
−400
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 −400
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64
500 500
IM3
EM torque
0 IM2 0
IM1
−500 −500
−1000
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 −1000
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64
Time(s)
Speed(rad/sec)
190 190
IM3
188 IM2 188
IM1
186 186
184
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 184
1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64
Time(s)
Time(s)
Figure 6.19. Simulation results of IMs in the microgrid fault study. IM1 to IM3 three-phase currents are
shown in the first to third row, respectively. Fourth and fifth row are respectively the electromagnetic
torque and the mechanical speed of the IMs. The left column includes the results from FPGA-based
method, based on the proposed real-time simulation platform with the real-time time-step of 2.6µs and
the right column contains the results from the reference method, using PSIM with the time-step of 2.6µs.
127
CHAPTER 6. REAL-TIME SIMULATION PLATFORM AND PERFORMANCE
VERIFICATION
128
Chapter 7
7.1 Summary
This dissertation introduces an FPGA-based real-time simulation platform for real-time
simulation studies of large-size power systems which include short transmission lines and
multiple PECs. Presence of short transmission lines creates a large set of network equa-
tions that can not be decoupled. The real-time simulation platform should solve these
equations with a small time-step, due to presence of high switching frequency PECs.
Handling the large admittance matrix, representing the large set of network equations,
requires floating-point numerical representation which is associated with larger latencies
in FPGAs, as compared to fixed-point representation. These latencies prevent achieving
small simulation time-steps for large systems. Moreover, the real-time simulation plat-
form should accurately simulate EMs, as components of power systems, under various
test scenarios and system configurations.
The existing work, for simulation of systems targeted in this thesis, suffers from the
following limitations. The existing FPGA-based simulators (i) are not capable of simulat-
ing networks with large number of nodes using a small time-step, (ii) employ ADC model
to represent PEC switches which introduces substantial errors, e.g., artificial switching
loss and numerical oscillations which are unacceptable for most of practical applications,
(iii) use QD EM model that fails to emulate EM behaviour under specific test scenarios
and system configurations and (iv) are mainly based on fixed-point representation or use
intermediate fixed-point accumulation stage.
The FPGA-based real-time simulation platform of this thesis (i) can simulate large
networks with a small time-step of 2.55µs and up to 160 outputs/nodes, (ii) employs two-
value resistor switch model to accurately represent PECs, (iii) accurately simulates EMs
under all test scenarios and system configurations, (iv) is based on standard floating-point
numerical representation, (v) can be interfaced with commercially available simulation
129
CHAPTER 7. SUMMARY AND CONCLUSION
platform, e.g.,RTDS, to enable parallel simulation of distribution system and the rest of
the system (in RTDS) and (vi) features fixed-hardware design, therefore, time-consuming
hardware code re-compilation is avoided. This platform also includes a model preparation
script that calculates study system parameters based on the modeling approaches devised
in this work.
This thesis also presents RMNA formulation of network equations to solve relatively
large set of equations associated with networks featuring short transmission lines and
enable parallelism between the simulation task of solving network equations and those
of other power system component models. A low latency floating-point matrix-vector
multiplication hardware module is designed to carry out the simulation task of solving
network equations. A novel FPGA-based partitioning method is proposed for accurate
real-time simulation of multiple PECs using two-value resistor model. Based on the par-
titioning method, a PEC hardware module is designed and replicated to simulate systems
embedding multiple PECs. A new EM CPVBR model is proposed to enable real-time
simulation of EMs, regardless of their dynamic saliency and system configuration. An
EM hardware module is designed, based on the proposed EM model, that can represent
different types of EMs, i.e., IM, SM and PMSM. This thesis also presents IHULM which
enables partitioning of power system model, using transmission line natural delays based
on ULM, to enable parallel simulation of distribution system in the FPGA-based DRTS
and the rest of the system in RTDS.
7.2 Conclusions
This thesis shows that, although FPGAs are powerful computation devices, the exist-
ing power system EMT simulation algorithms are not readily applicable for time- and
resource-efficient FPGA-based DRTS design. However, reformulation of the existing
equations and/or devising new component models, tailored for FPGA-based implemen-
tation, can facilitate achieving such design. This thesis also investigates and shows that:
• In contrast to the existing works in the literature, FPGA-based DRTS design, with
small real-time simulation time-step, based on standard floating-point numerical
representation, can be enabled to simulate large networks using a small time-step
by reformulation of floating-point accumulation process explained in Chapter 2;
• Fixed-hardware FPGA-based DRTS design can avoid time-consuming hardware
code recompilation;
• Using High Level Synthesis (HLS) FPGA programming method enables more ag-
gressive design exploration and achieving a higher FPGA-based DRTS performance,
130
CHAPTER 7. SUMMARY AND CONCLUSION
i.e., simulating a large system in a small time-step, than using solely HDL languages;
• In partitioning of model of a system, including multiple PECs, considering each
PECSN as a subsystem enables representing power switches by two-value resistor
model. This also enables retaining constant system admittance matrix to avoid
on-the-fly LU factorization;
• CPVBR EM model suits the structure of the proposed FPGA-based DRTS, since
it enables direct interface with the model of the rest of the system and retains
constant admittance matrix;
• In FPGA-based real-time simulation of systems targeted in this work, i.e., systems
with large number of nodes and short transmission lines, the module associated
with the solution of network equations imposes highest computational burden and
therefore is the dominant resource-consuming module.
7.3 Contributions
The main contribution of this dissertation is designing a fixed-hardware FPGA-based
DRTS to avoid hardware code recompilation, using standard floating-point numerical
representation. The FPGA-based DRTS can simulate networks up to 160 nodes/outputs,
four PECs and three EMs with the real-time time-step of 2.55µs. Moreover, the simula-
tor is equipped with an IHULM module that enables parallel simulation of distribution
system in the FPGA-based DRTS and the rest of the system in RTDS. The detailed
technical innovations of this thesis include:
• Devising RMNA formulation to enable (i) parallelism between the task associated
with the solution of the network and those of other component models and (ii)
appropriate scheduling of the tasks based on their associated latency to achieve a
stall-free pipeline design and therefore small real-time simulation time-step.
• Designing a low-latency matrix-vector multiplication module to enable solution
of a large set of network equations, based on standard floating-point numerical
representation.
• Developing a solution-level partitioning method for simulation of PECs which
(i) maintains constant network admittance matrix, while using two-value resistor
model to represent power switches in PECs, (ii) is generalized for application to
multiple PECs which enables real-time simulation of systems embedding multiple
PECs.
• Designing an FPGA-based PEC module, based on the proposed partitioning method,
that can represent PECs with up to 6 switches and requires relatively small FPGA
131
CHAPTER 7. SUMMARY AND CONCLUSION
logic and memory resources to save the PEC parameters and matrices.
• Devising a CPVBR EM model which (i) enables direct interface of the EM model
to the rest of the system, (ii) is compatible with RMNA formulation and the de-
vised partitioning method for simulation of PECs, (iii) enables representing EMs
regardless of their dynamic saliency and (iv) enables parallelism between the EM
simulation task and the rest of the tasks in the FPGA-based DRTS.
• Developing an FPGA-based EM module, based on the proposed CPVBR model,
that can represent different types of EMs, i.e., IM, SM and PMSM.
• Designing IHULM module that (i) enables integration of the proposed FPGA-
based DRTS into an industry-standard real-time simulator, i.e., RTDS, based on
modeling-level partitioning of power systems using the natural delay of the trans-
mission lines and (ii) operates in parallel with the other simulation task/modules
which enables achieving small real-time simulation time-step. This module enables
parallel simulation of distribution system in the FPGA-based DRTS and the rest
of the system in RTDS.
• Developing a model preparation script that automatically calculates the parameters
and matrices of a study system using its describing netlist file, based on RMNA
formulation and component modeling approaches devised in this dissertation.
132
Appendix A
EM Matrices
This section presents the matrices of the proposed generalized EM and the CPVBR EM
model which are defined by
h iT
λ r = λqr1 , λdr1 , λqr2 , λdr2 , (A.1)
h iT
0
ur = isq , isd , λmag , vf , vsq , (A.2)
h iT
yλ = λmq λmd λ”q λ”d , (A.3)
L”mq rrq1 L”mq
− Lrrq1 (1 − Lrq1
) 0 Lrq1 Lrq2
0
rq1 L”md rrd1 L”md
rrd1
0 − Lrd1 (1 − Lrd1 ) 0 Lrd1 Lrd2
Ar = , (A.4)
r L” L”
rq2 mq rrq2 mq
Lrq2 Lrq1
0 − Lrq2
(1 − Lrq2
) 0
”
rrd2 Lmd ”
Lmd
rrd2
0 Lrd1 Lrd2
0 − Lrd2 (1 − Lrd2 )
rrq1 L”mq
0 0 0 0
Lrq1 rrd1 L”md rrd1 L”md
0 0 0
Lrd1 Lrd1 Lmd
Br = rrq2 L”mq , (A.5)
Lrq2 0 0 0 0
rrd2 L”mq rrd2 L”md
0 Lrd2 Lrd2 Lmd
1 0
”
Lmq L”mq
L
0 Lrq2
0
rq1 L”md L”md
0 0
Lrd1 Lrd2
Cr = L”mq , (A.6)
L”mq
Lrq1 0 Lrq2
0
L”md ”
Lmd
0 Lrd1
0 Lrd2
133
APPENDIX A. EM MATRICES
L”mq 0 0 0 0
L”md
0 L”md
Lmd
0 0
Dr =
0
, (A.7)
0 0 0 0
L”md
0 0 Lmd
0 0
L” rrq1 L” rrq2
− mq2 0 − mq
L2rq2
0
Ce1 = Lrq1 , (A.8)
rrd1 L”md rrd2 L”md
0 − L2rd1
0 − L2rd2
”
L rrq2 L”mq rrq1
( mq
L2rq2
+ L2rq1
) 0 0 ω
Ce2 (ω) = rrd2 L”md rrd1 L”md
, (A.9)
0 ( L2rd2
+ L2rd1
) −ω 0
and " #
0 ω(L”d − L”q ) 0 0 0
De (ω) = L”md L”d −L”q . (A.10)
0 0 0 Lrd2 ∆t
134
Appendix B
This section presents the parameters and fitting results of the transmission line used
in this thesis. The tower configuration of an untransposed overhead transmission line
is given in Fig. B.1. The values of the characteristic admittance matrix Y c (s), prop-
agation matrix H (s), impedance per unit length Z (s) and admittance per unit length
Y (s) at sample frequencies ωs s are obtained using PSCAD and the fitting results of the
transmission line is explained as follws.
G1 10m G2
10m
C2
5m
10m
C1 C3
30m
135
APPENDIX B. TRANSMISSION LINE PARAMETERS AND FITTING RESULTS
Table B.1
Conductor and ground wire data
Description Value
Conductor radius 0.020345 Ω
Conductor DC resistance 0.032060 Ω/km
Ground wire radius 0.005524 m
Ground wire resistance 2.86450 Ω/km
The fitting of Y c (s) is carried out using vector fitting for matrix transfer functions
[72] [73] and Fig.B.2 shows the results from fitting of Y c (s).
−3
x 10
2.5
2 data
fitted
(s)
c(1,1)
1.5
Y
0.5
−1 −4 0 1 2 3 4 5 6
x 10
3.5
2.5
(s)
c(1,2)
2
Y
1.5
0.5
−1 0 1 2 3 4 5 6
−4
x 10
3.5
2.5
(s)
c(1,3)
2
Y
1.5
0.5
−1 0 1 2 3 4 5 6
Log(f)
Figure B.2. Results from fitting of characteristic admittance Y c (s). Top is Y c (1, 1)(s), middle Y c (1, 2)(s)
and bottom Y c (1, 3)(s).
To fit H (s) the mode functions hi (s)s are obtained by (6.5) at all sample frequency
136
APPENDIX B. TRANSMISSION LINE PARAMETERS AND FITTING RESULTS
1
data
0.8 fitted
0.6
|h1(s)|
0.4
0.2
0
−1 0 1 2 3 4 5 6
1
0.8
0.6
|h2(s)|
0.4
0.2
0
−1 0 1 2 3 4 5 6
1
0.8
0.6
|h3(s)|
0.4
0.2
0
−1 0 1 2 3 4 5 6
Log(f)
Figure B.3. Results from fitting of mode functions. Top is h1 (s), middle h2 (s) and bottom h3 (s).
The poles of hi (s)s are used to obtain residue matrices of (6.6) using
A Rx R = B R (B.2)
where x R is an unknown vector, containing entries of R Hji s, and each row of A R corre-
sponds to (6.6) at a specific sample frequency point [48]. Equation (B.2) is an overde-
termined set of linear equations, i.e., the number of unknowns is less than number of
137
APPENDIX B. TRANSMISSION LINE PARAMETERS AND FITTING RESULTS
equations, therefore,
min ||A
ARx R − B R ||2 (B.3)
is solved by [48]
xR = A+
R BR (B.4)
where
A+ ATRA R )−1A TR
R = (A (B.5)
1
data
0.8 fitted
H(1,1)(s)
0.6
0.4
0.2
0
−1 0 1 2 3 4 5 6
0.4
0.3
(s)
(1,2)
0.2
H
0.1
0
−1 0 1 2 3 4 5 6
0.4
0.3
H(1,3)(s)
0.2
0.1
0
−1 0 1 2 3 4 5 6
Log(f)
Figure B.4. Results from fitting of propagation matrix H (s). Top is H (1, 1)(s), middle H (1, 2)(s) and
bottom H (1, 3)(s).
138
Bibliography
[1] Paul C. Krause, Oleg Wasynczuk, Scott D. Sudhoff, and Steven Pekarek. Introduc-
tion to the Design of Electric Machinery, pages 608–. Wiley-IEEE Press, 2013.
[8] RTDS Technology Inc. Winnipeg Canada. Real-time simulation. [online]. available:
http://www.rtds.com.
[10] T. Maguire and J. Giesbrecht. Small time-step vsc model for the real time digital
simulator. IPST, Montreal, QC, Canada,, 2005.
139
BIBLIOGRAPHY
[11] P. Pejovic and D. Maksimovic. A method for fast time-domain simulation of networks
with switches. Power Electronics, IEEE Transactions on, 9(4):449–456, Jul 1994.
[12] R. Meka, M. Sloderbeck, M.O. Faruque, J. Langston, M. Steurer, and L.S. DeBrun-
ner. Fpga model of a high-frequency power electronic converter in an rtds power
system co-simulation. In Electric Ship Technologies Symposium (ESTS), 2013 IEEE,
pages 71–75, April 2013.
[17] G. Sybille and P. Giroux. Simulation of facts controllers using the matlab power
system blockset and hypersim real-time simulator. In Power Engineering Society
Winter Meeting, 2002. IEEE, volume 1, pages 488–491 vol.1, 2002.
[21] M. Matar and R. Iravani. Fpga implementation of the power electronic converter
model for real-time simulation of electromagnetic transients. Power Delivery, IEEE
Transactions on, 25(2):852–860, April 2010.
140
BIBLIOGRAPHY
[23] G.G. Parma and V. Dinavahi. Real-time digital hardware simulation of power elec-
tronics and drives. Power Delivery, IEEE Transactions on, 22(2):1235–1246, April
2007.
[24] Aung Myaing and V. Dinavahi. Fpga-based real-time emulation of power electronic
systems with detailed representation of device characteristics. Industrial Electronics,
IEEE Transactions on, 58(1):358–368, Jan 2011.
[25] N. Roshandel Tavana and V. Dinavahi. A general framework for fpga-based real-time
emulation of electrical machines for hil applications. Industrial Electronics, IEEE
Transactions on, 62(4):2041–2053, April 2015.
[26] Can Wang, Wei Li, and J. Belanger. Real-time and faster-than-real-time simulation
of modular multilevel converters using standard multi-core cpu and fpga chips. In
Industrial Electronics Society, IECON 2013 - 39th Annual Conference of the IEEE,
pages 5405–5411, Nov 2013.
[28] K. Strunz and E. Carlson. Nested fast and simultaneous solution for time-domain
simulation of integrative power-electric and electronic systems. Power Delivery,
IEEE Transactions on, 22(1):277–287, Jan 2007.
[30] Yuan Chen and V. Dinavahi. Fpga-based real-time emtp. Power Delivery, IEEE
Transactions on, 24(2):892–902, April 2009.
[31] Yuan Chen and V. Dinavahi. Digital hardware emulation of universal machine and
universal line models for real-time electromagnetic transient simulation. Industrial
Electronics, IEEE Transactions on, 59(2):1300–1309, Feb 2012.
141
BIBLIOGRAPHY
[38] G. Hachtel, R. Brayton, and F. Gustavson. The sparse tableau approach to network
analysis and design. IEEE Transactions on Circuit Theory, 18(1):101–113, Jan 1971.
[40] J. P. David. Low latency solver for linear equation systems in floating point arith-
metic. In 2015 International Conference on ReConFigurable Computing and FPGAs
(ReConFig), pages 1–7, Dec 2015.
142
BIBLIOGRAPHY
[47] Chung-Wen Ho, A. Ruehli, and P. Brennan. The modified nodal approach to network
analysis. IEEE Transactions on Circuits and Systems, 22(6):504–509, Jun 1975.
[48] A. Morched, B. Gustavsen, and M. Tartibi. A universal model for accurate calcula-
tion of electromagnetic transients on overhead lines and underground cables. IEEE
Transactions on Power Delivery, 14(3):1032–1038, Jul 1999.
[49] Randall J. LeVeque. Finite Difference Methods for Ordinary and Partial Differential.
[51] R. Razzaghi, C. Foti, M. Paolone, and F. Rachidi. A novel method for the op-
timal parameter selection of discrete-time switch model. Proceedings of the 10th
International Conference on Power Systems Transients, pages 1–7, July 2013.
[52] K. K. Fung and S. Y. R. Hui. Fast simulation of multistage power electronic sys-
tems with widely separated operating frequencies. IEEE Transactions on Power
Electronics, 11(3):405–412, May 1996.
[55] T. Kato, K. Inoue, T. Fukutani, and Y. Kanda. Multirate analysis method for
a power electronic system by circuit partitioning. IEEE Transactions on Power
Electronics, 24(12):2791–2802, Dec 2009.
143
BIBLIOGRAPHY
[58] E. Dlala. Comparison of models for estimating magnetic core losses in electrical ma-
chines using the finite-element method. IEEE Transactions on Magnetics, 45(2):716–
725, Feb 2009.
[59] S.D. Pekarek, O. Wasynczuk, and H.J. Hegner. An efficient and accurate model
for the simulation and analysis of synchronous machine/converter systems. Energy
Conversion, IEEE Transactions on, 13(1):42–48, Mar 1998.
[61] P. J. Lagace, M. H. Vuong, and K. Al-Haddad. A time domain model for transient
simulation of synchronous machines using phase coordinates. In 2006 IEEE Power
Engineering Society General Meeting, pages 6 pp.–, 2006.
[64] H. K. Lauw and W. S. Meyer. Universal machine modeling for the representation of
rotating electric machinery in an electromagnetic transients program. IEEE Trans-
actions on Power Apparatus and Systems, PAS-101(6):1342–1351, June 1982.
144
BIBLIOGRAPHY
145