[IEEE 2013 IEEE 22nd International Symposium on Industrial Electronics (ISIE) - Taipei, Taiwan...

4
Classification of Power Quality Disturbances Using Wavelet Transform and K-Nearest Neighbor Classifier Ngo Minh Khoa Department of Technique & Technology Quy Nhon University Quy Nhon, Viet Nam [email protected] Dinh Thanh Viet, Nguyen Huu Hieu Department of Electrical Engineering Da Nang University of Science and Technology Da Nang, Viet Nam [email protected] , [email protected] Abstract - This paper proposes a new method to classify power quality disturbances using wavelet transform and K-nearest neighbor classifier. New features of power quality disturbances are extracted from discrete wavelet transform then using K- nearest neighbor classifier to classify these disturbances according to the features. Block diagram of the proposed method has been shown in this paper. Performance of the proposed method is trained and verified with power quality disturbances generated by Matlab software. The classification accuracy for these disturbances has been presented and shows that the proposed method is doing well in classifying these types of power quality disturbances. Keywords - Power quality; Wavelet transform; K-Nearest neighbor; Disturbance; Classification. I. INTRODUCTION Nowadays power quality (PQ) has become a very significant issue of electrical power system operation since the use of modern power electronic devices has increased. These devices are very sensitive to voltage disturbances. Disturbances such as voltage sag/swell with and without harmonics, interruption, flicker, transients and harmonic distortion often generate waveform distortions, and this leads to problems such as malfunctions, instabilities, short lifetime, and failure of electrical equipments and so on [1]. The selection of suitable features is extremely important for classification of any PQ disturbances. The features extracted by signal processing techniques are used as input to the PQ classification system. Feature extraction can be carried out in two steps. Firstly, we transform the raw signal from its original form into a new form. Secondly, suitable information is extracted from this new form. An appropriately chosen feature set reduces the burden over the classifiers [3]. Features may directly be extracted from the original measurements, e.g., RMS values, or from some transformed domain, e.g., Fourier transform (FT), short-time Fourier transform (STFT), wavelet transform (WT), and S-transform or from the parameters of signal models, e.g., autoregressive (AR) , autoregressive moving average (ARMA) models. FT has been used for extracting the frequency contents of the recorded signal. According to the frequency contents of the signal, some of the PQ problems can be detected. But, FT is not suitable for transient signals. This is because FT provides information only about the existence of a certain frequency component, but does not give information about component appearance time [2]. A suitable way to obtain such information is to apply time- frequency (or time scale) signal decomposition where time- evolved signal components in different frequency bands can be obtained. Although, STFT can overcome this problem, but STFT still has the limitation of a fixed window width i.e. the trade-off between the frequency resolution and the time resolution should be determined a priori to observe a particular characteristic of the signals [2]. Due to a fixed window width, STFT is inadequate for the analysis of the transient non- stationary signals. Therefore, more powerful and efficient methods and techniques are required to detect and analyze non-stationary disturbances [3-10]. To resolve the fixed resolution problem of STFT, many researchers have proposed the use of the WT approach to analyzing the power system disturbances [3-6], that automatically adjusts to give proper resolutions of both time and frequency. In this approach, a larger resolution of time is provided to high-frequency components of a signal, and a larger resolution of frequency to low-frequency components. These features make the WT well suited for the analysis of the power system transients caused by various PQ disturbances. This paper has proposed a new method that is designated to classify types of PQ disturbances using WT and K-nearest neighbor classifier. New features of PQ disturbances are extracted from discrete wavelet transform (DWT) then using K-nearest neighbor classifier to classify these disturbances according to the features. II. METHODOLOGY BACKGROUND A. Wavelet Transform In the WT [3-6], the choice of a specific wavelet is made. This is called the mother wavelet. The wavelet ψ(t) can be dilated (stretched) and translated (shifted in time) by adjusting the two parameters that characterize it, i.e. a - the scale parameter and b - the translation parameter: Ѱ , (ݐ)= (1) with a ϵ R + and b ϵ R.

Transcript of [IEEE 2013 IEEE 22nd International Symposium on Industrial Electronics (ISIE) - Taipei, Taiwan...

Classification of Power Quality Disturbances Using Wavelet Transform and K-Nearest Neighbor Classifier

Ngo Minh Khoa

Department of Technique & Technology Quy Nhon University Quy Nhon, Viet Nam

[email protected]

Dinh Thanh Viet, Nguyen Huu Hieu

Department of Electrical Engineering Da Nang University of Science and Technology

Da Nang, Viet Nam [email protected], [email protected]

Abstract - This paper proposes a new method to classify power quality disturbances using wavelet transform and K-nearest neighbor classifier. New features of power quality disturbances are extracted from discrete wavelet transform then using K-nearest neighbor classifier to classify these disturbances according to the features. Block diagram of the proposed method has been shown in this paper. Performance of the proposed method is trained and verified with power quality disturbances generated by Matlab software. The classification accuracy for these disturbances has been presented and shows that the proposed method is doing well in classifying these types of power quality disturbances.

Keywords - Power quality; Wavelet transform; K-Nearest neighbor; Disturbance; Classification.

I. INTRODUCTION

Nowadays power quality (PQ) has become a very significant issue of electrical power system operation since the use of modern power electronic devices has increased. These devices are very sensitive to voltage disturbances. Disturbances such as voltage sag/swell with and without harmonics, interruption, flicker, transients and harmonic distortion often generate waveform distortions, and this leads to problems such as malfunctions, instabilities, short lifetime, and failure of electrical equipments and so on [1].

The selection of suitable features is extremely important for classification of any PQ disturbances. The features extracted by signal processing techniques are used as input to the PQ classification system. Feature extraction can be carried out in two steps. Firstly, we transform the raw signal from its original form into a new form. Secondly, suitable information is extracted from this new form. An appropriately chosen feature set reduces the burden over the classifiers [3]. Features may directly be extracted from the original measurements, e.g., RMS values, or from some transformed domain, e.g., Fourier transform (FT), short-time Fourier transform (STFT), wavelet transform (WT), and S-transform or from the parameters of signal models, e.g., autoregressive (AR) , autoregressive moving average (ARMA) models. FT has been used for extracting the frequency contents of the recorded signal. According to the frequency contents of the signal, some of the PQ problems can be detected. But, FT is not suitable for transient signals. This is because FT provides information only

about the existence of a certain frequency component, but does not give information about component appearance time [2]. A suitable way to obtain such information is to apply time-frequency (or time scale) signal decomposition where time-evolved signal components in different frequency bands can be obtained.

Although, STFT can overcome this problem, but STFT still has the limitation of a fixed window width i.e. the trade-off between the frequency resolution and the time resolution should be determined a priori to observe a particular characteristic of the signals [2]. Due to a fixed window width, STFT is inadequate for the analysis of the transient non-stationary signals.

Therefore, more powerful and efficient methods and techniques are required to detect and analyze non-stationary disturbances [3-10]. To resolve the fixed resolution problem of STFT, many researchers have proposed the use of the WT approach to analyzing the power system disturbances [3-6], that automatically adjusts to give proper resolutions of both time and frequency. In this approach, a larger resolution of time is provided to high-frequency components of a signal, and a larger resolution of frequency to low-frequency components. These features make the WT well suited for the analysis of the power system transients caused by various PQ disturbances.

This paper has proposed a new method that is designated to classify types of PQ disturbances using WT and K-nearest neighbor classifier. New features of PQ disturbances are extracted from discrete wavelet transform (DWT) then using K-nearest neighbor classifier to classify these disturbances according to the features.

II. METHODOLOGY BACKGROUND

A. Wavelet Transform

In the WT [3-6], the choice of a specific wavelet is made. This is called the mother wavelet. The wavelet ψ(t) can be dilated (stretched) and translated (shifted in time) by adjusting the two parameters that characterize it, i.e. a - the scale parameter and b - the translation parameter:

Ѱ , ( ) = √ (1)

with a ϵ R+ and b ϵ R.

The continuous wavelet transform (CWT) of a given signal x(t) with respect to the mother wavelet ψa,b(t), (if ψa,b(t) is a complex signal) is the following dot product:

( , ) = ⟨ , , ⟩ = ( ) √ ∗ (2)

where * means the complex conjugate.

The CWT is a redundant transform; in fact, it considers continuous translations and dilations of the same function, which makes the transform heavily implementable. A non-redundant version of the wavelet transform, which refers to a discrete number of expansions (a values) and translations (b values), is the DWT, which is often used instead of CWT in the field of power quality disturbance assessment.

In order to obtain discrete scale and time parameters of the wavelet function defined in Equation (1), we can choose discrete scaling and translation parameters such as a = aj

0 and b=kaj

0b0 where k and j are integers and a0 > 1, b0 > 0 are fixed. The result is:

Ѱ , ( ) = (3)

The WT of a continuous signal x(t) using discrete scale and time parameters of wavelets leads to the following wavelet coefficients:

( , ) = ⟨ , Ѱ , ⟩ = ( )Ѱ∗ (4)

Now let us consider a finite sequence of L samples of the sampled waveform x(n); the L-point DWT of the L-point sequence x(n) n = 0, 1, . . . , L-1 (once again using discrete scale and time parameters) is defined by:

( , ) = ∑ ( )Ѱ∗ (5)

B. Feature Extraction

The feature selection is an important component of designing classifier since even the best classifier will perform poorly if the features used as inputs are not selected well [3]. The computed discrete wavelet coefficients provide a compact representation that shows the energy distribution of the signal in time and frequency. Therefore, the computed discrete wavelet coefficients of the PQ disturbances were used as the feature vectors representing the signals. In order to reduce the dimensionality of the extracted feature vectors, statistics over the set of the wavelet coefficients were used. The following statistical features used to represent the time-frequency distribution of the signals using Daubechies 4 (db4) with 5 levels. So there are 6 wavelet coefficients consists of a5, d5, d4, d3, d2 and d1. For example voltage sag and its feature waveforms shown as Figure 1.

1- Minimum, average and maximum of the power quality disturbance (i.e. Figure 1.a).

2- The coefficients corresponding to the approximation (Ea5) (i.e. Figure 1.b)

3- The percentages of energy corresponding to the approximation and details (Ed5, Ed4, Ed3, Ed2, Ed1) (i.e. Figure 1.c, d, e, f, g).

Figure 1. Voltage sag and its feature waveforms using DWT

C. K-Nearest Neighbor (K-NN)

The K-NN algorithm [11] is a nonparametric method in that no parameters are estimated as, for example, in the multiple linear regression model. Instead, the proximity of neighboring input (x) observations in the training data set and their corresponding output values (y) are used to predict (score) the output values of cases in the validation data set. These output variables can either be interval variables in which case the K-NN algorithm is used for prediction while if the output variables are categorical, either nominal or ordinal, the K-NN algorithm is used for classification purposes.

Before getting into details of the K-NN algorithm we need to define the Euclidean distance between two input vectors xr and xs. Let’s consider the two input variable case since it is

0 200 400 600 800 1000 1200 1400 1600 1800-1

0

1

Samples

V (

pu)

Voltage Sag

(a)

0 200 400 600 800 1000 1200 1400 1600 1800-1

0

1

Samples

a5 (b)

0 200 400 600 800 1000 1200 1400 1600 1800-0.5

0

0.5

1

Samples

d5 (c)

0 200 400 600 800 1000 1200 1400 1600 1800-0.1

0

0.1

Samples

d4 (d)

0 200 400 600 800 1000 1200 1400 1600 1800-0.1

0

0.1

Samples

d3 (e)

0 200 400 600 800 1000 1200 1400 1600 1800-0.05

0

0.05

Samples

d2 (f)

0 200 400 600 800 1000 1200 1400 1600 1800-0.05

0

0.05

Samples

d1 (g)

easy to represent in two-dimensional space. See the two vectors xr = (xr1, xr2) and xs = (xs1, xs2) represented in Figure 2 below. The distance between these two vectors is computed as the length of the difference vector xr - xs, denoted by

( , ) = | − | = ( − ) + ( − ) (6)

Figure 2. The Euclidean distance between two vectors xr and xs

More generally the distance between two p-dimensional vectors u = (u1, u2,…,up) and v = (v1, v2,…,vp) is calculated as

( , ) = | − | = ( − ) + ( − ) +⋯+ − (7)

Given that the K-NN method is dependent on distance measures, it is recommended that the input data be standardized first before proceeding to build an optimal K-NN model. The minimum distance between the vectors gives the closest neighbor so it is predicted that it belongs to the same class with the test object.

Figure 3. Block diagram of the proposed method

III. SIMULATION RESULTS

Using Matlab/Simulink to generate nine types (S1 - S9) of different PQ disturbances as follows: S1 - Normal sine, S2 -

Voltage sag (Figure 4.a), S3 - Voltage swell (Figure 4.b), S4 - Voltage interruption (Figure 4.c), S5 - Voltage flicker (Figure 4.d), S6 - Oscillatory transient (Figure 4.e), S7 - Voltage harmonic (Figure 4.f), S8 - Voltage sag and harmonic (Figure 4.g) and S9 - Voltage swell and harmonic (Figure 4.h).

Figure 4. Types of power quality disturbances

500 1000 1500-1

0

1Voltage Sag

V (

pu)

Samples

(a)

500 1000 1500-2

0

2Voltage Swell

V (

pu)

Samples

(b)

500 1000 1500-1

0

1Voltage Interruption

V (

pu)

Samples

(c)

500 1000 1500-2

0

2Voltage Flicker

V (

pu)

Samples

(d)

500 1000 1500-2

0

2Oscillatory Transient

V (

pu)

Samples

(e)

500 1000 1500-1

0

1Voltage Harmonic

V (

pu)

Samples

(f)

500 1000 1500-2

0

2Voltage Sag and Harmonic

V (

pu)

Samples

(g)

500 1000 1500-2

0

2Voltage Swell and Harmonic

V (

pu)

Samples

(h)

Discrete Wavelet

Transform

Feature extraction

using DWT

KNN Classifier

0 500 1000-101

Disturbance waveform

Ea5, Ed1 ÷ Ed5

Minimum Average

Maximum

min, mean, max

S1 S2 S3 S4 S5 S6 S7 S8 S9

x1

x2

xr = (xr1, xr2)

xs = (xs1, xs2)

xr - xs

K-NN classifier is trained with 900 training sets (100 samples for each class), then using 20 other samples for each class to test the K-NN classifier. The following results of K-NN classifier have been shown in Tables I, II.

TABLE I. CONFUSION MATRIX RESULT USING K-NN CLASSIFIER

S1 S2 S3 S4 S5 S6 S7 S8 S9 S1 20 0 0 0 0 0 0 0 0 S2 0 18 1 1 0 0 0 0 0 S3 0 0 20 0 0 0 0 0 0 S4 0 4 0 15 1 0 0 0 0 S5 0 0 0 0 20 0 0 0 0 S6 0 0 0 0 0 20 0 0 0 S7 0 0 0 0 0 0 20 0 0 S8 0 0 0 0 0 0 0 20 0 S9 0 0 0 0 0 0 0 0 20

In Table I, the classification results are described in terms of a 9x9 confusion matrix. The diagonal elements represent correctly classified power quality classes and off-diagonal elements represent the misclassification. The overall accuracy is calculated by finding the average of all diagonal elements. Number correct/incorrect classified samples and percentage accuracy for each class have been shown in Table II.

TABLE II. CLASSIFICATION RESULTS USING K-NN CLASSIFIER

Type of PQ disturbances

Total samples

Correct In-

correct Accuracy

Normal Sine

20 20 0 100%

Voltage Sag

20 18 2 90%

Voltage Swell

20 20 0 100%

Voltage Interruption

20 15 5 75%

Voltage Flicker

20 20 0 100%

Oscillatory transient

20 20 0 100%

Voltage Harmonic

20 20 0 100%

Sag & harmonic

20 20 0 100%

Swell & harmonic

20 20 0 100%

Overall accuracy

94.44%

It can be easily understood from Tables I and II that the proposed method is a precise and accurate one which can classify almost all single and combined disturbance signals correctly.

IV. CONCLUSION

In this paper, a WT based K-NN method has been proposed for the classification of PQ disturbances. In order to construct an effective classifier, it is essential to choose suitable features that can detect and classify the main characteristics of signal. For this purpose, three features based on minimum, average

and maximum of signal and six other ones based on WT are extracted.

The proposed method has been tested, using simulated waveforms by Matlab/Simulink. The simulation results presented in the paper clearly reveal the potential capability of the proposed method in classifying the PQ disturbances accurately. In comparison with other methods which are also based on WT, the proposed method seems faster and simple. It has the potential to improve the performance of the automatic PQ monitoring equipments with on-line classification abilities.

ACKNOWLEDGMENT

The authors would like to thank Quy Nhon University and National Foundation for Science and Technology Development of Vietnam for the financial support. We are also thankful to Department of Electrical Engineering, Da Nang University of Technology for their encouragement and technical support to carry out this work.

REFERENCES [1] M.H.J. Bollen, I.Y.H. Gu, S. Santoso, et al., “Bridging the gap between

signal and power,” IEEE Signal Processing Magazine, vol. 26, no. 4, pp. 12-31, July 2009.

[2] Y.H. Gu, M.H.J. Bollen, “Time-frequency and time-scale domain analysis of voltage disturbances survey,” IEEE Trans. Power Deliv., vol. 15, no. 4, pp. 1279-1284, Oct. 2000.

[3] B.K. Panigrahi, V.R. Pandi, “Optimal feature selection for classification of power quality disturbances using wavelet packet-based fuzzy k-nearest neighbor algorithm,” IET Gener., Transm. Distrib., vol. 3, no. 3, pp. 296-306, Mar. 2009.

[4] T.X. Zhu, S.K. Tso, K.L. Lo, “Wavelet-based fuzzy reasoning approach to power-quality disturbance recognition,” IEEE Trans. Power Deliv., vol. 19, no. 4, pp. 1928-1935, Oct. 2004.

[5] L.C. Saikia, S.M. Borah, S. Pait, “Detection and classification of power quality disturbances using wavelet transform, fuzzy logic and neural network,” in Proc. Annual IEEE India Conference (INDICON), Dec. 17-19, pp. 1-5, 2010.

[6] Liu Hua, Wang Yuguo, Zhao Wei, “Power quality disturbances detection and classification using complex wavelet transformation and artificial neural network,” in Proc. Chinese Control Conference (CCC), July 26-31, 2007, pp. 208-212.

[7] T.K. Abdel-Galil, M. Kamel, A.M. Youssef, E.F. El-Saadany, M.M.A. Salama, “Power quality disturbance classification using the inductive inference approach,” IEEE Trans. Power Deliv., vol. 19, no. 4, pp. 1812-1818, Oct. 2004.

[8] ZhaoXing Zeng, Chun Huang, Jinlun Cheng, Shuo Qu, Qian Qin, “Power quality disturbance classification with multi-classification SVM based on MST,” in Proc. IEEE Innovative Smart Grid Technologies - Asia (ISGT Asia), May 21-24, 2012, pp. 1-6.

[9] Wang Lixia, He Zhengyou, Zhao Jing, “A new approach of power quality disturbance classification based on rough membership neural networks,” in Proc. Asia-Pacific Power and Energy Engineering Conference (APPEEC), Mar. 28-31, 2010, pp. 1-4.

[10] S. Mishra, C.N. Bhende, B.K. Panigrahi, “Detection and classification of power quality disturbances using S-transform and probabilistic neural network,” IEEE Trans. Power Deliv., vol.23, no.1, pp. 280-287, Jan. 2008.

[11] P. Viswanath, T.H. Sarma, “An improvement to k-nearest neighbor classifier,” IEEE Recent Advances in Intelligent Computational Systems (RAICS), Sept. 22-24, 2011, pp. 227-231.