# Clustering and Fuzzy Logic-Based Demand-Side Management for Solar Microgrid Operation: Case Study of Ngurudoto Microgrid, Arusha, Tanzania

Authors: Godiana Hagile Philipo; Yusufu Abeid Chande Jande; Thomas Kivevele
Journal: Advances in Fuzzy Systems
 (2021)

---

## Abstract

Permanent electricity availability should not be taken for granted since grid sustainability and reliability are at stake when there is no balance between supply and demand. This paper employs a load balancing demand-side management (DSM) approach based on fuzzy logic, considering the low energy users who have insignificant influence on system peaks. Through the K-means clustering algorithm, suitable candidates for DSM are identified, and the control mechanism is based on energy utilization and load priority. The results reveal that about 3.7 kW in power saving was achieved per month. This result indicates that, with a proper energy management strategy for an individual customer, almost a flatter load profile and power saving can be achieved.


---

## Body

## 1. Introduction

Electrical energy has been one of the most unsubstitutable and flexible sources of energy [1]. It is a vital resource in boosting the economy of any country. Therefore, electricity intake is on the ever-increasing side leading to unreliable and low grid efficiency [2]. Meeting this ever-increasing demand means overexploiting the limited resources by establishing new power plants [3]. Towards meeting sustainable energy goals, microgrids have gained popularity as a worldwide trend of exploring green energy technologies [4–6]. Microgrids’ challenges regarding reliability and stability have compelled many types of research on how to match demand with the available supply [7–9]. Also, finding appropriate ways of energy saving through customer-utility involvement has led to the concept of demand-side management (DSM) [10]. Through DSM, moderating power consumption and decreasing peak demand have become the most significant concern of both customers and utility companies [11, 12]. Therefore, in achieving sustainability, reliability, and stability of any electricity grid, DSM is indispensable and unavoidable [11].DSM refers to programs seeking to modify consumers’ energy consumption through efficiency improvements or shifting loads on the electric grid's customer side [13]. They encourage customers to consume less during peak hours and more in off-peak hours through financial incentives and behavioural change [10, 14]. DSM can be categorized as energy efficiency and demand response (DR) as illustrated in Figure 1. Energy efficiency programs encourage users to consume less energy while enjoying the same service level through energy-efficient devices [15]. DR programs target the demand profile whereby customers may either reduce their consumption during peak periods without altering the off-peak periods [16–18] or shift some loads from peak hours to off-peak hours due to high prices imposed during peak periods [13, 16]. DR consists of intended electricity consumption pattern adjustments by end-users aiming at altering the total energy consumption or the timing and level of a sudden rise in demand [16, 19]. It has three main categories: time of use (ToU), direct load control, and load shifting. ToU method is when there are no fixed electricity prices; instead, different prices are set for other usage times, and high fees are imposed during peak loads. The electricity price is determined by how much and when electricity is used [20].Figure 1
General classification of DSM.In the direct control method, utilities have access to end-user customers and limit customers' electricity usage by switching down some of the appliances during peak demands. Most of the appliances suitable for direct load control are heavy loads such as refrigerators, air conditioners, and cooling devices [21]. Load shifting is shifting loads from peak to off-peak times to allow even distribution of the load. This method does not change the overall energy consumed; as an alternative, it keeps the demand and supply to the required possible level to increase system efficiency.Apart from the mentioned programs, DSM makes use of various methods such as electricity tariffs [22], incentives [23], penalties [24], power-saving technologies, and government policies [25–27]. Incentive mechanisms are programs wherein a customer is being paid a monetary amount for his ability to reduce load during peak hours. This amount is separate from their standard rates of electricity applied, and it can be carried out as bill rebates or cash compensation [28, 29]. The pricing mechanism uses different prices apart from ToU to reveal the cost and value of electricity within that hour. It is divided into two: real-time pricing (RTP) and critical peak pricing (CPP). RTP rates a varying price throughout the day by dividing a day into slots while CPP is when the electricity market charges differently depending on the supply cost of electricity [30]. DSM and DR can be used interchangeably.By tradition, utilities have been managing demand from their side through reducing transmission losses and increasing generation capacities without success [31]. Through DRPs, successful energy management is possible; however, when usage patterns and customers’ behaviours are taken into account, more realistic results can be attained since they are crucial towards success load management and decision making [32].


## 2. Related Works and Contribution

Referring to the available literature works, different researchers have implemented energy management in the electricity market using fuzzy logic. Yuan et al. (2018) proposed an energy management strategy based on fuzzy logic to distribute generated energy depending on the load demanded adequately. The method presented an improvement in the overall performance of the system [9]. On the other hand, Nehrir et al. (1999) implemented a customer-interactive DSM strategy using fuzzy logic to shift the water heater’s usage pattern [33]. Results offered the possibility of flattening the load profile through fuzzy rules.Similarly, through the fuzzy controller, three parameters were taken into account: cost, demand, and comfort. The benefit of renewables was analyzed to show how they impact cost and energy saving. Results showed better improvement of load profile through shutting down of loads during peak hours [34].Also, the application of fuzzy logic has been realized in hybrid microgrids for energy management and supervisory control [35–38]. Multiagent energy management based on fuzzy logic was introduced, aiming at managing energy in a stand-alone renewable energy system [39]. Ravibabu et al. (2009) developed a fuzzy-based DSM controller to reduce peaks by prioritizing vital loads during peak hours [1]. He did not take care of the customers’ comfort, and the research was limited to a single house. Another implementation of a fuzzy-based DSM was done for the residential customers of a grid-connected microgrid by assuming that both the loads and generations are noncontrollable. The simulation results of 25 rules presented improvement in the profile [40].Furthermore, a DSM for residential customers was employed using the multiscale and multilayer method. Each household was equipped with its control system to limit loads during peak periods [41]. A multiagent-based DR was proposed based on the multistep hierarchical algorithm for a multimicrogrid system to ensure its reliability and cost reduction. The method proved to be more cost-effective compared to conventional energy management systems [42]. A dynamic pricing DR was illustrated using reinforcement learning, which took care of the service provider's benefit and customers’ cost reduction. Simulation results promised a balanced and reliable power system with reduced energy and operation cost [43]. To improve grid resilience and provide a cost-optimal solution for system operators, both mixed-integer linear and nonlinear approximation were used. The MINLP result is too large for nonlinear and nonconvex networks to provide efficient solutions [44].On the other hand, providing an optimal solution using mixed-integer linear programming is time-consuming and slow, especially for larger datasets [45]. Most of the explained energy management system relies on traditional methods such as abstract and deterministic rules, which mainly encounter disadvantages like their inability to guarantee optimal results, especially when there are any fluctuations in the variables. Besides, abstract works usually approximate reality and rely on the developer’s experience, hence sometimes unrealistic [43]. The significant advantage of fuzzy logic over others is that no mathematical modelling is needed for the controller design. The outputs and inputs of a fuzzy controller are mapped with membership functions, and final rules are set to obtain the desired outcome [46]. Also, upon an unexpected change in the system parameters, no modifications are required in the controller, and since the outputs depend on the effects of the inputs, the same rule base can still be used [47].Generally speaking, many DSM methods based on fuzzy logic have been implemented; however, most of these studies did not take care of the customers' usage patterns and their load types. Also, demand response programs in electricity markets have predominantly been conducted in developed countries compared to developing ones [10, 48, 49]. Obtained results may not be feasible to most developing countries’ load profiles due to less flexible loads and even low per capita energy consumption [2]. Moreover, the behaviour point of view in developing countries with many isolated microgrids is different from well-established countries with reliable power. Therefore, the present study aims at bridging this gap by developing a DSM based on fuzzy logic to control other clusters of customers independently to enhance customer participation since energy management is following how much and when they consume electricity. In this study, clustering and load limiting reduce the burden to low energy users as they do not influence peaks in the system. The study has utilized data collected from Ngurudoto solar microgrid, Arusha, Tanzania. The proposed method presents the potential of balancing energy in the microgrid based on the load limiting.The new contributions of this work can be listed as follows:(i)
A new fuzzy logic-based DSM approach has been proposed to match microgrid customers’ real situations in the developing world with a vast difference in consumption(ii)
The clustering approach has been used to facilitate customer prioritization; hence, low energy users did not suffer energy management burden(iii)
The adopted method can enhance or trigger the DSM’s embracement since the benefit is equally distributed depending on the potentiality of energy usage(iv)
Customer usage pattern has been well established, which helps the power provider and customers plan for both energies, comfort, and cost-saving properly


## 3. Materials and Methods

### 3.1. Data Collection

Consumption data were collected from a solar battery microgrid called Ngurudoto based in Arusha, Tanzania. It has a 7.5 kW capacity with wireless and communication modules for data communication, as shown in Figure2. Electricity consumption was recorded using smart meters installed in each house. For each intelligent meter, real-time data were recorded using a combination of remote sensing devices, a data logger, and a remote PC. Collected demand data were analyzed using Microsoft Excel, Python, and Matlab. Fuzzy logic was done using MATLAB R2018a software.Figure 2
Data collection framework.


### 3.2. K-Means Clustering

K-means clustering is an unsupervised machine learning algorithm in which the grouping is done based on similarities and differences. It requires the following inputs:(i)
Number of cluster centres (K)(ii)
Training sets (x1, x2, x3…)The methodologies involved in K-means clustering are summarized in Figure3 and explained as follows:(i)
The first step involves randomly initializing the value of K, which represents the number of clusters to be formed. The optimal value ofK can be calculated using the elbow method.(ii)
Distance between the data points and the initialized cluster centres is calculated by using the sum of square distance as follows:(1)WSS=∑DXi,Yi2=∑i=1N∑j=1NXij−Yij2.(iii)
Depending on the minimum distance obtained, data points are grouped to the nearest cluster centres.(iv)
The new centroid is calculated from the groups of data points moved to the same group, i.e.,μ=∑data points in a certain cluster/total data points in thatcluster(v)
The mean is now repositioned as a new centroid.(vi)
This process is repeated to all the clusters until there is no change in cluster centroids representing the clusters formed.Figure 3
K-means clustering algorithm.


### 3.3. Case Study

The main objective of this study was to design a DSM model for load management during peak hours. The microgrid located in Arusha, Tanzania, was considered as a case study whereby connected houses were grouped according to their usage patterns through clustering. The loads were also grouped into two groups: vital and nonvital, as illustrated in Table1 to appreciate their importance. By applying DSM based on load priority and direct load control techniques, consumption was limited through cutting off nonvital loads during peak hours to supply power to the vital loads. Figure 4 represents the proposed model for controlling the loads according to their priority during peak hours. F1, F2, F3, and F4 are the fuses connected to the houses’ nonvital loads in the respective clusters. The clusters suitable for energy management were selected according to the energy usage resulted from load profile classification. This selection helped prevent low energy users from the burden of the high cost of energy management.Table 1
Total loads in the microgrid with their classifications.
S. no.Name of the loadPower consumption (W)Number of loadsDescription depending on the priority1.Fridges904Nonvital2.Radios56Vital3.Tube lights4036Vital4.Computers154Vital5.Televisions603Nonvital6.Phones438Vital7.Water pump2001NonvitalFigure 4
Proposed model for fuzzy logic load control.The fuses have a control signal from the fuzzy controller which trip off during peak hours when the load exceeds the set limit. This mechanism allows shutting down of only nonvital loads leaving the vital loads connected. The selection of loads is based on customer priority. The fuzzy logic controller being the central part of the circuit has two inputs: time and comparator. A comparator compares the reference set maximum current and the current flowing while the timer in the input time checks whether it is peak or off-peak. The outputs of the two are then fed to the fuzzy controller. A controller’s output sends the desired control signal to the connected houses to limit the power consumption.


### 3.4. Fuzzy Logic Controller

The fuzzy controller is an artificial intelligence system that can be used to either reduce, control, or modify power consumption. It works so that only consumers’ priority loads are connected during peak hours, and within the off-peak hours, loads can be increased without exceeding the limit. The general working mechanism of a fuzzy controller contains the following components:(i)
Input(ii)
Fuzzification(iii)
Inference engine (rules)(iv)
Defuzzification(v)
Output


### 3.5. Fuzzy Membership Functions

For all the input and output variables, fuzzy membership functions are essential for defining linguistic rules that govern their relationships. For this case, the trapezoidal membership function is used for input time, as shown in Figure5.Figure 5
Input membership function for time.Figure6 shows zmf and smf, the most appropriate membership function for the feedback or comparator. For the output signals, constant and linear membership functions were used, as shown in Figure 7.Figure 6
Input membership function for feedback.Figure 7
Output membership function for clusters.The most crucial task in the designing of the fuzzy controller is the development of the fuzzy rules. The number of rules always depends on the number of considered membership functions for both input and output blocks. In this study, the fuzzy controller is designed to limit power usage during peak hours by switching off some of the loads depending on the priority set. In this study, several rules are used, a few of them being mentioned below:(i)
If time is off-peak (am) and feedback is < set current limit (A), then cluster 3 is all, cluster 4 is all, and cluster 8 is all(ii)
If time is peak (am) and feedback is < set current limit (A), then cluster 3 is all, cluster 4 is all, and cluster 8 is all(iii)
If time is off-peak (pm) and feedback is < set current limit (A) then cluster 3 is all, cluster 4 is all, cluster 8 is all(iv)
If time is low and feedback is medium, then cluster 3 is no change, cluster 4 is no change, and cluster 8 is no change(v)
If time is peak (am) and feedback is > set current limit (A), cluster 3 is vital, cluster 4 is vital, and cluster 8 is vital(vi)
If time is off-peak (am) and feedback is none, then cluster 3 is all, cluster 4 is all, and cluster 8 is all(vii)
If time is peak (pm) and feedback is > set current limit (A), cluster 3 is vital, cluster 4 is vital, and cluster 8 is vital(viii)
If time is off-peak (pm) and feedback is none, then cluster 3 is all, cluster 4 is all, and cluster 8 is all


## 3.1. Data Collection

Consumption data were collected from a solar battery microgrid called Ngurudoto based in Arusha, Tanzania. It has a 7.5 kW capacity with wireless and communication modules for data communication, as shown in Figure2. Electricity consumption was recorded using smart meters installed in each house. For each intelligent meter, real-time data were recorded using a combination of remote sensing devices, a data logger, and a remote PC. Collected demand data were analyzed using Microsoft Excel, Python, and Matlab. Fuzzy logic was done using MATLAB R2018a software.Figure 2
Data collection framework.


## 3.2. K-Means Clustering

K-means clustering is an unsupervised machine learning algorithm in which the grouping is done based on similarities and differences. It requires the following inputs:(i)
Number of cluster centres (K)(ii)
Training sets (x1, x2, x3…)The methodologies involved in K-means clustering are summarized in Figure3 and explained as follows:(i)
The first step involves randomly initializing the value of K, which represents the number of clusters to be formed. The optimal value ofK can be calculated using the elbow method.(ii)
Distance between the data points and the initialized cluster centres is calculated by using the sum of square distance as follows:(1)WSS=∑DXi,Yi2=∑i=1N∑j=1NXij−Yij2.(iii)
Depending on the minimum distance obtained, data points are grouped to the nearest cluster centres.(iv)
The new centroid is calculated from the groups of data points moved to the same group, i.e.,μ=∑data points in a certain cluster/total data points in thatcluster(v)
The mean is now repositioned as a new centroid.(vi)
This process is repeated to all the clusters until there is no change in cluster centroids representing the clusters formed.Figure 3
K-means clustering algorithm.


## 3.3. Case Study

The main objective of this study was to design a DSM model for load management during peak hours. The microgrid located in Arusha, Tanzania, was considered as a case study whereby connected houses were grouped according to their usage patterns through clustering. The loads were also grouped into two groups: vital and nonvital, as illustrated in Table1 to appreciate their importance. By applying DSM based on load priority and direct load control techniques, consumption was limited through cutting off nonvital loads during peak hours to supply power to the vital loads. Figure 4 represents the proposed model for controlling the loads according to their priority during peak hours. F1, F2, F3, and F4 are the fuses connected to the houses’ nonvital loads in the respective clusters. The clusters suitable for energy management were selected according to the energy usage resulted from load profile classification. This selection helped prevent low energy users from the burden of the high cost of energy management.Table 1
Total loads in the microgrid with their classifications.
S. no.Name of the loadPower consumption (W)Number of loadsDescription depending on the priority1.Fridges904Nonvital2.Radios56Vital3.Tube lights4036Vital4.Computers154Vital5.Televisions603Nonvital6.Phones438Vital7.Water pump2001NonvitalFigure 4
Proposed model for fuzzy logic load control.The fuses have a control signal from the fuzzy controller which trip off during peak hours when the load exceeds the set limit. This mechanism allows shutting down of only nonvital loads leaving the vital loads connected. The selection of loads is based on customer priority. The fuzzy logic controller being the central part of the circuit has two inputs: time and comparator. A comparator compares the reference set maximum current and the current flowing while the timer in the input time checks whether it is peak or off-peak. The outputs of the two are then fed to the fuzzy controller. A controller’s output sends the desired control signal to the connected houses to limit the power consumption.


## 3.4. Fuzzy Logic Controller

The fuzzy controller is an artificial intelligence system that can be used to either reduce, control, or modify power consumption. It works so that only consumers’ priority loads are connected during peak hours, and within the off-peak hours, loads can be increased without exceeding the limit. The general working mechanism of a fuzzy controller contains the following components:(i)
Input(ii)
Fuzzification(iii)
Inference engine (rules)(iv)
Defuzzification(v)
Output


## 3.5. Fuzzy Membership Functions

For all the input and output variables, fuzzy membership functions are essential for defining linguistic rules that govern their relationships. For this case, the trapezoidal membership function is used for input time, as shown in Figure5.Figure 5
Input membership function for time.Figure6 shows zmf and smf, the most appropriate membership function for the feedback or comparator. For the output signals, constant and linear membership functions were used, as shown in Figure 7.Figure 6
Input membership function for feedback.Figure 7
Output membership function for clusters.The most crucial task in the designing of the fuzzy controller is the development of the fuzzy rules. The number of rules always depends on the number of considered membership functions for both input and output blocks. In this study, the fuzzy controller is designed to limit power usage during peak hours by switching off some of the loads depending on the priority set. In this study, several rules are used, a few of them being mentioned below:(i)
If time is off-peak (am) and feedback is < set current limit (A), then cluster 3 is all, cluster 4 is all, and cluster 8 is all(ii)
If time is peak (am) and feedback is < set current limit (A), then cluster 3 is all, cluster 4 is all, and cluster 8 is all(iii)
If time is off-peak (pm) and feedback is < set current limit (A) then cluster 3 is all, cluster 4 is all, cluster 8 is all(iv)
If time is low and feedback is medium, then cluster 3 is no change, cluster 4 is no change, and cluster 8 is no change(v)
If time is peak (am) and feedback is > set current limit (A), cluster 3 is vital, cluster 4 is vital, and cluster 8 is vital(vi)
If time is off-peak (am) and feedback is none, then cluster 3 is all, cluster 4 is all, and cluster 8 is all(vii)
If time is peak (pm) and feedback is > set current limit (A), cluster 3 is vital, cluster 4 is vital, and cluster 8 is vital(viii)
If time is off-peak (pm) and feedback is none, then cluster 3 is all, cluster 4 is all, and cluster 8 is all


## 4. Results and Discussion

### 4.1. Case Study

This study proposed fuzzy logic-based load management for an isolated solar microgrid. Twenty-two residential houses were considered whereby the K-means clustering algorithm was performed on the collected real-time electricity consumption data using the Scikit-Learn Python package [50]. Clustering was done to identify customers' typical usage pattern, grouping them into respective clusters and hence controlling their demand according to how they consume power. Load limiting and load priority techniques were used for the individual clusters to achieve a flatter load profile.Clustering with K-means gave ten groups of clusters as per Figure8, which was obtained using the elbow method that determines the number of clusters from the sample data provided. The results are represented by the elbow point or the first turning point of the graph where a small decrease in the error sum is observed. The appropriate K value is at number ten from the data used, as indicated in Figure 8. Therefore, the number of clusters found is ten.Figure 8
Elbow method to determine the optimal value ofK for the clusters.From the cluster results in Figure9, houses have been grouped based on similar usage pattern. All the clusters demonstrated variations in demand which indicated that there is a need for DSM. Apart from the usage patterns, clusters 3, 4, and 10 represented households falling in the highest use cluster. Given solar-powered microgrids, these customers may be regarded as potential users who mostly decide or influence the system’s overall peak demand. On the other hand, clusters 6 and 9 consist of the lowest electricity users; one may assume that their primary usage is for lighting and phone charging. In the context of DSM, these customers should not be burdened with either the high prices or switching off some loads since they do not influence peaks in the system. The remaining clusters, 1, 2, 5, 7, and 8, represent medium-use customers. This study's clustering results have shown great potential for a successful DSM program due to the proper load balancing technique. Clusters help identify customers responsible for energy management by assessing their degrees of peak generation. The importance of clustering results can be supported by Hannes et al. (2019), who explained that customers would strongly participate in any program if only they generate profit from it [51].Figure 9
Different clusters obtained after the K-means clustering algorithm.Figure10 shows the composition of houses in each cluster. Cluster 2 represents a group with most customers while clusters 4, 6, 8, 9, and 10 each have only one customer, indicating that they have unique usage patterns.Figure 10
Cluster compositions.From the results obtained, one individual house for each cluster of interest was chosen as a case study for DSM. The choice was made based on the highest consumer in each cluster to cater for the worst-case scenario. Table2 shows the clusters with their respective reference houses selected. The assumption made in this study is that customers with the usage pattern of 600 W and above are suitable candidates for DSM. Hence, clusters 3, 4, 8, and 10 were chosen, represented by load profiles of houses 14, 12, 22, and 10.Table 2
Houses for reference in each cluster.
Cluster numberReference house1House 72House 173House 144House 125House 86House 17House 58House 229House 1510House 10The grouped customers were then characterized by both pattern and magnitude of consumption. By using the collected demographic data, different types of customers falling into each consumption category and load profiles were characterized. Figure11 shows the relationship between different demography attributes and power usage for all the houses. Results show that the highest energy consumer is in house 14, falling under cluster 3. High consumption customers also tend to have indoor businesses, as explained by house number 14, which has a bar business. These results are further supported by authors in ref. [52] who analyzed customers’ consumption patterns in Tanzanian rural microgrids. From the demographic results, it is clear that the number of house members and their indoor businesses influences electricity usage. Medium-use customers represented by house number 10, falling under cluster 10, show considerable electricity usages. According to the survey data, one may argue that electricity consumption is due to many students who claimed to be using electricity for studying purposes. The argument is in correlation with the study by Elizabeth et al. (2020), who suggested that medium energy households’ presence was due to school children's presence [53]. The same applies to house number 8, which seemed to have a significant consumption since they owned a small shop. House numbers 1, 9, 19, 20, and 21 characterized the small users since they contain either a single family member or a more significant number of older adults who do not consume a considerable amount of energy due to their lifestyles. The present study tries to accommodate the low energy users by proposing a DSM mechanism which did not burden them since their electricity usage was not significant in the system peak generation.Figure 11
Relationship between power usage and different demographic attributes.The surface viewer in Figure12 shows the three-dimensional plot of three parameters: time, power, and the cluster power output after fuzzy logic DSM. The graph shows managed clusters 3, 4, and 8. In cluster 3, the off-peak dates represented by days before 14 were uncontrolled since the set power limit was not reached. This situation allows both vital and nonvital loads to be switched on similar to how Nehrir et al. (1999) explained the water heater operation scheduled during off-peak hours [33]. Peak days in the range of 18–22 marked the concentration area whereby the fuzzy logic controller helped limit the power usage to 1300 W using a 7.5 A fuse. The yellow colour shows the shaved or clipped area after DSM, which is the operator's target. For cluster 4, the allowable load was set as 800 W during peak hours. Load limiting was done via a 4 A fuse which shut down excess loads observed on the 21st day. Likewise, in cluster 8, all the loads were limited to 600 W during peak hours. Excessive loads found in the range of 24–26 days were shaved to 600 W, as depicted in the diagram.Figure 12
Surface view output representation for clusters 3, 4, and 8 after fuzzy application.Figures13 and 14 show the rule viewer of the outputs for clusters 3 and 4, respectively. The rule viewer is used to show the effectiveness of the output. From these diagrams, two points were taken into consideration: off-peak and peak periods. On the sixth day, cluster 3, represented in Figure 13 represents the off-peak points. A feedback current of 2.99 A corresponding to a power of 657.8 W gave an output power of 657 W after fuzzification. The results show almost the same energy before and after fuzzification, indicating that the loads were not managed or shifted. In the exact figure, peak points are represented by the 17th day. The power observed was 1738 W single-phase, which gave a feedback current of 7.9 A to the controller, and hence, the power was limited to 1000 W by switching off nonvital loads.Figure 13
Output result representation of off-peak and peak points for cluster 3.Similarly, cluster four, represented by Figure14, shows the results during off-peak and peak periods. Load curtailment is observed during peak hours while nothing was done during off-peak hours. The fuzzy controller achieved the above through the feedback current received.Figure 14
Output result representation of off-peak and peak points for cluster 4.Figures15–18 represent the monthly load profiles before and after implementing DSM for clusters 3, 4, 8, and 10, respectively. The results show that the generated power can be fully utilized except during peak power periods by implementing fuzzy logic-based energy management scheme as the author depicted in ref. [9]. Before optimization, the load demand is higher than the set limits. After applying a fuzzy logic controller, closer to a flat load profile is seen, which helps avoid system collapse and blackouts, especially during peak hours. The profiles clearly show that each cluster’s peaks have been restricted to match the corresponding limits set. Also, the overall load profile before and after implementing fuzzy logic DSM is shown in Figure 19. There is a significant reduction in demand during peak periods due to the clusters that have taken part in DSM. These results show more improvement in the design and implementation than that reported by Ravibabu et al. [1] since many houses have been included in the clustering approach. Also, with this approach, small electricity consumers are not taken into consideration until when they satisfy for DSM.Figure 15
Load profile before and after the implementation of DSM in cluster 3.Figure 16
Load profile before and after the implementation of DSM in cluster 4.Figure 17
Load profile before and after the implementation of DSM in cluster 8.Figure 18
Load profile before and after the implementation of DSM in cluster 10.Figure 19
Total load profile before and after the implementation of DSM for all the targeted clusters.Figure20 shows energy savings for different days in a month and the overall energy saving per month. The graph shows the power saving of almost 3700 W per month. The amount of saving achieved is very significant in the DSM context, and it assures the system stability in case of peak loads. Different energy savings are also observed for different days due to the variable nature of demand [54]. Moreover, on the 3rd, 5th, 7th, 11st, 13th, 14th, 16th, 19th, 22nd, and 24th days, the savings are approximately close to zero, and one may argue that no load was either shifted or switched off. In this scenario, the argument can be that most of the houses were in the off-peak range, hence retaining the same energy before and after DSM. Likewise, the highest energy saving was achieved on the 27th day, and one may suppose that several nonvital loads were shut down to avoid overloading the system.Figure 20
Daily and total power saving for the overall system.It is clear from the obtained results that, with fuzzy logic-based energy management strategy, demand profiles can be levelled, and available generation can be optimized appropriately to meet consumers’ needs. Since the proposed method tried to operate the loads partly, the system’s efficiency can be improved. The above observation is in line with ref. [55] and further supported by ref. [33]. On the other hand, since both the customers' load demand and the power generated from solar microgrids are uncertain and stochastic, the fuzzy logic controller has proven to be the most efficient and effective method compared to mathematical models discussed by the authors in ref. [9].


## 4.1. Case Study

This study proposed fuzzy logic-based load management for an isolated solar microgrid. Twenty-two residential houses were considered whereby the K-means clustering algorithm was performed on the collected real-time electricity consumption data using the Scikit-Learn Python package [50]. Clustering was done to identify customers' typical usage pattern, grouping them into respective clusters and hence controlling their demand according to how they consume power. Load limiting and load priority techniques were used for the individual clusters to achieve a flatter load profile.Clustering with K-means gave ten groups of clusters as per Figure8, which was obtained using the elbow method that determines the number of clusters from the sample data provided. The results are represented by the elbow point or the first turning point of the graph where a small decrease in the error sum is observed. The appropriate K value is at number ten from the data used, as indicated in Figure 8. Therefore, the number of clusters found is ten.Figure 8
Elbow method to determine the optimal value ofK for the clusters.From the cluster results in Figure9, houses have been grouped based on similar usage pattern. All the clusters demonstrated variations in demand which indicated that there is a need for DSM. Apart from the usage patterns, clusters 3, 4, and 10 represented households falling in the highest use cluster. Given solar-powered microgrids, these customers may be regarded as potential users who mostly decide or influence the system’s overall peak demand. On the other hand, clusters 6 and 9 consist of the lowest electricity users; one may assume that their primary usage is for lighting and phone charging. In the context of DSM, these customers should not be burdened with either the high prices or switching off some loads since they do not influence peaks in the system. The remaining clusters, 1, 2, 5, 7, and 8, represent medium-use customers. This study's clustering results have shown great potential for a successful DSM program due to the proper load balancing technique. Clusters help identify customers responsible for energy management by assessing their degrees of peak generation. The importance of clustering results can be supported by Hannes et al. (2019), who explained that customers would strongly participate in any program if only they generate profit from it [51].Figure 9
Different clusters obtained after the K-means clustering algorithm.Figure10 shows the composition of houses in each cluster. Cluster 2 represents a group with most customers while clusters 4, 6, 8, 9, and 10 each have only one customer, indicating that they have unique usage patterns.Figure 10
Cluster compositions.From the results obtained, one individual house for each cluster of interest was chosen as a case study for DSM. The choice was made based on the highest consumer in each cluster to cater for the worst-case scenario. Table2 shows the clusters with their respective reference houses selected. The assumption made in this study is that customers with the usage pattern of 600 W and above are suitable candidates for DSM. Hence, clusters 3, 4, 8, and 10 were chosen, represented by load profiles of houses 14, 12, 22, and 10.Table 2
Houses for reference in each cluster.
Cluster numberReference house1House 72House 173House 144House 125House 86House 17House 58House 229House 1510House 10The grouped customers were then characterized by both pattern and magnitude of consumption. By using the collected demographic data, different types of customers falling into each consumption category and load profiles were characterized. Figure11 shows the relationship between different demography attributes and power usage for all the houses. Results show that the highest energy consumer is in house 14, falling under cluster 3. High consumption customers also tend to have indoor businesses, as explained by house number 14, which has a bar business. These results are further supported by authors in ref. [52] who analyzed customers’ consumption patterns in Tanzanian rural microgrids. From the demographic results, it is clear that the number of house members and their indoor businesses influences electricity usage. Medium-use customers represented by house number 10, falling under cluster 10, show considerable electricity usages. According to the survey data, one may argue that electricity consumption is due to many students who claimed to be using electricity for studying purposes. The argument is in correlation with the study by Elizabeth et al. (2020), who suggested that medium energy households’ presence was due to school children's presence [53]. The same applies to house number 8, which seemed to have a significant consumption since they owned a small shop. House numbers 1, 9, 19, 20, and 21 characterized the small users since they contain either a single family member or a more significant number of older adults who do not consume a considerable amount of energy due to their lifestyles. The present study tries to accommodate the low energy users by proposing a DSM mechanism which did not burden them since their electricity usage was not significant in the system peak generation.Figure 11
Relationship between power usage and different demographic attributes.The surface viewer in Figure12 shows the three-dimensional plot of three parameters: time, power, and the cluster power output after fuzzy logic DSM. The graph shows managed clusters 3, 4, and 8. In cluster 3, the off-peak dates represented by days before 14 were uncontrolled since the set power limit was not reached. This situation allows both vital and nonvital loads to be switched on similar to how Nehrir et al. (1999) explained the water heater operation scheduled during off-peak hours [33]. Peak days in the range of 18–22 marked the concentration area whereby the fuzzy logic controller helped limit the power usage to 1300 W using a 7.5 A fuse. The yellow colour shows the shaved or clipped area after DSM, which is the operator's target. For cluster 4, the allowable load was set as 800 W during peak hours. Load limiting was done via a 4 A fuse which shut down excess loads observed on the 21st day. Likewise, in cluster 8, all the loads were limited to 600 W during peak hours. Excessive loads found in the range of 24–26 days were shaved to 600 W, as depicted in the diagram.Figure 12
Surface view output representation for clusters 3, 4, and 8 after fuzzy application.Figures13 and 14 show the rule viewer of the outputs for clusters 3 and 4, respectively. The rule viewer is used to show the effectiveness of the output. From these diagrams, two points were taken into consideration: off-peak and peak periods. On the sixth day, cluster 3, represented in Figure 13 represents the off-peak points. A feedback current of 2.99 A corresponding to a power of 657.8 W gave an output power of 657 W after fuzzification. The results show almost the same energy before and after fuzzification, indicating that the loads were not managed or shifted. In the exact figure, peak points are represented by the 17th day. The power observed was 1738 W single-phase, which gave a feedback current of 7.9 A to the controller, and hence, the power was limited to 1000 W by switching off nonvital loads.Figure 13
Output result representation of off-peak and peak points for cluster 3.Similarly, cluster four, represented by Figure14, shows the results during off-peak and peak periods. Load curtailment is observed during peak hours while nothing was done during off-peak hours. The fuzzy controller achieved the above through the feedback current received.Figure 14
Output result representation of off-peak and peak points for cluster 4.Figures15–18 represent the monthly load profiles before and after implementing DSM for clusters 3, 4, 8, and 10, respectively. The results show that the generated power can be fully utilized except during peak power periods by implementing fuzzy logic-based energy management scheme as the author depicted in ref. [9]. Before optimization, the load demand is higher than the set limits. After applying a fuzzy logic controller, closer to a flat load profile is seen, which helps avoid system collapse and blackouts, especially during peak hours. The profiles clearly show that each cluster’s peaks have been restricted to match the corresponding limits set. Also, the overall load profile before and after implementing fuzzy logic DSM is shown in Figure 19. There is a significant reduction in demand during peak periods due to the clusters that have taken part in DSM. These results show more improvement in the design and implementation than that reported by Ravibabu et al. [1] since many houses have been included in the clustering approach. Also, with this approach, small electricity consumers are not taken into consideration until when they satisfy for DSM.Figure 15
Load profile before and after the implementation of DSM in cluster 3.Figure 16
Load profile before and after the implementation of DSM in cluster 4.Figure 17
Load profile before and after the implementation of DSM in cluster 8.Figure 18
Load profile before and after the implementation of DSM in cluster 10.Figure 19
Total load profile before and after the implementation of DSM for all the targeted clusters.Figure20 shows energy savings for different days in a month and the overall energy saving per month. The graph shows the power saving of almost 3700 W per month. The amount of saving achieved is very significant in the DSM context, and it assures the system stability in case of peak loads. Different energy savings are also observed for different days due to the variable nature of demand [54]. Moreover, on the 3rd, 5th, 7th, 11st, 13th, 14th, 16th, 19th, 22nd, and 24th days, the savings are approximately close to zero, and one may argue that no load was either shifted or switched off. In this scenario, the argument can be that most of the houses were in the off-peak range, hence retaining the same energy before and after DSM. Likewise, the highest energy saving was achieved on the 27th day, and one may suppose that several nonvital loads were shut down to avoid overloading the system.Figure 20
Daily and total power saving for the overall system.It is clear from the obtained results that, with fuzzy logic-based energy management strategy, demand profiles can be levelled, and available generation can be optimized appropriately to meet consumers’ needs. Since the proposed method tried to operate the loads partly, the system’s efficiency can be improved. The above observation is in line with ref. [55] and further supported by ref. [33]. On the other hand, since both the customers' load demand and the power generated from solar microgrids are uncertain and stochastic, the fuzzy logic controller has proven to be the most efficient and effective method compared to mathematical models discussed by the authors in ref. [9].


## 5. Conclusion

The available gap between demand and supply due to the increase in electrical appliances, leading to a shortage of electricity during peak usage, is pronouncing. DSM programs offer an enhanced chance to exploit consumption diversity and accordingly reduce the peak demand for electricity. Shifting loads from peak to off-peak or switching off some loads during peak hour's period can be a challenge to specific customers; hence, exploiting their usage pattern through clustering leads to more flexible DSM techniques. In this work, the fuzzy logic-based DSM programs are used as a load limiter to control loads during peak hours. This control mechanism helps in the proper utilization of the available power at a given time by giving priority to vital loads depending on the preference set by customers.Moreover, the proposed program favours all kinds of customers, hence encouraging their participation in DSM. Therefore, this study is essential to guarantee energy saving and customer satisfaction. It can be further extended to account for cases where consumers are given incentives for their willingness to participate in the DSM program.



---

*Source: 6614129-2021-02-15.xml*