Detection and Prevention of Unintentional Formation of Loops in Self-Healing Power Systems and Microgrids

Self-healing or self-assembling power systems that rely on local measurements for decision making can provide significant resilience benefits, but they also must include safeguards that prevent the system from self-assembling into an undesirable configuration. One potential undesirable configuration would be the formation of closed loops for which the system was not designed, a situation that can arise any time that two intentional-island systems can be connected in more than one place, e.g., if tie-line breakers are included in the self-assembling system. This paper discusses the unintentional loop formation problem in self-assembling systems and presents a method for mitigating it. This method involves calculating the correlation or the mean absolute error (MAE) between the two local frequency measurements made on either side of a line relay. The correlation and MAE between these frequencies changes significantly between the loop and non-loop cases, and this difference can be used for loop detection. This article presents and explains the method in detail, presents evidence that the method's underlying assumptions are valid, and demonstrates in PSCAD two implementations of the method. The paper concludes with a discussion of the strengths and weaknesses of the proposed method.


Detection and Prevention of Unintentional Formation
of Loops in Self-Healing Power Systems and Microgrids

I. INTRODUCTION
A SELF-HEALING power system (SHePS) has the ability to automatically detect that the system is not operating within desired parameters, and to restore as much of the system as possible to normal operation [1]. Typically, a SHePS does this by reconfiguring itself via switches and tie lines to route power around damaged or faulted equipment, in such a way that the maximum amount of load remains served.
Two classes of engineering challenges associated with SHePS are a) locating and isolating the damaged or faulted equipment; and b) ensuring that during the self-assembly process the SHePS does not enter a configuration that is infeasible or undesirable.
A considerable amount of work has been done on various types of SHePS over the last two decades [2], [3], [4], [5], [6], and some SHePS techniques are mature; one SHePS technology, commonly called Fault Location Isolation and Service Restoration (FLISR) [7], is commercially available (for example, see [8] and [9]). Today's SHePS technologies typically address the two engineering challenges described above via sharing of data over a high-speed communications network [10], [11], between devices and a central controller (a centralized architecture) or between devices directly (a distributed architecture). Such systems have shown considerable promise, but in practical applications, the communications systems can be expensive, often suffer from scalability issues, and may become unreliable during natural or human-caused disruptions. Maurer et.al. described the situation thus [12]: "Communications is the Achilles' Heal [sic] of any self-healing system. No matter what type of self-healing system you select-centralized, substation-based, or distributed intelligence-that fact is still true." This paper deals with a subclass of SHePS techniques that do not share data between devices, and instead rely only on local measurements. The process envisioned in this paper is an application to power systems of the concept of "self-assembly" [13], [14], a term borrowed from chemistry, biology, and materials science [15], [16] in which larger, more complex structures are formed spontaneously, without centralized direction. Selfassembling power systems could have major resilience benefits. They could be used by themselves, providing a minimum-cost high-flexibility option that avoids the problems associated with communications-dependent systems described above, or they could be used as backups to communications-based systems. One unacceptable configuration that must typically be avoided during self-assembly is the creation of closed loops. Most North American distribution is not designed to be looped, and in microgrids formed from such circuits unintentional formation of loops can lead to operational problems, such as paralleling of tap-changing voltage-regulating transformers [17], [18] or issues with protection not designed for looped circuits [16], [19]. Consider the example microgrid shown in Fig. 1. This microgrid is formed from a section of subtransmission and two existing distribution circuits. Grid-forming sources are labeled "GFM", and grid-following sources "GFL". The red boxes indicated closed relays, and the green boxes indicate open relays. The microgrid is off-grid in Fig. 1 as indicated by the green blocks (open breakers) at either end of the subtransmission section. This microgrid includes two normally-open tie lines between breakers T11-T21 and T12-T22. If the tie-line breakers were automated as part of the SHePS scheme, there are three ways in which closed loops could be formed in this microgrid, shown by dashed red loops, all of which would include step-regulating transformers. In a self-assembling system, it is necessary that each tie-line relay includes a function that enables that relay to determine using only its own local measurements whether closure of that relay would create a closed loop, and if so, block closure of that relay.
This loop-detection function will only need to operate in a situation in which an open line relay detects in-range ("good") voltage and frequency on both sides. (If there is a "good" voltage on one side only, then the other side is de-energized and closing of that relay cannot form a loop.) The loop detection function will operate in coordination with a synchronization check (synccheck) function that ensures that the voltages on both sides of the relay have a sufficiently-close match in magnitude and phase angle. Because the frequencies on either side of the line relay may be similar, the sync-check function may take tens of seconds to reach phase matching. This consideration, combined with the fact that both sides of the relay are already energized so there is no load not being served, means that the loop detection function does not need to be especially fast; it could take 10 to 20 seconds to operate without causing unacceptable system performance degradation.
The key contribution of this paper is a proposed method for preventing the unintentional formation of closed loops in self-assembling SHePS, using only local measurements. The proposed method uses statistical analysis of the voltage frequencies on either side of the relay to detect whether the systems on either side are independent or interconnected. To the best of our knowledge, this is the first proposed method for solving the unintentional loop prevention problem in self-assembling power systems. The physical mechanism of operation of the method is explained, implementations of the method using two different statistical parameters (correlation and mean absolute error) are described, and the operation of the method is demonstrated via simulation.

II. THEORY AND PROPOSED METHOD
Consider an open line relay that is on the boundary between two small intentionally-islanded power systems x and y, as shown in Fig. 2. This open line relay can be energized from either side, so it has voltage measurements in both systems. Both voltage measurements are made by the same relay, so time synchronization of the measurements is straightforward.
If systems x and y are completely independent of one another, then closing the line relay will network systems x and y so that they can share resources, and closure can be permitted. If systems x and y are already connected at another point, however, connecting this line relay will form a closed loop through that existing point of interconnection, so closure must be blocked.
In this work, it is assumed that all of the sources in the intentionally-islanded systems use a linear frequency droop function, expressed as where f(t) is the operating frequency at time t, f 0 is the operating frequency corresponding to power P 0 , P(t) is the power being drawn from the source at time t (i.e., the load power at time t) and m is the desired slope of the power-frequency droop line. The load power P(t) can be expressed as a combination of an average component, P avg , and a randomly-varying component, P rand : Substituting (2) into (1) shows that the operating frequency f(t) also has a random component: When two sources are in independent, non-connected systems, their load variations P xrand (t) and P yrand (t) will be independent (an assertion that is demonstrated via measured data in the following section of this paper). Reflecting each of these independent power vectors off of the droop curve of each source using (3) results in two f(t) vectors with independent f xrand (t) and f yrand (t) components. On the other hand, if systems x and y are interconnected, then their sources share a total load and a common frequency as shown in the house diagram in Fig. 3, and their f(t) vectors will be strongly correlated. (There will be short-duration transient variations in frequency that can be uncorrelated, but in most cases, these high-speed frequency variations are filtered out of the measurements.) Thus, if the frequency vectors on either side of the line relay in Fig. 2 are independent, the closure of that line relay will not lead to the formation of a loop, but if the frequency vectors are not independent, then the closure of that line relay should be blocked because such closure would form a closed loop. The independence or non-independence of the two frequency vectors can be identified via any of several statistical comparisons of the vectors. For example, Pearson's correlation r [20] between the two frequency vectors would be expected to yield very close to +1.0 when the two systems are connected, but would vary between ±1.0 when they are independent. Similarly, it would be expected that the average error at each time step between the two frequency vectors would be much larger when the systems are independent than when they are connected. Thus, the mean absolute error (MAE) [20] between the two frequency vectors would be expected to be orders of magnitude smaller when the systems are connected than when they are independent. In this work, methods for unintentional loop detection based on both Pearson's r and the MAE are demonstrated via PSCAD simulations.

III. DEMONSTRATION OF NON-CORRELATION OF GEOGRAPHICALLY ADJACENT LOADS
Either implementation of the proposed method of unintentional loop detection relies on there being an uncorrelated variation between the loads in adjacent microgrids, over a time window of a few seconds to a few tens of seconds. This independence of loads is what gives rise to the differences in correlation or MAE that make unintentional loop detection possible. Because of the reliance of the method on this property of loads, it is important to demonstrate that real-world loads actually do have this property. Thus, to demonstrate this lack of correlation between real-world loads, two sets of 1-second load data, one measured at the individual residence level and one measured at the feeder-head level, were analyzed using MATLAB. This section presents the results of those analyses.

A. Data From Ota City, Japan
The first data set includes two years' worth of 1-second data measured at the individual residence level for 586 residences in Ota City, Japan. These residences are geographically clustered (all within a roughly 1 km × 1 km area) and served by the same distribution circuit. Details of the system and the data set are found in [21]. Correlations were calculated between each pair of individual residences, and also between two synthetic 'microgrids' created by summing the first 260 residences (1-260) and the next 260 residences (261-520) into two aggregates. The synthetic microgrids are the more difficult case for the loop  detection method, so those results are presented here. Fig. 4 shows a sample of the power demand of these two synthetic microgrids, using a portion of the June 2007 data. It can be seen in Fig. 5 that the microgrids' loads do correlate over longer intervals-for example, there is a clear diurnal correlation in the loads-but superimposed onto this is a higher-frequency noise that results from the shorter-term individual load switching referred to earlier in this paper. That higher-frequency variation is the variation on which the loop detection method will rely. The load data are measured at a 1-s interval, meaning that the Nyquist frequency is only 0.5 Hz. Some load variation that is relevant to this method will be faster than this, but that higher-rate variation will be aliased to lower frequencies in these data. Fig. 6 shows a tightly zoomed view of the 1-s active power demand of the two microgrids, after high-pass filtering to remove the DC offset. It is visually apparent that these loads are changing independently; short times can be found in Fig. 5 in which the loads are well-correlated, anticorrelated, and uncorrelated. Thus, if one ran a Pearson's correlation calculation on these data, one might  expect a "noisy" correlation result that oscillates between +1 and −1. Fig. 7 shows the unfiltered Pearson's correlation coefficient versus time between the two microgrids' active power demand, using a 7200-point buffer. As expected from the visual inspection of the data, the correlation appears oscillatory, fluctuating over a range of almost ±0.9 with approximately zero mean. Fig. 8 shows a moving-average filtered version of the correlation in Fig. 7, showing that the mean value of the correlation is low.

B. Data From Cordova AK
The second set of data contains two years' worth of 1-second data from the Cordova Electric Cooperative (CEC) system in Cordova, AK [22], measured at the whole-feeder level. There are five data sets, measured at five separate feeder head-ends fed from a common main bus. Figs. 9-12 show results from this data set. Fig. 9 shows the active power vs. time at 1-s resolution measured at the head ends of two similar feeders, for a small segment of the data recorded in June 2015. The CEC data shows a correlated diurnal variation, but superimposed on that is a Fig. 9. Active power vs. time at 1-s resolution measured at two feeder headends for the CEC system.    higher-frequency uncorrelated variation. Fig. 10 shows a tightlyzoomed view of a section of the data in Fig. 9, highlighting this higher-frequency variation. Fig. 11 shows Pearson's correlation calculated on the data set in Fig. 9, and Fig. 12 shows the results in Fig. 11 after passage through a moving-average filter. The correlation in Fig. 11 shows "noisy" behavior similar to that in Fig. 7, with a low mean value as indicated by Fig. 12.

IV. DEMONSTRATION OF UNINTENTIONAL LOOP FORMATION DETECTION
The use of correlation or MAE to detect unintentional loop formation was demonstrated in simulation using PSCAD. The IEEE 13-bus distribution test system [23] was partitioned into three microgrids. Fig. 13 shows a simplified one-line diagram of the 13-bus system, and Fig. 14 shows the actual PSCAD model. The blue dashed lines indicate the boundaries between the microgrids. Microgrid Boundary Relays (MBRs) connect the microgrids to one another after a specific time has elapsed and   Fig. 4, is whether breakers TL1 and TL2 can be closed without creating a closed loop. The inverters are represented in PSCAD using a generic H-bridge model switching at 3.6 kHz with forwardand backward-rotating dq0-frame grid-forming controls. The inverters have a linear power-frequency droop characteristic as shown in Fig. 15. The microgrids are numbered 633, 671, and 675, corresponding to the number of the inverter in that microgrid. In the PSCAD model in Fig. 14, each microgrid includes a pseudo-random load that consists of a small parallel R-L load (about 2% of the total microgrid load) that is switched on and off at random times using the switching function generator shown in Fig. 16. The simulation time step used is 20 µs, and the sampling rate of the data for post-processing is 5 kHz. The simulations start with the three microgrids all operating independently (all tie-line breakers and microgrid boundary relays are open). At t = 15 s, the MBR between microgrids 671 and 675 is allowed to close once its synchronization check conditions are satisfied, and at t = 35 s, the MBR between microgrids 633 and 671 is allowed to close. In each microgrid, the frequency is measured using a phase-locked loop (PLL) which is then filtered using a first-order low-pass filter with a 0.5-sec time constant. Two categories of use cases were studied: 1) "unmatched" cases in which the loading is such that there is a steady-state frequency difference between adjacent microgrids; and 2) "matched" cases in which the microgrid loads were manipulated so that the steady-state frequencies between two adjacent microgrids were essentially equal. In the plots below, a red vertical dashed line marks the time at which the MBR between microgrids 671 and 675 is allowed to close, and a purple vertical dashed line marks the time at which the MBR between microgrids 633 and 671 is allowed to close. The cases presented below provide representative results.

A. Unmatched Load Case, Using Correlation
Figs. 16-18 show correlation-based results for an "unmatched load case", with the correlation calculated using MATLAB's "corr" function [24] calculated over a sliding window. Fig. 16 shows the 5 kHz-sampled frequency vs. time for each of the three microgrids in an unmatched load case. Until t = 15, all three microgrids are independent, and Fig. 16 indicates that there is a steady-state difference in frequency between any two microgrids. In this period, any two microgrids could be connected without forming a loop. Just after t = 15 s, the 671-675 MBR closes, and the frequencies of those two microgrids become equal as their inverters share load according to the droop characteristic (Fig. 13). Now if TL2 (Fig. 15) were closed, a closed loop would be formed. At roughly t = 37 s, the 633-671 MBR closes, and after that, all three microgrids have the same average frequency. Following this, the closure of either TL1 or TL2 would form a loop, so the closure of either TL1 or TL2 should be blocked. Fig. 17 shows the unfiltered (raw) correlations vs. time over a 50000-point (10-second) moving buffer between each pair of frequencies. (For the first 10 sec of the simulation the buffers are filling.) The trace labeled 633-671 shows the correlation between the frequencies on either side of TL1, and 671-675 shows the correlation between the frequencies on either side of TL2. (The correlation between 633 and 675 is also included.) Fig. 17 shows that the correlation of frequencies between any two independent microgrids is low (less than 0.5), but as soon as any two microgrids are connected at one point, such that connection at a second point would  form a loop, the correlation between their frequencies rises rapidly and remains above 0.98. Fig. 18 shows the correlations of Fig. 17 after passing through a moving-median filter with a 50000-point (10-second) buffer. The median-filtered results increase the margin between connected and disconnected cases while preserving a reasonable speed of response. As predicted, the independent microgrids have uncorrelated frequencies and a tie line relay between them could be allowed to close, but as soon as the microgrids are connected and a loop becomes possible, their frequencies are strongly correlated, and the closure of a relay seeing these frequencies on either side should be blocked.

B. Matched Load Case, Using Correlation
Figs. 20-22 show correlation-based results for a "matched load case". In this case, the load of microgrid 633 was manipulated so that after the 671-675 MBR closes, the average frequency of that 671+675 combined microgrid is equal to that of microgrid 633. Fig. 20 shows the measured frequencies in the three microgrids. Once the 671-675 MBR closes (just after t = 15 s), the frequencies of those two microgrids become equal,  and they align very closely with the frequency of microgrid 675, which is still independent. Under this condition, TL1 cannot be closed without forming a loop, but TL2 could be closed, and thus these conditions must be differentiated. Fig. 21 shows the unfiltered Pearson's correlations between each pair of measured frequencies, calculated using MATLAB's "corr" function [24] over a sliding window, and Fig. 22 shows the results from Fig. 21 after passing through a moving median filter. Figs. 21 and  22 show that the 633-671 correlation is near unity after these two microgrids are connected, indicating that closing further connections between them would form loops. The 633-675 and the 671-675 correlations remain very low, indicating that the closure of a relay between these could be allowed.    The MAE is calculated over a sliding window as

C. Matched Load Case, Using MAE
where k is the starting index of the MAE window, MAE k is the value of the MAE over the window starting at point k, f 1 and f 2 are the two vectors of frequency measurements, and N is the number of data points over which the MAE is calculated (here, 50000). As expected, the MAE between the frequencies in the two connected microgrids is much smaller (here, two orders of magnitude smaller) than between independent microgrids. The connected versus non-connected cases are clearly distinguished, and thus MAE can also be used to prevent unintentional loop formation.

V. DISCUSSION
The results in Section III show that filtered correlation and mean absolute error can both be used to reliably indicate whether the closure of a relay would lead to the formation of a loop. In the correlation-based implementation, closure of the relay can be allowed if the correlation between the filtered frequencies of the voltages on either side of the relay is below some threshold (say, <0.9), but closure should be blocked if that correlation is above that threshold because this indicates that closure of the relay could create a loop. It appears that filtering of the correlation results in a method that has a good margin between the two cases, and acts within a time frame suitable for this application. In the MAE-based implementation, there was a large detection margin between the two cases with no further filtering; a threshold of 1 × 10 −4 Hz would allow detection and preserve a large buffer against nuisance trips.
Correlation is a nonlinear, sensitive function. This sensitivity can be advantageous in some circumstances, but it could also in some cases lead to erratic behavior. For example, Pearson's r is sensitive to outliners [20], so some form of outlier removal might be necessary to ensure reliable performance. The MAE is a well-behaved, linear function, which could make MAE a preferable implementation in some cases. Also, correlation by itself does not detect when there is a constant "DC" offset between the frequency vectors, so when the correlation-based implementation is used, a difference in average frequencies between the two vectors could be used as a separate indication that the relay can be safely closed without forming a closed loop. The MAE, on the other hand, intrinsically detects a "DC" offset of this type and does not require that as a separate condition.
The MAE-based implementation may depend more strongly than the correlation-based method on the parameters of the inverter controls, such as specific droop slopes. Thus, the threshold values may be more inverter-specific for the MAE-based method than for the correlation-based method. Also, the magnitude of the frequency variation may become smaller as the system gets larger, which could reduce the margin between the case in which a loop would not be formed and the case in which a loop would be formed. Thus, the MAE-based version could potentially be less scalable than the correlation-based version.
It is not clear how effective either method would be in a case in which the sources are under isochronous control. The correlation-based method may still work because there would still be small uncorrelated changes in frequency between the two intentional-island systems when they are independent, but the frequencies of connected generators under isochronous control are not necessarily linearly related and thus their relationship may not be well-detected by Pearson's correlation [20]. A different correlation, such as Kendall's tau [20], may work better in this case, but computing Kendall's tau over a sliding window would be computationally intensive. The magnitudes of the frequency differences under isochronous control may be sufficiently small that differentiation by the MAE-based method also may no longer work. However, two independent intentional-island systems with isochronous sources and relying only on local measurements would not be good candidates for paralleling in a self-assembling system, so this use case may be of minimal practical concern.
The purpose of the loop-detection function is to allow any two independent intentional-island systems to be connected to one another at one point only. Any time two independent intentionalisland systems are connected to one another, significant changes in available fault current magnitude and direction as well as other parameters can occur, and these changes may impact the operation of protection systems and the dynamic performance of the connected systems. Such impacts must be addressed to ensure that the resulting interconnected system remains stable and properly protected.

VI. CONCLUSION
This paper has proposed and demonstrated in simulation two implementations of a method for enabling a sectionalizing relay in a self-healing, self-assembling power system with distributed, droop-controlled sources to detect whether the closure of that relay would lead to the formation of a loop. This in turn allows the self-assembling system to avoid the creation of unintentional, undesirable loops. The only inputs required for either implementation of the method are the frequencies of the voltages on either side of the relay in question.
One implementation of the method relies on the fact that loads adjacent to one another have uncorrelated variations on short time scales. In unconnected systems, those uncorrelated load variations will reflect off the droop curves of the inverter-based sources in the microgrids to produce uncorrelated frequency variations. Thus, a lack of correlation in the frequency indicates that the systems on either side of the relay are not yet connected, and the relay can be closed without forming a loop. When the voltages on either side of the relay come from the same set of sources, the correlation between frequencies on either side of the relay becomes high. In this case, closure would form a loop, and closure can then be blocked if the system is not designed for looped operation.
Another implementation of the method relies on the fact that the magnitudes of the difference in frequencies on either side of the relay at each sample time will typically be much larger when the systems are independent than when they are connected. Thus, the mean absolute error between the frequencies can also provide a means for differentiating between independent and connected cases and can be used to prevent undesirable loop formation.
PSCAD simulations using the IEEE 13-bus system partitioned into three microgrids with three grid-forming inverters have shown that both implementations work in self-assembling systems with droop-controlled inverter-based sources. These methods can facilitate the deployment of self-assembling or self-organizing power systems for resilience in cases where the formation of loops must be avoided.