# A Heuristic Algorithm for Locating Line-to-Line Faults in Photovoltaic Systems
## 3 Proposed Method
### Heuristic Algorithm for Line-to-Line Fault Location
#### 3.2.2 Fault Location Determination  
Through the previously described candidate location marking process for line-to-line short-circuit faults, this study obtains several pieces of information useful for determining the fault location: \(d_{1}\), \(d_{2}\), \(L_{1}\), \(L_{2}\), \(k_{1}\), and \(k_{2}\). Next, using the 21 \(\times\) 2 array configuration as an example, this study presents the proposed fault location determination process for line-to-line short-circuit faults, as shown in Figure 7.  
This process is derived from empirical observation and results in six cases, labeled Case 1 to Case 6. Cases 1 to 3 involve intra-string short-circuit faults, while Cases 4 to 6 involve cross-string short-circuit faults. Each of these six cases is explained in detail below. Case 1: An intra-string short-circuit fault occurs within a single module group, as shown in Figure 8, with the fault occurring in module group \(V_{1,4}\); two modules are short-circuited, resulting in a module group voltage of A. In the fault marking process, when \(i=1,j=3\), a comparison between the third and fourth module groups reveals that \(\mid\Delta V_{1,3}\mid\) is greater than the threshold \(\Delta V_{threshold}\) and is positive. Therefore, the fault position count \(k_{1}\) is incremented by 1, the fault candidate array \(L_{1}\) adds the index 4, and the voltage direction \(d_{1}\) is set to 1. When \(j=4,\ \mid\Delta V_{1,4}\mid\) also exceeds the threshold but is negative, so \(k_{1}\) is incremented to 2, \(L_{1}\) adds the index 4, and \(d_{1}\) is set to \(-1\). For \(i=2\), no anomalies are detected; therefore, the initial state is maintained. The results of the fault marking process are shown in Table 2, Stage 1. Next, the process proceeds to the fault location determination step. Initially, duplicate fault points in the fault candidate array \(L_{i}\) are removed, and the remaining points are sorted. The fault point count \(k_{i}\) is then recalculated, with the results shown in Table 2, Stage 2. At this point, it has been determined that a fault point exists in the first string, so is set at 1,  
Figure 6: Candidate location marking process for line-to-line short-circuit faults. and \(V_{1,7}\). This type of fault is a more severe line-to-line short-circuit fault, as nearly the entire string is short-circuited, impacting the entire array's power generation. In the fault marking process, String 1 initially compares \(V_{1,7}\) with \(V_{1,1}\) and finds that both have the same voltage; therefore, no record is made. However, in the comparisons between \(V_{1,1}\) and \(V_{1,2}\), and between \(V_{1,6}\) and \(V_{1,7}\), it is observed that \(V_{1,2}\) and \(V_{1,6}\) have lower voltages, and these are recorded. Thus, a total of two module groups are marked as faulted, with the final recorded voltage direction as \(-1\). No abnormalities are detected in String 2; therefore, it remains in its initial state. The marking results are shown in Table 3, Stage 1. In the fault determination process, duplicate fault points in the fault candidate array \(L_{i}\) are first removed and sorted, and the fault point count \(k_{i}\) is recalculated, with the results shown in Table 3, Stage 2. At this stage, it has been found that there are two fault points in String 1, so s is set at 1. Directly identifying the fault in module groups 2 and 6 of String 1 would lead to an error. Therefore, whether the first marked point in \(L_{s}\) is less than or equal to 2 and the last marked point in \(L_{s}\) is greater than or equal to 6 will be checked first. If this condition is true, it is checked whether \(V_{1,2}\) and \(V_{1,6}\) are 0. If the condition is false, no further modifications are necessary. If the condition is true, this indicates that the fault is not in module groups 2 and 6, and the location results need to be adjusted by setting \(L_{s}(1)\) to 1 and \(L_{s}(k_{s})\) to 7. This is shown in the \"Modified\" section of Table 3. Finally, it is determined that the fault location is in module groups 1 and 7 of String 1.