Create and explore imaginative 3D worlds with our new product Dreamfield (opens in a new tab)
Papers
Topics
Authors
Recent
Search
2000 character limit reached

Safe Reinforcement Learning using Ideas from Model Predictive Control

Published 8 Jul 2026 in cs.LG and cs.RO | (2607.07252v1)

Abstract: Reinforcement learning (RL) enables the synthesis of control policies directly from data, making it highly appealing for complex cyber-physical systems (CPSs) and robotics. A persistent challenge, however, is ensuring strict, hard safety constraints during the active learning phase. In real-world physical systems, violating mechanical limits can cause irreversible damage, necessitating that exploration remains strictly within safe operational regions. We propose a generalized framework that combines the adaptive, high-performance nature of deep reinforcement learning (DRL) with the formal safety guarantees of model predictive control (MPC). Using a mathematical model of the system dynamics, offline MPC computations define a feasible state-action space, representing all safe combinations of system states and control inputs that guarantee constraint satisfaction. During training and deployment, the RL agent's instantaneous actions are projected onto this globally verified feasible set via a safety filter. We systematically evaluate our generalized approach on a non-linear 1-DoF laboratory testbed, demonstrating successful exploration and stable policy convergence on physical hardware.

Citations (2)

Summary

  • The paper combines deep reinforcement learning with offline MPC feasibility checks to precompute recursively safe state-action boundaries and project unsafe actions to the nearest feasible control.
  • The method exploits convex feasible action intervals and bisection search to reduce computation, while reward shaping encourages PPO to learn smooth, inherently safer policies during hardware training.
  • The Quanser Aero 2 demonstration shows stable exploration and convergence with substantially reduced catastrophic risk, but rare violations reveal limitations from model mismatch, latency, sampling, and low-dimensional scalability.

Motivation and problem statement

Reinforcement learning (RL) offers a route to synthesizing control policies directly from data for complex cyber-physical systems (CPSs), but its reliance on extensive, unconstrained exploration is fundamentally incompatible with physical hardware, where violating mechanical or actuator limits can cause irreversible damage. The paper addresses this safety bottleneck by proposing a framework that couples deep RL with the formal guarantees of model predictive control (MPC). The key conceptual device is the definition of the unsafe state: not merely a constraint violation itself, but any situation from which a future violation becomes physically inevitable regardless of subsequent control actions — the "point of no return" boundary ∂F\partial\mathcal{F}. This framing makes clear that single-step constraint checking is insufficient; safety must be recursive and forward-looking.

Positioning relative to prior safe-RL approaches

The authors situate their work against three established families of safe-RL methods. Constrained MDP formulations such as constrained policy optimization and Lagrangian methods enforce only expected cumulative cost bounds over a horizon, which cannot provide deterministic, step-by-step protection during stochastic early training. Lyapunov-based approaches restrict policy updates to safe subsets but require constructing valid Lyapunov functions, while Hamilton-Jacobi reachability suffers from the curse of dimensionality on continuous systems. Reactive mechanisms — shielding automata and control barrier functions (CBFs) — intervene online, but the paper identifies a structural weakness: standard DRL policies map states to instantaneous actions without a predictive horizon, so an online filter that does not simulate long-term dynamics may intervene too late in high-inertia systems already committed to an inevitable collision trajectory.

The distinguishing contribution is therefore architectural: rather than evaluating safety online, the framework uses MPC as an offline feasibility oracle to pre-compute the feasible state-action space F\mathcal{F}, shifting all heavy computation out of the real-time control loop. This is a deliberate trade of offline computation for online latency, and it is what enables deployment on high-frequency control loops.

Formal framework

The system is modeled as a continuous-time nonlinear plant xË™(t)=fcont(x(t),u(t))\dot{x}(t) = f_{\text{cont}}(x(t), u(t)), discretized into an MDP with hard state constraints Xsafe\mathcal{X}_{\text{safe}} and actuator limits Usafe\mathcal{U}_{\text{safe}}. A state ss is feasible if at least one action admits an infinite sequence of future actions keeping the system within S+\mathcal{S}^+; the feasible state-action space F\mathcal{F} is the union of all such pairs. For each candidate pair (s,a)(s,a), the MPC oracle solves the constrained finite-horizon optimal control problem with the first input pinned to aa; feasibility over the horizon certifies membership in F\mathcal{F}0.

Two design choices deserve emphasis. First, instead of computing a rigorously derived terminal invariant set — often intractable for nonlinear systems — the authors use a conservatively large prediction horizon F\mathcal{F}1: if F\mathcal{F}2 exceeds the maximum time to bring the system to a full halt under maximum opposing effort, surviving F\mathcal{F}3 steps serves as a practical guarantee of long-term safety. This is explicitly a practical substitute for classical recursive-feasibility theory, not a formal equivalent. Second, for control-affine mechanical systems, the feasible action set F\mathcal{F}4 forms a convex interval, so only the boundaries F\mathcal{F}5 and F\mathcal{F}6 need be determined via bisection search. Any interior action is then guaranteed feasible by convexity, drastically reducing oracle queries compared to exhaustive evaluation of the continuous action space.

During training, a deterministic Euclidean projection filter maps raw actions outside F\mathcal{F}7 to the nearest feasible point before execution. Two reward-shaping mechanisms support learning: penalizing the projection magnitude F\mathcal{F}8 incentivizes the agent to internalize the safety boundaries natively, and an action-smoothness penalty based on the sliding-window standard deviation of applied actions suppresses the bang-bang oscillation typical of DRL controllers.

Experimental validation

The framework is evaluated on a Quanser Aero 2 testbed configured for 1-DOF pitch control with two opposed motors, governed by nonlinear dynamics including gravitational restoring torque (F\mathcal{F}9 term) and empirically identified friction, inertia, and voltage-gain parameters. Mechanical pitch limits of xË™(t)=fcont(x(t),u(t))\dot{x}(t) = f_{\text{cont}}(x(t), u(t))0 define xË™(t)=fcont(x(t),u(t))\dot{x}(t) = f_{\text{cont}}(x(t), u(t))1. The offline grid search with bisection yields minimum and maximum feasible voltage surfaces over the state space; these surfaces concretely exhibit the point-of-no-return structure, shrinking to maximum reverse thrust at high velocities near the limit. Deployment uses a compiled Simulink model wrapped in a Gymnasium interface, enabling zero-shot transfer to hardware via the Quanser Python API.

With the projection filter active, a PPO agent trained directly on both simulation and physical hardware, successfully exploring the extreme boundaries of the state space while remaining within feasible bounds "for the vast majority of the training process." That qualifier matters: the paper candidly reports rare, intermittent mechanical violations on hardware despite the theoretical guarantee. The authors attribute these to model inaccuracies (the sim-to-real gap), discrete-time sampling errors between evaluation steps, unmodeled communication latencies, and numerical solver tolerances in the real-time projection. The filter nonetheless prevents catastrophic high-velocity exploration failures and stabilizes hardware training relative to unconstrained baselines. It should be noted that the empirical results are qualitative — no quantitative violation rates, return curves, or baseline comparisons are tabulated — so the strength of the empirical claims rests on demonstration rather than statistical evidence.

Limitations and open questions

The paper is explicit about three limitations. First, the absolute safety guarantee is conditional on the fidelity of the nominal dynamics model used by the oracle; the observed hardware violations demonstrate that this assumption fails in practice at some rate, and robust MPC formulations are proposed as a future remedy rather than incorporated here. Second, the grid-search construction of xË™(t)=fcont(x(t),u(t))\dot{x}(t) = f_{\text{cont}}(x(t), u(t))2 scales exponentially with state-action dimension xË™(t)=fcont(x(t),u(t))\dot{x}(t) = f_{\text{cont}}(x(t), u(t))3, confining the method to low-dimensional systems; Gaussian-process-based active sampling near the boundary xË™(t)=fcont(x(t),u(t))\dot{x}(t) = f_{\text{cont}}(x(t), u(t))4 is proposed but not yet validated. Third, the horizon-based substitute for a terminal invariant set leaves open whether formal recursive-feasibility guarantees can be recovered without prohibitive computation for nonlinear plants. An additional open question raised by the reported edge-case violations is how inter-sample constraint enforcement and communication latency can be handled within the projection architecture itself.

Conclusion

This paper presents a clean separation of concerns for safe RL: offline MPC pre-computes recursively feasible state-action boundaries, and a lightweight projection filter enforces them at control-loop frequency. Exploiting convexity of the feasible action set reduces the offline mapping to boundary bisection, and the approach was demonstrated end-to-end on physical hardware with stable PPO convergence. The guarantee is, however, contingent on model accuracy and exact execution, and scalability beyond low-dimensional systems remains unresolved — both acknowledged by the authors as the principal directions for further work.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.