UAT 202 Fundamentals of Automation Technology
Worksheet 4 Tuning a temperature controller
Objective
Compare ON/OFF, P and PI control, test windup and choose a controller for the charging cabinet
Equipment and materials
- Python and the module 4 example code
- Temperature-sensor and fan rig via PLC or microcontroller (if available)
Safety
- Mainly simulation
- With a real rig, keep clear of fan blades and heat sources and stay below the lecturer's temperature limit
Steps
- Run Example 1 with hysteresis of ±0.2 and ±1.0 °C; record switching count and band
- Set P gain Kp to 0.6 and 1.2; record steady-state error and explain why it does not vanish
- Remove the line that stops I accumulation; start from a 45 °C cabinet and compare with anti-windup
- With a rig, implement ON/OFF with hysteresis on a real fan and record the graph
- Conclude which controller the charging cabinet should use, with reasons
Record of results
| Hysteresis band (°C) | Oscillation range in the last 20 min (°C) | Fan switches in 1 hour | Notes |
|---|---|---|---|
| Controller and Kp | Steady temperature (°C) | Steady-state error (°C) | Steady fan command u (0–1) |
|---|---|---|---|
| Version | First time at 30 °C (min) | Lowest temperature (°C) | Range in the last 20 min (°C) |
|---|---|---|---|
Questions
From Table 1, how do narrow and wide hysteresis bands trade temperature accuracy against fan wear? Which band suits the charging cabinet?
From Table 2, the steady-state error shrinks as Kp rises but never vanishes. Why, judging by the fan command u that is needed? Why can PI bring it to zero?
From Table 3, explain integral windup using your own numbers: why does the unprotected version overcool and keep oscillating?
Recommend a controller for the charging cabinet with reasons from your results, and name the safety limit needed in addition to the controller.
How does a drone flight controller use the same principle, and why does PX4 limit the I term in its rate loop?
Check before you hand in
What to hand in
- Tables and graphs comparing ON/OFF, P and PI
- Graphs with and without anti-windup
- Controller recommendation for the cabinet