An Energy Management Scheme for Hybrid Energy System Using Fuzzy Logic Controller

: This paper presents a Fuzzy Logic Controller-based energy management system (EMS) to control hybrid energy sources. The design is a single-phase and grid-tied system sized to handle the system's diverse load demands. The design system consists of photovoltaic modules, a grid source and a single-phase standby generator. The system uses energy produced by the PV modules (using Perturbation and Observation MPPT to maximize energy generated from the modules) and power stored in the Energy Storage Unit (ESU) to fulfil the various load needs while prioritizing the selling of excess energy to the grid. The fuzzy controller controls and manages the highlighted operational activities and prevents the ESU from overcharging and undercharging. Simulink is adopted to implement the proposed system within the simulation period; as the irradiation increased from 0W/m 2 to 100W/m 2 , the grid's power supply dropped from 6000W to 4000W because of the amount of PV power generation between 0.6s and 0.8s . The photovoltaic module contributed to the system's overall power consumption while keeping the DC bus voltage between 396V and 406V . The EMS using the fuzzy logic controller provides high levels of energy security, system effectiveness and O &M cost optimization. It has also offered a consistent and uninterrupted power supply


INTRODUCTION
The present effect of insufficient and unstable electrical energy generated, transmitted, and distributed from the national grid has crippled business productivity and survival in Nigeria, thereby weakening the nation's economy and human capacity development. It has also harmed life and caused discomfort to the citizens of the country (Momoh et al., 2018). The effects of poor energy delivery are numerous, affecting every facet of human life. Thus, there is a need to solve, compliment, and manage the problem of the effect of insufficient and unstable power supply constantly experienced across the nation.
Most parts of the nation are blessed with a long duration of solar irradiation of 5 to 6 hours daily (Abam et al., 2014;Akinyele et al., 2019a;Ogunjo et al., 2021). Because of this, the usage of solar renewable energies for producing clean and sustainable energy is expanding quickly in response to the country's social and political efforts and technical and economic progress (Fawkes, 2022). However, a system that solely relies on renewable energy from a single source (such as solar PV or wind energy) is not thought to be technically stable, especially for isolated loads in remote locations, because the availability of renewable energy sources may not be assured at all times due to the varying nature of the resource's outputs (Linn & Ya, 2014). Hence, hybrid power systems that combine conventional and renewable energy systems are needed.
Hybrid energy systems, as the name suggests, combine two or more methods of producing power, typically employing renewable technologies like solar PV and wind turbines (Taha et al., 2018;Olatomiwa & Mekhilef, 2015;Akinyele et al., 2019b). Hybrid energy systems offer high energy security through a combination of generation technologies. To further increase supply reliability and security, they frequently include a storage system (battery, fuel cell) or backup fossil fuel-based generator for continuous energy supply (Kamal et al., 2018;Linn & Ya, 2014;Surendra & Siva, 2015). Hybrid renewable energy systems are becoming more popular as grid-tied or stand-alone power systems supply in remote places due to advancements in renewable energy technology and the subsequent increase in the price of petroleum products which even posted toxic gas to the environment (Surendra & Siva, 2015). The unprofitability of a single energy source is a problem resolved by hybridizing two or more energy sources.
Additionally, a hybrid energy system offers several benefits, including smoother production, lower production costs, and higher reliability and dependability (Linn & Ya, 2014). A hybrid energy system often combines two or more renewable energy sources to maximise system efficiency and improve supply balance. These two or more renewable energy sources combined increase system efficiency and a more excellent balance in energy supply (Aoun et al., 2021;Surendra & Siva, 2015).
On the other hand, there is a need to manage power flow in a hybrid system since it comprises two or more energy sources, necessitating an energy management system (EMS). An EMS is a collection of computer-aided tools that electric utility grid managers use to monitor, regulate, and optimize the performance of the generated or transmission systems. It is also suitable for microgrids and other small-scale systems. Energy management and efficiency improvements have long been crucial for business and commerce. EMS is a system created to increase energy efficiency through process optimization by reporting on the precise energy used by each piece of equipment. More recent, cloud-based energy management systems can remotely control heating, ventilation, air conditioning (HVAC) and other energy-consuming equipment. These systems also collect detailed, real-time data on each piece of equipment and produce intelligent, targeted, real-time guidance on identifying and seizing the most compelling savings opportunities.
Many researchers have carried out works on energy management in hybrid energy systems; some of these works are discussed here: Zenned et al. (2019), worked on energy management strategies for hybrid power system (HPS), a sort of HPS made up of a fuel cell generator, wind turbine, solar generator, and battery storage system and the fuzzy logic control technique served as the foundation for the strategy. The hybrid power system was sized for the home's occupants to satisfy the required energy output. A MATLAB/Simulink was modelled to sell any excess electricity generated to the grid. The methodology was applied under climatic conditions (wind speed, solar irradiation and temperature). Bakht et al. (2015), researched a state-flow-based energy management strategy for hybrid energy systems to mitigate load shedding. The study looked into how state-flow could be used to create an energy management strategy for the renewable-based hybrid energy system. The hybrid energy system (HES) comprises Solar PV, energy storage units, and a diesel generator connected to a power grid subject to periodical load shedding. The EMS controlled the HES operation in both grid-connected and islanded modes of operation. It improved energy generation and consumption while ensuring a reliable power supply during load shedding. Lagorse et al. (2009), researched multiagent-fuzzy-logicbased-energy management of hybrid systems. In their work, the multiagent-system (MAS) technology was used as energy management in a stand-alone system. A simulation model was used to monitor the system's behaviour, showing that the suggested EMS could modify its response to different configurations. The EMS controlled the HES's energy flow while the MAS technology was used to create the distributed controller. Ferahtia et al. (2022), proposed an optimal energy management strategy for a DC microgrid. In their research, a commercial building power system was investigated, including one solar array, fuel cell, battery storage system, a bidirectional DC/AC grid converter and salp swarm algorithm (SSA) to develop the proposed EMS. The simulation findings showed that the EMS had excellent power management and performance, with the SSA-based EMS delivering good power quality and a safe operating environment. The proposed technique also allowed the loads to be met using local generators.
Uddin and Islam (2018) researched an intelligent power management controller based on fuzzy logic that combines grid power with battery backup, solar power, and wind power. The system can exchange electricity with the nearby grid. The fuzzy control method monitors solar and wind variations and battery state-of-charge. It calculates the load demand to choose the sources without using an exact numerical model and achieves more reliability than the conventional system.
Shyni and Ramadevi (2019), researched the energy management of a hybrid generation system using solar and wind energy. A common current-source multiple-input DC-DC converter connects the PV array, wind turbine, and battery storage. The fuzzy logic controller ensures the power management between intermittent renewable energy generation, energy storage, and the grid. By keeping the common dc voltage constant, the grid interface inverter directs the energy drawn from the PV array and wind turbine into the grid. As a result, the hybrid system's performance improves operational effectiveness, quality, and power availability.
Despite being competitive algorithms, the major drawback of existing methodologies, especially SSA techniques, is poor exploitation, slow convergence, and uneven exploration and exploitation operation. The primary reason why the SSA method is unable to address multi-objective situations when compared to fuzzy logic systems, which can offer the most effective solution to complex problems under a broader range of operating conditions, is that SSA only saves one solution as the best solution, making it impossible to store multiple solutions as the best solutions for a multi-objective problem. Fuzzy logic systems are straightforward to use and understand and allow for simple modification. The primary drawback and area for development in the study conducted by Uddin and Islam (2018) is the performance degradation brought about by output changes that do not match the load demand's time distribution.
The contribution of this present study is that the configuration of hybrid energy sources (HES) employed is the most prevalent one applicable in Nigeria. Due to Nigeria's unstable grid power supply, most houses and businesses rely on the grid (when available), generators and solar energy to meet their energy needs. The HES architecture and configuration approach, along with the designed EMS techniques using fuzzy logic, provide high levels of energy security, system effectiveness, and O & M cost optimization. It has also offered a consistent and uninterrupted power supply. This paper is structured as follows: The system configuration and architecture are briefly explained in section II. The specifics of the energy management methodology are presented in section III. The HES modelling is described in section IV. Section V presents the simulation results and discussion. The conclusion is presented in the last section.

II. THE HYBRID ENERGY SYSTEM ARCHITECTURE
The proposed HES architecture consists of solar PV modules, an energy storage unit, a single-phase standby generator, a DC-to-DC boost converter, an AC-to-DC bidirectional inverter, DC and AC loads, and an EMS control unit. The architectural layout of the suggested HES is shown in Figure 1.
The main objective of this proposed hybrid system is to supply the various types of loads throughout the system with a constant and uninterrupted supply of electricity and to supply any excess power generated to the grid and vice versa. The EMS control unit is programmed and developed to manage and control the energy generated and stored to meet the abovehighlighted objective with various real-life operating circumstances and scenarios. The proposed HES functions in two modes with each necessary to accomplish the goals listed above. It should be noted that the bus voltage is continuously monitored during both operational modes to make sure it is maintained at the specified set value.
MODE 1: The hybrid energy system uses the energy from the sun to power the load, charge the battery, and send any extra energy generated to the grid when there is high solar radiation. The battery, coupled to the DC bus through a DC-to-DC bidirectional converter, provides electricity to the grid and the connected loads during periods of low irradiation or at night when the state of charge (SOC) of the battery is above the prescribed SOC (only if the battery can meet the load demands).
MODE 2: When the energy storage unit (ESU) is somewhat low or lower than the required SOC, and the solar PV's power output is insufficient to satisfy the demand from the loads, the generator or the grid (when available) supplies the various loads and charges the ESU. The grid or generator supply is immediately switched off when the ESU is fully charged, causing the system to return to the initial mode (Mode1).
III. ENERGY MANAGEMENT SYSTEM CONTROL METHODOLOGY The HES uses a constructed fuzzy inferences system as EMS control to enable the hybrid system to be self-directive and entirely autonomous from manual operations and decisions. The proposed fuzzy interference system is illustrated and briefly explained in this section, along with the fuzzy logic theory (Chen et al., 2011;Lagorse et al., 2009;Rezk et al., 2019).
Zadeh first proposed the Fuzzy control theory in 1965 as a quantitative expression for ill-defined ideas (Singh et al., 2013;Voskoglou, 2018). Nowadays, applications for fuzzy logic may be found in various industries and other sectors. Due to its superior performance as an intelligent control system, it can displace more traditional controllers like proportionalintegral-derivative (PID) controllers. The use of energy dispatch and management in hybrid renewable energy systems are just some of its numerous benefits (Chen et al., 2011;Suganthi et al., 2015). A fuzzy control system is designed on fuzzy-logic principles; by making logic segments of neither zero nor one viable. The so-called fuzzy logic creates a haven between the conventional zero and one. It gives conceptual ideas and experiences a broader and more flexible place to express themselves through logical reasoning. This is so because it uses a collection of qualitative criteria that are established by semantic descriptions. A fuzzy controller is different from conventional or traditional controllers because it is developed using various techniques, such as the Mamdani methodology (Zenned et al., 2017), which is the most basic method. After all, it is founded on human experimental knowledge of the system under study (Chen et al., 2011;Mahyiddin et al., 2016). This fuzzy logic controller (FLC) implemented in this design is shown in Figure 2.
In Figure 2, the EMS created for the HES is a fuzzy logicbased controller. The fuzzy controller is intended to be in charging mode or discharging mode in order to achieve the appropriate SOC value. The fuzzy control's input variables are SOC and P, and its output variable is Iref. The Eqns. (1) and (2) lists the definitions of the input and output variables.
SOC >= SOC command (1) ΔP = P pv − P L (2) Where; SOC is the State of Charge of the batteries. P pv is the Power generated by the PV. P L is total load connected across the system. The inputs ΔP and battery SOC are implemented using the fuzzy triangular member function. The input variable SOC has fuzzy membership of four grades: L (low), M (medium), H (High), and VH(very high), while ΔP has membership functions of fuzzy control containing five grades: NB (negative big), NS (negative small), Z (zero), PS (positive small), and PB (positive big) and the output variables has four grades: NS (negative small), Z (zero), PB (positive big) PS (positive small) of membership function as shown in Figures 3, 4 and 5 respectively. The FLC uses IF-THEN statements to establish relationships between outputs and inputs. The statement's "if" clauses explain both input and, if true, the output sections (Hamarsheh, 2018).
In Figure 3, the battery state of charge (SOC) rating was subdivided into four membership functions, 0 to 40 to represent low, 40 to 60 to represent medium, 60 to 80 to represent high, and 80 to 100 to represent very high grade.
In Figure 4, the power difference (∆P) was subdivided into five membership functions, -10k to -4k to represent NB, -8k to 0k to represent NS, 0k to 8k to represent PS, 4k to 10k to represent PB and while Z was maintained at zero range.
In Figure 5, the fuzzy output (Iref) was subdivided into four membership functions, -10 to 0 to represent NB, 0 to 30 to represent PS, 30 to 50 to represent PB, and Z was maintained at zero range.
If the ΔP is negative, it indicates that renewable energy does not provide the load with adequate power. Consequently, the battery must be used in charging mode; if the SOC is low, i.e. SOC is less than SOCcommand, and the battery operates in discharge mode when SOC is greater than SOCcommand. This study's control rules prioritize selling additional electricity generated from PV and electricity stored in the battery into the grid. Fuzzy control design guidelines are established to maintain battery SOCcommand at 40% to increase the lifespan of the storage batteries.
The fuzzy rules for the suggested system are displayed in Table 1. For instance, when the input variable ∆P is NB (the amount of electricity to sell to gird is minimal) and the input variable SOC is H, the output variable Iref is PB (the degree of discharging current is large) (greater than the SOC command and the membership degree is small).
However, when the input variable ∆P is PB (the amount of electricity to sell is considerable) and the input variable SOC is low, the output variable Iref is NB (the level of charging current is maintained) (smaller than the SOCcommand and the membership degree is small).
IV. HYBRID ENERGY SYSTEM MODELING MATLAB/Simulink is used to create and control the HES simulation circuit. The suggested architectural circuit and control design of HES is depicted in Figure 2. The MATLAB/Simulink software allows for real-life scenario simulations that consider changing lighting conditions, varying DC and AC loads, and fuzzy logic control reactions to diverse working operations.

A. Solar PV Module
The PV component of the hybrid system has an Isotech ISTH215P modular with a mixed parallel and series combination. Modelling a solar cell using a "one-diode" comparable circuit is possible, as seen in Figure 6. The solar panel consists of photovoltaic cells with the following characteristics: a shunt resistance Rsh, a serial resistance Rs, and a diode. Eqn. (3) represents the generated current from the PV panel (Rashid, 2011).
The junction current ID is given by the equation: The shunt resistor's RSh shunt current expression is as follows: NP : number of parallel strings and NS : number of modules in series.
The Isotech ISTH215P PV parameter is shown in Table 2 and its I-V and its d P-V characteristics of are shown in Fig.7    For better output power efficiency, the PV uses Perturb and Observe (P&O) maximum power point tracking MPPT algorithm. To achieve this, Mat-lab Function was used.

B. PV Boost Converter Design with (P&O) MPPT Algorithm
One of the most basic switch-mode converter varieties is the boost converter. It is a dc-to-dc converter made of an inductor, a semiconductor switch (MOSFET), a diode, a capacitor, and a load resistor; its output voltage is greater than the source voltage. The equivalent circuit of the boost converter is shown in Figure 8, and the converter specification is presented in Table 3. Energy can be transported from a PV array to an electrical system more effectively with the help of the MPPT. The primary purpose is to change the panel's output voltage to supply the load with the most energy possible. The control system, the tracking component, and the switch-mode dc-dc converter make up the majority of modern designs. The entire supply is built around the switch-mode converter. Voltage converters are created to provide a fixed input voltage or current corresponding to the maximum power point by arranging the switch mode section in different topologies, such as buck or boost converter. A controller is required to continuously monitor the PV system and ensure that it operates at the PV maximum power point by tracking the MPPT to implement the abovementioned procedure. To use either a voltage-controlled technique or a power feedback control, the controller continuously measures the voltage and current values produced by the PV and compares them to specific threshold values (Rashid, 2011;Konstantinou & Hredzak, 2021).
The P&O approach uses a few measurable factors and a straightforward feedback system. It works by managing the array current, regularly perturbing (i.e., increasing or decreasing) the duty cycle, and comparing the PV output power to that of the preceding perturbation cycle. To ascertain the movement of the operating point, it measures the derivatives of power and voltage. If the perturbation increases (or decreases) in array power, the following perturbation is made in the same (or opposite) direction. This low-cost method is simple to use and distinguish by continually tracking and effectively obtaining a significant amount of power from PV (Rashid, 2011    Eqns. (7) and (8) Where Vin is input voltage from the PV Vop is output voltage of the boost converter Fsw is switching frequency Iin is input PV voltage Iop is output current L is boost converter inductance value C is boost converter capacitance value ∆V is ripple voltage ∆I is ripple current of the inductor

C. Energy Storage Unit/Battery System
When considering an energy storage unit (battery bank) for HES, the battery bank must be sized to meet the load demand during unfavourable weather and climatic conditions (Memon & Patel, 2021). Lead acid, lithium, zinc bromide, zinc chloride, sodium-sulfur, nickel-hydrogen, redox, and vanadium batteries are among the several battery types that are offered. One of the biggest obstacles to improving PV power systems is affordable electrical energy storage availability. Lead-acid batteries are typically used to provide energy storage for a few hours to a few days. Lead-acid batteries are frequently used for remote region power supplies due to their affordable price and extensive availability (Albright, 2012;Rashid, 2011). When selecting batteries for solar energy applications, the following factors are taken into consideration: Intense discharge (70-80 per cent depth of discharge), low current during charging or draining, long-duration charge and discharge (long duty cycle), variable and erratic charge/discharge, minimal self-discharge, long lifespan, low and price. Table 4: shows the battery parameter and specification used during the simulation.
In this study, a bank battery is utilized to store any extra power generated and keep track of the electricity going to the load. The battery bank's state of charge (SOC) should be considered in this situation. There are two procedures: (i) Charging process: the expression state conditions for the charging process is when ∆P is Positive Big or Small (PB or PS) for operational mode 1. While for mode 2, when ∆P is NB and SOC is very low or at medium region. (ii) Discharge process: The expression state conditions for discharging process regardless of the operational modes is when ∆P is Negative Big and Small (NB or NS), and SOC is in the very high region.

D. DC -DC Bidirectional Converter
A bidirectional buck converter acts like a boost converter when current is flowing from the output to the input. A buck converter with a reversed current flow is how a bidirectional boost converter functions. The controllable switches must be driven alternately with enough dead time between them if they must be driven simultaneously for any reason, such as to avoid the DCMto prevent a shot-through current. The batterycharged controller is archived using a bidirectional converter. The controllable semiconductor switches are switched using PWM generated from a PID-operated microcontroller to drive the switches as required (Uddin & Islam, 2018;Konstantinou & Hredzak, 2021;Rashid, 2011). The bidirectional converter equivalent circuit is shown in Figure 9.

E. AC/DC Bidirectional Inverter
The bidirectional DC to AC inverter transfers power from the DC stage to the associated AC grid. The inverter can also transmit power from the associated AC grid to the DC stage. At the same time, the DC loading demand is minimal if the DC energy is inadequate to meet the DC loading requirement (Taha et al., 2018). The inverter is connected to the utility by an LCL filter (with specifications shown in Table 5); it is a single-phase full-bridge inverter with a conventional voltage source PWM inverter. The input voltage produced by the PV modules needs to be greater than the utility's peak voltage. The efficiency is around 97%. Also required for power decoupling between PV modules and the utility is a sizable capacitor (Konstantinou & Hredzak, 2021;Rashid, 2011). Power converters with a rectifier input stage use LCL filters specifically made to limit harmonic current absorption. Eqns. (11), (12) and (13) are used to derive capacitance and inductance values, respectively (Rekioua, 2020;Rashid, 2011). Table 5 gives the parameters of the LCL filter.
Where C is the filter capacitances value L1 is the inverter side inductance value L2 is grid side inductance value Fsw is the switching frequency of the filter I is the rated current of the filter ∆Ippmax is ripple current of the filter V is bus voltage Vac is single phase grid voltage S is rated power in KVA

F. The Grid and Generator Supply
The grid supply is the distribution network to the domestic consumer at 230V. The power is supplied to the customer via a service drop and an electricity meter. The generator is an electric generator, often known as a dynamo, and is a backup power supply source that transforms mechanical energy into electricity. It can be powered by diesel or petrol. A home backup generator provides electricity directly to the home's electrical system, allowing backup to the entire house or simply the essential electrical appliance in the home. Both the grid and generator are single-phase power supplies.

V. SIMULATION RESULT AND DISCUSSION
Before integrating the entire HES circuit, the various sections of the HES circuit and control were initially simulated and tested. The results were graphically and digitally shown with the aid of the scope and display block in Simulink. Figure  10 shows the MATLAB/Simulink model circuit and control diagram. The simulation sampling time was set to 1us, and the simulation period was set at 1s. During the simulation, temperature and solar irradiance were varied within the simulation period, and the MPPT of the output power and current is depicted in Figure 11. Figure 12 shows the various varying loads across the system.
At the initial stage, a 1kW DC load was connected across the DC bus. After 0.05s, another 2kW was connected, totaling a 3kW DC load throughout the simulation. Also, a 2kW AC load was connected after 0.1s across the AC bus. The battery SOC was set to 35 per cent, and the voltage battery's volt was 51V. The voltage and SOC graphs show an increment, which means the battery is charging. The battery charging voltage is maintained at 5A for varying loads across the system. DC bus voltage was maintained at 396V to 406V throughout the simulation period, as shown in Figure 13. Figures 14 and 15 shows that from 0s to 0.4s, when solar irradiation is sufficient, the power generated by the PV meets the varying loads' demand, charges the battery bank and supplies excess power fed to the grid. From 0.4s to 0.8s, the solar irradiation is insufficient to meet the load demand (assuming no grid power supply), and the system automatically switches to operational mode 2. After that, the generator meets the load demands and charges the battery (NOTE: from 0.6s, there is a drop in power supply by the generator because the PV partially supply the loads). From 0.8s to 1s, the system restores to Mode 1 because irradiation is back to maximum.
The first graph in Figure 16 (Pgrid) shows the grid power within the preset simulation time. From the graph, the power fed to the grid from 0s to 0.25s varied between 1732W to 5124W (due to different loads across the system). Furthermore, after 0.25s, the power fed dropped from 5124W to 0W (due to irradiation reduction). After 0.8s, irradiation hit maximum; power was provided to the grid again at 0.83s from 0W to 5481W. N.B At maximum irradiation of 1000W/m2, power generated from the PV varies from 11,000W to 12,000W.
It is established that the techniques used in this study respond to various load distributions at any given point in time as against the study carried out by Uddin and Islam (2018), where the output variation of the renewable sources used might not match the time distribution of the load demand with respect to time. However, the fuzzy logic technique used in the present application enabled quick and efficient switching between the operational modes and response to output variation of the energy sources and adaptation to various load demands types at any given point in time (i.e. the output variation of the source matches the load demands). VI. CONCLUSION In this paper, a fuzzy logic energy management system was developed for a hybrid energy system to control the different energy sources and operational modes. The results show how efficient and effective the methodology used to manage the demand for energy sources and loads is. Fuzzy logic techniques allow for simple modification, altering the controller's performance. It outperforms other controllers in complex, nonlinear or undefinable systems for which there is good practical knowledge. The fuzzy logic energy management approaches used here have higher performance, quick operational mode switching across a range of energy sources, and the ability to respond to diverse load demand types at any given time (i.e. the output variation does not depend on time variation). The method also protects the energy storage unit from overcharging and undercharging. When correctly scaled, it can satisfy load demand and sell electricity to the grid (i.e., prioritizing the selling of extra power), which reduces fuel consumption and decrease the need to utilize a backup generator frequently. Because renewable energy sources are unpredictable and intermittent, adding a standby generator increases the reliability of the system. Finally, the suggested HES and EMS design can be adopted globally for residential and small-scale commercial applications.