Evaluation of Uncertainty in AC Power Calculation with Asynchronously Sampled Data

This article presents a comparison of several standard based methods for determination of the effective and the apparent AC power from sampled voltage and current signals. The comparison is based on the accuracy achieved in three different measurement scenarios, which is evaluated by means of Monte-Carlo-simulations. The comparison shows that the accuracy of the power estimation from asynchronously sampled data can be as good as the power estimation from synchronously sampled data. This allows for a reduction of the effort for synchronization between voltage and current channels while the overall performance remains equal.


Introduction
Measuring power is a standard task in electrical engineering. High accuracy of power estimation is of major interest in the in context of energy efficiency. For example, the optimization of a power factor correction device [1] with the intention to improve the efficiency will require a validation by measurement. Unfortunately, the power loss is not directly accessible by electrical measurement as rather the small difference between large quantities (input and output power) needs to be determined. This results in high demands on the accuracy of the measurement approach. By reaching physical limits of the efficiency factor, the improvements get smaller and the power measurements needs to be more and more accurate. For instance, an efficiency improvement from 98 % to 99 % reduced the loss by a factor of 50 % (and thus the generated heat!), whereas it can not be validated if the uncertainty of the power estimation is in the range of 1 % as this relates to the input and output power respectively.
It should be noted that power estimation has achieved very high accuracy for the sinusoidal case at mains frequencies. However, modern inverter technology often leads to signals that drastically deviate from the sinusoidal case and high order harmonics and also non-periodic components are commonly observable. Consequently, highly accurate methods for this situations are of major interest. Due to the advantages of the digitalization modern measurement systems operate in the discrete time domain and the arising question is, how accurate the various methods for the calculation are.

Problem description and objective
In order to estimate the electrical AC power in the digital domain it is necessary to sample the current and voltage and process them appropriate to approximate the continuous-time integral. When the sampling frequency is an integer multiple of the signal frequency, the power determination can accurately be performed in the (discrete) frequency domain. However, when the sampling frequency is not an integer multiple of the signal frequency, spectral leakage occurs, which reduces the accuracy. Things get even worse when the current and voltage signals are sampled asynchronously, as the spectral line obtained from the Discrete Fourier transform (dft) are no longer coherent.
Generally, voltage and current measurement require individual measurement devices. These devices can share the same clock generator, be synchronized, or run completely independent. The more they have in common, the more restricted is their general applicability as synchronization signals need to be transmitted besides the measurement data, which consumes additional hardware, wires and/or bandwidth. On the other side, an algorithm for computing the AC power from two devices has lower complexity when the quantities share common timings.
In context of asynchronous or synchronous samples, we investigate three different scenarios for the measurement setup: • The two analog-to-digital converter (adc) for the current and the voltage have a common clock generator (or accurate synchronization by means of a stable Phase Locked Loop) and thus have the same sampling frequency. This scenario will be denoted as oc (one clock generator). • The second scenario is that the two adcs run independently with two different clock generators and thus have slightly different sampling frequencies and the samples are not coherent in time. However, time stamps are available. The abbreviation of this scenario is tc (two clock generators). • The last measurement-setup is that the two adcs run independently but the clock generators are synchronized before every measuring interval and thus they have different sampling frequencies but no initial time-lag between the current and voltage. This scenario will be denoted as tc-s (two clock generators with synchronization).
The approximation of the continuous-time integral from samples can be done by different interpolation methods or by evaluating the integral in the frequency-domain. The focus of this paper is to compare these methods concerning their accuracy in the three different measurement scenarios. The organization of this paper is as follows. Section 2 explains the basic theory for measuring electrical power in the digital domain. Section 3 deals with the uncertainty of the various methods and scenarios. The conclusion is given in section 4.

Digital calculation of electrical power
This section deals with the theoretic background on the calculation of the AC power in the discrete time and frequency domain. The underlying time-continuous case is conform with the IEEE standard 1459 − 2010.
The evaluation of the AC power from the power grid and a linear load is considered, and thus it is legitim to assume voltage u(t) and current i(t) to be a composition of sinusoidal waves: where N w is the number of assumed harmonic waves. The cycle time T S of these signals is defined as T S = 2π ω and the effective power P and the apparent power S are then calculated as (2) where N S is the number of signal-periods.
The continuous time signals are reconstructed from the discrete time samples u[n] and i[n] which are in general not coherent in time and have different sampling-periods T u and T i . The sampled signals are denoted as where t s is the time-shift due to the unsynchronized adcs and N is the number of available samples. In the case of continuous running adcs it is sufficient to limit t s to be in the range 0 ≤ t s < T i since it is always possible to arrange the samples such that the time-shift is in the given range.

Evaluation in the time domain
The approximation of the continuous-time signals for evaluating (2) are obtained by interpolating the discrete time signals u[n] and i[n] with different interpolation functions f int (x): The effective power P in (2) and the apparent power S from (2) are then evaluated as where I int (n, k, T n , T k , t n , t k ) is Due to the convenient framework and versatileness of splines, cardinal splines of different orders are compared with the sinc function. A detailed comparison of them and further interpolation functions are given in [2]. Since the number of samples is finite and the interpolation functions have in general an infinite support, the effect of truncating the interpolation function is considered. A further aspect of truncation is the computational complexity of P and S since all integrals I int (n, k, T n , T k , t n , t k ) without a common support are zero a priori. The cardinal splines η α (x) with order α ∈ {0, 1, 2, 3, 5} are calculated according to [3]. The truncated versions of them η S α (x) and the truncated sinc function sinc S (x) have a supported on (−S, S). The cardinal spline of zeroth and first order η 0 (x) and η 1 (x) (nearest-neighbor and linear interpolation) have inherently finite support and are not truncated.

Evaluation in the frequency domain
Since the dft represents a scaled version of the Discrete Fourier Series under the assumption that the sampled signal is periodic, it is necessary to select a window such that it contains an integer number of signal cycles. Actually, this is only possible when the sampling frequency is an integer multiple of the signal frequency, otherwise it is an approximation. The signal-lengths N u and N i of the truncated voltage and current signals for the evaluation with the dft are chosen such that the truncated versions include almost a full number of signal-periods.
Nu n  (1) is then calculated as where the summation is over the indices corresponding to the harmonics and (.) denotes the complex conjugation. In the following, the AC power calculation using the dft is denoted by dft.

Simple power calculation in the time domain
The simplified calculation is based on the assumption that the sampling frequency 1 T of voltage and current is equal, the signals are coherent in time and the sampled signal is periodic. In this case the AC power is calculated as where ⌊.⌋ denotes rounding towards −∞. In the remainder of this article this method will be denoted by spc.

Uncertainty evaluation
Due to the enormous amount of parameters for the current and the voltage the uncertainty is evaluated by means of Monte-Carlo-simulation. The voltage is generated at random with the baisc conditions from the standard IEC 60038.

Simulation setup
The common parameters for all three measurement setups are: • The fundamental frequency f may vary between 47 and 52 Hz but is assumed to be constant for each sampling interval and the phase ϕ 0 is random between 0 and 2π. • The number of harmonics N w is defined to be N w = 25 The total harmonic distortion (thd) is smaller than 8 % and theÛ i are bounded according to IEC 60038. • The number of samples N is fixed to 4100 which corresponds to a sampling interval of approximately 1 s. Sampling a longer time can result in a higher accuracy but on the other side the time resolution of the calculated AC power decreases. Additionally a load is generated as a RLC-combination at random with values from 50 to about 2500 VA.
With the voltage u[n], which is randomly generated for each Monte-Carlo-simulation, the current is calculated by means of complex impedances. Depending on the measurement scenarios oc, tc or tc-s the measured current i m [n] is calculated.
In all three scenarios the measured voltage u m [n] and current i m [n] are independently corrupted by Additive White Gaussian Noise (AWGN) ν u [n] and ν i [n], with a standard derivation of σ u = 1 mV and σ i = 30 µA.
The effective power P and the apparent power S is calculated with the measured signals u m [n] and i m [n] and the methods explained in section 2. The true values P true and S true are calculated by means of complex AC-analysis.
All methods for calculating the AC power need the the fundamental frequency of the voltage and current signal. Therefor, the fundamental frequency is calculated by counting the average number of samples between the zero-crossings in u m [n]. This method is abbreviated by zc. Additionally, the frequency is estimated by finding the position of the first maximum in the estimated autocorrelation-function (abbr. acf) by means of Newton's method.

Simulation results
The following figures show the average of all Monte-Carlo-iterations relative absolute errors of the effective-and apparent power P and S, which are calculated as M [.] denotes the mean operator and the number of Monte-Carlo-iterations is chosen to be 100. A larger number of iterations did neither significantly influence the error-mean nor the errorvariance. The abscissa show the different methods for calculating the AC-power. Beside the mean absolute error the ordinate shows the quantile for 84.1 % and 15.9 %. Thus, 68.2 % of the absolute errors lie in the interval denoted by the quantiles. Figure 1(a) shows the absolute error of the effective power e P in the case of a setup with one clock generator (oc). The frequency estimation with zc (denoted by •) outperforms the acf method (denoted by * ). The accuracy limit of each method is achieved if the frequency is known exactly and the measurement noise is absent. This case gives a potential estimation and is denoted by x.
The accuracy of the setup with two independently running adcs (tc) is shown in figure 1(b). The interpolation methods with the measured samples perform slightly worse than in the case oc, but the possible potential of the configuration (perfect frequency estimation and no measurement noise) is noticeable worse.
The case tc-s, is illustrated in figure 1(c). The accuracy in this case is similar to the accuracy in the case oc and slightly better than in the case tc. A possible reason for this is that the uncertainty of interpolation between two samples is maximal in the middle of them and is zero at the sample points. Since the sample frequencies differ with a maximum of 100 ppm and the sampling period is one second, the worst possible time delay between the current and the voltage is 0.41 samples.
The error of the apparent power e S in figure 1(d) is independent of an possible time-shift t s between the voltage and current signal. Therefor the absolute error is the same in all three scenarios and just depends on the method of calculation.

Conclusion
It is not advisable to use a truncated sinc or cardinal spline of order 1 as interpolation function, since the sinc function has the worst performance in all scenarios for a given support S and the    The evaluation in the frequency domain is an alternative to interpolation in the time domain for all three scenarios because the computational costs are very low. A drawback is the high sensitivity concerning the estimate of the fundamental frequency.
The method SPC has a competitive accuracy in calculating the effective power P in the case of one common clock generator or synchronized signals, but performs poor in the case of free running adcs.
The overall conclusion is that the measurement setup does hardly influence the accuracy if a cardinal spline with an order greater than 1 or the dft is used. A benefit through the additional effort of the scenarios oc or tc-s will make sense if the frequency is measured more accurate and the measurement noise is low or if the spc method is used.