Source-linked AI summary

Safe Receding Horizon Mixed-Integer Differentiable Predictive Control for Degradation-Aware Battery Dispatch

Eshagh Safarzadeh Ravajiri, Jan Drgona, Benjamin F. Hobbs

arXiv:2609.28698v1eess.SYcs.SY

TL;DR

Battery dispatch requires handling discrete operating modes and path-dependent degradation, while repeated mixed-integer optimization limits closed-loop speed. S-RH-MI-DPC trains a neural policy on exact rainflow degradation and pairs it with a QP safety filter for receding-horizon control. In a 7-day evaluation, it had a 6.9% cost gap versus the mixed-integer MPC benchmark and a 25× speedup.

Abstract

from arXiv · show

We present a safe receding-horizon mixed-integer differentiable predictive control methodology for residential battery energy storage dispatch that combines neural-network speed with recursive feasibility guarantees. Unlike open-loop learning-to-optimize methods, it incorporates real-time state-of-charge feedback and sinusoidal time-of-day conditioning, enabling closed-loop re-planning at every timestep without re-solving a mixed-integer program. A differentiable rainflow cycle-counting layer enables self-supervised training of the mixed-integer policy on exact degradation physics. The controller is a hybrid closed-loop system pairing a neural mode-selection and continuous-action policy with a quadratic-programming safety filter that guarantees recursive feasibility independent of network weights or mode optimality. We establish mode-conditioned Lipschitz continuity and a conditional regret decomposition into training-quality, mode-mismatch, and forecast-error terms. On a 7-day net-metering evaluation, the method attains a 6.9% cost gap versus the closed-loop mixed-integer MPC benchmark with a 25x speedup (0.11 s vs 2.7 s per step), while average regret rises by under 4% across 0-30% forecast noise. The learned and benchmark modes agree at every step, so the bound reduces to its training-quality and forecast-error terms, both empirically validated.

I. INTRODUCTION

Residential battery dispatch must balance time-varying electricity prices with degradation while handling discrete charge/discharge choices and path-dependent rainflow costs. S-RH-MI-DPC combines self-supervised policy training with a QP safety filter, extending prior open-loop BESS control toward feasible receding-horizon operation.

I. INTRODUCTION

  • At each control step, BESS dispatch involves discrete charge/discharge choices and non-smooth, path-dependent rainflow degradation, while classical MILP methods re-solve the optimization in closed loop.The dispatch setting couples time-of-use prices and solar generation with battery degradation.Source: §I · p. 1
  • Prior mixed-integer DPC for BESS used open-loop day-ahead forecasts, without SOC feedback under process noise and forecast error.The paper contrasts this with learning-based approaches that rely on supervised behavioral cloning and large datasets of optimal solutions.Source: §I · p. 1
  • S-RH-MI-DPC trains a neural policy offline through a differentiable rainflow layer and uses a convex QP safety filter for feasible receding-horizon deployment.The policy incorporates SOC feedback and sinusoidal time-of-day conditioning.Source: §I · p. 1
  • Its conditional regret bound decomposes suboptimality into training quality, discrete mode mismatch, and cumulative forecast error.The proposed framework also establishes pointwise and recursive feasibility and mode-conditioned Lipschitz continuity.Source: §I · p. 1

A. Dispatch Optimization Problem

  • The dispatch formulation uses a 24-step daily horizon with one-hour intervals and accounts for purchase and export tariffs, site demand, solar generation, and cycle aging.Its control vector contains separate charge and discharge powers, with mode-dependent dynamics and net-metering balance.Source: A. Dispatch Optimization Problem · pp. 1–2

B. Battery Degradation Model

The paper models degradation with rainflow cycle counting and a piecewise-linear approximation for tractable optimization. Its controller instead trains offline on exact degradation physics, then uses a neural policy and QP filter for receding-horizon deployment.

B. Battery Degradation Model

  • Rainflow degradation assigns a stress cost to each half- or full-cycle, while an M-segment piecewise-linear surrogate converts the MINLP into a MILP.Each cycle is weighted by its multiplicity and the battery replacement cost.Source: B. Battery Degradation Model · p. 2

III. METHODOLOGY

  • Offline training differentiates the closed-loop objective through the policy, SOC dynamics, and rainflow layer; online, the controller selects a mode and candidate action in one forward pass.A convex QP safety filter projects the candidate action, and only the first action is applied at each hour.Source: §III · p. 2, A. Architecture Overview · p. 2

A. Architecture Overview

  • The policy input combines forecast profiles, current SOC, and sinusoidal time encoding so behavior is conditioned on the horizon’s start time within the day.The sinusoidal encoding represents where the window starts, including midnight, noon, or another intraday hour.Source: A. Architecture Overview · p. 2
  • A three-layer MLP produces separate mode and power heads, with the mode head selecting among charge, discharge, and idle and the power head generating scaled control magnitudes.The encoder uses LayerNorm and dropout, with a hidden dimension of 1024.Source: A. Architecture Overview · p. 2

B. Mode and Power Heads Outputs

The mode head uses mutually exclusive mode selection, while the power outputs are gated by the selected mode. Idle therefore yields zero charge and discharge power by construction.

B. Mode and Power Heads Outputs

  • Gumbel-Softmax with a straight-through estimator enforces mode exclusivity during training, and inference uses a hard argmax over mode logits.The training temperature anneals from 5.0 to 0.1.Source: B. Mode and Power Heads Outputs · p. 2
  • The selected mode gates the power-head outputs.The mode and power heads thus determine a discrete operating mode and its associated continuous controls.Source: B. Mode and Power Heads Outputs · pp. 2–3
  • Idle forces both charge and discharge power to zero by construction, satisfying the mode-specific constraint architecturally.The tanh mapping sends power-head logits to the permitted range and provides stronger gradients near zero than sigmoid.Source: B. Mode and Power Heads Outputs · p. 3

C. Differentiable Rainflow Layer

The differentiable rainflow layer evaluates exact cycle degradation from the SOC trajectory while supplying gradients for self-supervised policy training. Training combines economic cost, exact rainflow degradation cost, and an SOC-violation penalty.

C. Differentiable Rainflow Layer

  • The forward rainflow pass identifies cycle peaks and valleys in the SOC trajectory, then computes each cycle’s depth and multiplicity.Cycle depths are the absolute SOC differences between the identified extrema.Source: C. Differentiable Rainflow Layer · p. 3
  • The layer combines sparse gradients at identified SOC extrema with dense surrogate gradients at every timestep, clipping gradients to [−1,1] for stability.The sparse component provides physics-accurate gradients at extrema that define cycle depths.Source: C. Differentiable Rainflow Layer · p. 3

D. Training Procedure

  • Self-supervised training uses exact rainflow degradation cost alongside import cost minus export revenue and a penalty for SOC violations.Training samples randomized T-step windows from synthetic two-day sequences with randomized start times and initial SOC, adding 5% Gaussian input noise.Source: D. Training Procedure · p. 3

E. Convex QP Safety Filter

The controller separates neural mode selection and continuous-action generation from projection onto a mode-conditioned feasible set. Before execution, a convex QP safety filter adjusts infeasible candidates while preserving the selected charge or discharge direction.

E. Convex QP Safety Filter

  • The safety filter projects the learned action onto the one-step feasible set before execution, invoking the QP only when the candidate would leave the state set.Feasible outputs pass through unchanged.Source: E. Convex QP Safety Filter · p. 3
  • The convex QP safety filter enforces mode exclusivity by zeroing the unselected power channel, so projection changes magnitude but not direction.The filter is solved via OSQP and preserves the selected mode's power direction.Source: E. Convex QP Safety Filter · p. 3

A. Hybrid Closed-Loop System Definition

  • The hybrid controller selects a mode with μθ, generates a continuous candidate with πθ, then projects it onto the mode-conditioned feasible set.The projection is Euclidean and separates discrete mode selection, continuous control generation, and safe projection.Source: A. Hybrid Closed-Loop System Definition · p. 3

B. Feasibility of the Hybrid Controller

Under nonempty, closed, convex mode-conditioned feasible sets, the hybrid controller has a unique projection and preserves state feasibility recursively. Its continuity guarantee is mode-conditioned, and recursive feasibility assumes nominal SOC dynamics unless robust constraints are added.

Feasibility of the Hybrid Controller

  • Under the feasibility assumption, the mode-conditioned projection exists uniquely because its feasible set is nonempty, closed, and convex.For the BESS, zero-magnitude action is admissible in every mode, making the set nonempty; linear dynamics and compact power and SOC bounds give convexity and closedness.Source: B. Feasibility of the Hybrid Controller · p. 4
  • If the initial state is feasible, every later state remains feasible under any neural-network switching signal, regardless of mode optimality.This recursive-feasibility result assumes exact nominal SOC dynamics; additive disturbances require robust tightening or a robust invariant set.Source: B. Feasibility of the Hybrid Controller · p. 4
  • For a fixed state and mode, the projected policy is Lπ-Lipschitz in the forecast window.The projection is non-expansive, so the composite Lipschitz constant is no greater than that of the neural continuous-control policy.Source: B. Feasibility of the Hybrid Controller · p. 4
  • The Lipschitz guarantee applies only within a fixed mode; mode transitions may create discontinuities, so forecast perturbations must not induce a switch.Source: B. Feasibility of the Hybrid Controller · p. 4

C. Conditional Performance Bounds

The conditional performance analysis decomposes regret into training quality, mode mismatch, and forecast accuracy, subject to stated regularity assumptions. When learned and comparator modes agree, the mode-mismatch term vanishes.

C. Conditional Performance Bounds

  • The regret decomposition separates training quality, discrete mode mismatch, and forecast accuracy.The bound is conditional on its stated assumptions.Source: C. Conditional Performance Bounds · p. 4
  • The cost-regularity constant LJ(T) may depend on the horizon, and exact rainflow degradation receives no separate Lipschitz claim.Its contribution is absorbed into LJ(T) under the cost-regularity assumption.Source: C. Conditional Performance Bounds · p. 4
  • The forecast-error assumption is local: it applies in neighborhoods where the optimal mode sequence is unchanged, not across mode-flipping perturbations.A perturbation that changes the optimal integer sequence can induce a jump.Source: C. Conditional Performance Bounds · p. 4
  • When learned and comparator modes agree throughout the trajectory, the mode-mismatch term is zero and the bound retains training-quality and forecast-error terms.The comparator and learned policy optimize the same economic–degradation objective; the authors report that their discrete decisions coincide at most steps once training converges.Source: C. Conditional Performance Bounds · p. 5
  • The bound measures suboptimality against MPC-PWL, not against the global MINLP optimum.MPC-PWL uses a piecewise-linear degradation approximation.Source: C. Conditional Performance Bounds · p. 5

V. EXPERIMENTAL RESULTS

The reported experimental setup evaluates a trained BESS policy with specified system limits, optimizer settings, and a curriculum for degradation weighting.

V. EXPERIMENTAL RESULTS

  • The evaluated BESS has 10 kWh capacity, 4.8 kW maximum charge/discharge power, 0.92 charge and discharge efficiencies, and SOC limits of [0.1,0.9]Ecap.Source: §V · p. 5
  • Training used 10,000 samples for 1,500 epochs, with batch size 48, AdamW, OneCycleLR, and gradient clipping at ∥∇∥2 ≤ 1.0.Source: §V · p. 5
  • The degradation weight increased from 0.1 to 1.0 through a curriculum schedule, with SOC penalty weight λsoc = 5.Source: §V · p. 5

A. Weekly Cost Performance

On the 7-day evaluation, S-RH-MI-DPC had a 6.9% weekly-cost gap versus MPC-PWL and ran 25× faster. All steps were feasible, and learned modes matched the comparator throughout.

A. Weekly Cost Performance

  • 6.9% gap ($2.68): weekly cost was $41.33 for S-RH-MI-DPC versus $38.65 for MPC-PWL.The comparison covers 7 days.Source: A. Weekly Cost Performance · p. 5
  • 25× speedup: S-RH-MI-DPC took 0.11 s per step versus 2.7 s per step for MPC-PWL.The respective total times were 18.1 s and 451 s.Source: A. Weekly Cost Performance · p. 5
  • All 168 steps were feasible (100%), with the QP safety filter invoked on 39.3% of steps.The passage attributes feasibility to the safety filter regardless of NN output quality.Source: A. Weekly Cost Performance · p. 5
  • Learned modes matched MPC-PWL at all steps (100% mode agreement), making the empirical mode-mismatch term ∥δ mode∥2 = 0.Source: A. Weekly Cost Performance · p. 5
  • The reported economic and degradation components were balanced, which the authors describe as confirming training on exact degradation physics through the differentiable rainflow layer.Source: A. Weekly Cost Performance · p. 5

B. Experiment A: Regret vs Training Quality

The experiments assess training-quality and forecast-error terms in the regret bound, and the conclusion reports the controller’s 7-day benchmark comparison and feasibility result.

B. Experiment A: Regret vs Training Quality

  • RT/T decreases monotonically with training epochs, with a 36% reduction as action deviation εemp falls.The near-linear εemp–RT/T relationship is consistent with the training-quality term contracting as ε approaches zero.Source: B. Experiment A: Regret vs Training… · p. 5

C. Experiment B: Forecast Robustness

VI. CONCLUSION

  • Recursive feasibility and positive invariance of the SOC constraint set hold independently of network weights or mode selection, with suboptimality bounded by training quality, mode mismatch, and forecast error.The conclusion also reports that regret decreases with epochs and rises by less than 4% across 0–30% forecast noise.Source: §VI · p. 6
  • In the evaluation, S-RH-MI-DPC achieved a 6.9% cost gap versus the mixed-integer MPC benchmark, with 100% feasibility and a 25× speedup (0.11 s vs 2.7 s per step).Source: §VI · p. 6
Loading 2609.28698v1…