← News
Tech for Good Tech for Good Frontiers

This Battery Controller Learned From Its Mistakes — And Prevented Costly Failures

This Battery Controller Learned From Its Mistakes — And Prevented Costly Failures
Scenario-DeePC Technology used
NEST Research Facility, CH Location
80% Fewer Violations Improvement
No Physics Model Needed Key benefit
80% constraint violations reduced

80% fewer constraint violations. That’s the result when a smart new controller faced one of the messiest realities of real-world battery operation: sensors that lie.

Not maliciously, of course. But the state-of-charge (SOC) estimate on a lithium titanate battery system at Switzerland’s NEST research facility doesn’t just drift—it jumps. Without warning, its software recalibrates, shifting the reported SOC by several percentage points up or down. These aren’t measurement errors in the usual sense. They’re discrete, abrupt corrections baked into the black-box battery management system, invisible to external controllers.

For most control algorithms, this is a nightmare. Batteries must stay within strict SOC limits—say, 20% to 80%—to avoid degradation or even fire. If your controller thinks the battery is at 40%, but the sensor suddenly recalibrates to 45%, you’ve just lost five points of safety margin. Do that near a boundary, and you risk triggering an automatic shutdown—or worse.

Yet in a recent experiment, a new method called Scenario-based Data-Enabled Predictive Control (Scenario-DeePC) didn’t just survive this chaos. It thrived. Compared to standard data-driven control, it slashed constraint violations by 80%—all while tracking the same aggressive reference trajectory. And it did so without a single line of battery physics encoded in its logic. Instead, it learned what could go wrong by watching what had gone wrong.

This isn’t just a win for one lab in Dübendorf. It’s a sign that we might finally be ready to manage the messy reality of grid-scale energy storage—not with perfect models, but with intelligent adaptation.

The Science

Battery energy storage is the linchpin of the renewable revolution. Solar and wind are intermittent; batteries smooth them out. But controlling those batteries is harder than it looks. You can’t let them overcharge or deeply discharge. You need precision. And traditionally, that meant building detailed mathematical models of electrochemical dynamics—capturing how voltage, current, temperature, and aging interact.

It’s painstaking work. First-principles modeling requires deep domain expertise. System identification demands extensive testing. And both break down as batteries age or vary across units. So researchers have turned to data-enabled predictive control (DeePC), a method that skips modeling entirely. Instead of simulating the battery, DeePC asks: What have we seen before?

The idea comes from Willems’ fundamental lemma in systems theory: if you have enough historical input-output data from a system, you can reconstruct its entire behavior. In practice, that means storing past records of power commands and resulting SOC measurements in a Hankel matrix—a structured array where each column is a sliding window of past behavior. When the controller needs to predict the future, it finds a weighted combination of these past trajectories that best matches the current situation.

Mathematically, standard DeePC solves:

subject to

Here, $g$ weights the historical trajectories, $r$ is the desired SOC path, and the regularization terms $|g|{\lambda_g}^2$, $|\sigma_y|{\lambda_y}^2$ make the prediction robust to noise. But there’s a catch: while the prediction is regularized, the constraints—like “SOC must stay between 35% and 75%”—are not. If the model is slightly off, or a sensor jumps, the controller might confidently command a power profile that violates safety limits.

Enter Scenario-DeePC. It borrows from the scenario approach, a framework for turning uncertain constraints into probabilistic guarantees. Instead of saying “the SOC must always be safe,” it says “the SOC must be safe in 95% of plausible futures.” To define those futures, it samples from past prediction errors—the gaps between what the controller expected and what actually happened.

Each time the controller runs, it computes the one-step prediction error:

and stores it in a buffer $\mathcal{E}_{\text{buffer}}$. Later, when planning ahead, it generates multiple scenarios by adding random draws from this buffer to its base prediction. For each scenario, it enforces the SOC constraints. If all scenarios stay within bounds, the plan is deemed robust. If not, slack variables allow minor violations—but penalize them heavily in the cost function.

Crucially, the buffer is updated online. Every $M+1$ steps, a new error is added, and the oldest is discarded. This creates a rolling memory of recent uncertainty, allowing the controller to adapt to changing conditions—like a sudden increase in sensor noise or a recalibration event.

But here’s the catch: prediction errors aren’t independent. Due to the SOC being reported in 0.5% increments, small errors persist over time, creating artificial correlation. To satisfy the scenario approach’s theoretical requirements, the authors store only every $(M+1)$-th error, where $M$ is the estimated correlation horizon. In this case, $M=5$: every sixth error is kept, ensuring statistical independence.

What They Found

The experiment pitted Scenario-DeePC against standard DeePC on a 96 kWh ads-tec battery rack at NEST, connected to a live research microgrid. Both controllers aimed to track a repeating SOC cycle: hold at 50%, ramp down to 35%, hold, ramp up to 75%, hold, return to 50%. The constraints matched the trajectory bounds—so any violation wasn’t due to aggressive goals, but to uncertainty.

Over 20 cycles, standard DeePC violated the SOC limits 15 times. Scenario-DeePC? Just 3 times. An 80% reduction

Constraint Violations: Standard DeePC vs. Scenario-DeePC

Number of times each controller drove the battery outside its safe SOC range (35%–75%) during 20 cycles.

Constraint Violations: Standard DeePC vs. Scenario-DeePC
LabelValue
Standard DeePC15
Scenario-DeePC3

.

More telling was when violations occurred. Standard DeePC failed mostly during or just after recalibration jumps—precisely when prediction errors spiked. Scenario-DeePC, having absorbed those errors into its scenario buffer, tightened its constraints automatically. It didn’t just react; it anticipated.

Fig. 4: SOC, commanded power, and one-step prediction error of Scenario-DeePC and standard DeePC during cycles of the reference trajectory without a recalibration event, shown superimposed in time.
Fig. 4: SOC, commanded power, and one-step prediction error of Scenario-DeePC and standard DeePC during cycles of the reference trajectory without a recalibration event, shown superimposed in time. Source: Sebastian Zieglmeier, Nikolas Recke

shows two cycles without recalibration. Both controllers perform similarly—small prediction errors, no violations. But

Fig. 5: SOC, commanded power, and one-step prediction error of Scenario-DeePC over consecutive cycles of the reference trajectory containing two recalibration events of opposite sign. The elevated scenario buffer entries introduced by these events visibly tighten the constraint handling for the subsequent cycles, until discarded from the buffer.
Fig. 5: SOC, commanded power, and one-step prediction error of Scenario-DeePC over consecutive cycles of the reference trajectory containing two recalibration events of opposite sign. The elevated scenario buffer entries introduced by these events visibly tighten the constraint handling for the subsequent cycles, until discarded from the buffer. Source: Sebastian Zieglmeier, Nikolas Recke

tells a different story. During Cycle 3, the SOC estimate jumps upward by ~2 percentage points. Standard DeePC, blind to this shift, continues as if nothing happened—until it hits the upper limit. Scenario-DeePC, meanwhile, sees the spike in its prediction error and adjusts. The next time it plans a charge phase, it leaves more headroom. The buffer remembers.

One-Step Prediction Error Over Time

Deviation between predicted and measured SOC at each control step, showing spikes after recalibration events.

One-Step Prediction Error Over Time
LabelValue
Cycle 10.3
Cycle 20.4
Cycle 31.8
Cycle 41.6
Cycle 50.5
Cycle 60.4
Cycle 70.3

tracks the one-step prediction error over seven cycles. After the recalibration in Cycle 3, errors remain elevated for several cycles—reflecting the controller’s temporary misalignment. But by Cycle 5, they’ve decayed back to baseline. Scenario-DeePC’s adaptive buffer captures this transient, then forgets it, avoiding unnecessary conservatism later.

Performance-wise, both controllers tracked the reference equally well. The median tracking error was nearly identical. The difference wasn’t in where they went, but in how safely they got there.

Why This Changes Things

Energy storage is scaling fast. The world added 37 GW of battery capacity in 2023 alone—triple the amount from 2020. Much of it goes into grid services: smoothing solar output, shifting load, providing backup. But as batteries move from lab curiosities to critical infrastructure, reliability becomes non-negotiable.

Today, most industrial controllers rely on model predictive control (MPC) with hand-tuned disturbance models. They assume noise is Gaussian, disturbances bounded, recalibrations nonexistent. When reality deviates, safety margins balloon—or failures occur.

Scenario-DeePC flips the script. It doesn’t assume anything about uncertainty. It learns it. And because it’s data-driven, it works out of the box on any system with recorded inputs and outputs—no re-engineering needed.

That’s transformative for three reasons.

First, batteries age. Their internal resistance grows, capacity fades, efficiency drops. A model built at commissioning becomes obsolete. Scenario-DeePC continuously updates its understanding through the scenario buffer, adapting to slow degradation without manual recalibration.

Second, systems are heterogeneous. A utility-scale storage farm might mix cells from different batches, manufacturers, or chemistries. Each has unique quirks. Building individual models is impractical. A data-driven approach treats them all the same: as black boxes with measurable behavior.

Third, sensors are imperfect. The SOC jumps at NEST aren’t a bug—they’re a feature of how real battery management systems operate. Many commercial BMSs recalibrate based on open-circuit voltage measurements, temperature thresholds, or usage patterns. These events are rarely documented, never shared with external controllers. Scenario-DeePC doesn’t need documentation. It just watches.

This also democratizes access. You don’t need a PhD in electrochemistry to deploy it. With enough data, even a junior engineer can set up a robust controller. That lowers the barrier to entry for community microgrids, developing regions, or startups.

Of course, it’s not magic. The method assumes the system is approximately linear time-invariant over short horizons—a reasonable approximation for SOC dynamics, but less so for highly nonlinear processes like thermal runaway. And while it handles stochastic uncertainty well, it can’t predict truly novel failure modes absent from the data.

Still, the implications ripple outward. Imagine fleets of electric vehicles participating in vehicle-to-grid programs, their aggregated batteries forming a virtual power plant. Each car’s BMS recalibrates independently. A central controller using Scenario-DeePC could coordinate them safely, learning from collective errors without needing to model each vehicle.

Or consider repurposed EV batteries for second-life energy storage. Their history is often unknown. Scenario-DeePC could bootstrap control from scratch, letting the system reveal its own limits.

What's Next

This was a first real-world deployment. The authors rightly call it an experimental study. Several questions remain.

How large should the scenario buffer be? Too small, and it misses rare events. Too large, and it retains outdated information. The paper fixes $N_{\text{buffer}} = 50$, but adaptive sizing—based on error variance or recency—could improve performance.

Can the method handle multi-output constraints? Here, only SOC was constrained. Real systems also limit current, temperature, and rate of change. Extending the scenario approach to coupled constraints is theoretically sound but computationally heavier.

And what about communication delays or actuator saturation? The current setup assumes perfect tracking of power setpoints. In noisy networks, that won’t hold. Integrating robustness to input uncertainty would make the method even more practical.

Perhaps most exciting: could Scenario-DeePC learn across systems? Right now, each battery maintains its own error buffer. But if anonymized prediction errors were shared across a fleet, a new unit could start with a pre-trained buffer—accelerating convergence and improving safety from day one.

We’re entering an era where energy infrastructure must be as flexible as the renewables it supports. Models will always have a place, especially for design and certification. But for day-to-day operation, the future may belong to controllers that don’t pretend to know the physics—but instead, learn from experience.

As the authors put it: “Its adaptive scenario buffer further tightens constraint handling automatically, improving robustness to unpredictable recalibration events.” In a world of complex, aging, interconnected systems, that’s not just a technical detail. It’s a philosophy.