INDIAN INSTITUTE OF TECHNOLOGY, KHARAGPUR 721302, DECEMBER 27-29, 2002 509

Numerical Differential Protection of Power using Algorithm based on Fast Haar Wavelet Transform

K. K. Gupta and D. N. Vishwakarma

Abstract-- A fast and simple numerical filtering algorithm is The differential protection scheme shows certain limitations. an important requirement for the efficient power system Detection of a differential current does not provide a clear relaying. This paper presents a wavelet-based algorithm for distinction between internal faults and other conditions, e.g. numerical differential protection of power transformer, using Magnetizing inrush, over-excitation of the transformer core, harmonic restraint approach. This algorithm provides an external faults. The conventional approach to mitigate these accurate and computationally efficient tool for distinguishing internal faults from magnetizing inrush and over excitation problems is to apply percentage (biased) differential inrush. This algorithm is essentially a numerical filter, which characteristic along with second and fifth harmonic restraints extract the fundamental component and second and for inrush and over-excitation conditions, respectively. fifth harmonic components of differential current, to provide operating and restraining signal respectively. This algorithm The conventional percentage differential relays used for generates it’s coefficient by additions and subtractions routines the protection of power transformer against internal faults are only and does not involve time consuming multiplication and either of electromagnetic or static type. Electromagnetic and division calculation. The computation complexity of the static relays have several drawbacks. The concept of algorithm presented here is O(N) additions and subtractions as numerical protection, which evolved during the last two compared to DFT based algorithm, whose computation complexity is O(Nlog2N) operations. decades, shows much promise in providing improved performance. The main features of the Numerical relays are Index Terms—Differential Protection, Haar Transform, their economy, reliability, compactness, flexibility and the Wavelet Transform, . possibility of integrating a Numerical into the hierarchical computer system within the substation.

I. INTRODUCTION II. FAST HAAR WAVELET TRANFORM (FHWT) A power transformer belongs to a class of very TECHNIQUE expensive and vital component of system and its protection is one of the most challenging problems in the The proposed algorithm is derived from the well-known area of power system relying. The frequency of occurrence Haar Transform based algorithm. In Haar Transform the Haar faults in power transformer is less than on lines. But if a coefficients are calculated first and from Haar coefficients the power transformer experiences a fault, it is necessary to take sine and cosine Fourier coefficients are calculated, using the transformer out of service as soon as possible so that established relationship between Haar and Fourier damage is minimized. The cost associated with repairing a coefficients. The Haar transform can also be termed as damaged transformer may be very high. An unplanned outage Discrete Wavelet Transform (DWT), using Haar wavelet. of a power transformer can cost electric utilities crores of The Discrete Wavelet (Haar) Transform requires Nlog2N rupees. Consequently, it is of great importance to minimize operations to transform a N sample vector. the frequency and duration of unwanted outages. Accordingly, high demands are imposed on power The DWT matrix is not sparse in general, so it has the transformer protective relays. Requirements include same complexity issues as the discrete Fourier transform. So it is solved in same way as for the FFT, by factoring the DWT into a product of a few sparse matrices using self- · Dependability (no missing operation) similarity properties. This result in an algorithm that requires · Security (no false tripping) only order N operations to transform an N-sample vector. · Speed of operation (short fault clearing This fast version of the DWT can be called as Fast Wavelet time) Transform (FWT). The FWT using Haar Wavelet calculates Haar coefficients by 4(N-1) multiplications. Hence its Differential protection scheme based on circulating current computation complexity is O(N) operations. principle is widely used to protect the power transformer against internal faults [4], [9]. In the algorithm presented here these 4(N-1) multiplications are converted in 2(N-1) additions. Hence the The authors are with the Institute of Technology, Banaras Hindu computation complexity is reduced to O(N) additions. But the University, Varanasi - 221005, India (telephone: 91-5412-57733, e-mail: coefficients calculated by this modified algorithm will not be [email protected], [email protected]). 510 NATIONAL POWER SYSTEMS CONFERENCE, NPSC 2002

same as Haar coefficients. We can call them as Modified é0.5 0.5 ù Haar coefficients. A relationship between the Modified Haar ê0.5 -0.5 ú [H ] =ê ú (4.3) coefficient and Fourier coefficients can be established and 3 ê 0.5 0.5 ú from that the sine and cosine Fourier coefficients of the input ê ú ë 0.5 -0.5û signal can be calculated. é0.5 0.5 ù [H ] =ê ú (4.4) A signal vector [ X ] , whose length is an integer power of 4 0.5 -0.5 two, can expressed as ë û

Here blank entries signify zeros. [ X ] = [ H ] [ B ] (1) 16 Like the Fast Fourier Transform (FFT), the Fast wavelet Where H is the Haar matrix and B is the Haar coefficient 16 Transform (FWT) is a fast, linear operation that operates on a vector, which can be calculated as data vector whose length is an integer power of two, [ B ]= [ H ]-1. [ X ] (2) 16 transforming it into a numerically different vector of the same length. The Haar matrix H16 The FWT consists of applying above matrix [ H ] é1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 ù ê ú hierarchically, first to full data vector [ X ] of length N (i.e. ê1 1 1 0 1 0 0 0 -1 0 0 0 0 0 0 0 ú ê1 1 1 0 -1 0 0 0 0 1 0 0 0 0 0 0 ú multiplying [H1] to data vector [ X ]), next all the high ê ú ê1 1 1 0 -1 0 0 0 0 -1 0 0 0 0 0 0 ú frequency information is shifted to bottom of the vector by ê1 1 -1 0 0 1 0 0 0 0 1 0 0 0 0 0 ú ê ú using a permutation matrix. This process is applied again to ê1 1 -1 0 0 1 0 0 0 0 -1 0 0 0 0 0 ú the vector of low frequency information of length N/2 (i.e. ê1 1 -1 0 0 -1 0 0 0 0 0 1 0 0 0 0 ú ê ú multiplying [H 2] to data vector of low frequency H = ê1 1 -1 0 0 -1 0 0 0 0 0 -1 0 0 0 0 ú (3) [ 16] ê ú information), then to the vector of length N/4 and so on, until ê1 -1 0 1 0 0 1 0 0 0 0 0 1 0 0 0 ú ê1 -1 0 1 0 0 1 0 0 0 0 0 -1 0 0 0 ú only two components remains. The procedure is sometimes ê ú ê1 -1 0 1 0 0 -1 0 0 0 0 0 0 1 0 0 ú called a pyramidal algorithm [5], for obvious reason. The ê1 -1 0 1 0 0 -1 0 0 0 0 0 0 -1 0 0 ú ê ú equation below makes the procedure clear: ê1 -1 0 -1 0 0 0 1 0 0 0 0 0 0 1 0 ú ê1 -1 0 -1 0 0 0 1 0 0 0 0 0 0 -1 0 ú ê ú ê1 -1 0 -1 0 0 0 -1 0 0 0 0 0 0 0 1 ú ê ú ë1 -1 0 -1 0 0 0 -1 0 0 0 0 0 0 0 -1û

Hence by using above matrix and equation (2), the Haar coefficients vector [ B ] can be calculated and by relating these coefficients with Fourier coefficients, the sine and cosine Fourier coefficients can be determined. This algorithm requires order Nlog2N operations. The same Haar coefficients can be computed with less number of mathematical operations by factorizing above matrix as follows [11]

é0.5 0.5 ù ê0.5 -0.5 ú ê ú ê 0.5 0.5 ú ê ú ê 0.5 -0.5 ú ê 0.5 0.5 ú ê ú ê 0.5 -0.5 ú ê 0.5 0.5 ú ê ú In the above procedure the last vector is the vector of Haar [H ]=ê 0.5 -0.5 ú (4.1) 1 ê 0.5 0.5 ú coefficients [B] we got before. This procedure requires only ê ú ê 0.5 -0.5 ú 4(N-1) multiplications and 2(N-1) additions. Now if above ê ú ê 0.5 0.5 ú procedure is followed in reverse direction without Haar ê 0.5 -0.5 ú -1 ê ú coefficient vector [B], we get a matrix [H] , which is same as ê 0.5 0.5 ú -1 ê 0.5 -0.5 ú the matrix [H16] mentioned before. ê ú ê 0.5 0.5 ú ê ú ë 0.5 -0.5û Now if all the non-zero coefficients (0.5 & -0.5) of matrix [H] are replaced by ones (1 & -1 respectively) and above é0.5 0.5 ù ê ú procedure is followed, we will get a vector of coefficients, ê0.5 -0.5 ú like [ B ]. But the coefficients of this vector will be different ê 0.5 0.5 ú ê ú then coefficients of vector [ B ]. Let call this vector as [H ]=ê 0.5 -0.5 ú (4.2) 2 ê 0.5 0.5 ú modified Haar coefficient vector [B ]. Now it will take only ê ú m ê 0.5 -0.5 ú 2(N-1) additions to get these coefficients. ê 0.5 0.5ú ê ú ëê 0.5 -0.5ûú INDIAN INSTITUTE OF TECHNOLOGY, KHARAGPUR 721302, DECEMBER 27-29, 2002 511

é1 1 ù ê ú N -1 ê1 -1 ú 1 ê 1 1 ú F = X (m) ê ú 0 å ê 1 -1 ú N m =0 ê 1 1 ú ê ú ê 1 -1 ú N -1 ê 1 1 ú 2 2pm ê ú F1 = X (m) sin [H ]= ê 1 -1 ú (6.1) å a1 ê 1 1 ú N m=0 N ê ú ê 1 -1 ú ê ú N -1 ê 1 1 ú 2 2pm ê 1 -1 ú F = X (m) cos ê ú 2 å 1 1 ê ú N m=0 N ê 1 -1 ú ê ú ê 1 1ú …………………………………. ê ú ë 1 -1û …………………………………. …………………………………. é1 1 ù N -1 ê ú 2 ê1 -1 ú F = X (m) sin pm ê 1 1 ú N -1 å ê ú N m=0 [H ]=ê 1 -1 ú (6.2) a2 ê 1 1 ú The above equations can be written in matrix form as ê ú ê 1 -1 ú follows. ê 1 1ú ê ú [ F ] = [ S ] [ X ] (9) ëê 1 -1ûú T Where [ F ] = [ F0, F1, F2, …………..FN-1 ] is a vector whose components are the Fourier coefficients, [ X ] is é1 1 ù ê ú the data vector, and [ S ] is a N x N matrix forms by values of [H ]=ê1 -1 ú (6.3) sine and cosine functions at different sampling points, along a2 ê 1 1 ú ê ú with the factor, 2/N. ë 1 -1û Considering N to be even and of the form N = 2n, the é1 1ù elements of the matrix S can be obtained as follows. [Ha4]=ê ú (6.4) ë1 -1û

By following the reverse procedure without involving ì 1 ï for k = 0 modified Haar coefficient vector [ Bm ], we will get a N x N N -1 ï matrix [ Ha ] . Hence the input vector X(m) in terms of this ï 2 (k +1) mp S = í sin foroddk,i.e. k = 1,3,KK(N -1) (10) matrix can be expressed as km N N ï ï 2 k mp [ X ]= [ H ] [ B ] (7) ï cos forevenk,i.e. k = 2,4,KK(N - 2) a m N N î Using matrix [ Ha ], a relationship between the modified Haar coefficients and Fourier coefficients can be established Where, m = 0,1,2………(N-1) and Skm is the element of as follows [8] matrix S in row k and column m.

Fourier expansion of the periodic signal x(t) in the interval Thus all the elements of [ S ] for N = 16 can be obtained (0, T) is defined as easily. The Fourier coefficients are the components of vector [ F ] representing x(t) over the interval (0,T). The square of N -1 X(t) = F0 +Ö2 F1 sin wt + Ö2 F2cos wt + Ö2 F3 sin 2wt + Ö2 the length of this vector, [ F ]T [ F ] = 2 , is equal to the å Fk F4 cos 2wt + …………..+ Ö2 F9 sin 5wt + Ö2 F10 cos 5wt + k =0 ………….. (8) mean square value of x(t) over this interval. Similarly the modified Haar coefficients are the components of another Where w is the fundamental angular frequency which is vector [ Bm ] that has the same length and represents x(t) in given by w = 2pf = 2p/T, and F0, F1, F2, ………… F9, F10, …. terms of a different basis. By substituting equation (7) into are the Fourier coefficients. equation (9)

A finite series expansion is obtained by truncating the [ F ] = [ S ] [ Ha ] [ Bm ] (11) above series of equation (8) and reducing the number of n terms from infinite to N, where N is of the form N= 2 . Hence, by calculating the matrix [ S ] from Equ. (10) and

matrix [ Ha ], the Fourier coefficient vector [ F ] can be The Fourier coefficients are defined in the discrete form as determined directly from the modified Haar coefficient vector follows. [ Bm ]. 512 NATIONAL POWER SYSTEMS CONFERENCE, NPSC 2002

III. ALGORITHM FOR DIFFERENTIAL PROTECTION Im1 = maximum value of fundamental current OF POWER TRANSFORNER component Im2 = maximum value of second harmonic current The algorithm for extracting the fundamental frequency component component and the harmonic components from differential Im5 = maximum value of fifth harmonic current current signal is based on the Fast Haar Wavelet Transform component (FHWT) technique. Based on the relative magnitude of these f1 = angle lag from reference for fundamental fundamental and harmonic components the operating component condition of the relay is decided. f2 = angle lag from reference for second harmonic component This algorithm for the Numerical Differential protection of f5 = angle lag from reference for fifth harmonic power transformer can be applied in the following way: component The differential transformer current, whether due to fault Id = maximum value of dc decaying component or inrush, is represented as [6] t = time constant associated with decaying dc component N The post fault current signal based on which results are -at -bt Im (t) = IDCe + å Ik Sin(kwt + Fk )e calculated is k =1 (12) i(t) =2 Sin (wt - 800)+0.5 Sin (2wt - 270)+ 0 (- t / 0.01) 0.3 Sin (5wt - 18 ) +0.07 e (14) Where the time constant 1/a and 1/b are associated with decaying DC and harmonic components, respectively. The value of fundamental current component obtained using the algorithm based on Fast Haar Wavelet transform. The current signal is sampled at regular intervals. In order I1 =1.9938 to prevent aliasing effect due to sampling, the sampling rate (samples per cycle) should be greater than (2n+1). Where n is The value of second harmonic component the order of harmonic component to be detected. Therefore, I2 = 0.5056 to satisfy the computational requirement the sampling rate is chosen as 16 samples per cycle, i.e. a sampling frequency of The value of fifth harmonic component 800Hz for the 50Hz power frequency. The selection of data I5 = 0.3012 window is an important factor in the computation of the threshold quantities. The full cycle data window is used for Calculated errors and frequency response an accurate estimation of the fundamental and harmonic The error in the fundamental frequency component, second components and the rejection of the DC components. The harmonic component and fifth harmonic component can be modified Haar coefficients of sampled current vector are calculated from the formula given below. obtained by using equation (5) and equation (6). These % Error = ((Actual value – Calculated value) coefficients are obtained mere addition and subtraction of the / Actual value) *100 (15) current samples. The sine and cosine Fourier coefficients corresponding to modified Haar coefficients are obtained by For the fundamental frequency component: the relationship between them, which is represented by the % error = ((2 – 1.9938) / 2)*100 = 0.31 equation (11). From these Fourier coefficients the fundamental and different harmonic components of input For second harmonic component: differential current are obtained. % error = ((0.5 – 0.5056) / 0.5)*100 = -1.12

For second harmonic component: IV. RESULTS % error = ((0.3 – 0.3012) / 0.3)*100 = -0.4 The algorithm based on Fast Haar Wavelet Transform for the numerical differential protection of power transformer, to The frequency response is a measure of the filtering extract fundamental and harmonic components from the characteristics of algorithm. The frequency response for the differential current signal, has been programmed in the Numerical filter using proposed algorithm, for the test signal MATLAB 5.3 and tested successfully. is shown in Fig. 2. Frequency response is curve between The flow chart to find the modified Haar coefficients and normalized frequency and gain, where normalized frequency relating them with Fourier coefficients, to find different is assumed frequency divided by power frequency and gain is Fourier coefficients is given in the Fig. 1. Software on the calculated value of current component at assumed MATLAB 5.3, based on this flow chart is given in Appendix frequency divided by actual current component. The response I. This software is tested for the following type of post fault to all undesired is test signal: i(t) = Im1Sin (wt - f1) + Im2Sin (2wt - f2) + (- t / t) Im5Sin (5wt - f5) + Id e (13) Where the terms used are as follows: INDIAN INSTITUTE OF TECHNOLOGY, KHARAGPUR 721302, DECEMBER 27-29, 2002 513

Fig. 1. Program flow chart for computation of Im1, Im2 and Fig. 2. Frequency Response of FHWT Based Filter Im5

VI. REFERENCES nonzero, but small. The efficacy of the filter is clear from the response shown in Fig. 2., that for particular frequency, the [1] Z. Moravej, D. N. Vishwakarma, and S. P. Singh, “Digital filtering corresponding frequency component is extracted and other algorithms for the differential relaying of power transformer: An are almost rejected. Overview”, Electrical Machines and Power Systems, Vol. 28, pp. 485 – 500, 2000. [2] M. Gomez-Morgante and D. W. Nicollete, “A wavelet based V. CONCLUSION differential transformer protection”, IEEE Transactions on Power Delivery, vol. 14, No. 4, pp. 1351-1358, 1999. [3] B. Kasztenny, and M. Kezunovic, “Digital relays improve protection The algorithm based on fast Haar wavelet transform, of large ”, IEEE Computer Application in Power, pp. 39- generates its coefficients using additions and subtractions of 45, Oct. 1998. the data samples more accurately than earlier schemes. The [4] A. D. Guzman, S. Zocholl, G. Benmouyal, and H. J. Altuve, “A current equations for extraction of fundamental frequency component based solution for transformer differential protection – Part-I; Problem statement,” IEEE Transactions on Power Delivery, vol. 16, No. 4, pp. and harmonic components using Fast Haar Wavelet transform 485-491, Oct. 2001. are derived. Software has been developed to calculate [5] O. Rioul and M. Vetterli, “Wavelets and Signal Processing”, IEEE modified Haar coefficients and Fourier coefficients and hence Signal Processing Magazine, pp. 14-38, Oct. 1991. [6] H. K. Verma, and A. M. Basha, “Transformer differential relay based magnitude of fundamental and second and fifth harmonic on approach”, The institute of Engineers (India) Journal component of differential current. The calculated errors for (EL), Vol. 67, pp. 132-137, Dec. 1986. different frequency component of differential current are very [7] M. A. Rahman, B. so, M. R. Zaman, and M. A. Hoque, “Testing of small and do not affect the accuracy of algorithm. The algorithm for a stand-alone digital relaying for power transformers”, frequency responses of the fundamental frequency filter, IEEE Transactions on Power Delivery, vol. 13, No. 2, pp. 374-385, April 1997. second harmonic filter and fifth filer shows good filtering [8] D. N. Vishwakarma and B. Ram, “ and characteristics of the algorithm. During magnetizing inrush Gear”, Tata McGraw-Hill Publishing Company Limited, New Delhi, and over excitation, the algorithm is flexible enough to 1995. generate the necessary restrain signal. [9] L. P. Singh, “Digital Protection – Protective Relaying From Electro - Mechanical to Microprocessor”, Willey Eastern Limited, 1994. [10] A. G. Phadke and J. S. Thorpe, “Computer Relaying for Power Systems”, Research Studies Press Ltd., England 1988. [11] http://www.math.hmc.edu/math185/pdfs