Bi-Level Phase Load Balancing Methodology with Clustering-Based Consumers’ Selection Criterion for Switching Device Placement in Microgrids

In the last years, the Distribution Grid Operators (DGOs) assumed transition strategies of the distribution grids towards an active area associated with the "Smart Grids" concept. They are considering the use of Artificial Intelligence techniques, combined with advanced technologies and real-time remote communication solutions of the enormous data amounts, to develop smart solutions into the small size distribution grids, also called microgrids (μGs). These solutions will provide support for the DGOs to ensure an optimal operation of the technical infrastructure of the μGs. In this context, a bi-level methodology for solving the phase load balancing problem in the μGs with complex topologies and a high number of single-phase consumers, considering a clustering-based selection criterion of the consumers for placement of the switching devices, was proposed in the paper. A real μG from a rural area, with 114 consumers integrated into the Smart Metering System (SMS), belonging to the DGO from Romania, was considered in testing the proposed methodology. An implementation degree of 17.5%, corresponding to the phase load balancing equipment installed to only 20 consumers from the μG, led to a faster computational time with 43% and reducing the number of switching operations by 92% than in the case of a full implementation degree (100%). The performance indicators related to the unbalance factor and energy-saving used in the evaluation of the technical benefits highlighted the efficiency of the proposed methodology.


Introduction
Today, the transformation of the technical infrastructure that to satisfy the requirements of the small size active distribution grids, namely microgrids (μGs), is technically possible due to the presence of the automation devices and, more recently, smart meters that communicate using industry standards. On the other hand, there are challenges of the Distribution Grid Operators (DGOs) to ensure the transition towards the μGs: the emergence of the distributed generation sources (including the prosumers) and storage systems, the requirements for reducing the carbon footprint of electricity production that determines the change of the market model, and the presence of the bidirectional power flow [1].
In the current stage of this transition, the accelerated development in innovation and technology plays an important role leading to [2]: • investments in the technical infrastructure of the actual electricity distribution grids to achieve flexibility able to adapt to new requirements of the μGs; • increasing the automation degree in the μGs to ensure the resilience, optimal integration of the distributed generation sources, efficient solutions for an optimal operation; The balancing mode (using switching devices or manually) is missing because due to commercial objectives subject to some technical constraints. The approaches from [17] - [19] studied the PLB problem considering the integration of electric vehicles. Kikhavani M.R. et al. in [17] addressed the optimal phase connection of Plug-in electric vehicles (PEVs) based on the power loss minimization and the improvement of the voltage profile. The algorithm commands phase switching devices, which connect or disconnect the optimal number of PEVs in the two operational ways (vehicle-to-grid and grid-to vehicle). Reference [18] presents the adaptive coordination between the photovoltaic inverters and electric vehicle charger based on a local controller device to solve the PLB problem. At the same time, the approach detailed in [19] proposed the LV modular bypass converters. The main advantage of these active balancing methodologies refers to the particular topology of a μG without additional power losses. One of the options to address optimal phase balancing is the integration of energy storage systems in the μGs with smallscale distributed generation, as in [20]. The main limitation of the last four approaches [17]- [20] is the balancing speed, which is limited to a high number of switching operations, as a consequence of the dynamic connection of the electric vehicle and storage systems. A comprehensive solution with smart transformers is presented in [21], while another study proposes a simple three-phase load balancing considering only the information provided by smart meters [22].
A brief description of the literature is presented in Table 1 to highlight the main contributions of the proposed methodology, considering the type of μG, the balancing point (pillar/substation level), the balancing mode (manual/automatic), the optimization model with objective function (OF) with constraints (C), and the minimum number of switching operations. The objective function considers the minimization of unbalance current (UC), unbalance voltage (UV), unbalance factor (UF), cost optimization (CO), and active power losses (APL). Many other papers in the literature solve the PLB problem, but the approaches coincide with those presented in Table 1.
The proposed methodology includes the following original contributions: • the use of the K-means algorithm-based clustering in the first level to select the "candidate" groups containing 1-P consumers where the phase load balancing equipment (PLBE) are installed, with a significant influence on the minimization of unbalance factor; the clustering simplify the selection process leading at a relatively small number of 1-P consumers with the PLBE installed; • the use of an improved PLB algorithm in the second level that aims minimization of the unbalances factor at the SP level, subject to the constraints where its value must be below an imposed limit by the Decision-Maker (DM) at the pillars with 1-P consumers from the "candidate" groups connected. Section 3 will present the details on these contributions. The organization of the next sections is the following: Section 2 presents the architecture of a Smart Balancing System (SBS) which can solve the PLB problem efficiently, Section 3 particularizes the levels of the proposed methodology which integrates the clustering-based selection criterion of the consumers for the PLB process, Section 4 details the results obtained for a real μG from the northeastern area of Romania and a comparison with the methodology where all consumers take part to the PLB process (100% implementation degree of the PLBE) to highlight the accuracy and benefits of the proposed algorithm, and Section 5 includes the conclusions and the future works.

The Architecture of the Smart Balancing System
The architecture of an SBS used in solving the PLB problem from a μG should have the following main components: the phase load balancing equipment (PLBE), composed of a smart meter (SM) and a switching device (SD), a high-speed data communication system, and the data concentrator from the supply point (SP), See Fig. 1. All 1-P consumers must have the three-phase (3-P) branching (where abc represents the phase conductors and N is associated with the neutral conductor) to be involved in the PLB process.
The PLBE is installed in the consumption points where there is a 3-P branching. The data concentrator installed in the SP takes over, with a sampling step (15, 30, or 60 minutes) set by the DM, the data on the current and the connection phase from each consumption point associated with the 1-P consumer. The decision-making module, which includes the PLB algorithm, processes the data, and finally, sends the command to each SD to switch the load on the new phase according to the identified solution corresponding to a minimum unbalance degree. Fig. 2 presents the implementation of the SBS in a μG where all 1-P consumers have 3-P branching and the PLBE installed (100% implementation degree).
Regarding the first component (SD) of the SBS, there are different approaches proposed in many research papers based on a high automation degree. The Static Transfer Systems (STS)-based devices, with various costs and technical performances [23]- [25], were already implemented. These solutions follow reducing the purchase cost and switching times. Other devices use a control system of the three-phase load unbalance [26] composed of a magnetic holding relay and a thyristor in parallel that allows quickly switching the load between phases a, b, or c. The main advantages of this solution are low cost, high real-time performance, and a positive effect on reducing the unbalance factor. An automatic phase load balancing device, based on a microcontroller and three relays, was proposed in the references [27] - [29]. The operating time of the relay represents a significant technical parameter in the switching process. The results indicated that this solution is efficient, having a reduced cost in their implementation. Another variant of a three-phase balancing device is presented in [30] that has in their structure six relays and six contactors to ensure the balanced regime of three controllable loads. The conclusion is that increasing the loads can lead to a high cost due to the number of contactors. The solid-state relays and contactors connected to each phase represent the base of the solution adopted in [31]. The three triacs of relays operate such that no two triacs are in the "on state" at the same time because this state will create a short circuit among phases. A design of a phaseswapping device with magnetic latching relays (MLRs) proposed in [32] can represent an efficient solution having economic and technical benefits. Currently, the price of three magnetic latches with a maximum load of 100 A on the market is less than 30 $, while the price of MLRs is usually more than 100$. In these conditions, this device can lead to a reduction of the cost of the equipment and realize the functions of zero-voltage turn-on and zero-current turn-off, which reduce the impact of inrush current and arc on the user. Also, it uses a high-speed data transmission system that is the main advantage in the implementation of a remote control scheme.
But, the architecture of the SBS can have a significant impact on the operation of the μGs only if the following requirements are fulfilled: the communication infrastructure has a high-speed data transmission, the data concentrator located at the level of the SP, which integrates the decisionmaking module, has superior performances (high data acquisition and processing speed), and the SD

Input data
The input data considered in the clustering process include for each consumer n, n = 1,…, NC, where NC represents the total number of the consumers, the absorbed current at the hour when the peak load, hPL, was recorded in the μG, and the distance, Dn, n = 1,…, NC, from the SP (connected to the MV electricity distribution grid of the DGO) to the pillar where the consumer is connected. Thus, the consumers subjected to the clustering process have these features recorded in a matrix ID, having the size NCx2: where: NC represents the number of the consumers from the μG integrated in the SMS; hPL is the hour when the peak load was recorded in the μG; In,hPL corresponds the absorbed current by the consumer n, n = 1, …, NC at the hour hPL; Dn indicates the distance between the SP and the pillar where the consumer n is connected.
The current profiles corresponding to the day of the peak load from the μG are uploaded from the database of the SMS in a matrix [I], having the size NCxH: I  I  I   I  I  I   I  I  I   I   ,  ,  1 where and H is the analysed time period (in this case H = 24 hours, with a sampling step Δh = 1 hour).
The aggregation of these profiles at the LV level of the SP to identify the hour of the peak load represents the following step: , will be used in the clustering process as the first feature of the consumers, representing the absorbed currents at the hour when the peak load has been recorded in the μG.
In addition to the current profiles, the branching type, tb, tb = {1-P, 3-P}, where 1-P is associated with the single-phase consumers and 3-P with the three-phase consumers, and connection phase, p={a, b, c, abc}, for each consumer, are uploaded from the consumers' database of the DGO based on the identification number of the analysed μG and recorded in the vectors [Tb]1xNc and [Ph]1xNc. The 1-P consumers are connected at one of the phases p = {a, b, c}, and the 3-P consumers are connected at all three phases p = {abc}. Based on these data, the current profiles are aggregated on each phase at the SP level, and the unbalance factor (UF) is calculated for the peak load hour, hPL, using the formula: where p -the set of the phases ( { , , } p a b c  ); np corresponds the number of the phases (np = 3); Ip (hPL) is the total current on the phase p, at the LV level of the SP and hour hPL; Iav (hPL) -the average value of the phase currents at the SP level and hour hPL.
If UF (hPL) has a value higher than 1.1 (limit value accepted by the DGO for the unbalance factor), the clustering algorithm is initialized to identify the consumers' "candidate" groups.
The second column of the matrix [ID], corresponding to the second feature used in the clustering process, refers to the distances between the pillars and the SP. The calculation of these distances is easy, knowing the topology of the μG identified based on an algorithm proposed by the authors in [35]. Using this topology and the additional information obtained from the DGO regarding the distance between two successive pillars, which is 0.04 km [36], a distance-vector [D]1xNc, having the size 1xNC, is built knowing the allocation of the consumers to the pillars. The elements of this vector, associated with the topology from Fig. 4, are presented in Table 2.   I at the hour when the peak load, hPL, was recorded in the μG, and the distance, D * n , n = 1,…, NC, from the SP to the pillar where the consumer is connected. The objective of the K-means algorithm is grouping the consumers in K clusters denoted by C = {Ck | k = 1: K}. The grouping is performed in such a way as to minimize the objective function: where: mk is the centroid of the cluster k, k = 1, …, K; dist (. , .) represents the Euclidean distance in the two-dimensional space.
The algorithm starts with a random set of the centroids associated with the K clusters and then change the centroids into several iterations. Finally, it will find a partition that corresponds to a minimum of the function F [38].
The main steps of the algorithm are the following, see Fig. 5: Initialization: It starts with the random selection of the K centroids from the rows of the matrix Assigning: Each row from the input data matrix is associated with the nearest centroid: Update: The new positions of the centroids mk, k = 1, …, K, are recalculated as the average of the features (current and distance) associated with the consumers from that cluster Ck.
The following formula sums up all the characteristics of the consumers belonging to the cluster Ck, k= 1, …, K, having the membership degree to it.
where nk is the number of consumers from the cluster Ck. But, the question is if the algorithm found a partition that corresponds to a global optimum of the function F. To obtain the optimal number of clusters the following steps can be completed: • Calculation the maximum number of clusters based on the formula [37]: • Clustering: K-means clustering method is used for each partition in the Ck clusters, k = 2, …, Kmax, using the input data matrix. • Evaluating the quality of partition: The evaluation is based using the silhouette coefficient calculated with the relation [39]: where : Nr and Ns are the number of the consumers assigned to the clusters r and s; dist(IDi, IDj) is the represents the Euclidean distance in the two-dimensional space between the i-th and j-th rows from the matrix [ID * ].
• Iterative process: The steps 2 and 3 (Clustering and Evaluating the quality of partition) are repeated to evaluate the quality of partitions between 2 and Kmax. The values of SC are recorded for each partition in the vector QP = [SC (2) , SC (3) , …, SC (Kmax) ]. • Determining the optimal number of clusters through the calculation of the maximum value from the vector QP, SCmax. The partition with SCmax is associated with the optimal number of clusters, Ck,opt.

Selecting the consumers' "candidate" groups
The decision-making process to select the "candidate" groups uses a qualification indicator, QI, defined for the interest areas resulted from the zoning of the "distance-current" space. Each interest area has a degree of "importance", GI, (High, Medium, and Low) having a discrete value of the QI assigned. Thus, the interest areas cannot be similar mainly due to the differences associated with the distances between consumers and the SP from the rural and urban or aerial and underground μGs, and the absorbed currents at the peak load by the consumers.
Inside the interest areas, the consumers' groups associated with the clusters Ck,opt, obtained from the clustering process are represented by the centroids mk, with the average characteristics of the distances and absorbed currents of the consumers from each cluster.
The values of the QI depend on the degrees of importance: GI{7, 8, 9, 10}, for a "High" degree, GI{4, 5, 6}, for a "Medium" degree, and GI{1, 2, 3}, for a "Low" degree. The clusters with the centroids inside the areas with a "High" degree of importance represent "candidate" groups. They will participate in the PLB process in descending order of the QI, and depending on the stop criterion imposed by the DM on the unbalance factor, UF, all or only some of them will be chosen.
The average value of the unbalance factor, UFav,SP, on the LV side of the SP, in the analysed period, H, is calculated in each iteration. where: where l is the current iteration; GC -number of "candidate" groups; UFlim -the specified value by the DM to stop the iterative process.

The second level -phase load balancing process
The PLB process is described by an algorithm having as aim the minimization of the unbalance factor, UF, on the LV side of the SP by switching the consumers assigned to the "candidate" groups from a phase to another. It represents an improved variant of the algorithm proposed in [40] where all consumers integrated into the SMS take part in the PLB process, having as the objective the minimization of the unbalance factor at each pillar. Even if the optimal solution corresponded to a value of the unbalance factor very close to 1.0 (ideal target), the number of switching operations is very high.
The improved variant of the algorithm starts with the end pillars and follows the route to the SP, aggregating the currents on each phase. The objective is the minimization of the unbalance factor at the SP level. The constraints of the optimization model consider the values of the unbalance factor that must be smaller than an imposed limit by the DM at the level of the pillars with the 1-P consumers from the "candidate" groups connected. The optimal solutions are obtained through coordination of the PLBE installed to the consumers from the "candidate" groups, leading to a reduction of the time and switching operations.
Thus, the objective function of the PLB problem refers to the minimization of hourly unbalance factor inside the analysed period H at the level of the SP: (20) subject to: where:       (40) where: UFSP (h) -the unbalance coefficient on the LV side of the SP and hour h; {PGC} -the set of the pillars with least one consumer from the "candidate" groups GC is connected; {PT} -the set of all pillars from the analyzed μG; UFpGC (h) -the unbalance coefficient calculated for the hour h at the pillar pGC where at least one consumer from the "candidate" groups GC is connected; UFlim -the limit value accepted by the DM for the unbalance coefficient at the pillar level; Ia,SP NC,pCG (h) -the total number of the consumers connected at the pillar pCG  {PGC}, and hour h; Na,ns -the total number of the non-switchable consumers from the μG connected on the phase a; Nb,ns -the total number of the non-switchable consumers from the μG connected on the phase b; Nc,ns -the total number of the non-switchable consumers from the μG connected on the phase c; Na,s (h) -the total number of the switchable consumers (belonging to the "candidate" groups) from the μG connected on the phase a, at hour h; Nb,s (h) -the total number of the switchable consumers (belonging to the "candidate" groups) from the μG connected on the phase b, at hour h; Nc,s (h) -the total number of the switchable consumers (belonging to the "candidate" groups) from the μG connected on the phase c, at hour h; na (h) -the total number of the consumers from the μG connected on the phase a, at hour h; nb (h) -the total number of the consumers from the μG connected on the phase b, at hour h; nc (h) -the total number of the consumers from the μG connected on the phase c, at hour h; H-the analysed time period.  For a better understanding, Fig. 7 exemplifies the implementation of the proposed PLB algorithm using the test μG presented in Section 3.1.1, where consumer C9 connected to the pillar P7 has a PLBE installed. The colour used to highlight the phase currents on each section is red and yellow for the modified values due to switching the consumer C9 from phase a to b. Thus, the value of the UF at the SP level has been reduced from 1.11 to 1.004. Also, the effect of this switching operation, quantified through a value of the UF below 1.1 (maximum value accepted by the DGO in the μGs), feels at the level of each pillar. The proposed methodology has the following advantages: • It can be applied in the real μGs with complex topologies and a high number of 1-P consumers. • It uses in the first level a clustering-based selection criterion to obtain the "candidate" groups of the 1-P consumers which participate in the PLB process, with significant influence on the minimization of the unbalance factor. • It integrates into the second level a PLB algorithm that aims minimization of the unbalance factor at the SP level, subject to the constraints regarding its value below an imposed limit at the pillars where the 1-P consumers from the "candidate" groups are connected. The fast computational time and convergence speed represent strengths compared with other algorithms.

Case Study
A real μG, having the rated voltage by 0.4 kV, belonging to the DGO from the northeast of Romania was considered in the testing of the proposed methodology. Fig. 8 presents the topology of the analysed μG where the following colours were used to emphasize the type (1-P or 3-P) and allocation of the consumers on the phases: red (1-P consumer, phase a), blue (1-P consumer, phase b), yellow (1-P consumer, phase c), and magenta (3-P consumers). Table 3 presents details of the characteristics associated with the sections of the μG. It can be observed that 62.5 % (2.2 km) from the total length has the cross-section of phase and neutral conductors by 50 mm 2 , this section being associated with the main trunk of the network. The lateral branches, having a total length of 1.32 km are both 1-P (18.2 %) and 3-P (19.3 %), with the cross-sections of the conductors less than 35 mm 2 . Fig. 9 presents the type (1-P or 3-P) and the initial allocation of the phases for all consumers. The analysis of the information highlights that most of the 1-P consumers are allocated on the phase b (48.2 %), followed by phase c (36.8%), and phase a (14%). Only one consumer (0.9 %) connected at the pillar P10 has 3-P branching. The vectors [Tb] and [Ph] will contain these data (see Table A1 from Annex A).   Another significant piece of information in testing the methodology refers to the consumers. In the analysed μG, all consumers have the meters integrated into the SMS such that the current curves can be available, see the supplementary file. The information associated with the topology of the μG and current profiles is uploaded from the database of the DGO, representing the input data of the proposed methodology.
In the first stage, the matrix [ID], having two columns associated with the vectors [IhPL] and [D] which contain the absorbed currents at the hour the peak load, hPL, and the distances, Dn, n = 1,…, NC, from the SP to the pillar where each consumer is connected, is built. Then, based on the elements of the structure-vectors [VT1] and [VT2], all data related to the topology (pillars and sections) are recorded in the vectors [PT] and [S]. Using these vectors and the additional information on the distance between two successive pillars (0.04 km) provided by the DGO according to the technical regulations in Romania [36], the calculation of the distances from the vector [D] is performed knowing the allocation of the consumers to the pillars. Finally, the current profiles of the consumers from the day with peak load recorded in the μG are uploaded in the matrix [I].
To identify the hour of the peak load, hPL, the aggregation process of the current profiles takes place at the LV level of the SP, see Fig. 10.
In the next step, the unbalance factor, UF, has been calculated at the peak load hour (hPL = 22) to decide the initialization of the clustering process. Because the value of the UF was higher than 1.1 (UF = 1.18), the column [I22] from the matrix [I] together with the vector [D] will compose the matrix [ID] used in the clustering process. The maximum number of the partitions (Kmax = 10) was determined using relation (14), knowing the number of consumers (NC = 114). The optimal number of the clusters resulted in the clustering process was five. The testing of the quality has done using the silhouette coefficient, SC. The value of SC, equal to 0.76, was maximum for a partition in five clusters, see Fig. 11. Table 4 presents the statistical indicators (mean, standard deviation, maximum, and minimum) of each cluster (consumers' group) obtained in the clustering process based on the K-means algorithm. Most consumers (80% of the total consumers used in the clustering process) belonging to the clusters (C1, C2, and C3) have small values of the absorbed currents at the hour. This situation is usually in the rural distribution networks from Romania because the electricity consumption of many consumers is under 1000 kW/year. On the other hand, the allocation of these consumers at the pillars indicates distances from the SP between 0.2 and 1.2 km.  , and C3, having the smallest number of consumers, is characterized by values of the currents over 6 A. Most consumers from Cluster C5 are connected to the pillars located in the middle zone of the network, the distances from the SP being between 0.5 and 0.76 km.
In the next stage, the "candidate" groups have been chosen based on the qualification index, QI. Table 5 contains the information on the qualification index and the degrees of importance assigned to the proposed zones. A qualification index from 9 (the highest importance) until 1 (the least importance) will label each zone classified in Table 5. The zoning process was based on the analysis of the results obtained in the clustering process and presented above. Fig. 12 shows the 3-D representation of the clusters considering the absorbed current, distance, and qualification index. The centroids, represented by the mean presented in Table 4, will characterize each cluster in the identification process of the "candidate" groups. The interest zones for the PLB process will have the values of QI, in descending order, between 9 and 4, associated with the High and Medium degrees of importance, see Fig. 13. The clusters from these zones, highlighted in red, are Cluster C3 (High degree, QI = 7) and Cluster C5 (Medium degree, QI = 5). These clusters represents the "candidate" groups for the PLB process in this case, where each consumer will have installed a PLBE.
The second level of the methodology refers to running the PLB algorithm considering the "candidate" groups in descending order of the QI (C3 and C5) until the convergence condition is satisfied. The value imposed to stop the iterative process was 1.01, meaning an acceptance of 1% for the unbalance factor at the SP level, and the imposed limit of the unbalance factor at the pillar level, UFlim, see constraint (21), was 1.1 (maximum value accepted by the DGO in the μGs).
The algorithm starts from the farthest points (P20, P39, and P88), aggregating the phase currents at each pillar until the SP. The optimal solution, represented by the minimum average value of the UF at the level of the SP in the analysed period, is obtained through coordination of the PLBE installed to the consumers from the "candidate" groups. Thus, the best allocation of the consumers on the phases of the μG is determined. Fig. 14 shows the hourly values of the UF at the LV level of the SP obtained after applying the PLB algorithm. The analysis of data indicates a maximum value of 1.0078 recorded at the hour of the peak load (hPL = 22) and an average of 1.003. This last value is well below the target value of 1.01, set to stop the iterative process. The results have been compared with the full implementation degree (FID)-based algorithm proposed in [39], where all consumers have the PLBE installed (100% implementation degree) because the computational time (1.26 seconds) was over others PLB algorithms based on the PSO [41] (348 seconds) and GA [42] (291 seconds). The code of the algorithm has been written in Matlab2016 and running on a computer Intel Core i7, 3.10 GHz, 4GB RAM, and WIN 10 64-bit operating system. Fig. 15 presents the results obtained with both algorithms, FID algorithm [39], where there is a full implementation degree (100%) of the PLBE, and the proposed algorithm, with clustering-based consumers' selection criterion for placement of the PLBE, where the implementation degree is 17.5%. Fig. 16 presents the switching diagrams of the PLBE installed to the consumers from the "candidate" groups and Table A2 from Annex A contains details on the PLB process highlighted through the switching matrix.
The analysis of the diagrams and matrix associated with the switching operations concluded that the first eleven consumers, located closer to the SP, have a higher number of the switching operations (98, representing 81.7% of the total number) than the last eleven consumers (22, representing 18.3 % from the total number), located close to the end pillars of the network. The switching of the consumers from one phase to another is different. Fig. 15. Comparison between the two algorithms with 100% and 17.5% implementation degrees, considering the number of the switching operations The hours with a high number of switching operations are 1 (18 operations), 16 and 17 (9 operations), 2, 20, 22, and 23 (8 operations). But, there are two hours (3 and 5) where the PLBE did not work. The PLBE from two consumers (76 and 83) did not perform the switching operations in the analysed interval, such that they were excluded from the set of "candidate" consumers. In these conditions, it can assert that 20 PLBE optimally located in the network lead at an unbalance factor by 1.003, very close to the ideal value (1.0). The implementation degree of the PLBE in this μG is only 17.5 % (20 devices from a total number of 114).
All switching operations lead at a balanced loading on the three phases at each hour from the analysed period on the LV level of the SP, compared with the initial situation (unbalance regime, 0% implementation degrees of the PLBE), see Figs. 17 and 18. Table A3 from Annex A details the information on the phase currents and unbalance factors in all analysed cases (0%, 17.5%, and 100% implementation degrees). Table 6 presents the synthesis with the performance indicators (the computing time, the unbalance factor, the total number of the switching operations in the analysed interval, and theenergy-saving) for the three implemented degrees (0%, 100%, and 17.5%).  The energy losses have been determined following the steady-state calculation at each hour using the forward/backward sweep-based algorithm developed in [35] for the balanced and unbalanced three-phase regimes of the μGs. Tables A4, A5, and A6, Annex A, show the detailed results of the steady-state calculation at each hour in the three cases. Fig. 19 shows the energy losses on the phases (a, b, and c) and neutral (N) conductors. The analysis highlights a significant reduction of the energy losses on phase b and neutral for both implementation degrees. Also, the values of the energy losses in the conductors are very close, between 0.1 kWh (phase a), 0.5 kWh (phase b), 0.7 kWh (phase c), and 0.3 kWh (neutral). Finally, the following relation was used in the evaluation of the energy-saving (ΔWS): (41) where: ΔW0 represents the energy losses in the unbalance case (0% implementation degree of the PLBE in the μG), and ΔWpg corresponds the energy losses in the balanced cases (pg = 100% and 17.5%).
The analysis of the results from Table 6 highlights the efficiency of the proposed algorithm. If the values of the unbalance factor and energy-saving are very close, with small differences (0.3% and 1.5%, respectively), the computational time and the number of switching operations represent the strengths of the proposed algorithm. It is 0.54 seconds faster, and the switching operations are reduced by 92%.
These last specific indicators will have a positive influence on the initial investments, due to the significant reduction of the PLBE and 3-P branching, obtaining similar technical benefits represented by the energy-saving as in the case when the implementation degree of the PLBE is full (100%). Fig. 19. The comparison between the energy losses in the phase and neutral conductors (0%, 100%, and 17.5% implemented degree of the PLBEs in the μG)

Conclusions
In the paper, a clustering-based bi-level methodology was proposed to determine the optimal placement of the PLBE to the consumers. The first level refers to a decision-making process where the "candidate" groups of the consumers with the PLBE installed are identified based on the K-means clustering algorithm and a qualification index. The second level integrates the PLB process described by the minimization of the unbalance factor on the LV side of the SP by switching from a phase to other phases the switchable consumers from the candidate groups. The energy-saving has represented the base in the evaluation of the technical benefits.
A real μG from a rural area belonging to a Romanian DGO, with 114 consumers, was considered in testing the proposed methodology. All consumers have the meter integrated into the SMS. Following the clustering process, two "candidate" groups having together 22 consumers were identified, based on the qualification index. Only 20 consumers participated in the PLB process because two consumers did not modify the connected phase in the analysed interval (24 hours). The analysis of the obtained results highlighted the efficiency of the proposed methodology compared with the approach where all consumers have the PLBE installed, meaning a full implementation degree (100%). Thus, 20 PLBE installed to the consumers, representing an implementation degree by only 17.5%, led to similar technical benefits as in the case of a full implementation degree (100%) highlighted through the unbalance factor (1.003 versus 1.0001) and an energy-saving (59.1% versus 60.6%), considering the number of switching operations decreases highly with the 92 % (120 versus 1470). The computing time is 0.54 seconds faster than in the case of full implementation degree (100%), mainly due to the reduced number of the PLBE and the local optimal solutions identified only at the level of the pillars where the consumers from the "candidate" groups are connected.
On the other hand, the methodology leads to significant economic benefits due to the reduced number of PLBE and 3-P branching. This branching must replace the 1-P branching at the consumers with PLBE installed.
But, the methodology can have a significant impact on the operation of the μGs only if the communication infrastructure has a high-speed data transmission, and the data concentrator located at the level of the SP, integrating the decision-making algorithm for the optimal switching of the consumers on the phases, has superior performances (high data acquisition and processing speed).
The future work of the authors is concentrated now on the μGs with prosumers to develop the solutions which integrate these small-scale distributed generation sources in the PLB process.

Conflicts of Interest:
The authors declare no conflict of interest. The number of the consumers integrated in the SMS from the μG n

Nomenclature
The index of the consumer from the μG n = 1,…, NC hPL The hour when the peak load was recorded in the μG Dn The distance between the supply point and the pillar where the consumer n is connected In,hPL The absorbed current by the consumer n, at the hour hPL,

[A] [ID]Ncx2
The matrix with the consumers characteristics subjected to the clustering process, size (NCx2) H The analyzed period, [hours] Δh The sampling step Δh = 1 hour

[I]NcxH
Matrix containing the current profiles of the consumers from the day when the peak load was recorded in the μG, size (NcxH) Vector of the currents aggregated at the LV level of the SP for each hour h, [A] The maximum value of the total current (peak load) at the LV level of the SP, Vector of connection phase, size (1xNc) np The number of phases (np = 3) Ip (hPL) The total current on the phase p, at the LV level of the SP and hour hPL ,[A] Iav (hPL) The average value of the phase currents at the SP level and hour hPL, [A] UF (hPL) The unbalance factor calculate for the peak load hour,  (2) , SC (3) , …, SC (Kmax) ].

QI Qualification indicator UFav,SP
The average value of the unbalance factor on the LV side of the SP GC The number of "candidate" groups UFSP (h) The unbalance coefficient on the LV side of the SP and hour h; {PGC} Set of pillars with least one consumer from the "candidate" groups GC is connected; {PT} Set of all pillars from the analyzed μG; UFpGC (h) Unbalance coefficient for the hour h at the pillar pGC where at least one consumer from the "candidate" groups GC is connected; UFlim Limit value accepted by the DGO for the unbalance coefficient in the μGs; Ia,SP (h) The current on the phase a on the LV side of the SP and hour h, [ The number of the non-switchable consumers connected on the phase b, at the pillar pGC  {PGC}, and hour h Nc,ns,pGC (h) The number of the non-switchable consumers connected on the phase c, at the pillar pGC  {PGC}, and hour h Na,s,pGC (h) , The number of the switchable consumers connected on the phase a, at the pillar pGC  {PGC}, and hour h Nb,s,pGC (h) The number of the switchable consumers connected on the phase b, at the pillar pGC  {PGC}, and hour h Nc,s,pGC (h) The number of the switchable consumers connected on the phase c, at the pillar pGC  {PGC}, and hour h NC,ns,pCG (h) The total number of the non-switchable consumers connected at the pillar pGC  {PGC}, and hour h NC,s,pCG (h) The total number of the switchable consumers connected at the pillar pCG  {PGC}, and hour h NC,pCG (h) Total number of the consumers connected at the pillar pCG  {PGC}, and hour h Na,ns The total number of the non-switchable consumers from the μG connected on the phase a Nb,ns The total number of the non-switchable consumers from the μG connected on the phase b Nc,ns The total number of the non-switchable consumers from the μG connected on the phase c Na,s (h) The total number of the switchable consumers (belonging to the "candidate" groups) from the μG connected on the phase a, at hour h; Nb,s (h) The total number of the switchable consumers (belonging to the "candidate" groups) from the μG connected on the phase b, at hour h; Nc,s (h) The total number of the switchable consumers (belonging to the "candidate" groups) from the μG connected on the phase c, at hour h; na (h) The total number of the consumers from the μG connected on the phase a, at hour h; nb (h) The total number of the consumers from the μG connected on the phase b, at hour h; nc (h) The total number of the consumers from the μG connected on the phase c, at hour h; FID Full implementation degree-based algorithm ΔWS The energy-saving, [%] ΔW0 Energy losses in the unbalance case (0% implementation degree of the PLBE installed in the μG), [kWh] ΔWpg Energy losses in the balanced cases (pg = 100% and 17.5%), [kWh]  a b b b b b b b b b b b b b b b b b b b a a b b b  3 18 C5  a a b b b b a a a a a b a a a a b a a a a a a a b  7   20  C5  c b a a a a b a a a b a b b b b a b b b a a b b a  12   37  C5  a a b b b b b c a c b b b a b b b b b b c a b b b  10   42  C5  a b b b b b b a a a a b b b b b c b c a c c a c c  10 43 C5 c a c c b b a c c c c b a b a a b a a b a a b a b  16   48  C5  c b b b a a a a a a a a b a b a b a a a a a a a a  8   53  C5  c b c c a a a a a a a a a a a a c a a a a a a c c  6   54  C5  b a c c a a a a a a a a a b a b b b a a a a a c c a a a a a a a a a a a a c a a a a a a a a a a a a a a a a a a a a a a a a a a a a  0   82  C5  b a a a a a a a a a a a a a a a a a a a a a a a a  1   83  C5  a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a