Islanding Detection of Microgrid Incorporating Inverter Based DGs Using Long Short-Term Memory Network

This paper proposes a new approach for rapid detection of islanding events in a microgrid (MG). The proposed approach is a two-step procedure in which the first step is to extract some valuable features from the voltage and current signals. Such signals are analyzed for finding the second harmonic by the discrete Fourier transform (DFT). Then, the symmetrical components of this second harmonic are calculated for voltage and current, resulting in six features; positive, negative and zero sequence components. In the second step, a novel deep learning classifier based on long short-term memory (LSTM) network to identify the islanding decision is applied. The LSTM is a new artificial intelligence technique which is a distinctive pattern of recurrent neural networks. To evaluate the performance of the proposed approach, simulated and practical voltage and current signals are used. The simulated signals are generated by simulating a MG consisting of inverter based wind DGs using Matlab Simulink, while the practical data are collected from an experimental model consisting of wind and PV DGs. Different intentional and unintentional islanding events are conducted and processed using the proposed approach. The results show that in comparison with other artificial intelligence algorithms such as decision tree (DT), support vector machine (SVM) and artificial neural network (ANN), the proposed approach is efficient and reliable in detecting the islanding with high accuracy, high dependability and small detection time.


INDEX TERMS
Increasing the integration of the distribution generations (DGs) into distribution networks has numerous technological advantages such as enhancing the reliability, system security and performance in addition to environmental benefits by VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ decreasing fossil fuel consumption [1]. Nevertheless, this integration faces some challenges due to the intermittency behavior of the renewable DGs. One major problem that should be addressed is the islanding detection. An islanding condition can be intentional or unintentional. Intentional islanding is carried out because of the scheduled maintenance, while unintentional islanding can take place as a result of unpredicted issues causing the isolation from the main grid. This can lead to safety hazards, mal-operation of protective devices, power quality disturbances [2]. So the IEEE 1547-2003 standard specifies that the maximum allowable delay for recognizing the unintentional islanding condition is two seconds [3]. There are two main categories for recognizing the unintentional islanding; global and local techniques. In the global or remote techniques, a complete communication between the DGs and the control center of the utility grid is required. The main disadvantage of these techniques is the required cost to build the communication system especially when there is no previously any type of communication infrastructure [4]. The local techniques can be additionally classified into three sorts: passive, active, and artificial intelligence and signal processing based techniques. The passive procedures screen the network parameters, for example, voltage, current, frequency, and harmonic distortion at the point common coupling (PCC) on the DG site with the utility network for detection processes of islanding occasions [5]. In [6], the authors used the voltage and frequency deviations to recognize the islanding occurrence. The changes of both frequency and active power with the time were used in [7]. The measurement of harmonic distortion was used as an indicator for islanding in [8]. The voltage surge and the displacement of phase angle were used in [9]. The change of phase deviation with the time was implemented in [10].
In the active recognition strategy, unsettling influences are purposefully injected into the system and the islanding is then distinguished dependent on network reactions to the aggravations [11]. The third category of islanding detection techniques is based on artificial intelligence and signal processing approaches. Fourier Transform (FT) and Fast Fourier Transform (FFT) [12], [13] are the first signal processing techniques used in islanding detection. These techniques are based only on frequency spectrum analysis and are therefore unable to detect disturbances such as islanding and transients due to the presence of nonstationary characteristics in the voltage, current or power waveforms. Hence, timefrequency, multi resolution analysis based short-time Fourier transform (STFT) was proposed to monitor non-stationary disturbances but due to its non-adaptive window size, it also failed to detect islanding and disturbances in some cases [14]. In [15], the wavelet transform (WT) was combined with machine learning algorithm to detect the islanding occurrence and this combination gave a high accuracy and a less number of miss-classified events and had a high adoptability. In [16], the output of WT was the input to neuro-fuzzy and this hybrid technique had many advantages such as fast and simplicity.
Artificial neural network (ANN) was used with WT resulting in minimization of computational burden [16]. The effective performance and the low influence of noise and harmonics were achieved by combining WT with s-transform and support vector machines (SVMs) algorithm [17]. In [18], decision tree (DT) classifier was used with WT for fast detection and applicability to multi DGs networks. The fuzzy technique is combined with WT in [19] and it achieved a high successful performance under different operating conditions. All the WT based method depended on selected signal for detection and this make a strong challenge because if the threshold of the signal is high, the detection may not be occurred and if it is very small, a wrong tripping may be occurring. In [20], the neuro-fuzzy algorithm was used to avoid the selection of signal threshold and it was applied on multi-DGs microgrid (MG) and succeeded to detect the islanding of whole MG but it couldn't detect the disconnection of single DG in the MG.
In [21], the ANN was used with FT to detect the occurrence of islanding but it was applied on a MG with single DG based on wind turbine. Many other artificial intelligent techniques are used to detect the islanding such as the DT [22], SVMs [23], neuro-fuzzy logic [24], the adaptive ensemble classifier [25], Hilbert-Huang transform, machine learning techniques [26], and the modified Slantlet transform [27].
To overcome the shortage and disadvantages of the aforementioned methods, a precise and quicker islanding detection approach based on developing a long short-term memory (LSTM) network is presented in this work. The methodology comprises of two noteworthy steps where the initial step comprises the extraction of specific features derived from three-phase voltage and current signals at DG site using the discreet Fourier transform (DFT) and symmetrical components method. The aim of this step is to extract the unique features which can reflect the dynamic characteristics of islanding events. The last step is established with the LSTM classifier to achieve higher accurate event detection as well as assess the credibility of the output events. In addition, due to its very quick learning speed, it can also track the results of events online. The main contributions of the work can be summarized as: • A new two steps approach for rapid detection of islanding events in a MG is presented • A novel deep learning classifier based on long short-term memory (LSTM) network is applied • Different case studies are conducted in order to verify the performance of the proposed methodology in detecting the occurrence of islanding and in distinguishing between islanding events and non-islanding events such the connecting/disconnecting capacitor banks and zero power mismatch at different load models.
• The proposed LSTM is applied on simulated and practical intentional and unintentional islanding events. Accordingly, this paper is organized as follows. In section II, the proposed islanding detection approach is proposed. Section III illustrates simulation results and case studies.
In section IV, the results of applying the proposed approach on experimental data are discussed. Finally, the conclusions are presented in section V.

II. THE PROPOSED ISLANDING DETECTION APPROACH
The proposed islanding detection approach is two steps process; features extraction and classification. During the processing of voltage and current signals using STFT analysis, it is observed that the second harmonic has the maximum contribution with respect to other harmonics during the islanding operation. In this approach, the second harmonic is therefore first extracted by the DFT, since it is considered the dominant factor arising from the occurrence of the islanding. Then, the symmetrical components of this second harmonic are calculated for voltage and current, resulting in six features; positive, negative and zero sequence components. The six extracted features are the inputs to the LSTM classifier as shown in Fig. 1 while, its output is a decision signal that is one if the islanding occurs or zero if there is no islanding.

A. FEATURE EXTRACTIONS STEP
The DFT is utilized to identify the frequency contents in the captured voltage and current waveforms as these waveforms are periodic. The second harmonic is extracted and is processed using symmetrical component method. The magnitudes of symmetrical sequence components are the main indicators that are used to indicate the existence of disturbances in voltage or current waveforms. The symmetrical component voltages are calculated using the three phase voltages (V a , V b , and V c ) and the notation a = 1 120 o as follows: where V 1 , V 2 and V 0 are the voltage positive, negative and zero sequence components, respectively. This equation is also used to find the symmetrical component currents by knowing the line currents.

B. CLASSIFICATION STEP
The proposed LSTM network is used to automatically learn features, identify, and detect the islanding events. The LSTM network is a Recurrent Neural Network (RNN) type that, using the hidden layer as a memory cell, can handle time series correlation problems in both short and long time. The RNNs are special type of ANNs that comprise a loop in internal networks. RNNs have recurrent hidden states where the output at each time step is dependent on the preceding time step, so the hidden cells in RNNs receive a feedback from the previous states to current states [28]. The architecture of RNN allows it to be consecutive input.
Officially, RNN gives a sequence X = [x 1 , x 2 , . . . , x n ], x t ∈ R k is the input at the time step t. The hidden state h t at the same time step t, h t ∈ R d , is updated by [28]: where, Input & hidden sizes, respectively. f : Non-linear function (sigmoid or tanh). Sequence input layer and the LSTM layer are the core components of the LSTM network. Where the input sequence layer has data from the time series data inserted into the network and the LSTM layer learns long-term dependencies between sequence data time steps as shown in Fig. 2. The LSTM network keeps a memory cell c t encoding memory of observed information up to the time step t. The performance of memory cell is regulated by three gates: input gate i t , output gate o t and forget gate f t . The updating equations are given as follows [28]: The sigmoid function is used for prediction and transformation in neural networks, and the operator means the element-wise multiplication of vectors. The block diagram of the LSTM cell is shown in Fig. 3.
At time step t, the forget gate f t is primarily acquired through a new input function x t and previous hidden state h t−1 . The cell states change using the tanh function while the gates use a sigmoid activation function. The last memory cell knowledge c t−1 can be kept when the forgotten gate value is close to one and vice versa. Next, the previous hidden state and the new input function form the input gate i t that is added to the memory cell to become c t . Finally, the output (hidden) state h t or the output gate will decide what should be taken from the memory cell to form the new hidden state h t .
The proposed LSTM framework for islanding identification is shown in Fig. 4. The extracted raw features are fed into the LSTM input layer. The input layer, and the hidden state of an LSTM model is updated repeatedly to characterize the input. The final hidden state h f will pass throughout, a fully-connected layer with a softmax function to produce the condition mark. Here, the raw signals perform as the direct and just input for the entire model. A single deep neural network is the main part which finishes the task of islanding identification.

1) INPUT PREPARATION
Considering that the length of the LSTM input sequence influences the complexity and performance of the entire model, an operational input preparation plan becomes very important. The model should build full utilization of various hidden features in multi-sensor data when dealing with data gathered from multiple sensors of different signals. The input data therefore needs to be correctly joined via the same input preparation procedure. This data-fusion plan allows extension of this technique to multi-sensor data. A preparation function for a time series signal segment s ∈ R l×n from n sensors is found to form sampling points in m uninterrupted time steps into one vector as the input at t th time step [29]: In this technique, the identity function as and x t ∈ R m×n will be redesigned into R mn as an input vector. As future work, an advanced preparation function as the convolution operation will be considered.

2) LSTM MODEL ARCHITECTURE
LSTM is used to attain the feature representation for input signal [29]: where θ denotes all learnable parameters. As the final hidden state h f encodes the greatest information from input signal, take h f as the representation vector and use a fully-connected layer to convert it into a vector with the length equivalent to the class number. A softmax layer is accepted for islanding detection problem.
The probability distribution is calculated as [29]: where W s ∈ R |C|×d , b s ∈ R |C| are learnable parameters and

3) MODEL TRAINING
The model could be trained in an end-to-end way by backpropagation using the cross-entropy loss as the loss function, Let Y be the target distribution of condition types andŶ be the predicted condition distribution. The objective of training is to minimize the cross-entropy loss between Y andŶ for all training samples [28]: where i is the index of training sample.  Table 1. The voltage and current are monitored and measured at each DG bus and at the main circuit breaker (CB) between the MG and the utility grid (CB_0). In this work, five case studies are presented to assess the performance of the proposed methodology in detecting the MG islanding. The STFT is applied to find the information on harmonic distortion in the time and frequency domains in the captured waveforms before applying the proposed methodology to confirm the high contribution of second harmonics during the islanding event. Such case studies include opening the main CB, loss of distribution line (DL), three phase short circuit at PCC bus, capacitor bank switching and power mismatch.

A. CASE 1: OPENING THE MAIN CB
In this case, the main CB between the MG and the utility grid (CB_0) is opened at time instant t equals 3.9 s therefore, the current reaches to zero.
The inverter based-DG controller maintains the inverter average output power to be constant to not deteriorate the maximum power point (MPP) process and this causes an increase in the DG voltage, as shown in Fig. 6. The voltages at the DGs buses are monitored and processed using STFT to find the harmonic contents with time as shown in Fig. 7. From the figure it is remarked that, during the islanding event, the second harmonic appears with high magnitude.
For this reason, the proposed methodology processed this second harmonics for voltage and current waveforms to find their symmetrical components; positive, negative and zero that represent the extracted features shown in Figs. 8 and 9.
During normal operation, the values of the second harmonic of captured voltage and current waveforms are zero,     (t = 3.9 s), the second harmonic order appears in voltage and current waveforms as illustrated in Fig.7 and their symmetrical components have remarkable changes with high values as shown in Figs. 8 and 9.
The islanding decision is shown in Fig. 10 compared to other techniques such as DT [22], support vector machine (SVM) [23] and ANN [21]. The results show that all DGs are islanded from the utility grid due to the disconnection of main circuit breaker. The results show also the proposed LSTM is the accurate technique comparing with the other techniques and it gives the islanding decision at 3.9 s.

B. CASE 2: LOSS OF DISTRIBUTION LINE
One of the events that may happen in the distribution network is the losing of DL. Taking DL3 as an example, it is lost at t = 3.7 s, and CB_3 is opened at t = 4 s. Fig. 11 shows the captured voltage and current waveforms at DG3 bus. Before applying the proposed LSTM, these waveforms are processed using STFT to find the harmonic contents in time-frequency domains. Fig. 12 shows that the second harmonic does not exist during normal operation, exists with small values during the loss of distribution line and its value is high during the occurrence of islanding. By processing the measured waveforms to extract features as shown in Figs. 13 and 14, at normal operation, the symmetrical component values of the second harmonic are zero, and when DL3 is lost, there is a disturbance happened, but it is not like the islanding disturbance. In addition, the voltage and current waveforms at DG4 are processed and the symmetrical components of its second harmonic order are shown in Figs. 15 and 16.  According to the magnitude of these sequence components, Fig. 17 shows that the proposed islanding algorithms, LSTM, identifies the occurrence of islanding starting from the loss of the DL, at t = 3.7 s for DG3. This is a significant action because beginning with the loss of DL3, the DG3 is isolated from the main grid as DL3 is the only link between DG3 and the main grid.
On the other hand, the LSTM identifies that DG4 is not islanded because their symmetrical component of voltage and current second harmonics are zero. Fig. 17 also reveals that the other techniques give wrong decisions at the healthy DGs by giving a spike at the instant moment.

C. CASE 3: THREE PHASE SHORT CIRCUIT AT PCC BUS (B0)
An unintentional islanding event is conducted using three phase short circuit at the PCC bus (B0) between the MG and the utility grid. The 3-ϕ fault occurs at time instant t = 3.5 s and the voltage and current waveforms before and during this fault are shown in Fig. 18. Harmonic contents of the current waveform are shown in Fig. 19. The figure shows that the second harmonics has a significant contribution during the islanding occurrence. The symmetrical components of the voltage and current waveforms are shown in Figs. 20 and 21, respectively. The LSTM's output decision indicates that the MG is subjected to an islanding event and this appear at all MG DGs as shown in Fig. 22. This figure also depicts that the proposed LSTM and the other algorithms used in the comparison have an accurate islanding decision.

D. CASE 4: CAPACITOR BANK SWITCHING
This case study is presented to assess the performance of the proposed methodology under non-islanding event like the connecting/disconnecting capacitor banks. As depicted  in Fig. 5, a capacitor bank of 1.5 MVAr rating is installed at bus B1 and it is normally disconnected. This capacitor bank is connected at t = 3.5 s and the voltage and current waveforms at DG1 are shown in Fig. 23. These waveforms are processed using DFT and the symmetrical components of their second harmonics are shown in Figs. 24 and 25. The values of these symmetrical components are zero except at the instant of connecting the capacitor bank. They have surges or spikes with very small values, not exceed 1 × 10 −4 pu. The LSTM takes the decision of does not occur the islanding as shown in Fig. 26.

E. CASE 5: POWER MISMATCH
The power mismatch represents a major challenge for the techniques used to detect the MG islanding. As known,  the load can be modeled as a constant power, constant impedance and constant current. In this case study, to assess the performance of the proposed LSTM in distinguishing between islanding and non-islanding events like generation/ load mismatch, two load models are used: constant power model and constant impedance model. This case is conducted at DG4. Under normal operation, the generated power of DG4 is greater than the load at DG4 (L4 and part of L00) by P = 20 % that is delivered to the main grid. At the time instant t = 3.2 s, an additional load (with rating equals P) is connected to DG4 and this causes the power mismatch is almost zero. At time instant t = 3.5 s, the circuit breaker CB_4 is disconnected to isolate this DG and its local load L4 from the main grid.

1) CONSTANT POWER LOAD
The load is represented by its active and reactive power ratings and according to this load model; the relation between the voltage and current is inversely proportional.   The captured voltage and current waveforms at DG4 are shown in Fig. 27. The voltage slightly decreases and the current increases during the zero power mismatch. When the CB_4 is disconnected, the current flow to the PCC bus (B0) is zero and this causes the increase in the voltage at the DG4 bus. Figs. 28 and 29 show the extracted features from voltage and current waveforms. When a sudden load change occurs at t = 3.2 s, small changes are detected in the values of the symmetrical components during first cycle then the symmetrical components return to their values during the normal operation. At the instant of opening CB_4, remarkable values of the symmetrical components are observed and these values are the inputs to the LSTM. The islanding decision is shown in Fig. 30.  The results show that in spite of the power mismatch is zero but the proposed LSTM has the ability to give the exact decision of islanding when opening CB_4. The LSTM provides this correct decision as it does not depend on the variations in voltage or frequency magnitudes associated with the active and reactive power balance like conventional islanding passive techniques.

2) CONSTANT IMPEDANCE LOAD
In this case, all constant power loads are replaced by constant impedance parallel RLC loads and the following formulas are used to calculate the value of active and reactive power of the load  In this type of load model, the relation between the voltage and current is directly proportional. The waveforms of voltage and currents at DG4 are shown in Fig. 31 while the symmetrical components are shown in Figs 32 and 33. From the figures, it is remarked that the symmetrical components have a significant values starting from the opening CB_4 at time instant t = 3.5 s. The LSTM uses these values to identify the islanding decision. Fig. 34 shows that the LSTM has a correct islanding decision in spite of the zero power mismatch when opening CB_4. The results of this case ensure that the zero power mismatch and different load models do not affect the performance of the proposed LSTM.
The accuracy and dependability indices stated in equations (16) and (17), respectively and the calculated detection time are used to depict this comparison.

Correctly classified instances
Total number of instances × 100 (16) All works in this paper are running on MATLAB-2019b, Window 10, CPU; Intel core i7-2.7 GHz, 6 GB RAM. The results in Table 2 confirm the best performance of the proposed LSTM in comparing with DT, SVM and ANN in terms of dependability, accuracy and detection time.

IV. APPLYING THE PROPOSED APPROACH ON EXPERIMENTAL DATA
In this section, the performance of the proposed methodology to detect the MG islanding is tested by setting up some experiments in a MG laboratory (lab.  Table 3. Three smart meters are connected to the output terminals of the wind DG and the PV DG and at the PCC of the MG. These meters are used as data acquisition devices and they are integrated with a PC, its specifications are stated   in the simulation results section, to record the online captured voltage and current waveforms at the DGs and the MG PCC.
Many cases have been conducted to test the validation of the proposed methodology in detecting the intentional and unintentional islanding of MGs. Due to the limited number of pages; two case studies are presented in this section.

A. CASE 1: TRIPPING THE MAIN CB
The main CB0 that is between the utility grid and the MG is switched off for a scheduling maintenance or any other emergency condition. The captured three-phase voltage and current waveforms at the PCC are shown in Fig. 37.    In this case, the mismatch between the MG's generated power and loads is considered to see whether the LSTM classifier can even distinguish between this event and the islanding event. This mismatch is conducted by connecting load 3 and Load 4 to the MG and disconnecting them again. After that the main CB is switched off, to isolate this MG, to create intentional islanding. The voltage and current waveforms at the PCC, DG1 bus and DG2 bus are captured. Fig. 41 shows the captured voltage and current waveforms at DG1 (wind DG) while the symmetrical components of the three-phase voltages and current are shown in Figs. 42 and 43, respectively. The results display variations in positive, negative and zero values when the loads are switched on, the loads are turned off and the main CB is opened. It is not possible to differentiate between certain event from these events. However,     the LSTM has the ability to distinguish between them. The output of LSTM, shown in Fig. 44, depicts that the islanding is occurred at the time instant 2.8 s.
The results of LSTM are compared with those of DT, SVM and ANN as shown in Fig. 44. From the figure, it is concluded that the DT and SVM algorithms do not have the ability to differentiate between change of load and the islanding events. Moreover, the comparison depicts that the ANN has some errors and cannot exactly identify the islanding.
This comparison is carried out at different generation/load mismatch values from zero to 110 %. In each case the detection accuracy, dependability and detection time are calculated and the mean values are summarized in Table 4.

V. CONCLUSION
This work introduces a new two steps approach for rapidly detecting the islanding events in a MG. The symmetrical components of the second harmonic of voltage and current signals are analyzed via a novel deep learning classifier, LSTM, to identify the islanding decision. Different intentional and unintentional islanding events are conducted in order to evaluate the performance of the proposed approach. In addition, simulated and practical voltage and current signals are used. Two load models are used: constant power model and constant impedance model in order to ensure that the zero power mismatch and different load models do not affect the performance of the proposed LSTM. Moreover, the performance of the proposed methodology under non-islanding event like the connecting/disconnecting capacitor banks is verified. The results prove the superiority of the proposed approach in detecting the islanding with high accuracy, high dependability and small detection time compared with other artificial intelligence algorithms such as DT, SVM and ANN.