Runtime-Assured, Real-Time Neural Control of Microgrids Amol Damare Shouvik Roy Scott A. Smolka Scott D. Stoller Stony Brook University, Stony Brook NY, USA Abstract We present SimpleMG, a new, provably correct design methodology for runtime assurance of microgrids (MGs) with neural controllers. Our approach is centered around the Neural Simplex Architecture, which in turn is based on Sha et al.’s Simplex Control Architecture. Reinforcement Learning is used to synthesize high-performance neural controllers for MGs. Barrier Certificates are used to establish SimpleMG’s runtime-assurance guarantees. We present a novel method to derive the condition for switching from the unverified neural controller to the verified-safe baseline controller, and we prove that the method is correct. We conduct an extensive experimental evaluation of SimpleMG using RTDS, a high-fidelity, real-time simulation environment for power systems, on a realistic model of a microgrid comprising three distributed energy resources (battery, photovoltaic, and diesel generator). Our experiments confirm that SimpleMG can be used to develop high-performance neural controllers for complex microgrids while assuring runtime safety, even in the presence of adversarial input attacks on the neural controller. Our experiments also demonstrate the benefits of online retraining of the neural controller while the baseline controller is in control. 1 Introduction A microgrid (MG) is an integrated energy system comprising distributed energy resources (DERs) and multiple energy loads operating as a single controllable entity in parallel to, or islanded from, the existing power grid [27]. DERs tend to be renewable energy resources and include solar panels, wind turbines, batteries, and emergency diesel generators. By satisfying energy needs from local renewable energy resources, MGs can reduce energy costs and improve energy supply reliability for energy consumers. Some of the major control requirements for an MG are active/reactive power control, load sharing, and frequency and voltage regulation. Control of MGs is challenging because MGs are complex systems subject to varying degrees of uncertainty, especially if a significant portion of the energy is provided by renewable DERs. Moreover, they are subject to various forms of disturbances, including short circuits, transients when DERs are connected or disconnected, and transients when the MG switches between grid-connected and islanded modes. To help address these control challenges, the application of neural networks for microgrid control is on the rise [11]. Increasingly, Reinforcement learning (RL) is being used to train powerful Deep Neural Networks (DNNs) to produce high-performance MG controllers. 1 arXiv:2202.09710v1 [eess.SY] 20 Feb 2022