Optimal Management of the Peak Power Penalty for Smart Grids Using MPC-based Reinforcement Learning

Wenqi Cai, Hossein Nejatbakhsh Esfahani, Arash Bahari Kordabad, Sébastien GrosCDC 2021

Introduction

In the evolving landscape of modern smart grids, residential "prosumers"—households that both produce and consume energy—face a complex economic landscape. Managing energy costs effectively requires balancing two distinct and often conflicting financial pressures: volatile hourly spot-market prices and monthly peak-power penalties. While Economic Model Predictive Control (EMPC) has long been a standard for short-term optimization, it often fails to account for long-term penalties that occur over a 30-day billing cycle. This paper presents a hybrid control strategy that integrates the structural advantages of Model Predictive Control (MPC) with the adaptive learning capabilities of Reinforcement Learning (RL) to bridge this temporal gap.

The Problem: Horizon Mismatch and Stochasticity

Prosumers typically optimize their energy usage based on two cost components:

  1. Spot-market costs: These are hourly prices determined by grid demand, which are well-suited for optimization over short horizons (e.g., 24 hours).
  2. Peak-power penalties: These are charges based on the single highest point of electricity demand recorded over an entire month.

Standard EMPC struggles with peak-power penalties because the "peak" is a global property of a 720-hour (30-day) window, whereas the controller typically only looks ahead 12 to 24 hours. Furthermore, residential energy behavior is highly stochastic, driven by unpredictable local production (like solar) and consumption patterns. While pure Deep Reinforcement Learning (DRL) could theoretically learn these patterns, it often lacks the safety guarantees and data efficiency required for critical power infrastructure.

Proposed Methodology: Parametric MPC-based RL

The authors propose a Parametric MPC-based Reinforcement Learning framework. In this architecture, the MPC does not just act as a controller; it serves as the policy approximator for the RL agent.

The Actor-Critic Architecture

  • The Actor (Parametric MPC): Instead of using a generic neural network, the policy is defined by a parametric MPC scheme. The internal model coefficients, cost function weights, and constraints are treated as tunable parameters ($\theta$). This ensures that every action taken by the agent is the result of a constrained optimization problem, inherently respecting physical limits such as battery state-of-charge (SOC).
  • The Learner (Deterministic Policy Gradient): The system uses the Deterministic Policy Gradient (DPG) method to update the MPC parameters. By calculating the gradient of the long-term cost with respect to $ heta$, the system learns to adjust its short-term logic to minimize long-term expenses.
  • The Critic (LSTD): A Least Squares Temporal Difference (LSTD) method estimates the value function, providing the actor with feedback on the long-term implications of current energy management decisions.

One of the most critical parameters tuned is $ heta_\lambda$, a scaling factor that translates the monthly peak penalty into a value the short-term MPC can utilize.

Experimental Setup and Data

The methodology was validated using a simulated three-agent residential smart grid. Each agent was equipped with unique battery capacities and stochastic local power profiles modeled as stable random walks.

To ensure realism, the study utilized real-world energy price data from the Nord Pool European Power Exchange for Trondheim, Norway, recorded in November 2020. The simulation spanned a full month (720 hours) to test the controller's ability to manage the monthly peak penalty effectively.

Key Insights and Results

Horizon Mismatch Compensation

A significant finding was the system's ability to compensate for its limited prediction horizon. The RL agent learned that the optimal weight for the peak penalty within the 12-hour MPC window ($\theta_\lambda$) was approximately 22.5, even though the actual monthly penalty ($\lambda$) was 100. This discrepancy demonstrates that the RL agent successfully "learned" how to bias the short-term controller to achieve the best long-term economic outcome.

Performance Metrics

  • Peak Power Reduction: The collective peak power of the neighborhood was reduced from an initial 42 kWh to approximately 11 kWh as the RL tuned the MPC parameters.
  • Convergence: The total closed-loop economic cost ($J$) and all 19 tuned parameters (including battery dynamics and cost-shaping factors) reached stable values, indicating a robust and reliable learning process.
  • Safety and Stability: Unlike standard DRL, which can produce erratic outputs during early training phases, the MPC-based policy remained safe throughout the learning process because it always operated within the defined physical constraints of the battery system.

Conclusion and Future Work

This research demonstrates that using MPC as a function approximator for RL provides a powerful tool for smart grid management. It combines the "domain knowledge" of power system physics with the adaptive power of machine learning.

While the results for the three-agent system are promising, the authors identify centralization as a primary limitation. Future research will focus on developing distributed MPC-based RL strategies to improve scalability for larger neighborhoods. Additionally, incorporating more sophisticated forecasting models for energy production and consumption could further refine the controller's performance in increasingly complex energy markets.

Summary updated

BibTeX
@inproceedings{cai2021optimal,
  author = {Wenqi Cai and Hossein Nejatbakhsh Esfahani and Arash Bahari Kordabad and Sébastien Gros},
  title = {{Optimal Management of the Peak Power Penalty for Smart Grids Using MPC-based Reinforcement Learning}},
  booktitle = {CDC},
  year = {2021},
  doi = {10.1109/cdc45484.2021.9683333},
}
Figure