**5. Hardware-In-The-Loop Results**

In order to validate the simulation results presented in the previous section, the example microgrid shown in Figure 8 was implemented using a hardware-in-the-loop (HIL) system, allowing the system to be emulated in software, and connected with real world hardware in real time [20]. Using an HIL approach allows the system to be built and tested virtually with new proposed control methods, while interfacing with real hardware [21].

The same component values were implemented in the simulation, and in a Typhoon HIL600 unit. The HIL experimental apparatus is shown in Figure 9. The Typhoon HIL600 has 32 channels of ±5 V analog output (AO) that can be mapped to data points in the HIL circuit. The microgrid control board then offsets and scales these signals to 0 V to +3.3 V that are read by the 12-bit analog to digital converters on all three DSPs. For this example, only 5 channels of analog signals are needed to implement the proposed control. The analog signals and the scaling from the HIL are shown in Table 6.

**Figure 8.** Example microgrid used in hardware-in-the-loop (HIL) for PB demonstration of droop control methods.

**Figure 9.** Typhoon HIL600 with microgrid control board and three TI-F28335 DSP ControlCards (two cards were used for this paper).


**Table 6.** Hardware-in-the-loop (HIL) Analog Output Configuration.

The microgrid control board has BNC connectors linked with the first four analog output channels that are convenient to connect to an oscilloscope. For this work, the first three channels were used to view the first three signals in Table 6, and capture the results in oscilloscope traces.

The controller for each source was implemented on a separate Texas Instruments F28335 DSP ContolCARD [22] programmed through the Embedded Coder toolbox in MATLAB/Simulink. The control card for Source 1 implements (4), while the card for Source 2 implements (3), each using a PID control loop. By using separate control cards for each of the two sources, decentralized control is ensured; each source uses only local information, and the proposed control method does not require a communication link between the sources and/or the other components in the microgrid.

This microgrid has the same topology as the one implemented in the simulation. However, for the HIL experiment, power electronics were included, along with parasitic inductances and capacitances. To represent the variable load, a controllable current source was included. This type of load is comparable to an inductive or motor load in an actual system. The numeric values used for the circuit parameters are shown in Tables 7 and 8.


**Table 7.** Source 1 and Source 2 parameter values.



The system was implemented on a Typhoon HIL600 unit using distributed control through Texas Instruments F28335 DSP ContolCARDs. Each of the three sources is controlled using a separate TI card, using only local sensors. The circuit schematic used in the Typhoon software is shown in Figure 10.

**Figure 10.** Hardware-in-the-loop schematic for PB microgrid example.

The controllers implemented for each of the three sources are shown in Figures 11–13. Sources 2 and 3, representing a conventional and energy storage source, respectively, are controlled using traditional linear droop control. Source 1, representing a solar source, is controlled using optimal high dimension droop control as in (4).

**Figure 11.** HIL controller for Source 1 (solar)–optimal high dimension droop.

**Figure 12.** HIL controller for Source 2 (conventional)–traditional droop.

**Figure 13.** HIL controller for Source 3 (storage)–traditional droop.

Due to the limitations of the HIL system, a short overall time period was used, and the per-minute solar and load information was scaled. The profiles for power available from the solar resource and required load current are shown in Figure 14. The solar irradiance data is taken from the NREL BMS measurements from 1 June 2012, starting at 11:00 a.m.

**Figure 14.** (**a**) Solar power available and (**b**) load profiles for HIL implementation.

The results of implementing these profiles in the HIL system are shown in Figure 15. The bus voltage is shown, along with the current supplied from each of the three sources—all three use the same zero point on the oscilloscope trace. As the power available from the sun and the required load change, the conventional and storage sources change their output based on traditional linear droop control. Source 1 changes its output based on optimal high dimension droop control, where the reference current is determined by (4).

In order to verify that the proposed controller is operating as desired, data from the oscilloscope trace in Figure 15 was imported and plotted using MATLAB. The bus voltage and solar power available were used in (4) to calculate the reference current that Source 1 should be supplying. This reference current is plotted with the actual Source 1 current in Figure 16. The source output does match the desired reference value calculated using optimal high dimension droop control.

**Figure 15.** Hardware-in-the-loop results with optimal high dimension droop control: Ch1 Bus Voltage; Ch2 Source 1 Current; Ch3 Source 2 Current; Ch4 Source 3 Current.

**Figure 16.** Reference and actual current supplied by solar resource using optimal high dimension droop control.
