A fast robot controller has two sources of error that it can measure while it runs, and almost no controller uses them. The first comes from the disturbance estimator. An extended state observer is a small filter that lumps friction, wind and model mismatch into one estimated "total disturbance" signal. Its prediction error on the measured output, called the innovation, shows each sample how far behind the true disturbance it is. The second comes from the optimizer. When a model predictive controller (MPC: a controller that re-solves a short-horizon constrained optimization every sample) is cut off after a fixed number of iterations to meet a deadline, its remaining constraint and optimality residuals show how far from the true solution it stopped. This note proposes using both signals to size, each sample, the safety margin by which state and input constraints are tightened. The margin then stays small in calm conditions and grows during gusts, load steps or observer transients. It is calibrated offline so that constraint violations stay below a target rate.
This matters because current designs pick one fixed margin. Tube MPC takes it from a worst-case bound, and engineers otherwise hand-tune it. A fixed margin is either too cautious most of the time or violated exactly when the disturbance changes fastest. Those are also the moments when observer lag and solver truncation are largest, and when a controller on a deadline has the least time to recover. The claim is narrow and testable. With per-sample compute held fixed, a margin driven by measured innovation and measured solver residual gives lower tracking error, at the same violation rate, than the best fixed margin found by exhaustive tuning.
Core Claim
Let $e_1$ be the observer's output innovation, $\Delta\hat f$ the change in the disturbance estimate over the last sample, $r_K$ the primal residual of the optimizer after $K$ iterations, and $\tau$ the computation delay. The proposal tightens every constraint $c(x,u)\le 0$ in the prediction to $c(x,u)\le -m_t$, where
$$m_t = \phi_1(|e_1|, |\Delta \hat f|)\,(1+\tau\,\omega) + \phi_2(r_K),$$
$\phi_1,\phi_2$ are monotone non-decreasing functions fitted offline, and $\omega$ is the observer bandwidth.
The first term has a physical basis. For a linear extended state observer, the estimation error obeys linear dynamics driven by the disturbance rate $\dot f$. Its steady size therefore scales roughly as $\dot f/\omega$, and the innovation $e_1$ is the one component of that error vector we can measure directly. The factor $(1+\tau\omega)$ accounts for the estimate going stale while the solver runs. The second term is the residual that a truncated iterative solver already computes at no extra cost.
The functions are calibrated on held-out closed-loop rollouts so that the per-step violation rate stays at or below a target $\varepsilon$. Conformal-style quantile calibration on rollouts is the intended procedure. The file contains no control paper that does this, so the calibration step is our contribution rather than a borrowed result.
What is new is not "put the disturbance estimate into the MPC." Prior work already does that, as shown below. What is new is treating the observer's innovation and the truncated solver's residual as live, cheap error certificates that schedule constraint tightening under a hard compute deadline.
Relation to Prior Work
Two papers motivate the gap from the observer side.
- Friction-Compensation and Extended State Observer Based Model Predictive Control for PMSM Servo Systems embeds a linear observer's disturbance estimate into MPC predictions for a motor servo. It solves the QP to convergence with a standard solver and does no constraint tightening.
- A Finite-Time Extended State Observer with Prediction Error Compensation for PMSM Control replaces the linear observer with a finite-time one. It shows that the linear-observer MPC baseline overshoots toward 200 A under a 3x inductance change, and it leaves observer gains and MPC weights hand-tuned.
Both treat the observer estimate as exact once injected. We instead treat its measured innovation as an indicator of how inexact the estimate currently is.
From the robust-control side, Deep Model Predictive Control With Stability Guarantees wraps a tube MPC around an adaptive network. It obtains input-to-state stability by treating residual model error as bounded by a fixed, known constant. That paper constrains our design: its guarantee needs a bound we do not assume. We trade a worst-case deterministic guarantee for a calibrated statistical one. We will report the worst-case tube as a baseline so the conservatism of that trade is visible.
The solver side supplies the method. Deep FlexQP: Accelerated Nonlinear Programming via Deep Unfolding unfolds ADMM (an operator-splitting QP solver) into a fixed number of layers. It lets an LSTM set step sizes and uses an $\ell_1$ elastic relaxation of constraints, so every subproblem returns a step even when the constraints conflict. We reuse its unfolded solver and its elastic relaxation directly. The elastic layer matters here because a growing margin can make the tightened QP infeasible during observer peaking. Deep FlexQP itself builds its QP from a nominal model, has no observer, and uses no margin that responds to run-time error. More broadly, deep unfolding in wireless optimization, such as Joint Communications and Sensing Hybrid Beamforming Design via Deep Unfolding, shows that fixed-depth unfolded solvers keep solution quality while cutting runtime. That supports using $K$-layer unfolding as the compute-limited solver.
On the learning side, DiAReL and DATT: Deep Adaptive Trajectory Tracking for Quadrotor Control feed disturbance estimates into neural policies. DiAReL uses a disturbance observer and DATT uses an $\mathcal{L}_1$ adaptive estimator. Both show that the estimate helps, but neither enforces hard constraints. DATT is our reference for what an unconstrained learned controller achieves on tracking.
Research Program
The system has three parts, built in this order.
The first part is a closed-loop simulator that models computation delay honestly. The plant evolves for $\tau(K)$ seconds between measurement and actuation, and $\tau(K)$ is measured from the solver on the target embedded CPU, not assumed. Without this, every latency comparison would flatter slow solvers.
The second part is the controller. A linear extended state observer feeds its disturbance estimate into the MPC prediction model. The QP is solved by a $K$-layer unfolded ADMM with elastic constraints, following Deep FlexQP. The margin $m_t$ is computed from $e_1$, $\Delta\hat f$ and $r_K$ before the final projection. We will also run a finite-time observer variant to check that the idea does not depend on the linear observer's error structure.
The third part is calibration and co-tuning.
- Shape of $\phi_1,\phi_2$: fitted as small monotone piecewise-linear functions on rollouts drawn from a training disturbance distribution.
- Scale: set by quantile calibration on a separate rollout set to meet $\varepsilon$.
- Joint tuning: observer bandwidth, $K$ and the unfolded step parameters are tuned together by gradient descent through the unfolded closed loop, with $K$ swept over a grid under each compute budget.
This joint tuning addresses the gap the finite-time observer paper names. It is secondary to the main claim, and we will ablate it separately.
We will also analyze one question. Under the linear-observer error dynamics and a known contraction rate for ADMM, does a margin of this form give a provable per-step bound on how far the true tightened constraint is from the nominal one? A partial result would show the margin is a valid upper bound whenever $\dot f$ stays within the range seen during calibration. Such a result would say precisely when the calibration should break.
Baselines
Naive reference. Nominal MPC with no observer, solved to convergence by OSQP, run in the delay-aware simulator. It shows how much the disturbance problem matters at all.
Converged-solver reference. The same observer-augmented MPC solved to convergence, with the delay that full convergence actually costs. It isolates what truncation buys. A zero-delay version of it is an unattainable reference that bounds achievable performance.
Strongest simple competitor. Observer-augmented MPC solved by warm-started OSQP or ADMM with a fixed iteration count per sample, plus a single constant constraint back-off. The back-off is grid-searched on the same training rollouts and calibrated to the same $\varepsilon$ on the same held-out set. This is the baseline most likely to kill the idea, because warm starting already makes few iterations go a long way. It gets the same compute budget and the same tuning budget in rollouts.
Strongest existing method. Deep FlexQP with the observer estimate added as a QP parameter, plus the same tuned constant back-off. It shares our solver, so any gap is attributable to the adaptive margin. Deep FlexQP reports 4–16x faster solves than OSQP inside SQP loops, and over 70% fewer safety violations and 43% higher task completion in a predictive safety filter (Deep FlexQP). Those numbers come from its own benchmarks, not ours, so we re-run it rather than quote it.
Robust reference. A worst-case tube MPC in the style of Deep Model Predictive Control With Stability Guarantees, with a fixed tube sized from the largest observer error seen in training. It shows the price of deterministic guarantees.
Unconstrained learned reference. A DATT-style policy trained with the same disturbance estimator, reported for tracking only. On Crazyflie hardware, DATT reports 0.05 m tracking error on a star trajectory versus 0.11 m for its MPC baseline, with inference under 3.2 ms (DATT).
Ablations. These isolate the key ingredient:
- margin from innovation alone;
- margin from solver residual alone;
- the margin without the delay factor;
- fixed versus co-tuned observer bandwidth.
Criterion for success. At equal compute budget and equal calibrated violation rate $\varepsilon$ on held-out disturbances, our tracking RMSE must be lower than the fixed-back-off unfolded baseline by more than the seed-to-seed spread. The same must hold for at least two of three disturbance families.
Why not just…?
Why not just use warm-started OSQP with a few iterations and a tuned constant margin? This is the real threat. Warm-started real-time iteration is cheap, and in smooth regimes the margin it needs may be nearly constant. The proposal changes nothing in the solver itself. Its bet is that the needed margin is strongly non-stationary, and that a constant one tuned to $\varepsilon$ is set by the rare gust or load step. The direct test is the matched-violation RMSE comparison under step gusts and impulses in safe-control-gym. If the gap vanishes on smooth disturbances and appears only on abrupt ones, we will say so and narrow the claim to abrupt-disturbance regimes. If it vanishes everywhere, the idea is wrong.
Why not just raise or lower the observer bandwidth instead of adding a margin? Bandwidth trades lag against noise amplification, a classical observer limitation. No fixed choice removes both lag under fast $\dot f$ and chatter under noise. The co-tuning ablation answers this: it optimizes bandwidth jointly but keeps the margin constant. If co-tuned bandwidth with a constant margin matches the adaptive margin, the innovation signal adds nothing.
Why not just train a policy with domain randomization, as DATT and DiAReL do? Those policies give no constraint guarantee. DiAReL itself found that randomization alone did not close the transfer gap without an explicit disturbance estimate (DiAReL). The safe-control-gym study reports that model-based controllers reach good tracking with roughly a tenth of the data that PPO or SAC need, and with fewer constraint violations (Safe-Control-Gym). We include the learned policy so readers can see what constraint enforcement costs in tracking error, not to argue that it loses on tracking.
Why not just use a worst-case tube? It is sound but sized for the worst disturbance at every step. The robust baseline measures how much tracking that conservatism costs.
Proposed Experiments
Primary benchmark. The 2D quadrotor and cart-pole in safe-control-gym, on circle, lemniscate and square tracking tasks. Position and thrust constraints are active. The suite's disturbance hooks are combined into three families: step gusts, external impulses, and mass or inertia perturbation with white measurement noise. Training and test distributions differ in gust magnitude and timing, so calibration is tested under shift. We found no result on Lacuna for disturbed 2D-quadrotor tracking RMSE under these settings. The cited suite reports GP-MPC data-efficiency and model-error-adaptation results, so all numbers here will be produced by us.
Second domain. A simulated PMSM current loop with current limits as hard constraints, using the 3x inductance change and load steps of the finite-time observer paper. Under that scenario its linear-observer MPC baseline overshot toward 200 A (FTESO-MPC). This tests whether the adaptive margin prevents such overshoot during observer peaking without lowering observer gains.
Metrics and plots. - Tracking RMSE. - Per-step and per-episode constraint violation rate. - Worst-case violation depth. - Measured per-sample wall-clock on an embedded CPU. - Pareto curves of RMSE against violation rate at three fixed compute budgets.
Decisive checks. There are three.
- At matched calibrated $\varepsilon$, does the adaptive margin beat the tuned constant margin on the unfolded solver?
- Does the held-out violation rate stay at or below $\varepsilon$ under gust distributions not seen in calibration?
- Does the ablation show the innovation term, rather than the residual term alone, carrying the gain?
A positive answer to the first two and a clear attribution in the third would support the claim. Failure of the first means the idea should be dropped. Failure of the second means calibration, not the margin form, is the weak point, and the paper becomes a study of when observer innovation stops predicting estimation error.
References
- Friction-Compensation and Extended State Observer Based Model Predictive Control for PMSM Servo Systems
- A Finite-Time Extended State Observer with Prediction Error Compensation for PMSM Control
- Deep Model Predictive Control with Stability Guarantees
- Deep FlexQP: Accelerated Nonlinear Programming via Deep Unfolding
- Joint Communications and Sensing Hybrid Beamforming Design via Deep Unfolding
- DiAReL: Reinforcement Learning With Disturbance Awareness for Robust Sim2Real Policy Transfer in Robot Control
- DATT: Deep Adaptive Trajectory Tracking for Quadrotor Control
- Safe-Control-Gym: A Unified Benchmark Suite for Safe Learning-Based Control and Reinforcement Learning in Robotics