Detection of Harmonic Overvoltage and Resonance in AC Railways using Measured Pantograph Electrical Quantities

Harmonic resonances are part of the Power Quality (PQ) problems of electrified railways and have serious consequences for the continuity of service and integrity of components in terms of overvoltage stress. The interaction between Traction Power Stations (TPSs) and trains that causes line resonances is briefly reviewed showing the dependence on infrastructure conditions. The objective is real-time monitoring of resonance conditions seen first of all from the onboard pantograph interface, but it is equally applicable at TPS terminals. Voltage and current spectra, and derived impedance and power spectra, are analyzed proposing compact and efficient methods based on Short-Time Fourier Transform, suitable for real-time implementation with the hardware available for energy metering and harmonic interference monitoring. The methods are tested by sweeping long recordings taken at some European railways, covering cases of longer and shorter supply sections, with a range of resonance frequencies of about one decade. They give insight into the spectral behavior of resonances, their dependency on position and change over time, and criteria to recognize genuine infrastructure resonances from rolling stock emissions.


Introduction
Railways are being used worldwide as an efficient and effective transportation infrastructure for people and goods, both long distance and within an urban context. The traction supply arrangement peculiarly differs from three-phase industrial networks for several aspects: AC railways are single phase operated at Medium Voltage (MV) level; they have physical extension typical of a transmission network, but separated in smaller sections for most AC railways; the traction line feeds power to distributed moving loads (the trains); the interaction between Traction Power Stations (TPSs) and trains causes a variety of Power Quality (PQ) phenomena that are relevant to internal operation and disturbance to third parties [1]. In particular, as mainly focused by the EN 50388 standards [2,3] regarding interaction between rolling stock and supply traction line, harmonic distortion and in general conducted emissions may cause disturbance locally to signaling and control devices, as well as supply line distortion, instability and overvoltages. The first have been subject to extensive research for PQ indexes and criteria [1], as well as compensation strategies and implementations [4][5][6][7][8]. The last are the objectives of recent research aiming at defining the conditions for line instability, harmonic resonances, consequences in terms of excessive distortion and insulation breakdown [9][10][11][12].
Supply traction lines of some tens of km or longer with significant capacitive loading due to MV cables, transformers, and trains (with their own onboard devices) exhibit a wide range of resonance phenomena, occurring in the frequency interval of a hundred of Hz up to some kHz, depending on the supply arrangement and length [13,14]. Traction systems in use today are mostly operated at 25 kV 50/60 Hz and 15 kV 16.7 Hz with dif-ferent supply schemes: the supply sections of the latter are much longer with extensive earthing bringing the resonant frequency of the line in the lower part of the considered frequency range, namely one or few hundreds Hz; 2x25 kV systems have shorter supply sections with resonances in the kHz range [15][16][17][18][19][20][21], as recently investigated for a series of resonance incidents [1,9]. As shown in [9,22], in a real scenario the response of the line may be quite complex.
The behavior of the traction line impedance with fixed feeding points (the TPSs) and moving loads (the trains) was initially analyzed among others in [13,14], proposing simple one-dimensional models based on transmission-line theory, indicating the high-level conditions for line resonance, as recalled by [9]. Basically a line resonance occurs when the inductive and capacitive reactance terms with opposite sign are nearly equal in amplitude and compensate, leading to extreme conditions of very small or very large terminal impedance, depending on whether such elements are series or parallel connected. As for elementary resonant circuits, series and parallel resonances lead to situations of current or voltage amplification at the resonant frequency.
A real system is a more complex and articulated combination of series and parallel connected elements. The overall traction line can be subdivided into different sub-circuits that are relevant to define and analyze propagation of harmonics and coupling onto a range of affected systems. The harmonics propagate along the pantograph and catenary system, and along the return circuit, pertaining to the so called hot and cold paths. The cold path is relevant for induced and conducted disturbance onto signaling and communication systems that share the track with the traction supply circuit; the studied circuit must include an accurate model of the return circuit, of common to differential signal transformation, and local resonances. The hot path, conversely, concerns mainly the traction supply and overhead distribution system with an overall return along the return circuit and earth; the studied circuit is relevant for distortion shared by the TPSs and trains, and propagated back onto the high voltage feeding line and then into the public grid.
Resonances can occur between the elements interconnected by the long traction line over a broad frequency range, concretizing as low-frequency and high-frequency oscillations (identified as LFOs and HFOs, respectively). Recalling the EN 50388 standards [2,3] and the interpretation given in [9], it may be said that LFOs are related to system instability [23], mostly caused by delay and phase rotation along the line [24] and interaction of active controls onboard rolling stock, applying power factor compensation [25,26]. This led to the catastrophic blackout of the Swiss network on April 1995 (as reported in [25,27]) and a significant research activity among the infrastructure owners, manufacturers and scholars. A comprehensive list of incidents caused by network resonances is reported in [1] and a detailed list of those occurred in China is reported in [9].
HFOs, besides causing overvoltages, are interpreted sometimes as a PQ problem, where network resonances are excited by the rolling stock harmonic emissions. Network resonances are of course subject to variability depending on loading, the relative position and the type of the trains in the supply section, although the theory of the one-dimensional transmission line suggests that main resonances do not depend on train position [9,13,14]. Such slight variability, in particular for secondary resonances, was observed during tests carried out in a well documented system, the test ring at Velim in Czech Republic, where the influence of train position every 500 m including traction supply cables was investigated [28]. The longer the traction supply section between two TPSs, the lower the main resonant frequency, as theoretically demonstrated in [13,14] and taken up and commented by [9].
The consequence of parallel resonances occurring in the hot path is an increase of distortion injected back into the public grid and most of all line voltage amplification, with potentially catastrophic effects: • excessive instantaneous voltage may trigger TPS overvoltage protections, possibly causing cascaded tripping and the collapse of a large portion of the railway electric network; • overvoltage stress in terms of single or repeated overvoltages of varying intensity that may cause the failure of surge arresters, likely resulting in a short circuit through the failed unit and a sudden TPS out-of-service due to protection tripping.
Series resonances may also occur [15], where the propagation of distortion involves the TPS and the upstream network, resulting in an increased distortion injected into the public grid. These resonances are made correspond by Sainz et al. to the zeros of the pantograph impedance Zp. In general, major series resonance should occur in the lower part of the HFO range, where the series resistance is lower and the risk of excitation by low-order harmonics is higher and consequences are thus worse.
As HFOs are caused by the resonance of TPS and line, accounting for distributed and lumped capacitance terms, and are excited by rolling stock emissions, two approaches may be identified for harmonic and resonance suppression: ground based suppression and on-board suppression [9]. Among ground based suppression techniques, use of passive and active filters installed at TPSs is the most common solution [29], although some networks reconfigurations may also be considered, in order to shift the resonance frequency and reduce the factor of merit. On-board suppression may be achieved by installing passive filters that may be exposed to excessive stress when an entire line section with resonance excited by nearby trains occurs [9]. On-board suppression most often relies on the modification of the converter modulation, rather than a revolutionary change of topology [30].
Converter control can be initiated and adapted if continuous monitoring of the pantograph quantities and of incipient line resonances is provided. Similarly, critical situations and the necessity of suppression implementation for a given line may be assessed if pantograph quantities are available and evaluated. This work discusses in fact practical conditions for detection of resonance conditions from a railway vehicle, using information available at the pantograph electric interface. Other measurement techniques have been proposed in the past [9,29,31], using purposely developed equipment located at TPS. The focus here instead is on the observability of resonance phenomena from the pantograph interface, to provide a distributed monitoring system that can be in principle installed onboard all the trains of the network.
The work is structured as follows: Section 2 describes the quantities and conditions for resonance to occur; Section 3 goes into the details of the detection and interpretation of harmonic resonances; Section 4 reports the results obtained from measured data collected during test runs in Switzerland and France, thus covering both 16.7 Hz and 50 Hz traction supply systems.

Network resonance
As shown in [9], the system may be analyzed by means of Multiconductor Transmission Line (MTL) equations, representing the overall network as a meshed set of series and parallel connected branches, to which lumped circuits (such as the TPS and the train, as well as auxiliary transformers, including the Pole-Mounted Step-Down Transformers considered in [16]) may be attached at nodes. Although often neglected, MV connecting cables between TPS and traction line may give a significant additional capacitance, which can bring the "natural" resonance of the supply section to lower frequency (see considerations on the relevance of such parameters for exact fitting of measured frequency response in [28]).
For the analysis of the hot path there is in general no need of a detailed model of the conductors forming the return path (the "cold path"); conversely, studying track-connected signaling circuits requires attention to track balance and rail-to-rail and rail-to-earth parameters [32]. The hot path is often studied using simplification of conductors at the same potential into equivalent conductors [33], as considered also in [9] (see refs no. 92 and 93 there). However, the accuracy of the simplification worsens with increasing frequency [33], so that this approach may be used for load flow studies and electromechanical simulation, but could lead to errors when frequencies of one to some kHz are considered, as it is for HFOs.
Network resonances depend on the studied transfer function and may be different if considering different quantities: the TPS voltage to evaluate the occurrence of overvoltages and the impact of TPS equipment; the line current flowing along the TPS transformer, as a PQ phenomenon impacting on the feeding network upstream; the pantograph voltage as a measure of parallel resonance along the line and the chance of interfering with the operation of the onboard converters; the pantograph current providing direct information on the exchanged active and reactive power and disturbance to track signaling, if interpreted as return current. Considering in particular the effect of the additional capacitance provided by the high-voltage cables wayside and onboard (e.g. on train roof between pantographs), the local train-based measurement of line resonances becomes more relevant.
Focusing on the source of distortion exciting the traction line resonances and on measurements available at the locomotive (or electro-train), the impedance is modeled at the pantograph-line interface, as carried out in [9,13,14]: the simplified schematic is shown in Figure 1. The frequency response of a railway line depends first of all on its length, and in particular on the length of the supply section, when this is electrically separated from the adjacent ones. The 50/60 Hz systems have the necessity of strict separation of each supply section, being derived from the national grid by loading alternatively two of the three phases (each supply section has thus a phase rotation of 120 electrical degrees); this is achieved by the phase separation sections, more commonly altogether named "neutral sections". Conversely, 16.7 Hz systems have in several countries (such as Switzerland) a dedicated single-phase distribution and transmission network upstream, so that a phase separation is not in principle necessary. Then, mainly exigencies of network stability and continuity of service require the use of some neutral sections, more separated than for 50/60 Hz systems. To fix the ideas, the length for a 50/60 Hz high-speed line is in the order of 40 km, whereas for 16.7 Hz systems may be in the order of a hundred km.
From the point of view of HFO modeling, this has two consequences: • A longer supply section implies that HFOs begin in principle at a lower frequency, although a direct proportionality on length for the two systems is not correct, as there are differences in the traction conductors and per-unit-length parameters.

•
The ideal equivalent circuit arrangement for 50/60 Hz and 16.7 Hz systems differs in that the former has always one TPS at one end of the line and the other end is left floating against the neutral section, whereas for the latter there may be configurations with more than one TPS with a piece of line terminated on a TPS at each end, without electrical separation. These two cases are show below for completeness.
The impedance resulting from the parallel combination of the left and right sections at the pantograph connection point gives the following known expressions, having assumed a typical single-side supply scheme, as in 25 kV systems (see Figure 1(a)): The resonance condition results from Now, in [9] a purely inductive ZTPS is assumed and the tanh( ) function was simplified with its own argument, so that (3) reduces to: having indicated with C the total capacitance of the line. The first objection may be that the inductance of the line has disappeared, but neglecting the shunt conductance as sensible for the overhead conductors of the traction supply, the (small letters indicate per-unit-length parameters).
For a system without phase separation points and longer supply sections separated by some neutral sections, as in the case of 16.7 Hz railways (shown in Figure 1(c)), the two-terminal impedance condition at many locations are those of ZTPS at each side. This is a simplification that neglects the two adjacent line sections beyond the considered TPSs, that are assumed to represent a low-impedance termination.
nance inductive and capacitive terms compensate, leaving a line impedance with resistive behavior [35,36]. The resistive term should be then determined quite accurately, and skin effect should be taken into account for a correct estimate of damping and height of the impedance peaks. Similarly, the depth of anti-resonance (or series resonance) points depends on the series resistance, chiefly influenced by skin effect in the traction supply conductors. For traction line conductors skin effect is prominent in the running rails [37,38], whereas overhead conductors are not appreciably affected, being made of metals with negligible magnetic permeability, besides their smaller cross section. Transformers at TPS and on-board can increase the overall line loss, and may introduce some proximity effect within their windings; this explains the fact that stray inductance (that by definition represents the uncoupled magnetic field in air and is a linear term) is slightly frequency dependent.

Resonance detection
The selected approach is to mimic expert's behavior when observing an ideal display that contains a set of signal characteristics extracted from the original input quantities. Such characteristics correspond to the spectrum components of the pantograph voltage and current, together with the peak and rms values of the corresponding waveforms. Investigated criteria regard abnormal increase of some spectrum components, together with their specific behavior vs. time. The approach considers the analogous behavior of adjacent spectrum components, in order to discard isolated components, possibly caused by power converters, that do not match the assumption of a limited factor of merit.

Selected pantograph quantities and basic Fourier analysis
With the objective of detecting incipient resonances in real time using on-board instrumentation, as discussed in section 2, the quantities that are accessible at the pantograph interface are Vp and Ip, the frequency domain spectra of the pantograph voltage and current, obtained from the corresponding vp and ip time waveforms. The same approach can then be transferred to the TPS, where the available quantities are the line voltage Vl and each feeder current If,k or the total line current Il.
Spectra are calculated with a Short-Time Fourier Transform (STFT) approach, with care of using P  2 periods of the fundamental f1 to set a frequency resolution df = f1/P, that has the following advantages: • it attenuates rapid transients lasting less than one cycle; • it displays well even and odd harmonics with at least one intermediate bin between each of them; we should remember, however, that odd harmonics prevail and have a behavior coherent with the train operating conditions, so that they are even more separated and exempt from significant spectral leakage from the adjacent ones; • it allows the use of tapering windows with a broad main lobe (such as Flat Top), as the resulting reduction in frequency resolution is anyway less than a factor of 2 with respect to the implicit rectangular window.
The signals can in any case be analyzed with a percentage of overlap p  50 %, ensuring a time resolution down to the fundamental period, without hindering the desirable real-time response and frequency resolution.

Resonance conditions
A HFO condition occurs at the maxima of pantograph impedance Zp as a parallel resonance; the line voltage resonance then occurs if there is correspondingly a significant current excitation close to the identified resonance frequency. A series resonance occurs at the zeros of the same Zp, causing a maximization of the current flowing back down to the TPS and possibly upstream. In both cases the resistance of the return circuit due to thee skin effect in the running rails [37,38] plays a major role and reduces the factor of merit, especially when observing the increase of minima and reduction of maxima of the Zp curve.
Practically speaking, with values of the factor of merit Q in the order of 10, the bandwidth f around the ideal resonance frequency fr that is proportional to 1/Q, so about 10%, will represent an interval with non negligible width, bracketing more than one harmonic component, when fr is of the order of magnitude of one or more kHz. This is confirmed by the voltage spectra shown in [18,20,21].
The lower the Q factor the lower the peak at resonance and the less relevant the effect of such resonance and the necessity to detect it.
At resonance (parallel or series one) the reactive components compensate and the net resulting impedance has a real value. This condition translates into the voltage Vh and current Ih phasors at the resonance frequency being in phase.
From a harmonic power flow point of view this is equivalent to a cancellation of the harmonic reactive power term Qh at the said resonance frequency, maximizing the harmonic active power fraction. It is just remembered that the term "harmonic reactive power" results from the direct multiplication of voltage and current phasors at the same frequency, neglecting distortion power terms resulting from mixed multiplication of voltage and current phasors at different frequencies [35,36]. Then it is not meant that the active power term Ph is maximum overall, but its fraction taken with respect to the total harmonic apparent power Ah = (Ph 2 +Qh 2 ) (namely the harmonic displacement factor dh = Ph/Ah) is. This is clear as all low-order harmonics are characterized by large values of apparent power and consequently, in proportion, active power as well, as demonstrated in [39]. The use of dh allows a normalized weighting of the active power flow at all frequencies without problems of scale, with which resonance conditions may be characterized and identified.
What is observed also is that the harmonic power flow at the resonant frequency is prevalently active (theoretically only active power would flow). As the analysis is carried out at the characteristic harmonics of the traction supply fundamental, that might not coincide with the observed resonant frequency, the cancellation of the harmonic reactive power terms may be only approximate.
However, cancellation of reactive power at a given harmonic is a necessary, but not sufficient, condition for identification of network resonances, series or parallel. In fact, there are transient situations, as identified in the polar plots of the harmonic active and reactive power components in [39], for which the reactive power term may be temporarily very small with active power prevailing. This behavior was investigated in [40] to identify suitable PQ source indicators, focusing in particular onto the sign and intensity of the active power indicator.
The harmonic active power Ph has thus proven itself as a valid indicator of power flow and harmonic power sources, as well as of resonance conditions, with a better discernibility than for voltage and current quantities alone. As the product of the two quantities, it has better scale properties than their quotient, i.e. the pantograph impedance Zp.
The mentioned transient conditions in any case last namely for a limited amount of time and are often related to the train operating conditions, whereas network resonances are more persistent and may depend only slightly on train position.
In addition, recalling the considerations on the factor of merit, a network resonance will affect several frequency bins at which there will be a significant increase of the harmonic power factor, whereas a loco emission is often limited to one or few harmonics.
From the definition of HFO it is understood also that a network parallel resonance as such should be accompanied by some amount of voltage amplification. Series resonances instead should be characterized by low voltage components and correspondingly current amplification.

Detection criteria
Regarding criteria for detection, all harmonic components and the basic frequency resolution may be used, as well as grouped harmonics and a band-pass approach.
The most direct approach is based on detecting an excessive distortion of Vp that would cause the increase of the peak and rms values of the waveform. In alternative, the attention may be focused on the peak and rms values of the waveform in an attempt to avoid the Fourier analysis: the peak value is nevertheless exposed to transients, that would be detected as false positives; the rms value instead requires a calculation whose complexity is approximately that of a FFT implementation. In addition, the use of harmonic spectra allows the implementation of additional criteria, as the presence of adjacent harmonics and harmonic grouping.
So, a time interval where some distortion threshold is exceeded is marked as a first candidate for resonance detection, although the excessive voltage distortion may be caused by an excess of current distortion due e.g. to a particular operating point of the rolling stock power system. Confirmation comes from the corresponding assessment of current distortion at the same harmonics, verifying that it does not exceed a suitable threshold. This is equivalent to the verification of a sufficiently large Zp to justify the increased distortion observed in Vp in turn not caused by an increase of Ip .
A set of rules is given identifying the criteria for the identification of resonance conditions, HFO and their time behavior.
Rule 1: a resonance condition configures around the peaks of Zp, the local maxima of the network impedance seen from the pantograph.

Rule 2:
HFO is triggered if the rolling stock has emissions exciting the resonance and this is visible in the Vp spectrum, peaking around the resonance frequency.
Rule 3: an incipient HFO situation can be prevented, once distinguished from a momentary increase of Ip for which the ratio Zp = Vp / Ip is taken into account.
In general, the identification of the resonance is made on a semi-quantitative basis, where the detection of a fractional increase of Zp and Vp is sufficient (as it will be demonstrated in section 5 with experimental data); the uncertainty requirement for the measurement of the pantograph quantities is thus not demanding and fits existing transducers and instrumentation already installed for monitoring purposes.
As observed in practice, converters emissions in the kHz range may be accompanied by a slight increase of Zp, due for example to the inductive behavior of the on-board transformer through which such emissions flow. However, such increase is limited to few spectral lines, so that it might be distinguished from a HFO due to the apparent larger Q factor. To make the interpretation of the Zp spectrum easier and less prone to errors, a robust check is carried out by combining the Zp spectrum with the distribution of dh values, resulting in the filtered impedance Zp. A convenient threshold dthr = 0.9 was determined with some trial and error, with respect to the discernibility and interpretability of the resulting graphs.
Rule 4: a HFO is confirmed if dh  dthr (dthr = 0.9 is a convenient threshold, but other values, maybe slightly larger, are possible).
This effectively removes many extraneous points and makes easier the interpretation of 2-D STFT spectrum of Zp.
It is remembered that both quantities, Zp and dh , are matrices resulting from the STFT application, so with time and frequency as indices for rows ad columns.
The confirmation of a HFO condition with parallel resonance comes from a local increase of voltage distortion components. To this aim the Vp spectrum is scaled by nor-malizing it with respect to the fundamental value at the same time instant ( h p V , ), and for an exigency of scale, only harmonic values are displayed, discarding the fundamental and the larger low-frequency components.
it is possible to evaluate the overall distortion as Total Harmonic Distortion (THD), just taking the rooted sum of squares: This approach is in line with [18], but it is ineffective in practice, if the real behavior of the AC railway and rolling stock is considered: • Low-order harmonics are ubiquitous in AC railways [1,4,39], and may or may not be produced by the rolling stock used for tests, depending on the type of the on-board converters; modern 4QCs (four-quadrant converters) are not in general a source of low-order harmonics. Low-order harmonics have the largest amplitude of all voltage spectrum components and they would mask the effect in the overall THD of higher-order components at resonance .
• High-order components at HFO frequencies do not correspond always to the main emission components of rolling stock, but are excited by lesser distortion components, such as some of the lateral bands of 4QC emissions.
For a scale problem (avoiding the influence of low-order harmonics) and for selectivity with respect to the emission patterns of various types of rolling stock, it is advisable thus to limit the calculation of THD to frequency bands, starting from a conveniently large minimum frequency and with an extension that preserves some accuracy and sensitivity for detection of incipient resonance conditions. This concept corresponds to the proposal of evaluating the ripple of DC grids in bands, using intervals for the STFT indexes or equivalently a bank of pass-band filters [41].
Such bands Hi may have an extension of some or several hundreds Hz, that should be selected taking into account that the two AC railways with different fundamental frequency will populate differently each interval, with a denser harmonic sequence for 16.7 Hz systems. It is in fact unavoidable that 50/60 Hz components are more spaced apart and contribute less terms within the same bandwidth; a minimum number of harmonics per frequency band should be decided to bracket the whole harmonic group of a 4QC emission (whose spread as for Pulse Width Modulation theory depends on the output frequency).
Conversely, resonances are related to the geometry and electrical characteristics of the infrastructure and not to the fundamental frequency, for which the same band representation would fit both systems. From this it is evident that a meaningful and effective representation of voltage distortion must trade off between the two exigencies.
It is also recalled that frequency-limited harmonic distortion profiles calculated using real measured data are rarely smooth, as they collect adjacent spectrum components of mixed origin: some deal of numeric smoothing is thus necessary to ease readability, as it will be shown at the end of section 4.

Results and discussion
Long data records taken along some AC railway systems are considered for the verification of the rules ad conditions discussed so far. The considered systems represent modern railways with quite different topologies, as described in [42], where the origin and the characteristics of data are also clarified: The use of the condition of Rule 4 allows excluding during post-processing points in the time-frequency space that are not relevant from a resonance-tracking viewpoint: such points in the following graphs are excluded and their position is set as white as the background (this was implemented using the feature NaN, "not a number", in Matlab).
Three cases are considered in the following figures: a 1200 sec. run on the 16.7 Hz system in Figure 2, an 850 sec. run on the 50 Hz system in Figure 3, and a zoom of a 16.7 Hz system situation that shows a time-varying anti-resonance. In each figure the information from top to bottom, left to right is displayed with the following scheme: In Figure 2(a) a neutral section is clearly visible just before 600 s with Vp falling rapidly to 0 with zero current and power absorption as well. There are frequent phases of traction and braking that alternate during the trip, as this train was in normal passenger service.
It is possible to recognize some red areas for Zp (Figure 2(b)), corresponding to large values of impedance and in principle to line resonance situations, if confirmed by the Ph map (Figure 2(c)), with application of Rule 4. These areas are located for example at about 9 and 12 kHz and extend intermittently before and after the neutral section; the resonance at about 14.5 kHz, instead, disappears after the neutral section.
The persistent horizontal line at 4 kHz is well evident as a voltage harmonic in Figure 2(e), but is not backed up by a corresponding large impedance value Zp in Figure  2(d), as this is, as known, an emission of another type of train running on the same line.
In Figure 3 There are several red areas of Zp (Figure 3(b)), which however do satisfy Rule 4 (dh  0.9), as shown by comparing with Figure 3 It is interesting to observe two red areas of Zp with a shape that is typical of a line resonance at about 8-9 kHz and 10-11 kHz, at time 200 s and 300 s, respectively, but they do not pass the Rule 4 verification.
This network shows at some locations a slight deviation from the theoretically grounded assumption that resonances do not depend on train position: this occurs between the two phase-separation sections, between 500 s and 650 s. Around 11-12 kHz an approximate U shape is barely visible in the Zp graph, and it is better highlighted when combined with Ph as per Rule 4, as shown in Figure 3(d) and (e). A slight dependency on train position is in reality possible when the line is not straight, but joint with a third line segment at a junction.
Anti-resonances are also clearly visible as between 10 and 12 kHz, ascending first and then descending centered on 200 s.  (around -60 dB, that is 0.1%). In the original Zp map (Figure 4(b)) there is a larger red area of high impedance values that do not pass the confirmation Ph test of Rule 4), and disappear when considering Zp in Figure 4(d).
Starting from the previous tests cases, the behavior of the band-limited THD was evaluated, as show in Figure 5 for Switzerland and Figure 6 for France. Bands for calculation of THDi were selected depending on the characteristics of the h p V , spectrum, starting from a frequency of 500 Hz, separating the low-frequency interval from the successive bands Hi = 1 kHz located above it. THDi curves were smoothed before plotting using a moving average filter of order 11.  The two systems confirm their major differences, with the France AC network featuring higher distortion and not only in the first low-frequency interval.
Resonance occurrence corresponds to time intervals with large THDi although also situations of increased rolling stock emissions fall into this category and a clear distinction without Zp information is not possible. Also the prevalence of active harmonic power is an indicator that the distortion corresponds to a resonance situation, whereas without it also intervals of current pulling might be included.
The THD for Switzerland is all caused by network components in THD0, so below 500 Hz. Considering the high-frequency THD, it is evident that the THD channels of 1 kHz are not very selective in tracking resonances, as even THD14 can follow the two resonances at 13-14.5 kHz occurring in the intervals 650-800 s and 850-1000 s: the THD14 profile loses dynamic due to other voltage components for which there is no prevalence of harmonic active power and that h p V , would have discarded. Similarly, THD9 misses the resonance at 9.5 kHz before 600 s and tracks it only between 600 and 950 s. Observing France in Figure 6 THD7 captures two resonances at about 200 and 350 s also visible in Figure 3(e). At higher frequency THD11 and THD12 track the two resonances at about 10.5 kHz, occurring in particular at 500 and 650 s. THD5 and THD6 should have tracked the discontinuous resonances occurring between 4.5 and 6.5 kHz and they are partially successful, at the beginning and around 500-550 s.

Conclusions
This work has discussed the problem of detection of resonances in AC railways in a rolling stock perspective, so starting from the measured pantograph quantities (voltage and current) and the derived quantities of pantograph impedance and harmonic active power. Suitable conditions are identified for the detection of resonance conditions, focusing on parallel resonances, and a set of rules has been formulated. Local maxima of the pantograph impedance are detected and confirmed by a prevalent flow of harmonic active power, indicating the mutual cancellation of the harmonic reactive power terms. Such condition for the harmonic active power may hold also in case of series resonance, for which minima of the pantograph impedance should be considered. In both cases further confirmation is obtained by the amplification of the harmonic components of voltage and current, respectively.
These criteria have then been validated by means of extensive experimental data measured in two different AC railway networks, one operated at 16.7 Hz (Switzerland) and one at 50 Hz (France).
The straightforward monitoring of voltage harmonic distortion was also included and compared to results in [18]: although a useful indicator in general, it has issues of selectivity, due to the mix of voltage harmonic components with opposite or incoherent behavior, not being able to reject those without a large active power fraction. It also necessitates always some degree of smoothing during post-processing to improve readability of obtained distortion profiles versus time. It has, however, a simple implementation, especially if implemented with a filters bank.
The comparison of voltage harmonic distortion over selected frequency bands with the results previously obtained with the pantograph impedance combined with the harmonic displacement factor has shown the superiority of the latter in terms of ability to locate and track resonance phenomena, avoiding the interference of spectral components of reactive nature.

Supplementary Materials: Not applicable.
Author Contributions: The contribution of L.S. and A.M. to conceptualization, methodology, software, experimental validation, and writing is the same. All authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.