Real Time Simulation and Hard Ware in The Loop Testing Using Typhoon HIL
Real Time Simulation and Hard Ware in The Loop Testing Using Typhoon HIL
Real-Time
Simulation and
Hardware-in-the-Loop
Testing Using Typhoon
HIL
Transactions on Computer Systems
and Networks
Series Editor
Amlan Chakrabarti, Director and Professor, A. K. Choudhury School of
Information Technology, Kolkata, West Bengal, India
Transactions on Computer Systems and Networks is a unique series that aims
to capture advances in evolution of computer hardware and software systems
and progress in computer networks. Computing Systems in present world span
from miniature IoT nodes and embedded computing systems to large-scale
cloud infrastructures, which necessitates developing systems architecture, storage
infrastructure and process management to work at various scales. Present
day networking technologies provide pervasive global coverage on a scale
and enable multitude of transformative technologies. The new landscape of
computing comprises of self-aware autonomous systems, which are built upon a
software-hardware collaborative framework. These systems are designed to execute
critical and non-critical tasks involving a variety of processing resources like
multi-core CPUs, reconfigurable hardware, GPUs and TPUs which are managed
through virtualisation, real-time process management and fault-tolerance. While AI,
Machine Learning and Deep Learning tasks are predominantly increasing in the
application space the computing system research aim towards efficient means of
data processing, memory management, real-time task scheduling, scalable, secured
and energy aware computing. The paradigm of computer networks also extends it
support to this evolving application scenario through various advanced protocols,
architectures and services. This series aims to present leading works on advances
in theory, design, behaviour and applications in computing systems and networks.
The Series accepts research monographs, introductory and advanced textbooks,
professional books, reference works, and select conference proceedings.
Saurabh Mani Tripathi ·
Francisco M. Gonzalez-Longatt
Editors
Real-Time Simulation
and Hardware-in-the-Loop
Testing Using Typhoon HIL
Editors
Saurabh Mani Tripathi Francisco M. Gonzalez-Longatt
Department of Electrical Engineering Department of Engineering
Kamla Nehru Institute of Technology Centre for Smart Grid
Sultanpur, India University of Exeter
Exeter, UK
Department of Electrical Engineering,
Information Technology and Cybernetics
University of South-Eastern Norway
Notodden, Norway
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature
Singapore Pte Ltd. 2023
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether
the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse
of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and
transmission or information storage and retrieval, electronic adaptation, computer software, or by similar
or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors, and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Singapore Pte Ltd.
The registered company address is: 152 Beach Road, #21-01/04 Gateway East, Singapore 189721,
Singapore
Foreword
The story of Typhoon HIL started in 2008, when motivated by a real-life challenge
to completely change the way power electronics control systems are designed and
tested, Typhoon HIL’s founding team embarked on a quest to bring Hardware in the
Loop (HIL) testing for power electronics and motor drives to reality. A couple of
years later, we succeeded in demonstrating the first of kind 1 µs time step real-time
HIL simulation for power electronics that set the record for the smallest time step HIL
simulation by two orders of magnitude. More importantly, we proved that ultra-high
fidelity HIL for power electronics is possible, and for the first time, there was a clear
path towards a fully integrated model-based design workflow where design, testing,
and system integration can be done using the same models, from start to finish, all
in one unified workflow.
At the time there were many good off-line simulation software for the design
and simulation of power converters. Also, there were good solutions for converter
testing and validation. But the gap was HIL testing to connect model-based design
with model-based testing. Indeed, it was HIL that unlocked wider acceptance of
integrated and unified Model-Based Engineering (MBE) as the key process for the
design, testing, and lifecycle maintenance of power electronics control systems. And
as with any new innovation that enables radical departure from a widely accepted
practice of the time, it took more than a decade until HIL became adopted as a
cornerstone of control design and testing thus replacing high-power lab testing of
controllers.
From day one, our vision was to develop integrated and easy-to-use MBE tools
to empower control engineers developing power electronics controls, to elevate the
design processes, empower teams to collaborate, thus unleashing creative energy,
and radically accelerating the pace of innovation. On the one hand, we understood
the importance of power electronics, and on the other hand, we were unsatisfied with
the status quo in terms of design and testing tools. This nexus was further amplified
by the imminent need to accelerate the transformation of our civilization’s energy
systems toward a 100% clean and sustainable energy future and the need to have better
v
vi Foreword
testing, design and integration tools. Indeed, in the past 10+ years, power electronics
converters and their applications have been driving renewable integration, energy
storage proliferation, and electrification of transportation.
This first issue of the Real-time Simulation and Hardware in the Loop Testing
serves as an impressive demonstration of both the breadth and depth of power elec-
tronics applications with particular emphasis on control design, testing, and system-
level integration challenges. We believe that this book, with in-depth treatment of
grid forming inverter control design, advanced protection concepts, interoperability
challenges between protection and DERs, and microgrid and distribution system
controls, will empower and motivate the community to push the boundaries of control
design and optimization both in terms of performance, robustness, and interoper-
ability. Furthermore, it paves the way for further exploration of machine learning
and AI applications to the problem of control and coordination of the future truly
cyber-physical grid.
We want to express our deepest gratitude and appreciation to all the authors for
their deep, technically rigorous, and original contributions. We have been deeply
inspired and genuinely amazed by the authors’ creative ways of using Hardware
in the Loop and real-time simulation. This has energized us to continue improving
our software and hardware tools and to continue co-creating with authors and the
research and development community at large.
This book will not only help the users and power electronics and power systems
communities, but it will also motivate all the developers of Model-Based Engineering
(MBE) tools for power to continue improving their solutions and processes that will
further accelerate our civilization’s transition to a clean energy future.
vii
viii Preface
quickly built and parameterised. Chapter 2 throws light upon the importance of power
electronic converters, their modelling and control functionalities in grid-connected
systems. A case study for a single-phase grid-connected PV inverter simulation using
the Typhoon HIL 402 device is also presented.
Chapter 3 presents grid forming control techniques for power electronic converters
as a solution to low rotational inertia systems; the controllers have been implemented
and tested using the modelling and real-time simulation framework of Typhoon
HIL. Chapter 4 presents various model predictive control (MPC) strategies for grid-
connected converters and describes their implementation, testing and validation using
the Typhoon HIL platform.
An optimal programmed pulse width modulation (PWM) strategy coordinated
with the virtual synchronous machine (VSM) concept for grid-connected multilevel
converters in accordance with the current harmonic content limits of the IEEE 1547
standard has been proposed in Chap. 5. In addition, the real-time operation of a grid-
connected three-phase neutral point clamped converter was carried out in Typhoon
HIL 402 to demonstrate the performance of the proposed approach. A non-linear
predictive current control scheme for a single-phase shunt active power filter (SAPF)
using selective harmonic compensation has been presented in Chap. 6. The proposed
non-linear predictive current control scheme has been implemented and tested using
the Typhoon HIL 402 device.
A practical experimental setup for the development and controller testing of xEV
applications has been proposed in Chap. 7 by demonstrating a C-HIL setup for
field-oriented control (FOC) of a permanent magnet synchronous motor (PMSM)
using the Typhoon HIL 602+ simulator and AURIXTM microcontroller. Chapter 8
provides a theoretical and conceptual introduction to electric vehicle digital twins
that can be used as a platform for research and development of electric vehicle
pertinent technologies. In Chap. 9, the authors derive large and small signal models
for primary controllers and demonstrate the effect of primary controller parameters
on steady-state and transient behaviour by showing the performance of time domain
simulations on the HIL. In Chap. 10, the authors have used Typhoon HIL real-time
simulation platform for modelling a reconfigured IEEE-33 bus distribution system
to assess the effect of diverse harmonic order frequency on network parameters and
its subsequent impact on the hosting capacity of the network.
The authors of Chap. 11 systematically introduce modelling and simulation for
testing purposes of non-directional over-current protection relays in Virtual HIL
(VHIL) to help power engineers evaluate protective relay settings under more real-
istic conditions. In Chap. 12, the 8-bus transmission system is implemented under a
soft real-time simulation platform that allows the determination of the sequence of
operation, fault current detection capability and operating time of directional over-
current relays under solid three-phase to ground fault conditions. In Chap. 13, a
VHIL platform for line protection with distance protection relay has been devel-
oped and tested using a real-time HIL simulation validated by theory-based calcu-
lation and DIgSILENT PowerFactory software with three-phase and single-line-
to-ground short-circuit fault cases. Finally, Chap. 14 proposes and demonstrates a
Preface ix
Acknowledgments The editors are grateful to all the authors for their valuable contribution to
this edited book. The editors also thank all the reviewers who have generously given their time
to review the chapter manuscripts. The editors thank the CEO and co-founder of Typhoon HIL,
GmbH, for granting the necessary permission, and the staff of Springer Nature for their continued
support throughout the press production process of this edited book.
Contents
xi
xii Contents
xiii
xiv Editors and Contributors
Contributors
Ivana Isakov Faculty of Technical Sciences, University of Novi Sad, Novi Sad,
Serbia
Swati Kumari Birla Institute of Technology, Mesra, Jharkhand, India
Daniel M. Lima Federal University of Santa Catarina - UFSC, Blumenau, Brazil
Luiz A. Maccari Jr. Federal University of Santa Catarina - UFSC, Blumenau,
Brazil
Henrique Magnago UFSM, Santa Maria, Brazil
Azra Malik Advance Power Electronics Research Lab, Department of Electrical
Engineering, Jamia Millia Islamia (A Central University), New Delhi, India
Jorge R. Massing UFSM, Santa Maria, Brazil
Hugo Mendonça Escuela Técnica Superior de Ingenieros Industriales, Universidad
Politécnica de Madrid, Madrid, Spain
Vinícius F. Montagner Federal University of Santa Maria - UFSM, Santa Maria,
Brazil
Martha Nohemi Acosta Montalvo University of South-Eastern Norway, Pors-
grunn, Norway
Sandeep Ojha Electrical Engineering Department, Motilal Nehru National Insti-
tute of Technology Allahabad, Prayagraj, Uttar Pradesh, India
Felipe Antonio Gómez Olaya Department of Electrical and Electronical Engi-
neering, University of the Andes, South America, Colombia
Caio R. D. Osório Typhoon HIL, Novi Sad, Serbia
Alexandre T. Pereira UFSM, Av. Roraima, Santa Maria, Brazil
Le Nam Hai Pham University of South-Eastern Norway, Porsgrunn, Norway
Humberto Pinheiro Federal University of Santa Maria - UFSM, Santa Maria,
Brazil
Jose Miguel Riquelme-Dominguez Escuela Técnica Superior de Ingenieros Indus-
triales, Universidad Politécnica de Madrid, Madrid, Spain
Sourav Kumar Sahu Birla Institute of Technology, Mesra, Jharkhand, India
Juan David Hernández Santafé Department of Electrical and Electronical Engi-
neering, University of the Andes, South America, Colombia
Dimas A. Schuetz Federal University of Santa Maria - UFSM, Santa Maria, Brazil
Pawan Sharma Department of Electrical Engineering, UiT The Arctic University
of Norway, Narvik, Norway
Márcio Stefanello UNIPAMPA, Av. Tiaraju, Alegrete, Brazil
xvi Editors and Contributors
Jonas R. Tibola Federal University of Santa Maria - UFSM, Santa Maria, Brazil
Ivan Todorović Faculty of Technical Sciences, University of Novi Sad, Novi Sad,
Serbia
Raju Wagle Department of Electrical Engineering, UiT The Arctic University of
Norway, Narvik, Norway
Abbreviations
xvii
xviii Abbreviations
EV Electric vehicle
FCS-MPC Finite control set model predictive control
FFT Fast Fourier transform
FOC Field-oriented control
FPGA Field programmable gate array
FRT Fault ride-through
GA Genetic algorithm
GCC Grid-connected converter
GDS Gate drive signals
GTM General timer module
GUI Graphical user interface
HC Hosting capacity
HEV Hybrid electric vehicles
HIL Hardware-in-the-loop
HLF Harmonic load flow
HSM Hardware security module
ICE Internal combustion engine
IDE Integrated development environment
IEEE Institute of electrical and electronics engineers
iLLD Infineon low level drivers
IM Induction motors
IOs Inputs/outputs
LCT Low-carbon technologies
LUT Look up table
LVRT Low voltage ride through
MBSE Model-based systems engineering
MGCS Microgrid control system
MIL Model-in-the-loop
MPC Model predictive control
MTU Memory test unit
NPC Neutral-point clamped
NR Newton-Raphson
OBC On-board chargers
OC Operational Condition
OpenDSS Open distribution system simulator
OP-PWM Optimal programmed pulse-width modulation
PC Personal computer
PCC Point of common coupling
PCC Predictive current control
PEC Power electronic converter
PFC Power factor correction
P-HIL Power hardware-in-the-loop
PIL Processor-in-the-loop
PLL Phase-locked loop
PMSM Permanent magnet synchronous motor
Abbreviations xix
1.1 Introduction
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 1
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_1
2 C. R. D. Osório et al.
and airplane power systems in the marine and aerospace industries; and the
advancement in high-efficiency and low-cost electric motors, electric drives, and
powertrains (Liserre et al. 2010; Osório et al. 2021; Chemali et al. 2016; Rommel 2019;
Xu et al. 2021).
As a common point in these applications, one can look to the presence of highly
dynamical switching converters that, besides its own complexity, include additional
features such as intricate digital control, protection capabilities, and advanced com-
munication systems. As a consequence, a major engineering challenge has been to
be able to design, implement, and validate, in a timely manner, high-quality and eco-
nomically viable solutions that comply with multiple development and operational
requirements, such as electric vehicle integration standards and grid codes (Osório
2020; Knezović et al. 2017).
In this direction, as the intricacy of controlling power electronics, microgrids,
and power systems rise, the ability to reduce development time and costs is a key
trait. It is not efficient to wait until advanced stages of a project to carry out tests
or to wait for prototypes to be built in order to manually verify the integration of
different hardware and software, as well as to assess the performance of the overall
system. If this strategy is adopted, it can significantly prolong development time and
cost, in addition to limiting testing flexibility due to hardware constraints and safety
precautions (Dinavahi et al. 2001; Vekić et al. 2012; Khan et al. 2017).
To overcome that, and to increase the efficiency of engineering processes,
hardware-in-the-loop (HIL) simulations have been increasingly used by industry and
academia. In this testing framework, the device under test can be directly connected to
a real-time simulation, enabling efficient closed-loop, model-based automated test-
ing. HIL proved to be reliable and comprehensive in accelerating the development
cycle by allowing testing to start early in the development process, all while improv-
ing flexibility, coverage, and security in the verification and validation process. As a
testament to that, HIL tools have been used by the automotive and aerospace indus-
tries for decades, and have proven effective for testing and pre-commissioning of
microgrids, shipboard power systems, validation of energy storage systems, motor
drives, and other applications (Genic et al. 2017; Salcedo et al. 2019; Jonke et al.
2016; Zelic et al. 2020; Abdelrahman et al. 2018; Amin et al. 2019; Badini and Verma
2019).
Since its foundation in 2008, Typhoon HIL has supported industry and academia
by providing high-fidelity hardware-in-the-loop real-time emulators for electrical
systems, with continuous development driven by extensive user feedback. By means
of vertically integrated test solutions, Typhoon HIL enables model-based develop-
ment, test-driven design and the development of digital twin models to assess the
technical feasibility of complex systems from the early stages of development all
the way to pre-certification, including verification and validation of controls, protec-
tion, the communication layer, system integration, and interoperability testing. Some
Typhoon HIL devices and features of the toolchain are illustrated in Fig. 1.1.
For a better understanding of how Typhoon HIL toolchain has been recognized as
a powerful solution for real-time hardware-in-the-loop simulation in different appli-
cations, throughout this chapter, technical details about the technology, methodology,
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 3
and functionalities are presented. It is also worth mentioning that several tutorials,
videos, and knowledge-based articles are available online, detailing the features pre-
sented in this chapter (Typhoon HIL 2023, a, b).
For a long time, control system testing was done manually, relying on small-scale
or large full-scale power hardware. In traditional development and validation cycles,
such as those following the V-model, these tests would often occur only in the veri-
fication and commissioning stage after a physical prototype has been developed. In
order to meet cost, time, and quality requirements, model-based systems engineer-
ing (MBSE) has emerged as a powerful methodology. In this framework, physical
systems and prototypes can be replaced by virtual models, which enable the execu-
tion of exhaustive simulations in a safe and flexible environment, saving time, and
reducing costs from the specification to the commissioning and maintenance phase.
A graphical representation of how MBSE can be applied to support different steps
of the development cycle is shown in Fig. 1.2.
Depending on the specifications, level of abstraction, application, and device
under test, different testing setups can be considered, as illustrated in Fig. 1.3. These
approaches include model-in-the-loop (MIL), software-in-the-loop (SIL), controller
hardware-in-the-loop (C-HIL), and power hardware-in-the-loop (P-HIL).
In the MIL and SIL approaches, both control and power stages (i.e., controller
and plant) are simulated in a virtual environment (V-HIL), generally not requiring
real-time execution. In the MIL approach, the controller is modeled together with
the power layer, while in the SIL approach, the actual control software is considered
in the simulation.
Testing setups that feature a mix of physical systems and virtual models are
collectively referred to as hardware-in-the-loop (HIL). This means that some physical
4 C. R. D. Osório et al.
Fig. 1.2 V-model: graphical representation of MBSE applied in different steps of the development
cycle
part of the system is connected to the real-time simulation, which could be part of
the power hardware (P-HIL) or part of the controller hardware (C-HIL).
In the P-HIL approach, the focus is on testing power hardware. Therefore, power
amplifiers can be used to link the real-time simulator to the actual power hardware
device under test via analog input/output signals or communication protocols. For
instance, current and voltage references can be sent from the real-time simulation to
the amplifier using analog outputs, while the feedback signals of the device under test
are sensed by the power amplifier, and then sent to the simulation using the real-time
simulator analog inputs. As a drawback, although testing software in the presence
of actual power provides very accurate results, it usually involves higher cost, lower
flexibility, and the need for additional safety precautions.
On the other hand, the C-HIL approach stands out as an effective solution for
testing controllers, combining high fidelity, reduced cost, high testing flexibility,
and a safe environment. That is possible thanks to the advancements in computing
technologies, such as discussed in Sect. 1.4, which enable the development of real-
time simulation devices capable of emulating a device’s power stage (physical layer)
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 5
with high precision, even considering demanding high switching power electronics
applications.
With the C-HIL approach, the actual controller under test can be directly connected
to the modeled plant in real-time simulations, allowing for closed-loop evaluation
even before a prototype of the plant is available, as illustrated in Fig. 1.4. This allows
for verification and validation of control hardware, software, and firmware in a real-
istic environment, which provides more flexibility and security than fully physical
prototypes, as well as higher fidelity when compared to fully simulated environ-
ments. C-HIL also enables engineering teams to automate test cases and to perform
several evaluations effortlessly, allowing discovery of performance and integration
issues as soon as they arise, iteratively improving the performance of the system
being developed. In a similar manner, once experimental prototypes or the actual
plant are running, digital twins can be built and the C-HIL approach can be used to
validate controller continuous improvements; software lifecycle maintenance; qual-
ity assurance processes; and to perform tests that can be hard to replicate, dangerous,
or potentially destructive to lab equipment.
The Typhoon HIL toolchain supports all aforementioned testing scenarios, with
a targeted focus on the C-HIL approach.
Typhoon HIL Inc. was founded in 2008 as a startup, thanks in part to the invest-
ment provided by Ray Stata, Founder of Analog Devices. Typhoon HIL today is a
multinational corporation that is the current technology leader in the rapidly growing
field of ultra-high-fidelity controller Hardware-in-the-Loop (C-HIL) technology. The
company mission is to “Engineer and promote environmentally sustainable power
technologies that scale,” with the aim of laying the groundwork for building a sus-
tainable future.
Typhoon HIL serves its customers with custom solutions comprised of fully verti-
cally integrated software and hardware for model-based testing and development of
power electronics, e-mobility, microgrids, and distribution networks. Typhoon HIL
solutions aim to support its users through the entire span of their product’s lifecycle,
6 C. R. D. Osório et al.
Fig. 1.5 Typhoon HIL coverage of different market and application segments
starting from design and development, throughout validation and verification stages
driven by automated testing, all the way to integration and maintenance. Engineer-
ing services provided by the company help in technology adoption, system bring-up,
and scaling, to speed up project progress and success. Since its establishment, the
company successfully brought to market a number of HIL products, installing over
1000 HIL systems worldwide in both industry and academia.
The company’s primary R&D center in Serbia features a multidisciplinary team of
experts in the fields of power electronics, signal electronics, real-time and application-
specific software, computer architectures, electricity distribution, protection and con-
trol, industrial power system management, integration of distributed energy sources,
and communication protocols. As a result, the Typhoon HIL environment has compe-
tences to cover multiple applications in fields such as microgrids, drives, e-mobility,
battery energy storage systems, marine power systems, and so on (see Fig. 1.5 for
illustration).
In addition to the corporate headquarters in Boston, MA and the main R & D center
in Serbia, the company has offices in Switzerland, Brazil, Canada, France, and soon
Germany. The company also works together with over 20 value-added resellers,
distributors, and engineering centers worldwide which facilitate both development
and production, as well as successful communication to serve the global market.
When performing HIL testing, it is imperative that the simulation runs in real time;
the elapsed time when running the digital model of a physical system must match
exactly with the real-world time, also known as the wall-clock time. In this con-
text, Typhoon HIL devices are high-performance computers designed and built for
real-time simulation of power-electronics-based systems. This makes a HIL device
an important tool for several applications where the behavior of a device should be
tested before prototyping, including model-based control development, test-driven
design, pre-commissioning, virtual system integration, and interoperability testing
of modern power-electronics-enabled technologies. Simulations run on these devices
have also proven useful when acting as a high-fidelity replica, or “digital twin,” of a
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 7
power electronic device or power system, such as for replicating faults encountered
by a real device in customer support applications or by creating a sandbox environ-
ment for SCADA operator control training in microgrids. But what are the challenges
in performing real-time simulations?
real-time simulations where the model response calculation must be finished within
the predefined simulation step (Lian and Lehn 2005).
The challenges described so far focused primarily on the real-time simulation of
power converters, where time constants in the order of nanoseconds are required in
order to precisely reproduce switching effects and obtain accurate simulation results.
On the other hand, when testing, for instance, the secondary or tertiary control lay-
ers of power systems such as microgrids, models tend to be large and simulation
run times may reach days or weeks, with time constants in the order of minutes or
hours. In this sense, it is possible to see that different applications present differ-
ent requirements, such as high time resolution and long-term stability, which may
demand different modeling approaches and processor capabilities, posing a signifi-
cant challenge. A chart illustrating the wide range of time scales of interest within a
microgrid application is illustrated in Fig. 1.7.
In addition to that, as mentioned before, real-time simulations are essential when
real elements are present in the loop. As a consequence, the hardware-in-the-loop
simulation devices must be robust and present suitable interfaces, allowing easy
access to multiple inputs, outputs, and connection with a wide range of possible
devices under test, including supporting the specific communication protocols those
devices may use. At the same time, real-time simulations and the hardware-in-the-
loop testing framework aim to reduce time and costs in the development cycle, and
thus must not overwhelm engineers with additional concerns. Therefore, it is impor-
tant to provide a solution that, although technically advanced, is user-friendly and
easy to get used to. In this context, the HIL solution should suit different application-
Fig. 1.6 Illustration of state space (SS) calculation and the respective state (X) change due to a
digital input (DI) event with sampling period equal to the simulation time step. Sampling error and
latency depend on when the DI changes with respect to the simulation time step (Osório et al. 2021;
Typhoon HIL 2023c)
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 9
Fig. 1.7 Graph illustrating how the time scale of interest varies in a microgrid application according
to the phenomenon to be observed and the objectives of the simulation (Typhoon HIL 2017)
specific systems with easily deployable preset configurations, while still providing
flexibility for more experienced HIL users to develop bespoke solutions for custom
applications.
. Achieving very short simulation time steps and low latency to represent
highly dynamic power electronics systems with accuracy.
. Reducing memory capacity requirements.
. Improving the effective PWM time resolution.
. Coping with large models and different application-specific requirements.
. Hardware with suitable interfaces and support for industry standard com-
munication protocols.
. User friendliness, flexibility, and easy to get used to.
Aiming to overcome the challenges mentioned in this section, Typhoon HIL provides
a vertically integrated solution, comprising of real-time simulator hardware and a
dedicated software toolchain (Typhoon HIL Control Center). The technology stack is
seamlessly integrated from Typhoon HIL’s application-specific processors and robust
numerical solver all the way to the model building interface, supervisory system, and
testing automation solution, in a single easy-to-use and affordable toolchain.
10 C. R. D. Osório et al.
In the next subsections, the Typhoon HIL real-time simulator hardware and soft-
ware technology is presented, as well as how they address the challenges described
here.
Typhoon HIL simulators are hardware platforms specialized for high-fidelity real-
time HIL simulations of power-electronics-based systems, which are enabled by a
state-of-the-art processor design seamlessly integrated with a fully embedded com-
piler. As mentioned before, proper real-time simulation of power-electronics-based
systems requires high-speed, low-latency, scalable, and flexible computation tech-
nologies. Typhoon HIL devices achieve that by using a programmable, application-
specific, hybrid architecture that combines CPU (central processing unit) and FPGA
(field programmable gate array) technologies, seamlessly integrated with the soft-
ware toolchain.
The current line-up includes two generations of devices. The third-generation
devices (HIL402, HIL602+, and HIL604) support simulation steps down to 500 ns,
while oversampling digital inputs with 6.5 ns resolution. These devices have proved
themselves in numerous industrial applications, even in some cases with switch-
ing frequencies exceeding 100 kHz. To further improve simulation fidelity for high
switching frequency applications, such as high-speed drives and DC-DC resonant
converters, fourth-generation devices (HIL404 and HIL606) support even lower sim-
ulation steps, down to 200 ns, with digital input sampling resolution of 3.5 ns. More
details about the current device line-up, including the number of processing cores,
model capacity, time resolution, number of analog and digital inputs/outputs (IOs),
and connectivity support with industry standard protocols can be seen in Fig. 1.8. In
addition, it is worth noting that thanks to the modular design, multiple device units
can be stacked together and paralleled, behaving as a single larger simulator.
All Typhoon HIL devices share a common multi-processor architecture, which
contains a proprietary multi-core FPGA solver, system CPUs, and user CPUs, as
illustrated in Fig. 1.9. A summary of their functions is given as follows:
. Typhoon FPGA Solver: The multi-core FPGA solver is used to simulate the
electrical layer of the model, optimized for time-exact simulation.
. System CPUs: General-purpose processors indirectly controlled by the user, typ-
ically used to simulate low dynamics phenomena of certain electrical domain
components or to handle communication protocol stacks.
. User CPUs: General-purpose processors that are under direct user control, respon-
sible for the simulation of model components that don’t belong to the electrical
domain, such as mechanical, thermal, and signal processing components. User
CPUs can also be used for the development of controller algorithms within the
model, using MIL and SIL approaches or rapid control prototyping.
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 11
The HIL606 device is illustrated in Fig. 1.10, where (a) illustrates the front view,
highlighting the analog and digital IOs, and (b) illustrates the back view, highlighting
the expanded connectivity options, which increases flexibility for multiple protocols.
Fig. 1.9 Typhoon HIL device architecture, encompassing: user CPU, System CPU, and Typhoon
FPGA solver with multiple Standard Processing Cores (SPCs)
(a)
(b)
Notice that the resources available on the Typhoon HIL FPGA solver enable it to
support various elements used in different electrical applications. This architecture
is scalable and is used on all Typhoon HIL devices. Nevertheless, every device
has a number of different configurations, which differ in number and size of the
computational elements available. The user can choose the configuration in order
to optimize FPGA resources for the specific application under test. For instance,
time-varying elements are not supported for all configurations, while the number of
signal generators or machine solvers depends on the device configuration.
The FPGA solver also provides the means for emulating switch turn-on and turn-
off delays in addition to real-time calculation of semiconductor losses, enabling
detailed power converter modeling even with converter blocks that consist of ideal
switches.
14 C. R. D. Osório et al.
Fig. 1.11 Illustrative representation of the GDS Global Oversampling method. DI represents the
digital input (GDS or PWM signal) and X illustrates the state change due to the input event (Osório
et al. 2021; Typhoon HIL 2023c)
Fig. 1.12 Example of how circuit partitioning allows for reducing memory capacity requirements
and achieving faster simulation rates
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 15
space matrix, splitting the model in different cores also allows for achieving faster
simulation rates. It is worth mentioning that circuit partitioning can be done both
between SPCs of a single HIL device and between multiple HIL devices. Moreover,
enabling parallel computing of complex power electronics or power system models
is done in a very easy and straightforward way, by using dedicated components in
the Schematic Editor of the Typhoon HIL Control Center tool that will be detailed
later.
(a) (b)
Fig. 1.14 HIL interfaces: a HIL breakout board; b HIL TI launchpad interface
real-time simulator and the device under test. As an example, Typhoon HIL offers
off-the-shelf plug-and-play interface boards for Texas Instruments controllers and
Launchpads, as illustrated in Fig. 1.14b.
Multiple conditioning systems packaged in a dedicated enclosure, called HIL
Connect, are also offered, as illustrated in Fig. 1.15a. This approach provides great
flexibility once it supports all major types of connectors, allowing the user to connect
the device under test to the emulator with the exact same cables that would be used
in the real system. HIL Connect systems can be customized according to particular
requirements and specifications.
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 17
(a) (b)
Fig. 1.15 HIL interfaces: a HIL connect; b Packaged interface with HIL compatible controllers
Typhoon HIL Control Center is a fully integrated toolchain that enables users to
build models, parametrize components, run HIL-based real-time simulations, and
perform automated tests. This means any user can access the full potential of the
developed hardware technology in an easy and straightforward way, without requiring
experience in low-level programming. In addition, by means of a Virtual HIL device,
the toolchain can also be used to verify real-time ready models even without controller
hardware and before having an actual HIL device available, further facilitating the
test-driven development process.
The initial window of the software can be seen in Fig. 1.16. The main resources
include the modeling tool, the real-time graphical interface, and test development
tools, as described in the following sections. If you are interested to raise your skill and
knowledge of the Typhoon HIL toolchain, a HIL Fundamentals course is available
on the HIL Academy platform which provides a detailed explanation and interactive
demonstration of the tools described here (Typhoon HIL 2023b).
Schematic Editor
Schematic Editor is a software environment where real-time ready models are built
and compiled using a user-friendly and intuitive interface, as illustrated in Fig. 1.17.
The models can be developed from scratch, by dragging and dropping any number
of the hundreds of pre-built components easily accessible using the Library Explorer
tool shown in the left side of Fig. 1.17. The library includes pre-packaged converters,
transformers, renewable sources, electrical machines, passive components, and oth-
18 C. R. D. Osório et al.
Fig. 1.17 Schematic editor interface displaying a wind turbine with doubly-fed induction generator
model
ers, which are optimized for fast compilation and real-time executions, in addition
to being easily parametrized for different domain-specific applications.
As an example, Fig. 1.18 shows a three-phase inverter component, which is part
of the converters library. This component can be used in conjunction with passive
and other components to build tailor-made models for custom applications. Notice
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 19
Fig. 1.18 Example of a pre-packaged converter (three-phase inverter) and its general properties
window
that instead of having to use individual switches and diodes, converters like this one
are available as pre-packaged components optimized for real-time execution, with
a specialized runtime logic that allows for reducing the number of modes, thereby
reducing memory capacity requirements.
Figure 1.18 also shows the general properties of the three-phase inverter compo-
nent when the internal modulator control type is selected, highlighting the ease of
configuring different parameters. In this case, the controller can be modeled within
Schematic Editor using signal processing components, providing the control signals
(InA, InB, and InC) for the converter. If a HIL device is available, the modulation
is done with high resolution by the dedicated PWM modulator unit in the FPGA.
Alternatively, if an external controller is available and it is properly interfaced with
the HIL device, the converter can be directly controlled by HIL digital inputs. Addi-
tional tabs on the properties window also allow enabling the emulation of turn-on
and turn-off switching delays (Timing tab) as well as semiconductor losses (Losses
tab).
As mentioned in the challenges section, it is also important to provide a solution
that suits users with different levels of expertise and different application-specific
systems with easily parameterizable models. With that in mind, besides the default
libraries, Typhoon HIL provides domain-specific toolboxes with component-level
building blocks optimized for different model depths and requirements, making the
task of building complex models even easier. One example of this is the Microgrid
Toolbox, which contains distributed energy resources such as diesel generators, PV
power plants, wind power plants, and energy storage systems that can be built using
different component types. The choice of which type of component to use when
building a model depends on the device under test, the purpose of the simulations, the
20 C. R. D. Osório et al.
testing requirements, and also on the hardware resources that the user has available,
as described below:
. Switching components: Recommended for system-level testing of real converter
controllers that require detailed power electronics models and accuracy in emu-
lating the switching behavior in order to interface the PWM outputs. These com-
ponents include pre-implemented control subsystems that can be freely modified
by the user, as well as extensive control gains parametrization.
. Average components: Behavioral twins of the switching component models in
terms of parametrization and dynamics, but consumes significantly less computa-
tion resources, making them the better choice for situations where the switching
dynamics can be neglected and a PWM interface is not needed.
. Generic components: Based on average models, recommended for microgrid
applications and energy management systems, where the simulations focus on
testing top-level controllers responsible for steady-state regulation of voltage and
frequency as well as load/energy management. Dedicated communication user
interfaces are available for communication testing and troubleshooting interoper-
ability issues. These components also include useful built-in functionalities such
as voltage and frequency droop, ramping, low-voltage ridethrough (LVRT), and
voltage and current protection, as well as self-tuning and grid support features.
Another toolbox of note is Typhoon HIL’s Communication Toolbox, which incor-
porates many standard protocols from various industry and research applications.
Most modern engineering system employs some sort of critical, digital communica-
tion protocol. Testing these communication protocols is important to verify the proper
functioning of the device under test in an integrated system, including interoperability
and pre-certification testing, communication fault testing, and cybersecurity testing,
among others.
Applications that require communication testing extend to several industry fields,
such as automation, energy generation transmission and distribution, automotive,
aerospace, and marine. In academic research, communication protocols are also used
to implement co-simulation interfaces and integrate different laboratory equipment.
Table 1.1 shows the protocols available in Typhoon HIL Control Center, organized by
the application where they are most commonly used in HIL tests. To understand and
choose which protocol is suitable for an application, different requirements must
be considered. Common requirements include flexibility, criticality, determinism,
number of devices, standards, robustness, data types, security level, remote or local
access, speed, and hardware setup.
Typhoon HIL Control Center also includes several examples for various applica-
tions, which can be used as starting point to build different models. The examples
library is organized by application area and includes descriptions of the models often
coupled with application notes, which makes it easy to navigate. Figure 1.19 shows
the schematic of the terrestrial microgrid example using generic components, avail-
able in the Examples Explorer.
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 21
Table 1.1 Communication protocols supported by Typhoon HIL Control Center as of the 2022.4
software release (future releases will include support for additional protocols)
General/Industry Energy/Microgrids Automotive
Modbus Server (slave) DNP3 Outstation CAN
Modbus Client (master) IEC 61850 GOOSE J1939
Modbus SunSpec IEC 61850 Sampled Values CAN-FD
Ethernet Variable Exchange IEC 61850 MMS Server CANOpen Slave
(TCP/UDP)
OPC UA IEEE C37.118 PMU Server ISO 15118-2 EVCC
EtherCAT Slave IEEE C37.118 PMU Client ISO 15118-2 SECC
Precision Timing Modbus Server (Slave)
SFP Aurora Modbus Client (Master)
PROFINET IO IEC 60870 Server
Serial/UART
SPI (slave)
op_mode
Grid UI1 Grid1
control_option
- HIL 606
ui_out ui_out
power_meas power_meas A B C N
CB_status CB_status
toPCCess fromESS
toPCCdg fromDG A B C
PCC_control Inputs
MGCC
DER_control DER_control
CB_status CB_fb PCC_monitor
MGCC_ON
Microgrid_controller
synch_ref synch_ref
a b c
RL Section1 RL Section2
A B C
Trafo5
a b c
Goto23 A B C A B C
toPCCdg A B C N A B C N
A B C N A B C N A B C N toPCC ui_in ui_in ui_in ui_in
toPCCess toPCC ui_in ui_in ui_in ui_in ui_in ui_in
Diesel Genset (Generic) UI1 Diesel Genset (Generic)1 Variable Load (Generic) UI1 Variable Load (Generic)1
Battery ESS (Generic) UI1 Battery ESS (Generic)1 Wind Power Plant (Generic) UI1 Wind Power Plant (Generic)1 PV Power Plant (Generic) UI1 PV Power Plant (Generic)1 Constant Impedance Load1 Interruptible load
Fig. 1.19 Example of model built in the schematic editor for a terrestrial microgrid using generic
components
HIL SCADA
Once the model is compiled, it can be loaded to HIL SCADA, a real-time graphical
user interface that enables operating, controlling, and monitoring of the simulation.
The time elapsed while the model is being simulated is called simulation runtime
and for real-time simulations this will exactly match the wall-clock time.
During simulation, HIL SCADA can be used to modify simulation inputs such
as signal generator variables and power plant inputs, as well as to observe signals in
real time or capture them for further analysis. That can be done by easily dragging
and dropping action and monitoring widgets available in the widgets library. Custom
libraries can also be created, according to the user’s needs. In addition, Typhoon HIL
API (application programming interface) functions and Python code can be used to
achieve more flexibility when programming widgets. Users don’t need to be experts
22 C. R. D. Osório et al.
Fig. 1.20 SCADA panel built for the model shown in Fig. 1.19
Fig. 1.21 Example of Allure report automatically generated when running tests in Typhoon Test
IDE for the electric vehicle example available in the Example Explorer
automatic reports. This is possible since Typhoon HIL software is Python based, and
the tests can be done using the Typhoon HIL API, which is a set of Python functions
that allows the user to control the simulation environment, parametrize components,
load, run, and interact with the models. The TyphoonTest IDE automation tool runs
using pytest, providing automatic report generation with Allure. An example of
an automatically generated report is shown in Fig. 1.21, considering the test of an
electric vehicle drivetrain. In this report, the user can easily verify which conditions
are passed or not in the tests, in addition to checking more detailed information.
Using HIL with test automation can bring benefits for several applications. For
instance, in industry, test automation can be used in the development cycle, including
a very large number of tests, operating conditions, and parameters; in device pre-
certification, by running certification-like tests as part of the development process;
and in the commissioning process. In Academia, use cases include testing of new
methodologies for a wider range of conditions; benchmarking different methodolo-
gies, by using the same test procedure and metrics to compare them; and automatically
generating results, which allow for quick updates to reports and papers, if needed. For
laboratories and certification bodies, automatized pre-certification tests can improve
certification turnaround.
24 C. R. D. Osório et al.
Fig. 1.22 Example of C-HIL setup with a Typhoon HIL402 real-time simulator, TI LaunchPAD
LAUNCHXL-F28379D, and a dedicated interface board
Additional Tools
As shown in Fig. 1.16, Typhoon HIL Control Center also includes the following
additional tools:
Fig. 1.23 Model built in Typhoon HIL Schematic Editor for real-time simulation of a buck syn-
chronous converter
Table 1.2 C-HIL interface specification table for example shown in Fig. 1.23
Signal typea Simulation range Controller range Description
Digital input 1 0/1 0/3.3 V Top switch PWM
signal
Digital input 2 0/1 0/3.3 V Bottom switch PWM
signal
Analog output 2 [0–50] V [0–3.3] V Voltage measurement
Analog output 1 [0–30] A [0–3.3] V Current measurement
a Signal types are defined here from the HIL device. HIL digital inputs come from the controller’s
digital outputs, while HIL analog outputs are measured through controller’s analog inputs
using Schematic Editor. In this model, the user must identify all interface points
between the controller and the power stage model, including inputs, outputs, and
all necessary voltage and current measurements. When building the schematic, an
easy way to keep track of all relevant signals is to create a table with their names,
description, and voltage levels.
To demonstrate this, Fig. 1.23 shows the power stage model of a synchronous
buck converter, built for real-time simulation. Table 1.2 lists the inputs and outputs
of the model, as well as the voltage range specified in the controller.
Configuration of the digital inputs is set directly in the IGBT leg properties,
as shown in Fig. 1.24a, and should be done considering the proper mapping of
the controller digital outputs to the HIL digital inputs through the interface. The
configuration of the analog outputs can be done using the Output Settings component,
as shown in Fig. 1.24b, taking into account the appropriate signal mapping.
In the output settings, the Scaling and Offset parameters must be defined from the
values obtained in simulation in order to ensure proper conditioning of the signals
from the real-time simulator (HIL analog outputs) to the controller (digital signal
processor inputs). These values can be calculated as follows:
max zero
Vph K int Vctrl
Scaling = , offset = , (1.1)
max
Vctrl − zero
Vctrl K int
26 C. R. D. Osório et al.
(a) (b)
Fig. 1.24 Interface settings: a digital input settings; b analog output settings
zero
where K int is the gain of the interface board; Vctrl is the voltage in the controller
max
inputs that represents 0 V in the physical system; Vctrl is the maximum rated voltage
max max
at the controller inputs; and Vph is the physical values represented by Vctrl .
Once the controller is properly connected to the real-time simulator and the model
is built, validated, and fully parametrized, then the C-HIL simulation is ready to run.
It is worth mentioning that the real-time ready model shown in Fig. 1.23 can be
validated offline in a preliminary stage without the controller, and the results can
be compared with offline simulations or mathematically calculated responses. The
offline simulation can be performed using the Virtual HIL (V-HIL) environment
which, as mentioned in Sect. 1.4.2, enables simulation of real-time ready models
without a HIL device.
1.6 Conclusions
This introduction highlights some of the key challenges to performing real-time sim-
ulation testing, and how the specific hardware and software solutions in the Typhoon
HIL real-time simulation platform work to overcome them. An example of a simple
C-HIL testing setup featuring a real controller is shown to demonstrate how such a
testing environment can be easily built and parameterized.
HIL testing plays a growing and increasingly critical role in the development and
improvement of new power electronics and power systems technologies. Controller
hardware-in-the-loop (C-HIL) testing solutions, such as those provided by Typhoon
HIL, stand out as effective solutions for testing, validating, and troubleshooting real
controllers in a safe, realistic environment.
In the following chapters, real examples of HIL testing solutions using the
Typhoon HIL toolchain are presented in detail.
1 Introduction to Typhoon HIL: Technology, Functionalities, and Applications 27
References
Abdelrahman AS, Algarny KS, Youssef MZ (2018) A novel platform for powertrain modeling of
electric cars with experimental validation using real-time hardware in the loop (HIL): a case study
of GM second generation chevrolet volt. IEEE Trans Power Electron 33(11):9762. https://doi.
org/10.1109/TPEL.2018.2793818
Amin M, Abdel Aziz GA (2019) A hardware-in-the-loop realization of a robust discrete-time current
control of pma-synrm for aerospace vehicle applications. IEEE J Emerg Select Top Power Electron
7(2):936. https://doi.org/10.1109/JESTPE.2018.2890592
Badini SS, Verma V (2019) A novel mras based speed sensorless vector controlled pmsm drive. In:
2019 54th international universities power engineering conference (UPEC), pp 1–6. https://doi.
org/10.1109/UPEC.2019.8893607
Celanovic NF (2017) Typhoon HIL blog – digitalization of microgrids and electrical distrubution
networks. www.info.typhoon-hil.com/blog/microgrid-digitalization
Chemali E, Preindl M, Malysz P, Emadi A (2016) Electrochemical and electrostatic energy storage
and management systems for electric drive vehicles: state-of-the-art review and future trends.
IEEE J Emerg Select Top Power Electron 4(3):1117. https://doi.org/10.1109/JESTPE.2016.
2566583
Dinavahi V, Reza Iravani M, Bonert R (2001) Real-time digital simulation of power electronic
apparatus interfaced with digital controllers. IEEE Trans Power Delivery 16(4):775. https://doi.
org/10.1109/61.956769
Genic A, Gartner P, Almeida M, Zuber D (2017) Hardware in the loop testing of shipboard power
system’s management, control and protection. In: 2017 IEEE vehicle power and propulsion
conference (VPPC), pp 1–6. https://doi.org/10.1109/VPPC.2017.8331026
Jonke P, Stöckl J, Miletic Z, Bründlinger R, Seitl C, Andrén F, Lauss G, Strasser T (2016) Integrated
rapid prototyping of distributed energy resources in a real-time validation environment. In: 2016
IEEE 25th international symposium on industrial electronics (ISIE), pp 714–719. https://doi.org/
10.1109/ISIE.2016.7744977
Khan A, Jarraya F, Gastli A, Ben-Brahim L, Hamila R, Rajashekara K (2017) Dual active full bridge
implementation on Typhoon HIL for G2V and V2G applications. In: 2017 IEEE vehicle power
and propulsion conference (VPPC), pp 1–6. https://doi.org/10.1109/VPPC.2017.8331023
Knezović K, Martinenas S, Andersen PB, Zecchino A, Marinelli M (2017) Enhancing the role of
electric vehicles in the power grid: field validation of multiple ancillary services. IEEE Trans
Transp Electrific 3(1):201. https://doi.org/10.1109/TTE.2016.2616864
Lian K, Lehn P (2005) Real-time simulation of voltage source converters based on time average
method. IEEE Trans Power Syst 20(1):110. https://doi.org/10.1109/TPWRS.2004.831254
Liserre M, Sauter T, Hung JY (2010) Future energy systems: integrating renewable energy sources
into the smart power grid through industrial electronics. IEEE Indust Electron Mag 4(1):18.
https://doi.org/10.1109/MIE.2010.935861
Majstorovic D, Celanovic I, Teslic ND, Celanovic N, Katic VA (2011) Ultralow-latency hardware-
in-the-loop platform for rapid validation of power electronics designs. IEEE Trans Indust Electron
58(10):4708. https://doi.org/10.1109/TIE.2011.2112318
Osório CRS, Miletic M, Zelic J, Majstorovic D, Gagrica O (2021) Advancements on real-time sim-
ulation for high switching frequency power electronics applications (invited paper). In: 2021 21st
international symposium on power electronics (EE), pp 1–6. https://doi.org/10.1109/Ee53374.
2021.9628306
Osório CRD, Koch GG, Pinheiro H, Oliveira RCLF, Montagner VF (2020) Robust current control of
grid-tied inverters affected by LCL filter soft-saturation. IEEE Trans Indust Electron 67(8):6550.
https://doi.org/10.1109/TIE.2019.2938474
Pallo N, Foulkes T, Modeer T, Fonkwe E, Gartner P, Pilawa-Podgurski RC (2017) Hardware-in-
the-loop co-design testbed for flying capacitor multilevel converters. In: 2017 IEEE power and
energy conference at Illinois (PECI), pp 1–8. https://doi.org/10.1109/PECI.2017.7935758
28 C. R. D. Osório et al.
Rommel C (2019) HIL TESTED – powerful performance, functionality, and quality from model-
based testing. Published by VDC Research. https://info.typhoon-hil.com/lp-white-paper-vdc-
research-hil-tested
Salcedo R, Corbett E, Smith C, Limpaecher E, Rekha R, Nowocin J, Lauss G, Fonkwe E, Almeida
M, Gartner P, Manson S, Nayak B, Celanovic I, Dufour C, Faruque M, Schoder K, Brandl
R, Kotsampopoulos P, Ha TH, Davoudi A, Dehkordi A, Strunz K (2019) Banshee distribution
network benchmark and prototyping platform for hardware-in-the-loop integration of microgrid
and device controllers. J Eng 2019:5365
Typhoon HIL. (2023) Online documentation. www.typhoon-hil.com/documentation
Typhoon HIL. (2023a) Youtube channel. www.youtube.com/c/TyphoonHIL-com/featured
Typhoon HIL. (2023b) HIL fundamentals course. https://hil.academy/courses/hil-fundamentals/
Typhoon HIL. (2023c)Documentation – GDS oversampling. www.typhoon-hil.com/
documentation/typhoon-hil-software-manual/concepts/gds_oversampling.html
Typhoon HIL. (2023e) Documentation – IO voltage levels. https://www.typhoon-hil.com/
documentation/typhoon-hil-hardware-manual/hil4-6_series_user_guide/References/hil4-6_
IO_voltage_levels.html
Typhoon HIL. (2023f) Documentation – IO timing. https://www.typhoon-hil.com/documentation/
typhoon-hil-hardware-manual/hil4-6_series_user_guide/References/hil4-6_IO_timing.html
Vekić MS, Grabić SU, Majstorović DP, Čelanović IL, Čelanović NL, Katić VA (2012) Ultralow
latency HIL platform for rapid development of complex power electronics systems. IEEE Trans
Power Electron 27(11):4436. https://doi.org/10.1109/TPEL.2012.2190097
Xu L, Guerrero JM, Lashab A, Wei B, Bazmohammadi N, Vasquez J, Abusorrah AM (2021)
A review of DC shipboard microgrids part i: power architectures, energy storage and power
converters. IEEE Trans Power Electron 1. https://doi.org/10.1109/TPEL.2021.3128417
Zelic J, Novakovic L, Klindo I, Gruosso G (2020) Hardware in the loop framework for analysis
of impact of electrical vehicle charging devices on distribution network. In: 2020 IEEE vehicle
power and propulsion conference (VPPC), pp 1–5. https://doi.org/10.1109/VPPC49601.2020.
9330863
Chapter 2
Control of Grid-Connected Inverter
2.1 Introduction
During the past few years, there has been an increased penetration of non-
conventional distributed energy resources (DERs) into the conventional electricity
distribution grids (Khan et al. 2020). This trend has witnessed an accelerated shift
from low-voltage power networks to the smart micro-grid pattern with efficient and
reliable interconnections of DERs at the point of common coupling (PCC). In this
whole shift, power electronics converters play a major role in the transfer and control
of generated power from one side to the other (Khan et al. 2019). They act as an
interface between various electrical domains, for instance, DC–DC converters are
utilized to supply to DC loads from the relevant DC sources at the required voltage
and power. In a similar manner, DC–AC converters or inverters are utilized as an
interface between DC generators like batteries, PV panels, etc., and AC receiving
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 29
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_2
30 A. Malik and A. Haque
ends like power grids, etc. Inverters are also divided into two different categories—
voltage source and current source inverters (VSIs and CSIs) (Kouro et al. 2015).
These names come from the fact that the respective converter output voltage and
current are controlled independently. The major difference between the two topolo-
gies is that the VSIs are capable to perform voltage buck operation, whereas CSIs
can only carry out voltage boost functions. For CSIs, three-phase configurations are
considered more relevant than single-phase configurations. When the inverter func-
tions as an integration between the DC source and the grid for efficient transfer and
control of generated power, then it is termed a grid-connected inverter (Kurukuru
et al. 2021). Overall, a grid-connected system works in different operation modes
depending on the control switch states, which can be guided locally through the
inverter or remotely through an operator (Yang et al. 2019). These operation modes
are presented in Fig. 2.1 and are described below.
In this mode, the corresponding DER supplies to the load independently and it is
disconnected from the grid (Khan et al. n.d.). The inverter in this mode is responsible
for supplying to the AC loads joined at the PCC. The inverter also functions to main-
tain the voltage and frequency of the system at the suitable range as specified in the
standards. During the fault events, the line breaker opens through the disconnection
command issued by the respective protection devices (Bharath et al. 2018). There
2 Control of Grid-Connected Inverter 31
In this mode, the inverter is connected to the grid at PCC and it transfers the generated
power from the DC side to the AC side, i.e., grid and AC loads (Ahmed et al. 2011).
The voltage reference is taken as per the grid side requirements for inverter controller.
Furthermore, the inverter control is responsible for maintaining the frequency and
power at the AC side. In this mode, synchronization is important and it is achieved
through phase-locked loop (PLL) by the control algorithm (Bisht et al. 2020). Along
with that, it keeps a track on harmonics and reduces the harmonics as per grid
standards (Zmood and Holmes 2003). Inverter switches play a significant part in
implementing the control technique.
power flow and control of the DC-link voltage at the DC side. Both the controls are
important for robust and efficient functionality of the whole system (Liu et al. 2020).
The general control structure of inverter consists of two cascaded loops, one of them
is an internal current control loop, controlling the grid current and the other is an
outer voltage control loop, which controls the DC link voltage. The inner control loop
should be fast enough for ensuring proper dynamic response and harmonics reduction
within the required limits for distorted grid operation. The outer voltage control loop
should be slower than the inner loop for an optimal power flow and better regulation
(Ahmad, et al. 2018). This is required for establishing stability for a given controller
in grid-connected inverter systems. These grid-connected inverter controllers can be
of many types depending on the application and other requirements.
There are several classical controllers already presented in literature like propor-
tional (P), proportional–integral (PI), proportional–integral–derivative (PID), etc.
Among these, the most commonly employed controller is PI controller since it has
the capability for efficient DC signal tracking. It is represented by a continuous-time
expression as given below:
c(t) = K P e(t) + K I e(t). (2.1)
KI 1 + sTI τI
G P I (s) = K P + = KP = KP 1 + . (2.2)
s sTI s
2K I (s)
G P R (s) = K P + . (2.3)
s 2 + ω02
Based on the above expression, the controller structure can be shown through the
representation shown in Fig. 2.3.
2 Control of Grid-Connected Inverter 35
For current error compensation in the grid-connected inverter control, one of the
linear controllers can be a state-feedback controller, which is able to work in both
stationary as well as synchronously rotating reference frame (Lee et al. 1992). The
synthesis of the network is made based on the linear state-feedback theory. To ensure
sufficient and proper damping, a feedback gain matrix is calculated through pole
assignment utilization (Liu et al. 1998). The integral part of the controller is respon-
sible for making sure that the static error is reduced to zero. However, it may cause
the transient error to escalate to the point of unacceptable range. Therefore, it requires
the feedback signals for both the disturbance and reference inputs to be summed in
the feedback control law. It is observed that the state feedback controller provides
superior performance as compared to the traditional PI controllers since the control
technique provides dynamically correct compensation of the voltage signal.
Among all the non-linear controllers, SMC algorithms are widely utilized owing to
their improved and robust performance. The major benefit associated with SMC is
that it is observed to be indifferent to parameter deviation and load disturbances
(Cortes et al. 2009). Therefore, it is able to provide a non-varying steady-state
response for grid-connected PV applications. However, the overall output of SMC is
highly dependent on the appropriate sliding surface, which is sometimes difficult to
define (Zheng et al. 2018). Further, the performance of SMC also relies on sampling
time, thus, it may be affected due to distortion if the adequate sampling time is not
identified. These disadvantages may highly affect the overall PV system efficiency
in a negative way and therefore, it is recommended to consider all these facts before
applying this technique.
It is also one of the important controllers under non-linear controllers and has been
employed for grid-connected systems. It consists of creating an adaptive band to
achieve an optimum and stable switching frequency (Davoodnezhad et al. 2014).
Therefore, the output of hysteresis controller is found to be the individual switch
states. Hence, it becomes important to consider the isolated neutral again for proper
attaining proper control. The advantages of hysteresis controller include deficiency
of tracking errors, insensitivity to load disturbances, lesser complexity, outstanding
robustness, and fast dynamics. The limitations of this controller include load time
constant and the switching speed, since the switching speed relies over the load
parameters. When applied to three-phase systems, the comparator state change in
one phase may impact the load voltage in other phases. Considering the three current
errors as space vectors, this effect may be compensated (Chavali et al. 2022). This
will establish numerous controller variants, termed space-vectors. Through suit-
able voltage vector selection, an optimum performance with better stability can be
achieved.
2 Control of Grid-Connected Inverter 37
Adaptive controller provides the output response based on condition changes within
the process (Castello et al. 2016). These controllers adjust the control action auto-
matically depending on the operating conditions. They may manifest better perfor-
mance, with insensitivity to parameter variations. However, they are considered to be
computationally complex for implementation in grid-connected systems (Kumar and
Tyagi 2021). On the other hand, robust control approach is adopted for designing the
controller considering the uncertainties. These controllers are able to achieve stability
along with robust performance, even for multi-variate systems. A proper criterion,
clear description, and appropriate bounds must be defined to achieve desired robust
control. H-infinity controllers under robust control solve multivariable problems by
representing them as an optimization problem (Yang et al. 2020).
Neural Network (NN) is typically inspired by the biological neural network in the
human brain. It consists of a connection of several artificial neurons making a network
similar to the human nervous system (Meireles et al. 2003). These controllers are
capable to attain better results using function mapping. Furthermore, the desired
control objectives can be achieved through training in either online or offline mode.
These intelligent controllers are fast and computationally efficient, therefore, they
are considered highly preferable for grid-connected PV inverter control (Bose 2017).
38 A. Malik and A. Haque
Reference
value
+
Considered Target Measured Error
Parameter value - Crisp
Fuzzification
input
Fuzzy
input
Fuzzy Rule-
Control Objective base
Fig. 2.4 A general block diagram for Fuzzy Logic (FL) controller
The system dynamics of an inverter and control structure can be represented through
inverter modeling. It is an essential step towards attaining the inverter control objec-
tives (Romero-cadaval et al. 2015). The overall process includes the reference frame
transformation as an important process, where the control variables including volt-
ages and currents in AC form, will be converted to DC form using Clark and park
transformations. These transformations are applied to both one- and three-phase
systems (Purba et al. 2019). Furthermore, the system modeling of inverter along
with the L filter, PQ controller, voltage, and current controllers is established.
The grid-connected PV system control diagram for a three-phase inverter is
depicted in Fig. 2.5. It involves the application of a cascaded control loop. The
2 Control of Grid-Connected Inverter 39
external loop consists of controlling the active and reactive power by PQ controller.
It may also consist of indirect control through a DC-link voltage controller. This is
generally applied to two-level grid-connected PV applications consisting of DC/DC
converter for optimal power extraction (Strache et al. 2014). Further, the inner control
loop is employed to control the injected current into the AC load. It aims to normalize
the current output as per the reference fixed by the outer loop. The output voltage
reference can be achieved with the help of inner current controller loop. This refer-
ence is utilized for PWM to produce the inverter output voltage through switching
sequences in the inverter devices. In addition, a PLL is employed for the transformed
variables to synchronize with the grid (Yu et al. 2019). A mathematical model can
also be devised for modeling the three control loops-PQ, voltage, and current control
loops.
They vary with time depending upon the dynamics in each phase. For translating
the inverter dynamics into mathematical modeling, the balanced three-phase inverter
system can be characterized through transformation into a two-phase system over
stationary reference frame or αβ-reference frame as given below
⎡ ⎤
1 −1 ta
tα 0 ⎣ tb ⎦,
= √2 √
2
3 − 3 (2.4)
tβ 0 2 2 tc
where tα and tβ are the variables in the stationary reference frame, whereas ta , tb ,
and tc are the variables of the three-phase system. This transformation is popularly
termed Clarke transformation.
Stationary reference frame to Synchronous reference frame (αβ to dq)
The two-phase variables in the αβ reference frame are actually AC variables rotating
at the same speed as that of the three-phase variables. Therefore, it becomes difficult
to apply classical controllers like PI controller, since it won’t be able to accomplish
zero-error tracking of the corresponding parameters. In that case, Park transformation
can be applied. Park transformation refers to the conversion of stationary reference
frame (αβ) parameters to synchronous reference frame parameters (dq) as given
below
td cos θ sin θ tα
= , (2.5)
tq − sin θ cos θ tβ
where td and tq are the parameters in the synchronous reference frame. Angle θ is the
angular position for the given parameters. Quantities td and tq are the DC quantities
obtained through park transformation, which is considered as a preferable choice in
the case of applying PI controllers.
Both above transformations were applied for three-phase systems. However, they
may be applied for a single-phase inverter system as in Fig. 2.6b, by utilizing
an orthogonal signal generator (OSG). This OSG creates an imaginary quantity,
2 Control of Grid-Connected Inverter 41
in quadrature with the original single-phase variable. Then, the two variables in
αβ reference frame can be converted to dq reference frame with the help of Park
transformation.
The outer PQ control loop is responsible for real and reactive power control with the
help of instantaneous power theory (Kumar et al. 2020). The instantaneous real and
reactive powers (P and Q) can be calculated in the dq reference frame as provided
below
3
P= i d vd + i q vq , (2.6)
2
3
Q= i d vq − i q vd . (2.7)
2
For simplicity, supposing that the PLL is following the output voltage vector with
the d-axis of the synchronous dq reference frame or vq = 0, the transfer functions
from the above calculations (ratio of real and reactive powers to dq output currents)
can be found as given below:
For an ideal converter, the above calculations are used for open-loop control to
regulate the real and reactive power. Nonetheless, a closed-loop control is preferred
for better performance in the case of uncertainties (deviations in voltage and power
losses) in the system.
An alternative to the PQ control loop is through the DC-link voltage regulation as the
outer loop. If the DC-link voltage is maintained constant, it confirms the optimum
power delivered from the DC side to the AC side. This approach is commonly applied
in PV systems in the case of continuous supply through PV arrays. It is able to ensure
optimum power delivery at the load end. For grid-tied applications, it is desired that
the DC-link voltage should be more than the maximum grid voltage. For a loss-
less power converter, input power and output power should be balanced as per the
instantaneous power theory. This can be explained as
d VDC
Input DC power = VDC C DC . (2.10)
dt
Input DC power = Output AC power
d VDC 3
VDC C DC = i d vd + i q vq . (2.11)
dt 2
Assuming that the PLL is following the output voltage vector with the d-axis of
the synchronous dq reference frame or vq = 0, the transfer functions from the above
calculations (ratio of DC-link voltage output and reactive powers to d-axis current)
can be found as given below:
The objective of the current controller is to control the output AC current and in the
process, it generates a reference for output voltage. As per the circuit in Fig. 2.5,
applying Kirchohff’s law, the three-phase inverter output current can be expressed
below
di a
L + Ri a = via − va , (2.13)
dt
2 Control of Grid-Connected Inverter 43
di b
L + Ri b = vib − vb , (2.14)
dt
di c
L + Ri c = vic − vc . (2.15)
dt
where i p , vi p , and v p are the current injected to the grid, inverter output voltage,
and the AC load voltage, respectively, with p = a, b, c being the three phases. After
applying the Clark and park transformations in the above equations, the following
expressions are obtained:
di d
L + Ri d − ωLi q = vd1 − vd , (2.16)
dt
di q
L + Ri q + ωLi d = vq1 − vq , (2.17)
dt
where i d and i q represent the currents injected to the AC side on dq reference frame,
and ω is the frequency of the system. Similarly, vd1 , vq1 represent the inverter output
voltages in dq reference frame, and vd , vq are the output voltages or load voltages
corresponding to d and q axes. From the above equations, the AC current to be
injected can be regulated through the inverter output voltage control. However, there
is a coupling between the d- and q-axis currents, which causees the control to be
slightly complicated. The control dynamics are also affected by the load character-
istics. Therefore, there is a need to modify the output voltage references through
adding decoupling terms and, further, the modified current control modeling can be
expressed as
di d ∗
L + Ri d = vd1 , (2.18)
dt
di q ∗
L + Ri q = vq1 . (2.19)
dt
From the above calculations, the d- and q-axis-related terms are found to be
identical. Therefore, a single-axis analysis should be sufficient due to their similar
dynamics. The plant transfer function can then be obtained as the ratio of the output
current to the inverter output voltage.
i d (s) i q (s) 1
∗ = ∗ = . (2.20)
vd1 (s) vq1 (s) sL + R
44 A. Malik and A. Haque
shown in Fig. 2.10. It is clearly visible that the output voltage and current are AC
waveforms at a frequency of 50 Hz, with voltage at amplitude 325 V (RMS value is
230 V) and current at amplitude 95A.
Further, the Typhoon HIL-402 device can also be utilized to obtain real-time simu-
lation results over digital storage oscilloscope (DSO). The overall setup is provided
in Fig. 2.11. Further, the inverter output voltage and current obtained over DSO are
shown in Fig. 2.12. They are scaled outputs as can be visible from the figure. Hence,
the results are verified through Typhoon HIL-402 setup.
Fig. 2.10 The sinusoidal voltage and current obtained after simulation
46 A. Malik and A. Haque
Fig. 2.11 The overall system setup with the HIL-402 device
Fig. 2.12 The inverter output voltage and current obtained at DSO
2.5 Conclusion
Renewable energy sources including PV, winds, etc., are globally embraced at an
increased rate. Their fast adoption has led to more utilization of power electronic
converters worldwide for optimum power transfer and delivery. The advanced power
electronics converter technology has provided significant favorable methods for inter-
connection with renewable energy generators, especially PV systems. This chapter
talks about the importance of power converters, their modeling, and control func-
tionalities in a grid-connected system. Majorly, it specifies the DC/AC converter
or inverter mathematical analysis and various control approaches for performing
2 Control of Grid-Connected Inverter 47
References
Ahmad A et al (2018) Robust control of grid-tied parallel inverters using nonlinear backstepping
approach. IEEE Access PP(8):1, https://doi.org/10.1109/ACCESS.2018.2875030
Ahmed KH, Massoud AM, Finney SJ, Williams BW (2011) A modified stationary reference frame-
based predictive current control with zero steady-state error for LCL coupled inverter-based
distributed generation systems 58(4):1359–1370
Al-shetwi AQ, Zahim M, Blaabjerg F (2018) Low voltage ride-through capability control for single-
stage inverter-based grid-connected photovoltaic power plant. Sol Energy 159, 665–681, 2018,
https://doi.org/10.1016/j.solener.2017.11.027
Bharath KVS, Haque A, Khan MA (2018) Condition monitoring of photovoltaic systems using
machine leaming techniques. 2018 2nd IEEE international conference power electron. Intell.
Control Energy Syst. ICPEICES 2018, pp. 870–875, https://doi.org/10.1109/ICPEICES.2018.
8897413
Bisht R, Bhattarai R, Subramaniam S, Kamalasadan S (2020) A novel synchronously rotating
reference frame based adaptive control architecture for enhanced grid support functions of single
phase inverters 9994(c):1–11, https://doi.org/10.1109/TIA.2020.2994879
Bojoi RI, Limongi LR, Roiu D, Tenconi A (2011) Enhanced power quality control strategy for
single-phase inverters in distributed generation systems 26(3):798–806
Bose BK (2008) Neural network applications in power electronics and motor drives—an introduc-
tion and perspective. IECON Proc (Indus Electron Conf) 54(1):25–27, https://doi.org/10.1109/
IECON.2008.4757921
Bose BK (2017) Artificial intelligence techniques in smart grid and renewable energy systems—
some example applications. Proc IEEE 105(11):2262–2273. https://doi.org/10.1109/JPROC.
2017.2756596
Cai H, Wei W, Peng Y, Hu H (2014) Fuzzy proportional-resonant control strategy for three-phase
inverters in islanded micro-grid with nonlinear loads. IEEE international conference fuzzy system,
pp 707–712, https://doi.org/10.1109/FUZZ-IEEE.2014.6891682
Castello J, Espi JM, Garcia-Gil R (2016) A new generalized robust predictive current control
for grid-connected inverters compensates anti-aliasing filters delay. IEEE Trans Ind Electron
63(7):4485–4494. https://doi.org/10.1109/TIE.2015.2497303
Chandran P, Madhura RS, Roselyn JP, Devaraj D, Gopal V, Ravi A (2019) Development of intelligent
fuzzy PQ-FRT control strategy for grid-connected solar PV system. IEEE International conference
intelligent techology control Optimum. Signal Process. INCOS 2019, pp. 7–11, https://doi.org/
10.1109/INCOS45849.2019.8951347
48 A. Malik and A. Haque
Cortés P, Wilson A, Kouro S, Rodriguez J, Member S (2010) Model predictive control of multilevel
cascaded H-bridge inverters 57(8):2691–2699
Cortes D, Vázquez N, Alvarez-Gallegos J (2009) Dynamical sliding-mode control of the boost
inverter. IEEE Trans Ind Electron 56(9):3467–3476. https://doi.org/10.1109/TIE.2008.2010205
Chavali RV, Dey A, Das B (2022) A hysteresis current controller PWM scheme applied to three-level
NPC inverter for distributed generation interface. IEEE Trans Power Electron 37(2):1486–1495.
https://doi.org/10.1109/TPEL.2021.3107618
Davoodnezhad R, Holmes DG, McGrath BP (2014) A novel three-level hysteresis current regulation
strategy for three-phase three-level inverters. IEEE Trans Power Electron 29(11):6100–6109.
https://doi.org/10.1109/TPEL.2013.2295597
Dasgupta S, Sahoo SK, Panda SK (2011) Single-phase inverter control techniques for interfacing
renewable energy sources with microgrid-Part I: parallel-connected inverter topology with active
and reactive power flow control along with grid current shaping. IEEE Trans Power Electron
26(3):717–731. https://doi.org/10.1109/TPEL.2010.2096479
Du Y, Lu DDC, Chu GML, Xiao W (2015) Closed-form solution of time-varying model and its
applications for output current harmonics in two-stage PV inverter. IEEE Trans Sustain Energy
6(1):142–150. https://doi.org/10.1109/TSTE.2014.2360616
Ebrahimi M, Member S, Khajehoddin SA (2015) Fast and robust single-phase DQ current controller
for smart inverter applications 8993(c):1–9, https://doi.org/10.1109/TPEL.2015.2474696
Fatama AZ, Khan MA, Kurukuru VSB, Haque A, Blaabjerg F (2020) Coordinated reactive power
strategy using static synchronous compensator for photovoltaic inverters. Int Trans Electr Energy
Syst 30(6):1–18. https://doi.org/10.1002/2050-7038.12393
Han Y et al (2017) Stability analysis of digital controlled single- phase inverter with synchronous
reference frame voltage control 8993(c), https://doi.org/10.1109/TPEL.2017.2746743
Hannan MA, Ghani ZA, Hoque MM, Ker PJ, Hussain A, Mohamed A (2019) Fuzzy logic inverter
controller in photovoltaic applications: Issues and recommendations. IEEE Access 7(c):24934–
24955, https://doi.org/10.1109/ACCESS.2019.2899610
Hannan MA, Ghani ZA, Mohamed A, Uddin MN (2015) Real-Time testing of a fuzzy-logic-
controller-based grid-connected photovoltaic inverter system. IEEE Trans Ind Appl 51(6):4775–
4784. https://doi.org/10.1109/TIA.2015.2455025
Hasanien HM (2016) An adaptive control strategy for low voltage ride through capability
enhancement of grid-connected photovoltaic power plants 31(4):3230–3237
Kazmierkowski MP, Malesani L (1998) Current control techniques for three-phase voltage-source
PWM converters : a survey 45(5):691–703
Khan , Haque A, Kurukuru VSB (2019) Machine learning based islanding detection for grid
connected photovoltaic system. 2019 international conferencepower electron. Control Autom.
ICPECA 2019 - Proc., vol. 2019-Novem, no. 1, https://doi.org/10.1109/ICPECA47973.2019.
8975614
Khan MA, Haque A, Bharath Kurukuru VS (2020) Reliability analysis of a solar inverter during
reactive power injection. 9th IEEE international conference power electron. Drives Energy Syst.
PEDES 2020, https://doi.org/10.1109/PEDES49360.2020.9379776
Khan MA, Haque A, Bharath KVS, Droop based low voltage ride through implementation for grid
integrated photovoltaic system
Kouro S, Leon JI, Vinnikov D, Franquelo LG (2015) Grid-connected photovoltaic systems: an
overview of recent research and emerging PV converter technology. IEEE Ind Electron Mag
9(1):47–61. https://doi.org/10.1109/MIE.2014.2376976
Kumar N, Saha TK, Dey J (2020) Multilevel Inverter (MLI)-based stand-alone photovoltaic system:
modeling, analysis and control 14(1):909–915
Kurukuru VSB, Haque A, Khan MA, Sahoo S, Malik A, Blaabjerg F (2021) A review on artificial
intelligence applications for grid-connected solar photovoltaic systems. Adv Renew Energy Syst
(Part 1 2), pp 161–174, https://doi.org/10.1201/b18242-7
2 Control of Grid-Connected Inverter 49
Kumar M, Tyagi B (2021) A robust adaptive decentralized inverter voltage control approach for
solar PV and storage-based islanded microgrid. IEEE Trans Ind Appl 57(5):5356–5371. https://
doi.org/10.1109/TIA.2021.3094453
Lee DC, Sul SK, Park MH (1992) High performance current regulator for a field-oriented controlled
induction motor drive. Conference Rec. - IAS Annual Meeting (IEEE Ind. Appl. Soc., vol 1992-
Janua, no 5, pp 538–544, https://doi.org/10.1109/IAS.1992.244349
Li X, Balog RS (2015) PLL-less robust active and reactive power controller for single phase grid-
connected inverter with LCL filter, Conference Proceeding—IEEE appllication power electronics
conference Expo. - APEC, vol 2015-May, May, pp 2154–2159, https://doi.org/10.1109/APEC.
2015.7104647
Liao H, Zhang X, Ma Z (2021) Robust dichotomy solution-based model predictive control for the
grid-connected inverters with disturbance observer. CES Trans Electr Mach Syst 5(2):81–89.
https://doi.org/10.30941/cestems.2021.00011
Liu Q, Member S, Caldognetto T, Buso S (2020) Review and comparison of grid-tied inverter
controllers in microgrids 35(7):7624–7639
Liu YH, Chen CL, Tu RJ (1998) A novel space-vector current regulation scheme for a field-
oriented-controlled induction motor drive. IEEE Trans Ind Electron 45(5):730–737. https://doi.
org/10.1109/41.720329
Merabet A (2017) Control system for dual-mode operation of grid-tied photovoltaic and wind
energy conversion systems with active and reactive power injection. Saint Mary’s Univ. Halifax,
NS, Canada, no. August, 2017, https://doi.org/10.13140/RG.2.2.26509.44006
Meireles MRG, Almeida PEM, Simões MG (2003) A comprehensive review for industrial appli-
cability of artificial neural networks. IEEE Trans Ind Electron 50(3):585–601. https://doi.org/10.
1109/TIE.2003.812470
Parvez M, Fathi M, Elias M (2020) Comparative study of discrete pi and pr controls for single-phase
UPS inverter 4:1–13, https://doi.org/10.1109/ACCESS.2020.2964603
Purba V, Johnson BB, Rodriguez M, Jafarpour S, Bullo F, Dhople SV (2019) Reduced-order
aggregate model for parallel-connected single-phase inverters. IEEE Trans Energy Convers
34(2):824–837. https://doi.org/10.1109/TEC.2018.2881710
Ramchand R (2018) A new control strategy for single phase cascaded H bridge multilevel inverter
in stationary reference frame with nonlinear loads
Rowan TM, Kerkman RJ (1986) A new synchronous current regulator and an analysis of current-
regulated PWM inverters I(4)
Romero-cadaval E, François B, Malinowski M (2015) Grid-connected photovoltaic generation
plants as alternative energy sources
Strache S, Wunderlich R, Heinen S (2014) A Comprehensive, quantitative comparison of inverter
architectures for various PV Systems, PV cells, and irradiance profiles. IEEE Trans Sustain Energy
5(3):813–822. https://doi.org/10.1109/TSTE.2014.2304740
Tarasantisuk C, Kumsup S, Piyarat W, Witheepanich K (2016) Stationary frame current regula-
tion using Proportional Resonant controller for single phase grid connected inverter. 2016 13th
international conference electrical engineering computer telecommun infernational technology
ECTI-CON 2016, no 2, pp 3–7, https://doi.org/10.1109/ECTICon.2016.7561350
Xu S, Xue Y, Chang L (2021) Review of power system support functions for inverter-based
distributed energy resources- standards, control algorithms, and trends. IEEE Open J Power
Electron 2:88–105. https://doi.org/10.1109/ojpel.2021.3056627
Yang L, Chen Y, Luo A, Huai K (2019) Stability enhancement for parallel grid-connected inverters
by improved notch filter. IEEE Access 7:65667–65678. https://doi.org/10.1109/ACCESS.2019.
2917533
Yang T, Cai Z, Xun Q (2020) Adaptive backstepping-based H∞ robust controller for photovoltaic
grid- connected inverter. IEEE Access 8:17263–17272. https://doi.org/10.1109/ACCESS.2019.
2962280
50 A. Malik and A. Haque
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 51
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_3
52 J. M. Riquelme-Dominguez et al.
evaluate their behaviour of them, a validation test has been carried out with each
controller implementation connected to two isolated loads. Finally, a conclusion is
given, revealing the strengths and weaknesses of each considered performance.
3.1 Introduction
Significant changes are taking place in modern power systems. These changes touch
on every aspect of the system, including how electricity is produced, the mechanism
used to supply it, and how the end user uses the electricity.
In terms of electricity production, renewable energy generators such as wind and
solar photovoltaics (PV), among others, are displacing conventional synchronous
generators from the generation mix. Although these kinds of energy sources are
considered environmentally friendly technologies, their output power highly depends
on the primary renewable source, which is, to a certain extent, volatile and challenging
due to dependence on the weather (Gonzalez-Longatt et al. 2021). In addition, the
intermittent nature of renewable generators contrasts with the traditional operation
of conventional synchronous generators. The operation of electricity distribution
networks is also changing. In recent times, there has been a trend to optimising avail-
able resources in electricity transmission systems to take full advantage of distributed
generation, such as small photovoltaic generators, microturbines, biomass, and fuel
cells.
In fact, current trends suggest that the interaction between distribution system
operators (DSOs) and transmission system operators (TSOs) is changing. All parties
involved in the power system will profit from the complete interaction between
TSOs and DSOs, which will release the potential of the present and foreseeable
resources. Finally, consumers have become an active part of the power system due to
the integration of embedded generation (EG), the widespread use of electric vehicles
(EV), and electrical energy storage (EES). The emergence of the aforementioned
technologies together with the change in consumer behaviour makes the latter a
prosumer, an entity that both consumes and produces electricity. The unifying factor
behind these advancements is the widespread adoption of power electronic converter
interfaced technologies (Chamorro et al. 2021; Acosta et al. 2021). Nonconventional
generation and storage technologies rely on power electronic converters (PECs) to
supply more manageable electricity and to integrate energy storage and renewable
resources in power systems.
The PEC is a critical component in integrating new low-carbon technologies
(LCT), as it is an enabling technology that creates the necessary interface between
several energy systems (Gonzalez-Longatt et al. 2021; Gorostiza and Gonzalez-
Longatt 2020).
The growing use of PECs is reducing the number of synchronous generators (SGs)
available in the power system, which has several implications from the point of view
3 Grid-Forming Converter Control Techniques Implementation … 53
of system operation. Two significant difficulties have been cited in numerous research
publications and projects (ENTSO-E 2021; Operator 2016): (i) low (or nonexistent)
supply of total system rotational inertia and (ii) reduced and limited fault levels
affecting short circuit ratio.
Different actors have identified the above-mentioned issues: transmission system
operators, researchers, and manufacturers (IEEFA 2021). Several documents have
reported some of the negative aspects associated with high penetration of PEC tech-
nology in power systems: lack of robustness (specifically during extreme overcur-
rent events and significant voltage drops), malfunction of the Phase-Locked Loop
(PLL) to track extremely low voltage sags (Grid 2016), fault ride-through (FRT) fail-
ures, and unfavourable interactions. The IEEE’s power system dynamic performance
committee acknowledged, in April 2020 (Hatziargyriou et al. 2020), the necessity
for new types of dynamic behaviour in electrical power systems with a high pene-
tration of power electronic interfaced technologies. Due to the broad presence of
PEC-interfaced technologies in bulk power systems, the classification and defini-
tion of power system stability phenomena were improved by adding new factors.
Two new stability categories have been introduced (Hatziargyriou et al. 2020): (i)
converter-driven stability and (ii) resonance stability.
The dynamic behaviour of renewable energy sources is radically different
from conventional synchronous generators due to the presence of voltage-source
converters (VSC), which serve as an interface with the grid (Hatziargyriou et al.
2020). The existence of high penetration of VSC in power systems has caused several
local instabilities, known as a converter-driven instabilities. These instabilities can
be caused, among others, by an incorrect design of the control settings or wrongly
calibrated controllers. However, the substitution of conventional generation with
PEC-based energy sources does not necessarily have a negative impact on the grid.
Nevertheless, it is true that, as discussed above, it can be a source of instability.
On the other hand, if the controller settings are appropriately adjusted, PEC-based
technologies can provide solutions to some of the problems of power systems, e.g.,
those derived from low inertia power systems. PEC-interfaced technologies that take
the place of traditional synchronous generators can be equipped with controllers to
react to unforeseen occurrences and system imbalances exceptionally quickly; in fact,
PEC-interfaced technologies can do that much faster than mechanical synchronous
machines. A PEC-dominated power system needs both short-term and long-term
solutions to improve stability. One of these potential solutions is related to controlling
the grid-side inverter based on VSCs using grid-forming control. The grid-forming
control technique allows for supporting the grid operation since it emulates the
behaviour of conventional synchronous generators. There are different alternatives
for grid-forming control implementation.
A little summary of the main control techniques used to emulate the behaviour
of a synchronous generator is shown in Fig. 3.1 (see more details at (Tamrakar et al.
2017)).
In this chapter, the authors present details of the modelling and implementation of
three grid-forming control techniques in the digital real-time simulation framework of
54 J. M. Riquelme-Dominguez et al.
Synchronverters
Virtual Synchronous
Machine (VISMA)
Topology
Synchronous generator
model based Institute of Electrical
Power Engineering
(IEPE) Topology
Kawasaki Heavy
Industries (KHI)
Lab·s Topology
Virtual Oscillator
Control (VOC)
Inducverter
Fig. 3.1 Classification of different control strategies used for the implementation of synchronous
generation emulation
Typhoon HIL. The grid-forming control techniques implemented in this chapter are
Droop Control, Virtual Synchronous Machine (VSM), and Synchronverter (SynC).
This chapter is organised as follows: Sect. 3.2 presents the test system used to
implement the grid-forming strategies and a description of the Droop, VSM, and
SynC control techniques. Section 3.3 shows real-time simulation results considering
the test system and the three grid-forming control techniques. Simulations have been
carried out using the Virtual HIL functionality available in the Typhoon HIL Control
Centre. Finally, Sect. 3.4 summarises the main points of this chapter.1
3.2 Modelling
The objective of this chapter is to present details of the modelling and implementation
of three grid-forming control techniques in digital real-time simulation.
This section presents the modelling aspects of the three grid-forming control
techniques considered in this chapter.
A straightforward but very extremely useful isolated test system is used for modelling
purposes. The system is formed by a VSC-based power converter feeding two loads.
Load 1 is a three-phase series RL branch, whereas Load 2 is a three-phase series
RLC branch. An RLC filter is used as an interface between the VSC and Bus 1 to
reduce harmonics due to switching. Every load is equipped with a circuit breaker
(S1 , S2 ) that allows to connect and disconnect them when required. The three-phase
AC test system is depicted in Fig. 3.2, including the main parameters of the system
and the main electrical variables involved.
The implementation of the test system in the Typhoon HIL Schematic Editor (.tse
file) is shown in Fig. 3.3.
As depicted in Fig. 3.3, the test system is implemented with several Typhoon
HIL blocks available in the library core: the “Three Phase Inverter” block used to
model the VSC, “Resistor”, “Inductor”, and “Capacitor” blocks used to model the
filter and the loads. Some measurement elements have also been included, such
Qmeas
Pmeas
VSC Filter Bus 1
Rf Lf S1 R1 L1
Vdc
Cf Load 1
Iabc Vs,abc
IL,abc S2
R2
Load 2
L2
C2
Fig. 3.2 Test System: A single VSC connected to two constant impedance loads
56 J. M. Riquelme-Dominguez et al.
I_RMS
Pload
I_RMS
modulator
POWER_P Pload
Input
POWER_Q
Qload Goto53
POWER_PF
out1
out2
out status_s1
Meter Split1
Qload
PFload
Goto54
C
RLC filter Constant8
La Lload
En
InA
InB
InC
Out
DC+ A A+ A-
Lb Lload1
B B+ B-
Vdc_link
Lc Lload2
DC- C C+ C-
GND
Rc Ic1 Ic2 Rload2
Ic1 Ic2 Three-phase Meter1
Three Phase Inverter1 Step1 S1
Load 1
Va1 Va1 S2
VSC
Goto22 status_s2
C1 C2 C3
Vb1 Vb1
Goto23
Vc1 Vc1
C4 C5 C6
Fig. 3.3 Implementation of the isolated test systems inside the Typhoon HIL framework
The main foundation of droop control is to emulate the very well-known behaviour
of a synchronous generator governor, in which any increase in the load results in a
decrease of the frequency according to its frequency droop characteristic. Similarly,
reactive power is related to the voltage magnitude by introducing a voltage droop
characteristic. The grid-forming droop control uses a droop approach to calculate
frequency (Δf droop ) and voltage (ΔV droop ) deviation from the steady-state operation
point (Eberlein and Rudion 2020; Habibullah et al. 2021):
Δ f dr oop = m p ΔP (3.1)
where mp and mq are the active and reactive power droop coefficients and ΔP and
ΔQ are the low-pass filtered active and reactive power deviations from the steady-
state operating point, respectively, the droop coefficients were determined according
to Fig. 3.4.
As depicted in Fig. 3.4, the nominal frequency (f 0 ) and voltage (V 0 ) need to be
specified for some load conditions (e.g. Load,1 and Load,2). Then, the minimum
frequency (f min ) and voltage (V min ) are stated according to the maximum power of
the VSC. In this chapter, the maximum active power of the VSC is 1.2 times the
active power consumed by the loads, and the maximum reactive power is 1.2 times
the reactive power consumed by Load 1. It is worth mentioning that the character of
the Load 1 is inductive, while Load 2 is of a capacitive nature. For this reason, the
total reactive power consumed by the two loads is lower than the one consumed by
Load 1.
The following subsections show the model implementation of the droop control
technique for a VSC-based power electronic converter.
The active and reactive power controller, which is one of the outer control loops, is
used to regulate the voltage amplitude and frequency, respectively.
Once it has the required voltages and currents in the rotating frame, the instanta-
neous active (3.3) and reactive power (3.4) are calculated from the measured output
voltage and current in the synchronous rotating frame (dq) by the following equations:
3( )
Pmeas = Vsd I Ld + Vsq I Lq (3.3)
2
3( )
Q meas = Vsd I Lq + Vsq I Ld (3.4)
2
The reference frequency ωset and the reference voltage magnitude V sd,set come
from the P-f and Q–V droop control (3.5) and (3.6). The primary control is expressed
by the following equations:
Figure 3.6 depicts the implementation of the active and reactive power measure-
ments in Typhoon HIL Schematic Editor with their input variables (V sd , V sq , I Ld ,
I Lq ). These measurements are introduced in Eqs. (3.3) and (3.4) in order to obtain the
measured active and reactive power (Pmeas , Qmeas ). The measured power is compared
with the set power (Pset , Qset ) and the power deviation from the setpoint is obtained,
which is introduced in (3.5) and (3.6). First, the power variation is multiplied by the
respective droop coefficient and then added to the frequency and voltage setpoints to
define the frequency reference (ωset ) and the voltage magnitude reference (Vsd,ref ),
respectively.
The reference frequency and the reference voltage magnitude are conducted sepa-
rately through “Goto” blocks to the Active Power Synchronisation control and the
Voltage and Current controllers, as explained in the following subsections.
The active power synchronisation control serves to define the control angle (theta,
θ = ωt) as depicted in Fig. 3.7. It takes the reference frequency as input through a
“From” block in radians per second unit. Then, the reference frequency is integrated
into an angle increment (Converters et al. 2010) by the “Integrator” block from the
library “core”. The result is the output signal θ. It is noteworthy that the Integrator
60 J. M. Riquelme-Dominguez et al.
Integrator
may be reset when the status of that block is greater than 2π, which corresponds to
one complete revolution.
The voltage and current controllers are known as the inner control loops. They are
formed by two pairs of cascaded PI-controllers, and their goal is the regulation of ac
voltages and currents at the output of the converter’s filter. The control is made by
decoupling the reference voltage magnitude of each direct-quadrature axis, V sd,ref, and
V sq,ref . Figure 3.8 shows the implementation of the voltage and current controllers.
Current control
w
Voltage control
Vsd Modulation signal
in d-axis
ILd Id,ref X
Iq X
Vsd,ref Idref
+
-
+
Vsdref + md
- -
+
+ md
-
+
Id
Vsd
Vsd X
w Modulation signal
X
Id X
Iqref
+ mq
+ +
+ +
- + mq
+ -
Vsq_ref +
Iq
Vsq,ref ILq Vsq
Vsq
Modulation signal
in d-axis
md
dq to abc
mq VSC control
d a
in
q
b in1 modulator
0
in2
ωt c
theta
Fig. 3.9 Modulation signal generation for the control of the VSC
As stated above, the active power regulation in the VSM grid-forming technique is
done through the swing equation of an SG:
dωset
Tacel = Pset − Pmeas + K d (ω0 − ωset ) (3.7)
dt
where T acel is the mechanical time constant, and K d is the damping coefficient.
Figure 3.10 shows the implementation of the swing equation in the Typhoon HIL
environment. It includes the measured active power (Pmeas ) at Bus 1; the nominal
angular frequency (ω0 ), and the active power command (Pset ). Finally, the derivative
of the reference frequency with respect to time is integrated to provide the reference
frequency (ωset ).
As detailed in Sect. 3.2.3, the virtual rotor angular position of the VSM (θ) is
given by the active power synchronisation control loop, and this angular position
corresponds to the phase angle of the voltage induced by the VSM model.
The parameters of the VSM technique are defined for specific operating conditions
of the VSC, as in the case of the droop control. The minimum angular frequency (ωmin )
is set for the maximum active power of the VSC, Pmax,VSC . The nominal frequency
(ω0 ) is set for specific load conditions, for example, Pset = PLoad,1 . Therefore, K d
can be determined when the derivative of the reference frequency is zero:
Pmax,V SC − PLoad,1
Kd = (3.8)
ω0 − ωmin
unbalance. Just after the power imbalance, the angular frequency deviation is zero,
and the derivative of the reference frequency only depends on T acel , Pset , and Pmeas .
Thus, defining a maximum ROCOF, the mechanical constant keeps:
where df set /dt|max is the maximum allowed ROCOF expressed in Hertz per second.
dωset
Tacel = Tmech − Telec + D p (ω0 − ωset ) (3.10)
dt
d(M f i f )
K = Q set − Q meas + Dq (V0 − Vsd,set ) (3.11)
dt
The implementation of the dynamic swing equations in the Typhoon HIL environ-
ment is shown in Fig. 3.11, with the following input variables: the electromagnetic
torque (T elec ), the reactive power (Qmeas ) generated by the Synchronverter and the
nominal voltage (V 0 ); the internal set values of the moment of inertia (Tacel ), the inte-
grator gain (K) to regulate the field excitation, the frequency droop coefficient (Dp ),
the voltage droop coefficient (Dq ), the voltage setpoint (V sd,set ), the angular frequency
setpoint (ω0 ), the mechanical torque setpoint (T mech ) and the reactive power setpoint
(Qset ); and the output variables of the reference angular frequency (ωset ) and the
reference field excitation (M f if ).
The mechanical torque (T mech ) can be obtained from the setpoint of active power
(Pset ) by dividing it by the nominal mechanical speed (ω0 ). Again, the virtual rotor
angle of the Synchronverter (θ) is given by the active power synchronisation control
loop.
64 J. M. Riquelme-Dominguez et al.
Fig. 3.11 Implementation of the dynamic swing equations in the Typhoon HIL environment
Trigonometric functions are necessary for the calculation of magnitudes as the active
and reactive power measured at Bus 1, the electromagnetic torque provided by the
VSC and the reference voltage at the output of the VSC filter. cos θ and sin θ are
vectors defined as the three-phase angle difference with equal spacing of 120° or
2π/3 in radians, as shown in Eqs. (3.12) and (3.13) (Fig. 3.12).
⎡ ⎤
(cos θ 2π )
cos θ = ⎣ cos θ − 3 ⎦ (3.12)
( )
cos θ − 4π 3
⎡ ⎤
(sin θ 2π )
sin θ = ⎣ sin θ − 3 ⎦ (3.13)
( )
sin θ − 4π 3
3 Grid-Forming Converter Control Techniques Implementation … 65
Trigonometric functions
The measured active (Pmeas ) and reactive power (Qmeas ) generated by the Synchron-
verter are given by Eqs. (3.14) and (3.15), where <,> denotes the inner product:
The implementation of the active and reactive power calculation in the Typhoon
HIL environment are shown in Fig. 3.13. The inputs to the subsystems “Active Power”
and “Reactive Power”, which implements (3.14) and (3.15), are: the RLC filter output
current (I abc,2 ), the sin θ vector for the active power, the cos θ vector for the reactive
power, the field excitation (M f if ), and the angular frequency reference (ωset ).
Ia2 Ia Ia2 Ia
Ib2 Ib Ib2 Ib
Ic2 Ic Ic2 Ic
P P_meas Q Q_meas
wset W wset W
Fig. 3.13 Implementation of the active and reactive power equations in Typhoon HIL environment
66 J. M. Riquelme-Dominguez et al.
Ib2 Ib
sin_120 sin_120 Vsdref
Ic2 Ic
a d
wset W
sin_240 sin_240 abc to dq
Mf_If Mf_If
Fig. 3.14 Implementation of electromagnetic torque and the modulated voltage in the Typhoon
HIL environment
The electromagnetic torque (T elec ) is the energy stored in the magnetic field of the
machine, represented by Eq. (3.16):
e = θ̇ M f i f sin θ (3.17)
The mechanical time constant is related to the maximum ROCOF that the system
frequency can experiment immediately after an active power unbalance. This is
because just after the power imbalance, the angular frequency deviation is zero, and
the derivative of the reference frequency only depends on Tacel , T mech , and T elec .
Thus, defining a maximum ROCOF, the mechanical constant keeps:
PLoad,1
ω0
− Pmax,V
ωmin
SC PLoad,1
ω0
− Pmax,V SC
ωmin
Tacel = | = | (3.19)
dωset | |
dt max 2π ddtfset |
max
where df set /dt|max is the maximum allowed ROCOF expressed in Hertz per second.
The tuning of Dq and K is identical to the one followed for Tacel and Dp .
This section shows the numerical results of the real-time simulations considering the
proposed test system to illustrate the performance of the three implemented grid-
forming control techniques. The models used for digital real-time simulation were
implemented using the Typhoon HIL framework. The test system together with the
controller models, was created using Typhoon HIL Schematic and then compiled
and ran using the Typhoon HIL SCADA system.
The parameters of the test system and the three gird-forming control techniques
are detailed in Tables 3.1, 3.2, 3.3, 3.4 and 3.5.
To check the correct implementation of the grid-forming control strategies, two
scenarios have been proposed. In both scenarios, the VSC is feeding Load 1, and
suddenly the Load 2 is connected to the system. The first case analyses the response
of the grid-forming droop control considering a variation of the droop coefficient
parameters. The second scenario compares the response of the three grid-forming
techniques under the same event.
The first scenario analyses the effect of varying the parameters of the droop control
grid-forming technique. A pair of droop coefficients have been previously defined,
and then they are modified to observe the response of the VSC control system. The
3 Grid-Forming Converter Control Techniques Implementation … 69
first pair of droop parameters are selected to satisfy the following requirements: when
only Load 1 is connected, the reference frequency is set to its nominal value (ω0 =
120π rad/s), and the minimum frequency in Hertz is 59.5 Hz for the maximum active
power of the converter (1.2 times the total active power consumed by the loads). In
terms of reactive power, the peak nominal voltage at Bus 1 is defined as 400 V when
the two loads are connected. The minimum voltage is set to 0.9 times the nominal
voltage for the maximum reactive power of the VSC (1.2 times the reactive power
consumed by Load 1). Figure 3.15 shows active power control performance in these
conditions. It can be seen that the VSC delivers the requested active power (Pset
= 1.796 MW) in less than 0.1 s, while the reference frequency is maintained at its
nominal value, ω0 . At t = 0.5 s, switch S2 is closed, and Load 2 is connected to the
system. As a consequence, there is an active power imbalance of |ΔP| = 0.664 MW,
and the droop control reduces the reference frequency to 384 MHz. This situation is
maintained until the end of the simulation.
The performance of the reactive power droop control is depicted in Fig. 3.16.
It can be seen that the reactive power control is as fast as one of the active power,
achieving the reactive power set (Qset = 1.118 MVar) in less than 0.1 s. The voltage
is set between the minimum voltage defined (V min = 360 V) and its nominal value,
according to the voltage droop characteristic: with just Load 1 connected, the voltage
is set to V set = 371.28 V. When Load 2 is connected at t = 0.5 s, its capacitive character
almost compensates the reactive power consumed by Load 1, being the final reactive
power consumed by loads of 1.5 kVar. The connection of Load 2 also implies an
increment of the voltage at Bus 1, achieving the designed value of 400.0 V for that
load conditions.
3
Pmeas (MW)
|ΔP| = 0.664 MW
2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Frequency at Bus 1 (Hz)
60
59.6
59.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s)
Fig. 3.15 Active power droop control performance after the connection of Load 2 at t = 0.5 s.
Active power droop coefficient: mp = 3.591 × 10–6
70 J. M. Riquelme-Dominguez et al.
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
400
Vsd at Bus 1 (V)
|ΔV| = 28.62 V
300
200
100
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s)
Fig. 3.16 Reactive power droop control performance after the connection of Load 2 at t = 0.5 s.
Reactive power droop coefficient: mq = 2.5675 × 10–5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Frequency at Bus 1 (Hz)
60
59.8
59.6
59.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s)
Fig. 3.17 Droop control performance after the connection of Load 2 at t = 0.5 s. Three different
active power droop coefficients were considered
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
400
Vsd at Bus 1 (V)
300
200
100
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s)
Fig. 3.18 Droop control performance after the connection of Load 2 at t = 0.5 s. Three different
reactive power droop coefficients were considered
The three strategies have been compared in the same scenario. Again, the VSC is
feeding Load 1, and Load 2 is suddenly connected to Bus 1 at t = 0.5 s. The VSM and
the Synchronverter strategies have been designed for a minimum angular frequency
72 J. M. Riquelme-Dominguez et al.
of f 0 = 59.7 Hz, whereas in droop control, this value has been kept to 59.5 Hz. The
results of the simulations are plotted in Figs. 3.19 and 3.20.
In Fig. 3.19, it can be seen that the three strategies present the same evolution
in the first part of the simulation due to the initial load conditions. When Load 2 is
connected at t = 0.5 s, all the techniques increment the active power delivered to
the loads. However, as can be seen in the reference frequency plot, one of the droop
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Frequency at Bus 1 (Hz)
60
59.8
59.6
59.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s)
Fig. 3.19 Comparison of the three grid-forming techniques after the connection of Load 2 at t =
0.5 s. Active power control
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
400
Vsd at Bus 1 (V)
300
200
100
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s)
Fig. 3.20 Comparison of the three grid-forming techniques after the connection of Load 2 at t =
0.5 s. Reactive power control
3 Grid-Forming Converter Control Techniques Implementation … 73
control is much more aggressive than the other two due to the linear characteristic of
the droop strategy. As a result, the reference frequency falls slower in the VSM and
SynC strategies by incorporating the dynamic swing equation, which considers the
derivative of that magnitude. In this simulation, it is shown that the incorporation of
the electromagnetic torque in the swing equation is preferable to have slower decay
of the reference frequency, as depicted in Fig. 3.19.
Figure 3.20 depicts the evolution of the reactive power measured and the reference
voltage at Bus 1 for the three simulations. As shown, the results in this case are quite
similar. In fact, the results of the droop control and the VSM strategy are identical
as the VSM technique has been implemented with a droop control for the reactive
power controller. The Synchronverter technique presents similar results with a greater
oscillation when the power imbalance occurs due to the control of the electromagnetic
torque instead of the active power, as shown in Fig. 3.19.
3.4 Conclusions
In this chapter, three grid-forming control techniques for VSC have been imple-
mented in the Typhoon HIL environment. The test system consisted of an isolated
three-phase system formed by the converter and two loads. The implementation of
the control techniques implied several subsystems and control loops, including the
measurement system, the current and voltage controllers, the active power synchroni-
sation control, and the active and reactive power controllers. Throughout this chapter,
all of these components have been presented in detail, both the fundamental equations
and their modelling in the Typhoon HIL Schematic Editor. Finally, simulation results
show the correct functioning of the grid-forming techniques. An analysis of the droop
control coefficients was presented. The comparison between the three control tech-
niques showed that VSM and SynC provide inertia to the system in contrast to droop
control. The main difference between VSM and SynC is related to the inclusion of
the dynamic swing equations of the synchronous generator in terms of torque.
References
Eberlein S, Rudion K (2021) Small-signal stability modelling, sensitivity analysis and optimisation
of droop controlled inverters in LV microgrids. Int J Electr Power Energy Syst 125:106404,
https://doi.org/10.1016/j.ijepes.2020.106404
Gonzalez-Longatt F, Acosta MN, Chamorro HR, Rueda JL (2021) Power converters dominated
power systems. In: Gonzalez-Longatt F, Rueda JL (eds) Modelling and simulation of power
electronic converter controlled power systems in PowerFactory, Switzerland: Springer Nature
Switzerland AG
Gorostiza FS, Gonzalez-Longatt F, (2020) Deep reinforcement learning-based controller for SOC
management of multi-electrical energy storage system. IEEE Trans Smart Grid, 1–1, https://doi.
org/10.1109/TSG.2020.2996274
Hatziargyriou N et al (2020) Stability definitions and characterisation of dynamic behavior in
systems with high penetration of power electronic interfaced technologies, https://doi.org/10.
1109/JSYST.2015.2444893
Habibullah M, Gonzalez-Longatt F, Acosta MN, Chamorro HR, Rueda JL, Palensky P (2021) On
short circuit of grid-forming converters controllers: a glance of the dynamic behaviour
High penetration of power electronic interfaced power sources and the potential contribution of grid
forming converters european network of transmission system operators for electricity ENTSO-E
technical group on high penetration of power electronic interfaced power sources. Accessed: Mar.
30, 2021. [Online]. Available: www.entsoe.eu
IEEFA, “Australia’s Opportunity To Plan Ahead for a Secure Zero-Emissions Electricity Grid
Towards Ending the Reliance on Inertia for Grid Stability,” 2021
National Grid, “System Operability Framework 2016,” UK Electr. Transm., no. November, pp. 68–
72, 2016, Accessed: Mar. 30, 2021. [Online]. Available: www.nationalgrid.com/sof
Tamrakar U, Shrestha D, Maharjan M, Bhattarai B, Hansen T, Tonkoski R (2017) Virtual inertia:
current trends and future directions. Appl Sci 7(7):654. https://doi.org/10.3390/app7070654
Zhong QC, Weiss G (2011) Synchronverters: inverters that mimic synchronous generators. IEEE
Trans Ind Electron 58(4):1259–1267. https://doi.org/10.1109/TIE.2010.2048839
Chapter 4
Model Predictive Control
for Grid-Connected Converters
with Typhoon HIL
Abstract The growing use of distributed energy resources is driving several improve-
ments in power electronics and their control strategies, especially regarding voltage-
source converters, which are crucial to integrate these resources into the electric
grid. Control strategies such as classical linear proportional-integral, proportional-
resonant, state feedback and deadbeat are generally employed for these applications.
However, these strategies usually do not take into account nonlinearities such as con-
trol action saturation and current limitations. To solve these issues, Model Predictive
Control (MPC) has become a very powerful alternative for controlling grid-connected
converters (GCCs), allowing to encompass in the control design different linear and
nonlinear constraints. Among the MPC controllers, the Finite Control Set MPC (FCS-
MPC) is an attractive solution for controlling GCCs. In FCS-MPC, an optimization
problem is formulated with a cost function that expresses the control objectives, such
as current reference tracking, capacitor voltage regulation, minimization of losses
and common-mode voltages. Besides, FCS-MPC can be implemented with one volt-
age vector per sampling period, or with a switching sequence, characterizing the
Modulated MPC. In this context, this chapter will present different MPC strategies
for GCCs and how they can be implemented, tested and validated using the Typhoon
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 75
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_4
76 D. M. Lima et al.
HIL platform and the Test-Driven Design (TDD) approach. In power electronics,
the TDD can be used to address the performance of GCCs, and also provides a tool
to benchmark different implementations of current controllers in a fair way. In this
chapter, TDD will be used in order to test, validate and compare the performance of
MPC controllers for three-phase GCCs with LCL filters. TDD was carried out using
Python scripts and the Typhoon HIL platform, testing the current controllers under
different steady-state and transient conditions.
4.1 Introduction
use a continuous set control input, that is, the control input can assume any real value
between some arbitrary range. The FCS-MPC takes a different approach by limit-
ing the possible number of control input values to a finite set. In this type of MPC
algorithm, an optimal control input that belongs to the set of all possible switching
states of the power converter is computed at every sampling period, but this results
in a variable switching frequency pattern (Kouro et al. 2009; Rodriguez et al. 2013;
Vazquez et al. 2017; Karamanakos et al. 2020; Scoltock et al. 2013; Kakosimos and
Abu-Rub 2018; Alam et al. 2019; Aguilera et al. 2013; Karamanakos and Geyer
2020; Geyer 2016). The main advantage is the possibility of easily insert constraints
in the control law to achieve robust performance and stability against parametric
uncertainties and variations. However, the main drawback of the FSC-MPC is the
variable switching frequency, which can cause problems such as vibrations, elec-
trical resonances, acoustic noise and widespread harmonic content with low-order
components leading to difficulties in the design of the power filter. On the other hand,
CCS-MPC controllers have as their main characteristic the use of a PWM modulator.
The control law is obtained as a continuous signal and is modulated as a PWM signal.
As a result, this approach presents a fixed switching frequency and, consequently,
fixed harmonic content on the voltages generated by the GCC. However, it brings
difficulties when it is necessary to introduce restrictions on the control law, as, for
example, to cope with robustness specifications or saturation (Camacho and Bordons
2004; Rossiter 2005).
In the context of grid-connected applications, the GCC control system is gen-
erally implemented in a Digital Signal Processor (DSP) or a similar system. This
control system should be properly tested and validated for various operational con-
ditions (OCs), including faults in the grid, strong and weak grids, disturbances, etc.
before connecting the inverter to the grid. These conditions are usually described in
Technical Standards and Grid Codes of Power System Operators, with which com-
mercial GCCs must comply; otherwise, problems may arise in the operation of the
power system. For example, in 2016, a fire caused a major system disturbance in the
Southern California Area (Corporation 2017). During this occurrence, known as the
Blue Cut Fire, faults in the power system were detected, and the worst event was
a line-to-line fault with a phase jump and voltage sag. The phase jump caused an
abrupt phase shift in the voltages, which was erroneously interpreted by the synchro-
nization algorithms of the PV inverters as a frequency deviation from the nominal 60
Hz. The actual frequency dropped to 59.86 Hz, but the synchronization algorithms
detected 57 Hz. As a result, the PV inverters started to trip and disconnect from the
grid, causing a cascaded event where more than 2GW of solar power was lost in a
single day.
Looking back at the events of the Blue Cut Fire, would it be possible to have
prevented the loss of such a huge amount of PV power? Would the extensive test and
validation of the control systems under various operation conditions have been able
to detect such a misbehaviour of the synchronization algorithms before deploying
the inverters in the field?
Extensive testing of inverter control software and firmware in order to comply with
the Grid Codes and avoid events such as the Blue Cut Fire is generally a demanding
78 D. M. Lima et al.
process. Also, implementing all these different OCs in a real laboratory environment
can be difficult and, in some cases, dangerous. Laboratory setups for emulating grid
conditions are usually expensive and limited, in the sense that they are not able to
emulate the behaviour of various phenomena that can occur in real power systems.
A virtual automated test environment can accelerate this process, since it can safely
simulate any desired OCs, which lowers the design/redesign costs and time-to-market
of new GCC systems.
The Test-Driven Design (TDD) is a methodology from the software area that can
be adapted to many problems, including GCC test and design. The core idea of the
TDD is to verify specific functionalities of the software by performing a series of
automated tests in a software unit (a small part of the code) (Janzen and Saiedian
2005, 2008; Williams et al. 2003; Jeffries 2007). In the case of a GCC, each of its
control blocks can be subjected to various tests, following the TDD methodology,
to ascertain, for example, if grid standards are met. The TDD is also capable of
providing a fair methodology to benchmark different implementations of controllers
for GCCs. In this chapter, the TDD will be used in order to test, validate and compare
the performance of Model Predictive Controllers for three-phase GCCs with LCL
filters. The TDD was carried out using Python scripts and the Typhoon HIL platform
to test the current controllers under different steady-state and transient conditions.
The remainder of this chapter is divided as follows. The system modelling and con-
trol algorithms are presented in Sects. 4.2 and 4.3, respectively. TDD with Typhoon
HIL is presented in Sect. 4.4, and the results are shown in Sect. 4.5. Finally, conclu-
sions are given in Sect. 4.6.
PWM Signals
Transformations
Line to phase
Controller
abc to αβ
Current
ADC
DSP
| | | || | | || | | || |
ẋα Ac 0 xα Bc 0 uα Fc 0 wα
= + + (4.1)
ẋβ 0 Ac xβ 0 Bc u β 0 Fc wβ
| |T
where x j = i 1 j , vcj , i 2 j , u j and w j (with j = α, β) are, respectively, the system
states, the control inputs and the disturbances. The matrices are defined as
⎡ ⎤ ⎡ 1 ⎤ ⎡ ⎤
0 −1
L1
0 0
⎢ 1 −1 ⎥
L
Ac = ⎣ C f 0 C f ⎦ , Bc = ⎣ 0 ⎦ , Fc = ⎣ 0 ⎦ ,
1
(4.2)
1 −1
0 L2 0 0 L2
It is also important to consider a one-sample time delay in the model, since the
control action computed at k will only be applied at k + 1. This avoids issues related
to a variable delay. The model (4.3) then becomes
| | | || | | | | |
x(k + 1) AB x(k) 0 F
= + u(k) + w(k) (4.4)
u(k) 0 0 u(k − 1) I 0
The current controllers used in this chapter will be presented here, which comprise
two different Model Predictive Control (MPC) algorithms and a Proportional Reso-
nant (PR) controller. It is important to observe that, in this chapter, only the current
control loop of the GCC will be described, in order to simplify the analysis. However,
the HIL simulations also take into account other important control loops, such as the
Phase-Locked Loop (PLL) for grid synchronization.
Model Predictive Control is one of the most used advanced control techniques in the
industry (Camacho and Bordons 2004). However, MPC is not a single algorithm but a
family of algorithms that has some common basic concepts. A typical MPC algorithm
uses a model of the system to predict its future behaviour, and then computes the
control action through an optimization that is carried out at each sampling time Ts
using the information of the references, control inputs and predictions. Depending
on the type of model, optimization problem and how this problem is solved, different
MPC algorithms are defined. One essential part of MPC is its associated cost function
J , where the user can specify the tuning parameters of the algorithm. A basic cost
function for a Single-Input Single-Output (SISO) system is given below
4 Model Predictive Control for Grid-Connected Converters … 81
E
N2 E
Nu
J =δ (yref (k + i ) − y(k + i )) + λ /\u(k + i − 1), (4.6)
i=N1 i=1
where y is the output, yref is the output reference, /\u(k) = u(k) − u(k − 1) is the
control effort and N1 , N2 , Nu , δ and λ are, respectively, the initial and final prediction
horizon, the control horizon, the future error weight and control effort weight. The
prediction horizon defines the future time window to be considered in the control
problem, the control horizon determines when the controller can act in the future
time window and the weights are adjusted to make the controller prioritize one of
the terms of the cost function in relation to the others, where a higher value for a
given weight means higher importance. The user can change the tuning parameters
to achieve the desired closed-loop response. The first term of (4.6) is the predicted
future reference tracking error and the second one the control effort. By choosing
the weights adequately, the user can prioritize the reference tracking or the dynamic
response of the controller. A relative low value of λ will produce a faster closed-
loop response. It is worth noting, however, that (4.6) is just an example; different
MPC algorithms can use different cost functions that have more (or less) terms with
different purposes.
The MPC algorithms obtain the control action to be applied in the process through
the minimization of J while taking into account process constraints, such as the max-
imum voltage that can be synthesized. For more detailed information, see Camacho
and Bordons (2004). The MPC algorithms used in this chapter are presented below.
As explained before, the FCS-MPC limits the possible number of control input values
to a finite set. This characteristic is useful to directly control the switching states of an
inverter, that is, without any modulation (Karamanakos et al. 2020; Karamanakos and
Geyer 2020; Geyer 2016). Hence, the finite number of possible control actions are
the allowed switching vectors of the inverter. In the case of the three-phase two-level
inverter in Fig. 4.1, there are 7 distinct control input vectors available, which are given
by the pairs (u α j , u β j ), with j = 1, . . . , 7. Assuming, this constraint on the control
inputs, that the prediction horizon is N1 = N2 = N > 1 (due to the implementation
delay), and that the control action u j (k) is kept constant within this horizon (Nu = 1),
the prediction at k + N is given by
N
x̄ j (k + N ) = Ā x̄ j (k) + B p u j (k) + F p W p , (4.7)
y j (k + N ) = C̄ x̄ j (k + N ). (4.9)
With the predicted output given by the previous equation, it is possible to compute
the future tracking error
e j (k + N ) = yref (k + N ) − y j (k + N ), (4.10)
|| || /\ || ||
||e j (k + N )||2 = ||yref (k + N ) − y j (k + N )||2
M M
/\ || ||2
= ||yref (k + N ) − f − C̄B p u j (k)||M (4.11)
Then, the optimal control input to be applied is the one which generates the lowest
norm of the error according to (4.11).
The choice of the tuning parameters N and M will depend on the system and
control specifications. For the case of power regulation using GCCs with LCL filters,
the controlled variables are usually the grid-side currents, but since this requires a
model with a higher dimension, a longer prediction horizon is needed, which, in turn,
increases the computational burden and stability problems associated with model
uncertainties and disturbance estimation (Panten et al. 2016).
To avoid this issue, a simplified model will be used where the LCL filter is approx-
imated by an L-filter. In this case, the converter-side currents are the states and the
capacitor voltages are considered as disturbances.
4 Model Predictive Control for Grid-Connected Converters … 83
Applying this to model (4.1) results in the following simplified system matrices:
| | | | | |
10 10 −1 1 0
Ac = −1L1
, Bc = 1
L1 0 1
, Fc = L1
(4.12)
01 01
where the states are given by xα = i 1α and xβ = i 1β , u α and u β are the control inputs,
and wα = vcα and wβ = vcβ are the disturbances. The tuning parameters are chosen
as N = 2 and M = I.
The FCS-MPC algorithm can be summarized in the following steps, given the
tuning parameters N and M, at each sampling k:
(1) obtain the disturbance prediction vector W p ;
(2) obtain the reference vector yref (k + N );
(3) for each possible control input vector j, compute the cost function (4.11) using
(4.7);
(4) At k + 1, implement the control input vector j that results in the lowest value
for the cost function (4.11).
The Space Vector Modulated Model Predictive Control (SVM2 PC), first proposed
in Osorio et al. (2021), differently from the FCS-MPC, combines control and space-
vector modulation (SVM) in a single optimization problem. As discussed previously,
the FCS-MPC algorithm computes the value of the cost function for all possible
switching states and then applies the control action that results in the lowest cost
function value, which is constant inside a sampling period.
The SVM2 PC uses an approach where the duty cycles of each possible sector
are included in the optimization problem, thus, an optimal switching sequence is
obtained.
This approach solves some issues of the FCS-MPC, such as variable switching
frequency.
With SVM2 PC, an SVM is used to define the switching states of each inverter
} Thus, the control input vector belongs to a finite u : R →
2
semiconductor
{ 0 1 switch.
O = v , v , . . . , v , which is implemented within a sample period following a
7
V j = { v j0 , v j1 , v j2 , v j1 , v j0 }, (4.13)
~~`` ~~`` ~~`` ~~`` ~~``
0.5d j0 0.5d j1 d j2 0.5d j1 0.5d j0
where (v j0 , v j1 , v j2 ) is the set of the three nearest voltage vectors that comprise a
given sector S j in the space vector, with j = 1, . . . , 6. The switching sequence with
five vectors (4.13) is shown in Fig. 4.2, along with the evolution of the states within
a sampling time Ts . With each switching vector v ji , there is an associated duty cycle
d ji , in a way that
84 D. M. Lima et al.
E
2
d ji = 1, with d ji > 0. (4.14)
i=0
Assuming that the GCC depicted in Fig. 4.1 is a two-level converter, and that the
control input u(k) is implemented using the switching sequence (4.13), the system
model (4.5) can be approximated using the average voltage vector being synthesized,
resulting in
Now, the output and error vectors are defined as in (4.9) and (4.10), respectively,
with the same considerations. Replacing (4.16) and (4.9) into (4.10), the error vector,
after some manipulations, can be written as
/\
e j (k + N ) = d j1 h j1 + d j2 h j2 + h3 , (4.18)
4 Model Predictive Control for Grid-Connected Converters … 85
with
h j1 = −C̄ B p v j1 (k)
h j2 = −C̄ B p v j2 (k) (4.19)
N −1
h3 = yref (k + N ) − C̄ Ā x j (k) − C̄ F p W p .
where
| |
H j = h j1 h j2 (4.21)
and the diagonal positive definite matrix M represents the output weighting param-
eters of the optimization problem.
The objective of the SVM2 PC algorithm is to find the sector S j and duty cycle
vector d j (k) which minimizes the cost function (4.20) under the constraints given
in (4.14), i.e. the optimal values for the proposed optimization problem. As shown
in Osorio et al. (2021), it is possible to write this problem as a constrained convex
optimization which has a global optimal solution.
Also note that it is possible to choose different prediction horizons and output
vectors.
Following the same reasoning presented in Sect. 4.3.1.1, the SVM2 PC algorithm
will be used to control the converter-side current with N = 2 and M = I. Given that
h j1 and h j2 can be computed off-line for each sector S j by using (4.19), as explained
in Osorio et al. (2021), the SVM2 PC algorithm has the following steps (Osorio et al.
2021) at each sampling time k:
(1) obtain the disturbance prediction vector W p ;
(2) obtain the reference vector yref (k + N );
(3) compute the value of h3 in (4.19);
(4) for each sector S j :
• compute the duty cycles d j1 and d j2 using (4.22):
• if d j1 + d j2 ≥ 1, compute (4.24) with A0 and b0 from (4.23);
• if d j1 ≤ 0, compute (4.24) with A1 and b1 from (4.23);
• if d j2 ≤ 0, compute (4.24) with A2 and b2 from (4.23);
(5) compute d j0 = 1 − d j1 − d j2 ;
• if d ji > 1, set d ji = 1 and the other two duty cycles equal to zero;
(6) compute the cost function (4.20) for each sector S j ;
(7) select the optimal duty cycles d∗ and sector S ∗ which results in the lowest value
for cost function (4.20);
86 D. M. Lima et al.
(8) at k + 1, implement the control input vector through the symmetrical sequence
in (4.13), the three switching vectors of sector S ∗ and duty cycles d∗ .
( )−1
d j = − H j T M H j H j T Mh3 . (4.22)
⎧ | |
⎨ A0 = | 1 1 ,| b0 = −1
A1 = | −1 0 | , b1 = 0 (4.23)
⎩
A2 = 0 −1 , b2 = 0
| | | T |−1 | T |
dj H j M H j 0.5AiT H j Mh3
=− . (4.24)
μi Ai 0 bi
The Proportional Resonant (PR) current controller has been widely applied to GCCs
(Teodorescu et al. 2006, 2011). In its classical form, the control system assumes the
structure presented in Fig. 4.3, which is a state-feedback approach with additional
resonant states.
The PR has a very large gain at a specific frequency, allowing reference tracking
and disturbances rejection at this frequency. The damped (non-infinite gain) discrete
resonant controller used here has the following difference equation:
where the subscript i indicates the resonant controller for some output i, yref,i is the
desired reference for the output yi , ξi is the resonant controller state and a, for each
angular frequency ω, depends on the damping ratio ζ , that is
ωζ
a=/ .
1 − ζ2
| | | || | | |
ξi (k + 1) 0 1 ξi (k) 0
= + (yref,i (k) − yi (k))
ξi (k + 2) −e−2aTs 2e−aTs cos(ωTs ) ξi (k + 1) 1
(4.26)
or, in a compact form, with i = α, β,
In this chapter, the PR will be used to control the grid-side currents, thus, there will
be one resonant controller at the fundamental frequency for each grid-side current
(i gα and i gβ ). As a result, it will be called here a single resonant controller. It is
worth mentioning that it is possible to add more resonant frequencies to improve,
for example, harmonic rejection, but this is not performed in this chapter. For more
information, please refer to Teodorescu et al. (2006, 2011).
Combining the resonant controllers for both αβ coordinates, we have
Aiming to systematize the controller design, let us join the controller and the plant
states into a single vector. Therefore, the state-space representation of the combined
system becomes
⎧| | | || | | | | | | |
⎪
⎪ x̄(k + 1) Ā 0 x̄(k) B̄ 0 F̄
⎨ = + u(k) + y + w(k),
ξ (k + 1) | −T C̄
| Rξ ξ (k) 0 T ref
0
⎪ | | x̄(k)
⎪
⎩ y(k) = C̄ 0
ξ (k)
(4.29)
where C̄ is adequately chosen so that y is equal to the grid-currents, as defined in
(4.28).
The next step is to find the state feedback gains Kξ and Kx̄ . In this chapter, the
Discrete Linear Quadratic Regulator (DLQR), which is an optimal control design
method, will be used with (4.29) to obtain the feedback gains. The use of the DLQR
will result in the feedback control law shown below
88 D. M. Lima et al.
| | | |
x̄(k) | | x̄(k)
u(k) = −KLQR = − Kx̄ , Kξ . (4.30)
ξ (k) ξ (k).
Also, to avoid issues with the windup of the resonant states, an anti-windup technique
will be used with gain KAW , as shown in Fig. 4.3.
For this controller, the tuning parameters are
| |
100I8 0
Qx = , Qu = I2 , KAW = 0.8I2 , (4.31)
0 0.001I4
where I j is an identity matrix with dimension j, and Qx and Qu are diagonal matrices
used to weight the states and the inputs in the DLQR algorithm.
These controllers, as well as the three-phase two-level GCC with LCL filter, will
be implemented in the Typhoon HIL platform in order to verify and compare their
performances for different grid conditions.
End
Pass
Software Unit /
Start Test Test Result:
DUT
Failed
Refactoring
Fig. 4.4 Basic TDD flowchart. Figure adapted from Magnago et al. (2019)
4 Model Predictive Control for Grid-Connected Converters … 89
test fails, the application goes through a redesign stage to fix the issues, being tested
until it passes in all tests (Jeffries 2007).
As a result, the TDD is a powerful tool that can also be applied for testing,
developing and validating controllers for GCCs; for example, in this chapter, the
MPC current controller is the DUT considered for the TDD. The inverter topology
and the grid-side filter are chosen by the designer, according to the application. As
an example, let us consider here the three-phase two-level GCC with LCL filter,
as described in Sect. 4.2, where either the grid-side or inverter-side currents can be
controlled. In this case, there are also measurements of the voltages of the capacitors
of the LCL filter and the line-to-line voltages. The performance evaluation of the
designed MPC current controller can consider different operational conditions (OCs),
where the grid characteristics, current references and other parameters are varied.
Many other characteristics can be included in the OCs, such as different types of
faults, voltage harmonics, changes in the grid impedance, grid frequency variations,
voltage disturbances and many others (Teodorescu et al. 2007).
Finally, performance indexes are defined prior to the execution of the tests, so as
to quantitatively evaluate the obtained results.
Using Typhoon HIL, the TDD can be implemented as automated test scripts
written in Python, using the Typhoon Test IDE platform. The inverter, LCL filter,
utility grid, sensors, and the other elements of the power stage are modelled with
high-fidelity in the Schematic Editor and emulated in real-time using a Typhoon HIL
simulator. The controller is implemented either in a C block in the Schematic Editor,
or externally by means of a DSP. In this chapter, the MPC current controllers will
be implemented in a C block. The schematic is then compiled, the automated test
scripts in Python are run in the Typhoon Test IDE environment. Once the set of tests
are complete, the results are presented in the Allure platform and as an automatically
generated PDF report that contains the test parameters, OCs, results and performance
indexes. In the beginning of the report, a summary of the test results is presented that
provides a straightforward evaluation of the overall controller performance. Also,
more detailed results for each test are presented in specific tables and plots. In Fig.
4.5, a table is presented where the settling times (performance index) for the SVM2 PC
described in Sect. 4.3.1.2 are shown; a more detailed description of the TDD for the
controllers presented in Sect. 4.3 will be shown in the next section. With the TDD, it is
possible to compare the performance of different controllers for various OCs, where
the green and red cells in the tables indicate whether the performance requirements
were met or not, respectively, by the current controller.
Steady-state and transient performance indexes are used to evaluate the current
controllers. The steady-state ones are computed from the grid-side currents over one
cycle of the fundamental frequency of the grid voltages, and are
1. THD(%): Average of the total harmonic distortion of the grid-side currents of
each phase;
2. E N 2 ( A): Average current tracking error calculated as the 2-norm of the grid
current vector in αβ coordinates;
90 D. M. Lima et al.
Fig. 4.5 SVM2 PC: colour-graded table showing the settling time (performance index) for different
grid faults
3. E N 2max (A): Maximum current tracking error, calculated as the maximum value
of the 2-norm of the current vector in the αβ coordinates;
4. Current harmonics: Peak value of the grid-side current harmonics as a percentage
of the amplitude of the fundamental component.
The transient indexes are calculated for both the grid-side and inverter-side cur-
rents considering their responses against faults in the grid:
1. tset (s): Time interval from the beginning of the fault until the instant when the
current tracking error is lower than a predefined value;
2. i g M (A): Maximum Root-Mean Square (RMS) value of the grid-side currents,
calculated by means of a half-cycle fundamental moving average for each grid-
side current;
3. i cM (A): Maximum peak of the inverter-side currents.
For example, Fig. 4.6 shows the time-domain waveforms for a test that failed,
that is, a Type C Fault with 0.55∠−90◦ for the SVM2 PC. From top to bottom, the
waveforms displayed are the grid phase voltages, inverter-side currents, RMS value
4 Model Predictive Control for Grid-Connected Converters … 91
Fig. 4.6 SVM2 PC: time-domain plots for Type C Fault with 0.55∠−90◦ . a Complete plot; b
Transient response plot
92 D. M. Lima et al.
of the grid-side currents and the norm of current tracking error in the αβ coordinates.
Figure 4.6a presents the complete capture time, while Fig. 4.6b gives a zoom over
the transient response. The system is also tested under weak grid conditions, defined
from the short-circuit ratio, which then defines the Thevenin equivalent impedance at
the PCC. The inverter-side current reference is gradually increased and the THDs of
the grid-side currents and voltages are calculated. Values of THDs above a predefined
threshold limit are detected and reported, indicating a possible instability.
The current controller behaviour is characterized using the performance indexes
listed before for the following OCs: Faults on the grid of the types A (symmetrical
three-phase), B (asymmetrical phase-ground), C (asymmetrical phase-phase) and E
(asymmetrical phase-phase-ground), as well as harmonics on the grid voltage and
stability under weak grid. The user can select the exact conditions for each test, for
example, type of fault (and its magnitude and phase), the amplitude and phase of
grid harmonics, current reference increments and maximum value.
A detailed description of the TDD, as well as example projects and files, can be
found at https://hil.academy/courses/digital-control-of-grid-tied-converters/.
In the next section, the current controllers described in Sect. 4.3 will be simulated
using Typhoon HIL and, after that, the TDD approach described in this section will
be used to benchmark the performance of these current controllers.
First, the performance response of the FCS-MPC controller under strong and weak
grid conditions, respectively, are shown in Figs. 4.7 and 4.8. In these figures, a step
in the current reference from 0A to the nominal current of 214A is applied. For the
4 Model Predictive Control for Grid-Connected Converters … 93
Fig. 4.7 Transient performance of the FCS-MPC algorithm under strong grid conditions
Fig. 4.8 Transient performance of the FCS-MPC algorithm under weak grid conditions
Fig. 4.9 Transient performance of the SVM2 PC algorithm under strong grid conditions
one vector is applied in each sampling period Ts , while the SVM2 PC implements a
switching sequence.
Finally, the performance of the single resonant controller is presented in
Figs. 4.11 and 4.12 for strong and weak grid conditions, respectively. The results
reveal the convergence to the new current reference with a slower transient response
when compared to the SVM2 PC and FCS-MPC controllers.
4 Model Predictive Control for Grid-Connected Converters … 95
Fig. 4.10 Transient performance of the SVM2 PC algorithm under weak grid conditions
Fig. 4.11 Transient performance of the single resonant controller under strong grid conditions
Now, let us analyse the harmonic rejection performance of each controller in the
presence of 5% of 5th order harmonic, 3% of 7th order harmonic and 1% of 11th order
harmonic in the grid voltages. First, the performance of the FCS-MPC, for both weak
and strong grids, respectively, is shown in Figs. 4.13 and 4.14. It is possible to see
96 D. M. Lima et al.
Fig. 4.12 Transient performance of the single resonant controller under weak grid conditions
that the grid voltage harmonics are reproduced in the grid currents, especially under
weak grid conditions. This can be attributed to the fact that the FCS-MPC needs an
adequate estimation of the disturbances, i.e. the voltages across the filter capacitors,
in order to operate properly. In this implementation, this estimation is obtained simply
by the rotation of the positive sequence component of the filter voltages. In this sense,
the performance of the FCS-MPC with distorted grid conditions could be improved
by using a better method for the estimation of the disturbances.
In the same way, the results for the SVM2 PC under weak and strong grid condi-
tions, respectively, are presented in Figs. 4.15 and 4.16. Similar to the FCS-MPC, it
can be noted that the grid voltage harmonics are also reproduced in the grid currents,
especially under weak grid conditions. The same remarks concerning the improve-
ment of the disturbance estimation for the FCS-MPC can be made for the SVM2 PC;
the only difference is that the disturbances now are the grid voltages.
Finally, the harmonic rejection performance of the resonant controller under weak
grid conditions is shown in Fig. 4.17, and under strong grid conditions in Fig. 4.18.
These results show a similar performance to the other compared techniques, but with
less distortion for the currents under a weak grid. The harmonic rejection performance
of the resonant controller can be improved by the addition of multiple resonant
controllers tuned to the harmonic components that should be rejected.
4 Model Predictive Control for Grid-Connected Converters … 97
Fig. 4.13 Harmonic rejection performance of the FCS-MPC algorithm under weak grid conditions
Fig. 4.14 Harmonic rejection performance of the FCS-MPC algorithm under strong grid conditions
98 D. M. Lima et al.
Fig. 4.15 Harmonic rejection performance of the SVM2 PC algorithm under weak grid conditions
Fig. 4.16 Harmonic rejection performance of the SVM2 PC algorithm under strong grid conditions
4 Model Predictive Control for Grid-Connected Converters … 99
Fig. 4.17 Harmonic rejection performance of the single resonant controller under weak grid con-
ditions
Fig. 4.18 Harmonic rejection performance of the single resonant controller under strong grid
conditions
100 D. M. Lima et al.
Finally, in order to benchmark and fairly compare the performances of the three
current controllers described in Sect. 4.3 and simulated in VHIL in the above sub-
sections, let us now run the TDD for each controller independently. It is important to
mention that, in this chapter, the purpose of the TDD is not to prove that a given cur-
rent controller is better than the other, but solely to show how different controllers can
be compared in a fair way, allowing the designer to analyse the results and redesign
the controller appropriately, so as to obtain the desired performance.
The tests for the TDD, OCs and parameters are the same as the ones described in
Sect. 4.4. The grid faults and harmonic tests are performed with a strong grid, while
the stability test is carried out with a weak grid and volt-var support. In total, 51 tests
were run, and some of the results will be presented and discussed here. In Fig. 4.19,
from top to bottom, the overview of the TDD results for FCS-MPC, SVM2 PC and sin-
gle resonant controller, respectively, are shown as presented in the Allure platform. It
can be seen that the SVM2 PC and the single resonant controller have passed the same
number of tests, although, as will be discussed in the following, the tests in which the
controllers passed and failed are different, as well as their individual performances.
The FCS-MPC, due to its simple implementation, has a degraded performance when
compared to the SVM2 PC and the single resonant current controllers.
To complement the Allure results, a PDF report is also automatically generated.
In the report, initially, a table summarizing the test results is presented for the fault
conditions on the grid. As described in Sect. 4.4, the tests are divided into Steady
State and Transient, and are evaluated for four different types of faults in the grid. The
test summaries for the FCS-MPC, SVM2 PC and single resonant current controllers,
respectively, are shown in Figs. 4.21, 4.20 and 4.22. The metrics shown in the table
are the ones enumerated in Sect. 4.4, and the thresholds used for the TDD were
chosen as (these values can be modified by the users to suit their design needs)
1. THD(%): Average value of the THD of the grid-side currents of the three phases.
Max = 2.0%.
2. E N 2 ( A): Average current tracking error, represented as the 2-norm of αβ current
vector. Max = 3.5 A.
3. E N 2max (A): Maximum current tracking error, represented as the maximum value
of the 2-norm of the αβ current vector. Max = 8.0 A.
4. tset (s): Settling time of the current tracking error. Max = 10.0 ms.
5. i g M (A): Maximum RMS value of the grid-side current of the three phases. Max
= 250 A.
6. i cM (A): Maximum RMS value of the converter-side current of the three phases.
Max = 355 A.
The THD and stability test summaries are shown in Figs. 4.24, 4.23 and 4.25 for
the performance of the FCS-MPC, SVM2 PC and single resonant current controllers,
respectively. As a result, it can be noted that Figs. 4.21, 4.20, 4.22, 4.24, 4.23 and 4.25
present an overview of the performances of the controllers. If the designer wishes
4 Model Predictive Control for Grid-Connected Converters … 101
Fig. 4.20 Test summary of grid fault conditions for the FCS-MPC current controller
Fig. 4.21 Test summary of grid fault conditions for the SVM2 PC current controller
Fig. 4.22 Test summary of grid fault conditions for the single resonant current controller
4 Model Predictive Control for Grid-Connected Converters … 103
Fig. 4.23 Test summary of THD and stability tests for the FCS-MPC current controller
Fig. 4.24 Test summary of THD and stability tests for the SVM2 PC current controller
Fig. 4.25 Test summary of THD and stability tests for the single resonant current controller
or needs to have a more detailed analysis of the behaviour of the controller for a
specific test, this information can be accessed either in Allure or in the PDF report.
However, by analysing Figs. 4.21, 4.20, 4.22, 4.24, 4.23 and 4.25, some conclusions
can already be drawn.
First, regarding the fault conditions on the grid, we can see that the FCS-MPC
fails in all tests, while the SVM2 PC passes in all THD tests, but fails the current
error tests and, finally, the single resonant controller passes all the steady-state tests.
104 D. M. Lima et al.
The poor performance of the FCS-MPC derives from the fact that only one voltage
vector is implemented in a sampling period Ts , and the controlled variable is the
converter-side current. It must be stressed that a compensation of the reactive power
of the LCL filter capacitors was included in the FCS-MPC algorithm, in order to
provide adequate references for the converter-side currents. To further improve its
performance, a modified FCS-MPC with reduction of the tracking error could be
implemented in order to provide better current tracking capability, the converter-side
inductors of the LCL filter could be increased, the switching frequency could also
be increased or the grid-side currents could be controlled. The SVM2 PC, on the
other hand, needs an adequate estimation of the disturbances, i.e. the grid voltages,
in order to operate properly. Since, in this example, this estimation is obtained by the
rotation of the positive sequence component of the grid voltages, not considering the
negative sequence, the unbalances are not properly addressed. This could be solved
by improving the estimation of the disturbance. Lastly, the improved behaviour of the
resonant controller is due to the fact that, as described in Sect. 4.3, it is implemented
as two decoupled controllers, one for the α and one for the β axis. As a result, for
asymmetrical faults, the controller has a better performance, as it is able to deal with
the unbalanced phase voltages.
Now, considering the THD, the FCS-MPC does not comply with a high number
of harmonic components due to the higher current ripple and tracking error when
compared to the SVM2 PC and the single resonant controller. In these tests, the
SVM2 PC has a better performance than the other controllers. The single resonant
controller was tuned to track only the fundamental component of the current; a
multiple resonant controller, designed to reject specific harmonics, would yield a
better performance. Finally, the stability tests for weak grid conditions demonstrate
that the FCS-MPC presents an indication of instability for some values of the current
reference. This may be attributed to the fact that the converter-side current reference
depends on the voltages of the filter capacitors, in order to compensate for its reactive
currents at the fundamental frequency. On the other hand, the SVM2 PC and the single
resonant controller are stable under weak grid conditions.
Let us now take a look at some specific test results, in order to further analyse
the performance of the three current controllers. As an example, consider a type A
fault with 0.55∠−90◦ , where the FCS-MPC failed in all tests but the i g M (A) and
i cM (A) ones, the SVM2 PC passed in all the tests, and the single resonant controller
failed in the i cM (A) and the settling time. The grid phase voltages for the considered
fault condition are shown in Fig. 4.26. The complete responses of the FCS-MPC can
be seen in the TDD results presented in Figs. 4.27, 4.28 and 4.29. The waveforms
displayed in Figs. 4.27 and 4.29, are, from top to bottom, the grid phase voltages,
inverter-side currents, RMS value of the grid-side currents and the norm of current
tracking error in the αβ coordinates. As presented in Fig. 4.20, the FCS-MPC has a
poor performance for fault conditions, and this can be seen in the TDD waveforms.
The currents injected in the grid have large ripples, as depicted in Fig. 4.28, having a
negative impact both on the THD and the current tracking error. From Fig. 4.28, we
can see that the dynamic response of the FCS-MPC controller is quite fast; however,
the calculated settling time was equal to 296.96 ms, making the controller fail the
4 Model Predictive Control for Grid-Connected Converters … 105
Fig. 4.26 Grid phase voltages for a type A fault with 0.55∠−90◦
test. This discrepancy is due to the fact that the currents of the FCS-MPC have a
high ripple, and the Python script thus interprets that the controller has not reached
a steady state in the predefined time window used to calculate the settling time. The
norm of the tracking error (the blue curve), shown in Fig. 4.29, lies outside of the
defined threshold, represented by the red curve; this behaviour again can be explained
as a result of the current ripple. On the other hand, the maximum values of i g M (A)
and i cM (A) are within the predefined limits. As previously mentioned, these results
could be improved by modifying the FCS-MPC in order to include a compensation
for the tracking error to provide better current tracking, controlling the grid-side
currents or increasing either the converter-side inductor or the switching frequency.
For example, Fig. 4.30 shows the norm of the current tracking error for a case where
the converter-side inductor was increased from 500 µH to 1500 µH. We can see that
the error has significantly decreased, but at the expense of a large inductance. The
metrics for the FCS-MPC were computed as (these values were extracted from the
detailed tables presented in the PDF report)
1. THD: 5.23%
2. E N : 11.67 A
3. E N 2max : 28.16 A
4. tset : 296.96 ms
5. i g M : 156.66 A
6. i cM : 243.3 A.
The second controller that was tested was the SVM2 PC controller. A zoom of
the transient response and the steady-state current tracking error, respectively, are
presented in Figs. 4.31, 4.32 and 4.33. The same waveforms described for the FCS-
MPC are shown. Especially in Fig. 4.33, it can be seen that the norm of the current
106 D. M. Lima et al.
Fig. 4.27 Complete transient response of the FCS-MPC current controller for a type A fault with
0.55∠−90◦
Fig. 4.28 Zoom of the transient response of the FCS-MPC current controller for a type A fault
with 0.55∠−90◦
4 Model Predictive Control for Grid-Connected Converters … 107
Fig. 4.29 Norm of the current tracking error of the FCS-MPC current controller for a type A fault
with 0.55∠−90◦
Fig. 4.30 Norm of the current tracking error of the FCS-MPC current controller for a type A fault
with 0.55∠−90◦ and with an increased converter-side inductor
108 D. M. Lima et al.
Fig. 4.31 Complete transient response of the SVM2 PC current controller for a type A fault with
0.55∠−90◦
tracking error, i.e. the blue curve, lies within the defined maximum threshold in red.
In quantitative terms, we have
1. THD: 0.21%
2. E N : 1.23 A
3. E N 2max : 1.59 A
4. tset : 4.33 ms
5. i g M : 159.54
6. i cM : 252.92 A.
Finally, the TDD results for the single resonant controller can be seen in
Figs. 4.34, 4.35 and 4.36, in which the same waveforms described for the FCS-
MPC are shown. For these conditions, the single resonant controller presents a good
harmonic performance, as well as low current tracking error; this can be seen by the
good quality of the grid-side currents of Fig. i cM (A), as well as by the norm of the
current tracking error (blue curve) lying inside the defined threshold (red curve) in
Fig. 4.36. However, the controller presents a slower dynamic response when com-
pared to the SVM2 PC, which is expected. This can be quantified in the larger value
of the settling time for the single resonant controller. The performance indexes for
the single resonant current controller are
1. THD: 0.5%
2. E N : 0.98 A
3. E N 2max : 2.36 A
4 Model Predictive Control for Grid-Connected Converters … 109
Fig. 4.32 Zoom of the transient response of the SVM2 PC current controller for a type A fault with
0.55∠−90◦
Fig. 4.33 Norm of the current tracking error of the SVM2 PC current controller for a type A fault
with 0.55∠−90◦
110 D. M. Lima et al.
Fig. 4.34 Complete transient response of the single resonant current controller for a type A fault
with 0.55∠−90◦
Fig. 4.35 Zoom of the transient response of the single resonant current controller for a type A fault
with 0.55∠−90◦
4. tset : 40.23 ms
5. i g M : 165.66 A
6. i cM : 326.16 A.
4 Model Predictive Control for Grid-Connected Converters … 111
Fig. 4.36 Norm of the current tracking error of the single resonant current controller for a type A
fault with 0.55∠−90◦
Finally, let us compare the performance of the three current controllers with respect
to the harmonic content in steady state. The goal of this test is to demonstrate the
capability of the current controller under test to reject disturbances resulting from
harmonics in the grid voltage. The tests are carried out with a strong grid and with the
reference equal to the nominal value of the current. The tables with the odd harmonic
content for, respectively, the FCS-MPC, SVM2 PC and the single resonant current
controllers are presented in Fig. 4.37a, b and c. In the tables, the lines indicate the
amplitude and phase of the grid background voltage harmonics, while the columns
represent the order of the grid current harmonics. The FCS-MPC has some high-
order harmonic components due to the high current ripple and tracking error, but
has a better performance than the resonant controller when the low-order harmonics
are considered. It can be seen that the SVM2 PC has the best harmonic performance.
The single resonant controller, as the name indicates, was designed to track only the
fundamental component of the current; this performance could be improved by using
a multiple resonant controller designed to reject specific harmonic components.
4.6 Conclusions
(a) FCS-MPC
(b) SVM2PC
Fig. 4.37 Amplitude of the odd grid-side current harmonic normalized with respect to the funda-
mental (%): a SVM2 PC, b FCS-MPC and c Single resonant current controller
the behaviour of the inverter with the current controller can be rapidly and safely
assessed, showing the user if a redesign is necessary or not. The TDD also allows an
easy and fair comparison among different current controllers.
In this chapter, the TDD was applied to three different controllers: the SVM2 PC,
a FCS-MPC and a single resonant controller. The SVM2 PC has shown superior per-
formance under balanced faults at the grid side. However, under unbalanced faults
at the grid side, the performance of the SVM2 PC can be improved with a better pre-
diction of the disturbances. The performance of the FCS-MPC could be improved
by (i) using a modified FCS-MPC with better steady-state estimation, (ii) increasing
4 Model Predictive Control for Grid-Connected Converters … 113
the converter-side inductor of the LCL filter or the switching frequency or (iii) con-
trolling the grid-side currents. Finally, the TDD also indicates that the performance
of the single resonant controller could be improved by using a multiple resonant
controller, designed to reject specific harmonics.
The framework presented in this chapter, using Typhoon HIL for the TDD imple-
mented as automated tests written in Python, can be readily extended to other con-
trollers applied to grid-connected converters and also to other applications in power
electronics. This indicates a great potential for improvement in the product devel-
opment stage, increasing safety and reliability, and reducing cost and time, while
keeping high standards in the control systems validation.
Acknowledgements The authors would like to thank Typhoon HIL, especially their engineers
Henrique Magnago and Tiarles Guterres, who were responsible for the implementation of the auto-
mated Python scripts for the TDD, and UFSM-PPGEE for the support required to obtain the results
presented in this chapter. This study was financed in part by the Coordenação de Aperfeiçoamento
de Pessoal de Nível Superior - Brasil (CAPES), and by the Conselho Nacional de Desenvolvimento
Científico e Tecnológico - Brasil (CNPq).
References
Aguilera RP, Lezana P, Quevedo DE (2013) Finite-control-set model predictive control with
improved steady-state performance. IEEE Trans Indust Inf 9(2):658. https://doi.org/10.1109/
TII.2012.2211027
Alam KS, Akter MP, Xiao D, Zhang D, Rahman MF (2019) Asymptotically stable predictive control
of grid-connected converter based on discrete space vector modulation. IEEE Trans Indust Inf
15(5):2775. https://doi.org/10.1109/TII.2018.2876274
Blaabjerg F, Teodorescu R, Liserre M, Timbus A (2006) Overview of control and grid synchroniza-
tion for distributed power generation systems. IEEE Trans Indust Electron 53(5):1398
Camacho E, Bordons C (2004) Model predictive control. Springer, Berlin
Dannehl J, Fuchs F, Hansen S, Thøgersen P (2010) Investigation of active damping approaches for
PI-based current control of grid-connected pulse width modulation converters with LCL filters.
IEEE Trans Indust Appl 46(4):1509. https://doi.org/10.1109/TIA.2010.2049974
Falkowski P, Sikorski A (2018a) Finite control set model predictive control for grid-connected AC-
DC converters with LCL filter. IEEE Trans Indust Electron 65(4):2844. https://doi.org/10.1109/
TIE.2017.2750627
Falkowski P, Sikorski A (2018b) Comparative analysis of finite control set model predictive control
methods for grid-connected AC-DC converters with LCL filter. In: Proceedings of the IEEE 27th
international symposium industrial electronics (ISIE), pp 193–200. https://doi.org/10.1109/ISIE.
2018.8433673
Ferreira SC, Gonzatti RB, Pereira RR, da Silva CH, da Silva LB, Lambert-Torres G (2018) Finite
control set model predictive control for dynamic reactive power compensation with hybrid active
power filters. IEEE Trans Indust Electron 65(3):2608
Geyer T (2016) Model predictive control of high power converters and industrial drives. Wiley
Guerrero J, Blaabjerg F, Zhelev T, Hemmes K, Monmasson E, Jemei S, Comech M, Granadino R,
Frau J (2010) Distributed generation: toward a new energy paradigm. Indust Electron Mag IEEE
4(1):52. https://doi.org/10.1109/MIE.2010.935862
IEEE (2011) IEEE:1547 standard for interconnecting distributed resources with electric power
systems
114 D. M. Lima et al.
Janzen D, Saiedian H (2005) Test-driven development concepts, taxonomy, and future direction.
Computer 38(9):43. https://doi.org/10.1109/MC.2005.314
Janzen D, Saiedian H (2008) Does test-driven development really improve software design quality?
Softw IEEE 25:77. https://doi.org/10.1109/MS.2008.34
Jeffries R, Melnik G (2007) Guest editors’ introduction: Tdd-the art of fearless programming. Softw,
IEEE 24:24. https://doi.org/10.1109/MS.2007.75
Kakosimos P, Abu-Rub H (2018) Predictive control of a grid-tied cascaded full-bridge NPC
inverter for reducing high-frequency common-mode voltage components. IEEE Trans Indust
Inf 14(6):2385. https://doi.org/10.1109/TII.2017.2768585
Karamanakos P, Geyer T (2020) Guidelines for the design of finite control set model predictive con-
trollers. IEEE Trans Power Electron 35(7):7434. https://doi.org/10.1109/TPEL.2019.2954357
Karamanakos P, Liegmann E, Geyer T, Kennel R (2020) Model predictive control of power electronic
systems: methods, results, and challenges. IEEE Open J Ind Appl 1:95. https://doi.org/10.1109/
OJIA.2020.3020184
Kouro S, Cortes P, Vargas R, Ammann U, Rodriguez J (2009) Model predictive control-a simple and
powerful method to control power converters. IEEE Trans Indust Electron 56(6):1826. https://
doi.org/10.1109/TIE.2008.2008349
Kumar S, Bansal SK (2013) Comparative study of test driven development with traditional tech-
niques
Lekouaghet B, Boukabou A, Lourci N, Bedrine K (2018) Control of PV grid connected systems
using mpc technique and different inverter configuration models. Electric Power Syst Res 154:287
Magnago H, Guterres T, Carnielutti F, Massing J, Vieira R, Pinheiro H (2019) A test driven design
approach to benchmark current controllers for grid-tied inverters. In: 2019 20th workshop on con-
trol and modeling for power electronics (COMPEL), pp 1–8. https://doi.org/10.1109/COMPEL.
2019.8769672
NAER Corporation (2017) 1,200 MW fault induced solar photovoltaic resource interruption distur-
bance report
Nauman M, Hasan A (2016) Efficient implicit model-predictive control of a three-phase inverter
with an output LC filter. IEEE Trans Power Electron 31(9):6075. https://doi.org/10.1109/TPEL.
2016.2535263
Osório CRD, Schuetz DA, Koch GG, Carnielutti F, Lima DM Jr, LAM, Montagner VF, Pinheiro
H, (2021) Modulated model predictive control applied to lcl-filtered grid-tied inverters: a con-
vex optimization approach. IEEE Open J Ind Appl 2:366. https://doi.org/10.1109/OJIA.2021.
3134585
Panten N, Hoffmann N, Fuchs FW (2016) Finite control set model predictive current control for grid-
connected voltage-source converters with LCL filters: a study based on different state feedbacks.
IEEE Trans Power Electron 31(7):5189. https://doi.org/10.1109/TPEL.2015.2478862
Rodriguez J, Kazmierkowski MP, Espinoza JR, Zanchetta P, Abu-Rub H, Young HA, Rojas CA
(2013) State of the art of finite control set model predictive control in power electronics. IEEE
Trans Indust Inf 9(2):1003. https://doi.org/10.1109/TII.2012.2221469
Rodriguez J, Kazmierkowski MP, Espinoza JR, Zanchetta P, Abu-Rub H, Young HA, Rojas CA
(2013) State of the art of finite control set model predictive control in power electronics. IEEE
Trans Indust Inf 9(2):1003. https://doi.org/10.1109/TII.2012.2221469
Rossiter JA (2005) Model-based predictive control: a practical approach. Control series. CRC Press,
Boca Raton
Scoltock J, Geyer T, Madawala UK (2013) A comparison of model predictive control schemes for
mv induction motor drives. IEEE Trans Indust Inf 9(2):909. https://doi.org/10.1109/TII.2012.
2223706
Sultana WR, Sahoo SK, Sukchai S, Yamuna S, Venkatesh D (2017) A review on state of art devel-
opment of model predictive control for renewable energy applications. Renew Sustain Energy
Rev 76:391. https://doi.org/10.1016/j.rser.2017.03.058
Teodorescu R, Blaabjerg F, Liserre M, Loh P (2006) Proportional-resonant controllers and filters
for grid-connected voltage-source converters. Electr Power Appl, IEE Proc 153(5):750
4 Model Predictive Control for Grid-Connected Converters … 115
Teodorescu R, Liserre M, Rodriguez P (2007) Grid converters for photovoltaic and wind power
systems Wiley-IEEE Press
Teodorescu R, Liserre M, Rodriguez P (2011) Grid converters for photovoltaic and wind power
systems, vol 29. Wiley
Vazquez S, Rodriguez J, Rivera M, Franquelo LG, Norambuena M (2017) Model predictive control
for power converters and drives: advances and trends. IEEE Trans Indust Electron 64(2):935.
https://doi.org/10.1109/TIE.2016.2625238
Vazquez S, Rodriguez J, Rivera M, Franquelo LG, Norambuena M (2017) Model predictive control
for power converters and drives: advances and trends. IEEE Trans Indust Electron 64(2):935.
https://doi.org/10.1109/TIE.2016.2625238
Williams L, Maximilien E, Vouk M (2003) Test-driven development as a defect-reduction practice.
In: 14th international symposium on software reliability engineering, 2003. ISSRE 2003., pp
34–45. https://doi.org/10.1109/ISSRE.2003.1251029
Willis H, Scott WG (2000) Distributed power generation: planning and evaluation. In: Power engi-
neering (Willis). Taylor & Francis
Young HA, Perez MA, Rodriguez J (2016) Analysis of finite-control-set model predictive current
control with model parameter mismatch in a three-phase inverter. IEEE Trans Indust Electron
63(5):3100. https://doi.org/10.1109/TIE.2016.2515072
Chapter 5
Grid-Connected Multilevel Converter
with Optimal Programmed PWM
and Virtual Synchronous Machine
F. B. Grigoletto (B)
Federal University of Pampa, Alegrete, RS, Brazil
e-mail: [email protected]
D. A. Schuetz · J. R. Tibola · F. Carnielutti · H. Pinheiro
Federal University of Santa Maria - UFSM, Santa Maria, Brazil
e-mail: [email protected]
J. R. Tibola
e-mail: [email protected]
F. Carnielutti
e-mail: [email protected]
H. Pinheiro
e-mail: [email protected]
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 117
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_5
118 F. B. Grigoletto et al.
5.1 Introduction
In this context, this chapter presents an optimal programmed PWM strategy coor-
dinated with a virtual synchronous machine. The innovation of this chapter is out-
lined as (i) An OP-PWM where the harmonic current content is minimized and is
kept under the limits of the IEEE 1519 standard; (ii) The proposed modulation strat-
egy presents a superior performance in terms of harmonic distortion compared to
SHE-PWM for an equivalent number of switching angles and output filter; (iii) The
closed-loop control by means of he Virtual Synchronous machine concept provides
the synchronization angle required for the OP-PWM technique that supports the
overall implementation of the grid-connected converter.
This chapter is organized as follows: Sect. 5.2 introduces the SHE modulation,
Sect. 5.3 presents a detailed description of the proposed OP-PWM algorithm for the
mitigation of individual harmonic components and THD minimization. Section 5.4
presents the closed-loop control structure based on the concept of Virtual Syn-
chronous Machine for grid-tied converters. Furthermore, the design and implementa-
tion of the modulator is presented. Section 5.5 shows the main Hardware-in-the-Loop
(HIL) results and, finally, the conclusions are presented in Sect. 5.6.
Let us consider a voltage waveform, periodic in the time domain t with quarter-wave
symmetry. This function can be described by the Fourier series as follows:
∞
E
v(ωt) = ah sin (hωt), (5.1)
h=1
where ah is given by
∞
4 E
ah = (−1)n+1 cos (hαn ) , (5.2)
hπ n=1
4| |
cos (α1 ) − cos (α2 ) + · · · + (−1)n+1 cos (α N ) = m i (5.3)
π
4 | |
cos (5α1 ) − cos (5α2 ) + · · · + (−1)n+1 cos (5α N ) = 0 (5.4)
5π
5 Grid-Connected Multilevel Converter … 121
4 | |
cos (7α1 ) − cos (7α2 ) + · · · + (−1)n+1 cos (7α N ) = 0 (5.5)
7π
.. .. ..
. . .
4 | |
cos (H α1 ) − cos (H α2 ) + · · · + (−1) cos (H α N ) = 0,
n+1
(5.6)
Hπ
where n is the n-th switching angle defined by n = 1, 2, . . . N and h is the h-th
harmonic component to be eliminated, where h = 1, 5, 7, . . . H . Moreover, m i is the
modulation index defined by the ratio between the fundamental voltage component
and the dc-link voltage. In order to eliminate H harmonic components, N switching
angles are needed, where H = N − 1. In order to ensure a valid solution, the angles
αn must satisfy the condition (5.7):
π
0 < α1 < α2 < α3 < · · · < α N < . (5.7)
2
The nonlinear equations of (5.6) can be solved by numeric methods as, for exam-
ple, Newton-Raphson. Other solutions can be obtained by computational tools, such
as the f mincon solver, available in MATLAB® software. Usually, different solu-
tions exist for (5.6); however it is important to note that harmonic components at
frequencies higher than the eliminated components are not taken into account in the
conventional formulation of SHE. For grid-tied converters, these harmonic voltage
components can result in harmonic current components that exceed the limits defined
by the grid-connection standards, such as the IEEE 1547 shown in Table 5.1.
It is important to mention that the limits presented in Table 5.1 are given as a
percentage value of the nominal current in a period of 15–30 min. Moreover, even
harmonics must be limited to 25% of the odd harmonics (IEEE Standard 2018).
Fig. 5.1 PWM switching pattern with seven switching angles of quarter period
122 F. B. Grigoletto et al.
Table 5.1 Individual harmonic current distortion and THD limits of the IEEE 1547 standard (IEEE
Standard 2018)
Harmonic order (h) δh · 100 (%)
h < 11 4
11 ≤ h < 17 2
17 ≤ h < 23 1,5
23 ≤ h < 35 0,6
35 ≤ h 0,3
THD 5
This chapter proposes that the harmonic current components are kept below the limit
established by IEEE 1547. In addition, the optimization algorithm searches a solution
that minimizes the THD and complies with the limits of the IEEE 1547.
The definition of the switching angles can be treated as an optimization problem,
that is: ⎧
⎨ f THDi (αn ) ≤ 0
min THDi (α) subjected to f 1 (αn ) = 0 and f h (αn ) ≤ 0 (5.8)
αn ⎩
0 < α1 < · · · < α N < π2
| |
| ∞ ( )2 |∞
|E Ih 1 |E
f THDi (αn ) = | = | [Vh |G ( j ωh) |]2 , (5.10)
h=2
I 1 V1 |G ( j ω1) | h=2
where Ih is the amplitude of the individual harmonic component of the output current
and I1 is the fundamental harmonic component. LCL filters are often used for the
grid-connection of power converters due to their third-order characteristic, which
results in high attenuation of the harmonic components. Considering an LCL filter,
5 Grid-Connected Multilevel Converter … 123
the transfer function that relates the grid current i g and the converter PWM voltage
vin is given by
i g (s) sC Rd + 1
G(s) = = 3 , (5.11)
vin (s) s C L 1 L 2 + s C Rd (L 1 + L 2 ) + s(L 1 + L 2 )
2
where C is the capacitance of the output filter, Rd is the damping resistance and L 1 e
L 2 are the inductances. Considering s = j ω for sinusoidal systems, the filter gain as
a function of the harmonic order is |G( jω)|. Therefore, this gain can be used to define
the upper bound of the harmonic current components according to the standard. As
the limit for THDi is 5%, according to Table 5.1, the following constrains must be
met:
f THDi (αn ) = THDi − 0.05 · Inom ≤ 0, (5.12)
where Inom is the nominal output current. The following constrains are derived in
order to search for the switching angles that satisfy the individual harmonic limits:
| |
cos (α1 ) + · · · + (−1)n+1 cos (α N ) = m i π4 (5.13)
| |
cos (5α1 ) + · · · + (−1) cos (5α N ) ≤
n+1 5πδ5 Inom
4|G(5· jω)|Vdc
(5.14)
| |
cos (7α1 ) + · · · + (−1)n+1 cos (7α N ) ≤ 7πδ7 Inom
4|G(7· jω)|Vdc
(5.15)
.. .. ..
. . . (5.16)
| | H πδh Inom
cos (H α1 ) + · · · + (−1) n+1
cos (H α N ) ≤ 4|G(H · jω)|Vdc
. (5.17)
Note that in (5.17) the values of H are not related to N as stated for the conventional
SHE. In this work, it was established that H = 50 and N = 7. Therefore, in a general
way, the inequalities of (5.17) can be expressed by
E
N
hπ δh Inom
f h (αn ) = (−1)n+1 cos (hαn ) − ≤ 0. (5.18)
n=1
4|G (h · j ω) |Vdc
Due to the quarter-wave symmetry, the even harmonic components are zero. On
the other hand, the components multiple of three are canceled for three-phase three-
wire systems.
Fig. 5.2 Block diagram of the grid-connected converter with the proposed OP-PWM strategy and
the virtual synchronous machine
trol concept. The control scheme uses the measurements of the grid voltage and output
currents to provide the modulation index m i and synchronization angle θ . Once m i
and θ are defined, the switching angles αn are obtained from look-up tables stored
offline. Once these angles are found, the modulator executes the logic operations to
generate the drive signals for the power switches.
support. In this way, the mechanic and electric equations of the system are derived
in order to mimic the behavior of a synchronous machine (Zhong and Weiss 2011).
Let us consider a thee-phase synchronous machine, where the flux can be written
as
oabc = Liabc + M f i f , (5.19)
where M f is the mutual inductance among the rotor and stator windings, iabc is a
vector of the stator currents and i f is the field current. Furthermore:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
Oa ia M f cos(θ )
oabc = ⎣ Ob ⎦ ; iabc = ⎣ i b ⎦ ; M f = ⎣ M f cos(θ − 2π 3
)⎦, (5.20)
Oc ic M f cos(θ − 4π 3
)
and Rs is the equivalent resistance of the stator windings. From (5.19), the terminal
voltage is given by
do
vabc = −Rs iabc −
dt (5.21)
diabc
= −Rs iabc − L s + eabc
dt
The electromotive force eabc due to the rotor movement is:
dM f di f
eabc = − if − Mf (5.22)
dt dt
since dθg /dt = ωg , di f /dt = 0, M f i f = U f v it can be written:
⎡ ⎤
ωg U f v sin(θ )
eabc = ⎣ ωg U f v sin(θ − 2π 3
)⎦ (5.23)
ωg U f v sin(θ − 3 )
4π
dω
J = Tmv − Tev − K dw (ωgn − ω), (5.24)
dt
where J is the moment of inertia, K dw is the constant damping factor of the machine,
which is related to the frequency oscillation.
On the other hand, the electromagnetic torque Tev is dependent of the electric
variables and acts as the feedback in the loop:
ea i a + eb i b + ec i c
Tev = . (5.25)
ω
The mechanic torque Tmv is directly related to the active power reference, such as
126 F. B. Grigoletto et al.
Pr e f
Tmv = . (5.26)
ωgn
The amplitude of the voltage produced by the VSM is associated with the reactive
power equation:
Q − Qr e f
Ufv = (5.27)
sK
where, K is the constant related with amplitude oscillation, Q r e f is the reference
reactive power and Q is the reactive expressed as
Q = ωiabc M f i f (5.28)
Fig. 5.3 Drive signals generation for the three-level NPC inverter
U f vω
mi = . (5.29)
Vdc /2
where Vdc is the voltage of the DC link. The modulation index belongs to a range from
0 to a theoretical maximum of 4/π ≈ 1.27. At the DSC, the m i value is multiplied
by 100 and rounded to a 7 bits binary number and then sent to the FPGA through a
parallel communication. At the FPGA, m i is used as an index in the look-up table
with the information of the α angles.
On the other hand, the information about the virtual synchronous machine fre-
quency is sent to the modulator as a variable clock frequency. This clock is generated
using the conventional PWM modules, or counter timer, available in most common
DSCs. This PWM module usually works at a high frequency ( f DSC ). By setting a
maximum count value to TP E R , i.e., the maximum value of the counter, and the duty
cycle to 50%, this module can work as a variable frequency clock generator, as shown
in Eq. 5.30. ( ωgn )
TP E R = round Nb ·
ω
(5.30)
TP E R
COMP = .
2
128 F. B. Grigoletto et al.
where, C O M P is the duty cycle comparator register set to 50%, Nb is the base clock
divider and depends on the chosen frequency resolution of the modulator (/\ f min ),
as shown in Eq. 5.31.
f gn
/\ f min = (5.31)
Nb
Fig. 5.4 Clock generation at the DSC to drive the FPGA counters. Example when the frequency
changes from ω A to ω B , with ω B > ω A
The following Boolean logic can be employed to derive the drive signals for the
inverter power switches:
( )
S1 = A · B · C + D · E + F · G + H
( ) (5.35)
S2 = A · B · C + D · E + F · G + H .
Appendix B shows the VHDL code to implement the main part of the modulator
proposed above for phase A.
130 F. B. Grigoletto et al.
Fig. 5.5 Drive signals generation for the three-level NPC inverter
Fig. 5.6 Typhoon Model composed of NPC inverter, LCL filter, three-phase grid, current e voltage
sensor, power meter
Hardware-in-the-Loop results were obtained using a Typhoon HIL 402. The model
of the converter has been developed in the Typhoon HIL software using a Three-
Phase Neutral-Point Clamped converter (NPC) connected to the grid by means of an
LCL filter, as shown in Fig. 5.6.
The implementation of the control strategy is performed in a Texas Instruments
DSC TMS320F28379D. This DSC is a 32-bit floating point Digital Signal Controller
with a processor clock of 200 Mhz and a peripheral clock of f DSC = 100 Mhz. The
VSM is discretized using the Euler method with a time step of Ts = 1/2760 s.
The voltages and currents from the emulated system in Typhoon Hil are converted
to analog signals with a ±10 V range. These analog signals are scaled down with
operational amplifiers to match the range of 0 to 3 V, that is the input of the ADC
channels of the DSC.
5 Grid-Connected Multilevel Converter … 131
Digital signals are sent from the DSC to the ALTERA FPGA Cyclone IV
EP4CE6E22C8N, where the modulator and the dead-time for the gate signals are
implemented in VHDL language. The modulator also returns the electrical angle of
the virtual synchronous machine. Figure 5.7 shows the setup employed to obtain the
results and Fig. 5.8 illustrates the implementation of each stage in their respective
device. In summary, the grid voltage (vg ) and the converter output current (i inv ) are
measured by the TMS320F28379D DSC, that communicates with the CoreEP4CE6
FPGA sending frequency (ω) and modulation index (m i ) and receiving the angle (θ ).
Moreover, the computed switching signals (S1 ...S6 ) are sent to the converter that is
emulated in the Typhoon HIL 402.
Table 5.2 shows the main parameters of the HIL test. It is important to mention that
the parameters of the LCL filter have to be known a priori, since the transfer function
of the filter is part of the algorithm that searches the switching angles. Therefore,
in this chapter, the following steps are presented for the LCL filter design: (i) the
capacitor is derived from the reactive power absorbed at rated conditions, where the
132 F. B. Grigoletto et al.
capacitance generally is around 5% of the base value (Liserre et al. 2005). (ii) The
converter-side inductor L 1 is considered ten times greater than the grid-side inductor
L 2 . This value defines the ratio of harmonic current attenuation between both sides,
i.e., converter and grid. (iii) The resonance frequency is lower than the equivalent
switching frequency and it must not coincide with the harmonic components gener-
ated by the converter. In this chapter, the equivalent switching frequency is 840 Hz
and the resonance frequency of the LCL filter is 579 Hz. Furthermore, the LCL filter
presents a resonance that can be damped for a stable grid-connected operation. The
resonance can be damped via control feedback whenever there is enough bandwidth.
However, the virtual synchronous machine acts mainly at nominal frequency and
cannot properly damp the LCL resonance. Therefore, a resistor is added in series
with the capacitor as passive damping.
Figure 5.9 shows the switching angles for the proposed OP-PWM and for the
convectional SHE-PWM. Note that the solution of the proposed strategy results in
discontinuous switching angles as a function of the modulation index.
Based on the switching angles from Fig. 5.9, two simulations are carried out on
MATLAB with both SHE-PWM and OP-PWM. Figure 5.10 shows the behavior of
the output grid currents.
5 Grid-Connected Multilevel Converter … 133
Fig. 5.9 Switching angles for the conventional SHE and the proposed OP modulation strategy
Fig. 5.10 Output current using conventional SHE modulation versus proposed OP-PWM
The spectrum of the current for the proposed OP-PWM and the conventional SHE
can be seen in Fig. 5.11. It is possible the note from Fig. 5.11a that the harmonic
components 5a , 7a , 11a , 13a , 17a and 19a are eliminated when the conventional
SHE is applied. However, the harmonic components 23a , 25a e 29a exceed the limits
established by the standard. This issue can be solved by the increase of the number
of angles or the design of the output filter, although both solutions can represent an
increase of costs or volume/weight to the system. On the other hand, as shown in
134 F. B. Grigoletto et al.
Fig. 5.11 Harmonic spectra of output current compared to the limits imposed by IEEE 1547. a
Conventional SHE-PWM. b proposed OP-PWM strategy
Fig. 5.11b, the proposed modulation strategy keeps all harmonic components under
the limits established by the standard.
Furthermore, Fig. 5.12 shows that the proposed strategy keeps the THD of the
output current within the limits imposed by the standard for the modulation indexes
from 0.6 to 1.16. Additionally, Fig. 5.13 shows the behavior of the harmonic content
5 Grid-Connected Multilevel Converter … 135
Fig. 5.12 THD of output current and limits imposed by IEEE 1547
Fig. 5.13 3D graphic of the harmonic spectrum of output for the proposed strategy
of the output current until the 50a harmonic order, which are also within the limits
imposed by the standard for the modulation indexes from 0.6 to 1.16.
Figure 5.14 shows a step in the active power reference from Pref = 300 kW to
Pref = 750 kW. It can be seen that the system presents a good transient response with
136 F. B. Grigoletto et al.
Fig. 5.14 Step on the active power reference from Pref = 300 kW to Pref = 750 kW
a settling time of less than 0.1 s. This response can be adjusted through the inertia
of the virtual synchronous machine. This result was taken from the Typhoon HIL
software.
Figure 5.15 shows the internal variables of the DSC for the same power step
shown in Fig. 5.14. An increase in the frequency when the active power increases
can be seen. The modulation index also increases to compensate the voltage drop
over the LCL filter due to the current increase.
Data from the DSC memory is gathered by saving all needed variables in a specific
memory region, and it is imported with the “Save Memory functionality” of the Code
Composer Studio. This function is present in the most common Eclipse-based IDEs.
“Save Memory” outputs a single-column file with all the content of a given memory
region. This file is then processed with MATLAB to generate Fig. 5.15.
Figure 5.16 shows the steady-state current at the inverter-side inductor (i inv ) and
at the grid-side inductor (i g ). The amplitude difference is due to the reactive power
of the capacitor. A higher current ripple can be seen at the inverter-side inductor. On
the other hand, at the grid-side inductor, a very small ripple is perceived due to the
third-order harmonic attenuation of the LCL filter. The THD of the grid current is
kept below 5%, which meets the IEEE 1547 standard, as expected.
Figure 5.17 shows a FFT analysis of the line current at the grid-side inductor (i g ),
while Figure 5.18 shows the inverter output line-to-line voltage with the OP-PWM
strategy.
The proposed algorithm finds valid solutions for modulation indexes lower than
1.16. Conversely, the range m i = 1.16 to 1.27 comprises the overmodulation region
where the loss of degrees of freedom generates additional harmonic components that
deteriorate the quality of the output voltages. Therefore, the proposed algorithm can
5 Grid-Connected Multilevel Converter … 137
61 f
60
59
58
0 0.1 0.2 0.3 0.4 0.5 0.6
0.9
Modulation Index
0.88
mi
0.86
0.84
0.82
0 0.1 0.2 0.3 0.4 0.5 0.6
Time (s)
Fig. 5.15 Main variables from DSC memory equivalent to the step on active power reference in
Fig. 5.14
not find a solution that keeps the THD and individual harmonics under the limits
of the IEEE 1547 standard for m i ≥ 1.16. As the grid voltage generally does not
experience large variations in its amplitude and frequency at nominal conditions, the
converter is designed to operate with modulation indexes lower than 1.16. Supposing
that a modulation index greater than 1.16 is required during the operation of the grid-
connected converter, then there will be a limitation of the control action. The converter
still synthesizes sinusoidal output voltages with a limited maximum value, however,
this fact may result in active and reactive powers different from the reference.
On the other hand, when it comes to a five-level multilevel converter, low modu-
lation indexes lead to a reduction of the number of output voltage levels from 5 to 3,
increasing the output current distortion. Therefore, the operation of a grid-connected
converter at low modulation indexes is avoided. It is worth mentioning that low mod-
ulation indexes generally are useful for applications such as motor drives operating at
the variable voltage/frequency; therefore this topic is out of the scope of this chapter.
138 F. B. Grigoletto et al.
Fig. 5.16 Line current at the inverter-side inductor (i inv ) and at the grid-side inductor (i g ). Image
from the Typhoon HIL software
4.5
OP-PWM
4 IEEE 1547
3.5
2.5
In / I nom
1.5
0.5
0
0 5 10 15 20 25 30 35 40 45 50 55
Harmonic order (h)
Fig. 5.17 FFT analysis of the line current at the grid-side inductor (i g ). Data from the Typhoon
HIL software, plot, and FFT performed on MATLAB
5 Grid-Connected Multilevel Converter … 139
Fig. 5.18 Inverter line-to-line output voltage. Image from the Typhoon HIL software
5.6 Conclusion
This chapter proposed an optimal programmed PWM strategy coordinated with the
virtual synchronous machine concept for grid-connected multilevel converters. The
switching angles were obtained offline by an optimization algorithm that minimized
the THD and constrained the individual harmonics in compliance with the harmonic
limits of the IEEE 1547 standard. The proposed technique was applied to a three-
phase grid-connected NPC converter; notwithstanding the principles described in this
chapter can be expanded to other topologies with any number of levels. Moreover,
the virtual synchronous machine concept supported the control and grid-connection,
as it incorporates the angle for synchronization and dismisses additional current or
voltage control loops. HIL results were obtained with a setup comprising Typhoon
HIL 402, a TMS320F28379D DSC and an EP4CE6E22C8N FPGA. These results
demonstrated the good performance of the proposed modulation technique compared
to the conventional selective harmonic elimination strategy.
Appendix A
min f (X )
subject to AX ≤ B, Aeq X = Beq (linear constraints)
(5.36)
C(X ) ≤ 0, Ceq(X ) = 0 (nonlinear constraints)
LB ≤ X ≤ UB (bounds)
The vector init contains the initialization of the seven switching angles. Whenever
one solution is achieved, the initialized angles are refreshed for the new search. If the
algorithm cannot find a solution next to the discontinuities of the angles, therefore
the initialization angles can be randomized. The lower bound (LB) of the solutions
is zero and the upper bound (UB) is π/2.
Appendix B
Figure 5.19 shows the VHDL code to implement the main part of the proposed
modulator for the phase A. A VHDL code usually is composed of processes. These
processes are activated by a sensitivity list. There are two signals at the sensitivity
list: reset and clock. Reset is used to asynchronously put all variables to default states.
On the other hand, an uprising edge clock is used to run the modulator itself.
There are other processes to implement all the functions of the modulator, e.g.,
dead-time generation, receiving/sending data from/to the DSC, but they are not shown
here for the sake of simplicity.
5 Grid-Connected Multilevel Converter … 141
Fig. 5.19 VHDL code to implement the proposed modulation for phase A
References
Agelidis VG, Balouktsis A, Balouktsis I, Cossar C (2006) Multiple sets of solutions for harmonic
elimination PWM bipolar waveforms: analysis and experimental verification. IEEE Trans Power
Electron 21(2):415–421. https://doi.org/10.1109/tpel.2005.869752
Beck H-P, Hesse R (2007) Virtual synchronous machine. In: 9th international conference on elec-
trical power quality and utilisation, pp 1–6. https://doi.org/10.1109/epqu.2007.4424220
Chabni F, Taleb R, Helaimi M (2017) ANN-based SHEPWM using a harmony search on a new
multilevel inverter topology. Turkish J Electr Eng Comput Sci 25:4867–4879. https://doi.org/10.
3906/elk-1703-122
142 F. B. Grigoletto et al.
6.1 Introduction
In recent years, the distorting loads have caused an increasing amount of harmonic
currents to enter the grid (Marcos-Pastor et al. 2020). Harmonic distortion currents
can be minimized by utilizing power line conditioner techniques. Active power filters
(APFs) prove to be the popular and efficient power line conditioners in the field
of power electronics (Hsu and Wu 1996). The APFs are effective applications not
only for the harmonic current compensation of grid current which is produced by
the distorting loads, but also for the reactive power compensation, unbalanced, non-
linear loads, etc. (Ojha and Gupta 2020). During the past two decades, the design and
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 145
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_6
146 S. Ojha and R. Gupta
control of APFs have been rigorously investigated, especially for the compensation
of harmonics produced by the distorting loads. Due to the direct control of the
harmonics, the selective current harmonics (SCH) elimination method is useful,
especially in low switching frequency applications (Makhlouf et al. 2016; Liang et al.
2016; Cid-Pastor et al. 2013). Generally, the three-phase shunt filters find application
in the systems for large capacity non-linear loads. On the other hand, single-phase
APFs are useful for small-scale applications with single wire earth return power
systems as shown in Fig. 6.1.
The SCH elimination is a pre-programmed modulation technique that elimi-
nates lower-order harmonics in the reference current (Ojha and Pandey 2016). The
SCH elimination has some distinct features in comparison to other control tech-
niques; these include (i) low converter switching frequency, (ii) possibility of over-
modulation, which increases the utilization of the DC-link voltage, (iii) elimination
of lower-order harmonics, and (iv) reduction in the size of the DC-link filter compo-
nents. The SCH elimination scheme uses trigonometric equations with the variety of
angles obtained after applying the Discrete Fourier Transform (DFT)-based filtering
of the output waveforms. The most common methods used to solve these equations
are numerical methods and optimization-based methods.
In the proposed technique, a Diode clamped 2-level inverter with a DC-link capac-
itor is employed. The performance of the proposed predictive current controller is
superior to classical selective harmonic elimination (SHE) owing to the inclusion
of the band-pass filter with a harmonic compensator which eliminates the selective
harmonics present in the system without using the physical filter in the hardware
Rsh
Ish
Single-Phase
H-Bridge
Inverter DC-Link
Capacitor
Gate Pulse
Fig. 6.1 Block diagram of single-phase active power filter (APF) compensated distribution system
6 Selective Harmonic Compensation in Active Power Filter … 147
model. It reduces the cost and bulkiness of the system. The advantages of model
predictive control (MPC) are its robustness and stability (due to the presence of zero in
transfer function) and the disadvantages of MPC (the conventional and the proposed
ones), when compared to SHE, is that it contains variable switching frequency which
increases switching losses.
This chapter presents an SCH elimination based on the PCC algorithm (Hsu and
Wu 1996) for the APF. It uses the reference shunt current (Ishref ) and a PCC algorithm
to achieve tracking in presence of the periodic disturbances. The disturbance rejection
transfer functions are used to eliminate the selected frequencies (Ojha et al. 2017).
However, the proposed method gives a more efficient algorithm in terms of the
complexity, sensitivity, and quantization effect with an algorithmic configuration
that is tested through the Typhoon-HIL implementation.
This chapter is divided into five sections: mathematical analysis of PCC for
a single-phase inverter, calculation of shunt reference current having selective
harmonic (third harmonic in this chapter), simulation on Typhoon-HIL simulation
environment, real-time simulation validation by using FPGA-based Typhoon HIL
402 kit for APF, and finally the conclusions.
The mathematical analysis of the PCC is described in this section. The controller
logic uses the past and present state of the variable and predicts the future state of the
variable. In the PCC logic, the variable is the shunt APF current. The predicted current
(at an instant k + 1) is then compared with the reference current (at a particular instant
k) and produces an error, which is attempted to be eliminated using the proposed
criteria known as the minimization of the cost function (Bodetto et al. 2014; Ojha
and Pandey 2015).
The PCC control algorithm in the form of a flow chart is shown in Fig. 6.2.
The controller senses the initial value of the shunt current, DC-link voltage, stored
reference shunt current, and switching state at instant k. Now, the controller calculates
or predicts the future value of the shunt current using the voltage vector state at instant
k + 1. Then, the controller iterates the program for four times due to the availability
of four switching vector states, and using (6.3), it will find the best switching states.
If the estimated cost function is less than the optimal value of the cost function, it
will set the estimated cost function as the optimal cost function. If this condition is
satisfied, it will generate gate pulse, otherwise it will return to the for loop block for
the next iteration.
The single-phase inverter dynamic equation can be written as
di sh Rsh i sh uVdc
=− + (6.1)
dt L sh L sh
where i sh is shunt current which varies from i sh (kTS ) → i sh (kTS + TS ) (i.e., from
particular instant kT S to very next instant (kT S + T S ), T S is sample time, dt is the
148 S. Ojha and R. Gupta
No
Let I L be the load current or compensating current as shown in Fig. 6.1. The compo-
nents of the load current are (a) real (I PL ), (b) reactive (I QL ), and (c) harmonic
components (I hL ), or (a) grid current (I g ) and (b) shunt current (I sh ) as defined below.
6 Selective Harmonic Compensation in Active Power Filter … 149
Iref
Ishref
Gain
Vc LPF PI PLL PCC
Gate Pulse
Vcref Vg IL Ish
Fig. 6.3 General diagram of the current mode voltage control method for single-phase APF using
conventional PCC algorithm
I L = I P L + I Q L + Ih L = Ig + Ish (6.4)
Figure 6.3 shows a general diagram of the current mode voltage control technique.
The control is based on an outer voltage loop and an inner current loop. The current
is controlled by using PCC techniques. Where the reference current is generated with
the help of the outer voltage loop.
The reactive and harmonic components of the grid current can be eliminated by
introducing the shunt current in the system (Liu et al. 2019). It implies that the
shunt current consists of two components of the load current, namely reactive and
harmonic, which have equal magnitude and are out of phase with each other to convert
the grid current to have a purely real component. To provide complete compensation
of reactive and harmonics components, the compensation current can be evaluated
by (6.5)
(√ )
2(PLac + PLoss )
Ishr e f = IL − sin(ωo t) (6.5)
Vs R M S
where PLac is the load instantaneous power, V sRMS is the RMS value of grid voltage,
and PLoss is the power loss of the DC-link capacitor. The power loss PLoss can be
defined as follows:
{
PLoss = K pdc (Vdcr e f − Vdc f ilter ) + K idc (Vdcr e f − Vdc f ilter )dt (6.6)
For harmonic detection, a digital analysis filter bank can be used (Ojha and Pandey
2016; Ojha et al. 2017). A digital filter bank is based on the Fourier series, also called
DFT (Hsu and Wu 1996). So, the distorted load current can be written as
150 S. Ojha and R. Gupta
N {
E { ) { ))
2 ∗ pi ∗ hkTS 2 ∗ pi ∗ hkTS
i L (kTS ) = Io (kTS ) + Ah cos + Bh sin
h=1
N N
(6.7)
switching f requency
where h is the harmonic coefficient, N = f undamental f r equency
.
The time-varying coefficient Ah (kT S ) and Bh (kT S ) value can be calculated as
{ )⎫
2 2 ∗ pi ∗ h ∗ kTS ⎪
Ah (kTS ) = Ah (kTS − TS ) + (i L (kTS ) − i L (kTS − N )) sin ⎪
⎬
N N
{ )
2 2 ∗ pi ∗ h ∗ kTS ⎪
⎪
Bh (kTS )h (kTS − TS ) + (i L (kTS ) − i L (kTS − N )) cos ⎭
N N
(6.8)
Figure 6.4 Shows how the SCH elimination technique has been implemented to
generate I∗shref . This I∗shref differs from conventional Ishref .
The transfer function of band-pass filter (TF1) can be written as
2 ∗ ξ w1 ∗ f 1 ∗ s
T F1 = (6.9)
s 2 + 2 ∗ ξ w1 ∗ s + w12
E
N
2 ∗ ξ w1 ∗ f h ∗ h ∗ s
T F2 = (6.10)
h=3
s 2 + 2 ∗ ξ w1 ∗ h ∗ s + (h ∗ w1 )2
IL Harmonic
Compensator
6 Selective Harmonic Compensation in Active Power Filter … 151
The simulations are performed in the Typhoon-HIL simulation environment and real-
time simulation results are obtained for the SCH for single-phase SAPFs, as shown
in Fig. 6.1. The emulated system has been accomplished in real time, using Typhoon
HIL 402, as shown in Fig. 6.5, where the circuit parameters are given in Table 6.1.
Figure 6.6 shows the grid voltage, grid current, shunt current, reference shunt current,
DC-link voltage, and load current waveform when conventional PCC is implemented
using (6.5) in (6.3). Figure 6.7 shows the Fast Fourier transform (FFT) of grid current,
where it shows the frequency spectra to 19th harmonic order. Except fundamental
frequency the grid current has magnitude of 3rd, 5th etc. harmonic component, the
numerical value is mentioned in Table 6.2, while using conventional method, the
THD of grid current is 6.34%.
Figure 6.8 shows the grid voltage, grid current, shunt current, reference shunt current,
DC-link voltage, and load current waveform when the proposed PCC technique is
implemented using (6.11) in (6.3). Figure 6.9 shows the Fast Fourier Transform (FFT)
of grid current, where it shows the frequency spectra till 19th harmonic order. Except
for fundamental frequency, the grid current has a magnitude of 5th etc harmonic
Fig. 6.5 Typhoon HIL 402 interfaced with console PC through USB cable
152 S. Ojha and R. Gupta
Fig. 6.6 Grid voltage, grid current, shunt current, reference shunt current, DC-link voltage, and
load current when conventional PCC technique is implemented
component. It can be noted that load current has 3rd harmonic component of very
low magnitude, while using the proposed method the load current has very low
magnitude of 3rd harmonic component. The numerical value is mentioned in Table
6.2. The THD of grid current is 2.34%.
The measured values of grid current and load current with conventional and
proposed PCC techniques implemented are shown in Table 6.2.
6 Selective Harmonic Compensation in Active Power Filter … 153
Fig. 6.7 FFT of grid current when conventional PCC technique is implemented
Table 6.2 Measured values of grid current and load current with and without SCH elimination
method
Mode/Frequency (Hz) 50 150 250 350 450 550 650
Conventional Grid current (A) 43.9 0.8 1 0.04 0.08 0.01 0.01
PCC Load current (A) 39.8 24 7.1 1.2 1.1 0.6 0.43
Proposed Grid current (A) 43.8 0.22 1 0.04 0.08 0.01 0.01
PCC Load current (A) 39.7 7.68 7.1 1.2 1.1 0.6 0.43
Fig. 6.8 Grid voltage, grid current, shunt current, reference shunt current, DC-link voltage, and
load current with the implementation of the proposed PCC technique by eliminating 3rd harmonic
154 S. Ojha and R. Gupta
Fig. 6.9 FFT of grid current implementing proposed PCC technique by eliminating 3rd harmonic
Fig. 6.10 Grid voltage, grid current, and load current waveform when conventional PCC techniques
are implemented
Figures 6.10 and 6.11 show real-time simulation results when the virtual simulation
model is dumped on the Typhoon HIL 402 kit.
Figure 6.10 shows the grid voltage, grid current, and load current waveforms when
conventional PCC is implemented in the plant. The grid current is dominated by the
third and fifth harmonics, which are 1.8% and 2.2% of the fundamental, respectively.
6 Selective Harmonic Compensation in Active Power Filter … 155
Fig. 6.11 Grid voltage, grid current, and load current waveforms when the proposed PCC technique
is implemented by eliminating the 3rd harmonic
Figure 6.11 shows the grid voltage, grid current and load current waveforms respec-
tively when proposed PCC technique is implemented here 3rd harmonic eliminate
in the grid current. The grid current is dominated by the third and fifth harmonics,
which are 0.5% and 2.2% of the fundamental, respectively. The proposed method has
a reduction of 72.2% of the third harmonic in the grid current than the conventional
methods.
6.5 Conclusion
In this chapter, conventional predictive current control (PCC) scheme and proposed
PCC technique based on a selective harmonic (3rd harmonic) compensator for
single-phase SAPFs have been presented. In view of the performance of the SAPFs
confirmed by the results of virtual simulation and real-time simulation, the proposed
algorithm is highly suitable for SCH elimination. In the proposed method, 72.2%
of the third harmonic has been eliminated from the grid current as compared to the
conventional methods. This chapter designs the control parameters utilizing conven-
tional non-linear techniques, namely, high-frequency rejection transfer functions.
And control circuit should be synchronized with the power line using the PLL circuit.
References
Hsu CY, Wu HY (1996) A new single-phase active power filter with reduced energy-storage capacity.
IEE Proc Elect Power Appl 143(1):25–30
Liang Q, Hui Z, Kaipei L, Liu Q (2016) An improved modulation of the selective harmonic
elimination controlling. 2006 international conference on power system technology, pp 1–5
Liu X, Li X, Zhou Q, Xu J (2019) Flicker-free single switch multi-string LED driver with high
power factor and current balancing. IEEE Trans Power Electron 34(7):6747–6759
Marcos-Pastor A, Vidal-Idiarte E, Cid-Pastor A, Martínez-Salamero L (2020) Minimum DC-link
capacitance for single-phase applications with power factor correction. IEEE Trans Industr
Electron 67(6):5204–5208
Makhlouf B, Bouchhida O, Nibouche M (2016) Extension of real time harmonic elimination theory
to the traditional selective harmonic elimination. 2016 8th international conference on modelling,
identification and control (ICMIC), pp 597–602
Ojha S, Gupta R (2020) Performance comparison of sampled hysteresis and predictive control
methods for tracking current in APF. 2020 IEEE 17th India council international conference
(INDICON), pp 1–6
Ojha S, Pandey AK (2015) Comparative analysis of voltage source inverter using sinusoidal pulse
width modulation and third harmonic injection method for different levels and loads. IJAER
10(20):41451–41457
Ojha S, Pandey AK (2016) Close loop V/F control of voltage source inverter using sinusoidal PWM.
Third harmonic injection PWM and space cector PWM method for induction motor. IJPEDS 7(1)
Ojha S, Sharma C, Pandey AK (2017) Comparative analysis of closed loop three level voltage
source inverter using sinusoidal Pulase Width Modulation and Third Harmonic Injection method
for different loads. Second international conference on electrical, computer and communication
technologies (ICECCT) Year: pp 1–6
Chapter 7
Development of Electric Vehicles
Applications Using AURIX™
Microcontroller and Typhoon HIL
Note: xEV denotes any kind of vehicle that utilizes electric motor traction (electric vehicle).
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 157
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_7
158 I. Todorović et al.
7.1 Introduction
Fossil fuels usage and greenhouse gas emissions reductions are adopted as pivotal
objectives in the domain of the development and application of emerging technolo-
gies. This has become a necessity as several ecological and societal problems became
impossible to ignore. Since the transportation sector is one of the largest contributors
to CO2 emissions and one of the largest consumers of non-renewable fuels, this sector
will be transformed in the following years (World Energy Outlook 2020). Primarily,
this transformation will come in form of transportation electrification and xEVs’
proliferation. xEVs should decrease fossil fuel usage and greenhouse gas emissions,
but they will also reduce the residential area air and noise pollution, which are asso-
ciated with a significant number of health issues. Moreover, these vehicles bring
several advantageous features of direct interest to users. They are constructed to be
safe and reliable and have lower maintenance costs than conventional vehicles. They
can be charged at home and their usage is significantly cheaper since the electricity
price is comparatively significantly lower than the price of fossil fuels (Report on
EV 2020; Electric Cars 2021). Traditional vehicles in turn used internal combustion
engines for traction, which led to rather poor reliability and high maintenance costs,
while the fuel cost significantly increased usage expenses.
The electromobility development is still in progress and the adoption of xEV
technologies began with the introduction of hybrid electric vehicles (HEV), as an
interim solution. On the other hand, the number of vehicles that rely only on elec-
tric traction is increasing. Both HEVs and EVs represent highly complex systems
since the essential requirements, such as reliability and safety need to be fulfilled.
Therefore, all pertaining subsystems have to be carefully developed and tested.
Among others, in recent years, the vigorous development of various power
electronics-based devices and systems has been undertaken. Various charger topolo-
gies have been investigated, both high voltage and low voltage DC-DC converters
were developed, and the inverter design was improved, as well as the design of the
other auxiliary converters. Additionally, the battery management system, as one of
the most important control elements, has gained considerable attention. It directly
affects the efficiency, reliability, and safety of xEVs, and thus researchers are putting
a lot of effort into the enhancement of battery management strategies. Another rele-
vant xEVs’ component is the powertrain domain controller that controls centralized
powertrain functions and governs the inter-communication. All these systems require
careful planning and testing methods. Several development strategies can be under-
taken, but the most common method in the praxis is the utilization of the V-model
or its derivatives (Anselma and Belingardi 2019).
The V-model is a representation of the xEV’s development lifecycle, i.e., it defines
the activities to be performed and the results to be produced. Firstly, the system’s
specifications have to be provided and these include:
. Concept of operations,
. Requirements and architecture,
7 Development of Electric Vehicles Applications … 159
. Detailed design.
Secondly, a project test and integration procedures are conducted, which incorporate:
. Integration, test, and verification,
. System verification and validation,
. Operation and maintenance.
The use of the V-model ensures project risk minimization, cost reduction, and
secures reliable development process outcomes.
This chapter provides a detailed insight into how two V-model stages—“Integra-
tion, test, and verification” and “System verification and validation” are conducted. It
will be shown how these stages can be accelerated and qualitatively improved using
C-HIL (controller hardware-in-the-loop) approach.
The usage of C-HIL setups during xEV development lifecycles is becoming an
industry standard and the C-HIL environment addressed in the chapter is based on
sophisticated real-time simulators and digital signal processors that are widely used
in the automotive industry in general.
Hardware-wise, the C-HIL development, testing, and verification environment
consists of:
. Real-time simulator,
. Digital signal processor or microcontroller,
. Interface board.
A real-time simulator, often denoted as an emulator, is used to emulate the power
stage of the system. Essentially, it replaces and mimics the vehicle’s power stage
operation. The microcontroller is used to implement desired control structures. The
interface board adjusts the signals that are exchanged between the real-time simulator
and the microcontroller.
Considering Fig. 7.1, the control code downloaded to the Infineon 32-Bit Single-
Chip AURIX™ TriCore™-based Microcontroller (represented with a circle) is used
to govern different domains of the power stage (represented with rectangles) emulated
in the real-time simulator.
Considering the software tools used, the power stage model was implemented
using the Typhoon HIL Control Center software package, while the control code was
synthesized using AURIX™ Development Studio. Easy controller peripheral config-
uration, initialization, and usage were achieved using the Infineon Low-Level Drivers
(iLLD) software package. Software tools OneEye (for controller variables observa-
tion) and Typhoon HIL SCADA (for power stage variables observation) provided
the graphical representation of the results. Both OneEye and Typhoon HIL SCADA
enable users to create GUIs, communicate with different controllers and emulators,
respectively, and easily depict gathered data.
The more precise the power stage model is, the more accurate the obtained
results are. Additionally, if more complex systems are to be emulated, several
160 I. Todorović et al.
emulator units can be used. The power stage is defined on the PC, using dedi-
cated software, compiled and downloaded on an emulator. Emulator- and controller-
relevant signals are routed through the interface board. The emulator sends analog
and digital signals that correspond to the signals gathered from real sensors in the
physical system. Then, these signals are adjusted using operational amplifier circuits
and forwarded to the real controller with the control code. Finally, according to the
received information, the controller takes necessary actions and produces gating and
other control signals that are sent to the inputs of the emulator.
Alternatively, the testing environment can be constituted using different tools and
devices. Firstly, other microcontrollers can be used (Texas Instruments C2000 series
(Texas Instruments C2000 real-time microcontrollers n.d.), STMicroelectronics
microcontrollers (STMicroelectronics Microcontrollers Microprocessors n.d.), etc.),
but the AURIX™ microcontrollers are dedicated to electric vehicle applications.
Infineon provides users with code examples, drivers, and software routines that are
compatible with and standardized for various electric vehicle applications. Hence,
the users can quickly start developing complex control structures and pertaining
safety and compliance software modules.
Moreover, instead of the C-HIL approach (based on real-time simulators), other
configurations can be used. Firstly, software in the loop (SIL) setup can be used.
Software tools such as MATLAB, PSIM, PLECS, and others can be used to build
digital twins of electric vehicle infrastructure and control structures. SIL enables
users to build testing setups of almost arbitrary complexity and size and analyze
them with the desired level of detail. Still, offline simulations, on which SIL is
based, are executed significantly slower than in real-time, hence extending testing
and development time (MathWorks n.d.).
Next, the processor in the loop (PIL) setups can be used (Infineon n.d.). They
enable the processor of a specific controller and the implemented code to be tested and
analyzed in great detail. The disadvantage of PIL setups is that the testing procedure
is also slower than in real-time since the execution of the implemented code is slowed
down in order to synchronize code execution with the model execution (the model
7 Development of Electric Vehicles Applications … 161
is implemented using offline simulators). SIL and PIL are usually employed at the
beginning of the development lifecycles to conduct preliminary tests.
In recent years, the controller model in the loop (CMIL) approach is becoming
increasingly popular. The model of the complete microcontroller is implemented and
executed using dedicated computer software and it is connected via specific software
routines to offline simulators and the model is implemented using those simulators.
Using this approach, comprehensive examination of the control code behavior, micro-
controller resources utilization, etc., as if the real controller was tested. Again, CMIL
is based on offline simulators run on personal (general-purpose) computers, and
testing procedures are unnecessarily prolonged in comparison to the C-HIL testing
procedures. Also, only several microcontroller vendors are providing the users with
corresponding microcontroller models, and only for flagship controllers (Infineon
n.d.).
Lastly, prototypes, full-scale and scaled-down versions, are platforms for the most
comprehensive testing of EV systems. The disadvantage of the usage of prototypes
is that they do pose a threat to personnel and equipment safety and if damaged or
destroyed by misuse or otherwise, expensive and time-consuming repairs must take
place. Generally, if employed, prototypes are used at the end of the development
process.
In the following paragraphs, the data describing the microcontroller, emulator, and
pertaining software tools, i.e., specificities of the environment for the development
of electric vehicle applications, will be provided. Also, for which applications the
environment can be used will be proposed, where implementation of field-oriented
control of permanent magnet synchronous motor will be explained in more detail.
Typhoon HIL 602+ real-time simulator is a powerful tool for the development, auto-
mated testing, and optimization of a wide range of power electronic devices used
in grid-connected applications, microgrids, and automotive and electric propulsion
drives. In view of the available I/O ports, the emulator contains 16 analog input
channels with 16-bit resolution (voltage range ±10 V), 32 analog outputs (with the
same precision and same voltage range), 32 digital inputs (input voltage range is
[−15 V, 15 V]), and the same number of digital outputs (output voltage range is [0 V,
5 V]). Considering the communication features, Ethernet, CAN, RS232, USB 2.0,
and high-speed, a serial link can be used (Typhoon HIL General Specification n.d.).
Typhoon HIL Schematic Editor, shown in Fig. 7.2, is a software tool used for the
graphical representation of the power stage models to be emulated. It contains a
162 I. Todorović et al.
Typhoon HIL SCADA, represented in Fig. 7.3, is another tool from the Typhoon
HIL software toolchain used for the visualization of a broad spectrum of real-time
simulations. It contains a vast number of user-friendly widgets that can be simply
configured and enables easy and convenient monitoring of all significant signals.
The drag and drop principle is used to design SCADA panels and different advanced
functions such as signal FFT are also available.
The AURIX™ TC2xx family system architecture is shown in Fig. 7.5 (Infineon-
TC27x_D-step-UM-v02_02-EN n.d.).
The TC27x product family has the following features:
. High-performance microcontroller with three CPU cores,
. Two 32-bit super-scalar TriCore™ CPUs (TC1.6P),
. Power-efficient scalar TriCore™ CPU (TC1.6E),
. Lock stepped shadow cores for one TC1.6P and TC1.6E,
. Multiple on-chip memories,
. 64-Channel DMA controller with safe data transfer,
. Sophisticated interrupt system (ECC protected),
. The high-performance on-chip bus structure,
. Optional hardware security module (HSM) on some variants,
. The safety management unit (SMU) handling safety monitor alarms,
. Memory test unit with ECC, Memory Initialization, and MBIST functions (MTU),
. Hardware I/O Monitor (IOM) for checking digital I/O,
In AURIX™ TC275, there are two modules dedicated to the conversion of analog
input values (voltages) to discrete digital values. Those modules are the Versa-
tile Analog-to-Digital Converter (VADC) and the Delta-Sigma Analog-to-Digital
Converter (DSADC).
If a resolver is used to determine the angular rotor position in electrical drive
applications, the carrier generation and processing of resolver signals can be done
with DSADC.
Table 7.2 summarizes the feature set of the AURIX™ TC27x series. More details
can be found in the product-specific user manual (World Energy Outlook 2022) and
datasheet (Infineon-TC27xDC-DataSheet-v01_00-EN n.d.).
The AURIX™ TC275 LiteKit, shown in Fig. 7.6, is equipped with a 32-Bit Single-
Chip AURIX™ TriCore™-based Microcontroller Aurix™ TC275.
Summary of features (Infineon-AURIX_TC275_Lite_Kit-UserManual n.d.):
7 Development of Electric Vehicles Applications … 167
. Arduino connector,
. Arduino ICSP connector,
. Voltage regulator 5 V to 3.3 V,
. Optional 0 u resistors (R39_opt/R40_opt in 1210 imperial),
. Arduino connector (Digital),
. 20 MHz Crystal for AURIX™ and 12 MHz Crystal for OCDS,
. Mikrobus connector for WIFI/BLE,
. Infineon CAN transceiver TLE9251VSJ & CAN connector,
. Pin connector X2,
. Power LED (D5),
. LEDs D1/D2 for ADBUS7/4 and LED3 for ESR0 Signal (low-active),
. Arduino pin connector (POWER & ANALOG IN),
. Potentiometer (10 kOhm) and solderable 0 u resistor (R33 in 0805 imperial),
. Micro USB (USB3.0 recommended),
. 10-pin DAP connector,
. Reset button,
. 2 × Shield2GO connector for Infineon Maker Shields,
. EEPROM 1Kbit.
The AURIX™ Development Studio, shown in Fig. 7.7, is a free-of -charge Integrated
Development Environment (IDE) for the TriCore™-based AURIX™ microcontroller
family. It is a comprehensive development environment, including Eclipse IDE, C-
compiler multicore debugger, and Infineon Low-Level Driver (iLLD). There are
no time or project size restrictions. It enables editing, compiling, and debugging
168 I. Todorović et al.
of application code. The debugger and compiler are intended to be used in non-
productive projects.
The AURIX™ Development Studio also comes with examples related to:
. Communication protocols (ASCLIN module handling for LIN, UART, SPI, and
CAN communication),
. Data handling (e.g., flexible CRC engine control, input–output monitor control,
bus register protection, memory protection control, data and program flash
programming, direct memory access control, memory test),
. Timers (e.g., signal capturing, clock system, PWM signal generation),
. Analog signals (e.g., analog-to-digital converter control, delta-sigma analog-to-
digital converter control),
. General-purpose input–output control, CPU management (e.g., code execution
from SRAM, performance register usage, power management system control,
multicore, trap recognition, watchdog handling),
. Alarms (e.g., device reset type trigger and detection, interrupt handling, safety
management unit control).
Those examples can be easily imported to AURIX™ Development Studio.
Figure 7.8 partially shows the list of examples available for the AURIX™ TC275
Lite Kit.
7 Development of Electric Vehicles Applications … 169
Fig. 7.8 Infineon code examples, import to the AURIX™ development studio
The Infineon Low-Level Driver library (iLLD) provides access and configuration
functions to the integrated peripherals of the Infineon AURIX™ family of micro-
controllers. iLLD is intended to be used as non-productive software. Together with
SFR header files, iLLDs are a fundamental part of the infrastructure for tests and
applications.
iLLDs consist of the following components:
. Standard layer with (verbose) access functions to SFRs,
. The interface layer has configuration and handling functions, which will imple-
ment the use cases. Multiple interface layers could be available if the peripheral
is used for different purposes,
. The infrastructure layer consists of SFR headers and application startup software,
which are also used by the MCAL software,
. The implementation layer consists of device configuration,
. Pin maps configuration to configure I/O pins,
. The service software layer provides a generic runtime API for a common
application use case. It abstracts the underlying interface driver.
As shown in Fig. 7.9, the documentation is generated using Doxygen. The docu-
mentation can be downloaded from the Infineon website (Infineon Low Level Driver
documentation n.d.).
170 I. Todorović et al.
7.3.5 OneEye
OneEye is a free of charge Windows application that enables the users to create
their own Graphical User Interface (GUI) and to interact with an Electronic Control
Unit (ECU) during runtime. Different kinds of widgets like graphs, oscilloscopes,
sliders, numeric fields, and pictures enable the user to visualize the state of the
ECU and control the ECU. OneEye communicates with the target over the selected
communication interface (such as CAN, COM, Ethernet, etc.) using text or binary
protocols.
OneEye can be downloaded from the Infineon toolbox (Infineon Toolbox n.d.;
softwaretools.infineon.com n.d.). The latest version supports the Infineon device
access server. This feature enables the user to have direct read and write access to C
variables.
Figure 7.10 shows OneEye in edit mode. Users can enable Tool Box, Property
Box, Browser, or Debug Box. Those boxes and their usages are described in OneEye
help.
7.4 Setup
The setup, shown in Fig. 7.11, for the development of xEV applications (but not
limited to) consists of:
7 Development of Electric Vehicles Applications … 171
Fig. 7.11 Setup for development of xEV applications (University of Novi Sad, Serbia)
172 I. Todorović et al.
Figure 7.12 shows the block diagram of the interface board, which is designed to
enable a seamless interface between AURIX™ development kits, such as AURIX™
TC275 LiteKit or TC375 LiteKit, and any of the HIL4 and HIL6 series devices.
Features:
. Headers for one AURIX™ TC275 LiteKit (or AURIX™ TC375 LiteKit),
. All HIL and development board signals available through sensing terminals,
. 5 V and 3.3 V power supply jumpers (HIL or development board) with LED
indication,
. 16 HIL digital inputs,
. 16 HIL digital outputs (level shifted to 3.3 V),
. 16 HIL analog outputs (clamped to 3.3 V),
. A total of 8 BNC terminal posts are provided (e.g., for easy oscilloscope
connection for analog signal monitoring).
The following figure shows the pinout of AURIX™ TC275 LiteKit connectors X1
and X2 connected to HIL digital inputs/outputs and HIL analog outputs (Fig. 7.13).
Fig. 7.13 Pinout of AURIX™ TC275 LiteKit connectors X1 and X2 which are connected to HIL
IO connectors
One of the HIL digital outputs can be used as a start or stop command toward the
microcontroller.
Figure 7.15 shows a block diagram of a setup that can be used for developing
a sensorless FOC of a PMSM or IM. In addition to the previously described plant
model, in this example, emulated phase current and DC-link voltage signals can be
sensed using the microcontroller’s ADC unit. During the development of a sensorless
algorithm, one of the ADC channels can be used to sense the emulated rotor position.
174 I. Todorović et al.
The estimated position can be compared with the emulated one and the output of the
sensorless algorithm can be validated.
Figure 7.16 shows a block diagram of a setup that can be used for developing a
dual motor drive. Two sensorless FOC of a PMSM or IM can be implemented in
parallel. The emulated phase current and DC-link voltage signals can be sensed using
the microcontroller ADC unit. During the development of a sensorless algorithm,
one of the ADC channels, per drive, can be used to sense the emulated rotor position.
The estimated position can be compared with emulated one and the output of the
sensorless algorithm can be validated.
One of the HIL digital outputs, per drive, can be used as a start or stop command
toward the microcontroller.
Figure 7.17 shows a block diagram of a setup that can be used for developing a
sensored FOC of PMSM or IM. The emulated phase currents and DC-link voltage
signals can be sensed using the microcontroller ADC unit. The DSADC unit can
be used to generate resolver carrier signals and acquire resolver sine and cosine
signals. In addition, during development, one ADC channel might be used to sense
the emulated rotor position. The position recalculated based on signals from the
DSADC can be compared with the emulated one connected to the ADC channel.
One of the HIL digital outputs can be used as a start or stop command toward the
microcontroller.
Figure 7.18 shows a block diagram of a setup that can be used for developing an
open-loop control of interleaved boost converter. In this example, the interleaved
boost converter is a converter in which three boost converters are connected in
parallel. Both, continuous and discontinuous conduction modes can be tested. The
plant model can be created using the HIL Schematic Editor by taking:
. The voltage source from the Sources library,
. The boost converter (switch and diode are modeled as ideal switches) component
from the Converter library,
. The inductor, resistor, and capacitor are from the Passive Components library.
One of the HIL digital outputs can be used as a start or stop command toward the
microcontroller.
Figure 7.19 shows a block diagram of a setup that can be used for developing an
AC/DC converter. The plant model can be created using the HIL schematic editor
by taking:
. The voltage source from the Sources library,
. The single-phase diode rectifier (diodes are modelled as ideal switches), single-
phase inverter (switches and diodes are modelled as ideal switches), and boost
7 Development of Electric Vehicles Applications … 177
converter (switch and diode are modelled as ideal switches) components from the
Converter library,
. The inductor, resistor, and capacitor are from the Passive Components library.
178 I. Todorović et al.
One of the HIL digital outputs can be used as a start or stop command toward the
microcontroller. The emulated voltage and current signals can be acquired using the
microcontroller’s ADC unit.
Figure 7.20 shows a block diagram of a setup that can be used for developing an
active front-end and dual-active bridge converter. The plant model can be created
using the HIL Schematic Editor by taking:
. The voltage source from the Sources library,
. The single-phase rectifier (switch and diode are modelled as ideal switches),
and single-phase inverters (switches and diodes are modelled as ideal switches)
components from the Converter library,
. The inductor, resistor, and capacitor from the Passive Components library,
. The ideal transformer component from the Transformers library.
One of the HIL digital outputs can be used as a start or stop command toward the
microcontroller. The emulated voltage and current signals can be acquired using the
microcontroller’s ADC unit.
Permanent magnet synchronous motors play a very important role in advanced regu-
lated electric drives, mostly because of high power density, relatively small rotor
7 Development of Electric Vehicles Applications … 179
Figure 7.21 shows a block diagram of the setup which can be used for developing
a sensorless/sensored FOC of a PMSM. The emulated phase current and DC-link
voltage signals are sensed using the microcontroller’s ADC unit. There is an option
that one of the ADC channels is used to sense the emulated rotor position. The plant
model is created using the HIL Schematic Editor by taking:
. The voltage source from the Sources library,
. The three-phase inverter (switches and diodes are modelled as ideal switches)
component from the Converter library,
. The PMSM from the Machines library (parameters of used Nanotec motor can be
found in Nanotec motor datasheet n.d.).
One of the HIL digital outputs is used as a start or stop command toward the
microcontroller.
The models of the PWM inverter, DC power supply, and electric motor are
emulated with a time-step of 1 μs, while the control algorithm with a PWM carrier
frequency of 20 [kHz] is implemented using a control platform based on the Infineon
AURIX™ TC275 LiteKit. OneEye is used to send commands to microcontrollers
and plot system variables using graph and oscilloscope functionality.
The block diagram of the PMSM drive control system is shown in Fig. 7.22.
Speed is regulated by a proportional-integral regulator which outputs the q-axis
current reference. The d-axis current reference can be set manually using OneEye.
The d- and q-axis currents are regulated by proportional-integral regulators and
their outputs are d- and q-axis voltages. Those voltages are transformed to αβ refer-
ence frame using inverse Park transform. Outputs of Inverse Park transform are
inputs for space vector block, which converts them to PWM signals duty cycles.
Phase current signals are converted to dq reference frame using Clarke and Park
transforms.
The three-phase two-level inverter has six power switches and in order to control
them, six synchronized PWM signals shall be generated. The dead time shall be
inserted to avoid damage to power switches.
In this example, the GTM is used as a PWM unit. Based on the functionality of
available pins, on AURIX™ TC275 LiteKit connectors X1 and X2, different sets of
the GTM TOM channels can be used. The function of each port pin can be found
in Infineon-TC27xDC-DataSheet-v01_00-EN n.d. Since the GTM module of the
AURIX™ TC275 does not have a dead time module, seven TOM/ATOM channels
are used, one as a master timer and six to generate PWM signals.
GTM TOM submodule with its channels and port pins used for PWM generation
are listed in the table below (Table 7.3).
7 Development of Electric Vehicles Applications … 181
Fig. 7.24 Schematic editor: selection of digital inputs used in inverter model
Fig. 7.25 OneEye: testing of PWM generation using scalar control (V/f control)
same time. But, if we consider that system is symmetrical, then it is enough to sense
two-phase currents synchronously.
AURIX™ TC275 peripherals used for the phase current and voltage sensing are
shown in Table 7.4.
While some GPIO pins are used as analog inputs, the VADC Pull Down
Diagnostics/Multiplexer Diagnostics are disabled for those pins.
The waveforms of three-phase currents, DC-link voltage, and open-loop electrical
angular motor position are shown in OneEye (Fig. 7.26, left). The waveforms of three-
phase currents, DC-link voltage, electrical and mechanical angular motor position,
and mechanical speed are shown in HIL SCADA (Fig. 7.26, right).
Fig. 7.26 Current and voltage sensing: OneEye(left) and HIL SCADA (right)
184 I. Todorović et al.
In the FOC algorithm, it is necessary to have an accurate position of the rotor in order
to achieve independent control of flux and torque. The emulated electrical position
is scaled to range from 0 to 2π [rad] and sensed with the microcontroller’s ADC
unit. If one assumes that the system is symmetrical, then two-phase currents instead
of three can be sensed, and instead of the third one, the ADC channel can be used
to sense emulated electrical position. Based on the electrical angular motor position,
speed can be recalculated.
AURIX™ TC275 peripherals used for phase current, voltage, and electrical
position sensing are shown in Table 7.5.
The waveforms of two-phase currents, DC-link voltage, and electrical angular
motor position are shown in OneEye (Fig. 7.27, left). The waveforms of two-phase
currents, electrical and mechanical angular motor position, and mechanical speed
are shown in HIL SCADA (Fig. 7.27, right).
After confirming that phase current, DC-link voltage, electrical angular motor posi-
tion, and speed calculation are correct, current and speed loops can be closed.
Figure 7.28 shows the OneEye configuration on the left side and HIL SCADA on the
right side. Using OneEye, it is possible to set controller references. In a particular
example, the d-axis current reference is set to zero and the speed reference is changed
in steps of 50 [rad/s]. In the OneEye graph, one can notice the response of the speed
and current PI controllers.
7 Development of Electric Vehicles Applications … 185
Fig. 7.27 Position and current sensing: OneEye (left) and HIL SCADA (right)
Fig. 7.28 OneEye (left): Response of the speed and current controllers and HIL SCADA (right)
7.7 Conclusion
The transportation sector transformation has accelerated in recent years. This has
been and will be facilitated through the usage of specific development, testing, and
verification tools. One of the most important tools in this regard is hardware-in-the-
loop setups, and in particular, controller hardware-in-the-loop setups. This chapter
has depicted one C-HIL setup that consists of a modern real-time simulator, a micro-
controller commonly used in the automotive industry, and pertinent hardware and
186 I. Todorović et al.
software tools. It has been shown how this safe and flexible environment can be used
to design and develop software functionalities for various power electronics-based
systems in the domain of xEV, without any concerns stemming from real power
stage utilization. The material provided in the chapter can be used as a set of guide-
lines for interested engineers and researchers, but also by the students and the young
developers that are interested in taking part in the transportation evolution.
References
https://softwaretools.infineon.com/tools/com.ifx.tb.tool.oneeye3
Anselma PG, Belingardi G (2019) Next generation HEV powertrain design tools: roadmap and
challenges, pp 2019–01–2602. https://doi.org/10.4271/2019-01-2602
AURIX™ TC2xx microcontroller expert-training: https://www.infineon.com/aurix-expert-training
Electric Cars: Calculating the Total Cost of Ownership for Consumers (2021) The Euro-
pean Consumer Organisation, 2021. [Online]. Available: https://www.beuc.eu/publications/
beuc-x-2021-039_electric_cars_calculating_the_total_cost_of_ownership_for_consumers.pdf.
Accessed 6 Jan 2022
Infineon, “Infineon PIL.” https://www.mathworks.com/products/connections/product_detail/inf
ineon-tricore-microcontrollers.html
Infineon, “Virtualizer Development Kit.” https://www.infineon.com/cms/en/product/promopages/
virtualizer-development-kit/
Infineon-TC27x_D-step-UM-v02_02-EN: https://hitex.co.uk/fileadmin/uk-files/downloads/Shield
Buddy/tc27xD_um_v2.2.pdf
Infineon-TC27xDC-DataSheet-v01_00-EN: https://www.infineon.com/dgdl/Infineon-TC27xDC-
DataSheet-v01_00-EN.pdf?fileId=5546d462694c98b4016953972c57046a
Infineon-AURIX_TC275_Lite_Kit-UserManual: https://www.infineon.com/dgdl/Infineon-
AURIX_TC275_Lite_Kit-UserManual-v01_02-EN.pdf?fileId=5546d46272e49d2a01730
5871f9464ab
Infineon Low Level Driver documentation: https://www.infineon.com/aurix-expert-training/
TC27D_iLLD_UM_1_0_1_12_0.chm
Infineon Toolbox: https://www.infineon.com/toolbox
MathWorks, “C compilers for Matlab.” https://www.mathworks.com/support/requirements/suppor
ted-compilers.html
Morimoto S, Tong Y, Hirasa T (1994) Loss minimization control of permanent magnet synchronous
motor drives. IEEE Trans Ind Electron 41(5)
Nanotec motor datasheet: https://en.nanotec.com/fileadmin/files/Datenblaetter/BLDC/DB42/DB4
2S02.pdf
Report on EV charging pricing, regulatory framework and DSO role in the e-mobility development
(2020) Interreg Europe, 2020. [Online]. Available https://www.interregeurope.eu/sites/default/
files/inline/file_1628687446.pdf. Accessed 6 Jan, 2022
STMicroelectronics Microcontrollers & Microprocessors. https://www.st.com/en/microcontrollers-
microprocessors/stm32-32-bit-arm-cortex-mcus.html
Texas Instruments C2000 real-time microcontrollers. https://www.ti.com/microcontrollers-mcus-
processors/microcontrollers/c2000-real-time-control-mcus/overview.html
Typhoon HIL General Specification. https://www.typhoon-hil.com/documentation/typhoon-hil-har
dware-manual/hil4-6_series_user_guide/References/hil4-6_general_specifications.html
World Energy Outlook (2020) International energy agency. [Online]. Available: https://iea.blob.
core.windows.net/assets/a72d8abf-de08-4385-8711-b8a062d6124a/WEO2020.pdf. Accessed 6
Jan 2022
Chapter 8
Electric Vehicles Digital Twinning Using
x-HIL Platforms
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 187
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_8
188 I. Todorović and I. Isakov
8.1 Introduction
The means for people and goods transportation are being increasingly transformed
since the end of the twentieth century and although new vehicles for public trans-
portation are developed, more evident and rapid changes are introduced in the design
of vehicles used for personal transportation (Global EV Outlook 2021). The changes
are coming in many forms, but the following three aspects of vehicles are most
substantially changed—propulsion (i.e., what energy is used for propulsion), vehicle
utilization optimization, and security. The vehicles that will be used in the following
decades will be decreasingly based on oil derivatives and internal combustion engines
and increasingly on electric batteries (and other electric energy storage elements) and
electric drives. Also, mechanisms for energy utilization optimization are integrated
into vehicle control structures. Similarly, many novel systems for driving comfort and
entertainment during vehicle usage are developed. Hence, the vehicles are becoming
highly customizable, personalizable, and generally optimizable. This certainly was
not the case for traditional vehicles. Finally, it is expected that new vehicles will be
much safer to drive and consequently significant efforts are invested in developing
driving assistance and autonomous driving tools.
All these changes, and generally proliferation of hybrid and later pure electric
vehicles, have been initially instigated more by the shifts in ecological, social, and
cultural norms than by technological improvements. Arguably, the only advance-
ment of fundamental importance for electric vehicles (EVs) recently was made in
the domain of batteries—the nickel-metal hydride and lithium-ion batteries have
matured sufficiently so that a reasonable driving range can be achieved, while driving
performance can be comparable with a traditional car (Khaligh and Li 2010). The rest
of the relevant technologies (power electronics devices, motors, mechanical devices)
were at least in principle well known and already in use in a wide range of similar
applications.
Still, to continue the trend of accelerated electric vehicles development and usage,
the ecological reasons and the market pull will not suffice. The EVs are still facing
many problems stemming from the EVs’ performances, how they are built and how
they are handled once they reach the end-of-life product stage. These problems must
be addressed, i.e., a range of technological advancements must be achieved, before
the mass adoption of EVs can take place.
To facilitate and accelerate some of the necessary technological advancements,
one platform that has emerged in recent years as a powerful research and development
tool, in many different engineering domains, can be adopted—the digital twin.
Remark: It should be noted that although some researchers and engineers consider
the digital twin to be the same thing as what is traditionally called a (simulation)
model, here these two will be differentiated. Indeed, they are conceptually quite
8 Electric Vehicles Digital Twinning Using … 189
similar, but it could be said that there is a subtle, yet important difference. The
(simulation) model is a construct traditionally implemented on personal computers
or some similar platforms. The digital twin is a construct that is implemented on any
digital computer platform. In other words, all (simulation) models are digital twins,
but not vice versa. Although this may seem like irrelevant semantic hairsplitting, in
praxis it can result in significant differences. Namely, some modern digital computer
platforms allow real pieces of hardware to be included in the digital twin. This
can increase significantly the credibility and precision of research and development
procedures (in comparison to traditional personal computer simulations). Moreover,
many novel digital platforms are dedicated to the development of a specific kind
of digital twins, i.e., are not general-purpose platforms such as personal computers.
Consequently, the digital twin’s execution can be much faster (real-time or faster
than real-time execution is possible).
Digital twins, or replicas, are representations of addressed systems implemented
on different digital computer platforms. They can be realized with varying preci-
sion and accuracy. Among others, the important advantage of using digital twins, in
comparison to full power or scaled-down prototypes, is that digital twins are much
safer and more flexible to operate, leading to accelerated testing and development
procedures for novel concepts and devices.
The main goal of this chapter is to provide the reader with the digital twin of an
EV that can be used to facilitate some of the crucial technological advancements,
particularly those that are in broad terms related to EV traction. Correspondingly,
the digital twin consists of all subsystems, relevant for the EV traction examination,
which can be found in an EV:
• Electric energy storage elements.
• Power electronics devices.
• Traction motor(s).
• Vehicle’s kinematic model.
The chapter provides theoretical and conceptual details necessary for digital twin
synthesis. Relevant data and technical information are also given. Finally, together
with the text, the digital twins that can be readily run, altered, and improved are
provided.
In the following section of the chapter, the platform for digital twinning is
described. The third section offers the theoretical background for digital twin
synthesis. The hardware and software aspects of the EV are explicated with reason-
able details. The fourth section contains details regarding the EV digital twin imple-
mentation. The fifth section is dedicated to the examination of the developed digital
twin. The last section offers an overview of the chapter and concluding remarks.
190 I. Todorović and I. Isakov
The digital twins in general can be developed using a wide range of platforms,
depending on the specificities of the research and development goals. Model-in-the-
loop (MIL), processor-in-the-loop (PIL), controller-hardware-in-the-loop (C-HIL),
power-hardware-in-the-loop (P-HIL), and other approaches are extensively in use
nowadays. The details on these and other paradigms used for digital twinning can be
found in Todorović and Isakov (2022).
Still, for EV digital twinning, the most meaningful approaches are MIL, C-HIL,
and P-HIL.
MIL corresponds to the traditional personal computer (PC)-based modeling. Both
power stage and control structure elements are implemented within the same envi-
ronment (PC), oftentimes using similar elements native to the simulation tools used
for digital twin development. Advantages of the MIL approach are safety (no real,
especially high power, devices are used), flexibility (pertinent tools can be used to
generate digital twins for various applications, with various levels of precision and
complexity), and tools availability (only a PC with specific software is necessary).
The disadvantages are that digital twins are run on PCs that are not optimized for any
type of digital twins in particular. Hence, even for the twin of moderate complexity
and level of precision, execution is significantly slower than real-time execution.
This impedes development and testing processes significantly. Also, the MIL usually
offers only crude information on how the real system is going to behave.
C-HIL is based on a dedicated digital computer platform, i.e., assumes the usage
of specific devices designated as real-time simulators (RTSs) or emulators. These
devices are designed to be capable of running the digital twin in real-time. The
RTSs are used for power stage implementation, while the control structures are
implemented on a real controller card. C-HIL got its name because a real piece
of hardware (controller with the control code) is “in the loop”, i.e., its behavior is
inspected in more detail. The advantages of C-HIL are that fast development and
testing procedures are possible, that a real controller with real control code is used,
and that this environment is also quite safe since no high-power devices are used.
There are no significant disadvantages of C-HIL usage. C-HIL does assume the usage
of emulators, specific kind of devices, but the price of these devices is nowadays
comparable to the price of some simulation software packages (such as MATLAB).
P-HIL is a platform that is conceptually quite similar to C-HIL. It is also based on
real-time simulators or emulators. Hence, the digital twins are also run in real-time.
The difference is that in P-HIL, a (high) power device is tested, i.e., “in the loop”. The
emulators again implement a certain power stage, but the emulators are interfaced
with a high-power device-under-test and not a low-power device such as a controller
board. This is a great way to examine the behavior of a power electronics device in
different working conditions, for example. Still, as this approach assumes usage of
a specific, usually custom-made, device that is tested the P-HIL approach will be
disregarded in the remainder of the text (although P-HIL generally is relevant for
8 Electric Vehicles Digital Twinning Using … 191
EV digital twinning). The provided material then would not be of interest to a wider
audience and replicability of the provided digital model would be modest at best.
Here, the Typhoon HIL toolchain will be used to derive both MIL and C-HIL
digital twins. The reasons why this toolchain is chosen are as follows:
• The same software can be used to derive MIL and C-HIL digital twins and
switching from MIL to C-HIL approaches is quite easy.
• The software for digital twins’ design is completely free (Typhoon n.d.). Hence,
users can develop MIL digital twins free of charge, only a PC is needed (for C-HIL
emulators are necessary and are not free).
• There is a rich library of readily available elements that can be used to
build comprehensive digital twins. Also, many examples can facilitate twin
development.
The two most important software tools are Schematic Editor and HIL SCADA.
Schematic Editor is used to graphically design the digital twin, using the mentioned
library of elements. In the case of MIL, the power stage and control structures are
designed in the Schematic Editor. Afterward, the file created with the Schematic
Editor is compiled and run on a PC. The MIL approach can be designated VHIL
(virtual hardware-in-the-loop) here since the virtual hardware-in-the-loop paradigm
is utilized. If the C-HIL setup is used, the power stage of the digital twin is again
designed using Schematic Editor, but the control code is generated using other soft-
ware tools (in accordance with the used controller card). The file created using the
Schematic Editor, containing the digital twin’s power stage, is compiled and down-
loaded to an emulator or emulators (depending on digital twin’s complexity). HIL
SCADA, as the name suggests, is used to collect and visualize the data from the
digital twin. Also, the HIL SCADA can be used to generate control signals and
generally manage the digital twin. The HIL SCADA is in both cases similarly used.
In Fig. 8.1, simplified schemes of the MIL and C-HIL setups can be found. Red
arrows represent a model loading pathway. Blue arrows represent data exchanged
between the HIL SCADA and the digital twin. Black arrows represent the analog
and digital signals exchanged between the emulator and the interface board, i.e.,
the controller. “CC” stands for control code and “PS” stands for the power stage.
It should be emphasized that the power stages, built with the Schematic Editor, are
rather similar for both types of digital twins. The only significant difference is how
the signals exchanged between the power stage and control scheme are generated
and routed. Consequently, once the digital twin for MIL (VHIL) is built, it is a trivial
task to create one for the C-HIL setup. Regarding the Schematic Editor, only settings
under Control for power electronics devices should be changed (Internal modulator
or Model for MIL and Digital input per switch or Digital input per leg for C-HIL),
as indicated in Fig. 8.2. In the first case, the modulating signals or gate signals are
generated by the control structures executed on the PC, together with the power
stage. In the second case, real gate signals are coming from the controller card, via
the interface board, to the emulator.
In the remainder of the text, the focus will be more on MIL/VHIL than on the
C-HIL approach since MIL digital twin is portable and replicable. Also, as indicated
192 I. Todorović and I. Isakov
Fig. 8.2 Parts of Schematic Editor diagrams and settings windows for MIL (a) and C-HIL (b)
8 Electric Vehicles Digital Twinning Using … 193
previously, once the MIL digital twin functions properly, the C-HIL digital twin
can be derived in the manner of minutes. Finally, some details on how the C-HIL
environment can be established, using commercially available controllers popular
in the automotive industry (AURIX™ TriCore™ microcontrollers), can be found in
Chap. 7 and will not be repeated here.
The simplified scheme of the vehicle that will be modeled is given in Fig. 8.3. The
electric vehicle with two electric energy storage systems (battery and supercapaci-
tors) is considered. Those storage systems are connected to a common DC link via
two bidirectional buck-boost converters. These two converters secure the stability of
the DC-link voltage. The three-phase traction inverter is also connected to the DC
link. The inverter is used to drive permanent magnet synchronous machines. The
machine is “loaded” with the vehicle’s kinematic model. The sensors and variables
feedback lines are not depicted in the figure. Also, from the mentioned DC link
other, smaller power, devices could be powered, but these devices are not regarded
in the EV digital twin (they generally are of secondary importance for the vehicle
behavior).
The EV digital twin with two energy storage systems is considered since this kind of
storage hybridization brings several operational and reliability-related advantages.
In the context of EVs, the battery storage system is a high specific energy system
(securing long driving range), while the supercapacitor system is a high specific
power system (enabling high torque, i.e., acceleration, to be realized). Consequently,
the vehicles with these two storage systems can deliver significantly better driving
performances and energy recuperation. Similarly, the current profile that is necessary
to be realized for a specific driving profile can be separated into two components.
One, slow-changing component, is to be realized by the battery system and the other,
fast-changing component, is to be realized by the supercapacitor system. The absence
of abrupt changes in battery current extended the battery life significantly. Also, the
battery could have smaller current and even capacity ratings, resulting in a smaller,
cheaper, and lighter battery system, etc. (Vazquez et al. 2010).
The batteries and supercapacitors are complex electrochemical elements and their
precise modeling can be quite complex. Within the Typhoon HIL toolchain, or more
precisely within Schematic editor, three types of batteries and supercapacitors models
can be utilized:
• Models from Schematic Editor Library. These elements are parametrizable, but
the model’s structure cannot be significantly changed. This is the fastest and the
easiest way to include a battery or supercapacitor in a digital twin (by simply
dragging and dropping the element in the digital twin), but can be less precise and
accurate.
• Models based on look-up tables. These models are simple since there is no analyt-
ical battery of supercapacitor model derivation. Also, these models can be precise,
but for specific operating conditions. If some variable of operational importance
is changed (for example, ambient temperature), the look-up table could become
inadequate.
• Custom-made models. These models are implemented using C-function blocks
that are available in the Schematic Editor Library. C-functions can be used to
implement almost arbitrarily complex analytical expressions that shall secure
similar storage model behavior to a behavior of a real storage system. Also, look-
up tables can be used here also, if necessary, to augment models’ precision. This
way of elements modeling is the most time-consuming, but the models are the
most accurate and correspond precisely to real systems. Still, these models can
be quite complex and special care should be given when choosing which model
should be used, especially if a system-wide behavior is examined.
Here, the first type of battery and supercapacitor models will be used. The models
that are available in the Library (out of the box) can be parametrizable to a satisfactory
extent and they do capture the most relevant behavioral features of interest for EV
digital twinning.
Following the EV outline given in Fig. 8.3, the two most important types of power
electronics devices will be used in the digital twin—bidirectional DC-DC converter
and three-phase inverter.
8 Electric Vehicles Digital Twinning Using … 195
The bidirectional DC-DC converters are used since two-way energy flow must
be secured both for the battery and supercapacitor system. There are many novel
bidirectional DC-DC converters, some of which are multiport DC-DC converters.
Indeed, these converters seem suitable for usage in EVs with more than one energy
storage system. Still, they tend to be complex, while not bringing particularly better
performances. Consequently, they are not proven commercial solutions and still
have not found a way to mass-produced EVs. Instead of these novel solutions, a
traditional bidirectional DC-DC converter will be adopted—a transistor leg with
passive elements (capacitors and inductors). This converter is shown in Fig. 8.4.
Regarding the control of the DC-DC converter, the current loop is realized using
peak current mode control since it is a simple, fairly robust way of controlling the
current flow in DC-DC converters (Erickson and Maksimović 2001). The control
scheme for one DC-DC converter is represented in Fig. 8.5. In the figure, the Ix ref is
a reference value of the current that should be absorbed or generated by the energy
storage system. The trigger signal is used to set the RS flip-flop periodically (at
the frequency at which the transistors should be switched—pulse width modula-
tion frequency). The flip-flops are reset at the moment when the storage system’s
instantaneous current becomes larger than the reference current value. Please note
the orientations of Ixboost and Ixbuck currents in Fig. 8.4. Letter x stands either for
battery or supercapacitor. For the peak current mode to function properly, a suffi-
ciently large inductor must be used, so that the peak current does not differ too
much from the average current level (Erickson and Maksimović 2001). The rest of
the scheme activates or deactivates the appropriate transistor so that the appropriate
current flow direction is secured. In the overall control structure, the DC-link voltage
control is also assigned to the DC-DC converter. Hence, the DC-link voltage control
loop, encompassing current control loop(s), generates the cumulative current refer-
ence (Iref ) to be produced by both storage systems. The currents produced by the
two storage systems must be in a sum equal to the Iref in a steady state. The Iref
is separated into the reference currents for battery and supercapacitor systems by
employing a simple low-pass filter, as shown in Fig. 8.6. IB ref is then forwarded to
the current control loop of the DC-DC converter connected to the battery system and
ISC ref is forwarded to the current control loop of the DC-DC converter connected to
the supercapacitor system.
For the traction converter, a standard three-phase two-level voltage source inverter
is used. This is a reliable, simple, effective, and well-understood topology. Other
196 I. Todorović and I. Isakov
topologies have been proposed, but this converter is used in commercial vehicles,
albeit with improvements made to increase the reliability, efficiency, and power
density of this traditional converter.
The inverter is driven by the sensored field-oriented control, outlined in Fig. 8.7
(Vukosavic 2011). Speed and current regulators are implemented using proportional-
integral regulators. The modulator based on the space-vector modulation tech-
nique generates gate signals. The d-axis current reference is held at zero, i.e., flux-
weakening is not implemented, although it is an important feature in EVs (the drives
must achieve high-speed values). This can be implemented using a look-up table or
some analytical scheme for the derivation of id ref for a specific speed and specific
loading of the traction machine (Marčetić 2014).
Fig. 8.7 Sensored field-oriented control for permanent magnet synchronous machine
8 Electric Vehicles Digital Twinning Using … 197
It should be emphasized that all necessary power electronic devices for EV digital
twinning can be readily found in the Schematic Editor Library, i.e., there is no need for
additional modeling. Also, the elements present in the Library are made out of ideal
switches. Still, it is possible to include the data for real (non-ideal) semiconductor
devices, if losses analysis or some similar analysis should be conducted.
Depending on the vehicle’s traction system (and instantaneous torque and power
produced by the traction system) and mechanical characteristics of the vehicle (mass
of the vehicle, chassis type, center of mass, etc.) different operating points (speed and
acceleration) and performances can be realized. Consequently, to create a compre-
hensive electric vehicle digital twin, a vehicle’s kinematic model must be derived
and implemented.
Although the pertaining analysis can become quite involved, here the five basic
forces exerted onto the moving vehicle will be addressed in simplified form.
The cumulative force exerted onto the vehicle can be expressed in the following
form (Ehsani 2018):
1
Fa = ρ AC D (v − vV a )2 (8.2)
2
Fr = μk · m · g (8.3)
Fg = m · g · sinα (8.4)
• α—slope angle,
• m—vehicle mass (expressed in kg),
• g—gravitational acceleration (9.8 m/s2 ).
Fla = m · a (8.5)
The force necessary for angular acceleration of the vehicle’s rotating masses can be
calculated using (8.6):
8 Electric Vehicles Digital Twinning Using … 199
J ·G 2 · a
Fωa = (8.6)
r 2 · ηg
Hence, the cumulative force developed by the traction system can be written in the
following form:
1 J G2a
Fc = ρ AC D (v − vV a )2 + μk mg + mgsinα + ma + 2 (8.7)
2 r ηg
G 1 dv J G 2 dv
ηg Tc = ρ AC D (v − vV a )2 + μk mg + mgsinα + m + 2 (8.8)
r 2 dt r ηg dt
Finally, after rearranging (8.8), the expression that can be simply implemented is
obtained as follows:
G 1 J G 2 dv
ηg Tc = μk mg + mgsinα + ρ AC D (v − vV a )2 + m + 2 (8.9)
r 2 r ηg dt
The digital twin is organized so that the output of the vehicle’s kinematic model
is the speed that is then forwarded and imposed on the traction motor. The motor
generated a torque (Tc ) which is in turn forwarded to the vehicle’s kinematic model.
Besides the Tc , regarding (8.9), the inputs to the vehicle’s kinematic model are air
speed and slope angle, while the rest of the variables are considered constant.
In this chapter, the implementation of the EV digital twin introduced in the previous
chapter and outlined in Fig. 8.3 will be presented. The digital twin is realized using
Typhoon HIL VHIL software (MIL paradigm). Still, as indicated previously, once
VHIL is operating correctly, it is a trivial task to create a digital twin that can run on
real-time simulators (taking into account that the control code, in that case, has to be
implemented on a dedicated microcontroller).
200 I. Todorović and I. Isakov
The settings for battery and supercapacitor systems are shown in Fig. 8.8. The settings
were chosen in accordance with standard values used in commercial vehicles. The
current limits are set within the pertaining control loops. In the Battery type menu,
other battery types can be chosen, including a User-defined battery. In the Signal
Processing tab, the user can enable the battery’s state-of-charge to become avail-
able for further calculations. This information is useful for energy management
strategies. Similarly, the supercapacitor voltage is measured in order to dispatch
the supercapacitor only when its state-of-charge is within defined limits.
The part of the schematic that contains DC-DC converters and other relevant elements
is shown in Fig. 8.9. How signals (gate signals and measured currents and voltages)
are routed can be also seen in the figure.
Figure 8.10 depicts the DC-link voltage control loop. The proportional gain of
the regulator is set to 0.2 and the integral gain is set to 20. The low-pass filter cutoff
frequency is set to 1 Hz. The C-function block seen in the figure implements an energy
management scheme. In the provided model, rudimental functions are implemented
and it is up to readers to expand and improve the functionalities of this block and
implement a more comprehensive energy management strategy. The outputs of the
“energy management” block are reference values for battery and supercapacitor
currents. The DC-link voltage control loop is executed at 10 kHz (this frequency is
marked Ts in the Model initialization script).
The peak current mode control for the DC-DC converters, which corresponds to
Fig. 8.5, is shown in Fig. 8.11. The control is the same for the battery and super-
capacitor system. Only the current references are different. The flip-flops are set at
100 kHz frequency. The outputs of this loop are the gate signals for transistors.
Figure 8.12 depicts the three-phase inverter and how the relevant signals are
routed. Since the control structures are implemented in the same environment as
Fig. 8.10 DC-link voltage control loop with current reference management
Fig. 8.11 Control for DC-DC converters driving SC and battery system
the power stage, the signals that drive transistors are present in the figures both for
DC-DC converters and three-phase inverters.
There is a slight difference—for DC-DC converters, the gate signals are routed,
while for the three-phase inverter, the modulating signals are routed (the gate signals
are calculated internally). Accordingly, the settings for DC-DC converters and the
inverter are different, as depicted in Fig. 8.13.
Figures 8.14 through 8.16 are relevant for three-phase inverter control. In Fig. 8.14,
the speed control loop of the PMSM is shown. A standard proportional-integral
regulator with anti-windup protection is implemented. The reference speed is set by
the look-up table that is defined by the Common Artemis Driving Cycle (Urban).
8 Electric Vehicles Digital Twinning Using … 203
Fig. 8.13 Settings for the IGBT legs (a) and the three-phase inverter (b)
Since the control scheme for the inverter is normalized, the data coming from the
look-up table had to be also “normalized”. Hence, the gain is placed after the look-up
table.
Figure 8.15 depicts the current loop, regulating the PMSM direct current compo-
nent. The reference value for this loop can be set from the HIL SCADA if desired
(default value is zero). The output is the necessary direct voltage component that
shall be realized by the inverter (in p.u.).
Figure 8.16 depicts the current loop, regulating the PMSM quadrature current
component. The reference value for this loop is defined by the speed control loop.
204 I. Todorović and I. Isakov
The output is the necessary quadrature voltage component that shall be realized by
the inverter (in p.u.).
Figure 8.17 shows the part of the schematic that consists of normalization blocks,
Park and Clarke transformations, and inverse transformations. Also, block imple-
menting space-vector modulator is depicted. The modulating signals coming from
the space-vector modulator are fed to the three-phase inverter. Please note that the
power-invariant Clarke transformation is used. The data for the PMSM and other data
relevant for the converter’s power stages and control structures are provided in the
schematic accompanying this chapter and are not given here for esthetic purposes.
Specifically, the relevant data can be found in the Model initialization script.
8 Electric Vehicles Digital Twinning Using … 205
The settings for the PMSM traction motor are given in Fig. 8.18. It is important to
note that in tab Load, the Load source is set to Model, and the Model load type is set
to speed. This enables the vehicle kinematic model to define the speed of the machine
shaft. Additionally, in tab Output, the observation of electrical torque, mechanical
speed, and mechanical angle is enabled (these variables are available for processing).
Figure 8.19 depicts the part of the schematic related to the vehicle’s kinematic model.
The C-function block contains only expressions derived from (8.9). Also, in Fig. 8.19,
it can be seen that the torque produced by the PMSM is the input to the vehicle’s
kinematic model. The output of the vehicle’s kinematic model is the mechanical
speed of the PMSM shaft (actually the output is the vehicle speed in m/s, but this
can be converted into the motor shaft speed using a simple gain block). This speed
is input in the PMSM block.
206 I. Todorović and I. Isakov
The digital twin’s behavior was recorded using the VHIL approach. The test lasted
for 1000 s (simulation time). It took 7 h to execute. Naturally, if the model was
deployed on the emulators, the execution time would be exactly 1000 s.
Still, considering that the digital twin contains a detailed model of PMSM, several
converters, controlled using closed loops, with switching frequencies in medium,
high ranges, etc., even VHIL execution time is quite reasonable.
Figures 8.20 and 8.21 depict the responses recorded when both battery and super-
capacitor systems were activated and when only the battery system was activated,
respectively. The sole (simple) goal was to investigate what will be the differences
in battery current when the supercapacitors are deployed and when they are not. The
differences in the two waveforms should provide clear evidence that supercapacitors
could extend battery lifetime.
Figures depict reference speed (defined by the Common Artemis Driving Cycle
(Urban) (Common Artemis Driving Cycles (CADC) n.d.)) and vehicle speed, the
power delivered to the vehicle by the traction system, inverter phase currents, torque
produced by the traction system, battery current, supercapacitors current (if there is
one), and DC-link voltage.
The first waveforms testify that the vehicle speed follows the speed reference
precisely. The waveform depicting traction motor power output indicates that the
PMSM is adequate since the power spikes reach 50 kW since the vehicle speed was
not at maximum and the maximum power output is 70 kW. Similar remarks can be
given for the currents and torque waveforms. Considering battery and supercapacitor
currents, although the supercapacitor current consists of substantial high-frequency
components, the battery spikes are still significant. Also, amplitudes of the superca-
pacitor system current are much smaller than the battery system current counterparts.
This signifies that the low-pass filter (Fig. 8.6) cutoff frequency could have been set
to an even lower value. In Fig. 8.22, the battery system waveforms are superim-
posed. It is evident that the amplitudes of the battery currents are generally higher
and high-frequency changes are present when the supercapacitor system is deacti-
vated, as expected. Finally, from the last waveforms in Figs. 8.21 and 8.22, it can
8 Electric Vehicles Digital Twinning Using … 207
Fig. 8.20 Responses with battery and supercapacitor systems activated. This figure shows, respec-
tively, reference speed (nref ) and vehicle speed (n), the power delivered to the vehicle by the traction
system (P), inverter phase currents (Ia , Ib , and Ic ), the torque produced by the traction system (Tc ),
battery current (ILb ), supercapacitors current (ILsc ), and DC-link voltage (VDC )
208 I. Todorović and I. Isakov
Fig. 8.21 Responses with only battery system activated. This figure shows, respectively, reference
speed (nref ) and vehicle speed (n), the power delivered to the vehicle by the traction system (P),
inverter phase currents (Ia , Ib and Ic ), the torque produced by the traction system (Tc ), battery
current (ILb ), and DC-link voltage (VDC )
be concluded that the DC-link voltage regulation loop operates properly (taking into
account that a significantly larger DC-link capacitor was used in the second case).
8 Electric Vehicles Digital Twinning Using … 209
Fig. 8.22 The difference in the battery currents with (red) and without (green) supercapacitors
8.6 Conclusions
This chapter provides the theoretical and conceptual introduction to what constitutes
an electric vehicle digital twin. The focus of the discussion were the power stage
and the vehicle’s kinematics. Also, it is explicated how particular electric vehicle
parts can be implemented on a VHIL platform and the details of the implementation
are provided. The last part of the chapter offers a set of waveforms capturing the
most important electric vehicle behavior features.
The presented digital twin is not by any means the most comprehensive digital
twin possible. Improvements can be made. For example, a more detailed transmission
system could be regarded, tire slippage can be included, a vehicle with more than one
traction motor can be developed, an energy management scheme can be significantly
enhanced, etc.
Still, it should be a good starting point for a more thorough analysis, branching
into any domain that regards electric vehicle power stage or vehicle movement
dynamics. For example, the efficiencies of different electric vehicle subsystems can
be addressed. Advanced power electronics control structures can be examined as
well. Moreover, the digital twin can be used as a foundation for the development of
different topologies of hybrid-electric vehicles’ digital twins.
The authors hope that the readers will find the presented chapter useful and are
willing to join efforts in continued research on this topic, with all interested parties.
References
Chau KT (2015) Electric vehicle machines and drives: design, analysis and application. Singapore:
IEEE, Wiley
“Common Artemis Driving Cycles (CADC)” https://dieselnet.com/standards/cycles/artemis.php
Ehsani M (2018) Modern electric, hybrid electric, and fuel cell vehicles, 3rd edn. Taylor & Francis,
CRC Press, Boca Raton
Erickson RW, Maksimović D (2001) Fundamentals of power electronics, 2nd edn. Kluwer
Academic, Norwell, Mass
Global EV Outlook 2021. IEA, Paris, 2021. [Online]. Available: https://www.iea.org/reports/glo
bal-ev-outlook-2021
210 I. Todorović and I. Isakov
Khaligh A, Li Z (2010) Battery, ultracapacitor, fuel cell, and hybrid energy storage systems for
electric, hybrid electric, fuel cell, and plug-in hybrid electric vehicles: state of the art. IEEE Trans
Veh Technol 59(6):2806–2814, https://doi.org/10.1109/TVT.2010.2047877
Marčetić DP (2014) Mikroprocesorsko upravljanje energetskim pretvaračima, II. Novi Sad, Serbia:
Fakultet tehničkih nauka u Novom Sadu
Todorović I, Isakov I (2022) Advances and prospects in distributed generation sources digital twins
design. In: Smart grids technology and applications [Working Title], IntechOpen, https://doi.org/
10.5772/intechopen.102703, https://www.intechopen.com/online-first/80842
Typhoon HIL, “VHIL.” https://www.typhoon-hil.com/products/virtual-hil-device/
Vazquez S, Lukic SM, Galvan E, Franquelo LG, Carrasco JM (2010) Energy storage systems for
transport and grid applications. IEEE Trans Ind Electron 57(12):3881–3895, https://doi.org/10.
1109/TIE.2010.2076414
Vukosavic SN (2011) Digital control of electrical drives. Springer, New York; London
Chapter 9
Microgrid Primary Controller
Performance Characterization
Abstract This chapter reviews the main types of primary controllers for grid-
forming converters found in microgrids with multiple distributed converter-based
energy resource units. The main type of primary controllers are droop, virtual
synchronous generator and dispatchable virtual oscillator, and some variations are
described aiming to reveal their dynamic behavior and select their control param-
eters. This establishes the foundations for a fair comparison among the primary
control alternatives considered. The large and small signal models for the primary
controllers are derived, and it is demonstrated how the primary controller parameters
impact the steady-state and transient behaviors; in addition, time domain simulation
on Hardware-in-the-Loop (HIL) illustrates their performance. Since the microgrid
controller presents different scenarios of operation, an automated Test-Driven Design
(TDD) reveals from extensive simulations in the time domain the strong and weak
points of each primary controller. Initially, metrics for both steady-state and tran-
sient performances are defined. Then, the key scenarios based on each operating
mode such as grid-connected, islanded and unplanned islanding are selected to carry
out the tests. Finally, an automated report is given, revealing the strengths and weak-
nesses of each considered a primary controller.
A. T. Pereira (B)
UFSM, Av. Roraima, 1000 Santa Maria, Brazil
e-mail: [email protected]
H. Pinheiro · J. R. Massing · H. Magnago · F. Carnielutti
UFSM, Santa Maria, Brazil
e-mail: [email protected]
M. Stefanello
UNIPAMPA, Av. Tiaraju, 810 Alegrete, Brazil
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 211
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_9
212 A. T. Pereira et al.
9.1 Introduction
Droop Control is the most popular primary control (Kawabata and Higashino
1988; Tuladhar et al. 1997; Chandorkar et al. 1994). It has been reported for power-
sharing in UPS inverters since the late 80s. Some authors have proposed different
control schemes to overcome several limitations of the droop method (Guerrero et al.
2006, 2004). Important contributions were also made by pointing out that the output
impedance of the inverters plays a critical role in power- sharing (Guerrero et al.
2005, 2004; Beheshtaein et al. 2019) and proposing the use of hierarchical control
structures (Guerrero et al. 2011; Coelhoet al. 2016).
The second primary controller method presented is the Virtual Synchronous
Machine (VSM), where an inverter and its controller emulate the dynamic behav-
ior of a Synchronous Generator (Bevrani and Ise 2014; Sakimoto and Miura 2011;
Zhong and Weiss 2011). Synchronous generators are widely used in power systems,
and they have inherently active and reactive power- sharing characteristics. As a
result, the VSM integration increased the flexibility of the distribution system, once
it was established using the well-known synchronous generator model (Alipoor et al.
2015; Zhong et al. 2014; Ashabani and Mohamed 2014; Shintai et al. 2014). In par-
ticular, a comparison between the dynamic performance of VSMs and traditional
droop controllers is presented in Liu et al. (2016). These two approaches have been
developed in two different contexts but show strong similarities. They are equiva-
lent under certain conditions as demonstrated in D’Arco and Suul (2014). Although
different types of VSMs have been proposed in the literature, the idea of operating
inverters to simulate the complete dynamic behavior of synchronous generators was
also developed with the concept of synchronverters (Zhong and Hornik 2013; Zhong
and Zeng 2011; Zhong and Weiss 2009), where some of the system parameters, such
as inertia, friction coefficient and field and mutual inductances, can be appropriately
chosen to improve dynamic performance (Zhong et al. 2018). Moreover, it can emu-
late the virtual machine with interesting properties, like the limitation of the voltage
and frequency, vital in a real-life implementation. In Stallmann and Mertens (2020),
sequence impedance modeling is carried out for a grid-forming control based on
matching inverter and synchronous generator dynamics showing that both control
concepts, although being different, present similar small-signal dynamics.
An alternative way to implement the primary controller is the Virtual Oscillator
Control (VOC). Its roots lie on the Liénard-type oscillators (Dhople et al. 2013;
Johnson et al. 2014; Sinha et al. 2015). When used to control parallel-connected
inverters, they have power-sharing characteristics. It has been demonstrated that the
average voltage and frequency dynamics have similar characteristics to a classic
droop law (Johnson et al. 2016). VOC is generally programmed as nonlinear differ-
ential equations that exhibit cycle-limit behavior, and it is usually implemented in
microcontrollers. A comparison between VOC and traditional droop controllers is
presented in Johnson et al. (2017). It is noteworthy that VOC is an approach derived
in the time domain different from the droop control that considers phasor quantities
and assumes the existence of a quasi-sinusoidal steady state (Sinha et al. 2017).
This chapter presents in Sects. 9.2, 9.3 and 9.4 a brief description of the main
primary control techniques for grid-forming inverters, presenting methodologies for
defining the parameters of the controllers. Sections 9.5 and 9.6 present the concept of
214 A. T. Pereira et al.
the Test-Driven Design and the case study system. Sections 9.7, 9.8 and 9.9 show an
extensive analysis of the performance of the main primary control techniques using
automatic testing, and finally, Sect. 9.10 summarizes the main points of this chapter.
The Droop Control has its principle based on the operation of synchronous generators
where the active power is linked with the frequency and the reactive power with the
voltage since they have an inductive output impedance and are usually connected to
inductive networks; see Fig. 9.1. In an inverter-based distributed energy resource, the
droop control performs this link. A local or remote secondary controller sends the
setpoints of active and reactive power, as well as the frequency and voltage references
to the primary controller, which, in this case, is implemented by the Droop Controller.
The droop controller measures the active and reactive power at the PoC and compares
them with their setpoints. The droop coefficients m link the inverter output active
power to the frequency, whereas droop coefficients n link the reactive power to the
inverter output voltage. It is important to notice that in low voltage networks, the
equivalent impedance seen by the inverter is not always predominantly inductive,
and voltage source inverters do not have significant inductive output impedance as
synchronous generators. For these reasons, a virtual inductor can be included in the
controller. It provides an inductive output impedance for the inverter in the frequency
range of the droop control operation. In Fig. 9.1, a block diagram of Droop Control
is presented with voltage and current loops required to damp the LC filter resonance,
compensate for the inverter nonlinearities and limit the inverter output current.
In order to understand the behavior of the Droop Control and tune its parameters,
it is possible to assume that the converter is operating in a sinusoidal steady state
where the dynamics of the inner voltage and current loops are neglected. As a result,
the DER can be represented by the equivalent circuit shown in Fig. 9.1. It is easy to
demonstrate that active and reactive power exchanged with the grid at the PoC are
given, respectively, by (9.1) and (9.2):
V
p= E sin(δ) (9.1)
XL
V V2
q= E cos(δ) − (9.2)
XL XL
where X L is the reactance of the virtual inductor and δ is the difference between the
angular position of the inverter and the voltage at the PoC.
Considering that the voltage amplitude at the PoC, V , is constant and the power
angle, δ, is small, the active power p is proportional to the power angle, δ. On the
other hand, the reactive power depends on the voltage V . These relations, in turn,
motivate the droop control implementation shown on the block diagram of Fig. 9.1.
9 Microgrid Primary Controller Performance Characterization 215
The active and reactive powers measured at the PoC pass through low- pass filters
that attenuate the high-frequency components above the grid nominal frequency. A
state-space representation of these filters can be expressed in (9.3) and (9.4):
dpf
= −a p f + ap (9.3)
dt
dq f
= −aq f + aq (9.4)
dt
The filtered active and reactive powers are used in the droop laws to generate the
inverter frequency (9.5) and voltage amplitude (9.6). It is important to notice that the
actual inverter output voltage must also include the virtual inductor drop:
ω = ωo − m( p f − Po ) (9.5)
E = E o − n(q f − Q o ) (9.6)
The droop coefficient, m, is usually defined to make the inverter deliver its rated
active power for a frequency deviation /\ω around the defined setpoint, Po (9.7).
Similarly, the droop coefficient n is designed to make the converter exchange the
rated reactive power for a voltage deviation /\E (9.8):
216 A. T. Pereira et al.
/\ω
m= (9.7)
Prated
/\E
n= (9.8)
Q rated
dθ
=ω (9.9)
dt
θ = ωg t + δ (9.10)
dδ
= ω − ωg (9.11)
dt
As a result, the nonlinear dynamic equations that describe the behavior of the
power angle, frequency and amplitude of an inverter with inductive droop connected
to a stiff grid are presented in (9.12), (9.13) and (9.14), respectively. In order to
simplify the notation, constants a21 , a22 , a31 , b11 , b21 and b31 are defined. It is noticed
that the dynamic equation is nonlinear and that the nonlinearities are associated with
the product of the state variable e, which is the inverter background voltage amplitude,
with the sine and cosine of the power angle δ:
dδ
= ω + b11 (9.12)
dt
dω
= a21 ω + a22 e sin(δ) + b21 (9.13)
dt
de
= a21 e + a31 e cos(δ) + b31 (9.14)
dt
where
a21 = −a
a22 = −aV m/X L
a31 = −nV /X L
b11 = −ωg
b21 = a(ωo + m Po )
nV 2 a
b31 = a(E o + n Q o ) +
XL
9 Microgrid Primary Controller Performance Characterization 217
In order to have a feeling of the qualitative behavior of the inverter with induc-
tive droop connected to a stiff grid, the equilibrium points of the derived nonlinear
dynamic equation can be found. This is done by setting the derivative of the state
variables to zero and then solving the resulting nonlinear algebraic equation for the
state variables, which results in the possible operating points. The inverter local
qualitative behavior is defined by the eigenvalues of the Jacobian matrix (9.15). The
eigenvalues can be easily found from the roots of the determinant of (λI − J):
⎡ ⎤
0 1 0
J = ⎣ a22 e∗ cos(δ∗ ) a21 a22 sin(δ∗ ) ⎦ (9.15)
−a32 sin(δ ) 0 a21 + a32 cos(δ∗ )
∗
1 1
p
0,8 0,8
0,6 q 0,6
0,4 q 0,4
0,2 p 0,2
q
0 0
Active and Reactive Power (pu)
0,92 0,94 0,96 0,98 1 1,02 1,04 1,06 1,08 1,1 0,96 0,97 0,98 0,99 1 1,01 1,02 1,03 1,04 1,05
-0,2 -0,2
-0,4 -0,4
-0,6 -0,6
-0,8 -0,8
-1 (a) -1
(b)
1 q 1
p
0,8 0,8
0,6 0,6
0,4 0,4
p
0,2 0,2 q
0 0
0,92 0,94 0,96 0,98 1 1,02 1,04 1,06 1,08 1,1 0,96 0,97 0,98 0,99 1 1,01 1,02 1,03 1,04 1,05
-0,2 -0,2
-0,4 -0,4
-0,6 -0,6
-0,8 -0,8
-1 -1
(c) (d)
Voltage at the PoC (pu) Frequency at the PoC (pu)
Fig. 9.2 Steady-state performance of the grid-forming inverter connected to the grid with the
traditional droop control (a) and (b) and Improved droop control (c) and (d)
left and right eigenvectors associated with each eigenvalue of Jacobian matrix (9.16).
It is seen that the pair of complex eigenvalues are associated with the frequency
command and the power angle, while the real eigenvalue is related to the amplitude
of the inverter background voltage:
λ1 λ2 λ3
0.706 0.706 0.03 δ
(9.17)
0.690 0.690 0.03 ω
0.018 0.018 0.964 e
ded
= a21 ed + a32 e cos(δ) + b32 (9.18)
dt
de
= ed (9.19)
dt
where
a32 = −kq aV /X L
| |
b32 = kq a Q o + V 2 /X L + (E o − V )/n
n = kq /kv
b -axis q-axis
r
as' ic ib
cs r + rs +
fd ' vcs
S
bs rs - vbs
- -
bs' N a -axis vas -
fd ia +
rs +
c s' id
as d -axis
c -axis
Fig. 9.4 Non-salient pole three-phase uniformly gaped synchronous machine
⎡ ⎤ ⎡ ⎤
λ1 −94.25 + j68.55
⎢ λ2 ⎥ ⎢ −94.25 − j68.55 ⎥
⎢ ⎥=⎢ ⎥ (9.20)
⎣ λ3 ⎦ ⎣ −8.39 ⎦
λ4 −180.10
λ1 λ2 λ3 λ4
0.86 0.86 0 0 δ
0.86 0.86 0 0 ω (9.21)
0 0 0.05 1.058 ed
0 0 1.058 0.05 e
dλαβ
vαβ = rs iαβ + (9.22)
|dt |
| | iαβ
λαβ = Ls lsr (9.23)
id
| |
Ls 0
Ls = (9.24)
0 Ls
| |
L s f d sin(θr )
lsr = (9.25)
−L s f d cos(θr )
Combining Eqs. (9.22)–(9.25) results in (9.26), where the electromotive force (EMF)
voltage vector as (9.27) and the rotor flux as ψd = L s f d i d have been defined. From
the derivative of the energy stored in the coupling field with respect to the rotor
angular position, it is possible to obtain the electromagnetic torque (9.28):
diαβ
vαβ = rs iαβ + Ls + eαβ (9.26)
| dt |
cos(θr )
eαβ = ψd ωg (9.27)
sin(θr )
| |
T cos(θr )
Te = ψd iαβ (9.28)
sin(θr )
diαβ
vαβ = −rs iαβ − Ls + eαβ (9.29)
dt
dωr 1
= (Ti − Te − D p ωr ) (9.30)
dt J | |
T − sin(θr )
Q gap = ψd ωr iαβ (9.31)
cos(θr )
( | |)T
0 1
Q PoC = vαβ iαβ (9.32)
−1 0
Fig. 9.5 VSM connected to a strong grid—reactive power computed at the PoC
In order to simplify the notation, some constants are defined (9.36)–(9.38). The
VSM’s nonlinearities are associated with the products of state variables and the sine
and cosine of the power angle δ:
dω
= a11 ω + a12 ψ sin(δ) + b11 (9.36)
dt
dδ
= ω + b12 (9.37)
dt
dψ
= a32 ω2 ψ2 + a33 ωψ cos(δ) + b31 (9.38)
dt
224 A. T. Pereira et al.
where
−D p
a11 =
J
−V
a12 =
J XL
−1
a32 =
K XL
V
a33 =
K XL
( )
1 Po
b11 = + D p ωo
J ωo
b21 = −ωr
1 ( )
b31 = Q o + Dq (E o − V )
K
In order to have a feeling of the qualitative behavior of the inverter with VSM
connected to a stiff grid, the equilibrium points of the derived nonlinear dynamic
equation can be found. The inverter local qualitative behavior is defined by the
eigenvalues of the Jacobian matrix (9.39), which is the matrix of the first-order partial
derivative of the right side of the ordinary differential equation at an equilibrium point.
The eigenvalues can be easily found from the roots of the determinant of (λI − J):
⎡ ⎤
a11 a12 ψo cos(δo ) a12 sin(δo )
J=⎣ 1 0 0 ⎦
2a32 ωo ψ2o + a32 ψo cos(δo ) −a33 ψo ωo sin(δo ) 2a32 ω2o ψo + a33 ωo cos(δo )
(9.39)
The damping action (9.40) is used to emulate the damping component found in
the classical synchronous generator model. As a result, it provides an additional
tunable parameter that allows adjusting the damping ratio associated with the active
power loop without affecting the steady-state frequency droop characteristic (Dong
and Chen 2018): ( )
d Te
Df ∝ (ω − ωr ) (9.40)
dt ψd
only on the circuit parameters but also on the operating point. The participation
matrix (9.42) reveals that the real eigenvalue (9.41) is associated with the magnitude
of the flux of the VSM. The complex pair of eigenvectors are associated with the
VSM frequency and power angle:
⎡ ⎤ ⎡ ⎤
λ1 −5.01 + j15.47
⎣ λ2 ⎦ = ⎣ −5.01 − j15.47 ⎦ (9.41)
λ3 −0.41
λ1 λ2 λ3
0.525 0.525 0 ω
(9.42)
0.525 0.525 0 δ
0 0 0.999 ψ
Once more, the impact of the states on the modes can be revealed from the partic-
ipation factors. The pair of complex eigenvalues (9.45) are associated with the VSM
frequency and the power angle, while the real eigenvalue is associated with the VSM
flux magnitude (9.46):
⎡ ⎤ ⎡ ⎤
λ1 −9.92 + j38.24
⎣ λ2 ⎦ = ⎣ −9.92 − j38.24 ⎦ (9.45)
λ3 −3.62
λ1 λ2 λ3
0.517 0.517 0 ω
(9.46)
0.516 0.516 0 δ
0 0 0.999 ψ
226 A. T. Pereira et al.
Fig. 9.6 Steady-state performance of the grid-forming inverter connected to a strong grid with the
VSM control with reactive power computed at the PoC
From the stable operating point, it is possible to obtain the droop characteristics.
In this example, the active power setpoint is –1 pu and the reactive power setpoint
is 0 pu. The frequency and voltage droop coefficients have been set to 5 and 10%,
respectively. Figure 9.6a shows the voltage-var characteristic as expected. Figure
9.6b shows the frequency-active power characteristic.
The Droop and the VSM have their roots in well-known principles of operation
of conventional electric power systems with synchronous generators. On the other
hand, there are controllers whose foundations lay on oscillators. In this section, two
of these controllers are described, namely the Virtual Oscillator Control (VOC) and
the Dispatchable Virtual Oscillator Control (dVOC).
The Virtual Oscillator Control (VOC) follows an analogous path but aiming to
emulate a nonlinear limit-cycle dead-zone oscillator (Johnson et al. 2014). The main
attributes of the VOC are global asymptotic synchronization among all parallel-
connected VOC controlled inverters, power-sharing capacity in the islanded mode
without measurements of powers directly and programmable droop behavior in
steady state.
Although VOC has been conceived for single-phase systems—for which the appli-
cation is straightforward—it is possible to implement the VOC for three-phase sys-
tems as well. The main issue is that the original VOC is not dispatchable since there
are no inputs to assign active and reactive power setpoints. In addition, it presents
odd harmonics on the voltage used to modulate the power converter (Awal et al.
2020). It is worth mentioning that recent modifications have been proposed to mit-
igate these shortcomings, such as extra control loops that can be added for power
dispatching allowing the use of the VOC in the control of voltage source converters
(VSC) in grid-connected mode. Considering the distortions, it is possible to mitigate
9 Microgrid Primary Controller Performance Characterization 227
the impact of the nonlinear oscillator on the harmonic content of the output voltages
via filtering.
The dispatchable Virtual Oscillator Control (dVOC) solves the main issues of
the VOC. As mentioned, the VOC is not a dispatchable controller because there
are no setpoints for active and reactive powers. Furthermore, the nonlinear voltage-
controlled element h (vvoc ) introduces distortions on the inverter output voltage. On
the other hand, the dVOC has input setpoints for active and reactive powers that are
P0 and Q 0 and does not present distortions like the VOC. The roles of the three terms
on the right-hand side of the dVOC law are to define the nominal frequency of the
dVOC; to regulate the frequency; and to regulate the voltage:
| | | || |
d vα 0 −ω0 vα
=
dt vβ ω0 0 vβ
| |( | | | | | |)
0 −1 1 P0 Q 0 vα i
+η − 1α
1 0 V02 −Q 0 P0 vβ i 1β
! ~~ `
⎡ ⎤
e
⎣ θα ⎦
eθβ
|| ||2 | |
V02 − ||vαβ || vα
+ ηα (9.47)
V02 vβ
! ~~ `
⎡ ⎤
e
⎣ vα ⎦
evβ
The dVOC was introduced in Colombino et al. (2017), and its implementation for
inductive grids is given by (9.47). There are three main objectives of a grid-forming
inverter control for microgrid applications that are accounted, namely frequency
setpoint, which is implemented by the first term on the right-hand side of the dVOC
law; voltage magnitude control that comes directly from the third term on the right-
hand side by computing the error between the actual amplitude and its setpoint V 0 ;
and power dispatch. It is important to notice that the power regulation objective is not
readily seen in the second term. After some algebraic manipulations, it is possible
to uncover the active and reactive powers exchanged at the PoC. In addition, no
inner-loops are being modeled. Since the dVOC has setpoints for active and reactive
powers, it is possible to express the second term of the dVOC law according to (9.48):
(| || | | || |)
η 0 −/\p vα /\q 0 vα
|| ||2 + (9.48)
||vαβ || /\p 0 vβ 0 /\q vβ
228 A. T. Pereira et al.
where
|| ||2
||vαβ ||
/\p = P0 − p
V02
|| ||2
||vαβ ||
/\q = Q0 − q
V02
⎡ ( )⎤
| | 0 −ω0 − η
P0 −
V02
p | |
d vα ⎢ V02 ||vαβ ||2 ⎥ vα
= ⎢ ( ) ⎥
dt vβ ⎣ η V2 ⎦ vβ
ω0 + P0 − 0 2 p 0
V02 ||vαβ ||
( ( ) || ||2 ) | |
ηα 1 V02 V02 − ||vαβ || vα
+ Q 0 − || ||2 q +
V0 αV0 ||vαβ || V0 vβ
(9.49)
The previous development demonstrated that, although the powers are not directly
measured, they are captured by the dVOC law. Replacing (9.48) in (9.47), it is
possible to recognize that the characteristics of an inductive droop are present: the
active power has a direct impact on the frequency of the system, whereas the reactive
power impacts the voltage (9.49). The droop coefficients recovered from these droop
laws are m = η/V 20 and n = 1/αV0 . The relations f × P and V × Q are not entirely
decoupled due to the actual voltages present in all terms. However, as the dVOC
voltage amplitude approaches the setpoint V0 , the droop equations become more and
more decoupled.
The dVOC in its original formulation achieves its objectives using the output cur-
rent of the grid-forming inverter and the voltage signals generated internally by the
dVOC. However, following the path of making the dVOC compatible with inductive
lines, a virtual inductor is added. Furthermore, inner-loops are implemented. There-
fore, the equivalent circuit seen by the dVOC is a voltage-controlled voltage source
followed by the virtual inductor behind the PoC. The inner-loops are assumed to
perform well enough so that the voltage at the capacitor is equal to the output voltage
from the dVOC. For this reason, an improved dVOC for single-phase systems with
inner-loops is presented in Fig. 9.7. The voltage at the PoC may be used in place
of the magnitude voltage of the dVOC. This choice is motivated by the fact that the
dVOC behaves better after the clearing of a short circuit. As in the case of the VOC,
the output current here is no longer the output current of the inverter but the current
delivered at the PoC.
9 Microgrid Primary Controller Performance Characterization 229
Fig. 9.7 dVOC for a single-phase DER with inner-loops block diagram
developer writes some tests for a given application before the application or device
under test (DUT) is actually designed. Then, software development is carried out in
a recursive manner.
Among the software development methodologies, TDD can be adopted when
designing and testing controllers for grid-tied converters. The basic idea of the
TDD is to perform a series of automated tests, each one for a specific scenario.
The scenarios are defined a priori by the designer via a software that drives the
simulation as a supervisory system. The results presented in this chapter have been
implemented in the Typhoon Test Integrated Development Environment (IDE), the
framework that integrates pytest for running tests written in Python, as shown in
Fig. 9.8. In addition, there are a number of application protocol interfaces, APIs,
that allow quicker and easier testing. Typhoon Test IDE also integrates with the
Allure Framework reporting tool, providing holistic interactive reports. Each sce-
nario is simulated systematically and the results can be collected and compared
with each other. Examples of scenarios include, for instance, structural and/or para-
metric changes in the system to be simulated. All the schematics and test scripts
mentioned in this chapter can be found under the examples provided with Typhoon
HIL Control Center installation (examples\courses\digital control of grid-tied con-
verters\TDD_TestDrivenDesign\TDD5_Droop) or within the Control of Microgrids
course at https://hil.academy/.
In order to evaluate and compare the performance of the different primary controllers
derived, a case study has to be defined: a microgrid comprised of two identical DERs
sharing a load that combines linear resistive and nonlinear inductive, Fig. 9.9.
The case study considers three different operating modes:
• Grid-connected Mode;
• Transition Mode;
• Islanding Mode.
9 Microgrid Primary Controller Performance Characterization 231
Fig. 9.13 Load subsystem schematic comprising linear and nonlinear load, and short circuit
Finally, the grid subsystem schematic is presented in Fig. 9.15 and comprises the
grid whose voltage amplitude, frequency and phase can be controlled via Scada input
signals that can be sent from Scada or Test IDE.
Initially, the test is parameterized by defining, for instance, the microgrid grid-
rated voltage and frequency, DERs rated power, as well as characterizing the events
to be captured in the different operating modes, such as voltage, frequency and power
thresholds; simulation time intervals; and so on. Once the test is finished, the results
can be inspected using the test report tool Allure, Fig. 9.16. This report contains
all the test parameters, DUT and OCs, as well as the test results and performance
indexes.
This test evaluates whether or not the active and reactive power exchanged by the
DERs are within a predefined envelope of 15% around the ideal droop curves. These
tests were evaluated for all five controllers, and the results are summarized in Fig.
9.16a. All the events (connection, disconnection, load change, etc.) occur at the same
instant on both DERs.
The grid frequency changed from 57 Hz to 63 Hz, as shown in Fig. 9.17. For
each case, the active power was compared with the expected frequency droop curve
234 A. T. Pereira et al.
Fig. 9.16 Summary of automated testing results for a grid-connected mode; b unplanned islanding
mode; and c islanding mode
GRID-CONNECTED MODE
0.0 2.2 4.4 6.6 8.8 11.0 13.2 15.4 17.4 Time (s)
Fig. 9.17 Voltage and frequency change during grid-connected mode test
described by a continuous line. The parameters of the frequency test are presented
in Table 9.1.
The grid voltage was changed from 200 to 240 Volts with a step voltage of 10V,
Fig. 9.17. For each case, the reactive power and the voltage were compared with the
expected voltage droop curve described by a continuous line. The parameters of the
voltage test are presented in Table 9.2.
236 A. T. Pereira et al.
The points marked in green squares in Figs. 9.18, 9.19, 9.20, 9.21 and 9.22 mean
the active power delivered by the DERs is within the predefined threshold. In order to
compute the voltage-var curves, the voltages are measured at the DER PoC, to avoid
the voltage drop in the feeder. The frequency droop characteristic of Droop control
is as expected, Fig. 9.18a. For the Droop control nominal grid-voltage, the reactive
power is within the thresholds, which is, in this case, 0.15 pu, Fig. 9.18b. However,
for all other voltage values, the reactive power exceeds the maximum allowable
limits. For each case, the reactive power and the voltage are plotted and compared
with the expected voltage droop curve. The Droop control with the integrator in
the voltage loop, Fig. 9.19, passes in all cases: for all frequencies and voltages, the
active and reactive powers delivered by the DERs are within the defined envelope.
Similarly as for the Droop control, the dVOC passes in association with the frequency
9 Microgrid Primary Controller Performance Characterization 239
support in steady state, Fig. 9.20a. However, regarding the voltage support, the dVOC
fails close to the lower voltage limit, Fig. 9.20b. The VSM passes the steady-state
frequency support curve test, Fig. 9.21a. As expected, the VSM with the reactive
power computed at the gap fails voltages close to the lower and upper voltage limit
considered, Fig. 9.21b. This is attributed to the voltage drop on the virtual inductor.
Finally, the VSM with the reactive power computed at the DER PoC passes in all
tests, Fig. 9.22.
All primary controllers considered pass the frequency support steady-state tests.
The Droop presents a significant error on the voltage-var curve among all other
primary controllers considered. The VSM with reactive power on the gap fails in
240 A. T. Pereira et al.
the voltage-var curve, which is attributed to the voltage on the virtual inductor.
Even though the dVOC fails at a point of the voltage-var curve, its performance is
satisfactory.
The transition mode tests evaluate the steady-state and the transient behavior of the
microgrid voltage, frequency and power-sharing when unintentionally disconnecting
it from the main grid. The microgrid is unintentionally disconnected from the main
9 Microgrid Primary Controller Performance Characterization 241
grid at t = 0.5 s. The disconnections are performed under four operating conditions:
with power setpoints set to zero and 0.7 pu combined with operation under no load
and full load, Fig. 9.23. The unplanned islanding test evaluates the power-sharing
among the DERs, the voltage and frequency settling time after the disconnection,
as well as the steady-state errors for both frequency and voltage. The parameters
of the unplanned islanding test are presented in Table 9.3. Several waveforms have
been obtained, but just the ones that fail are presented. Since the DERs have similar
behavior, just the rms voltage of one of them is shown in this paper.
Droop control fails as rms voltage after the disconnection with full load and power
setpoints set to zero exceeds the threshold of 20V below the nominal value, Fig. 9.24a.
Similar behavior is observed when the active and reactive power setpoints are 0.7
pu, Fig. 9.24b. In the case of the Improved Droop control, it is not able to share
active power soon after the transition to the island mode, Fig. 9.25a. The yellow
envelope defines the active power tolerance region for the DER2. The power-sharing
error between the DERs is slightly out of the defined envelope. The VSM with
reactive power computed at the gap fails in the unplanned islanding test with active
and reactive power setpoints set to zero pu and 0.7 pu, Fig. 9.25b and (c), as the
steady-state frequency after the disconnection is below 5% of the nominal microgrid
242 A. T. Pereira et al.
frequency. Finally, the VSM with the reactive power computed at the DER PoC fails
with the power setpoints set to zero and disconnection with full load. Both settling
time and steady-state error do not meet the defined limits, Fig. 9.26a. With power
setpoints set to 0.7 pu and disconnection under no load, the active power-sharing
requirement is almost achieved. There is only a small time interval that the defined
threshold is violated, Fig. 9.26b. In unplanned islanding with setpoints set to 0.7 pu
and full load, the frequency steady-state error exceeds the 3 Hz tolerance defined,
Fig. 9.26c.
The automated test points out that the dVOC presents the best results, Fig. 9.16b.
A detailed analysis reveals that the Improved Droop and the VSMs could also lead to
good results in meeting the defined requirements by adjusting their control parame-
ters. The communication delay between the MGCC and the DERs could change the
9 Microgrid Primary Controller Performance Characterization 243
results of this test as the MGCC can inform the DERs that the operation microgrid
is in islanding mode.
This test evaluates the performance of the considered primary controllers when oper-
ating in islanding mode. Three load conditions are considered: linear (33%, 66% and
100% of full load); nonlinear (33%, 66% and 100% of full load); and short-circuit
(at t = 0.05 s and t = 0.25 s), Fig. 9.27. Steady-state and transient metrics for the
voltage and frequency are analyzed, and the power-sharing between the DERs is also
considered.
Table 9.4 Parameters of the islanding mode test with linear load
Parameter Value
Time interval before the next change (s) 0.1
Time interval after the change (s) 0.3
Maximum rms voltage settling timea (s) 0.5
Maximum rms voltage steady-state errorb (V) 35
Maximum frequency steady-state errorb (Hz) 3
a Settling time region is ±5Vrms of last value in capture
b Compared with nominal value, after load transition
246 A. T. Pereira et al.
The test script allows the operator to set the thresholds for overshoot, settling
time and steady-state error for the voltage and frequency during events resulting
from load changing, Tables 9.4 and 9.5. The microgrid frequency steady-state error
is also evaluated. In addition, power-sharing among the DERs is also considered.
The nonlinear load is defined as in IEC 62040-3 standard that characterizes the
performance of UPSs. In addition, it is possible to parameterize the short-circuit
durations, Table 9.6. In the following results, 50 ms and 250 ms short-circuit durations
are considered. As previously stated, just the results that fail are analyzed.
The Improved Droop control fails in both short-circuit tests, Fig. 9.28. Despite
the power-sharing mismatch during the 50 ms short circuit, after it is cleared the
voltage and frequency are restored to their nominal values. However, for the 250 ms
short-circuit duration, after the clearing, the voltage and frequency are not restored
to their nominal values. On the other hand, the voltage at the DER PoC during a 50
Table 9.5 Parameters of the islanding mode test with nonlinear load
Parameter Value
Time interval before the next change (s) 0.2
Time interval after the change (s) 0.5
Maximum voltage after removing the load (V) 357
Maximum peak current during load (A) 400
Maximum rms voltage overshoot during load 100
(V)
Maximum rms voltage settling timea (s) 0.5
Maximum rms voltage steady-state errorb (V) 20
Maximum frequency steady-state errorb (Hz) 1.5
a Settling time region is ±5 Vrms of last value in capture
b Compared with nominal value, until load is removed
Table 9.6 Parameters of the islanding mode test with short circuit
Parameter Value
Short-circuit duration test points (s) 0.05, 0.25
Time interval before the next change (s) 0.2
Time interval after the change (s) 0.5
Maximum voltage after returning from short 800
circuit (V)
Maximum peak current during short circuit (A) 400
Maximum rms voltage overshoot during short 300
circuit (V)
Maximum rms voltage settling timea (s) 0.5
Maximum rms voltage steady-state errorb (V) 100
Maximum frequency steady-state errorb (Hz) 5
a Settling time region is ±5 Vrms of last value in capture
b Compared with nominal value, after the short-circuit event
9 Microgrid Primary Controller Performance Characterization 247
ms short-circuit when the dVOC is used is shown in Fig. 9.29a. It fails on the test
because of the overvoltage soon after the short-circuit clearing. Similar behavior is
observed for the 250ms short circuit, Fig. 9.29b. Figure 9.29c shows the DERs output
currents during the short circuit. They are limited by the DER current inner loop.
The VSM with the reactive power computed at the gap fails in the linear load test
since the steady-state frequency error is slightly below the considered 3 Hz threshold
when operating at full load, Fig. 9.30a. In addition, it also fails in 250 ms short-circuit
test due to the overvoltage soon after the short-circuit clearing, Fig. 9.30b, as well
as the active and reactive sharing after the 250 ms short-circuit clearing, Fig. 9.31.
248 A. T. Pereira et al.
Finally, the VSG with the reactive power computed at the DER PoC fails at the
full load test, Fig. 9.32a. The frequency is slightly below the considered threshold.
In addition, overvoltage, Fig. 9.32b, and power-sharing issues, Fig. 9.33, are also
observed for this VSG.
250 A. T. Pereira et al.
9.10 Conclusion
Methodologies for the main primary control techniques for grid-forming inverter
parameterization were presented. The test-driven design provided a holistic way to
evaluate the performance of primary controllers for microgrid and pointed out the
strong and weak points of each alternative. The Droop Control is not only simply
implemented and presents excellent behavior during short circuit but it also presents
large reactive power dispatch errors when connected to the grid. The 2I Droop Control
reduces the Droop Control steady-state error at the price of penalizing the behavior
after the short circuit. The dVOC demonstrated to be a strong candidate for the
primary controller, just requiring attention for short-circuit cases in islanding mode.
The VSM not only makes it possible to select the droop characteristic and moment
of inertia as in conventional synchronous generators but also presents a critical point
to be addressed in the power-sharing after the short-circuit clearing.
9 Microgrid Primary Controller Performance Characterization 251
References
Alipoor J, Miura Y, Ise T (2015) Power system stabilization using virtual synchronous generator
with alternating moment of inertia. IEEE J Emerg Select Top Power Electron 3(2):451–458
Ashabani M, Mohamed YAI (2014) Novel comprehensive control framework for incorporat-
ing VSCS to smart power grids using bidirectional synchronous-vsc. IEEE Trans Power Syst
29(2):943–957
Awal MA, Yu H, Tu H, Lukic SM, Husain I (2020) Hierarchical control for virtual oscillator based
grid-connected and islanded microgrids. IEEE Trans Power Electron 35(1):988–1001
Beheshtaein S, Golestan S, Cuzner R, Guerrero JM (2019) A new adaptive virtual impedance based
fault current limiter for converters. In: IEEE energy conversion congress and exposition (ECCE)
2019, pp 2439–2444
Bevrani YMH, Ise T (2014) Virtual synchronous generators: a survey and new perspectives. Int J
Electr Power Energy Syst 54:244–254
Chandorkar MC, Divan DM, Hu Y, Banerjee B (1994) Novel architectures and control for distributed
ups systems. In: Proceedings of 1994 IEEE applied power electronics conference and exposition
- ASPEC’94, 1994, vol 2, pp 683–689
9 Microgrid Primary Controller Performance Characterization 253
Coelho EA, Wu D, Guerrero JM, Vasquez JC, Dragicevic T, Stefanovic C, Popovski P (2016) Small-
signal analysis of the microgrid secondary control considering a communication time delay. IEEE
Trans Indust Electron 63(10):6257–6269. Bevrani and Ise
Colombino M, Groß D, Dörfler F (2017) Global phase and voltage synchronization for power
inverters: a decentralized consensus-inspired approach. In: 2017 IEEE 56th annual conference
on decision and control (CDC), 2017, pp 5690–5695
D’Arco S, Suul JA (2014) Equivalence of virtual synchronous machines and frequency-droops for
converter-based microgrids. IEEE Trans Smart Grid 5(1):394–395
Denis G, Prevost T, Debry M, Xavier F, Guillaud X, Menze A (2018) The migrate project: the
challenges of operating a transmission grid with only inverter-based generation. a grid-forming
control improvement with transient current-limiting control. IET Renew Power Gener 12(5):523–
529
Dhople SV, Johnson BB, Hamadeh AO (2013) Virtual oscillator control for voltage source inverters.
In: 2013 51st annual allerton conference on communication, control, and computing (Allerton),
2013, pp 1359–1363
Dong S, Chen C (2018) Adjusting synchronverter dynamic response speed via damping correction
loop. In: IEEE power energy society general meeting (PESGM) 2018, p 1
Fucci D, Erdogmus H, Turhan B, Oivo M, Juristo N (2017) A dissection of the test-driven develop-
ment process: does it really matter to test-first or to test-last? IEEE Trans Softw Eng 43(7):597–614
Guerrero JM, de Vicuna LG, Matas J, Castilla M, Miret J (2005) Output impedance design of
parallel-connected ups inverters with wireless load-sharing control. IEEE Trans Indust Electron
52(4):1126–1135
Guerrero JM, de Vicuna LG, Matas J, Miret J, Castilla M (2004) Output impedance design of
parallel-connected ups inverters. In: 2004 IEEE international symposium on industrial electronics,
vol 2, pp 1123–1128
Guerrero JM, Matas J, De Vicunagarcia Garcia, De Vicuna L, Castilla M, Miret J (2006) Wireless-
control strategy for parallel operation of distributed-generation inverters. IEEE Trans Indust
Electron 53(5):1461–1470
Guerrero JM, de Vicuna LG, Matas J, Castilla M, Miret J (2004) A wireless controller to enhance
dynamic performance of parallel inverters in distributed generation systems. IEEE Trans Power
Electron 19(5):1205–1213
Guerrero JM, Vasquez JC, Matas J, de Vicuna LG, Castilla M (2011) Hierarchical control of droop-
controlled ac and dc microgrids-a general approach toward standardization. IEEE Trans Industr
Electron 58(1):158–172
Janzen D, Saiedian H (2008) Does test-driven development really improve software design quality?
IEEE Softw 25(2):77–84
Janzen D, Saiedian H (2005) Test-driven development concepts, taxonomy, and future direction.
Computer 38(9):43–50
Jeffries R, Melnik G (2007) Guest editors’ introduction: Tdd-the art of fearless programming. IEEE
Softw 24(3):24–30
Johnson B, Rodriguez M, Sinha M, Dhople S (2017) Comparison of virtual oscillator and droop
control. In: 2017 IEEE 18th workshop on control and modeling for power electronics (COMPEL),
2017, pp 1–6
Johnson BB, Dhople SV, Hamadeh AO, Krein PT (2014) Synchronization of parallel single-phase
inverters with virtual oscillator control. IEEE Trans Power Electron 29(11):6124–6138
Johnson BB, Dhople SV, Hamadeh AO, Krein PT (2014) Synchronization of nonlinear oscillators
in an LTI electrical power network. IEEE Trans Circuits Syst I Regul Pap 61(3):834–844
Johnson BB, Sinha M, Ainsworth NG, Dörfler F, Dhople SV (2016) Synthesizing virtual oscillators
to control islanded inverters. IEEE Trans Power Electron 31(8):6002–6015
Kawabata T, Higashino S (1988) Parallel operation of voltage source inverters. IEEE Trans Ind
Appl 24(2):281–287
Kumar S, Bansal S (2013) Comparative study of test driven development with traditional techniques.
Int J Soft Comput Eng 3(1):352–360
254 A. T. Pereira et al.
Liu J, Miura Y, Ise T (2016) Comparison of dynamic characteristics between virtual synchronous
generator and droop control in inverter-based distributed generators. IEEE Trans Power Electron
31(5):3600–3611
Long B, Liao Y, Chong KT, Rodríguez J, Guerrero JM (2021) Mpc-controlled virtual synchronous
generator to enhance frequency and voltage dynamic performance in islanded microgrids. IEEE
Trans Smart Grid 12(2):953–964
Matevosyan J, Badrzadeh B, Prevost T, Quitmann E, Ramasubramanian D, Urdal H, Achilles S,
MacDowell J, Huang SH, Vital V, O’Sullivan J, Quint R (2019) Grid-forming inverters: are they
the key for high renewable penetration? IEEE Power Energy Mag 17(6):89–98
Olivares DE, Mehrizi-Sani A, Etemadi AH, Cañizares CA, Iravani R, Kazerani M, Hajimiragha
AH, Gomis-Bellmunt O, Saeedifard M, Palma-Behnke R, Jiménez-Estévez GA, Hatziargyriou
ND (2014) Trends in microgrid control. IEEE Trans Smart Grid 5(4):1905–1919
Sakimoto TIK, Miura Y (2011) Stabilization of a power system with a distributed generator by a
virtual synchronous generator function. IEEE 8th international conference power electronics and
ECCE Asia, pp 1498–1505
Shintai T, Miura Y, Ise T (2014) Oscillation damping of a distributed generator using a virtual
synchronous generator. IEEE Trans Power Delivery 29(2):668–676
Sinha M, Dörfler F, Johnson BB, Dhople SV (2017) Uncovering droop control laws embedded within
the nonlinear dynamics of van der pol oscillators. IEEE Trans Control Netw Syst 4(2):347–358
Sinha M, Dörfler F, Johnson BB, Dhople SV (2015) Virtual oscillator control subsumes droop
control. In: American control conference (ACC) 2015, pp 2353–2358
Stallmann F, Mertens A (2020) Sequence impedance modeling of the matching control and compar-
ison with virtual synchronous generator. In: 2020 IEEE 11th international symposium on power
electronics for distributed generation systems (PEDG), 2020, pp 421–428
Tuladhar A, Jin H, Unger T, Mauch K (1997) Parallel operation of single phase inverter modules with
no control interconnections. In: Proceedings of APEC 97 - applied power electronics conference,
vol 1, pp 94–100
Williams L, Maximilien E, Vouk M (2003) Test-driven development as a defect-reduction practice.
In: 14th international symposium on software reliability engineering, 2003. ISSRE 2003, pp
34–45
Zhong Q-C, Hornik T (2013) Control of power inverters in renewable energy and smart grid inte-
gration. Wiley
Zhong Q, Weiss G (2009) Static synchronous generators for distributed generation and renewable
energy. In: 2009 IEEE/PES power systems conference and exposition, March 2009, pp 1–6
Zhong Q, Zeng Y (2011) Can the output impedance of an inverter be designed capacitive? In:
IECON 2011 - 37th annual conference of the IEEE industrial electronics society, Nov 2011, pp
1220–1225
Zhong Q, Weiss G (2011) Synchronverters: Inverters that mimic synchronous generators. IEEE
Trans Industr Electron 58(4):1259–1267
Zhong Q, Nguyen P, Ma Z, Sheng W (2014) Self-synchronized synchronverters: inverters without
a dedicated synchronization unit. IEEE Trans Power Electron 29(2):617–630
Zhong Q, Konstantopoulos GC, Ren B, Krstic M (2018) Improved synchronverters with bounded
frequency and voltage for smart grid integration. IEEE Trans Smart Grid 9(2):786–796
Chapter 10
Effect of Diverse Harmonic Order
Frequencies on Dynamic PV Hosting
Capacity Assessment in Active
Distribution Network: A Typhoon HIL
Based Approach
Abstract Increase in the per capita energy consumption across the globe is show-
casing the use of a wide range of electrical devices, machineries and appliances in
domestic as well as in industries. Major portions of these loads are either dynamic
or non-linear. These dynamic and non-linear loads often cause distortion in the sinu-
soidal signals leading to the generation of unwanted harmonics. These harmonics
cause various operational as well as long-term permanent damage to the equipment
connected to the distribution system such as variation in load profile, increased line
losses, overheating of machines and devices, false tripping of the protection system
and generation loss. To decrease the gap between generation and demand, integra-
tion of new renewable to the existing grid is ineluctable. To use these renewable
in the existing grid, power system parameters need to be verified if they are within
the specified utility standards. Although the maximum value of the renewable inte-
grations is estimated during integration, the presence of unexpected non-sinusoidal
signals diminishes such estimated values. In this work, the estimation of the effect of
individual harmonics on line parameters and subsequently its effect on the hosting
capacity (HC) of the network is analyzed extensively. In this context authors used
Typhoon HIL real-time simulation platform for modeling the reconfigured IEEE-
33 bus distribution system and accurate and cost effective analysis for this study.
Additionally, ETAP is used for calculating THD and MATLAB is used for scripting
of load flow techniques and measurement of current THD using MATLAB’s FFT
analysis tool on Simulink to support the claim of the real-time results.
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 255
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_10
256 S. Kumari et al.
10.1 Introduction
With the growing power demand and depletion of fossil fuels, the conventional
power system needs up-gradation to meet the demand. One of the ways to meet the
demand is to use renewable sources in the existing grid (Bollen and Hassan 2022).
Among various distributed energy resources (DERs), photovoltaic distributed gener-
ation (PVDG) is widely used due to various technical, economical as well as environ-
mental benefits (Tsikalakis and Hatziargyriou 2007). To balance the demand, DER
integration is considered one of the solutions but the amount of DER that can be
added needs to be calculated; hence the concept of hosting capacity (HC) comes into
picture. The amount of DER penetration into the power grid that may be permitted
without compromising the system’s reliability or power quality is determined using
the network’s HC (Chathurangi et al. 2018). PV HC is governed by various opera-
tional limiting factors which include bus voltage limits, ampacity, harmonic limits,
variation in load parameter, feeder length, R/X ratio, Thevenin impedance, and distri-
bution network topology (Chathurangi et al. 2018; Sahu and Ghosh 2020; Jothibasu
et al. 2019; Alturki et al. 2018; Santos et al. 2015). The voltage limitations are
imposed to reduce the losses in the system and prevent faulty operation of the protec-
tion devices whereas the ampacity reduces the risk of overheating of conductors, and
insulation failures (Sahu et al. 2020). Numerous researches have been done to maxi-
mize the PV HC which focuses on the several approaches for the estimation and
maximization of HC including active distribution network (ADN) management, a
stochastic approach using Monte Carlo simulation and optimization-based calcu-
lations. The optimization-based simulation focuses on the deployment of PV with
optimal size at optimal locations (Alturki et al. 2018). To maximize the PV HC,
random allocation of PV is done at various locations keeping fundamental voltage as
a constraint at each node in a stochastic approach through Monte Carlo simulation
(Jothibasu et al. 2019). However, the ADN can be managed to maximize the PV
HC by optimally using control devices and smart inverters (Ding and Mather 2017).
By installing new distribution lines with tie-switches, adding switching capacitors,
altering voltage regulator taps, managing controllable branch switches, and moni-
toring smart PV inverters, the PV HC can be optimized (Chathurangi et al. 2018;
Ding and Mather 2017; Alturki and Khodaei 2018). The optimal reconfiguration
will also lead to a better voltage profile and reduced losses. Therefore, for this work,
a reconfigured IEEE-33 bus system is considered (Rajaram et al. 2015; Wazir and
Arbab 2016). To assess the effect of diverse harmonic order frequency on network
parameters and HC, various literatures were studied which are reviewed in the next
section.
10 Effect of Diverse Harmonic Order Frequencies … 257
estimation as it will mimic the real plant that will consider the system harmonics.
The integration of various non-linear devices into the network injects higher order
of harmonics which thereby results in a change of network parameters which will
eventually affect HC. Therefore, it needs to be studied in an elaborate manner.
Below are the contributions of the work to illustrate the effect of diverse harmonic
orders of frequency on HC.
i. A 5-bus distribution network and a reconfigured IEEE-33 bus system are
modeled in Typhoon HIL and ETAP software for the analysis of diverse
harmonic components on HC.
ii. The currents and voltages at the PCC are extracted from Typhoon HIL, thereafter,
the FFT analysis is done on these signals using FFT analysis tool to calculate
the THD% and dominant harmonics using MATLAB to ensure current THD
abides by the IEEE 519–2014 standard.
iii. HLF is performed on the distribution systems using MATLAB to calculate the
changes in the network parameters due to the presence of non-fundamental
currents in the system.
iv. DLF is performed considering the dynamic effect of the harmonic current on the
varying network parameters to check the operational constraints such as node
voltage.
v. Lastly, HLF is performed to confirm the variation of HC with a change in
harmonic contents in the distribution system.
The organization of this chapter is as follows. The effect of power system param-
eters on HC is highlighted in Sect. 10.3. Section 10.4 gives the methodology for the
determination of harmonic impedance. Section 10.5 illustrates the concept of hosting
capacity. Section 10.6 describes the real-time simulation platform used to analyze the
effect of harmonics on HC. Section 10.7 details other tools used for HC assessment.
The case study and outcomes are depicted in Sect. 10.8. Lastly, Sect. 10.9 concludes
the findings of the study.
With the increasing introduction of power electronic devices like rectifiers, inverters,
static VARs, etc. into the existing power system, the sinusoidal nature of the volt-
ages and currents in the system gets disturbed resulting in harmonic variation in
the system. These harmonics hamper the voltage and current profile of the system
which eventually leads to deterioration of the power quality of the system. The injec-
tion of harmonics also leads to changes in parameters like the node voltage, current
injection, line impedances, and power injection into the system. Since the harmonic
frequency keeps on changing, it results in the change in line impedance Z line as the
reactance of the line X line is dependent on frequency f .
10 Effect of Diverse Harmonic Order Frequencies … 259
where Rline is the line resistance and the line reactance X line = 2π fL (L is the line
inductance). Due to changes in line parameters, the node voltages start to change.
Parameters such as node voltage and current injection into the distribution system play
a pivotal role in the HC assessment. The distribution side may experience a number
of problems as a result of violating the fundamental voltage restrictions, including
an uneven voltage profile that may contribute to ohmic losses and erroneous tripping
of protective devices. The next decisive factor should be the current since variations
in the current can cause equipment failure, device malfunction, and equipment and
line thermal breakdown. Hence, voltage and current are the deciding factors for the
estimation of HC. Hence these factors need to be maintained according to the IEEE
standards.
In this context, IEEE 519 standard ensures the harmonic component content in
voltage as well as current in the power system network at the Point of Common
Coupling (PCC). As per the IEEE-519 standard, THD is defined as the ratio of the
root mean square (rms) of the harmonic content, considering harmonic components
up to the 50th order and specifically excluding inter-harmonics, expressed as a percent
of the fundamental (IEEE Recommended Practice 2014). This standard limits the
total distortions in currents and voltages at the PCC. This work focused on the current
distortion limits at the PCC across the network. Current THD (T H D I ) is defined as
the ratio of the root mean square value of the harmonic currents to the fundamental
current.
/
I22 + I32 + · · · + I N2
T H DI = (10.2)
I1
where I1 is the fundamental rms value of current signal and I N is the nth rms harmonic
component of current signal.
THD plays a significant role in maintaining the distortions under specified limits
as per IEEE-519. Therefore, to find the THD of the current signal, the Fast Fourier
Transform (FFT) analysis is performed on those signals. The discrete Fourier trans-
form (DFT) of a sequence, or its inverse (IDFT), is calculated by the FFT method
(Brigham and Morrow 1967). Fourier analysis converts a signal from its primary
domain (often time) to a representation in the frequency domain and vice versa.
The FFT of current signal i (n) can be represented as:
N −1
E
I (k) = i (n).wkn
N (10.3)
n=0
j2π
wher e k = 0, 1, 2, 3, . . . , N − 1, w N = e− N is the twiddle factor.
In this work, FFT analysis is performed using MATLAB Simulink. FFT analysis
of the signals will provide the THD% values and the harmonic order of frequency that
260 S. Kumari et al.
is dominant. Upon finding the THD and dominant harmonic frequencies, load flow
is performed on the distribution system to determine harmonic impedance which is
detailed in the next section.
To find the change in voltages at different buses, load flow analysis is done on
the distribution networks. To analyze the fundamental voltage profile, Distribution
Load Flow (DLF) analysis is performed. DLF method of analysis is preferred over
various other methods because of its lower complexity, quick convergence, and higher
computation speed. This method eliminates the tedious work of calculation of Ybus
matrix or Jacobian matrix. DLF method only requires the use of line and load param-
eters (Teng 2003). With the line parameters, two fixed matrices are formed named
BIBC and BCBV matrix, and the combination of both the matrices is named as DLF
matrix. The calculation of these matrices is detailed as follows:
For a radial distribution system, the relationship between bus injection currents
and branch currents is evaluated which uses the concept of Kirchhoff’s Current Law
(KCL) and backward sweep methodology. The Eqs. (10.4)–(10.15) used for DLF
analysis is referred from Teng (2003). For a distribution system with N number of
buses and M branch sections, the relationship between bus injection currents Inode
and branch currents Ibranch is expressed in Eq. (10.4).
f or j = 2, 3, ..., N
f or j = 2, 3, ..., N
⎡ ⎤
I2(k)
⎢ I3(k) ⎥
⎢ ⎥
Inode = ⎢ .. ⎥ (10.10)
⎣ . ⎦
I N(k)
For nodes where PVDG is connected, the net apparent power Snet at the node in
Eq. (10.9) can be considered as
where apparent power of the load is Sload = Pload + j Q load and the real power of
PVDG is PP V .
Step 4: Compute [/\V ]
| |
/\V (k) = [DL F][Inode (k) ] (10.12)
⎡ ⎤ ⎡ ⎤
/\V (k)
2 Vs − V2
⎢ /\V (k) ⎥ ⎢ Vs − V3 ⎥
⎢ 3 ⎥ ⎢ ⎥
where [/\V ] = ⎢ . ⎥=⎢ .. ⎥
⎣ .. ⎦ ⎣ . ⎦
/\V (k)
N Vs − VN
Step 5: Update node voltage
f or j = 2, 3, ..., N
f or j = 2, 3, ..., N
(k)
Step 8: If emax ≤ ε(tolerance), then compute node voltages else update the iteration
as k = k + 1 and go to Step 3.
The above steps will calculate the node voltages with a distribution network with
DG at steady state. The following section explains the harmonic load flow technique
which helps in observing the harmonic node voltages at different order of frequencies.
different harmonics. The generalized harmonic load flow considers the net effect of
harmonic currents contributed by linear loads, non-linear loads, and shunt capacitors
as shown in Teng and Chang (2007).
However, for the concerned networks of this book chapter, there is no inclu-
sion of shunt capacitors hence the matrices concerning them in Teng’s paper (Teng
and Chang 2007) can be omitted. Therefore the simplified HLF based on the
forward/backward sweep method used here can be represented as follows:
The system harmonic currents [I h ] can be expressed as in Eq. (10.16):
| | T
I h,k = [I h h,k ] (10.16)
where [Ah ihj ] is the coefficient matrix associated with harmonic currents contributed
by different loads connected.
Hence the branch currents due to harmonic currents can be represented by
Eq. (10.18).
| | T h,k
Bih,k
j = [Aih,k
j ] [I ] (10.18)
The branch voltage drop due to system harmonics can be represented by the
expression in Eq. (10.19).
T
/\Vih,k h h,k
j = Z i j [Ai j ] [I
h,k
] (10.19)
where [H Ah ] represents the relationship matrix between bus voltage matrix and
current harmonic matrix.
Equation (10.20) will calculate the harmonic bus voltages at a different order of
frequencies.
264 S. Kumari et al.
The voltage variations due to harmonic injection can then be observed in different
harmonic orders. Since voltage variation plays a major role in the power injection
into the system, variation in voltage can cause a change in the PV hosting capacity
of the entire system as explained in Sect. 10.5.
To meet the growing power demand, over the years, there has been an increase in
PV usage in the distribution system. Although usages of distributed energy resources
(DERs) like solar photovoltaic (SPV) is widely adopted, with harmonic rich power
systems, power injection gets limited into the system. With the usage of DERs, there
is a bi-directional power flow in the system which complicates the conventional
power flow. Thus, the PV penetration into the radial distribution system may result
in deteriorating the power system parameters beyond the specified utility standards.
This deviation eventually raises the concern of the quality maintenance, hence the
PV integration needs to be done according to the network capacity, i.e., according
to hosting capacity (HC). Hosting capacity is defined as the maximum amount of
DER that can be connected to the existing distribution network without violating the
voltage and current limits (Sahu and Ghosh 2020).
Different types of DER integration have different effects on the hosting capacity
(Sahu et al. 2020). PV hosting capacity is also dependent on several factors which
include the system’s Thevenin impedance, network characteristics, size and location
of solar PV, and voltage control regulating devices. HC is also dependent on the
length of the feeder and the conductor type used. To allow additional PV integration
into the existing system optimally adding new distribution lines with tie-switches,
adding switching capacitors, regulating voltage regulator taps, monitoring control-
lable branch switches, reactive power control, and controlling smart PV inverters
could be some of the various ways in which PV HC can be maximized (Chathurangi
et al. 2018; Sahu and Ghosh 2020; Ding and Mather 2017; Alturki and Khodaei
2018). SPV hosting is also determined by critical factors such as the maximum
feeder voltage and excessive line loading (Jothibasu et al. 2019).
The real power injection at the PCC can be estimated using Eq. (10.21) (Sahu and
Ghosh 2020) as follows:
V pcc (V pcc − V )
P= + Pload (10.21)
(Rth + X th tanϕ)
where V pcc is the maximum voltage at PCC, V is the grid voltage, Rth is the Thevenin
resistance of the line, X th is the Thevenin reactance of the line, Pload is the active
power of the load and ϕ denotes the power factor angle of the load.
Equation (10.21) suggests a relation between the power injected into the system,
node voltage, and Thevenin impedance. Therefore, it can be inferred that voltage
and current play an important role in the estimation of HC. In this work, the authors
10 Effect of Diverse Harmonic Order Frequencies … 265
focused on the prior mentioned parameters and the effect of harmonic order on
those parameters. Also, due to the various types of load integration across nodes
of the network, there is a certainty of a wide range of harmonics injection into the
distribution system. Additionally, the variation in load can’t be ignored which leads
to changes in the HC at different nodes of the network. Hence to further analyze the
effect of harmonics on the indicators of HC, multiple high fidelity real-time as well
as offline simulation software are used namely Typhoon HIL, ETAP, and MATLAB.
Typhoon HIL has been used by several researchers to analyze HC for real-time
simulation (Sahu and Ghosh 2020, 2021a, b), but the application of Typhoon HIL
for HC considering harmonic impedance as an indicator is not been reported in any
literature so far according to the best knowledge of the authors. A detailed explanation
of the simulation platforms is explained in the next section.
The flowchart shown in Fig. 10.1, summarizes the workflow to achieve the
objectives of this chapter.
Real-time simulation has gained its importance over the years. It allows users to
mimic the actual complex model onto a platform on the computer and execute it
at the same rate as an actual system. It enables users to efficiently study various
controllers and networks in an actual environment at a reduced cost, reduced risk of
damaging the hardware, and quick testing and simulation of the networks. Therefore,
the effect of system’s diverse harmonics on the estimation of HC can be analyzed
using a real-time simulation platform, the Typhoon HIL real-time simulator which
enables the authors to perform accurate estimation of the effect of harmonics.
266 S. Kumari et al.
Typhoon HIL is a software and hardware package used for real-time simula-
tion which is not limited to micro-grids and distribution systems. The hardware
and software both being co-developed enable the researchers to save time on the
integration of the two. The real-time simulator whose primary processor is FPGA
and general-purpose CPUs is used for slow dynamics. Typhoon is enriched with
different libraries and firmware configurations for diverse applications. It is known
for its high fidelity and speed and high switching frequency with the latest 4th gener-
ation devices. It can allow a high switching frequency and very low simulation time
step as low as 500 ns. Typhoon HIL software allows users to work at different step
times according to the type of simulation, alternatively, if the user doesn’t have a
fair idea about the time step the internal process selects an optimal time step. This
software allows researchers/engineers to test their networks at a reduced cost. With
the expanse of the HIL series and its libraries, the testing process is simplified and
saved time for engineers working on micro-grids, distribution networks, and solar
PV inverters. Typhoon HIL real-time emulators help in testing and validating the
result with real-time simulation. The results from the emulator are very efficient.
The advantages of Typhoon HIL can be listed as follows:
(1) High fidelity
(2) Very small simulation time step
(3) Ultra-low latency Analog IO
(4) Ultra-fast Digital IO.
Typhoon HIL finds application in various fields which are not limited to:
(1) Power Systems
(2) Power electronics and drives
(3) Micro-grid and Smart grids
(4) Power Quality Analysis
(5) HVDC and FACTS
(6) Power system protection
(7) Phasor Measurement Unit(PMU) and Synchrophasor study, etc.
Typhoon HIL offers various device settings such as HIL 402, 404 (4th generation),
602+, 603, 604, 606 (4th generation), and VHIL+. Along with that, it has several
configurations which vary in memory, machine support, etc.
Below steps are followed to create and simulate a model in Typhoon HIL real-time
simulator:
Step 1: Choosing Hardware settings
The hardware device is chosen along with the configuration according to the number
of SPCs and converter weight needed. Typhoon HIL can also detect the hardware if
an emulator is connected to the plant. The simulation method and time step can also
be set in this window.
Different simulators offer different hardware configurations. One such real-time
simulator is HIL 604 whose configuration is shown in Fig. 10.2.
10 Effect of Diverse Harmonic Order Frequencies … 267
results and to change any parameter a SCADA needs to be designed according to the
user need. The details of SCADA design are explained in the next step.
Step 5: Designing SCADA Panel
To interact with the developed model or observe the results, an interface is designed
in the Typhoon HIL environment. This is called as SCADA interface, where the
user can give command to the developed model with the help of action weights. For
observing the results, monitoring weights such as scope, digital display, test-box, and
trace graph can be used. In case, data recording is required data logging weights can
be used, with varying data sampling rates can be used. Also, file formats like ‘.csv’,
‘. mat’, and ‘HDF5’ are supported for data logging. For very high-resolution data
recording internal scope can be used with 1 million samples per second resolution.
Lastly, mathematical operation can also be formed on the data received from the
measurement units. For example: in this considered case the line current signals are
extracted from the scope in.csv format which is situated in the SCADA of Typhoon
HIL environment.
Step 6: Saving the Model Settings
The rightmost panel on the window is used to save the model settings. The model
settings include contactor settings, voltage parameters, etc. The contactors are kept
in closed mode.
These steps allow users to efficiently model and run the network in real-time
environment using a Typhoon HIL emulator.
The next section briefly explains the use of other tools required for the analysis
of distribution networks in presence of harmonics.
This software is used for electrical network modeling and simulation software tools
used by power systems engineers to analyze electrical power system dynamics,
transients, and protection. This is industry-standard software that is very useful for
performing complex analyzes on electric power systems. It can be efficiently used
for load flow analysis and harmonic analysis on large systems.
In this chapter, this software will be used for the estimation of line current
THD% in different distribution networks, using the harmonic analysis module in
this software.
10 Effect of Diverse Harmonic Order Frequencies … 269
10.7.2 MATLAB
For analysis of attaining the desired objective, the case study is done on two models:
5 bus system and reconfigured IEEE-33 bus system. Both the distribution systems
are modeled and simulated on Typhoon HIL and ETAP software. To test the effect
of diverse harmonic order on hosting capacity, SPV loads are connected at different
nodes in the distribution system.
Fig. 10.4 Modeling of 5-bus distribution system on Typhoon HIL real-time platform
270 S. Kumari et al.
calculation from both the software is due to the fact that ETAP is an industry-based
software that tends to provide a safe limit of THD value. Hence, the values in ETAP
are slightly higher as compared to that of Typhoon HIL. Typhoon provides a real-
time simulation environment making it instantaneously available for further analysis.
Rigorous simulation data in both the platforms i.e., Typhoon HIL and ETAP also
confirms that for the same condition, the THD values in case of ETAP are slightly
greater than the Typhoon HIL real-time values. These phenomenon can also be
observed in Tables 10.2 and 10.5.
It is found from the FFT analysis that the odd order of harmonics upto 11th order is
dominant. Further to analyze the effect of individual harmonic orders on the system,
harmonic analysis using the forward/backward based method is performed using
MATLAB scripting. To perform HLF, the node current signal harmonic components
are fed into MATLAB scripting for accurate analysis. From the harmonics analysis, it
is witnessed that the line reactance increases with the harmonic order, and is tabulated
in Table 10.3. The individual harmonic voltages corresponding to various harmonic
orders are depicted in Fig. 10.6.
It can be observed from Fig. 10.6 that if we consider individual harmonic order,
there will be a change in voltage at all buses. It can also be observed that the domi-
nant harmonic frequencies contribute to higher node voltages compared to the non-
dominant harmonic order. Therefore, it can be concluded that the change in voltage
will result in a change in the power flow of the system. This will result in a variation
in the PV hosting capacity of the network.
A reconfigured IEEE-33 bus system is used for the analysis purpose in this chapter.
Various literatures (Rajaram et al. 2015; Wazir and Arbab 2016), suggest this network
over the non-reconfigured network due to the following advantages:
i. Reduced losses
ii. Improved voltage profile
iii. Bus voltage magnitudes are under the acceptable limits.
272
Table 10.3 Harmonic line impedance for different harmonics of 5-bus system
Sl No From bus To bus R(o) Fundamental 3rd harmonic 5th harmonic 7th harmonic 9th harmonic 11th harmonic
X(o)
1. 1 2 0.0922 0.0470 0.1410 0.2350 0.3290 0.4230 0.517
2. 2 3 0.4930 0.2512 0.7536 1.2560 1.7584 2.2608 2.7632
3. 3 4 0.3661 0.1864 0.5592 0.9320 1.3048 1.6776 2.0504
4. 4 5 0.3810 0.1941 0.5823 0.9705 1.3587 1.7469 2.1351
S. Kumari et al.
10 Effect of Diverse Harmonic Order Frequencies … 273
Fig. 10.6 Harmonic node voltages of the 5-bus distribution network a Fundamental frequency, b
3rd harmonic order, c 5th harmonic order, d 7th harmonic order, e 9th harmonic order, and f 11th
harmonic order
Table 10.4 Line and load data of reconfigured IEEE-33 bus distribution system
Sl. No From bus To bus Line data Load data
R(o) X(o) P(kW) Q(kVAR)
1. 1 2 0.0922 0.0470 100 60
2. 2 3 0.4930 0.2512 90 40
3. 3 4 0.3661 0.1864 120 80
4. 4 5 0.3811 0.1941 60 30
5. 5 6 0.8190 0.7070 60 20
6. 6 7 0.1872 0.6188 200 100
7. 8 9 1.0299 0.7400 60 20
8. 10 11 0.1967 0.0651 45 30
9. 11 12 0.3744 0.1298 60 35
10. 12 13 1.4680 1.1549 60 35
11. 13 14 0.5416 0.7129 120 80
12. 15 16 0.7462 0.5449 60 20
13. 16 17 1.2889 1.7210 60 20
14. 17 18 0.7320 0.5739 60 40
15. 18 33 0.5000 0.5000 60 40
16. 2 19 0.1640 0.1565 90 40
17. 19 20 1.5042 1.3555 90 40
18. 20 21 0.4095 0.4784 90 40
19. 21 22 0.7089 0.9373 90 40
20. 12 22 2.0000 2.0000 90 40
21. 3 23 0.4512 0.3084 90 50
22. 23 24 0.8980 0.7091 420 200
23. 24 25 0.8959 0.7071 420 200
24. 6 26 0.2031 0.1034 60 25
25. 26 27 0.2842 0.1447 60 25
26. 27 28 1.0589 0.9338 60 20
27. 28 29 0.8043 0.7006 120 70
28. 29 30 0.5074 0.2585 200 600
29. 30 31 0.9745 0.9629 150 70
30. 31 32 0.3105 0.3619 210 100
31. 8 21 2.0000 2.0000 90 40
32. 9 15 2.0000 2.0000 60 10
10 Effect of Diverse Harmonic Order Frequencies … 275
Fig. 10.7 Modeling of reconfigured IEEE-33 bus distribution system in Typhoon HIL real-time
platform
Capture/Scope widget in HIL SCADA in ‘.csv’ format. Thereafter, the FFT analysis
is performed in MATLAB’s FFT Analysis tool on those extracted signals which give
the THD% values. The identical network harmonic analysis is performed on ETAP
using the Harmonic Analysis module to find the current THD%. The current THD%
values evaluated on both the software is tabulated in Table 10.5.
It is seen from Table 10.5 that the current THD% values are well within the IEEE-
519 standards of current distortions. It is found from the FFT analysis that the odd
harmonic orders are dominant. FFT analysis on node currents are also performed
for signals extracted from Typhoon HIL. It helps in providing the harmonic content
at the nodes which is further fed into the MATLAB scripting for HLF analysis.
Similar steps are considered as previously explained for this reconfigured IEEE-33
276 S. Kumari et al.
bus system. The variation in line reactance with the change in harmonic order is
tabulated in Table 10.6. The individual harmonic voltages for reconfigured IEEE-33
bus system are presented in Fig. 10.9.
It can be observed from Fig. 10.9 that if we consider individual harmonic order,
the variation in voltage will be different for all the nodes for fixed-harmonics. This
result shows the dominance of harmonics voltage is different for different nodes.
The individual harmonic node voltage will contribute to a change in the overall node
voltage. The variation in voltage due to diverse harmonic order may result in a change
in the power flow of the active distribution system as inferred from Eq. (10.21). This
will restrict the PV penetration into the distribution system, which will not be the
same as calculated HC in case of the planning stage. The additional harmonics, which
are added to the system, may also cause various issues in the distribution system such
as losses in the connected device, unwanted resonance, and heating of equipment.
Any of the mentioned parameters considered as an indicator for DER integration
may prematurely restrict the HC of the network. This condition may also lead to the
underutilization of the available infrastructure, showcasing the importance of this
research for enabling the distribution system to work on its optimal potential to meet
the current and future energy demand.
10.9 Conclusion
Considering the current energy demand, DER integration into the distribution system
cannot be avoided. In addition to the DER integration application of various non-
linear loads are frequent. With such renewable sources and loads in the active distri-
bution network, a wide range of harmonic content cannot be avoided. In this work
effect of harmonics on network parameters are studied and following conclusions
can be drawn.
i. Line current THD was estimated for both the considered networks, according
to IEEE-519.
ii. Individual impedances are estimated corresponding to each dominant frequency
of the network.
iii. The HLF analysis is used to estimate voltage for various harmonic orders. The
HLF result shows that with an increase in harmonic content in the network,
system parameters like the node voltage and line impedance changes. The node
voltages of dominant harmonic order frequency show a higher contribution to
harmonic voltage.
iv. These changes in parameters cause the fundamental node voltage to change
which further will result in the change of power flow in the network and thereby
result in the change of HC.
Table 10.6 Harmonic line impedance for different harmonics of the reconfigured IEEE-33 bus system
278
Sl. No From bus To bus R(o) Fundamental 3rd harmonic 5th harmonic 7th harmonic 9th harmonic 11th harmonic
X(o)
1. 1 2 0.0922 0.0470 0.1410 0.2350 0.3290 0.4230 0.5170
2. 2 3 0.4930 0.2512 0.7536 1.2560 1.7584 2.2608 2.7632
3. 3 4 0.3661 0.1864 0.5592 0.9320 1.3048 1.6776 2.0504
4. 4 5 0.3811 0.1941 0.5823 0.9705 1.3587 1.7469 2.1351
5. 5 6 0.8190 0.7070 2.1210 3.5350 4.9490 6.3630 7.7770
6. 6 7 0.1872 0.6188 1.8564 3.0940 4.3316 5.5692 6.8068
7. 8 9 1.0299 0.7400 2.2200 3.7000 5.1800 6.6600 8.1400
8. 10 11 0.1967 0.0651 0.1953 0.3255 0.4557 0.5859 0.7161
9. 11 12 0.3744 0.1298 0.3894 0.649 0.9086 1.1682 1.4278
10. 12 13 1.4680 1.1549 3.4647 5.7745 8.0843 10.3941 12.7039
11. 13 14 0.5416 0.7129 2.1387 3.5645 4.9903 6.4161 7.8419
12. 15 16 0.7462 0.5449 1.6347 2.7245 3.8143 4.9041 5.9939
13. 16 17 1.2889 1.7210 5.1630 8.6050 12.047 15.489 18.931
14. 17 18 0.7320 0.5739 1.7217 2.8695 4.0173 5.1651 6.3129
15. 18 33 0.5000 0.5000 1.5000 2.5000 3.5000 4.5000 5.5000
16. 2 19 0.1640 0.1565 0.4695 0.7825 1.0955 1.4085 1.7215
17. 19 20 1.5042 1.3555 4.0665 6.7775 9.4885 12.1995 14.9105
18. 20 21 0.4095 0.4784 1.4352 2.3920 3.3488 4.3056 5.2624
19. 21 22 0.7089 0.9373 2.8119 4.6865 6.5611 8.4357 10.3103
20. 12 22 2.0000 2.0000 6.0000 10.000 14.000 18.000 22.000
(continued)
S. Kumari et al.
Table 10.6 (continued)
Sl. No From bus To bus R(o) Fundamental 3rd harmonic 5th harmonic 7th harmonic 9th harmonic 11th harmonic
X(o)
1. 1 2 0.0922 0.0470 0.1410 0.2350 0.3290 0.4230 0.5170
21. 3 23 0.4512 0.3084 0.9252 1.5420 2.1588 2.7756 3.3924
22. 23 24 0.8980 0.7091 2.1273 3.5455 4.9637 6.3816 7.8001
23. 24 25 0.8959 0.7071 2.1213 3.5355 0.9497 6.3639 7.7781
24. 6 26 0.2031 0.1034 0.3102 0.5170 0.7238 0.9306 1.1374
25. 26 27 0.2842 0.1447 0.4341 0.7235 1.0129 1.3023 1.5917
26. 27 28 1.0589 0.9338 2.8014 4.6690 6.5366 8.4042 10.272
27. 28 29 0.8043 0.7006 2.1018 3.5030 4.9042 6.3054 7.7066
28. 29 30 0.5074 0.2585 0.7755 1.2925 1.8095 2.3265 2.8435
29. 30 31 0.9745 0.9629 2.8887 4.8145 6.7403 8.6661 10.592
30. 31 32 0.3105 0.3619 1.0857 1.8095 2.5333 3.2571 3.9809
10 Effect of Diverse Harmonic Order Frequencies …
a b
c d
e f
Fig. 10.9 Harmonic node voltages of reconfigured IEEE-33 bus distribution network a Funda-
mental frequency, b 3rd harmonic order, c 5th harmonic order, d 7th harmonic order, e 9th harmonic
order, and f 11th harmonic order
References
Sahu SK, Ghosh D (2021b) Photovoltaic hosting capacity increment in an unbalanced active distribu-
tion network. ICPEE 2021—2021 1st international conference power electronics Energy, https://
doi.org/10.1109/ICPEE50452.2021.9358688
Santos IN, Ćuk V, Almeida PM, Bollen MHJ, Ribeiro PF (2015) Considerations on hosting
capacity for harmonic distortions on transmission and distribution systems. Electr Power Syst
Res 119:199–206. https://doi.org/10.1016/j.epsr.2014.09.020
Tsikalakis AG, Hatziargyriou ND (2007) Environmental benefits of distributed generation with
and without emissions trading. Energy Policy 35(6):3395–3409. https://doi.org/10.1016/j.enpol.
2006.11.022
Teng JH, Chang CY (2007) Backward/forward sweep-based harmonic analysis method for distribu-
tion systems. IEEE Trans Power Deliv 22(3):1665–1672. https://doi.org/10.1109/TPWRD.2007.
899523
Teng JH (2003) A direct approach for distribution system load flow solutions. IEEE Trans Power
Deliv 18(3):882–887, https://doi.org/10.1109/TPWRD.2003.813818
Wazir A, Arbab N (2016) Analysis and optimization of IEEE 33 bus radial distributed system using
optimization algorithm
Chapter 11
Non-directional Overcurrent Protection
Relay Testing Using Virtual
Hardware-in-the-Loop Device
Abstract Protective relays are an integral part of the power grid, making it reli-
able and secure against abnormal conditions. Hardware-in-the-Loop (HIL) can be
employed to test and validate digital protective relay devices in the real-time simula-
tion comprising hardware and software before actual implementation. However, the
HIL technique requires a complex and high-cost technical environment consisting
of hardware devices, sensors, communication, and simulation platforms. The Virtual
HIL (VHIL) Device is a new real-time simulation approach to offer the entire expe-
rience and challenges coming from the actual implementation of HIL. It allows the
users to approach the possibility of learning the principles and techniques used in
HIL without any concern related to using real hardware or physical devices. This
chapter aims to illustrate the use of the model-based system engineering toolchains
of Typhoon HIL for understanding the implementation methodology of the VHIL
technique, from creating a testing model to the process of running. A modified
version of the well-known three-phase radial feeder of the European MV distribu-
tion benchmark system created by CIGRE Task Force C6.04.02 is modelled and
simulated for evaluating non-directional overcurrent protective relay performance
through multiple short-circuit fault scenarios. The main contribution of this chapter
is to systematically introduce the modelling and simulation for testing purposes of
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 283
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_11
284 L. N. H. Pham et al.
the non-directional overcurrent protection relay in VHIL that helps power engineers
evaluate the protective relay settings under more realistic conditions.
11.1 Introduction
Power system protection plays a vital role in achieving a satisfactory level of relia-
bility and security in power systems. Relaying power system protection is a branch
of power system concerned with the principles of design and operation of equipment
called protection relays or protective relays (or simply called relays). A protection
relay is a device that detects abnormal power system conditions and initiates correc-
tive action as quickly as possible to return the power system to its normal state
(Horowitz and Phadke 2014).
One of the functions of a protective relay that is used in distribution networks
is overcurrent protection. The protection relays used in such a function could be
directional (operating for in-front events) and non-directional (will work for all)
depending upon the topology of the distribution system (Aman et al. 2011). The non-
directional relays are mostly used for radial distribution feeders, the most common
type of worldwide distribution system. Currently, it is used in combination with the
directional overcurrent protection relay according to the development of modern
networks, including more than one source or multiple lines conveying electrical
power in different directions.
Testing protection relay in software and hardware environment is vital in ensuring
the relay setting configuration in real-world systems. Hardware-in-the-Loop (HIL) is
a developing technology used in developing and testing complex real-time systems
by providing an effective platform to help validate software systems on specially
equipped test benches receiving real input data from physical devices (Review of
hardware-in-the-loop 2019). The HIL technology has been used by several authors
using the testing platform with different optimisation models (Hubschneider et al.
2018; Edrington et al. 2015; Kelm et al. 2022; Kezunovic et al. 2017; D’Arco et al.
2020).
Testing processes have been developed to be applied for a variety of subsys-
tems and functionalities in the protection systems: SCADA systems (Montaña et al.
2018), communication platforms (Pazdcrin et al. 2018), overcurrent and directional
overcurrent relays (Rodriguez et al. 2018), and distance protection systems as well
(Celeita et al. 2018). For example, the authors in Makhzani et al. (2017) investigate
the behaviour of instantaneous overcurrent protection using an OPAL-RT digital
simulator through HIL testing. In Camarillo-Peñaranda et al. (2020), virtual distance
protection relay testing was conducted through HIL simulation in PSCAD software.
However, the HIL technique requires a complex technical environment consisting of
hardware devices, sensors, communication, and simulation platforms. For instance,
11 Non-directional Overcurrent Protection Relay Testing … 285
the authors in Celeita et al. (2018) rely on micro-controllers costing around 5000
USD for a single testing platform (Camarillo-Peñaranda et al. 2020). To allow the
users to approach the possibility of learning the principles and techniques used in HIL
without any concern related to using real hardware or physical devices, Virtual HIL
(VHIL) Device is a new technique to offer all the experience (including challenges)
coming from the real implementation of HIL.
This chapter aims to illustrate the use of model-based system engineering
toolchains of Typhoon HIL to understand the implementation methodology for eval-
uating non-directional overcurrent protection relay performance, from creating a
testing model to the process of running.
A practical and illustrative example of “How to” create a model and simulate it
inside the Typhoon HIL Control Centre environment using the “Virtual HIL Device”
is provided. A simple radial distribution is used for illustrative purposes through
multiple short-circuit scenarios: three-phase, three-phase-to-ground, single-phase-
to-ground, phase-to-phase, and two-phase-to-ground.
This chapter starts by introducing the problem and giving an overview of the
overcurrent protection function of the protection relay. The workflow inside Typhoon
HIL Control Centre is explained. The model creation starts with the use of HIL
Schematic Editor; then, the methods of creating HIL SCADA are introduced to
illustrate how to display numerical results and visualise signals. Finally, simulation
results through short-circuit fault scenarios are displayed, and a discussion of the
results is performed.
B0 B1 B2
Trx
/// ///
R
External Grid
Load A Load B
Fig. 11.1 Test System. Simplified equivalent model of the three-phase radial feeder of the European
MV distribution benchmark system
is used to reduce the voltage to 20 kV. Buses B1 and B2 are connected throughout an
overhead transmission distribution line called “Line 12”. On buses B1 and B2, two
lumped loads named “Load A” and “Load B” are connected to each bus.
A non-directional overcurrent protection relay is connected to the overhead distri-
bution line “Line 12” sending terminal. The protection relay located at the beginning
of the overhead line offers feeder protection. In the case of short-circuit fault situa-
tions, it must be prevented from spreading to healthy parts of the network to ensure
that the power grid continues to supply energy. The main requirements for the feeder
protection are as follows:
• During the short circuit, the circuit breaker nearest to the fault should open, and
all other circuit breakers remain in a closed position.
• If the circuit breaker nearest to the fault fails to open, then backup protection
should be provided by the adjacent protection relay ordering the opening of its
circuit breaker.
• The operating time of the protection relay should be small enough to maintain the
system stability without the need to trip a circuit.
The classical non-directional overcurrent protection relays use a straightforward
protection principle; the protection relay senses the feeder current through the
secondary winding of the current transformer (CT) and compares it with a predeter-
mined threshold value. The protective relay operates if the sensed current is above
the threshold and the trip signal is generated and sent to the tripping circuit of the
circuit breaker (BK) to isolate the faulty feeder from the rest of the healthy remaining
part of the system.
Depending on the technologies (analog or digital), the non-directional overcurrent
protective relay may have a specific internal design; Fig. 11.2 shows a simplified
block diagram of a non-directional overcurrent relay and its signal flows with the
other components of the protection system.
The operating characteristics of non-directional overcurrent protection relays are
defined by the operating times typically governed by a time versus current magnitude
curve (I–t).
Considering the modern protection practice, there are three main types of time–
current operating characteristics:
11 Non-directional Overcurrent Protection Relay Testing … 287
• Instantaneous.
• Time-dependent: Definite time and inverse time.
• Mixed: Combination of the previously stated.
The instantaneous overcurrent function is characterised by no time delay inten-
tionally provided. Nowadays, the operating time of the instantaneous overcurrent
function is less than ten milliseconds and is sometimes expressed in cycles based
on the power system frequency (Mehta 2005). The instantaneous overcurrent func-
tion has only the pickup current setting and does not have any time delay setting.
The pickup current is adjustable, and the application engineer can choose various
settings from a wide range. The operating characteristics of this type can be shown
in Fig. 11.3.
The time-dependent overcurrent function characteristics have been standardised
in modern times to allow protection engineers a coherent use of the protection char-
acteristics. As the name implies, these overcurrent protection functions operate with
an intentional time delay. The minimum current at which the protection relay oper-
ates (pickup current) and the delay time before the trip are both adjustable. Two types
of time-dependant overcurrent functions are broken into two categories: Define time
and inverse time.
The define-time protection relays operate with some intentional time delay and are
adjustable along with the current pickup level. Inverse-time protection relays have an
operating time depending on the magnitude of the current, generally with an inverse
characteristic (the operating time of the overcurrent protection relay is smaller as the
current gets more significant).
The inverse-time operating characteristics have evolved over time, and then stan-
dardisation allowed homologating them. Two primary standards are used worldwide,
288 L. N. H. Pham et al.
the American standard IEEE C37.112–1996 (IEEE Standard for Inverse-Time Char-
acteristics Equations for Overcurrent Relays 2019) and the European IEC 60,255
(IEC 2009). The inverse-time operating characteristics according to the two standards
are shown in Fig. 11.4.
Tables 11.5 and 11.6 show the equations associated with US curves and IEC
curves, respectively, where tp is operating time in seconds, TD is time-dial setting,
TMS is time multiplier setting, and M is applied multiples of pickup current.
The mixed overcurrent function consists of the different types of overcurrent
protection relay elements packed into a single programmable unit. The combination
of instantaneous, define-time, and inverse-time elements may be used in this type of
protection relay.
ANSI/IEEE standards are used to define the protection operating characteristics
in America, while IEC standards are a common practice in Europe. Therefore, it is
typical to use some codes and nodes when practically referring to protection functions
according to these standards.
11 Non-directional Overcurrent Protection Relay Testing … 289
Fig. 11.4 Inverse-time overcurrent protection relay characteristic. a The American standard IEEE
C37.112–1996. b The European IEC 60,255
overcurrent element has only one setting, the pickup current. On the other hand, the
inverse-time overcurrent element has two basic settings: the pick current and the time
delay settings. The process of determining the time delay setting involves.
(1) Calculation of a time-dial or time multiplier setting in definite-time overcurrent
elements.
(2) Selection in inverse-time overcurrent elements of a time–current curve from a
family of curves as given in Tables 11.5 and 11.6.
These settings must be evaluated for reliability and correct operation before
installing and deploying protective relays in a real-world system. The need for
protection relay testing can be divided into four categories:
• Type testing. It is an extensive process where the quality of a newly fabricated
relay or new software revision for a relay model is concerned.
• Acceptance testing. The protective relay is tested to prove that it is the correct
model and that all the features work as they should. It consists of functional tests
of inputs, outputs, displays, communication, and in some cases, predefined pickup
and timing tests.
• Commissioning testing. It is a site-specific test to confirm all protective elements
and logic settings are correct for their intended uses.
• Maintenance testing. It is used to ensure a protective relay continues to operate
as it should.
At the same time, the protective relay testing methods and equipment become more
powerful. However, they require time, effort, and expensive physical equipment to
conduct tests on the protective relay.
The authors in this chapter contributed an adequate protection relay testing method
that overcomes the limitations of the previous testing methods by using real-time
simulation. It allows the testing model to be executed at the same rate as actual
physical devices making these tests more realistic under multiple testing scenarios.
For this purpose, the testing model is created that can be used for real-time simula-
tion by using model-based engineering toolchains of Typhoon HIL. Two overcurrent
protective functions are focused on, instantaneous overcurrent and inverse-time over-
current. The implementation methodology of creating the model and conducting
non-directional overcurrent protection relay testing is described in the following
sections.
The authors used the modelling and simulation framework for digital real-time
simulations created by Typhoon HIL.
11 Non-directional Overcurrent Protection Relay Testing … 291
(a)
(b)
Fig. 11.5 a Desktop icon of Typhoon HIL Control Centre v2022.1 SP1, b Typhoon HIL Control
Centre in software initialisation
To start working in Schematic Editor Environment, there are two alternatives for
creating a new schematic. The users can use the existing access toolbar to create a
new model or use the combination key “Ctrl + N” on the PC keyboard. After that,
the setting window will appear and require users to define the schematic setting (see
Fig. 11.8).
After finishing the setup of schematic settings, the Schematic Editor will load
the Library of Components, and a new schematic design will be ready to start the
building of the model.
To find components, the users can navigate the library tree or use the library
explorer until having suitable components for the model. The model can be placed
by classically dragging and dropping and/or rotating a component; the users can take
advantage of the right bottom context menu when right-clicking on the component.
11 Non-directional Overcurrent Protection Relay Testing … 293
The simplified benchmark network used for the Test System circuit is created in the
Schematic Editor. According to Fig. 11.1, the components of the Test System include
an external grid, a two-winding power transformer (“Trx”), a non-directional overcur-
rent protection relay (R), three buses (B0, B1, and B2), a section of transmission line
(Line 12), and three lumped three-phase loads (A and B). Additionally, short-circuit
294 L. N. H. Pham et al.
Fig. 11.8 Window showing the setting used for a New Schematic
faults occurring at the end of the transmission line are simulated for the purpose
of testing the non-directional overcurrent protection relay. These components are
defined as follows:
• External grid ( ): In the branch “Test Suite” of the library tree, the component
named “Grid Simulator” is used for modelling the external grid component of the
test system (Fig. 11.9).
• Transformer ( ): For the transformer component, the “Three-phase Two-Winding
Transformer” in the “Transformer” branch of the library is selected (Fig. 11.10).
• Line 12 ( ): For the transmission line “Line 12” component, “Transmission
Line” in the “PI section” part of the “Transmission Lines” of the library is selected
(Fig. 11.11).
• Loads ( ):Loads A and B are modelled as a constant impedance and it is
implemented by using the “Constant Impedance Load” in section “Loads” of
the “Microgrid” branch (Fig. 11.12).
• Buses ( ): For bus B0, B1, and B2 components, users can use “Electrical port”
in the “Ports” branch and define a bus with three-port in and three-port out, then
merge them under “Subsystem” (Fig. 11.13).
• Overcurrent protection relay ( ): The overcurrent protection relay device is
different from the aforementioned components. It cannot be represented by indi-
vidual components in the library but can be emulated by a combination of
protective relay functions, current transformer, and measurement devices. This
component is defined in a later section (see Sect. 3.1.3) (Fig. 11.14).
11 Non-directional Overcurrent Protection Relay Testing … 295
and S4, respectively. In the case when one of these switches is closed, a short
circuit will occur. For example, four switches, S1, S2, S3, and S4, are closed for
the three-phase-to-ground short-circuit case (Fig. 11.15).
11 Non-directional Overcurrent Protection Relay Testing … 297
Fig. 11.14 Complete overcurrent protection relay component (R) named “Soft Relay”
After placing all components in the schematic environment, the components need
to be connected. The users will notice that the line connecting the initial terminal
is attached to the cursor and then move to the next terminal, and then perform a
right-click at the ending terminal to finish the connection. The complete Test System
model with the full connection of components can be shown in Fig. 11.16.
To edit the parameters of components, the users use double-click to open a
properties window to include the appropriate data. For the external grid ( )
and the “Trx” component ( ), the user can edit the parameters according to
Tables 11.1 and 11.2, respectively. To edit the transmission line ( ) and loads (
298 L. N. H. Pham et al.
Fig. 11.15 a Fault element. b Nominal operating and short-circuit fault scenario modelling
11 Non-directional Overcurrent Protection Relay Testing … 299
Table 11.3 Transmission line parameters with R 'ph , X 'ph , B 'ph , R0' , X 0' , and B0' that are positive
and zero sequence resistance, reactance, and susceptance values, respectively
R 'ph X 'ph B 'ph R0' X 0' B0' Length
[Ω/km] [Ω/km] [µS/km] [Ω/km] [Ω/km] [µS/km] [km]
0.501 0.716 47.493 0.817 1.598 47.493 2.82
3 matrix form. As a consequence, the parameters set through the properties window
will be filled in according to the nameplates of the user-set parameters. For instance,
as shown in Fig. 11.18, “class cable” consists of common parameters of a typical
cable: zero sequence and positive sequence of resistance, reactance, and capacitance;
variable “LT ” is declared as “class cable”; the set data for resistance parameter of the
transmission line is “LT.Rabc_matrix” meaning resistance matrix in “class cable”
(Table 11.3).
Similarly, for load components (Loads A and B), with the parameters shown in
Table 11.4, the set data for nominal three-phase power and power factor is under
matrix form, as shown in Fig. 11.19.
The buses ( ), non-directional overcurrent protective relay ( ), and fault ( )
are only connected and are not necessarily edited.
Fig. 11.18 Edit “Transmission line” parameters using “Model initialisation function”
11 Non-directional Overcurrent Protection Relay Testing … 303
50 and ANSI 51 elements. The inputs of this element are “Mem_reset”, “Meas_in”,
“CT ”, and “Manual_reset”.
These input signals are used by the subsystems inside the “Relay” as shown in
Fig. 11.21. The input “Mem_reset” aims to send the protective functional blocks
inside “Relay” which will reset the memory of the protective functional blocks. The
input “Meas_in” is used to receive the measured RMS current from , the input “CT ”
is intended to receive the ratio of current transformer, and the input “Manual_reset”
is used to receive the trip signal reset of the “Relay”. These input values can be
configured in the HIL SCADA interface.
Figure 11.31 shows the subsystems inside the “Relay” that are “Protective func-
tions”, “Trip Source combination”, “Trip Memory reset zone”, and “Trip Signal zone”.
Each of these subsystems is explained as follows:
• Protective functions: In this subsystem, there are two main overcurrent protective
functional blocks with the specific description and parameter settings that are
available in ‘ANSI protective functions’ (2022), including
– “(50) Instantaneous Overcurrent” (see Fig. 11.22). This block is dedicated to
providing instantaneous protection against high currents. This block issues a
304 L. N. H. Pham et al.
Fig. 11.20 Schematic diagram of the complete overcurrent protection scheme with four main
elements, for overcurrent functions, for measurement device, for circuit breaker, and for
defining operating time of protection relay
11 Non-directional Overcurrent Protection Relay Testing … 305
trip signal without any time delay. The inputs of this block are “Meas_in”,
“Mem (En/Rst)”, “CT ”, and “OC_threshold_pu”. Two inputs, “Meas_in” and
“CT ”, are connected with the “Relay” inputs through previously declared
nameplates, the input “Mem (En/Rst)” is intended to reset the trip memory,
and the input “OC_threshold_pu” is used to receive the threshold value from
HIL SCADA interface. The output signals are “trip_inst”, “trip_A”, “trip_B”,
“trip_C”, and “Mem”. The output “trip_A” is used to move the protective relay
dials towards trip position if the measured current crosses the preset threshold
value on phase A. The same purpose goes for “trip_B” and “trip_C” in phase
B and phase C, respectively. However, these outputs are not used; instead,
using the output “trip_inst” sends the trip signals when any currents at any
of the phases cross the defined threshold. The output “Mem” is used to send
the feedback of trip memory; when the tripping occurs, this output is active;
otherwise, this output is inactive.
– “(51) AC Inverse Time Overcurrent” (see Fig. 11.23). This block is dedicated
to protecting against high currents based on time-dial and inverse-time over-
current curves. There are six inputs of this block including “Mem (En/Rst)”,
“Meas_in”, “TOC_thresh”, “TOC_curve_type”, “TOC_timeDial”, and “CT ”.
Two inputs, “Meas_in” and “CT ”, are connected with the “Relay” inputs
through previously declared nameplates; the input “Mem (En/Rst)” is used to
reset the trip memory; the input “TOC_thresh” is used to receive the threshold
value from HIL SCADA interface; the input “TOC_curve_type” is used to
define the inverse-time overcurrent curves corresponding to a family of curves
in Tables 11.5 and 11.6, and the input “TOC_timeDial” is used to receive the
306 L. N. H. Pham et al.
TD or TMS values from HIL SCADA. The output signals are “dial_reset”,
“time_trip”, and “Mem”. The output “dial_reset” is intended for feedback on
the dial states, the output “time_trip” is used for an inverse-time overcurrent
trip command, and the output “Mem” is used to send the feedback of trip
memory; when the tripping occurs, this output is active; otherwise, this output
is inactive.
• “Trip Source Combination” (see Fig. 11.24): the “OR” block (out is True if
any inputs are True) in this subsystem is dedicated to receiving the output
signal “trip_inst” from “(50) Instantaneous Overcurrent” and the output signal
“time_trip” from “(51) AC Inverse Time Overcurrent”. When any protective func-
tions detect a fault, the trip is issued, which triggers a command to the output of
the “OR” block that sends the trip signal to the HIL SCADA interface.
• “Trip-Memory Reset Zone”: In this area, there is a combination of multiple
functional blocks for memory, and trip reset of protection functional blocks as
follows:
– “Trip Memory Combination/Memory Reset Logic” (see Fig. 11.25). There are
two logical blocks in this area, the “NXOR” block (out is True if all inputs are
True or False) and the “OR” block. The “OR” block is dedicated to receiving
the output “Mem” of two protective functional blocks “(50) Instantaneous
Overcurrent” and “(51) AC Inverse Time Overcurrent”. The “NXOR” block
has two inputs, one is the output of the “OR” block, and one is “Mem_reset”,
an input of the “Relay” that can be configured from the HIL SCADA interface.
When one of two protection functional blocks detects a fault, the output signal
of “OR” is active; and if the “Mem_reset” signal is active contemporaneous
via the HIL SCADA interface, the output of “NXOR” is activated and sends the
memory reset signal to the input “Mem (En/Rst)” of two protection functional
blocks.
– “Reset Source Combination” (see Fig. 11.26). The “AND” block (out is
True if all inputs are True) in this subsystem has two inputs, one is the
output “dial_reset” of “(51) AC Inverse Time Overcurrent” and one is
“Manual_reset”, an input of the “Relay” that can be configured from the HIL
SCADA interface. The output of the “AND” block is “Resets-Relay” that is
dedicated to resetting the trip state of protective functional blocks.
– “Trip-Reset Logic/Control” (see Fig. 11.27). This block is dedicated to issuing
the trip signal to the HIL SCADA interface. The inputs of this block are “Trip”,
“Reset”, and “Min-Time”. The input “Trip” is used to receive the trip signal
from two protective functional blocks and is the output of “Trip Source Combi-
nation” the input “Reset” is used to receive the trip-reset signal and is the
308 L. N. H. Pham et al.
Table 11.5 Equations associated with US curves following the American standard IEEE C37.112–
1996 (IEEE Standard for Inverse-Time Characteristics Equations for Overcurrent Relays 2019)
Curve type Relay operating time Equations
( )
U1 (Moderately Inverse) t p = T D × 0.0226 + M0.0104
0.02 −1 (1)
( )
U2 (Inverse) t p = T D × 0.18 + M5.95
2 −1 (2)
( )
U3 (Very Inverse) t p = T D × 0.0963 + M3.88
2 −1 (3)
( )
U4 (Extremely Inverse) t p = T D × 0.0352 + M5.67
2 −1 (4)
( )
U5 (Short-Time Inverse) t p = T D × 0.0262 + M 0.00342
0.02 −1 (5)
310 L. N. H. Pham et al.
The algorithm includes two sections: (a) calculations of the protection relay’s
operating time and (b) maintaining the operating time of the protection relay.
In the first section of the algorithm, the inputs are the execution rate, the status
of the circuit breaker, state change of circuit breaker, state of fault, and encounter.
The discrete execution rate is set as default according to the sample time assigned
system components of 20 µs. This section includes three logical conditions with “If ”
statements. The first logical condition is the condition to enable the encounter when
there is a short-circuit fault, and the circuit breaker is still in the closed state. The
short-circuit fault is happening, and the circuit breaker needs to switch to the open
state; this is the second condition to identify the status of the circuit breaker. The
third condition is to count the timer of operating time when the counter is active and
the state of the circuit breaker is in an open state.
The second section of the algorithm includes one logical condition to stop the time
counter from maintaining the operating time of the protection relay. If the short-circuit
fault is cleared, the counter is deactivated, stopping the timer. The logical condition
is the product of counter time and previous time 1.0 s if greater than the product of
counter time (is forced to stop when the fault is cleared) and real-time, the counter
time or the operating time of protective relay is held that will be displayed in HIL
SCADA interface (Fig. 11.31).
11 Non-directional Overcurrent Protection Relay Testing … 313
The model of the Test System is built using the Typhoon HIL schematic, and then the
model is compiled to translate the computer model created in Schematic Editor into
a programming language code that can be used in the over elements of the VHIL
toolchain.
The users use two buttons in the toolbar to compile the model, “Compile
schematic” (Compile the current schematic model) and “Compile and load model in
HIL SCADA” (Compile the current schematic model and load it into HIL SCADA).
The alternative way is using the Schematic Editor menu “Model” and selecting the
option “Compile schematic” or “Compile and load model in HIL SCADA” as needed.
The HIL SCADA interface can be depicted in Fig. 11.32. The users need to select
the option “Load Model in the Virtual Device” to load created model in the schematic
to HIL SCADA. This option emulated the real HIL 40x/60 × device, but no external
I/O to real devices is possible. Then, the HIL SCADA editor is ready to use, and the
graphical environment is prepared to create a specific interface with the real-time
model. To create a new panel, the users need to press the “Create new Panel” at
the command toolbar. The blank panel appears and is ready for the users to place
available widgets from the library, as shown in Fig. 11.33.
An efficient monitoring dashboard requires users to customise the widget for the
panel depending on the arrangement and the quantities that users want to display and
control. The panel includes two main functions: result displaying and adjusting the
desired values.
Fig. 11.32 Loading the created schematic model into the virtual HIL device
11 Non-directional Overcurrent Protection Relay Testing … 315
Fig. 11.33 Working panel in HIL SCADA with available widgets library
In this chapter, the complete monitoring and controlling panel was created using
HIL SCADA, and its implementation is depicted in Fig. 11.34.
The widgets in the “Monitoring” and “Action” core of the widget library are
intended to create the monitoring and controlling panel. These widgets are adjusted
by performing a double-click on the widget to open the properties window. In the
window settings, the users can do navigation commands that require widgets to
Fig. 11.34 Complete monitoring and controlling panel created by HIL SCADA, for the visual
image, for capturing voltage and current waveforms, for inverse-time overcurrent curves visual
graph, for protection relay settings dashboard, for circuit breaker’s status monitoring, for
protective relay’s status monitoring, and for control dashboard
316 L. N. H. Pham et al.
perform requests of the users, including displaying desired values or signals for
monitoring functions or adjusting parameters.
The first element ( ) is used to visualise protective relay tests through images.
To create this element, the users need to select the “Image” widget in the “Visual”
of the HIL SCADA widget library; then, the users perform a right-click to define the
direct path of the desired image (see Fig. 11.35).
The visual image used in the panel is Test System based on Fig. 11.1. Additionally,
the authors used the image in Scalable Vector Graphics (SVG) format to reconstruct
the image under two cases, nominal operating and short-circuit fault cases. For the
nominal operating case, the circuit breaker (named BK in the image) is highlighted
in red colour, which indicates the closed state. For short-circuit fault cases, the circuit
breaker is in green colour, which shows the opened state, and the fault icon appears
at the end of the transmission line (Lines 1–2).
To perform the image format in the two aforementioned conditions, the authors
used the “Macro” widget in “Action” of the HIL SCADA widget library; then, the
users need to do a right-click to open the properties window and start to parse SVG
image as XML (Extensible Markup Language). The “Fault Signal” and “Status
Breaker” from the fourth element ( ) of “Soft Relay” (see Sect. 3.1.3) are the
input data to execute “BK” and fault icon via the “xml.etree.ElementTree” module
(‘xml.etree.ElementTree 2022) with associated commands (see Fig. 11.36).
Fig. 11.36 Define “Visual Image” in specific circumstances, normal operation, and fault cases
The sixth element ( ) (see Fig. 11.41) is “Relay status”, including “LED” and
“Digital Display” widgets. The “LED” widget is used to represent the trip signal
coming from which overcurrent functional blocks, “(50) Instantaneous Overcurrent”
or “(51) AC Inverse Time Overcurrent”. The “Digital Display” widget represents the
operating time of the protective relay. The users can use right-click on the widget
and select the desired signal.
The seventh element ( ) is the “Control” dashboard created to perform multiple
actions, “Fault selection”, “Apply Fault”, “Clear Fault”, and “Reset Relay” (see
Fig. 11.42.
For the “Fault selection”, the “Combo Box” widget in “Action” of the HIL SCADA
library is used to perform this action. The users can define the name of short-circuit
cases in “Available values” of widget properties, then, according to declared types of
fault in the Fault element of the test system (see Sect. 3.1.1). The nominal operating
case is named “NO FAULT ”. At the same time, short-circuit fault can be of different
types: three-phase, three-phase-to-ground, single-phase-to-ground, phase-to-phase,
11 Non-directional Overcurrent Protection Relay Testing … 319
The monitoring and controlling panels were created inside HIL SCADA that can be
used for non-directional overcurrent protective relay testing.
The users need to run the real-time simulation by pressing the “Start simulation”
button on the toolbar (after the HIL Schematic has been appropriately compiled).
Simulation using the VHIL will start, and time will be presented at the Control
bar.
The circuit breaker monitoring dashboard has two LED indicators displaying the
status of the circuit breaker; when the circuit breaker is closed, the LED named
“Close” is lit in red colour, as shown in Fig. 11.43.
To test the non-directional overcurrent functions, the protection relay settings
configuration, including CT ratio, ANSI 50/51 pickup current, time-dial, and inverse
operating time curves, can be predetermined at the “Relay setting” dashboard as
shown in Fig. 11.44.
The procedure of using created panel includes four steps shown in the “Control”
dashboard in Fig. 11.45 as follows:
322 L. N. H. Pham et al.
In STEP 1, there are many scenarios, including nominal operating cases and short-
circuit fault cases. The nominal operating case is named “NO FAULT ”. At the same
time, short-circuit fault cases can be defined by many types of short circuits: three-
phase, three-phase-to-ground, single-phase-to-ground, phase-to-phase, and two-
phase-to-ground, in each case, according to the A, B, and C phases and the grounded
neutral N as shown in Table 11.7. The users can select one of these scenarios to
conduct the appropriate test.
STEP 2 is to press the button “Apply fault”. The consequences in SCADA panel after
pressing can be shown in Fig. 11.46. The captured signal is automatically activated
(a)
(b)
Fig. 11.42 a “Control” dashboard; b “Fault selection” action; c “Apply Fault” action; d “Clear
Fault” action; e “Reset Relay” action
11 Non-directional Overcurrent Protection Relay Testing … 323
(c)
(d)
by the condition predefined in “Capture/Scope” (see Sect. 3.2). In the visual image,
the BK is lit in green colour, and the fault icon appears simultaneously. At the “BK
monitoring” dashboard, the LED expressing the open state of the circuit breaker is
turned on. At the “Relay Status” dashboard, the LED indicates which overcurrent
function is active, and the operating time of the protective relay is shown. The inverse-
time overcurrent curve is plotted through the XY-graph widget according to preset
values in the “Relay setting” dashboard, as shown in Fig. 11.47.
STEP 3 and STEP 4 are performed simultaneously for the purpose of returning the
protective relay to its initial state to conduct further tests. The users need to click
the button “Clear Fault” first and then tick the box “Manual Reset”. The clicking
of the button “Clear Fault” clears the fault in the test system. Ticking the “Manual
324 L. N. H. Pham et al.
(e)
Reset” box returns the test system to the initial state. All necessary calculations and
observations are computed and stored before running another test. The users need to
untick the “Manual Reset” box before implementing further tests.
11 Non-directional Overcurrent Protection Relay Testing … 325
Fig. 11.44 The red colour of the LED in “Close” indicates ready to perform tests
This section presents the results of simulating different short-circuit fault scenarios at
the end of the test model’s overhead distribution line (Lines 1–2). The main objective
of this section is to observe the behaviour of the overcurrent protection relay through
model-based toolchains of Typhoon HIL as the following assumptions:
326 L. N. H. Pham et al.
Fig. 11.46 The consequences in SCADA panel after pressing the button “Apply fault”
Fig. 11.47 Inverse-time overcurrent curve plotted after performing “Apply Fault”
11 Non-directional Overcurrent Protection Relay Testing … 327
• The overcurrent protection functions ANSI 50 and ANSI 51 are considered. Time-
dial, ANSI 50/51 pickup current, and curve characteristics are known as protection
relay settings. The operating time of the protection relay in two cases, instanta-
neous ANSI 50 and different inverse overcurrent time curves of ANSI 51, is
presented.
• The current waveforms under multiple short-circuit cases, three-phase, three-
phase-to-ground, single-phase-to-ground, phase-to-phase, and two-phase-to-
ground, are presented using Typhoon HIL.
For these objectives, the authors provided a proposed set of predetermined
settings for non-directional overcurrent functions for testing the operating time of
the protection relay.
The set of predetermined settings consists of CT ratio and values of pickup current
ANSI 50/51. This section illustrates the proposed methodology of predetermined
setting selection.
For CT ratio, the accurate CT ratio reflects secondary values of current through
the protection relay and directly influences protection relay’s operation whether to
send a trip signal or not. The methodology to select the CT ratio for the overcurrent
protection relay is based on the nominal primary operating current according to
Failed (2000). Therefore, to calculate the CT ratio, the total load current up to the
point of the protection relay should be considered. The total load current through
the protection relay is the sum of load B current which is given in Table 11.4 with a
value of 120A. The users can retrieve this value from the waveform of the nominal
operating current by selecting the “NO FAULT ” option in STEP 1 (see Sect. 11.4),
as shown in Fig. 11.48.
The authors used the CT ratio for protection relay due to the 125% nominal
operating current as an overload situation. As a consequence, the current transformer
CT ratio of 200 (the nearest value above the overload current) is selected and used
for all the simulation scenarios.
The pickup current is the operation condition of the overcurrent protective relay
upon the current through it exceeds that value. The selection of threshold values
depends on the specific system in the particular situations corresponding to the stated
objective of protection engineers. The value of pickup current (ANSI 50 and ANSI
51) proposed by the authors is twice the value of the nominal operating current
through the protection relay of 240 A on the primary side and 1.2 A on the secondary
side, according to the ratio of CT.
There are two specific testing cases with particular settings according to the main
purpose of this chapter is testing overcurrent functions, ANSI 50 and 51, as follows:
• Case I, Instantaneous: For testing the operating time of the instantaneous over-
current function (ANSI 50), the pickup current of the ANSI 50 function is
1.2A.
• Case II, Inverse Time: The pickup current settings in inverse-time overcurrent
testing (ANSI 51) is 1.2A and the time dial, TD, is 0.5.
The RMS values of short-circuit scenarios performed by using the VHIL Device in
the Test System are compared with the results from the DIgSILENT PowerFactory
modelling. DIgSILENT PowerFactory is the widespread and leading power system
analysis software, which covers the full range of functionality from standard features
to novel, sophisticated, and advanced applications (PowerFactory—DIgSILENT
2022) (Fig. 11.49).
The authors used SP2 DIgSILENT PowerFactory version 2022 to model
Test System and to perform the implementation of short-circuit calculation. The
“Complete” method in calculating short circuit is applied.
To compare the RMS short-circuit values obtained from VHIL and DIgSILENT
PowerFactory, a summary of RMS values of short-circuit current (Ik) for all scenarios
is presented in Table 11.8. The RMS value from DIgSILENT PowerFactory is
obtained by RMS simulation. The RMS value of short-circuit current from the VHIL
device is extracted from the waveform as shown in Fig. 11.50. The waveform in
Fig. 11.50 is obtained from the steady-state waveform of short-circuit current when
the settings in CASE II are applied to the protective relay.
The maximum relative error between RMS short-circuit current in all scenarios
is 1.65%. This indicates a significant similarity between the RMS values of the
short-circuit cases retrieved from the VHIL Device and DIgSILENT PowerFactory.
11 Non-directional Overcurrent Protection Relay Testing … 329
Fig. 11.51 Trip sequence and waveforms of three-phase current considering a three-phase short
circuit in instantaneous overcurrent testing. The short-circuit event starts at 0.1 s, and the trip
operates instantly at 0.1 s (from 0—inactive to 1—active)
Case II: Testing the operating time of the inverse-time overcurrent protective
relay
For the inverse time overcurrent relay, the operating time is changed according
to the case of short-circuiting and inverse-time overcurrent curves. For illustration
purposes, the waveforms of three-phase current and tripping sequences for multiple
short-circuit fault scenarios are presented using SCADA HIL in Fig. 11.52.
332 L. N. H. Pham et al.
The operating time of the protective relay in this section can be retrieved from
Eq. (1) to Eq. (5) based on the RMS values of short-circuit current derived from
DIgSILENT PowerFactory in Table 11.8. A summary of the protection relay’s
operating time of the entire simulation, considering several short-circuit cases, is
presented in Tables 11.10 and 11.11.
Considering the aforementioned fault scenarios, it is noticed from the results that
the short circuit is cleared after delay time depending on the type of short-circuit
cases and inverse-time overcurrent curve. As seen from the above results, there
is a significant similarity between the case study simulated in VHIL Device and
equation-based calculation.
Fig. 11.52 Trip sequences and waveforms of inverse time overcurrent testing using U1 curve for
short-circuit cases: a single-line-to-ground (A-N), b phase-to-phase (A-B), c two-phase-to-ground
(A-B-N), and d three-phase (A-B-C)
11 Non-directional Overcurrent Protection Relay Testing … 333
Table 11.10 The operating time of protection relay in milliseconds. (1) Equation-based calculation,
(2) VHIL Device simulation
Curve U1 U2 U3 U4 U5
Cases (1) (2) (1) (2) (1) (2) (1) (2) (1) (2)
A-N 125 121 124 119 70 67 49 50 48 49
B-N 125 121 124 119 70 67 49 50 48 49
C-N 125 121 124 119 70 67 49 50 48 49
A-B 122 124 121 123 68 69 47 49 47 50
A-C 122 124 121 123 68 69 47 49 47 50
B-C 122 124 121 123 68 69 47 49 47 50
A-B-N 119 118 115 116 64 65 42 43 46 48
A-C-N 119 118 115 116 64 65 42 43 46 48
B-C-N 119 118 115 116 64 65 42 43 46 48
A-B-C 116 117 114 115 63 64 40 41 46 47
A-B-C-N 116 117 114 115 63 64 40 41 46 47
Table 11.11 The operating time of protection relay in cycles. (1) Equation-based calculation, (2)
VHIL Device simulation
Curve U1 U2 U3 U4 U5
Cases (1) (2) (1) (2) (1) (2) (1) (2) (1) (2)
A-N 6.25 6.05 6.20 5.95 3.50 3.35 2.45 2.50 2.40 2.45
B-N 6.25 6.05 6.20 5.95 3.50 3.35 2.45 2.50 2.40 2.45
C-N 6.25 6.05 6.20 5.95 3.50 3.35 2.45 2.50 2.40 2.45
A-B 6.10 6.20 6.05 6.15 3.40 3.45 2.35 2.45 2.35 2.5
A-C 6.10 6.20 6.05 6.15 3.40 3.45 2.35 2.45 2.35 2.5
B-C 6.10 6.20 6.05 6.15 3.40 3.45 2.35 2.45 2.35 2.5
A-B-N 5.95 5.90 5.75 5.80 3.20 3.25 2.10 2.15 2.30 2.40
A-C-N 5.95 5.90 5.75 5.80 3.20 3.25 2.10 2.15 2.30 2.40
B-C-N 5.95 5.90 5.75 5.80 3.20 3.25 2.10 2.15 2.30 2.40
A-B-C 5.80 5.85 5.70 5.75 3.15 3.20 2.00 2.05 2.30 2.35
A-B-C-N 5.80 5.85 5.70 5.75 3.15 3.20 2.00 2.05 2.30 2.35
Fig. 11.53 Per cent error of operating time of protection relay when comparing values from VHIL
Device with Equation-based calculation in short-circuit cases
this chapter. The so-called “Soft Relay” can be used to test and validate protection
settings without the need to use real hardware or any other physical devices.
The test system was used to test the overcurrent protection functions of a protec-
tion relay. Instantaneous overcurrent and inverse-time overcurrent functionalities
of a non-directional protection relay were tested considering predetermined setting
configuration.
Presenting the methodology for creating and testing a model, including a protec-
tion relay to be used in real-time simulation, allows the scientific community to use
this chapter as a starting point for many other possible protection schemes.
References
Aman MM, Khan MQA, Qazi SA (2011) Digital directional and non-directional over current relays:
modelling and performance analysis. NED Univ J Res 8(2):70–85
‘ANSI protective functions’. https://www.typhoon-hil.com/documentation/typhoon-hil-software-
manual/References/ansi_protective_functions.html. Accessed 11 Jul 2022
Camarillo-Peñaranda JR, Aredes M, Ramos G (2020) Hardware-in-the-loop testing of virtual
distance protection relay. In: 2020 IEEE/IAS 56th industrial and commercial power systems
technical conference (I&CPS), Jun. 2020, pp 1–6, https://doi.org/10.1109/ICPS48389.2020.917
6775
Celeita D, Flores A, Ramos G, Pohl M (2018) Design of virtual distance protection for offline
transmission line relay testing. In: 2018 IEEE 38th central America and Panama convention
(CONCAPAN XXXVIII), Nov. 2018, pp 1–6, https://doi.org/10.1109/CONCAPAN.2018.859
6426
336 L. N. H. Pham et al.
C. T. F. C6. 04.02, Benchmark systems for network integration of renewable and distributed energy
resources. International council on large electric systems Paris, France
D’Arco S, Duong TD, Are Suul J (2020) ‘P-HiL evaluation of virtual inertia support to the nordic
power system by an HVDC terminal. In: 2020 IEEE PES innovative smart grid technologies
Europe (ISGT-Europe), pp 176–180.https://doi.org/10.1109/ISGT-Europe47291.2020.9248905
Edrington CS, Steurer M, Langston J, El-Mezyani T, Schoder K (2015) Role of power hardware
in the loop in modeling and simulation for experimentation in power and energy systems. Proc
IEEE 103(12):2401–2409, https://doi.org/10.1109/JPROC.2015.2460676
Fonti P (2000) Current transformers: how to specify them. Schneider Electr Cah Tech Merlin Gerin,
no. 194
Horowitz SH, Phadke AG (2014) Power system relaying. Wiley
HubschneiderS et al (2018) Requirements for power hardware-in-the-loop emulation of distribution
grid challenges. In: 2018 53rd international universities power engineering conference (UPEC),
Glasgow, Sep. 2018, pp 1–6. https://doi.org/10.1109/UPEC.2018.8541851
IEEE standard for inverse-time characteristics equations for overcurrent relays. IEEE Std C37112–
2018 Revis. IEEE Std C37112–1996, pp 1–25, https://doi.org/10.1109/IEEESTD.2019.8635630
IEEE standard electrical power system device function numbers, acronyms, and contact designa-
tions. IEEE Std C372–2008 Revis IEEE Std C372–1996, pp 1–48, https://doi.org/10.1109/IEE
ESTD.2008.4639522
KelmP et al (2022) Hardware-in-the-loop validation of an energy management system for LV
distribution networks with renewable energy sources. Energies 15(7):2561, https://doi.org/10.
3390/en15072561
Kezunovic M, Esmaeilian A, Manimaran G, Mehrizi-Sani A (2017) The use of system in the loop,
hardware in the loop, and co-modeling of cyber-physical systems in developing and evaluating
new smart grid solutions, https://doi.org/10.24251/HICSS.2017.385
Montaña DAM, Rodriguez DFC, Ivan Clavijo Rey D, Ramos G (2018) Hardware and software
integration as a realist SCADA environment to test protective relaying control. IEEE Trans Ind
Appl 54(2):1208–1217, https://doi.org/10.1109/TIA.2017.2780051
Makhzani AS, Zarghami M, Falahati B, Vaziri M (2017) Hardware-in-the-loop testing of protection
relays in distribution feeders with high penetration of DGs. In: 2017 North American power
symposium (NAPS), Sep. 2017, pp 1–6, https://doi.org/10.1109/NAPS.2017.8107191
Mehta VK, Mehta R (2005) Principles of power system: including generation, transmission, distri-
bution, switchgear and protection : for B.E/B.Tech., AMIE and Other Engineering Examinations.
S. Chand Publishing
Pazdcrin AV, Samovlenko VO, Tashchilin VA, Chusovitin PV, Dymshakov AV, Ivanov YV (2018)
Platform for testing Iec 61850 control systems using real-time simulator. In: 2018 international
youth scientific and technical conference relay protection and automation (RPA), Sep. 2018, pp
1–14. https://doi.org/10.1109/RPA.2018.8537188
‘PowerFactory—DIgSILENT’. https://www.digsilent.de/en/powerfactory.html. Accessed 6 Jun
2022
Rodriguez DFC, Osorio JDP, Ramos G (2018) Virtual relay design for feeder protection testing
with online simulation. IEEE Trans Ind Appl 54(1):143–149, https://doi.org/10.1109/TIA.2017.
2741918
Review of hardware-in-the-loop—a hundred years progress in the pseudo-real testing’, E+E Scien-
tific Journal, Aug. 09, 2019. https://epluse.ceec.bg/review-of-hardware-in-the-loop-a-hundred-
years-progress-in-the-pseudo-real-testing/. Accessed 7 Aug 2022
S. IEC, ‘Measuring relays and protection equipment-Part 151: Functional requirements of
over/under current protection’, IEC 60255–151 (2009)
Schossig T (2010) Testing in IEC 61850—advanced topics and extended possibilities, pp 61–61,
Jan. 2010, https://doi.org/10.1049/cp.2010.0233
‘SR Flip Flop’. https://www.typhoon-hil.com/documentation/typhoon-hil-software-manual/Refere
nces/sr_flip_flop.html. Accessed 29 Jul 2022
11 Non-directional Overcurrent Protection Relay Testing … 337
12.1 Introduction
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 339
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_12
340 J. D. H. Santafé et al.
followed by several authors, who developed different optimization models that allow
obtaining the relay pick-up current settings and time delay constants for minimum
overall operation time subject to selectivity and sensitivity constraints (Hussain et al.
2013; Birla et al. 2005; Raza et al. 2014; Singh and Panigrahi 2014; Noghabi et al.
2009; Amraee 2012; Mahari 2013; Albasri et al. 2015; Damchi et al. 2018).
Existing network representations used to get optimal coordination settings are
generally based on static positive-sequence models. For instance, the 8-bus trans-
mission system proposed by A. S. Braga and J. Tome Saravia in 1996 has been
widely used as a standard test case on DOCR to get optimal solutions (Braga and
Saraiva 1996). However, as this test system is structured as a positive sequence
network model, some important aspects such as the synchronous generator model,
transient and sub-transient fault currents per phase, dynamic topologies generated
by non-simultaneous actuation of a circuit breaker, current transformers saturation
and the effect of unbalanced loads (Urdaneta et al. 1995; Mahboubkhah et al. 2020;
Sorrentino and Rodríguez 2020) must be also considered to evaluate the quality of any
relay coordination solution in real-world conditions. For this reason, it is necessary to
implement existing test systems in real-time simulators considering detailed network
models whose time-variant currents affect the response of the DOCP system. Litera-
ture shows some contributions to this objective. In Martín (2016), Almas et al. (2012),
Hussin et al. (2016), detailed network models were developed in MATLAB/Simulink
to evaluate the response of directional overcurrent relays with ANSI (American
National Standards Institute) 67 function.
This chapter presents the implementation of the 8-bus Braga’s test system (Braga
and Saraiva 1996) under realistic conditions using the soft-real-time Typhoon HIL
platform (Typhoon-HIL 2020). The system comprises 2 generators, 2 power trans-
formers, 8 busbars and 7 transmission lines with 14 directional overcurrent relays with
ANSI 67 function. Three-phase fault current waveforms are determined per-phase at
all line ends considering the transient and sub-transient components, dynamic topolo-
gies generated by non-simultaneous actuation of circuit breakers, load currents and
current transformers saturation.
To properly evaluate the performance of the protection system for a given coor-
dination solution (time dials and pick-up currents settings), it is necessary to insert
faults at different locations of the line. As the set of faults is large in a system with
8 busbars and 7 transmission lines, modifying fault positions in the schematic editor
and observing the results in Typhoon SCADA HIL(Supervisory Control And Data
Acquisition) is cumbersome. The Typhoon HIL solvers have a rather limited memory,
mainly for those components that need signal processing for their operation. Even if
the different processing cores that Typhoon HIL devices have been used, the contac-
tors that can be used to perform faults at the same time are very few (Typhoon-HIL
2020).
To overcome these limitations, for each inserted fault, a methodology was devel-
oped in the Script editor of Typhoon HIL to calculate the relay operation times
12 Directional Overcurrent Relay Protection System … 341
In this section some theoretical definitions are presented, such as the overcurrent and
directional protection functions, as well as the definition of directional blocking.
Directionality of the power flow is measured from the phases of the voltages and
currents on the line. Table 12.1 shows the current and voltage pairs used for power
flow determination. There are several types of polarizations used both in theory and
in practice, but the most used is the phase-phase quadrature in which it is determined
whether the polarization of the flow is positive (“Forward”) or negative (“Backward”)
as will be seen below:
Thus, taking the voltage polarization angle as λ1 and current operation angle
as λ2 , and ψ = λ2 –λ2 , it is satisfied that the torque angle is proportional to T =
λ1 λ2 sin(ψ). This value will be positive if 0 < ψ < π and negative when π < ψ <
2π. Considering the above, the operation area can be created considering the Relay
“Backward” if:
Note: All relays used during this investigation have an RCA angle of 45°.
Tr 1
∫ dt = 1 (12.4)
0 T (G)
Where:
Table 12.2 shows the above parameters used for different standards.
12 Directional Overcurrent Relay Protection System … 343
Table 12.2 Constant values for ANSI/IEEE and IEC standards (IEEE Standard for Inverse-Time
Characteristics Equations for Overcurrent Relays 2019)
Curve description Standard αr 1 αr 2 L
Standard inverse IEC 0,14 0,02 0
Very inverse IEC 13,5 1 0
Extremely inverse IEC 80 2 0
Long time inverse UK 120 1 0
Rectifier UK 45,900 5,6 0
Moderately inverse IEEE 0,0515 0,02 0,114
Very inverse IEEE 19,61 2 0,491
Extremely inverse IEEE 28,2 2 0,1217
Inverse US 5,95 2 0,18
Short time inverse US 0,16,758 0,02 0,11,858
Figure 12.1 shows a three-node system with a fault at line “b”. As can be seen
there, the directions of the power flow when the externality occurs are shown in red.
From this image it is possible to see the pairs of primary relays (“3”, “4”) with their
respective backups (“1”, “6”), which will always have a positive polarization and
will operate in coordination given the input settings. However, the relays (“2”, “5”)
also see a high current that will surely be above the minimum pickup current required
to trip their associated breaker, but because they observe a polarity opposite to the
direction of the center of the line they protect, they will not be able to operate at any
time. This property increases the selectivity of a protection system, and it is essential
to take it into account when modeling directional overcurrent relays.
12.3 Methodology
This section will present the parameters of the system to be implemented and the
details of system implementation. It is necessary to clarify that due to the limited
contactor capacity that can be used in the software, it was not possible to implement
the fourteen existing relays in the system simultaneously. For this reason, 7 different
schematic files (.tse) with their respective HIL API files (.py) were created. In each
of these files the same system is presented, but with the fault located in each of the
different 7 lines and with their respective primary and backup relays. The project
files and a step-by-step video tutorial can be found in https://github.com/pmdeolive
iradejesus/DOCP-TyphoonHIL.git.
344 J. D. H. Santafé et al.
The case study used during the development of this chapter was obtained from
Braga and Saraiva (1996) and has electrical devices such as transformers, generators,
transmission lines and circuit breakers operated by directional overcurrent relays.
Figure 12.2 shows the topology of the 8-node system, followed by tables with the
parameters of each of the elements mentioned above (Tables 12.3, 12.4, 12.5 and
12.6).
There are several models of Typhoon HIL devices (402, 404, 602, 603 and 604),
each with distinct characteristics. For the present project Typhoon HIL 402 was used,
which has 4 cores, 16 analogy inputs/outputs, 32 digital inputs/outputs, an analogy
voltage range of ±10 V and a resolution of 16 bits. Moreover, the simulation step and
method must be chosen to define the accuracy of calculations and simulation time.
The candidate methods are “Exact”, “Trapezoidal”, “Euler” or “Bilinear”, Euler”
or “Bilinear”. On the other hand, the “Hardware configuration id” box is of signifi-
cant importance because it allows choosing the HIL 402’s own limit configurations,
such as the number of System Processing Cores (SPC), “Machine solvers”, signal
generators, contactors, and others.
12 Directional Overcurrent Relay Protection System … 345
Fig. 12.2 Case study, 8 nodes system (Braga and Saraiva 1996)
Table 12.3 8 nodes system, generator data (Braga and Saraiva 1996)
Node S [MVA] Vp [KV] x [%]
7–1 150 10 15
8–6 150 10 15
Table 12.4 8 nodes system, line data (Braga and Saraiva 1996)
Node Node R [Ω/km] X [Ω/km] Y [S/km] Length [km]
1 2 0,04 0,5 0 10
1 3 0,057 0,714 0 7
3 4 0,05 0,563 0 8
4 5 0,05 0,45 0 10
5 6 0,045 0,409 0 11
2 6 0,044 0,5 0 9
1 6 0,05 0,5 0 10
Table 12.5 8 nodes system, transformers data (Braga and Saraiva 1996)
Node S [MVA] Vp [KV] Vs [KV] x [%]
7–1 150 10 150 4
8–6 150 10 150 4
346 J. D. H. Santafé et al.
To understand the concept of SPC used in “Typhoon” it is essential to make use of the
following explanation: The processing of a system in Typhoon is divided as follows:
• Typhoon FPGA (Field Programmable Gate Arrays) solver: FPGA board with
multiple processing cores, optimized for time-domain electrical simulations.
• System CPU: Processing application, indirectly controlled by the user, which
serves as an assistance to the FPGA board.
• User CPU: Processing application, directly controlled by the user, which is used
to execute signal processing models.
The different processing levels listed above compose the architecture used by
Typhoon to process the electrical models created for subsequent real-time simulation.
Figure 12.3 shows the processing structure made by the FPGA where the different
cores generated in the system are processed. This means that it is the user who decides
how many cores should be used for processing in the system. However, this decision
is limited because the larger the modelled system is, the more cores are needed. In
Typhoon, the term SPC is used to refer to the cores and its use is essential if the
modelled system has many non-linear and time-varying elements such as:
• Signal generator: Blocks that generate different waveforms.
• LUT (Look-Up-table): Block used to simulate non-linear elements such as battery
or solar panels.
In general, SPCs are used because the use of non-linear elements increases the
size of the state matrices considerably and memory overflows are generated if the
correct division in SPCs of the circuit to be simulated is not made.
Considering the enormous number of ideal contactors that were foreseen to be
necessary for the implementation of the system and that every hardware configuration
id has the same ideal contactors per SPC, the id with the largest number of SPC
was chosen, i.e., 2, with 4 SPC. Besides, a balance between computation time and
accuracy of results was bearing in mind to determine the simulation step and method.
Table 12.7 shows the chosen configuration for hardware settings and circuit solver
settings for this project. The other settings were left as default.
This section will present the development of the directional function of the relays in
the schematic editor of the real-time simulation tool “Typhoon HIL” and the capture
of necessary signals for the overcurrent function. The overcurrent function will be
discussed in detail in Sect. 12.3.2.
Relay block implementation
This section will explain the internal creation of the relay block, i.e., it will show how
the directionality and overcurrent measurements are performed so that the device can
open a circuit breaker in case of fault conditions are met.
In Fig. 12.4, the internal topological layout of the relay is presented, where the
rate transition function, the directionality and overcurrent logic block (ANSI 67) and
trip output post-processing are located. These elements will be explained below:
• Rate transition
The first step is to sample the current and voltage data entering the protection device.
This is necessary since the real relays cannot take all the existing data and it is
348 J. D. H. Santafé et al.
Fig. 12.4 The relay’s internal topology has three zones: ANSI 67 Function, Transition Rate and
Output (Trip)
necessary to take samples every certain time of the input signal. Therefore, a block
called “Rate Transition” provided by Typhoon (Fig. 12.5) was used, which allows a
change in the time step during the simulation of the signals, which simulates a data
sampling at rates lower than those at which the system is working.
The system has a simulation time of 10e-6, and the relays have a simulation
time of 5e-4. The relay’s internal step time can be varied to smaller values from the
initialization window provided by the schematic editor, but it is necessary that its
value be a multiple of the system’s step time. It is for this reason that the value of
5e-4 was taken, to be able to take 32 samples/cycle = 5.208888e-4, which is used
by real relays.
• ANSI 67 block
This block is divided into six different data processing zones, which allows us to
determine directionality and overcurrent given the input voltage and current signal
data. Each of these is explained below:
• Basic data: In this area the data of voltages and phase currents entering the relay
are acquired (Fig. 12.6).
• RMS Values: In this area, RMS values of instantaneous currents are obtained
(Fig. 12.7).
• Phase measurement: In this area the angle values of input voltages and currents
are obtained. This is done by means of the phase difference of an ideal sin(wt)
12 Directional Overcurrent Relay Protection System … 349
sine signal with the input signal by means of a block inside the tool library called
“Phase Diff” (Fig. 12.8).
• HIL API inputs: In this area the values that can be configured during simulation
in the HIL API interface, or in SCADA HIL if that is necessary, are obtained, as
will be seen later (Fig. 12.9).
• Directionality function: In this area there is a block that internally allows
the development of code in C# language, with which the angle input data are
obtained, and the relay polarization is checked (Fig. 12.11). Figure 12.10 shows
the flowchart associated with the algorithm developed to find the polarity with
which the relay observes the power flow.
350 J. D. H. Santafé et al.
To model the 8-bus case study in Typhoon, elements provided by tool library and
the input parameters described in system parameters were used. The devices used
during the development of the case study were the following:
• Three-phase transformer with impedance parameters at rated power, frequency,
RMS line-to-neutral voltage, positive short-circuit sequence, Y-Y connection,
active losses and linear or non-linear core model (Fig. 12.13).
• An ideal three-phase source with nominal frequency, RMS line-to-neutral voltage
and phase input parameters. Series impedances are added to account transient fault
contribution (Fig. 12.14).
12 Directional Overcurrent Relay Protection System … 351
• Constant impedance load which, depending on its power factor, either in forward
or reverse, is made up of series or parallel resistance circuits with inductances and
capacitances respectively. Among its input parameters are the line-to-line voltage,
connection type, rated power, and power factor (Fig. 12.15).
• PI model transmission lines with input parameters that can be entered in three
ways, by means of geometry, sequence data, and coupled RL. These types of lines
are modelled as resistors in series with inductances and in parallel with capacitance
at the ends, which are fed by voltage sources controlled by the input parameters
entered. Transmission line geometry is assumed symmetrical (Fig. 12.16).
• Because of PI section lines were placed instead of RL (resistance-inductance) and
the circuit is too large, it was necessary to place simulation couplers, which are
needed by the software to divide the system into subsystems, allowing parallel
processing of the cores or SPCs that were discussed in the theoretical framework of
this document. These simulation couplings do not change in any way the properties
of the lines (mutual or self-impedances), they are called couplings because they
have two ideal voltage sources that help to perform the division discussed above.
The coupling used was a three-phase transmission line coupling, as can be seen
in Fig. 12.17.
352 J. D. H. Santafé et al.
Fig. 12.10 Flowchart directionality function Note Fig. 12.10 shows a logic switch at the output of
the function block, which enables or disables the directionality from the device mask
Fig. 12.11 Area: directionality function Note Fig. 12.11 shows a logic switch at the output of the
function block, which enables or disables the directionality from the device mask
12 Directional Overcurrent Relay Protection System … 353
1. The couplings enter inductances to the system, which must be considered at the
time of making the system.
2. Tune coupling parameters is not an easy challenge because off there is not an
exact rule to do this to have the system as close as possible to the original one. It
is necessary to choose correct inductance value, if it is necessary to get embedded
inductors or capacitors and choose the correct value of “Embedded ratio”, which
is configured to be calculated automatically. However, it can be set manually
and if this value is set incorrectly, it can cause erroneous data to be read into the
12 Directional Overcurrent Relay Protection System … 355
system. For example, it can cause one side of the coupling to read ten times less
current than the other side.
3. Due to the use of contactors in the system, a topological error arises when they
open, varying the magnitude and phase of the voltages in the system nodes.
This produces discrepancies when the relays act. The problem when opening a
contactor is that the line attached to it is with an “incorrect” voltage, since its
value should be zero. However, when the contactor is opened, the simulation
couplings cause a parasitic voltage in these lines that generate current changes
on the adjacent side of the coupling, causing the other nodes of the system to
change the voltages and therefore discrepancies are generated when the modelled
relays act.
With the aim of solve problem 2, it was necessary to read the Typhoon documen-
tation and perform various tests, where it was found that the most similar results
to those expected were obtained without embedded inductors or capacitors, which
means that it is not necessary to set the TLM (Transmission Line Model) radius
(Fig. 12.18).
On the other hand, the optimum inductance of the couplings is to select as coupling
inductance the value of the inductance of the nearby line.
Furthermore, the solution found to solve problem 3, was to make use of capaci-
tances on both sides of the couplings. These function as voltage dischargers when a
switch is open and maintain a constant voltage when they are closed, or the system
is reset. In this way, stray voltages, and their effects on the other nodes in the system
are avoided.
• Final measurements block, relay, and switch
Figure 12.19 shows how a relay block is implemented in the case study where it will
be seen that each relay has its respective switch and measurement block, in which
356 J. D. H. Santafé et al.
Fig. 12.18 Simulation coupling and its capacitances on both sides, to avoid stray voltages on the
line. stray voltages on the line
the instantaneous phase currents and voltages are measured and are sent to HIL API
by using the probes available in the simulation tool as shown in Fig. 12.20.
Using what was shown during this section, the complete circuit was assembled, and
the 7 different schematics were created for when the fault occurs in each of the 7
lines. Figures 12.21, 12.22, 12.23, 12.24, 12.25, 12.26 and 12.27 show the divisions
generated by the couplings for each of the modelled schematics and their respective
primary and backup relays. It is important to remember that the circuit is separated
into four different cores and that they allude to the maximum allowed by the HIL
402 device.
It is important to stress out that when dividing the circuit into cores, the “Ground”
points must be separated and because the circuit must have this same point in
common, they must be represented by “tags” joined in the same coupling. If the
above is not developed, topological problems will arise in the network that will not
allow to compile the system because it will not know which is the correct division
of the “SPC’s”.
Current transformer saturation was included in the model. The main requirement of
a current transformer is the ability to accurately reflect the waveform of the primary
current. However, the principle of a traditional electromagnetic transformer is real-
ized based on the core coupling between the primary and secondary windings. Due to
the hysteresis of the CT core and its nonlinear characteristics, the secondary current
during the fault may contain large harmonics and decaying DC components that can
12 Directional Overcurrent Relay Protection System … 357
Fig. 12.21 Case study implemented with fault on line 1 and its respective core splits and primary and backup relays
J. D. H. Santafé et al.
12 Directional Overcurrent Relay Protection System …
Fig. 12.22 Case study implemented with fault on line 2 and its respective core splits and primary and backup relays
359
360
Fig. 12.23 Case study implemented with fault on line 3 and its respective core splits and primary and backup relays
J. D. H. Santafé et al.
12 Directional Overcurrent Relay Protection System …
Fig. 12.24 Case study implemented with fault on line 4 and its respective core splits and primary and backup relays
361
362
Fig. 12.25 Case study implemented with fault on line 5 and its respective core splits and primary and backup relays
J. D. H. Santafé et al.
12 Directional Overcurrent Relay Protection System …
Fig. 12.26 Case study implemented with fault on line 6 and its respective core splits and primary and backup relays
363
364
Fig. 12.27 Case study implemented with fault on line 7 and its respective core splits and primary and backup relays
J. D. H. Santafé et al.
12 Directional Overcurrent Relay Protection System … 365
cause the CT to have severe saturation. Consequently, the distortion of the secondary
current may cause protection malfunction. For this reason, the current signal in the
secondary of the current transformer can experience severe distortion due to satu-
ration and affects the performance of the protection relay (Fernando and Quiñónez
2021).
We used the magnetization curves for different primary-secondary current trans-
former ratios included in Gers and Holmes (2004). These curves determine the
magnetization current and voltage, which, if noted, present some breakpoints that
cause the current not to increase significantly after these points. The ratio chosen in
this case is 200:5.
The implemented system considers the transient topologies of the system given at
the difference in the tripping time between the two primary relays as shown in this
section.
Power system model
A power system with a protection scheme based on directional overcurrent relays can
be described with 7 transmission lines (in this study they are presented as π model),
8 transmission nodes, 2 transformers, and 2 generation nodes. Each of the system’s
k lines is protected by two relays function 67 phases with their respective switch,
giving a total number of relays equal to twice the number of lines in the system.
The number of relays is 14. 20 is the number of relay pairs main backup. Each fault
position h in a faulted line is given per unit line from 5 to 95% (0.05 ≤ h ≤ 0.95).
Protection system model
In a power system with a protection scheme based on directional overcurrent relays
there are two types of relays: primary and backup. The primary relays are both
associated to the two circuit breakers at the ends of the faulted line. On the other
hand, backup relays are those linked to the breakers connected to the ends of the next
transmission lines and should operate in if the primary relays do not work properly.
In addition, it is generally considered that when there is a fault on a transmission
line, both primary relays trip simultaneously to clear the fault. However, this never
happens because the relay that senses a higher fault current, usually the one that is
closer to the fault, trip first. This results in a transient state of the system between
the operation time of the first primary relay to trip, which is called relay “q”, until
the final operation of the other primary relay, which is called relay “i”. Likewise,
backup relays of main relay “q” are called relays “p” and backup relays of relay “i”
are called relays “j”. This information can be seen more clearly in Fig. 12.28.
366 J. D. H. Santafé et al.
Operation times
Considering only IEC standardized curves and the power system model presented,
the operation time of a relay r given by a fault h on a line k (Tr kh ), can be recalculated
for relays q and p with any drawback as can be seen in Eqs. (12.5) and (12.6).
αr 1 Dr
T (G)r kh = G(t)r kh αr 2
(12.5)
Pr
− 1
Tr kh 1
∫ dt = 1 (12.6)
0 T (G)r kh
operation time or its backup relay j operation time in case i is blocked (T qkh ≤
t ≤ T ∗ ikh or Tqkh ≤ t ≤ T ∗ jkh ). For understanding the computation of the operation
times, it is necessary to imagine that a ground fault occurs in a location of the line,
at that time, relay q trip first.
( However,) while this is going on, relays i and j are
calculating operation times T(i− j )kh in the interval 0 ≤ t ≤ Tqkh . When ( relay )q
'
is operation, the current seen by i and j increases, so, operation times T(i− j )kh
(denoting
( transients
) with (‘)) are smaller. As a result, effective transient operation
∗
times T(i− j)kh lies between above-mentioned values. It can be seen graphically in
Fig. 12.30 and mathematically in Eqs. (12.7) and (12.8) as (Sorrentino 2020).
This section will describe the programming and implementation of overcurrent func-
tion of relays whose operation times are calculated considering transient period of
the fault currents following Eqs. (12.5) and (12.6).
Relays implementations were performed in the Typhoon HIL Script editor. This tool
provides full test-automation capabilities. It allows you to write, open, and execute
various automated testing scripts written in Python, using appropriate Typhoon API
libraries. In this case, three types of API libraries will be used, which are the HIL
API, schematic editor API and Typhoon Test.
HIL API are collection of functions that allow users to real-time control the HIL
simulation process from the Python scripts. Functions are divided into four groups:
Functions for controlling and initializing the simulation process (function for loading
model, starting/stopping simulation…) Functions for setting and changing the state
of the simulation (various set_ functions) Functions for getting information from the
simulation (get_ functions including Capture functionality) Various utility functions
(Typhoon-HIL 2020).
On the other hand, Schematic API provides a set of functions/methods to manipu-
late existing schematic models (tse files) and create new ones from scratch program-
matically. This is most used for creating scripts for testing and automating repetitive
tasks, but its use is not restricted for these use cases only (Typhoon-HIL 2020).
Finally, TyphoonTest is a testing framework that provides high-level functions
to test power electronics and power systems equipment. It also provides integration
with pytest and Allure framework and is so useful to automate tests. TyphoonTest
API is meant to be easier to use and abstract away from HIL-specific details, meaning
clearer tests that convey more effectively the intent and that could be used, in the
future, for other targets than HIL simulation. Traditional HIL API and TyphoonTest
API can be used together in the same test code without problems (Typhoon-HIL
2020).
As mentioned at the beginning of the system implementation section, a.py file
was created with a function for each of the lines, added to a main.py file from where
the inputs and outputs of each of these functions will be managed.
12 Directional Overcurrent Relay Protection System … 369
Input data are grouped in five blocks: (a) power system schematic (complete
power system implemented in Typhoon HIL schematic editor); (b) settings of relays
(relay curve types, pickup and time dial settings); (c) relay pairs data (vector of relay-
pairs associated to each transmission line; (d) simulation parameters (signal capture
time, sampling rate, fault time); (e) working directory path (it is necessary to upload
the recompiled model in each iteration). The algorithm has four loops to calculate
operation times and tripping angle. The first one assigns the faulted line k, therefore,
the schematic editor associated to k line. The second one assigns the counter f to
analyze n f fault locations h. These fault positions are calculated uniformly from the
number of faults “n f ” faults that the user wants to perform and obtain the operation
times of the primary and backup relays of each line. The third loop traverses the
relays vector to compute each operation time with relay q block, and four one does
the same but considering relay q operation. Results are reported in row 16.
It is important to highlight that to simulate the change of position of the faults,
what was done was to divide the transmission lines into two sections, having the fault
connected in the center of these, and to vary the distances of the sections of the line.
On the other hand, it is important to highlight that the calculation of the distances
of the lines is made equidistantly from 5% of the line to 95%. This is because if the
fault is closer to the nodes, the software presents numerical problems.
12.4 Results
This section presents the results of simulating different failures in different lines of
the base system. The goal is to observe the behavior of the tool when simulating a
large system and to do so according to the following assumptions:
1. Only the 67-phase function is considered. Relay time dial and pickup settings as
well as curve characteristics are known parameters.
2. Three-phase short-circuit current waveforms are determined using Typhoon HIL.
Short circuit current magnitude is considered variant over time considering the
loads.
3. Pre-fault conditions are considered.
4. Conventional current transformer saturation is considered.
5. Circuit breaker operation times are not included in the model.
6. Relay time operation considering transient network configurations is estimated
according to IEC (2009).
It is important to clarify that, since the implemented system has many nodes, the
computational cost increases and the tool is limited in developing the solution of
the differential equations in exact time or called Robust Real Time. Therefore, it is
necessary to increase the time between each step of solution of the equations and
generates a delay in the simulation time although there is a synchronization in the
step time, receiving the name of Soft Real Time.
12 Directional Overcurrent Relay Protection System … 371
A short circuit study was first performed to compare the steady-state fault currents
obtained with the simulated system and those found in Rajput and Pandya (2016).
These results allow verifying the veracity of the system simulated in the tool. It is
important to remember that, in Typhoon HIL, loads, pre-fault conditions and CT
saturation are considered and this impact the results.
The current magnitude results and the error results are presented with respect to
those of the literature in Table 12.8. In this table R1 refers to a primary relay and R2
to a backup relay.
As can be seen from the above results, the maximum relative error found is 5.5%.
This indicates a great similarity between the case study simulated in the Typhoon
tool and the results obtained in Rajput and Pandya (2016). This allows for comparing
the relay operation results with the theoretically expected ones since both models are
comparable.
Table 12.8 Fault currents obtained at Typhoon and relative errors of fault currents found at Typhoon
and in the literature (Rajput and Pandya 2016)
Line R1 R2 ETAP [24] Typhoon HIL Error
R1(kA) R2(kA) R1(A) R2(A) R1(%) R2(%)
6 1 6 2,7 2,7 2591,71 2589,86 4,01 4,08
1 2 1 5,38 0,81 5454,96 792,13 1,39 2,21
1 2 7 5,4 1,54 5454,96 1514,71 1,02 1,64
2 3 2 3,34 3,34 3440,05 3441,16 3,00 3,03
3 4 3 2,24 2,24 2290,03 2273,19 2,23 1,48
4 5 4 1,36 1,36 1307,89 1308,41 3,83 3,79
5 6 5 4,99 0,42 5036,77 402,12 0,94 4,26
5 6 14 4,99 1,54 5036,77 1477,27 0,94 4,07
7 7 5 4,26 0,42 4442,1 417,38 4,27 0,62
7 7 13 4,26 0,81 4442,1 816,69 4,27 0,83
6 8 7 4,99 1,54 5022,87 1470,12 0,66 4,54
6 8 9 4,99 0,42 5022,87 396,89 0,66 5,50
1 9 10 1,45 1,45 1431,93 1432,44 1,25 1,21
2 10 11 2,34 2,34 2321,49 2320,45 0,79 0,84
3 11 12 3,49 3,49 3599,3 3600,71 3,13 3,17
4 12 13 5,38 0,81 5471,23 795,39 1,70 1,80
4 12 14 5,38 1,54 5471,23 1533,59 1,70 0,42
5 13 8 2,5 2,5 2413,32 2411,56 3,47 3,54
7 14 1 4,26 0,81 4430,08 813,67 3,99 0,45
7 14 9 4,26 0,42 4430,08 419,32 3,99 0,16
372 J. D. H. Santafé et al.
Figures 12.31, 12.32, 12.33 and 12.34 show, for illustration purposes, the results
considering an inserted three-phase solid faults located at 95% with coordination
solution provided by Sorrentino (2020). Waveforms and tripping sequences are
presented using SCADA HIL. The aim of these results of instantaneous currents
and relay logic outputs is to appreciate the proper behavior of the relays involved
during the externality.
In Figs. 12.31 and 12.32, transients do not affect the operation of the relay. As
can be seen, the instant the fault is initiated a transient arises in relay “2” which is
cleared at approximately 1.1 [s], and due to the opening of its associated breaker the
impedance at the point of fault changes, generating a transient current seen by relay
“9” being cleared at 1.2 [s] from the start of the fault. As can be seen, the effect of
current variation is not only seen by the primary devices, but the backup devices are
also subject to these abrupt variations and at approximately 1.25 [s] relay “10” 39
operates. This really shows the good performance of the system implemented in the
tool, but on the other hand suggests a big challenge when placing the relay input
settings so that selectivity problems do not occur as seen with the backup relay in
this case, where it should not operate because the primaries did it first.
In Figs. 12.33 and 12.34, at the onset of the fault, relay “10” that is closest to
the fault will operate first and generate the transient currents seen in “3”. Unlike the
previous example, the selectivity in this example is optimal since the backup relays
did not trip due to the clearing done by their primary pairs.
This section presents the resulting DOCP operation times in the 8-bus test system
implemented in Typhoon considering one fault per line (located at 50% of line
374 J. D. H. Santafé et al.
length) for the coordination solution provided by the optimization method presented
in Sorrentino (2020).
Relay operation times for all primary and backup relays shown in Table 10 were
computed using the exact IEC formula (Eqs. 12.5 and 12.6) [IEC 60,255–151:2009,
19] accounting three-phase fault current waveforms at all line ends considering
stable and transient components, dynamic topologies generated by non-simultaneous
actuation of a circuit breakers, load currents and current transformers saturation.
Operation times associated with primary relays i and q and, backup relay p and j
(see Table 12.9) are written in cells shaded in red, green, yellow, and blue, respec-
tively. Each row of Table 10 corresponds to the tripping sequence for a three-phase
12 Directional Overcurrent Relay Protection System … 375
solid fault located at 50% of line length from line 1 to line 7 and each column
corresponds to a relay enumerated as shown in Fig. 12.2.
Consider a fault at 50% of the line 1, between relay 2 and 9. The faster primary
relay “q” is 9 with an operation time of 0.83 s (green color). The slowest primary
relay “i” is 2 with 1.31 s (red color). Backup relays “j” of “i” are 1 and 7 with
operation time of 1.76 s and 1.69 s (blue color), respectively. Backup relay “p” of
“q” is 10 with 1.38 s (yellow color).
In this case, when a fault is inserted in line 1, relays 1, 2, 7, 9, and 10 are sensitive
and the separation times in relay pairs 2–1, 2–7 and 9–10 are 0.45 s, 0.38 s and
0.55 s. The coordination solution provided by Sorrentino (2020) consider an allow-
able coordination interval of 0.3 s. In this case, when a fault is inserted in line 1,
relays pairs 2–1, 2–10 and 9–10 are selective.
376 J. D. H. Santafé et al.
Table 12.9 Operation times considering transients, saturation and loads in Typhoon (exact IEC
formula)
Fault Operation times with parameters obtained in [14] considering transients
50% R el a y
/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Line Times [s]
1 1,76 1,31 1,69 0,83 1,38
2 1,59 1,18 1,04 1,51
3 1,49 1,02 1,19 1,66
4 1,37 0,82 1,32 1,89 1,71
5 2,59 1,13 1,49 1,04 1,87
6 0,98 1,49 1,91 1,09 2,81
7 NT 2,98 1,22 NT 2,89 1,17
If we consider a fault in line 7 (last row of Table 12.9), we can observe that backup
relays 1 and 9 are not tripping (NT) since they are unable to detect the fault, and
therefore there are no selectivity in relay pairs 14–1 and 14–9.
The implementation in Typhoon is able to get operation times for several faults
located between 5 and 95% of each line.
In this chapter, an interconnected power system of eight nodes, seven 150 kV trans-
mission lines and 14 relays originally proposed by Braga and Saraiva in (1996) was
implemented under a real-time simulation platform (Typhoon HIL) for the verifica-
tion of the behavior of a protection system based on directional overcurrent relays
(DOCR).
The simulation was performed in soft real-time. This allows the platform to deter-
mine the sequence of operation, the fault current detection capability and the opera-
tion time of the directional overcurrent relays under solid three-phase to ground fault
conditions.
The developed methodology to obtain the operation times considering the transient
period of several fault currents in the Script Editor can be very useful for the protection
engineers since it would allow them to review the performance of a DOCP scheme
configuration considering as many faults as they consider necessary, making a more
accurate calculation of the operation times of the relays and get results automatically.
Protection engineers will benefit of the proposed implementation to evaluate the
quality of any directional overcurrent protection scheme, optimized or not, under
realistic conditions.
We recommend the use of the proposed implementation with the real relay in
Hardware in the loop simulation. Additional improvements can be included in the
12 Directional Overcurrent Relay Protection System … 377
Acknowledgements The authors are grateful to Professor Elmer Sorrentino for the valuable
comments and suggestions.
References
Albasri FA, Alroomi AR, Talaq JH (2015) Optimal coordination of directional overcurrent relays
using biogeography-based optimization algorithms. IEEE Trans Power Delivery 30(4):1810–
1820, https://doi.org/10.1109/TPWRD.2015.2406114
Almas MS, Leelaruji R, Vanfretti L (2012) Over-current relay model implementation for real time
simulation amp; Hardware-in-the-Loop (HIL). IECON 2012—38th annual conference on IEEE
industrial electronics society, pp 4789–4796, https://doi.org/10.1109/iecon.2012.6389585
Amraee T (2012) Coordination of directional overcurrent relays using seeker algorithm. IEEE Trans
Power Delivery 27(3):1415–1422, https://doi.org/10.1109/tpwrd.2012.2190107
Braga AS, Tome Saraiva J (1996) Coordination of overcurrent directional relays in meshed networks
using the Simplex method 3:1535–1538, https://doi.org/10.1109/MELCON.1996.551243
Birla D, Maheshwari RP, Gupta HO (2005) Time-overcurrent relay coordination: a review. Int J
Emerg Electr Power Syst 2(2)
Damchi Y, Dolatabadi M, Mashhadi HR, Sadeh J (2018) MILP approach for optimal coordina-
tion of directional overcurrent relays in interconnected power systems. Electric Power Syst Res
158:267–274, 0378–7796, https://doi.org/10.1016/j.epsr.2018.01.015. dirección: http://www.sci
encedirect.com/science/article/pii/S0378779618300233
Fernando B, Quiñónez C (2021) Estudio de saturación de transformadores de corriente : análisis
y simulación Current transformer saturation study : analysis and simulation. Brazilian Appl Sci
Rev, 1222–1243, https://doi.org/10.34115/basrv5n2-045
Gers JM, Holmes EJ (2004) Protection of electricity and distribution networks, ép. 47, second
edition. IET y Power energy
Hussain MH, Rahim SR, Musirin IJ (2013) Optimal overcurrent relay coordination: a review.
Procedia Eng 53:332–336, https://doi.org/10.1016/j.proeng.2013.02.043
Hussin NH, Idris MH, Amirruddin M, Ahmad MS, Ismail MA, Abdullah FS, Mukhta NM (2016)
Modeling and simulation of inverse time overcurrent relay using Matlab/Simulink. 2016 IEEE
international conference on automatic control and intelligent systems (I2CACIS), pp 40–44,
https://doi.org/10.1109/i2cacis.2016.7885286
IEC 60255–151:2009 Measuring relays and protection equipment—Part 151: Functional require-
ments for over/under current protection (2009)
IEEE Standard for Inverse-Time Characteristics Equations for Overcurrent Relays. IEEE Std
C37.112–2018 (Revision of IEEE Std C37.112–1996), pp 1–25. https://doi.org/10.1109/IEE
ESTD.2019.8635630
Martín SS, Fernández MB (2016) Model and performance simulation for overcurrent relay and
fault-circuit-breaker using Simulink. Int J Electr Eng Educ 43(1):80–91, https://doi.org/10.7227/
ijeee.43.1.8
Mahari A, Seyedi H (2013) An analytic approach for optimal coordination of overcurrent relays.
IET Gener Trans Distrib 7(7): 674–680, https://doi.org/10.1049/iet-gtd.2012.0721
378 J. D. H. Santafé et al.
13.1 Introduction
Modern protection relays are becoming more advanced, with the number of built-in
features and capabilities increasing. Most protection relays would not only have one
protective relaying function, but they would also have several. The protective relay
functions are highly dependent on the software/firmware of the protective relay and
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 379
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_13
380 L. N. H. Pham and F. Gonzalez-Longatt
only be limited by the number of inputs and outputs the physical protection relay
has.
At the same time, the protection relay testing methods and equipment are
becoming more powerful. The need for protection relay testing can be divided into
four categories:
• Type testing. It is an extensive process where the quality of a newly fabricated
relay or new software revision for a relay model is concerned.
• Acceptance testing. The protective relay is tested to prove that it is the correct
model and that all the features are working as they should. It consists of functional
tests of inputs, outputs, displays, communication, and in some cases, pre-defined
pickup and timing tests.
• Commissioning testing. It is a site-specific test to confirm all protective elements
and logic settings are correct for their intended uses.
• Maintenance testing. It is used to ensure that a protective relay continues to
operate as it should.
These types of testing protection relaying functions play a vital role in ensuring
protection systems’ secure and reliable operation. Many researchers have investigated
testing platforms for a variety of subsystems in the protection system; ranging from
SCADA systems (Montaña et al. 2018), communication platforms (Pazdcrin et al.
2018), non-directional overcurrent and directional overcurrent relays (Rodriguez
et al. 2018), and distance protection relays (Camarillo-Peñaranda et al. 2020).
However, as modern systems grow in complexity, particularly in software, these
critical tests of protection relay are easier said than done. Hardware-in-the-loop
(HIL) is the solution for solving the difficulties of testing complex systems by
creating a scalable test system ensuring comprehensive test coverage. A HIL distance
function testing platform for feeder protection was shown in Camarillo-Peñaranda
et al. (2020); it uses PSCAD software and the virtual relay function with a commer-
cially available microcontroller. The authors in Camarillo-Peñaranda et al. (2020)
emphasised the needed realistic and flexible platforms for testing protective relay
functions.
This chapter proposes a methodology for creating virtual HIL distance protection
relay based on Typhoon HIL (software for the testing real-time embedded system);
it allows protection engineers to access the protective relay’s performance without
related concerns to hardware or physical devices. An example of a distance protection
relay connecting two grids with fault injection from Distance protection relay with
false tripping prevention (2022) is performed. This chapter explains the distance
protection function testing platform for an illustrative test system using model-based
engineering toolchains of Typhoon HIL, Schematic Editor and HIL SCADA. The
methodology of creating and modelling distance protection relay, the logic of the
protection relay, and communication between two toolchains through multiple tests
is presented. Validation of the proposed approach in Typhoon HIL is conducted
considering two different approach methods: theory-based calculation and built-in
model DIgSILENT PowerFactory with real protective relay SEL-411L (Latif et al.
2020). Through this chapter, readers can grasp the concept of distance protection
13 Distance Protection Relay Testing Using Virtual … 381
In the design of reliable and secure transmission systems, the distance protec-
tion function is denoted in the USA as ANSI 21 according to the ANSI Standard
Device Number (ANSI/IEEE Standard C37.2) (IEEE Standard Electrical Power
System Device Function Numbers, Acronyms, and Contact Designations 2008) and
in Europe as PDIS according to The European IEC 61,850–2 (Dede et al. 2014).
Distance protection is a method of protecting transmission lines from faults in the
power system. It measures the impedance between the protective relay location and
the point where the short circuit is located and compares it with the pre-determined
value (Anderson 1999). If the measured impedance (|Z meas |) is less than a pre-defined
set value (|Z set |), the distance protective relay operates by sending a trip signal to
the circuit breaker to isolate the faulty section. Since the total transmission line
impedance (|Z line |) is directly proportional to line length, the impedance of fault
location, therefore, can be determined directly.
The distance protection function provides the protection for transmission lines
under multiple faults as follows: (i) Short-circuit faults, (ii) Failed broken conductor
and voltage transformer fuse, (iii) Dead line charging, and (iv) Power swing.
Distance protection schemes are commonly employed to provide primary or
main protection and backup protection for AC transmission and distribution lines
against three-phase, phase-to-phase, and phase-to-ground short circuits (Erezzaghi
and Crossley 2003).
In an overall scheme of distance protection, it is necessary to provide a number of
relays to obtain the required discrimination. Therefore, modern practice is to adopt
the method of protection applied in three zones.
A number of distance protection relays are used in association with timing relays
so that the power system is divided into a number of zones with varying tripping
times associated with each zone.
The first zone tripping, which is instantaneous, is normally set to 80% to 90%
of the protected section. Zone 2 protection with a time delay sufficient for circuit
breaker operating time and discriminating time margin covers the remaining 20%
portion of the protected section plus 25% to 40% of the next section. In the distance
382 L. N. H. Pham and F. Gonzalez-Longatt
protection relay scheme, zone 2 also provides backup protection for the protective
relay in the next section. Zone 3, with still more time delay, offers complete backup
protection for all faults at all locations (Horowitz and Phadke 2014) (Fig. 13.1).
The advantage of distance protection is that it does not require a communication
channel, making its application more inexpensive than more complex and sensible
protection schemes such as differential protection. Additionally, it can be applied to
a line with bidirectional power flows, so this protection scheme is more suitable for
transmission and some distribution networks.
It is worth mentioning that distance protection is more selective than non-
directional and directional overcurrent protections (Anderson 1999). However,
distance protection also has some drawbacks. For instance, it does not cover the
total length of the line, making it necessary to set various protection zones to protect
the entire line and guarantee proper coordination between lines.
Depending upon the distance protection characteristics, there are the following
types of distance protection relay:
• Reactance relay (X).
• Impedance relay (|Z|).
• Mho relay (|Y|).
The reactance (X) type protection relay is preferred for protecting short-line
sections as they are not affected by the arc resistance (Rf ), and more percentage
of the line can be protected at high speed. The impedance (|Z|) type protection relay
is suitable for phase fault protection for lines of moderate length. The arc affects the
impedance relay more than the reactance relay. Mho type (|Y|) protection relay is best
suited for long lines and particularly where a severe synchronising power surge may
occur. The mho protective relay is reliable because it combines both the directional
and distance measuring functions in one unit.
Distance protection plays a vital role in protecting the bulk power industry’s
transmission lines, especially in highly meshed systems. Due to this vital role, it is
crucial to appropriately conduct acceptance testing to guarantee the correct operation
13 Distance Protection Relay Testing Using Virtual … 383
of entire functional modules of the distance protection relay. Therefore, virtual real-
time simulation techniques are needed to conduct this type of distance protection
relay test.
An exciting term used in the protection environment is the word “seen”. The
impedance seen by a distance protection relay is calculated as the ratio between
the voltage and current measurements at the installation location. During a short
circuit fault, the impedance “seen”, or “measured” by the distance protection relay
is different from the normal condition; consequently, the distance relay operates in
response to changes in the ratio of measured current and voltage.
The distance protection relay measures the impedance at the secondary of the
measurement transformers, and the impedance measurement depends on the connec-
tion and the ratio of the voltage transformer (VT) and current transformers (CT).
According to Anderson (1999), the phases voltages and line currents measured
and injected into a distance protection relay are line-to-neutral bus voltages and line
currents obtained at the secondary side of the measurement’s transformer can be
expressed as follows:
V pb
V pr = (13.1)
Nvt
I pl
I pr = (13.2)
Nct
where V pr represents the voltage of the secondary side of the transformer; V pb is the
voltage of the primary side of the transformer; N vt is the ratio of VT; I pr represents
the current of the secondary side of the transformer; I pl is the current of the primary
side of the transformer; N ct is the ratio of VT.
Now, consider that the protective relay calculates the ratio of secondary voltage
and secondary line current applied to it. The ratio (measured impedance |Z meas |) is
given by the following equation:
V pr
|Z meas | = = N f · m · Zl (13.3)
I pr
where N f is the ratio of impedance “seen” by the protective relay; m is the distance
from the bus to the short-circuit location in km, Z l is the positive-sequence impedance
of the line in ohms/km.
384 L. N. H. Pham and F. Gonzalez-Longatt
m
1 2
CB CT Ipr
“F”
Vpr
A-N
PT
Zset
R Fault
Fig. 13.2 Single line diagram showing a single-line-to-ground short-circuit at phase A, point “F”
In this chapter, the authors decided to consider two types of short-circuit conditions
for the Test System. The short-circuits are used for testing purposes of the distance
protection relay; specifically, three-phase short-circuits and single-line-to-ground
short-circuits.
A three-phase short-circuit is a symmetrical fault that is not statistically the
most frequent short-circuit in the transmission system but is typically the most
severe. Since it is a symmetrical terminal condition and the system is assumed to
be balanced, as a consequence, the magnitude of the voltage in all phases is equal
(|V an | = |V bn | = |V cn |), and the same principle applies to currents (|I a | = |I b | = |I c |).
A single-line-to-ground short-circuit is an unsymmetrical fault and is statistically
the most common fault in the power grid. A single line diagram showing a single-
line-to-ground short-circuit can be shown in Fig. 13.2. Considering the theory of
symmetrical component, the equivalent sequence networks are connected in series
for this kind of short-circuit. The current only flows in the faulted phase and is
connected to the ground (|I a | = I f and |I b | = |I c |=0)., while the current in the other
two phases is zero.
According to Saadat (1999), the three-phase short-circuit current, and the single-
line-to-ground short-circuit current can be calculated by Eqs. (13.4) and (13.5),
respectively.
Vf
I3 f = (13.4)
Z f + Z s1
Vf
I1 f = (13.5)
Z f + 13 (Z s0 + Z s1 + Z s2 )
used. These factors depend on the type of distance protection relay from different
manufacturers with different formulas, compensation type names, and symbols. For
instance, some of the most used factors are symbolised as K N , K 0 , K E or K G, which
are also referred to as earth-return compensation factor, ground-return compensation
factor, and neutral impedance correction factor, respectively.
Taking the earth-return compensation factor K N (also known as residual compen-
sation factor) into a practical common practice in the protection engineering world.
In this case, the factor is used to modify the measured current, and the impedance
seen by the distance protection relay is expressed as:
V pl
Z r elay = (13.6)
I pl + K N In
Z1
Z0
−1
KN = (13.7)
3
where, Z relay is the fault impedance “seen” by the distance protection relay; V pr is
the protection relay voltage; I pr is the protection relay current; In is the residual
current; Z 0 is the zero-sequence of the transmission line; Z 1 is the positive sequence
of the transmission line.These compensation factors can be illustrated specifically in
Sorrentino (2014). However, these factors are not considered in this chapter.
Conventional formulas used in this chapter
The conversion between the real and imaginary parts of the complex number is used
in this chapter. Specifically, the fault impedance (Z relay ) “seen” by the protection
relay can be written as:
Z r elay = Z ∠θ ◦ = R + j X (13.8)
where, Z is the magnitude of the fault impedance, θ is the phase angle, R is the
resistance component, and X is the reactive component.
R and X can be calculated as follows:
R = Z cos θ (13.9)
X = Z sin θ (13.10)
For distance protection relay testing, the authors have decided to use a straightforward
Test System; it consists of a transmission system interconnecting two simplified power
386 L. N. H. Pham and F. Gonzalez-Longatt
Fig. 13.3 Test System. The single-line diagram of the 230 kV transmission system with the distance
protective relay (“R”) is located at the sending terminal (“s”)
This section presented the main aspects of the modelling and simulation of distance
protection relays using a digital real-time simulation framework via model-based
toolchains of Typhoon HIL (two critical modelling and simulation environments,
Schematic Editor and HIL SCADA).
As distance protection is well-known for being used in transmission systems, the
authors have decided to use a straightforward test system described in the previous
section. However, all the methods explained in this chapter can be extended to more
complicated topologies of distribution systems.
The actual implementation of the test system shown in Fig. 13.3 inside the Typhon
HIL environment has been slightly modified to consider the features required by the
real-time simulation.
The Test System consists of two external grids ( -left side and -right side)
connected to a single transmission line, but it has been divided into two sections
of transmission lines connected in series ( ) and a circuit breaker ( ) and two
customisable fault points ( ). This Test System is designed to emulate a transmission
system with multiple infeed.
The transmission system is assumed to be working at a single voltage of 230 kV,
50 Hz and the single line diagram is shown in Fig. 13.3, and the schematic imple-
mentation based on Typhoon HIL Schematic Editor is accordingly modelled and can
be depicted in Fig. 13.4.
For testing purposes of distance protection relay, two customisable faults are
located at the transmission line; for the sake of simplicity, short-circuit cases are in
the middle and at the end of the transmission line.
The Test System model consists of the following components: ( ) External grids,
( ) Transmission line, ( ) Fault, ( ) Circuit Breaker, ( ) Meter, ( ) Distance
protective relay. The components from ( ) to ( ) can be defined by available
Fig. 13.4 Test System: Complete model of 230 kV transmission line system from Schematic Editor
388 L. N. H. Pham and F. Gonzalez-Longatt
elements in the library of Schematic Editor that can be given in detail in Component
library (2022). However, distance protection relay ( ) is the complex combination
of multiple functional blocks in the library.
External grids ( ): these components can be defined by “Three-phase Voltage
Source” (“Source” library) connected with “Inductor” and “Resistor” (“Passive
Component” library) (Fig. 13.5).
Transmission line ( ): the transmission line (Line SR) is created by two components,
“Transmission line” (“PI Section” of the “Transmission Lines” library) in series. Each
component has the same zero sequence, positive sequence impedance according to
Table 13.1; however, the length of each component is half of the transmission line,
Line SR (Fig. 13.6).
Faults ( ): This component consists of a set of switches and a control block named
“Control State Machine”. The control state machine is used to define the type of
short-circuit to be simulated; the control system generates signals, and they are sent
to the four switches and, depending on the status of the switches (closed or open), a
specific type of short circuit can be modelled. The “Fault” component also includes
resistances in the configuration to replicate the condition of arc resistance for each
type of short circuit. The “fault” component allows modelling the following types
of short circuits: three-phase short-circuit, line-to-line short-circuit, single-line-to-
ground short-circuit, and two-phase-to-ground short-circuit. The type of fault can
be defined by coding the status of switches (“Single Pole Single Throw” component
from the library) (Fig. 13.7).
13 Distance Protection Relay Testing Using Virtual … 389
Circuit Breaker ( ): An ideal circuit breaker can be simulated with this component,
the name in Typhoon HIL schematic library is “Triple Pole Single Throw Contact”,
and it is created from the “Ideal Contactors” branch of the library (Fig. 13.8).
Meters ( ): This component is used to generate the system frequency based on
a single phase PLL from a voltage measurement. It can be created by “Single
phase PLL” from the “Signal Processing” branch; see the implementation details
in Fig. 13.9.
Distance protective relay ( ): The distance protective relay is modelled by
combining multiple available functional blocks. This component consists of three
inputs and four outputs. Three inputs (A+, B+, C+) and three outputs (A-, B-, C-)
are used to connect three phases A, B, and C, to other 3-phase elements. The output
named “switch signal” is intended to send the trip signal to the circuit breaker ( )
(Fig. 13.10).
Inside the distance protection relay, there are two main functional areas as shown
in Fig. 13.11: ( ) Measurements of line current (I a , I b and I c ) and line-to-neutral
voltage on the transmission line (V an , V bn and V cn ), and ( ) Logic of the distance
protection relay. These main functional areas can be illustrated as follows:
( ) Measurements of current and voltage on transmission line
This functional area consists of a “current measurement” block and a “voltage
measurement” block from the Schematic library as main elements. These blocks
are used to measure current and voltage on the transmission line. The testing model
does not have CT and VT. Therefore, to represent a CT and VT, a gain must be used
to transfer the primary quantities and obtain the secondary current and voltage. The
CT ratio and VT ratio are set according to Table 13.1. The measured current (with
the tagged name “IA”) and measured voltage (with the tagged name “VAn”) are the
inputs of blocks in ( ) logic of the distance protection relay.
390 L. N. H. Pham and F. Gonzalez-Longatt
This area consists of the connection of three main functional blocks. They are:
“Fault detection”, “Trip logic”, and “CODO” (closing-opening-difference-operator)
algorithm. These blocks are the combination of subsystems that can be illustrated as
follows:
• “Fault detection”
This block is dedicated to detecting the fault and determining the protection zone.
There are two protection zones, zone 1 and zone 2, set in this block with two
corresponding trip signal outputs (Fig. 13.12).
392 L. N. H. Pham and F. Gonzalez-Longatt
This block has three inputs, including “I”, “V ”, and “contactor”. The input “I”
and V ” is the measured current that is connected from the inputs “IA” and “VAn” from
the functional area, “Measurements of current and voltage on transmission line” (
). The input “contactor” is intended to define the state of the circuit breaker.
To detect the fault and determine which protection zone operates, there are
three main functional components connected inside the block “Fault Detector”,
including: “RX Calculation”, “Holding Inputs”, and “Zone Determination”.
These components can be illustrated as follows:
• “RX Calculation” (see Fig. 13.13). The instantaneous values of the measured
current (I) and voltage (V ) of line SR are the inputs to this block. These measure-
ments are transformed into RMS values by using “RMS” block from the “Signal
Processing” of the Schematic library. The magnitude of the impedance (Z) seen
by the distance protection relay can be calculated according to RMS values of
voltage (Vrms) and RMS values of current (Irms) by using Ohm’s laws (Z =
Vrms/Irms).
The phase angle difference (θ ) between voltage phase angle and current phase
angle is calculated and converted into electrical degrees unit by using the “Phase
Difference” block from “Signal Processing” of the Schematic library.
These values are used to calculate the two components of the impedance, real
component R (resistance) and imaginary component X (reactive) according to the
Eqs. (13.8) and (13.9).
• “Holding Input” (see Fig. 13.14). The holding input block is a function imple-
mented in the “C function” of the Schematic library. This function is designed to
keep the output values of the resistance (R) and reactance (X) in case the circuit
breaker is open due to a trip signal.
13 Distance Protection Relay Testing Using Virtual … 393
• “Zone Determination”. (see Fig. 13.15). R and X values from “RX Calculator”
are input to the zone determination, including zone 1 protection and zone 2 protec-
tion blocks. Other inputs of this block are the magnitude, angle and zone reach of
the protection relay from HIL SCADA interface.
Both zone protection (zone 1 and zone 2) blocks are created by the “C function”.
They contain a function with a simple if-statement that is coded in block properties.
If the calculated values are less than the setting, the function generates an output
signal called “fault” equal to 1; otherwise, it will send a signal 0 (normal or not fault
condition).
After determining which protection zones operate, the output of the operated
block is activated to send the trip signal. However, the time of sending this signal is
delayed, and this delay time is different according to which protection zone operates.
The delay time for zone 1 is 50 ms, while the delay time for zone 2 is 0.3 s. To gain
394 L. N. H. Pham and F. Gonzalez-Longatt
this delay time, the outputs of both protection zone blocks need to connect with
multiple functional blocks. This connection can be shown in Fig. 13.16.
The output from zone 1 goes to an integrator which multiplies the input value with
the execution rate at each simulation step. This value is input to a comparator which
compares the time-delay component with a value of 50 ms. Even if the protective
relay is set instantaneously, it is impossible to trip simultaneously when a fault is
selected. If the value from the integrator is greater than the time delay, the output
will be set at 1. If the value is less, the output is set at 0 and will not send a signal
13 Distance Protection Relay Testing Using Virtual … 397
Fig. 13.16 The output signal of zone protection blocks are delayed with the corresponding time to
the protection zone
of fault. The zone 2 protection block has the same approach as the zone 1 protection
block but has a different time-delay value of 0.3 s which is a typical time delay for
zone 2 protection. This time delay includes the operating time of zone 1 and a time
interval for giving time to zone 1 to clear the short circuit. For detecting a fault from
zone 2, there must be an output of 1 from the comparator and an inverted value to 1
from zone 1.
• CODO algorithm
The closing-opening-difference-operator) (CODO) algorithm‘ calculates the fault
filtering signal and transforms it into a non-linear signal by applying mathematic
operations, such as addition, subtraction, maximum and minimum (Distance protec-
tion relay with false tripping prevention 2022). The input of this block is the measured
current of the transmission line (tagged name “IA”) seen by the distance protection
relay. The output of this block is active through the signal “enabled CODO” from
the HIL SCADA interface and block “AND” as shown in Fig. 13.17.
398 L. N. H. Pham and F. Gonzalez-Longatt
The purpose of this function is to filter the false trip signal due to the power
swings event. The change in frequency will influence the impedance such that the
relay protection zones may detect it as a fault.
The output signal of CODO algorithm block is formed by using the Dilatation,
Erosion, Opening and Closing algorithm, as shown in Fig. 13.18.
Delaytion
1. Inputs:
a = 40 [constant]
x = RMS current of transmission line
m[0]=x
2. for (i = a-2) and (i > 0)do:
3. i = i-1;
4. m[i+1] = m[i];
6. for (i = 0) and (i <= a-1) do
7. i = i+1;
8. y[i]=m[i]+0.1;
9. n=y[0];
10. for (i = 0) and (i <= a-1) do
13 Distance Protection Relay Testing Using Virtual … 399
11. i = i+1;
12. if y[i]>n do [find the maximum of
13. n]
n=y[i]
14. Out:
f=n
Erosion
1. Inputs:
a = 40 [constant]
x = RMS current of transmission line
2. m[0]=x
3. for (i = a-2) and (i > 0) []
4. i = i-1;
5. m[i+1] = m[i];
6. for (i = 0) and (i <= a-1) []
7. i = i+1;
8. y[i]=m[i]-0.1;
9. n=y[0];
10. for (i = 0) and (i <= a-1) do
11. i = i+1;
12. if y[i]<n do [find the minimum of
13. n]
n=y[i]
14. Out:
g=n
Opening:
Out=f g
Closing:
Out=f g
The dilation algorithm and erosion algorithm use three loops. The first one assigns
the size of the matrix called “m” due to the pre-set constant number as 40. For
the dilation algorithm, the second loop is to increase the step size of 0.1 for the
measured RMS value of current, as opposed to the erosion algorithm. The third loop
in the dilation algorithm is used to figure out the maximum input values, and for the
erosion algorithm, this loop is dedicated to finding the minimum input values.
The dilation algorithm (usually represented by ⊕ ) is dedicated to the structure
of the measured current element for expanding the tolerances contained in the input
current according to the change of frequency. As opposed to the dilation algorithm,
the erosion algorithm (usually represented by ⊖ ) is used to erode away the tolerances
of the measured current caused by the change of frequency.
400 L. N. H. Pham and F. Gonzalez-Longatt
The opening and closing algorithms are the combinations of dilatation and erosion.
The opening algorithm is used to restore or recover the original measured current to
the maximum possible extent. The closing algorithm is used to smoother the contour
of the distorted current and fuse back the narrow breaks and long thin gulfs. Closing
is also used to get rid of the small holes of the obtained current.
• Trip logic
The “Trip logic” block is dedicated to determining the trip signal according to the
“Fault detection “, “CODO algorithm”. This block has three inputs, “fault zone 1”,
“fault zone 2”, and “CODO”. The inputs “fault zone 1” and “fault zone 2” are the
output signals of zone protection blocks in “Fault detection”. The input “CODO” is
the output signal from CODO algorithm that is used to ensure the protective relay
not trip when there is a false fault (see Fig. 19a).
Inside this block, there are two main blocks, “trip logic zone 1” and “trip logic
zone 2” (see Fig. 19b). These blocks are intended to send the trip signal or the reset
signal to the protective relay.
The output of the trip logic block is “trip zone 1” and “trip zone 2” from “trip logic
zone 1” and “trip logic zone 2”. These outputs are combined with the signal “enable”
from HIL SCADA to send the signal “trip” or “not trip” to the circuit breaker, as
shown in Fig. 13.20.
The HIL SCADA panel offers the essential user-interface elements (widgets) to
monitor and interact with the simulation at runtime, allowing the users to further
customise according to needs. In this section, the authors give the readers the method-
ology to create the controlling and monitoring panel using available HIL SCADA
library widgets to test the distance protection relay.
The controlling and monitoring panel as shown in Fig. 13.21 consists of 6 main
parts: ( ) One line diagram, ( ) Distance protection commands and measurements,
( ) Faults, ( ) Extras, ( ) Capture/Scope, ( ) Power Swing Control.
These main parts are created by using available widgets in the “Monitoring” and
“Action” core of HIL SCADA library. These widgets are adjusted by performing a
double-click to open the properties window. In the window settings, the users can do
navigation commands that require widgets to perform requests of the users. These
commands are structured in the Python programming language (What is Python
Executive Summary 2022).
The first element ( ) is used to display the state of model values; frequency in
the grid, contactor status, and also the presence and location of the transmission line
fault.
The frequency in the grid can be visualised by using the “Digital Display” widget
from “Monitoring” of the library. The users need to perform a double-click on the
13 Distance Protection Relay Testing Using Virtual … 401
widget and selects the desired signal to observe. In this widget, the frequency of two
meters, the element of the Test System model (see Sect. 13.3.1), is selected (see
Fig. 13.22).
The state of the model; contactor status, and location of the transmission line fault
can be visualised by using the visual image. To create this element, the users need to
select the “Image” widget in the “Visual” of the HIL SCADA widget library; then,
the users perform a right-click to define the direct path of the desired image (see
Fig. 13.23).
The visual image used in the HIL SCADA panel is in SVG (Scalable Vector
Graphics) format to reconstruct the image under two cases, nominal operating and
short-circuit fault. The illustrative detail of rebuilding this visual image can be
performed via the creation of the element of the panel.
Fig. 13.21 Controlling and monitoring panel for testing distance protection relay created by using
HIL SCADA
The “Enable/disable protective relay” action includes the “Tick box” widget and
“LED” widget. The “Tick box” widget is used to enable or disable the distance
protection relay by defining “Macro code” inside the widget. When the box is ticked,
the enable signal is sent to the distance protection relay in the Schematic Editor;
otherwise, the signal will not be sent, which means the distance protection relay is
in the disabled state. The “LED” widget is used to show this enable signal as “sent”
13 Distance Protection Relay Testing Using Virtual … 403
Fig. 13.22 Select the signal inside the “Digital Display” widget to observe the frequency of the
Test System
or “unsent”. It will be coloured in green if the enable signal is sent. The detail of the
implementation is shown in Fig. 13.25.
The “Observe the trip status” action is used to display the trip status of the distance
protection relay. By using “LED” widget, whether the trip signal comes from zone
1 protection or zone 2 protection, the “LED” will be highlighted in red colour (see
Fig. 13.26).
The “Reset protective relay” action is performed to reset the distance protective
relay when the protective relay is in a trip state. This action can be created by using
the “Button” widget. The reset trip signal is defined in the “Macro code” inside this
widget. When this button is clicked, the reset trip signal is sent to the “Trip logic”
functional block of the distance protective relay (see Sect. 13.3.1), and then the trip
signal is cleared (see Fig. 13.27).
404 L. N. H. Pham and F. Gonzalez-Longatt
Fig. 13.23 Select the direct path of the image inside the “Image” widget
The “Check the presence of fault” action can be created by using the “Digital
Display” widget. In “Macro code” inside this widget, the authors defined the visu-
alised text based on the trip signal coming from zone 1 protection and zone 2 protec-
tion. In case of no trip signal coming from these zones, the text ‘No fault” is visu-
alised; otherwise, it will indicate which protection zone is sending the trip signal (see
Fig. 13.28).
The “Change the values of zone reaches” action includes two “Slider macro”
widgets to pre-determine the reach zone values of two protection zones. These are
the inputs named “reach” of two functional protection blocks, “zone 1 protection” and
“zone 2 protection” of “Zone Determination” (see Sect. 13.3.1). The implementation
is shown in Fig. 13.29.
The “Track the change in impedance” action can be performed using the “XY
graph” widget to visualise the diagram zoomed graph with zones, transmission line
and observed fault impedance. The users need to select the resistance (R) and reaction
(X) signals for the X-axis and Y-axis of the graph. Additionally, the zones, transmis-
sion line and observed fault impedance are defined in the “Advance setting” section
inside the widget. The detailed implementation is shown in Fig. 13.30.
13 Distance Protection Relay Testing Using Virtual … 405
The third element ( ) “Fault” (see Fig. 13.31) is indicated to allow the users to
choose which types of faults users want to inject; short-circuit cases in the middle
of the transmission line or at the end of the transmission line, or both short-circuit
cases simultaneously.
Several actions can be performed in this element named “Fault 1”, “Fault 2”,
“Apply action”, and “Select action”.
“Fault 1” represents the short-circuit cases in the middle of the transmission line,
and “Fault 2” represents the short-circuit cases at the end of the transmission line.
“Fault 1” and “Fault 2'' is the “Fault” element in Test System” (see Sect. 13.3.1).
They are created by using the “Tick box” widget; then, the commands to define them
can be performed in “Macro code” inside the widget. If the box is ticked, the fault
element is activated. The implementation can be shown in Fig. 13.32.
For the “Apply Fault”, the users select the “Macro” widget in “Action” of
HIL SCADA library. This button is used to define the sample rate and time
interval for captured signal in “Capture/Scope”. The users should right-click the
“Capture/Scope”, then select “Copy Widget ID” and use this ID number for “Macro
widget settings” of the “Apply Fault” button. Additionally, the types and starting
times of short-circuit cases can be defined in these widgets via Python scripts. For
the convenience of observing short-circuit events, the authors selected the starting
time of the short-circuit at 0.1 s.
406 L. N. H. Pham and F. Gonzalez-Longatt
For the “Fault selection”, the “Combo Box” widget in “Action” of the HIL SCADA
library is used to perform this action (see Fig. 13.33). The users can define the
name of short-circuit cases in the “Available values” of the widget properties, then,
according to declared types of faults in the Fault element of the test system (see
Sect. 13.3.1). The nominal operating case is named “NO FAULT ”. At the same time,
short-circuit fault cases consist of many types of short-circuit faults (three-phase,
three-phase-to-ground, single-phase-to-ground, phase-to-phase, and two-phase-to-
ground) are explicitly named in each case according to the A, B, C phases and the
grounded neutral N as shown in Table 13.3. Users must select one of these scenarios
to conduct the appropriate tests.
The fourth element ( ) contains two “Macro” widgets for grid initialisation and
for handling online diagram image.
For “Grid initialisation”, the values of the external grid element (see Sect. 13.3.1)
are set at the “Macro” code inside the widget (see Fig. 13.34).
For “Image handling”, the users need to use a right-click to open the prop-
erties window and start to parse SVG images as XML (the Extensible Markup
Language). The “contactor”, “Fault 1”, and “Fault 2” are the input data to execute
the change in distance protection relay and fault icon in the visual image. The
“xml.etree.ElementTree” module (xml.etree.ElementTree 2022) with associated
commands are used in this section. The implementation can be shown in Fig. 13.35.
13 Distance Protection Relay Testing Using Virtual … 407
The “Sweep type” action is created by using the “Combo box” widget. There
are two selections in this widget that are low frequency and high frequency (see
Fig. 13.37).
The “Sweep duration” defines the duration time of power swing events using the
“Combo box” widget. This widget has five selections according to five time periods,
2 s, 4 s, 6 s, 8 s and 10 s (see Fig. 13.38).
The “Start frequency sweep” action is created by using the “Button” widget. Two
selections from “Sweep type”, low frequency and high frequency, are defined inside
13 Distance Protection Relay Testing Using Virtual … 409
this button. The low frequency is set as 55 Hz, while the high frequency is set as
65 Hz. The sine waveform from two sources is executed with the new frequency in
the period of time selection in “Sweep duration” (see Fig. 13.39).
The “Enable CODO” action is created to send the enable CODO signal to the
CODO algorithm by using the “Tick box” widget from the HIL SCADA library.
13 Distance Protection Relay Testing Using Virtual … 411
When the box is ticked, the CODO algorithm is enabled; otherwise, it is disabled
(see Fig. 13.40).
412 L. N. H. Pham and F. Gonzalez-Longatt
The 230 kV transmission model with distance protection relay is built-in DIgSILENT
PowerFactory to validate the results for the distance protection testing from Typhoon
HIL. The distance protective relay used in this section is SEL-411L, a protective
relay product of “Scheweitzer Engineering Laboratories” (SEL-411L 2022). The
distance protection relay model of SEL- 411L is available in the library in DIgSI-
LENT PowerFactory and makes it possible to implement distance protection testing
(Fig. 13.41).
The system information implemented can be shown in Tables 13.4 and 13.5.
The SEL-411L relay model in the PowerFactory consists of protection functions
including: differential, overcurrent, voltage, frequency control, distance and out-of-
step. However, for the primary purpose of this chapter, distance protection is focused
and another function is set out of service.
The settings for the protection relay model SEL-411L in PowerFactory for
distance protection can be shown in Table 13.6.
414 L. N. H. Pham and F. Gonzalez-Longatt
There are both phase distance elements (Z1P and Z2P) and ground distance
elements (Z1MG and Z2MG). Phase distance elements protect phase-to-phase,
phase-to-ground, and 3-phase faults, while ground distance elements are respon-
sible for faults involving the ground. These elements have the same settings for zone
1 (Z1P = Z1MG) and zone 2 (Z2P = Z2MG) since they have equal requirements
for the zone reaches.
This section shows the results of two testing cases: Testing zone 1 with a three-phase
fault on the transmission line and Testing zone 2 with single-phase-to-ground on the
transmission line.
For two cases, the authors used three different approach methods, theory-based
calculations, Typhoon HIL simulation and DIgSILENT PowerFactory. To get easier
in comparison of three methods, the same settings of the distance protection zone of
the relay is used.
13 Distance Protection Relay Testing Using Virtual … 415
Zone 1 is the first protection zone of the protective relay and is the first o trip
with no intentional time delay if a fault is detected in this zone. This zone is set
at 80% of the transmission line length. Zone 2 must cover the total length of the
transmission line and in addition, gives backup protection to t the adjacent line. The
reach for zone 2 is set to 120%. The impedance values of the two protection zone
416 L. N. H. Pham and F. Gonzalez-Longatt
Fig. 13.41 Single line diagram of 230 kV transmission model with distance protection relay on
the beginning of transmission line modelled in DIgSILENT PowerFactory
Table 13.4 AC voltage sources parameters for the 230 kV transmission model in PowerFactory
Parameter Value Unit
Rated system voltage 230 kV
Positive and negative sequence of sending side impedance 2.645 + j0.1847 Ω
Positive and negative sequence of receiving side impedance 10.68 + j0.3233 Ω
Table 13.5 Transmission line parameter for the 230 kV transmission model in PowerFactory
Parameter Value Unit
Length of transmission line 100 km
System frequency 50 Hz
Positive and negative sequence of line impedance per km 0.20631 + j0.74769 Ω/km
Zero sequence of line impedance per km 0.5157 + j1.91319 Ω/km
13 Distance Protection Relay Testing Using Virtual … 417
Fig. 13.42 Positive sequence line impedance in distance protective relay settings
13.6 Results
This section shows the fault impedance results based on three different methods in
two testing cases; a three-phase short-circuit at the middle of the transmission line and
a single-line-to-ground short-circuit at the end of the transmission line, according
to the pre-determined reach zone 1 and zone 2. The results based on calculation
correspond to Eqs. (13.1)–(13.5), while Typhoon HIL simulation and PowerFactory
can measure the fault impedance results.
Table 13.9 shows the comparison between calculation and measured fault
impedance.
For Typhoon HIL Simulation and DIgSILENT PowerFactory, an R-X diagram
with line impedance characteristics can be shown for users to get a visual
understanding of the testing.
13 Distance Protection Relay Testing Using Virtual … 419
Fig. 13.43 Positive sequence line impedance with zone 1 and zone 2 reach represented in R-X
diagram
Fig. 13.44 R-X diagram with line impedance characteristics; reach zone 1 and zone 2 protection
in PowerFactory
Table 13.9 Comparison between calculated and measured fault impedance in Typhoon HIL
simulation and DIgSILENT PowerFactory
Three-phase short-circuit Single-line-to-ground
short-circuit (phase A)
Theory-based calculation 10.4∠69.046 ◦ 30.620∠74.741 ◦
Measured fault impedance in 12.32∠78.106 ◦ 34.98∠72.43 ◦
Typhoon HIL simulation
Measured fault impedance in 10.969∠64.74 ◦ 32.58∠71.27 ◦
DIgSILENT PowerFactory
Fig. 13.45 Testing zone 1 protection with three-phase short-circuit in the middle of transmission
line in Typhoon HIL
case, is in zone 1 protection of the protective relay, similar to the R-X diagram from
DIgSILENT PowerFactory.
For a single-line-to-ground short-circuit at the end of the transmission line case,
fault impedance, in this case, is higher than the pre-set zone 1 and zone 2 protection
impedance. In this case, the fault is out of the protection zone of the distance protective
relay; therefore, there is no operating trip signal. From the R-X diagram retrieved
from Typhoon HIL simulation and DIgSILENT PowerFactory, the fault impedance,
in this case, is out of zone 2 protection.
The measured fault impedances from DIgSILENT PowerFactory are a little higher
than results retrieved from Typhoon HIL simulation, but the same results with fault
detection in zone 1 with a three-phase short-circuit in the middle on the transmission
line and failure in zone 2 protection of not detecting a single-line-to-ground short-
circuit at the end of the transmission line.
422 L. N. H. Pham and F. Gonzalez-Longatt
Fig. 13.46 Testing zone 2 protection with single-line-to-ground short-circuit at the end of the
transmission line in Typhoon HIL
13.7 Conclusions
This chapter presented the proposed methodology for testing the distance protec-
tion relay using model-based engineering toolchains of Typhoon HIL. The virtual
HIL simulation showed similar fault impedance of two other methods, theory-based
calculation and DIgSILENT PowerFactory, in two short-circuit cases, three-phase
short-circuits and single-line-to-ground short-circuits. However, this approach allows
users to access the testing performance of a physical HIL device with all restrictions of
the real-time environment. In the future, the virtual protection relay can be developed
to conduct protection function testing in more complex power systems.
13 Distance Protection Relay Testing Using Virtual … 423
Fig. 13.47 Testing zone 1 protection with three-phase short-circuit in the middle of transmission
line in DIgSILENT PowerFactory
Fig. 13.48 Testing zone 2 protection with single-line-to-ground short-circuit at the end of
transmission line in DIgSILENT PowerFactory
424 L. N. H. Pham and F. Gonzalez-Longatt
References
Anderson PM (1999) Power system protection. New York: McGraw-Hill : IEEE Press
Camarillo-Peñaranda JR, Aredes M, Ramos G (2020) Hardware-in-the-loop testing of virtual
distance protection relay. In: 2020 IEEE/IAS 56th industrial and commercial power systems
technical conference (I&CPS), Jun. 2020, pp 1–6. https://doi.org/10.1109/ICPS48389.2020.917
6775
Component library. https://www.typhoon-hil.com/documentation/typhoon-hil-software-manual/
topics/component_library.html. Accessed 12 Jul 2022
Distance protection relay with false tripping prevention. https://www.typhoon-hil.com/documenta
tion/typhoon-hil-application-notes/References/distance_protection_relay.html#concept_dpr__
figure_01. Accessed 18 Jul 2022
Dede A, Della Giustina D, Franzoni F, Pegoiani A (2014) IEC 61850-based logic selectivity scheme
for the MV distribution network. In: 2014 IEEE international workshop on applied measurements
for power systems proceedings (AMPS), pp 1–5
Erezzaghi ME, Crossley PA (2003) The effect of high resistance faults on a distance relay. In: 2003
IEEE power engineering society general meeting (IEEE Cat. No.03CH37491), Jul. 2003, vol 4,
pp 2128–2133, https://doi.org/10.1109/PES.2003.1270943
Horowitz SH, Phadke AG (2014) Power system relaying. Wiley
IEEE Standard Electrical Power System Device Function Numbers, Acronyms, and Contact Desig-
nations. IEEE Std C372–2008 Revis. IEEE Std C372–1996, pp 1–48, Oct. 2008, https://doi.org/
10.1109/IEEESTD.2008.4639522
Latif U, Moldesæther R, Dhakal P (2020) Development a cyber-physical testbed for relay-in-the-loo.
University of South-Eastern Norway
Montaña DAM, Rodriguez DFC, Ivan Clavijo Rey D, Ramos G (2018) Hardware and software
integration as a realist SCADA environment to test protective relaying control. IEEE Trans Ind
Appl 54(2):1208–1217, https://doi.org/10.1109/TIA.2017.2780051
Pazdcrin AV, Samovlenko VO, Tashchilin VA, Chusovitin PV, Dymshakov AV, Ivanov YV (2018)
Platform for testing Iec 61850 control systems using real-time simulator. In: 2018 international
youth scientific and technical conference relay protection and automation (RPA), Sep. 2018, pp
1–14, https://doi.org/10.1109/RPA.2018.8537188
Rodriguez DFC, Osorio JDP, Ramos G (2018) Virtual relay design for feeder protection testing
with online simulation. IEEE Trans Ind Appl 54(1):143–149, https://doi.org/10.1109/TIA.2017.
2741918
Saadat H (1999) Power system analysis. United States of America
SEL-411L advanced line differential protection, automation, and control system. selinc.com. https://
selinc.com/products/411L/. Accessed 21 Jul 2022
Sorrentino E (2014) Comparison of five methods of compensation for the ground distance function
and assessment of their effect on the resistive reach in quadrilateral characteristics. Int J Electr
Power Energy Syst 61:440–445
What is Python? Executive Summary. Python.org. https://www.python.org/doc/essays/blurb/.
Accessed 16 Jan 2022
xml.etree.ElementTree—The ElementTree XML API—Python 3.10.5 documentation. https://docs.
python.org/3/library/xml.etree.elementtree.html. Accessed 30 Jul 2022
Chapter 14
Cyber-Physical Co-simulation
Framework Between Typhon HIL
and OpenDSS for Real-Time
Applications
Abstract Cyber infrastructures have been extensively used for power system moni-
toring, control, and operation because of the development of new information and
communications technology (ICT) in power systems. Deployment of cyber-physical
co-simulation in the case of a realistic distribution network is still a big challenge.
Hence, to solve the problem of modelling complex distribution networks, a cyber-
physical co-simulation framework is proposed in this chapter. The proposed frame-
work consists of a cybernetic layer, a physical layer, and a co-simulation framework
between OpenDSS and Typhoon HIL. The cyber layer consists of software and
tools to model the distribution system and communicate with the physical layer. The
physical layer is the Typhoon HIL real-time simulator consisting of virtual or real
controllable devices. A realistic framework to execute the real-time simulation using
the Typhoon HIL SCADA system and Python-based co-simulation is created in this
chapter. The real-time simulation demonstrates the proposed framework’s effective-
ness in observing the distribution network’s voltage profile due to real-time variation
in reactive power from the PV.
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023 425
S. M. Tripathi and F. M. Gonzalez-Longatt (eds.), Real-Time Simulation and
Hardware-in-the-Loop Testing Using Typhoon HIL, Transactions on Computer
Systems and Networks, https://doi.org/10.1007/978-981-99-0224-8_14
426 R. Wagle et al.
14.1 Introduction
Fig. 14.1 Framework for cyber-physical co-simulation framework using OpenDSS and the
Typhoon HIL real-time modelling and simulation framework
428 R. Wagle et al.
the typhoon HIL schematic editor and the typhoon HIL SCADA to exchange infor-
mation between the Typhoon HIL real-time simulator and the Typhoon HIL SCADA.
In the schematic editor, a subsystem is created to get the information from SCADA
and to send the information to Typhoon HIL. The number of subsystems depends
on the number of devices to be controlled from the SCADA terminal. The Typhoon
HIL schematic editor has abundant libraries to create an interface dependent on
the requirement. In the third task, a Python program must be created to initialise,
execute the overall process, get the information from the real-time simulator, and
send the signal to the real-time simulator. In this chapter, the considered distributed
network is a European medium voltage network created by CIGRE Task Force C6.04
presented in the report “Benchmark Systems for Network Integration of Renewable
and Distributed Energy Resources” (Cigre 2014). Therefore, in this chapter, only
PVs are considered as distributed resources.
The first step in creating a model in OpenDSS is defining a new circuit. When a
new circuit is created, it is installed as a three-phase voltage source named “Source”
connected to a bus named “SourceBus” with a reasonable short circuit strength. The
new circuit has many parameters that users can define or set to default values. To
create the European MV CIGRE network (Krechel et al. 2019), the default values
are replaced by the ones provided in CIGRE. Then, in the script of OpenDSS, the
new circuit is defined, as shown in the code below.
In this model, there are two distribution transformers connected to the grid. It
is considered that each transformer has ±10% load changing taps, with each tap
change corresponding to ±0.625%. However, in the transformer used here, the taps
are fixed.
The lines of the network are created as an object that connects two buses in the
network. The line parameters are represented by the line codes, which can be defined
separately in the script of OpenDSS. The code for creating line codes and lines in
OpenDSS is given below. The data are modified as per our requirements.
Loads can be defined by a specific piece of script in OpenDSS. The loads can be
modelled as static loads or time-dependent loads. Also, they can also be defined as
single-phase loads or three-phase loads. In the code below, the modelling of the load
is done. In this study, the loads are modelled as static 3-phase loads.
The important part of real-time co-simulation using OpenDSS and Typhoon HIL
is the creation of the Typhoon HIL schematic and the SCADA. In this subsection,
detailed steps to create a schematic and SCADA are presented.
14 Cyber-Physical Co-simulation Framework Between Typhon HIL … 433
is imported in Typhoon HIL SCADA to execute the desired work. More details on
how to import Python-based modules to Typhoon HIL python core can be found in
Typhoon HIL operating manual (Hil 2022). Second, a program to communicate with
the OpenDSS on startup and during the real-time simulation needs to be scripted in
Python. Figure 14.4 shows the panel developed in Typhoon HIL SCADA to initiate
co-simulation. Different macro widgets can be placed in a panel to define programs
for initialising co-simulation.
To initialise the real-time co-simulation framework, the following code is scripted
to initialise the OpenDSS parameters in Typhoon HIL SCADA.
import os
from os import path
import sys
import numpy as np
import pandas as pd
import random
import math
if not sys.platform.startswith("win"):
raise Exception(‘You are on Linux! In order to run this model you need
to manually instal opendssdirect package.’)
SW_VERS = hil.get_sw_version()
global powers1
global powers2
global powers3
global powers4
global powers5
global powers6
global powers7
global powers8
global powers9
436 R. Wagle et al.
global busV1
global busV2
global busV3
global busV4
global busV5
global busV6
global busV7
global busV8
global busV9
global Q_PV1
global Totalloss
global Activeloss
global Reactiveloss
# declaring initial values to the global variable
powers1=0
powers2=0
powers3=0
powers4=0
powers5=0
powers6=0
powers7=0
powers8=0
powers9=0
Reactiveloss=0
Activeloss=0
activepower=0
reactivepower=0
x = bool(hil.read_digital_signal(name = "enabled"))
if x:
# Sets new active and reactive power levels in OpenDSS for
all PVsystems in network
powers1 = hil.read_analog_signal("PVcontrol.Q")
powers2 = hil.read_analog_signal("PVcontrol1.Q")
powers3 = hil.read_analog_signal("PVcontrol2.Q")
powers4 = hil.read_analog_signal("PVcontrol3.Q")
powers5 = hil.read_analog_signal("PVcontrol4.Q")
powers6 = hil.read_analog_signal("PVcontrol5.Q")
powers7 = hil.read_analog_signal("PVcontrol6.Q")
powers8 = hil.read_analog_signal("PVcontrol7.Q")
powers9 = hil.read_analog_signal("PVcontrol8.Q")
if dss.Solution.Converged():
# Selects the bus where the inverter is installed and
collect voltages
Totalloss=dss.Circuit.Losses()
Activeloss=Totalloss[0]
Reactiveloss=Totalloss[1]
#dss.Circuit.SetActiveElement("Vsource.SOURCE")
totalpower = dss.Circuit.TotalPower()
activepower = totalpower[0]
reactivepower = totalpower[1]
438 R. Wagle et al.
The overall process of implementing the co-simulation between Typhoon HIL and
OpenDSS is shown in Fig. 14.8. First, the test distribution system is modelled in
OpenDSS. The PVs are placed on the distribution network in the OpenDSS model.
The OpenDSS modules are executed through a Python interface. A Python program
is written inside the SCADA of the Typhoon HIL to interact with the OpenDSS. In a
schematic editor on Typhoon HIL, a communication interface between the SCADA
and the Typhoon HIL real-time simulator is modelled. This model in the schematic
editor can interact with the SCADA and the Typhoon HIL Real-Time Simulator.
The SCADA of Typhoon HIL consists of a python program to get the signals from
OpenDSS, process the signal, and display the real-time outputs. The SCADA also
consists of different sliders for sending the real-time signal to the OpenDSS. At
each change, the signal is fed to the OpenDSS, the load flow is executed inside the
OpenDSS, and the outputs are fed into the Typhoon HIL.
440 R. Wagle et al.
The research was carried out in the Digital Energy Systems Laboratory (DIgEnSys-
Lab). The DIgEnSys-Lab has physical equipment for real-time monitoring and
control (see https://fglongattlab.fglongatt.org for further information). Each part of
the simulation study is described in the following subsection. Typhoon HIL 604 is
used to model the cybernetic and physical layers in this paper. The European medium
voltage distribution network produced by CIGRE Task Force C6.04 in their publi-
cation “Benchmark Systems for Network Integration of Renewable and Distribution
Energy Resources.” It is assumed that the network is symmetrical and balanced. As
illustrated in Fig. 14.9, the test system comprises two typical 20 kV, 50 Hz, three-
phase feeders named feeder 1 and feeder 2. By turning on or off the switches S1, S2,
and S3, the feeder can be operated in a radial or meshed topology. In this analysis,
all the switches are assumed to be closed.
The wind source considered in the original study is replaced with a PV of the same
size to test the effectiveness of real-time reactive power control with smart inverters
of PVs in this situation. The load and other network information are kept the same
as in the original study. Table 14.1 shows the ratings of PVs considered in this study.
14 Cyber-Physical Co-simulation Framework Between Typhon HIL … 441
Fig. 14.8 Overall frameworks for co-simulation between Typhoon HIL and OpenDSS
voltage profile of the network changes in real-time for the real-time change in the
reactive power.
Fig. 14.9 Test system: Modified CIGRE medium voltage distribution system (Cigre 2014)
Fig. 14.11 Reactive power profile of PV obtained by dynamically changing the reactive power
input
14 Cyber-Physical Co-simulation Framework Between Typhon HIL … 445
Fig. 14.12 Voltage profile of CIGRE network obtained from Co-simulation framework
Acknowledgements The authors are very grateful to the Arctic Centre for Sustainable Energy
(ARC) (project number 740108), UiT The Arctic University of Norway, Norway, for providing
an opportunity for Mr Raju to visit and work in DIgEnSys-Lab. Authors and especially Prof F.
Gonzalez-Longatt, acknowledge the technical support provided by the teams of Typhoon HIL and
EPRI.
References
Acosta MN, Gonzalez-Longatt F, Andrade MA, Torres JR (2021) Optimal reactive power control
of smart inverters: vestfold and Telemark regional network. In: 2021 IEEE Madrid PowerTech,
pp 1–6
Cao G et al (2019) Real-time cyber−physical system co-simulation testbed for microgrids control.
IET Cyber-Phys Syst Theory Appl 4(1):38–45
Cigre (2014) Benchmark systems for network integration of renewable and distributed energy
resources
HIL T (2022) Typhoon HIL manual. typhoon-hil, 2022. [Online]. Available https://www.typhoon-
hil.com/documentation/
Krishnamurthy D (2017) OpenDSSDirect.py. dss-extensions.org, 2017. [Online]. Available https://
dss-extensions.org/OpenDSSDirect.py/notebooks/Example-OpenDSSDirect.py.html
Krechel T, Sanchez F, Gonzalez-Longatt F, Chamorro HR, Rueda JL (2019) A transmission system
friendly micro-grid: optimising active power losses. In: 2019 IEEE Milan PowerTech, pp 1–6
Schloegl F, Rohjans S, Lehnhoff S, Velasquez J, Steinbrink C, Palensky P (2015) Towards a classifi-
cation scheme for co-simulation approaches in energy systems. Proceedings—2015 international
symposium smart electrical distribution system technology EDST 2015, pp 516–521
Steinbrink C, Schlogl F, Babazadeh D, Lehnhoff S, Rohjans S, Narayan A (2018) Future perspectives
of co-simulation in the smart grid domain. 2018 IEEE international energy conference energycon
2018, pp 1–6
446 R. Wagle et al.
Sun CC, Hong J, Liu CC (2015) A co-simulation environment for integrated cyber and power
systems. 2015 IEEE international conference smart grid communication. SmartGridComm 2015,
pp 133–138
Sunderman W, Dugan RC, Smith J (2014) Open source modeling of advanced inverter functions
for solar photovoltaic installations. In: 2014 IEEE PES T&D conference and exposition, pp 1–5
Tang Y et al (2017) A hardware-in-the-loop based co-simulation platform of cyber-physical power
systems for wide area protection applications. Appl Sci 7(12)
van der Meer AA et al (2017) Cyber-physical energy systems modeling, test specification, and
co-simulation based testing. In: 2017 Workshop on modeling and simulation of cyber-physical
energy systems (MSCPES), pp 1–9
Venkataramanan V, Srivastava A, Hahn A (2016) Real-time co-simulation testbed for microgrid
cyber-physical analysis. In: 2016 Workshop on modeling and simulation of cyber-physical energy
systems (MSCPES), pp 1–6
Wagle R, Tricarico G, Sharma P, Sharma C, Rueda JL, Gonzalez-Lonzatt F (2022) Cyber-physical
co-simulation testbed for real-time reactive power control in smart distribution network. In: 2022
IEEE PES innovative smart grid technologies—Asia (ISGT Asia), Singapore, Singapore, pp
11–15. https://doi.org/10.1109/ISGTAsia54193.2022.10003553