You are on page 1of 10

This article has been accepted for inclusion in a future issue of this journal.

Content is final as presented, with the exception of pagination.

IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS 1

Optimal Hierarchical Energy Management


System With Plug-and-Play Capability for
Neighborhood Home Microgrids
Kamyab Gholampour , Jafar Adabi , Hamidreza Gholinezhad , and Otaigbe Inegbedion

Abstract—With the increasing adoption of renewable en- to their reduced environmental impact [1], [2]. Consequently, the
ergy sources, researchers are actively engaged in the de- implementation of an efficient home energy management system
velopment of smart grid technologies. This study intro- (HEMS) is crucial to optimize HMG performance and increase
duces a home energy management system (HEMS) de-
signed to optimize home microgrid (HMG) operation by economic benefits, particularly in local communities [3]. HMGs
integrating electric vehicles (EVs) through a hierarchi- can also operate in island mode in the event of an upstream
cal three-level distributed control approach. The proposed grid failure [4]. To achieve an optimal and efficient HMG per-
system governs the power transfer of distributed energy formance, numerous energy management algorithms have been
sources through converter control at the primary level, proposed.
while employing an intelligent optimal power exchange
technique for EVs and energy storage (ES) at the sec- For instance, in [5], an algorithm is explored for optimizing
ondary level. To achieve optimal energy demand manage- the size of photovoltaic (PV) and energy storage (ES) in an
ment, the system employs a two-layer strategy, compris- energy management system (EMS), considering various case
ing offline and online scheduling, utilizing particle swarm studies related to the charging and discharging status of electric
optimization and artificial neural network to reduce com- vehicles (EVs). The authors in [6] presented an optimal energy
puting time. The offline scheduling formulates a determin-
istic optimization model to minimize HMG operation costs, management algorithm for industrial ESs by forecasting day-
thereby extending ES lifetime through optimal load-sharing. ahead generation and load profiles to reduce fuel, operation, and
The online scheduling approach enables real-time perfor- maintenance costs in HMGs. Similarly, in [7], a smart energy
mance under uncertainty and accommodates plug-and- management technique was proposed, utilizing deep neural net-
play renewable energy sources, HMGs, loads, and batter- work (DNN) optimization and free reinforcement learning mod-
ies. Furthermore, the proposed algorithm is tested using
MATLAB/Simulink simulations over a 24-h period, affirming eling. Furthermore, [8] presents an energy management strategy
its ability to respond promptly to HEMS status changes for demand-side response, considering real-time reductions in
and adapt decision-making methods to new conditions with ES charging and discharging. Abdolrasol et al. [9] improved
improved training time and reduced mean square error. an artificial neural network (ANN) using particle swarm opti-
In addition, experimental studies on two laboratory-based mization (PSO) to manage renewable energy resources within
HMGs demonstrate the feasibility of the proposed HEMS.
a virtual power plant system, aiming to minimize power con-
Index Terms—Artificial neural network (ANN), electric ve- sumption and prioritize sustainable resources.
hicle (EV), hierarchical energy management, home energy Hierarchical energy management has emerged as a method for
management system (HEMS), microgrids, plug-and-play,
smart charging.
uncertainty and real-time management [10]. In [11], a two-level
hierarchical model predictive controller (HMPC) was proposed
to enhance the performance of building microgrids using hybrid
I. INTRODUCTION energy storage. In addition, [12] presents a two-layer hierarchi-
HE integration of renewable energy sources into home cal HEMS to reduce daily household energy costs and maxi-
T microgrids (HMGs) has garnered significant attention due mize PV self-consumption. Several other studies have proposed
two-stage hierarchical energy management systems for smart
homes [13], [14], [15].
To address the shortcomings in existing research and im-
Manuscript received 12 April 2023; revised 2 August 2023; accepted prove the stability and power-sharing capabilities of HMGs, a
17 August 2023. (Corresponding author: Jafar Adabi.)
Kamyab Gholampour and Jafar Adabi are with the Faculty of Elec- novel hierarchical control strategy is presented in this article.
trical and Computer Engineering, Babol Noshirvani University of Tech- The proposed method focuses on the control process of power
nology, Babol 47148-71167, Iran (e-mail: k.gholampour@stu.nit.ac.ir; converters based on a three-level (Primary, Secondary, and Ter-
j.adabi@nit.ac.ir).
Hamidreza Gholinezhad and Otaigbe Inegbedion are with the Otask- tiary) HEMS architecture, considering the stochastic behavior
iES, NE8 3DF Gateshead, U.K. (e-mail: hamid.omran@otaskies.com; of EVs. The main contributions of the proposed strategy include
philip@otaskies.com). a hierarchical energy management framework for neighborhood
Color versions of one or more figures in this article are available at
https://doi.org/10.1109/TIE.2023.3319729. grids to achieve economic, flexible, and secure HMG operation
Digital Object Identifier 10.1109/TIE.2023.3319729 under the uncertainty of renewable energy sources and loads,
0278-0046 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.
See https://www.ieee.org/publications/rights/index.html for more information.

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

2 IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS

TABLE I
COMPARISON OF PROPOSED FRAMEWORK AND EXISTING LITERATURE

Fig. 1. Proposed HSEG architecture.

real-time scheduling in home-scale energy generation, efficient


power-sharing among multiple energy storage systems, and The rest of this article is organized as follows. Section II
an optimization algorithm based on online and instantaneous provides an overview of the system and discusses the proposed
data for fast real-time decisions under EV’s stochastic behavior three-level HEMS, while Section III presents the simulation and
and plug-and-play operation. The proposed algorithm also con- experimental results of various case studies. Finally, Section IV
siders ES life, avoids batteries overcharging/overdischarging, concludes the article.
minimizes costs, improves system response speed, enhances
system reliability, and offers better scalability for integrating II. PROPOSED HEMS WITH PLUG-AND-PLAY OPERATION
additional system units. The effectiveness of the proposed al-
gorithm is demonstrated through experimental evaluation on Fig. 1 illustrates the structure of HEMS with several HMGs
two laboratory-based HMGs, highlighting its efficiency and with ES, EV, and home appliances as unidirectional or bidirec-
feasibility for real-time applications. In order to compare the tional sources, which are connected to the dc link by separate dc–
proposed model with recent studies, Table I is presented. The dc converters. Further, it consists of three levels such as primary,
main contributions of the proposed strategy are as follows. secondary, and tertiary levels [19], where the reference currents
1) A hierarchical energy management framework is de- are determined according to the multiobjective optimization
signed for power-sharing among multiple energy storage algorithm. HEMS operations can be carried out using either a
systems for a neighborhood grid, achieving economic, centralized or decentralized structure, which utilizes hierarchical
maximal flexibility, and secure operation of the HMG control [20], [21], [22]. In this approach, the individual HMGs
under the uncertainty of renewable energy sources and are controlled and monitored by the owners and consumers. Each
loads. The system incorporates real-time scheduling in HMG can supply its internal loads by connecting/disconnecting
home-scale energy generation (HSEG) with a simple to/from the upstream grid, while conventional buildings (CBs)
implementation. are fed by the neighborhood grid or the upstream grid. ES power
2) An optimization algorithm based on online and instan- (PiES (t)) and EV power (PiEV (t)) is assumed to be positive
taneous data enables fast real-time decisions under the during the discharge process and negative during the charging
stochastic behavior of EVs and plug-and-play operation. process, while the load power (PiLoad (t)) is always positive. Fur-
3) The system considers ES life by avoiding batter- thermore, the grid power is considered positive when supplying
ies overcharging/over-discharging and minimizing costs the HMG load. In addition, the PV-connected converter is al-
through factors like temperature, mean state of charge ways controlled under maximum power to continuously supply
(SOC), and reducing the depth of discharge (DOD). the load.
4) The proposed algorithm is experimentally evaluated on The proposed HEMS is implemented as a hierarchical frame-
two laboratory-based HMGs, demonstrating its efficiency work in three levels namely primary, secondary, and tertiary
and feasibility in minimizing total generation costs with in local control, HMG, and central energy management system
a fast calculation time, making it suitable for real-time (CEMS), respectively. An intelligent optimal power exchange
applications. technique is presented for EV and ES at the secondary level
Overall, the proposed strategy addresses key challenges in based on PV, load, andTariff for buy/sale of electricity from
energy management for HMGs and presents a comprehensive the upstream grid λt . Hence, the excess output power (PiΔ (t))
j=M Load
solution that considers various aspects such as flexibility, sta- from HMG and the sum of CBj loads ( j=1 Pj ) are sent to
bility, real-time performance, and cost optimization. The ex- CEMS. Thereafter, an optimization problem is formulated under
perimental validation further supports the effectiveness of the the required constraints at the tertiary level in two layers of PSO
proposed approach. and ANN.

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

GHOLAMPOUR et al.: OPTIMAL HIERARCHICAL ENERGY MANAGEMENT SYSTEM WITH PLUG-AND-PLAY CAPABILITY 3

Fig. 2. SC diagnosis in the proposed HEMS method. (a) PiPV ≥ PiLoad . (b) PiPV ≤ PiLoad .

TABLE II
TYPICAL LIFE CYCLE

A. Primary Level (Local Control) regions are separated by diagonal lines, resulting in a total
of twelve different SCs. The border between the two areas is
This level regulates the amount of power exchanged via dif-
separated by a strip (two red dashed lines) to prevent problems
ferent converters on the references received from the secondary
such as instantaneous and continuous movement of the HMG
level. The primary level uses measured voltage and current in a
position between the two areas. These SCs are classified into two
PI controller scheme explained in [23]. This scheme includes
general groups, where the power produced by PVi (PiPV (t)) is
three PI current controllers for dc/dc converters. The dc-bus
more than available load in the HM Gj (PiLoad (t)) in the first six
voltage error has also been used in a PI voltage controller
of SC as shown in Fig. 2(a). Conversely, the power shortage is
to generate current reference of a single-phase bidirectional
compensated by the upstream grid, ES, and EVs for the other six
inverter.
as shown in Fig. 2(b) (described in Table II). It is worth noting
that this SC classification approach is flexible and unaffected
B. Secondary Level (HMG) by the number of HMGs, since the chosen SC changes with the
variations in SOC and λt .
The proposed method selects one of the following scenarios
(SC) to maximize the profit of HMGs at the secondary level.
The buying or selling performance of the HMGs is determined C. Tertiary Level (CEMS)
by two parameters, such as λt and SOC [19], [24]. Hence, when One of the most critical parameters in the electricity market
EV is connected to any HMG, the decision is made based on λt , is the value of the market-clearing price (MCP) which is deter-
ES’s SOC for ith HMG (SOCES i ), and EV’s state of charge for mined by the coincidence of two consumers’ power prices and
ith HMG (SOCEV i ) in a 3-D space. As depicted in Fig. 2, there producers’ excess power price curves in a double-sided auction
are minimum and maximum values for each parameter, which structure [25]. Consequently, it is necessary to connect all HMGs
divide the parameter space into three distinct regions. These and CBs of the neighborhood grid to CEMS. Thereafter, a

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

4 IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS

set of information such as power shortages or extra power of


HMGs along with their bid price, and the required power of
CBs are sent to CEMS. CEMS involved processing data and
sending suggestions to each HMG and CB in order to achieve
several objectives, including increasing reliability, optimizing
the price paid by CBs, and enhancing the motivation of HMGs
participating in the energy market.
Hence, this purpose requires infrastructure with high per-
formance, and a powerful information processing system to
receive, process, and send a high volume of information at
any given time. Therefore, implementing the structure is ex-
pensive, and complicated. In fact, innovative methods such as
genetic algorithms, and PSO are generally implemented based
on objective function or nonlinear constraints. However, inno-
vative methods have the potential to improve optimal online
management, their long computation time presents a significant
disadvantage. To address this issue, two-layer optimization al-
gorithms are proposed to solve the power flow problem. The
first layer is the offline layer, where PSO is employed for
its high efficiency and accuracy. Although the PSO compu-
tation time is high, this layer is offline, and the high com-
putation time does not interfere with the power management
process. The second layer makes reference to the online layer, Fig. 3. Flowchart for implementing HEMS in HMG.
where ANN is used due to its low computational time, low
memory, and high efficiency. Eventually, the combination of
these two methods of PSO, and ANN could reduce the above in real-time to optimize the performance of a dynamic system.
disadvantages. For such programs, classical optimization techniques are not
1) First Layer–Offline Optimization Stage: In this layer, effective because of the dimensions of the subject, and the
PSO is applied to find the optimal SOC of ES, and EV in different high requirement of computational time. As a result, ANNs
time periods (SOCt|t=1,2,...,k ), for 24 h with a time step of 1 h. are composed of interconnected neurons that possess the innate
The population of the PSO algorithm consists of Np vectors, ability of parallel and distributed information processing. Even
therefore each vector represents an order of SOCES , and SOCEV as the subject’s dimensions increase, the convergence rate of
over a period of 24 h, and each particle represents a SOC value the solution process remains unaffected. This makes ANNs a
in a one-hour time step. Furthermore, PSO inputs include Initial promising and feasible option for achieving real-time optimiza-
j=M
SOCES , and SOCEV (SOCES-O EV-O
i=1 , SOCi=1 ), j=1 Pj
Load
, λt , and tion. In this layer, ANN is used to find the optimal SOC of ES, and
Δ
Pi (t), as shown in (1). As mentioned above, the secondary EV in cases where data measurement (DM ) has an error with DP ,
level optimization performance is based on data predictive (DP ). in which 24 h with a one-hour time step is considered. Further,
Thus, PiΔ (t) is obtained from the lower level based on cases, that ANN is first trained in advance based on case studies (CSs).
are obtained by each HMG to solve the plug-and-play problem. Indeed, training an energy management system, especially with
Based on these inputs, the PSO searches for the optimal SOC multiple CS, requires a significant amount of input data and
values for 24 h, and proposed recommended power flow formula corresponding outputs for the training process. The input data
(CTi,run
i (t)) is calculated at the end as shown in (12). The PSO should capture the characteristics of the different scenarios rep-
is initialized based on random values from the inputs. System resented by the CSs, while the outputs are the expected responses
variables include P ES , P EV , P PV , T ES , LTES , SOCAVG , DOD, or optimal decisions of the energy management system for each
and P L . Thereafter system operating costs (C T ) is calculated. particular scenario. To gain an optimal output, the input data
The abovementioned procedure is carried out multiple times, entered into the PSO follows the optimal SOC values for ES,
with each repetition involving an update of the particle positions and EV. In addition, the data is then utilized for training ANN
using both local and global best solutions. Consequently, the in offline. In the error compensation layer, the error limits are
categories of SOCs yielding the lowest cost are identified and dynamically changing, and updating. These changes are based
considered as the optimal solutions. Moreover, the optimal SOC on an error between DM , and DP , and occur at each step, as
vector at each time step is considered the constraint for the next shown in (2). Consequently, if the error exceeds a certain value,
layer. ANN would show this information based on the instances it has
trained. The flowchart of the structure of the proposed algorithm,
PiΔ (t) = PiPV (t) + PiEV (t) + PiES (t) − PiLoad (t)
and the coordination between the two layers are shown in
∀ HMGi , i = {1, 2, . . . , N }. (1) Fig. 3.
 P 
2) Second Layer–Online Optimization Stage: It is chal- D (t) − (DM (t))
Err(t) = · (2)
lenging when a large-scale optimization method is performed (DM (t))
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

GHOLAMPOUR et al.: OPTIMAL HIERARCHICAL ENERGY MANAGEMENT SYSTEM WITH PLUG-AND-PLAY CAPABILITY 5

D. Problem Formulation the ES profile curve [27].


It is important to realize that power flow optimization is mi · SOCAVG
i (t) − di
primarily designed to minimize system operating costs while CAVG
i (t) = CES
i ES(t)
· (8)
Efadei · ni · Yhr i
supplying loads continuously. In fact, the total system cost at
each time interval t is given in (3). In this regard, CiΔ (t) is total c) DOD impact: The relationship between the ES life cycle,
operating cost HMGi by the upstream grid at time t, and CiES (t) and DOD is presented in (9) [28], where Ni is the number of ESi
is total operating cost ESi at time t. The following is a description cycles in a DOD, and μi is the charge, and discharge efficiency
of each of the costs: of ES.
T
 CES
i
CDOD
i (t) = · (9)
min CiT (t) = min [CiΔ (t) + CiES (t)]. (3) ES
2 · Ni · DODi (t) · E i · μ2i
t=0
A polynomial fit curve is used to apply DOD to the cost
1) Grid Operation Cost: λt is calculated dynamically under function. Finally, discharge depth costs are defined under the
factors such as fuel price, demand, available production, and following equation:
equipment outages in (4).
CDOD
i (t) = −0.012 · DODi (t)4
CiΔ (t) = λt · PiΔ (t) · Δt. (4)
+ 0.033 · DODi (t)3 0.021 · DODi (t)2 − 0.056 · DODi (t)
2) ES Degradation Cost: As explained earlier, the effect of (10)
the ES life cycle on system costs is also considered in the opti- Equation (11) describes the impact of all three factors on
mization problem. However, only three main factors have been the costs of ES degradation. Further, the discrete form of the
considered in reducing the ES life cycle, such as temperature, objective function to be optimized is given in (12).
average SOC, and DOD.
i (t) = max[Ci
CES (t), CDOD (t), CAVG (t)]
TEMP
a) Temperature impact: The performance of ES under dif- i i (11)
ferent charges, and discharge rates reduce the life cycle of T,N
i
ES by changing the temperature [26]. In fact, the operating CTi,run
i (t) = [CΔ
i (t)(k)+η.pi (t)(k) · Δt · Ci (t)(k)].
ES ES

temperature of the ES is directly affected by the average power t=0,k=1


injection/delivery to/from the ESi at time t (PiAVG (t)). Further, (12)
a simple temperature model is presented in (5). In this equation,
TiES (t) is the operating temperature ESi at time t, TiAMB the III. RESULTS
air temperature ESi at time t, and RiES,TH the ESi pack thermal
resistance. Moreover, the absolute value of the average power A. Simulation Results
has used in this equation for charging and discharging CS. Simulations were implemented in HMG domestic communi-
ties in the presence of four HMGs and four CBs, with a max-
TiES (t) = TiAMB (t) + RiES-TH · |PiAVG |(t)|. (5) imum power exchange of 5.5 kW between each HMG and the
grid. In particular, the proposed energy management algorithm
The effect of temperature on the ESi life cycle at time t
applies the presented optimization of ES, and EV for the next
(LTES
i (t)) is presented in (6) under a certain temperature. In day. Thereafter, the proposed algorithms of PSO and ANN, are
fact, increasing the temperature could reduce the power and
simulated in the MATLAB environment to evaluate the intended
capacity of the ES. Therefore, as shown in (7), the life cycle
hierarchical framework, where PV considered as the renewable
of an ES depends directly on its capacity. In addition, the values
energy source. Table III includes the values of SOCES i , SOCi
EV
of parameters a and b are obtained from the ES profile curve.
(to protect EV and ES), the time interval that of EVi is connected
The calculated life cycle is used to update the ES capacity in the
(TiEV-i ), and the output power of the PiES , PiEV , PiPV , PiLoad , and
next charging cycle. Moreover, the ES degradation cost due to
PjLoad . Moreover, λt is treated as an hourly value throughout the
an increase in temperature is given in (8). In this equation, Yhri
day and is simulated over a 24-h period for the HMG, spanning
represents the number of hours of use ESi at the year, and CiES
ES from 00:00 to 23:00. The functions and parameters of PSO and
represents the initial cost of ESi . E i is the full capacity of ES ANN are listed in Table IV.
at the time of power exchange. The article introduces several CSs to evaluate and test the
ES
(bi ·E i )
proposed hierarchical energy management system. The CSs are
ES ES(t) as follows.
i (t) = ai · · exp T
LTES Ei i (6)
1) CS1: Involves three HMGs and three CBs participating
 tf
dt in the optimal charging program for the day ahead.
CTEMP
i (t) = CES
i · (7) 2) CS2: Expands the HMG by adding one more HMG,
ti Yhr i · LTES
i (t)
resulting in four HMGs and three CBs.
b) Average SOC impact: Modeling the average effect of SOC 3) CS3: Removes one HMG from CS1.
on ES costs is determined by (8). In this equation, EfadeES
i is the 4) CS4: Adds one more CB to CS1.
ESi capacity at the end of life, and m and n are obtained through 5) CS5: Removes one CB from CS1.

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

6 IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS

TABLE III
SIMULATION PARAMETERS

j=M
Fig. 4. Total power PiΔ (t), and j=1
P Load of CSi.

TABLE IV
PSO AND ANN PARAMETERS

Fig. 5. HMGi of CS1 using the PSO algorithm. (a) ΔSOC ES


i .
(b) ΔSOC EV
i .

The behavior of all CSs is dependent on PiΔ (t), PjLoad (t),


and their participation in the market, as illustrated in Fig. 4. In
addition, Fig. 5 displays the SOC of CS1 and depicts how the
charge/discharge schedules of ES and EV are affected by λt .
According to Fig. 5(a), optimization is performedbased on the
SOC, daily hours, presence of EV, and amount of j=M j=1 P
Load
.
In addition, the EV charging and discharging schedules are
determined in Fig. 5(b) based on reconnecting the EV for HMG1
6) CS6: Dedicated to investigating the system’s response to to HMG3 with different SOCES-O i at time periods specified in
uncertainty. This CS explores the effects of uncertainty Table III. This indicates how much EV and ES are flexible in
on the target HMG from two different perspectives: by 1) achieving the intended objectives. Fig. 6(a) and (b) represent
changing the output power of PV in each HMG; and 2) the ES and EV for HMG1 and HMG2 , respectively. Fig. 6(a)
varying the load in the HMG. illustrates that the State of Charge (SOCES-O
i ) of Energy Storage
By conducting these diverse CS, the proposed algorithm can (ES) remains at 80% for all CSs. However, there is a notable
be thoroughly assessed in different scenarios, providing valuable increase of 55.2% in the load of circuit breakers (CBs) during
insights into its performance, robustness, and adaptability under CS4 from 9:00 to 11:00, leading to an 11% increase in ES
various conditions. This approach ensures a comprehensive discharge. Conversely, the lowest load of CBs in CS5 results
evaluation of the energy management system’s capabilities and in a higher maximum SOCES i compared to CS3 by around 25%.
helps validate its effectiveness in real-world applications. During 11:00 to 14:00, PGR i (t) (the mean grid-supplied power

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

GHOLAMPOUR et al.: OPTIMAL HIERARCHICAL ENERGY MANAGEMENT SYSTEM WITH PLUG-AND-PLAY CAPABILITY 7

Fig. 6. SOCESi , and SOCi


EV
of CSi using the PSO algorithm.
(a) SOCES
1 and SOC EV
1 . (b) SOC ES EV
2 and SOC2 .

Fig. 7. Variations of PiPV and PiLoad from CS1 to CS6 . (a) P1PV and
j=M Fig. 8. SOCES EV
1 , SOC1 of CSi for both the PSO, ANN algorithm.
P1Load . (b) P2PV and P2Load . (c) P3PV and P3Load . (d) j=1
P Load .
(a) SOCES1 and SOCEV
1 for CS1. (b) SOCES
1 and SOCEV
1 for CS2.
(c) SOC1 and SOC1 for CS3. (d) SOC1 and SOCEV
ES EV ES
1 for CS4.
(e) SOCES EV
1 and SOC1 for CS5.
at time t) for this CS is near the minimum, at approximately
5.717%, despite the fact that the least PiΔ (t) for CS3 during
the same period equals the minimum PiPV . All CSs operate in for accurate decision-making within a reasonable timeframe.
discharging mode when λt has a high value between 16:00 to Moreover, the mean processing times for ANN and PSO, which
18:00. Consequently, in CS2, the increase of 24.5% in PiΔ (t) are 202.11 s and 0.018485 s, respectively, highlight the signifi-
leads to a higher SOC level in both homes between 11:00 to cance of these techniques in energy management strategies. The
13:00. relatively longer processing time for ANN compared to PSO is
Fig. 7 compares CSi based on the PSO algorithm and the justified as ANN involves complex computations and learning
ANN algorithm to evaluate the performance of ANN training. To from data to make informed decisions. On the other hand, PSO is
provide desirable data for ANN training, PSO is used. Initially, a fast and efficient optimization algorithm, which plays a crucial
the ANN is trained with various functions and layers, and role in quickly finding optimal solutions for various aspects of
multiple scenarios are executed. Then, PSO selects the optimal the energy management system. Overall, the combination of
values for minimum error, time, number of neurons in a layer, ANN and PSO, with their respective processing times, ensures
and hidden layers. This process enhances the performance of a powerful and effective energy management strategy that can
the ANN during both training and testing. The actual mea- make real-time decisions, optimize performance, and achieve
sured data is divided such that 100% is utilized for training optimal power-sharing and stability within the microgrid. The
and testing the ANN. The mean training time of 1 h, 29 min, mean square error (MSE) is an effective measure to assess the
and 30 s, with 1000 iterations conducted for the epochs, indicates prediction performance of the ANN. The optimal performance
the efficiency and effectiveness of the training process for the of MSE was achieved at 5.7641e-05, resulting in the best training
proposed energy management strategy. It demonstrates that the performance and optimal prediction of the ANN. Table V shows
training process is capable of optimizing the neural network the five main results of the simulation for CS1 to CS5 (presented
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

8 IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS

TABLE V
OPERATION COST COMPARISONS BETWEEN PSO, ANN, AND ACO IN 24 H

Fig. 9. SOCES
i of CS1, CS6 using the PSO, ANN algorithm. (a) SOCES ES ES
1 . (b) SOC2 . (c) SOC3 .

separately for HMG1 and HMG2 ) for PSO, ANN, and ACO
algorithms. The last two rows show the mean power obtained
for each CS, where the power purchased from the upstream grid
is 6.078 kW, 6.194 kW, and 6.427 kW for PSO, ANN, and ACO,
respectively. Accordingly, CS5 purchases the lowest power from
the upstream grid due to the lowest load. The columns under each
case contain two subcolumns containing the mean money that
the owners pay or gain. In the sub-column corresponding to CS1
and HMG1 , the money they pay is 0.02141 [£] for PSO, 0.002836
[£] for ANN, and 0.1146 [£] for ACO. This trend is almost the Fig. 10. Experimental test bed.
same for HMG2 and other columns in the table. Uncertainty
modeling has been used Taguchi because it has a higher speed TABLE VI
due to the smaller volume of calculations compared to other SIMULATION PARAMETERS
methods [29]. The effect of uncertainty has been examined under
two aspects mentioned in CS6. Based on Fig. 8(a), in the early
and late hours of the day, the load on HMG1 decreased, while
the sunlight on PV1 increased
 slightly. Moreover, as shown in
Fig. 8(d), the changes in j=M j=1 P Load
j at certain times of the
ES
day change the SOC1 and the maximum variations occur in
(I), as depicted in Fig. 9(a), in which the proper optimization
of the proposed algorithm is apparent. Similarly, in Fig. 9(b),
the maximum variations in (II) result from decreasing PV2 (due
to cloudy weather) with respect to CS, increasing the load in
HMG 2 at the beginning and end of the day, and variations
j=M
in j=1 Pj
Load
. Therefore, the level of SOCES 2 is reduced The test configuration is illustrated in Fig. 10 and its specifi-
to purchase less power from  the upstream grid. In addition, cations are detailed in Table VI. Fig. 11(a) displays the current
Load
slight variations in Pi=3 and j=Mj=1 Pj
Load
, and the late rising profiles for PV and load, pertaining to HMG1 and HMG2 over
of the sun (PV3 ) lead to the reduction of SOCES 3 in the time twenty time-steps, with PV1 having a higher value than PV2 .
corresponding to (III) in Fig. 9(c). Meanwhile, the current produced by PV and consumed by the
load is shown as positive and negative amounts, respectively.
Further, the two batteries act as ES and EV, while PV resembles
B. Experimental Results a dc source. As shown in Fig. 11(b) to (f), the optimal ES and EV
In order to evaluate the effectiveness of the algorithm under current profiles are derived in several ECS with the most optimal
consideration, it was applied to a test bed designed for experi- performance to confirm the plug-and-play mode and uncertainty.
mental CS (ECS), utilizing a TMS320F28335 DSP processor. The iES and iEV are also obtained under the following ECSs.

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

GHOLAMPOUR et al.: OPTIMAL HIERARCHICAL ENERGY MANAGEMENT SYSTEM WITH PLUG-AND-PLAY CAPABILITY 9

to supply the load and to reduce the cost (V). while it is charged
during peak off hours (VI). Similarly, by detecting subsequent
plug-and-play, this procedure is repeated for Fig. 11(e) and (f),
leading to modifications on the optimal profile of ES2 and EV2 .

IV. CONCLUSION
In conclusion, this article presented a comprehensive hierar-
chical energy management system for smart homes, featuring
accurate power-sharing, energy conservation, and optimization
techniques for multiple energy storage systems. The proposed
approach included a novel secondary level strategy in HMG
to efficiently distribute excess power, followed by two layers of
energy management at the tertiary level. In the offline layer, PSO
algorithm was employed to solve MG operation management,
addressing multiple objectives such as technical aspects, oper-
ating cost reduction, environmental concerns, and battery health
status. On the other hand, the online layer utilized ANN to en-
hance the convergence for load forecast error uncertainties, plug-
and-play capability, and variations in PV output power. This
approach not only improves efficiency and availability, but also
simplifies controller design and reduces modeling complexity
and computation. The proposed system outperforms other EMS
strategies by achieving a 17.36% reduction in MSE of ANN.
The effectiveness of the control strategy is verified through both
simulation and experimental studies. These findings highlight
the system’s capability to optimize microgrid operation, improve
performance, and ensure robust power-sharing while consider-
ing uncertainties and real-time variations in energy sources and
Fig. 11. Experimental result: PV, load, ES, and EV currents in ECS1 loads. Overall, the proposed hierarchical energy management
to ECS5. (a) PV and load currents in ECS1 to ECS5. (b) ECS1.
(c) ECS2. (d) ECS3. (e) ECS4. (f) ECS5.
system offers a promising solution for achieving sustainable
and efficient energy utilization in smart homes, contributing to
the development of more reliable and environmentally friendly
Microgrid systems.
1) ECS1: HMG involves three HMGs and three CBs. EV1 Future works can focus on two aspects: 1) EV user behavior,
is connected and disconnected where SOCES-O 1 = 80%, whereby the controller can make beneficial decisions based on
and SOCEV-O
1 = 60%. the behavior of EV users; and 2) improving the cyber-physical
2) ECS2: HMG involves four HMGs and three CBs, in platform into the real-time grid and large-scale operation with
which ES1 and EV1 parameters are the same as ECS1. the market operators.
3) ECS3: HMG involves three HMGs and four CBs. EV1
and EV1 parameters are same as ECS1. REFERENCES
4) ECS4: HMG involves two HMGs and three CBs. This
[1] M. Alramlawi and P. Li, “Design optimization of a residential PV-battery
case covers the various connection states of EV with microgrid with a detailed battery lifetime estimation model,” IEEE Trans.
SOCES-O
2 = 55% and SOCEV-O 2 = 30%. Ind. Appl., vol. 56, no. 2, pp. 2020–2030, Mar./Apr. 2020.
5) ECS5: HMG involves three HMGs and two CBs. Also, [2] K. Zou, G. Mohy-ud din, A. P. Agalgaonkar, K. M. Muttaqi, and S. Perera,
“Distribution system restoration with renewable resources for reliability
EV2 and EV2 parameters are the same as ECS4. improvement under system uncertainties,” IEEE Trans. Ind. Electron.,
According to ECS2, after the sudden connection HMG, the vol. 67, no. 10, pp. 8438–8449, Oct. 2020.
new optimal ES profile is in Fig. 11(c) due to the input of more [3] F. Yang, X. Feng, and Z. Li, “Advanced microgrid energy management
system for future sustainable and resilient power grid,” IEEE Trans. Ind.
power generation. Then, the optimal charging and discharging Appl., vol. 55, no. 6, pp. 7251–7260, Nov./Dec. 2019.
schedule is modified for the ES and EV, ES1 is less discharged [4] T.-L. Nguyen, Y. Wang, Q.-T. Tran, R. Caire, Y. Xu, and C. Gavriluta,
(I) than ECS1 in Fig. 11(b). Meanwhile, the end of the day is “A distributed hierarchical control framework in islanded microgrids and
its agent-based design for cyber–physical implementations,” IEEE Trans.
more discharged to reduce the microgrid cost (II). Similarly, Ind. Electron., vol. 68, no. 10, pp. 9685–9695, Oct. 2021.
EV1 with the entry of more PV in peak the charge is increased [5] J. Abushnaf and A. Rassau, “Impact of energy management system on the
to leave the house with the desired charge level (III). Although sizing of a grid-connected PV/battery system,” Electricity J., vol. 31, no. 2,
pp. 58–66, 2018.
the input power has increased in ECS2, the load increases in [6] H. Li, A. T. Eseye, J. Zhang, and D. Zheng, “Optimal energy management
ECS3. Therefore, ES1 goes into discharge mode to supply the for industrial microgrids with high-penetration renewables,” Protection
charge of existence (IV). Further, EV1 in this case is discharged Control Modern Power Syst., vol. 2, no. 1, pp. 1–14, 2017.

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.
This article has been accepted for inclusion in a future issue of this journal. Content is final as presented, with the exception of pagination.

10 IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS

[7] Y. Du and F. Li, “Intelligent multi-microgrid energy management based on [28] T. Markel, K. Smith, and A. A. Pesaran, “Improving petroleum displace-
deep neural network and model-free reinforcement learning,” IEEE Trans. ment potential of PHEVs using enhanced charging scenarios,” in Electric
Smart Grid, vol. 11, no. 2, pp. 1066–1076, Mar. 2020. and Hybrid Vehicles Power Sources, Models, Sustainability, Infrastructure
[8] M. Manbachi and M. Ordonez, “Ami-based energy management for and the Market. Amsterdam, Netherlands: Elsevier, 2009, pp. 1–9.
islanded AC/DC microgrids utilizing energy conservation and optimiza- [29] T. Prabatha, H. Karunathilake, A. M. Shotorbani, R. Sadiq, and K. Hewage,
tion,” IEEE Trans. Smart Grid, vol. 10, no. 1, pp. 293–304, Jan. 2019. “Community-level decentralized energy system planning under uncer-
[9] M. G. Abdolrasol, R. Mohamed, M. A. Hannan, A. Q. Al-Shetwi, M. tainty: A comparison of mathematical models for strategy development,”
Mansor, and F. Blaabjerg, “Artificial neural network based particle swarm Appl. Energy, vol. 283, 2021, Art. no. 116304.
optimization for microgrid optimal energy scheduling,” IEEE Trans.
Power Electron., vol. 36, no. 11, pp. 12151–12157, Nov. 2021.
[10] D. Y. Yamashita, I. Vechiu, and J.-P. Gaubert, “A review of hierarchical Kamyab Gholampour received the B.Sc. and
control for building microgrids,” Renewable Sustain. Energy Rev., vol. 118, M.Sc. degrees in electrical engineering from
2020, Art. no. 109523. the Babol Noshirvani University of Technology,
[11] I. V. Daniela Yassuda Yamashita and J.-P. Gaubert, “Two-level hier- Babol, Iran, in 2014 and 2022, respectively.
archical model predictive control with an optimised cost function for His research interests include smart grid,
energy management in building microgrids,” Appl. Energy, vol. 285, 2021, smart charging of EVs, their applications in re-
Art. no. 116420. newable energy, and neighborhood home mi-
[12] M. Elkazaz, M. Sumner, E. Naghiyev, S. Pholboon, R. Davies, and crogrids.
D. Thomas, “A hierarchical two-stage energy management for a home
microgrid using model predictive and real-time controllers,” Appl. Energy,
vol. 269, 2020, Art. no. 115118.
[13] F. Luo, G. Ranzi, S. Wang, and Z. Y. Dong, “Hierarchical energy man-
agement system for home microgrids,” IEEE Trans. Smart Grid, vol. 10,
Jafar Adabi received the B.Eng. and M.Eng.
no. 5, pp. 5536–5546, Sep. 2019.
degrees from Mazandaran University, Babol,
[14] G. Xu, C. Shang, S. Fan, X. Hu, and H. Cheng, “A hierarchical energy
Iran, in 2004 and 2006, respectively, and the
scheduling framework of microgrids with hybrid energy storage systems,”
Ph.D. degree from the School of Engineering
IEEE Access, vol. 6, pp. 2472–2483, 2017.
Systems, Queensland University of Technology,
[15] W. Jiang, K. Yang, J. Yang, R. Mao, N. Xue, and Z. Zhuo, “A multiagent-
Brisbane, Queensland, Australia, in 2010, all in
based hierarchical energy management strategy for maximization of re- power engineering.
newable energy consumption in interconnected multi-microgrids,” IEEE
He is currently an Associate Professor with
Access, vol. 7, pp. 169931–169945, 2019.
the Babol Noshirvani University of Technology,
[16] H. Kim, M. Kim, and J. Lee, “A two-stage stochastic p-robust optimal en-
Babol, Iran. His research interests include the
ergy trading management in microgrid operation considering uncertainty optimal design and high frequency modeling of
with hybrid demand response,” Int. J. Elect. Power Energy Syst., vol. 124,
power electronics and motor drive systems for EMI analysis.
2021, Art. no. 106422.
[17] D. Sadeghi, A. H. Naghshbandy, and S. Bahramara, “Optimal sizing of
hybrid renewable energy systems in presence of electric vehicles using
multi-objective particle swarm optimization,” Energy, vol. 209, 2020,
Art. no. 118471. Hamidreza Gholinezhadomran received the
[18] K. Gholami and E. Dehnavi, “A modified particle swarm optimization B.S. degree in 2012, the M.S. degree in 2015,
algorithm for scheduling renewable generation in a micro-grid under load and the Ph.D. degree in 2022, from the Babol
uncertainty,” Appl. Soft Comput., vol. 78, pp. 496–514, 2019. Noshirvani University of Technology, Babol,
[19] H. R. Gholinejad, J. Adabi, and M. Marzband, “An energy management Iran, all in electrical engineering.
system structure for neighborhood networks,” J. Building Eng., vol. 41, In 2023, he joined as a Postdoctoral Research
2021, Art. no. 102376. Associate with Northumbria University, Newcas-
[20] L. Meng, E. R. Sanseverino, A. Luna, T. Dragicevic, J. C. Vasquez, and J. tle, U.K., under Innovate U.K. project. He cur-
M. Guerrero, “Microgrid supervisory controllers and energy management rently leads the design and development of the
systems: A literature review,” Renewable Sustain. Energy Rev., vol. 60, charging AI-EMS architecture, integrating it with
pp. 1263–1273, 2016. the charging hardware, and battery manage-
[21] A. Bani-Ahmed, M. Rashidi, A. Nasiri, and H. Hosseini, “Reliability ment systems with OtaskiES, Gatehead, U.K. His research interests
analysis of a decentralized microgrid control architecture,” IEEE Trans. include optimal and intelligent energy management systems strategies
Smart Grid, vol. 10, no. 4, pp. 3910–3918, Jul. 2019. for renewable energy, electric vehicle, and battery storage integration.
[22] C. Kammer and A. Karimi, “Decentralized and distributed transient con-
trol for microgrids,” IEEE Trans. Control Syst. Technol., vol. 27, no. 1,
pp. 311–322, Jan. 2019.
[23] H. reza Gholinejad, J. Adabi, and M. Marzband, “Hierarchical energy Otaigbe Inegbedion received the M.Sc. degree
management system for home-energy-hubs considering plug-in elec- in petroleum geochemistry from Newcastle Uni-
tric vehicles,” IEEE Trans. Ind. Appl., vol. 58, no. 5, pp. 5582–5592, versity, Newcastle upon Tyne, U.K., in 2013,
Sep./Oct. 2022. and the Ph.D. degree in carbon capture from
[24] H. R. Gholinejad, A. Loni, J. Adabi, and M. Marzband, “A hierarchical en- Northumbria University, Newcastle upon Tyne,
ergy management system for multiple home energy hubs in neighborhood U.K., 2017.
grids,” J. Building Eng., vol. 28, 2020, Art. no. 101028. He is Director of OtaskiES, Gateshead, U.K.,
[25] A. Hasankhani and S. M. Hakimi, “Stochastic energy management of with a background in energy system and design
smart microgrid with intermittent renewable energy resources in electricity engineering, carbon capture, smart city energy
market,” Energy, vol. 219, 2021, Art. no. 119668. optimization, and energy business modeling. He
[26] A. Hoke, A. Brissette, K. Smith, A. Pratt, and D. Maksimovic, “Accounting has total seven years of experience working (oil
for lithium-ion battery degradation in electric vehicle charging optimiza- and gas), with Apple University, Cupertino, California, CA, USA, San-
tion,” IEEE Trans. Emerg. Sel. Topics Power Electron., vol. 2, no. 3, tander University, London, U.K., and Newcastle University. His research
pp. 691–700, Sep. 2014. interests include carbon capture, energy system and design, sensor
[27] A. Motamedi, H. Zareipour, and W. D. Rosehart, “Electricity price and fusion, strategy, design thinking, smart city infrastructure/integration,
demand forecasting in smart grids,” IEEE Trans. Smart Grid, vol. 3, no. 2, AI/ML, PR/people skills, innovation, creativity, and entrepreneurship.
pp. 664–674, Jun. 2012.

Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL. Downloaded on October 20,2023 at 16:13:56 UTC from IEEE Xplore. Restrictions apply.

You might also like