# Novel harmonic analysis method for smart metering

With wider deployments of smart metering, smart grids and distributed generation, power quality monitoring has become of great importance. Harmonic analysis of current and voltage signals allows several key power quality indicators. For example, an energy meter with harmonic analysis functions can characterize the state of the load or supply, enabling predictive maintenance or system optimization.

The presence of harmonics is an ever increasing concern for providers and consumers of energy alike. Excessive harmonic currents can lead to overheating of power transformers and reactive power compensators and neutral conductors. False tripping of protective relays can also be caused by harmonic currents.

Harmonic voltage and currents can also interfere with sensitive equipment operating in proximity to large harmonic generators. Traditionally, developers would use a digital signal processor to implement some version of the Fourier algorithm or bandpass filtering to perform harmonic analysis.

This article presents a new approach, titled Adaptive Real Time Monitoring (ARTM), and compares it against other possible methods: FFT algorithms and bandpass filtering. ARTM will be featured in the next generation Analog Devices (ADI) products for energy applications.

**Fourier based methods **

In energy metering or power quality monitoring systems, when the harmonic analysis is performed, phase currents and voltages are simultaneously sampled and then processed to compute the following power quality measurements on the fundamental and harmonic components: active, reactive and apparent powers, rms values, power factors, and harmonic distortions. Fast Fourier Transform (FFT) analysis comes immediately to mind. The procedure requires the following steps as in **figure 1**.

**Fig. 1: Steps required to implement FFT algorithm.**One must determine the period of the fundamental component. This can be a time consuming process that is typically realized by low pass filtering the phase voltages to isolate the fundamental and measuring the time between consecutive zero crossings. Any error in determining the period propagates to the error in amplitude and phase of the harmonics.

The sampling frequency must be modified to obtain 2N samples per period. This implies using analog to digital converters that allow variable sampling frequencies. Then one must acquire 2N samples corresponding to one or more periods. The last step is to execute the FFT algorithm. Samples taken across multiple periods increase the accuracy of the computations. But this means a heavier burden on the DSP and a slower overall response.

One can see that modifying the sampling frequency function of the fundamental period affects other calculations usually executed in an energy meter. Energy computations include a lot of filters that have coefficients computed function of the sampling frequency. Implementing an entire metering program with dynamic adjustment of such coefficients may be avoided if the Goertzel algorithm is adopted. This approach computes the DFT using a number of samples per period different than 2N, allowing for a constant sampling frequency independent of the fundamental period. The steps to implement such algorithm are as in ** figure 2**.

Fig. 2: Steps to implement the Goertzel algorithm.

The period of the fundamental component still needs to be determined as already presented for the FFT implementation. The sampling frequency is now constant and a certain number of samples per period are acquired. The coefficients used in the Goertzel algorithm are computed based on the number of samples per period. The Fourier transform is then executed.

**Bandpass filter based method **

Perhaps the simplest approach to harmonic analysis is to use bandpass filtering. It basically takes the phase currents and voltages and applies a narrow band filter around one harmonic. One can analyze multiple harmonics simultaneously if multiple filters are implemented in parallel. The steps to implement this approach are as described in * figure 3*.

*Fig. 3: Steps to implement a bandpass filter.*In this approach, the period of the fundamental harmonic still needs to be determined. The accuracy of this measurement needs to be substantially increased because at higher harmonics, there is the risk of missing the harmonic frequency of interest. This practically means longer time reserved to filtering the time period between consecutive zero crossings.

The filter coefficients are computed based on the fundamental period. The phase currents and voltages are filtered at the desired harmonic and the corresponding rms values are computed. One drawback of this method is that only the amplitude of the harmonic is preserved and any phase information is lost. Hence, the harmonic powers, the power factors and harmonic distortions cannot be computed.

**Adaptive real time monitoring (ARTM) **

Since the fundamental frequency of the power grid can drift over time, there is a great advantage to a harmonic analyzer that can track these changes in frequency automatically, without the user intervention. ARTM continuously estimates the likely value of the fundamental frequency and compares it to the real frequency present on the voltage line.

Any error coming out of this comparison is used as a feedback factor to increase or decrease the value of the estimated frequency. This is basically the self-adapting element of ARTM. Based on the estimated frequency or integer multiples of it, a real-time procedure to extract spectral components is performed on the voltage and current of a selected phase. This operation will create a set of values that are proportional with the energy present at the estimated frequency (or multiples of it). By performing further signal processing operations on these values, we can provide the real-time powers and RMS values at fundamental or integer multiples of the fundamental frequency (which, in fact, are the harmonics).

For polyphase systems, independent frequency estimators will be dedicated to each phase voltage. This way, even if the voltage of a phase goes down, the user can select one of the remaining ones to get an estimated frequency of the power grid and use it in the procedure mentioned earlier. By controlling the integer multiplication factor, it can be decided (in a flexible manner) which harmonic will be monitored. This has the advantage of dedicating all the DSP computational resources to monitor just the harmonics of interest.

By contrast, an FFT approach will be computing the values at multiples frequencies of the spectrum at once, but it will consume much more resources in doing so. To achieve the same performance levels, the memory locations needed to store a certain number of samples that will be used by the FFT algorithm are significantly higher when compared with this proposed real-time method. Monitoring a chosen harmonic will become even more powerful and relevant if the fundamental values are also monitored in parallel: it enables the computations of harmonic distortion (HD) ratios for RMS components of current and voltage, an indicator that sometimes is more meaningful than just the absolute values. In fact, from a purely theoretical DSP perspective, this is a widespread and accepted method of presenting data in a normalized fashion.

In one further step, by performing a sweep of the HD values for certain range of harmonic indexes, the total harmonic distortion (THD) can also be computed by adding the values obtained. Beside magnitude response over frequency, a classic and complete harmonic analyzer should provide information about the phase response at certain frequencies.

The ARTM provides phase information in terms of power factor calculation which is the ratio of active power versus the apparent power. ARTM computes power factor corresponding to fundamental frequency (known as displacement power factor) but also corresponding to various harmonic frequencies. Having these values in real time can be very useful as a global indicator of the power quality, but also for systems trying to implement control loops aimed at keeping the power factor within given boundaries. Another benefit of computing the active, reactive and apparent powers in real-time, is that energy values at fundamental or harmonics can be obtained through accumulations. This will allow the user to analyze how the total energy consumption is being distributed between fundamental and harmonic components. In 3 phase systems there is further interest in harmonic analysis of the neutral current and on the sum of phase currents, especially in the presence of triplen harmonics (odd multiples of the third harmonic) created by various non-linear loads.

Because the net effect of triplen harmonics is additive, the neutral conductor may end up carrying more current than it was designed for leading to overheating and possible fire. Triplens can also cause problems in three-phase delta transformers due to circulating currents that can overheat the windings. Being able to monitor the harmonic components on the neutral current as well as on the sum of phase currents can also be useful in indicating some potential imbalance issues.

** Table 1** shown above presents a comparative summary of the various methods discussed in this article. Bandpass filter and ARTM can be used to monitor the fundamental and harmonic components in real time. If the fundamental frequency of the power line changes, the ARTM method is proven to respond immediately with sufficient accuracy.

The memory occupied by an eventual implementation is very large in case of the FFT (because of the need for samples storage) and quite small in the case of the other methods. The accuracy of the results is very high for ARTM, medium for Goertzel algorithm and bandpass filter and low for the FFT.

**Fig. 4: Steps to implement Adaptive Real Time Monitoring.**
**About the authors:**

Petre Minciunescu is systems engineer and Gabriel Antonesei is senior DSP design engineer, both work at Analog Devices – **www.analog.com
**

Courtesy of eeNews Europe

Courtesy of eeNews Europe