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

A PD controller can stabilize spacecraft attitude, but a constant disturbance torque can leave a steady-state pointing bias. Adding integral action can remove that bias, yet it also introduces a new engineering concern: actuator saturation can cause the integrator to accumulate control demand that the hardware cannot realize. This interactive problem connects control theory to real spacecraft actuator limits and shows why anti-windup matters.

Problem Setup

Single-Axis Spacecraft Attitude Holding

Consider a rigid spacecraft rotating about one principal axis. The state contains attitude angle \( \theta \) and angular velocity \( \omega \). The controller commands torque \( \tau_c \), while the spacecraft is also subjected to a constant disturbance torque \( \tau_d \).

$$ \dot{\theta} = \omega $$ $$ J\dot{\omega} = \tau_c + \tau_d $$ $$ \dot{\omega} = \frac{\tau_c + \tau_d}{J} $$

Here \(J\) is the spacecraft moment of inertia about the controlled axis. The disturbance may represent a simplified persistent effect such as solar-radiation-pressure torque, aerodynamic torque, residual magnetic torque, actuator bias, or model mismatch.

Important modelling point: torque does not equal angular acceleration. The spacecraft inertia determines how strongly a given torque changes angular velocity.
PD Limitation

Why PD Can Leave a Steady-State Pointing Error

Define the pointing error as

$$ e = \theta_{target} - \theta $$

A PD controller commands

$$ \tau_c = K_p e - K_d \omega $$

The proportional term produces restoring torque, while the derivative term damps angular motion. Under a constant disturbance, however, a non-zero equilibrium error may be required to generate enough proportional torque to balance the disturbance.

$$ \omega_{ss}=0,\qquad \dot{\omega}_{ss}=0 $$ $$ K_p e_{ss}+\tau_d=0 $$ $$ \boxed{e_{ss}=-\frac{\tau_d}{K_p}} $$
What PD does well

Provides stable, damped attitude regulation with simple implementation and no integrator state.

What PD cannot guarantee

Zero steady-state pointing error in the presence of a persistent constant disturbance.

Integral Action

How Integral Action Removes the Bias

A PID-like spacecraft attitude law augments the controller with accumulated error:

$$ \tau_c = K_p e + K_i I - K_d\omega $$ $$ \dot I = e $$

In discrete time,

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

The integral state stores past error. Under a constant disturbance, it can build the exact control torque needed to cancel the disturbance while allowing the instantaneous pointing error to return toward zero.

$$ e_{ss}=0,\qquad \omega_{ss}=0 $$ $$ K_i I_{ss}+\tau_d=0 $$ $$ \boxed{I_{ss}=-\frac{\tau_d}{K_i}} $$
Engineering interpretation: PD requires present error to create the balancing torque. PID can use stored error history to create that balancing torque even after the present error becomes small.
Where PID Breaks

Integrator Windup Under Actuator Saturation

Real actuators cannot supply unlimited torque. Reaction wheels, control-moment gyros, thrusters, magnetic torquers, and other actuators all have finite authority.

$$ |\tau_{applied}| \le \tau_{max} $$

The controller may request a torque \( \tau_{cmd} \) larger than the actuator can deliver. Saturation clips the applied torque:

$$ \tau_{applied} = \mathrm{sat}\!\left(\tau_{cmd},-\tau_{max},+\tau_{max}\right) $$

If the integrator continues accumulating error while the actuator is saturated, the internal control demand can grow far beyond the realizable hardware output. This is integrator windup.

Integral action adds memory — actuator saturation can turn that memory into windup.

The result can be larger overshoot, longer settling time, sluggish recovery after leaving saturation, and unnecessarily large internal torque demand.

Reality Check

Anti-Windup and Real System Constraints

The simplest educational anti-windup strategy is conditional integration. Instead of always updating the integral state, integration is paused when saturation is active and the current error would drive the actuator still farther into saturation.

$$ \dot I = \begin{cases} e, & \text{unsaturated} \\ e, & \text{saturated but error drives the command back toward the linear region} \\ 0, & \text{saturated and error drives farther into saturation} \end{cases} $$

This is more useful than simply freezing the integrator whenever saturation occurs, because it still allows the stored integral state to unwind when the error is helping the controller return toward the allowable actuator region.

const pushingFurtherIntoPositiveSaturation =
    rawTorque > tauMax && error > 0;

const pushingFurtherIntoNegativeSaturation =
    rawTorque < -tauMax && error < 0;

const blockIntegration =
    pushingFurtherIntoPositiveSaturation ||
    pushingFurtherIntoNegativeSaturation;

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

More advanced implementations may use back-calculation, tracking anti-windup, integrator clamping, or actuator-aware dynamic compensation.

Interactive Demo

Compare PD, PID, and PID with Anti-Windup

Adjust the spacecraft inertia, target attitude (entered in degrees), controller gains, disturbance torque, and actuator torque limit. The plots update automatically. Compare the selected controller with the other two architectures using exactly the same physical conditions.

Choose controller mode:
10
10°
5
0.8
4
0.10
0.3
50

Selected Controller — Performance Metrics

Compare All Three Controllers

The next plots run PD, PID without anti-windup, and PID with anti-windup under identical spacecraft inertia, disturbance, gain, target, and actuator constraints.

Controller Comparison Metrics

Controller Final error (rad) Overshoot (%) Settling time (s) Max |τcmd| (N·m) Saturation time (s) Max |I|
Engineering Analysis

How to Read the Plots

Attitude & error

Check overshoot, settling time, steady-state error, and whether the target is actually reached.

Commanded vs applied torque

The gap between them reveals actuator saturation and lost control authority.

P / I / D contributions

Shows which controller term dominates the torque demand and when the I-term is building.

Saturation ratio

\(|\tau_{cmd}|/\tau_{max}>1\) means the controller is requesting more torque than the actuator can provide.

Integral state

Rapid growth during saturation is a direct indicator of windup risk.

Phase portrait

A well-behaved closed-loop trajectory should converge toward \(e=0,\omega=0\).

Do not judge a controller from one curve alone. A response can appear acceptable in attitude while still demanding unrealistic actuator torque or accumulating an excessive hidden integral state.
Takeaway

What This Problem Shows

PD

Simple and damped, but a constant disturbance can require a non-zero steady-state pointing error.

PID

Integral action can remove steady-state bias, but unrestricted integration can create windup during saturation.

Anti-Windup

Accounts for actuator saturation and limits excessive integral accumulation while preserving integral action.

More control does not automatically mean better control.

The deeper engineering lesson is:

Integral action can reject persistent bias, but actuator authority determines whether that benefit is physically realizable.