PID practice

02 / PRACTICAL PROCEDURE

How to compare PID tuning in simulation

Test one hypothesis: will changing Ti reduce residual error without extra overshoot? Run two experiments on one model, restoring the initial state between them.

After reading. You will have a reproducible A/B comparison with test conditions, PV/MV plots and an explanation of the trade-off.

1. Record the baseline conditions

Choose one stand and one controller. Record initial SP/PV, MV limits, model parameters, PID form, time units and Kp/Ti/Td. Fix noise and disturbance conditions: they must match across the two runs.

For example, compare only Ti while keeping Kp and Td fixed. Run A uses the baseline parameters. Run B starts after restoring the same initial conditions. First time here? The first-launch lesson walks through signing in, choosing a demo stand and starting the simulation.

Open a demo stand step by step

How to compare tunings A and BOne baseline stand, state and SP step feed two separate experiments. A uses the baseline Kp, Ti and Td. Restore the initial state before B and change one parameter. Compare both results using PV and MV.One baselinesame stand, state and SP stepRun A · baselineKp, Ti, TdRun B · hypothesischange only TiCompare PV and MVerror, overshoot, time, limits
Two separate runs from the same state. Change one PID parameter between A and B; keep the model, SP step and observation duration identical.

2. Define the step and criteria before running

Example comparison conditions: SP 40 → 60 °C, a 120 s observation and a settling band of 59–61 °C. These are selected teaching conditions, not a recommendation for every stand. Choose suitable values for your model in advance.

Settling time is the point after which PV stays inside the chosen band for the rest of the observation. If PV leaves the band again, the first crossing is not settling. Record “not reached” if the condition is not met.

Measure maximum PV, residual error and time at an MV limit. For a positive step, one normalized overshoot definition is max(0, max(PV) − new SP) / |ΔSP| · 100 %. For example, a 64 °C peak after a 40 → 60 °C step gives 20 %; the formula is undefined for ΔSP = 0.

Reading temperature and power togetherIn the upper plot, dashed SP changes from 40 to 60 °C. Solid PV responds later, overshoots and returns to the target. In the lower plot, dotted MV in percent rises immediately and then decreases. Time axes align, while variable scales are separate.Temperature, °CSP – – PV ━6040SP steptime →Power, %MV · · ·1000time →PV: does it overshoot SP?MV: what effort reaches the target?
Illustrative curves, not a PIDLAB simulation result. Above: SP/PV temperature in °C. Below: MV power in %. Compare the timing of changes, not line heights on different scales.

3. Repeat with one change

Run A and retain its parameters and plots. Restore the initial state. For B, change only Ti and repeat the same SP step for the same observation duration. Reducing a positive Ti strengthens I; also changing Kp would alter several ISA contributions.

Record the same fields for A and B: Kp/Ti/Td, SP step, maximum PV, settling time, residual error and time at an MV limit. If B is faster but produces more overshoot or keeps the output at a limit longer, that is a trade-off.

Find SP, PID parameters and simulation controls

4. Check the output and one disturbance

If MV reaches 100 %, more controller gain cannot produce extra heater power. Check how the loop recovers from saturation and how anti-windup operates. If MV fluctuates strongly with noisy PV, examine D and filtering.

Now apply one identical disturbance to A and B, where the stand supports it. Investigate noise or model-parameter changes in separate experiments. Autotuning and one favourable metric do not replace testing the complete scenario.

Requested output and the MV limitA dashed controller request exceeds 100 %. Dotted actual MV is clamped to 100 % while the request exceeds the limit. Below the limit the lines coincide. This illustrates static output clipping, without an anti-windup model.MV, %– – controller request· · · MV after limiting100MV limit = 100 %time →A request above the limit is unavailable.
Illustrative output clipping, not a test recording. A heater cannot deliver more than 100 % power. Anti-windup affects integral accumulation and recovery; it does not increase the physical MV limit.

5. State a conclusion from the observations

Use this template: “Under [conditions], B changed [metric] from […] to […], at the cost of […]. Under disturbance, […]. I choose […] using criterion […]”. Fill the gaps with your results; if neither tuning is acceptable, say so.

Include SP/PV/MV plots and baseline parameters so the experiment can be repeated. The conclusion applies to the tested model and scenario. Transfer to physical equipment needs separate checks of scaling, action direction, calculation interval, limits and a test plan.

Compare tunings in PIDLAB

Open the first-launch lesson: sign in, choose a demo stand and start the process. Then return to the comparison procedure above.

Open the first-launch lesson

PIDLAB — an engineering laboratory for PID loops. Simulation does not replace validation on the real plant.