# Battery Energy Management System Using Edge-Driven Fuzzy Logic

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Power Balance Equation

_{L}is the electric load power; ${P}_{PV}$ is the supplied PV power; ${V}_{B}$ and ${I}_{B}$ are the batteries bank voltage and current, respectively; ${P}_{g}$ is the exchanged grid power; $\alpha $ is the grid relay ($\alpha \mathsf{\u03f5}\left[\mathrm{0,1}\right]$); and ${\eta}_{PV}$ and ${\eta}_{b}$ are the efficiency of PV and the batteries bank system, respectively, including the power converters’ efficiencies.

#### 2.2. Battery State of Charge Equation

_{0}) is the initial SOC at time t

_{0}in (%); C is the battery nominal capacity in (Ah); and I

_{B}is the battery charge/discharge current in (A), which is obtained using Equation (3).

_{B}is the algebraic value of the batteries’ power. To reduce the algorithm complexity, ${V}_{B}$ is chosen as constant all the time (48 V).

#### 2.3. Fuzzy Logic Control Structure

- Algebraic difference between PV power supply and building power demand (ΔP).
- ESS SOC.
- Dynamic electricity price (EP).

- Decreasing the cost of energy imported from the grid utility taking into consideration the hourly electricity price.
- Maximizing the PV power share.
- Charging the batteries from the grid when the electricity price is low and from the excess PV power when it is high; the latter option is feasible by opening the external relay.
- Inject more power to the public grid when the electricity price is high.
- Keep SOC between the two upper and lower allowable limits.
- Maximize the use of PV power for load supply, especially when the power price is high.
- Operate the microgrid independently of the electrical grid as much as the system constraints allow.

#### 2.4. Constraints

_{min}and SOC

_{max}are the predefined minimum and maximum limits of ESS SOC, respectively; and ∆T is the cycling control time.

#### 2.5. Baseline Method (Rule-Based EMS)

## 3. Validation System Description

#### 3.1. System Components

#### 3.2. PC—Xtender Communication Protocol

- >scom.exe --port=COM3 --verbose=3 write_property src_addr=1 dst_addr=101
- object_type=2 object_id=1138 property_id=5 format=FLOAT value=12.0

## 4. Results and Discussion

#### 4.1. Rule-Based EMS Test

#### 4.2. Fuzzy-Based EMS Test

#### 4.2.1. Partially Cloudy Day Test

#### 4.2.2. Sunny Day Test

## 5. Conclusions

- An infinity of operation conditions can be considered during the evaluation of the system status data before performing control.
- Smooth control of ESS SOC.
- The ability to add various data inputs with less complexity compared to rule-based EMS approaches.
- Thanks to the edge communication interface, EMS commands can be sent via a low-level controller (PLC), which needs some additional software configurations, or directly to power converters without the need for any BEMS modifications. This last option is recommended only during the commissioning or test phase.
- Thanks to the high hardware resources of the edge device, a high-level programming language, combined with industrial communication protocols, makes it possible to implement advanced EMS algorithms in BEMS.

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Appendix A

ΔP | dP++ | dP+ | dP0 | dP− | dP−− | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|

EP-L | SOC−H | P+ | R1 | - | R0 | - | R0 | P+ | R1 | P+ | R1 |

SOC−M | P− | R1 | P− | R1 | P− | R1 | P− | R1 | P− | R1 | |

SOC−L | P−− | R1 | P−− | R1 | P−− | R1 | P−− | R1 | P−− | R1 | |

EP-M | SOC−H | P+ | R1 | P+ | R1 | P+ | R1 | P+ | R1 | P++ | R1 |

SOC−M | P0 | R1 | P0 | R1 | - | R0 | - | R0 | P+ | R1 | |

SOC−L | P− | R1 | P− | R1 | P− | R1 | - | R0 | P−− | R1 | |

EL-H | SOC−H | P++ | R1 | P++ | R1 | P++ | R1 | P++ | R1 | P++ | R1 |

SOC−M | P+ | R1 | - | R0 | - | R0 | - | R0 | P+ | R1 | |

SOC−L | P− | R1 | P− | R1 | P− | R1 | - | R0 | P− | R1 |

_{PV}-P

_{L}) value to a high negative one, respectively. In Table A1, orange cells correspond to the grid feeding mode (ESS discharging) and blue ones correspond to ESS charging modes, while green ones correspond to island mode. Each cell is divided into two parts: the right one relates to the external relay status (R0: relay is opened; R1: relay is closed), while the left part is related to the ESS power reference, in which the values are ordered from the high negative value to high positive one according to the quantities P−−, P−, P0−, P+, and P++.

## Appendix B

## References

- International Energy Agency. Energy Technology Perspectives 2012: Pathways to a Clean Energy System; International Energy Agency: Paris, France, 2012. [Google Scholar]
- Saadon, S.; Gaillard, L.; Giroux-Julien, S.; Menezo, C. Simulation study of a naturally-ventilated building integrated photovoltaic/thermal (BIPV/T) envelope. Renew. Energy
**2016**, 87, 517–531. [Google Scholar] [CrossRef] - Wang, W.L.; Liu, Y.S.; Wu, X.F.; Xu, Y.; Yu, W.Y.; Zhao, C.J.; Zhong, Y.B. Environmental assessments and economic performance of BAPV and BIPV systems in Shanghai. Energy Build.
**2016**, 130, 98–106. [Google Scholar] [CrossRef] - Qureshi, W.A.; Nair, N.-K.C.; Farid, M.M. Impact of energy storage in buildings on electricity demand side management. Energy Convers. Manag.
**2011**, 52, 2110–2120. [Google Scholar] [CrossRef] - Li, R.; Satchwell, A.J.; Finn, D.; Christensen, T.H.; Kummert, M.; Le Dréau, J.; Lopes, R.A.; Madsen, H.; Salom, J.; Henze, G.; et al. Ten questions concerning energy flexibility in buildings. Build. Environ.
**2022**, 223, 109461. [Google Scholar] [CrossRef] - Habib, M.; Ladjici, A.A.; Bollin, E.; Schmidt, M. One-day ahead predictive management ofbuilding hybrid power system improvingenergy cost and batteries lifetime. IET Renew. Power Gener.
**2019**, 13, 482–490. [Google Scholar] [CrossRef] - Habib, M.; Ladjici, A.A.; Khoucha, F. Frequency Control in Off-Grid Hybrid Diesel/PV/Battery Power System. In Proceedings of the International Conference on Electrical Engineering, Algiers, Algeria, 13–15 December 2015. [Google Scholar]
- Habib, M.; Ladjici, A.A.; Harrag, A. Microgrid management using hybrid inverter fuzzy-based control. Neural Comput. Applications
**2020**, 32, 9093–9111. [Google Scholar] [CrossRef] - Long, B.; Jeong, T.W.; Lee, J.D.; Jung, Y.C.; Chong, K.T. Energy Management of a Hybrid AC–DC Micro-Grid Based on a Battery Testing System. Energies
**2015**, 8, 1181–1194. [Google Scholar] [CrossRef] - Ferrández-Pastor, F.-J.; Mora, H.; Jimeno-Morenilla, A.; Volckaert, B. Deployment of IoT Edge and Fog Computing Technologies to Develop Smart Building Services. Sustainability
**2018**, 10, 3832. [Google Scholar] [CrossRef] - Hashmi, S.A.; Ali, C.F.; Zafar, S. Internet of things and cloud computing-based energymanagement system for demand side managementin smart grid. Int. J. Energy Res.
**2021**, 45, 1007–1022. [Google Scholar] [CrossRef] - Singh, H.; Gupta, M.M.; Meitzler, T.; Hou, Z.-G.; Garg, K.K.; Solo, A.M.G.; Zadeh, L.A. Real-Life Applications of Fuzzy Logic. Adv. Fuzzy Syst.
**2013**, 2013, 581879. [Google Scholar] [CrossRef] - Suganthi, L.; Iniyan, S.; Samuel, A. Applications of fuzzy logic in renewable energy systems—A review. Renew. Sustain. Energy Rev.
**2015**, 48, 585–607. [Google Scholar] [CrossRef] - Chaouachi, A.; Kamel, R.M.; Andoulsi, R.; Nagasaka, K. Multiobjective Intelligent Energy Management for a Microgrid. IEEE Trans. Ind. Electron.
**2013**, 60, 1688–1699. [Google Scholar] [CrossRef] - Garcıa, P.; Torreglosa, J.P.; Fernandez, L.M.; Jurado, F. Optimal energy management system for stand-alone wind turbine/photovoltaic/hydrogen/battery hybrid system with supervisory control based on fuzzy logic. Int. J. Hydrogen Energy
**2013**, 38, 14146–14158. [Google Scholar] [CrossRef] - Abadlia, I.; Bahi, T.; Bouzeria, H. Energy management strategy based on fuzzy logic for compound RES/ESS used in stand-alone application. Int. J. Hydrogen Energy
**2016**, 41, 16705–16717. [Google Scholar] [CrossRef] - Al-Sakkaf, S.; Kassas, M.; Khalid, M.; Abido, M.A. An Energy Management System for Residential Autonomous DC Microgrid Using Optimized Fuzzy Logic Controller Considering Economic Dispatch. Energies
**2019**, 12, 1457. [Google Scholar] [CrossRef] - Yuan, Y.; Zhang, T.; Shen, B.; Yan, X.; Long, T. AFuzzyLogic Energy Management Strategy for a Photovoltaic/Diesel/Battery Hybrid Ship Based on Experimental Database. Energies
**2018**, 11, 2211. [Google Scholar] [CrossRef]

**Figure 4.**Membership functions of fuzzy controller inputs: (

**a**) power difference Pout between PV supply and load (W), (

**b**) ESS SOC level (%), and (

**c**) electricity price EP (€/MWh).

**Figure 5.**Fuzzy surfaces between inputs and outputs: (

**a**) ESS current (Ib) as function of power difference (Pout) and SOC; (

**b**) grid external relay (R) as a function of power difference (Pout) and SOC; (

**c**) ESS current (Ib) as a function of SOC and electricity price (EP); and (

**d**) grid external relay (R) as a function of SOC and electricity price (EP).

Component | Subcomponent | Parameter | Value |
---|---|---|---|

PV system | PV module | Power at MPP | 240 Wp |

Voltage at MPP | 30.0 V | ||

Current at MPP | 8.1 A | ||

Open-circuit voltage | 37.4 V | ||

Short-circuit current | 8.6 A | ||

Temperature coefficient | −0.46%/K | ||

Module model | Bosch solar module c-Si M 60 | ||

PV power plant | Number of modules | 27 | |

Inclination | 9 × 35° 18 × 30° | ||

Alignment | 180° south | ||

Power | 6.3 KWp | ||

Batteries’ system | Battery cell | Voltage | 4 V |

Nominal capacity | 546 Ah | ||

Battery model | Rolls Battery 4CS17P | ||

Batteries’ bank | Number of cells in series | 12 | |

Number of cells in parallel | 1 | ||

Power | 4.5 KW | ||

Programmable load | - | Nominal power | 3.6 KW |

Load mode | Constant power | ||

Control mode | Remote | ||

Model | Chroma 63,803 |

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. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Habib, M.; Bollin, E.; Wang, Q.
Battery Energy Management System Using Edge-Driven Fuzzy Logic. *Energies* **2023**, *16*, 3539.
https://doi.org/10.3390/en16083539

**AMA Style**

Habib M, Bollin E, Wang Q.
Battery Energy Management System Using Edge-Driven Fuzzy Logic. *Energies*. 2023; 16(8):3539.
https://doi.org/10.3390/en16083539

**Chicago/Turabian Style**

Habib, Mustapha, Elmar Bollin, and Qian Wang.
2023. "Battery Energy Management System Using Edge-Driven Fuzzy Logic" *Energies* 16, no. 8: 3539.
https://doi.org/10.3390/en16083539