Integral action design

From XuShuwenn/RedAct · View interactive version

Integral action design is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Adding integral action to MPC for offset-free tension tracking.

How to use this skill

Skill file

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

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

Where:

Tuning Guidelines

Integral gain c_I:

Decay factor gamma:

Anti-Windup

Limit integral term to prevent windup during saturation:

u_I = np.clip(u_I, -max_integral, max_integral)

For R2R Systems

Apply integral action per tension section:

for i in range(num_sections):
    u_I[i] = gamma * u_I[i] - c_I * dt * (T[i] - T_ref[i])
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.