## 4 Pilot Protection Based on Jensen-Shannon Distance
### Protection Criteria  
The startup criteria of the proposed pilot protection are as follows:  
\[\left|i_{ph}(k)-i_{ph}(k\,-\,N)\right|>I_{set} \tag{14}\]  
\[\left|i_{0}(k)-i_{0}(k\,-\,N)\right|>I_{set} \tag{15}\]  
where \(i_{\rm ph}\) denotes the samples of the phase current; \(i_{0}\) denotes the zero-sequence current; \(N\) denotes the sampling number per cycle; and \(I_{\rm set}\) denotes the action threshold. Protection initiates and proceeds to subsequent steps if three consecutive current samples of any phase satisfy either Equation (14) or (15); otherwise, it resets.  
Three-phase current samples from both line terminals are processed by taking the peak and valley values of each phase as the upper and lower bounds of the sampling intervals. These intervals are then divided into 15 equal segments to derive probability distributions for sampling points at each terminal. Utilizing the probability values obtained through this interval-based approach better mitigates the effects of noise. Finally, the Jensen-Shannon distance between the discrete probability distributions of both terminals is computed to determine waveform similarity.  
The calculated Jensen-Shannon distances for current sampling distributions during normal operation are demonstrated in the probability distribution histogram in Figure 5, where \(I_{\rm na}\sim I_{\rm nc}\), \(I_{\rm ma}\sim I_{\rm mc}\) represent the three-phase currents on the grid side and PV side, respectively. The calculated Jensen-Shannon distances for the three phases are 0.109, 0.113, and 0.095, which are consistent with theoretical analysis during normal operation.  
After the internal phase-A-to-ground fault at F\({}_{3}\) occurs on the transmission line, the Jensen-Shannon distance between current sampling distributions at both line terminals is analyzed, and the probability distribution histogram is shown in Figure 6. The resulting distances are 0.749, 0.116, and 0.104 for phases A, B, and C, respectively, validating the theoretical analysis. These results demonstrate significantly larger Jensen-Shannon distances in fault phases compared to minimal distances in healthy phases/phases under normal operation.  
Figure 5: Current sample value distribution during normal operation.  
Figure 6: Current sample value distribution after the phase-A-to-ground fault occurs.  
Combining the above inferences reveals that during normal operation and after external faults, the currents \(I_{\text{M}}\) and \(-I_{\text{N}}\) at both ends of the transmission line are near-identical. Consequently, the calculated \(D_{\text{JS}}(I_{\text{M}},-I_{\text{N}})\) approaches zero. Conversely, during internal faults, \(I_{\text{M}}\) and \(-I_{\text{N}}\) exhibit marked dissimilarity, resulting in \(D_{\text{JS}}(I_{\text{M}},-I_{\text{N}})\) significantly exceeding zero. Therefore, by quantifying waveform similarity through the Jensen-Shannon distance algorithm, the following criterion is established:  
\[D_{JS}(I_{M},-I_{N})> D_{set} \tag{16}\]  
where \(D_{\text{set}}\) denotes the protection threshold. After the protection is started, if the calculated \(D_{\text{JS}}(I_{\text{M}},-I_{\text{N}})\) satisfies Equation (16), an internal fault is determined. Considering that \(D_{\text{JS}}(I_{\text{M}},-I_{\text{N}})\) is close to zero when an external fault occurs, the protection threshold \(D_{\text{set}}\) should be set to a small value to avoid interference factors (such as noise).  
In summary, if the three consecutive phase current samples meet the startup criterion, the protection starts. Then, the discrete probability distribution of the current samples at both ends is obtained, and the Jensen-Shannon distance \(D_{\text{JS}}(I_{\text{M}},-I_{\text{N}})\) is calculated. If \(D_{\text{JS}}(I_{\text{M}},-I_{\text{N}})\) is greater than the protection threshold \(D_{\text{set}}\), an internal fault is identified; otherwise, an external fault is identified, and the protection is restored.