# Optimum System for Diagnosing Power Quality in Electrical Microgrids
## 2 Materials and Methods
### Experimental Setups for Evaluating DiagElect  
To confirm that DiagElect is a suitable electrical measurement network for the PQ analyses mentioned, two experimental setups are necessary.  
Firstly, a test bench is constructed to validate the voltage and current measurements from the SDMD, ensuring they meet the standards for accuracy. The test bench includes an NHR(r) 9410 Regenerative Grid Simulator (referred to here as the grid emulator), which is manufactured by NH Research, located in Irvine, CA, USA. It supplies well-calibrated sinusoidal voltages and currents to a purely resistive load. The grid emulator supplies voltages in stepped RMS amplitudes, increasing by 10 V increments from 90 V to 400 V, at a frequency of 50 Hz, to provide various measurement points for testing the SDMD. For each voltage level set by the grid emulator, the SDMD measures voltage and current. These measurements are then compared with those from a commercial measurement device, specifically a Circumtor(r) (Circutor, Terrassa, Spain) [19]. Both measurement devices are evaluated based on reference values provided by the grid emulator, with their deviations from these values expressed as percentages.  
Secondly, to identify nodes that inject harmonics--as proposed in this study--an experimental microgrid has been constructed. This experimental microgrid comprises the following elements:  
* A grid emulator that supplies a rated phase voltage of 230 V RMS at 50 Hz.
* Four microgrid nodes representing linear, nonlinear, balanced, and unbalanced three-phase loads.  
Details about the loads at each microgrid node are provided in Table 2, which shows the load type and the expected contribution to distortion or its absence. Each load represents a microgrid node, and the four loads are connected to the grid emulator.  
For a comprehensive understanding of the setup and interconnections within the experimental microgrid, a schematic diagram of the proposed experimental microgrid is provided in Figure 1.  
In addition, a host computer is essential for implementing DiagElect's analysis procedures and algorithms. In the use case, this host computer is equipped with an Intel(r) Core i7 processor (Intel, Santa Clara, CA, USA), 1.10 GHz and 16 GB RAM, and runs MATLAB(r) R2024a software. Although MATLAB(r) was used for processing the voltage and current measurements because it is commonly used in our institution, other free software alternatives can also be utilized.  
Figure 2 shows the experimental microgrid constructed in the laboratory, highlighting the system's ease of installation, which requires minimal tools and technical expertise. In addition, DiagElect's plug-and-play components significantly reduce setup time, ensuring rapid deployment and operation.  
\begin{table}
\begin{tabular}{c c c} \hline
**Node** & **Load Type** & **Expected** \\  & & **Distortion/Non-Distortion Source** \\ \hline Node 1 & 3-phase Unbalanced R Load & Non-distorting \\ Node 2 & 3-phase Balanced RL Load & Non-distorting \\ Node 3 & 3-phase Voltage Regulator & Distortion source \\ Node 4 & 3-phase Rectifier & Distortion source \\ \hline \end{tabular}
\end{table}
Table 2: Specifications of the loads in the microgrid nodes.  
Figure 1: Schematic diagram of the proposed experimental microgrid.  
Figure 2: Test bench configuration to validate the performance of DiagElect.