1 Introduction

The reliability and adaptability of the electricity grid are improved by the incorporation of intelligent devices, which is made possible by smart grids [1]. Due to limitations in kinetic energy storage and the dynamic reaction of electronic power converters in DG systems, micro grids (MG) necessitate quick and adaptive fault classification procedures [2, 3]. Transmission line (TL) fault detection and classification are crucial to fault root cause analysis and quick power grid recovery [4]. Fault analysis has benefited greatly from the use of deep learning due to its ability to automatically extract representative features from large datasets [5]. In order to generalize, the current deep learning-based fault detection algorithms require a significant amount of data collected under a wide range of fault circumstances [6]. Defining and, hence, collecting received fault characteristics in all potential fault scenarios is challenging in the TL area. As a result, researchers encounter a number of difficulties in overcoming these faults. It is important to have a method that communicates the nature of the occurrence to the centralized security networks [7,8,9]. Since fault localization algorithms cannot do their job without knowing what kind of fault happened in the network, techniques for detecting and classifying faults are crucial [10].

For SGs and MGs, different authors discuss various fault location techniques and methods, such as using smart devices like smart meters, smart sensors, phase measurement units (PMU), and switching devices [9], as well as using knowledge-based methods [11], intelligent approaches [12], acceptance methods with load estimation [13], location through Supervisory Control and Data Acquisition (SCADA) systems and many intelligent electronic device (IED) data [14], and methods based on high frequency components (S-transform) [15, 16]. To carry out a thorough examination of the fault location in SGs in the distribution domain, these techniques are still insufficient.

Methods for locating faults in transmission lines can be classified into two broad categories: those that rely on traveling waves and those that employ impedance. The impedance method relies on the linear relationship between the measured impedance and the distance from the fault location to the measurement location in order to pinpoint the exact location of an electrical issue. Several sources [17, 18] have looked into the feasibility of using the impedance approach to pinpoint the location of faults in overhead transmission lines. The disparity between aerial and cable sections' positive and zero sequence impedance is the primary drawback of employing this technique in integrated transmission lines [19, 20]. However, detecting the location of the fault in combined lines presents significant difficulties due to the impedance-based locating approach [21]. The traveling wave approach is the fastest and most accurate of the methods available for fault detection. Mobile-wave detection is typically performed post-error in this positioning method [22, 23]. This method works well for this task because it uses mobile waves and different procedures on variable voltage, current, and frequency signals to quickly and precisely identify and detect faults. Meanwhile, a number of methods have been introduced to boost fault identification, classification, and localization in transmission lines. In this study, we use a fuzzy thresholding system to detect faults based on voltage measurements made at the line's origin, a decision tree and a random forest algorithm to classify the faults that have occurred, both of which have been optimized using the wild horse optimization algorithm, and an Adaptive Neural Fuzzy Interface System (ANFIS) to locate the faults using wave frequency signals. The main limitation of this research is the lack of accurate access to real network information and the modeling of the proposed plan under a Simulink MATLAB model, which will highlight the need for the practical implementation of the proposed approach. One of the important gaps in the problem of error detection is the low speed of the methods in a real-time approach. Also, accurate location of the fault location to fix the fault in time and prevent long-term blackout of the transmission line is one of the other important challenges in the upcoming issue. The contributions of this work are outlined as follows:

  • This research addresses various fault types and their localization strategies with an intelligent strategy for transmission systems.

  • Machine learning systems and meta-heuristic algorithms are used to solve problems for fault location methodologies and types of failures impacting Electric Power Systems (EPS), SGs, and MGs.

  • This document also provides advanced methods for troubleshooting SGs and MGs expeditiously and precisely by considering fault-tolerant controls, communication structures that ensure automatic fault location and self-healing, and the use of intelligent algorithms to identify and minimize risk.

  • To improve the flexibility of these intelligent systems, this evaluation also looks at the fault location method for transmission networks and takes into account different parameters with the least amount of distance error.

The remainder of this essay is organized as follows: Sect. 2 provides a brief overview of the background of relevant publications and introductory concepts. Section 3 provides a description of the suggested methodologies and approaches for the proposed identification, categorization, and localization. The transfer system used in Murray's study is simulated in the fourth section, and the findings are examined. The article's conclusions are then presented in the fifth section.

1.1 Research Background

1.2 Literature Review

The control and energy management problems of micro grids (MGs) are challenging due to the high level of uncertainties and disturbances such as changes in demands, mechanical powers, and solar energies. So, intelligent computing is needed to be developed for these systems. In Paper [24], automatic voltage and frequency regulation is achieved with the implementation of a resilient and optimum fuzzy controller. Fuzzy logic strengthens the defense against unknowns and disruptions like radiation, variations in wind power, and shifts in load demand. Rising time, settling time, overshoot, and the control system's resistance to uncertainties and perturbation effects are some of the suitable and effective criteria used by the newly presented controller.

Fault detection and classification in transmission lines (TL) is crucial in the present era to guarantee reliability and uninterrupted power delivery. Isolating a problematic part from the rest of the network is essential for maintaining reliability and reducing power outages caused by malfunctions. Automation methods and machine learning algorithms have become increasingly significant in virtually every industry in recent years. In [25], an ML-based system for detecting and categorizing faults is proposed. Ten distinct types of normal and error data (in voltage and current units) were generated by simulation of two different TLs in MATLAB Simulink. In contrast to the TL-2, which featured two generators and three loads, the TL-1 only featured a single generator and load. The data were first normalized, and then a classifier based on an extreme learning machine (ELM) technique was applied. Training led to the development of two distinct ELM models, one for FD and one for FC. The resulting error classification accuracy for TL-1 was 99.18% and for TL-2 was 99.09%.

Using SA-MobileNetV3, the authors of [26] describe a time-series-based fault-tolerant classification approach for transmission systems. Since MobileNetV3's SE (Squeeze-and-Excitation) module lacks the ability to collect channel spatial dimension information, the SA (shuffle attention) module was developed to accurately determine the significance of pixels across channels and combine them in strategic locations. The suggested method is analogous to image recognition in that it can extract high-level features from time-series voltage and current signals using the same channel. The simulation results for a data-generating model of a 735 kV transmission line show that this technology can rapidly identify 11 types of problems, with an accuracy rate of 99.90%.

A novel, efficient method for fault detection and classification in a transmission line is presented in the study [27]. After creating the fault detection signal, the proposed algorithm does not require any more data for fault classification, and it often converges for fault detection in half a cycle from the fault's onset. In this scenario, quicker circuit breakers can be used. Only the three-phase current signals collected at the relay end are used in the two-stage approach, which combines wavelet transform (WT) and a Chebyshev neural network (ChNN). In [28], the author presents a fuzzy logic system for early failure detection. The suggested approach can accurately detect and categorize a wide range of fault types, including symmetrical, asymmetrical, high impedance fault (HIF), and evolving faults.

In [29], an intelligent fault detection and classification technique based on fuzzy logic is created for DG-integrated distribution lines. In each stage, two modeled Fuzzy Inference Systems (FIS) look for errors. The first FIS identifies the high magnitude of fault current associated with normal shunt faults; and the second FIS identifies the small magnitude of current owing to occurrence of HIF. The features derived from the Teager energy operator are used in the proposed design. Response time is roughly 1–1/4 cycle time, according to the research.

In [30], a novel algorithm is created to identify line failures in real-time. The generator bus current deviation index (GBCDI) and the line current distribution factor (LCDF) are the two additional parameters on which the proposed algorithm relies. The projected GBCDI is used to determine which bus will serve as the primary bus (PB), and from there, which of the available lines will serve as the primary line (PL). Power system operators have easy access to the LCDF proposed for a variety of scenarios that may be simply calculated. Now, the suggested objective function measures the line current estimated using the LCDF and compares it to the PMU of the observed PL current for different scenarios. To further ground the generated model in reality, the PMU error is incorporated into the objective function.

In [31], a fault detection, identification, and location approach based on matching pursuit decomposition (MPD) using real-time voltage variations are described. Fault line maps are produced by machine learning algorithms in smart grid (SG) systems. In particular, MPD extracts time–frequency characteristics from voltage and frequency signals that are collected by SG frequency perturbation recorders. Then a hybrid clustering technique is designed and utilized to cluster the frequency and voltage signal properties in distinct symbols. Using symbols, two detection HMMs are trained for fault detection to distinguish between normal and abnormal operating conditions of the SG [32]. Also, numerous identification HMMs are trained under different system error scenarios, and in the case of an error, the learned recognition HMMs are utilized to identify the sorts of errors. Meanwhile, if the fault is discovered by the detection HMMs, a fault line map is constructed utilizing the feature extracted by MPD from voltage signals and SG topology information. Numerical findings illustrate the feasibility, efficacy and accuracy of the suggested method for detecting different sorts of faults with varied measurement signal-to-noise ratios in SG systems.

The study [33] looks at the problems with MGs operating in both stand-alone (SA) and grid-connected (GC) modes. It also creates real-time protection and intelligent disturbance detection methods to ensure the MGs operate steadily. An intelligent fault classification mechanism is established in the suggested technique by leveraging the benefits of convolutional neural networks (CNN) and wavelet transform. Prior to using the wavelet transform for picture preprocessing and transformation, the voltage and current measurements are examined for any potential MG network faults. After being converted, the images are recognized as scalograms and further trained using CNNs. In order to assess the progress of the suggested method, data gathering using the IEEE 13-bus system is taken into consideration. During the classifier generation process, additive white Gaussian noise (AWGN) and additive impulsive Gaussian noise (AIGN) are injected at different levels to mimic the real-time behavior of the MG network. The average test accuracy for the trained classifier is 98.9% for SA MG and 97.1% for GC MG; whereas, the average training accuracy is 99.1% for SA MG and 97.7% for GC MG.

A novel approach based on convolutional distributed autoencoders (CSAEs) for fault detection and classification in power transmission lines is proposed in [34]. In contrast to traditional approaches, the suggested method builds a framework for defect identification and classification by automatically extracting features from the voltage and current signal data set. For half-cycle multichannel signal segments, convolutional feature mapping and mean integration are used to create feature vectors with local transfer invariance. Feature vectors are used by a softmax classifier to detect and classify faults. The creation of an ANN for fault classification and detection in the power transmission line is the main topic of the paper [35]. This study evolves the fault detector and classifier using feed-forward artificial neural networks with backpropagation algorithms. The classifier and fault detector are trained before the instantaneous current and voltage readings are obtained.

A reduced order Thau observer is developed in paper [36] by focusing solely on the unknown rotational dynamics, which are reconstructed as the dominating linear and nonlinear for design purposes. Hence, the suggested Thau observer may detect quadrotor defects and provide information on a rotational state estimate mistake, although it is only of third order. Additionally, this study provides the suggested Thau observer with a basic online adaptive fault estimating law that may detect two malfunctioning actuators simultaneously by utilizing the predicted rotational state error. Both the adaptive fault estimates and the Thau observer states show convergence of errors, according to Lyapunov analysis. Furthermore, in order to measure the percentages of failures in the actuators, this research builds a batch form of least-squares projection method. In addition, the paper thoroughly examines the results of fault detection and diagnosis in both simulation and real-time settings to demonstrate the practicality of the suggested approach.

The article [37] presents a new method combining fuzzy logic and neural networks to detect, categorize, identify and locate faults based on the data of sensors and smart meters put in the smart grid. The technique provided in this research makes it feasible to discover and classify problems in the network by simultaneously using the OpenDSS-MATLAB platform. IEEE 37-bus system is used to validate the proposed technique. The accuracy obtained with the proposed technique is 99.9%, which is a good value in the literature.

The research [38] provides an unsupervised framework for TL fault detection and classification (FDC) based on capsule network (CN). Instead of employing the CN baseline, an adaptation to this with a sparse filter approach is employed in this work. Capsule network with sparse filtering (CNSF) spontaneously learns essential error aspects and dramatically improves model performance without needing vast amounts of data. The suggested technique accepts three-phase signals after 1.2 cycle error and encodes them into a single image, which is defined as the input for the proposed CNSF model.

A trustworthy machine learning method for identifying and categorizing different smart grid issues is shown in [39]. Principal component analysis (PCA) and linear discriminant analysis (LDA) are advantageous to the suggested method. The size of dataset matrices can be decreased by using PCA. By applying PCA, the data sizes are decreased and any potential singularity in the data set is eliminated. To maximize the inter-class distance and decrease the intra-class distance of the data set, the LDA method is used to the PCA output data. Lastly, the problem is located and its classes are identified using the widely used K-nearest neighbor method.

In order to address these critical issues, a fault-tolerant controller is proposed in paper [40] for full control of a quad rotor UAV with motor faults. Multirotor unmanned aerial vehicles (UAV) are particularly vulnerable to motor faults, which can result from damaged propellers or defective motors. Motor faults significantly alter the dynamics of the multirotor UAV and therefore jeopardize flight safety and reliability since the controller loses its efficiency. The nonlinear observer technique and Sliding Mode Control (SMC) make up the suggested fault-tolerant approach. A fault-tolerant controller is built using an SMC and a newly designed nonlinear observer that anticipates how motor defects would impact the dynamics of the quad rotors. Further, the SMC is strengthened by the nonlinear observer to withstand flight-related uncertainties and disruptions. The suggested SMC will directly attenuate any disturbance noticed by the nonlinear observer, which is an indication of an actuator fault.

A new random forest (RF)-based fault detection approach for high voltage direct current (HVDC) transmission lines is proposed to address the existing challenge of satisfying the competing needs for protection sensitivity and fast response of HVDC transmission lines. The 8-frequency fault current waveform is extracted using S transformation, and the fluctuation index and total energy ratio are calculated; the wave index is then utilized to distinguish between internal and external errors, and the total energy ratio is used to locate positive and negative poles [41]. There has been a transmission line error. Using the S-scale conversion fluctuation index and the S-scale conversion total energy ratio, a fault characteristic sample set of HVDC transmission lines is built, and an intelligent RF fault detection model is developed for detecting such faults. HVDC transmission line fault detection training and testing have been completed. Theoretical analysis and numerous simulation test results indicate that the protection failure problem brought on by the misidentification of the traditional traveling wave front or the loss of wave front data can be effectively solved by the RF-based intelligent fault detection method proposed for HVDC transmission lines. It has a powerful ability to resist transmission resistance and a powerful ability to resist interference [42], and it can rapidly and accurately detect internal and external faults and select fault poles under varying fault distances and transmission resistances.

Numerous signal processing techniques have been used for classification and fault location calculations in the distribution and transmission networks as a result of research done in the field of wave-assisted fault detection. The primary issues with these works are the various levels of complexity as well as the accuracy and speed of various methods for signal error processing. In this study, we attempted to improve the identification method with less expenses and complexity while also increasing the accuracy and speed of detection using several optimization approaches and a meta-heuristic algorithm [43].

The superiority of the proposed work can be followed in two parts. The first part includes the detection, classification and simultaneous location of faults at smart grid in each PMU, which is obtained with information including voltage and frequency. It increases the speed of fault resolution in this proposed technique compared to other works. The second part includes the presentation of new techniques of combining machine learning systems with meta-heuristic algorithms, which makes this work more accurate compared to other methods.

1.3 Wild Horse Optimization Algorithm (WHO)

Human, animal, plant, physicochemical, and other agents' natural behaviors often serve as models for optimization algorithms. Animal behavior has served as inspiration for many algorithms presented in the recent decade. In this research, we implement a novel optimization method named the wild horse optimizer (WHO), which takes cues from the cooperative nature of free-ranging horses. Groups of horses, including a stallion, numerous mares, and their young, are the norm for the equine species. Grazing, pursuing, dominance, leadership, and mating are just some of the various characteristics displayed by horses. One endearing characteristic that sets horses apart from other animals is their courteousness. The way horses are raised causes their young to break away from their group and join other groups before they reach puberty. The purpose of this door is to discourage father-daughter and sibling relationships. The suggested algorithm draws primary motivation from the courteous actions of horses [44, 45]. Figure 1 shows the flowchart of the wild horse optimizer algorithm that was employed in this work.

Fig. 1
figure 1

WHO algorithm flowchart [31]

The five primary phases of Wild Horse Optimizer are as follows:

  1. 1.

    Establishing the starting population, dividing horses into groups, and selecting leaders.

  2. 2.

    Horse grazing and mating;

  3. 3.

    Leadership and leadership of the group by the leader (Narayan).

  4. 4.

    Exchange and selection of leaders.

  5. 5.

    Save the best solution.

1.4 Adaptive Neural Fuzzy Network

The four key components of ANFIS fuzzification, neural network, database, and defuzzification are the same fuzzy inference system with neural network. Five levels make up the primary ANFIS structure, which is depicted in Fig. 2.

Fig. 2
figure 2

Basic structure of ANFIS

First layer: (input nodes). The membership function is used in this layer to determine the degree of membership of input nodes to various fuzzy intervals [46, 47].

$${O}_{1,i}=\mu {A}_{i}\left(x\right), \quad for \quad i=1,2$$
(7)
$${O}_{1,i}=\mu {B}_{i}\left(x\right), \quad for \quad i= 3,4$$

Second layer: (base nodes). Each node in this layer calculates the degree of activity of a rule:

$${O}_{2,i}={W}_{i}=\mu {A}_{i}\left(x\right)\mu {B}_{i}\left(y\right), \quad i=\mathrm{1,2}$$
(8)

Third layer: The output of this layer is normalized from the previous layer.

$${O}_{3,i}=\overline{{W}_{i}}=\frac{{W}_{i}}{{W}_{1}+{W}_{2}} \quad i=\mathrm{1,2}$$
(9)

The fourth layer: (result nodes) [48]. In this layer, the output of each node is equal to:

$${O}_{4,i}=\overline{{W}_{i}}{f}_{i}=\overline{{W}_{i}} \left({p}_{i}x+{q}_{i}y+{r}_{i}\right)$$
(10)

The fifth layer: (output nodes). In this layer, each node calculates the final output value as follows (the number of nodes is equal to the number of outputs):

$${O}_{5,i}=\sum_{i}\overline{{W}_{i}}{f}_{i}=\frac{{\sum }_{i}{W}_{i}{f}_{i}}{{\sum }_{i}{W}_{i}}$$
(11)

In order to get the required output from the desired input, the nonlinear parameters associated to the fuzzy membership functions in the first layer and the linear parameters of the fourth layer must be calculated by training using the training data [49]. When it comes to adaptive neural network-based fuzzy inference systems, hybrid training is one of the most effective approaches [50, 51]. The first layer of this approach uses the error backpropagation method for training; whereas, the fourth layer employs the least-squares estimation method. The ANFIS technique is utilized to pinpoint the exact location of the fault along the line in this investigation. In this scenario, ANFIS takes as input variables the characteristics information taken from the line voltage frequency signal, and its output is the detection of the fault’s location.

1.5 Decision Tree Algorithm

Decision trees are among the most used and successful data mining techniques. This approach can be helpful when handling massive amounts of data. Because of their predictive nature, decision trees find utility in data mining for both classification and regression tasks. When its purpose is to sort data into categories, the tree is known as a classification tree; when its purpose is to make predictions, it is known as a regression decision tree. Application of classification trees allows for the categorization of datasets. It is widely used in a variety of industries, including marketing, engineering, and medical. The structure of a decision tree gives a rule-based explanation of the tree's prediction; the leaves of the tree indicate the class to which most data have been assigned, and each branch from the root to the leaves comprises a rule. Important parts of the decision tree are as follows [52,53,54]:

Leaf Nodes: Nodes where successive divisions end. Leaves are identified by a class.

Root Node: Root means the starting node of the tree.

Branches: In each internal node, branches are created as many as possible solutions.

1.6 Random Forest Algorithm

Known sometimes as a random decision forest, a random forest is a kind of hybrid learning technique for regression and classification that depends on a structure composed of multiple decision trees, each of which is trained separately and then utilized to generate its own predictions regarding the data [55]. Random forests are useful for decision trees that overfit the training set. Though their effectiveness differs depending on the type of data, random forests frequently beat decision trees [56, 57]. The decision tree and the decision diagram are both practical tools for decision support.

  • Simple comprehension: Anyone can learn how to work with decision trees with a little research and guidance.

  • Big and complex data handling: The decision tree is capable of processing complex data and making judgments based on it with ease.

  • Simple reuse: After a decision tree is created, it can be utilized to calculate several instances of the same problem.

  • The ability to integrate with other techniques: Better results can be obtained by merging the decision tree's output with other decision-making processes.

Disadvantages: As a general rule, random forests have better accuracy than decision trees, although decision trees have intrinsic interpretability. There is a small subset of machine learning models that are as straightforward to understand as decision trees. For a model to be considered desirable, interpretability is a key feature. Customers have more faith in the model's conclusions when using these models, and developers may be sure the model is producing reasonable predictions [58]. In addition, when dealing with multiple categorical variables, the decision forest may fail to enhance the underlying model's accuracy. Their employment is not justified when adding more estimators does not lead to improved accuracy [59, 60].

2 Presenting the Proposed Technique for Fault Detection, Classification, and Localization Along a Power Transmission Line

In this research, a new framework for fault detection, fault classification, and localization is proposed, as depicted in Fig. 3. Using MATLAB Simulink, voltage–current data representing 11 distinct fault types were created in a simulation of a 375 kW power transmission line. Information about fault is gathered right as they occur. Non-defective data, on the other hand, is collected at random under ideal circumstances. Of course, healthy data is not taken into account in the modeling for fault classification. The information was then split into a training set and a test set. The data were then normalized using the min–max technique. Three newly optimized machine learning models were then trained for fault detection (binary), classification (multi-class), and fault localization along the transmission line. Model classification performance, data set size, and model complexity are evaluated between the proposed technique and other models. Listed below are the specifics of each phase of the process.

Fig. 3
figure 3

A proposed framework for fault detection, fault classification and fault location

2.1 Model Simulation and Data Generation

The specifications of the various components inside the TLs, as well as the single-line and Simulink representations of the constructed TL simulation models, are displayed in Figures 4 and 5. This approach is comparable to a long-distance transmission line, in which energy is generated locally and sent to a far location. The loads in a real world scenario are a combination of R, L, and C, however there are more loads than are taken into account here. An analogous single load can be used to represent the sum of the loads. The length of the transmission line is 600 km. The voltage, current, and fault frequency of each unit were recorded, and the fault generator block was used to initiate all fault kinds in accordance with a predetermined program. All parameters are in real values, because it is easy to understand in real values. Any anomalous state in TL that causes a disruption in the normal flow of voltage and current is referred to as a TL fault.

Fig. 4
figure 4

Single line diagram for 735 kV power system

Fig. 5
figure 5

Three-phase series compensation model of the transmission line

There are two types of short-circuit faults, symmetrical and asymmetrical. Because the fault current is the same for all three phases during a three-phase short-circuit, this type of fault is known as a symmetrical fault. In the asymmetric instance, there are only one or two phases. The waveforms of voltage, current, and frequency during the ABG fault are depicted in Figure 6. As demonstrated by a dotted red rectangle in Figure 6a, the voltage of phases A and B goes to zero when the fault occurs. On the other hand, the current is enhanced compared to the typical scenario with some shrinking as seen by the dotted red rectangle in Figure 6b. For FC reasons, a total of 11 distinct classifications were examined. 100 data samples were created for each category based on fault position and impedance, and each sample had 16 features (frequency value resulting from three-phase voltage). Hence, a total of 1100 cases were considered and the data set was fully balanced. For training and testing purposes, the gathered samples were divided in a ratio of 90:10.

Fig. 6
figure 6

a, b Display of voltage and current outputs and frequency of bus B1 to estimate the fault time. c Performance results of the fuzzy system to identify the fault time

2.2 Normalization

When features or attributes are normalized, their values are transformed into a range while maintaining their information and relationships with one another. Changing the scale may not always be necessary. The loss function will fluctuate excessively without normalization [61, 62]. Min–max normalization was utilized in this investigation, and its mathematical expression is given by the following equation, where X is the original sample values.

$${\text{Normalized Data}}=\frac{X-{\text{MIN}}(X)}{{\text{MAX}}\left(X\right)-{\text{MIN}}(X)}$$
(12)

2.3 Fault Detection with Fuzzy Thresholding

Using a fuzzy logic system model, we were able to determine the time of error occurrence and apply the range identified for different phases to extract characteristics from the frequency signal that fall within the fault range (Figure 7). Our system's fuzzy rules are summarized in Table 1. If the system demarcation differs from what is depicted in Figure 6c, a pulse is generated that can be utilized to precisely determine the fault incidence time zone. The input signal follows the phasor size of the line voltage.

Fig. 7
figure 7

a Displaying input and output membership functions. b Characteristics of input and output

Table 1 Fuzzy rules governing fault detection system

Due to its mismatched parameters, short processing time, and cheap computational cost, the fuzz thresholding system is efficient and effective. Its design enables it to track the minimum deviation of the error. The system's input and output membership functions are shown in Figure 7a. Figure 7b displays the transfer characteristics that are dependent on thresholds. The figure shows that a transmission line error event occurs whenever the voltage deviates from a normalized range. This system can detect and introduce any unexpected voltage size divergence in less than half a cycle.

2.4 Optimization of DT and RF Classification Algorithms With the Help of WHO Meta-Heuristic Algorithm

Using a combination of statistical and signal characteristics, containing a total of 16 features, we extracted features from the frequencies modulated by the fault pulse range shown in Figure 6c. We have employed a feature weighting with the WHO meta-heuristic approach to enhance the accuracy with which error signals may be classified. Important features for classification using DT and RF algorithms are highlighted by the following relation, which defines the weighting function for each of the 16 features:

$$ {\text{F }} = {\text{ DT }}({\text{W1}} \times {\text{X1}}, \ldots ,{\text{ Wi}} \times {\text{Xi}}),\quad {\text{i}} < = {16} $$
(13)
$$ {\text{F }} = {\text{ RF }}({\text{W1}} \times {\text{X1}}, \ldots ,{\text{ Wi}} \times {\text{Xi}}),\quad {\text{i}} < = {16} $$

In order to achieve 100% classification accuracy in the objective function, these Wi weight values—which comprise 16 distinct variables—are incorporated. These values are derived using the WHO algorithm. The optimal response that falls between − 1 and 1 defines the range of these weights. On the basis of the test data, the objective function is computed.

The work makes use of search-based machine learning systems, including the well-known decision tree and random forest algorithms. Not only might they employ undefined data, but they can also introduce exploration-type noise. Thus, to address this shortcoming of machine learning techniques like RF and DT, the WHO algorithm is employed in this study; as a result, the accuracy of these approaches is enhanced while dealing with noise. These methods will also be fortified.

2.5 Fault Localization Along the Line with the Help of Adaptive Neural Fuzzy Network

After the issue has been confirmed and classified, the next step is to pinpoint its precise location along the line. The ANFIS system is trained by extracting features from the frequency deviation of the line at various fault points along the line across the time range of fault occurrence. The fault localization is optimized during neural network training based on the line length. By adjusting the feature weights with the help of the WHO wild horse algorithm, the optimal system response may be attained.

3 Simulation Results and Experimental Analysis

3.1 Test System

Using the single-line diagram (SLD) depicted in Figure 4, a three-phase, 60 Hz, 735 kV power system is simulated to produce simulation data. The power plant, which is made up of six 350 MVA generators, transmits power to a 600 km is the equivalent network via a transmission line. The transmission line that connects the B1, B2, and B3 buses is split into two sections, each measuring 300 kilometers in length. The right side of the transformer Tl is where the fault is measured, at a distance of 20–280 kilometers from the generator G2. The SLD model, depicted in Figure 4, is a MATLAB–Simulink implementation. Figure 5 illustrates how each line is adjusted to boost transmission capacity using capacitors equal to 40% of the line reactance. Due to their shunt nature, both lines have a 330Mvar shunt reactance to compensate. At substation B2, a 300 kV MVA 735/230 transformer with a 25 kV third winding supplies power to a 250 MW 230 kV load, where shunt and series compensating equipment is installed. In terms of series compensation, both lines share the same subsystems. Each phase of the series compensation module for a given line consists of a series capacitor, a metal oxide varistor (MOV) for capacitor protection, and a parallel gap for MOV protection. When the MOV's dissipated energy reaches 30 MJ, a circuit breaker trips, activating the simulated gap. There are two circuit breakers: CB1 and CB2. A synchronous machine block that has been simplified is used to simulate generators. Two transformers are modeled using the primary transformer blocks (two windings and three windings). The transformer that is attached to bus B2 undergoes saturation. The voltage and current signals are transferred to the data acquisition block through Goto blocks in the three-phase V-I measurement blocks B1, B2, and B3. For training and testing purposes, the voltage and current measured in B1 are gathered in this research.

3.2 Data Generation

Fault scenarios in real transmission lines are dynamic and complex. Table 2 displays the parameter settings for generating faulty or non-faulty signals with varying fault locations and fault times in order to simulate various fault circumstances. A sampling frequency of 20 kHz is used to capture the line voltage and current signals at B1. The suggested model's classification performance can be observed by varying the sample frequency (5 kHz, 10 kHz, 16 kHz, and 20 kHz). In this simulation, the data set includes 1100 sets of three-phase voltage and current and frequency signal data with 11 types of faults, among which each type of fault used for training includes 1000 sets of three-phase voltage and current and frequency signal data. Meanwhile, the case used for testing includes 100 sets of three-phase voltage and current signal data and frequency. Fuzzy systems are defined to offer fault thresholding, as shown in Figure 7. This is where the inclusion of membership functions in the input signal for the voltage deviation amount has helped achieve a satisfactory level of identification accuracy. The goal of presenting these fuzzy rules is to classify the incidence of faults.

Table 2 System parameters used to generate data

3.2.1 Ranking Strategies

In this case, we have used a simulation model under Simulink MATLAB. To increase the credit rating of the proposed methods, we have used a set of types of errors in different distances of the transmission line. This data set contains 1100 data samples that have been tested at different distances of the transmission line. For 100 equal distances, 11 distinct fault samples have been defined and verified for these data. The results of this work have been done in order to increase the validity of the proposed design by 60% as test data and 40% as test data.

3.3 Performance Evaluation

MATLAB software was utilized for all tests, and a personal computer with an Intel(R) Core(TM) i5 CPU running at 2.67 GHz and 4 GB of RAM was used. When the maximum number of cycles is reached, the optimization process is ended. Table 2 lists the parameter settings used during training. The accuracy improvement curve and loss with increasing iterations for both DT and RF approaches are displayed in Fig. 8. It is evident that after 100 iterations, the accuracy approaches one and the loss or function value drops to 0.109 and 0, respectively.

Fig. 8
figure 8

Demonstration of the performance of wild horse algorithm for a DT and b RF

Table 3 shows the labeling for the types of errors. Figure 9 displays the confusion matrix used to further assess the classification performance, with the anticipated results in the rows and the actual results in the columns. Elements on the diagonal of the confusion matrix represent correctly identified samples; while, elements off the diagonal represent misclassified samples. All 11 categories of mistakes are correctly identified, with the exception of a few samples that were incorrectly assigned to other categories of errors (as seen in the confusion matrix).

Table 3 Display error labeling
Fig. 9
figure 9

Showing the confusion matrix for different methods a WHO-DT and b WHO-RF

Classification results for the proposed method using two optimized decision trees and a random forest are displayed in Fig. 10 below. Figure 10 demonstrates that the random forest method provided superior accuracy. In comparison with voltage and current signals, fault frequency data performs better. Perhaps the frequency signal, rather being a single voltage or current signal, contains additional erroneous information, including high and low frequencies. Its accessibility is superior, though. Furthermore, the suggested classification method performs reasonably well, with a minimum classification accuracy of up to 97%.

Fig. 10
figure 10

Classification performance of the proposed method

Finally, Fig. 11 shows the actual and estimated positioning by ANFIS. The measurement units are in kilometers, which has a maximum fault of 153.6 m with displacement.

Fig. 11
figure 11

Display the location results

3.4 Evaluation of Anti-Noise Performance

The original data set has been supplemented with varying degrees of Gaussian noise to assess the anti-noise performance of the suggested model. In specifically, the test set was contaminated by 15 dB; whereas, the training set data were subjected to mixed noises of 10 dB in equal proportion. The test results of the WHO-RF and WHO-DT models are displayed in Table 3 as equally mixed noise, respectively. The evaluation indices include Ac (accuracy), Pr (accuracy), Se (sensitivity), F1 (F1 score, harmonic mean of Pr and Se) and can be described as follows:

$${\text{Ac}}=\frac{{\text{TP}}+{\text{TN}}}{{\text{TP}}+{\text{TN}}+{\text{FP}}+{\text{FN}}}$$
(14)
$${\text{Pr}}=\frac{{\text{TP}}}{{\text{TP}}+{\text{FP}}}$$
(15)
$${\text{Se}}=\frac{{\text{TP}}}{{\text{TP}}+{\text{FN}}}$$
(16)
$$F1=\frac{2\times {\text{Pr}}\times {\text{Se}}}{{\text{Pr}}+{\text{Se}}}=\frac{2\times {\text{TP}}}{2\times {\text{TP}}+{\text{FP}}+{\text{FN}}}$$
(17)

Table 4 shows that, with regard to noise interference, the WHO–RF model has outperformed the WHO–DT model in terms of overall classification accuracy. Consequently, the proposed WHO–RF model has better noise immunity than the WHO–DT model.

Table 4 Calculation results in the presence of noise

3.5 Comparison with existing methods

To further illustrate the development and superiority of the proposed model, the WHO–RF model is compared with the state-of-the-art error classification techniques; Table 5 presents the quantitative and qualitative comparison results. The suggested strategy outperforms the other six techniques with a greater classification accuracy of 99.93% in the presence of noise. Consequently, the proposed method outperforms other strategies. Initially, voltage-based classification (e.g., ST + PN, LSTM) is more accurate than current-based classification (e.g., WPT + SVM) within the same input type. This could be because current signals provide more low-frequency information about the specific fault type; while, voltage signals have more fault-induced transients that are useful in detecting the fault type. When both voltage and current are used, low frequency and high frequency can be connected, resulting in great classification accuracy. Although there is no certainty that data image presentation would increase accuracy, it can potentially improve fault reporting. However, it will add complexity to the system. Lastly, classification accuracy is increased to 99.58 and 99.72 percent, respectively, by combining the voltage and current signals. However, the performance of GAF + CNN and CNSF varies when there are disturbances (accuracies of 91.26 and 98 percent, respectively, at 10 dB SNR). The suggested approach outperforms the others, demonstrating its excellence and resilience in the face of noise, with a 99.93% success rate.

Table 5 Comparison of the proposed method with other methods

4 Conclusion

In this research, a fuzzy detection and automatic fault classification system was developed for the power grid, with the help of WHO-optimized random forest and decision tree algorithms, as well as ANFIS-assisted fault localization for various TL configurations with 11 types of faults. The suggested method performed well in the scenarios of fault detection (FD), fault classification (FC), and fault localization (FP) thanks to its high generalizability. The utilization of frequency signals for locating and classification is a major innovation in this strategy; these signals are available at all nodes in the smart grid, which has decreased the demand for auxiliary equipment. Within less than 0.5 cycle of time, FD models were able to detect faults effectively. FC, on the other hand, achieved a 100% success rate for WHO-RF and an 89.1% success rate for WHO-DT. In comparison with the standard ANN model, the models' processing times were shorter, and their computational complexity was lower. Using the suggested ANFIS model for fault location identification, an estimate of the fault location of less than 153.6 m is presented. This shows the superior performance, which is primarily attributable to the gradual non-adjustment of the meta-parameter and the optimization of the ideal weighting coefficient using WHO. None of the described methods involve the use of sophisticated data transformation techniques to expedite the processing of data. Using a circuit breaker in conjunction with the described procedures allows the faulty part to be located and removed from the system. In the future, nonlinear modeling will enable in-depth investigations of the exact location of the fault. Real-world applications allow further investigation into the effectiveness of this new approach. Consequently, we want to employ a real network system in our upcoming work to evaluate the effectiveness of the suggested scheme using more recent meta-heuristic methods.