A new protection scheme for PV-wind based DC-ring microgrid by using modified multifractal detrended fluctuation analysis

This paper presents fault detection, classification, and location for a PV-Wind-based DC ring microgrid in the MATLAB/ SIMULINK platform. Initially, DC fault signals are collected from local measurements to examine the outcomes of the proposed system. Accurate detection is carried out for all faults, (i.e., cable and arc faults) under two cases of fault resistance and distance variation, with the assistance of primary and secondary detection techniques, i.e. secondorder differential current derivative (


Introduction
In recent years, there have been many studies on the integration of renewable energy sources (RESs), such as photovoltaic systems (PV), wind turbines (WT), tidal, hydro, etc. Among these RESs, PV and WT are the most preferred because of their abundant availability in nature [1,2]. Many developed and developing countries in the world are increasing their power generation with the RESs. In power distribution networks, modern technologies in power electronic devices make the integration of RESs with microgrids more flexible. Based on the connection of equipment types, networks in the microgrid can be AC, DC, or both [3]. In the present era, DC microgrids have attracted significant attention because of their advantages compared to AC microgrids in terms of low transmission losses, active and reactive power control, reliability, economical operation, power transfer capacity, eco-friendliness, and simpler monitoring [1][2][3][4].
The major challenges in the DC microgrid are fault protection (i.e., detection and isolation) and location. Different possibilities of faults in the DC distribution network are Pole-Pole (P-P), Positive Pole-Ground (P-P-G), Negative Pole-Ground (N-P-G), Series arc and Shunt arc faults [1]. Generally, DC cables offer low impedance in the fault scenario and as a result the rate of rise of the fault current is very high [3][4][5]. To protect the DC microgrid from these currents, different protection schemes have been introduced. Reference [6] discusses a differential protection scheme where a high bandwidth communication channel to transmit the signals is required together with a backup protection scheme. In this scenario the cost and complexity of the grid is increased. Other issues with the differential protection schemes are the effect of distributed capacitance, especially in high voltage DC microgrids, and change in the penetration level of RESs changing the threshold values and as a result making it unable to synchronize with the utility grid [2,4]. To compensate for these issues, references [7][8][9] propose an improved threshold-based, modified and discrete time frame for the differential protection scheme, which is time-frequency based with the assistance of variational mode (VMD) and HHT combination. An over-current protection scheme can easily detect the pole to ground fault at high resistance but itis unable to classify different fault types that occur in the DC microgrid. It also requires high-speed sensing devices [10,11].
Line current derivative protection schemes have been discussed for different faulty sections of bus voltages, wind speed variations and fault clearing time etc., but this method is unable to distinguish different kinds of faults and also needs communication devices [12]. In [13,14], various faults in the DC microgrid are classified with the help of relay coordination. However, it requires adjacent relays for coordination of signals. References [15][16][17] discuss fault detection with oscillation frequency using inverse-time transient power, reliability index, and a poverty severity index method. The main issues with these indices are that they need a communication channel, it is diffcult to process the signals with low disturbance index [15], and they are unable to detect overcurrent and high resistance faults [16,17]. In reference [18], a pseudo-voltage-based method is introduced to distinguish the different faults in the DC ring microgrid and this method purely depends on the local measurements. A fast selective protection scheme can detect faults quickly and accurately using local measurements but it requires a backup protection scheme [19]. The parameters are estimated using the least-squares method and the classification of internal and external faults is proposed in [20]. However, it requires a communication channel and backup protection because of its instant de-energization in the adjacent cables under fault conditions. Traveling wave and reflected wave-based protection schemes provide fast fault detection but they require high-speed measuring devices and are also limited to short-distance cables [21]. Renewable energy-based DC microgrids sometimes face a fault-ride-through problem during a fault scenario. In particular, a short duration P-P fault collapses the voltage and thus fault current limiters may be required to reduce the fault current [22]. According to National Electrical Codes (NEC) and Under Laboratory (UL: 1699B), the detection and isolation of PV side arc faults are essential to protect from fire hazards [23].
In [24][25][26][27][28], the signal processing algorithms, i.e., Modified Wavelet Transform (MWT) [24], Ensemble Empirical Mode Decomposition (EEMD) [25], S-Transform (ST) [26], and Empirical Wavelet Transform with Support Vector Machine (EWT-SVM) [27] require more features to analyze the faults. As a result, information will be lost due to mode mixing, reduction of dimensionality, and deterioration of classification accuracy. Fuzzy-based, artificial neural networks (ANN), and random vector function neural networks (RVFLN) have short comings such as needing data training, robustness and weight calculation [28]. In reference [29], an iterative technique is presented for the estimation of fault location estimation in a DC microgrid. Another popular and widely used method for the non-stationary signals is fractal analysis, which is used to extract fractal characteristics from the hidden signals using Mono-fractal or detrended fluctuation analysis (DFA) [30]. DFA is the transform tool to compress large data into fluctuation curves of low intensity, and it is widely used in scientific research because of its long-range detection, and ability to remove the fluctuation trends from the signal. In reference [31], the electrical activity of the brain and movements of the right arm are diagnosed using DFA analysis. The shortcomings of DFA are mono fractal components having variable characteristics and not having any information about its local fractal components. References [32,33] introduce the compensation for DFA problems using multifractal analysis with the help of multifractal detrended fluctuation analysis (MFDFA). It is a powerful and popular method. However, one of the concerns of MFDFA is that it is applicable only to fixed polynomial order but not for higher-order polynomials in the detrending process. This problem is solved by using M-MFDFA in the application of daily precipitation time series [34].
To address the above-mentioned problems, this paper focuses on fault detection, classification, and distance estimation for the proposed model. For accurate fault detection, two protection schemes, i.e., primary and secondary, are proposed. The primary detection technique is based on the second-order derivative of the fault current. The secondary detection technique is sliding mode window-based Pearson's correlation coefficient (SMW-PCC). The detected faults are input to the proposed M-MFDFA classifier. This classifier can compute the level of multifractality of the faulty signal for finding a discriminative set of features of any order polynomials with the help of polynomial and trigonometric functions. From M-MFDFA, multifractal features are extracted in terms of a kurtosis index (KI) to enhance the performance of the proposed classifier, and it is represented in2-D (two dimensional) and 3-D (three dimensional) scatter plots for better visualization. This paper also addresses the unknown parameters and fault distance estimation recursive least squares with forgetting factor (FF-RLS) algorithm.
The remainder of the paper is organized as follows. Section 2 illustrates the modeling and possibilities of faults in the proposed DC ring microgrid, while Sect. 3 describes the DC cable and arc fault detection using the second-order derivative of fault current and SMW-PCC. Brief details of M-MFDFA and its classification are illustrated in Sect. 4, while unknown parameter estimation is described in Sect. 5. Results and discussions are illustrated in Sect. 6, to validate the superiority of the proposed PV-Wind based DC ring microgrid protection scheme compared to existing methods. Finally, Sect. 7 concludes the paper.

Fault analysis in PV-wind-based DC ring microgrid
The complete architecture of this paper for fault analysis of the DC ring microgrid is shown in Fig. 1.
A PV-Wind-based DC ring network is formed by six nodes, i.e., A, B, C, D, E, and F, and each node is connected with its adjacent nodes to form the ring network shown in Fig. 2. In this model node A is connected to the utility grid through a VSC converter and voltage is stepped-down through a transformer from 11 kV to 500 V. The VSC converter allows bidirectional power flow, so the utility grid is always ready to send or receive power to/from the DC microgrid [1,[18][19][20]. At node B, a 400 kW PV farm, which is obtained by parallelling four PVs with each PV panel rated at 100 kW, is connected through a DC-DC converter. To obtain the maximum power from the PV array, a maximum power point tracker (MPPT) with a 'perturb &observe' (P&O) algorithm is used. In addition to the MPPT for the PV array, two more controllers, i.e., the voltage and current controllers are used to regulate and synchronize with the utility grid through the DC-DC converter. At node C, a DC-lamp load-1of 250 kW is connected, while at node D, 90 kW of wind power is obtained with three permanent magnet synchronous generators (PMSGs) each rated at 30 kW, and is connected through another VSC. Similar to the PV farm, the MPPT is used to obtain the maximum power from the PMSG, while a space vector PWM technique and proportional-integral (PI) controller is used in PMSG to control the rotor speed. Although wind energy fluctuates in nature, in this paper, wind speed is considered to be constant at 12 m/s. At node E, a150 kW battery is connected through a bidirectional DC-DC buck-boost converter, where the voltage is boosted from 96 to 550 V to synchronize with the microgrid DC voltage. The battery is used to maintain a stable power flow under uncertain load conditions. Whenever the load is less than the generation, the battery is operated in the buck mode and is charged by consuming power from the DC bus. In contrast, the battery delivers power back to the DC bus in boost mode when the load is greater than the generation [15]. At node F, the 250 kW DC lamp load-2 is connected. The detailed parameters of the DC ring network and faults classes are given in Tables 1 and 2, respectively.

Fault analysis in the proposed model
The main issue in the DC ring microgrid is fault current due to its rapid changes of magnitude and direction under fault conditions. The commonly occurring faults in the DC ring microgrid are cable faults and arc faults. Analyzing these faults, especially in the DC ring microgrid, is very difficult because of its bidirectional current flow. In this paper differential current is used to analyze the faults, because of its naturally being zero under normal operation and becoming non-zero under fault conditions. The representation of various faults in the cable, i.e., P-P fault and P-P-G is shown in Fig. 3a, b, respectively. From Fig. 3b, it is clear that under normal conditions the differential current (I 1 -I 2 ) flows through R f , where as under fault conditions their additional current (I 1 + I 2 ) flows through R f because the current direction changes towards the fault, as shown in Fig. 4. Similarly, there may be scope to analyze using the average current, though it has a higher magnitude under normal conditions compared to fault conditions as shown in Fig. 5a. Thus, it is difficult to analyze high resistive faults in the microgrid, where average current versus differential current is shown in Fig. 5b.
Whenever a fault occurs in the network there is a voltage drop, and at the same time the rate of current increases, as shown in Fig. 5c. Cable faults include P-P, P-P-G, and N-P-G types. A P-P fault may occur because of a lightning strike or fallen trees on the cables, while P-P-G and N-P-G faults occur because of physical contact between the cable and the ground. This may happen because of heavy storms or aging of the cables. Arc faults may be of series or shunt type, and they occur because of insulation failure or improperly installed cables. Cable faults are created in the microgrid cables, i.e., between nodes A and B in the model. The representation of cable faults is shown in Fig. 3, and the variation of fault  resistance (R f ) and distance (F d ) in the cable for different faults is shown in Figs. 6 and 7, respectively. Arc faults are created in the PV arrays, i.e., series and shunt arcs are formed by connecting resistance in series and parallel between the PV arrays as shown in Fig. 8. By considering the variation of R f and F d , the corresponding fault currents are shown in Figs. 9 and 10, respectively. The fault duration time for all faults is considered to be from 1.3 to 1.55 s.
By observing all cable faults from Figs. 6 and 7, it is clear that if the fault and cable resistances are low, the fault current magnitude is high. Differential currentbased fault analysis has key advantages such as less detection time and easy detection in the cable with the help of its second-order derivative, as will be described in Sect. 3.

Fault detection using second-order differential derivative current
The proposed novel approach for fault detection using the second-order derivative of the differential current does not require a communicational channel to detect or clear the fault, while it only depends on the local-based network parameters, and smoothing of the signal and the processing time to detect the fault is very short. The modified circuit for the fault detection using the proposed method is shown in Fig. 11, where the source voltages of where I dc1 and I dc2 are the measured currents at buses A and B, respectively, as depicted in Fig. 3b. I 1 and I 2 are the fault currents, which are different to I dc2 and I dc2 as described in [18,[35][36][37]. During the fault, the sum of these currents flows through the fault resistance, because of the changing current direction towards the fault. (1) (2)  Table 2 Type of Faults and classes

Fault type Class name
Pole-Pole (P-P) F1 Positive Pole-Ground (P-P-G) F2 Negative Pole-ground (N-P-G) F3 Series arc F4 fault which are obtained from [35,36]. The attenuation constants α 1 and α 2 , and the damping frequencies ω d1 and ω d2 are given as:  where ω n1 and ω n2 are the natural frequencies which are obtained from: The differential current is obtained from (2) and (3) as: Under normal conditions, L 1eq = L 2eq and R 1eq = R 2eq . However, under fault conditions, L 1eq = L 2eq and R 1eq = R 2eq , and there are: Based on the above conditions, different faults in various case studies under fault resistance variation and fault distance variation in the faulty cable are identified with the maximum and minimum peak amplitudes of each fault current as observed from Figs. 6, 7, 9 and 10. These fault current magnitudes are reported in Table 3.
Applying the derivative with respect to time for the differential current in (4) yields: After the occurrence of the fault at t = 0 + , the differential current derivative magnitude is: Applying the derivative to (5) to obtain the double derivative equation for the differential current, which is used to detect the fault, yields: After the occurrence of the fault at t = 0 + , the double derivative of differential current magnitude is: Substituting α 1 and α 2 values to (8) leads to: From (6) and (9), it is seen that the second-order derivative of differential current magnitude in (9) depends on the fault and equivalent resistances of the faulty cable. However, in the case of differential current, the derivative magnitude in (6) is independent of the fault and equivalent resistances of the faulty cable. In the first-order derivative, during a fault scenario, the magnitude of fault current is very high due to the independence of R f and cable resistance and it is also sensitive to external noise, where as the second-order derivative differential current depends on the fault and cable resistances during the fault scenario as seen from (9). Thus it is easy to protect and isolate the DC microgrid quickly once fault and cable resistances are known. From the above discussion, it is clear that the first-order derivative has higher magnitude than the second-order Modified circuit for P-P-G fault differential current derivative [37]. For this reason, the second-order derivative current is used in this paper for fault detection with the variety of case studies.

Case 1: Under fault resistance variation
In the proposed model, the fault resistance variation from 0.1 to 2 Ω is considered based on the nominal voltage and short circuit current [38,39] in the grid-connected mode to analyze behavior of different faults with the fault switching time varying from 1.3 to 1.55 s. It is seen from Figs. 6 and 9 where different fault resistance variations are considered, while keeping the fault distance constant at 20%, that the magnitude of the fault current decreases with the increase of fault resistance while its shape remains the same. Among these variations, 0.5 Ω fault resistance is considered in this paper to analyze the fault detection with a first peak magnitude of d 2 I 3 dt 2 technique for DC short circuit and arc faults, as depicted in Fig. 12. In this method, the fault is detected in the case of non-zero differential current. The fault detection times for the fault resistance variations for different types of faults using the proposed method are listed in Table 4.

Case 2: under fault distance variation
Analyzing different types of faults with the fault distance variation is very difficult because the local measurements are unable to detect the fault if it happens far from the measurement bus. Here the proposed model is simulated by varying the fault distance from 20 to 100% for different faults while keeping the fault resistance constant at 1Ω, and the simulation results are shown in Table 3, and Figs. 7 and 10. Among these variations, 40% of the fault distances for different types of faults are considered, and the fault is detected with the first peak magnitude of the second-order derivative of differential current for all  types of faults, as depicted in Fig. 13. The detection times are illustrated in Table 4. From the above discussions and results, it is clear that the proposed d 2 I 3 dt 2 method is more accurate and faster in terms of fault detection than others. However, this method has low accuracy and a delayed fault detection time when the system is subjected to high impedance loads and in the presence of noise. Because of this, a secondary protection scheme, i.e., sliding mode windowbased Pearson's correlation coefficient, is proposed in this paper.

Sliding mode window-based Pearson's correlation coefficient
Pearson's correlation coefficient (PCC) is widely used to estimate the behavior of a non-linear signal [40]. However, with PCC it is impossible to achieve a fast and accurate fault detection time especially when there is large number of samples in the non-linear signal [41]. The performance can be improved by the proposed method using sliding mode window-based PCC (SMW-PCC). In this paper, SMW-PCC can be obtained by the correlation coefficient (CC) of the current window to the previous window of the differential fault signal, expressed as: where k is the sampling instant, n is the number of samples in the window, which is always n ≥ k, and in this paper, n is considered to be 10 samples for accurate detection. If n is very large it diminishes the sensitivity and accuracy. x k−1+n and x k+n are the mean values of the previous and current windows, respectively. m is the length of the fault signal and R X prev , X current is the Pearson's correlation coefficient of previous and current windows of the differential fault signal. The range of R varies between -1 and + 1. If R X prev , X current = 0 it indicates that there is no correlation between the previous window and the current window of a fault signal, whereas R X prev , X current = +1 and − 1 indicate a strong positive and strong negative correlation between the previous window and current window of a fault signal, respectively. SMW-PCC can be obtained for every instant using (10). If the current and previous samples have the same magnitude the resultant CC is large because the correlation between the same signals is obviously high [40]. In this method, windows are moving by correlating the current window with its previous one until the length of the signal m is covered. During this moving process, if any window samples contain abrupt changes in their magnitude correlation, the coefficient will be immediately changed. Based on the sudden change in the correlation coefficient magnitude it is easy to detect the fault instant in the signal. Therefore, this method is proposed in the paper for fault detection, even if the system is subjected to large load, high fault resistance, and presence of noise.

Case 1: under fault resistance variation
In this scenario, the fault resistance is varied from 0.1 to 2 Ω while the fault distance is kept constant. The differential fault currents of both cable and arc faults under these variations can be seen in Figs. 6 and 9, respectively. Among these variations, R f = 2.0 Ω is considered to identify the fault detection for all the DC faults using the SMW-PCC method. From Fig. 14 it is clear that if the system is healthy, i.e., previous and current window magnitudes are the same, the correlation coefficient is the highest. When an abrupt change occurs in either current or previous windows, the correlation coefficient value is changed immediately. This effect can be observed from 1.3 to 1.5 s in Fig. 14, where the threshold is considered at 0.98. If the correlation coefficient of any signal is less than the threshold it indicates a fault in the signal. In this paper, the first low peak magnitude is considered as the fault instant to trip and isolate the microgrid from the fault zone. The low peak magnitudes of all the faults are reported in Table 4.

Case 2: under fault distance variation
In this scenario, the fault distance is varied from 20 to 100% of the cable length while keeping the fault resistance R f constant at 1 Ω. The differential fault currents for all the faults under these variations are illustrated in Figs. 7 and 10. Among these variations, the fault distance (F d ) is fixed at 40% of the cable length to consider the fault detection in the DC fault signals using the SMW-PCC method.
From Fig. 15 it is seen that the system is in healthy condition when there is no change in the magnitude of the current and previous windows, while the correlation coefficient is at a maximum. Whenever the system is unhealthy there are, abrupt changes in the signal correlation coefficient and it is decreased from maximum to minimum, as can be seen in Fig. 15 during 1.3-1.55 s. The threshold is 0.98 and below the threshold it is considered as a faulty section. In this paper, the first low peak magnitude is considered as the fault instant to trip the relay for microgrid protection, and the magnitudes of different faults are reported in Table 4.

Basic MFDFA
Using detrended fluctuation analysis (DFA), monofractal components can be analyzed for long-range but not forlocal fractal components. MFDFA is the extension of DFA which can successfully rectify the drawbacks of DFA [42]. Originally, MFDFA was proposed to analyze the non-stationary time series signals which can also significantly eliminate the characteristics data [32]. In this paper, the proposed algorithm is used to classify the different non-stationary fault signals collected from bus B, and five steps are taken to illustrate the classification of different fault signals.
Step 1. Initially the differential current (i.e., I 3 = I 1 -I 2 ) signal is passed through MFDFA, which contains the vanished components of the non-linear time series. Such is the non-overlapping uninterrupted segment (v) with an equal length of scales. The symbol ⌊⌋ ⌊a⌋ refers to only considering the integer part because sometimes the length of the differential current signal is not multiples of the time scale (s). Given this, there may be a small part of the truncated data leftover from the end of the signal and not used. In order to use this data the same process is repeated from the opposite end of Y(m), and as a result of such process, 2N s components are obtained.
Step 3. Local trends of each 2N s segment can be calculated using the least squares fitting approach, and then the variance of each segment can be calculated as: Step 4. Average overall segments to achieve the fluctuation function (F q ) or average fluctuation of the qth order, defined as: From (14) it is clear that for q = 2, F q (s) belongs to DFA analysis. To discover how F q (s) relies on the scales s for other values of q, it is necessary to repeat the steps from 2 to 4 for unlike time scales (s). In this paper, q is restricted within the interval − 5 ≤ q ≤ 5.
Step 5. Finally the scalar behavior of F q (s) employing log-log graphs against s for each value of q is observed and the range of time series scales is where H (q) is the Hurst exponent. If both q and H(q) are independent of each other, H(q) has stable values and the resultant of variance F 2 (v, s) is the same for all the local fractal segments.

Multifractal spectrum analysis
The relation can be established between the generalized Hurst exponent H(q) and mass exponent E(q) as: The relation between E(q) and q is linear when q and E(q) are independent of each other and is monofractal data. Otherwise, it is a multifractal series data due to the nonlinear nature, and has a strong non-linear relation. By using the Legendre transform [32], the relation between the singularity spectrum (Mq) and mass exponent (Eq) can be established as: where λ represents the singularity exponent or Holder exponent, and Mq represents the fractal dimension of the time series with distinct values of λ. The graph plot between Mq and λq is termed a multifractal or singularity spectrum, and Mq reaches the maximum value when q = 0. The obtained graph is an inverted parabola, where the width indicates the measure of the multifractal spectrum, with a larger value signifying a higher degree of multifractality. In the case that it shows zero-degree then it is a monofractal time series data because Hq is independent of q.

Modified MFDFA algorithm (M-MFDFA)
In the basic MFDFA method, local fractal trends are considered to take the fixed polynomial order which was discussed in step 3, (12) and (13). It is not the best way for estimating the local trends, because n will not be stable throughout the time series data, but varies for different time intervals. Basic MFDFA is difficult to apply for measuring the trends in real-time series data with the unknown trend and unknown functional form because it is very difficult to find the best polynomial for eliminating the local trends [34]. To avoid these shortcomings in the basic MFDFA, this paper proposes the M-MFDFA method, where a set of polynomials and trigonometric functions of possible linear combinations are considered as depicted in Table 5.
Set of polynomials and trigonometric functions U = {A 1 , A 2 , . . . .A 12 } to estimate the local trends are: where a, b, c, K 1 , K 2 , K 3, and K 4 are real constants, which come from the DFA analysis for local trends.
The proposed M-MFDFA method only changes step 3 of the basic MFDFA without affecting the other steps. Thus the modified step 3 is as follows: Step 3. Local fractal trends are calculated for each of the 2N s segments with the help of the trigonometric functions set f i for i = 1, 2, . . . .12 that belong to the set U. According to the method kurtosis of each of the segments will take only one function from the function set U and is then subtracted from the profile. This optimal mode is obtained to estimate the local trend by the selection of one which has the lowest kurtosis, and variance of each segment can then be calculated as: A 6 = ax 2 + bx + c + K 1 sin (x) + K 2 cos (x), A 7 = a + K 3 sin (2x) + K 4 cos (2x), A 9 = ax 2 + bx + c + K 3 sin (2x) + K 4 cos (2x), A 10 = a + K 1 sin (x) + K 2 cos (x) + K 3 sin (2x) + K 4 cos (2x), A 11 = ax + b + K 1 sin (x) + K 2 cos (x) + K 3 sin (2x) + K 4 cos (2x), and A 12 = ax 2 + bx + c + K 1 sin (x) + K 2 cos (x)  Compared with (12) and (13), using the modified (20) and (21) makes it easier to minimize the local trends of any order of polynomial function f set belonging to U. This method is also suitable for cases whoseresponse is curvilinear. • Hurst exponent (Hq) • Mass exponent or scaling exponent (Eq) • Multifractality spectrum or singularity spectrum (Mq) • Extreme right of the multifractal spectrum (λ qmax ) • The peak value of the multifractal spectrum (λ peak ) • Width of the singularity spectrum (Δλ q ) From the aforementioned features, the three main vectors, i.e., Hurst exponent, Mass exponent, and Singularity spectrum, that effect the non-linear characteristics of signals are identified from the various kinds of literature [32]. The impact of these vectors in the proposed model is discussed in Sect. 6.

Statistical analysis for the selected feature vectors
From the above discussion, the chosen feature vectors are used for fault classification. For accurate classification of DC faults, 2-Dimensional (2-D) and 3-Dimensional (3-D) scatter plots are used. Since the extracted features are in vector form it is compulsory to convert them into statistical measurement data, and then it is simple to visualize the distinctly classified faults in 2-D and 3-D plots. The statistical measurements are numerically-based representations, which give important information for ease of interpretation. Among the various statistical measurements, kurtosis is found to be more sensitive for nonlinear characteristics, and thus the kurtosis index is used (20) in this paper [32,43]. From the statistics, kurtosis can be defined as the combination of a weight distribution's tail relative to the center of the distribution represented as: where Y is the fault signal and Y is its mean value, N is the length of the signal, and σ is the standard deviation.
The KI data set is obtained from the feature vectors, i.e., Eq, Mq, and Hq of each DC fault under fault resistance and distance variation. The obtained data set is used to enhance the performance of the proposed classifier in terms of classification accuracy. For better visualization, the data is represented in 2-D and 3-D scatter plots in the form of clusters and its results are discussed in Sect. 6.

Parameter estimation
The estimation of cable parameters plays a key role in determining the fault instant during a fault in the proposed microgrid model. Thus, in the current section, DC cable parameters are estimated to modify the cable network (i.e., π-section network) as shown in Fig. 3b, to an equivalent fault network. If the fault happens in the cable at a particular point, the part from that point to the rest of the section is disconnected in the modified circuit, which is shown in Fig. 16. To obtain the unknown parameters, the 'forgetting factor-based recursive least squares' (FF-RLS)method is used. From (1), there is:

Recursive least squares with forgetting factor
In this paper, a novel approach of recursive least squares method with variable forgetting factor [43] is used to locate the fault distance by estimating the unknown parameters of the DC ring microgrid cable. The FF-RLS method is used in various applications such as estimation ofO 2 gas-liquid mass-transfer in the chemical industry, in financial studies, biomedical applications for estimating the ECG signals, predicting the torque and speed parameters in mechanical studies as well as recent application of RLS to estimate unknown parameters such as resistance, inductance, and capacitance in electrical circuits. The proposed method is more accurate and stable than others, with low computational time and high robustness which is proven in [43][44][45][46]. Equation (23) can be modified as: From the above equations, the known parameters are the current and voltage matrices which are represented for n samples as I dc ∈ R n×3 = [I 1 (n); �I 1 (n) �t ; I 3 (n)] n×3 and V dc ∈ R n×1 = [V c (n)] n×1 , respectively, and the unknown parameters are Z dc ∈ R 3×1 = R 1 ; L 1 ; R f . The above equation is illustrated during the period of t m andt m+1 as: where m represents each iteration cycle. Assuming: where A c , B c , and C c are the cable resistance, inductance and fault resistance respectively. By using (25), (26) can be modified as follows: where ϕ(m) is the regression vector and contains the data of the DC cable current, and E(m) represents the prediction error. θ (m) is the estimated state vectorand is updated using FF-RLS to find the unknown parameters, and can be obtained by: State vector update estimation is developed by: where G(m) is the Kalman gain matrix, given as: where P is the error covariance matrix and it is obtained as: Equations (26) to (31) are performed recursively with the initial values of the invertible matrix P(0) and an initial state vector θ(0). The forgetting factor for the RLS is λ, and its range is 0 < λ < = 1. In this paper, λ is varied from 0.78 to 0.997. In the steady-state, the computation speed of the proposed algorithm can be estimated by: where T s is the sampling period, and α R is the bandwidth of the estimator and must be greater than zero. From (32) it is clear that a lower value of λ increases the computation speed, reduces the noise rejection and selectivity, where as a higher value reduces the estimation speed but increases selectivity and stability. Thus, a low value is used in the transient state value. Location of fault distance is estimated using estimated parameters and is briefly discussed in Sect. 6. The overall summary of the FF-RLS algorithm is illustrated in Table 6.

Results and discussion
Initially, various faults are simulated in the MATLAB/ SIMULINK platform for the proposed PV-Wind-based DC ring microgrid model under different fault resistances and distances. Signals are collected from bus B, and the fault range of the differential current signals is shown in Table 3. For every fault, it is necessary to identify the fault occurring time, and for that purpose two protection schemes are proposed. The primary protection scheme is a second-order derivative of the differential fault current and SMW-PCC is the secondary protection technique. The primary protection technique is more suitable for low impedance and fault resistance conditions. However, in noisy and high impedance fault conditions, d 2 I 3 dt 2 leads to false detection. Therefore, the secondary protection technique (i.e. SMW-PCC) is introduced in this paper to protect the grid from all aspects. This detection technique works on the basis of the correlation coefficient between the current and the previous windows, and the correlation coefficient threshold is selected as 0.98. By using these techniques all the faults are detected in less than 11 ms, where as the detection time is less than 2 ms in the case of fault resistance variation (R f = 0.5 Ω) and less than 10 ms in the case of fault distance variation (F d = 40%) with the d 2 I 3 dt 2 technique. By using the SMW-PCC technique the detection time is less than 9 ms in the case of fault resistance variation (R f = 2.0 Ω) and less than 11 ms in the case of fault distance variation (F d = 40%). Compared to the arc faults (i.e., series arc and shunt arc), cable faults are detected very quickly by these approaches, as can be clearly seen from Table 4.
After fault detection, it is necessary to classify the different types of DC faults. In this paper a novel M-MFDFA approach is used to classify the different faults, where a total of five different types of fault signals (i.e., differential current signals) are directly passed through the M-MFDFA classifier. This classifier initially calculates the profile by subtracting the mean from the input, and it then calculates the 2N s components of each fault segment. The time scale parameters (s) considered from 16 to 1024 have a logarithmic scale of 19 between them and are equally divided by N (i.e., length of the signal) segments.
Thus variance of these segments is calculated for any order of polynomial functions. Under two scenarios, i.e., fault resistance and distance variations, the fluctuation component F q with the order q is evaluated. Among the three vectors (i.e., Hq, Eq, and Mq), the Hurst exponent (Hq) is identified as the best feature vector to analyze the dynamic characteristics of the non-linear signal based on Table 6 Stepwise execution of FF-RLS algorithm  their properties indicate high magnitude and insensitivity to local fluctuations. In this spectrum, all the faults are seen to be different from one another. For better classification and to enhance the performance of the proposed classifier, the chosen multifractal feature vectors are converted into statistical measurement data using the kurtosis index, as shown in Table 7. The data is represented in 2-D and 3-D scatter plots in Fig. 19 to give the proper DC fault classification in the form of clusters. From Fig. 19 it is clear that all the faults are distinctly classified.

Performance evaluation
The  N-P-G fault (F 3 ) and Shunt arc fault (F 4 ) as can be seen in Fig. 19. The classification accuracy of the proposed method can be obtained using (33). The proposed classifier is compared with existing classifiers, i.e., EEMD, ST, WT, EWT-SVD, and MFDFA in terms of extracted features and classification accuracy for both without and with noise (30 dB noise is intentionally added to the signal), and with the assistance of (34). The relative computational time is calculated for each method and listed in Table 8. From Table 8 After classification, it is necessary to estimate fault location. Thus, FF-RLS is used to estimate the unknown parameters using (29), while among the different unknown parameters this paper focuses on the cable resistance. Fault distance can be obtained by the ratio of estimated to the actual resistance, and using the estimated fault distance relative error can be obtained as: (35)    The proposed FF-RLS algorithm estimates all the locations of all faults accurately using (35) which are listed in Tables 9, 10, 11, 12 and 13. Unknown parameters can be obtained for the concerned fault by updating the fault data along with the variation of the forgetting factor (λ) in the proposed algorithm. After the recursive performance from (31) unknown parameters are obtained.
To represent fault location effectively, random data has been taken from the P-P-G fault among all the faults at R f = 1 Ω, and its corresponding plot is represented in Fig. 21. As seen, it is evident that the proposed FF-RLS algorithm can successfully estimate the fault distance at R f = 1 Ω.

Conclusion
In this paper a novel approach is presented for fault detection, classification, and distance estimation to obtain reliable operation of a PV-Wind-based DC-ring microgrid. Initially, five kinds of faults are collected from local measurements for two cases, i.e., fault resistance variation (R f ) and fault distance variation (F d ). Differential current is estimated from the collected     signals and its fault data is obtained with the help of the maximum and minimum values under different variations of R f and F d . The second-order derivative and SMW-PCC are applied to the differential fault current (i.e., the current passing through R f ) for DC fault detection. The fault detection is carried out using d 2 I 3 dt 2 with the first peak magnitude. Below the threshold (0.98 in this paper) is a fault zone where an especially low peak is considered for detection using SMW-PCC. Detected fault signals are passed through the M-MFDFA classifier for classification. The M-MFDFA multifractal features (i.e., Hq, Mq, and Eq) are in vector form, and are converted to statistical measurement data with the assistance of KI and plotted in 2-Dimensional and 3-D dimensional scatter plots for effective visualization. Scatter plots reveal that all the faults are accurately classified. Finally, fault distance estimation is achieved through the unknown parameters using the FF-RLS method. The novelties of this paper are: • Modeling of the ring microgrid with the combination of PV array, wind turbine, battery, utility grid, and loads; • The combination of primary and secondary detection techniques, i.e., d 2 I 3 dt 2 and sliding mode window-based Pearson's correlation coefficient (SMW-PCC), is used to protect the microgrid in uncertain conditions. M-MFDFA has been proposed for fault classification and its main advantages are that it can estimate the local trends of any order polynomial function and it does not t require any signal processing algorithm to decompose the signals. M-MFDFA reduces the computational burden, RCT, extracted features, and increases the robustness of the system. It is concluded that the proposed method is suitable for the fault diagnosis of the PV-Wind-based DC ring microgrid.