Fault Location and Restoration of Microgrids via Particle Swarm Optimization

: This aim of this work was to develop an integrated fault location and restoration approach for microgrids (MGs). The work contains two parts. Part I presents the fault location algorithm, and Part II shows the restoration algorithm. The proposed algorithms are implemented by particle swarm optimization (PSO). The fault location algorithm is based on network connection matrices, which are the modiﬁcations of bus-injection to branch-current and branch-current to bus-voltage ( BCBV ) matrices, to form the new system topology. The backward/forward sweep approach is used for the prefault power ﬂow analysis. After the occurrence of a fault, the voltage variation at each bus is calculated by using the Z bus modiﬁcation algorithm to modify Z bus . Subsequently, the voltage error matrix is computed to search for the fault section by using PSO. After the allocation of the fault section, the multi-objective function is implemented by PSO for optimal restoration with its constraints. Finally, the IEEE 37-bus test system connected to distributed generations was utilized as the sample system for a series simulation and analysis. The outcomes demonstrated that the proposed optimal algorithm can effectively solve fault location and restoration problems in MGs.


Introduction
Microgrids (MGs) can be regarded as a "set of load clusters, distributed generations (DGs), and energy storage systems" [1][2][3]. In terms of the traditional power grid, MGs are the partial active networks in distribution systems. Therefore, the type and ownership of MGs can vary considerably, such as utility and customer MGs. Utility MGs include distribution substations, main transformers, full feeders, partial feeders, or distribution transformer-level MGs. However, regardless of their type, MGs are capable of operating in grid-tied and islanding modes through the point of common coupling, which is the connection point between the MGs and the main grid that is created by a static switch.
Traditional passive distribution networks, which do not have DG interconnection, spend more than half an hour on fault detection, isolation, and restoration (FDIR). As a result of the high penetration of DGs in feeders to form active distribution networks, large amounts of data are available and are received by the feeder dispatch control center or distribution dispatch control center; consequently, the FDIR concept in distribution contingencies is different, in which rigorous fault current calculation approaches are proposed by DGs [4][5][6][7]. Besides, the advanced information and communication techniques in FDIR are proposed to restore power to as many systems as possible and to reduce power restoration time after the occurrence of feeder faults in a radial-type feeder arrangement [8][9][10]. In the past few decades, many customers in rural distribution networks served by power companies have experienced long power outages, especially those in upstream networks. A recent, possible solution for rapid and effective restoration is to operate these feeders as The methods used for fault detection and isolation are summarized as follow (1) Impedance method; (2) High-frequency components and wavelet transform; (3) Artificial neural network; (4) Comparison measurement and simulation value; (5) Hybrid method.
In general, the fault current contributed by the upstream main grid and DG bus voltage variation, and it is used to determine the fault location in MGs. Brah used synchronized voltage and current measurements to detect the fault section i bution systems with high DG penetration; however, how to effectively rebuild after the fault has occurred is the key factor. Unfortunately, much of the available is weak on this point, and therefore, the aim of this work is to effectively rebuild corresponding to the network topology under post-fault conduction. The concept the proposed approach in this paper is based on the impedance method, PSO, synchronized voltage and current measurement technique proposed in [15]. A systematic and effective graph theory-based algorithm is proposed for fault loc MGs. Therefore, only a minor modification of the BIBC matrix built in the pre-fau is needed in the fault stage; and a new, fast, and effective ZBus is derived. This app applicable to unbalanced distribution networks and is different from the traditio modification method, which is used in three-phase balanced systems. Service res implemented by PSO algorithm follows fault detection and isolation and is aim minimum number of switches and loss of electricity service. The methods used for fault detection and isolation are summarized as follows: (1) Impedance method; (2) High-frequency components and wavelet transform; (3) Artificial neural network; (4) Comparison measurement and simulation value; (5) Hybrid method.
In general, the fault current contributed by the upstream main grid and DGs causes bus voltage variation, and it is used to determine the fault location in MGs. Brahma [15] used synchronized voltage and current measurements to detect the fault section in distribution systems with high DG penetration; however, how to effectively rebuild the Z Bus after the fault has occurred is the key factor. Unfortunately, much of the available research is weak on this point , and therefore, the aim of this work is to effectively rebuild the Z Bus corresponding to the network topology under post-fault conduction. The concept used in the proposed approach in this paper is based on the impedance method, PSO, and the synchronized voltage and current measurement technique proposed in [15]. A distinct, systematic and effective graph theory-based algorithm is proposed for fault location in MGs. Therefore, only a minor modification of the BIBC matrix built in the pre-fault stage is needed in the fault stage; and a new, fast, and effective Z Bus is derived. This approach is applicable to unbalanced distribution networks and is different from the traditional Z Bus modification method , which is used in three-phase balanced systems. Service restoration implemented by PSO algorithm follows fault detection and isolation and is aimed at a minimum number of switches and loss of electricity service.

Derivation of Fault Location Approach
The fault location approach proposed in this study is described in detail. The first step of the proposed method is to calculate the pre-fault and fault bus voltages. Therefore, a fast and systematic power flow method should be developed to avoid rebuilding Z Bus due to the different network topologies before and after the occurrence of a fault. Consequently, graph theory is applied to develop the bus impedance matrix for the power flow solution and fault current calculation. Finally, the proposed voltage error matrix (VEM) and particle swarm optimization (PSO) are used to determine the fault location. The detailed theory of the proposed method is described here.

Graph Theory-Based Power Flow Algorithm
A combination of Z Bus , graph theory and backward/forward sweep algorithm are applied in the power flow analysis. A systematic approach, graph theory, is used to build incidence matrices that correspond to network topologies. The proposed algorithm uses the A incidence matrix, which is the element-bus incidence matrix, and the K matrix, which is the branch-path incidence matrix. The BIBC and BCBV matrices can be established according to the network topology based on these matrices. Furthermore, the BIBC and BCBV matrices are applied in the power flow algorithm. The solution procedure of the proposed power flow is described as follows.
Step 2: Transpose the BIBC matrix and add the primitive line impedance, which means total series impedance between two connection buses into the corresponding non-zero element position to derive the BCBV matrix.
Step 3: Build the bus impedance matrix using Equation (3) by multiplying the BIBC and BCBV matrices. [ Step 4: Calculate the equivalent bus injection current at each bus connected to the source or load using Equation (4), where P i and Q i are active and the reactive power at each bus, V i k is the bus voltage magnitude, which is set to 1.0 pu at the initial condition.
Step 5: Compute the voltage derivation of each bus using Equation (5).
Step 6: Using Equation (6) to update the bus voltage, where V no_load is the no-load voltage at each bus, i.e., the bus voltage is assumed as 1.0 pu, that is, Step 7: Check the convergence by Equation (7). If Equation (7) is true, then there is no convergence; therefore, proceed to Step 4; otherwise, end the solution procedure. ε is the maximum toleration, that is

Fault Location Alogrithm Based on Z Bus
The proposed fault location algorithm uses the bus voltage variation, which is caused by the fault current contributed by the upstream utility grid, and distributed energy resources to determine fault locations. A fast Z Bus modified algorithm based on the BIBC and BCBV matrices is necessary for the rigid computation of the bus voltage variations before and after the occurrence of a fault. Therefore, Z Bus can be built by using Equation (3) according to the pre-fault network topology. Z Bus needs to be modified when a short-circuit fault occurs at bus k. We assumed that the MGs are equipped with measuring devices placed at the output terminals of each DG unit. During fault conditions, the values of zerosequence, positive-sequence, and negative-sequence voltages and currents are recorded by the measuring devices and can be used to obtain the zero-, positive-, and negative-sequence Thevenin impedances of the DGs [27], respectively. The phase frame impedance of the DGs is calculated by using Equation (8), where a = e j2π 3 , Z S is the sequence impedance. The derived Thevenin impedances of all DGs are added as branches from the connected buses to the reference bus. Consequently, Z Bus can be modified according to the minor changes in the BIBC and BCBV matrices.
While a three-phase short-circuit fault occurs at bus j, the bus voltage can be expressed as the pre-fault voltage plus the voltage deviation caused by the fault current by Equation (9). The voltage at faulted bus j can be obtained by Equation (10) and can also be derived by multiplying the fault current by the fault impedance as shown in Equation (11).
Therefore, the fault current can be obtained from Equations (10) and (11), as shown in Equation (12), for the three-phase bolted fault. Z abc f = 0, and V abc j (F) = 0.
where V abc j (0) is the pre-fault three-phase voltage at bus j, I abc j (F) is the fault three-phase current from bus j to the ground, Z abc jj is the equivalent three-phase impedance from bus j and can be obtained from Z Bus , Z abc f is the three-phase fault impedance. Using Equation (12), the bus voltage derivation at bus i due to a fault at bus j is expressed as Equation (13).
Appl. Sci. 2021, 11, 7036 6 of 16 The three-phase bus voltage derivation at all DG buses for the assumed fault location can be calculated by Equation (13). The first step of the proposed algorithm is to calculate the voltage error at each bus, as shown in Equation (14). The voltage error at bus j is expressed as the norm of the difference between the voltage derivation and the value of the measured voltage. In real-time application, the voltage derivation (∆V abc S(i)− f (j) ) at bus j is caused by the fault current contributed by source bus i, which represents the upstream utility grid or DG. The value of the measured voltage (∆V abc S(i)−meas. ) can be obtained by the synchronized voltage and current measurement device, with millisecond level response time installed in each fault current contributed source, from the energy management system of the MG, and m in Equation (14) represents the number of fault current sources. For an n-bus MG, the VEM can be established, as shown in Equation (15). The smallest value of the element in the VEM denotes the bus with the short-circuit fault. It is noteworthy that the fault current is generally about ten times the normal load current; besides, the fault current contributed by DG is two times the rated output current limited by inverter of photovoltaic. Therefore, the measurement device is able to distinguish the fault current and normal current contributed by load and DG, and then it can be determined whether the bus voltage deviation is caused by fault current or normal current. Additionally, the computing time depends on the bus number of the system; fortunately, this is not a problem for MGs, which the system is relatively smaller than a distribution feeder, such as a partial feeder MG or a community MG.

Solution Procedure of the Proposed Fault Location Algorithm
Short-circuit faults may occur at the bus or in the line segment. Thus, Z Bus can be modified on two conditions. If the fault occurs at the bus, then Z Bus does not need to be modified. Otherwise, if the fault occurs in the line segment, a negative impedance in the line segment should be added to remove the original line segment. Then, a virtual bus that is assumed to be in the middle of the line segment, as well as two elements, should be added, with one element added as a new branch from the existing bus to the virtual bus, and with the other element added as a new link from the virtual bus to the other existing bus; the procedure is shown in Figure 2. Therefore, the dimension of the BIBC matrix becomes (n + 1) × (n + 1), and the new Z Bus can be derived by using Equation (3). The fault point is assumed at the virtual bus. In this study, PSO [28,29] is used to search for the faulted bus, and the assumed faulted bus is modeled as a particle whose objective function is shown in Equation (16). The fault will be detected according to the minimal value of the voltage error in the VEM. The proposed fault location approach of the MG is shown in Figure 3.

Proposed Service Restoration Approach
MGs are capable of grid-tied and islanding operations integrated with DGs and loads. Therefore, electricity service restoration can be divided into two operation modes. Regardless of the operation mode, service restoration is aimed at reducing the out-of-service un-faulted zone and then minimizing its effect. Consequently, the service restoration problem can be described as the minimization of a multi-objective non-linear problem that is composed of the loss of load service, the number of switch operations, and power loss, as shown in Equation (17).
subject to where P loss−service denotes the loss of load service; n ops represents the number of switch operations; P loss denotes the system power loss; w i denotes a weighting factor that can be adjusted for the requirement; I max is the ampere capacity of the conductor; and V min and V max represent the lower and upper limits of bus voltage, respectively. The related parameters of the objective function and constraints are set to w 1 = 0.2, w 2 = 0.1, and w 3 = 0.7. Furthermore, the lower and upper limits of the bus voltage are 0.95-1.05 pu, and the ampere capacity is 300 A. By applying the PSO algorithm to solve the proposed service restoration approach, the A matrix is built according to the switch status and must be transferred to the PSO algorithm to obtain the corresponding network topology. The power flow algorithm is used to compute the specified network topology, and the value of the proposed function of each particle is obtained. PSO, which is a combination of the pbest and gbest, allows a particle to quickly and correctly adjust, thereby resulting in rapid convergence using Equations (21)- (25).
where V k n denotes the velocity of the nth particle at the kth iteration; s k n represents the kth position of the nth particle; the learning factors are represented as c 1 and c 2 ; the random numbers of rand 1 and rand 2 are between 0 and 1; pbest k n denotes the best value of the nth particle at the kth iteration; and gbest k denotes the global best value at the kth iteration. w max , and w min are the maximum and minimum of the inertia weighting value, respectively, which are set to w max = 0.9, w min = 0.2, so in Equation (25) this means that the weighting value of inertial velocity is decreased from 0.9 to 0.2; n denotes the particle number; and k max denotes the maximum iteration. In this study, the related parameters of PSO were set to n = 500; the maximum iteration number was 200; c 1 = 2, and c 2 = 2. The detailed solution procedure of the service restoration is illustrated in Figure 4. number; and kmax denotes the maximum iteration. In this study, the related parameters of PSO were set to n = 500; the maximum iteration number was 200; c1 = 2, and c2 = 2. The detailed solution procedure of the service restoration is illustrated in Figure 4.

Start
Using PSO for network reconfiguration by changing the states of tie-switch and normally closed switch.

Convergence
Output optimal network topology and switch states in service restoration stage.

End
Compute objective function and its corresponding values by executing power flow algorithm.

Numerical Results and Discussions
The MG modified from the IEEE 37-bus test system was utilized as a sample system to verify the effectiveness of the proposed method. The original IEEE 37-bus test system is a traditional distribution network whose line and bus data are shown in [30]. The system is a three-phase unbalanced passive network that is only connected with loads. The simulation results under grid-tied and islanding operation modes are discussed in the following sections.

Description of the Sample System and Simulation Scenarios
The MG sample system was modified on the basis of the IEEE 37-bus test system ( Figure 5). Five new tie lines and switches were added as follows. S36 was installed between buses 701 and 722. S37 was installed between buses 735 and 741. S38 was installed between buses 727 and 732. S39 was installed between buses 725 and 731. S40 was installed between buses 712 and 740. In addition, the DGs were connected at buses 724, 731, and

Numerical Results and Discussions
The MG modified from the IEEE 37-bus test system was utilized as a sample system to verify the effectiveness of the proposed method. The original IEEE 37-bus test system is a traditional distribution network whose line and bus data are shown in [30]. The system is a three-phase unbalanced passive network that is only connected with loads. The simulation results under grid-tied and islanding operation modes are discussed in the following sections.

Description of the Sample System and Simulation Scenarios
The MG sample system was modified on the basis of the IEEE 37-bus test system ( Figure 5). Five new tie lines and switches were added as follows. S36 was installed between buses 701 and 722. S37 was installed between buses 735 and 741. S38 was installed between buses 727 and 732. S39 was installed between buses 725 and 731. S40 was installed between buses 712 and 740. In addition, the DGs were connected at buses 724, 731, and 740. The parameters of the tie switches and lines are shown in Table 1. The power outputs of the DG at buses 724, 731, and 740 are 595, 460, and 150 kW, respectively. points are between buses 702 and 703, buses 727 and 703, and buses 710 and 734. This fault is used to simulate power generation less than the load demand in the downstream islanded area. Load shedding is required for this situation. In this study, a co-analysis and simulation platform was established ( Figure 6). The sample system was built in OpenDSS [31] and MATLAB: the value of the measured voltage of the sample system was obtained by OpenDSS, and the proposed fault location, service restoration, and power flow algorithms were coded in MATLAB.   The simulation scenarios are presented in Table 2, and the scenarios are explained as follows.  In this study, a co-analysis and simulation platform was established ( Figure 6). The sample system was built in OpenDSS [31] and MATLAB: the value of the measured voltage of the sample system was obtained by OpenDSS, and the proposed fault location, service restoration, and power flow algorithms were coded in MATLAB.

Simulation of EMS
The proposed algorithms   Table 3 illustrates the simulation results of the sample system and the scenarios assumed in Section 5.1 according to the proposed fault location and service restoration algorithms in this study. The network topologies, voltage error values near the fault line segment, and convergence characteristics including the fault location and restoration objective functions in Equations (16) and (17) that correspond to each scenario are illustrated in Figure 7a-c.

Grid-Tied Operation
In Scenario 1, a three-phase bolted short-circuit fault occurs in line segment 702-703, which is between buses 702 and 703. Fault is detected in line segment 702-703 according to the minimal value of the voltage deviation in the VEM using the proposed fault location algorithm (Equation (16)). The proposed service restoration algorithm is used to restore power supply to the un-faulted area. Therefore, according to the convergence of the numerical results of the objective function and the related constraints (Equations (17)-(19)), the switch between line segment 708-709 is opened, and two tie switches (i.e., S39 and S40) are closed to form the network topology (Figure 7a). The service restoration percent-  Table 3 illustrates the simulation results of the sample system and the scenarios assumed in Section 5.1 according to the proposed fault location and service restoration algorithms in this study. The network topologies, voltage error values near the fault line segment, and convergence characteristics including the fault location and restoration objective functions in Equations (16) and (17)   In Scenario 1, a three-phase bolted short-circuit fault occurs in line segment 702-703, which is between buses 702 and 703. Fault is detected in line segment 702-703 according to the minimal value of the voltage deviation in the VEM using the proposed fault location algorithm (Equation (16)). The proposed service restoration algorithm is used to restore power supply to the un-faulted area. Therefore, according to the convergence of the numerical results of the objective function and the related constraints (Equations (17)- (19)), the switch between line segment 708-709 is opened, and two tie switches (i.e., S39 and S40) are closed to form the network topology (Figure 7a). The service restoration percentage is 100% because of the fault that occurs in the line segment, and the operations of the tie switches successfully restore electricity service. The power loss is 62.47 kW in this radial type topology, and all the line currents and bus voltages satisfy their limits. power loss is 61.47 kW, all the line currents are less than 300 A, and the bus voltages are within 0.95-1.05 pu. The simulation results illustrate that the combined fault location and restoration approach is capable of dealing with double-point fault conditions.

Grid-Tied Operation
In Scenario 3, a triple fault occurs in line segments 702-703, 727-703, and 710-734. These multiple fault points are detected by three minimal values in the VEM. The switch between line segment 708-733 is opened, and four tie switches, namely, S37, S38, S39, and S40, are closed to form the network topology, as shown in Figure 7c. Similarly, the service restoration percentage is 100%, the power loss is 60.46 kW, and all the line currents and the bus voltages do not violate these limits. The outcomes demonstrate that the proposed approach is capable of multiple-point fault detection, isolation, and restoration.

Islanding Operation
A single-line diagram of the sample system under islanding operation mode is shown in Figure 8. In islanding operation mode, the available power output of the DGs plays a key role in ensuring the stable operation of the system because no utility power grid acts as a swing bus. System frequency and voltage magnitude are kept constant in accordance with the power balance principle. Consequently, if the power generation of DGs is greater than the load demand, then the optimal dispatch method automatically adjusts the power output to meet the power balance requirement. Otherwise, the load shedding strategy should be used to maintain power balance. The loads are classified into critical and common loads. The symbol of critical load is expressed as "O," and the symbol of non-critical load is represented as "☆" (Figure 8). The first priority of load shedding is non-critical load and then critical load. The simulation results of the sample system and the assumed scenarios are listed in Table 4. In Scenario 1, the fault is detected in line segment 702-703 according to the minimal value of voltage deviation in the VEM. The tie switch S39 is closed to form a network topology (Figure 8). The service restoration percentage is 83.61% because the power output of the DGs is less than the load demand. Load shedding is required to keep the power balance. In addition, the power loss is 22.27 kW, and all the line In Scenario 2, the fault type is the same as that in Scenario 1, that is, a double fault occurring in line segments 702-703 and 727-703. These two fault points are detected by two minimal values in the VEM. The switch between line segment 708-733 is opened, and three tie switches, namely, S38, S39, and S40, are closed to form the network topology, as shown in Figure 7b. Similar to Scenario 1, the service restoration percentage is 100%, the power loss is 61.47 kW, all the line currents are less than 300 A, and the bus voltages are within 0.95-1.05 pu. The simulation results illustrate that the combined fault location and restoration approach is capable of dealing with double-point fault conditions.
In Scenario 3, a triple fault occurs in line segments 702-703, 727-703, and 710-734. These multiple fault points are detected by three minimal values in the VEM. The switch between line segment 708-733 is opened, and four tie switches, namely, S37, S38, S39, and S40, are closed to form the network topology, as shown in Figure 7c. Similarly, the service restoration percentage is 100%, the power loss is 60.46 kW, and all the line currents and the bus voltages do not violate these limits. The outcomes demonstrate that the proposed approach is capable of multiple-point fault detection, isolation, and restoration.

Islanding Operation
A single-line diagram of the sample system under islanding operation mode is shown in Figure 8. In islanding operation mode, the available power output of the DGs plays a key role in ensuring the stable operation of the system because no utility power grid acts as a swing bus. System frequency and voltage magnitude are kept constant in accordance with the power balance principle. Consequently, if the power generation of DGs is greater than the load demand, then the optimal dispatch method automatically adjusts the power output to meet the power balance requirement. Otherwise, the load shedding strategy should be used to maintain power balance. The loads are classified into critical and common loads. The symbol of critical load is expressed as "O," and the symbol of non-critical load is represented as "$" (Figure 8). The first priority of load shedding is non-critical load and then critical load. The simulation results of the sample system and the assumed scenarios are listed in Table 4. In Scenario 1, the fault is detected in line segment 702-703 according to the minimal value of voltage deviation in the VEM. The tie switch S39 is closed to form a network topology (Figure 8). The service restoration percentage is 83.61% because the power output of the DGs is less than the load demand. Load shedding is required to keep the power balance. In addition, the power loss is 22.27 kW, and all the line currents and bus voltages satisfy their limits. In Scenario 2, these two fault points are detected by two minimal values in the VEM. Then, two tie switches, namely, S38 and S39, are closed to form the network topology ( Figure 8). The service restoration percentage is 83.61%, the power loss is 22.41 kW, all the line currents are less than 300 A, and the bus voltages are within 0.95-1.05 pu. In Scenario 3, the multiple-point fault is detected by three minimal values in the VEM. Three tie switches, namely, S37, S38, and S39, are closed to form the network topology. Similarly, the service restoration percentage is 83.61%, the power loss is 22.4 kW, and all the line currents and the bus voltages do not violate the limits.

Conclusions
In this study, a fault location and service restoration algorithm was developed and integrated for three-phase short-circuit fault detection, isolation, and restoration in MGs. The proposed approach is based on a fast-computing algorithm and the measured data from the EMS of MGs. Therefore, graph theory is used to establish BIBC and BCBV matrices for the corresponding network topology. The bus impedance matrix is effective and easy to build and modify for pre-fault and post-fault analyses, without the need for the timeconsuming rebuilding of a bus impedance matrix due to topology changes. Consequently, the bus impedance matrix is convenient to use in pre-fault power flow analysis and the calculation of post-fault bus voltage change caused by the fault current contributed by the upstream power gird and DGs. The multi-objective function, which is composed of load shedding, switch operations, and power loss with voltage drop and ampere capacity constraints, is proposed for service restoration. These algorithms are implemented by PSO for fault location and optimal service restoration. The MG modified from the IEEE 37-bus was used as the sample system to demonstrate the feasibility of the proposed approach. The proposed approach was coded using MATLAB and executed on a Windows 10 Intel ® Core™ i7-10700F CPU @2.9 GHz personal computer, and the average computing time of each scenario of the IEEE 37-bus was less than 1 s. The numerical results illustrate a maximal service restoration percentage with minimum switch operations and power loss under both operating modes. The outcomes show that the proposed approach is capable of detecting, isolating, and restoring three-phase short-circuit faults under the grid-tied and islanding operating modes of MGs.