Model
The job: bring an oven from 20 °C to 180 °C and keep it there. Our only handle is a heater that gives 0 to 2.5 kW. It can heat but never cool. A thermocouple, the sensor, reads the temperature.
We have no equation for the oven, so we measure one. With no controller, we fix the heater at 1 kW and record the temperature for an hour. This open-loop experiment is called a bump test or step test.
Gain K: 1 kW would end 110 °C up, so K = 110 °C/kW. Dead time θ: nothing moves for 1 minute. Time constant τ: 63 % of the rise comes 15 minutes after that. Model: G(s) = 110e^(−s)/(15s + 1).
Tune
Suppose our thermostat just switches: full heat below 178 °C, off above 182 °C. The dead time spoils it. Each switch acts a minute late, so the oven keeps swinging between 167.8 and 189.3 °C.
Ziegler and Nichols turned the bump-test numbers into PID settings: Kp = 1.2τ/(Kθ) = 0.164 kW per °C, Ti = 2θ = 2 min, Td = 0.5θ = 0.5 min. The rule is a known starting point, not a final answer.
Start from cold. The oven reaches 180 °C after 14.1 minutes, then keeps climbing to 262.6 °C at 33.1 minutes. Any cake inside is ruined. The model was right and the rule is standard, so what went wrong?
Real-world fixes
All through the warm-up the PID asked for far more than 2.5 kW, so the heater sat at its limit. The integral kept adding up error anyway. At 180 °C it alone still asks for 86.5 kW. That is integrator windup.
Too hot, the best the heater can do is switch off; it cannot pull heat out. It sits at 0 kW for 10.8 minutes while the oven loses heat through its walls, and is back under 185 °C only at 39.1 minutes.
Same gains, one new line: add to the integral only while the heater is not at a limit. Now the warm-up peaks at 182.1 °C and stays within 1 °C of 180 °C after 17.4 minutes.
At 40 minutes the door opens for one minute and lets out heat, modelled as 2 kW. The oven dips to 165.8 °C. The PID goes to full power and is back within 1 °C 6.1 minutes after opening.
What is happening
# step 1/10 · job # about: Setpoint 180 °C, Oven (plant), Heater 0–2.5 kW setpoint 180 °C oven now 20 °C (room temperature) heater 0 to 2.5 kW, heats only sensor thermocouple inside the oven The design, in order: 1. measure a model of the oven 2. tune a controller from the model 3. fix the problems the real parts add
The oven is a first-order model with a dead time and illustrative numbers: 110 °C per kW, a 15-minute time constant and a 1-minute delay, at 20 °C ambient. Every curve and number in the figure is computed from it. The Python on the steps is plain Python 3. It updates the controller every 0.6 s, delays the heater power by one minute in a list, and moves the oven forward with the exact solution of its equation between updates, just as the figure does.