Energy management system for grid-connected solar photovoltaic with battery using MATLAB simulation tool

Abstract Fuzzy logic controller system is one of the intelligent methods of energy management system that aims at conserving energy. The effectiveness of fuzzy logic controller is depending on set of restrictions, linguistic variables, values, and number of probabilistic combinations of resources to formulate the rules. These should be considered to obtain optimal results in terms of energy conservation. Therefore, the objective of this study was to maximize power supply from solar and battery for energy saving. The evaluated performances in this study were the demand and supply. Optimization was conducted with the rule-based fuzzy logic control system in MAT LAB software. A total of thirty-three (33) number of combinations/rules were performed. Using rule viewer tool in Mat lab as performance analysis, it was observed that the demand was the main set of restriction for all three resources to supply (35.3 contribution of grid,17.5 contribution of battery, and 17.5 contribution of solar, respectively), while the grid had the highest contribution to supply 35.3 kW of demand. Rule based fuzzy shown that the results obtained are in total conformance to that of the traditional energy management method, with intelligently switch the load to the available resources at a time. Thus, 80% of the national grid energy was saved during day time and 35% during night time. The majority of the loads were shared by solar in day time and battery and grid in night time.


PUBLIC INTEREST STATEMENT
There has been growing interest in solar energy due to it is easy to use, less pollutant, abundant in nature and drop of solar cost in recent years. Fuzzy logic controller system is one of the intelligent methods of energy management system that aims at conserving energy. The effectiveness of fuzzy logic controller is depending on set of restrictions, linguistic variables, values, and number of probabilistic combinations of resources to formulate the rules. These should be considered to obtain optimal results in terms of energy conservation. Fuzzy logic approach is used due to its ability to obtain precise by include partial condition with degree of membership function. In Ethiopia, most of the populations live without access to electricity and electric power interruption is common incident. Thus, intelligent energy management system is a modern solution to electrify more areas and improve power system reliability.

Introduction
Fuzzy controller, which is based on fuzzy logic is much closer to human thinking and lingual expressions than traditional logical systems. This provides a means of converting a linguistic control strategy based on expert knowledge into an automatic control strategy (Azizi et al., 2020). The objective of intelligent management system is to save energy consumption from the national grid. Energy conservation is prevention wasteful use of resource. Saving energy was an activity that customer must exercise. Fuzzy logic control is an intelligent management tool that serves to manage the energy for energy saving (Ponce et al., 2020;Singh et al., 2020;Vivas et al., 2020). Fuzzy control system has logical rules that optimally share the power from grid, solar, and battery intelligently (Mohammadzadeh & Rathinasamy, 2020;Vivas et al., 2020;Xu et al., 2020).
Energy saving technology to maximize supply from renewable/solar source is a reasonable choice for energy saving (Leonard et al., 2020;Zhao et al., 2020). Intelligent control system is a best way to improve the traditional energy management system. Therefore, the study was conducted to find out efficient energy management system that uses the available resources like solar, national grid and battery. This intelligent control system reduces the electric power instructions and the need of building new power plant.
Energy conservation reduces the need of building new power plants. Therefore, energy conservation is an important strategy to use electric power efficiently and economically. Due to this efficient use of electric power system reliability is highly improved and it gives time to think about new plant installations. Hence, the reliability problem is reduced with efficient energy management system.
There are different energy management system-related studies in which fuzzy logic controller has been used for different perspectives. Fuzzy controller system has been used for energy management. The existing literature review explored that different researchers used different energy management methods. This study contributes to the existing literature by proposing rule base fuzzy control system that compares the available resource with the load demand at various times a day. Time of a day is considered as set the restrictions in logical rule formulation.
A country like Ethiopia, where 85% of the populations live without access to electricity and poor power system reliability, intelligent energy management system is a modern solution. Energy saving technology is an ideal solution to electrify more areas and improve power system reliability (Fikre & Berhanu, 2019;Gadisa & Taffa, 2019;Kasaw & Haile, 2019;Teshome, 2019). Therefore, the objective of this study was to maximize the energy consumption from solar and battery.

Literature review
There are different intelligent energy management system-related studies in which fuzzy logic controller has been used in different perspectives. Fuzzy logic controller has been used for energy management for different energy sources.
The rule-based methodology has been used to manage the energy from different resources. Logical rule base control systems provide a systematic and apparent way to enclose multiple probabilistic combination conditions. Al-Sakkaf et al., (2019) Review provided an application of fuzzy in energy management and suggested that fuzzy logic control is the most popular method. Peng et al., (2020) used the rule base fuzzy logic method to control a hybrid energy system.
The existing literature review explored that different researchers used different fuzzy control methods. This study contributes to the existing literature by proposing rule based fuzzy control system that considered time of a day as set the restrictions in logical rule formulation in addition to the available resource and the load demand at various times a day.

Study area and period
Smart energy management system is conducted in Ashuda town from January 1, 2020 to January 21, 2020. Ashuda is a town in South Achefer woreda in Amhara regional state. It is 90 kilometers away from Bahir Dar, which is the capital city of Amhara regional state. There is no substation in the town. Dangila substation, which is 50 km away, serves to the town and the surrounding community.
Ashuda is located in the north-western parts of Ethiopia between 11.6° North latitude 36.91° East longitude. The town has about 800 households. 600 households are considered small 200 households are large based on the level of income (Ayele et al., 2020). The town has one health center, one high school and elementary school. There was electricity access to town and the surrounding community. However, interruption is a common incident and community suffers with power interruption.

Resource assessment
Resources are anything coming from outside the system that is used by the system to generate electric power. Renewable resources are dependent on geographical locations. The solar resource potential depends on latitude, longitude, and environmental conditions. Solar resource potential data indicates the amount of radiation that strikes Earth's surface in a typical year. The data can be presented as hourly average solar radiation on the horizontal surface (kWh/m 2 ) (Table 1)/ ( Figure 1). Data were collected using interview, website/metrological (Islam et al., 2019) data, and direct measurements. Three weeks were given for data collectors and supervisors for 5 days on methods of taking data from electric customers through interviewing, and direct measurement.

Load demand analysis
The total load of the community was very important in designing power plants. Thus, the size and cost of hybrid system were depending on the amount of electrical loads (Table 2). Electrical loads were estimated by listing all electrical appliances, estimate appliances rating, multiply by number of hours used in each day and add up the watt hours for all appliances.
The total estimated peak load indicated (Table 3) is not the actual peak load that will be seen by the system. This is due to all the loads allocated for a certain time period thatmight not be switched on at the same time. Therefore, daily load of the village varies largely throughout the day. The average daily energy demand of the village is about 1529.226kWh and the needed number of module calculated as (Panigrahi & Thakur, 2019).  Where: N ms À Number of modules in series Number of modules connected in parallel is obtained from 3 The total number of modules required to generate 1529.226kWh/day power is calculated as:

Battery bank capacity sizing
The battery bank capacity required is obtained from 5 (Vargas et al., 2019)  The selected inverter capacity should be greater than 246; 221:25W with 72 V system voltage. 5 kW rating inverter was used to size the inverter capacity. The total number of inverters required is calculated as:

Charge controller sizing
The rated current of the regulator (Vargas et al., 2019)

Fuzzy logic controller of energy management
The fuzzy controller was used to manage the energy and make decisions according to the written rule (Table 4). Thus, Fuzzy logic controller was an intelligent tool to manage the loading condition, so as to maximize use of solar PV and battery (Tushabe, 2019;Yuchen & Zhong, 2019). Fuzzy logic is multivalued logic, in between Yes case and No case there were partial cases addressed by fuzzy logic controller. This partial cases in between were membership values, atmospheric conditions were monotonically increased, and monotonically decreased membership this type was triangular. Thus, triangular membership function was selected in this study. Then, scaling/normalization was used to normalize the inputs in a specific range. Inputs were converted from classical values (Yes, No) to of fuzzy values (Fuzzification). Fuzzy values were also converted into classical values (defuzzification).
The hybrid system components were solar, national grid, and battery (Table 4). The generation capacity of hybrid system would satisfy the energy demand based on weather conditions. Fuzzy controller system was used to manage the solar PV, national grid, and battery efficiently to save the energy. The controller system looked the loads, and then switched to the available resources (Table 5) to satisfy load demand. Thus, there was no more electric power interruptions, which is a serious problem in the country (Anteneh & Khan, 2019;Mandefro, 2019;Tola et al., 2019). The energy balance between the total generation and the total demand was satisfied with the fuzzy logic controller. The principal requirements of hybrid system were the availability of renewable energy resources, and the combinations were formulated.

Fuzzy logic-based relaying system model for proposed energy management
The fuzzy logic interfacing system (Figure 2) system was used to make an intelligent decisions based on the given rules (Kviesis et al., 2020; Ponce et al., 2020; Wu et al., 2020). Therefore, it is more precise than traditional relaying system (Figure 2). The logical controller was an intelligent tool to manage the load, so as to save the grid energy.
The proposed fuzzy logic control system inputs were: PD represents the community electric power demand.
DT represents the time of a day.
PB represents the electric power from battery sources.
PO represents the output power.
PS represents the electric power from solar sources.
PNg represents the electric power from national grid sources.

Membership function of proposed control system
The membership function is all about how the input, map to member values (Guerra et al., 2020;Melin et al., 2019;Radhakrishna et al., 2019). Fuzzy logic energy management system is multi logic, like low, medium, and large to address these partial conditions logical system controller like fuzzy is a very important tool. The partial conditions are always in between membership values (Al-Sakkaf et al., 2019;Tascioni et al., 2020;Vivas et al., 2020).
PD represents the membership function of electric load demand that consists of low, medium, and large.
DT represents the membership function of time of a day, which covers 24-hours day and night (6 am to 6 pm and 6 pm to 6 am).
PB represents the membership function of battery power sources which has nil, medium, and large.
PO represents the membership function of output power which consists of PB-only, PS-only, PS +PB, and national grid.
PS represents the membership functions of solar power sources, which has low, medium, and large.
PNg represents the membership function of electric power from national grid sources; it consists yes/no state or available/not available.

Proposed control system rules
In modeling the logical controller, set the restrictions, determining the linguistic variables and values are important to formulate rules for logical controller (Jana et al., 2019;Liu et al., 2015). In this study, there were five inputs and one output for the controller. The input linguistic variables were solar power (PS), national grid power (PNg), battery power (PB), Power demand (PD), and time of a day and output linguistic variable was out power (Po). Solar and battery power inputs have low, Medium, and high and nil, medium, and high linguistic values, respectively. Power output has linguistic values PNg, PS, PB, and PS+PB. MATLAB/Simulink was used to write (Table 1), rules so as to maximize energy consumption from solar and battery. The rules were written; by considering the probability of resources combination, energy balance in which power generated was equal or to power demand.

Performance evaluation
There were 33 combinations of inputs; each column shows that membership function for a particular input. Each membership function in set is associated with a particular rule which maps with input variable values (Figure 3). The first row corresponds to the first rule and the plots in the output column show how the rules are played to the output. A performance of the control system is evaluated by demand and supply balances. In the rule viewer, it was observed that the demand was satisfied with nation grid supply (35.3 contribution of grid, 17.5 contribution of battery, and 17.5 contribution of solar, respectively); hence, the grid had the highest contribution to supply 35.3 kW of demand. The aforementioned combination is one of the probabilistic combinations among 33 logical combinations. Thus, satisfying demand was the main set of restrictions for all resources to supply load. Medium

30-35kW Large
Rule viewer had shown that intelligent rule-based controller switches the load to the available resources. It was evident that the demand was satisfied according to the resources availability and generation capacity at a time. Therefore, controller was used to switch the load demand among solar, battery, and grid. Thus solar, battery, and grid serve the community load 24 hours without any electric power interruptions (Figure 3). The load management system automatically switches light and medium to solar or battery and large load to the sum of solar and battery power at day time. And the light and medium loads switches to battery and large loads to grid at night time based on the sources availability.

Conclusions
There was load sharing among solar, battery, and national based on their availability. This load sharing contributes to fill the energy gap of the country. It is also used to improve electric power system reliability and give time to install new power plant.
Power demand, solar power, battery power, and time of a day were the determinant factors for rule base logical controller formulations. From row one the logical combination (35.3 kW contribution of grid, 17.5 kW contribution of battery, and 17.5 kW contribution of solar, respectively), the grid had the highest contribution to supply 35.3 kW of the demand.
It is concluded that in this critical energy crisis situation using all of energy sources around the community, with some smart energy management system is a reasonable choice. Therefore, using every possibility for the energy conservation is important to overcome the energy crisis in Ethiopia. On the basis of resource potential of Ethiopia, it is suggested to the government to start intelligent energy management system that can combine the national grid and solar resources.