Optimal Coordination of Over-Current Relays in Microgrids Using Unsupervised Learning Techniques

Microgrids constitute complex systems that integrate distributed generation (DG) and feature different operational modes. The optimal coordination of directional over-current relays (DOCRs) in microgrids is a challenging task, especially if topology changes are taken into account. This paper proposes an adaptive protection approach that takes advantage of multiple setting groups that are available in commercial DOCRs to account for network topology changes in microgrids. Because the number of possible topologies is greater than the available setting groups, unsupervised learning techniques are explored to classify network topologies into a number of clusters that is equal to the number of setting groups. Subsequently, optimal settings are calculated for every topology cluster. Every setting is saved in the DOCRs as a different setting group that would be activated when a corresponding topology takes place. Several tests are performed on a benchmark IEC (International Electrotechnical Commission) microgrid, evidencing the applicability of the proposed approach.


Introduction
Modern societies are highly dependent on the supply of electrical energy for their daily functioning. The per capita energy consumption has steadily grown, due to the increasing of industrialization and world population; so, fossil fuel and conventional energy resources might not be sufficient for meeting humanity's energy needs in the medium term [1]; in other words, the traditional electrical network will not be enough to meet the growing energy demand. For overcoming this issue, the massive implementation of renewable energy resources and efficient energy storage systems have been thought as the future of power generation [2,3]. Microgrids play a key role in this solution, since they facilitate the integration of renewable energy resources in distribution systems through distributed generation (DG) [4]; nevertheless, such integration brings new issues regarding their control and operation [5].
The fact that microgrids may exhibit different operational modes that are associated with the presence of DG units has become one of the main challenges in their protection coordination [6]. DG units generate bi-directional power flows and variable short-circuit levels that modify the traditional behavior of distribution networks. According to [7,8], protection systems in microgrids must face two remarkable challenges: the first one corresponds to their inherent dynamic behavior, due to intermittent loads and generators, and the second one is related to their operating characteristics (grid connected or islanded). These two aspects tangle the problem of microgrid protection coordination; therefore, finding a protection scheme that guarantees speed, selectivity, and reliability has become one of the most challenging tasks in planning microgrid operation [9].
Directional over-current relays (DOCRs) are widely used in distribution networks (DNs) and they are recognized as the main protection device due to their simplicity and low implementation cost [10]. Nevertheless, non-radial flexible systems such as microgrids complicate the setting of DOCRs [11][12][13]. Recently, researchers have focused their efforts on the implementation of optimization techniques for reducing the protection times of DOCRs, guaranteeing selectivity and reliability resorting to non-standard characteristics [14,15] and machine learning techniques [16][17][18].
In [14], an alternative approach to conventional protection coordination modeling was proposed. This is achieved by adding a new constraint to the coordination problem that takes into account the Plug Setting Multiplier (PSM), which is the ratio of the fault current that is seen by the relay to the pickup current. The tripping characteristic of over-current relays is limited by the PSM value. The approach of [14] takes the limitation of conventional IEC tripping characteristics used nowadays in numerical relays into consideration.
The authors in [10] proposed a setting group-based adaptive protection scheme to take different configurations of a microgrid that result from the connection and disconnection of DG into account. The work proposes different setting groups, limiting its number according to the capabilities of commercial relays; additionally, a new method based on integer linear programming and particle swarm optimization (PSO) is used to specify the adjustments of DOCRs. A similar approach to the one that was proposed in [10] is implemented in [16] and [17] while using unsupervised machine learning techniques. In [16], the authors exploit the facility to save multiple setting groups within digital DOCRs to adapt the setting of the relays to the current topology of the network. Because the number of setting groups is much lower than that of possible network topologies, a K-means algorithm is used to classify topologies into a number of clusters equal to the number of setting groups. Based on this work, the authors in [17] proposed a technique for DOCRs coordination while using the Self-Organizing Map (SOM) clustering algorithm.
In [18], the protection settings and network topology of a microgrid are modified through a rule-based adaptive protection scheme to enhance network reliability. The protection coordination is achieved by means of a machine-learning methodology that is based on a hybrid artificial neural network and a support vector machine model. In [19], the authors proposed a protection coordination index to measure the impact of DG on DOCRs coordination. The index is determined by a two-phase non-linear programming optimization problem that considers variations of the maximum DG penetration level with changes in the protection coordination time interval. Authors in [20] proposed a methodology for coordinating DOCRs that considers topology changes due to single outages of lines or generators. The optimal relay settings when considering the N-1 security criterion are achieved through the solution of a mixed integer nonlinear programming problem. In [21], a multi-objective swarm optimization algorithm combined with a fuzzy decisionmaking tool is developed for the coordination of DOCRs in microgrids. The proposed approach aims to overcome the limitations of single-objective optimization algorithms that are applied to minimize the operation time of DOCRs coordination. In [22], the authors proposed an online adaptive coordination protection scheme for DOCRs using intelligent electronic devices and a communication channel to obtain real-time information to update the configuration of the relays. This paper proposes a new protection coordination approach of DOCRs in microgrids that integrates and complements the characteristics of the models that are presented in [10,14,16,17]. The proposed coordination model is applicable to adaptive protection schemes that use different settings groups and considers the current capabilities and limitations of DOCRs. The coordination problem is solved by a genetic algorithm, while several machine learning techniques carry out the clustering of operational scenarios. The contributions of this work are twofold: (1) it adopts the constraint that was proposed in [14] regarding the PSM while taking into account the limitation of conventional IEC tripping characteristics currently used in numerical relays, and (2) it limits the number of clusters to that of the setting groups according to the capabilities of commercially available relays, as proposed in [10,16,17].
These two features are available in normal operation of commercial relays; nonetheless, they are traditionally not considered in the optimization models of DOCRs. It is a fact that the number of relay setting groups is far less than the possible operating scenarios of a microgrid. Therefore, the proposed approach adopts machine learning techniques to intelligently group the operation scenarios according to the number of setting groups available in the relay. Additionally, a comparison of the performance of different machine learning techniques, which includes K-means and SOM techniques that were adopted in [16,17] is presented. Table 1 shows the features of related research works in the field, evidencing the knowlege dgap in the existing literature that is filled by the proposed approach. X X X X X X It is worth mentioning that these features are available in commercial relays, but are not considered in traditional protection coordination schemes of DOCRs. It is also a fact that the number of relay setting groups is far less than the possible operating scenarios of a microgrid. Therefore, the proposed approach adopts machine learning techniques to intelligently group operation scenarios, according to the number of setting groups available in the relay. Apart from the aforementioned contributions, this paper compares the performance of several Machine Learning techniques, as detailed in the results section. To summarize, a methodology is proposed for the coordination of DOCRs that jointly uses the K-means, self-Organizing Map, and hierarchical techniques to improve the operating times of the coordination scheme while guaranteeing network security.

Objective Function
Equation (1) represents the objective function (OF) of the protection coordination problem that aims at minimizing the total operation time of the DOCRs. In this case, t i f corresponds to the operation time of relay i when fault f occurs, while m and n are the number of relays and faults in the system, respectively. It is worth to mention that, according to the specialized literature, the most common objective function of the protection coordination problem is the minimization of the total operation time. Regarding reliability, this one is taken into account within the constraints of the optimization problem. as described in Section 2.2.

Constraints
The constraints of the optimal DOCRs coordination problem are given by Equations (2)- (9).
Equation (2) illustrates the coordination time between backup and primary DOCRs. In this case, t j f is the operation time of the backup relay j when fault f occurs, and t i f is the operation time of the primary relay i, for the same fault. The coordination time interval CTI is the period of time that is allowed for the backup protection to operate. When a fault takes place, both the backup and primary DOCRs identify the fault occurrence. The backup DOCR is in charge of tripping the fault in case the primary DOCR misses to isolate the fault. The ORCs that are considered in this study present a normal inverse characteristic, as indicated by Equation (3). In this case, A and B are constant parameters of the curve, TMS i is the time multiplying setting of relay i, and PSM i f is the ratio between the fault current I f i and the pick up current ipickup i given by Equation (4). Equation (5) indicates the operating time limits of the DOCRs. In this case, t imin and t imax are the minimum and maximum operating time of relay i, respectively. Equation (6) represents the minimum and maximum limits of TMS for relay i that is given by TMS imin and TMS imax , respectively. Similarly, Equation (7) represents lower and upper limits of the pickup current ipickup i , denoted as ipickup imin and ipickup imax , respectively.
Equation (8) represents the lower and upper limits of the PSM denoted as PSM imin and PSM imax , respectively. PSM is the ratio between the fault current seen by the relay and the pickup current. The standard characteristic curves of commercial relays are generally defined in a region where the minimum and maximum values are 1.1 and 20 times the PSM, respectively. Nonetheless, the presence of DG units in microgrids considerably increases the short circuit levels. Consequently, for different faults, the maximum value that is defined for the PSM might be exceeded, affecting the sensitivity of the protections and causing a loss of the coordination protection scheme. In order to avoid this, a new constraint regarding the PSM was introduced in [14]. In this case, the maximum value of the PSM is the highest current level of the IEC normally inverse curve programmed in the industrial protective relay before the definite time region of the curve.
Equation (9) represents the lower and upper limits of setting groups (SG), denoted as SG imin and SG imax , respectively. This consideration is not taken into account in traditional protection coordination approaches. In this case, SG imax corresponds to the highest number of SG programmed in the industrial protective relay, which may range from two up to eight, depending on the manufacturer.

Unsupervised Learning Techniques
Machine learning can be defined as the study of computer algorithms that automatically improve through experience and provide computers with the ability to learn. Machine learning algorithms are generally classified in supervised and unsupervised. In the former, the computer is presented with sample inputs and their corresponding or desired outputs and the goal is to learn the general rule that maps inputs to outputs, while, in the later, the data set is not labeled; this means that the algorithm must find the labels and define them. Accordingly, these algorithms need to learn the structure of the data set and the relationship between the characteristics for creating groups of objects [25]. A group is a set of data objects that are similar to each other, but different from objects in other groups. Unsupervised algorithms make inferences from data sets while only using input vectors without referring to known, or labeled outcomes. In this work, unsupervised learning algorithms are used for grouping microgrid operation scenarios and then for proposing adjustments to the DOCRs for each of the groups that are found. The K-means and SOM techniques used in [16,17] are implemented for comparative purposes, along with hierarchical techniques for improving results.

K-Means Clustering Algorithm
K-means is a well known unsupervised machine learning algorithm that is used for clustering [25]. The objective of K-means is basically to group similar data points together and discover underlying patterns. It consists on determining a set of k points in a dataset, called centroids (every centroid is associated to a cluster). Subsequently, each data point is allocated to each cluster minimizing the distance d ij from each object within the dataset to its closest centroid [16]. To summarize, K-means algorithm identifies the k number of centroids and then allocates every data point to the nearest cluster, keeping the centroids as small as possible. Figure 1 illustrates the K-means clustering for five clusters within a three-dimensional space. It is worth mentioning that the number of clusters in the proposed application is limited by the number of setting groups available in commercial DOCRs. The K-means algorithm features the following procedure of five steps: (1) k points are selected as the number of groups desired to create initial centroids, (2) every data point is associated with the closest centroid to create temporal groups from the distance d ij , (3) new centroids are calculated for each temporary group, (4) each data point is reassigned to the group with the closest centroid from the distance d ij , and (5) the procedure is repeated until convergence is achieved. For calculating d ij , the Euclidean distance is commonly used, as shown in Equation (10), where x i is the object, c j is the center of the group, and m is the number of objects in the group g j .

SOM Clustering Algorithm
The SOM clustering algorithm is a type of competitive artificial neural network that is designed to facilitate the visualization of high-dimensional data structure. Kohonen introduced SOM in [26]. The neurons in this method are generally distributed on a twodimensional rectangular or hexagonal grid, which is called map. In this sense, SOM can be seen as a method for performing dimensionality reduction. Each neuron in SOM has an associated n-dimensional weight vector that can be considered as its position within an n-dimensional space. The training consists of reducing a distance metric by moving weight vectors towards the input data without spoiling the topology that is induced from the map space. Figure 2 illustrates the topology of the SOM network. This algorithm features the following procedure of five steps: (1) randomize the node weight vectors in a map, (2) randomly pick an input data vector D(t), (3) use the Euclidean distance to find the similarity between the input vector D(t) and the map's node's weight vector, then track the node that gives the smallest distance (best matching unit), (4) update the weight vectors W(s + 1) of the nodes in the neighborhood of the best matching unit by pulling them closer to the input vector, and (5) increase the current iteration s and repeat from step 2, while current iteration s is less than the iteration limit. Equation (11) is commonly used for updating the weight vectors W(s + 1), where f (u, v, s) is the neighborhood function that provides the distance between neurons u and v in iteration s, a is a monotonically decreasing learning coefficient, u is the index of the best matching unit in the map, v is the index of the node in the map, and s is the current iteration.

Hierarchical Clustering Algorithm
Hierarchical clustering algorithms allow for identifying homogeneous groups of data location, from a similarity matrix [27]. Finding the hierarchical structure involves calculating the distance between each pair of points and then using these distances to join pairs of points. Hierarchical algorithms group from bottom to top. Each sample starts in its own group; the two most similar groups are combined into a new larger group until all of the samples are joined into a single large group. The result of this procedure can be graphically represented using a dendrogram or binary tree. Figure 3 illustrates an example of hierarchical clustering. In this case, six elements are allocated in a square. X and Y are the first two elements that are combined to form a cluster. This is done by computing the distance based on the length of a straight line drawn from one element to another. The closest element to the new set formed by X and Y is W; and then elements X, Y, and W form a new cluster. The process continues until all of the elements are grouped together, as indicated in the dendogram.
The distances between new groups formed and each of the old groups can be calculated following different procedures [28]. In this research, we used the single, complete, average, and Ward method for calculating the distances between groups, as detailed below.

Single Method
In this case, the distance d ij between groups g i and g j corresponds to the minimum distance between two points x and y. Point x belongs to group g i , while point y belongs to group g j .

Complete Method
In the Complete method, the distance d ij between groups g i and g j corresponds to the maximum distance between two points x and y. Point x belongs to group g i , while point y belongs to group g j .

Average Method
In this case, the distance d ij between groups g i and g j corresponds to the average of the distance between two points x and y. Point x belongs to group g i , while y belongs to group g j . Where n i is the number of elements in group g i and n j is the number of elements in group g j .

Ward Method
In the Ward method, the total variance within the group is minimized. At each step groups g i and g j with a minimum distance d ij merge. A pair of groups is found that yields a minimal increase of total variance within the group after fusion.

Methodology
Initially, the microgrid under study is modeled and several simulations are carried out in order to characterize its behavior. In this step, information regarding short-circuit currents that are seen by the relays for a set of operative scenarios and faults is obtained. In this case, three-phase faults were considered in the middle of the lines. However, other types of faults and locations can be considered, which may result in different settings of the DOCRs. It is worth mentioning that every system operator determines the type of faults and locations to be evaluated beforehand in order to establish the protection coordination scheme. From the results of the aforementioned simulations, a cluster analysis is performed when considering several operative scenarios using the machine learning algorithms described in Section 3. Subsequently, the optimal coordination of DOCRs is performed for each cluster that was obtained by the machine learning algorithms. A genetic algorithm (GA) is used in this step. Nonetheless, is worth mentioning that any other metaheuristic technique can be implemented in this step. Finally, while taking the results of the DOCRs coordination and the defined clusters into account, a heuristic is applied for improving the coordination. Figure 4 depicts the flowchart of the proposed methodology. Each of the steps is described in detail below.  Figure 4. Flowchart of the proposed methodology.
A short-circuit analysis is first performed in all operative scenarios to perform the clustering. In each operative scenario, each fault current that is seen by each relay of the system is taken, according to the established faults. Once it is established, the database with all of the fault currents that are seen by the relays, the clustering is carried out with each of the automatic learning techniques described in the document. In all of the automatic learning methods implemented, clustering is carried out from the fault currents that are seen by the relays in all operating scenarios. In the particular case of the K-means technique, the clustering is carried out, taking, as a starting point, a centroid that essentially depends on the fault currents seen by the relays.
Once the clusters are defined, in order to identify the coordination of each one, the previously established fault currents are considered and the coordination is evaluated while taking into account the fault current seen by each relay in all the scenarios found in the cluster, while using the GA. The above process is repeated for each cluster.
As already mentioned, the GA is in charge of coordinating each cluster based on the fault currents that are seen by each relay in the operating scenarios present in the cluster.
In order to carry out this coordination, the initial individuals of the population are defined randomly, while considering the constraints of the decision variables. In this problem, the individuals are the variables that are to be adjusted in each relay of the system. The GA considers the operating times of all relays as the objective function. What is sought in this case is to reduce operating times, ensuring that the constraints that are presented in the formulation are met.
There are different stopping criteria in the steps of the methodology. In the general methodology, the first one is that there are no coordination violations between relays. The second one is that the maximum number of clusters allowed is reached (this is defined according to the characteristics of the commercial relay that is being used, depending on the maximum number of groups of settings that it has enabled). In the case of the GA, a maximum number of iterations was defined as the stopping criterion (2000 iterations for the test system used).

Simulation Process
The test microgrid is modeled using the Digsilent Power Factory software [29], where a set of possible operating scenarios are configured. The configuration of scenarios is carried out taking into account combinations of different generation outputs and topological alternatives. Once each operation scenario is configured, short-circuit current calculations are performed for different fault locations and for each operating scenario. The output data of the simulation process are the short-circuit current values that are seen by each relay for each fault. Figure 5 presents the flowchart of this stage of the methodology.

Clustering of Operating Scenarios
The proposed methodology seeks to identify different setting groups, limiting its number to the capabilities of commercial relays. The number of relay setting groups is far less than the possible operating scenarios of a microgrid; therefore, an intelligent grouping of scenarios that meets the limitations of commercial relays is necessary. The data regarding short-circuit currents of the set of operating scenarios is the characteristic evaluated to perform the clustering. The number of sets in which the operation scenarios are grouped is defined. Subsequently, the short-circuit currents obtained in Step 2 are used as input data for the machine learning algorithms. The clustering is performed according to the defined number of groups and short circuit results, while using the unsupervised learning technique that is described in Section 3, as shown in Figure 6. Each of these methods provides a possible distribution of the groups of operating scenarios.

Solution of the Protection Coordination Problem
The protection coordination problem is solved by means of a GA, as previously mentioned. It is worth to mention that in this step any other metaheuristic can be implemented; nonetheless, GAs have proven to be effective in addressing the coordination problem of DOCRs as outlined in [24,30,31]. The short-circuit currents obtained in Step 1 and the groups obtained by the machine learning algorithms in Step 2 are used as input data of the GA. The DOCR coordination model presented in Equations (1) to (9) is solved for each group of settings provided by the machine learning algorithms (see Figure 6).
The clustering carried out using the machine learning algorithms gives possible distributions of operative scenarios in the groups. The characteristics of each distribution must be evaluated in order to define which one guarantees the safest operating condition. The GA solves the DOCR coordination problem for each distribution corresponding to the operating scenarios. Once this process is carried out, the performance of each distribution is evaluated, verifying the coordination times between main and back up relays, as well as the operating times for each relay. Finally, if the performance of any of the distributions of the operating scenarios guarantees the enforcement of the coordination constraints, the process is finished; otherwise, it it proceed to step 4.

Heuristic Adjustment
An adjustment of the distributions is made using one of the techniques summarized in Section if the performance of the distributions of the operating scenarios does not comply with the constraints of the protection coordination problem 3. Each method provides a possible distribution of the operating scenarios. For performing such adjustment, the performance of each of the methods is analyzed.
The heuristic process is as follows: (1) the method with the best performance is selected, (2) the groups that present coordination problems are identified, (3) the group distributions of other methods with great similarity to groups of step 1 are detected; the coordination of such methods must be adequate, (4) the differences between the members of the selected groups in steps 2 and 3 are analyzed, (5) small modifications are made in the group that is selected in step 2, taking some elements form another group, (6) the DOCR coordination problem is solved for the groups of step 5, and (7) it is verified if the coordination performance of the new distributions complies with the selectivity constraint; if it is so, the process is terminated; otherwise, the second best performing method is selected and the procedure is repeated repeated through step 2. Figure 7 shows an example of one of the proposed heuristic.

Tests and Results
The proposed approach was tested with a benchmark IEC microgrid that integrates DG. Figure 8 depicts the test microgrid and its parameters can be consulted in [32]. Also, the characteristics of the protection scheme can be found in [14]. Table 2 presents the 16 operative scenarios (OSs) taken into account for this microgrid. Such OSs are generated by considering different generation and topological conditions. Note that the topology of the microgrid is modified while considering the operational states of switches CB-1 and CB-2; apart from this, the microgrid is able to operate connected or disconnected from the main network (grid-connected and islanded modes).  OS1  on  open  open  off  off  off  off  OS2  on  open  open  on  on  on  on  OS3  on  open  open  on  on  off  off  OS4  off  open  open  on  on  on  on  OS5  on  close  close  off  off  off  off  OS6  on  close  close  on  on  on  on  OS7  on  close  close  on  on  off  off  OS8  off  close  close  on  on  on  on  OS9  on  close  open  off  off  off  off  OS10  on  close  open  on  on  on  on  OS11  on  close  open  on  on  off  off  OS12  off  close  open  on  on  on  on  OS13  on  open  close  off  off  off  off  OS14  on  open  close  on  on  on  on  OS15  on  open  close  on  on  off  off  OS16  off  open  close  on  on  on  on For the sake of clarity, all of the relays were labeled with numbers ranging from one to 15, preceded by the letter R located, as illustrated in Figure 8. Standard IEEE 242 recommends that the coordination time between main relay and backup relays CTI should be equal to or greater than 0.2 s [33]. In this case, a CTI of 0.3 s is considered for ensuring a greater margin of safety. A standard inverse IEC characteristic curve was adopted for the operating characteristic of the DOCRs, with parameters A and B of 0.14 and 0.02, respectively. This type of curve was adopted, since it is the most widely used in protection coordination schemes; nonetheless, any other characteristic curve may be used. It was also assumed that the relays of the microgrid are able to configure a maximum of four setting groups. The test system was implemented in DIgSILENT Power Factory and several faults were considered in the lines of the test network.

Results with No Clustering
The coordination problem was initially solved when considering a single set of parameters for the 16 operative scenarios described in Table 2. The problem was solved using a GA. Results are summarized in Table 3 that shows the total operating times and the number of cases where coordination is not guaranteed; that is, where the constraint given by Equation (2) is not met. It is evident that coordination cannot be guaranteed in all cases since constraint (2) is not fulfilled 13 times. From this test, it is concluded that it is extremely difficult (if not impossible) to guarantee security when considering a single set of parameters due to the high number of operating alternatives.

Results with Two Clusters
In this section, the DOCR coordination problem is solved by using the proposed methodology. The initial number of relay setting groups is defined. In this case, it starts with two clusters and the grouping of the OS that is presented in Table 2 is carried out. Table 4 details the OS belonging to each cluster, the operation time and number of violations of the coordination problem that was obtained with different methodologies.
In this case, all of the clustering methods provided the same distribution of OS. In cluster 1, there are no coordination problems; that is to say that selectivity is guaranteed; nonetheless, in cluster 2, there are four cases where coordination is not guaranteed. When comparing with the results that are presented in Table 3, a reduction of the operating time and number of violations in the selectivity constraint is evident. Nonetheless, the adjustment with the heuristic technique does not present any additional improvement in this case. Therefore, it is proceeded to increase the number of clusters.

Results Considering Three Clusters
In this case, three clusters are considered and the OS presented in Table 2 are grouped using the described methods. The distribution of the clusters and the obtained results are presented in Table 5. Note that the Hierarchical single and average methods provide the same clustering, while the other methods result in different distributions of OS. When comparing with Table 4, a reduction of the violations is evident; however, some cases still do not achieve coordination, since up to four violations are presented in some clusters. In this case, the method that obtained the best performance was K-means, while the ones with the worst performance were the hierarchical single and average methods. The adjustment using the heuristic technique did not present any additional improvement, so it is expected to increase the number of clusters. Table 6 presents the results of the methodology considering four clusters. In this case, the hierarchical single and average methods provided the same distribution of OS, while the other methods found different clusters. When comparing with Table 5, there is an improvement in all of the methods, except for K-means, which presents the worst performance, while the hierarchical Ward presents the best performance. An adjustment of the clustering was made while using the heuristic that was proposed in Section 4.4. The main idea with this heuristic is to improve the results of the clustering methods. Table 7 and Figure 9 present the adjustment results. It can be seen that the coordination is guaranteed, since constraint (2) does not present any violation in any of the clusters. In this case, the optimal coordination is finally achieved and, therefore, no further clustering is required.   Table 8 presents the protection coordination settings for the test system. For each relay, ipickup and TMS in each group are presented; furthermore, backup relay information is also presented. For illustrative purposes, Figure 10 depicts the coordination between a main and a backup relay in OS12 for the IEC microgrid when fault in line DL-5 takes place. In this case, the main and back up relays are RP2 and RB4, respectively. Note that the coordination between these two relays is evident.

Conclusions
The optimal coordination of protection schemes in modern distribution networks that incorporate microgrids has became a challenging task, due to the presence of DG. Furthermore, microgrids may feature multiple operational scenarios and topologies, which renders traditional approaches for DOCR coordination unreliable. In this context, adaptable protection schemes are required. This paper proposes a flexible approach for the optimal coordination of DOCRs in microgrids that host DG and feature several operational scenarios or topologies. The proposed coordination approach is applicable to adaptive DOCR schemes that use different setting groups and considers the current capabilities and limitations of commercial relays. The proposed model considers the unsupervised learning techniques to intelligently group operation scenarios according to the number of setting groups available for each relay. A comparison of the performance of three unsupervised learning techniques is performed (K-means, SOM, and Hierarchical clustering with four variants). Furthermore, a new methodology for mixing characteristics of different machine learning algorithms is proposed by means of a heuristic adjustment that allows for improving the performance of the protection scheme. A genetic algorithm was used for solving the proposed coordination model. The applicability and effectiveness of the proposed approach was tested with a benchmark IEC microgrid that features 16 operational scenarios. The tests show that an adequate coordination is guaranteed when four setting groups are considered. In this sense, the heuristic adjustment played a key role in ensuring the selectivity of the proposed coordination. Future research may include other machine learning techniques as well as non-conventional characteristics of commercially available DOCRs.