When PD Is Not Enough: Bias, Integral Action, and Windup

A PD controller can stabilize spacecraft attitude in an ideal simulation. But if a constant disturbance torque is present, the spacecraft may settle with a small steady-state pointing error. This problem continues from PD control and shows how adding integral action introduces new engineering risks such as actuator saturation and windup.

Problem Setup

Attitude Holding Under Constant Disturbance

The spacecraft is commanded to hold a target attitude. The model includes attitude angle \( \theta \), angular velocity \( \omega \), control torque \( \tau \), and a small constant disturbance torque.

$$ \dot{\theta} = \omega $$ $$ \dot{\omega} = \tau + \tau_d $$

The disturbance torque may represent simplified environmental effects such as solar pressure, atmospheric drag torque, magnetic effects, or small modelling bias.

PD Limitation

Why PD Can Leave a Steady-State Error

A PD controller uses attitude error and angular velocity:

$$ \tau = K_p(\theta_{target} - \theta) - K_d\omega $$

The proportional term pulls the spacecraft toward the target. The derivative term damps motion. But under a constant disturbance torque, PD may settle at a non-zero attitude error because the proportional term must generate a balancing torque.

$$ K_p e_{ss} + \tau_d = 0 $$

This means the spacecraft can look stable, but still not point exactly where required.

Integral Action

Adding Integral Action

PID adds an accumulated error term:

$$ \tau = K_p e + K_i \int e\,dt - K_d\omega $$

The integral term keeps accumulating error until it produces enough torque to cancel the disturbance. This is why PID can remove steady-state error.

$$ I_{k+1} = I_k + e_k \Delta t $$

But integral action has a serious weakness: it can keep growing even when the actuator is already saturated.

Where PID Breaks

Integrator Windup

Real actuators cannot provide unlimited torque:

$$ |\tau| \leq \tau_{max} $$

If the controller asks for more torque than the actuator can deliver, the output is clipped. However, the integral term may continue accumulating error. This is called windup.

Windup can cause overshoot, slow recovery, oscillation, and poor pointing response even though PID was added to improve the controller.

Integral action solves bias, but it can create a new failure mode.
Why It Happens

Why Integral Action Changes System Behaviour

The integral term accumulates past error over time. This allows the controller to generate a torque that cancels constant disturbances.

However, the integral term does not respond to actuator limits. When the actuator saturates, the applied torque stops increasing, but the integral term may continue to grow.

Integral action adds memory — but without limits, that memory becomes unstable.

This is why PID can outperform PD in ideal conditions, but fail in realistic systems unless actuator constraints are explicitly handled.

Interactive Demo

Compare PD, PID, and PID with Anti-Windup

Select a controller mode and adjust the gains. The simulation includes a constant disturbance torque and actuator saturation. Watch how attitude error, torque, and the integral term behave.

Choose controller mode:









Compare Controllers

This overlay runs PD, PID, and PID with anti-windup using the same gains and disturbance. It helps show how the three controllers behave differently under the same physical limits.

Reality Check

Anti-Windup and Real System Constraints

Anti-windup prevents the integral term from growing uncontrollably when the actuator is saturated. A simple approach is conditional integration.

Only integrate error when the actuator is not saturated.

This is not the only anti-windup method, but it demonstrates the engineering idea clearly: the controller must know that the actuator has physical limits.

if (!isSaturated) {
  integralError += error * dt;
}

The important lesson is that PID is not automatically better than PD. It is better only when the integral term is handled carefully.

Takeaway

What This Problem Shows

PD

Stable and damped, but may leave steady-state error under constant disturbance.

PID

Can remove steady-state error, but may suffer from integrator windup.

Anti-Windup

Respects actuator limits and prevents the integral term from growing unrealistically.

More control does not always mean better control.

The engineering lesson is:

Integral action solves bias, but actuator limits decide whether PID behaves safely.