#### Abstract

Recognition and analytics at the edge enable utility companies to predict and prevent problems in real time. Clearing the voltage sag disturbance source by the positioning method is the most effective way to solve and improve the voltage sag. However, for different grid structures and fault types, the existing methods usually achieve a sag source location based on the single feature of monitoring data extraction. However, due to the effectiveness and applicability of the existing method features, this paper proposes a multidimensional feature of the voltage sag source positioning method of the matrix. Based on the analysis of the characteristics of the voltage sag event caused by the fault, this paper proposes a multidimensional feature matrix for voltage sag source location, based on the convolutional neural network to establish the mapping relationship between the feature matrix and the voltage sag position, thus achieving multiple points based on multiple points. The voltage sag source orientation is identified by the monitoring data. Finally, the voltage sag event caused by the short-circuit fault is simulated in the IEEE14 node model, and the effectiveness of the proposed method is verified by simulation data. The simulation results show that the proposed method has higher accuracy than the traditional method, and the method can be applied to different grid structures and different types of faults.

#### 1. Introduction

Electric Internet of Things (UEIoT) realizes the interconnection of everything and human-computer interaction in all aspects of the power system by fully applying mobile Internet technology, artificial intelligence technology, and advanced communication technology. It provides intelligent services characterized by a comprehensive perception of the state, efficient processing of information, and convenient and flexible application. In order to drive reliability and operational efficiency, utility companies now need to leverage advanced distribution analysis. Delivering analytics at the edge means that the energy industry can use data in a far more effective and efficient way. Detection at the edge enables utility companies to predict and prevent problems in real time, to cost-effectively deploy resources and personnel, and to increase overall grid optimization, security, and reliability. A voltage sag is a power quality disturbance event where supply voltage quickly recovers after dropping [1]. The root cause of the voltage sag is the voltage sag of a common connecting point which is caused by the increase in the partial voltage of power impedance due to the increase in current. The causes of the voltage sag can be divided into short-circuit fault, transformer magnetizing inrush current, inductive motor start, and other large-capacity load operations [2–4]. The positioning of the voltage sag can not only be used to divide the temporary responsibility of both power supply and power consumption but also help to shorten the time spent by a power supply company on fault elimination [5].

At present, the positioning methods of the current voltage sag can be roughly divided into positioning methods based on a single monitoring point [6–9] and positioning methods based on multiple monitoring points [10, 11]. Literature [6] determines whether the voltage sag source is in the upstream or downstream of the power quality detection device according to the signs of the disturbed active power (i.e., the difference between the active power before and after the occurrence of the voltage sag) and the disturbed active power energy (the integral of the disturbed active power on a time scale). Literature [7] uses the fundamental voltage and current recorded by the power quality monitoring device to calculate equivalent impedance and determines whether the voltage sag is located in the upstream or downstream of the power quality monitoring device according to the signs of the real part of impedance. Literature [8] judges that the voltage sag source is located in the upstream or downstream of the monitoring point according to the slope of the line segment connected by two points before and after the fault. Literature [9] determines whether the voltage sag source is located in the upstream or downstream of the monitoring point according to the signs of the real part of current during the voltage sag. Literature [10] puts forward the sensitivity index of the fault current to the voltage sag, determines the priority of nodes according to the sensitivity index, and then determines the priority of the installation location of the power quality monitor according to this index. Then, the position of the voltage sag source is determined according to the current variation of each monitoring branch before and after the voltage sag event as well as the priority of the nodes. Literature [11] searches the voltage sag path by using the feeder sending end and determines that the branch line with the lowest voltage is the line where the voltage sag occurs. Then, a quadratic function is used to fit the voltage into the function of distance, which can not only realize the estimation of node voltage sag but also achieve the location of the voltage sag source.

Traditional locating methods of the voltage sag source have some limitations in practical application. The locating methods based on a single monitoring point are only suitable for a radiation network. Besides, the judgment results based on the disturbed active power and disturbed active energy may not match [2], and this method lacks theoretical derivation [12]. The real part method of equivalent impedance [7], the system trajectory slope method [8], and the real part current method [9] all assume that the circuit conditions will not change when there is a voltage sag caused by the fault, which is bound to affect the judgment result. Although the method proposed in literature [10] is applicable to radiation networks and ring networks, it is affected by the system grounding mode. The method proposed in literature [11] is only applicable to radial networks. To solve the problems such as limited application scope and inaccurate positioning of the existing methods, literature [3, 13, 14] integrates the system slope trajectory and other traditional positioning methods as comprehensive criteria and uses the BP Neural Network (BPNN) and Support Vector Machine (SVM) to establish the mapping relationship between the criteria and positioning results, respectively. Literature [15, 16] obtains the first peak of the disturbed power after the occurrence of the voltage sag as the feature vector, and then, the SVM and Radial Basis Function (RBF) Neural Network are used to conduct classification and then achieve fault location, respectively. The voltage sag source location method based on classification considers the voltage sag source location a binary classification problem and determines whether the voltage sag source is located in the upstream or downstream of a single monitoring point. Such methods are prone to have conflicting features that affect the classification results, especially when they are used for voltage sag positioning in a loop network.

As the power grid fault is the main cause of the voltage sag [17, 18], in this paper, on the basis of the research of the existing methods, the main contributions are as follows: (1)A voltage sag source location method based on a multidimensional feature matrix is proposed to conduct the positioning of the voltage sag events caused by the power grid fault(2)Then, the characteristics of voltage sag events are analyzed, and the disturbance power, disturbance energy, real part of equivalent impedance, slope trajectory, and real part of the current of all monitoring nodes of the whole network are extracted to form the feature matrix(3)Later, the locating problem of the voltage sag source is transformed into a multiclassification problem. The features are extracted by the convolutional layer and sampling layer of the convolutional neural networks (CNN) to avoid the contradiction between the features. The mapping relationship between deep features and the location of the voltage sag source is established through the fully connected layer of CNN to realize the location of the voltage sag source(4)In the IEEE14 node model, the grid fault data is obtained by simulation, in order to verify the effectiveness of the proposed method. The simulation results show that the proposed method is more accurate than the traditional methods and more applicable to different network structures and different types of faults

The rest of the paper is organized as follows. We first discuss some related works in voltage sag source location methods, and then, we elaborate our proposed sag source location method based on convolutional neural network algorithm. Moreover, we present experiments to evaluate our method in Simulation Analysis. Finally, the conclusions of this paper are given in Conclusion.

#### 2. Voltage Sag Source Location Methods

##### 2.1. Upstream and Downstream Positioning Methods

Both positioning criteria [6–9] proposed according to the variation of electric quantity when the voltage sag occurs and the method that constitutes a comprehensive criterion for a classifier’s classification and identification [13–16] judge whether the voltage sag source is located in the upstream or downstream of the power quality monitoring device. As shown in Figure 1, the reference direction of the power flow has been marked with arrows. As for the power quality monitoring device , the lines and where the energy flows to and the lines , , and where the energy does not flow through are the upstream regions, while the lines where the energy flows through are the downstream regions. This method which defines upstream and downstream is only applicable to radial networks, but for more complex networks such as ring networks, it may be difficult for this method to define upstream and downstream.

##### 2.2. Multimonitoring Point Positioning Method

The positioning method based on multimonitoring points needs to install a large number of monitoring devices in the power grid. At present, the positioning methods based on multimonitoring points mainly include the deviation method based on branch current [10] and the node voltage deviation index method [11].

The branch current deviation method uses the system coefficient matrix to calculate the current of the system when the bus fails: where is the equivalent resistance at the bus , represents the fault resistance, is the transmission impedance between the buses and , and represents the line impedance between the buses and .

The sensitivity of the system current to the transient voltage is defined as

The branch current deviation is where and are defined as the current values before and after the failure, respectively.

The sensitivity of all nodes in the network is calculated, and the monitoring device is installed in the nodes with higher sensitivity. When a fault occurs, the current deviation of each branch of the bus equipped with the monitoring device is calculated, and the positioning of the voltage sag source can be realized by searching according to the current deviation. This method has obvious defects, and the fault current varies in different grounding modes, so it is difficult to guarantee the reliability of its application.

The node voltage deviation method calculates the voltages of all nodes in the whole network based on the system coefficient and monitoring data. The voltage deviation is defined as

The bus with the maximum voltage deviation is determined as the location where the voltage sag source occurs. This method does not take into account the voltage sag caused by different short-circuit faults, so it has some limitations.

#### 3. Multidimensional Characteristic Matrix for Sag Source Location

Effective feature selection is the key to realize classification. Based on the existing methods, the disturbance power and energy, the real part of the equivalent impedance, the slope of the system trajectory, and the real part of the current are extracted from each node.

##### 3.1. Disturbance Power and Disturbance Energy

DP (disturbance power) is defined as the difference between the instantaneous power and the steady-state operating power, while DE (disturbance energy) is defined as the integral of the disturbance energy during the disturbance. where and represent the transient power during disturbance and steady-state operation, respectively.

##### 3.2. Equivalent Impedance Real Part

Based on the equivalent circuit shown in Figure 2, the equivalent impedance variation at the power quality monitoring device caused by the voltage sag is analyzed.

Assuming that there is a disturbance in the downstream of the power quality monitoring device, the system parameters do not change during the disturbance, the voltage variation is , and the current variation is , then

The equivalent impedance can be calculated by Equations (7) and (8):

Similarly, the equivalent impedance can be calculated when the disturbance occurs in the upstream:

Therefore, the equivalent impedance can be defined as , and the voltage sag source can be localized according to the polarity.

##### 3.3. System Slope Trajectory

Equation (10) can be transformed into where denotes the phase difference between and and represents the phase difference between and .

When the disturbance occurs in the upstream of the power quality monitoring device, ; when the disturbance occurs in the downstream of the power quality monitoring device, . It can be seen from Equation (11) that, assuming that the operating parameters do not change when the disturbance occurs, the position of the voltage sag can be judged by the correlation between and . Therefore, a line is synthesized during the disturbance to locate the voltage sag source according to the slope of the line .

##### 3.4. Real Part of the Current

According to Equation (12), when the disturbance occurs in the upstream, the current direction during the disturbance is opposite to that before the disturbance. When the disturbance occurs in the downstream, the current direction during the disturbance is the same as that before the disturbance. Therefore, the sag source can be localized according to the polarity.

##### 3.5. Characteristic Matrix

The characteristic matrix of the whole network is as follows: where represents the characteristic matrix of phase , and the three-dimensional characteristic matrix formed is used as the input of the three channels of CNN.

#### 4. Sag Source Location Method Based on the Convolutional Neural Network (CNN)

The voltage sag location method proposed in this paper is used to classify and identify voltage sag events occurring on different lines. When the 3D characteristic matrix selected in Section 1 is used for classification and recognition, there may be a problem of mutual redundancy among features or failure to completely represent the voltage sag, which affects the accuracy of the final classification. As a bionic model, CNN’s basic framework usually includes a feature extractor and classifier [19], and it is composed of a convolutional layer, sampling layer, and fully connected layer [20–22]. Its structure is shown in Figure 3. The convolutional layer and the sampling layer can not only effectively learn the original feature matrix of the input at a deeper level but also reduce the number of neurons and simplify the complexity of the network through weight sharing. The fully connected layer, as a classifier, inputs the features after convolution and sampling and outputs classification categories.

##### 4.1. Forward Pass

In the forward pass process, the output of the th convolutional layer is where denotes the th output characteristic matrix of the th layer, denotes the activation function, denotes the combination of the characteristic matrix output by the upper layer, denotes the convolution kernel connecting and , and denotes the bias corresponded by .

The output of the th convolutional layer is the input of the th sampling layer. In this case, the output of the th sampling layer is where represents the lower sampling function.

The output obtained by convolution sampling is sorted into , as the input of the fully connected layer, and the output of the th fully connected layer is where denotes the weight connecting and and is the bias of the th layer.

##### 4.2. Backward Pass

The training of CNN minimizes the error between the output data and the expected data by adjusting the weight and bias, and this process is known as reverse pass. As a supervised learning algorithm, it is necessary to define a loss function before conducting reverse pass. The commonly used error functions include the square error loss function and cross-entropy loss function. In this paper, the cross-entropy loss function is selected: where represents the number of samples, represents the expected output, and represents the actual output.

According to the loss function, the error of each neuron in the th output layer can be calculated: where is the value of the input activation function of the th neuron in the th layer. Equation (17) can be written as the matrix form as follows: where represents the Hadamard product.

The error of the th layer of the fully connected layer can be used to calculate the error of the th layer of the full connected layer:

Given the sampling layer error, the error of the previous layer can be calculated as follows: where represents the upsampling function.

Given the convolution layer error, the error of the previous layer can be calculated as follows:

The backpropagation of the error can be used to calculate the gradient of the weight and bias:

The gradient descent method is adopted to adjust the weight and bias of the network: where denotes the weight or bias and denotes the learning rate.

##### 4.3. Sag Source Positioning Method

In this paper, a voltage sag source positioning method based on a multidimensional characteristic matrix is proposed to locate single voltage sag events caused by the grid fault. The positioning of the voltage sag source is considered a multiclassification problem, and the voltage sag events occurring on different lines are divided into different categories. The mapping relationship between voltage sag events and lines is established by CNN to realize the location of the voltage sag source. The flowchart of the method proposed in this paper is shown in Figure 4. (1)Record the voltage and current waveform of all monitoring points in the whole network when the voltage sag occurs. The IEEE14 node model is built in PSCAD/EMTDC to simulate voltage sag events caused by the short-circuit fault, and then, the voltage waveform of each node corresponded by each voltage sag event and the current waveform at both ends of each line are recorded(2)Based on the data recorded in step (1), the disturbance power, disturbance energy, real part of equivalent impedance, slope of system trajectory, and real part of the current at each end of each line are calculated to form a feature matrix, and then, the corresponding labels are set according to the line where the voltage sag occurs. The characteristic matrix and corresponding tags are used as a sample for CNN training. In this paper, the CNN trained for the test randomly selects a part of the obtained samples as the test samples(3)Take the training sample as the input of CNN and conduct forward pass to output the predicted tag. In order to make CNN output the result that matches the actual tag, reverse pass is required to adjust the network parameters. The trained CNN has established the mapping relationship between input and output(4)Based on the CNN completed by training, the positioning of the voltage sag source can be realized. Input the characteristic matrix of voltage sag events that need to be located, and the output is the label of the circuit that occurs. This paper tests the classification performance of CNN completed by training based on the test samples obtained in step (2).

#### 5. Simulation Analysis

##### 5.1. Data Acquisition

To verify the CNN-based voltage sag source location method proposed in this paper, a large amount of data of voltage sag events are needed. Firstly, the IEEE14 node model is built in PSCAD/EMTDC, as shown in Figure 5. Faults are set at each ten equal points of each line, including single line-to-ground fault (SLGF), phase-to-phase fault (PPF), double line-to-ground fault (DLGF), and three line-to-ground fault (TLGF). Ten uniform random numbers whose transition resistance is between 0 and 10 *Ω* are set at each fault point for simulation. Then, the sampling frequency of 5 kHz is used to record the voltage waveform of 14 nodes and the current waveform at both ends of 17 lines during each simulation.

The recorded waveform data is input into MATLAB for processing. First of all, an FIR low-pass filter is designed to filter the collected data and retain the power frequency component. Secondly, the features mentioned in Section 2 at both ends of each line are extracted to form a feature matrix of , and then, the corresponding label (label format is ) is set. The 100 sample sets of each line are randomly divided into 80 training samples and 20 test samples, and the sample distribution is shown in Table 1.

##### 5.2. Model Evaluation Index

The indexes which are used to evaluate dichotomy problems mainly include accuracy rate, recall rate, F1 value index, ROC curve, etc. [23–26], but they are no longer fully applicable to the multiple classification problems appearing in this paper. Therefore, the accuracy rate and kappa coefficient [27–30] are intended to be used to evaluate the models used in this paper.

The calculation formula of kappa is as follows: where represents the classification accuracy of samples, represents the number of samples of category, represents the number of samples predicted to be category , and represents the total number of samples.

##### 5.3. Construction of the CNN Model

Based on TensorFlow, a deep learning framework developed by Google, CNN is built. The CNN consists of two convolutional sampling layers and three fully connected layers [31–36]. The first convolutional layer has 32 convolution kernels with a size of , the second convolutional layer has 64 convolution kernels with a size of , the convolution kernel of the sampling layer is , and the number of nodes in the middle layer of the fully connected layer is 1024. Among them, the activation function of the hidden layer is “RELU,” the activation function of the output layer is “SOFTMAX,” the convolution mode is “VALID,” and the sampling mode is “SAME.”

The CNN which has been built is trained in batches, and 80 training samples are randomly trained in each batch. The weight is set as a normally distributed random number with a mean value of 0 and variance of 0.1, the bias is set as a constant of 0.1, the learning rate is set as 0.0001, and the number of training is set as 1000. Adam-Optimizer is selected to adaptively control the learning rate of each parameter in the network.

##### 5.4. Single-Phase Ground Fault Analysis

The classification results of the voltage sag source caused by SLGF are analyzed, and only the classification results of other fault types are given. The change curve of the loss function value and the change curve of classification accuracy of the training set and test set are shown in Figure 6.

**(a)**

**(b)**

Based on the obfuscation matrix, the evaluation index of the model is calculated, each column of the obfuscation matrix represents the predicted category, and each row represents the actual category. In this paper, there are 17 types of SLGF samples, so the dimension of the confusion matrix is . To observe and draw the confusion matrix easily, as shown in Figure 7, the omitted parts are all correctly classified samples. Based on the confusion matrix, one sample of line ( represents the line between node 2 and node 3) is misclassified as line by the classifier and two samples of line as line , and the samples of other lines can be correctly classified as the real category.

The confusion matrix as shown in Figure 7 can be drawn by using the -nearest Neighbor (KNN) and Ensemble Learning Algorithm (EL) (the confusion matrix of the classification results of the comparison classifier is omitted here due to space limitation). The respective classification indexes can be calculated according to the confounding matrices of different classifiers, as shown in Table 2.

The classification accuracy of CNN is 99.12% and the kappa coefficient is 99.06%, which are the highest among the three classifiers.

##### 5.5. Other Short-Circuit Fault Analysis

The samples of PPF, DLGF, and TLGF are trained and classified by the same classification model. The training process of CNN is shown in Figure 8, and the classification results are shown in Table 3.

**(a)**

**(b)**

**(c)**

It can be seen that, when the voltage sag sources caused by different fault types are classified based on single transient characteristics, the classification accuracy of voltage sag sources caused by different fault types is seriously affected by different feature selections, different classifiers, and different fault types. The classification accuracy of KNN and EL is improved based on multidimensional features, but it cannot meet the requirements. Regardless of the voltage sag events caused by any type of fault, CNN can be used to accurately classify based on the multidimensional feature matrix, and the classification accuracy is up to 100%.

##### 5.6. Comparison with Existing Methods

The proposed method is based on multipoint monitoring data and can be used to identify voltage sag sources in loop and radiation networks. The existing voltage sag source positioning methods based on multimonitoring points include the branch current deviation method and node voltage deviation method. Among them, the node voltage deviation method does not consider SLGF, DLGF, and TLGF faults. Therefore, the proposed method is compared with the branch current deviation method.

The branch current deviation method defines the current outflow node as the positive direction. The deviation current of the branch is calculated by Equation (3), and the priority is determined according to the magnitude of the deviation current, thus determining the direction of the voltage sag source. The primary SLGF on line is positioned, and the branch current deviation method is briefly described as an example.

The deviation coefficients of all branch currents are calculated, as shown in Table 4. It can be seen that, according to the priority, fault current flows through line from node 1 and through line from node 2. Therefore, it can be judged that SLGF occurs on line .

Based on the branch current deviation method, the samples used for the CNN test are located for the voltage sag source, and the positioning results are shown in Table 5.

It can be seen from Table 5 that the branch current deviation method is used to locate the voltage sag caused by SLGF, DLGF, and TLGF, and the positioning accuracy is 48.24%. The accuracy of voltage sag positioning caused by PPF is 60.29%, so there is a certain gap with the method proposed in this paper. Based on the analysis of the positioning results, this method is greatly affected by the position of the power source, and the fault near the power source generates a larger fault current, so it can be positioned more accurately. Besides, the fault current in the neutral arc suppression coil system is composed of the whole system capacitive current, so this method is not applicable to the neutral arc suppression coil grounded system.

#### 6. Conclusion

In summary, the voltage sag source location method based on the multidimensional characteristic matrix proposed in this paper can accurately locate the voltage sag caused by different fault types. Compared with the traditional voltage sag source location method based on multipoint monitoring data, it has higher accuracy and is more suitable for the voltage sag source location in the loop network.

In this paper, a locating method of the voltage sag source based on the multidimensional feature matrix was proposed; then, a multidimensional feature matrix was constructed by extracting the disturbance power and disturbance energy, the real part of equivalent impedance, the slope of system trajectory, and the real part of the current at both ends of the whole network line, and then, CNN was used to realize the voltage sag source. The IEEE14 node model was built in PSCAD\EMTDC, and a large number of waveform data obtained by simulation under different fault types was adopted to verify the proposed method in this paper, and then, it was compared with the branch current deviation method. The simulation results show that the proposed method could accurately identify the location of voltage sag sources under different fault types, and the accuracy was higher than that of traditional methods.

#### Conflicts of Interest

The authors declare no conflict of interest.

#### Acknowledgments

This paper is sponsored by State Grid Science and Technology Project (Grant No. 52153218000B).