Skip to content
Tactiverge

School/□ Systems Engineer/Week 18

A fair fight between controllers

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

About 35 min · 3 goals · Checked by automated tests

1.Why should I care?

Engineering decisions are made from comparisons. A comparison where one option got an easier test is worse than none, because it looks like evidence. This lesson builds the habits that make your term project trustworthy.

  • ◇ Write a specification and test protocol before running any comparison.
  • ◇ Compare controllers under matched conditions (same plant, load, noise seed, actuator limits).
  • ◇ Recognise an unfair comparison and explain how it biases the result.

2.Predict

One controller is tested without the load disturbance the others faced. Its results will probably look…

Guess first. Being wrong here is how the surprise works.

3.Understand

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.

Explain it another way

A race where one runner starts ten metres ahead tells you nothing about who's faster.

Worked 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?

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.

Common mix-ups

  • The controller with the best single number is the best controller.
    ✓ Judge against the whole pre-written spec under matched conditions. A controller can win one metric and fail the spec.

4.Discover

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.

Loading the interactive…

Can't use the interactive? Read a description instead

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.

5.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

Which is a matched condition for a controller comparison?

6.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

Why include a P-only controller in the comparison?

Practice 3

Settling times over four matched runs: 1.8, 2.0, 2.2, 2.0 s. What is the mean, in seconds?

s

Practice 4

Why write the specification before running any tests?

Practice 5 · a fresh version every time

A first-order plant with static gain K = 4 is under proportional control with gain Kp = 3. The set point steps to r = 1. What steady-state error r − y∞ remains?

7.Apply it

Write the specification and test protocol for your term project: metrics with conventions, limits, loads (0, 300 and 600 kg), number of runs and how you will tune each controller. Submit it before you run any tests.

8.Reflect

Concepts: Baselines and ablation studies · Evaluation metrics · Comparing conditions with uncertainty · Tuning a PID controller