A rotary servo lever near a mechanical travel stop, with a compact controller beside it.

What you need

Use a simulated PI controller with an explicit actuator limit and a persistent unattainable target.

Integral growth without anti-windup in the example. 5 steps: 0.25 command units; 10 steps: 0.5 command units; 20 steps: 1 command units.
Integral growth without anti-windup in the example. Original Academy diagram using illustrative values; not a measured hardware result.
Read the diagram as a data table
Values used in the illustration
Condition or componentcommand units
5 steps0.25
10 steps0.5
20 steps1

The calculation

I_(k+1) = I_k + K_i × e_k × Δt
u_raw = K_p × e_k + I_k

I is the integral contribution in actuator-command units. Anti-windup modifies the update when saturation would push the command further into its limit.

Worked example

Illustrative numbers. Replace them with your measured inputs.

For K_i=1 command-unit/(rad·s), error 0.5 rad and 0.1 s steps, the integral grows by 0.05 per step. After 20 steps it reaches 1.0 even if the actuator could never supply the demanded effort.

Try it step by step

  1. Simulate a target beyond the actuator’s capability and observe the integral while the output remains clipped.
  2. Implement a suitable conditional-integration or back-calculation method, with clear behavior for both saturation directions.
  3. Return to a reachable target and compare recovery with and without anti-windup.
  4. Define integral reset or tracking behavior for disabled drives, mode changes and invalid feedback.

How to check the result

A valid design should recover from prolonged saturation without an avoidable large stored-error transient.

Common mistake to avoid

Simply freezing the integral whenever output is saturated can prevent it from unwinding in some cases. The error direction and chosen anti-windup method matter.

Reference reading

Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.

Read our methods, limitations and safety notes.