# Effect of Phase Shifting on Real-Time Detection and Classification of Power Quality Disturbances

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

- The novelty of the proposed algorithm is that it uses phase shifting as an additional stage in signal acquisition for the detection and classification of eight types of single power quality disturbances;
- An algorithm to analyze disturbances in electrical signals was developed on the BeagleBone Black and probed its capability to acquire and classify the signals in real time;
- Four classifiers, MLP, KNN, PNN, and DT, were compared in the classification stage.

## 2. Materials and Methods

- A.
- Disturbances Generation

- B.
- Signal Acquisition and Phase-Shifting Stage

- C.
- Detection and Feature Extraction

_{1}and cA

_{1}are known as the detail and approximation coefficients of the first resolution level. In contrast, cD

_{n}and cA

_{n}then correspond to the coefficients of the n-th resolution level, as can be seen in Equations (1) and (2), where g and h correspond to the coefficients of the high-pass and low-pass filters, respectively, which are determined by the wavelet function used.

_{i,j}are the N coefficients of the i-th resolution level.

_{cAn}, SE

_{cDn}and LOE

_{cAn}, and LOE

_{cDn}represent the Shannon entropy and log-energy entropy of the approximation and detail coefficients, respectively.

_{Sin}and LOE

_{Sin}correspond to the Shannon entropy and log-energy entropy proper to this signal.

- D.
- Classification

- Multilayer perceptron (MLP) has 12 neurons in the hidden layer, and SoftMax is used for the activation function;
- K-nearest neighbors (KNN), with the number of neighbors, K, is set to 3;
- Probabilistic neural network (PNN) with a propagation of the radial basis function (smoothing factor $\sigma $) of 0.02;
- Decision tree (DT).

## 3. Results

## 4. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Yoldas, Y.; Önen, A.; Muyeen, S.; Vasilakos, A.V.; Alan, I. Enhancing smart grid with microgrids: Challenges and opportunities. Renew. Sustain. Energy Rev.
**2017**, 72, 205–214. [Google Scholar] [CrossRef] - Junior, W.L.R.; Borges, F.A.S.; Rabelo, R.A.L.; Rodrigues, J.J.P.C.; Fernandes, R.A.S.; da Silva, I.N. A methodology for detection and classification of power quality disturbances using a real-time operating system in the context of home energy management systems. Int. J. Energy Res.
**2021**, 45, 203–219. [Google Scholar] [CrossRef] - Naidu, T.A.; Albeshr, H.M.A.A.; Al-Sabounchi, A.; Sadanandan, S.K.; Ghaoud, T. A Study on Various Conditions Impacting the Harmonics at Point of Common Coupling in On-Grid Solar Photovoltaic Systems. Energies
**2023**, 16, 6398. [Google Scholar] [CrossRef] - Herman, L.; Špelko, A. New Reference Current Calculation Method of a Hybrid Power Filter Based on Customer Harmonic Emission. Energies
**2023**, 16, 7876. [Google Scholar] [CrossRef] - Jha, K.; Shaik, A.G. A comprehensive review of power quality mitigation in the scenario of solar PV integration into utility grid. e-Prime Adv. Electr. Eng. Electron. Energy
**2023**, 3, 100103. [Google Scholar] [CrossRef] - Beniwal, R.K.; Saini, M.K.; Nayyar, A.; Qureshi, B.; Aggarwal, A. A Critical Analysis of Methodologies for Detection and Classification of Power Quality Events in Smart Grid. IEEE Access
**2021**, 9, 83507–83534. [Google Scholar] [CrossRef] - WJunior, L.R.; Borges, F.A.D.S.; de AL Rabelo, R.; Rodrigues, J.J. A methodology for detection of power quality disturbances in the context of demand side management. In Proceedings of the 2019 4th International Conference on Smart and Sustainable Technologies (SpliTech), Split, Croatia, 18–21 June 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–6. [Google Scholar]
- Kumar, C.S.; Ramesh, P.; Kasilingam, G.; Ragul, D.; Bharatiraja, C. The power quality measurements and real time monitoring in distribution feeders. Mater. Today Proc.
**2021**, 45 Pt 2, 2987–2992. [Google Scholar] [CrossRef] - Oubrahim, Z.; Amirat, Y.; Benbouzid, M.; Ouassaid, M. Power Quality Disturbances Characterization Using Signal Processing and Pattern Recognition Techniques: A Comprehensive Review. Energies
**2023**, 16, 2689. [Google Scholar] [CrossRef] - Caicedo, J.E.; Agudelo-Martínez, D.; Rivas-Trujillo, E.; Meyer, J. A systematic review of real-time detection and classification of power quality disturbances. Prot. Control. Mod. Power Syst.
**2023**, 8, 2–37. [Google Scholar] [CrossRef] - Wang, S.; Chen, H. A novel deep learning method for the classification of power quality disturbances using deep convolutional neural network. Appl. Energy
**2019**, 235, 1126–1140. [Google Scholar] [CrossRef] - Chawda, G.S.; Shaik, A.G.; Shaik, M.; Padmanaban, S.; Holm-Nielsen, J.B.; Mahela, O.P.; Kaliannan, P. Comprehensive review on detection and classification of power quality disturbances in utility grid with renewable energy penetration. IEEE Access
**2020**, 8, 146807–146830. [Google Scholar] [CrossRef] - Elbouchikhi, E.; Zia, M.F.; Benbouzid, M.; El Hani, S. Overview of Signal Processing and Machine Learning for Smart Grid Condition Monitoring. Electronics
**2021**, 10, 2725. [Google Scholar] [CrossRef] - Turović, R.; Dragan, D.; Gojić, G.; Petrović, V.B.; Gajić, D.B.; Stanisavljević, A.M.; Katić, V.A. An End-to-End Deep Learning Method for Voltage Sag Classification. Energies
**2022**, 15, 2898. [Google Scholar] [CrossRef] - Jandan, F.; Khokhar, S.; Memon, Z.A.; Shah, S.A.A. Wavelet-based simulation and analysis of single and multiple power quality disturbances. Eng. Technol. Appl. Sci. Res.
**2019**, 2, 3909–3914. [Google Scholar] [CrossRef] - Igual, R.; Medrano, C. Research challenges in real-time classification of power quality disturbances applicable to microgrids: A systematic review. Renew. Sustain. Energy Rev.
**2020**, 132, 110050. [Google Scholar] [CrossRef] - Chen, Z.; Li, M.; Ji, T.; Wu, Q. Real-Time Recognition of Power Quality Disturbance-Based Deep Belief Network Using Embedded Parallel Computing Platform. IEEJ Trans. Electr. Electron. Eng.
**2020**, 15, 519–526. [Google Scholar] [CrossRef] - Ribeiro, E.G.; Mendes, T.M.; Dias, G.L.; Faria, E.R.; Viana, F.M.; Barbosa, B.H.; Ferreira, D.D. Real-Time System for Automatic Detection and Classification of Single and Multiple Power Quality Disturbances. Measurement
**2018**, 128, 276–283. [Google Scholar] [CrossRef] - Markovska, M.; Taskovski, D.; Kokolanski, Z.; Dimchev, V.; Velkovski, B. Real-time implementation of optimized power quality events classifier. IEEE Trans. Ind. Appl.
**2020**, 56, 3431–3442. [Google Scholar] [CrossRef] - Junior, W.L.R.; Borges, F.A.; Veloso AF, D.S.; de ALRabêlo, R.; Rodrigues, J.J. Rodrigues. Low voltage smart meter for monitoring of power quality disturbances applied in smart grid. Measurement
**2019**, 147, 106890. [Google Scholar] [CrossRef] - IEEE 1159-2009; IEEE Recommended Practice for Monitoring Electric Power Quality. IEEE Transmission and Distribution Committee: Piscataway, NJ, USA, 2009.
- Rahman, D.; Awal, M.A.; Islam, M.S.; Yu, W.; Husain, I. Low-latency High-speed Saturable Transformer based Zero-Crossing Detector for High-Current High-Frequency Applications. In Proceedings of the 2020 IEEE Energy Conversion Congress and Exposition (ECCE), Detroit, MI, USA, 11–15 October 2020; pp. 3266–3272. [Google Scholar] [CrossRef]
- Eristi, B.; Yildirim, O.; Eristi, H.; Demir, Y. A real-time power quality disturbance detection system based on the wavelet transform. In Proceedings of the 2016 51st International Universities Power Engineering Conference (UPEC), Coimbra, Portugal, 6–9 September 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 1–5. [Google Scholar]
- Rico-Medina, A.V.; Reyes-Archundia, E.; Gutiérrez-Gnecchi, J.A.; Olivares-Rojas, J.C.; García-Ramírez, M.D.C. Analysis of the appropriate decomposition level based on discrete wavelet transform for detection of power quality disturbances. In Proceedings of the 2022 IEEE International Autumn Meeting on Power, Electronics and Computing (ROPEC), Ixtapa, Mexico, 9–11 November 2022; IEEE: Piscataway, NJ, USA, 2022; Volume 6, pp. 1–6. [Google Scholar]
- Rico-Medina, A.V.; Reyes-Archundia, E.; Gutiérrez-Gnecchi, J.A.; Chávez-Báez, M.V.; Olivares-Rojas, J.C.; del C García-Ramírez, M. Evaluation of wavelet-based feature extraction methods for detection and classification of power quality disturbances. World J. Adv. Eng. Technol. Sci.
**2022**, 07, 220–229. [Google Scholar] [CrossRef] - Patro, S.; Sahu, K.K. Normalization: A preprocessing stage. arXiv
**2015**, arXiv:1503.06462. [Google Scholar] [CrossRef] - Jo, J.-M. Effectiveness of normalization pre-processing of big data to the machine learning performance. J. Korea Inst. Electron. Commun. Sci.
**2019**, 14, 547–552. [Google Scholar] - Ansari, S.; Alnajjar, K.A.; Saad, M.; Abdallah, S.; El-Moursy, A.A. Automatic Digital Modulation Recognition Based on Genetic-Algorithm-Optimized Machine Learning Models. IEEE Access
**2022**, 10, 50265–50277. [Google Scholar] [CrossRef] - Kumar, H.S.; Upadhyaya, G. Fault diagnosis of rolling element bearing using continuous wavelet transform and K- nearest neighbour. Mater. Today Proc.
**2023**, 92, 56–60. [Google Scholar] [CrossRef] - Baroud, D.H.; Hasan, A.N.; Shongwe, T. The Use of Multiclass Support Vector Machines and Probabilistic Neural Networks for Signal Classification and Noise Detection in PLC/OFDM Channels. In Proceedings of the 2020 30th International Conference Radioelektronika (RADIOELEKTRONIKA), Bratislava, Slovakia, 15–16 April 2020; pp. 1–6. [Google Scholar] [CrossRef]
- Costa, V.G.; Salcedo-Sanz, S.; Pedreira, C.E. Efficient evolution of decision trees via fully matrix-based fitness evaluation. Appl. Soft Comput.
**2024**, 150, 111045. [Google Scholar] [CrossRef] - Jamali, S.; Farsa, A.R.; Ghaffarzadeh, N. Identification of optimal features for fast and accurate classification of power quality disturbances. Measurement
**2018**, 116, 565–574. [Google Scholar] [CrossRef] - He, S.; Li, K.; Zhang, M. A real-time power quality disturbances classification using a hybrid method based on s-transform and dynamics. IEEE Trans. Instrum. Meas.
**2013**, 62, 2465–2475. [Google Scholar] [CrossRef]

Disclaimer/Publisher’s Note: The statements, opinions, and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

PQD | Mathematical Model | Parameters |
---|---|---|

Ideal | $V\left(\omega t\right)=$$\mathrm{A}\mathrm{sin}\left(\omega t\right)$ | $\omega =2\pi f$ f = line frequency |

Sag | $V\left(\omega t\right)=A\left(1-\alpha \left(u\left(t-{t}_{1}\right)-u\left(t-{t}_{2}\right)\right)\right)\mathrm{sin}\left(\omega t\right)$ | $0.1\le \alpha \le 0.9$ $T<{t}_{2}-{t}_{1}<9T$ |

Swell | $V\left(\omega t\right)=A\left(1+\alpha \left(u\left(t-{t}_{1}\right)-u\left(t-{t}_{2}\right)\right)\right)\mathrm{sin}\left(\omega t\right)$ | $0.1\le \alpha \le 0.8$ $T<{t}_{2}-{t}_{1}<9T$ |

Interrupt | $V\left(\omega t\right)=A\left(1-\alpha \left(u\left(t-{t}_{1}\right)-u\left(t-{t}_{2}\right)\right)\right)\mathrm{sin}\left(\omega t\right)$ | $0.9\le \alpha \le 1$ $T<{t}_{2}-{t}_{1}<9T$ |

Flicker | $V\left(\omega t\right)=A\left(1+\alpha \mathrm{sin}\left(\beta t\right)\right)\mathrm{sin}\left(\omega t\right)$ | $0.1\le \alpha \le 0.2$ $\beta =2\pi {f}_{c}$ $5Hz\le {f}_{c}\le 10Hz$ |

Harmonics | $V\left(\omega t\right)=A\left(\mathrm{sin}\left(\omega t\right)+{\displaystyle \sum _{n=1}^{3}}{\alpha}_{2n+1}\mathrm{sin}\left(n\omega t\right)\right)$ | $0.05\le {\alpha}_{3}\le 0.15$ $0.05\le {\alpha}_{5}\le 0.15$ $0.05\le {\alpha}_{7}\le 0.15$ $\sum {\alpha}_{i}^{2}=1$ |

Notching | $V\left(\omega t\right)=A\left(\mathrm{sin}\left(\omega t\right)-sign\left(\mathrm{sin}\left(\omega t\right)\right){\displaystyle \sum _{n=0}^{9}}k\left(u\left(t-\left({t}_{1}-0.02n\right)\right)-u\left(t-\left({t}_{2}-0.02n\right)\right)\right)\right)$ | $0.1\le k\le 0.4$ $0<{t}_{1},{t}_{2}<5T$ $0.01T\le {t}_{2}-{t}_{1}\le 0.05T$ |

Oscillatory Transient | $V\left(\omega t\right)=\mathrm{sin}\left(\omega t\right)+\left(\propto {e}^{\frac{t-{t}_{1}}{\tau}}\left(u\left(t-{t}_{1}\right)-u\left(t-{t}_{2}\right)\right)\right)\mathrm{sin}\left({\omega}_{n}t\right)$ | $0.1\le \alpha \le 0.8$ $0.5T\le {t}_{2}-{t}_{1}\le 3T$ $8ms\le \tau \le 40ms$ ${\omega}_{n}=2\pi {f}_{n}$ $300Hz\le {f}_{n}\le 900Hz$ |

Impulsive Transient | $V\left(\omega t\right)=A\left(1+{\displaystyle \sum _{n=1}^{k}}\alpha \left(u\left(t-\left({t}_{1}+T*n\right)\right)-u\left(t-\left({t}_{2}+T*n\right)\right)\right)\right)\mathrm{sin}\left(\omega t\right)$ | $k=\mathrm{number}\mathrm{of}\mathrm{impulses}$ $0.1\le \alpha \le 1$ $0.05T\le {t}_{2}-{t}_{1}\le 0.06T$ |

Round | MLP | KNN | PNN | DT |
---|---|---|---|---|

1 | 81.75% | 96% | 95.5% | 96% |

2 | 80.25% | 96% | 95.25% | 91.25% |

3 | 77.5% | 95.25% | 95.5% | 93.25% |

4 | 67.25% | 95% | 96% | 94.25% |

5 | 76.75% | 95.25% | 95.5% | 93% |

6 | 80% | 96.5% | 95.75% | 92.5% |

7 | 76.25% | 96% | 96.25% | 95.75% |

8 | 70.75% | 97.5% | 97.5% | 95.25% |

9 | 81.75% | 92.75% | 95% | 90% |

10 | 60.5% | 96% | 96.25% | 92.75% |

Average | 75.275% | 95.65% | 95.85% | 93.4% |

Round | MLP | KNN | PNN | DT |
---|---|---|---|---|

1 | 95.5% | 99.75% | 99.5% | 97.75% |

2 | 92.25% | 98.25% | 98.5% | 98.25% |

3 | 94% | 99.25% | 99.5% | 98.75% |

4 | 90.5% | 98.75% | 99% | 96.75% |

5 | 95.5% | 99.25% | 99.75% | 98.5% |

6 | 96.75% | 100% | 99.5% | 98.5% |

7 | 94.25% | 99% | 99% | 97.75% |

8 | 94% | 98.75% | 99% | 98% |

9 | 98.5% | 99% | 99% | 98.5% |

10 | 94.25% | 98.5% | 98.25% | 98% |

Average | 94.55% | 99.05% | 99.1% | 98.075% |

Classifier | Non-Phase-Shifted | Phase-Shifted |
---|---|---|

MLP | 75.275% | 94.55% |

KNN | 95.65% | 99.05% |

PNN | 95.85% | 99.1% |

DT | 93.4% | 98.075% |

Classifier | No Noise | SNR 30 dB | SNR 50 dB |
---|---|---|---|

MLP | 94.55% | 89.17 | 91.39 |

KNN | 99.05% | 93.58 | 96.88 |

PNN | 99.10% | 93.62 | 97.96 |

DT | 98.075% | 92.10 | 95.94 |

Reference | Detection | No. of Features | Classification | No. of PQD | Hardware | Accuracy Non-Phase-Shifted | Accuracy Phase-Shifted |
---|---|---|---|---|---|---|---|

[19] | DWT/MRA | 21 | RF1 RF2 RF3 Overall | 6 singles and 14 complexes | NI myRIO-1900 | 88.81% 96.84% 96.74% 96.48% | 88.22% 95.25% 95.62% 94.72% |

[33] | Hybrid | 5 | DT | 8 singles and 2 complexes | Xilinx Spartan XC2S200PQ208 FPGA, DSP TMS320C6713 | Not given | 99.27% |

Proposed | DWT/MRA | 2 | MLP KNN PNN DT | 8 singles | BeagleBone Black | 75.275% 95.65% 95.85% 93.4% | 94.55% 99.05% 99.1% 98.075% |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Reyes-Archundia, E.; Yang, W.; Gutiérrez Gnecchi, J.A.; Rodríguez-Herrejón, J.; Olivares-Rojas, J.C.; Rico-Medina, A.V.
Effect of Phase Shifting on Real-Time Detection and Classification of Power Quality Disturbances. *Energies* **2024**, *17*, 2281.
https://doi.org/10.3390/en17102281

**AMA Style**

Reyes-Archundia E, Yang W, Gutiérrez Gnecchi JA, Rodríguez-Herrejón J, Olivares-Rojas JC, Rico-Medina AV.
Effect of Phase Shifting on Real-Time Detection and Classification of Power Quality Disturbances. *Energies*. 2024; 17(10):2281.
https://doi.org/10.3390/en17102281

**Chicago/Turabian Style**

Reyes-Archundia, Enrique, Wuqiang Yang, Jose A. Gutiérrez Gnecchi, Javier Rodríguez-Herrejón, Juan C. Olivares-Rojas, and Aldo V. Rico-Medina.
2024. "Effect of Phase Shifting on Real-Time Detection and Classification of Power Quality Disturbances" *Energies* 17, no. 10: 2281.
https://doi.org/10.3390/en17102281