TactivergeLite

Lite / Textbooks / Feedback and Control / Chapter 8

8. Tuning, saturation and fair evidence

Version 1 · Technically checked (automated checks only) · 4 source lessons · Full interactive version

Introduction

Real controllers meet real limits. Motors max out, valves open only so far, and while an actuator is saturated the integral keeps accumulating error it cannot act on, then releases it as a big overshoot: windup. Tuning means writing the spec first, adjusting one thing at a time and logging every run. And claiming that one controller is better means a fair comparison: same tests, same loads, a baseline, and every trade-off reported.

Figure 8.1. Saturation lets the integral run away (described in words)

Integrator windup: while the actuator is at its limit for 4 s with an error of 5, the integral climbs to 20. With Ki = 0.5 that is 10 units of stored push that must unwind before the controller recovers.

Explanation

Built from 4 School lessons. Each part is the lesson's own explanation.

8.1 Tuning to a written spec

Two engineers tune the same motor. One takes 10 minutes, one takes an afternoon. Both meet the spec. What did the first one do differently?

A procedure

  1. I and D off. Raise Kp until the response is quick with modest overshoot. 2. Add Kd until overshoot meets the spec. 3. Add Ki until steady-state error is gone within the settling limit. 4. Re-check every line of the spec, because each change affects the others.

A tuning log

One row per test: gains, conditions (set point, load, noise), and every metric in the spec. Change one gain at a time. A log lets a teammate reproduce your result, shows why you stopped, and catches the moment something got worse.

When the spec can't be met

Sometimes no gains meet everything: the actuator can't push hard enough, noise rules out much D, or delay limits the gain. Then the honest result is 'not achievable with this hardware', with the evidence, and a proposal: faster sensor, bigger motor, or a relaxed spec.

Common mix-ups

Open the Lite lesson: Tuning to a written spec

8.2 Hitting the wall: saturation and windup

A robot arm is held still for two seconds, then released. It flies past its target. The controller was perfect in simulation. What did the simulation forget?

Saturation opens the loop

A motor driver can't exceed its supply voltage; a heater can't exceed full power. When the controller asks for more, the actuator delivers its maximum. While saturated, changing the command changes nothing: the loop is effectively open, and the plant just runs flat out.

Windup

The integral doesn't know the actuator is saturated, so it keeps adding error. By the time the output reaches the set point the integral is far too large, and it takes a long period of negative error (overshoot) to unwind it. Bigger Ki and longer saturation mean worse windup.

Anti-windup

Conditional integration: stop integrating while the actuator is saturated and the error would push it further. Back-calculation: bleed the integral back in proportion to the difference between requested and actual command. Clamping: cap the integral. All three keep I useful without the overshoot.

Common mix-ups

Open the Lite lesson: Hitting the wall: saturation and windup

8.3 A fair fight between controllers

A report says 'PID beat PI by 40 %'. Before you believe it, what three questions should you ask?

Decide before you test

Write the specification (metrics, limits, conventions) and the protocol (set point, loads, noise, number of runs, duration) before the first run. Otherwise it is too easy to pick the metric that makes your favourite look good.

Match everything except the controller

Same plant parameters, same actuator limits, same disturbance at the same time, same noise seed or the same set of seeds, same simulation step. P is the natural baseline: it shows how much I and D actually add.

Tune each fairly, too

Comparing a carefully tuned PID with a carelessly tuned PI tests your effort, not the controller. Give each the same tuning method and budget, and report how you tuned. The scoreboard's gains came from one coarse grid search per controller, stated in its note.

Common mix-ups

Open the Lite lesson: A fair fight between controllers

8.4 Writing up the trade-offs

Your PID passes every check. Your teammate's PI is 1 s slower but uses half the peak motor current. Who wins, and how would you write it?

Structure

Question → specification and protocol (written before testing) → results table (every controller, every load, every metric) → explanation → limitations → recommendation. Keep the table complete even where your preferred option loses.

Explain with the models

Link each observation to this term's theory: 'P leaves 29 mm at 600 kg, as e = Δm·g/Kp predicts'; 'PID overshoots less because D raises ζ'; 'PI is slower because, held to the overshoot limit, its ζ forces a low ωn'. A result you can explain is far more convincing than one you can only show.

Trade-offs and honest limits

When no option wins everything, say what each costs: speed, effort, sensitivity to noise, complexity. State the model's simplifications and that results are simulated. Recommend for a stated priority: 'if motor current is the constraint, choose PI'.

Common mix-ups

Open the Lite lesson: Writing up the trade-offs

Worked examples

Tuning to a written spec: example 1

Log excerpt: Kp 2 → OS 0 %, ts 2.1 s; Kp 5 → OS 18 %, ts 1.6 s; Kp 5, Kd 0.2 → OS 6 %, ts 0.9 s; but e∞ = 0.04. Next step?

Solution

Add a small Ki to remove the 4 % error, then re-check OS and ts, since I tends to add overshoot. If OS rises above 10 %, nudge Kd up.

Hitting the wall: saturation and windup: example 1

A heater is at full power for 60 s while the error averages 10 °C, and Ki = 0.05 %/(°C·s). How much has the integral term added to the command?

Solution

Ki·∫e ≈ 0.05 × 10 × 60 = 30 percentage points of extra command that the heater couldn't deliver. That excess must unwind after the target is reached, causing overshoot.

A fair fight between controllers: example 1

Three runs of PI give settling times 2.1, 2.4, 2.7 s; three of PID give 1.9, 2.0, 2.4 s, with different noise seeds per run. Is PID faster?

Solution

Means: PI 2.4 s, PID 2.1 s. The ranges overlap, and with only three runs each the evidence is weak. Use the same three seeds for both (paired comparison) and more runs before claiming a difference.

Writing up the trade-offs: example 1

Rewrite 'PID was way better' as a reportable result.

Solution

'Under the matched protocol (0, 300 and 600 kg; same noise seed), PID met all five checks at every load. PI met four of five, failing the doors-open limit at 600 kg by 1.8 s. P failed levelling at 300 and 600 kg (errors 15 and 29 mm), matching Δm·g/Kp.'

Interactive figures, in words

Figure 8.2 from Hitting the wall: saturation and windup

Choose PI, Kp = 4, Ki = 6, actuator limit ±1.5, anti-windup off. Note the overshoot and settling. Tick anti-windup and compare. Then try limit None: which run is the fair 'ideal' reference?

With a PI controller and an actuator limit of plus or minus 1.5, the effort plot sits on the limit at the start. Without anti-windup, the output overshoots by about 40 % and settles slowly. With anti-windup on, the same gains overshoot by only a few per cent.

Figure 8.3 from A fair fight between controllers

Investigation: with 'Matched' conditions, record which controllers pass and why each failure happens. Then switch to 'Unfair' and record how PID's row changes. Write one sentence on what a reader of the unfair table would wrongly conclude.

The scoreboard table lists overshoot, settling time, final error, peak effort and pass or fail for P, PI and PID on the same plant. Under matched conditions P fails on final error, PI fails on settling time and PID passes. Under the unfair setting, PID is tested with no load or noise and its row looks better for reasons unrelated to the controller.

The interactive versions are in the full chapter.

Laboratory

These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.

Practice

Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.

  1. You've set Kp. Overshoot is 18 % and the spec is 10 %. What next in the procedure?
    Answer it in “Tuning to a written spec”
  2. You can't get settling under 1 s without the motor hitting its current limit. What is the right report?
    Answer it in “Tuning to a written spec”
  3. What causes integrator windup?
    Answer it in “Hitting the wall: saturation and windup”
  4. Which change directly prevents windup?
    Answer it in “Hitting the wall: saturation and windup”
  5. An actuator is saturated for 4 s while the error is constant at 0.5. With Ki = 3, by how much does the integral term Ki·∫e grow?
    Answer it in “Hitting the wall: saturation and windup”
  6. Which is a matched condition for a controller comparison?
    Answer it in “A fair fight between controllers”
  7. Why include a P-only controller in the comparison?
    Answer it in “A fair fight between controllers”
  8. Which is a genuine limitation of a simulation-only controller comparison?
    Answer it in “Writing up the trade-offs”

Engineering applications

Anti-windup in industry

Industrial PID controllers stop integrating while the output is saturated, or bleed the integral back when it is. Without that, a heater that hits full power during start-up overshoots badly once it catches up.

Honest comparisons

A controller tuned on one test can look brilliant and fail on the next. Engineers test every controller on the same set of loads and disturbances, and report where each one loses as well as where it wins.

Watch (optional)

Streaming video uses a lot of data. Everything you need is in the text.

Summary

Glossary

Integrator windup
Windup happens when the actuator is saturated but the integral term keeps growing; once the error reverses, the oversized integral causes a large overshoot while it unwinds. Field Guide
PID controller
A PID controller adds proportional, integral and derivative actions: present error, accumulated past error and predicted future error. Field Guide
Overshoot
Overshoot is how far a response goes past its final value, usually given as a percentage of the step size. Field Guide
Settling time and rise time
Settling time is how long a response takes to enter and stay within a band, often 2 %, of its final value. Rise time is how long it takes to go from 10 % to 90 % of the step. Field Guide
Baselines and control conditions
A baseline is the reference condition a new idea is compared with, such as the existing design or a simple method, tested in the same way. Field Guide

Project: A fair controller shoot-out

Choose a simulated plant with a saturating actuator. Write a spec, tune a PID controller with and without anti-windup, and compare them with a simple P baseline across at least three loads and a setpoint change. Report a full results table and one honest limitation.

Deliverables

Write it up on paper or in your own notes. Lite never stores what you write.

References

← 7. PID controlContents →