You are on page 1of 23

sensors

Article
Unified Environment for Real Time Control of Hybrid Energy
System Using Digital Twin and IoT Approach
Lamine Chalal 1,2, *, Allal Saadane 1 and Ahmed Rachid 2

1 Icam School of Engineering, Lille Campus, 6 Rue Auber, B.P 10079, CEDEX, 59016 Lille, France;
allal.saadane@icam.fr
2 Laboratory of Innovative Technologies, University of Picardie Jules Verne, 80000 Amiens, France;
rachid@u-picardie.fr
* Correspondence: lamine.chalal@icam.fr; Tel.: +33-202263943

Abstract: Today, climate change combined with the energy crisis is accelerating the worldwide
adoption of renewable energies through incentive policies. However, due to their intermittent and
unpredictable behavior, renewable energy sources need EMS (energy management systems) as well
as storage infrastructure. In addition, their complexity requires the implementation of software and
hardware means for data acquisition and optimization. The technologies used in these systems are
constantly evolving but their current maturity level already makes it possible to design innovative
approaches and tools for the operation of renewable energy systems. This work focuses on the
use of Internet of Things (IoT) and Digital Twin (DT) technologies for standalone photovoltaic
systems. Based on Energetic Macroscopic Representation (EMR) formalism and the Digital Twin
(DT) paradigm, we propose a framework to improve energy management in real time. In this
article, the digital twin is defined as the combination of the physical system and its digital model,
communicating data bi-directionally. Additionally, the digital replica and IoT devices are coupled via
MATLAB Simulink as a unified software environment. Experimental tests are carried out to validate
the efficiency of the digital twin developed for an autonomous photovoltaic system demonstrator.

Keywords: digital twin; internet of things; real-time monitoring; rule-based control; battery;
Citation: Chalal, L.; Saadane, A.; standalone photovoltaic system
Rachid, A. Unified Environment for
Real Time Control of Hybrid Energy
System Using Digital Twin and IoT
Approach. Sensors 2023, 23, 5646. 1. Introduction
https://doi.org/10.3390/s23125646
Renewable energy systems, such as solar panels and wind turbines generate power
Academic Editors: Antonio Puliafito, from natural resources that are available intermittently. Since they produce variable power,
Antonio Cano-Ortega and their effective dissemination can be accelerated by better control and monitoring. Tradition-
Francisco Sánchez-Sutil ally, data acquisition systems (DAQs), usually centralized, are used for collecting all system
data [1]. However, the cost of commercial DAQs is the most significant barrier for greater
Received: 3 May 2023
Revised: 3 June 2023
diffusion. IoT (Internet of things) based smart meters have recently gained substantial
Accepted: 12 June 2023
popularity for control and measurement data. Indeed, their ability to communicate data
Published: 16 June 2023
over networks offers a wide range of applications. Therefore, IoT devices can potentially
be useful for real-time energy management. Accordingly, energy production efficiency
and reliability can be significantly improved ([2–4]). This can help reduce dependence on
traditional fossil fuel-based energy sources and promote renewable energy.
Copyright: © 2023 by the authors. However, implementing IoT in renewable energy systems faces several challenges
Licensee MDPI, Basel, Switzerland. due to the variety of protocols and devices available in the market [5]. This can make
This article is an open access article it difficult to integrate IoT devices while ensuring their compatibility with the existing
distributed under the terms and infrastructure [6].
conditions of the Creative Commons On the other hand, defined as the combination of the physical system and its digital
Attribution (CC BY) license (https://
model, the Digital Twin (DT) paradigm can be used to predict energy production and con-
creativecommons.org/licenses/by/
sumption. It also enables predictive maintenance [7]. Therefore, it is crucial to implement
4.0/).

Sensors 2023, 23, 5646. https://doi.org/10.3390/s23125646 https://www.mdpi.com/journal/sensors


Sensors 2023, 23, x FOR PEER REVIEW 2 of 23
Sensors 2023, 23, 5646 2 of 23

consumption. It also enables predictive maintenance [7]. Therefore, it is crucial to imple-


ment techniques
techniques that provide
that provide a widearange
wide range of operational
of operational data about
data about the actual
the actual system
system [8]. IoT
[8]. IoT technology can be associated with DT thanks to their ability of actuation
technology can be associated with DT thanks to their ability of actuation and sensing. and sens-
ing.In this work, our objective is to build a DT of a standalone PV system to deal with
In this
real-time work,
energy our objectivechallenges.
management is to build Figure
a DT of1 adepicts
standalone PV system
the diagram to deal
of the with
digital twin
asreal-time
developedenergy management
in this work: challenges. Figure 1 depicts the diagram of the digital twin
as developed in this work:
- Physical system: made up of two PV panels, batteries, DC loads, a solar emulator, and
- aPhysical
weathersystem:
station.made up of two PV panels, batteries, DC loads, a solar emulator,
- Smart sensors station.
and a weather and actuators: including devices required for control and monitor-
- ing Smart sensors
purposes. and actuators: including devices required for control and monitoring
purposes.
- Digital counterpart implemented in MATLAB: including mainly EMR-based model,
- Digital counterpart implemented in MATLAB: including mainly EMR-based model,
Real-Time monitoring, and control systems.
Real-Time monitoring, and control systems.

Figure 1. Diagram of the digital twin of the standalone PV system.


Figure 1. Diagram of the digital twin of the standalone PV system.

Toexperimentally
To experimentallyvalidate
validatethe
theproposed
proposedframework,
framework,we
wehave
havedeveloped
developedaalablabdemon-
de-
monstrator according to IoT-based architecture for embedded and distributed instrumen-
strator according to IoT-based architecture for embedded and distributed instrumentation.
tation. Furthermore, to cope with the devices’ heterogeneity, we use MATLAB Simulink.
Furthermore, to cope with the devices’ heterogeneity, we use MATLAB Simulink. Indeed,
Indeed, this is a comprehensive software environment that can communicate with sensors
this is a comprehensive software environment that can communicate with sensors and
and Programmable Logic Controllers through client/server applications.
Programmable Logic Controllers through client/server applications.
This document is structured as follows. First, we present a review of the literature
This document is structured as follows. First, we present a review of the literature
related to our work. In the second part, we detail our test bench which constitutes the
related to our work. In the second part, we detail our test bench which constitutes the
physical part of the proposed Digital Twin. In the third part, we present an approach
physical part of the proposed Digital Twin. In the third part, we present an approach
based on the Energetic Macroscopic Representation (EMR) formalism as a numerical
based on the Energetic Macroscopic Representation (EMR) formalism as a numerical
counterpart of our system. Finally, the experimental validation of the resulting digital
counterpart
twin will beofdiscussed.
our system. Finally, the experimental validation of the resulting digital twin
will be discussed.
2. Literature Review
2. Literature Review
Several studies have considered photovoltaic systems monitoring. In [9], the authors
Several studies have considered photovoltaic systems monitoring. In [9], the authors
used the IoT and MQTT (MQTT: Message Queuing Telemetry Transport) in web-based
used the IoT and
monitoring. TheyMQTT (MQTT:this
implemented Message
approachQueuing Telemetry
to monitor Transport) of
the performance in the
web-based
solar
monitoring.
panels and theThey implemented
battery system, as this
wellapproach to monitor
as the energy the performance
consumption of the solar
of a living laboratory.
panels
Similarand theisbattery
work system,
reported in [10].asWhen
well as the energy
compared consumption
to other protocols, of a living
MQTT haslaboratory.
a small
Similar
footprint, making it much more suitable for resource-constrained environments.has
work is reported in [10]. When compared to other protocols, MQTT a small
Despite
footprint, making it much more suitable for resource-constrained environments. Despite
several benefits, it is important to note that MQTT brokers do not provide the same level
of entity authentication or encryption capabilities [11]. Moreover, IoT devices are often
not interoperable, and it is difficult to integrate external sources of information and cloud
Sensors 2023, 23, 5646 3 of 23

computing to use energy more efficiently. Indeed, it requires the design and implementation
of hierarchical architectures and standardized solutions to facilitate interoperability. Till
today, no standard solution is established yet [12]. However, most providers share IoT
middlewares, which has fostered the emergence of cross-domain applications.
In [13], the authors developed a Smart Home monitoring system using Power Line
Communication (PLC) which has the advantage of not needing additional communication
cables [14]. This article also demonstrates the potential of using PLCs to monitor individual
photovoltaic panels.
Moreover, the review work [1] provides an overview on the importance of monitoring
systems for photovoltaic plants (electrical and meteorological data). The article reviews
different types of monitoring systems that are currently available for PV plants, including
hardware and software aspects. The authors discuss the advantages and disadvantages of
each type of system and provide examples of commonly used components.
There exist several commercial software for monitoring and simulation of PV systems
such as LabVIEW ([15–18]) and MATLAB Simulink ([19,20]).
Furthermore, studies in [20–24], present an energy management system by using
Programmable Logic Controller. Compared to other hardware control systems, PLCs
have specific advantages as ruggedness, noise immunity, modularity, low cost, and small
footprints [25].
We also reviewed several papers dealing with Digital Twins. This concept is partic-
ularly popular in the context of industry 4.0, where it is mainly implemented for man-
ufacturing systems [26]. Nowadays, there is a significant trend to apply this concept to
the electrical energy field [27]. That said, there are few concrete applications. Moreover,
as there are several misconceptions about digital twin definition [28], it is important to
distinguish the digital twin, the digital model, and the digital shadow. In fact, the digital
model is defined as a digital copy of a physical system without any data exchange and
is generally used for simulation and design purposes. Likewise, the Digital Shadow is a
combination of a physical system and its digital model with a one-way data exchange.
Although some authors claim to use the concept of the Digital Twin as just defined
above, most of the articles deal with the “digital model” or “digital shadow”. For instance,
authors in [27] study the digital twin possibilities for fault diagnosis purpose of PV system.
However, they use a digital shadow instead of digital twin. We find the same confusion in
the articles [29–33].
Relatively to our contribution, Table 1 summarizes the state of art of the current
literature dealing with digital twin applications.
In this work, we propose a Digital Twin of a complete photovoltaic system using
MATLAB software as a unified environment. This framework is suitable to address the
following topics:
- Real-time access to multi-protocol data for monitoring purposes.
- Modelling, simulation, and real-time control of PV systems
- Implementing of innovative energy management systems
- Reporting
In other words, this experimental platform can be used to compare simulation results
and monitored data in real time. Indeed, it could be used to develop new approaches for
fault detection and prediction issues. This integrated environment allows on the one hand
to have a large panel of toolboxes (modelling, code generation, machine learning, advanced
control, cloud computing . . . ). Therefore, it could be easily used for advanced control and
optimization purposes.
Sensors 2023, 23, 5646 4 of 23

Table 1. Literature review related to IoT and DT usage for energy management.

IoT Multi- Energy Digital Digital


Reference
Sensors 2023, 23, x FOR PEER REVIEW Monitoring 4Digital
of 23 Twin
Capability Protocols Management Model Shadow
[34] 3 3 7 3 7 7 7
[29]
[10] ✓3 -- 7✓ 3 ✓ 3- -3 ✗ 7
[35] 7 7
Unified 7 3 3 3 7
Proposed ✓ ✓ ✓ ✓ ✓ ✓
[9] 3 environment
3 3 3 7 7 7
[36] 3 3 7 3 7 7 7
In this work, we propose a Digital Twin of a complete photovoltaic system using
[37] 3 MATLAB 3 software as a 7unified environment.
3 7
This framework is suitable7 to address the 7
[16] 7 following
3 topics: 7 3 7 7 7
- Real-time access to multi-protocol data for monitoring purposes.
[30] 3 - 7 3 3 3 7
- Modelling, simulation, and real-time control of PV systems
[38] 3 - 3
Implementing 7
of innovative energy3management systems
7 7 7
[39] 7 - Reporting
- 3 3 7 7 7
[10] 3 In -other words, this3experimental platform
3 can be used
- to compare simulation
- results 7
and monitored data in real time. Indeed, it could be used to develop new approaches for
Proposed 3 faultUnified
detection and prediction
3 issues. This
3 integrated environment
3 allows 3
on the one hand 3
toenvironment
have a large panel of toolboxes (modelling, code generation, machine learning, ad-
vanced control, cloud computing…). Therefore, it could be easily used for advanced con-
trol
3. and optimization
Materials purposes.
and Methods
The concept
3. Materials of the digital twin, object of this work, is implemented on a test rig.
and Methods
In this section we describe the structure of the demonstrator, its instrumentation and
The concept of the digital twin, object of this work, is implemented on a test rig. In
control system.
this section we describe the structure of the demonstrator, its instrumentation and control
system.
3.1. PV System Description
The
3.1. PV stand-alone
System system is composed of the following elements (Figure 2):
Description
• The stand-alone
Solar emulator system is composed
as artificial of the following elements (Figure 2):
light source,
•• × 215
2Solar Wp photovoltaic
emulator panels
as artificial light (SunPower Co., San José, CA, USA),
source,
•• 28
2 × Ah
215 batteries as storage
Wp photovoltaic system
panels (Victron
(SunPower Co.,Energy B.V.,
San José, CA,Almere,
USA), The Netherlands),
•• 28 Ah
DC batteries as storage system (Victron Energy B.V., Almere, The Netherlands),
loads.
•• DC loads.
Power converters (Victron Energy B.V., Almere, The Netherlands).
• Power converters (Victron Energy B.V., Almere, The Netherlands).

Figure 2.
Figure 2. PV
PVsystem
systemdemonstrator.
demonstrator.
Sensors 2023, 23, x FOR PEER REVIEW 5 of 23
Sensors 2023, 23, 5646 5 of 23

3.2. Sensors
3.2. Sensors and
and Data
Data Aquisition
Aquisition
Developingaadigital
Developing digitaltwin
twinfor
forrenewable
renewableenergy
energysystems
systems requires
requires constant
constant data
data col-
collec-
lection and monitoring [40]. Therefore, it is necessary to implement techniques that
tion and monitoring [40]. Therefore, it is necessary to implement techniques that provide a pro-
vide arange
wide wideofrange
data:of data:
-- Weather data
Weather data (temperature,
(temperature, irradiance,
irradiance, wind
wind speed
speed…);
. . . );
-- Real time electrical data (energy, currents, voltages, batteries’state
Real time electrical data (energy, currents, voltages, batteries’ stateof
ofcharge
charge…).
. . . ).
The experimental platform is equipped with sensors of various technologies
The experimental platform is equipped with sensors of various technologies that that dodo
not use the same communication protocol. To transmit measurement
not use the same communication protocol. To transmit measurement data to a unifieddata to a unified
software environment,
software environment,we wehave
havedeveloped
developeda hardware
a hardwareandand software
software architecture
architecture based based
on
on the
the following
following components:
components:
- An IoT
An IoTarchitecture
architecturecombining
combiningsmart
smart sensors
sensors forfor electrical
electrical data
data [41][41]
andand a weather
a weather sta-
station.
tion. As As
IoT,IoT, these
these devices
devices use heterogeneous
use heterogeneous communication
communication protocols
protocols [42] , in-
[42], including
cluding Modbus
Modbus TCP/IP, TCP/IP, HTTP,
HTTP, and and PROFINET ;
PROFINET;
- MATLAB Simulink, as an an integrated
integrated environment
environment concentrating
concentrating allall the
the operational
operational
data of
data of the
the system,
system, constitutes
constitutes the
the core
core of
of the
the digital
digital twin.
twin.
Figure 33 depicts
Figure depicts the
the demonstrator
demonstratoroverview
overviewand
andits
itscontrol
controlsystem
systemarchitecture.
architecture.

Figure 3.
Figure 3. Control
Control system
system architecture
architectureof
ofthe
thePV
PVplant.
plant.

3.3.
3.3. Control
Control System
System
At
At first level,
first level, the
the embedded
embedded control
control system
system isis based
based on
on aa S7-1200
S7-1200 PLC
PLC which
which controls
controls
solar
solar emulator and relays. This allows experimental tests to be carried out according
emulator and relays. This allows experimental tests to be carried out according toto
real-time
real-time weather
weather datadata or
or with
withhistorical
historicaldata.
data.
At
At the
thesecond
second level, the the
level, overall control
overall of theof
control PVthe
system
PV is performed
system within MATLAB
is performed within
Simulink programs using the embedded PLC as a slave. Data
MATLAB Simulink programs using the embedded PLC as a slave. Data communicationcommunication is carried
out using OPC-UA
is carried out usingand Industrial
OPC-UA Communication
and Industrial Toolbox™.Toolbox™.
Communication
Figure
Figure 4 describes the unified architecture proposedin
4 describes the unified architecture proposed inthis
thiswork.
work.
Sensors2023,
Sensors 2023,23,
23,5646
x FOR PEER REVIEW 66 of 23
of 23

Figure 4.
Figure 4. Digital
Digital Twin
Twin architecture
architecture overview.
overview.

4.
4. PV System Modeling
Modeling
This
This section details
section details our
our approach
approach to
to modeling
modeling the
the PV
PV system.
system. The aim is
is to
to develop
develop
the digital replica counterpart of the Digital Twin.
the digital replica counterpart of the Digital Twin.

4.1.
4.1. Solar
Solar Panels
Panels
A
A photovoltaic (PV)
photovoltaic (PV) power
power system
system consists
consists of
of two
two solar
solar panels
panels (SPR-215-WHT).
(SPR-215-WHT). PV
PV
parameters of each panel are given in Table
parameters of each panel are given in Table 2.2.

Table 2. Parameters
Table 2. Parameters of
of the
the SPR-215-WHT
SPR-215-WHT solar
solar panel
panel at
at STC
STC form
formdatasheet.
datasheet.
Parameter Parameter Value Value
power Pmaxpower 𝑃
MaximumMaximum 215 Wp 215 Wp
Voltage atVoltage
maximum Vmp point 𝑉
power pointpower
at maximum 39.8 V 39.8 V
Current at maximum power point Imp 5.40 A
Current
Open circuitatvoltage
maximumVoc power point 𝐼 48.3 V 5.40 A
Open
Short Circuit Current Isc voltage 𝑉
circuit 5.80 A 48.3 V
Voltage temperature
Short coefficient
Circuit Current
β oc 𝐼 −136.8 mV/◦ C 5.80 A
Current temperature coefficient
Voltage temperature coefficient 𝛽
α sc 3.5 mA/◦−136.8
C mV/°C
Number of cells per module ns 72
Current temperature coefficient 𝛼 3.5 mA/°C
Number of cells per module 𝑛 72
PV panel is composed of several cells. Each PV cell is made up of semiconductor
materials whichiscan
PV panel convert solar
composed irradiance
of several cells.into electrical
Each PV cellenergy.
is made Based onsemiconductor
up of the electronics
theory of semiconductor p-n junction, it can be described by a current
materials which can convert solar irradiance into electrical energy. Based on the source. Theelectron-
studied
panel model
ics theory in this work isp-n
of semiconductor represented
junction, itbycan anbeequivalent
describedcircuit. It consists
by a current source.ofThe
a single
stud-
diode for the cell polarization function and two resistors (series and shunt)
ied panel model in this work is represented by an equivalent circuit. It consists of a singlefor the losses
(Figure
diode for5).the
The equivalent
cell circuit
polarization is composed
function and twoof an ideal(series
resistors current shunt)I ph
andsource forinthe
parallel,
losses
reverse diode, series resistance R s and parallel resistance
(Figure 5). The equivalent circuit is composed of an ideal sh R .
current source 𝐼 in parallel,
reverse diode, series resistance 𝑅 and parallel resistance 𝑅 .
Sensors2023,
Sensors 23,x5646
2023,23, FOR PEER REVIEW 7 of2323
7 of

(a) (b)
Figure 5. Equivalent circuit model. (a) PV cell; (b) PV panel composed of 𝑛 cells in series.
Figure 5. Equivalent circuit model. (a) PV cell; (b) PV panel composed of ns cells in series.

The𝐼I pv==𝑓f 𝑉Vpv characteristic


The characteristicofofthisthismodel
modelisisgiven
givenbybythe
thefollowing
followingequation:

equation:
𝑉 𝑅 𝐼
𝐼 = 𝐼 − 𝐼 − Vpv + Rs I pv
 
(1)
I pv = I ph − ID − 𝑅 (1)
Rsh
where:
where:
- 𝐼 is the current generated by solar panel;
- - 𝐼 I pvisisthe
thephotocurrent,
current generated
which byissolar panel;
linearly proportional to irradiance and depends on
I phtemperature
- the is the photocurrent,
as shown in the followingproportional
which is linearly equation: to irradiance and depends on
the temperature as shown in the following equation:
𝐼 = 𝐼 𝛼 ∆𝑇
G
I ph = ( I phn + αsc ∆T )
Gn
○ where ∆𝑇 = 𝑇 − 𝑇 (𝑇 = 25 °C ), 𝐺 is the incident of irradiation on the solar
# panel, and∆T
where 𝐺 =(1000
T − W/m²)
T n (Tn at= standard conditions
25◦ C), G is (STC);
the incident of irradiation on the solar
- 𝐼 is thepanel,
diode and
current: 2
G (1000 W/m ) at standard conditions (STC);
n
- ID is the diode current: 𝑞𝑉
𝐼 = 𝐼 exp  qV −1 (2)
ID = I0 [exp 𝐴𝐾𝑇 pv
− 1] (2)
AKT
○ where: 𝐼 is the PV cell reverse saturation current that mainly depends on the
# temperature,
where: I0 isq the PVelectronic
is the cell reverse saturation
charge of an current
electronthat 10 C),depends
(1.6mainly 𝑇 is theon the
tem-
19 C), T is the
perature of the PV cell, 𝑘 is Boltzmann’s constant (1.38 10 𝐽/𝐾), and A is the
temperature, q is the electronic charge of an electron (1.6 × 10
temperature
diode of the PV cell, k is Boltzmann’s constant (1.38 × 1023 J/K), and A
ideality factor.
is the
A PV panel diode up
is made ideality factor. identical PV cells connected in series to provide
of numerous
A PV
a higher panel A
voltage. is PV
made up of numerous
module of 𝑛 identical
composed identical PV cellscells
connected incan
in series series tobe
also provide
repre-a
higherby
sented voltage. A PV module
the equivalent composed
circuit of ns identical
shown Figure cells
4a but the in series
circuit cantoalso
needs be represented
be modified [43]
by the equivalent circuit
as follows (Figure 5b): shown Figure 4a but the circuit needs to be modified [43] as follows
(Figure 5b):
𝑅 _ = 𝑛 𝑅 , 𝑅 _ = 𝑛 𝑅 , 𝐴 = 𝑛 𝑛, 𝐼 _ = 𝐼 , 𝐼 _ = 𝐼 (3)
Rs_ns = ns Rs , Rsh_ns = ns Rsh , Ans = ns n, I0_ns = I0 , I ph_ns = I ph (3)
The solar panel datasheet does not include some important parameters, such as 𝑅
and 𝑅The . To obtain
solar them,
panel we useddoes
datasheet the PV
notarray toolsome
include of Matlab by setting
important the PV parameters
parameters, such as Rs
ofand
theRstudied solar them,
. To obtain panel.weTable
used 3 shows
the PVthe extracted
array parameters.
tool of Matlab by setting the PV parameters
sh
of the studied solar panel. Table 3 shows the extracted parameters.
Table 3. Parameters of the SPR-215-WHT solar panel at STC form datasheet.
Table 3. Parameters of the SPR-215-WHT solar panel at STC form datasheet.
Parameters Values
𝑅 _ 0.72262 Ω
Parameters Values
𝑅 _ 198.7727 Ω
R𝐼s_ns 10 Ω 𝐴
0.72262
3.8896
Rsh_ns 198.7727 Ω
𝐴 0.74816−15
I0 3.8896 × 10 A
Ans 0.74816
The mathematical model of the studied solar panel is then implemented under
MATLAB Simulink and the results are compared to datasheet data as shown in Figure 6.
Sensors 2023, 23, 5646 8 of 23

Sensors 2023, 23, xSensors


FOR PEER
2023,REVIEW
23, x FOR PEER REVIEW 8 of 23
The mathematical model of the studied solar panel is then implemented under MAT-
LAB Simulink and the results are compared to datasheet data as shown in Figure 6.

7
7

1000 w/m²
6 1000 w/m²
6

5 800 W/m² 5 800 W/m²

Current (A)

Current (A)
4
4

800 W/m²
3 800 W/m²
3

2
2
1000 w/m² at 50C°
1000 w/m² at 50C°

1
1

0
0
0 5 10 15 20 25 30 35 40 45 50
0 5 10 15 20 25 30 35 40 45 50

Voltage (V)
Voltage (V)

(a) (a) (b) (b)


1000 W/m²
1000 W/m²

200
200
1000 W/m² at 50°
1000 W/m² at 50°

150
150

800 W/m²
800 W/m²
Power(W)

Power(W)

100
100

500 W/m²
50 500 W/m²
50

0
0
0 5 10 15 20 25 30 35 40 45 50
0 5 10 15 20 25 30 35 40 45 50
Voltage (V)
Voltage (V)

(c) (c)
Figure6.6. Actual
Figure data
datavs.
ActualFigure 6. data
vs. Actual
datacomputed
data vs. by
computed thecomputed
data
by model:
the (a)
model:byI-V
thecharacteristics
(a) model:
I-V (a) I-Vfrom datasheet;
characteristics
characteristics from (b) datasheet
from
datasheet;
actual I-V characteristics vs. computed
actual I-V characteristicsI-V characteristics;
vs. computed (c) actual P-V
I-V characteristics;characteristics vs. com-
(b) actual I-V characteristics vs. computed I-V characteristics; (c) actual(c) actual
P-V P-V characteristics
characteristics vs. vs. c
puted P-V characteristics.
puted P-V characteristics.
computed P-V characteristics.
Thedotted
The dottedcurves
curves
Thein inFigure
Figure
dotted 55represent
represent
curves in Figure data
data fromthe
5 from thedatasheet
represent datasheet
data and
fromand thecontinuous
the the continuous
datasheet and the cont
ones come from the
ones mathematical
come from the model. These
mathematical results
model. show
These a good
results
ones come from the mathematical model. These results show a good correlation between correlation
show a goodbetween
correlation be
the model and the
the solar
model panel
and manufacturer’s
the solar panel
the model and the solar panel manufacturer’s data. data.
manufacturer’s data.
Toassess
To assessthe
themodel’s
model’s
To assess effectiveness,
the model’swe
effectiveness, we conductedindoor
effectiveness,
conducted indoor
we testsofofthe
conducted
tests thePV
indoorPVpanel.
panel.
tests The
ofThe
the PV pan
PV panel was illuminated
PV panel was
PV panel was illuminated using an artificial
illuminated
using using
an artificial light
lightan source, while
artificial
source, light
while its output
source,was
its output was
while connected
its output
connected to was con
ato a rheostat.
rheostat. To
toobtain
To obtain the the
I-VI-V
a rheostat. To curves,
obtain
curves, measuring
the instruments
I-V curves,
measuring measuring
instruments were were integrated,
instruments
integrated, as depicted
were
as integrated,
depicted in as de
in Figure
Figure 7a. 7a. in Figure 7a.

2
2
Simulation result
Simulation result
1.8 Experimental result
1.8 Experimental result

1.6
1.6

1.4
1.4

1.2
1.2
G = 220 W/m²
G = 220 W/m²
Current(A)

Current(A)

1 Tc = 50 °C
1 Tc = 50 °C

0.8
0.8

0.6
0.6

0.4
0.4

0.2
0.2

0
0
0 5 10 15 20 25 30 35 40 45 50
0 5 10 15 20 25 30 35 40 45 50
Voltage(V)
Voltage(V)

(a) (a) (b) (b)


Figure7.7.Experimental
Figure Experimental test
Figuretest
7. andcomparison
comparison
Experimental
and test ofofI-V
and I-V curves:(a)
comparison
curves: (a)of
experimental components
I-V curves: (a)
experimental ofofthe
experimental
components the tested
components
tested of th
PV panel; (b) comparison
PV panel; between
(b) real testbetween
comparison and thereal
mathematical
test and model.
the mathematical model.
PV panel; (b) comparison between real test and the mathematical model.

Figure 7b shows the simulation


Figure andsimulation
7b shows the experimental
andresults, confirming
experimental theconfirming
results, accuracy ofthe accu
the implemented mathematical model.
the implemented mathematical model.
Sensors 2023, 23, 5646 9 of 23

Sensors 2023, 23, x FOR PEER REVIEW 9 of 23


Figure 7b shows the simulation and experimental results, confirming the accuracy of
the implemented mathematical model.

4.2.
4.2.Batteries
BatteriesBank
Bank
Due
Dueto tothe
theinherent
inherentvariability
variabilityofofPV
PVpower,
power,thethebattery
batteryplays
playsaacrucial
crucialrole
roleininstand-
stand-
alone
alonePVPVsystems.
systems.InInthis
thissystem,
system,two
two1212VVAGM
AGM batteries areare
batteries installed andand
installed connected
connectedin
ainseries configuration. The utilization of AGM batteries provides additional
a series configuration. The utilization of AGM batteries provides additional benefits, benefits, as
they facilitate
as they recombination
facilitate recombination and effectively
and mitigate
effectively mitigategas
gasemissions
emissionsduring
duringovercharge.
overcharge.
Consequently,
Consequently,the thedemand
demandfor forroom
roomventilation
ventilationisisreduced,
reduced,andandthe
thebatteries
batteriesdodonotnotemit
emit
any
anyacid
acidfumes
fumesduring
duringnormal
normaldischarge
dischargeoperations
operations [44].
[44].
The
Thebattery
batterymodel
modelininFigure 8 considers
Figure a constant
8 considers internal
a constant resistance.
internal This resistance
resistance. This resis-
istance
connected in series
is connected inwith
seriesthewith
internal voltage voltage
the internal source which
sourcedepends on various
which depends on param-
various
eters [45]. [45].
parameters

Figure
Figure8.8.Nonlinear
NonlinearBattery
Batterymodel.
model.

The
Theterminal
terminalvoltage
voltageof
ofthe
thebattery
batteryisisgiven
givenby:
by:

V𝑉bat ==E𝐸−−RI
𝑅𝐼 (t𝑡)
bat
(4)
(4)
where:
where:
• 𝑅: is the internal resistance;
• R: is the internal resistance;
• 𝐼 : is the battery current.
• Ibat : is the battery current.
The controlled voltage source 𝐸 is described by the following equation:
The controlled voltage source E is described by the following equation:
𝐸 =𝐸 −𝐾 𝐴𝑒𝑥𝑝 −𝐵 Z𝐼 𝑡 𝑑𝑡 (5)
Q
E = E0 − K R + Aexp(− B Ibat (t)dt) (5)
where: Q − Ibat (t)dt
𝐸 : Fully charged voltage;
•where:
• 𝐾: polarization voltage (V);
• E : Fully charged voltage;
• 𝑄:0battery capacity (Ah);
• K: polarization voltage (V);
• 𝐴: exponential zone amplitude (V);
• Q : battery capacity (Ah);
• 𝐵: exponential zone time constant inverse (Ah).
• A: exponential zone amplitude (V);
• The parameterszone
B: exponential of this equivalent
time circuit can
constant inverse (Ah).be identified by considering the dis-
charge characteristics with a nominal current.
The parameters of this equivalent circuit can be identified by considering the discharge
We use a lead-acid battery, which features a nominal voltage of 12 volts (E0), a capac-
characteristics with a nominal current.
ity of 14 Ah (𝑄), a rated current of 0.7 A, and an internal resistance of 14 mΩ (Table 4).
We use a lead-acid battery, which features a nominal voltage of 12 volts (E0 ), a capacity
of 14 Ah (Q), a rated current of 0.7 A, and an internal resistance of 14 mΩ (Table 4).
Table 4. Parameters of an AGM battery from datasheet.

4. Parameters of anNominal
TableCapacity AGM battery from datasheet.
Voltage Internal Resistance Weight
14 Ah/0.7 A 12 V 14 mΩ 4.05 Kg
Capacity Nominal Voltage Internal Resistance Weight
14 Ah/0.7 A
The model parameters (K =12 V
0.12, 14 mΩ
A = 0.66, B = 7) are 4.05 kg
obtained through graphical esti-
mation based on the rated current discharge characteristic curve. The simulation results
are depicted in Figure 9. The Q-V discharge curve is composed of three sections. The first
section represents the exponential voltage drop if the battery is initially fully charged. The
second phase represents the charge that can be extracted from the battery until the voltage
Sensors 2023, 23, 5646 10 of 23

The model parameters (K = 0.12, A = 0.66, B = 7) are obtained through graphical


estimation
Sensors 2023, 23, x FOR PEER REVIEW based on the rated current discharge characteristic curve. The simulation results 10 of 23
Sensors 2023, 23, x FOR PEER REVIEWare depicted in Figure 9. The Q-V discharge curve is composed of three sections. 10 ofThe
23
first section represents the exponential voltage drop if the battery is initially fully charged.
The second phase represents the charge that can be extracted from the battery until the
dropsdrops
voltage belowbelow
the battery nominal
the nominal
battery voltage.
nominal Finally,
voltage. the the
Finally, third section
third represents
section thethe
represents total
drops below the
discharge of battery
the battery, when voltage.
the Finally,
voltage drops the third The
quickly. section represents
width of these the total de-
sections
total discharge
discharge of the of the battery,
whenwhen the voltage
dropsdrops quickly. The width of these sections
pends on
depends on the battery,
the battery type.
battery type. the voltage quickly. The width of these sections de-
pends on the battery type.
Battery Voltage(V)
Battery Voltage(V)

(a) (b)
(a) (b)
Figure 9. (a) Discharge curve (Q-V); (b) Discharge curve (Hours-V).
(a)Discharge
Figure9.9.(a)
Figure Dischargecurve
curve(Q-V);
(Q-V);(b)
(b)Discharge
Dischargecurve
curve(Hours-V).
(Hours-V).

To To estimate
estimate thethe
statestate of charge
of charge of battery
of the the battery
(SoC),(SoC), the well-known
the well-known Coulomb
Coulomb count-
counting
Tomethod
ing estimateistheusedstate oftocharge of the battery (SoC), the well-known Coulomb count-
method is used due todue its simplicity.
its simplicity. It on
It relies relies on measuring
measuring the current
the current and
and the the estima-
estimation
ing tion
method
of theis used
initialdue toof its simplicity. It battery.
relies on measuring the current and the estima-
of the initial state ofstate
charge charge of the
of the battery.
tion of the initial state of charge of the battery.
𝑆𝑜𝐶 𝑡 = 𝑆𝑜𝐶 −1 Z t 𝑖 𝑡 𝑑𝑡 ∗ 100 (6)
𝑆𝑜𝐶(t𝑡) =
SoC = SoC
𝑆𝑜𝐶0 − − 𝑖 ibatt (𝑡t)𝑑𝑡
dt ∗∗ 100
100 (6)
(6)
Cnom t0
4.3. Power Electronics
4.3.Power
4.3. PowerElectronics
Electronics
Figure 10 illustrates the simplified PV system architecture, comprising a solar panel,
Figure10
10illustrates
illustratesthe
thesimplified
simplifiedPV
PVsystem
systemarchitecture,
architecture,comprising
comprisingaasolar
solarpanel,
panel,
a a Figure
battery
battery forfor energy
energy backup,
backup, and
and power
power converters
converters (MPPT
(MPPT regulator)
regulator) that
that connect
connect these
these
a battery for energy
components to backup,
the DC and power converters (MPPT regulator) that connect these
load.
componentsto
components tothe
theDC
DCload.
load.

Figure 10. Simplified PV system architecture.


Figure
Figure10.
10.Simplified
SimplifiedPV
PVsystem
systemarchitecture.
architecture.
We determined the converter topology based on the current state of the art since it
Wenot
was determined thethe
specified by converter topology
manufacturer. based on the
Photovoltaic current
energy state of relies
harvesting the art since it on
primarily
wasirradiance
not specified by the manufacturer. Photovoltaic energy harvesting relies primarily
and solar panel temperature, resulting in variable PV voltage. Therefore, onim-
irradiance and solar
plementing panelPower
Maximum temperature, resulting(MPPT)
Point Tracking in variable PV voltage.
is essential Therefore,
to maximize im- ex-
power
plementing Maximum Power Point Tracking (MPPT) is essential to maximize power
traction regardless of weather conditions. A DC-DC converter is used to enable voltage ex-
traction regardless of weather conditions. A DC-DC converter is used to enable voltage
Sensors 2023, 23, 5646 11 of 23

We determined the converter topology based on the current state of the art since it
was not specified by the manufacturer. Photovoltaic energy harvesting relies primarily
Sensors
Sensors2023,
2023,23,
23,xxFOR
FORPEERon
PEER irradiance and solar panel temperature, resulting in variable PV voltage. Therefore,1111ofof2323
REVIEW
REVIEW
implementing Maximum Power Point Tracking (MPPT) is essential to maximize power
Sensors 2023, 23, x FOR PEER REVIEW extraction regardless of weather conditions. A DC-DC converter is used to enable voltage 11 of 23

adjustment
performsfrom the photovoltaic panels to match the battery voltage. This converter
performsstep-up
step-upand andstep-down
step-downfunctions
functionsby bycontrolling
controllingthetheinput-to-output
input-to-outputvoltagevoltagera- ra-
performs
performs step-up and step-down functions by controlling the input-to-output voltage
tiostep-up
tio throughand
through thestep-down
the variation functions
variationofof the by controlling
theconverter
converter switching
switching the input-to-output
device’s
device’s on-off
on-offduty voltage
duty cycle.
cycle.ra-
Another
Another
ratio
tio throughthe
through the variationofofthe theconverter
converterswitching
switchingdevice’s
device’s on-off
on-off duty
duty cycle.
cycle. Another
Another
convertervariation
converter isisrequired
requiredtotosupply
supplyand
andregulate
regulatethe thevoltage
voltagefor
forthe
theDCDCload.
load.In Inthe
theliterature,
literature,
converter
converter is
is required
required to
to supply
supply and
and regulate
regulate the
the voltage
voltage for
for the
the DC
DC load.
load. In
In the
the literature,
literature,
this configuration is commonly referred to as a two-stage DC-DC converter (Figure 11), as
this configuration is commonly referred to as a two-stage DC-DC converter (Figure 11), as 11), as
this configuration is commonly referred to as a two-stage DC-DC converter (Figure
this configuration
reported
reported in is commonly
[46]. referred to as a two-stage DC-DC converter (Figure 11), as
reported in [46]. in [46].
reported in [46].

Figure
Figure11.
11.Topology
Topologyofofstand-alone
stand-alonehybrid
hybridPV
PVsystem.
system.

Figure 11.
Figure 11.
4.4.Topology
EMR
4.4.Topology of stand-alone
of stand-alone
EMRRepresentation
Representation hybrid
ofofhybrid
the PV system.
theDigital
PV
Digitalsystem.
Replica
Replica
In
Inthetheproposed
proposed system, the
thebattery
batteryimposes
imposesaaconstantconstantvoltage,
voltage,and andthe thePVs PVsrelates
4.4.
4.4. EMR
EMR Representation
Representation of thesystem,
of the Digital
Digital Replica
Replica relates
totothe
the battery through the buck converter. It enables effective Maximum PowerPoint
battery through the buck converter. It enables effective Maximum Power Point
In the
the proposed
InTracking proposed system,
system, the
thebattery
battery imposes
imposes a aconstant
constant voltage,
voltage, andand thethePVs PVsrelates
relates to
Tracking (MPPT)
(MPPT) control
control for
for the
the PVPV panels.
panels. Moreover,
Moreover, RC
RC (𝑅
(𝑅 ,𝐶
, 𝐶 ) )and
and RLRL (𝑅(𝑅 ,𝐿
, 𝐿 ))
the battery
to the batterythroughthroughthe buck
the converter.
buck It enables
converter. effectiveeffective
Itthe
enables Maximum Power Point
Maximum Power Tracking
Pointcurrent
filters
filters are inserted
areforinserted between the PV and buck converter to reduce voltage and
(MPPT)
Tracking control
(MPPT) the PVbetween
control panels.
for theisPV
the PV andRC
Moreover,
panels. with
the(R buck, Cconverter
Moreover, cpv RC pv ) (𝑅
and RL ,𝐶
to (R
reduce
l pv , LRL
) and
voltage
filters,and
pv ) (𝑅 𝐿are
current
) ,𝐿 )
Finally, , 𝐿 )
ripple.
ripple. Finally,
Finally, the
the battery
battery isconnected
connected with the
the DC
DC Load
Load via
via aachopper
chopper and
and aaRL RL (𝑅(𝑅
inserted between
filters filter.
are inserted thebetween
PV and the the buck
PV and converter
the buck to reduce
converter voltage and current
to reduce voltage ripple.
and current
the filter.
battery is connected with the DC Load viathe
a chopper and a RL (Rldc , Land
ripple. Finally, the battery isMacroscopic
connected with DC Load via dc ) filter.
a RL (𝑅for ,organizing
𝐿 )
EMR
EMR (Energetic
(Energetic Macroscopic Representation)
Representation) isisaaagraphical
chopper
graphical formalism
formalism for organizing
EMR (Energetic Macroscopic Representation) is a graphical
filter. models and control of subsystems within a complete system [47]. The advantage of the formalism for organizing
models models
and and control
control of of subsystems
subsystems within awithin
completea complete
system system
[47]. The[47]. The advantage
advantage of the of the
EMR
EMR (Energetic
formalism Macroscopic
lies in its Representation)
ability to provide ais a graphical
comprehensive formalism
and for organizing
systematic approach for
EMR EMR
formalism formalism
lies in lies
its in its ability
ability to provide to provide
a complete a comprehensive
comprehensive and and
systematic systematic
approach approach
for for
models and
modeling controland of subsystems
analyzing complexwithin a
energy systems. system [47].
Firstly, The
each advantage
component of
is the
translated
modeling modeling
and analyzingand analyzing complex energy systems. Firstly, each component is translated
EMR formalism
into EMR lies in its complex
ability to energy
providesystems.
aand Firstly, each
comprehensive andcomponent
systematic is translated
approach for
into EMR EMRelements,
intoelements, elements,
and their and
and their
theirinputs
inputs inputs
and andoutputs
outputs outputs are
are definedaredefined
defined
according according
according totothe
to the causality thecausality
causality
modeling and
principle analyzing complex
(action/reaction). energy
Moreover, systems.
the Firstly, each component is translated
principle principle (action/reaction).
(action/reaction). Moreover, Moreover,
the systemthesystem
system isisdecomposed
is decomposed decomposedinto basicinto basic
basicsubsystems
intosubsystems subsystems
into EMRwith elements, andusing their inputs and outputs (orange
are defined according to the causality
withinteractions
with interactions interactions usingcolored
using colored colored
pictogramspictograms
pictograms
(orange(orange and
and green). andgreen).
green). Furthermore,
Furthermore,Furthermore,the control the
thecontrol
control
principle
blocks(action/reaction).
are depicted as Moreover,
blue the system Table
parallelograms. is decomposed
5 depicts theinto
mainbasic EMR subsystems
elements.
blocks are depicted as blue parallelograms. Table
blocks are depicted as blue parallelograms. Table 5 depicts the main EMR elements. 5 depicts the main EMR elements.
with interactions using colored pictograms (orange and green). Furthermore, the control
blocksTable
are
Table depicted
5.5.Some as
Someelementsblue parallelograms.
elements ofofEMR
EMRand andof Tablepictograms
ofcontrol
control 5 depicts the
pictograms [48]. main EMR elements.
[48].
Table 5. Some elements of EMR and of control pictograms [48].
Pictrograms
Pictrograms
Table 5. Some elements Pictograms
of EMR and of control pictograms [48].PictogramsSignificance
Significance
Pictrograms Pictograms Significance
Pictrograms Pictograms Significance
Source
Sourceof
ofenergy
Source of energy
energy

Source of energy
Element
Elementwith
withenergy
Element accumulation
with energy
energy accumulation
accumulation

Element with energy accumulation


Coupling
Coupling
Coupling devicesdevices
devices for for energy
forenergy
energy distribution
distribution
distribution

Coupling devices for energy distribution


Control
Controlbloc
blocwithout
withoutenergy
energyaccumulation
accumulation

Control bloc without energy accumulation


Control
Controlblock
blockwith
withcontroller
controller

Control block with controller


Strategy
Strategyblock
block
Pictrograms
Pictrograms Pictograms
Pictograms Significance
Significance
Pictrograms Pictograms Significance

Source
Source of
of energy
energy
Source of energy

Sensors 2023, 23, 5646 12 of 23


Element
Element with
with energy
energy accumulation
accumulation
Element with energy accumulation

Table 5. Cont. Coupling


Coupling devices
Coupling devices for
devices for energy
for energy distribution
energy distribution
distribution
Pictrograms Pictograms Significance

Control bloc
bloc without
ControlControl
without energy accumulation
energy energy
accumulation
Control bloc bloc without
without energy accumulation
accumulation

Control block
block with
ControlControlwith controller
controller
block with controller
Control block with controller

Sensors
Sensors2023,
2023,23,
23,xxFOR
FORPEER
PEERREVIEW
REVIEW Strategy block
StrategyStrategy
block block 12
12 of
of 23
23
Strategy block

Based
Based on
Basedon the
onthe information
theinformation
informationon on all
onall parts
allparts of
partsof the
ofthe demonstrator
thedemonstrator
demonstratorandand hypothesis,
andhypothesis,
hypothesis,thethe EMR
theEMR
EMR
(Energetic
(Energetic Macroscopic Representation) of the studied system is designed. The modeling
(EnergeticMacroscopic
MacroscopicRepresentation)
Representation)of ofthe
thestudied
studiedsystem
systemisisdesigned.
designed.TheThemodeling
modeling
methodologyand
methodology and theEMREMR organizationmethod
method are provided
provided in [49].
[49]. InFigure
Figure 12, the
the
methodology and the the EMR organization
organization method are are provided inin [49]. In
In Figure 12,
12, the
entire
entire EMR organization of the Digital model is depicted.
entireEMR
EMRorganization
organizationofofthe
theDigital
Digitalmodel
modelisisdepicted.
depicted.

Figure
Figure12.
12.EMR
EMRof the studied hybrid
hybridsystem.
Figure 12. EMR of
of the
the studied
studied hybrid system.
system.

The
Thecontrol
The controlchains
control chainsare
chains arededuced
are deducedusing
deduced usinginversion
using inversioncontrol
inversion controltheory
control theory[50]
theory [50]where
[50] wherethe
where thecontrol
the control
control
structure of a system is considered as
considered as
structure of a system is considered an
as an inverse
an inverse model
inverse model of
model of the
of the system
the system (Figure
system (Figure 13).
(Figure 13).
13).

Figure
Figure 13.
Figure13. Inversion-basedcontrol
13.Inversion-based
Inversion-based controlprinciple.
control principle.
principle.

Thetuning
The
The tuningpaths
tuning paths(yellow
paths (yellowlines
(yellow lines
lines inin
in Figure
Figure
Figure 14)
14)
14) are
are
are defined
defined
defined according
according
according to to
thethe
to the follow-
following
following
ing objectives:
objectives:
objectives:
1. Extract themaximum
1.1. Extract maximum ofthe the solarpower
power byacting
acting onchopper
chopper 1 tofind
find theoptimal
optimal
Extractthe
the maximumof of thesolar
solar powerby by actingon on chopper11to
to findthethe optimal
solar panelsvoltage;
solar voltage;
solarpanels
panels voltage;
2. Satisfy
2.2. Satisfy the DC load demandby by actingon on chopper2.2.
Satisfythe
theDC
DCload
loaddemand
demand byacting
acting onchopper
chopper 2.
The control scheme of the hybrid system is obtained by inverting the EMR element by
element according to the tuning chains (see lower part of Figure 14).
Conversion elements are inverted directly as they have no time-dependence behavior.
The accumulation elements (rectangle with forward slash) cannot be inverted physically to
avoid derivation. Thus, an indirect inversion is made by using IP controller. Table 6 shows
three examples of direct and indirect inversion.
Figure 13. Inversion-based control principle.

The tuning paths (yellow lines in Figure 14) are defined according to the following
objectives:
1. Extract the maximum of the solar power by acting on chopper 1 to find the optimal
Sensors 2023, 23, 5646 13 of 23
solar panels voltage;
2. Satisfy the DC load demand by acting on chopper 2.

Sensors
Sensors 2023,
2023,
Sensors
Sensors 23,23,
Sensors
23,
2023,
2023, 23, xxxFOR
FOR
2023,
FOR PEER
23,PEER
PEER
x FOR
PEER REVIEW
x FOR PEER REVIEW
REVIEW
REVIEW 13 13
13 of 23
of 23 2313 of 23
23
of
Sensors
Sensors 2023, 23, x FOR 2023,
PEER x REVIEW
23,REVIEW
FOR PEER REVIEW 13 of
13 of 23 13 of 23

Figure
Figure
Figure 14.Figure
Figure
14.
14. EMR
14.
EMR
EMREMRand
and
and deduced
14.and
EMR and
deduced
deduced control
deduced
deduced control
control
controlofofcontrol
of thethe
of
the
the studied
of the
studied
studied
studied hybrid system.
studied
hybrid
hybrid
hybrid hybrid
system.system.
system.
system.
Figure
Figure 14. EMR and14. EMR
deduced and deduced
control of thecontrol
studied of hybrid
the studied hybrid
system. system.

The control
The scheme
control of the
scheme hybrid
of the system
hybrid issystem
obtained is byby inverting the EMR element
The
TheTheThe
control
control
control
control
The scheme
scheme
scheme
control
scheme of of
of
the
of
the
the
scheme the hybrid
hybrid
hybrid
hybrid of the system
system
system
system hybrid is is
is is
obtained
obtained
system
obtained isbyobtained
obtained by
by invertingby
inverting
inverting
obtained
inverting bytheinverting
the
the the
EMR
EMR
inverting
EMR
EMR the EMR
EMR element
element
element
element
the
element element
byby
by
by element
element
elementby
element according
element
according
according tothe
to
to the
according
according to
thethetuning
to
tuning
tuning the
tuning chains
tuning
chains
chains
chains (see
(see
(see(seelower
chains
lowerlower
lower part
(see
part
partlower
part ofFigure
of
of Figure
of part
Figure
Figure of14).
Figure
14).14).
14). 14).
by element according to the tuning chains
by element according to the tuning chains (see lower part of Figure 14). (see lower part of Figure 14).
Conversion
Conversion
Conversion Conversion
elements
elements
elements elements
areare
are invertedare
inverted
inverted inverted
directly
directly
directly directly
as they
as they as
have they
ashavenono have no
no time-dependence
time-dependence
time-dependence behav-behav-
behav-
ior.Conversion
The
Conversion
elements
accumulation
elements
are
elementsinverted are inverted
directly
(rectangle withasas they
directly
they
forward
have
have no no
they
slash)
time-dependence
have
time-dependence
cannot be inverted
behav-
time-dependence
behav-
physi-
behav-
ior.ior.
ior. The
TheTheior. The
accumulation
ior. The accumulation
accumulation
accumulation elements
elements
elements
accumulation elements
(rectangle
(rectangle
(rectangle
elements (rectangle
with
withwith
(rectangle with
forward
forward
forward
with forward
slash)
slash)
slash)
forward slash)
cannot
cannot
cannot
slash) becannot
be be
invertedbe
inverted
inverted
cannot be inverted
physi-physi-
physi-
physi-
inverted physi-
ior.cally
The to accumulation
avoid elements
derivation. Thus, (rectangle
anan indirect with forwardisslash)
inversion made cannot
byby using beIPinverted
controller.physi-
Table
cally
cally
cally to
to cally
to
avoid
avoid
cally to
avoid avoid derivation.
derivation.
derivation.
derivation. Thus,
Thus,
Thus,
to avoid derivation. an
an Thus,
indirect
indirect
Thus, an an
indirect indirect
inversion
inversion
inversion inversion
is
is
indirectisinversion is
made
mademade is
by
by made
using
using by
usingIP
IP using
IP IP
controller.
controller. controller.
controller. Table
controller. Table
Table
Table
cally to avoid
6Figure
shows derivation.
three examples Thus,
ofdirectan indirect
direct and inversion
indirect inversion. made by is made
using IPby using IP Table
controller. Table
66 6 shows
shows
shows 66three
14. shows
EMR
threethree three
and
examples
examples
examples examples
deduced
of
of ofcontrol
direct
direct ofof
and
and direct
the
and and
studied
indirect
indirect
indirect indirect
hybrid
inversion.
inversion.
inversion. inversion.
system.
6 shows threeshows threeofexamples
examples direct and of indirect
direct and indirect inversion.
inversion.
Table 6.
Table Direct and
6. Direct and indirect
indirect inversion
inversion of EMR
of EMR blocks.
blocks.
Table
Table
Table 6.Table
6.6.Direct
Direct
Table 6.
Direct
and
andDirect
and and
indirect
indirect
indirect indirect
inversion
inversion inversion
inversion
of
of of
EMR
EMREMR of EMR
EMR blocks.
ofblocks.
blocks.
blocks.
Table 6. Direct and6.indirect
Direct and indirect
inversion of inversion
EMR blocks. blocks.
EMR and Based Inversed
EMR and Based Inversed
System System
System Equations
Equations
Equations Block Diagrams
Block Diagrams
Block
System
System
System
System System Equations
Equations
Equations
Equations Equations Block
Block
Block
Block Block Diagrams
Diagrams
Diagrams
Diagrams
Diagrams
Based Control
Diagrams Based Control

𝑽𝑉𝑉𝑉 ___
𝑉
𝒎𝑚𝑚 =𝑉= 𝒃𝒂𝒕_𝒎𝒆𝒂𝒔
𝑚 = 𝑉 __
𝑚 =
=
𝑚 𝒃𝒄𝟏= m𝑽bc1 𝑚 =
_ = Vbat_meas
𝑉
𝑉
𝑉 𝑉𝒃𝒄𝟏_𝒓𝒆𝒇
Chop-
Chop-
Chop- Chop-
Chop-
Chopper1 ___ bc1_ref𝑉 __
V
Chop- _𝐼 ILpv
𝐼
m𝑰bc1
𝐼=𝐼𝑳𝒑𝒗
per1
per1 per1
per1
per1 = I
bc1= 𝐼
per1 per1 𝒎𝑚𝑚 == 𝑚𝑚 =
𝒃𝒄𝟏
𝑚 = 𝑰𝐼𝒃𝒄𝟏 𝐼 𝐼𝐼
𝐼 𝐼

𝟏1 1
1 𝑅1 𝑅
1
𝐻 𝑠 = 𝐻𝑹
𝑅𝑅𝒍𝒅𝒄
𝑠 (R ) 𝑅
=
RLRL filter 𝑯 𝒔𝑠𝑠 == 𝑅 1

𝐻 𝐻𝐻
𝑠 = =H(𝐻
RL
RL filter
filter 𝑠𝐿𝐿𝐿 =ldc
RLRL
RL filter
filter 𝐿
RL filter filter s) 𝑳
=
filter 𝒅𝒄1+ RL1𝑠 𝑅𝐿 𝑠𝑠
𝟏11 𝐿 𝑅 𝒔1
𝑹𝑅𝑅𝒍𝒅𝒄𝑠 𝑠ldc
dc s

1 𝑅
𝑅

𝑹𝑅 𝑅
RC filter RC = 𝐻
𝑯𝐻𝐻𝒔𝑠𝑠 == 𝑅 𝑠𝑅𝒄𝒑𝒗= 𝑅
RC
RCRC filter RC filter
filter
filter 𝐻 𝑠
1(s)𝑹= 𝑅 = 𝐶
1 𝑠𝑅 𝐶
𝐻 𝑠 = 𝟏1 𝐶 𝑠𝑠
RC filterRC filter filter 1 𝑅𝑅 𝑪
𝐶
R
𝐶cpv
𝒔𝑠𝑠
1+R1
𝑠 Cpv𝑅
H
1 𝑅 𝒄𝒑𝒗 𝒑𝒗
𝐶 cpv s

The MPPT (Maximum Power Point Tracking) algorithm is widely used in PV sys-
tems.
TheInMPPT
this study, the Perturb
(Maximum Powerand Observe
Point (P&O)
Tracking) methodisiswidely
algorithm implemented. As systems.
used in PV shown in
InFigure 15a, the
this study, the power
Perturbcurves versus the
and Observe PV panels
(P&O) methodoutput voltage present
is implemented. maximum
As shown in
power
Figure points
15a, (empty
the power circles).
curves A Perturb
versus and Observe
the PV panels Maximum
output voltage Power
present Point Tracking
maximum power
strategy
points [51]circles).
(empty is implemented
A Perturbtoand
define the reference
Observe Maximum voltage
Powerimposed on PVstrategy
Point Tracking panels to ob-
[51]
istain
implemented
the maximalto define the reference
PV power whatevervoltage imposedand
the irradiance on PV panels to obtain
temperature the maximal
are (Figure 15b). The
P&O algorithm begins by sensing PV voltage and current voltage. The value of the current
power (V(k) X I(k)) is then compared to the previous power measurements. If the differ-
ence between the two measurements is equal to zero, then the value of the voltage is used
as a reference to control the PV voltage thanks to the chopper. If the value of the difference
Sensors 2023, 23, 5646 14 of 23

PV power whatever the irradiance and temperature are (Figure 15b). The P&O algorithm
begins by sensing PV voltage and current voltage. The value of the current power (V(k) X
I(k)) is then compared to the previous power measurements. If the difference between the
two measurements is equal to zero, then the value of the voltage is used as a reference to
control the PV voltage thanks to the chopper. If the value of the difference is not equal to
zero and if an increase in PV voltage generates an increase in power, this means that there
is a convergence to MPP (Maximum Power Point). However, if the power decreases, the
Sensors 2023, 23, x FOR PEER REVIEW 14 of 23
PV voltage reference must be reduced to converge to the MPP. The developed algorithm
Sensors 2023, 23, x FOR PEER REVIEW 14 of 23 is
implemented by the MPPT strategy block (dark blue block) as shown in Figure 15a.
Ppv (W)

Ppv (W)

(a) (b)
(a) (b)
Figure 15. (a) PV Power versus solar panel voltage for different irradiance (T = 25°) (b)
◦ ) Flowchart of
Figure 15. (a) PV Power versus solar panel voltage for different
different irradiance
irradiance (T
(T == 25
25°) (b) Flowchart of
perturb and observe algorithm.
perturb and observe algorithm.
The following figure (Figure 16) presents the implemented digital model under
following figure
figure(Figure 16)16)
presents the the
implemented digital modelmodel
under MAT-
MATLABfollowing
The Simulink thanks (Figure
to a Simulink presents implemented
library containing digital
the EMR basic pictograms.under
LAB Simulink thanks to a Simulink library containing the EMR basic pictograms.
MATLAB Simulink thanks to a Simulink library containing the EMR basic pictograms.

Figure 16. MATLAB Simulink model of the studied hybrid system and its control.

Figure 16.evaluate
FigureTo
16. MATLAB Simulink
MATLABthe model
model of
effectiveness
Simulink of the
of thestudied
the hybrid
developed
studied system
digital
hybrid and its
model,
system and its control. have been
simulations
control.
carried out with real-time solar irradiance and temperature data (Figure 17a) for a typical
dayTo
To evaluate
(30evaluate theThe
the
June 2022). effectiveness
effectiveness of the
of
digital model the developed
candeveloped digital
be run and digital model,
model,
connected simulations
simulations
to real time weather have
have been
been
con-
carried
ditionsout withtoreal-time
thanks Simulinksolar irradiance
Desktop and This
Real Time. temperature data (Figure
latter provides a real-time for a typical
17a) kernel for
day (30
(30 June
executingJune 2022).
2022).The
Simulink Thedigital
models on amodel
digital model
laptopcan be be
orcan runrun
desktop and connected
and
running to real
connected
Windows timeOS
to Mac
or real weather
time con-
X. weather
ditions thanks
conditions to Simulink
thanks Desktop
to Simulink DesktopRealReal
Time. ThisThis
Time. latter provides
latter a real-time
provides kernel
a real-time for
kernel
executing
for executingSimulink models
Simulink on aonlaptop
models or desktop
a laptop running
or desktop Windows
running Windows or Mac OS OS
or Mac X. X.
Sensors 2023, 23, x FOR PEER REVIEW 15 of 23

Sensors 2023, 23, x FOR PEER REVIEW 15 of 23


Sensors 2023, 23, 5646 15 of 23

400 18 80
Pv Power(W)
Battery power(W))
400
350 18
17.5 6080
DC load power(W)
Pv Power(W)
Battery power(W))
350
300 1717.5 4060 DC load power(W)

300
250 17
16.5 2040

250
200 1616.5 020

200
150 16
15.5 -20 0

150
100 1515.5 -20
-40

100
50 15
14.5 -40
-60

050 1414.5 -60


-80
Jun 30, 00:00 Jun 30, 06:00 Jun 30, 12:00 Jun 30, 18:00 0 5 10 15 20

0 2022 14 -80 Time [h]


Jun 30, 00:00 Jun 30, 06:00(a)Jun 30, 12:00 Jun 30, 18:00 0 5 10 15 20
(b)
Time [h]
2022
(a)
Figure 17. (a) Monitored irradiance and temperature profiles; (b)
(b) PV, battery, and load power
curves.
Figure 17. (a) Monitored irradiance and temperature profiles; (b) PV, battery, and load power
Figure 17. (a) Monitored irradiance and temperature profiles; (b) PV, battery, and load power curves.
curves.
Figure 17b shows simulation results of 𝑃 , 𝑃 , 𝑃 . PV panels cannot provide
Figure
enough Figure
17b shows
energy17b feedsimulation
toshows the DC load
simulation
results
(𝑃 of
results 𝑃Ppv𝑃, =P,bat
< of 10𝑃W)
PDClbefore
, W) . PV panels
𝑃 . PV
, before thepanels
timecannot
0.1 s, provide
cannot 6:30 AM.
provide
enough
Thus, energy
the batteryto feed the
provides DC
the load
DC (P
loadpv < P
duringDCl =
this10 period. Afterthe time
6:30 0.1
a.m., s,
the 6:30 a.m.
photovol-
enough
Thus, energyprovides
the battery to feed the DC load
the DC (𝑃 < this
loadduring 𝑃 period.
= 10 W) before
After the
6:30the
a.m.,time
the 0.1 s, 6:30 AM.
photovoltaic
taic panels
Thus, the begin toprovides
battery produce electricity
the DC load and
duringthe battery
this provides
period. After 6:30 difference
a.m., the to satisfy
photovol-
panels begin to produce electricity and the battery provides the difference to satisfy the
the battery.
taic panels When PV power exceeds the load demand, the battery is charging.
battery. WhenbeginPV power to produce
exceeds electricity
the load anddemand,the battery provides
the battery the difference to satisfy
is charging.
Figure 18a
theFigure
battery. shows power
simulation for 𝐼 , 𝐼 , 𝐼the battery
results load while Figure 18b shows the
18aWhen
showsPV simulation exceeds
resultsthe
for I pv , Idemand, is charging.
bat , IDCl while Figure 18b shows the state
state of charge
Figure ofshows
the battery. The battery isfor discharging
, 𝐼 ,PV
𝐼 when when PV panels
𝐼 panels Figureoutput is insuf-
of charge of the18abattery. Thesimulation
battery isresults
discharging while output is18b shows
insufficient, the
ficient,
state and
of it
charge is charging
of the when
battery. PV
The power
battery is
ishigher than
discharging DC load
when PVdemand.
panels output is insuf-
and it is charging when PV power is higher than DC load demand.
ficient, and it is charging when PV power is higher than DC load demand.
Current[A]
Current[A]

(a) (b)
(a) (b)charge.
Figure 18. (a) PV, Battery, and DC load currents; (b) Battery state of
Figure 18. (a) PV, Battery, and DC load currents; (b) Battery state of charge.
Figure 18. (a) PV, Battery, and DC load currents; (b) Battery state of charge.
5.5.Experimental
ExperimentalResults
Resultsand
andDiscussion
Discussion
Real-timemeasurements
Real-time
5. Experimental measurements werecarried
Results andwere carriedout
Discussion outtotoshow
showthe theeffectiveness
effectivenessofofthe theproposed
proposed
unified
unified Real-time measurements were carried out to show the effectiveness of themeasure-
framework,
framework, where
where the
the three
three electromagnetic
electromagnetic relays
relays are
are activated.
activated. These
These measure-
proposed
ments
ments are
aresubsequently
subsequently compared
compared ininreal
realtime
timewith
withthe thedigital
digitalmodel data, data,as
asoutlined inin
unified framework, where the three electromagnetic relays aremodel
activated. Theseoutlined
measure-
Figure
Figure 1.
ments 1. are subsequently compared in real time with the digital model data, as outlined in
The
Theapplied solar irradiance is presented in Figure 19. From the figure, we can see
Figure 1.applied solar irradiance is presented in Figure 19. From the figure, we can see
that
thatthe
theartificial source causes
causesa aslight delay
delayand behaves like a afirst-order system with
Theartificial
appliedsource
solar irradiance slight
is presented and behaves19.
in Figure like
From first-order system
the figure, with
we can see
non-linear behavior depending on the increase or decrease in light. This is due to the
that the artificial source causes a slight delay and behaves like a first-order system with
light dimmer.
Sensors 2023, 23, x FOR PEER REVIEW
non-linear behavior depending on the increase or decrease in light. This is due to the1
dimmer.

Sensors 2023, 23, 5646


non-linear behavior depending on the increase or decrease in light. This16isof due
23
to th
dimmer.

Irradiance[W/m²]
Irradiance[W/m²]

Figure 19. Applied solar irradiance (artificial light source).

Figure 20 represents the measured PV current and the PV numerical model,


lighting
Figure a slight
Figure19.
19. Applied
Applied deviation
solar
solar observed
irradiance
irradiance in the
(artificial
(artificial light illumination
light
source). source). levels around 300 W/m². Thi
ference is due to both the approximation of the mathematical model and the non-uni
Figure 20 represents the measured PV current and the PV numerical model, highlight-
illumination
Figure of 20the PV panels.
represents theFurthermore,
measured PVit current should beand noted thatnumerical
the PV the maximum
ing a slight deviation observed in the illumination levels around 300 W/m2 . This difference
rel
model,
error is approximately
lighting
is due toaboth
slight deviation6%, and
the approximation themathematical
observed
of the maximum absolute
in the illumination
model error isaround
levels
and the around
non-uniform 0.1,W/m².
300 whichTh
illumina- is
sidered
tion oflow.
ference is due
the to both
PV panels. the approximation
Furthermore, it should beof the that
noted mathematical
the maximum model and
relative the
error is non-un
approximatelyof
illumination 6%, and
the PV thepanels.
maximum absolute erroritis should
Furthermore, around 0.1,
be which
notedisthat
considered low.
the maximum re
error is approximately 6%, and the maximum absolute error is around 0.1, which i
sidered low.

Figure 20.
Figure 20.Digital modelPV
Digital model PV current
current vs measured
vs measured PV current
PV current.

In Figure 21, the measured and digital model load currents are depicted. The tests
In Figure 21, the measured and digital model load currents are depicted.
were initiated by activating a single lamp and subsequently both lamps. This led to an
The
were
Figureinitiated
the by
20.inDigital
increase activating
DCmodel
currentPV a0.23
single
current
from Avs lampA. and
tomeasured
0.46 PVsubsequently
current both lamps. This led
increase in the DC current from 0.23 A to 0.46 A.
In Figure 21, the measured and digital model load currents are depicted. Th
were initiated by activating a single lamp and subsequently both lamps. This led
increase in the DC current from 0.23 A to 0.46 A.
nsors 2023, 23, x FOR PEER REVIEW

nsors 2023, 23, x FOR PEER REVIEW

Sensors 2023, 23, 5646 17 of 23

Figure 21. Digital model vs measured load currents

Figure
Figure 21.Digital
21. Digital
Measured model
and
model vs measured
vsdigital
measuredmodel load currents
battery
load currents. currents are depicted in Figure 22
current refers and
Measured to adigital
battery discharge,
model whileare
battery currents a negative
depicted in current
Figure 22.refers to the cha
A positive
Measured and digital model battery currents are depicted in Figure 2
current refers to a battery discharge, while a negative current refers to the charging phase.
current refers to a battery discharge, while a negative current refers to the cha

Figure
Figure 22. Digital
22. Digital model
model battery
battery currentcurrent vs battery
vs measured measured battery current.
current.

Figure 23 represents PV power, battery power and DC load power, respectively. From 0
Figure s, 22.
to 50Figure Digital model
powerbattery
23 represents
the demanded PVcurrent
is higher the vs
power,
than measured
PVbattery batteryand
power
power. The battery is current.
thenDC load power, r
in discharging
mode.0However,
From to 50 s, when the PV power is
the demanded higher is
power than the demanded
higher than theDC PV
power, the battery
power. The batte
Figure mode.
is charging.
discharging
The23 represents
comparison
However, PVwhen
between power,
real data battery
and
the PV
the power
digital
power and than
model data
is higher DC the
showsloaddemanded
a goodpower,
correlation between them. Indeed, the maximum relative deviations between the real and
From
the 0model
to 50
battery
digital
s,charging.
isdata the demanded
The
are 8% for PV
power
comparison
power,
is higher
between
12% for battery
thanreal
power, and
the PV
2%data
power.
and
for load the
power.
The batte
digital
discharging
shows a good mode. However,
correlation when the
between them.PV Indeed,
power isthehigher than therelative
maximum demande de
the battery is charging. The comparison between real
tween the real and digital model data are 8% for PV power, 12% for battery data and the digital
shows
2% a good
for load power.correlation between them. Indeed, the maximum relative de
tween the real and digital model data are 8% for PV power, 12% for battery
2% for load power.
Sensors 2023, 23, x FOR PEER REVIEW 18 of 23
Sensors 2023, 23, 5646 18 of 23

Sensors 2023, 23, x FOR PEER REVIEW 18 of 23

Figure
Figure 23. Digital
23. Digital modelmodel
data data vs measured
vs measured PV, battery,
PV, battery, and and
loadload power.
power
Figure 23. Digital model data vs measured PV, battery, and load power
To establish
To establish a feedback
a feedback loop loop between
between thethe virtual
virtual andand realword
real wordofofthe thedigital
digitaltwin,
twin, we
implement an energy To establish aalgorithm
management feedback loop in between the
MATLAB virtual and
Simulink. The real word ofenergy
rule-based the digital twin
we implement an energy management
we implement algorithm
an energy in MATLAB
management algorithmSimulink.
in MATLABThe rule-based
Simulink. The rule-based
management
energy management algorithm sends
algorithm control
sends signals
control to the
signals to PLC
the (s7 1200).
PLC The advantage
(s7 1200). of using
energy management algorithm sends control signals to theThe
PLCadvantage
(s7 1200). The advantage
a rule-based control approach
of using a rule-based control is its ease of implementation in real-time [52]. The flowchart
of usingapproach
a rule-based is control
its easeapproach
of implementation
is its ease of in real-time [52].
implementation in The
real-time [52]. The
of the of
flowchart energy management
the energy management
flowchart
algorithm ismanagement
algorithm
of the energy
illustrated in Figure
is illustrated 24. It24.
in Figure
algorithm
receives measurement
It receives
is illustrated in Figuremeas-
24. It receives meas-
data as inputs and generates
urement data asrelay controlgenerates
inputs signals as outputs, which are subsequently
urement data as inputs and generates relayand control signals relayascontrol
outputs, signals
which as outputs,
are subse-which are subse-
transmitted to thequently
PLC. transmitted to the PLC.
quently transmitted to the PLC.

Figure 24. Rule-based algorithm flowchart.


Figure 24. Rule-based algorithm flowchart.

The energy management system generates five different modes. They are described in
Figure 24. Rule-based algorithm flowchart.
Table 7.
Sensors 2023, 23, 5646 19 of 23

Table 7. Different modes of the energy management system.

Modes Load Chopper 1 Chopper 2 Battery


Mode I: When the battery SOC reaches 96%, which indicates a nearly
full charge, the system is operating in float mode. At this point, the PV
power output is greater than the load demand. Therefore, the battery
ON FLOAT ON Float
should not continue to charge, and the Victron regulator automatically
switches to a lower charge voltage mode called float mode to maintain
the battery charge level and prevent overcharging.
Mode II: This mode is activated when the battery’s SOC is within the
normal range of 40 to 96 % and the power generated by the PV panels is
lower than the load demand. In such a scenario, the PV panels alone are
unable to meet the load requirement, and hence the battery is used to ON MPPT ON Discharge
supplement the power supply. The battery operates in the discharge
mode, while the PV converter operates in the MPPT mode, and the load
remains connected.
Mode III: This mode is activated when the battery’s SOC is within the
normal range of 40 to 90 percent and the power generated by the PV
panels is higher than the load demand. In such a scenario, the load is
ON MPPT ON Charge
powered solely by the PV panels, and any surplus power is utilized to
charge the battery. The battery operates in the charging mode, while the
PV converter remains in the MPPT mode.
Mode VI: This mode is activated when the battery’s SOC drops below
40%, and the power generated by the PV panels is higher than the
minimum power required, which is a fixed small value. In such a
scenario, the load demand exceeds the PV power output, and the fully
discharged battery cannot supplement the power supply. However, the OFF MPPT OFF Charge
PV panels can still generate power, which can be used to charge the
battery after the load is disconnected. In this mode, the PV converter
operates in the MPPT mode, and the battery is charging, while the load
remains disconnected.
Mode V: This mode occurs when irradiance is very low or non-existent.
In this case, the system goes into complete off mode until solar
OFF OFF OFF OFF
radiation starts again. The battery charges during the day and is ready
to supply the load in case of absence of solar radiation.

To assess the effectiveness of the energy management system, the initial load is set
Sensors 2023, 23, x FOR PEER REVIEW to 112 W. Figure 25 displays the recorded external solar irradiance for a one-hour period
20 of 23
on a cloudy day. Subsequently, these data are transmitted to the dimmer, enabling the
generation of adjustable artificial lighting.
Irradiance [W/m²]

Figure 25.25.
Figure Measured irradiance.
Measured irradiance.

Initially, the total power required by the load is provided by both the battery and
solar power sources, as the PV alone cannot fully support the load (Figure 26). During the
period from 0 to 757 s, the system operates in mode II.
Between 757 s and 876 s, as well as from 932 s to 1317 s, the solar irradiance remains
Figure 25. Measured irradiance.

Initially, the total power required by the load is provided by both the battery and
solar power sources, as the PV alone cannot fully support the load (Figure 26). During the
Sensors 2023, 23, 5646
period from 0 to 757 s, the system operates in mode II. 20 of 23
Between 757 s and 876 s, as well as from 932 s to 1317 s, the solar irradiance remains
below 50 W/m², leading the system to switch to mode V (system OFF). From 1317 s to 3508
s, the system once again operates in mode II. During the period from 3508 s to 3600 s, the
Initially,
load demand the totaldecreases
gradually power required by the
from 111 W toload is provided
60 W, by battery
causing the both thetobattery andless
generate solar
power sources, as the PV alone
power to meet the load requirements. cannot fully support the load (Figure 26). During the period
from 0 to 757 s, the system operates in mode II.

Power[W]

Figure 26.26.
Figure Measured PV,PV,
Measured battery, and
battery, load
and power.
load power.

Between
Figure 757 s and
27a shows 876 s, asvoltage
the battery well aswaveform,
from 932 swhile
to 1317 s, the27b
Figure solar irradiance
displays remains
the battery
below 50 W/m 2 , leading the system to switch to mode V (system OFF). From 1317 s to
State of Charge. The battery primarily operates in discharging mode, except during peri-
ods3508
whens, the
thesystem
systemonceis notagain operates(mode
in operation in mode
I). II. During the period from 3508 s to 3600 s,
the load demand gradually decreases from 111 W to 60 W, causing the battery to generate
less power to meet the load requirements.
Sensors 2023, 23, x FOR PEER REVIEW Figure 27a shows the battery voltage waveform, while Figure 27b displays the battery 21 of 23
State of Charge. The battery primarily operates in discharging mode, except during periods
when the system is not in operation (mode I).
State of Charge[%]
Voltage[V]

(a) (b)
Figure 27. (a) Battery voltage; (b) Battery state of charge.
Figure 27. (a) Battery voltage; (b) Battery state of charge.

6.6.Conclusions
Conclusions
Inthis
In thiswork,
work,we
wediscussed
discussedthe thechallenges
challengesof ofimplementing
implementingIoT IoTininrenewable
renewableenergy
energy
systems and the potential of digital twins for predicting energy production
systems and the potential of digital twins for predicting energy production and consump- and consump-
tion. We proposed
tion. proposedaaframework
frameworkthat thatcombines
combines thetheuseuse
of Internet of Things
of Internet (IoT)(IoT)
of Things and and
Dig-
ital Twin
Digital Twin(DT) technologies
(DT) technologiesfor for
standalone photovoltaic
standalone photovoltaic systems. TheThe
systems. digital twin
digital is de-
twin is
fined asas
defined thethe
combination
combination of the physical
of the system
physical systemandandits digital model,
its digital allowing
model, for bidi-
allowing for
rectional data communication. Furthermore, we designed a digital model of the PV sys-
tem by using Energetic Macroscopic Representation formalism. Experiments performed
in real time and their analysis demonstrate the effectiveness of the proposed framework.
As future work, we plan to use this platform to explore machine learning’s potential to
enhance energy management of PV systems.
Sensors 2023, 23, 5646 21 of 23

bidirectional data communication. Furthermore, we designed a digital model of the PV


system by using Energetic Macroscopic Representation formalism. Experiments performed
in real time and their analysis demonstrate the effectiveness of the proposed framework.
As future work, we plan to use this platform to explore machine learning’s potential to
enhance energy management of PV systems.

Author Contributions: Conceptualization, L.C. and A.S.; Formal analysis, L.C., A.S. and A.R.;
Methodology, L.C.; Investigation, L.C., A.S. and A.R.; Software, L.C. and A.S.; Supervision, L.C.;
Writing—original draft, L.C.; Experimental tests, L.C., Writing—review and editing, L.C., A.S. and
A.R. All authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Conflicts of Interest: The authors declare no conflict of interest.

References
1. Madeti, S.R.; Singh, S. Monitoring system for photovoltaic plants: A review. Renew. Sustain. Energy Rev. 2017, 67, 1180–1207.
[CrossRef]
2. Motlagh, N.H.; Mohammadrezaei, M.; Hunt, J.; Zakeri, B. Internet of Things (IoT) and the Energy Sector. Energies 2020, 13, 494.
[CrossRef]
3. Shrouf, F.; Miragliotta, G. Energy management based on Internet of Things: Practices and framework for adoption in production
management. J. Clean. Prod. 2015, 100, 235–246. [CrossRef]
4. Adhya, S.; Saha, D.; Das, A.; Jana, J.; Saha, H. An IoT based smart solar photovoltaic remote monitoring and control unit. In
Proceedings of the 2016 2nd International Conference on Control, Instrumentation, Energy & Communication (CIEC), Kolkata,
India, 28–30 January 2016; pp. 432–436. [CrossRef]
5. Baidya, S.; Potdar, V.; Ray, P.P.; Nandi, C. Reviewing the opportunities, challenges, and future directions for the digitalization of
energy. Energy Res. Soc. Sci. 2021, 81, 102243. [CrossRef]
6. Mukhopadhyay, S.C.; Suryadevara, N.K. Internet of Things: Challenges and Opportunities; Springer: Berlin/Heidelberg, Germany,
2014; Volume 9, pp. 1–17. [CrossRef]
7. Yu, W.; Patros, P.; Young, B.; Klinac, E.; Walmsley, T.G. Energy digital twin technology for industrial energy management:
Classification, challenges and future. Renew. Sustain. Energy Rev. 2022, 161, 112407. [CrossRef]
8. Agostinelli, S.; Cumo, F.; Guidi, G.; Tomazzoli, C. Cyber-Physical Systems Improving Building Energy Management: Digital Twin
and Artificial Intelligence. Energies 2021, 14, 2338. [CrossRef]
9. Rachid, A.; Djedjig, A. IoT and MQTT based web monitoring of a solar living laboratory. In Proceedings of the 2022 2nd
International Conference on Digital Futures and Transformative Technologies (IcoDT2), Awalpindi, Pakistan, 24–26 May 2022.
[CrossRef]
10. Voutsinas, S.; Karolidis, D.; Voyiatzis, I.; Samarakou, M. Development of an IoT power management system for photovoltaic
power plants. In Proceedings of the 2022 11th International Conference on Modern Circuits and Systems Technologies (MOCAST),
Bremen, Germany, 8–10 June 2022. [CrossRef]
11. Dinculeană, D.; Cheng, X. Vulnerabilities and Limitations of MQTT Protocol Used between IoT Devices. Appl. Sci. 2019, 9, 848.
[CrossRef]
12. Martín-Lopo, M.M.; Boal, J.; Sánchez-Miralles, A. A literature review of IoT energy platforms aimed at end users. Comput. Netw.
2020, 171, 107101. [CrossRef]
13. Han, J.; Choi, C.-S.; Park, W.-K.; Lee, I.; Kim, S.-H. PLC-based photovoltaic system management for smart home energy
management system. IEEE Trans. Consum. Electron. 2014, 60, 184–189. [CrossRef]
14. Miller, D.; Mirzaeva, G.; Townsend, C.D.; Goodwin, G.C. The Use of Power Line Communication in Standalone Microgrids. IEEE
Trans. Ind. Appl. 2021, 57, 3029–3037. [CrossRef]
15. Chouder, A.; Silvestre, S.; Taghezouit, B.; Karatepe, E. Monitoring, modelling and simulation of PV systems using LabVIEW. Sol.
Energy 2013, 91, 337–349. [CrossRef]
16. Dabou, R.; Bouraiou, A.; Ziane, A.; Necaibia, A.; Sahouane, N.; Blal, M.; Khelifi, S.; Rouabhia, A.; Slimani, A. Development
of autonomous monitoring and performance evaluation system of grid-tied photovoltaic station. Int. J. Hydrogen Energy 2021,
46, 30267–30287. [CrossRef]
17. Atia, D.M.; El-Madany, H.T.; Atia, Y.; Zahran, M.B. Real-Time Implementation of Energy Management for Photo-
voltaic/Battery/Diesel Hybrid System Based on LabVIEW. Int. J. Renew. Energy Res. 2022, 12, 1105–1116. [CrossRef]
18. Vergura, S.; Natangelo, E. Labview-Matlab Integration for Analyzing Energy Data of PV Pants. Renew. Energy Power Qual. J. 2010,
1, 1248–1252. [CrossRef]
Sensors 2023, 23, 5646 22 of 23

19. Dhillon, J.; Unni, A.; Singh, N. Design and Simulation of a PV System with Battery Storage Using Bidirectional DC-DC Converter
Using Matlab Simulink. In Proceedings of the 2022 1st International Conference on Sustainable Technology for Power and Energy
Systems (STPES), Srinagar, India, 5–6 July 2022. [CrossRef]
20. Manolakos, D.; Papadakis, G.; Papantonis, D.; Kyritsis, S. A stand-alone photovoltaic power system for remote villages using
pumped water energy storage. Energy 2004, 29, 57–69. [CrossRef]
21. Gouda, O.; Amer, G.; Elkhodary, T.; Awaad, M. Optimum Design and Implementation of Stand-alone Tracking Photovoltaic
Power System based on PLC and Microcontroller. In Proceedings of the 14th International Middle East Power Systems Conference
(MEPCON’10), Cairo, Egypt, 19–21 December 2010; pp. 119–124.
22. Kowsalya, M.; Elakya, A.; Pradeep, R. Solar Operated PLC Based Automated Irrigation System with Fault Preventer. In
Proceedings of the 7th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore,
India, 19–20 March 2021. [CrossRef]
23. Lee, J.; Lee, S.; Cho, H.; Ham, K.S.; Hong, J. Supervisory control and data acquisition for Standalone Hybrid Power Generation
Systems. Sustain. Comput. Inform. Syst. 2018, 20, 141–154. [CrossRef]
24. Mohammed, N.; Danapalasingam, K.A.; Majed, A. Design, Control and Monitoring of an Offline Mobile Battery Energy Storage
System for a Typical Malaysian Household Load Using PLC. Int. J. Power Electron. Drive Syst. 2018, 9, 180–188. [CrossRef]
25. Alphonsus, E.R.; Abdullah, M.O. A review on the applications of programmable logic controllers (PLCs). Renew. Sustain. Energy
Rev. 2016, 60, 1185–1205. [CrossRef]
26. Tao, F.; Zhang, H.; Liu, A.; Nee, A.Y.C. Digital Twin in Industry: State-of-the-Art. IEEE Trans. Ind. Inform. 2018, 15, 2405–2415.
[CrossRef]
27. Pan, H.; Dou, Z.; Cai, Y.; Li, W.; Lei, X.; Han, D. Digital twin and its application in power system. In Proceedings of the 2020 5th
International Conference on Power and Renewable Energy (ICPRE), Shanghai, China, 12–14 September 2020; pp. 21–26.
28. Fuller, A.; Fan, Z.; Day, C.; Barlow, C. Digital Twin: Enabling Technologies, Challenges and Open Research. IEEE Access 2020,
8, 108952–108971. [CrossRef]
29. Fahim, M.; Sharma, V.; Cao, T.-V.; Canberk, B.; Duong, T.Q. Machine Learning-Based Digital Twin for Predictive Modeling in
Wind Turbines. IEEE Access 2022, 10, 14184–14194. [CrossRef]
30. Agostinelli, S.; Cumo, F.; Nezhad, M.M.; Orsini, G.; Piras, G. Renewable Energy System Controlled by Open-Source Tools and
Digital Twin Model: Zero Energy Port Area in Italy. Energies 2022, 15, 1817. [CrossRef]
31. Zaballos, A.; Briones, A.; Massa, A.; Centelles, P.; Caballero, V. A Smart Campus’ Digital Twin for Sustainable Comfort Monitoring.
Sustainability 2020, 12, 9196. [CrossRef]
32. Moi, T.; Cibicik, A.; Rølvåg, T. Digital twin based condition monitoring of a knuckle boom crane: An experimental study. Eng.
Fail. Anal. 2020, 112, 104517. [CrossRef]
33. Livera, A.; Paphitis, G.; Pikolos, L.; Papadopoulos, I.; Montes-Romero, J.; Lopez-Lorente, J.; Makrides, G.; Sutterlueti, J.; Georghiou,
G.E. Intelligent Cloud-Based Monitoring and Control Digital Twin for Photovoltaic Power Plants. In Proceedings of the 2022
IEEE 49th Photovoltaics Specialists Conference (PVSC), Philadeplhia, PA, USA, 5–10 June 2022; pp. 0267–0274. [CrossRef]
34. Al-Ali, A.; Zualkernan, I.A.; Rashid, M.; Gupta, R.; Alikarar, M. A smart home energy management system using IoT and big
data analytics approach. IEEE Trans. Consum. Electron. 2017, 63, 426–434. [CrossRef]
35. Jain, P.; Poon, J.; Singh, J.P.; Spanos, C.; Sanders, S.R.; Panda, S.K. A Digital Twin Approach for Fault Diagnosis in Distributed
Photovoltaic Systems. IEEE Trans. Power Electron. 2019, 35, 940–956. [CrossRef]
36. Cheddadi, Y.; Cheddadi, H.; Cheddadi, F.; Errahimi, F.; Es-Sbai, N. Design and implementation of an intelligent low-cost IoT
solution for energy monitoring of photovoltaic stations. SN Appl. Sci. 2020, 2, 1–11. [CrossRef]
37. de Arquer Fernández, P.; Fernández, M.A.F.; Candás, J.L.C.; Arboleya, A.P. An IoT open source platform for photovoltaic plants
supervision. Int. J. Electr. Power Energy Syst. 2021, 125, 106540. [CrossRef]
38. Pereira, R.I.; Dupont, I.M.; Carvalho, P.C.; Jucá, S.C. IoT embedded linux system based on Raspberry Pi applied to real-time cloud
monitoring of a decentralized photovoltaic plant. Measurement 2018, 114, 286–297. [CrossRef]
39. Abdallah, E.L.; Ouassaid, M.; Zidani, Y. Development of a Real-Time Framework between MATLAB and PLC through OPC-UA:
A Case Study of a Microgrid Energy Management System. 2022, p. 13. Available online: https://www.researchsquare.com/
article/rs-1265626/v1 (accessed on 22 March 2022).
40. Qian, C.; Liu, X.; Ripley, C.; Qian, M.; Liang, F.; Yu, W. Digital Twin—Cyber Replica of Physical Things: Architecture, Applications
and Future Research Directions. Future Internet 2022, 14, 64. [CrossRef]
41. Transducer of, D.C. Circuit Parameters with Ethernet|Lumel. Available online: https://www.lumel.com.pl/en/catalogue/
product/transducer-of-d-c-circuit-parameters-with-ethernet-p30h (accessed on 17 June 2022).
42. Jaloudi, S. Communication Protocols of an Industrial Internet of Things Environment: A Comparative Study. Future Internet 2019,
11, 66. [CrossRef]
43. Wang, Y.-J.; Hsu, P.-C. Analytical modelling of partial shading and different orientation of photovoltaic modules. IET Renew.
Power Gener. 2010, 4, 272–282. [CrossRef]
44. Guo, S. The Application of Genetic Algorithms to Parameter Estimation in Lead-Acid Battery Equivalent Circuit Models. Master’s
Thesis, University of Birmingham, Birmingham, UK, 2010; p. 137.
45. Tremblay, O.; Dessaint, L.-A.; Dekkiche, A.-I. A Generic Battery Model for the Dynamic Simulation of Hybrid Electric Vehicles. In
Proceedings of the IEEE Vehicle Power and Propulsion Conference, Arlington, TX, USA, 9–12 September 2007; pp. 284–289.
Sensors 2023, 23, 5646 23 of 23

46. Jamshidpour, E.; Jovanović, S.; Poure, P. Equivalent Two Switches and Single Switch Buck/Buck-Boost Circuits for Solar Energy
Harvesting Systems. Energies 2020, 13, 583. [CrossRef]
47. Bouscayrol, A.; Guillaud, X.; Delarue, P.; Lemaire-Semail, B. Energetic Macroscopic Representation and Inversion-Based Control
Illustrated on a Wind-Energy-Conversion System Using Hardware-in-the-Loop Simulation. IEEE Trans. Ind. Electron. 2009,
56, 4826–4835. [CrossRef]
48. Mokhena, T.; Mochane, M.; Tshwafo, M.; Linganiso, L.; Thekisoe, O.; Songca, S. Powerful Multilevel Simulation Tool for HiL Analysis
of Urban Electric vehicle’s Propulsion Systems Raul; Intech Open: London, UK, 2016; pp. 225–240.
49. Lhomme, W.; Delarue, P.; Giraud, F.; Lemaire-Semail, B.; Bouscayrol, A. Simulation of a Photovoltaic Conversion System using
Energetic Macroscopic Representation. In Proceedings of the 15th International Power Electronics and Motion Control Conference
(EPE/PEMC), Novi Sad, Serbia, 4–6 September 2012. [CrossRef]
50. Gomand, J. Analyse de Systèmes Multi-Actionneurs Parallèles par une Approche Graphique Causale—Application a un Processus
Électromécanique de Positionnement Rapide. Ph.D. Thesis, Ecole Doctorale no. 432: Sciences des Métiers de l’Ingénieur, l’École
Nationale Supérieure d’Arts et Métiers, Paris, France, 2009.
51. Femia, N.; Petrone, G.; Spagnuolo, G.; Vitelli, M. Optimization of Perturb and Observe Maximum Power Point Tracking Method.
IEEE Trans. Power Electron. 2005, 20, 963–973. [CrossRef]
52. Mirzaei, A.; Forooghi, M.; Ghadimi, A.A.; Abolmasoumi, A.H.; Riahi, M.R. Design and construction of a charge controller for
stand-alone PV/battery hybrid system by using a new control strategy and power management. Sol. Energy 2017, 149, 132–144.
[CrossRef]

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.

You might also like