Abstract

Recently, the distribution network has been integrated with an increasing number of renewable energy sources (RESs) to create hybrid power systems. Due to the interconnection of RESs, there is an increase in power quality disturbances (PQDs). The aim of this article was to present an innovative method for detecting and classifying PQDs that combines convolutional neural networks (CNNs) and long short-term memory (LSTM). The disturbance signals are fed into a combined CNN and LSTM model, which automatically recognizes and classifies the features associated with power quality disturbances. In comparison with other methods, the proposed method overcomes the limitations associated with conventional signal analysis and feature selection. Additionally, to validate the proposed method's robustness, data samples from a modified IEEE 13-node hybrid system are collected and tested using MATLAB/Simulink. The results are good and encouraging.

1. Introduction

Renewable energy sources (RESs) can provide an efficient solution to increase in demand for electricity and also reduce the risk of pollution or global warming. However, the integration of RESs increases the use of solid-state devices, which overstress power quality disturbances (PQDs) such as harmonics, sag or swell in voltage, flicker, and voltage unbalance. Moreover, RESs have major characteristics of fluctuation and intermittent. The instability of renewable energy (RE) generation is an important cause of power quality disturbance, which guides voltage unbalance or fluctuation [1, 2]. The PQDs lead to a failure of electrical equipment [3]. It is understandable that these disturbances are a threat to grid when connected with multiple energy sources. Hence, there is an essential requirement to detect these PQDs to get better quality of power and keep the equipment away from failures. The identification and classification of PQDs depend mainly on feature extraction [4]. For feature extraction, several methods have been developed to detect and classify PQDs. The Fourier transform (FT) is a frequency-domain analysis and is suitable for stationary signal analysis. However, it is incapable to choose feature information when the signal is nonstationary. The discrete Fourier transform (DFT) and short-time Fourier transform (STFT) overcome the drawback of FT using a time-frequency window to localize transient in a signal proposed in [5]. The transient signals are not effectively designated in the STFT due to a fixed window. The S transform (ST) [69] uses a moving window, but the precision becomes lower while examining nonstationary transients.

The authors proposed a Hilbert–Huang transform (HHT)-based method for detecting the single and multiple PQD signals [1012], but the HHT is unsuccessful to build a frequency spectrum that leads to a loss of frequency components having small energy contents. The DWT [1319] methods are more suitable in the signal processing for PQDs to overcome the fixed resolution issue of STFT for analyzing the PQDs. The selection of suitable mother wavelets and sampling rate is the main challenge in DWT. Its accuracy relies on proper feature selection and classifier. Besides, all of these approaches are likely to be pretentious by the noise level of the signal and substantial computational work. Consequently, there is a requirement for a novel PQD detection with wide applicability.

Deep learning (DL) is very effective in automatic feature extraction of image and speech analysis. The DL can extract spatial and temporal features from the input without signal transformation [20]. The application of DL in the PQD problem not only improves the accuracy but also simplifies the process by eliminating handcrafted feature extraction. The application of convolutional neural networks (CNNs) in PQD classification is provided in [21], and the CNN combined with a long-short term memory (LSTM) is used for PQD classification in [22], but the training time, the number of parameters, and the performance against noise were not discussed. Besides, both [21, 22] have not considered the overfitting problem, which may extremely decline the accuracy of DNN. The PQDs are assessed based on a deep belief network in [23]. Although these methods are producing acceptable results in PQD detection in single PQDs, they scuffle with multiple PQDs.

The PQD signal is converted to a 2D image, which is input to DCNN for the detection and classification in [24]. The 2D image of the signal is entirely different from the 1D signal data. Moreover, multiple PQDs are not considered in this work. An effective technique is proposed in [25, 26] using DCNN for single and multiple PQD detection and classification. However, these methods need an enhancement. In this study, a PQD detection method based on combined CNN and LSTM is proposed. The contributions of work are enumerated as follows: (1) by analyzing single and multiple PQDs, the combination of CNN and LSTM layers eliminates manual feature extraction and enables automatic feature extraction and classification. (2) Since the computational complication of the CNN is high, the batch normalization (BN) layer is used to speed up the training process, and the reduced number of parameters is fed to LSTM. (3) To investigate the strength of the method, a complete evaluation of training parameters and accuracy with another model is conducted, including DCNN and CNN with the gated recurrent unit (GRU). 4). Further, to analyze the method, the data are collected by simulating a hybrid system with the PQDs and tested. The rest of this article is arranged as follows: Section 2 explains mathematical models of PQD. In Section 3, the construction proposed model is discussed. Section 4 presents the detailed results and comparison. Section 5 infers construction and verification of the proposed method on hybrid system. Section 6 concludes the work.

2. Power Quality Disturbance Data

A total of 16 PQDs are considered in this work, which include 10 single PQDs (normal, sag, swell, harmonics, flicker, interruption, spike, notch, impulsive, and oscillatory transient) and 6 multiple PQDs (sag with harmonics, sag with flicker, flicker with harmonics, interruption with harmonics, swell with harmonics, and swell with flicker). The proposed PQD detection method uses the data set, which is obtained from mathematical models given in Table 1.

The parameters of the mathematical model are varied as per the direction of IEEE 1159 standard [27]. In all the mathematical models of PQDs, the parameter “A” indicates the amplitude of the waveform and is set to 1 per unit. The factor “α” shows the intensity of the disturbances. The step function u(t) of model presents the time span of PQD in a signal. Harmonic disturbance data use the 3rd, 5th, and 7th orders. The flicker frequency () varied from 5 to 20 Hz, and the corresponding flicker magnitude varied from 0.1 to 0.2 p.u. During oscillatory transient signal generation, fn varies from 300 to 900 Hz, time constant (τ) varies from 0.008 to 0.04 s, and impulse magnitude () varies from 0 to 0.414 p.u. The notch or spike magnitude (k) varies from 0.1 to 0.4 p.u, and the width varies from 0.01 to 0.05 cycles. The sampling frequency of 3200 Hz is set because electric power signal recording equipment mostly uses the chosen sampling frequency. The generated signal contains 640 sampling points (10 cycles, 0.2 s) with the fundamental frequency of 50 Hz. In each PQD case, 8000 data have been generated by varying parameters, and hence, a total of 1,28,000 (8000 × 16 PQDs) data instances have been generated, but there is always some noise superimposed in the signal when it is actually collected from the real system through sensors. So, noise is added to the PQD data set with different signal-to-noise ratios (SNRs) of 20 dB to 40 dB, which increases the total data samples to 5,12,000 (4 × 1,28,000). The details of data set used in this study are presented in Table 2. The characteristic PQ signals simulated by mathematical model equations are shown in Figure 1.

3. The Proposed Method

The disadvantages of conventional signal investigation and feature selection can be overwhelmed by DL. A CNN can be used to take widespread feature extraction by convolutional layer and feature dimension reduction by pooling. Hence, the CNN reveals better generalization capability than old-fashioned feature extraction methods. In PQD detection, a 1D convolutional operation is ensuring spatial feature extraction while holding temporal features. The LSTM network shows outstanding temporal feature extraction capability. The PQD detection is a kind of time-series signal data. This needs that the PQD detection model would hold exceptional temporal and spatial feature extraction capabilities. Consequently, 1D CNN and LSTM network are utilized in the PQD detection model. It extracts the spatial features by 1D CNN, and then, it extracts the temporal features by LSTM network. As a result, this model extracts the features of PQD more completely. The proposed structure of combined CNN and LSTM model is presented in Figure 2, which comprises pair of CNN (two convolutional layers + pooling layers) stacked with three LSTM layers and two fully connected layers at the end.

3.1. Convolutional Layers

The convolutional layer (CL) is the primary layer in CNN. It transfers low-level features into high-level features. The convolutional operator is accomplished on the input with a kernel to create features. The output of CL is given as follows:where y is the output of CL. and br are the weight and bias of the rth layer, respectively, and f(x) is the activation function. It comprehends the activation of a neuron to output. The rectified linear unit (ReLU) activation function is preferred in deep learning rather than the tanh function.

3.2. Pooling Layer

A pooling layer is commonly added next to the CL. It is primarily used for downsampling. The pooling layer is used to reduce the dimension of the data after the convolution layer and extract vital information. It may decrease the influence of data fluctuations. For the PQD waveform, max pooling is better than average pooling and is hence used in this work. The mathematical expression for max pooling is given as follows:

3.3. BN Layer

BN is a method to increase the speed of neural networks. It is used to normalize the input by means of adjusting and scaling the activations. It allows each network to learn by itself more independently than other layers. Besides, it reduces overfitting efficiently compared with dropout. The input data batch x_i may be normalized using the following formula:where μ_x is the batch mean and σx2 is the batch variance. The learned scale and shift parameters are given by ϒ and β, respectively, ensuring that the input data have the same distribution.

3.4. Fully Connected Layer

It is also called the dense layer, and this layer has learning parameter D. The output of the dense layer is calculated by the following formula:

3.5. Softmax Layer

The softmax layer computes the probability distribution of “n” output classes. Hence, the softmax layer is used to foresee the class to which the input data belong. The probability distribution is computed by the following equation:where xi is the input. The output of p lies between 0 and 1, and the sum of all the probabilities will be equal to 1. The softmax layer is used for PQD classification in this work.

3.6. LSTM

LSTM is capable of learning long-term dependencies. A LSTM unit is composed of a cell, input gate, output gate, and forget gate. The cell evokes value over arbitrary time intervals, and the three gates control the flow of information into and out of the cell [28]. The LSTM is well suited for classification problems based on time-series data. Figure 3 demonstrates the construction of LSTM, which comprises input gate, output gate, and forget gate. These gates pick and discard the information passing over the network. Input gate i(t) has an activation function tanh ranging from −1 to 1.

It takes the current input x(t), C(t−1), and h(t−1) parameters for processing. Forget gate f(t) has two activation functions namely sigmoid and tanh. The forget gate chooses exactly how much information is retained from the previous output. The data are to be passed through the network when the value is 1. On the other hand, the data are not to be transformed into the network when the value is 0. The output gate o(t) has an activation function of sigmoid ranging from −1 to 1. The following equations are used to compute i(t), o(t), and f(t) at each and every time step:

3.7. GRU

The GRU is also a kind of RNN similar to LSTM with forget gate but has less parameters than LSTM [29]. It is also reducing time consumption in the training process due to lack of output gate. Hence, GRU is used for the PQD classification problem for comparison. A CNN stacked with GRU is used in this study for comparison.

4. Simulation Results

4.1. Metrics for Evaluation

The evaluation parameters of the proposed method are given as follows:Confusion Matrix: it is used to assess the classification performance of a model.Accuracy = (true positive + true negative)/total test casesPrecision = true positive/(true positive + true negative)Recall = true positive/(true positive + false negative)F1 Score = 2  precision  recall/(precision + recall)

4.2. Results and Discussions

Initially, 512000 samples have been produced as described in Section 2. From the total data set, 98% are used for training, 1% for validation, and 1% for testing. Usually, the training procedure is done with a mini-batch in deep learning. The mini-batch size is chosen as 64 for all three models, such that the training time of different methods is computed accurately. A total of 100 epochs are chosen in this work. However, in each epoch, loss during validation was monitored. The validation loss does not drop for incessant 20 epochs, and the training algorithm would be finished in advance of the scheduled epoch to evade overfitting. Then, the model with the top show in the validation set is chosen as the ultimate model. Moreover, the Python coding for the complete architecture of the proposed CNN + LSTM was carried out in Tesla K80 GPU in this work. During the training, the accuracy and loss values of all models are shown in Figure 4. It is noted that the CNN + LSTM model has better accuracy and less loss during training compared with the other two models.

For all three models, the details of final models and their properties such as parameters, training time, elapsed epochs, accuracy, and loss during validation are presented in Table 3. The combined CNN and LSTM model has less training parameters and produces better classification accuracy during validation. A total of 5120 cases were considered during testing, and the confusion matrices of all three models are shown in Tables 4-6. It was noted that the DCNN model accurately classified 5105 cases and 15 cases are misclassified that produces an accuracy of 99.70%. The combined CNN and GRU has classified 5109 cases correctly and produces the classification accuracy of 99.78%. The proposed method (CNN + LSTM) produces better calcification accuracy of 99.90% with only 5 cases that were misclassified.

Table 7 shows the effectiveness of the combined CNN and LSTM method in terms of precision, recall, andF1 score. The proposed CNN + LSTM model produced 99.90% precision (macro-average), while other deep learning models such as CNN + GRU and DCNN attained 99.79% and 99.71%, respectively. Similarly, F1 score for CNN + LSTM is 99.92%, while CNN + GRU has 99.78% and DCNN has 99.71%. The proposed CNN + LSTM model has the highest precision and F1 score compared with the other DL models. Hence, the proposed CNN + LSTM model outclassed the other models in terms of evaluation parameters.

To test the proposed model under noise grade, 1% of data from each category (both no noise and noise grade) has been randomly selected and the test results are presented in Table 8. The DCNN has provided good accuracy with pure signal (no noise signal). On the other hand, when the noise grade increases the performance is very poor. It uses 174410 trainable parameters and 410 non-trainable parameters. The LSTM + GRU model has a slight improvement in accuracy in all the categories of noise grade. However, the CNN + LSTM proposed in this work produces 100% classification rate for less noise grade and 99.31% under the worst noise grade of 20 dB as well. It uses 95632 parameters with training time of 95 s per epoch on GPU. This shows that the CNN + LSTM is an effective method to identify comprehensive features of each PQD. The performance of CNN + LSTM is better than CNN + GRU and DCNN under different noise levels.

4.3. Comparison of Computational Time

The DNNs may be performed on GPU to accomplish greater speed. The total number of units in GPU is greater than the CPU processor. Hence, the computational speed for DCNN on GPU is very fast. The computational time of DCNN is considerably lesser due to its parallel computation of GPU. The computation time in GPU and CPU is compared for 512000 samples in the DCNN model in Table 9.

4.4. Comparison with Existing Work

To validate the proposed method, the comparison has been done with existing DCNN and the conventional methods. The performance of different methods under complex PQ disturbances is listed in Table 10. This shows that the conventional methods require features from signal transformation before classification. Basically, the variance in the number and type of features produces a difference in the classification rate. For example, the FDST and DT designed with twenty features produced an accuracy of 99.28% [33]. Conversely, the ST and RF attained 99.7% of accuracy with only four features [30]. Hence, the multiple information is captured by CNN + LSTM, which makes it promising for automatic feature extraction. The proposed CNN + LSTM shows the superiority of the model compared with the traditional models. The proposed CNN + LSTM considered sixteen PQDs and produced 100% accuracy for low noise grade and 99.31% under the worst noise grade compared with the other DL models and other traditional methods.

5. Simulation of PQDs in Hybrid System

5.1. Hybrid System Studied

To further analyze the proposed method, a standard IEEE 13-node system [34] is modified to form a hybrid system as shown in Figure 5.

The hybrid system model is generated by incorporating the wind and solar photovoltaic (PV) cells into a standard IEEE 13-node test system. In the modified system, a wind energy conversion system (WECS) with doubly fed induction motor (DFIG) rated 1.5 MW, 575 V integrated at bus 680 through the transformer XWG, and an 8 km overhead transmission line. The model parameters of wind energy system have been reported in [35]. Similarly, a PV plant with the capacity of 1 MW is connected to the grid through the transformer XSPV at node 680, and the model parameters of complete PV system have been reported in [36]. Consequently, node 680 is considered as a point of common coupling (PCC). The complete experimental parameters such as load details, transformer data, and feeder details of the proposed system are provided in [37]. A capacitor bank is associated with nodes 611 and 675. The nonlinear load is connected to node 680 in the modified IEEE 13-node test system, and voltage regulator between nodes 632 and 650 is not used.

5.2. Generation of PQDs in Hybrid System

The modified IEEE 13-node system is simulated in MATLAB/Simulink. A normal waveform is produced at standard voltage and frequency. The voltage sag signal may be produced by adding line to ground faults at the generation side, switching huge load at a time, and sudden start-up of wind turbine. Voltage swell signals are generated by removing huge load in the system or by adding line to line faults at the generator end. For the generation of voltage interruption signal, the system is operated in islanding mode with the huge load in DGs that are tripped. Harmonics and notch are generated by connecting nonlinear loads. An oscillatory transient and spike are generated by switching a capacitor bank to the system due to the islanding process. The arc furnace model is connected at the load side to create flickering waveforms [38]. An impulsive transient is generated by connecting the lightning model in the system.

The multiple PQDs may be produced by simultaneous presentations of faults, switching, and mode changing of the grid. Nevertheless, there is less opportunity for multiple PQDs at a time in any system. Therefore, on a hybrid system only single PQDs with 200 cases are generated by changing different combinations of grid operations. These samples are added with noise (40 dB, 30 dB, and 20 dB) such that the total samples are 800 (200 × 4). All these samples are validated through the proposed CNN + LSTM method, and the test results are presented in Table 11. It is noted that 797 among 800 cases are classified correctly with the classification rate of 99.63%. The evaluation metrics such as precision, recall, and F1 score is the same as accuracy with 99.63%, which infers that the proposed DL model works better even though the test data set is different. These results show that the proposed DL model is a more generalized model for the detection and classification of PQDs.

6. Conclusion

This study proposes an application of combined CNN and LSTM to the PQD classification. The proposed CNN + LSTM comprehends an automatic feature extraction and selection and eliminates conventional ladders to enhance PQD detection. The proposed CNN + LSTM is compared with the other models such as DCNNs and CNN + GRU. The result indicates that the proposed CNN + LSTM method has higher accuracy, while taking less training than the other DL models. Compared with the existing methods, the CNN + LSTM algorithm performs well in noisy environments. The number of the parameters and complexity of the CNN + LSTM model are reduced, and hence, the computation speed is less. The proposed method is validated with a hybrid system and evidenced to achieve PQD classification with high accuracy. The proposed method is comprehended under offline environments. However, the online implementation is considered in future work.

Data Availability

The generated data set is available with this article as a supplementary file.

Conflicts of Interest

The authors have no conflicts of interest to declare.

Supplementary Materials

The generated signal contains 640 sampling points (10 cycles, 0.2 s) with the fundamental frequency of 50 Hz. In each PQD case, 8000 data have been generated by varying parameters, and hence, a total of 1,28,000 (8000 × 16 PQDs) data have been generated. The noise is superimposed on the signal when it is actually collected from the real system through sensors. So, noise is added to the PQD data set with different signal-to-noise ratios (SNRs) of 20 dB, 30 dB, and 40 dB, which increases the total data samples to 5,12,000 (4 × 1,28,000). The following is the description of each file: x0db_test.txt: data of 0 dB noise; x20db_test.txt: data of 20 dB noise superimposed on the signal; x30db_test.txt: data of 30 dB noise superimposed on the signal; x40db_test.txt: data of 40 dB noise superimposed on the signal. (Supplementary Materials)