Open Lab investigation · OL-06
Is It Really Better?
Use noisy simulated runs of a feedback controller to discover how many repeats you need before claiming one setting beats another.
About 2 h · advanced · 6 steps · Uses Lab 02 · Free
This is a learning investigation, not peer-reviewed research. Unexpected results are welcome: what matters is a clear hypothesis, honest data and careful interpretation.
The question
Research question
When sensor noise is present, how many repeated runs are needed before you can confidently say that one controller setting settles faster than another, and how does the answer depend on how big the difference is?
Why it matters
Engineers and scientists constantly compare two versions of something: two controllers, two grippers, two algorithms. With one run each, the "better" one might just have been lucky. With too many runs, you waste time. Knowing how much results vary, and planning enough repeats, is one of the most important habits in experimental work, and one of the most often skipped.
The feedback explorer is a good place to practise, because its sensor noise is generated from a seed. You can run the same experiment many times with different noise, exactly as if you had repeated a physical test, but in seconds and with nothing to break.
This is a learning exercise, not peer-reviewed research. Unexpected results are welcome: a prediction that turns out wrong, honestly reported, is a good outcome.
You will learn to
- Plan a comparison with a decision rule set before collecting data.
- Measure variability between repeated trials and use it to judge whether a difference is real.
- Explain how the size of a difference affects how many trials are needed.
- Recognise cherry-picking and how pre-planning protects against it.
Limits
- C1Use the feedback explorer with a fixed plant, fixed setpoint and fixed noise level throughout; record them.
- C2Compare two pairs of settings: one pair you expect to differ a lot, and one you expect to differ a little.
- C3Use the same list of seeds for every setting, and at least 8 seeds per setting.
- C4Write your decision rule before collecting data, and report every run.
- C5Any example numbers in your write-up other than your own runs must be labelled as made up.
Background
The system
The feedback explorer simulates a plant (by default a first-order system, like the speed of a fan responding to its input) under P, PI or PID control. It reports rise time, overshoot, 2% settling time and steady-state error for a step change in setpoint. You can add Gaussian sensor noise: the controller sees the noisy measurement, and the derivative term in particular reacts to it. A button regenerates the noise with a new seed.
Why one run is not enough
With noise, each seed gives slightly different metrics. Suppose, as a made-up illustration, that setting X settles in 2.1 s and setting Y in 2.3 s on one seed each. Is X better? Not necessarily: if settling time varies by ±0.3 s between seeds, a 0.2 s difference could easily reverse on the next pair of runs.
Describing variation
For each setting, run several seeds and calculate the mean and the standard deviation of the metric. The standard error of the mean, s / √n, tells you roughly how precisely you know the mean from n runs. If two means differ by much more than their combined standard errors, the difference is probably real. If not, you cannot tell yet.
As a made-up illustration: five runs with settling times 2.0, 2.2, 2.1, 2.4 and 2.3 s have mean 2.2 s. The deviations are −0.2, 0, −0.1, 0.2 and 0.1, whose squares sum to 0.1. Dividing by n − 1 = 4 gives 0.025, so s = √0.025 ≈ 0.16 s, and the standard error is 0.16 / √5 ≈ 0.07 s.
Decision rules and pre-registration
Before collecting data, write down exactly what you will compare, how many runs you will do, and what result you will count as "X is better". This is called a decision rule. Writing it first stops you from, consciously or not, running more seeds until you get the answer you hoped for, or quietly dropping the runs that disagree. Those habits are called cherry-picking, and they are a common way honest people fool themselves.
Big and small differences
A large difference between settings shows up clearly in a few runs. A small one needs many more. You will test this by comparing a pair of settings that differ a lot and a pair that differ a little.
Lab 02 · Feedback control
Explorer 02 — Feedback control
Measure, compare, correct
- Setpoint r = 1
- Closed-loop output
- Open loop (u = r/K)
- ±2 % band
Gains
Applies the command the model says is right, u = r / K, without ever measuring.
More controls
Plant
Like motor speed or an oven: τ·ẏ = −y + K·u. K = 1.
Real-world effects
Noise only affects the closed loop: the derivative term amplifies it.
- Rise 10–90 %
- 0.72 s
- Overshoot
- 0.0 %
- Settling 2 %
- 1.30 s
- Steady-state err
- 0.333
- theory r/(1+Kp·K) = 0.333
State
P control, Kp 2.0 on a first-order plant with τ 1.0 s. Rise time 0.72 s, overshoot 0.0 %, 2 % settling 1.30 s, steady-state error 0.333 (theory for P: 0.333). Peak control effort 2.00. Open loop: steady-state error 0.000.
P control, Kp 2.0 on a first-order plant with τ 1.0 s. Rise time 0.72 s, overshoot 0.0 %, 2 % settling 1.30 s, steady-state error 0.333 (theory for P: 0.333). Peak control effort 2.00. Open loop: steady-state error 0.000.
How to read this
The top panel shows the setpoint (dashed line at 1) and the plant's true output after a step command at t = 0. The solid line is the controlled system; the dotted line is open loop. The bottom panel shows the control effort u the actuator is asked to deliver.
Rise time is how long the output takes to go from 10 % to 90 % of where it ends up. Overshoot is how far it passes that value. Settling time is when it stays inside ±2 % for good. Steady-state error is the gap left at the end: P control always leaves one on these plants; integral action removes it.
Assumptions & limitations
- Linear plant models with known, constant parameters (K = 1). Real motors and heaters have friction, dead zones and parameters that drift with temperature and wear.
- Controller runs every 10 ms and holds its output between samples; the plant is integrated with 4th-order Runge–Kutta at the same step. There is no transport delay, which real systems almost always have.
- The derivative acts on the measurement (not the error) through a 50 ms low-pass filter, a common practical choice that avoids a spike when the setpoint jumps.
- Sensor noise is white Gaussian and seeded for repeatability; it is added only to the measurement, never to the true output.
- Metrics are computed on the true output up to the disturbance time (or 10 s); a response still moving at the end of the window is reported as not settled.
- Open loop uses the exact plant gain to pick its command. That flatters it: any modelling error would show up as steady-state error.
How to approach it
- 01
Explore the noise
Open the feedback explorer. Add a small sensor noise, around σ = 0.02, and pick a PI controller. Regenerate the noise several times and watch how the settling time readout changes. Get a feel for how much it varies. Do not record data yet.
- 02
Choose your pairs and hypothesis
Choose two pairs of controller settings: one you expect to differ a lot in settling time, and one you expect to differ only a little. Write your hypothesis: for each pair, which will settle faster, and roughly how many seeds you think you will need before the difference is clear.
- 03
Write the decision rule
Write your method and decision rule now. For example: "Use seeds 1 to 10 for every setting. Call X faster than Y if its mean settling time is lower by more than twice the larger standard error." Your rule can be different, but it must be fixed before data.
- 04
Collect data
For each of the four settings and each seed, record the settling time, plus overshoot for context. Note any runs that do not settle within the window, and handle them as your rule says.
- 05
Analyse and interpret
Calculate the mean, standard deviation and standard error for each setting. Apply your decision rule to both pairs. Then look at how your conclusion would have changed with only the first 2, 4 or 6 seeds. Did the large-difference pair become clear sooner?
- 06
Limitations
Discuss what the simulation's noise does not capture, such as wear, temperature or a different plant each day. How would the number of repeats you need change in a physical experiment?
Your work
Everything above is free to read and use. To save drafts, submit versions and get feedback, sign in.
You can also work on paper: the prompts below are what a submission asks for.
- Hypothesis (written before you collect any data)
- Method
- Data and observations
- Interpretation
- Limitations
How it's judged
There is more than one good answer. This rubric describes what strong work looks like.
Question and hypothesis
- Beginning
- No clear hypothesis, or it was clearly written after seeing the data.
- Developing
- A hypothesis is stated before data but is vague, so almost any result would fit it.
- Proficient
- A specific, falsifiable hypothesis with a reason behind it, written before data collection.
- Exemplary
- As Proficient, plus a stated prediction of how big the effect should be and what result would count against it.
Method and control of variables
- Beginning
- The method is missing or too vague to repeat.
- Developing
- The changed variable is clear, but other variables drift between runs or repeats are missing.
- Proficient
- One variable is changed at a time, others are held fixed and listed, with repeats and a decision rule set in advance.
- Exemplary
- As Proficient, plus a pilot run that led to a documented change of method, and a check that the measurement itself is reliable.
Data quality and honesty
- Beginning
- Data are missing, unitless or only summarised, with no raw values.
- Developing
- Raw data are present but inconvenient runs are silently dropped or units are inconsistent.
- Proficient
- All runs are reported with units, including failed or surprising ones, with a note on each exclusion.
- Exemplary
- As Proficient, plus variability between repeats is quantified (for example a range or standard deviation) and used in the interpretation.
Interpretation and limitations
- Beginning
- Claims go beyond the data or ignore the hypothesis.
- Developing
- The result is described but not connected to the hypothesis, or limitations are generic.
- Proficient
- The conclusion follows from specific numbers, and the most important limitation is named with its likely effect.
- Exemplary
- As Proficient, plus alternative explanations are considered and the student says exactly what further test would distinguish them.
Reflect
- Would you have reached a different conclusion with only one run of each setting? How often?
- Was it hard to stick to your decision rule? What tempted you to change it?
- How will this change the way you read claims that one design is better than another?
Go further
Turn on the load disturbance and add a third metric of your own, such as how far the output dips after the disturbance. Repeat the study for that metric and discuss whether one setting can be better on one metric and worse on another.
Resources
- Tuning a PID controller systematically
- Repeatability, trials and sample size
- Pre-registration and decision rules
- Comparing two conditions
- P-hacking and cherry-picking
- Feedback control explorer
- AtlasVariables, controls and confounders
- AtlasRepeated trials and sample size
- AtlasBaselines and ablation studies
- AtlasExperimental design and test protocols
- AtlasComparing conditions with uncertainty