0% found this document useful (0 votes)
10 views

Energy Management System of a Microgrid Using Deep Learning

EMS NOTES

Uploaded by

Divya Zindani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Energy Management System of a Microgrid Using Deep Learning

EMS NOTES

Uploaded by

Divya Zindani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Energy Management System of a Microgrid

Using Deep Learning


Nur Aini Nadhirah Mohd Nawawi Siti Hajar binti Yusoff Teddy Surya Gunawan
2024 IEEE 10th International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA) | 979-8-3503-6528-3/24/$31.00 ©2024 IEEE | DOI: 10.1109/ICSIMA62563.2024.10675580

Electrical and Computer Engineering Dept. Electrical and Computer Engineering Dept. Electrical and Computer Engineering Dept.
International Islamic University Malaysia International Islamic University Malaysia International Islamic University Malaysia
53100 Kuala Lumpur, Malaysia 53100 Kuala Lumpur, Malaysia 53100 Kuala Lumpur, Malaysia
[email protected] [email protected] [email protected]

Mohd Shahrin Abu Hanifah Suriza Ahmad Zabidi Siti Nadiah Mohd Sapihie
Electrical and Computer Engineering Dept. Electrical and Computer Engineering Dept. Petronas Research Sdn Bhd,
International Islamic University Malaysia International Islamic University Malaysia Bandar Baru Bangi 43000, Malaysia
53100 Kuala Lumpur, Malaysia 53100 Kuala Lumpur, Malaysia [email protected]
[email protected] [email protected]

Abstract—The increasing adoption of microgrids with Classical methods involve mathematically modeling
renewable energy systems, driven by environmental and specific variables and constraints to provide an optimal
socioeconomic factors, faces challenges such as renewable solution based on the given problem. An example of classical
energy variability and dynamic load fluctuations, leading to methods is linear programming, which makes optimal
increased grid consumption. This study addresses these decisions in EMS considering cost, availability, and
challenges by proposing an advanced Energy Management environmental impact. For example, this paper [3] proposed
System (EMS) integrated with a Deep Learning model for load an optimization method based on linear programming to
forecasting. The objective is to enhance the efficiency and cost- minimize operation costs and maximize solar energy's power.
effectiveness of microgrids by dynamically adjusting to
Despite their success, linear programming models are based
forecasted load demands. The EMS utilizes Long Short-Term
Memory (LSTM) networks to predict the load demand of a
on linear constraints, which means that they may not be able
commercial building, allowing for optimized battery scheduling to capture the complexities of nonlinear systems.
and reduced reliance on the utility grid. The study conducted a Another method is a Metaheuristic approach, which
month-long simulation using real historical load and solar power involves random searching and generating potential solutions.
data, comparing the proposed EMS with a standard EMS. Key It is widely used to address complex problems that classical
findings indicate that the proposed EMS significantly reduces methods cannot achieve. For example, Grisales-Noreña et al.
grid consumption, resulting in a 9.3% reduction in monthly
[4] proposed a Proximal Policy Optimization algorithm and
electricity bills. Integrating deep learning in EMS demonstrates
Artificial Neural Network (ANN) to schedule a day-ahead
substantial improvements in handling dynamic conditions and
optimizing energy usage. These findings imply that deep
dispatch of Battery Energy Storage Systems (BESS) to reduce
learning-based EMS can lead to significant cost savings and consumption costs from the utility grid, However, the
more efficient microgrid energy management, promoting the proposed method does not consider the battery efficiency and
broader adoption of renewable energy solutions. self-discharge effect, which could impact the economic
efficiency of the BSS operation. Additionally, the
Keywords—Energy Management System, Microgrid, Deep mathematical formulation of the EMS does not include the
Learning, Load Forecasting, Long-Short-Term Memory battery's maximum charging and discharging cycles, which
could limit its lifespan.
I. INTRODUCTION
Lastly, Artificial Intelligence methods such as Machine
Microgrids face substantial challenges, such as the Learning and Deep Learning have seen a significant increase
intermittent nature of renewable energy and load fluctuations, in the application of EMS. These methods can analyze the
which cause imbalances in the system. The energy demand of problem, identify patterns, and make optimal decisions. For
a building can fluctuate depending on factors such as the time example, Iringan Iii et al. [5] aimed to increase the
of day, occupancy levels, and operational activities. These consumption of solar PV and battery while decreasing reliance
imbalances necessitate increased energy exchange with the on the utility grid to reduce electricity costs by using machine
grid to stabilize the system, which can be less economically learning to forecast solar and load. The study achieved an
favorable and lead to higher electricity bill costs due to peak- NRMSE of 0.398 and 0.409 for load and solar power
time energy purchases. This not only results in higher costs but forecasting, respectively. However, it does not explicitly state
also in inefficient utilization of local generation resources [1]. how much the electricity costs are reduced using the proposed
Energy Management Systems (EMS) are part of the methods. Additionally, there is a lack of consideration for
microgrid controller. They play a critical role in ensuring that weather conditions and solar irradiance, which can impact the
the power generated within microgrids meets the building's accuracy of solar forecasting. Not to mention, using data from
load demand. EMS involves decision-making processes to a location different from the microgrid system being studied
maximize the use of renewable energy, minimize consumption may limit the generalizability of the results.
from the utility grid, and efficiently manage energy storage This paper proposes an advanced EMS integrated with
systems [2]. In general, three approaches to EMS have been deep learning to predict load fluctuations and adjust energy
explored in the past: Classical methods, Metaheuristic management strategies accordingly. The proposed EMS
methods, and Artificial Intelligence methods. algorithms are based on [6], where the BESS will discharge

979-8-3503-6528-3/24/$31.00 ©2024 IEEE

Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on January 02,2025 at 09:17:57 UTC from IEEE Xplore. Restrictions apply.
240
2024 IEEE 10th International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA2024)

during peak power by prioritizing charging before the for plant within the United States that is part of the Energy
expected peak power arrives. A deep learning Long Short- Information Administration [9]. For this simulation to mimic
Term Memory (LSTM) model is proposed to predict the load solar generation in Malaysia, the time resolution is modified
demand of a commercial building. This paper primarily to produce sunlight-generated power from 8 am to 6 pm.
focuses on the performance of the proposed EMS, which
utilizes load forecasting, rather than on the performance of the B. Proposed Energy Management System Algorithms
LSTM forecasting model itself. The performance of the Two algorithms proposed are EMS strategies and EMS
proposed EMS was compared with that of a standard EMS of with Load Forecasting algorithms. Fig. 2. is the EMS
battery scheduling proposed by [7], where the battery strategies based on Eq. (1) and (2). This algorithm determines
prioritizes charging during non-peak hours and discharging whether to charge or discharge the battery or to supply power
during peak hours. The simulation used Python with real-life from the grid to the load. It also abides by the SOC constraints
historical data from the United States. to avoid overcharge and over-discharge.

II. METHODOLOGY
This section outlines the methodology employed in
developing and implementing the proposed EMS for the
microgrid, detailing the microgrid design, the EMS
algorithms, and the deep learning techniques used for load
forecasting.
A. Proposed Microgrid Design
The microgrid's proposed block diagram is shown in Fig.
1. The PV panel generates power from sunlight, stored in the
Battery Energy Storage System (BESS). The BESS acts as the
main supplier, providing power to the load. The utility grid
supplies the remaining power if the power stored in the BESS
does not fulfill the load demand. A Deep Learning Energy
Management System (DL EMS) is integrated to analyze
current power conditions and forecast load demand, deciding
optimal strategies for charging and discharging the battery in
the microgrid, thereby reducing power consumption from the
utility grid.

Fig. 2. EMS strategies

Fig. 1. PV-Battery system design

The power balance equation for EMS can be expressed in


Eq. (1).

= + (1)

This equation signifies that the total power consumed by


the loads ( ) must be equivalent to the power discharged
from the battery ( ) and grid ( ). The BESS must also
adhere to a State-of-Charge (SOC) constraint to avoid
overcharging and ensure the battery’s lifetime. The constraint
equation is shown in Eq. (2).

< < (2)

The PV and battery system design are based on the load


demand of load demand for a commercial building obtained
hourly from the U.S. Department of Energy [8]. The dataset
represents a large office with fans, facilities, lighting,
equipment, gas, heating, water systems, and appliances. The
maximum energy per day is over 40000kWH. Therefore, the
proposed PV panel power system capacity is 1MW with a
battery energy storage capacity of 50MWh. The PV power is
obtained hourly from the historical solar generation profiles Fig. 3. Proposed EMS with LSTM load forecasting

Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on January 02,2025 at 09:17:57 UTC from IEEE Xplore. Restrictions apply.
241
2024 IEEE 10th International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA2024)

Fig. 3. illustrates the proposed EMS integrating load working hours. This pattern underscores the need for efficient
forecasting. The system collects daily load forecasts and load forecasting and management, particularly during peak
identifies the time of the highest predicted load. During peak hours, to optimize energy usage and reduce costs. The dataset
periods, it prioritizes charging the battery before the next was split into 70% for training and 30% for testing to validate
expected peak period. This approach ensures sufficient battery the model's accuracy.
power to meet the load demand during peak times. The EMS
also considers battery SOC constraints, charging the battery if
the SOC is below or discharging if it exceeds
, and stops charging when SOC reaches .
C. Proposed Deep Learning Techniques for Load
Forecasting
The proposed deep learning technique is LSTM for
forecasting the demand load. LSTM is selected due to its
widespread use in time series forecasting tasks. LSTM
networks are designed to handle long-term dependencies
better and mitigate the vanishing gradient problem, which is
common in traditional Recurrent Neural Networks [10].
LSTM can effectively capture complex temporal patterns
present in sequential data, making it particularly suitable for
load forecasting where historical data points heavily influence
future predictions. The steps of the load forecasting model are
as follows: data collection and preparation, data preprocessing Fig. 5. Load demand for a day
for deep learning, and application of the Long Short-Term
Memory algorithm. Finally, the performance of the deep 2) Data Preprocessing
learning model is studied. Data preprocessing is a crucial stage in training machine
1) Data Collection learning models. It involves transforming raw data into a
Fig. 4 illustrates the load demand pattern from March to format that machine learning algorithms can effectively use
May over two months. The graph shows significant [11]. Various methods are available depending on the nature
fluctuations in load demand, with consistent peaks and troughs of the data. In this case, max-min normalization scales features
indicating higher demand on weekdays and reduced demand between 0 and 1, as shown in Eq. (3). This ensures that all
on weekends. The pronounced regularity suggests typical features contribute equally to the learning process and helps
office building usage, with minimal weekend activity. The stabilize gradients during training.
data highlights the variability and predictability of load
demand, which is crucial for optimizing the EMS. The cyclical = (3)
pattern underscores the importance of accurate load
forecasting to ensure efficient energy distribution and
3) LSTM Hyperparameters
minimize reliance on the grid during peak periods.
The hyperparameters used to achieve the best results are
detailed in Table 1. They were determined based on the
findings in [11]. The tuning process was conducted multiple
times to identify the optimal set of hyperparameters. Only the
performance of the selected optimal hyperparameters will be
studied.

TABLE I. LSTM HYPERPARAMETERS


Parameters Value
Number epochs 2000
Learning rate 0.01
Hidden size 50
Number of layers 1
Number of classes 1
Optimizer Adam

4) Performance Metrics
Three popular statistical metrics are used to evaluate the
Fig. 4. Load demand for 2-month period forecasting algorithms: the mean absolute error (MAE), the
root mean square error (RMSE), and the mean absolute
Fig. 5 illustrates the daily load demand profile, showing percentage error (MAPE).
significant daily variations. The load demand peaks sharply
!
= ∑"
+,!|%
&'() * %'()|
around noon, reaching over 1000 kW, indicative of increased
(3)
activity during working hours. This peak is followed by a "
gradual decline in the afternoon and a steep drop in the
! 1
- = . ∑"
+,!/%
&'() * %'()0
evening as work activities wind down. The lowest demand is
(4)
observed during nighttime, reflecting minimal usage outside "

Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on January 02,2025 at 09:17:57 UTC from IEEE Xplore. Restrictions apply.
242
2024 IEEE 10th International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA2024)

! &'+) '+)
= ∑"
+,! 2 2 3 100% (6)
" '+)

where %& is the predicted value, % is the actual value and 7 is


the number of samples.
D. Electricity Bill Calculation
The calculation of the electricity cost consumption of the
microgrid must refer to the Time-Of-Use Tariff Rate. In this
project, a commercial building is used as a DC load. The Tariff
Rates are taken from the TNB website [12]. Table II shows the
TNB Tariff Rate for C2 commercial buildings. Table III refers
to the peak and off-peak periods.

TABLE II. TARIFF C2 MEDIUM VOLTAGE PEAK/OFF-PEAK


COMMERCIAL TARIFF
Tariff category Unit Current rate
For each kilowatt of maximum demand per RM/kW 45.10
month during the peak period Fig. 6. Load forecasting result for 2 months
For all kWh during the peak period RM/kW 36.50
For all kWh during the off-peak period RM/kW 22.40
Minimum monthly charge RM 7.2
B. Microgrid Simulation Result
The simulation is conducted for 30 days using the real
TABLE III. PEAK AND OFF-PEAK PERIOD [12] historical PV and load power data. Fig. 7 shows the power
generated by the PV panel. The maximum power that it can
Period Time Range
charge is up to 9000kW. Fig. 8 shows the actual load and load
Peak 08:00 – 22:00 forecast; it can be seen that the load forecast is nearly identical
Off-peak 22:00 – 08:00 to the actual load. From the figure, the load demand is the
highest during the weekday compared to the weekend. The
office is closed during the weekend, reducing the load power.
Eq. (7) represents the formula used to calculate the total
electricity cost for a commercial building within the microgrid
setup based on the Time-Of-Use Tariff Rate. The total cost is
derived by summing the costs incurred during peak and non-
peak periods.

89:;< 9=: = 36.5 BC + + 22.4 FF BC + (7)

where BC + represents the total energy consumed during


peak hours and FF BC + represents the total energy
consumed during non-peak hours.
III. RESULTS AND ANALYSIS Fig. 7. PV power for 30 days
This study's forecasting models and microgrid simulation
were all modeled in Python using Jupyter Notebooks. The
deep learning environment used was PyTorch. Additionally,
other Python libraries were used for data processing and
manipulation. The computations, such as fitting the models
and evaluating the results, were made on a computer with a
MacBook Air M1 having 8 GB RAM and running a MacOS
Sonoma operating system.
A. Experiment on Load Forecasting
Figure 6 illustrates the load forecasting prediction for a
large office over two months, comparing actual data with
predicted data using an LSTM model. The graph shows a Fig. 8. Actual and forecast load demand power for 30 days
strong correlation between the actual and predicted values,
indicating the model's effectiveness. Despite MAE of 53.23, Fig. 9 and Fig. 10 present bar graphs illustrating the daily
MAPE of 5.51%, and RMSE of 105.82, which might seem grid and battery supply for both EMS configurations: one with
high, the visual alignment suggests that the LSTM model deep learning integration and the other without. The number
reliably captures the load demand pattern. This close at the top of the graph shows the percentage of battery supply
resemblance validates the model's predictive capability, for the day. There are noticeable variations in battery supply
highlighting its potential for accurate load forecasting in between the two EMS setups on certain days. For instance, on
practical applications, thus ensuring efficient energy the third day, the proposed EMS has a self-consumption of
management. 73%; meanwhile, the standard EMS is 61.4%. From that day
onwards, the proposed EMS is higher than standard EMS

Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on January 02,2025 at 09:17:57 UTC from IEEE Xplore. Restrictions apply.
243
2024 IEEE 10th International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA2024)

except on certain days, such as on day 10, where the proposed reserves. At 5 p.m., the battery has already reached its
EMS is 22.2%, while standard EMS is 57.4%. To further minimum SOC and requires charging before it can be
investigate these differences, the data for the day 3 and day 10 discharged again.
have been isolated and plotted.

Fig. 9. Proposed EMS battery and grid supply

Fig. 12. Standard EMS day 3

2) Day 10 Analysis
On day 10, the peak time for the peak load forecast is at 4
p.m. Fig. 13 shows that the battery is charging before 4 p.m.,
and the load demand before that time is already high, even
though it is not at its maximum. This is a limitation since the
proposed EMS only considers the time of the maximum peak
and not the threshold of maximum peak demand.
Coincidentally, the PV power available is also low during the
day, causing the SOC to increase very slowly.
Fig. 10. Standard EMS battery and grid supply

1) Day 3 Analysis
On day 3, the peak time for peak load is 10 a.m. Therefore,
the battery was supposed to be charging before 10 a.m. to
anticipate the peak demand. Fig.11 illustrates the battery SOC
results of the proposed EMS. In the proposed EMS strategy,
the battery prioritizes charging before peak load demand
periods. This approach ensures the battery maintains a
sufficient charge level throughout the day to meet energy
demands. As a result, the battery remains operational and
capable of supplying power continuously throughout the day.

Fig. 13. Proposed EMS day 10

Fig. 11. Proposed EMS day 3

In contrast, the standard EMS in Fig. 12 operates


differently. It immediately discharges battery power when Fig. 14. Standard EMS day 10
peak load hours arrive, leading to an early depletion of battery

Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on January 02,2025 at 09:17:57 UTC from IEEE Xplore. Restrictions apply.
244
2024 IEEE 10th International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA2024)

In Fig. 14, the starting point of the battery's SOC is much IV. CONCLUSION AND FUTURE WORK
higher compared to that in the proposed EMS. Therefore, there In conclusion, this study presents a robust EMS for
is enough power to supply until 2 PM before needing to microgrids, enhanced with deep learning techniques to
recharge again. effectively address the variability in renewable energy and
To further analyze the results, an economic analysis was dynamic load fluctuations. The integration of LSTM networks
conducted to evaluate the total electricity bill for each day. Fig. for load forecasting has proven to significantly optimize
15. illustrates the comparison between the total costs of the energy usage and reduce costs, as demonstrated by the 9.23%
proposed EMS and the standard EMS. The red circles reduction in monthly electricity bills compared to a standard
highlight the days when the total cost of the proposed EMS EMS. The detailed simulations and economic analyses
exceeds that of the standard EMS. There is a total of 9 days confirm the proposed EMS's superior performance in
where the proposed EMS incurs higher costs than the standard maintaining battery SOC and reducing reliance on grid power
EMS. However, this result is acceptable because there are during peak periods. These findings underscore the potential
more days where the proposed EMS's costs are significantly of advanced deep-learning models in revolutionizing
lower, leading to overall savings. microgrid energy management. Future work should explore
the integration of renewable energy forecasting and adaptive
threshold-based discharge strategies to enhance the EMS's
efficiency and applicability in diverse settings.
ACKNOWLEDGMENT
This work was partially supported by Petronas Research
Sdn Bhd under grant number SPP22-124-0124.
REFERENCES
[1] M. Uddin, H. Mo, D. Dong, S. Elsawah, J. Zhu, and J. M. Guerrero,
“Microgrids: A review, outstanding issues and future trends,” Energy
Strategy Rev., vol. 49, p. 101127, Sep. 2023.
[2] Y. Zahraoui et al., “Energy Management System in Microgrids: A
Comprehensive Review,” Sustainability, vol. 13, no. 19, Art. no. 19,
Sep. 2021, doi: 10.3390/su131910492.
Fig. 15. Daily electricity cost for 30 days [3] A. Shufian and N. Mohammad, “Modeling and analysis of cost-
effective energy management for integrated microgrids,” Clean. Eng.
TABLE IV. COMPARISON OF TOTAL COST FOR A MONTH Technol., vol. 8, p. 100508, Jun. 2022.
[4] L. F. Grisales-Noreña, O. D. Montoya, and C. A. Ramos-Paja, “An
Hour Proposed EMS Standard EMS energy management system for optimal operation of BSS in DC
Peak RM83609.57 RM96289.45 distributed generation environments based on a parallel PSO
Off-Peak RM40967.67 RM40967.67 algorithm,” J. Energy Storage, vol. 29, p. 101488, Jun. 2020.
Total Cost RM124577.24 RM137257.12 [5] R. A. Iringan Iii, A. M. S. Janer, and L. A. R. Tria, “A Machine-
learning Based Energy Management System for Microgrids with
Distributed Energy Resources and Storage,” in 2022 25th
Table IV shows the daily costs for the proposed EMS and International Conference on Electrical Machines and Systems
the standard EMS during peak and non-peak hours over a (ICEMS), Chiang Mai, Thailand: IEEE, Nov. 2022, pp. 1–6.
[6] J. Koskela, A. Mutanen, and P. Järventausta, “Using Load
month. During non-peak hours, the costs are identical for both Forecasting to Control Domestic Battery Energy Storage Systems,”
EMS because both systems prioritize battery charging during Energies, vol. 13, no. 15, 2020, doi: 10.3390/en13153946.
these times due to the lower electricity prices. However, [7] M. Moghimi, D. Leskarac, C. Bennett, J. Lu, and S. Stegen, “Rule-
during peak hours, the proposed EMS incurs significantly based Energy Management System in an Experimental Microgrid
lower costs than the standard EMS, with a difference of with the Presence of Time of Use Tariffs,” MATEC Web Conf., vol.
70, p. 10011, 2016, doi: 10.1051/matecconf/20167010011.
RM12,679.88. Overall, the total monthly cost is calculated for
[8] “Commercial and Residential Hourly Load Profiles for all TMY3
both systems, demonstrating that the proposed EMS achieves Locations in the United States.” National Renewable Energy
a 9.23% reduction in total costs compared to the standard Laboratory, Dec. 01, 2022. Accessed: May 17, 2024. [Online].
EMS. Available: https://catalog.data.gov/dataset/commercial-and-
residential-hourly-load-profiles-for-all-tmy3-locations-in-the-united-
The study demonstrates the superior performance of the state-bbc75
proposed EMS with integrated deep learning for load [9] C. Bracken, S. Underwood, A. Campbell, T. B. Thurber, and N.
forecasting in a microgrid setting. Over two months, the Voisin, “Hourly wind and solar generation profiles for every EIA
LSTM model has shown high accuracy, proving its practical 2020 plant in the CONUS.” Zenodo, May 05, 2023.
[10] I. H. Sarker, “Deep Learning: A Comprehensive Overview on
applicability. The 30-day simulation reveals the proposed Techniques, Taxonomy, Applications and Research Directions,” SN
EMS significantly outperforms the standard EMS, particularly Comput. Sci., vol. 2, no. 6, Art. no. 6, Nov. 2021.
in reducing peak-hour costs through strategic battery [11] M. Abumohsen, A. Y. Owda, and M. Owda, “Electrical Load
management. Daily analyses highlight the EMS's ability to Forecasting Using LSTM, GRU, and RNN Algorithms,” Energies,
maintain optimal battery SOC, ensuring continuous power vol. 16, no. 5, Art. no. 5, Jan. 2023, doi: 10.3390/en16052283.
[12] “TNB Better. Brighter.,” TNB Better. Brighter. Accessed: Jan. 17,
supply and reducing grid dependence. Economic analysis 2024. [Online]. Available: https://www.tnb.com.my/commercial-
shows a 9.23% reduction in monthly costs compared to the industrial/pricing-tariffs1/
standard EMS, validating the proposed EMS as a more
effective solution for microgrid energy management and
emphasizing its potential for broader adoption.

Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on January 02,2025 at 09:17:57 UTC from IEEE Xplore. Restrictions apply.
245

You might also like