Artificial Intelligence-Based Controller For Grid-Forming Inverter-Based Generators
Artificial Intelligence-Based Controller For Grid-Forming Inverter-Based Generators
∗ Univ. Grenoble Alpes, CNRS, Grenoble INP, G2ELab, F-38000 Grenoble, France
† Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG, F-38000 Grenoble, France
‡ Nanyang Technological University, Singapore 639798, Singapore
Abstract—This paper aims at developing artificial intelligence [6]. Other alternatives do not attempt to reproduce the known
(AI)-based controllers for grid-forming inverter-based genera- behavior in traditional power systems, like the virtual oscillator
tors. The paper illustrates the relevance of the controller on a [7] or the matching control [8]. Those solutions rely on an
simplified isolated microgrid. The adopted AI approach relies on
supervised learning, thus implying the need for training datasets. often complex model-based controller, necessitating precise
Firstly, the case study and the use cases were selected, and the tuning and sufficient knowledge of the various parameters of
scenarios were defined to create the training datasets from an the close electrical environment of generating units.
experimentally validated virtual synchronous generator (VSG)
controller. The use cases represent the black-start of the grid- It is also possible to consider data-driven methods of
forming inverter and the variation of the load demands as well as control. In this context, various AI-based solutions have been
its characteristics. Then, the collected datasets were used to train studied. An artificial neural network (ANN) was designed for
the AI model, which was integrated in the control of a simulated
the control of a grid-connected rectifier/inverter under distur-
inverter for testing and comparison with the VSG controller on
the selected use cases. The proposed AI-based controller ensures bance, considering dynamic and power converter switching
the stability of a simplified microgrid, maintaining voltage and conditions [9]. An adaptive critic design-based reinforcement
frequency at their nominal values. The continuity of supply learning approach was considered in controlling virtual inertia-
is guaranteed and robust to changes in loads characteristics. based grid-connected inverters [10]. An ANN was designed for
Furthermore, the proposed controller shows fast responses to
tuning the inertia of a VSG [11], and a data-driven optimal
load variations in addition to high stability during the transitions
between loads. control strategy for VSG was tested with deep reinforcement
Index Terms—Grid-Forming Control, inverter-based genera- learning approach [12]. Most of those approaches are either
tors, artificial intelligence, neural networks, supervised learning considering the case of grid-following inverters, or they only
adapt the inputs or part of the controllers. To the best of
our knowledge, the control of grid-forming inverters via data-
I. I NTRODUCTION
driven methods has not been completely considered.
The need for reducing greenhouse gas emissions and di-
versifying the sources of electricity production lead to high In this paper, an AI-based controller is proposed to over-
penetration of renewable energy sources (RES) in the power come the necessity of modeling and tuning complex model-
system [1], [2]. The high penetration of RES has introduced based controllers, maintain stability, and achieve a fast re-
distributed generation, which competes with the more central- sponse to changes in load characteristics. It offers the possi-
ized power plants. This evolution of power systems creates bility to be retrained for new case studies either by generating
new challenges to cope with, e.g., stability of the grid due to new training datasets or by applying more advanced artificial
the intermittent nature of RES [3]. Moreover, distributed gen- intelligence methods. The purpose of the proposed controller
eration units are generally relying on inverter-based generators is to achieve the voltage and frequency control of the grid-
(IBG), increasing the weakness of distribution grids. forming unit, which is illustrated in a simplified isolated
Without changing the way grids are operated, the loss of microgrid environment.
inertia caused by IBG requires building new control strategies The paper is structured as follows: The simplified isolated
to ensure the stability of the power system in this new microgrid; the selected VSG control policy; and the case study,
context. One of the main solutions that can be found in the use cases, and scenarios are described in Section II. Section III
literature is to reproduce the behavior of rotating synchronous describes the proposed AI model, its training procedure, and
machines with the help of a virtual synchronous generators its implementation for simulation. Section IV discusses the
(VSG) controller, for which a recent good example would be obtained results, comparing the AI-based solution with the
the observer-based current controller from [4]. Simplifications VSG controller, at the level of the microgrid’s frequency,
exist, providing only virtual inertia and droop control [5], voltage, and the inverter’s current for a selection of scenarios.
This work has been partially supported by MIAI@Grenoble Alpes, (ANR- Finally, Section V concludes and states the main perspectives
19-P3IA-0003). of the work.
978-1-6654-8032-1/22$31.00 ©2022 IEEE
Authorized licensed use limited to: Technical University of Denmark DTU Library. Downloaded on April 26,2024 at 12:06:50 UTC from IEEE Xplore. Restrictions apply.
Fig. 1. Simplified Isolated Microgrid, illustration support for the AI controller.
Authorized licensed use limited to: Technical University of Denmark DTU Library. Downloaded on April 26,2024 at 12:06:50 UTC from IEEE Xplore. Restrictions apply.
with steps of 20 %. The first group of datasets corresponds
to the resistive loads (no reactive power consumption). The
second group of datasets represents the inductive loads, in
which every step of the active power range was simulated with
the whole range of positive reactive powers. The third group of
datasets includes the capacitive loads, where negative values
of reactive power consumption were applied. As a result, 72
datasets were collected to represent the defined scenarios.
The use case of black-start is considered and simulated in
each of the 72 generated datasets. The simulation time per
scenario was fixed at three seconds. Finally, these 72 datasets
were combined in a single dataset for training the AI model.
To reduce the rate of necessary and representative data flow
in the AI-based controller, the dq-frame was considered, as it Fig. 4. Implemented Neural Network Architecture.
conserves the required information for efficient operation at a
slower rate.
The 16 chosen features, corresponding to the input layer of measurements, target values, and errors between measure-
the neural network, were decided in a way that provides all ments and target values are reported to its inputs. The AI
the necessary information describing the actual situation of the model provides the necessary control signals from its output
simplified isolated microgrid. The features in the combined layer by mapping the values reported on its input layer to
training dataset are as follows: voltage and current at the their corresponding output values. As noted, the expected
loads (in dq-frame), voltage and current at the output of the values on the input layer of the neural network are divided
inverter (in dq-frame), frequency of the simplified isolated into three categories. The first category, corresponding to the
microgrid, the angular velocity of the virtual machine’s rotor measurements, includes the voltages and currents at the output
at the preceding time step in per unit (ωrpu
(t−1)
), the target value of the inverter and the load after being transformed to dq-
for the single-phase root mean square (rms) voltage (230 V), frame as well as the frequency. Moreover, the target values
the target value of the frequency (50 Hz), the errors between category includes the required rms phase voltage and the
rms rms
measured rms voltages and their target (Vmeas − Vtarget ), required frequency of the grid. Finally, the category of errors
and the error between the measured frequency and its target comprehends the differences between the actual measurements
(fmeas − ftarget ). On the other hand, the three chosen labels, collected from the grid (voltages and frequency) and the target
corresponding to the outputs of the neural network, are the values. One the other hand, the duty ratios (in dq-frame) and
following: the duty ratios in the dq-frame (αd and αq ) and the the angular velocity of the virtual machine’s rotor (in per unit)
angular velocity of the virtual machine’s rotor at the actual are provided by the output layer of the neural network. Thus,
time step in per unit (ωrpu (t)
). From the predicted ωrpu (t)
, the the controller will continuously receive new measurements
electrical angle θcalculated will be calculated for transforming from the grid and provide their corresponding control signals.
abc-frame to dq-frame and vice versa, as shown in Fig. 3. The architecture of the implemented neural network is
described in Fig. 4. As seen, the input layer is composed of 16
III. AI M ODEL T RAINING AND I MPLEMENTATION artificial neurons corresponding to the previously mentioned
This section describes the proposed AI model, its training three input categories. The neural network includes three dense
procedure, and its implementation for simulation. hidden layers, each composed of 128 artificial neurons. The
Before considering more advanced machine learning tech- output layer is made up of three artificial neurons representing
niques, the initial idea is to supervise the training of the model the duty ratios (in dq-frame) and ωrpu (t)
.
as well as to clearly state what is acceptable or not (in terms Although the input and output layers components were
of voltage and current) for a dedicated set of use cases. In decided concerning the requirements of the controlled system,
addition, this phase is considered the initialization of an AI the hidden layers were defined by testing various combinations
model that will act as a foundation for further developments. of several hidden layers and their components during the
Supervised learning is a technique that learns by using training phase. The combination of three hidden layers with
labeled data [13]. The data contain a set of inputs and 128 artificial neurons each, among the tested ones, has proven
their corresponding outputs. The term “deep” comes from the the best results and the least errors.
several layers between the inputs and the outputs ones. From
its definition, the deep supervised learning approach requires B. Model Training
the presence of training datasets. The proposed feed-forward neural network has been de-
signed and trained using Keras. Keras is a deep learning
A. Artificial Intelligence Model API that runs on top of TensorFlow, a machine learning
The AI model, a sequential feed-forward neural network, platform. Being straightforward, flexible, yet powerful, it has
interacts with the grid via its input and output layers. The been chosen for the design and training of the AI model.
Authorized licensed use limited to: Technical University of Denmark DTU Library. Downloaded on April 26,2024 at 12:06:50 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Training of the Neural Network.
n
1X
M AE = |yi − xi | (1) Fig. 7 graphically describes the methodology of operation
n i=1
and interaction of the AI-based controller with the IBG and its
Fig. 6 represents the plots of the mean absolute errors during simplified microgrid. The system measurements, target values,
the training phase. The two plots correspond to the M AE of and errors are all reported to the input layer of the controller.
the training part of the dataset as well as the validation part. It then provides the system with the required control signals
The training needed less than 30 epochs to reduce the M AE concerning the values introduced at its input layer.
to 0.0003. once the training is completed, the trained model is The AI-based controller’s capabilities of conserving the
exported and saved for deployment in the grid-forming unit. stability of the simplified microgrid (i.e., supply power to
the loads in this case) by maintaining the grid voltage and
C. Model Implementation frequency at their nominal values are tested on the defined set
The AI model was developed and trained in Python, while of use cases. During testing, only one single load is connected
the inverter and the simplified isolated microgrid were imple- at a time. The changes and characteristics considered in the
mented in Matlab/Simulink. The interface between the two testing phase are summarized in the tables I and II.
environments was needed. First, a Python function was coded Table I lists the three designed loads’ characteristics. Load 1
for importing the AI trained model. Second, a Matlab function is designed to be highly capacitive. Load 2 is designed to be a
was coded for calling the Python function responsible for relatively small resistive load, corresponding to the microgrid
importing the trained AI model. Then, the Matlab function at its lowest demands. Finally, Load 3 is highly inductive.
was integrated as a block in Simulink. As a result, the neural Table II lists and describes the events occurring at prede-
network is implemented directly in Simulink, reproducing the fined instants. These simulated events are designed to test the
control policy shown in Fig. 3 in the form of an AI-based stability and robustness of the proposed AI-based controller
controller. under extreme conditions, e.g., transition from a highly capac-
Authorized licensed use limited to: Technical University of Denmark DTU Library. Downloaded on April 26,2024 at 12:06:50 UTC from IEEE Xplore. Restrictions apply.
TABLE I
C HARACTERISTICS OF THE C ONNECTED L OADS
TABLE II
L IST OF O CCURRING E VENTS
Authorized licensed use limited to: Technical University of Denmark DTU Library. Downloaded on April 26,2024 at 12:06:50 UTC from IEEE Xplore. Restrictions apply.
R EFERENCES
[1] X. Wang, J. M. Guerrero, F. Blaabjerg, and Z. Chen, “A Review of
Power Electronics Based Microgrids,” International Journal of Power
Electronics, vol. 12, no. 1, pp. 181–192, 2012.
[2] Y. W. Li and C.-N. Kao, “An Accurate Power Control Strategy for
Power-electronics-interfaced Distributed Generation Units Operating in
a Low-voltage Multibus Microgrid,” IEEE Transactions on Power Elec-
tronics, vol. 24, no. 12, pp. 2977–2988, 2009.
[3] T. L. Vandoorn, J. D. M. De Kooning, B. Meersman, and L. Vande-
velde, “Review of Primary Control Strategies for Islanded Microgrids
with Power-electronic Interfaces,” Renewable and Sustainable Energy
Reviews, vol. 19, pp. 613–628, 2013.
[4] A. Moulichon, M. Alamir, V. Debusschere, L. Garbuio, M. A. Rahmani,
M.-X. Wang, and N. Hadjsaid, “Observer-based Current Controller for
Virtual Synchronous Generator in Presence of Unknown and Unpre-
dictable Loads,” IEEE Transactions on Power Electronics, vol. 36, no. 2,
Fig. 11. Single-phase rms Inverter Currents of AI Controller vs VSG, pp. 1708–1716, 2020.
scenarios from Table II. [5] L. Subramanian, V. Debusschere, H. B. Gooi, and N. Hadjsaid, “A
Cooperative Rate-based Model Predictive Framework for Flexibility
Management of DERs,” IEEE Transactions on Energy Conversion,
pp. 2724–2733, 2021.
Since the three phases are balanced, only the current in phase [6] U. Tamrakar, D. Shrestha, M. Maharjan, B. P. Bhattarai, T. M. Hansen,
a
a (Irms ) was plotted for better visualization. and R. Tonkoski, “Virtual Inertia: Current Trends and Future Directions,”
Both controllers are capable of avoiding any current over- Applied Sciences, vol. 7, no. 7, pp. 654–660, 2017.
[7] S. V. Dhople, B. B. Johnson, and A. O. Hamadeh, “Virtual Oscillator
shoots, specifically during the transition between different Control for Voltage Source Inverters,” in Annual Allerton Conference
microgrid characteristics, thus the inverter is protected and no on Communication, Control, and Computing (Allerton), pp. 1359–1363,
protection is triggered. Yet after the black-start and during IEEE, 2013.
[8] C. Arghir, T. Jouini, and F. Dörfler, “Grid-forming control for power
transitions, the current obtained by the AI-based controller converters based on matching of synchronous machines,” Automatica,
achieves its stability faster than the current from the VSG vol. 95, pp. 273–282, 2018.
controller. In addition, the current obtained in the VSG case [9] S. Li, M. Fairbank, C. Johnson, D. C. Wunsch, E. Alonso, and J. L.
Proao, “Artificial Neural Networks for Control of a Grid-connected
is undergoing undesired fluctuations, notably in the capacitive Rectifier/Inverter under Disturbance, Dynamic and Power Converter
and inductive cases. In contrast, the current profile of the Switching Conditions,” IEEE Transactions on Neural Networks and
AI-based controller is subjected to limited fluctuations that Learning Systems, vol. 25, no. 4, pp. 738–750, 2013.
[10] S. Saadatmand, P. Shamsi, and M. Ferdowsi, “Adaptive Critic Design-
are rapidly damped. This implies that the AI-based controller based Reinforcement Learning Approach in Controlling Virtual Inertia-
provides a better response to changes and a better power based Grid-connected Inverters,” International Journal of Electrical
quality. Power & Energy Systems, vol. 127, p. 106657, 2021.
[11] F. Yao, J. Zhao, X. Li, L. Mao, and K. Qu, “RBF Neural Network
Based Virtual Synchronous Generator Control With Improved Frequency
V. C ONCLUSION AND F UTURE W ORK Stability,” IEEE Transactions on Industrial Informatics, vol. 17, no. 6,
pp. 4014–4024, 2020.
[12] Y. Li, W. Gao, S. Huang, R. Wang, W. Yan, V. Gevorgian, and D. W.
In this paper, a supervised deep-learning AI-based con- Gao, “Data-driven Optimal Control Strategy for Virtual Synchronous
troller is trained based on data collected from a simulated Generator Via Deep Reinforcement Learning Approach,” Journal of
virtual synchronous generator (VSG) control. Then, it was Modern Power Systems and Clean Energy, vol. 9, no. 4, pp. 919–929,
2021.
implemented in an inverter, reproducing variations in the load [13] M. Z. Alom, T. M. Taha, C. Yakopcic, S. Westberg, P. Sidike, M. S.
demands and characteristics as a case study depicted in more Nasrin, M. Hasan, B. C. Van Essen, A. A. S. Awwal, and V. K. Asari,
than 70 scenarios. The controller was validated on a set of “A State-of-the-art Survey on Deep Learning Theory and Architectures,”
Electronics, vol. 8, no. 3, p. 292, 2019.
events with extreme load variations and compared to the actual
implementation of the VSG on the same inverter in the case
of a simplified microgrid.
The proposed AI-based controller showed a faster and
smoother response to changes compared to the VSG one
in terms of frequency, voltage, and current profiles, thus
providing higher robustness and stability in the cases of harsh
load impacts.
The adopted AI method is trained on specific case studies
and scenarios, obtained from simulating the VSG control on
a typical inverter. As a result, the proposed AI model dis-
plays limited adaptability characteristics. Deep reinforcement
learning, allowing the AI model to learn its optimal control
policy via interacting with its environment represents a clear
work path, allowing improved robustness to uncertainty in the
renewable production as well as in the grid topology.
Authorized licensed use limited to: Technical University of Denmark DTU Library. Downloaded on April 26,2024 at 12:06:50 UTC from IEEE Xplore. Restrictions apply.