*Article* **Power System Hardware in the Loop (PSHIL): A Holistic Testing Approach for Smart Grid Technologies**

#### **Manuel Barragán-Villarejo \*, Francisco de Paula García-López, Alejandro Marano-Marcolini and José María Maza-Ortega**

Department of Electrical Engineering, Universidad de Sevilla, Camino de los Descubrimientos s/n, 41092 Sevilla, Spain; fdpgarcia@us.es (F.d.P.G.-L.); alejandromm@us.es (A.M.-M.); jmmaza@us.es (J.M.M.-O.) **\*** Correspondence: manuelbarragan@us.es

Received: 20 June 2020; Accepted: 24 July 2020; Published: 28 July 2020

**Abstract:** The smart-grid era is characterized by a progressive penetration of distributed energy resources into the power systems. To ensure the safe operation of the system, it is necessary to evaluate the interactions that those devices and their associated control algorithms have between themselves and the pre-existing network. In this regard, Hardware-in-the-Loop (HIL) testing approaches are a necessary step before integrating new devices into the actual network. However, HIL is a device-oriented testing approach with some limitations, particularly considering the possible impact that the device under test may have in the power system. This paper proposes the Power System Hardware-in-the-Loop (PSHIL) concept, which widens the focus from a device- to a system-oriented testing approach. Under this perspective, it is possible to evaluate holistically the impact of a given technology over the power system, considering all of its power and control components. This paper describes in detail the PSHIL architecture and its main hardware and software components. Three application examples, using the infrastructure available in the electrical engineering laboratory of the University of Sevilla, are included, remarking the new possibilities and benefits of using PSHIL with respect to previous approaches.

**Keywords:** Hardware-in-the-Loop (HIL); Control HIL (CHIL); Power HIL (PHIL); testing of smart grid technologies

#### **1. Introduction**

The power system is undergoing a revolution nowadays, with the fast evolution of new hardware and software technologies. Power electronics, automation, cloud computing, big data, information, and communication technologies are some of the key components of the so-called smart grid. These new technologies are the enablers of the electricity sector decarbonization pursued by a society worried about energy dependence and the environmental impact of the consumed energy [1]. Without any doubt, the fulfillment of the Kyoto protocol [2] for restricting CO2 emissions and other greenhouse gases is resulting in drastic changes in terms of the generation mix of the power system, where a more active participation of renewable energies is required, but also the electrification of the transportation sector [3].

As a result, the operation and planning of power systems both in the transmission and distribution sides turn out to be even more complex than before. In fact, the uncertainty associated with renewable power sources and electrical vehicle charging, the security of supply and power quality expected by the final users with competitive energy prices and the constrained investment on network assets are stressing the power system [4]. At the same time, however, the technologies required for reducing this stress and also improving network operation are ready, but their network deployment has to be

carefully done. This is of utmost importance for those components that interact with the power system in an active manner, i.e., generators, protection devices, capacitor and reactor banks, On-Load Tap Changers (OLTCs), Flexible AC Transmission Systems (FACTS), High-Voltage DC links (HVDC), etc. Given the current automation level of the power system, where different control devices widespread along the network react to either local conditions or set points determined by a control center, it is mandatory to be sure that any new component does not interfere with the already existing ones.

For this purpose, simulation tools have brought a cost-effective solution to figure out the performance of a device or a system from its initial design stages, reducing the development costs and the time to market. The current available simulation tools cover almost all of the electrical engineering fields from electromagnetic transients to steady-state analysis. These design-support tools provide invaluable information, especially in the case of complex devices and systems. Simulation, however, is just one of the design process steps, experimental validation through a prototype or proof of concept always being required before any commercial product or even a pilot project. In fact, not all physical phenomena can be reproduced on a computer simulation tool because the reality is quite complex. In this regard, a recent branch of research, namely Hardware-in-the-Loop (HIL), focuses on the use of hardware and software tools to test devices and systems in the most realistic possible way and with a low investment. The main idea is to take advantage of the real-time simulation capabilities to test controllers or devices in a situation as close as possible to the reality. Two different and complementary options have been proposed in the HIL paradigm: Controller-Hardware-in-the-Loop (CHIL) and Power-Hardware-in-the-Loop (PHIL). Figure 1 describes these two HIL options and compares them with simulation tools. This figure highlights the simulated and physical devices (green and blue colored parts, respectively), the information flow, the power flows, and the interfaces between the actual and simulated environments. Let's consider that the objective of the simulation is to validate the performance of a device, i.e., the Device Under Test (DUT), connected to a power system. For this purpose, it is required to model all of the system components with the required detail level, but also the DUT including its control algorithms. The simulation tool can be executed on a conventional computer or a Real-Time Control System (RTCS) [5–9]. A step forward on the technology validation consists of applying CHIL [10–13]. In this case, all of the power components (power system and power components of the device) are still simulated in a RTCS, but the device control algorithm is embedded into a physical controller, e.g., a digital signal processor, with the objective of its real-time testing. The interface between the DUT (physical controller) and the RTCS is done using adequate analog/digital input/output ports as shown in Figure 1. It is possible, however, to move a step forward towards the reality by incorporating power components in the tests using a PHIL approach. This requires a power amplifier, which acts as a front end between the simulated and physical parts. The power amplifier is in charge of imposing the voltage at the point of common coupling with the DUT, which is computed by the RTCS considering its reaction. For this purpose, it is required to feedback the DUT injected current in the real-time simulated power system by using adequate analog/digital input/output ports [14–19].

In spite of the benefits provided by HIL testing, it is also important to point out that these techniques, and especially PHIL, are devoted to analyzing the behavior of a single DUT connected to a network node. Therefore, some aspects related to the introduction of a new technology in the power system can be masked. Interactions between different DUTs, the impact on the power system of a massive deployment of a new smart grid technology or the interaction between physical devices (DUTs) and the algorithms in charge of determining their setpoints are just some of these. In order to overcome these shortcomings, this paper proposes to extend the PHIL approach by: (i) introducing the algorithms determining the DUT setpoints, i.e., Algorithm Under Test (AUT); (ii) expanding the test focus from the current device-oriented approach to a system-oriented concept including the impact of the tested technology on the power system. This new approach, namely Power System Hardware-in-the-Loop (PSHIL), may allow the evaluation of the impact of a given technology over the power system in a holistic manner, considering all its power and control components.

**Figure 1.** Possible testing setups for assessing the effect of a new smart grid technology in the power system: (**a**) Simulation, (**b**) Control Hardware-in-the-Loop (CHIL), (**c**) Power-Hardware-in-the-Loop (PHIL).

The structure of this document is as follows. Section 2 elaborates on the PSHIL architecture and components. Then, the PSHIL functionalities and benefits with respect to simulation and conventional HIL approaches are outlined. Subsequently, Section 4 describes the PSHIL environment of the Department of Electrical Engineering at the University of Sevilla. Section 5 shows some case studies to evidence the wide range of possibilities that PSHIL testing may offer to the power community. Finally, the paper closes with the main conclusions and future lines of research.

#### **2. PSHIL Architecture**

This section describes the different PSHIL components and how they interact each other. Basically, a general PSHIL architecture is shown in Figure 2, where the simulated and physical environments are differentiated. On the simulation side, all the components, including network, generators, loads, and AUTs, are represented using adequate models which interact on a real-time simulation platform. In contrast, the physical side comprises a set of actual elements which may involve networks, generators, loads, DUTs, and AUTs implemented in different ways. The interaction between the simulated and the physical environments must be done through adequate interfaces. Finally, note that a management layer is required to coordinate the simultaneous testing in both environments. The next subsections are devoted to detailing each of these components.

#### *2.1. Real-Time Simulated Power System*

In this case, the power system used for testing purposes is simulated using an RTCS. Buses, branches, loads, generators, etc. are fully simulated. The physical devices (DUTs) are connected to this simulated network through a controllable voltage source, which acts as a power amplifier [20] as shown in Figure 2. The purpose of this amplifier is to physically reproduce the instantaneous voltage on a given bus of the real-time simulated network. Then, the DUT connected to the amplifier reacts to this voltage according to its control algorithm. This reaction is normally reflected in a current absorption/injection from the power amplifier, which is measured and sent back to the RTCS to be considered in the real-time simulation. In this way, it is possible also to evaluate the DUT's local impact in the simulated network. Note that this is quite convenient for testing local controllers (LCs) and

hardware components of a single DUT (PHIL). However, it is also possible to envision configurations with multiple power amplifiers for simultaneously testing different DUTs. In this case, it should be possible to evaluate the interactions between the DUTs through the real-time simulated network, but at a cost of requiring one power amplifier for each tested DUT.

**Figure 2.** Generic scheme describing the Power System Hardware-in-the-Loop (PSHIL) configuration.

#### *2.2. Physical Power System*

Two alternatives can be presented in this case: full-scaled networks and scaled-down networks. In the first case, different buses are interconnected through electrical lines and the DUTs are full-scale prototypes that interact with the different network components. Without any doubt, this testing environment gives to the test results the highest credibility because it is quite close to an actual field deployment. The space requirements and cost for high-voltage an high-power applications have to be considered, however. On the other hand, it is possible to use scaled-down networks where a change of the system base (rated voltage and rated power) is applied to scale down a given original network to an adequate value to be used on a laboratory environment. In this way, the main scaled-down magnitudes (voltage, current, and power) expressed in per-unit values are exactly the same as the ones in the original system. The buses of the scaled-down systems are interconnected through resistors and inductors with adequate values for emulating the original electrical lines. This network requires physical generators and loads that will be analyzed later. The main advantage of these physical testing environments is that some phenomena difficult to reproduce in simulations, such as heating and electromagnetic interference, always appear. The main disadvantage, however, is the reduced flexibility to modify either the topology or the parameters of the electrical network. This may hamper the impact of the DUTs on networks with different characteristics.

It is important to highlight that the PSHIL approach also considers that simulated and physical networks may coexist in a testing environment, as shown in Figure 2. This may provide an extended flexibility degree, which will be later exemplified in Section 5.1.

#### *2.3. Power Supply*

The objective of the power supply used in the physical network is to energize the testing environment providing the required power for the loads and DUTs. For this purpose, it is possible to consider the following not mutually exclusive options:


#### *2.4. Loads*

The loads are elements that absorb power from the buses of the physical power system under study. These can be classified into passive or active elements depending on the control capability:


#### *2.5. Devices and Algorithms under Test—DUTs and AUTs*

DUTs correspond to an actual device whose functionality and impact on the power system is tested using a PHIL approach. The possible list of devices that can be found in the specialized literature is endless, ranging from photovoltaic (PV) inverters [30], wind generators [31], HVDC [32], FACTS [14], energy storage systems [33], electric vehicle charging stations [26], OLTCs for power transformers [34], to digital protective relays [35]. Similarly, the functionalities that can be tested are numerous: primary control of voltage and frequency of Distributed Energy Resources (DERs) [36], current control in VSCs, inertia emulation in DERs [37,38], protection of VSCs during short-circuit faults [20], high-frequency power smoothing of renewable energy resources [39], MPPT in PV systems [40,41], etc. The simultaneous implementation of these strategies in several DUTs within a PSHIL environment allows evaluating the global impact on the power system under study, but also, mutual interactions between different DUTs can be analyzed, such as the elimination of zero-sequence current flow between transformerless grid-connected VSCs with a common DC bus [42] or the resonance frequencies originating between VSCs [43] .

The PSHIL approach, in addition, considers the possibility of also testing algorithms (AUTs) for optimizing real-time system operation and which may interact with DUTs through adequate setpoints. Therefore, the PSHIL concept extends the testing capabilities associated with the PHIL approach. Several objectives can be implemented for centralized or decentralized control structures, such as voltage control [44–46], minimization of power losses [47], congestion release [48], or the optimal allocation of ancillary services provided by different distributed control resources [49], among others. Basically, these algorithms are implemented on a computer that receives all of the network information (static and real-time data) following the general scheme outlined in Figure 2. The AUT computes and sends the DUT setpoints according to the available information and the intended objective. Furthermore, the PSHIL approach allows including in the loop the validation of other components such as the communication infrastructure, e.g., communication latencies, which are key for a comprehensive assessment of the real-time control strategies.

Therefore, the PSHIL concept simultaneously combines device- and system-oriented testing, which provides a new holistic approach especially suited to complex smart grid technologies.

#### *2.6. PSHIL Management*

The objective of the management layer is to coordinate the different components involved in the PSHIL testing platform. Basically, it consists of a hierarchical control architecture comprising two layers:


all of the required measurements. These measurements are provided to the AUTs, which may use them to compute the DUT setpoints, but are also stored for later analysis.

The information flow between the central management and LCs of generators, loads, and DUTs, as well as the interfaces between the simulated and physical networks, are key for proper PSHIL operation. Following a top-down description, the centralized PSHIL management layer is connected with each LC by using digital signals according to a communication protocol (CAN, Modbus, UDP, etc.) over a communication channel (RS-232, RS-485, Ethernet, etc.). Communication latencies depend on the performed tests, but usual values are in the order of seconds. Then, LCs are in charge of following these setpoints commanded by the centralized management layer, usually based on closed-loop algorithms to achieve a good dynamic response. For this purpose, it is required to manipulate analog signals related to the physical controlled device. This control loop latency depends on the required control bandwidth, but typical values are around dozens of microseconds. Regarding the interfaces between the simulated and physical environments, an information exchange as rapid as possible is required to avoid the problems generated by the time delays [50]. For this reason, the information exchange from the real-time simulation to the physical environment, and vice versa, is done by means of analog measurements that are regularly sampled at dozens of microseconds.

#### *2.7. Energy Management*

The energy management between the components of the PSHIL depends on whether the system under study is connected to a main electrical network or operates in islanded mode. In the first case, the electrical network is responsible for supplying or absorbing the energy necessary to maintain the power balance between loads and generators in the system. In islanded mode, however, it is required to provide adequate energy management to assure this active and reactive power balance. In this regard, two operation modes are clearly distinguished: communication-based and communication-less schemes [51]. The former schemes collect data from the PSHIL components (voltage, current, power, etc.) using a communication infrastructure in order to set the output power of the generators. Two alternative energy management algorithms within this group are usually implemented: centralized and decentralized energy management schemes [52]. The centralized algorithms receive all of the data from the PSHIL components in the Centralized PSHIL management layer and sets the operating points of the generators according to an objective, such as minimizing system operation and maintenance costs, environmental impact, or power losses [53,54]. In decentralized energy management schemes, local controllers of generation units exchange information through a communication bus. This information is used by the local controllers to determine an adequate setpoint by means of an optimization algorithm based on the shared information. Artificial-intelligence-based methods such as neural network or fuzzy systems [55] along with genetic algorithms have been used for this purpose [56]. Conversely, in communication-less schemes each generator operates independently without a communication infrastructure to exchange information with a control center or other generators. Droop-based strategies for frequency and voltage control implemented in each generation local controller are the most common techniques for energy management in this case [57].

#### **3. PSHIL Benefits**

The flexibility provided by the PSHIL approach clearly enlarges the testing capability with respect to the HIL concept. Basically, PSHIL may simultaneously test device and system functionalities provided by the DUTs and AUTs, as shown in Table 1. In this regard, it is interesting to note that the PSHIL approach is as powerful as a simulation tool but within an actual hardware environment close to the reality. Some examples of the functionalities tested using a PSHIL approach have been reported in [25,26]. In the first work, an Optimal Power Flow (OPF) for losses minimization (AUT) using an OLTC, a DC link, and distributed generators (DUTs) have been tested in a scaled-down MV distribution system. The second work deals with the integration of an electric vehicle charging station in an LV distribution network (DUT) to balance the MV/LV transformer loading (AUT). Both works

reveal that the PSHIL approach allows us to obtain specific conclusions about the DUT and AUT's performance but also the global impact of the tested technology on the network.

It has to be said, however, that this proximity to the reality is at the cost of relying on a physical network, which is difficult to reconfigure or adapt to other scenarios. In spite of this limitation, the PSHIL concept has several advantages with respect to simulation and conventional HIL strategies:



**Table 1.** Testing approaches for DUTs and AUTs.

#### **4. PSHIL Infrastructure at the University of Sevilla**

This section is devoted to describing the PSHIL infrastructure implemented in the Department of Electrical Engineering at the University of Sevilla. Figures 3 and 4 show a scheme and a view of this laboratory, respectively, whose main components are the following.

**Figure 3.** PSHIL platform of the Department of Electrical Engineering at the University of Sevilla.

**Figure 4.** PSHIL layout of the Department of Electrical Engineering at the University of Sevilla.


allows regulating the supply voltage on load. In addition, it is important to highlight that the design of this PSHIL infrastructure is quite flexible, being possible to incorporate also as DUT some of the already analyzed OLEs, or any other device. In fact, [25] analyzes the minimization of power losses (AUT) in the scaled-down distribution system using the static OLTC, the DC link, and the reactive power injections of some distributed generators emulated with the OLEs.

• PSHIL management. It has been implemented in a real-time platform provided by SpeedGoat. Particularly, this management system provides a bidirectional communication channel with the OLEs, DUTs, and AUTs by means of an UDP/IP communication protocol. The time latency with the local controllers of OLEs and DUTs is in the range of hundreds of microseconds, while the characteristic latency of AUTs depends on the algorithm but are in the range of minutes.

**Figure 5.** One-line diagram of the MV physical network within the PSHIL infrastructure at the University of Sevilla.

**Figure 6.** Elements of the PSHIL: (**a**) Regatron system, (**b**) synchronous generator, (**c**) OLEs Electrical cabinet.

#### **5. PSHIL Example of Application**

This section is devoted to describe a PSHIL application example using the University of Sevilla infrastructure presented in the above section. The objective is to evidence some of the main functionalities of a PSHIL testing environment to validate the integration of different DUTs and AUTs and their global impact on the power system under study. This application example revolves around the benefits that active distribution network management may bring to the operation of distribution systems with a high distributed energy resource (DER) penetration. This is usually studied in the MV and LV levels separately, but this section presents a simultaneous analysis of these two voltage levels. In order to do so, three different test cases following a step-by-step procedure will be presented to reach the pursued final goal.

#### *5.1. PSHIL Infrastructure Used in the Application Example*

The proposed application example comprises MV and LV distribution networks. The scaled-down distribution network supplied from the laboratory network previously described is used for this purpose. The LV network selected in this case is the residential feeder of the LV benchmark network proposed by the CIGRE Task Force C06.04.02 for the analysis of distributed generation in LV systems, shown in Figure 7 [58]. This LV network is simulated in real time using the OPAL-RT platform. It has been assumed that the LV network is connected to bus N14 of the MV scaled-down network as shown in Figure 5. The interface between these networks is done by the OLE connected at this bus following the scheme shown in Figure 8. To do so, the active and reactive powers of the LV network computed in the real-time simulation (*P*- *<sup>M</sup>*0, *<sup>Q</sup>*- *<sup>M</sup>*0) are sent to the corresponding OLE as references using the OPAL-RT analog outputs. Conversely, the voltage measured in bus N14 of the MV scaled-down network is sent to the real-time simulation to be considered as the bus M0 voltage using the OPAL-RT analog inputs. Note that the OLE connected to bus N14 also has to emulate an industrial load with power references (*P*- <sup>14</sup>*ind*, *<sup>Q</sup>*- <sup>14</sup>*ind*) sent from the management layer. Therefore, the OLE reference powers (*P*- *<sup>N</sup>*14, *<sup>Q</sup>*- *<sup>N</sup>*14) are the sum of these two setpoints.

**Figure 7.** PSHIL application example. One-line diagram of the LV real-time simulated network.

**Figure 8.** PSHIL application example. Integration of the LV real-time simulated network and the physical MV network.

Regarding the MV scaled-down physical network, the OLEs are connected to the following buses: N3, N5, N6, N7, N8, N9, and N10. Each bus has a combination of generators (photovoltaic and wind turbine) and loads (industrial and domestic types) with a peak power defined in Table 2. These peak power values correspond to those of the scaled-down system being required to apply the corresponding scale factor to obtain the values referred to the original system (20 MVA/100 kVA). A constant power factor of 0.87 for industrial loads and 0.98 for domestic loads has been assumed. The 24-h active power profiles of loads and generators are detailed in Figure 9 in per-unit values. The DUTs to be tested connected to this physical system are the distributed generation emulated by OLEs, the OLTC, and the DC link. These DUTs follow the optimal setpoints computed by an OPF that minimizes the power losses (AUT) [25].

**Table 2.** Peak power of loads and generators connected in each node of the MV scaled-down distribution network.


**Figure 9.** PSHIL application example. Daily profiles in per-unit (**a**) Load profiles, (**b**) Generation profiles.

Similarly, the loads and generators connected to the LV real-time simulated network get the same power profiles than the ones used in the physical system and represented in Figure 9. The peak power of the load and generators connected to each node is summarized in Table 3. Note that these values correspond to the original system rather than a scaled-down one because this network is simulated. Therefore, the corresponding scale factor must be applied to compute the reference powers (*P*- 14, *Q*- <sup>14</sup>). The AUT to be tested considers the reduced communication infrastructure associated with LV distribution systems, which prevents the use of secondary controllers like the one applied in the MV network. In this case, it is proposed to test an AUT that assigns a voltage reference to each distributed generator of the network, computed on a planning stage based on historical data. The local controllers of the distributed generators apply a reactive power droop strategy to achieve the assigned voltage reference.

#### *5.2. PSHIL Test Cases*

The test cases used to demonstrate the benefits of an active management of MV and LV distribution systems have been organized in a step-by-step manner as follows:


**Table 3.** Peak power of loads and generators connected in each node of the LV original distribution network.


Table 4 collects the DUTs/AUTs and the functionalities tested in each case. This table clearly shows the step-by-step procedure followed to reach the final goal of simultaneous testing of an active management of MV and LV distribution systems with a high DER penetration.

**Table 4.** DUT/AUT and functionalities of the test cases.


#### *5.3. PSHIL Experimental Results*

#### 5.3.1. PSHIL-1 Results

Figure 10a shows the 24-h active and reactive power profiles of the OLE connected to bus N14 for the test case PSHIL-1. This OLE is in charge of emulating an industrial load, detailed in Table 2, and also the integration of the LV real-time simulated network into the physical MV scaled-down system. The continuous lines represent the actual OLE active and reactive powers, while the dashed lines correspond to the setpoints (sum of the industrial load and LV real-time simulated network). It can be observed that there is hardly any difference between the power references and the actual injected values. In addition, Figure 10b compares the voltages measured at bus N14 and the ones used in the real-time simulation for bus M0. Both voltages are practically coincident, similarly to what

happens with the powers. Therefore, these results confirm an adequate integration of the LV real-time simulated network into the physical MV scaled-down network.

**Figure 10.** PSHIL-1: N14 industrial load and integration of the LV real-time simulated network within the MV scaled-down physical system. (**a**) 24-h evolution of active and reactive power injected by the OLE connected to bus N14. (**b**) 24-h evolution of voltages in bus N14 (physical network) and M0 (real-time simulated network).

Figure 11a shows the daily voltages of buses N3, N6, and N14 where undervoltage situations (voltages below 0.95 pu) during some periods are noticed. These undervoltages are more severe in those buses located farther away from the primary substation and mainly concentrated during the hours without DER injections. Conversely, these are responsible for the voltage peaks around 11:00 in nodes N3 and N14 because of the DER-related active power profile shown in Figure 9. It is interesting to note that this effect is not reproduced in bus N14 because the DC link is not connected in this test case and the net active power of the industrial load and the real-time simulated LV network is always negative (consumption), as shown in Figure 10a.

Figure 11b illustrates the nodal voltages of buses M1, M4, and M7 within the real-time simulated LV system. Similarly to the MV system, undervoltages arise around 20:00 and peak voltages around 11:00 when PV generation is peaking. Note that this effect is more prominent in bus M7, where PV generation is connected, becoming even higher than voltages in buses M4 and M1, which indicates a reverse power flow in the lines connecting these nodes. Bus M1 voltage is barely modified during this period of PV peaking because of its proximity to the MV/LV transformer. It can be observed, anyway, that the general voltage trend in the LV network is imposed by bus N14 of the MV network, especially in those periods without LV DER injections. These conclusions arise from the simultaneous analysis of the MV and LV networks facilitated by the proposed PSHIL approach.

**Figure 11.** PSHIL-1. Impact on the MV and LV distribution networks. (**a**) 24-h evolution of the MV network voltages at buses N3, N6, and N14. (**b**) 24-h evolution of the LV network voltages at buses M1, M4, and M7.

#### 5.3.2. PSHIL-2 Results

The AUT in the test case PSHIL-2 is an OPF for minimization of power losses in charge of defining the setpoints of the MV DUTs (OLTC, DERs, and DC link), whose daily evolution is detailed in Figure 12. The following comments can be stated for each of these DUTs:


Therefore, it can be claimed that the adequate control actions are computed by the AUT and executed correspondingly by the corresponding DUTs.

**Figure 12.** PSHIL-2. DUT performance using 24-h evolution of: (**a**) OLTC tap position and voltage of bus N3. (**b**) DER reactive power injections in buses N3 and N6. (**c**) DC-link reactive power injections. (**d**) DC-link active power transfer from N8 to N14.

Regarding the impact of the AUT on the tested power system, it is interesting to note the evolution of the MV and LV voltages shown in Figure 13. This figure represents the voltages of the same nodes represented in Figure 11 for the test PSHIL-1. Regarding the MV nodes, it can be clearly noticed that most of the time the voltages are above 1 pu and very close to 1.05 pu, which is the maximum voltage considered in the OPF. In addition, a flatter voltage profile can be observed compared to those of Figure 11a in spite of the highly variable DER generation. On the other hand, the evolution of the LV buses detailed in Figure 13b shows a similar evolution than the voltage of bus N14. This is reflected in a voltage increase of all LV buses thanks to the AUT and DUTs of the MV network, which avoid undervoltage situations (below 0.95 pu). This effect is especially remarked around hour 11, where the OLTC action drastically reduces the voltages of the LV buses. Finally, it is interesting to note the AUT effect on the power losses of the MV and LV networks, which have been reduced with respect to PSHIL-1 from 0.584% to 0.465% and 7.086% to 6.382%, respectively.

**Figure 13.** PSHIL-2. Impact on the MV and LV distribution networks. (**a**) 24-h evolution of the MV network voltages at buses N3, N6, and N14. (**b**) 24-h evolution of the LV network voltages at buses M1, M4, and M7.

#### 5.3.3. PSHIL-3 Results

In this case, the same voltage reference was imposed for all of the LV PV generators, for simplification purposes. Figure 14 shows the voltage and the active and reactive powers injected in by the PV connected in node M7. The bus voltage is compared with the reference voltage (1.05 pu) to compute the reactive power injection using a linear droop strategy. Note that the reactive power injection shown in Figure 14b is always positive because the nodal voltage is most of the time below the reference voltage, as shown in Figure 14a. This is especially noticeable at night when the voltages are low due to the network loading and the PV uses most of its capacity to inject reactive power according to the rated power detailed in Table 3.

**Figure 14.** PSHIL-3. (**a**) 24-h evolution of voltage in bus M7. (**b**) 24-h evolution of PV active and reactive power injections in bus M7.

Regarding the impact of these control actions on the distribution system, Figure 15 shows the daily voltage profiles on the MV and LV networks. The MV voltages, shown in Figure 14a, are almost the same as those presented in PSHIL-2 because only one LV distribution network has been simulated and, therefore, its effect on the MV side is barely noticed. The analysis of the LV voltages, however, reveal some differences due to the voltage control algorithm implemented in this network. During the midday hours, the PV power injection causes the voltage in bus M7 to be higher than the voltage in bus M1, revealing an inverse power flow between these two LV nodes. During the evening, with the peak load and the absence of PV active power injection, the voltage decreases. However, the influence of the reactive power injection using the spare PV converter capacity is noticeable comparing the voltage of buses M4 and M7. Note that in this evening period, the voltage at bus M7 is very close to that of bus M4, even though its electrical distance to the head node is larger. This effect is also noticeable when comparing these nodal voltages in the test PSHIL-2 (Figure 13b), where no LV control actions are applied. Finally and regarding the power losses, the LV local voltage control achieves a reduction of power losses from 6.382% reported in PSHIL-2 to 4.590%.

**Figure 15.** PSHIL-3. Impact on the MV and LV distribution networks. (**a**) 24-h evolution of the MV system voltage in buses N3, N6, and N14. (**b**) 24-h evolution of the LV system voltage in buses M1, M4, and M7.

#### **6. Conclusions**

This paper has presented a new HIL approach for simultaneously testing several DUTs and AUTs interacting with each other in a power system. In this way, the proposed PSHIL approach can be considered a natural evolution of the PHIL concept, which is mainly focused on the individual performance of a DUT connected to a network node. The PSHIL architecture has been depicted including a description of its main actual and simulated components classified according to their functionalities.

The PHSIL infrastructure available at the electrical engineering laboratory of the University of Sevilla has been used as an example of application to evidence the PSHIL testing functionalities, analyzing the active management of a MV and LV distribution system with high penetration of renewable generation. Different cases have been tested, each of which evidences some of the possible functionalities of the PSHIL approach.

The first test (PSHIL-1) shows how to integrate an LV real-time simulated network into a physical scaled-down MV system. The second one (PSHIL-2), using the first test as a starting point, elaborates on the use of an OPF (AUT) for power losses minimization in the physical MV scaled-down network combined with several DUTs (OLTC, DER reactive power, and a DC link) in charge of following the OPF-computed optimal setpoints. Finally, the third test case (PSHIL-3) introduces a voltage control algorithm in the LV network based on local conditions in buses where DERs are connected.

In conclusion, the staged testing procedure has demonstrated the PSHIL capacity of simultaneously analyzing an MV and LV distribution system in a hardware environment. Moreover, the results shown in the previous section evidence that the individual performance of each DUT can be successfully studied, as well as their impact on the power system. The PSHIL concept allows an evolution from a deviceto a system-oriented testing approach, providing a powerful framework for the study of smart grid technologies and allowing an assessment of the potential benefits that new technologies may bring to the power system.

**Author Contributions:** Conceptualization, M.B.-V. and J.M.M.-O.; Methodology, M.B.-V.; Software, ; F.d.P.G.-L. and A.M.-M.; Validation, M.B.-V. and F.d.P.G.-L.; Formal Analysis, J.M.M.-O. and A.M.-M.; Investigation, M.B.-V.; Resources, J.M.M.-O.; Data Curation, F.d.P.G.-L.; Writing—Original Draft Preparation, M.B.-V., J.M.M.-O. and

A.M.-M.; Writing—Review & Editing, M.B.-V., J.M.M.-O. and A.M.-M.; Visualization, F.d.P.G.-L.; Supervision, M.B.-V. and J.M.M.-O.; Project Administration, J.M.M.-O.; Funding Acquisition, J.M.M.-O. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Spanish Ministry of Economy and Competitiveness and the European Union Horizon 2020 under grant numbers ENE2017-84813-R and 764090, respectively. The APC was funded by the Ministry of Economy and Competitiveness under grant number ENE2017-84813-R.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Abbreviations**

The following abbreviations are used in this manuscript:


#### **References**


and Delivery of Electrical Energy in the 21st Century, Pittsburgh, PA, USA, 20–24 July 2008; pp. 1–6. doi:10.1109/PES.2008.4596142. [CrossRef]


© 2020 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 (http://creativecommons.org/licenses/by/4.0/).
