Characterization Procedure for Stand-Alone Merging Units Based on Hardware-in-the-Loop Technology

: The digitalization of a medium voltage network requires huge efforts from distributed system operators and electric utilities. The main reason is attributed to the costs associated with the replacement or introduction of new intelligent electronic devices capable of collecting and digitalizing current and voltage measurements. To this purpose, this paper introduces a new idea of a stand-alone merging unit (SAMU), which features real-time and hardware-in-the-loop technology, completed with accurate voltage and current sensors. Furthermore, the characterization procedure that allows an evaluation of the metrological performance of a complex device, such as a SAMU, is fully described. From the results, it is highlighted that (i) the developed SAMU is capable of performing highly accurate voltage, current, and power measurements; (ii) the characterization procedure is simple and exploitable for all kinds of SAMUs and other synchronized measurement devices.


Introduction
A significant step towards the transition of a power network into a Smart Grid consists of the digitalization of the network and, in particular, the substations. If the digitalization of primary substations may be an "easy" task (e.g., Italy has fewer than one thousand primary substations), digitalizing the secondary or distribution substations is not as easy (between one and two orders of magnitude more so than the primary ones). Among the obstacles for Distribution System Operators (DSOs) reaching a full digitalization of medium and low voltage (MV and LV, respectively) is part of the network, such as [1]: (i) the MV/LV network topology. In fact, MV and LV networks have a meshed structure with a huge number of nodes. Furthermore, typically, the distribution part of the network extends itself to rural areas, or is really complicated in its attempts to reach such areas (mountains, hills, etc.), to provide energy to all customers. Another obstacle is (ii): economic availability. This second reason is connected to the previous one. In other words, a DSOs investments for the grid are reasonably distributed among all nodes of the network, resulting in a low ratio of funds per node (compared to a transmission network).
Therefore, what can be perceived from the network is that the transmission and the distribution grids are being digitalized at different growing rates.
Focusing on the secondary substations, which is the aim of this paper, they mainly consist of a few fundamental electric apparatuses: circuit-breakers and protections [2][3][4], cable accessories and terminations [5][6][7][8], power transformers [9,10], and instrument transformers. In addition, communication infrastructure (copper or fiber optic-based) completes the substation. Such infrastructure must carry the information gathered from the measurement devices to the control rooms in order for the operators to make the correct management choices. us to exploit existing technologies of a laboratory environment for the development of new equipment with additional functionalities.
The remainder of the work is structured as follows. Section 2 provides the basic concepts and the standard vision of the SAMU, including communication and accuracy aspects. The measurement setup that recreates a SAMU is described in Section 3. Section 4 details the characterization procedure of the entire SAMU and the single components, which includes a better understanding of the influence of each component. The results are listed and discussed in Section 5, where the accuracy of the proposed SAMU is confirmed. Finally, Section 6 summarizes the main achievements of the work by drawing some conclusions.

Stand-Alone Merging Unit
This Section is completely dedicated to the SAMU. Considering the available standards, the aim is to clarify the definitions and working principles related to a SAMU. Therefore, Section 2.1 introduces the definitions of a SAMU, starting from the logical device concept. In Section 2.2 a summary of the working principle of a SAMU is provided. In Section 2.3, a brief summary of the fundamental communication aspects is provided. The accuracy and associated tests are presented in Section 2.4. Finally, Section 2.5 contains the main characteristics of the SAMU that has been designed in this work and is fully described in Section 3.

Definition
To understand what a SAMU is, one may start from IEC 61869-6 [24], where a SAMU is defined as a "merging unit with standardized inputs (analogue or digital)". Therefore, the main difference between an MU and a SAMU is the fact of having specific input values, which cannot be generic. The second step is the definition of an MU. To this purpose, two standards have to be considered: • IEC 61869-6 [24] defines an MU as "physical device (IED according to IEC 61850-2) in which a logical device merging unit is implemented"; and a logical device merging unit is a "logical device (in the meaning of IEC 61850-7-4) to do the time-coherent combination of logical nodes current transformer (TCTR) and/or logical nodes voltage transformer (TVTR) for building a standard digital output". Consequently, to complete the MU definition, IEC 61850-2 [41] has to be used, as it contains the definition of a logical device: an "entity that represents a set of typical automation, protection or other functions". • IEC 61850-2 [41] provides two definitions of an MU: one is a "physical unit performing the time coherent combination of the current and/or voltage data coming from sensors"; while the second is an "interface unit that accepts multiple analogue CT/VT and produces multiple time synchronized IEC 61850-9-2 compliant frames to provide data communication via the logical interface 4".
As can be noted, there is no complete agreement between the potential definitions. Instead, slight differences can be found between [24] and [41]. In particular, following [24], the MU definition is quite long, and it relies on several sub-definitions. Starting from [41], instead, it is easy to reach a clear definition, even if there are two versions of the same definition. Finally, in 02/21, the new IEC 61869-13 [42] was published, completely dedicated to SAMU. However, no definition of it is provided; hence, it can be assumed that what defined in [24] is still valid and confirmed.

Working Principle
With the help of Figure 1, the structure and working principle of a SAMU can be described. It consists of a unit that collects the output signals of instrument transformers, both legacy ITs and LPITs. In detail, Ref. [42] defines rated inputs for legacy inductive transformers as 1 A and 5 A, and values between 100 V and 200 V for CTs and VTs, respectively. For the LPITs, instead, the standard defines 22.5 mV, 150 mV, and 225 mV Energies 2021, 14, 1993 4 of 23 for the current one, and 3.25 V for the voltage one. Furthermore, a SAMU is capable of colleting digital inputs from the ITs, in addition to the typical analogue ones.

Working Principle
With the help of Figure 1, the structure and working principle of a SAMU can be described. It consists of a unit that collects the output signals of instrument transformers, both legacy ITs and LPITs. In detail, [42] defines rated inputs for legacy inductive transformers as 1 A and 5 A, and values between 100 V and 200 V for CTs and VTs, respectively. For the LPITs, instead, the standard defines 22.5 mV, 150 mV, and 225 mV for the current one, and 3.25 V for the voltage one. Furthermore, a SAMU is capable of colleting digital inputs from the ITs, in addition to the typical analogue ones. Figure 1. General structure of a stand-alone merging unit (SAMU), according to [42].
Turning to the output of the SAMU, it consists of a digital signal, in accordance with what is defined in IEC 61850-9-2 [43] (more details on communication are provided in the next, Section 2.3).
Finally, what completes a SAMU and confers it an added value, is the synchronization input signal. It allows synchronization of the data sampling of the ITs outputs with an external signal that could be shared among several SAMUs. An example of this external synchronization signal is the well-known pulse per second (PPS). Therefore, at each rising front of the PPS, the SAMU starts data collection and aligns its internal clock with the PPS.
The drawback of the working principle of a SAMU manifests if the synchronization is lost, resulting in a downgrade of a SAMU to a simple asynchronous data collector.

Communication
The communication requirements of a SAMU are standardized by the IEC 61850 series and the IEC 61869-9 [44]. In particular, the latter standard is an application of the IEC 61850 specifically developed for ITs. Furthermore, it includes details on the sample rates, time synchronization, and control blocks related to SAMUs.
Starting at the sample rates, [44] defines eight combinations of sample rates and publishing rates, ranging from 4800 Sa/s to 96,000 Sa/s. Among those rates, some are specific for 50 Hz systems and others for the 60 Hz ones.
Turning to synchronization, a SAMU uses an external signal to synchronize its sampling with other SAMUs, or with external time references. The preferred one is the Precision Time Protocol (PTP), also known as 1588; however, the PPS is an accepted alternative. Thanks to its internal high-frequency clock, a SAMU is capable of attributing to each sample a time stamp aligned with the synchronization signal. Considering the importance of the synchronization process, [44] dedicates several sections to time accuracy tests and to the explanation of how to evaluate and correct potential delays and loss of synchronization. Even the literature is quite vivid in this perspective, and, as it has been described in [45,46], researchers always try to find ways of minimizing delay errors and synchronization issues. Finally, what completes a SAMU and confers it an added value, is the synchronization input signal. It allows synchronization of the data sampling of the ITs outputs with an external signal that could be shared among several SAMUs. An example of this external synchronization signal is the well-known pulse per second (PPS). Therefore, at each rising front of the PPS, the SAMU starts data collection and aligns its internal clock with the PPS.
The drawback of the working principle of a SAMU manifests if the synchronization is lost, resulting in a downgrade of a SAMU to a simple asynchronous data collector.

Communication
The communication requirements of a SAMU are standardized by the IEC 61850 series and the IEC 61869-9 [44]. In particular, the latter standard is an application of the IEC 61850 specifically developed for ITs. Furthermore, it includes details on the sample rates, time synchronization, and control blocks related to SAMUs.
Starting at the sample rates, Ref.
[44] defines eight combinations of sample rates and publishing rates, ranging from 4800 Sa/s to 96,000 Sa/s. Among those rates, some are specific for 50 Hz systems and others for the 60 Hz ones.
Turning to synchronization, a SAMU uses an external signal to synchronize its sampling with other SAMUs, or with external time references. The preferred one is the Precision Time Protocol (PTP), also known as 1588; however, the PPS is an accepted alternative. Thanks to its internal high-frequency clock, a SAMU is capable of attributing to each sample a time stamp aligned with the synchronization signal. Considering the importance of the synchronization process, Ref.
[44] dedicates several sections to time accuracy tests and to the explanation of how to evaluate and correct potential delays and loss of synchronization. Even the literature is quite vivid in this perspective, and, as it has been described in [45,46], researchers always try to find ways of minimizing delay errors and synchronization issues.
The digitized output of the SAMU is then transmitted through a local data network in the form of data packets containing sampled values (SV), according to [43], and then formatted with the information of voltages, currents, and time. In this way, the receiver is capable of distinguishing and chronologically listing all the data coming from a single SAMU or multiple SAMUs, before further processing them.

Accuracy Evaluation
The last aspect to be considered when dealing with SAMUs is the metrological one. In particular, this new device may alter or decrease the accuracy of its input signals. Therefore, a SAMU's accuracy has to be standardized and evaluated. From this perspective, Ref. [42] provides tables with accuracy classes (ACs) and their limits for the current and voltage input channels (separately). In addition, the standard dedicates an entire annex to the evaluation of the combined uncertainty resulting from the entire measurement chain of IT plus SAMU. It also specifies the ACs and the limits for such combined uncertainty.
As for the testing of SAMU accuracy, which is more complex due to the digital output, Ref. [42] completely relies on [44], and does not specify other details regarding the accuracy tests. In brief, Annex 9D of [44] provides an example of a test circuit to evaluate devices with a digital output, in which a common clock signal is given to the reference and to the device under test. Afterwards, the two output signals are compared through the use of a composite error that contains information on the phase displacement and the ratio error.

Proposed SAMU
In light of the above, in this work, a new idea of a SAMU is developed, and it consists of (i) an OPAL simulator, being the processing unit of the SAMU; (ii) a resistive divider for the voltage input; and (iii) a shunt-plus-amplifier system for the current input. The developed SAMU accepts both IT and LPITs inputs; in particular, the 100/ √ 3 voltage level and 3.25/ √ 3, respectively (in the latter case, there is no need for a voltage divider). As for the current inputs, again, the SAMU accepts both the standardized input 1 A and 5 A for the legacy CTs, and the millivolt input signals from the current LPITs. Finally, OPAL features an IEC 61850-9-2 communication tool that allows us to convert the digital stream of acquired data into the standardized "packets" to be sent to a generic control room or receiver.
In what follows, the description is focused on the single-phase solution SAMU for the sake of simplicity. However, all the results are valid and can be extended to the three-phase solution or even more (16 analogue input channels are available).
Of course, the developed SAMU is just a way to exploit existing equipment to enhance their measurement capabilities and performance. It is not something that aims at replacing existing SAMUs, or at being the unique solution for developing a SAMU.

Measurement Setup
In this section, the equipment constituting the proposed SAMU is described, together with the instrumentation involved in its characterization process. What follows is structured as the following: Section 3.1 contains the characteristics of the components implemented to build the SAMU; in particular, an OPAL simulator, a voltage divider, and a current shunt are presented. In Section 3.2, the characterization setup is introduced, highlighting the metrological performance of its components.

SAMU
The main idea of this work was to develop a different SAMU, which includes a real time simulator capable of performing HIL measurements, and conditioning devices to adapt the ITs and LPITs outputs for the SAMU input channels. As it is described in the following, the core of the SAMU is based on OPAL technology, whereas the voltage and current signals are addressed by a resistive voltage divider and a resistive shunt, respectively.  Figure 2. The color code used in the figure is valid for all the following ones given in this work: blue, device boundaries; green, internal components; yellow, I/O interfaces or available connections. current signals are addressed by a resistive voltage divider and a resistive shunt, re tively.

OPAL
Starting from the processing unit of the developed SAMU, the OPAL-RT OP Simulator was a Real-Time Simulator (RTS) dedicated to performing real-time simula and HIL applications using RT-LAB software. The main components constituting th used are presented in Figure 2. The color code used in the figure is valid for all the fo ing ones given in this work: blue, device boundaries; green, internal components; ye I/O interfaces or available connections. The main components included in the considered RTS are: • Oregano syn1588 PCIe NIC. It is a PCI Express Ethernet network interface wit hancements to provide highly accurate clock synchronization via the IEEE Standard. In our case, a high-precision OCXO oscillator (Oven Controlled C Oscillator) was installed, and it featured a high accuracy, better than 0.05 ppm master operations or high accuracy applications. The Oregano card provided al time functions required for an IEEE 1588 PTP node to operate, both in master a slave node, as it could synchronize other devices via the Eth 1588 port shown i ure 2. This card also allowed us to create time-stamped digital data packets transmitted over the network using the same Eth 1588 port. The 1 PPS/IRIG input port (SMA cable) allowed us to synchronize the Oregano board with ei PPS signal or an IRIG-B signal, coming from a GPS source. The maximum appl The main components included in the considered RTS are: • Oregano syn1588 PCIe NIC. It is a PCI Express Ethernet network interface with enhancements to provide highly accurate clock synchronization via the IEEE 1588 Standard. In our case, a high-precision OCXO oscillator (Oven Controlled Crystal Oscillator) was installed, and it featured a high accuracy, better than 0.05 ppm, for master operations or high accuracy applications. The Oregano card provided all real-time functions required for an IEEE 1588 PTP node to operate, both in master and in slave node, as it could synchronize other devices via the Eth 1588 port shown in Figure 2. This card also allowed us to create time-stamped digital data packets to be transmitted over the network using the same Eth 1588 port. The 1 PPS/IRIG-B X4 input port (SMA cable) allowed us to synchronize the Oregano board with either a PPS signal or an IRIG-B signal, coming from a GPS source. The maximum applicable voltage was 3.3 V. The Ext Synch Out X7 port (SMA cable) made available the synchronizing signal to be used by an external board. • External Clock Adapter OP5964. This module was designated to convert a clock signal from the Oregano syn1588 board into a model synchronization standard compatible with OPAL RTS. The OP5964 could receive the external synchronization signal on the dedicated IO port and it could transmit the synchronizing signal to the RTSI interface from the TX output.
• RTSI (Real-Time System Interface) Synchronization Board. The synchronization connector was present in the front interface of the RTS. TX and RX allowed, respectively, for the transmission and reception of synchronization data. This board was internally connected to the FPGA. • XILINX TE0741 KINTEX-7 FPGA. It could accept four standard OPAL-RT mezzanine boards (2 digital IO and 2 analog IO boards), in addition to RS422 signals. It offered two types of synchronization, either LVDS or fiber optic, as it was connected to the RTSI interface. • Analog input card OP5340. It featured 16 differential analog input channels, with a maximum voltage range of ±20 V, sampled at 500 kSa/s. The ADC had a 16-bit resolution, and the minimum acquisition time was 2.5 µs per channel. The sampling was performed synchronously on all channels by the FPGA; nonetheless, the delay between two channels was evaluated for the sake of completeness in the characterization framework of the entire setup. The declared maximum noise of the analog card was 20 mV peak-to-peak. • OP4510 RTS also featured an IEC 61850-9-2 LE protocol for digital output data. This protocol allowed us to retrieve 80 or 256 samples per cycle, corresponding to 4000 and 12,800 samples, respectively, at a rated power system frequency of 50 Hz. Using an external clock, the Sample Value (SV) timings were synchronized with an external source, namely the Oregano board, which synchronized the protocol timings according to a specific standard. • Ethernet port. It was used to interface a laptop to the OP4510 RTS. All the controls were performed in real-time using RT-LAB software.

Instrument Transformers
In order to measure the standardized rated voltage and current, a voltage divider was installed on the voltage circuit, whereas a shunt and an amplifier were placed in the current circuit. The devices characteristics were as follows: • Active voltage divider. It was a resistive voltage divider providing an attenuation ratio of 11.003019, with a standard deviation of the mean of 1 ·10 −6 at 55 V. It needed to be supplied by an external voltage source at ±15 V. • Resistive shunt. It was a 10 A, 10 mΩ shunt. The ratio between the reference and the measured current was 1.000380, with a standard deviation of the mean 3 ·10 −6 at 5 A. • Custom amplifier. It featured various multiplication factors, but x100 was the one considered for all the tests described in this work. The amplifier required an external voltage source provided by the ±15 V voltage supply. • Low-voltage source. It was a custom 230/15 V voltage supply; it provided ±15 V and it was used to supply both the voltage divider and the amplifier.

Characterization Setup
Having presented the components constituting the SAMU, its characterization and the characterization of its single components are presented in this section. The required reference devices for the characterization are as follows: • Arbitrary waveform generator Keysight 33500B. It was used to recreate the PPS signal; therefore, only the specifications concerning the square wave were reported. The rise and fall times were fixed at 8.4 ns, with a resolution of 100 ps. The overshoot was typically below 2% and the duty cycle resolution was 0.01%. The pulse could have a minimum width of 16 ns with 100 ps resolution. The standard jitter measured with an external source analyzer, at a room temperature of 23 • C, was below 40 ps. • Arbitrary waveform generator RIGOL DG 1022. It was used to generate the 50 Hz sine waves for a range of amplitudes. The harmonic distortion of a sine wave was −45 dBc and the phase noise was −108 dBc/Hz. • Calibrator Fluke 6105A. In Tables 1-5, the voltage and current sine and harmonics specifications are provided, together with the power specifications.
• NI-9239 Data AcQuisition Board (DAQ). It was used to separately characterize the sensors adopted to develop the SAMU. The DAQ featured a ±10 V voltage range and a maximum 50 kSa/s sampling frequency. Its accuracy features were as follows: ±0.03% gain error and ±0.01% offset error.

Characterization Procedure
In this section, a detailed description of the characterization procedure is provided. In the Section 4.1, the OPAL characterization setup is presented. This is followed by the sensors' characterization setup in 4.2 and, finally, the whole SAMU test arrangement is illustrated in 4.3. The aim is to start with the characterization of the single elements composing the whole SAMU in order to understand the single contributors to the overall SAMU accuracy.

OPAL Characterization
In this section, the tests of amplitude, the phase delay introduced by OPAL, and the phase delay between two input channels of OPAL setups are, respectively, presented in Section 4.1.1, Section 4.1.2, and Section 4.1.3. In addition, in Section 4.1.4, the OPAL accuracy performances are tested with several distorted signals.
This set of tests was fundamental for evaluating the accuracy of the RTS, before assessing the whole setup representing the SAMU solution.

Amplitude Characterization
The setup used for the amplitude characterization is presented in Figure 3.

Characterization Procedure
In this section, a detailed description of the characterization procedure is provided. In the Section 4.1, the OPAL characterization setup is presented. This is followed by the sensors' characterization setup in 4.2 and, finally, the whole SAMU test arrangement is illustrated in 4.3. The aim is to start with the characterization of the single elements composing the whole SAMU in order to understand the single contributors to the overall SAMU accuracy.

OPAL Characterization
In this section, the tests of amplitude, the phase delay introduced by OPAL, and the phase delay between two input channels of OPAL setups are, respectively, presented in Sections 4.1.1, 4.1.2, and 4.1.3. In addition, in Section 4.1.4, the OPAL accuracy performances are tested with several distorted signals.
This set of tests was fundamental for evaluating the accuracy of the RTS, before assessing the whole setup representing the SAMU solution.

Amplitude Characterization
The setup used for the amplitude characterization is presented in Figure 3. The aim of this test was to assess the RTS accuracy in terms of amplitude. Therefore, the voltage levels ( ) listed in Table 6 were directly applied to the RTS with the reference The aim of this test was to assess the RTS accuracy in terms of amplitude. Therefore, the voltage levels (V cal ) listed in Table 6 were directly applied to the RTS with the reference voltage source (Fluke 6105 A). For each voltage level, 500 measurements of the RMS value were performed. The setup used for the evaluation of phase displacement, introduced by the RTS, is presented in Figure 4. The setup used for the evaluation of phase displacement, introduced by the RTS, is presented in Figure 4. The objective of this test was to assess phase displacement and its corresponding time delay, introduced by the processing unit, with respect to the synchronization signal (PPS in this case). In fact, as detailed in Section 2, the synchronization signal started the acquisition of the data coming from the ITs outputs.
WG1 was used to generate a square wave with a 3.3 V amplitude, an offset of 1.65 V, and a period of 1 Hz, corresponding to 1 s. The duty cycle was set to 50%. This square wave replicated the 1 PPS source one could obtain from a GPS antenna, and it was sent to The objective of this test was to assess phase displacement and its corresponding time delay, introduced by the processing unit, with respect to the synchronization signal (PPS in this case). In fact, as detailed in Section 2, the synchronization signal started the acquisition of the data coming from the ITs outputs.
WG1 was used to generate a square wave with a 3.3 V amplitude, an offset of 1.65 V, and a period of 1 Hz, corresponding to 1 s. The duty cycle was set to 50%. This square wave replicated the 1 PPS source one could obtain from a GPS antenna, and it was sent to the PPS input channel of OPAL (SMA connector X4 of the Oregano card) and to the external trigger input of WG2. This device was configured to be working in burst mode, and it was set to generate, without any additional delay, 20 cycles of a 50 Hz voltage sinusoid for different RMS values, presented in Table 7. The output voltage of WG2 was acquired with the analog card of the RTS. The choice of the roles of WG1 and WG2 was made based on the fact that WG1 has a better jitter with respect to WG2 for square wave generation.
What played a major role in this setup was the Oregano syn1588 card. This device was configured to work as a PTP Master using a 1 PPS signal, as it could receive either 1 PPS or an IRIG-B signal from a GPS antenna. The board was also set up to wait before the next second. It meant that the beginning of the simulation was delayed until the next second change. In this way, the rising edge of the synchronization signal was aligned to the rising edge of the 1 PPS signal, as defined by [43].
Another important setting was the synchronization timeout. This parameter, if set equal to zero, indicated that the simulation started immediately after the model was loaded. Generally, it could be increased in such a way that the simulation started with good synchronization accuracy with the external source. According to the datasheet, if the Oregano board was synchronized by a good IRIG-B or 1 PPS signal, the accuracy could reach 25 to 100 ns.
The synchronization accuracy took into account the accuracy between the time step of the simulation and the 1 PPS. When synchronizing with a 1 PPS signal from an external clock, the Oregano board would send, in any case, a synchronizing pulse to the FPGA at each time step of the model (20 µs in our case). The 1 PPS from the external clock would be used for some micro-adjustment to the clocking, to be sure that it was actually synchronized at the second.
Given this rationale, the external trigger out (SMA connector X7) of the Oregano board provided an external synchronization signal, which was sent to the Clock Adapter OP5964 entering the External Signal in the SMA connector. The Clock Adapter role has been previously described, and it was needed to convert the clock signal from the Oregano board into a model synchronization standard compatible with OPAL RTS. For this reason, the synchronizing signal was transmitted from the Sync TX jack to the Sync RX receiver in the RTSI board via an audio cable. The RTSI synchronization board was internally connected to the FPGA; therefore, it could propagate the synchronizing signal to the FPGA and perform the micro-adjustments explained before.
The described setup was used to perform 100 measurements for each of the sine voltages listed in Table 7.

Phase Displacement between Two Channels
The setup used for the characterization of the phase displacement between two analog input channels of OPAL RTS is illustrated in Figure 5.
As can be perceived from Figure 5, the idea behind this setup was exactly the same as the one described in the aforementioned configuration in Section 4.1.2.
Compared to the previous setup, in this case, the output of WG2 was sent to two different analog input channels of the analog card of OPAL RTS.
Despite the fact that the acquisition in the RTS was performed synchronously by the FPGA, in this test, the objective was actually to measure the time delay between two analog voltage sine waves triggered by an external PPS generated by the WG1, as before. Table 7 previously described holds; also, in this case, 100 measurements were carried out for each of the listed signals, and a synchronization accuracy of 25 ns was kept constant for the entire duration of the tests.

Distorted Signals Characterization
Given the increasing presence of superimposed harmonics on voltages and currents in the power system, this section describes the characterization of the RTS behavior vs. the distorted signals directly applied from the Fluke 6105 reference.
The measurement setup used for this test was the same as the one depicted in Figure 3. The tests consisted of applying, to the RTS input, a 5 V signal at 50 Hz, superimposed with a mix of harmonics from the 3rd to the 9th. The harmonics and their amplitudes, used to generate the distorted signals, were selected in accordance with EN 50160 [47]. For each distorted signal applied to the RTS, 500 measurements of THD were performed and compared to the THD set on the reference calibrator. Analogously, a distorted signal, gathered from in-field measurements performed during a fault and containing harmonics up to the 29th, was used as a further test signal and evaluated again with the THD parameter. As can be perceived from Figure 5, the idea behind this setup was exactly the same as the one described in the aforementioned configuration in Section 4.1.2.
Compared to the previous setup, in this case, the output of WG2 was sent to two different analog input channels of the analog card of OPAL RTS.
Despite the fact that the acquisition in the RTS was performed synchronously by the FPGA, in this test, the objective was actually to measure the time delay between two analog voltage sine waves triggered by an external PPS generated by the WG1, as before. Table 7 previously described holds; also, in this case, 100 measurements were carried out for each of the listed signals, and a synchronization accuracy of 25 ns was kept constant for the entire duration of the tests.

Distorted Signals Characterization
Given the increasing presence of superimposed harmonics on voltages and currents in the power system, this section describes the characterization of the RTS behavior vs. the distorted signals directly applied from the Fluke 6105 reference.
The measurement setup used for this test was the same as the one depicted in Figure  3. The tests consisted of applying, to the RTS input, a 5 V signal at 50 Hz, superimposed with a mix of harmonics from the 3 rd to the 9 th . The harmonics and their amplitudes, used to generate the distorted signals, were selected in accordance with EN 50160 [47]. For each distorted signal applied to the RTS, 500 measurements of THD were performed and compared to the THD set on the reference calibrator. Analogously, a distorted signal, gathered from in-field measurements performed during a fault and containing harmonics up to the 29 th , was used as a further test signal and evaluated again with the THD parameter.

Sensors Characterization
Once the RTS is characterized, the remaining components to be assessed are the voltage and current sensors. Therefore, this section describes the characterization setup and procedure that allowed us to evaluate the accuracy of the adopted sensors. Figure 6a

Sensors Characterization
Once the RTS is characterized, the remaining components to be assessed are the voltage and current sensors. Therefore, this section describes the characterization setup and procedure that allowed us to evaluate the accuracy of the adopted sensors. Figure 6a shows the measurement setup used to characterize the voltage sensor, while Figure 6b shows the one used for the current sensor, plus amplifier.
An important remark worth underlining, when looking at Figure 6, is that the characterization process included the DAQ described in Section 3.2. However, given the characteristics of the DAQ board, it is clear that its contribution to the total uncertainty was negligible.

SAMU Characterization
The characterization process concluded with the assessment of the metrological performance of the whole SAMU developed in this work. Figure 7 depicts the adopted measurement setup. It includes only components that have already been described.

Amplitude Characterization
This first set of tests involved the assessment of the amplitude measured by the SAMU considering the complete measurement chain sensor + RTS. Therefore, 80%, 100%, and 120% of the rated voltage (57 V), and 5%, 20%, and 100% of the rated current (5 A), were applied/injected with the Fluke 6105 A. Afterwards, 500 measurements of the RMS value of the voltages and currents measured by the SAMU were collected and assessed. An important remark worth underlining, when looking at Figure 6, is that the characterization process included the DAQ described in Section 3.2. However, given the characteristics of the DAQ board, it is clear that its contribution to the total uncertainty was negligible.

SAMU Characterization
The characterization process concluded with the assessment of the metrological performance of the whole SAMU developed in this work. Figure 7 depicts the adopted measurement setup. It includes only components that have already been described. This first set of tests involved the assessment of the amplitude measured by the SAMU considering the complete measurement chain sensor + RTS. Therefore, 80%, 100%, and 120% of the rated voltage (57 V), and 5%, 20%, and 100% of the rated current (5 A), were applied/injected with the Fluke 6105 A. Afterwards, 500 measurements of the RMS

Phase Characterization
Considering all the voltage and current values combination described in Section 4.3.1, the phase difference between the voltage and current channels was measured. The phase difference between the voltage and current was set to zero on the Fluke 6105, and 500 measurements were collected and evaluated.

Characterization Using Distorted Signals
In accordance with what was described in Section 4.1.4, for the simple RTS characterization, the whole SAMU was tested by applying/injecting distorted signals. Such signals were those introduced in Section 4.1.4, with the difference being that the rated voltage was not 5 V but 57 V for the voltage channel, and 5 A for the current one. Consequently, the harmonic amplitude percentages were calculated starting from those two values.

Power Characterization
This last set of tests aimed at extending the capabilities of a SAMU. Of course, the standard does not prescribe SAMUs for being capable of computing powers or energy. However, considering the computational capabilities of the developed SAMU, this further test added the wattmeter feature. Furthermore, considering the simultaneous presence of voltages and currents and the SAMU inputs, it might be useful to exploit its digital output to send power information to the control room, or to the data collector.
By using the setup depicted in Figure 7, 500 measurements of the following test were performed:

•
Test at rated conditions. The voltage was set to 57 V and the current to 5 A (at 50 Hz).

•
Test varying the amplitudes. From the combination of 80%, 100%, and 120% of the rated voltage and 5%, 20%, and 100% of the rated current, 9 power values were applied and measured (always at 50 Hz).

•
Test varying the power factor (PF). At rated voltage and current, the PF was set, varying from 1.0 to 0.1 at 0.1 steps.

Results and Discussion
This section includes all the results obtained from the sets of tests described in Section 4. Table 8 reports the amplitude test results in terms of mean values of 500 measurements. The table shows the RMS voltage applied from the calibrator (V cal ), the measured voltage (V m ) and its standard deviation of the mean (σ m ), and the relative error ε r between V m and V cal computed as: The last column of Table 8 reports the standard deviation of the mean of ε r , referred to as σ εv .

Amplitude Test Results
From Table 8, it is clear that measurements below 50 mV are strongly affected by 20 mV peak-to-peak noise, declared in the datasheet of the device. On the contrary, for higher voltages, ε r is always below two parts per thousand. In addition, from the values of σ εv , it is possible to appreciate the degree of accuracy that can be reached with the RTS. Table 9 reports the phase displacement test results in terms of mean value of 100 measurements. The table contains the RMS voltage applied from the WG2 (V gen ), the measured phase (ϕ m ), and its standard deviation of the mean (σ ϕ ). Table 9. Results obtained from the phase characterization tests of OPAL RTS, with WG1 generating the 1 PPS square wave and WG2 generating the voltage sine wave at 50 Hz.

V gen
For the sake of completeness, the corresponding time delay with respect to a 50 Hz sine wave is also reported (t m ), together with its standard deviation of the mean (σ t ).
The whole set of tests is performed with a synchronization accuracy of 25 ns between the time step of the simulation and the 1 PPS signal, generated by WG1.
The results presented in Table 9 show that the noise level for low-voltage signals do not influence phase displacement as much as when the amplitude is at very low levels. Furthermore, ϕ m remains almost constant, independent of the voltage amplitude adopted for the test.
A final note after presenting the amplitude and phase displacement tests is that both tests were performed on other channels to understand whether they behave in the same way. The results, not reported here for the sake of brevity, confirmed that all channels have coherent behaviors, both in amplitude and in phase. Table 10 reports the results of the phase displacement between two channels test. The results are presented in terms of mean value of 100 measurements. Table 10 includes the RMS voltage applied from the WG2 (V gen ), the phase measured (ϕ m1 ) on channel 1 and its standard deviation of the mean (σ ϕ1 ), and the measured phase (ϕ m2 ) on channel 2 and its standard deviation of the mean (σ ϕ2 ). Finally, the last two columns report the phase difference (∆ϕ) between channel 1 (ϕ m1 ) and 2 (ϕ m2 ), and its associated standard deviation of the mean σ ∆ϕ .

Phase Displacement between Two Channels Test Results
From Table 10, it can be observed that ∆ϕ and its uncertainty are slightly affected by the voltage amplitude used to run the test. In fact, for voltage values below 50 mV, ∆ϕ is only a fraction of milliradian. On the contrary, for higher voltage values, ∆ϕ decreases up to a few microradians, with a σ ∆ϕ in the order of 10 −7 . Table 11 lists the results of the tests in which the reference calibrator applies distorted voltages directly to the RTS (5 V for the 50 Hz component). From the table, the five distorted signals, A to E, are listed and described. In particular, h is the harmonic order, V h is the relative amplitude in [%] of the 50 Hz component, THD cal is the THD applied by the calibrator, and THD c is the one computed by the RTS. Finally, dTHD is the relative error in [%] between the two previous values.  From the table, it is clear that the distorted signals do not affect the measurements taken with the RTS. For all the distorted signals, from A to E, dTHD is always lower than 0.3%. Consequently, it can be concluded that the RTS is suitable and accurate enough to perform power quality evaluations on the input signals.

Sensors Characterization Results
In this section, the results obtained from the characterization of the employed voltage and current sensors, tested according to the setups illustrated in 4.2, are presented. Table 12 lists the results (100 measurements) of the voltage divider characterization. In the first two columns, the divider ratio, K v , is provided, together with its standard deviation of the mean, σ Kv ; the next two columns indicate the phase displacement in [rad], introduced by the voltage sensor, ϕ v , and its standard deviation of the mean, σ ϕv . The last column reports the reference voltage set in the calibrator (V cal ) in RMS value.
The results obtained in Table 12, specifically the ones related to 45, 55 and 70 V reference voltages, are used to compensate the phase of the measured voltage in [rad] and apply the correct voltage ratio, K v , in the next section of tests in 5.3. However, as it can be perceived, the influence of the phase correction is irrelevant. Furthermore, it can be stated that the voltage sensor is stable and accurate. The second part of the sensors' characterization tests involved the current branch. In this part, the resistive shunt and the custom amplifier were characterized together, as they were used simultaneously. Table 13 presents these results (100 measurements): the ratio between the reference current and the measured current (K i ) is provided, together with its standard deviation of the mean, σ Ki , in the first two columns; the next two, instead, indicate the phase displacement in [rad], introduced by the sensors, ϕ i , and its standard deviation of the mean, σ ϕi . The last column reports the reference current set in the calibrator (I cal ) in [A]. In the same way, as stated for the voltage, these values obtained from the characterization of the current branch will be used to correct the measurements results obtained in Section 5.3.

SAMU Characterization Results
In this last section of findings, the results obtained from the characterization of the SAMU are presented.

Amplitude Characterization Tests Results
These first tests were performed to evaluate the voltages and currents acquired by the SAMU.
The outcomes shown in Tables 14 and 15 take into account the results obtained from the characterization of the voltage divider, as well as the resistive shunt and the amplifier (previous Tables 12 and 13). Table 14 reports, in the first column, the voltage applied from the calibrator (V cal ); then, the measured voltage (V m ) and its standard deviation of the mean (σ mv ) are reported. Finally, the last two columns show the relative error in [%] with respect to the reference source (ε v ), as well as its standard deviation (σ εv ). The relative error was computed according to (1).  In the same way, Table 15 shows, in the first column, the current applied from the calibrator (I cal ), and then the measured current (I m ) and its standard deviation of the mean (σ mi ) are reported. Finally, the last two columns show the relative error in [%] with respect to the reference source (ε i ), as well as its standard deviation (σ εi ). In this case, the relative error is calculated according to (1), but replacing the voltage with the current.
By comparing the results listed in Tables 14 and 15 with those in Table 8, it can be stated that the introduction of the resistive voltage divider does not decrease the accuracy of the measurement chain; hence, it confirms the SAMU voltage channel performance in terms of amplitude.

Phase Characterization Tests Results
This section presents the results of the phase displacement between two channels when both voltage and current are injected in the SAMU.
This test intends to evaluate the level of synchronism of the SAMU, taking into consideration the phase displacement introduced by voltage and current sensors (evaluated in 4.2 and whose results are presented in Section 5.2, Tables 12 and 13). Table 16 presents, in the first column, the three voltages (120%, 100% and 80% of the rated value) applied from the calibrator (V cal ). In the second column, the three currents (100%, 20% and 5% of the rated value) are applied from the same reference source (I cal ). The last two columns show the phase displacement in [rad] between the two channels ∆ ϕ , computed as a mean over 500 measurements, and its standard deviation σ ∆ϕ . As demonstrated for amplitude, the high accuracy obtained from the characterization of the RTS itself (Table 9) is confirmed, even with the introduction of the current shunt and the amplifier. Of course, as has been previously noted, the phase displacement slightly worsens as the amplitude of the signal decreases.
It is worth highlighting here that the phase displacement of a single channel is the sum of two contributions: the RTS and the sensor. However, considering the negligible contribution of the sensors compared to the RTS, as described in Tables 12 and 13, the overall SAMU phase displacement can be considered to be the one in Table 9.

Characterization Using Distorted Signals Results
Considering the test described in Section 4.1.4 and its corresponding results presented in Table 11 in Section 5.1.4, this set of tests has been repeatedly applied to rated voltages and current to the SAMU.
With the same notation adopted in Table 11, Table 17 presents the voltage THD computed by the SAMU when a rated voltage with superimposed harmonics is applied to the SAMU by the reference calibrator. Signal E, in Table 11, is now applied to the SAMU as a rated current of 5 A with superimposed harmonics. Table 18 presents the results obtained from 500 THD measurements, reporting h as the harmonic order; I h is the relative amplitude in [%] of the 50 Hz component; THD i,cal is the THD applied by the calibrator; and THD c,i is the one computed by the RTS, together with its standard deviation, σ c,i . Finally, dTHD i is the relative error in [%] between the two previous values. Comparing Tables 17 and 18 with Table 11, it is possible to conclude that the obtained results are comparable with each other. Moreover, the influence of the voltage and current sensors to the SAMU does not decrease SAMU performances. In fact, the worsening in accuracy can be quantified, in the worst case, in a few parts per ten thousand.
As a final comment on the amplitude and phase tests, the SAMU shows high accuracy performance, either in rated or distorted signal conditions.

Power Characterization Tests Results
Tables 19 and 20 report the results obtained from the power tests described in Section 4.3.   Table 19 illustrates the voltage and current applied from the calibrator (V cal , I cal ), the power factor (PF), the power set in the calibrator (P cal ), the measured power (P m ), and its standard deviation (σ p ). In the last two columns, the relative error of the measured power (ε p ), with respect to the one set in the calibrator, is presented, together with its standard deviation (σ εp ). For each value of PF, 500 measurements were performed.
The relative error is computed, as illustrated in (1), but, in this case, it is related to powers: A first comment is that the power measurements, performed by the SAMU and quantified with ε p , are very accurate for all the test values. Furthermore, as appreciable from ε p , the influence of the PF on measured power is minimal. Therefore, the developed SAMU can be also used as a wattmeter (or even an energy meter).
Finally, Table 20 provides the results achieved from the power measurements at 120%, 100% and 80% of the rated voltage (corresponding to 68.4, 57 and 45.6 V, respectively) for a unitary power factor (PF = 1), and for a series of values of the current: 100%, 20% and 5% of the rated current, corresponding to 5, 1 and 0.250 A, respectively.
The results in Table 20 are coherent with those described in Table 19. A further comment can be made on the behavior of ε p vs. the amplitude of the current and voltage signals. In fact, ε p increases when the current value decreases. This behavior, even if limited to few parts per thousand, is due to the fact that low voltage levels correspond to input voltages for the RTS, even when limited; hence, far from its full scale.
Overall, considering all the power measurements, the developed SAMU can be considered very accurate, even for the power measurements.

Final Discussion
This section aims at summarizing the findings at the end of the SAMU characterization. In particular, it has been proven that the developed SAMU has all the characteristics to be called such. Furthermore, its accuracy is high enough to be included in the 0.5 AC (mainly due to phase displacement).
The characterization procedure confirmed the high performance of the processing unit adopted for the SAMU. In addition, such performance is not affected by the introduction of voltage and current sensors into the measurement chain. Regarding this aspect, the choice of very accurate sensors, made for the SAMU development, is not mandatory. In fact, less accurate sensors can be adopted (or whatever other available sensors are in the lab) because, after the characterization process, all systematic contributors to the uncertainty can be removed. However, by following the choice of very accurate voltage and current sensors, it is possible to neglect their effect on overall accuracy.
The SAMU has been tested with rated and distorted/real signals. From the results, it emerges that even the most distorted signals do not influence the measurement capabilities of the SAMU. This can be considered crucial in a power quality measurement environment; in fact, it can be excluded that, in real conditions, voltages and currents measured from the network are ideal as 50 Hz signals.
Finally, the developed SAMU has also been tested to assess its power measurement feature. The results clearly show that the accuracy obtained places the SAMU at the same level of the most accurate wattmeters on the market. It is worth highlighting that the SAMU does not have power and energy capabilities from a standard perspective. However, considering the several ancillary (or not) services used and implemented by DSOs, the information of the active and reactive power provides a significant added value to a particular device.

Conclusions
This work introduces a different idea of a SAMU. It consists of a real time simulator, which exploits the hardware-in-the-loop technology, plus voltage and current sensors. After a detailed description of all the SAMU components, the characterization procedure for the SAMU testing has been detailed and commented upon. The characterization aimed at testing the metrological performance of the SAMU in terms of amplitude, phase, and power, starting from sinusoidal or distorted/real signals. The results clearly confirm the high accuracy of the developed SAMU and its applicability in a typical laboratory environment. Therefore, this work succeeded in the obtaining of two main goals: (i) introducing a SAMU that features several measurement functions, even outside the SAMU requirements; and (ii) describing a simple and effective characterization procedure that can be replicated on every SAMU or synchronized measurement device.