Exponential Modulation Integral Observer for Online Detection of the Fundamental and Harmonics in Grid-Connected Power Electronics Equipment

Harmonic current estimation is required in active power filters for compensation purposes. The most efficient way of calculating the total harmonic current up to the infinite order is to subtract the fundamental component from the distorted current. Direct determination of the fundamental component of a distorted current of mains frequency was realized recently with a third-order modulation integral observer. This article shows that using an exponential modulation function (Exp-MF) for the integral observer will: 1) significantly enhance the robustness of the observer against noise and 2) automatically remove the low-frequency envelope arising from the D/A and A/C sampling processes compared to previous polynomial modulation function. These new and advantageous features are supported with detailed analysis and experimental verification. The robust observer can be implemented in grid-connected power electronics circuits that require the instantaneous information of the fundamental and/or harmonic currents. Practical comparative tests with the adaptive notch filter and recursive discrete Fourier transform (DFT) methods in an active power filter have confirmed the good performance under both the steady and dynamic states of the proposed Exp-MF integral observer.


require the instantaneous information of the fundamental and/or harmonic currents. Practical comparative tests with the adaptive notch filter and recursive discrete Fourier transform (DFT) methods in an active power filter have confirmed the good performance under both the steady and dynamic states of the proposed Exp-MF integral observer.
Index Terms-Active power filters (APFs), fundamental extraction, harmonics detection.

I. INTRODUCTION
T HE increasing use of nonlinear loads has prompted the harmonics pollution issues in power systems since the 1980s [1]. The power electronics community responded to this challenge by developing active power filters (APFs) [2]- [4] which inject approximate harmonic currents into the ac mains ( Fig. 1) in order to comply with various international electromagnetic compatibility (EMC) regulations such as the IEC-61000. A seminal review paper [5] on harmonics detection methods for APFs was published in 2007. This review paper compares six methods listed as follows: discrete Fourier transform (DFT) [6], [7], recursive DFT [8], [9], synchronous fundamental dq-frame [10], [11], fifth harmonic dq-frame [12], p-q theory [13], and generalized integrators. But since its publication, new methods not previously included have been reported. Among them is a modulation integral observer algorithm that adopts a totally different approach [14].
Based on the theoretical work in [14], it is reported in [15] that using modulation integrator observer, which determines only the fundamental component of a periodic signal, can be used to obtain the total current harmonic content up to infinite order by simply subtracting the fundamental component from the nonlinear input current. Because such a method can be implemented with a third-order observer, it is shown in [15] that it is a fast method with high accuracy. Such an approach is conceptually simple and computationally efficient. It has the advantage of no phase delay between the actual and reconstructed fundamental components of the distorted waveform. Moreover, the proposed method requires only single-phase current measurements for fundamental signal reconstruction. Therefore, it can be easily extended to a three-phase system without being affected by the unbalanced load.
In this article, the robustness of the modulation integrator observer method against noise and the aliasing issues caused in the A/D and D/A conversion process are explored for practical implementation of the modulation integral observer in a noisy environment. The novel contribution involves the use of a new exponential modulation function (Exp-MF) which can both increase the observer's robustness against noise and eliminate the practical aliasing issues. The mathematical proof on the robustness of the Exp-MF over the original MF is included. Practical comparisons of the exponential and the original MF is also provided to confirm the robust performance of the exponential modulation integral observer. Finally, the real-time performance of the time-domain Exp-MF method is practically compared with that of the adaptive notch filter (ANF) and frequency-domain recursive DFT (RDFT) methods in an APF application (Fig. 1).

II. SUMMARY OF THE INTEGRAL OBSERVER WITH POLYNOMIAL MODULATION FUNCTION FOR DETECTING THE FUNDAMENTAL COMPONENT
This section briefly summarizes the integral observer based on the polynomial modulation function (Fig. 2) that was published in [15]. The line current i (t) is expressed as where t is the time variable, c is the dc current component, and where a is the amplitude of the fundamental current, ω is the angular frequency, θ is the phase angle, and ϕ is the initial phase angle. The integral observer considers the total harmonic current as "noise" initially. If y(t) can be obtained by the observer, from (1) and (3), the total harmonic current can be obtained easily as follows: where y (2) (t) is the second-order time-derivative of y(t). Based on (3) and (5), one can form the following expression: As can be noticed, y(t) can be formulated as the output of a third-order state-space observable system where Since z 1 (t) = y(t), the total harmonic current can be derived if z 1 (t) is available. In addition, the dc offset and the fundamental component can be individually recovered after simple algebra [6] where G = 1 0 −(1/ω 2 ) and H = 0 0 (1/ω 2 ) .

III. EXISTING POLYNOMIAL MODULATION FUNCTION AND THE PROPOSED EXP-MF FOR THE INTEGRAL OBSERVER
In previous works [14], [15], a polynomial MF (10) in Table I was used to illustrate the effectiveness of the integral observer in determining the fundamental component. In this article, we focus on the use of the new Exp-MF (11) and compare the performance of these two MFs. As can be noticed, the Exp-MF φ e,h (t) inherits from the polynomial MF φ p,h (t) by multiplying an exponentially increasing term e w h t . The purposes of introducing the Exp-MF will be illustrated in Section IV.
In the following, we will use φ h (t) to denote an unclassified modulation function (which can be either polynomial or exponential). The MFs designed for this application must satisfy two conditions.
1) The MF and its first (n−1)th derivatives have 0 initial conditions, such that 2) The modulation function matrix defined as is invertible for any t ≥ t > 0, where t is a small time instant. Condition 2) can be verified by calculating the determinant of (t). For example, with the MFs selected from (10), it is immediate to obtain det((t)) = − w 1 w 2 w 3 t 9 8640 = 0 ∀t > 0 which implies the invertibility of (t). Following the same steps, the invertibility of (t) in the context of the Exp-MF [see (11)] also can be verified by simple algebras.
With the availability of the modulation function matrix, the following matrix equation can be formed: Hence, where the elements of column vector T can be obtained from the practical measurements of the line current i (t). It follows that To avoid error-accumulation and windup of the pure integrator operator (15) in case the measurement of i (t) is noisy, a periodic resetting strategy is integrated (see Appendix for the derivation of the resetting mechanism [14]). As such, the integral operator (15) is rescaled at time instants t k , defined as where T r is the period of the resetting scheme, while T represents the temporal window length of the integration after each rescaling event, T r ≥ T . When k = 0, t 0 = T + T r , which represents the first resetting instant. Subsequently, the resetting period is fixed at T r . In this context, the first derivative of v (1) φh (t) can be obtained from the practical measurement of the line current i (t), as follows: v (1) Then, v φh (t) can be calculated iteratively, and the value of The smoothness of the rescaling strategy is justified in the Appendix.
Note that the line current is sampled at a relatively high speed within each repetitive period, and the integral values of (18) can provide the time-domain vector V φ (t) continuously at each sampling instant, then the state vector z(t) can be obtained from (14) as

A. Aliasing Issues in A/D and D/A Conversion Process
In practical implementation, analog-digital (AD) and digital-analog (DA) conversion processes are involved in the sampling of waveforms that tends to introduce additional perturbations to the current signal fed to the observer. A periodic reset of the algorithm [see (17) and (18)] is needed to avoid the accumulation of integral estimation errors. Such processes would lead to an aliasing phenomenon resulting in low-frequency ripples in the envelope of the estimated fundamental component. This section mathematically characterizes the aliasing phenomenon, which is then addressed by the newly developed Exp-MF.
To proceed with the analysis, let us consider that the harmonic current signal i (t) is perturbed by a broadband noise n(t). Then, the perturbed signal is expressed aŝ where n(t) and the unmodeled high-order harmonics N k=2 i k (t) are treated as the additive disturbance in the estimation scheme. With reference to (17), the noisy input i (t) gives rise to a noisy auxiliary signalv φh (t), as shown by (20), as shown at the bottom of the page, with d(t) n(t)+ n k=2 i k (t). In contrast to the precise counterpart v φh (t) that is driven by y(t), the additive perturbation d(t) leads to an error signal,ṽ φh (t) v φh (t) − v φh (t), expressed as (21), shown at the bottom of the page, whereṽ is the rescaled error, depending on the terminal error of the previous time interval In view of (19) and (21), the estimation error of y(t), defined byỹ(t) ŷ(t) − y(t) takes on the form of (22), as shown at the bottom of the page, with is the rescaled terminal error at the end of the previous time interval. Because of (9), the total errorỹ(t) consists of two parts: the fundamental current estimation errorĩ 1 In view of (22), the integral operator offers satisfactory attenuation of the high-frequency components, including the harmonics N k=2 i k (t) and the high-frequency contents contained in n(t). However, the remaining low-frequency components, unless being zero-mean and uncorrelated with the modulation function (t), the error signalỹ(t) is prone to diverge due to the error accumulation within two continuous resetting instants. In combination with the resetting mechanism that inherently prevents the drift by downscaling the estimation error, the resulting fundamental signal estimates appear as a swinging sinewave. A numerical example is shown in Fig. 3, which is obtained by repeating the simulation example presented in [6] whereas the harmonic current signal is affected by a nonzero mean uniform distributed disturbance.

B. Antialiasing Solutions
Now, two possible approaches are introduced to reduce the aliasing effect.

1) Prefiltering of the Current Signal i (t):
It is intuitive to apply a prefilter to filter out the low-frequency contents in i (t), such that the swing phenomenon can be removed. With the aim of maintaining the amplitude and phase angle of the fundamental signal i 1 (t) in the filtered signal, a specialized bandpass filter is designed with ω s = 2π · 50 and K s = 1.
It is important to note that the gain of the filter F(s) at the fundamental frequency 50 Hz is 0 dB and the associated phase shift is 0, and consequently the fundamental signal i 1 (t) can be accurately estimated by the observer without using any post-correction scheme for the phase and amplitude. The effectiveness of F(s) are illustrated by the same simulation example deployed in Section VI-A. As shown in Fig. 4, the swing phenomenon is favorably eliminated by adding the bandpass filter to the observer scheme. However, the additional filter slows down the convergence speed at the beginning due to the transient response of the filter and also increases the overall complexity of the methodology.
2) Exponential Modulation Function: In this section, it will be shown that the aliasing issue can be addressed by the newly designed Exp-MF φ e,h (t) (see Table I) without using an additional filter, thereby the convergence speed is not compromised.
To proceed with the analysis, let us first recall the MFs selected from (10) and (11) In view of (21), the estimation errorṽ φh (t) at an arbitrary time instant is composed of two parts: 1) the rescaled terminal error at the end of the previous time-interval (initial error at t = 0 is 0) and 2) the accumulated error within the present time-interval. Next, the error comes from 2) will be investigated first whereas the error signal 1) will be studied later.
Without loss of generality, let us pick the first time-interval t ∈ [0,t 0 ]. In the context of the polynomial case, the estimation where As can be noticed, the sensitivity function of the system (28) (that is |1 − G p1,i ( j ω)|) has the sensitivity peak at ω d i sincẽ v φe1 (t) = t 0 e w 1 τ w 4 1 τ 5 120 the closed-loop transfer function G p1,i (s) is characterized by imaginary poles at ± j ω d i . Therefore, the system (28) is sensitive to d i (t), which also implies thatṽ φp1 (t) is sensitive to all frequency components. Analogously, it can be inferred that v φp2 (t) andṽ φp3 (t) are also sensitive to periodic disturbances when polynomial MFs (24) are applied. By analogy to (26), the error termṽ φ1 (t) driven by the Exp-MF φ e,1 (t) is expressed as (29), shown at the bottom of the previous page, with p 2 = 1, p 3 = 2, p 4 = 3, p 5 = 4, q 1 = 1, q 5 = 2, α 2 = 2, α 3 = 2, α 4 = 8, α 5 = 120, β 4 = 24, β 5 = 120. By following the same steps where G e1,i (s) is the transfer function induced by Exp-MFs. Due to the exponential term e w 1 t , all the imaginary poles at ± j ω d i are shifted to the right-hand side of the complex plane by w 1 , such that the new poles are w 1 ± j ω d i . In this context, the sensitivity to sinusoidal disturbances, d i , i = 1, 2, . . . , M, is significantly reduced. For the sake of completeness, the bode plots of G p1,i (s), G e1,i (s) with w 1 = 45 and ω d i = 5 Hz are depicted in Fig. 5 as an illustrative example. As can be seen, the sensitivity peak appears in G p1,i (s) is effectively removed in the exponential counterpart G e1,i (s).
Although closed-loop transfer functions G p1,i (s), G e1,i (s) in both cases are not stable (because of multiple 0 poles in the polynomial case and poles with positive real parts in the exponential case), the divergence of the estimation errorṽ φ1,i (s) evoked by the unstable poles (introduced by the polynomial and exponential functions, respectively) are highly attenuated inỹ(t) by the MF matrix (t) −1 as the rates of the divergence are compensated by the rate of decay (i.e., (t) −1 formed by the same type of MFs in each case). Finally, the boundedness of theỹ(t) is rigorously ensured by the resetting mechanism with the properly selected T , T r , and the observer scheme is subject to input-to-state stability [15]. Generally, the algorithm has to be reset frequently enough to avoid error accumulation and thereby to ensure stability.
Next, the initial error (rescaled terminal error at the end of the previous time-interval) at each time-interval will be studied. We demonstrate that the rescaling gain of the Exp-MFs is much smaller than the one induced by the polynomial MFs for possible choices of T and T r around 0.1 s (which is selected for both resetting coefficients in [6]). Let us consider the norm of the rescaling gains in both cases where p and e represent the MF matrix formed by polynomial and Exp-MFs, respectively. The map of the ratio γ p /γ e with respect to T and T r is illustrated in Fig. 6, where the benefit of Exp-MFs in terms of scaling down the gain is clearly presented. As such, the rescaled error of the Exp-MFs at each resetting instant tends to be smaller as compared to the polynomial counterparts by also considering the noise sensitivity in both scenarios. Now, it is possible to infer from the analysis that the robustness of the modulation integral observer is expected to be improved by replacing the polynomial MFs with the exponential ones. Thus, the swing phenomenon tends to be suppressed without adding an extra filter, which will be experimentally verified in Section IV.

V. PRACTICAL IMPLEMENTATION AND EVALUATION
Four sets of practical tests have been conducted to evaluate the performance of the proposed method. First, the robustness of the exponential and the polynomial modulation functions are compared under different noise levels. Second, a comparison of the computation time between polynomial and exponential modulation on FPGA and microcontroller is evaluated. Third, the practical implementation of the exponential modulation in an APF is demonstrated in a hardware setup. Finally, the dynamic performance has been compared between RDFT and Exp-MF methods.

A. Comparison of the Exponential and Polynomial Modulation Functions for the Integral Observer
Practical tests have been conducted to compare the performance of the two MFs under noiseless and noisy situations.  The reference waveform used in this test is shown in Fig. 7 and its harmonic content is given in Table II. Note that this reference waveform is based on the example (with the same relative harmonic ratios) used in the comparison in [5] for a range of harmonic detection methods. The third harmonic is not included because it is canceled in a three-phase power system with a delta-connected transformer. In the experiment, the weighted coefficients w 1 , w 2 , w 3 are selected as 45, 35, and 15 for both polynomial and Exp-MFs. The fundamental rule for tuning w 1 , w 2 , w 3 is to minimize the condition number of (t), in order to render feasible the practical inversion of (t), in the interval [t , T + T r ]. Note that the inverse matrix (t) −1 can be computed analytically once the MFs have been chosen, thereby the inverse can be implemented directly, to avoid online matrix inversion. The noise used for the practical tests is the Gaussian white noise and the peak to peak magnitude of the noise is set at 0.26, 1, 2, and 3 V. The reset time is T = T r = 0.1 s and the sampling frequency is 10 kHz. The harmonic current and the noise are generated by the function generator Tektronix AFG3102C and the algorithm is implemented by dSPACE DS1006.
The error is calculated by the following method. First, a predesigned harmonic current and fundamental current are injected by a functional generator to the dSPACE. Also, a fundamental current is injected into the dSPACE at the same time. Hence, the reconstructed fundamental current will be subtracted by the injected fundamental current in the program and output by the digital-to-analog converter (DAC) to the scope and further analysis can be carried out by capturing the  data. The method used here is to eliminate the phase error between the reconstructed and injected fundamental current as the functional generator can provide the two signals that are perfectly in phase. Fig. 8(a)-(c) shows the actual and reconstructed fundamental waveforms by the polynomial MF integral observer under noiseless and different noisy conditions. The corresponding measurements for the Exp-MF integral observer are shown in Fig. 9(a)-(c). It can be seen from Fig. 8(a) to (c) that the polynomial MF integral observer can estimate the fundamental component accurately when there is no noise. But the quality of the reconstructed fundamental waveform deteriorates with the increasing noise level. The reconstructed fundamental is affected by the noise and suffers from a swing issue. Therefore, the results are highly affected. However, the reconstructed fundamental waveforms using the Exp-MF integral observer are relatively closer to their ideal sinusoidal references with no obvious swing phenomena.
An alternative way to observe the robustness against noise is to plot the error-time series. Such results under different noise conditions (noise levels of 0, 2, and 3 V) are plotted in Fig. 10(a)-(c). In all cases, the Exp-MF has less error and outperforms the polynomial MF. These practical results confirm that the Exp-MF integral observer has more robustness against noise than the polynomial counterpart. These waveforms are  further analyzed so that their root-mean-square (rms) error and error boundary (which is the maximum error minus the minimum error) are obtained. Table III shows the rms error and the error boundary for both MFs.

B. Comparison of Computational Times of Online Implementations in Microcontroller and FPGA
The previous section shows that the Exp-MF has a better performance and robustness against noise than the polynomial function when used in the integral observer. A typical APF is  controlled by a microcontroller or DSP which has a limited computation power. Therefore, a microcontroller and FPGA are selected to implement the algorithm for comparison of the computing times. The basic specifications of the microcontroller and FPGA are listed in Tables IV and V. Two development boards for the MCU and FPGA have been implemented with the exponential modulation integral   observer algorithms. The sampling frequency is set at 10 kHz. The periodic distorted waveform generated by the signal generator and the reconstructed fundamental waveform generated by the STM32H7 development board are shown in Fig. 11. The comparison of the execution times between polynomial and exponential function are listed in Table VI. It is noted that the Exp-MF requires only 67.5 μs, which is well within the sampling time of 100 μs of the 10 kHz sampling time. This result confirms that such an algorithm can be implemented in MCU. The execution times of the algorithms are about 6 μs in FPGA.

C. Practical Comparison of ANF, RDFT, and Exp-MF Methods in an APF Application
A hardware setup similar to that of Fig. 1 has been employed to investigate the real-time performance of the proposed algorithm. Fig. 12 shows the photograph of such a setup. In the experiment, a KIKUSUI PBZ40-10 bipolar power supply is to emulate the power grid; a Delta VDF015M21A drive system (VFD) is used as the nonlinear load to generate the harmonic current; another KIKUSUI PBZ40-10 bipolar power supply has been set to current mode and acts as the APF. Since the bipolar power supply could only supply a 48-V ac voltage, an autotransformer is connected in between the VFD and the bipolar supply to step-up the voltage to 200 V.

1) Steady-State Performance:
The nonlinear load current drawn by the variable speed drive system is sampled at a frequency of 10 kHz. The proposed integral observer with the Exp-MF is compared with the ANF and RDFT methods. For the integral observer, the weighting factors are tuned offline to be w 1 = 45, w 2 = 35, and w 3 = 15. T r = T = 0.1. A pair of RDFT filters are employed with the order 0 and 1 for the offset and fundamental, respectively. The ANF is tuned with ζ a = 1 and γ = 10. Also, the test frequency is extended to a range between 48 and 52 Hz in order to study the robustness of the algorithms for both strong and weak power grids. Details of ANF and RDFT implementations can be found in the appendix of the work [15].
The total harmonic distortion (THD) of the grid current is calculated by the Voltech PM6000 power analyzer. The data are captured after one minute of operation so as to reduce the error caused by transients. Fig. 13 shows the mains voltage and the highly distorted input current before harmonic compensation by the APF. The total harmonic content is about 50%. The corresponding mains voltage and input current at 50 Hz after compensation by the APF based on the ANF, RDFT, and the Exp-MF methods are shown in Figs. 14, 15, and 16, respectively.
The THD values of the compensated currents of the three methods under comparison have been measured from 48 to 52 Hz with an increment of 1 Hz. These THD values are tabulated in Table VII. These results show that the performances of both RDFT and the integral observer with the Exp-MF are comparable and are much better than the ANF method. In this set of tests, the Exp-MF method has a slightly lower THD than RDFT. Input current (blue) and power supply voltage (red) without compensation at 50 Hz.     [16], [17]. Under these practical requirements, three representative cases are studied where the fundamental frequency comprises a frequency ramp from 50.5 to 49.5 Hz with different slopes 1) RoCoF = −0.2 Hz/s for a period of T = 5 s 2) RoCoF = −0.4 Hz/s for a period of T = 2.5 s 3) RoCoF = −1.0 Hz/s for a period of T = 1 s. A dynamic response test is set up to evaluate the performance of the Exp-MF and the RDFT methods. A dSPACE system is used to control a bipolar power supply to generate a distorted current of the shape shown in Fig. 7   errors and error boundaries than the RDFT method in all three cases.
The error signals of RDFT and Exp-MF method in case (c) are depicted in Fig. 17, where the scale of both methods is the same. The results verify the superior performance of the proposed estimation scheme.

VI. CONCLUSION
An integral-observer-based modulation function was recently reported to be a fast and effective solution in detecting the fundamental and thus the total harmonic content of a periodic waveform. The novel contributions of this article include a thorough theoretical analysis, a mathematic proof, and practical verification that an integral observer based on an Exp-MF will offer better robustness against noise and aliasing issues than that based on a polynomial modulation function. The computational times obtained in real-time implementation confirm that the proposed exponential modulation integral observer can be used in low-cost MCU for real-time operation. The proposed method has been practically compared with the ANF and RDFT methods in a practical real-time application of an APF. The THD values confirm the good performance of the proposed method. Under a range of rate of change of frequency in an ac power system, the proposed method provides a re-constructed fundamental component from a distorted waveform with a smaller error and error boundary than the RDFT method. Thus, the proposed method can provide good performance in both fixed and variable frequency situations. The study advances the integral observer technology for identifying the fundamental and hence the total harmonic content by introducing a new Exp-MF to enhance the integral observer's robustness against noise and mitigate the aliasing issues. Its ability to withstand noise in the sampled signal has been theoretically analyzed and proved, and also experimentally verified. The Exp-MF integral observer offers the combined advantages of fast computation and high robustness. It is a feasible option for adoption in grid-tied power inverters that require the information of the fundamental and harmonic content in real time for control purposes.

A. Periodic Rescaling Strategy
To introduce the rescaling strategy, let us now consider the time-shifted counterpart of the modulation integral (15) where t 0 is a time instant different from 0. On this occasion, a time-shifted version of (14) can be obtained Define two positive scalars T and T r , dividing the time span into successive segments terminated at t k = T + (k + 1)T r , k = 0, 1, . . .
Noting that (A2) holds for any generic t 0 , the following two equations both hold, for all t > t k − T , k = 1, 2, . . .
It is worth pointing out that the vector signal V φ (t|t k − T ) contains the information collected in the time window [t k − T , t], while V φ (t|t k−1 − T ) contains information collected in a longer time-window [t k−1 − T , t]. Referring to the two identities in (A3), it is possible to establish an algebraic relation between V φ (t|t k −T ) and V φ (t|t k−1 −T ) that permits to discard old information carried by the data processed in the interval [t k−1 − T , t k − T ]. Therefore, for t = t k , according to (A.3), it holds that which can be reformed as That is to say, the vector V φ (t k |t k − T ) can be computed from the vector V φ (t k |t k−1 − T ) through a simple algebraic rescaling, which is smooth as a result of (A3). For clarification, T r is the time between two rescaling events, while T represents the length of the equivalent integration window after each operation.
To ensure the error signal is downscaled after each resetting instant, the constant rescaling gain |(T )(T r + T ) −1 | needs to be sufficiently small (fulfilled by suitably designed T r and T ). Readers can refer to [14] for detailed characterization.