# 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.1 Fault Candidate Location Marking  
Assuming each module voltage is evenly distributed, each module group voltage will be identical during normal operation. This is shown in Figure 5a, with each group voltage at 3A. When a line-to-line short-circuit fault occurs, the voltages of each module group change differently. In Figure 5b, for an intra-string fault, the voltage of the affected  
Figure 4: P–V characteristic curves of PV array under different conditions.  
module is 0 V. Therefore, in String 1, \(V_{1,1}=2\)A, \(V_{1,2}-V_{1,6}=0\), \(V_{1,7}=3\)A, while all module group voltages in String 2 remain at 3B. In Figure 5c, for a cross-string fault, the array module voltages split into values A, B, C, and D, resulting in \(V_{1,1}=2\)A + B, \(V_{1,2}-V_{1,7}=3\)B, \(V_{2,1}-V_{1,6}=3\)C, and \(V_{2,7}=3\)D.  
To identify all possible fault locations, a scanning method is used to compare the voltage of each module group with the voltage of the subsequent module group, calculating the rate of voltage change \(\Delta V_{i,j}\) between them. This is shown in Equation (2).  
\[\Delta V_{i,j}=\frac{V_{i,j}-V_{i,j+1}}{V_{i,j}}\times 100\% \tag{2}\]  
When \(\mid\Delta V_{i,j}\mid\) exceeds the set threshold \(\Delta V_{threshold}\), this indicates that a line-to-line fault has occurred in one of the two module groups. Typically, the module voltage in the faulted group is lower than in normal modules, so the sign of \(\Delta V_{i,j}\) must be determined. If \(\Delta V_{i,j}\) is positive, this indicates that \(V_{i,j+1}\) has a lower voltage, so the module with index \(j+1\) should be marked. Conversely, if \(\Delta V_{i,j}\) is negative, this indicates that \(\Delta V_{i,j}\) has a lower voltage, so the module with index \(j\) should be marked. This relationship is represented in Equation (3):  
\[\textit{Marked index}=\left\{\begin{array}{ll}j+1&if\quad\Delta V_{i,j}>0\\ j&if\quad\Delta V_{i,j}<0\end{array}\right. \tag{3}\]  
Using the \(21\times 2\) array configuration as an example, this study establishes a candidate location marking process for line-to-line short-circuit faults. This is shown in Figure 6. The scanning sequence starts from 7, followed by 7, 1, 2, \(\ldots\), 6. After calculating \(\Delta V_{i,j}\) for the 6 th module group, the process moves to the next row. The purpose of this sequence is to ensure that each module group undergoes calculation. To simplify the process, \(j+1\) is replaced with mod(\(j+1\)).  
In the candidate location marking process for line-to-line short-circuit faults shown in Figure 6, six additional variables are introduced: \(d_{1}\), \(d_{2}\), \(L_{1}\), \(L_{2}\), \(k_{1}\), and \(k_{2}\). Here, \(d_{1}\) and \(d_{2}\) represent the direction of module group voltages in the two strings. When a cross-string line-to-line short-circuit fault occurs, the module group voltages in the higher-potential string are ordered from high to low, whereas in the lower-potential string, the voltages are ordered from low to high. Thus, a direction value d of 1 for a string indicates that the fault point is the first recorded fault point in that string. Conversely, if \(d=-1\), this indicates that  
Figure 5: Module group voltage under different conditions. (**a**) normal operation; (**b**) intra-string fault; (**c**) cross-string fault.  
the fault point is the last recorded fault point in that string, while a value of 0 indicates that no fault has occurred. Furthermore, \(L_{1}\) and \(L_{2}\) are sequences that record the fault candidate locations for each string. The remaining variables, \(k_{1}\) and \(k_{2}\), represent the number of fault candidate locations within each string.