WorksEngineering
Transformer-guided Variable Projection for Phasor and Fault-Time Estimation Under DDC Offset
Abstract
Decaying DC (DDC) offsets introduce substantial phasor estimation errors during the first post-fault cycle. Recent approaches have sought interpretable waveform representations, but identifying analytical expressions can incur substantial computational costs. This paper proposes a transformer-guided variable-projection estimator that extracts the fundamental phasor, DDC parameters, and fault inception time from point-on-wave (POW) samples as an interpretable analytical expression. An offline-trained transformer provides the signal structure and decay rate, while variable projection refines the parameters and handles windows containing the fault without knowledge of time of fault. Across single- and dual-DDC scenarios with time constants of 2.5–400~ms, the mean maximum overshoot (MO) is at most 2.7% on post-fault windows and 2.2% during online operation, where the DFT reaches 10–14%. The post-fault phasor settles within 5% approximately 12.5~ms after inception. Circuit-level validation on a 230-kV two-source system yields 1.6% mean MO, compared with 9.5% for the DFT.
Introduction
Accurate and fast phasor estimation is fundamental to power-system protection, monitoring, and wide-area measurement applications. During faults, current and voltage waveforms may be distorted by harmonics, noise, frequency deviations, current-transformer effects, and exponentially decaying DC (DDC) components. Conventional Fourier-based estimators [1] can exhibit considerable magnitude and phase errors following fault inception because DDC components violate their periodicity assumptions, potentially compromising protective-relay operation [2].
Related Work
Recent research follows two complementary directions: analyzing transient waveforms directly and improving phasor estimation under DDC. Waveform measurement units and point-on-wave (POW) recorders preserve synchronized waveform samples [3], enabling data-driven grid monitoring [4]. Beyond conventional phasor measurements, these samples retain information about fault inception, DDC dynamics, and harmonics, which can be recovered through transient-aware modeling.
Analytical and signal-processing methods estimate the DDC within a fixed signal model: [5] solve the DFTs of sub-windows analytically for two DDCs, [6] combines the DFT with a modified least-squares (LS) method based on notch-filter pairs, [7] jointly estimate the frequency deviation and the DDC time constant from recursive DFT relations, and [8] and [9] reconstruct the DC offset iteratively by polynomial and cosine-series fitting, respectively. These methods are accurate when the waveform matches the assumed model, but each commits to a single model, and their accuracy degrades when the transient departs from it, for example with very short or multiple time constants [9] or strong transients right after fault inception [6].
Machine learning methods offer an alternative. The network of [10] is in effect an adaptive LS fit whose weights, trained online on each window, are the coefficients of harmonic sinusoids and a Taylor-approximation DDC term. Offline trained networks map sub-cycle windows either to the undistorted waveform, from which the phasor is fitted by LS [11], or directly to the fundamental amplitude and phase under two DDCs and frequency deviations [12], while [13] reconstructs current-transformer waveforms with support vector machine and LS support vector machine models before a DDC robust modified DFT. These estimators fit a fixed, approximate model or learn a black-box mapping, and none identifies the analytical structure of the fault current.
Deep symbolic regression (DSR) enables interpretable fault-current estimation [14] and has been used to identify the harmonic content of grid voltages for converter control [15], but requires computationally expensive symbolic searches on each window. Conversely, LS methods are efficient but require predefined signal structures and nonlinear parameters. Inspired by SymFormer’s joint structure-and-constant prediction [16], this work uses a transformer to initialize a variable projection fit [17], avoiding online symbolic search while retaining an interpretable waveform representation. The main contributions are:
Single-pass identification of fault-current components and initialization of coefficients for subsequent physics-constrained refinement.
A variable-projection refinement with a continuous sigmoid switch between pre- and post-fault models, which estimates the fault time jointly with the decay rates, without requiring prior knowledge of the fault occurrence time.
An offline-trained estimator requiring no online training or symbolic search, with per-window execution time below the quarter-cycle update interval on a single CPU thread, validated on multiple scenarios and electromagnetic-transient simulations.
Proposed Method
Problem Formulation
Under fault conditions, current waveforms may contain harmonics and one or more DDC components [18], modeled as
where is the fault inception time, , is the nominal angular frequency, is the set of harmonic orders, and is the number of DDC components. The parameters and denote sinusoidal amplitudes and phases, while and represent DDC amplitudes and time constants.
The sampled waveform is , where and the noise, . Given the measured sequence , the objective is to recover the fundamental phasor and, when present, the fault inception time . To represent the possible waveform components, the admissible signal structure is defined as
where denotes the fundamental and the -th harmonic. The estimator selects the relevant components from this set for subsequent refinement.
One-Shot Structure and Parameter-Predicting Transformer
Input representation: Each window is peak-normalized as , since the structure and decay rate used by the subsequent refinement are independent of scale. Each sample is represented by and linearly embedded into . The nominal-frequency encoding, with the nominal angular frequency, provides sample position and phase information, allowing the encoder to distinguish the fundamental from transient components. A learned classification token is offset by a linear projection of , where is the window start time (s) measured from the detected fault inception. These features provide a phase reference and window position within the DDC.
Architecture and outputs: Three transformer encoder layers (, four attention heads, 128-unit feed-forward dimension) outputs a classification-token representation shared by two heads. The structure head selects waveform components using a probability threshold, with the fundamental always included. A two-layer coefficient head predicts , where and . The normalized prediction is mapped to the physical decay rate . Only the selected structure and are passed to variable projection, which refines the decay rate, recomputes the coefficients, and returns the final phasor.
Physics-Constrained Refinement
For a given structure and decay rates , the waveform model is linear in its remaining coefficients . The design matrix contains sine–cosine column pairs at for the fundamental and the selected harmonics, and a column for each DDC component. The coefficients are obtained in closed form as , while the nonlinear parameters are refined by minimizing the variable-projection residual [17]
For windows containing the fault, a continuous transition between the pre- and post-fault models is introduced:
where is the fault position relative to the window start , in samples (), is a fundamental sinusoid, and is the post-fault model with structure . The width samples gives a transition of about 1.5 samples, close to a step, while keeping the residual differentiable in between samples; for the same reason, the DDC terms use the smooth clock instead of . For fixed , (4) remains linear in the pre- and post-fault coefficients, so the fault time and the decay rates are refined jointly by the same variable projection.
The nonlinear parameters are the log-decay rates , augmented by the fault position in fault-containing windows: . They are refined using Gauss–Newton with Kaufman’s variable-projection Jacobian approximation:
Steps are bounded by and samples, with s, and accepted only if they reduce . Post-fault windows start from the transformer’s , with five iterations, selected through convergence experiments. Windows containing the fault use Levenberg–Marquardt [17] damping, with eight iterations at the first detection and three in later windows, which start from the previous estimates. The refined is then rounded to the neighboring sample with the lowest hard-switch residual, which gives , and the window is refitted with the hard switch and the clock . The optimized decay rates are used to recompute the linear coefficients . The fundamental phasor is then recovered as and .
Online Estimation
A one-cycle window slides over the measurements with a quarter cycle step. The transformer is trained offline, while only the estimated fault time and decay rates are carried between windows. The model uses its full structure, and fault containing windows are fitted using (4) without prior knowledge. The overall methodology is illustrated in Figure 1.
Figure 1. Proposed estimator architecture.
Fault detection: For a periodic pre-fault signal, the cycle difference ideally contains only noise. A fault is declared at the first of three consecutive samples satisfying , where ; the median absolute deviation of over the preceding cycle. This robust threshold adapts to measurement noise while limiting sensitivity to isolated transients. Before detection, the estimator reports the LS fundamental phasor. The detected sample initializes .
Reporting: The pre-fault phasor is retained until 150 post-fault samples are available. Thereafter, the post-fault phasor is estimated with from detector and the transformer initialized on the post-fault segment (). For fully post-fault windows, , and subsequent windows reuse the previously refined decay rates. As shown in Figure 2, 150 samples were selected as a practical reporting threshold, at which exceeds 0.999 for both DDC cases.
Figure 2. Reconstruction versus the number of post-fault samples for single- and dual-DDC signals.
Training and Evaluation
Signal Generation Model
Synthetic waveforms are generated using (1) at 12 kHz over 200-sample windows, with fundamental amplitudes of 1–20 p.u., random phases, and 20–40 dB SNR. The DDC time constants span 2.5–400 ms.
Training windows begin uniformly within the first 40 ms after fault inception and contain only post-fault samples. Windows containing pre-fault data are handled by the online procedure in Section II-D.
Training Procedure
The network is trained with a multi-task loss combining binary cross-entropy (BCE) for structure classification and mean squared error (MSE) for coefficient regression,
where indicates the presence of term , are the normalized coefficient targets, and the mask removes the coefficients of absent terms from the regression loss. The model is trained using 4000 training and 800 validation windows. Decay rates are sampled log-uniformly. Training uses Adam with a learning rate of for up to 20 epochs, keeping the checkpoint with the lowest validation loss.
Baseline Estimators
The proposed method is compared with three baselines evaluated on the same records: (i) the full-cycle DFT, on which relay phasor estimation is based [1]; (ii) the closed-form DDC removal method by Abdoos [19], which estimates a single DDC from the cycle integral and the endpoint difference before a DFT of the residual; and (iii) PySR, our replication of the deep symbolic regression search of [14], run on each window.
Evaluation Metrics
Performance is evaluated using the coefficient of determination between the true and reconstructed fundamental waveforms, MO and total vector error (TVE):
Three scenario families are considered: low- single DDC (–10 ms), extended- single DDC (–200 ms), and dual DDC ( up to 400 ms).
For post-fault evaluation, 50-ms records are processed using one-cycle windows with a quarter-cycle step over 30 noise realizations. Overlapping reconstructions are averaged; and MO are computed on the averaged trajectory, while TVE is evaluated per window.
For online evaluation, windows advance by quarter cycle without averaging or known fault time. MO includes all post-inception estimates, while settling time is defined as the time after which the estimated amplitude remains within 5% or 2% of its true value.
Results
Synthetic Data
The proposed method is evaluated on synthetic waveforms under two settings, both with SNR uniformly sampled from 20 to 40 dB. First, 30 fully post-fault windows per scenario, with independent noise realizations, are used to assess phasor estimation accuracy. Second, continuous online records are used to evaluate transient behavior, fault-time estimation, and settling performance without prior knowledge of fault inception time.
Post-Fault Windows
Table 1 shows that baseline performance depends strongly on DDC dynamics. The largest differences occur at short time constants, where the exponential decays substantially within a single estimation window. In this regime, Abdoos’ first-order approximation becomes less representative of the DDC, while the PySR search is dominated by the fundamental component, performing similarly to DFT. In contrast, the proposed method explicitly retains the exponential term and refines its decay rate through variable projection, substantially reducing transient errors.
| Scenario | Method | MO (%) | TVE (%) | |
| Low- | DFT | 0.7495 | 59.82 | 27.48 |
| Low- | Abdoos | 0.9481 | 32.24 | 14.59 |
| Low- | PySR | 0.7049 | 55.44 | 29.34 |
| Low- | Proposed | 0.9998 | 1.56 | 1.46 |
| Ext.- | DFT | 0.9794 | 13.15 | 22.00 |
| Ext.- | Abdoos | 0.9964 | 3.84 | 5.96 |
| Ext.- | PySR | 0.9758 | 5.68 | 18.80 |
| Ext.- | Proposed | 0.9986 | 2.69 | 3.56 |
| Dual DDC | DFT | 0.8900 | 39.19 | 29.04 |
| Dual DDC | Abdoos | 0.9954 | 6.76 | 6.91 |
| Dual DDC | PySR | 0.8831 | 32.42 | 27.32 |
| Dual DDC | Proposed | 0.9996 | 1.82 | 2.26 |
Table 1. Post-Fault Phasor Estimation Accuracy
As the DDC time constant increases, the exponential varies more slowly within each window, improving baseline performance and narrowing the gap with the proposed method, which nevertheless remains the most accurate. Under dual-DDC conditions, the proposed method maintains accuracy comparable to that achieved in the extended-time-constant single-DDC scenario.
Online Operation and Fault-Time Estimation
Fig. 3 illustrates the online behavior of the estimators. While baseline methods exhibit large transient excursions as the window crosses the fault, the proposed method maintains the pre-fault phasor until sufficient post-fault information is available, as detailed in II-D. By estimating fault inception within variable projection, the method avoids fitting a post-fault model to mixed pre- and post-fault samples, substantially reducing transient errors and achieving faster settling. This advantage persists under dual-DDC conditions as shown in Table II.
Fault-time estimation, described in Section II-D, was evaluated on 250 single-DDC records ( ms, 30 dB SNR), with post-fault fundamental amplitudes ranging from 1.1 to 5 pu and initial DC fractions ranging from 0 to 100%, using 10 records per case. Faults with pu or were reliably detected, with a median timing error of one sample. Missed detections occurred only for weaker faults ( pu and ), where limited waveform changes make fault identification more difficult. No false alarms were observed, and MO remained below 4.1% across all tested records.
The proposed method requires 2.4–2.5 ms per window on a single CPU thread, below the 4.17-ms quarter-cycle update interval.
| Scenario | Method | MO (%) Mean / p90 | TVE (%) Mean | Settling (ms) 5% / 2% |
| Single DDC | DFT | 10.20 / 21.41 | 6.24 | 19.7 / 29.2 |
| Single DDC | Abdoos | 13.76 / 36.89 | 2.69 | 18.3 / 29.6 |
| Single DDC | PySR | 10.53 / 21.86 | 6.76 | 24.3 / 29.5 |
| Single DDC | Proposed | 1.32 / 2.25 | 0.60 | 12.4 / 13.6 |
| Dual DDC | DFT | 13.59 / 26.29 | 9.20 | 24.6 / 31.1 |
| Dual DDC | Abdoos | 18.03 / 45.83 | 4.38 | 20.6 / 29.4 |
| Dual DDC | PySR | 13.04 / 26.03 | 9.39 | 24.8 / 31.1 |
| Dual DDC | Proposed | 2.22 / 3.65 | 0.88 | 12.6 / 15.7 |
| Circuit | DFT | 9.50 / 15.84 | 4.30 | 24.5 / 33.4 |
| Circuit | Abdoos | 3.30 / 5.57 | 1.72 | 21.4 / 35.1 |
| Circuit | PySR | 9.97 / 16.45 | 5.08 | 30.2 / 36.6 |
| Circuit | Proposed | 1.62 / 3.12 | 0.60 | 13.0 / 15.8 |
Table 2. Online Phasor Estimation and Settling Time
Circuit-Level Validation
To evaluate the estimator beyond the synthetic signal model, adapted from [18], single phase faults were simulated on a three-phase, 230-kV, 60-Hz two-source system in MATLAB/Simscape Electrical. Fault resistance, location, and inception angle were varied across 270 records. The resulting currents include circuit-dependent DC offsets and additional dynamics introduced by line capacitance, zero-sequence paths, and anti-aliasing filtering, which are not explicitly represented in the assumed waveform model. All records were processed online without retraining.
As shown in Table II, the proposed method maintains low MO and TVE, with substantially faster settling than baseline models, demonstrating generalization to circuit-level simulations despite dynamics not explicitly captured by the assumed signal model. Fault inception was successfully detected in 265 of 270 records, with missed detections occurring only at low SNR (below 21 dB).
Sensitivity to Frequency Deviation
Frequency sensitivity was evaluated over 59.5–60.5 Hz, with all estimators fixed at the nominal 60 Hz. As shown in Table III, the proposed method consistently achieves the lowest mean TVE under both single- and dual-DDC conditions. Its error increases approximately symmetrically with frequency deviation, indicating sensitivity to mismatch in the fixed-frequency sinusoidal basis. The baseline methods exhibit smaller changes but maintain substantially higher absolute errors. The greater sensitivity under dual DDC suggests that additional exponential components complicate phasor estimation
| Single DDC | Dual DDC | |||||||
| (Hz) | DFT | Abdoos | PySR | Prop. | DFT | Abdoos | PySR | Prop. |
| 59.5 | 6.25 | 2.93 | 6.84 | 1.44 | 9.21 | 4.53 | 9.46 | 1.92 |
| 60.5 | 6.25 | 2.94 | 6.79 | 1.47 | 9.21 | 4.55 | 9.50 | 1.96 |
Table III. Mean online TVE (%) under frequency deviation
Vector (PDF)
caption: Online fundamental amplitude estimation with a quarter cycle step and without prior knowledge of fault inception time. The proposed method retains the pre-fault phasor until 150 post-fault samples are available.
under model mismatch. These results motivate incorporating frequency as an additional nonlinear parameter in variable projection, which are out of the scope of current work.
Conclusion
A transformer trained offline can supply the structure and the nonlinear starting point of a physics-constrained variable-projection fit, turning one window of POW samples into an interpretable expression of the fault current: the fundamental phasor, the DDC parameters, and, for windows that contain the fault, the fault time. Without known fault instant, the estimator kept the mean maximum overshoot through the fault at 1.3–2.2%, where the DFT reached 10–14%, reported the post-fault phasor about 12.5 ms after inception, and transferred without retraining to fault currents from an electromagnetic-transient simulation. The limitations are the nominal-frequency model, a structure head that is only preliminarily tested, and simulated data. Future work will add frequency to the variable projection, train on variable structures, and evaluate field POW records.
References
- [1]G. Benmouyal, E. Schweitzer, and A. Guzmán, “Synchronized phasor measurement in protective relays for protection, control, and analysis of electric power systems,” in 57th Annual Conference for Protective Relay Engineers, 2004. IEEE, 2004, pp. 419–450.
- [2]H. Cheng, H. Sun, S. Kawano, D. Nikovski, S. Kitamura, and W. Su, “A fault detection and location technique for inverter-dominated islanding microgrids,” in 2022 IEEE 5th International Electrical and Energy Conference (CIEEC). IEEE, 2022, pp. 2041–2046.
- [3]H. Mohsenian-Rad and W. Xu, “Synchro-waveforms: A window to the future of power systems data analytics,” IEEE Power and Energy Magazine, vol. 21, no. 5, pp. 68–77, 2023.
- [4]L. Tong, X. Wang, and Q. Zhao, “Grid monitoring with synchro-waveform and AI foundation model technologies,” Energy Systems, 2025.arxiv.org/abs/2403.06942
- [5]Z. Liu, Y. Zou, H. Zhao, J. Han, and Y. Liu, “An analytical phasor estimation method for transient currents considering double decaying DC offsets,” IET Generation, Transmission & Distribution, vol. 20, no. 1, p. e70309, 2026.DOI
- [6]E. Rosolowski, “Development of a new phasor measurement algorithm with decaying DC offset removal,” Bulletin of the Polish Academy of Sciences Technical Sciences, vol. 74, no. 2, p. e157324, 2026.DOI
- [7]C.-C. Chu, T.-H. Ku, and C.-S. Wu, “Enhanced DFT-based frequency and phasor estimation from faulted power system measurements with decaying DC offsets,” in 2025 IEEE Industry Applications Society Annual Meeting (IAS), Taipei, Taiwan, 2025, pp. 1–7.DOI
- [8]X. Ma, Y. Wu, X. Xiao, Y. Wang, Z. Yuan, and Z. Gui, “An M-class PMU iterative interpolated algorithm considering DC offset,” IEEE Transactions on Power Delivery, vol. 40, no. 5, pp. 2850–2861, 2025.DOI
- [9]X. Wang, W. Li, B. Song, and J. Xu, “High precision decaying DC component estimation algorithm,” in 2025 10th Asia Conference on Power and Electrical Engineering (ACPEE), 2025, pp. 334–338.DOI
- [10]C. D. L. da Silva, G. C. Junior, L. Mariotto, and G. Marchesan, “Phasor estimation in power systems using a neural network with online training for numerical relays purposes,” IET Science, Measurement & Technology, vol. 9, no. 7, pp. 836–841, 2015.
- [11]V. Sok, S.-W. Lee, S.-H. Kang, and S.-R. Nam, “Deep neural network-based removal of a decaying DC offset in less than one cycle for digital relaying,” Energies, vol. 15, no. 7, p. 2644, 2022.DOI
- [12]S. Mohammadi, R. Haghighi, A. Hassan, V.-H. Bui, M. Wang, and W. Su, “Fast accurate phasor estimation in less than one cycle using neural networks,” in 2024 IEEE 18th International Conference on Control & Automation (ICCA), Reykjavik, Iceland, 2024, pp. 359–363.DOI
- [13]M. Tajdinian, B. Behdani, and M. Popov, “Supervised machine learning-assisted current transformer waveform reconstruction for fundamental fault current phasor estimation,” International Journal of Electrical Power & Energy Systems, vol. 173, p. 111436, 2025.DOI
- [14]S. Mohammadi and W. Su, “Symbolicphasor: Power system phasor estimation via deep symbolic regression,” arXiv preprint arXiv:2608.08552, 2026.arxiv.org/abs/2608.08552
- [15]G. V. Hollweg, V.-H. Bui, F. L. Da Silva, R. Glatt, S. Chaturvedi, and W. Su, “An rmac with deep symbolic optimization for dc–ac converters under less-inertia power grids,” IEEE Open Access Journal of Power and Energy, vol. 10, pp. 629–642, 2023.DOI
- [16]M. Vastl, J. Kulhánek, J. Kubalík, E. Derner, and R. Babuška, “Symformer: End-to-end symbolic regression using transformer-based architecture,” IEEE Access, vol. 12, pp. 37 840–37 849, 2024.arxiv.org/abs/2205.15764
- [17]G. Golub and V. Pereyra, “Separable nonlinear least squares: The variable projection method and its applications,” Inverse Problems, vol. 19, no. 2, pp. R1–R26, 2003.DOI
- [18]A. Haji-Mohammadi, M. Sanaye-Pasand, and S.-A. Ahmadi, “Novel method for decaying dc component removal based on solving the differential equations,” IEEE Transactions on Power Delivery, vol. 40, no. 2, pp. 693–704, 2024.
- [19]A. A. Abdoos, S. A. Gholamian, and M. Farzinfar, “Accurate and fast dc offset removal method for digital relaying schemes,” IET Generation, Transmission & Distribution, vol. 10, no. 8, pp. 1769–1777, 2016.DOI

