# Feasibility-Preserving Error Compensator

- ID: 2907
- Canonical URL: https://synthcore.org/idea/2907/feasibility-preserving-error-compensator
- API JSON: https://synthcore.org/api/idea/2907.json
- API Markdown: https://synthcore.org/api/idea/2907.md
- Verification status: queued_mechanism
- Source: [arXiv:2608.30825](https://arxiv.org/abs/2608.30825)
- Category: dynamics
- Solves: accuracy, stability
- ML areas: rl, training-dynamics, world-model
- Math tags: control-theory, dynamical-systems, linear-algebra, optimization
- Ratings: usefulness 7/10; difficulty 5/10; novelty 5/10

## Idea description

Add a low-dimensional feedback correction to the neural reference so that accumulated position mismatch is removed when actuator saturation or kinematic mismatch causes the shaped trajectory to lag the requested one. Unlike ordinary integral action, the correction is passed through the same feasibility-preserving reference shaper, preventing integral windup while ensuring that compensation cannot violate current, voltage, speed, or acceleration limits.

## Mathematical statement

Let $e_t=y^{\mathrm{des}}_t-y_t$ be the position or task-space error, $c_t$ the compensator state, and $z_t$ the neural reference. Use an accumulated-error update $c_{t+1}=\rho c_t+K_Ie_t$, where $0\leq\rho\leq1$ is leakage and $K_I$ is an integral gain matrix. Form the compensated command $\tilde z_t=z_t+K_Cc_t+K_Pe_t$, then apply the constrained shaping map $r_t=\mathcal{S}(x_t,\tilde z_t)$. To prevent windup, integrate the shaping residual $d_t=r_t-\tilde z_t$ through an anti-windup gain $K_A$: $c_{t+1}=\rho c_t+K_Ie_t+K_A d_t$. For local linear error dynamics $e_{t+1}=Ae_t-BK_Cc_t+\delta_t$, a sufficient unsaturated design target is that the augmented closed-loop matrix have spectral radius below one. Saturation changes the attainable equilibrium but cannot violate hard constraints because $r_t$ is always shaped.

## Key formulas

- $$c_{t+1}=\rho c_t+K_I e_t+K_A\bigl(r_t-\tilde z_t\bigr),\qquad \tilde z_t=z_t+K_Pe_t+K_Cc_t,$$
- $$r_t=\mathcal{S}(x_t,\tilde z_t)=\arg\min_r\frac{1}{2}(r-\tilde z_t)^\top W(r-\tilde z_t)\quad\mathrm{s.t.}\quad g_j(r,x_t)\leq0,$$
- $$\rho_{\mathrm{spec}}\!\left(\begin{bmatrix}A&-BK_C\\K_I C&\rho I\end{bmatrix}\right)<1,$$

## Implementation notes

1. Integration point: use this module at inference time in a servoing policy, learned trajectory generator, or world-model controller. The NN predicts nominal reference $z_t$; the compensator uses measured output $y_t$ and desired output $y_t^{\mathrm{des}}$ before the finite-candidate shaper. Keep $c_t$ separate from the NN hidden state so it can be reset between episodes. 2. Pseudocode: initialize $c=0$; at each control tick compute $e=y_{\mathrm{des}}-y$, $\tilde z=z+K_Pe+K_Cc$; call the candidate shaper to obtain $r$; compute $d=r-\tilde z$; update $c\leftarrow\rho c+K_Ie+K_A d$; send $r$ to the low-level controller. Clip $c$ only as a numerical safeguard. 3. Computed versus estimated: $e$, $d$, and shaped references are directly computed; local matrices $A$, $B$, and $C$ are estimated by finite differences or system identification. Tune gains from the linearized model, reducing $K_I$ until the predicted augmented spectral radius is below 0.9. 4. First cheap experiment: use a small MLP to command a simulated servo tracking square-wave and sinusoidal references under tight voltage and current limits. Compare no compensation, ordinary integral action before saturation, and this residual anti-windup method. Measure RMS position error, recovery time, maximum constraint violation, and compensator norm. The prediction is zero feasibility violations with reduced post-saturation error; in unsaturated tests, measured error decay should follow the dominant eigenvalue of the augmented matrix within 20%. Ordinary integral action should show larger windup and delayed recovery when saturation persists.

## Verification

- Status: queued_mechanism
- Mechanism evidence: no
- Mechanism confirmed: no

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
