Artiﬁcial Intelligence-Based Protection for Smart Grids

: Lately, adequate protection strategies need to be developed when Microgrids (MGs) are connected to smart grids to prevent undesirable tripping. Conventional relay settings need to be adapted to changes in Distributed Generator (DG) penetrations or grid reconﬁgurations, which is a complicated task that can be solved efﬁciently using Artiﬁcial Intelligence (AI)-based protection. This paper compares and validates the difference between conventional protection (overcurrent and differential) strategies and a new strategy based on Artiﬁcial Neural Networks (ANNs), which have been shown as adequate protection, especially with reconﬁgurable smart grids. In addition, the limitations of the conventional protections are discussed. The AI protection is employed through the communication between all Protective Devices (PDs) in the grid, and a backup strategy that employs the communication among the PDs in the same line. This paper goes a step further to validate the protection strategies based on simulations using the MATLAB TM platform and experimental results using a scaled grid. The AI-based protection method gave the best solution as it can be adapted for different grids with high accuracy and faster response than conventional protection, and without the need to change the protection settings. The scaled grid was designed for the smart grid to advocate the behavior of the protection strategies experimentally for both conventional and AI-based protections.


Introduction
The penetration of MicroGrids (MGs) will be widely acknowledged as a critical technology for integrating Distributed Generators (DGs) in the Distribution System (DS) [1,2], specifically with the widespread new loads such as the 5G communication channel, and the increase in electric vehicle production, auto-drive vehicles, and smart homes [3][4][5]. This means most of the electricity is covered by different types of DGs to form MGs.
Grid codes [6] require power converters to keep injecting power during grid faults to support the grid by decreasing the active power and elevating the reactive power injections [7,8]. Therefore, the need for a protection strategy for smart grids has become more essential. However, many obstacles exist [9], which impacts the Protective Devices (PDs) settings [8]. By using smart protection technologies, the efficiency of these networks can be significantly improved [10].
Various techniques for locating and detecting faults in DSs with DG have been developed. As seen in Table 4 of [11], these approaches can be subdivided into two classes: conventional or Artificial Intelligent (AI) strategies [10]. The limitations of conventional

Protection Challenges
The integration of MGs in DS influences the conventional protection, so current research work aims to update the settings and the parameters of the conventional protections to cope with the new challenges. Several methods have been developed to calculate the OCR parameters with MG penetration. Some of them use a microprocessor-based relay without communication [29]. Another way is to use linear programming with communication [30]. Previous studies focused on the non-based inverter DS. In [31], a new communication-assisted over current protection structure was proposed for inverter-based DC MGs. However, a major disadvantage is the slow tripping that may increase the damage to the faulty equipment based on the operating conditions. DR is one of the most applied methods to protect DS, especially with MG penetrations [15], as it solves the bidirectional power flow issue [14]. However, DR may face tripping problems if the current transformers are saturated or not configured correctly [32]. In addition, with the increase in MG penetration, the threshold current also increases, and the sensitivity of the relays is thus decreased. In addition, if the MG contribution comes from one end of the faulted line and is approximately equal to the current from the other end, the DR could face tripping problems, particularly with high MG penetration [33]. When the MG penetration changes, the OCR and DR settings need to be modified to adapt to the grid's new situation, as mentioned in [28], which can be done using several methods, as explained in [34]. Many researchers propose different techniques to update the settings of conventional relays with MG penetration. In [35], dual setting relays were equipped with two inverse time-current characteristics. However, previous studies did not focus on the PV-based inverter. In [36,37], the same idea was implemented with different network reconfigurations for inverter-based MGs, but the reliability evaluation and stability improvement need to be carefully studied.
Adaptive protection enables relays to react to any changes in the DS. Though this process's complexity is high, a proper communication medium is needed, mainly with grid reconfigurations and MG penetration into DS. In [38,39], a two-stage optimization approach was presented, including automated online readjustment of the relay settings to match with various DS operating conditions. One way to rapidly update the relay setting is to use communication, as presented in [20,40]. Another idea is based on pre-processing the faulted current and voltage signals using Fourier transform. In [41], a data-miningbased differential protection scheme was proposed, using discrete Fourier transform to estimate the most affected features during faults. A similar strategy was proposed in [42] using correlation transformation of the short-circuit current. In [43], a protection scheme based on harmonic analysis was proposed for an inverter-based MG with a reconfigurable configuration. Nevertheless, as previous studies depend on the harmonics, the protection scheme's performance must be analyzed, in particular, with various fault resistance when the fault is close to the point of common coupling.
The Differential Evolution (DE) algorithm is an effective way to solve directional OCR coordination problems. In [44,45], an enhanced DE was proposed, and comparisons among different versions of DE were presented. However, previous research focused on non-based inverter generators. Furthermore, the protection system's behavior during grid reconfigurations has not been studied. Recently, AI techniques have gained more importance in the protection of DS due to their ability to operate quickly and deal with many inputs. A Fuzzy Logic Controller to enhance the current differential protection scheme was presented in [46]. Another method is based on Particle Swarm Optimization (PSO); in [47], an adaptive protection approach was proposed through Integer Linear Programming (ILP) and PSO. ANNs are also one of the most effective methods to solve protection problems. In [48], a smart differential protection scheme using a nonlinear signal transformation based on ANN was proposed. However, the preceding research did not consider inverter-based generators.
Various techniques have been established lately in the context of the availability of inverter-based generators. In [34], a centralized algorithm with mixed-integer linear programming was proposed to obtain the relay setting, although no backup protection was introduced, and the algorithm was not tested experimentally. In [5], a fault diagnostic scheme utilizing Discrete Wavelet Transform and ANN was proposed. However, the error percentage was significant, due to the amount of transient data used to train the ANN.

Proposed CE and ZO Protection Algorithms
As seen from the aforementioned papers, a protection scheme for a DS with high MG penetration is required. The PDs must be capable of adapting to the variations introduced by the connected DGs to the grid, which involves the possible usage of PDs with directional capabilities including several characteristics such as fast reactions, sensitivity, selectivity, and reliability, thereby improving the DG fault ride through [15]. The proposed protection scheme, explained in [16], presents the characteristics mentioned above for the inverter-based generators using CE and an ANN-based backup ZO. It is important to note that the particularities of the effect of the inverter-based generators have been taken into consideration, such as small transient duration, low short-circuit current, and reversible power flow. Another aspect that must be considered is the ground connection of the HV/MV transformer as this connection will influence the short-circuit current in the network leading to a variation in the protection system performance. We studied different connections along with several topologies maintained by many facilities. The most conventional implemented configuration is to connect a zig-zag transformer to have an artificial neutral in the delta side of the medium voltage transformer, YNd11 grounded through zig-zag [49]. The analyzed grid shown in Figure 1 consists of several MGs connected to a DS. The proposed protection strategy was tested for other grid topologies. Table 1 shows the grid parameters.
gramming was proposed to obtain the relay setting, although no backup protection was introduced, and the algorithm was not tested experimentally. In [5], a fault diagnostic scheme utilizing Discrete Wavelet Transform and ANN was proposed. However, the error percentage was significant, due to the amount of transient data used to train the ANN.

Proposed CE and ZO Protection Algorithms
As seen from the aforementioned papers, a protection scheme for a DS with high MG penetration is required. The PDs must be capable of adapting to the variations introduced by the connected DGs to the grid, which involves the possible usage of PDs with directional capabilities including several characteristics such as fast reactions, sensitivity, selectivity, and reliability, thereby improving the DG fault ride through [15]. The proposed protection scheme, explained in [16], presents the characteristics mentioned above for the inverter-based generators using CE and an ANN-based backup ZO. It is important to note that the particularities of the effect of the inverter-based generators have been taken into consideration, such as small transient duration, low short-circuit current, and reversible power flow. Another aspect that must be considered is the ground connection of the HV/MV transformer as this connection will influence the short-circuit current in the network leading to a variation in the protection system performance. We studied different connections along with several topologies maintained by many facilities. The most conventional implemented configuration is to connect a zig-zag transformer to have an artificial neutral in the delta side of the medium voltage transformer, YNd11 grounded through zig-zag [49]. The analyzed grid shown in Figure 1 consists of several MGs connected to a DS. The proposed protection strategy was tested for other grid topologies. Table 1 shows the grid parameters.
The first algorithm (CE) is based on Direction of Power Flow (DPF) data and positivesequence current (i + ) values analyzed from all PDs in the grid. These data were transferred to the CE, as shown on the left side of Figure 1. The second algorithm is the ZO, located at each PD, which rely on exchanging DPF data via the communication between both PDs in the same line.   The first algorithm (CE) is based on Direction of Power Flow (DPF) data and positivesequence current (i + ) values analyzed from all PDs in the grid. These data were transferred to the CE, as shown on the left side of Figure 1. The second algorithm is the ZO, located at each PD, which rely on exchanging DPF data via the communication between both PDs in the same line.
The usage of CE and ZO algorithms is modeled and adapted by ANN to automatically coordinate the PD decision. The use of ANN provides the advantages of quick decisionmaking and massive data processing, making ANN preferred in DS with a high number of buses. Figure 2 depicts the structure that describes the ANN fault location scheme. Each input to neuron (x) is given a weight (W) that corresponds to the input's contribution, then a bias (b) is added to the summation of all inputs (from 1 to 24); each input includes 64 samples per cycle.  The usage of CE and ZO algorithms is modeled and adapted by cally coordinate the PD decision. The use of ANN provides the advant sion-making and massive data processing, making ANN preferred in D ber of buses. Figure 2 depicts the structure that describes the ANN fau Each input to neuron (x) is given a weight (W) that corresponds to the in then a bias (b) is added to the summation of all inputs (from 1 to 24); e 64 samples per cycle. A significant number of cases are required to train the ANN, cons variables such as variable DG penetration, location, various fault res locations. Figure 3 shows the flowchart of the ANN procedure startin modeling, passing through the system simulation, taking into consider scenarios, and ending by ANN validation and testing.
Test system modelling  A significant number of cases are required to train the ANN, considering numerous variables such as variable DG penetration, location, various fault resistance, types, and locations. Figure 3 shows the flowchart of the ANN procedure starting from the system modeling, passing through the system simulation, taking into consideration different grid scenarios, and ending by ANN validation and testing.
The Neural Net Fitting tool (nftool) from the Matlab TM Toolbox (MathWorks, Natick, MA, USA) was utilized to complete this task. After that, the most suitable training technique, "Levenberg Marquardt" was chosen. This approach necessitates a higher level of memory but requires less training time [50]. The ANN is trained for about 5000 cases to manage parameter changes that impact the protection algorithm's decision.
Based on the directional relay with ANN, the proposed protection strategy is an efficient option mainly for reconfigurable smart grids with MGs, where the direction of the power flow can vary continuously. Utilizing this feature provides the protection scheme with a level of reliability in locating a faulted part of the system during different conditions. The CE unit assesses the fault location depending on the network-wide comparative measurements and triggers the fitting circuit breakers during the fault. ZO is placed into action in parallel to strengthen the security and redundancy of the protection system, and the decisions of both controllers are assessed. The algorithm is dependent on the peer PDs in the same line and delivers their information to ZO installed at each PD [51]. If there is a communication problem, the decision priority shifts from one algorithm to the next. If both decision signals are available, they are compared and a priority check is performed to determine the best approach. A significant number of cases are required to train the ANN, considering variables such as variable DG penetration, location, various fault resistance, locations. Figure 3 shows the flowchart of the ANN procedure starting from modeling, passing through the system simulation, taking into consideration dif scenarios, and ending by ANN validation and testing.
Test system modelling   The author's previous work presented the ANN design, training, and detailed parameters. To calculate the Direction of Power Flow (DPF) at each PD, abc voltage and current need to be measured, as presented in the author's previous work [28]. The flowchart of the proposed protection scheme is presented in Figure 4. In the beginning, the inputs and communication signals from all PDs must be checked for their availability. In the case of a discrepancy and to ensure that the error is permanent, the signals are rechecked after half a cycle utilizing variable "a". The CE decision is performed if the signals are received. At the same time, the ZO algorithm is executed. If the decision of both algorithms agrees, then the trip decision is performed; otherwise, the priority goes to the decision of the ZO, as it has more secure communication signals. In the case of no decision signals received, the decision is to send a trip signal to the PD.
Another scenario was studied as follows: if the CE controller sends a trip signal to the PD and the PD does not respond, the CE controller will start a post-processing stage to disconnect the closest line to the fault. For instance, if a fault occurs at Distribution Line (DL) 4 in Figure 1, then PD7 and PD8 must disconnect as they are the two breakers connected at both ends of the faulted line DL4. Nevertheless, if they do not trip, the CE must send a trip signal to disconnect the nearest PDs to the faulted line DL4, which are PD6, and PD9. This step can guarantee the complete protection of the grid even if the trip signal is not executed for any reason such as breaker failures. half a cycle utilizing variable "a". The CE decision is performed if the signals are received. At the same time, the ZO algorithm is executed. If the decision of both algorithms agrees, then the trip decision is performed; otherwise, the priority goes to the decision of the ZO, as it has more secure communication signals. In the case of no decision signals received, the decision is to send a trip signal to the PD.

Analyzed Grid and Test Results
The OCR and DR explained in [52] are used to demonstrate the comparison to emphasize the advantages of the proposed protection strategy. The OCR, DR, and CE-ZO protection strategies were tested using an analyzed DS connected to several MGs. The algorithms were demonstrated for several DG penetrations, load consumptions, fault resistances, fault types, and fault locations. In this paper, the IEEE extremely inverse curve was selected as it guarantees the fastest disconnection [53]. The analysis of OCR, DR, and CE-ZO protection algorithms' performance is given for the grid represented in Figure 1. The relay settings used to obtain Figure 5 are shown in Tables 2 and 3 for the OCR and DR protection strategies. The currents at both ends of DL3 are represented in Figure 5 for the three protection strategies. These results correspond to a three-phase fault in DL3 with a fault resistance (r) equal to 0.1 Ω. Figure 5a shows the fault currents if two DGs are located at buses 4 and 6, Figure 5b with one DG connected at bus 4, and Figure 5c without DG, respectively. For the DR and CE-ZO protection strategies, the fault is cleared in a time of less than 15 ms. However, as shown in Figure 5a, the trip is faster for the CE-ZO algorithm than DR, because for DR the trip signal depends on the differential current value, while for CE-ZO, it depends on the DPF criteria. strategies. These results correspond to a three-phase fault in DL3 with a fault resistance (r) equal to 0.1 Ω. Figure 5a shows the fault currents if two DGs are located at buses 4 and 6, Figure 5b with one DG connected at bus 4, and Figure 5c without DG, respectively. For the DR and CE-ZO protection strategies, the fault is cleared in a time of less than 15 ms. However, as shown in Figure 5a, the trip is faster for the CE-ZO algorithm than DR, because for DR the trip signal depends on the differential current value, while for CE-ZO, it depends on the DPF criteria.

Parameter (DR) Value
Differential current (pu) 1.08 Biased characteristic (K) 0.5 Current Transformer (CT) 500:1 As seen in Figure 5a for OCR, PD5 will trip, but PD6 will not trip as the settings of the relay need to be updated. When two MGs are connected at buses 3 and 4, and if a three-phase fault occurs at DL3, the faulted line will be fed from two points. The shortcircuit current passing through PD5 is equal to the short-circuit current when one MG is connected at bus 3. However, the short-circuit current is different when an MG is connected at bus 4, as PD6 will be supplied from the MG. This case is important to show the difference between OCR and the other protection strategies. It can be concluded that the DR and CE-ZO protection strategies can disconnect the faulted part of the system rapidly, and for OCR and DR, the relay settings must be updated if DG penetration or grid configuration changes. In Figure 6, the trip signals for the three relays are presented in a 3-D preview for several DG penetrations, fault types, and fault resistance. It can be observed that the OCR protection strategy is not a good option as the fault persists for many periods, and its trip is affected by the DG penetration. difference between OCR and the other protection strategies. It can be concluded that the DR and CE-ZO protection strategies can disconnect the faulted part of the system rapidly, and for OCR and DR, the relay settings must be updated if DG penetration or grid configuration changes. In Figure 6, the trip signals for the three relays are presented in a 3-D preview for several DG penetrations, fault types, and fault resistance. It can be observed that the OCR protection strategy is not a good option as the fault persists for many periods, and its trip is affected by the DG penetration. When two DGs are connected at buses 3 and 4, the power flow and the current values are reduced in DL3 as MG1 and MG2 are close to the loads, so less power comes from bus 3. In the case of a single-phase to ground fault, as the ground connection is made through a zigzag transformer with grounding reactance, the fault current during a single-phase fault will be limited. Therefore, the DR will not trip in this case, as shown in Figure 7. However, during a three-phase fault, the fault current will be high in both cases, with and without MGs, as there is no influence from the zigzag transformer as shown in Figure 7. When two DGs are connected at buses 3 and 4, the power flow and the current values are reduced in DL3 as MG1 and MG2 are close to the loads, so less power comes from bus 3. In the case of a single-phase to ground fault, as the ground connection is made through a zigzag transformer with grounding reactance, the fault current during a single-phase fault will be limited. Therefore, the DR will not trip in this case, as shown in Figure 7. However, during a three-phase fault, the fault current will be high in both cases, with and without MGs, as there is no influence from the zigzag transformer as shown in Figure 7. The DR protection strategy is also affected by significant changes in MG penetration, which is averted using the CE-ZO protection strategy. The CE-ZO protection strategy can disconnect the fault with several DG penetrations, as shown in Figures 5-7. Moreover, the CE-ZO protection strategy can guarantee the fast disconnection of the fault even when the grid changes the operation conditions. The results shown in Figure 6   The DR protection strategy is also affected by significant changes in MG penetration, which is averted using the CE-ZO protection strategy. The CE-ZO protection strategy can disconnect the fault with several DG penetrations, as shown in Figures 5-7. Moreover, the CE-ZO protection strategy can guarantee the fast disconnection of the fault even when the grid changes the operation conditions. The results shown in Figure 6 support these conclusions, where the OCR, DR, and CE-ZO protection strategies' trip signals during different fault types with different fault resistances in different locations are represented. It can be concluded that the CE-ZO protection strategy presents better behavior under various grid operation conditions, generation, consumption, fault conditions, and also with reconfigurations of the grid.
These results are some examples to emphasize the importance of the CE-ZO protection strategy. This methodology can be adapted to other grid configurations. The scheme is tested with other grid configurations changing load consumption, different fault locations, DG penetration, fault types, and HV/MV transformer settings.

Experimental Results and Discussion
In this section, the experimental verification of the proposed algorithm is presented using a scaled physical grid, along with the conventional protection strategies, OCR and DR, and the proposed protection algorithm, CE and ZO. An equivalent model was built in the laboratory to give the same response and dynamic performance of the studied grid. A numerical relay based on the DSP TMS320F28335 type was used to implement the proposed strategy, which processes the measurement data obtained from the sensors, executes the algorithms, and finally gives the appropriate trip signals decision. The Solid-State Relay (SSR) was used as a PD in the studied grids. In addition, an inductor L E was added to emulate the impedance of the main grid, as shown in Figure 8b. In the authors' previous work [28], the SSR behavior was checked by simply sending the data of the faulted line, generated by the dSPACE, to be processed by the DSP. However, in this paper, a scaled system was designed and built experimentally in the laboratory for the MV DS to check the performance of the proposed protection scheme practically in different grid scenarios and configurations unlike the previously published work in the literature. The protection strategy was tested for which the grid shown in Figure 1 was adapted. The equivalent experimental system built in the laboratory is shown in Figure 9. The system's parameters are shown in Table 4. The base values for the DS in Figure  1 are: vB = 20 kV, iB = 721.7 A, ZB = 16 Ω, and for the grid in Figure 8 are: vB = 75 × √3 V, iB = 2.4 A, ZB = 31.25 Ω. The conceptual diagram of the algorithms to be applied practically is shown in Figure 8a, and Figure 8b shows the implemented grid that consists of three DLs and an inverter connected between DL1 and DL2. In the authors' previous work [28], the SSR behavior was checked by simply sending the data of the faulted line, generated by the dSPACE, to be processed by the DSP. However, in this paper, a scaled system was designed and built experimentally in the laboratory for the MV DS to check the performance of the proposed protection scheme practically in different grid scenarios and configurations unlike the previously published work in the literature. The protection strategy was tested for which the grid shown in Figure 1 was adapted. The equivalent experimental system built in the laboratory is shown in Figure 9. The system's parameters are shown in Table 4. The base values for the DS in Figure 1 are: v B = 20 kV, i B = 721.7 A, Z B = 16 Ω, and for the grid in Figure 8 are: v B = 75 × √ 3 V, i B = 2.4 A, Z B = 31.25 Ω. The conceptual diagram of the algorithms to be applied practically is shown in Figure 8a, and Figure 8b shows the implemented grid that consists of three DLs and an inverter connected between DL1 and DL2.
Several tests were done in the laboratory. Figure 10 presents the trip signals of OCR, DR, and CE-ZO protection strategies for symmetrical and unsymmetrical faults when the fault is located at F1 and F2, as seen in Figure 8b. The relay settings for the OCR and DR protection strategies were updated for each operation condition in the presence of DG. The trip times obtained for the reduced scale grid in Figure 10b are close to those obtained by simulation of the actual grid (see Figure 6). The CE-ZO algorithm was tested for different grid reconfigurations experimentally and using simulation. One experimental case is shown in Figure 11 to present the evolution of the abc voltages and currents for symmetrical and unsymmetrical faults with CE-ZO algorithms. It can be noticed that the simulation and experimental results are matched, and as is explained in Section 3, the CE-ZO protection strategy gives the best performance. Moreover, no relay setting updating is required.

Components Parameters Values
CINERGIA Inverter Rated power 10 kVA Rated voltage 400 V Figure 9. Complete laboratory setup.   Figure 12 shows the experimental and simulation behavior of the OCR, DR, and CE-ZO protection schemes and demonstrates the differences between them using the abc currents at both ends of the faulted line. The algorithms were tested when a three-phase fault was at F1 and F2 (see Figure 8b). The results show that the CE-ZO protection and the DR in the tested cases give a faster trip decision than OCR, as shown in the third row of Figure 12. Table 5 shows the effectiveness of the proposed strategy with other strategies operating under similar conditions. The proposed protection strategy compared to other protection strategies in terms of experimental verification, grid reconfiguration, trip time, advantages and disadvantages, is shown. It can be concluded that the proposed strategy provides fast tripping, and can deal with variable DG penetration, fault locations, fault types, (HV/MV) transformer configurations, and fault resistances. However, the disadvantage is the communication problems.

Conclusions
Smart grids with MGs have several configurations due to load consumption, reconfigurations due to faults or maintenance, and DG penetration dynamic changes. Therefore, renewable energies connected to smart grids require advanced protection strategies to avoid undesired tripping, and the parameters of OCR and DR protection strategies are complicated to fit and cannot be adapted to these changes in some cases. These drawbacks can only be solved through a complex updated process of the protection settings, which may not be possible when MGs are connected to smart grids. The major contribution is the comparison and the experimental validation of the proposed protection strategies with OCR and DR strategies. In addition, the drawbacks of conventional strategies are highlighted experimentally in the lab and solved with the developed AI protection. A protection strategy was developed using AI, which was used to solve the highlighted drawbacks of conventional protections and was validated experimentally to protect smart grids effectively to avoid these drawbacks. The protection scheme is based on two AI-based strategies to guarantee backup protection. The protection strategies based on a directional relay with an ANN can adapt to different grid reconfigurations. In addition, the trip decision is faster than conventional relays. The new approach improves the system's accuracy and speeds up the response of the protection system to unexpected changes in the grid. A comparison between conventional OCR, DR, and AI CE-ZO protection strategies illustrated the effectiveness of the proposed protection strategy. Moreover, the given strategies were tested experimentally in the laboratory for several grid situations through a scaled model designed and built to emulate the analyzed MV DS. Furthermore, the trip time speed of the PD was compared with other topologies operating under similar conditions. The AI-based protection strategies showed their practical advantages over conventional protections similar to the simulation results.