Shielded Controller Units for RL with Operational Constraints Applied to Remote Microgrids

Hadi Nekoei, Alexandre Blondin Massé, Rachid Hassani, Sarath Chandar, Vincent MaiarXiv 2025 · DOI

Introduction

Reinforcement Learning (RL) has shown great promise in optimizing complex systems, yet its deployment in critical infrastructure remains limited due to safety concerns. In domains like remote microgrids, where diesel generators, batteries, and renewable sources must be balanced, a single suboptimal action can lead to equipment failure or blackouts. This paper introduces Shielded Controller Units (SCUs), a modular framework that provides 100% safety guarantees while maintaining the performance benefits of RL.

The Challenge of Safe RL in Infrastructure

Traditional "Safe RL" methods often rely on penalty functions or black-box classifiers. While these can reduce the frequency of unsafe actions, they rarely provide the absolute guarantees required for industrial operations. Furthermore, designing a monolithic safety "shield" for a complex system is often engineeringly infeasible. The authors propose a hierarchical decomposition to address these scalability and interpretability issues.

Methodology: Shielded Controller Units

The SCU framework decomposes safety into manageable, hierarchical components.

Modular and Hierarchical Architecture

Instead of a single global shield, the system is organized into a hierarchy of SCUs. Each unit manages constraints for a specific device (e.g., a battery) or a cluster of devices (e.g., a generator group). This decomposition allows human experts to audit and approve the logic for individual components easily.

Example of SCU hierarchy showing nested units for modular safety management.

Internal Mechanism and Digital Twins

Each SCU consists of a controller and a digital twin (DT). The DT combines state estimation with simulation to predict the future consequences of an action. If an RL agent's proposed action is deemed unsafe by the DT—for instance, if it would lead to a state where a generator cannot start in time to meet demand—the SCU replaces it with a pre-defined safe fallback action.

Internal structure of an SCU, illustrating the interaction between the controller, digital twin (SCU-DT), and the physical device or sub-system.

Experimental Setup

The framework was evaluated using real-world data from a remote microgrid over one year. The environment included:

  • Power Demand: 180–540 kW.
  • Wind Power: 0–400 kW.
  • Forecasts: 7.5-hour horizons at 15-minute intervals, generated via industry-standard General Additive Models (GAM).

Key Results and Insights

The application of SCUs to the microgrid yielded several significant findings:

  • Efficiency Gains: The RL agent with SCUs achieved a 24% reduction in fuel consumption compared to standard industry heuristics.
  • Absolute Safety: Unlike baseline agents that frequently violated power balance constraints, the SCU-protected agent maintained zero violations throughout the test period.
  • Training Benefits: Training with an active shield improved performance and reduced variance. The shield effectively prunes the search space, allowing the agent to focus on optimizing within the safe region.
  • Real-time Performance: Control steps execute in under 0.05 seconds, demonstrating readiness for real-world deployment on standard hardware.

Conclusion and Future Work

SCUs provide a "white-box" safety layer that is both interpretable and auditable. While the current implementation requires prior knowledge of system dynamics to build digital twins, it offers a robust path forward for RL in regulated industries. Future research will explore the automatic synthesis of these shields and their application to larger-scale systems like healthcare and transportation.

Summary updated

BibTeX
@misc{nekoei2025shielded,
  author = {Hadi Nekoei and Alexandre Blondin Massé and Rachid Hassani and Sarath Chandar and Vincent Mai},
  title = {{Shielded Controller Units for RL with Operational Constraints Applied to Remote Microgrids}},
  year = {2025},
  eprint = {2512.01046},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.01046},
}
Figure