# Optimum System for Diagnosing Power Quality in Electrical Microgrids
## 1 Introduction
There are many commercial PQ analyzers that provide the THD index at the PCC, [18; 19; 20]. However, to determine the harmonic flow, the THD index alone is insufficient; other procedures and algorithms, as mentioned above, are necessary. In addition, to allocate distortion and/or imbalance responsibilities, simultaneous voltage and current measurements at all microgrid nodes are required. In short, the origin of the harmonics, their flow, and the distortion and/or imbalance responsibilities of each node can only be assessed by comparing the measurements obtained simultaneously from the different nodes [21; 22]. Based on the above, an electrical measurement network, consisting of two or more electrical measurement devices, and the hardware and software for processing the collected measurements, is needed. Regarding the electrical measurement devices, these can mainly be phasor measurement units (PMUs), advanced metering infrastructures (AMIs), or smart meters. With regards to PMUs and AMIs, these devices are mostly used at the transmission and distribution grids [23; 24], but not specifically from a microgrid perspective, and thus, they are not intended for demand-side load monitoring, but for the supply-side. Moreover, their implementation costs are high [25], and consequently, there are many studies that aim their optimal location to minimize the number needed to monitor the power grid [26; 27; 28]. On the other hand, there are some smart meters in the literature [29; 30; 31; 32; 33], but most of them are individual devices that are not part of a network, so the requirements for studying PQDs in a microgrid with multiple nodes are not guaranteed. In the technical literature on electrical measurement networks, [34] introduces a system utilizing self-developed smart meters with advanced communication capabilities, but it lacks synchronous measurements across multiple points. In [35], the authors develop a system for high-frequency, synchronous electromagnetic interference (EMI) measurements across multiple locations; however, it falls short of providing synchronous measurements across multiple points in a microgrid and relies on expensive commercial oscilloscopes to measure voltages and currents. Furthermore, [36] presents a measurement system designed for accurate and synchronized PQ monitoring in a real distribution grid. However, the system has several limitations, including a lack of focus on microgrids, an absence of node-specific harmonic identification, and limited scalability and portability. Finally, while electrical measurement networks designed for industrial sites, as discussed in [37; 38], are effective, they do not delve deeply into PQ issues or the detection and classification of both stationary and non-stationary PQDs. After analyzing the state of the art, it was concluded that no existing network integrates self-developed measurement devices (SDMDs) with a communication network that connects all devices and provides synchronous measurements, enabling the application of necessary procedures and algorithms for a comprehensive PQ analysis within a microgrid system. This analysis focuses on both stationary disturbances, such as harmonic source detection, and non-stationary disturbances, including voltage fluctuations, interharmonics, and fundamental frequency variations. Consequently, this gap motivated the work presented in this article. This paper presents DiagElect, a complete electrical measurement network designed to overcome the limitations identified in the technical literature. DiagElect incorporates a robust communication network that maintains continuous connectivity among all SDMDs, facilitating synchronous measurements across multiple points in noisy environments. This network facilitates the acquisition and processing of measurements essential for PQ analysis. Designed for versatility, DiagElect supports a wide range of applications from energy monitoring to the detection and classification of both stationary and non-stationary PQDs.