63  Control Systems Decision Guidance

In 60 Seconds

Choose open-loop control for simple, predictable processes (e.g., timed irrigation); closed-loop for variable conditions requiring accuracy (e.g., HVAC within +/-0.5 degrees C). Use PID for continuous analog control but NOT for discrete on/off decisions or systems with >2 second transport delay (use Smith predictor instead). For distributed IoT, implement local PID loops at edge devices with cloud-based setpoint optimization – never route real-time control through the cloud.

63.1 Learning Objectives

By the end of this chapter, you will be able to:

  • Select between open-loop, closed-loop, and hybrid control architectures based on application requirements
  • Configure appropriate P, I, D terms for a given IoT application scenario
  • Architect local versus cloud control placement for distributed IoT deployments
  • Apply structured decision matrices to justify control system design choices
  • Identify scenarios where PID control is inappropriate and simpler strategies are preferred

63.2 Prerequisites

Required Chapters:

Estimated Time: 30 minutes

The Problem: Control system design involves many trade-offs—cost vs. performance, speed vs. stability, simplicity vs. capability. Without structured decision-making, engineers often: - Over-engineer simple problems - Under-engineer critical systems - Choose cloud control when local is safer - Add unnecessary complexity

The Solution: Decision matrices and frameworks help you systematically evaluate options and make defensible engineering choices.

How to use this chapter:

  1. Start with the decision you need to make
  2. Find the relevant decision matrix
  3. Map your requirements to the matrix
  4. Follow the recommended approach

Key Concepts

  • Decision Framework: A structured set of criteria and decision rules guiding selection among process control strategies (on/off, P, PI, PID, cascade, feed-forward) based on process characteristics and performance requirements
  • Stability Criterion: A requirement that the closed-loop control system returns to equilibrium after disturbances — used to define acceptable gain ranges and filter requirements during control strategy selection
  • Performance Specification: Quantitative targets (settling time <10s, overshoot <5%, steady-state error <1%) that guide control strategy selection and tuning parameter optimization
  • Process Identification: The experimental or analytical procedure characterizing a process’s dynamic response (gain, time constant, dead time) from step tests or frequency sweeps — prerequisite to rational control design
  • Control Architecture Selection: Choosing between single-loop PID, cascade control, ratio control, model predictive control, and other strategies based on process complexity, interaction, and performance requirements
  • Tuning Method Selection: Choosing between heuristic (Ziegler-Nichols), model-based (Lambda tuning, IMC), and automatic tuning methods based on the process type, required performance, and available tools

Common Pitfalls

Applying PID to processes that fundamentally require different control strategies — batch reactors needing model predictive control, highly interactive multi-variable processes needing decoupling, or pure delay-dominant processes needing Smith predictor compensation.

Selecting linear PID without considering operating range nonlinearity. A control valve with installed characteristic varies gain by 10:1 across the operating range. Linear PID tuned at one point will be severely detuned or unstable at other operating points.

Selecting a complex model predictive control strategy without considering that operators must understand and override it during abnormal situations. Operators who don’t understand the control strategy disable automatic control and revert to manual, eliminating all benefits.

Implementing a new control strategy without measuring baseline performance (variance, settling time, oscillation period) of the existing strategy. Without a baseline, claimed improvements cannot be verified quantitatively.

63.3 Summary of Control Concepts

This section synthesizes the foundational concepts of processes, systems, and feedback control essential for IoT architecture design.

Key Takeaways:

  1. Process vs System
    • Process: Algorithm/steps that transform inputs to outputs
    • System: Complete set of interconnected components working together
    • IoT devices decompose into hierarchical subsystems
  2. Feedback Mechanisms
    • Feedback enables self-regulation and adaptation
    • Can be local (device-level) or distributed (system-level)
    • Essential for autonomous IoT operation
  3. Open-Loop Control
    • No feedback from output to input
    • Simpler, cheaper, lower power
    • Cannot self-correct errors or adapt to disturbances
    • Suitable for predictable environments or pure sensing
  4. Closed-Loop Control
    • Continuous feedback enables self-correction
    • Maintains desired output despite disturbances
    • More complex but provides stability and accuracy
    • Recommended for most IoT control applications
  5. PID Control
    • Industry-standard control algorithm
    • P (Proportional): Reacts to current error magnitude
    • I (Integral): Eliminates steady-state error, handles disturbances
    • D (Derivative): Reduces overshoot, provides damping
    • PI most commonly used in practice
  6. Design Trade-offs
    • Simple vs. robust
    • Fast response vs. stability
    • Cost vs. performance
    • Local vs. distributed feedback

Understanding these control principles is critical for designing reliable, autonomous IoT systems that can maintain desired behaviors in real-world environments.

63.4 Practical Decision Guidance

When designing IoT control systems, use these decision frameworks:

63.4.1 1. Open-Loop vs. Closed-Loop Decision Matrix

Use Open-Loop When Use Closed-Loop When
Environment highly predictable Disturbances expected
Accuracy not critical (±20%) Precision required (±2%)
Battery life paramount Reliability paramount
No safety implications Life-safety critical
Cost <$50 per unit Value >$500 per failure

Example: Outdoor lighting timer (predictable) vs. aquarium temperature (fish die if wrong).

63.4.2 2. PID Term Selection Guide

Control Mode When to Use Typical Applications
P-only Fast response needed, steady-state error acceptable LED dimming, non-critical positioning
PI Zero steady-state error required, moderate dynamics HVAC, industrial process control, most IoT
PID High inertia + overshoot intolerable Ovens, motor control, precision robotics
PD Fast response + damping, manual reset acceptable Rare—used in velocity control only

Rule of thumb: Start with PI (Kp=1.0, Ki=0.1). Add D only if overshoot >10%.

Interactive PID Output Calculator:

63.4.3 3. Distributed Control Architecture Decision

Requirement Local Control Cloud Control Hybrid
Latency <100ms >1s acceptable <100ms local, analytics in cloud
Reliability Must work offline Cloud dependency OK Autonomous + telemetry
Cost $50-500/device $10-100/device $100-300/device
Use Cases Industrial safety, medical Home comfort, monitoring Smart buildings, agriculture

Critical insight: For life-safety (fish farms, medical, industrial), always close the loop locally. Use cloud for dashboards/analytics, not primary control.

63.4.4 4. Real-World PID Tuning Quick Start

Step 1: Set Ki=0, Kd=0. Increase Kp until system oscillates. Use Kp = 0.5 × oscillation threshold.

Step 2: Add Ki = 0.1 × Kp. If steady-state error persists, double Ki. If overshoots badly, halve Ki.

Step 3: Only add Kd if overshoot >10%. Start with Kd = 0.1 × Kp. If system becomes sluggish, remove D.

Typical values for temperature control:

  • Kp: 2-5 (fast water heaters) to 10-20 (slow ovens)
  • Ki: 0.1-0.5 (eliminates offset in 30-120 seconds)
  • Kd: 0.5-2.0 (only if overshoot problem, e.g., industrial ovens)

Tuning a greenhouse heater (setpoint 24°C, starting temp 18°C):

Step 1 (P-only): Set K_i=0, K_d=0. Test K_p values: - K_p=5 → Stable at 22.8°C (1.2°C error, too weak) - K_p=15 → Oscillates ±2°C (too aggressive) - Choose K_p = 0.5(15) = 7.5 (half the oscillation threshold)

Step 2 (Add I): Set K_i = 0.1(7.5) = 0.75. Test: - Temp reaches 24.0°C but overshoots to 25.3°C (1.3°C overshoot = 5.4% of error) - Overshoot <10% → acceptable, no D-term needed - If overshoot was >10%, would halve K_i to 0.375

Final tuning: K_p=7.5, K_i=0.75, K_d=0 → Settles at 24.0±0.2°C in 12 minutes with 5% overshoot. For industrial oven requiring <2% overshoot, would add K_d = 0.1(7.5) = 0.75.

63.4.5 5. When NOT to Use PID

  • Event-driven systems: Motion detection, door sensors (use simple thresholds)
  • On/off actuators: Can’t modulate relay/solenoid (use hysteresis control instead)
  • High noise: Sensor readings vary ±10% (D term amplifies noise—use PI only)
  • Very slow processes: 1+ hour response time (use model predictive control instead)

Remember: 80% of IoT control problems solve with simple PI control (Kp=2, Ki=0.1) and local feedback. Don’t over-engineer.

63.5 Python Implementation Reference

63.5.1 PID Controller for IoT Systems

Key Features:

  1. Complete PID Implementation: Proportional, Integral, and Derivative terms
  2. Anti-Windup: Prevents integral term saturation
  3. Derivative Filtering: Reduces high-frequency noise
  4. Plant Simulation: First-order system with time delay
  5. Performance Metrics: Steady-state error, overshoot, rise time

Example Output:

=== PID Controller Simulation ===

--- P-only (Kp=2) ---
Steady-State Error: 16.67
Overshoot: 0.0%
Final Output: 33.33

--- PI (Kp=2, Ki=0.5) ---
Steady-State Error: 0.42
Overshoot: 12.3%
Final Output: 49.58

--- PID (Kp=2, Ki=0.5, Kd=0.1) ---
Steady-State Error: 0.38
Overshoot: 8.1%
Final Output: 49.62

=== IoT Temperature Control ===

Time(s)  Temp(°C)  Heater(%)
------------------------------
   0.0    18.00      83.4
  10.0    20.15      67.2
  20.0    21.52      42.1
  30.0    21.89      28.3
  60.0    22.01      21.7

Performance:
  Steady-State Error: 0.15°C
  Overshoot: 2.3%

63.6 Production Framework: IoT Control Systems

⏱️ ~20 min | ⭐⭐⭐ Advanced | 📋 P04.C24.U01

This section provides a comprehensive, production-ready Python framework for IoT control systems, implementing PID controllers, open-loop and closed-loop architectures, system simulation, and auto-tuning capabilities.

This production framework provides comprehensive IoT control system capabilities including:

  • PID Controller: Full PID implementation with anti-windup, output limiting, and configurable modes (P, PI, PD, PID)
  • Plant Models: First-order, thermal, and motor dynamics with realistic physics
  • System Simulation: Closed-loop and open-loop simulation with disturbance injection
  • Auto-Tuning: Ziegler-Nichols and Cohen-Coon tuning methods
  • Performance Analysis: 7 metrics including rise time, settling time, overshoot, and integral errors

The framework demonstrates production-ready patterns for IoT control systems with realistic plant models, comprehensive performance analysis, and auto-tuning capabilities.

63.7 Knowledge Check

63.8 Further Reading

Control Theory Fundamentals:

  • Ogata, K. (2010). Modern Control Engineering. Prentice Hall.
  • Åström, K. J., & Murray, R. M. (2021). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.

PID Tuning Methods:

  • Ziegler-Nichols tuning method
  • Cohen-Coon method
  • Software auto-tuning algorithms

IoT-Specific Resources:

  • ESP32 PID library: Arduino PID Library
  • Industrial IoT control systems
  • Edge computing for distributed control

Online Simulators:

63.9 References

  1. Perera, C., et al. (2014). “Context Aware Computing for The Internet of Things: A Survey.” IEEE Communications Surveys & Tutorials.

  2. Franklin, G. F., Powell, J. D., & Emami-Naeini, A. (2019). Feedback Control of Dynamic Systems. Pearson.

  3. Ang, K. H., Chong, G., & Li, Y. (2005). “PID control system analysis, design, and technology.” IEEE Transactions on Control Systems Technology.

  4. IoT Architecture Working Group. (2016). “IoT Reference Architecture.” IoT-A Project Deliverable.


Chapter Summary

This chapter established the fundamental concepts of processes and systems that underpin IoT device behavior and control mechanisms.

System Fundamentals: We defined systems as collections of interacting components with defined boundaries, inputs, and outputs. Understanding system boundaries helps architects determine what should be monitored, controlled, and optimized within IoT deployments. Every IoT device can be viewed as a system transforming sensor inputs into data outputs or actuator controls.

Feedback and Control: The chapter distinguished between open-loop and closed-loop control systems. Open-loop systems execute predetermined actions without measuring results, while closed-loop systems use feedback to continuously adjust behavior. Most effective IoT systems employ closed-loop control - thermostats maintaining temperature setpoints, industrial controllers regulating processes, and adaptive algorithms optimizing performance based on measured outcomes.

Process Optimization: We explored how processes transform inputs into valuable outputs through series of steps. In IoT contexts, processes include data collection workflows, communication protocols, power management strategies, and decision-making algorithms. Understanding process dynamics helps engineers optimize system responsiveness, energy efficiency, and reliability.

These systems and process concepts provide the analytical framework for understanding how IoT devices behave, respond to stimuli, and maintain desired operational states. This foundation prepares you for examining more complex multi-device network architectures.

63.11 Worked Example: Control System Selection for a Commercial Aquaponics Farm

Scenario: An aquaponics farm in Bristol grows lettuce and tilapia fish in a combined system. Water from the fish tanks is pumped to grow beds where plants filter nutrients, then returns clean to the fish. Three parameters must be controlled:

  1. Water temperature (fish survival: 22-28C, optimal: 25C)
  2. pH level (fish: 6.5-8.0, plants: 5.5-6.5, compromise: 6.8)
  3. Dissolved oxygen (fish die below 5 mg/L, optimal: 7-8 mg/L)

Control Strategy Analysis:

Parameter Disturbance Rate Safety Impact Precision Needed Recommended Control
Temperature Slow (ambient temp changes over hours) Moderate (fish stress at extremes) +/- 1C PI control
pH Medium (feeding events change pH in 15-30 min) Low (wide safe range) +/- 0.3 pH On-off with deadband
Dissolved oxygen Fast (can drop below lethal in 15 min) Critical (fish death) Must stay >5 mg/L PID + safety interlock

Detailed Analysis – Dissolved Oxygen (Life-Safety):

  • Why PID, not on-off? On-off aeration creates dissolved oxygen swings of 4-9 mg/L. The low point (4 mg/L) is below the 5 mg/L lethal threshold, risking fish kills. PID maintains steady 7.5 mg/L with +/- 0.3 variation.
  • Why local PID, not cloud? Internet outage = no control commands = fish die within 15 minutes. The PID loop runs on an ESP32 at the fish tank (edge control).
  • Safety interlock: If dissolved oxygen drops below 5.5 mg/L despite PID output, a hardware relay forces the aerator to 100% – independent of software.

Cost Comparison:

Control Approach Hardware Cost Annual Fish Loss Net Annual Cost
No automation (manual) GBP 0 GBP 4,200 (15% mortality) GBP 4,200
On-off (simple relay) GBP 85 GBP 1,800 (6% mortality from swings) GBP 1,885
PI control (heater + pH pump) GBP 340 GBP 600 (2% baseline mortality) GBP 940
PID + interlock (all 3 params) GBP 520 GBP 280 (1% baseline mortality) GBP 800

Decision: PID + safety interlock costs GBP 520 in hardware but saves GBP 3,400/year in fish mortality. The GBP 520 investment pays back in 56 days.

Decision Table: Control Type Selection by Parameter:

Factor Open-Loop On-Off PI PID
Disturbance frequency Rare/none Slow (hours) Medium (minutes) Fast (seconds)
Precision requirement Low (+/- 10%) Medium (+/- 5%) High (+/- 1%) Very high (+/- 0.1%)
Safety criticality None Low Medium Life-safety
Actuator wear concern N/A High (frequent cycling) Low Lowest
Example (aquaponics) Lighting timer pH dosing pump Water heater Dissolved oxygen aerator
Typical IoT hardware cost GBP 5 (timer) GBP 20 (relay) GBP 80 (PWM + sensor) GBP 120 (PID + interlock)

Making the RIGHT decision is just as important as knowing HOW things work!

63.11.1 The Sensor Squad Adventure: The Big Decision

The Sensor Squad was called to help a local farm. Farmer Rose had a problem: her plants were not getting the right amount of water!

“I water the garden every morning at 7 AM for exactly 20 minutes,” said Farmer Rose. “But sometimes the plants are drowning, and sometimes they’re too dry!”

Sammy the Sensor scratched his head. “That’s because you’re using OPEN-LOOP control! You water the same amount no matter what.”

“What does that mean?” asked Farmer Rose.

Max the Microcontroller drew a picture in the dirt: “Right now, your system goes like this: TIMER rings at 7 AM, SPRINKLER turns on for 20 minutes, DONE. You never CHECK if the soil actually needs water!”

Lila the LED lit up bright green with an idea. “What if we ADD Sammy to your garden? He can measure how wet the soil is! Then Max can decide: if the soil is dry, water it. If it’s already wet from rain, skip it!”

Bella the Battery raised her hand. “But wait – I only have so much energy. Do we REALLY need to check the soil every single second?”

Max thought carefully. “Good point, Bella! We don’t need to check every second. Soil dries out slowly – checking every 30 minutes is plenty. That saves YOUR energy AND still keeps the plants happy!”

The Squad installed the new system. The next morning it rained, and when 7 AM came… the sprinklers stayed OFF! Farmer Rose was amazed.

“You just saved 500 gallons of water!” cheered Sammy. “And your plants are healthier because they’re getting JUST the right amount!”

63.11.2 Key Lessons for Kids

Decision Open-Loop (Simple) Closed-Loop (Smart)
Watering Same time, same amount every day Checks soil moisture first
Room heating Heater runs for 2 hours Thermostat checks temperature
Night light Turns on at 7 PM every night Light sensor detects darkness

63.11.3 Try This at Home!

The Decision Game: Think of three things in your house. For each one, decide: is it open-loop or closed-loop?

  1. A toaster (hint: does it check if the bread is done?)
  2. A refrigerator (hint: does it check the temperature inside?)
  3. A washing machine timer (hint: does it check if clothes are clean?)

Answers: Toaster = open-loop (just uses a timer). Refrigerator = closed-loop (checks temperature, turns compressor on/off). Washing machine timer = open-loop (runs for set time regardless of how dirty clothes are).

63.12 What’s Next

If you want to… Read this
Study PID control fundamentals PID Control Fundamentals
Learn about PID tuning methods PID Tuning and Applications
Practice with the PID simulation lab PID Simulation Lab
Review processes fundamentals Processes and Systems Fundamentals
Study the process control overview Processes and Systems Overview