Fault Detection in a Single-Bus DC Microgrid Connected to EV/PV Systems and Hybrid Energy Storage Using the DMD-IF Method

: Variations in fault currents, short times to clear the fault, and a lack of a natural current zero-crossing point are the most important challenges that DC microgrid protection faces. This challenge becomes more complicated with the presence of electric vehicles and energy storage systems due to their uncertainties. For this reason, in this paper, a new method for fault detection in DC microgrids with the presence of electric vehicles and energy storage systems is proposed. The new proposed method uses the combination of dynamic mode decomposition and instantaneous frequency for fault detection. In this method, ﬁrst, a reference signal is made using the voltage and current signal sampled from the DC microgrid using the dynamic mode decomposition method. Next, in order to detect the fault, the instantaneous frequency value of the reference signal is calculated by the Hilbert transform. The simultaneous use of voltage and current signals reduces the transient effects of the control system on the proposed protection method. In order to measure voltage and current signals, only one intelligent electronic device unit is used in this paper. The proposed new method has been tested on a single-bus DC microgrid with the presence of electric vehicles and energy storage systems in MATLAB 2019b software. The results show that this method can detect all types of faults in DC microgrids, electric vehicles, and photovoltaics. Also, this method is immune to the uncertainties of the generation of distributed generation resources and the existence of noise distortions in the measured signals.


Introduction
Significant advances in the field of power electronics, the ever-increasing electrical loads, as well as concerns about environmental problems have led to the increased use of distributed generation (DG) resources [1][2][3].For this reason, the belief has been created among researchers in the field of energy that microgrids are one of the suitable options for solving these problems.A microgrid is a distribution network that includes DGs, loads, and energy storage systems [1].
Microgrids are divided into two types, AC and DC [4].Today, the use of DC microgrids has increased due to the use of more DC loads and the fact that DC is the nature of most DGs [5,6].DC microgrids have advantages such as a high efficiency [7], the easy connection of different resources through electronic power converters [8], and the ability to supply electricity to ships, remote areas from the power grids, and sensitive electronic equipment [9].
One of the most important challenges of DC microgrids is designing a suitable protection system for these networks [10].Actually, the main challenges of protecting DC microgrids can be seen as the change in the short circuit level, the high rate of changes in the fault current, the very short time to detect and clear the fault, the high uncertainty of DGs, and the lack of a natural zero current crossing point [11,12].In addition, the effect of low line impedance and fault resistance may make fault detection in DC microgrids a challenge [10].The high amplitude of the DC fault current may damage the converters [13,14].Another challenging issue that may make fault detection in DC microgrids difficult is the effect of noise on the sampled signals [15].In addition, the uncertainty of the generation of DGs and transient states in the network, including the connecting/disconnecting of loads, may make fault detection a challenge [16].Therefore, fault detection in the shortest time in order to prevent damage to the equipment in the network is very important in protecting a microgrid.In order to solve the challenges raised, many studies have been conducted in this field in recent years.In general, these studies are divided into two categories; local computing and that based on communications [17].
The most common scheme for fault detection in DC microgrids is differential protection [18].This method calculates the difference between the currents on both sides of the protection zone, and if this difference is greater than the threshold, it issues a trip command [19].The reason for using the threshold value in differential protection is to separate and distinguish the fault state from the normal state [20].Synchronizing the sampled signals and then comparing them with each other in order to issue a trip command in a certain time interval is one of the challenges of this method [21].Similarly, fault detection has been carried out in [22] using the differential method.However, it has not taken into account the generation uncertainties of DGs and the presence of energy storage systems.A scheme based on master-slave in DC microgrids has been presented in [23].Therefore, the current status on both sides of the protection area is checked by the slaves and the information is provided to the master.Then, the master detects the fault by receiving the information sent by the slave using the differential method.Overcurrent relays have been used in [24,25] to detect pole-to-ground (PG) and pole-to-pole (PP) faults.Overcurrent protection works by dividing the microgrid into several different areas and then placing the corresponding relays at the beginning and end of each line [26].Other conventional methods such as traveling waves, which are mostly used in AC networks, are likely to have incorrect performance in fault detection due to the lack of phasor signals in DC microgrids [27].In [28], traveling waves are used for fault detection.However, the noise caused by the switching of the converters may affect the optimal performance of this method [29].The use of transient waves for fault detection has also been suggested in some other studies.Therefore, the proposed method in [30] used a probabilistic neural-network to distinguish between transient states caused by faults and states caused by switching.The proposed algorithm in [28] is very sensitive to noise and may cause incorrect performances in normal network conditions.In [31], the signal processing method is used.In this method, the current of all lines in the microgrid is measured.These values are compared to the value of normal network conditions.The fault is detected by obtaining the energy of the point of the grid whose current has changed the most.What challenges the proposed method in [31] is not paying attention to the uncertainties in DG generations and not considering the effect of noise on the measured signals.The protection method presented in [32,33] is based on adaptive protection and communication between relays and protection units.In this method, all DGs and relays are connected to the central protection unit with communication channels.In this case, the status of each DG (active or inactive) is determined at any moment.According to the state of the microgrid, the central protection unit applies the settings related to each state to the relays using communication channels.In [34], the adaptive protection method is used to protect the DC microgrid.The challenge facing adaptive protection is not considering the uncertainties of communication links.The uncertainties of communication links can reduce the reliability of DC microgrid protection [16].In [35], in order to detect the fault, the parameter estimation method is used.This method samples the voltage and current signals of microgrid lines using several intelligent electronic devices (IEDs).The proposed method in [35] does not consider the uncertainties of communication links.The impedance estimation method is proposed in [36] in order to detect faults in the DC microgrids.However, the effect of noise on the sampled signals is not considered.Another method that has been used in fault detection in DC microgrids is the use of artificial intelligence.As an example, a method based on artificial intelligence for fault detection is proposed in [37,38].This method has used local data, although not considering transient states may challenge the proposed method.Another common method for fault detection in DC microgrids is the distance protection method.This method calculates the impedance of the lines by measuring the voltage and current of the microgrid lines.In this method, in order to detect the fault, the calculated impedance is compared with the predetermined threshold value.However, due to the large changes in voltage and current during the fault occurrence, it may cause limitations in this protection method [21,39].
As is known, the main obstacle to the expansion of DC microgrids is the existence of protection problems in this type of grid.Most of the existing methods use the current signal for fault detection or, like differential methods, need to create high-speed communication links for fault detection [40].The use of the current signal alone can reduce the accuracy of the protection systems or improper performance during the creation of various transients, especially the transients created by the control system [41].Using methods with communication links or multiple IEDs to protect a DC microgrid, although solving this problem, will increase the operating cost of DC microgrids, which is one of the most important obstacles in the expansion of DC microgrids.For this reason, a combined method based on dynamic mode decomposition (DMD) and instantaneous frequency (IF) is proposed in this paper.In this method, first, a reference signal is made using the voltage and current signal sampled from the DC microgrid using DMD.The simultaneous use of voltage and current signals reduces the transient effects of the control system on the proposed protection method.Next, in order to detect the fault, the IF value of the reference signal is calculated by the Hilbert transform, and the fault is detected by determining a threshold value.It should be noted that the proposed method uses only one IED in order to detect faults in different parts of the microgrid.Using only one IED reduces the costs of building and operating the DC microgrid.The proposed new method is evaluated using a DC microgrid in MATLAB/Simulink 2019b software.The results of the investigations show that this method was able to detect all types of faults with different impedances with only one IED in a reasonable time.Also, the proposed method is not sensitive to noise and shows good performance even when the signal is noisy.Finally, the results of the comparison between the proposed new method and the existing methods of fault detection in DC microgrids show the improvement of the performance of this method in different conditions, including fault detection in different points of the DC microgrid, the correct performance in the noise of sampled signals, and changes in fault impedance.
This paper is divided as follows: In the second part, the relationships related to the proposed DMD-IF method are presented.In the third part, the sample network is introduced and the simulation results are presented.In the fourth part, a comparison between the method presented in this paper and the existing DC microgrid protection methods is examined.

The Proposed Fault Detection Algorithm
The main goal of this paper is to detect faults in DC microgrids using a combination of DMD and IF methods in order to reduce the effects of DC microgrid control systems on protection systems.The DMD method is a popular method for modal decomposition, flow analysis, and reduced-order modeling.Also, the DMD method is widely used in the studies of dynamic systems (various studies in the fields of mechanics or power systems) [42].This method is very suitable for revealing spatial-temporal features [43].However, the use of DMD alone for fault detection can make it difficult to detect faults or even maloperation when creating various transients in the microgrid.For this reason, the IF value of the reconstructed signal by DMD will also be calculated in the next step.
In this study, the proposed method is based on the analysis of both current and voltage signals sampled from the DC microgrid.To obtain the reconstructed signal by the DMD, it is necessary to first sample the voltage and current of the DC microgrid in the normal (fault-free) working mode.These samples are stored inside the IED installed in the DC bus of the microgrid to be used in different conditions to generate the reconstructed signal.In the next step, during the operation time of the microgrid, the IED constantly samples the voltage and current signals of the microgrid, and a new signal is created using the new samples and the previous samples that were measured under the normal operation conditions of the microgrid.Figures 1 and 2 show the signals sampled during the normal operation of the network and the time of fault occurrence in the DC microgrid, respectively.It should be noted that the oscillations created in these figures are due to the non-ideal modeling of AC/DC and DC/DC converters.when creating various transients in the microgrid.For this reason, the IF value of the reconstructed signal by DMD will also be calculated in the next step.In this study, the proposed method is based on the analysis of both current and voltage signals sampled from the DC microgrid.To obtain the reconstructed signal by the DMD, it is necessary to first sample the voltage and current of the DC microgrid in the normal (fault-free) working mode.These samples are stored inside the IED installed in the DC bus of the microgrid to be used in different conditions to generate the reconstructed signal.In the next step, during the operation time of the microgrid, the IED constantly samples the voltage and current signals of the microgrid, and a new signal is created using the new samples and the previous samples that were measured under the normal operation conditions of the microgrid.Figures 1 and 2 show the signals sampled during the normal operation of the network and the time of fault occurrence in the DC microgrid, respectively.It should be noted that the oscillations created in these figures are due to the non-ideal modeling of AC/DC and DC/DC converters.In the next step, it is necessary to take RMS from the sampled signals.Then, the sampled signals are formed in the form of matrices presented in Equations ( 1)-(3) [44,45].In the next step, it is necessary to take RMS from the sampled signals.Then, the sampled signals are formed in the form of matrices presented in Equations ( 1)-(3) [44,45].
where X is the input data matrix, whose columns are sampled with different numbers of data.Also, X 1 and X 2 are the matrices constructed from the input matrix.It should be noted that X 2 is a time-shifted matrix [45].where X is the input data matrix, whose columns are sampled with different numbers of data.Also, 1 X and 2 X are the matrices constructed from the input matrix.It should be noted that 2 X is a time-shifted matrix [45].Next, to reduce the complexity of the problem, the dimensions of the problem (order of data) need to be reduced by the single value decomposition method.Therefore, the decomposition of the single value of the matrix 1 X is shown in Equation ( 4) [44].
where U and V are unit matrices and S is a diagonal matrix of single data.There- fore, the low-order matrices of the matrices presented in Equations ( 1)-( 3) are obtained by using Equations ( 5)-( 7) [45].
(1: ,1: ) (1: ,1: ) (1: ,1: ) where r is the order of reduction.It should be noted that in this paper, the value of r is considered equal to 1.
In the following, in order to obtain the eigenvalues, Koopman's approximation operator has been used [45].Next, to reduce the complexity of the problem, the dimensions of the problem (order of data) need to be reduced by the single value decomposition method.Therefore, the decomposition of the single value of the matrix X 1 is shown in Equation ( 4) [44].
where U and V are unit matrices and S is a diagonal matrix of single data.Therefore, the low-order matrices of the matrices presented in Equations ( 1)-( 3) are obtained by using Equations ( 5)-( 7) [45].
S r = S(1 : r, 1 : r) where r is the order of reduction.It should be noted that in this paper, the value of r is considered equal to 1.
In the following, in order to obtain the eigenvalues, Koopman's approximation operator has been used [45].
Sustainability 2023, 15, 16269 6 of 24 where ∼ B is the low-order approximation of the system matrix.Using this matrix and based on Equation (12), eigenvalues and eigenvectors are obtained [44].
where Λ and W are the eigenvalue and eigenvector, respectively.Based on this, the eigenvector matrix is displayed in Equation ( 13).Also, Equation ( 14) shows the eigenvalue matrix, which is a diagonal matrix [44,45].
The modes obtained from DMD correspond to the eigenvector.For this purpose, the order of these modes is calculated from Equation (15).Also, Equation ( 16) shows the matrix of these modes [44].
where Φ k ∀ k = 1, . . ., r is the eigenvalue vector, which is sometimes called the exact mode of DMD [44].
A circle with the radius 2π is used in order to detect disturbance conditions.For this purpose, if the eigenvalue is placed inside this circle (Figure 3), it means that the network is in normal mode.On the other hand, if the obtained eigenvalue is outside the mentioned circle (Figure 4), it indicates the occurrence of disturbance in the network.where is the low-order approximation of the system matrix.Using this matrix and based on Equation (12) , eigenvalues and eigenvectors are obtained [44].
where Λ and W are the eigenvalue and eigenvector, respectively.
Based on this, the eigenvector matrix is displayed in Equation ( 13).Also, Equation ( 14) shows the eigenvalue matrix, which is a diagonal matrix [44,45].
The modes obtained from DMD correspond to the eigenvector.For this purpose, the order of these modes is calculated from Equation (15).Also, Equation ( 16) shows the matrix of these modes [44].
where 1,..., is the eigenvalue vector, which is sometimes called the exact mode of DMD [44].
A circle with the radius 2π is used in order to detect disturbance conditions.For this purpose, if the eigenvalue is placed inside this circle (Figure 3), it means that the network is in normal mode.On the other hand, if the obtained eigenvalue is outside the mentioned circle (Figure 4), it indicates the occurrence of disturbance in the network.In the next step, in order to detect the fault in the DC microgrid, it is necessary to reconstruct the sampled signals in the normal state and in the fault condition.To obtain the reconstructed matrix, a coefficient is needed that shows the internal conditions of the input matrix.This coefficient is calculated based on the eigenvalue vector presented in Equation (17).conditions of the 1 X matrix.In the next step, to create the reconstructed signal based on voltage and current, the dynamic time ( v ) is calculated according to what is presented in Equation ( 18) [43,45].
( ) where j is the mode index and v is called dynamic time.Finally, using the discrete Fourier transform presented in Equation ( 19), the reconstructed matrix is obtained.Figure 5 shows the reconstructed signal by DMD in normal network conditions and in fault conditions [44,45].The data sampled in normal network conditions as well as in the conditions when a fault occurred in the network have been individually reconstructed by DMD.Then, the values obtained from both modes have been converted into a signal according to Equation (20).In the next step, in order to detect the fault in the DC microgrid, it is necessary to reconstruct the sampled signals in the normal state and in the fault condition.To obtain the reconstructed matrix, a coefficient is needed that shows the internal conditions of the input matrix.This coefficient is calculated based on the eigenvalue vector presented in Equation ( 17).
where b is the decomposition coefficient of the dynamic mode and indicates the internal conditions of the X 1 matrix.In the next step, to create the reconstructed signal based on voltage and current, the dynamic time (v) is calculated according to what is presented in Equation ( 18) [43,45].
where j is the mode index and v is called dynamic time.
Finally, using the discrete Fourier transform presented in Equation ( 19), the reconstructed matrix is obtained.Figure 5 shows the reconstructed signal by DMD in normal network conditions and in fault conditions [44,45].
Sustainability 2023, 15, x FOR PEER REVIEW 7 of 23 where b is the decomposition coefficient of the dynamic mode and indicates the internal conditions of the 1 X matrix.In the next step, to create the reconstructed signal based on voltage and current, the dynamic time ( v ) is calculated according to what is presented in Equation ( 18) [43,45].
where j is the mode index and v is called dynamic time.Finally, using the discrete Fourier transform presented in Equation ( 19), the reconstructed matrix is obtained.Figure 5 shows the reconstructed signal by DMD in normal network conditions and in fault conditions [44,45].The data sampled in normal network conditions as well as in the conditions when a fault occurred in the network have been individually reconstructed by DMD.Then, the values obtained from both modes have been converted into a signal according to Equation ( 20).The data sampled in normal network conditions as well as in the conditions when a fault occurred in the network have been individually reconstructed by DMD.Then, the values obtained from both modes have been converted into a signal according to Equation (20).
where X DMD_Normal is the reconstructed signal in the normal conditions of the microgrid Also, X DMD_Fault is the reconstructed signal by DMD when the fault occurred in the microgrid.
As stated at the beginning of this section, in order to detect the fault in the DC microgrid, it is necessary to calculate the IF value of the reconstructed signal by the DMD.For this purpose, an algorithm based on the Hilbert transform has been used to calculate IF.The Hilbert transform for continuous data can be calculated through Equation ( 21) [46].
Equation ( 21) is suitable for use in continuous data.To use the Hilbert transform for discrete data, the algorithm presented in [46] should be used.In this algorithm, discrete data are first transferred to the domain and frequency space with the help of the fast Fourier transform.To achieve the Hilbert transform, this step involves multiplying by a homogeneous function with a vertical constant value.Finally, in order to return to the domain and time mode, the inverse function of the Fourier transform is used.After applying the Hilbert transform to the instantaneous frequency signal, it can be calculated from Equation (22) [46].
where F S is the sampling frequency and is considered 10 kHz in this paper.Finally, the output obtained from DMD-IF is compared with the threshold values.If the obtained DMD-IF value exceeds the threshold values, a fault is detected.Based on this, the fault detection condition can be expressed based on Equation (23).
In general, the algorithm of the proposed method is shown in Figure 6.Basically, the proposed method starts from the sampling voltage and current signals.In the next step, by reducing the rank of the matrices through SVD, the problem has been improved, and its solution has become easier.Then, by calculating the eigenmodes of DMD, a single signal is reconstructed from the voltage and current.Finally, in order to detect the fault in the microgrid, the reconstructed signal has been evaluated using the Hilbert transform and instantaneous frequency.Thus, if the calculated value is greater than one of the predetermined threshold values, a fault will be detected.

Calculation of Threshold Values
The proposed method for fault detection in the DC microgrid requires the proper determination of threshold values.These threshold values are obtained by performing different numerical simulations based on the method described in [47].

Calculation of Threshold Values
The proposed method for fault detection in the DC microgrid requires the proper determination of threshold values.These threshold values are obtained by performing different numerical simulations based on the method described in [47].
As shown in Figure 7a,b, when the fault occurs in EV and PV sources, the currents produced by these sources flow towards the fault.As a result, the current direction at the location where the current and voltage signal is sampled (IED) is reduced.Meanwhile, according to Figure 7c, when a fault occurs in the DC bus, the current and voltage increase due to the presence of DG resources in the network that cause all microgrid currents to move towards the fault location.For this purpose, and to protect the DC microgrid with only one IED, it is necessary to use two threshold values ( 1k and 2 k ) for fault detection.As shown in Figure 7a,b, when the fault occurs in EV and PV sources, the currents produced by these sources flow towards the fault.As a result, the current direction at the location where the current and voltage signal is sampled (IED) is reduced.Meanwhile, according to Figure 7c, when a fault occurs in the DC bus, the current and voltage increase due to the presence of DG resources in the network that cause all microgrid currents to move towards the fault location.For this purpose, and to protect the DC microgrid with only one IED, it is necessary to use two threshold values (k 1 and k 2 ) for fault detection.In order to calculate the values of 1 k and 2 k , the effect of noise, generation uncer- tainties, and the effects of the control system should also be considered.For this purpose, different types of faults are simulated according to Table 1.Next, according to the algorithm presented in Figure 8, DMD-IF values will be calculated for all situations.Finally, the measured values were compared with each other, and the lowest and highest DMD-IF values obtained from all the study cases presented in  In order to calculate the values of k 1 and k 2 , the effect of noise, generation uncertainties, and the effects of the control system should also be considered.For this purpose, different types of faults are simulated according to Table 1.Next, according to the algorithm presented in Figure 8, DMD-IF values will be calculated for all situations.Finally, the measured values were compared with each other, and the lowest and highest DMD-IF values obtained from all the study cases presented in Table 1 were selected.Considering a tolerance, the threshold values in this paper are determined as k 1 = 2.70 and k 2 = −3.90,respectively.

Sample Network
The structure of the sample DC microgrid is shown in Figure 9.The presented DC microgrid includes EV/PV systems and hybrid energy storage systems including batteries and flywheels.In order to consider the various uncertainties and effects of the control system, the hierarchical control system presented in [48] has been fully implemented.In addition, the sample microgrid shown in Figure 9 has AC/DC and DC/DC converters and AC and DC loads.Also, this microgrid has the ability to connect to the network (gridconnected mode) through the SW switch.
The sample microgrid is a two-wire DC system that includes four lines (L1-L4).The cross-section of each line is a 240 mm 2 aluminum cable with PVC insulation type A and PVC sheath type ST-1 [49].The information of this microgrid is shown in Table 2.It should be noted that this microgrid is simulated in the MATLAB/Simulink environment.Also, the proposed protection algorithm is implemented in the MATLAB m file.

Sample Network
The structure of the sample DC microgrid is shown in Figure 9.The presented DC microgrid includes EV/PV systems and hybrid energy storage systems including batteries and flywheels.In order to consider the various uncertainties and effects of the control system, the hierarchical control system presented in [48] has been fully implemented.In addition, the sample microgrid shown in Figure 9 has AC/DC and DC/DC converters and AC and DC loads.Also, this microgrid has the ability to connect to the network (grid-connected mode) through the SW switch.

PG Fault Detection in the Islanded Operational Mode of the Sample DC Microgrid
In order to analyze the ability of the proposed method in detecting different ty faults in islanded DC microgrids, in this section, by opening the SW switch, the pro method will be evaluated.

PG Fault Detection in the DC Microgrid Main Bus
In order to evaluate the performance of the proposed method in detecting PG in a DC microgrid, PG faults with impedances of 1.5, 2.5, 5, 10, 20, and 25 ohms in t bus of the sample microgrid (fault F1) have been simulated.The time of the occurr all types of faults is considered t = 6 s. Figure 10 shows the results of the simula these study cases.As is clear from this figure, the proposed method has successfu tected the PG fault with different impedances.As is clear from Figure 10, before ap the fault at time t = 6 s, transient states are created in the output of the proposed m The sample microgrid is a two-wire DC system that includes four lines (L1-L4).The cross-section of each line is a 240 mm 2 aluminum cable with PVC insulation type A and PVC sheath type ST-1 [49].The information of this microgrid is shown in Table 2.It should be noted that this microgrid is simulated in the MATLAB/Simulink environment.Also, the proposed protection algorithm is implemented in the MATLAB m file.

PG Fault Detection in the Islanded Operational Mode of the Sample DC Microgrid
In order to analyze the ability of the proposed method in detecting different types of faults in islanded DC microgrids, in this section, by opening the SW switch, the proposed method will be evaluated.

PG Fault Detection in the DC Microgrid Main Bus
In order to evaluate the performance of the proposed method in detecting PG faults in a DC microgrid, PG faults with impedances of 1.5, 2.5, 5, 10, 20, and 25 ohms in the DC bus of the sample microgrid (fault F1) have been simulated.The time of the occurrence of all types of faults is considered t = 6 s. Figure 10 shows the results of the simulation of these study cases.As is clear from this figure, the proposed method has successfully detected the PG fault with different impedances.As is clear from Figure 10, before applying the fault at time t = 6 s, transient states are created in the output of the proposed method.These transient states are related to the uncertainties considered in this paper.As is clear, the proposed method did not perform wrongly for the transient states that occurred.These transient states are related to the uncertainties considered in this paper.As is clear, the proposed method did not perform wrongly for the transient states that occurred.Table 3 shows the results of analyzing the PG fault in the DC microgrid main bus.As is clear from this table, the proposed method has a successful performance in detecting PG faults in the main DC bus in less than 1 ms.In this section, the performance of the proposed method will be investigated when Table 3 shows the results of analyzing the PG fault in the DC microgrid main bus.As is clear from this table, the proposed method has a successful performance in detecting PG faults in the main DC bus in less than 1 ms.In this section, the performance of the proposed method will be investigated when the PG fault occurs in PV and EV.For this purpose, a PG fault with impedances of 1.5, 2.5, 5, and 10 ohms in PV and EV (faults F3 and F2) has been simulated at the t = 6 s.Figures 11 and 12 show the performance of the proposed method, respectively.As is clear from these figures, the calculated DMD-IF exceeded the threshold value in all cases, and the F2 and F3 faults were correctly detected.Tables 4 and 5 show the DMD-IF peak value and fault detection time by the proposed method when the PG fault occurs in PV and EV, respectively.From these tables, it is clear that the proposed method can correctly detect all types of faults in the PV section in less than 1 ms, as well as faults in the EV section in 2 ms.Tables 4 and 5 show the DMD-IF peak value and fault detection time by the propos method when the PG fault occurs in PV and EV, respectively.From these tables, it is cle  The probability of a PP fault in a DC microgrid is much lower than that of a PG fault; nevertheless, the occurrence of this type of fault can cause serious damage to different parts of a DC microgrid [50].For this reason, it is necessary to detect this type of fault quickly.For this reason, all types of PP faults with impedances of 1.5, 2.5, 5, and 10 ohms are simulated in the DC bus of the sample microgrid (fault F1).The time of the occurrence of all types of faults is considered as t = 6 s. Figure 13 shows the results of the simulation of this case study.As is clear from this figure, the proposed method has performed correctly against the PP fault with different impedances.
Similar to PG faults, the proposed method has also detected PP faults in less than 1 ms.The results of this study are presented in Table 6.nevertheless, the occurrence of this type of fault can cause serious damage to different parts of a DC microgrid [50].For this reason, it is necessary to detect this type of fault quickly.For this reason, all types of PP faults with impedances of 1.5, 2.5, 5, and 10 ohms are simulated in the DC bus of the sample microgrid (fault F1).The time of the occurrence of all types of faults is considered as t = 6 s. Figure 13 shows the results of the simulation of this case study.As is clear from this figure, the proposed method has performed correctly against the PP fault with different impedances.Similar to PG faults, the proposed method has also detected PP faults in less than 1 ms.The results of this study are presented in Table 6.

PP Fault Detection in PV and EV
Similar to the PG fault, it is necessary to check the performance of the proposed method against the types of PP faults in PV and EV.For this reason, a PP fault with impedances of 1.5, 2.5, 5, and 10 ohms in PV and EV (faults F3 and F2) has been simulated at t = 6 s. Figure 14 shows the performance of the proposed method when a PP fault occurs in the PV part, and Figure 15 shows this performance when a PP fault occurs in the EV part.As is clear from these figures, the calculated DMD-IF exceeded the threshold value in all cases, and the faults that occurred were correctly detected.
Tables 7 and 8 show the DMD-IF peak value and fault detection time by the proposed method when PP faults occur in PV and EV, respectively.Similar to the PG fault, it is necessary to check the performance of the propos method against the types of PP faults in PV and EV.For this reason, a PP fault with i pedances of 1.5, 2.5, 5, and 10 ohms in PV and EV (faults F3 and F2) has been simulated t = 6 s. Figure 14 shows the performance of the proposed method when a PP fault occ in the PV part, and Figure 15 shows this performance when a PP fault occurs in the part.As is clear from these figures, the calculated DMD-IF exceeded the threshold va in all cases, and the faults that occurred were correctly detected.Tables 7 and 8 show the DMD-IF peak value and fault detection time by the propos method when PP faults occur in PV and EV, respectively.

Analyzing the Proposed Method in Detecting Different Types of Faults in the Grid-Connected Mode of the Sample DC Microgrid
In order to analyze the ability of the proposed method to detect different types of fau in the grid-connected mode of DC microgrids, in this section, by closing the SW switch (Fi ure 9), the proposed method will be evaluated.Therefore, two PG and PP faults with a 1 ohm impedance have been applied to the main bus of the sample DC microgrid in Figure Figure 16 shows the results of this investigation.As can be seen from this figure, at the tim of the faults, the calculated DMD-IF value exceeded the threshold value, and the faults we correctly detected.This is despite the fact that, during the occurrence of common transien in the DC microgrid (before the PP fault in 2 to 4 s of the simulation), the DMD-IF signal d  In order to analyze the ability of the proposed method to detect different types of faults in the grid-connected mode of DC microgrids, in this section, by closing the SW switch (Figure 9), the proposed method will be evaluated.Therefore, two PG and PP faults with a 1.5 ohm impedance have been applied to the main bus of the sample DC microgrid in Figure 9. Figure 16 shows the results of this investigation.As can be seen from this figure, at the time of the faults, the calculated DMD-IF value exceeded the threshold value, and the faults were correctly detected.This is despite the fact that, during the occurrence of common transients in the DC microgrid (before the PP fault in 2 to 4 s of the simulation), the DMD-IF signal did not exceed the threshold value, and these transient states were not detected as faults.
part of the DC microgrid.

Analyzing the Proposed Method in Detecting Different Types of Faults in the Grid-Connected Mode of the Sample DC Microgrid
In order to analyze the ability of the proposed method to detect different types of faults in the grid-connected mode of DC microgrids, in this section, by closing the SW switch (Figure 9), the proposed method will be evaluated.Therefore, two PG and PP faults with a 1.5 ohm impedance have been applied to the main bus of the sample DC microgrid in Figure 9. Figure 16 shows the results of this investigation.As can be seen from this figure, at the time of the faults, the calculated DMD-IF value exceeded the threshold value, and the faults were correctly detected.This is despite the fact that, during the occurrence of common transients in the DC microgrid (before the PP fault in 2 to 4 s of the simulation), the DMD-IF signal did not exceed the threshold value, and these transient states were not detected as faults.

Investigating the Effect of Noise on the Proposed Method
It is practically impossible to consider an ideal system without noise [51].Also, the presence of noise in the signal can always have many adverse effects on fault detection methods.For this reason, the effects of noise on fault detection methods should be investigated.For this purpose, all the cases examined in the previous sections have been examined for PP and PG faults by adding white Gaussian noise with SNR = 35 dB.The results of this investigation are presented for PG faults in Figure 17 and for PP faults in Figure 18 for the islanded DC microgrid.As is clear from these two figures, the proposed method has shown correct performance when the signal is noisy.It is practically impossible to consider an ideal system without noise [51].Also, the presence of noise in the signal can always have many adverse effects on fault detection methods.For this reason, the effects of noise on fault detection methods should be investigated.For this purpose, all the cases examined in the previous sections have been examined for PP and PG faults by adding white Gaussian noise with SNR = 35 dB.The results of this investigation are presented for PG faults in Figure 17 and for PP faults in Figure 18 for the islanded DC microgrid.As is clear from these two figures, the proposed method has shown correct performance when the signal is noisy.

Fault Detection without Battery Energy Storage Systems
The possibility of energy storage systems leaving the microgrid is very common.For this reason, in this section, the performance of the proposed method is investigated without the presence of some energy storage systems.For this purpose, the batteries connected to L1 are removed from the network.Therefore, various types of PG faults with different impedances are placed on the main bus of the DC microgrid.Figure 19 shows the results of this investigation.As is clear from this figure, the value of DMD-IF is between two threshold values in the grid-connected mode of the microgrid, but when a fault occurs, the threshold value is violated and the fault is correctly detected.

Fault Detection without Battery Energy Storage Systems
The possibility of energy storage systems leaving the microgrid is very common.this reason, in this section, the performance of the proposed method is investigated w out the presence of some energy storage systems.For this purpose, the batteries connec to L1 are removed from the network.Therefore, various types of PG faults with differ impedances are placed on the main bus of the DC microgrid.Figure 19 shows the resu of this investigation.As is clear from this figure, the value of DMD-IF is between t threshold values in the grid-connected mode of the microgrid, but when a fault occu the threshold value is violated and the fault is correctly detected.

Comparison with Other Fault Detection Methods in the DC Microgrid
In many studies, the effect of noise on fault detection is not considered.In some stu ies, this issue may cause a wrong performance in fault detection when the signal is no

Comparison with Other Fault Detection Methods in the DC Microgrid
In many studies, the effect of noise on fault detection is not considered.In some studies, this issue may cause a wrong performance in fault detection when the signal is noisy.To investigate the mentioned problem, the method presented in [52] was used.This method uses differential protection for fault detection.To investigate this method, the sampled signals have been applied once without considering the noise and again by applying white Gaussian noise with SNR = 35 dB to the protection algorithm presented in [52].Figure 20 shows the results of the evaluations.As is clear from this figure, the method presented in [52] has performed properly in the network without noise in normal conditions, but if the signal becomes noisy, it will issue the trip command in normal conditions.Although single-threshold overcurrent (OC) methods have shown good performances in different conditions, the use of these methods requires the use of a large number of IEDs in a microgrid.It is known that the use of several IEDs in a single-bus microgrid will increase the construction and operation costs.For example, the authors have tried to simulate the single-threshold OC method.According to the OC methods, the threshold value is 1.2 times the microgrid current.Figure 21 shows the performance of the singlethreshold OC method when a fault occurs on the main bus of the microgrid.Although this figure shows the correct performance of this method in fault detection, by considering that the main purpose of this paper is using an IED to protect the DC single-bus microgrid, OC methods should be able to detect faults in other parts of the microgrid as well.For this reason, in Figure 22, the results of the OC method are presented for the occurrence of faults in the EV part.As is shown, this method does not have the ability to detect faults in different parts of the microgrid.Finally, in order to conduct a comprehensive review, the method proposed in this paper has been compared with [6,34,[53][54][55] in Table 9.As is clear from this table, the proposed method has worked successfully in different conditions.Finally, in order to conduct a comprehensive review, the method proposed in this paper has been compared with [6,34,[53][54][55] in Table 9.As is clear from this table, the proposed method has worked successfully in different conditions.Finally, in order to conduct a comprehensive review, the method proposed in this paper has been compared with [6,34,[53][54][55] in Table 9.As is clear from this table, the proposed method has worked successfully in different conditions.

Conclusions
In this paper, a fault detection method in a single-bus DC microgrid isolated from the grid with an IED and using the combined DMD-IF method is presented.The proposed method has been tested using a DC microgrid with a complete control system simulated in Simulink MATLAB.The results of the test of the proposed method indicate that the DMD-IF method is a very fast method in detecting all types of faults (PG and PP).In addition, the method has the ability to detect faults in different locations of the DC microgrid, including the main DC bus, EV, and PV.Also, this method is able to detect different types of faults by considering the effect of Gaussian white noise.The comparison shows the superiority of the proposed method over the existing methods.
Today, there are different types of storage systems, and researchers can focus on the effect of the presence of these storage devices on the protection methods of DC microgrids.In addition, it is very important to consider the effects of wind turbines in future research.

Figure 1 .
Figure 1.Sampled signals of voltage and current under normal network conditions.

Figure 1 .
Figure 1.Sampled signals of voltage and current under normal network conditions.

Figure 2 .
Figure 2. Sampled signals of voltage and current under fault conditions.

Figure 2 .
Figure 2. Sampled signals of voltage and current under fault conditions.

Figure 3 .
Figure 3. Generated eigenvector under normal network conditions.

Figure 3 .
Figure 3. Generated eigenvector under normal network conditions.

Figure 4 .
Figure 4. Generated eigenvector under disturbance in the network.

Figure 5 .
Figure 5.The reconstructed signal (a) in normal network conditions (b) in fault conditions.

Figure 4 .
Figure 4. Generated eigenvector under disturbance in the network.

Figure 4 .
Figure 4. Generated eigenvector under disturbance in the network.

Figure 5 .
Figure 5.The reconstructed signal (a) in normal network conditions (b) in fault conditions.

Figure 5 .
Figure 5.The reconstructed signal (a) in normal network conditions (b) in fault conditions.

Figure 6 .
Figure 6.Algorithm of the proposed method.

Figure 6 .
Figure 6.Algorithm of the proposed method.

Figure 7 .
Figure 7. Voltage and current sampled by the IED when a fault occurred (a) in EV, (b) in PV, and (c) in the DC bus.

Figure 7 .
Figure 7. Voltage and current sampled by the IED when a fault occurred (a) in EV, (b) in PV, and (c) in the DC bus.

Figure 8 .
Figure 8. Proposed algorithm for determining threshold values.

Figure 8 .
Figure 8. Proposed algorithm for determining threshold values.

Figure 10 .
Figure 10.The performance of the proposed method during the occurrence of PG faults in the DC microgrid main bus.

Figure 10 .
Figure 10.The performance of the proposed method during the occurrence of PG faults in the DC microgrid main bus.

Sustainability 2023 ,
15,  x FOR PEER REVIEW 14 of these figures, the calculated DMD-IF exceeded the threshold value in all cases, and the and F3 faults were correctly detected.

Figure 11 .
Figure 11.The performance of the proposed method during the occurrence of PG faults in the part of the DC microgrid.

Figure 11 .
Figure 11.The performance of the proposed method during the occurrence of PG faults in the PV part of the DC microgrid.

Table 4 .Table 5 .Figure 11 .
Figure 11.The performance of the proposed method during the occurrence of PG faults in the part of the DC microgrid.

Figure 12 .
Figure 12.The performance of the proposed method during the occurrence of PG faults in the part of the DC microgrid.

Figure 12 .
Figure 12.The performance of the proposed method during the occurrence of PG faults in the EV part of the DC microgrid.

3. 3 .
PP Fault Detection in the Islanded Operational Mode of the Sample DC Microgrid 3.3.1.PP Fault Detection in the DC Microgrid Main Bus

Figure 13 .
Figure 13.The performance of the proposed method during the occurrence of PP faults in the DC microgrid main bus.

Figure 13 .
Figure 13.The performance of the proposed method during the occurrence of PP faults in the DC microgrid main bus.

Figure 14 .
Figure 14.The performance of the proposed method during the occurrence of PP faults in the part of the DC microgrid.

Figure 14 .Figure 15 .
Figure 14.The performance of the proposed method during the occurrence of PP faults in the PV part of the DC microgrid.Sustainability 2023, 15, x FOR PEER REVIEW 17 of

Figure 15 .
Figure 15.The performance of the proposed method during the occurrence of PP faults in the EV part of the DC microgrid.

3. 4 .
Analyzing the Proposed Method in Detecting Different Types of Faults in the Grid-Connected Mode of the Sample DC Microgrid

Figure 16 .
Figure 16.The performance of the proposed method during the occurrence of PG and PP faults in the DC microgrid main bus (in the grid-connected mode).

Figure 16 .
Figure 16.The performance of the proposed method during the occurrence of PG and PP faults in the DC microgrid main bus (in the grid-connected mode).

Figure 17 .
Figure 17.The performance of the proposed method during the occurrence of PG faults in different parts of the DC microgrid with white Gaussian noise.

Figure 17 .
Figure 17.The performance of the proposed method during the occurrence of PG faults in different parts of the DC microgrid with white Gaussian noise.

Figure 17 .
Figure 17.The performance of the proposed method during the occurrence of PG faults in different parts of the DC microgrid with white Gaussian noise.

Figure 18 .
Figure 18.The performance of the proposed method during the occurrence of PP faults in different parts of the DC microgrid with white Gaussian noise.Figure 18.The performance of the proposed method during the occurrence of PP faults in different parts of the DC microgrid with white Gaussian noise.

Figure 18 .
Figure 18.The performance of the proposed method during the occurrence of PP faults in different parts of the DC microgrid with white Gaussian noise.Figure 18.The performance of the proposed method during the occurrence of PP faults in different parts of the DC microgrid with white Gaussian noise.
Sustainability 2023, 15, x FOR PEER REVIEW 19 o

Figure 19 .
Figure 19.The performance of the proposed method during the occurrence of PG faults in the microgrid without batteries.

Figure 19 .
Figure 19.The performance of the proposed method during the occurrence of PG faults in the DC microgrid without batteries.

Sustainability 2023 ,
15,  x FOR PEER REVIEW 20 of 23 faults in the EV part.As is shown, this method does not have the ability to detect faults in different parts of the microgrid.

Figure 20 .
Figure 20.Evaluation of the method presented in [52]: (a) signal without noise and (b) signal with noise.

Figure 21 .
Figure 21.The performance of the OC method during the occurrence of PG and PP faults in the DC microgrid main bus (Figure 9).

Figure 22 .
Figure22.The performance of the OC method during the occurrence of PG and PP faults in the EV part of the DC microgrid (Figure9).

Figure 20 .
Figure 20.Evaluation of the method presented in [52]: (a) signal without noise and (b) signal with noise.

Figure 20 .
Figure 20.Evaluation of the method presented in [52]: (a) signal without noise and (b) signal with noise.

Figure 21 .
Figure 21.The performance of the OC method during the occurrence of PG and PP faults in the DC microgrid main bus (Figure 9).

Figure 22 .
Figure 22.The performance of the OC method during the occurrence of PG and PP faults in the EV part of the DC microgrid (Figure 9).

Figure 21 .
Figure 21.The performance of the OC method during the occurrence of PG and PP faults in the DC microgrid main bus (Figure 9).

Figure 20 .
Figure 20.Evaluation of the method presented in [52]: (a) signal without noise and (b) signal with noise.

Figure 21 .
Figure 21.The performance of the OC method during the occurrence of PG and PP faults in the DC microgrid main bus (Figure 9).

Figure 22 .
Figure 22.The performance of the OC method during the occurrence of PG and PP faults in the EV part of the DC microgrid (Figure 9).

Figure 22 .
Figure 22.The performance of the OC method during the occurrence of PG and PP faults in the EV part of the DC microgrid (Figure 9).

Table 1
were selected.Considering a tolerance, the threshold values in this paper are determined as 1 2.70

Table 1 .
Study cases for calculating the threshold values.

Table 1 .
Study cases for calculating the threshold values.

Table 3 .
The results of the detection of PG faults in the DC microgrid main bus.

Table 3 .
The results of the detection of PG faults in the DC microgrid main bus.

Table 6 .
The results of the detection of PP faults in the DC microgrid main bus.

Table 7 .
The results of the detection of PP faults in the PV part of the DC microgrid.

Table 8 .
The results of the detection of PP faults in the EV part of the DC microgrid.

Table 7 .
The results of the detection of PP faults in the PV part of the DC microgrid.

Table 8 .
The results of the detection of PP faults in the EV part of the DC microgrid.

Table 9 .
Comparison of the proposed method with other studies.