## 5 Experimental Verification  
The proposed resilient control scheme has been experimentally validated in an islanded microgrid testbed with two DG units, as illustrated in Figure 16. The DG1 is included in Setup 1 and DG2 is included in Setup 2. The energy source in the DG unit is represented by a DC voltage source. The inverter is equipped in each setup working as the interfacing power converter between the DG and the loads. In the primary control level, each setup is equipped with a dSPACE Microlabbox board. The primary control loop which is developed using MATLAB/Simulink toolbox is compiled into dSPACE for execution. In the secondary control level, each setup is equipped with a PC platform which runs the dSPACE Control Desk program to manage the dSPACE controller. The PC platform collects the voltage and reactive power information from its local dSPACE and then transmits this information to the other PC using the TCP/IP protocol-based Ethernet links. Using the local and neighboring information, the proposed self-triggered control scheme can be realized on each PC platform to adjust the compensation terms in Equation (7) for each agent to meet the control objective of average voltage restoration and reactive power sharing. It is worth mentioning that the experimental implementation could be simplified by using only one dSPACE and only one PC to control all of the two DGs. However,  
Figure 14: Performance of the secondary control with the approach described in [32]: (**a**) DG output reactive power; (**b**) DG output voltages. Figure 15: Performance of the secondary control with our algorithm: (**a**) DG output reactive power; (**b**) DG output voltages. such implementation conflicts the distributed nature of the proposed control scheme. The experimental testbed parameters are provided in Appendix B. Since the DoS attack distorts the information exchanges between agents, such an attack is emulated through the on/off commands to the communication port of the PC platform. When the attacker starts to block the information transmission, the communication port of the PC platform in Setup 2 is turned off to emulate such an attack scenario. The real-time detection of such communication failure is not required. At the following triggering time instant, Agent 1 cannot receive the information from Agent 2 which implies that the communication link is in the presence of an attack. Then, the ACK-based monitoring mechanism is activated by Agent 1 to check whether the attack activity shifts to a sleep period. In order to emulate the sleep period of attack, the communication port of Agent 2 is turned on at a certain time instant. Agent 2 can receive the test packets and then send an ACK message to Agent 1. The two agents are able to exchange information and update according to Equations (12)-(14). The experimental results of the proposed control scheme are illustrated in Figures 17 and 18. In the experiment, the jamming intervals of DoS attacks are set as \(\mathbf{t_{a}}\in\){ [2.1 s, 2.2 s], [2.4 s, 2.6 s], [3.2 s, 3.5 s], [4.1 s, 4.3 s], [4.9 s, 5.0 s], [5.2 s, 5.4 s], [6.1 s, 6.4 s], [6.9 s, 7.0 s] ]. During the jamming intervals, the communication attempts of the two agents are denied by the attack. As can be seen in Figure 17, when the secondary control is applied at \(t=2\) s, the proposed self-triggered control scheme is able to discover the average information of voltage and reactive power in the presence of DoS attacks. The average voltage of all DGs can gradually restore to the nominal value. Meanwhile, accurate reactive power sharing can be achieved in steady-state. When load1 is decreased by the amount of 100 Var at \(t=7\) s, voltage restoration and reactive power sharing can still be guaranteed after a transient process. Figure 18 shows that the control inputs only update at the triggering time instants and the proposed ACK-based mechanism is able to successfully detect that the DoS attack shifts to a sleep period.