DC Series Arc Detection Algorithm Based on Adaptive Moving Average Technique

This paper proposes a DC series arc detection algorithm in a photovoltaic (PV) system using an adaptive moving average (AMA). The proposed algorithm uses two moving averages of <inline-formula> <tex-math notation="LaTeX">$F_{av}$ </tex-math></inline-formula> which is the average of 5 kHz to 40 kHz frequency band. One is <inline-formula> <tex-math notation="LaTeX">${MA}_{small}$ </tex-math></inline-formula> which is the moving average highly affected by recent <inline-formula> <tex-math notation="LaTeX">$F_{av}$ </tex-math></inline-formula>. The other is <inline-formula> <tex-math notation="LaTeX">${MA}_{large}$ </tex-math></inline-formula> which is the moving average heavily affected by past <inline-formula> <tex-math notation="LaTeX">$F_{av}$ </tex-math></inline-formula>. There is a little difference between <inline-formula> <tex-math notation="LaTeX">${MA}_{small}$ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">${MA}_{large}$ </tex-math></inline-formula> before arcing because <inline-formula> <tex-math notation="LaTeX">$F_{av}$ </tex-math></inline-formula> is approximately constant. However, this difference increases when the arc occurs because <inline-formula> <tex-math notation="LaTeX">${MA}_{large}$ </tex-math></inline-formula> slowly follows <inline-formula> <tex-math notation="LaTeX">${MA}_{small}$ </tex-math></inline-formula>. This difference is used as an arc detection indicator (ADI) in this study. Additionally, AMA is proposed to avoid nuisance tripping in the normal transient state. The proposed method determines the arc occurrence using the relative magnitudes of the two moving averages. Therefore, it is less affected by the shape of the frequency fluctuations caused by the load inverter. Hence, the proposed algorithm is effective in the centralized and spread-type of frequency fluctuations. These results were verified through an arc detection test and nuisance tripping test using arc experimental data and MATLAB.


I. INTRODUCTION
There are an increasing interest and dependence on renewable energy due to the increase in environmental pollution and the depletion of fossil fuels. Specifically, the photovoltaic (PV) system-a power generation system using solar energy-is installed at various places, including households and public facilities, due to its higher degree of freedom in power scale than other renewable energy sources [1]. However, as the scale of the PV system increases, the risk of an accident due to arc occurrence also increases. Arc accidents are characterized by the emission of light and heat due to the dielectric breakdown of gas. These arc accidents are classified into AC arc and DC arc. AC arc is an arc that occurs in an AC currentcarrying conductor. On the other hand, a DC arc is an arc that is generated in a conductor in which DC current flows. There is a possibility for an AC arc to be extinguished by itself because there is a moment when the current periodically becomes zero. However, a DC arc does not get extinguished The associate editor coordinating the review of this manuscript and approving it for publication was Chi-Seng Lam . by itself because the magnitude of the current does not become zero. Therefore, an additional blocking method is required [2], [3].
DC arcs are classified into a series arc, parallel arc, and ground arc. Series arc occurs between conductors with the same potential. However, parallel arc occurs between conductors with different potentials. Moreover, a ground arc refers to an arc that occurs between conductors and ground. Parallel and ground arcs can block the arc using conventional circuit breakers because the magnitude of the current largely increases in an accident. However, in the case of the series arc, it is not easy to block with the conventional breaker because the magnitude of the DC component of the current does not change large enough to operate the circuit breaker [4], [5].
The method using frequency-domain characteristics utilizes the frequency components of the current flowing in the conductor connecting the DC source to the load [2], [4], [12] or the capacitor installed on the output side of the DC source [13]. These frequency components of the current increase when the DC series arc occurs [29]. Using this characteristic, conventional methods using the frequencydomain detect the DC series arc by setting the average of the frequency band that increases when the DC series arc occurs as an arc detection indicator (ADI). However, there are frequency fluctuation components even in the non-arcing state due to the switching operation of the load inverter. Because the frequency band used as ADI overlaps with the band of frequency fluctuations that exist in the nonarcing state, these frequency fluctuations interfere with the arc detection and cause a nuisance tripping. A technique to reduce the influence of frequency fluctuations on the arc detection algorithm has been proposed [2], [4], [12]. However, this technique selectively reduces only a small number of remarkably large frequency components. Hence, it is effective when the frequency fluctuation is a centralized type but is ineffective when it is a spread type. The centralized type of frequency fluctuations is caused by the inverter with a constant switching frequency. Also, the spread type of frequency fluctuations is generated when the inverter with nonconstant switching frequency is connected [30] or inverters with constant switching frequency are connected in parallel. Therefore, since there can be various inverters as the load of the PV system, an algorithm that can effectively detect the DC series arc regardless of the type of frequency fluctuations is required.
In this paper, moving averages of a specific frequency band are used to develop the DC series arc detection technique that is effective for both centralized and spread type frequency fluctuations. In the proposed technique, ADI for the DC series arc detection is derived using F av which is the average of the 5 kHz to 40 kHz frequency band that increases characteristically when the DC series arc occurs [30]. The proposed technique uses MA small and MA large which are the moving averages of F av with different intervals to derive the proposed ADI. MA small is the moving average of F av with a small interval, which is sensitive to changes in F av . Moreover, MA large is the moving average of F av with a long interval, which is more affected by F av in the past than in the present. Since F av hardly changes before arcing, both MA small and MA large show similar values in non-arcing state. After arcing, MA small changes quickly because the change of F av is rapid. On the other hand, MA large changes slowly since MA large is the moving average of F av in the long interval. Using these characteristics, if the difference between MA small and MA large is set as ADI, the indicator approaches zero before the arc occurs, and the indicator increases after the arcing. However, this indicator can make a nuisance tripping in the normal transient state as an OFF to ON or an ON to OFF state of the load inverter. To solve this problem, in this paper, the number of F av used in the moving average calculation is adaptively changed according to the magnitude of the DC component of the load current, which is adaptive moving average (AMA). As a result, the proposed technique not only detects the DC series arc rapidly in the frequency fluctuations of the centralized type and the spread type, but also do not make the nuisance tripping in the normal transient state. These results were verified through arc detection and nuisance tripping tests using DC series arc experimental data and MATLAB. For convenience, the DC series arc is referred to as the arc in the next paragraph.

II. FREQUENCY FLUCTUATION
The frequency fluctuations are observed due to the load inverter in the PV system. When the switching frequency of the load inverter is constant, the frequency fluctuations show a centralized shape where the magnitudes of specific frequencies are prominent. The inverter controlled by a space vector modulation (SVM) shows such a centralized frequency fluctuation [31]. On the other hand, when the switching frequency of the load inverter is not constant, it shows the cluster of spread frequencies. The spread frequency fluctuation is observed in the inverters with constant switching frequency being connected in parallel, where the switching frequency of each inverter is not same or the inverter controlled by a model predictive control (MPC) [32]. Fig. 1 and Fig. 2 show examples of centralized frequency fluctuations by SVM and spread frequency fluctuations by MPC. I L in Figs. 1 and 2 means the load current of the PV system, which will be explained in the next section. The frequency distribution of the load VOLUME 9, 2021 current is analyzed by Fast Fourier transform (FFT). It can be seen that in the centralized type of frequency fluctuations, as shown in Fig. 1, a few frequencies stand alone. On the other hands, in the spread type as in Fig. 2, specific frequencies are clustered.
As mentioned in the introduction, the conventional arc detection technique using the frequency band sets the average of the frequency band that characteristically increases after arcing as ADI. In order to effectively detect the arc with the conventional ADI, ADI should approach zero before arcing, and should increase significantly after arcing. However, as can be seen from Fig. 1, there are frequency fluctuations due to the switching operation of the inverter in non-arcing state. These fluctuations cause ADI to rise before arcing. To overcome this problem, the conventional method used a technique of substituting a large frequency amplitude with a frequency average value [2], [4], [12]. However, this method is effective for the centralized frequency fluctuations, but not effective for the spread frequency fluctuations. In addition, even if the conventional frequency fluctuation mitigation technique is applied, since the noise existing in the load current before the arc is not completely removed, ADI before the arc is raised.

III. PROPOSED ARC DETECTION METHOD USING AMA A. FREQUENCY CHARACTERISTICS DURING THE ARC
This section discusses the characteristics of the load current during the arc. The arc generation circuit was constructed as shown in Fig. 3. This circuit was manufactured following UL1699B [28] which is regulation for devices that detect and block arcs in the PV systems.  is picture of the arc. In this paper, a three-phase inverter is used as the load inverter. In Fig. 3 (a), I L represents the load current. Decoupling network, module and line impedance in Fig. 3 (b) are the circuit elements between DC source and arc generator as shown in Fig. 3 (a). In order to collect load current when the arc occurs, the output voltage of the DC source is set to 300 V and the inverter is turned on. Then, the arc rods of the arc generator are separated to generate the arc. The load current at the time is saved using an oscilloscope, and frequency analysis is performed using a personal computer. When the arc is generated in the inverter load, the frequency within the 5 kHz to 40 kHz band is observed to increase irrespective of the shape of frequency fluctuations [30]. Therefore, we analyzed the characteristics of frequencies within the 5 kHz to 40 kHz band. Furthermore, FFT is employed to analyze the frequency characteristics. When FFT is performed using the load current samples within a certain time domain, the resulting value can be obtained as a matrix in the form of 1 row and L columns. Each column refers to the magnitude of each frequency bin obtained by FFT. Equation (1) shows the result of FFT expressed as a matrix.
where l = 1, 2, · · · , L, and L represents the number of columns of the FFT result matrix. In (1), fm 1 is the first column of the matrix and means the magnitude of a DC value with a zero frequency. fm 2 refers to the magnitude of F r Hz. F r is the FFT frequency resolution. Additionally, fm 3 represents the magnitude of the (2 * F r ) Hz. That is, each column of the FFT result matrix indicates the magnitude of the (l−1) * F r Hz of load current samples, where l denotes the column number. Moreover, F r is determined by the sampling rate of load current and the number of load current samples needed when calculating one FFT result. Equation (2) shows how to calculate F r .
where F s represents the sampling rate and F N means the number of load current samples for one FFT result. We performed FFT using 1024 load current samples collected at the sampling rate of 250 kHz. Therefore, the value of F r using (2) would be 244.14 Hz. In addition, L is determined to be To quantitatively determine what characteristics the frequency average in the 5 kHz to 40 kHz band has before and after the arc, the frequency average is calculated using the load current samples and FFT. The frequency average is calculated as follows: In (3), F av is the frequency average of 5 kHz to 40 kHz band. To calculate the average, the values from the 21st column to the 165th column of the FFT result were used. Since the FFT resolution used in this paper is 244.14 Hz, the 21st column of the FFT result means 4.88 kHz (=244.14 * 20), and the 165th column indicates 40.04 kHz (=244.14 * 164). Fig. 4 and Fig. 5 show F av before and after arcing according to the frequency fluctuations. Fig. 4 shows the case where the form of frequency fluctuation is the centralized type, and Fig. 5 represents the case where the shape of frequency fluctuation is the spread type. Fig. 4 and Fig. 5 show that F av increases rapidly at the starting point of the arc irrespective of the shape of the frequency fluctuation. Moreover, it can be seen that not only the magnitude of F av increases after the arc occurs, but also the rate of change of F av is greater than before the arc.
In the conventional arc detection method using frequency, the magnitude of a specific frequency band increases after arcing was used. However, Fig. 4 and Fig. 5 show that the magnitude and the rate of change of F av increase after arcing. Therefore, this paper proposes an arc detection algorithm using the rate of change of F av .

B. ARC DETECTION METHOD USING AMA
This study uses two moving averages to detect the arc using the rate of change of F av without being affected by the shape of the frequency fluctuation. Moving average is one of several techniques for analyzing data and obtaining an average calculated by moving the interval. Equation (4) shows a moving average. In (4), M means the number of data used in calculating the moving average. Also, MA(n) represents the VOLUME 9, 2021 moving average of the n-th time step. d(k) means data of the k-th time step. Fig. 6 is the concept of calculating the moving average of data. Fig. 6 shows how to calculate the moving average with M value of 3 from instantaneous data d(n). As shown in Fig. 6, since three data are needed to calculate the moving average, the moving average can be obtained sequentially from MA(3). As shown in Fig. 6, the larger the number of M used for calculating the moving average is, the more the previous data used to calculate the moving average is. Therefore, if the size of M is small, the moving average is influenced by recent data. Moreover, if the size of M is large, the moving average is more affected by past data than the recent one. Fig. 7 and Fig. 8 show the moving average result of F av when the arc occurs based on the shape of the frequency fluctuation and the value of M .
The green graph in Fig. 7 and Fig. 8 shows the value of moving average when M is equal to 1. This green graph is the same as instantaneous value of F av . Pink and blue in Fig. 7 and Fig. 8 represent the moving averages of F av when the size of M is 10 and 100, respectively. Fig. 7 shows that the value of the moving average is approximately the same irrespective of the M value before arcing. Moreover, the moving average in spread frequency fluctuation as in Fig. 8 before arcing remained approximately unchanged according to the M value. However, the absolute value of the moving average in spread frequency fluctuation is larger than that in centralized frequency fluctuation before arcing. From Fig. 7 and Fig. 8, it can be seen that the green line which is the instantaneous value of F av increases significantly after arcing. As the F av increases, the pink and blue lines also start to increase. However, while the pink line follows the green line quickly, the blue line follows the green line slowly. This is because the moving average with large M is affected by past F av than recent F av .
An effective ADI should have a large difference before and after arcing. In other words, it should approach zero before arcing and increase after arcing. From the result in Fig. 7 and Fig. 8, it can be seen that the change in the moving average value is small before the arcing, regardless of the size of the moving average interval. On the other hand, after the arc is generated, the degree of change varies according to the size of the interval of the moving average. Using these characteristics, if the difference between the moving average  with the small interval and the moving average with the large interval is set as ADI, an effective ADI can be derived. Therefore, in this paper, the following ADI is proposed as shown in (5).
In (5), ADI prop means the proposed ADI. Also, MA small is the moving average of F av with the small interval, and MA large is the moving average of F av with the large interval. In this paper, through trial and error, the intervals of MA small and MA large were set to 10 and 100, respectively. If ADI is set as in (5), it can be indirectly seen through Fig. 7 and Fig. 8 that ADI approaches 0 before the arc occurs, and ADI increases after the arc occurs, regardless of the type of frequency fluctuations. A detailed proposed ADI is presented in Fig. 14 and Fig. 15. Therefore, ADI prop can be effectively applied to spread frequency fluctuations as well as centralized frequency fluctuations.
However, because the moving average is affected by past F av , it may cause problems in the state of the load being turned on or off. If no appropriate action is taken, the arc detection algorithm using the moving average can falsely detect the arc even if the arc does not occur. Therefore, in this paper, as mentioned earlier, the interval of the moving average is adaptively adjusted to avoid the nuisance tripping in normal transient conditions, which is called AMA. In the proposed scheme for adaptive value of M , the magnitude of the DC component in the FFT result is used. First, in order to prevent the algorithm from the nuisance tripping when the condition of the load inverter changes from OFF to ON, the moving average is calculated excluding the F av result at the instant when the DC value calculated from the FFT is less than 0.5. For example, when calculating MA small , 10 F av s are needed. If the number of F av calculated at the moment when the magnitude of the DC value is less than 0.5 is 3, only 7 out of 10 are used to calculate MA small . In this case, the interval M is changed from 10 to 7. In addition, M is set to 1 if the DC component of the FFT result in latest F av is less than 0.5 to avoid the nuisance tripping of the algorithm when the condition of the load inverter changes from ON to OFF. Here, 0.5 is a standard for determining the operating state of the load inverter. In this paper, if the DC magnitude of the load current is less than 0.5, the load inverter is judged to be in the OFF state. The reason the standard for the operating state is 0.5 instead of 0 is because we take into account the noise present in the output of the current sensor. To prevent the nuisance tripping in the event of sudden change of the output power of the inverter load, The proposed technique checks the number of times ADI prop exceeds 0.002 in a row. When the number reaches 10, it is judged that the arc occurs. The threshold value of ADI prop of 0.002 is a value determined through trial and error. Fig. 9 and Fig. 10 show the flow chart of the proposed AMA calculation method.
In Fig. 9 and Fig. 10, (n) attached to each variable represents the n-th time point. Additionally, DC com (n) refers to the DC component of the FFT result obtained at the n-th time point. Moreover, M small and M large refer to the number of interval M used to calculate MA small and MA large , respectively. Fig. 11 shows the flow chart of the proposed arc detection algorithm. In Fig. 11, A num means the number of times ADI prop exceeds the threshold in succession.
In the proposed method, load current samples were collected at the sampling rate of 250 kHz. In addition, F av was calculated using 1024 samples of load current. Therefore, the time used to calculate F av is (1/250000) * 1024 ≈ 4 ms. Since MA small is calculated using 10 F av s, it takes about 40 ms to calculate MA small . Also, since MA large is obtained using 100 F av s, the time it takes to calculate MA large is about 400 ms. Therefore, it takes about 400 ms to calculate the proposed ADI prop . Also, the time required for the proposed arc detection indicator to determine the arc is about 40 ms which is the time takes for ADI prop to exceed the threshold 10 times in succession. Therefore, the time it takes for the proposed algorithm to detect the arc is about 440 ms. UL1699B which is the standard for devices that detect the arc in PV systems specifies that the arc detecting devices must detect the arc within 2.5 s [28]. Therefore, based on UL1699B, the time required for the proposed algorithm to detect the arc is relatively short.

IV. EXPERIMENTAL RESULTS
In this section, the performance of the proposed technique is verified using MATLAB and load current obtained through the arc generation circuit when the arc occurs. The proposed technique detects the arc using AMA. Hence, the arc VOLUME 9, 2021 detection performance is not affected by frequency fluctuations. The proposed technique is compared with [4]-an arc detection technique using frequency-to verify this. For convenience, the arc detection algorithm presented in [4] is called the conventional method. The performance of the arc detection algorithm is evaluated by how much ADI used in the algorithm differs before and after the arc. If the difference between ADI before and after the arc is large, the margin of the threshold value-the criterion for determining the arcis set sufficiently to reduce the risk of nuisance tripping. Fig. 12 and Fig. 13 show ADI of the conventional technique before and after the arc based on the form of frequency fluctuation.
The switching frequency of the load inverter in Fig. 12 and Fig. 13 is 20 kHz. In Fig. 12, ADI conv refers to ADI of the conventional method. Fig. 12 shows that the difference in ADI conv before and after the arc is clear for centralized frequency fluctuation. Therefore, there is no problem setting  the threshold value to determine the arc; hence, there is no fear of the nuisance tripping of the algorithm before the arc occurs. However, in Fig. 13, ADI conv before and after arcing is not as obvious as that of the centralized type. There is a greater risk of the nuisance tripping before arcing in spread frequency fluctuation than the centralized type owing to the small difference in ADI conv before and after the arcing. Fig. 14 and Fig. 15 show ADI before and after arc according to the frequency fluctuation of the proposed technique. For fair comparison, the same current samples used in Fig. 12 and Fig. 13 were used. In Fig. 14 and Fig. 15, ADI prop shows ADI of the proposed technique, which is the same as MA small − MA large . Fig. 14 and Fig. 15 show that ADI prop before and after the arc is clearer in both the  centralized and spread type of frequency fluctuations than that of the conventional method as in Fig. 12 and Fig. 13. Particularly, as shown in Fig. 13, in the conventional technique, ADI conv in the spread type of frequency fluctuation before the arc is larger than that in centralized type, so the difference in ADI conv before and after the arc is reduced. However, ADI prop in the centralized and spread fluctuations before arcing is small. Therefore, the proposed technique can efficiently detect the arc while being less affected by the shape of frequency fluctuation. In order to fairly compare ADI before and after the arc of the proposed method and the conventional method, the difference between ADI before and after the arc is compared through normalization as shown in (6).
where ADI after denotes the average of ADIs obtained for 0.5 seconds after arcing. Additionally, ADI before represents the average of ADIs for 0.5 seconds before arcing. Fig. 16 and Fig. 17 show the difference of ADI obtained through (6) of the  conventional method and the proposed method based on the switching frequency and the type of frequency fluctuations. Fig. 16 and Fig. 17 show that the difference in ADI of the proposed technique is 0.9 or more regardless of frequency fluctuation and switching frequency. However, the difference in ADI of the conventional technique exceeded 0.5 in the centralized type but showed less than equal to 0.4 in all switching frequencies in the spread type. Therefore, Fig. 16 and Fig. 17 show that the difference in ADI of the proposed method before and after the arc is larger than that of the conventional method regardless of the type of frequency fluctuation and the switching frequency. These results imply that the proposed technique has a relatively high setting range of the threshold to determine the arc occurrence. Moreover, it has better arc detection and nuisance tripping avoidance capabilities than the conventional method.
The following are the results of testing the arc detection performance of the proposed algorithm in MATLAB using arc experiment data. Fig. 18 and Fig. 19 show the results of the arc detection test of the proposed technique based on the shape of frequency fluctuation. In Fig. 18 and Fig. 19, the switching frequency of the load inverter is 20 kHz. The threshold in the second VOLUME 9, 2021  waveform of each Fig. 18 and Fig. 19 is 0.002 for determining the arc. The third image of each Fig. 18 and Fig. 19 represents the detection signal which sends a signal of size 1 when the proposed algorithm detects the arc generation. Fig. 18 and Fig. 19 show that the proposed technique detects arcing well. In addition, since detection signals are continuously sent not only at the moment of arcing start but also after arcing, the persistence of the arc detection of the proposed technique can be confirmed. Meanwhile, M small and M large remain unchanged from the initial values because there is no moment when the magnitude of the load current would become zero.   Fig. 20 and Fig. 21 represent that the AMA of the proposed technique mitigates the increase of ADI prop when the inverter gets turned on to prevent the algorithm from unwanted tripping. Additionally, the fourth graph of Fig. 20 and Fig. 21 shows that the value of M changes adaptively according to the magnitude of the load current. From Fig. 20 and Fig. 21, it can be seen that the proposed technique does not make the unwanted tripping when the state of the load inverter changes from OFF to ON regardless of the type of frequency fluctuations. It is noted from Fig. 20 that ADI prop exceeds the threshold once. However, since it did not exceed 10 times in a row, it was not judged as the arc occurrence. Fig. 22 and Fig. 23 represent the nuisance tripping test result of the proposed method based on frequency fluctuations when the state of the load inverter changes from ON to OFF. The switching frequency of the load inverter used in the test is 10 kHz. Fig. 22 and Fig. 23 show that the AMA alleviates the increase in ADI prop when the inverter is turned off, preventing the algorithm from nuisance tripping.   turning it off, they all changed to 1. Fig. 22 represents that ADI prop exceeds the threshold once. However, because it did  not exceed 10 times in succession, it was not judged as the arc occurrence.     Fig. 25 show the nuisance tripping test result of the proposed method based on frequency fluctuations in the step change of the output power of the inverter. The switching frequency of the load inverter used in the test is 15 kHz. Fig. 24 and Fig. 25 represent that the values of M small and M large do not change because the current does not become zero at any time during a sudden change of the load current. Furthermore, Fig. 24 and Fig. 25 show that the proposed arc detection algorithm does not make unwanted tripping even when load current changes suddenly.

V. CONCLUSION
This paper proposes the arc detection algorithm using AMA. The proposed ADI is calculated using two moving averages-MA small and MA large -with different tracking speed of F av . The proposed ADI is significantly small before arcing due to the low rate of change of the F av . However, the rate of change of F av increases as the arc starts; therefore, the proposed ADI increases. Hence, the arc can be detected using the rate of change of F av with the help of the proposed ADI. In addition, the proposed ADI is less affected by the type of frequency fluctuations such as centralized and spread fluctuations because it uses the relative magnitude of the two moving averages. Furthermore, M small and M large which are the intervals for calculating moving averages in the proposed method are adaptively adjusted based on the DC magnitude of the load current to prevent the nuisance tripping of the arc detection algorithm in the normal transient state. The performance and effectiveness of the proposed technique were verified using MATLAB and load current obtained by arc experiment.