Enhanced Intelligent Energy Management System for a Renewable Energy-based AC

: This paper proposes an enhanced energy management system (EEMS) for a residential AC microgrid. The renewable energy ‐ based AC microgrid with hybrid energy storage is broken down into three distinct parts: a photovoltaic (PV) array as a green energy source, a battery (BT) and a supercapacitor (SC) as a hybrid energy storage system (HESS), and apartments and electric vehicles, given that the system is for residential areas. The developed EEMS ensures the optimal use of the PV arrays’ production, aiming to decrease electricity bills while reducing fast power changes in the battery, which increases the reliability of the system, since the battery undergoes fewer charging/discharging cycles. The proposed EEMS is a hybrid control strategy, which is composed of two stages: a state machine (SM) control to ensure the optimal operation of the battery, and an operating mode (OM) for the best operation of the SC. The obtained results show that the EEMS successfully involves SC during fast load and PV generation changes by decreasing the number of BT charging/discharging cycles, which significantly increases the system’s life span. Moreover, power loss is decreased during passing clouds phases by decreasing the power error between the extracted power by the sources and the required equivalent; the improvement in efficiency reaches 9.5%.


Introduction
Natural resources such as oil, coal and natural gas are being consumed massively, which has resulted in not only a sharp decrease in the availability and accessibility of such resources, but also in severe environmental pollution [1,2]. Many researchers were inspired to address these problems [3,4]. Renewable energy has become the most promising candidate to address this issue on a large scale [5]. Solar energy is an attractive renewable energy source; one advantage is that it can be used in remote areas, where the grid extensions are costly [6][7][8][9]. Due to the fluctuating nature of solar irradiance, solar energy must be used with alternate power devices or storage systems [10,11]. According to the conditions, the storage system can include a hybrid BT/SC storage system. Hence, the combination of solar and BT/SC is considered as an excellent solution due to its reliability and efficiency, as well as its fast load response and flexibility [12].
A broad research community around the globe is investigating various hybrid renewable power generation structures. In [13] and [14], the authors presented an investigation of a standalone system. Their work aimed to optimize a real-time demand response model for a microgrid working in island mode by using various energy management strategies at the residential and grid levels. In [15], the authors proposed advanced load management for a hybrid renewable power system for remote housing. A sizing approach for a hybrid power system (PV/BT/SC) was developed in [16] using three control strategies which are responsible for controlling a suitable energy management system. In [17], the authors presented a new approach which consists of the specification, configuration, and operational characteristics of a grid-connected renewable energy system. In [18], the authors proposed an advanced energy management system for a residential system using a solar system. Their system is intended to control fans, machines and lights. Meanwhile, the authors in [19] proposed a fuel cell BT/SC for a residential system. The main aim of their work was to compare different energy management strategies for a fuel cell hybrid power system. Their EMS treats and evaluates hydrogen consumption, the state of charges (SoC)s of batteries and super-capacitors, as well as the overall system efficiency. The energy management techniques presented for comparison are [16,17]:  State machine control strategy  Rule-based fuzzy logic strategy  Classical proportional integral (PI) control strategy  Frequency decoupling and fuzzy logic strategy  Equivalent consumption minimization strategy (ECMS) In [20] and [21], a new approach for a PV/BT/SC system was presented. The system offers two operation modes, i.e., unit-power control mode and feeder-flow control mode. The authors also proposed five EMSs for a hybrid PV/BT/SC system. Their EMSs treat and evaluate the efficiency of battery energy [22]. The main aim of their work was to combine the three EMSs based on the battery state of charge and the SC state [23].
Compared to the previous study cited above, the work presented in this paper is noteworthy for developing a detailed model of renewable energy sources with improvements regarding the following.
 The system and its devices: Instead of using batteries as storage means in the same way as other researchers, an SC is used to enable the system to follow fast-changing load demands while allowing the battery to respond at slower rates. SC is characterized by instantaneous power and much faster response times (charging/discharging) than those of batteries [24].  Reliability improvement: As the battery is retained to respond to slow load/PV production changes through assigning the SC to the fast ones, the battery life span is increased [25].  The proposed EEMS: Previous EMSs use a condition for each component, as well as for the control of the deficit and excess power. One of our achievements was to update these classical strategies by controlling the system elements using decision (or connection) variables. However, these variables may react to facilitate rapid reactions against any power fluctuation using decision making [26].  Study of the global power: The developed work in this paper is compared to other related studies, where the overall power of the system is evaluated and discussed, covering aspects that were ignored in some research articles [27].
The main advantage of the proposed EEMS strategy compared to PI is its minimization of the maximum possible power required from the grid, and especially during consumption peaks. This improves the performance of the energy management system, and an almost optimal solution can be obtained.
The paper is organized as follows: a description of the hybrid system is given in Section 2. Section 3 presents modelling of the overall system. Section 4 treats and presents the energy management unit of the hybrid system. The simulation results are shown and discussed in Section 5, and Section 6 provides the conclusions. Figure 1 shows a typical structure of a residential power system that consists of the following components:

System Description and Methodology
 Solar PV panels.
 Lithium-ion batteries (BT), considered as a long-term power source.
 Super-capacitor (SC), considered as a short-term power source.
 Grid, which is resorted to during low solar irradiance and when the SC and BT are in discharged states.  Enhanced energy management system: EEMS. In this paper, an EEMS for a microgrid system-based residential system is proposed (in our application, we used a microgrid for five houses). The deployment of the system was shown to be an excellent option to improve energy security in all respects, e.g., reliability, power quality and environmental protection. The PV works as a primary energy source feeding the load and the HESS through a DC-DC converter, which achieves the PV maximum power point tracking (MPPT) control [28][29][30]. A HESS represents a backup source when the power generated by the PV is insufficient to support the AC load. The BT is used, primarily, to ensure power energy coverage during low solar irradiance. Furthermore, BT can provide the required power during permanent phases like PV production shortfalls and energy braking. SC is used to supervise and manage the transient and fluctuating power of the energy recovery, due to its fast-dynamic power exchange. A grid is introduced in order to ensure the supply of energy during PV and BT power shortages. An EEMS is proposed to meet the interconnection requirements, to optimize the performance of the power sources and to maintain sustainability. To design an intelligent EMS, the system and its dynamics should be well understood; hence, the mathematical model of each component in the system is developed as follows.

System Modeling
This section is divided into subheadings. It provides a concise and precise description of the experimental results, their interpretation as well as the experimental conclusions that can be drawn.

PV Model
To ensure maximum efficiency whatever the conditions of sunlight and temperature, the PV strings are connected to a DC-DC converter controlled by an MPPT algorithm. Then, the estimation of the overall electric power PPV produced by the PV surface SPV can be observed, as shown in Figure  2; note that G in this figure refers to solar irradiance. The PV overall efficiency ηPV can be obtained from the following mathematical equations [31] and [32].
where Ta is the ambient temperature, Gtot is the total solar radiation received by the PV panel, Tc the cell temperature, GNOCT is the nominal solar radiation, Tr is the reference temperature, βPV is the temperature coefficient and ηmanuf is the nominal efficiency.

Battery Model
To ensure the simulation stability, a filtered battery current, instead of the actual battery, is used to account for the polarization resistance [33]. The model parameters are derived from datasheets or simple dynamic tests. Figure 3a shows a simplified battery equivalent circuit, whereas Figure 3b shows the battery discharge characteristics over time, and different discharge currents. From Figure  3a, the battery voltage can be expressed as follows [34,35]: ( . ) . 0.1 where E0 is the battery constant voltage (V), K is the polarization constant (V/Ah), Q is the battery capacity (Ah), i * is the filtered battery current (A), Ab is the exponential zone amplitude (V), B is the exponential zone time constant inverse (Ah−1) and Rb is the battery internal resistance (Ω). Equation (2) recalls the equations of the Shepherd model for a Li-ion accumulator in case of charge (IBT < 0) and discharge (IBT > 0) [36].

SuperCapacitor Model
The SCs are included due to their high power density and low equivalent series resistance. These characteristics lead to greater efficiency, higher load current, low heat loss and longer life span. Therefore, there might be a low risk of full discharge, and the system should be discharged before servicing to reduce the risk of electric shock during maintenance [37]. The SC current-voltage relationship (see Figure 4) and state of charge are expressed as follows [38]: where C is capacitance (F), RSC is the supercapacitor module resistance (Ω) and ISC is the supercapacitor module current (A).

Load Profile
A residential system is adopted in this paper as a microgrid. Real measurements, which were taken in southern Tunisia, were used to represent a typical month ( Figure 5). In the chosen residential area, the heating is nonelectric, and the profile of load depends only on the daily activities of consumers (e.g. TV, microwave, refrigerator, etc.) [37]. Variations in the load profile according to the number of consumers and the seasons were also observed [38,39].

Energy Management Strategy
An energy management strategy was developed to ensure a maximized PV production, long battery and SC life spans, and lower electricity bills with high overall efficiency. To achieve these goals, an EEMS that controls the energy produced by the different energy sources according to the load demand was developed. In this paper, a control strategy is proposed based on the aforementioned requirements, as shown in Figure 5. First, the difference between the electric load required by the user (PL) and the generated one from the PV arrays (PPV) was estimated. The difference between these two power terms represents the power shortfall or surplus. As expressed in Equation (4), by dividing this difference by the battery and SC operation voltage, it is possible to determine the charging or discharge current (Istorage), which will eventually influence the battery and SC SoCs.
The following subsections describe both the classical PI controller-based EMS and the developed EEMS in detail.

Classical PI Control Strategy
The energy storage system, comprising the battery and SC, is controlled using a PI regulator. The PI regulator reference is calculated by subtracting the load power from the PV power. At each time instant (i), energy EL used to supply the load and the energy produced by the PV panels EPV are compared. If EPV is greater than EL, the excess energy is used to charge the storage energy system. Otherwise, the storage energy system is discharged to compensate for a lack of energy. The PI controller presented in Figure 6 takes into consideration the SoCmin and SoCmax limits of the battery. Equation (5) evaluates the energy difference between the load consumption and PV production: Figure 6 shows an illustration of the PI-based EMS presented in [17], with a slight modification, since the energy storage system adopted in this paper consists of two elements.

The Enhanced Energy Management Strategy (EEMS)
The proposed EEMS is a flexible and highly efficient energy management system, which is controlled using various parameters such as the load demand and the BT, as well as SC state of charges (respectively SoCBT and SoCSC). The proposed EEMS aims to maintain the proper functioning of the system by appropriately distributing the energy flow between the components of the system.
To achieve this, the control strategy proposed in this work acts to provide a continuous load supply under various conditions according to hybrid energy management with a state machine and an operating mode strategy. To have efficient control of the battery, the state machine control strategy implemented consists of six states. It ensures optimal operation using the PV/BT system based on the battery state of charge (SoCBT) level and the load. In this context, the PV and battery both have selective sources to ensure the load demand. The required energy can be fully met with the energy emitted by at least one source.
Thus, the state machine chooses the appropriate component to provide the load demand. According to the PV fluctuation during the production phase, the PV and BT may not be able to ensure the load demand. Based on the operating mode, the SC seems to be the best solution to resolve all of the PV or load fluctuations. Figure 7 describes the principle of the EEMS with the hybrid EMS according to the state machine and the operating mode. Thereby, the EEMS tends to define system performance through its operational state. In the flowchart shown in Figure 7, PL is the load power, PBT is the battery power, PBP is the sum of the battery and PV powers, and PSC is the SC power. The proposed EEMS is composed of two control techniques, i.e., state machine and operating mode, as explained below:

State Machine EMS
Mode1: |PL−PPV|  PBT_Max State 1: if PPV is greater than PL, then the battery floats and the PV power is limted to load one. To ensure the best system operation and the best system stability, according to the state of PBP=PPV+PBT, the SC is controlled as follows: If PL is greater than PBP and SoCSC is not at its maximum, the SC charges and recovers all of the power loss. If PL is less than PBP and SoCSC is not at its minimum, the SC discharges and supplies all of the needed power to the load. If PL is equal to PBP, the SC floats.

Results and Discussion
This part is devoted to a performance evaluation of the proposed EEMS. Indeed, numerous simulation tests were performed in the Matlab/Simulink environment to obtain the evaluation results, which were then analyzed and discussed in detail. The PV, BT and SC parameters are shown in Table 1. To perform these tests according to realistic conditions, real load profiles, which were measured in a building containing five apartments in El Manar, South Tunisia, were used. The rated power of this PV power plant was 18 kW (Figure 8) [40]. The used PV power and load profiles were provided by the Tunisian electricity and gas supplier company (STEG). Therefore, the orientation of the EEMS was more focused on Tunisia and its neighboring countries, such as Algeria and Libya, since they have similar climates and load demands. The hybrid system refers to the measured experimental PV average daily production data profiles as "power". These measured data are necessary to evaluate and control the system behavior. Figure 8 presents the obtained measured data. To obtain the results according to different meteorological states, the PV production was multiplied by percentages as follows: 0% no production; 30% temporary clear skies; 50% passing clouds; and 100% maximum production. Figure 9 presents the used power profiles (Load, PV production) with and without passing clouds.   By comparing the results displayed in Figure 10a,c to those displayed in Figure 10b,d, it can be seen that the PI-based control strategy employs the SC less than the proposed EEMS, as highlighted by rectangles A and B. The differences can be significant, especially at midday, where the PV production is at its peak, as well as during the night (6-9 pm), where the load demand increases. Moreover, the proposed EEMS employed the SC well during times of passing clouds, in contrast to the PI-based control method. Thus, the changes occurring in the system behavior depend on the PV system control and the state-of-charge fluctuations of the storage devices (BT, SC). Hence, by referring to the PV production, the system verifies its ability to manage the energy demand by comparing the needs with its operating capacity. More plots are presented in the paper to further show how the SC is employed. Figure 11a shows the SoC of the SC during the whole day, where the system was tested by both the conventional control method, based on the PI controller, and the proposed EEMS. As shown in this figure, the SoC of the SC obtained by the proposed EEMS goes higher than the one obtained by the PI-based control strategy at midday, when PV production occurs in significant quantities. From the same figure, it can be seen that during the night, where the load demand increases, the SC interferes more by the proposed EEMS than with the PI-based control method. The results in Figure 11b present the power error between what is required by consumers and what is delivered by the system, using both control methods being tested. As shown in this figure, the power delivered to the load by the PI-based control method deviated slightly from the desired one throughout the entire day. In contrast, the proposed EEMS operated with fewer errors regarding the power required by the load and the delivered supply. The main reason for the improvement shown in the proposed EEMS compared to the PI-based control structure is the use of the SC, which has faster response times compared to the battery. Further investigations were performed using more specific PV production and load profiles. In these load profiles, one weekday from May, one weekend day from May, one weekday from December, and one weekend day from December were considered. In this way, the proposed EEMS was tested by applying different possible scenarios. Figure 8 shows the PV production during the four seasons of the year, which were measured in central-southern Tunisia. Figures 12 and 13 show the system operating with passing clouds on the May weekday and weekend day, respectively, by using the proposed control strategy. The EEMS system tended to define the system performance according to its operational state with a SoCBT condition of 20%. The power fluctuations observed in the system were mainly due to two factors, i.e., variations in the weather conditions, which sometimes allows the PV to satisfy only the load demand, and fluctuations of energy consumption. The latter must be managed quickly and correctly by the system; to this end, the system goes through several steps. Consequently, the rest of the simulation results are split into two modes:  Stand-alone mode: In this case, the EEMS system controls the excess or power deficit by storage means (BT and SC) while the system is disconnected from the grid.  Grid-connected mode: In this case, the EEMS system controls the power excess or deficit by storage means (BT and SC) where SoCBT is kept above 20%; otherwise, the grid controls the deficit control.
As can be seen in Figures 12 and 13, which correspond to the system operating using the proposed EEMS during a weekday and a weekend day in May, respectively, the microgrid was working in standalone from 0 am to 4 am. At approximately 4 am, when the SoCBT reached its minimum, the microgrid was switched to grid-connected mode. With the start of the day, where the solar irradiance increased, the power consumed by the grid started to decrease, since the PV arrays contributed to providing power to the grid. At around 10 am, the power consumed by the grid reached its minimum, and eventually, the system was disconnected from the grid. As the solar irradiance and the power generated by the PV arrays kept increasing, the excess of power was used to charge the batteries. The microgrid system was operating as a stand-alone system during the remaining time of that day. The difference between Figures 12 and 13 lies in the load demand, which was more significant during the weekend, as residents usually stay at home and perform household duties like doing laundry, cleaning, etc. As shown in Figures 14 and 15, which correspond to the system when it was operating using the proposed EEMS during a December weekday and weekend day, the microgrid worked in standalone mode from 0 am to 6 pm and from 0 am to 5 am, respectively. Note that the SoCBT was set 60% at the start of this test, similar to the case of May. In the case of the weekend, and after 5 pm, the system was switched to grid-connected mode, since the battery had been discharged. Except from 4 am to 5 am, the difference in power between load and PV was greater than the maximum battery power, when the battery and the grid were supposed to satisfy the difference in load. Although solar irradiance started to increase, the system was still working in grid-connected mode, since the PV produced power is not enough to feed the load. Around midday, the system was disconnected from the grid several times as the PV generated power increased; indeed, this was enough even to charge the batteries for some time. The power that was used to charge the battery was consumed just after midday as the solar irradiance decreased. The system was connected to the grid from then until the end of the day. Therefore, the batteries were not used for extended periods during the winter, as they do not get fully charged, which consequently increases the electricity bills of consumers.  Figure 15. EEMS with passing clouds, a weekend day in December was used as a case study: (a) powers; (b) the SoCs.
The overall system performance varies according to the used EMS strategy, as shown in Figure  16. As shown, the best performance was obtained by the proposed EEMS, with and average efficiency of 91.5%, while the PI showed an average efficiency of 82%. Therefore, it can be concluded that the EEMS seems to be the most suitable forward strategy, since it offers the best features with the constraint of passing clouds compared to the PI strategy. The overall hybrid system performance depends on the PV production, stored energy and feed load. Indeed, the system error was tested using two strategies, as shown in Figure 11. Thus, the best performance was observed for EEMS compared with PI-based EMS. Therefore, it can be concluded that the EEMS seems to be the most suitable system, since it offers the best features with a constraint of greater power fluctuation reduction compared to PI-based systems.
The drawback of the proposed method is that hysteresis control is required to generate the switching states, which affects the response of the EMS to changes in load demand. As discussed earlier, the output of the algorithm is reference power, which is divided by the battery voltage and the DC-DC converter efficiency to obtain the battery and supercapacitor reference currents. Moreover, this EEMS does not take into account the variability in electricity prices.

Conclusions
This paper proposed and evaluated an EEMS for a residential microgrid system. The developed EEMS consists of two parts, i.e., the state machine strategy and operating mode, and aims to optimize the harvested energy from the PV as well as the energy stored in the energy storage system. Furthermore, the presented EEMS was designed to increase the battery lifespan by introducing a supercapacitor into the energy storage system. The supercapacitor regulates fast load and PV changes, while the battery is applied for slow ones, which reduces the number of battery cycles, and hence, extends the battery lifespan. The EEMS was evaluated against its counterpart, i.e., the PI-based EMS, using an experimental electrical load profile measured in El Manar-Tunisia, and a PV profile measured in central-southern Tunisia. The obtained results showed that system efficiency improved from 82% to 91.5% using the proposed EEMS.
Author Contributions: M.D. and A.L. written the paper and performed the tests. J.M.G.and A.A. and Y.A.A.T. helped in orgonizing the ideas and setting the structure of the paper. A.C. helped in finilizing and reviewing the paper. All authors have read and agreed to the published version of the manuscript.