home / skills / benchflow-ai / skillsbench / integral-action-design

This skill adds integral action to MPC for offset-free tension tracking, improving steady-state accuracy and robustness in control systems.

npx playbooks add skill benchflow-ai/skillsbench --skill integral-action-design

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.1 KB
---
name: integral-action-design
description: Adding integral action to MPC for offset-free tension tracking.
---

# Integral Action for Offset-Free Control

## Why Integral Action?

MPC with model mismatch may have steady-state error. Integral action eliminates offset by accumulating error over time.

## Implementation

```python
u_I = gamma * u_I - c_I * dt * (T - T_ref)
u_total = u_mpc + u_I
```

Where:
- u_I: Integral control term
- gamma: Decay factor (0.9-0.99)
- c_I: Integral gain (0.1-0.5 for web systems)
- dt: Timestep

## Tuning Guidelines

**Integral gain c_I**:
- Too low: Slow offset correction
- Too high: Oscillations, instability
- Start with 0.1-0.3

**Decay factor gamma**:
- gamma = 1.0: Pure integral (may wind up)
- gamma < 1.0: Leaky integrator (safer)
- Typical: 0.9-0.99

## Anti-Windup

Limit integral term to prevent windup during saturation:
```python
u_I = np.clip(u_I, -max_integral, max_integral)
```

## For R2R Systems

Apply integral action per tension section:
```python
for i in range(num_sections):
    u_I[i] = gamma * u_I[i] - c_I * dt * (T[i] - T_ref[i])
```

Overview

This skill adds integral action to a model predictive controller to achieve offset-free tension tracking. It augments the MPC output with a leaky integrator that accumulates tension error, reducing steady-state bias while avoiding windup. The skill is tuned for web and roll-to-roll (R2R) tension control applications.

How this skill works

The skill computes an integral control term that updates each timestep as a decayed accumulation of the tension error and combines it with the MPC command. A decay factor yields a leaky integrator for safer behavior; clipping prevents integral windup when actuators saturate. For multi-section systems it maintains one integrator per tension section.

When to use it

  • When MPC exhibits steady-state offset due to model mismatch or disturbances.
  • In web handling, tension control, or roll-to-roll processes requiring accurate setpoint tracking.
  • When actuators have saturation limits that risk integrator windup.
  • When per-section tension control is required for multi-span systems.

Best practices

  • Start with integral gain c_I in the 0.1–0.3 range and adjust based on response.
  • Use a decay factor gamma between 0.9 and 0.99 to create a leaky integrator.
  • Implement anti-windup by clipping the integral term to a max_integral bound.
  • Tune gains incrementally: observe correction speed and oscillation risk before increasing c_I.
  • Apply integrators independently per section for R2R systems to avoid cross-coupling.

Example use cases

  • MPC-controlled web tension where friction or model error causes persistent setpoint error.
  • Roll-to-roll printing where multiple spans require independent tension regulation.
  • Systems with limited actuator range where integrator windup produced long recovery times.
  • Upgrading an existing MPC loop to improve steady-state accuracy without redesigning the model.

FAQ

What are safe starting values for the integrator parameters?

Begin with c_I = 0.1–0.3 and gamma = 0.9–0.99; set max_integral to a value that keeps the integral contribution within actuator capability.

How do I prevent windup during saturation?

Clip the integral term to ±max_integral and consider reducing gamma or c_I if clipping occurs frequently.