International Conference on Electrical, Electronics and Optimization Techniques (ICEEOT)-2016 Harmonic Detection Using Kalman Filter Vidit A. Desai Assistant professor, Electrical Department Vadodara Institute of Engineering, Vadodara desai.vidit30@gmail.com ο Abstract—Now a days, because of utilization of highly non-linear load and power electronic devices, harmonics are generated in the power system. These harmonics create stress on electrical devices connected to the power system. These harmonics also cause failure of devicesand/or create disturbances in performance of devices. Hence this sets a requirement of harmonic filters. However, before designing a filter, the process of harmonic analysis is essential. This paper describes the design of an Extended Kalman filter for PWM converter for harmonic detection. Measurement of magnitudes and frequencies of fundamental and harmonic components present in system voltage and current waveformsare detected in this paper. The result of this filter are compared with the results of Fast Fourier transform (FFT) function in MATLAB. Simulation results show that the Extended Kalman filter is more accurate and requires less time for harmonic detection as compared to others. Index Terms—Extended Kalman Filter (EKF), Discrete Fourier transform (DFT), Fast Fourier transform (FFT), PWM converter, Harmonic detection, Noise I. INTRODUCTION T he need for increased power system efficiency reliability and security has lead to introduction of wide use of nonlinear devices and loads. The nonlinear loads such as power converters, adjustable speed drives, and uninterruptible power supply (UPS) lead to harmonic pollution. The switching devices are most often pulse width modulationbased and they tend to further aggravate the noise and perturbations introduced in the power system. Sudden changes in load, switching transients tend to deviate the magnitude and frequency of fundamental and harmonic components from their nominal values. Therefore, it is becomes imperative to look for novel and efficient methods for accurately determining harmonic components present in the measured power signals thereby addressing the power quality issues. Of many detection techniques proposed for harmonic detection in the past, Fast Fourier transform (FFT) and Discrete Fourier transform (DFT) have been widely used because of their simplicity and effective computational abilities. However, the deviation of harmonic parameters like magnitude, frequency and phase etc., may lead estimation errors which create leakage effect in both the techniques. To overcome this leakage effect, the authors in [1], proposed a multi-spectrum-line interpolation correction algorithm (MICA) to correct both long-range and short-range leakage effect. However, MICA also tends suffers from problem of Sandhya Rathore Professor, Electrical Department SCET, Surat sandhya.rathore@scet.ac.in synchronous deviation.The drawback of synchronous deviation has been overcome by [2] using a phase difference algorithm. On the similar lines, the authors in [3] proposed a new algorithm for harmonic analysis. Yet another team of researchers proposed an algorithm that utilizes a NUTTALL window to decrease the long-range leakage. Therein three spectrum lines are chosen to reduce the short-range leakage by interpolation, refer [4] for greater details. A novel algorithm is introduced by Varaprasadetal. [5] to transform asynchronous sampling to synchronous sampling with customized mathematical formulae. All these algorithms are difficult to apply to some cosine windows with high-order or certain coefficient. Because of demerits of DFT and FFT technique, the adaptive linear combiner (ADALINE) method became more popular for harmonic assessment in the time domain. Artificial Neural Networks have been applied for harmonic detectionas well [6]. An alternative method using neural network algorithm is used for harmonic detection in noisy environments can be found in [7]. An adaptive linear neuron (ADALINE) is used for online estimation of fundamental component and selected harmonic content of a distorted signal [8]. An effective procedure based on the radial-basis-function neural network is proposed to detect the harmonic amplitudes of the measured signal [9].For the ADALINE filters, however, the results are easily affected when the signals contain harmonic components that are not included in the ADALINE structure. This problem can be overcome by introducing higher order harmonic filters but convergence of Fourier coefficient has to be compromised. Kalman filter is yet another very populartechnique because it accurately detects harmonic components under noisy condition. Kalman filter have been utilized for estimation of power system voltage, current and frequency in a digital AVR [10]. A novel Kalman filter is also used in three-phase power systems [11]. Online estimation of signal parameters is also done using Kalman filter in the presence of harmonic and noise distortion, refer [12]. An approach for decomposition of harmonic voltage and current using Kalman filter combined with a frequency detection algorithm can be found in [13]. In this paper, unlike ADALINE, DFT and FFT, we employ EKF filter to find out the harmonic components in terms of their magnitudes and frequencies to very high degree of accuracy. This paper represents designing of an Extended Kalman filter for detection of harmonic components upto 25th order in ac-to-dc-to-ac PWM converter. The organization of this paper is as follows. Section II presents the formulation of Kalman filter while section III describes the harmonic detection process of Kalman filter. Experimental and simulation results are represented in section IV and the conclusion is made in Section V. II. FORMULATION OF KALMAN FILTER III. HARMONIC DETECTION PROCESS USINF KALMAN FILTER The dynamics and measurements of non-linear control system under consideration may be represented as follows: The analog multi-frequency signal is not exactly periodic because amplitudes, frequencies and phases are continuously changes slowly over a time. So for that purpose we first take a periodic signal π¦(π‘) with a zero dc component and Fourier series representation of that signal as shown below π₯π = ππ−1 (π₯π−1 , π’π−1 , π€π−1 ) π¦π = βπ (π₯π , π£π ) where, π€π and π£π are the process and observation noises which are both assumed to be zero mean multivariate Gaussian noise with covariance ππ and π π π€π ~ (0, ππ ) and π£π ~ (0, π π ) respectively. The functions π and β are the process and measurement dynamics respectively. Extended Kalman filter uses the first order Taylor expansion of the process and measure dynamics by evaluating the Jacobian matrix. The Jacobians are required to be evaluated at each prediction step. These matrices are used in the EKF equations. This process actually linearizes the non-linear function around the present estimate. But before following above pattern, the filter can be initialized as follows: π₯Μ0 + = πΈ(π₯0 ) π π0+ = πΈ[(π₯0 − π₯Μ0 + )(π₯0 − π₯Μ0 + ) ] Before calculating present state and covariance matrix using time update equation, compute partial derivative matrices as follows: πππ−1 β ππ₯ π₯Μπ−1 + πππ−1 = β ππ€ π₯Μπ−1+ πΉπ−1 = πΏπ−1 And from partial derivative matrices, present state and covariance matrix can be represented as follows: + π ππ− = πΉπ−1 ππ−1 πΉπ−1 +πΏπ−1 ππ−1 πΏππ−1 + π₯Μπ− = ππ−1 (π₯Μπ−1 ,π’π−1 , 0) Once again, before calculating updated state and covariance matrix using measurement update equation, compute partial derivative matrices as follows: πβπ β ππ₯ π₯Μπ − πβπ ππ = β ππ£ π₯Μπ − π»π = π¦(π‘) = ∑∞π=1 ππ sin(ππ€π π‘ + π·π ), π‘ = 0,1,2, …. As the signal π¦(π‘) is not exactly periodic but parameters amplitude ππ , frequency π€π and phases π·π are slowly time varying. So, we can state them as follows: π€π = π€π (π‘) π = ππ (π‘) π·π = π·π (π‘) Assume that the signal π¦(π‘) is corrupted by white Gaussian noise. So the measurement can be given as follows: π§(π‘) = π¦(π‘) + π£(π‘) Now the task is to estimate π1 (t)..., ππ (t), π€π1 (t)…π€ππ (t)from the measurements where π represent the number of the significant harmonic components present in a signal. The parameters are only estimated up to ππ‘β orderharmonics and higher harmonics are assumed to be negligible. So total 2π of parameters areto be estimated. State space representation of a signal can represented as follows: π₯(π‘ + 1) = π΄π₯(π‘) + π(π‘) π§(π‘) = β(π₯(π‘)) + π£(π‘) = π¦(π‘) + π£(π‘) Where, π₯(π‘) = [π1 (π‘) , π2 (π‘) . . ππ (π‘) , π€π1 (π‘), π€π2 (π‘) … π€ππ (π‘) ]π β(π₯(π‘)) = ∑∞π=1 ππ sin(ππ€π π‘ + π·π ),and πΌπ 0 0 π΄= [ 0 1 0 ] Where, πΌπ is an identity matrix of ππ‘β order. 0 0 πΌπ And π(π‘) is a white Gaussian noise with a zero mean and has a variance represented as follows: πΈ[π(π‘)π(π‘)π ] = π Now by using Jacobian elements, updated state and covariance matrix and Kalman gain can be represented as follows: The observation noise π£(π‘) is also a white Gaussian noise with zero mean and has a variance represented as follows: πΎπ = ππ− π»ππ (π»π ππ− π»ππ + ππ π π πππ )−1 π₯Μπ + = π₯Μπ − + πΎπ (π¦π − π»π π₯Μπ − − ππ ) = π₯Μπ − + πΎπ [π¦π − βπ π₯Μπ − , 0)] + ππ = (πΌ − πΎπ π»π )ππ− πΈ[π£(π‘)π£(π‘)π ] = π which is uncorrelated with π(π‘).The same can be represented as follows: πΈ[π(π‘)π£(π‘)] = 0 Throughout the paper operator Eand π₯Μhas been used to denote expectation operation over a noisy variable. Furthermore, we have process noise variance π matrix which is diagonal in nature. From the equation of π₯(π‘ + 1) in the state space representation, we can conclude that the amplitude of harmonic components evolve randomly over a period of time. Also the same argument is true for the fundamental frequency of the signal. The rate of the random walk can be determined by diagonal π matrix. A Kalman filter will be applied for estimating π₯Μ(π‘/π‘) or π₯Μ(π‘/π‘ − 1) of π₯(π‘) from the measurement π§(π‘) . Here π₯Μ(π‘/π‘) denotes estimation of π₯(π‘) with given measurements at time π‘ and π₯Μ(π‘/π‘ − 1) denotes estimation of π₯(π‘) with given measurements at time π‘ − 1. π₯Μ(π‘/π‘) = π₯Μ(π‘/π‘ − 1) + πΊ(π‘)[π§(π‘) − β(π₯Μ(π‘/π‘ − 1))] π₯Μ(π‘ + 1/π‘) = π΄π₯Μ(π‘/π‘) πΊ(π‘) = π(π‘)π» π (π‘)(π»(π‘)π(π‘)π»π (π‘) + π )−1 π(π‘ + 1) = π·[π(π‘) − πΊ(π‘)π»(π‘)π(π‘)]π· π + π Where, π»(π‘)is the Jacobian of β(π‘) that can be represented as follows: πβ(π₯Μ(π‘/π‘−1)) π»(π‘) = Μ(π‘/π‘−1) ππ₯ π»(π‘) = [sin(π€π π‘ + π·π ) … sin(+ π·π ) πΜ1 cos(π€π + π·π ) … πΜπ cos(π€π π‘π·π )] And the initial values for state and covariance are represented as follows: Fig. 1: Voltage and Current waveform for harmonic Analysis Figure 1 shows the waveforms of voltage and current waveforms which further serve as the input to the EKF method. It is evitable that the waveforms are highly nonlinear and distorted owing to stepped wave shape. π₯Μ(0) = πΈ[π₯(0)] = π₯Μ(0) π(0) = πΈ[(π₯(0) − π₯Μ(0))(π₯(0) − π₯Μ(0))π ] IV. EXPERIMENT AND SIMULATION RESULTS IV-A. SIMULATION RESULT FOR FFT TOOL IN MATLAB For the sake of simulation, a three-phase source is connected to the three-phase load with series connection of three-phase step down transformer and three phase ac-to-dc-to-ac PWM converter between source and load and distorted voltage and current waveforms are taken for harmonic analysis and detect magnitudes and frequencies of fundamental as well as harmonic components present in voltage and current waveforms. The same is presented in form of a table: Threephase system Load Transformer PWM IGBT Inverter ππ = 25kV (RMS), Frequency= 50HZ, VA rating= 10MVA X/R ratio = 5 ππΏ = 380V (RMS), Avtive Power = 50KW Voltage ratio= 25KV/415V, VA rating= 45KVA Snubber Resistance= 5000 Snubber Capacitance= inf. Ron= 1 × 10−3 Ohms Table 1: Simulated System Parameters Fig. 2: FFT analysis of Voltage waveform FFT is often used as a standard tool to analyses the total harmonic content present in the distorted current and voltage waveforms. We use this standard tool as a relative measure to check the superiority and efficacy of EKF technique. Figure 2 and 3 show the FFT of current and voltage waveform respectively. Fig. 3: FFT analysis of Current waveform Fig. 6: Magnitude and Frequency of 5π‘β component of load Voltage IV-B. SIMULATION RESULT FOR KALMAN FILTER METHODOLOGY Next we demonstratethe nonlinear Kalman filter which handles all this white noise present in the system considerably well. Fig. 7: Magnitude and Frequency of 7π‘β component of load Voltage Fig. 4: Magnitude and Frequency of fundamental component of load Voltage Fig. 8: Magnitude and Frequency of 9π‘β component of load Voltage Fig. 5: Magnitude and Frequency of 3rdcomponent of load Voltage load Current Fig. 9: Magnitude and Frequency of fundamental component of loadCurrent Fig. 13: Magnitude and Frequency of 9π‘β component of load Current The waveforms of fundamental component as well as various harmonics namely third order upto ninth order are illustrated in figures 4 to 13. The Kalman filter is able to process noise in a better manner as compared to the conventional techniques. The table shown below illustrates the performance of KF technique adopted in the paper with FFT tool in Matlab. Fig. 10: Magnitude and Frequency of 3ππ component of load Current Magnitude Order of Harmonic Fig. 11: Magnitude and Frequency of 5π‘β component of load Current Frequency 1 FFT 583.70 583.70-583.71 FFT 50 3 1.40 1.40-1.41 150 5 114.99 114.19-115.00 250 7 85.16 85.16-85.17 350 9 1.40 1.40-1.41 450 11 52.65 52.65-52.66 550 13 45.70 650 15 1.40 45.70545.715 1.40-1.41 17 33.74 33.74-33.75 850 19 31.58 31.58-31.59 950 EKF 750 EKF 50.000050.0001 150.000150.0001 250.000250.0001 350.000350.0001 450.000450.0001 550.000550.0001 650.000650.0001 750.000750.0001 850.000850.0001 950.000950.0001 Table 2: Comparison of EKF and FFT for load Voltage Fig. 12: Magnitude and Frequency of 7π‘β component of Magnitude Order of Harmonic Frequency 1 FFT 116.40 116.40-116.41 FFT 50 3 0.49 0.49-0.50 150 5 23.27 23.27-23.28 250 7 16.74 16.74-16.75 350 9 0.49 0.49-0.50 450 11 10.81 10.81-10.82 550 13 8.85 8.85-8.86 650 15 0.49 0.49-0.50 750 17 7.02 7.02-7.03 850 19 6.02 6.02-6.03 950 EKF EKF 50.000050.0001 150.000150.0001 250.000250.0001 350.000350.0001 450.000450.0001 550.000550.0001 650.000650.0001 750.000750.0001 850.000850.0001 950.000950.0001 Table 3: Comparison of EKF and FFT for load Current V. CONCLUSION This paper represents aspects,design and characteristics of Extended Kalman filter. EKF isapplied to the PWM converter for harmonic detection in distorted voltage and current waveforms From simulation results of Kalman filter and comparison table, it is found that Kalman filter technique is very accurate and fast when estimating the amplitude and frequency of voltage and current waveforms. The algorithm provides very good results even for the waveforms contaminated with significant noise or harmonics and the filter is adaptive with respect to system variations of harmonic parameters. The drawbacks of the Kalman filter related to its sensitivity to the disturbances and low noise to signal ratio. Also if the number of harmonic components increased for detection process then Kalman filter becomes slower and complexity is increased because of linearization. References [1] J. Wu, W. Zhao, Wei, “New precise measurement method of power harmonics based on FFT,”IEEE Conference Publication, Intelligent Signal Processing and Communication Systems, pp. 365-368, Dec 2005 [2] Z. Ren, B. Wang, “Estimation algorithms of harmonic parameters based on the FFT,”IEEE Conference Publications, Power and Energy Engineering Conference, pp. 1-4,March 2010 [3] F. Zhou, Z. Huang, C. Zhao, X. Wei, D. Chen, “Timedomain quasi-synchronous sampling algorithm for harmonic analysis,”IEEE Transaction, Instrumentationand Measurement, Vol. 60, no. 8, pp. 2804-2812, Aug. 2010 [4] Z. bing and Hu hong, “An improved window and interpolation algorithm using trispectrum for measuring power harmonics based on FFT,”IEEE Conference Publication,Pervasive Computing Signal Processing and Application, pp. 491-494, Sept. 2010 [5] O. V. S. R.,Varaprasad, R. Panda, D. V. S. S.S., “A novel synchronous sampling algorithm for Power System harmonic analysis,”IEEE Conference Publications, India Conference, pp. 1-5, Dec. 2013 [6] A. Zouidi, F. Fnaiech, Kamal Al-Haddad, “Artificial neural networks as harmonic detectors,”IEEE Conference Publications, IEEE Industrial Electronics, pp. 2889-2892, Nov. 2006 [7] H. Cheng Lin, “Intelligent neural network-based fast Power system harmonic detection,”IEEE Journals and Magazine, Industrial Electronics, Vol. 54, no. 1, pp. 43-52, Feb 2007 [8] A. Zouidi, F. Fnaiech, Kamal AL-Haddad, S. Rahmani, “Adaptive linear combiners a robust neural network technique for on-line harmonic tracking,”IEEE Conference Publication, Industrial Electronics, pp. 530-539, Nov. 2008 [9] G. W. Chang, Cheng-I Chen, Y. Teng, “Radial-basisfunction-based neural network for harmonic detection,”IEEE Journals and Magazines, Industrial Electronics, Vol. 57, no. 6, pp. 2171-2179, June 2010 [10] R. Aghazadeh, H. Lesani, M. S. Pasand and B. Ganji, New technique for frequency and amplitude estimation of power system signals,”IEEE Journals and Magazines, Generation, Transmission and Distribution, Vol. 152, no. 3, pp. 435-440, May 2005 [11] M. K. Ghartemani, H. Karimi, A. R. Bakhshai, “A Filtering technique for three-phase power systems,”IEEE Conference Publications, Instrumentation and Measurement Technology Conference, Vol. 2, no. 2, pp. 1503-1506, May 2005 [12] R. A. Zadeh, A. Ghosh, G. Ledwich, F. Zare, “Online estimation of signal parameters in the presence of harmonic and noise distortion,”IEEE Conference Publications, Power Electronics and Applications, pp. 1-10, Sept. 2009 [13] N. C. Will, R. Cardoso, “Implementation of the IEEE Std 1459-2010 using Kalman filter for fundamental and harmonics detection,”IEEE Conference Publications, Innovative Smart Grid Technologies, pp. 1-7, Oct. 2012