54  Processes and Systems

In 60 Seconds

Every IoT device executes a process (algorithm) within a system (hardware + software). Open-loop control executes fixed actions without feedback (simple but inaccurate); closed-loop control uses sensor feedback to self-correct (accurate but complex). PID controllers combine proportional (reacts to current error), integral (eliminates steady-state offset), and derivative (dampens oscillation) terms to achieve stable, precise control.

54.1 Learning Objectives

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

  • Define processes and systems in the context of IoT device architectures
  • Distinguish between open-loop and closed-loop control systems and explain their trade-offs
  • Explain feedback mechanisms and their role in achieving system stability
  • Describe PID (Proportional-Integral-Derivative) control and when each term is needed
  • Apply block diagram decomposition to model IoT systems hierarchically
  • Evaluate which control strategy suits a given IoT application scenario
Minimum Viable Understanding
  • Processes transform inputs into outputs – every IoT device executes a process (the algorithm) within a system (the hardware and software working together). Understanding this distinction is the first step to designing any IoT solution.
  • Feedback loops are what make IoT devices “smart” – without feedback, a device blindly executes instructions; with feedback, it measures its own output, compares it to a target, and self-corrects. This is the foundation of every thermostat, cruise control, and precision agriculture system.
  • PID control is the industry workhorse – combining proportional (react to current error), integral (eliminate accumulated error), and derivative (anticipate future error) actions, PID handles the vast majority of real-world control problems from HVAC to robotics.

Every electronic device you use – from a smart thermostat to a self-driving car – works by following a simple pattern: take in information, do something with it, and produce a result.

Process = The “recipe” or set of steps a device follows. Think of it like a cooking recipe: take ingredients (inputs), follow steps (process), get a meal (output).

System = All the physical parts working together. The kitchen itself – oven, pots, utensils, ingredients, and the cook – is the system.

In IoT terms:

Concept Everyday Example IoT Example
Input You feel cold Temperature sensor reads 16 degrees C
Process You decide to turn up the heat Microcontroller compares 16 degrees C to target 22 degrees C
Output You adjust the thermostat dial Controller sends signal to turn on heater
Feedback You check if you feel warmer Sensor measures temperature again

Two types of control:

  1. Open-loop (no feedback): A toaster runs for a set time – it does not check if the bread is actually toasted
  2. Closed-loop (with feedback): A thermostat continuously checks the temperature and adjusts the heater

Why this matters: Understanding processes and systems lets you design IoT devices that actually work reliably in the real world, not just in theory.

The Sensor Squad was visiting a smart greenhouse, and everything was going wrong!

“The tomatoes are wilting!” cried Sammy the Temperature Sensor. “It’s 40 degrees in here – way too hot! The cooling fans aren’t working properly.”

Max the Microcontroller examined the problem. “I see the issue. The fans are running on a simple timer – they turn on for 10 minutes every hour, no matter what the temperature is. That’s an OPEN-LOOP system. It doesn’t check what’s actually happening!”

“That’s like watering plants with your eyes closed!” said Lila the LED, blinking in alarm.

Bella the Battery had an idea. “What if Sammy keeps watching the temperature, and Max adjusts the fans based on what Sammy sees? When it’s too hot, speed up the fans. When it’s just right, slow them down!”

“That’s called a CLOSED-LOOP system!” Max explained excitedly. “And I know an even better trick called PID control!”

The Squad got to work:

  • Sammy (the sensor) measured the temperature: “It’s 40 degrees C – we need 25 degrees C!”
  • Max (the controller) calculated: “That’s 15 degrees too hot! Let me use my three super-powers…”
    • P-power (Proportional): “15 degrees off? Fans at HIGH speed!”
    • I-power (Integral): “We’ve been too hot for 20 minutes? Push fans even harder!”
    • D-power (Derivative): “Temperature is dropping fast now – ease off the fans so we don’t overshoot!”
  • Lila (the indicator) showed green when the temperature was perfect.
  • Bella (the battery) made sure everything had enough power.

Within 10 minutes, the greenhouse was a perfect 25 degrees C, and the tomatoes were happy!

Key Words for Kids:

Word What It Means
Process A recipe that a machine follows – like steps for making a sandwich
System All the parts working together – the sandwich maker, bread, fillings, and plate
Open-Loop Doing something without checking the result – like setting a timer and walking away
Closed-Loop Checking the result and adjusting – like tasting soup while cooking
PID Three super-powers: react to NOW (P), remember the PAST (I), predict the FUTURE (D)

54.2 Chapter Overview

This chapter covers the foundational concepts of processes and systems in IoT architectures – from basic input-process-output models through feedback mechanisms to advanced PID control. The material is organized into four focused sections for progressive learning.

54.2.1 How Processes and Systems Relate in IoT

Concept map showing how IoT processes and systems relate: a System contains Processes that transform Inputs to Outputs. Systems can be Open-Loop (no feedback) or Closed-Loop (with feedback). Closed-Loop systems use Controllers including On-Off, P, PI, and PID types, with increasing sophistication and precision.


54.3 Chapter Navigation

This chapter has been split into focused sections for better learning:

54.3.1 Part 1: Overview

Topics: What is a Process and System, Block Diagrams, IoT System Decomposition Time: ~15 min | Level: Foundational

Learn the fundamental concepts of processes and systems in IoT architectures. Understand how electronic systems transform inputs into outputs through controlled processes using block diagram representations.

Key Topics:

  • Process vs System definitions
  • Block diagram representation
  • Coffee pot system example
  • Hierarchical system decomposition
  • Design considerations

54.3.2 Part 2: Feedback Mechanisms

Topics: Feedback Loops, Electronic Feedback Systems, Smart Home Examples Time: ~20 min | Level: Intermediate

Explore how feedback mechanisms enable systems to self-regulate and maintain desired behaviors. See real-world examples including smart home heating and automatic clothes dryers.

Key Topics:

  • Feedback fundamentals
  • Negative vs positive feedback
  • Electronic feedback systems
  • Smart home heating system
  • Automatic clothes dryer example

54.3.3 Part 3: Open vs Closed Loop Control

Topics: Control System Types, Trade-offs, Water Quality Monitoring Time: ~12 min | Level: Intermediate

Compare open-loop and closed-loop control systems, understanding their advantages, limitations, and appropriate use cases in IoT applications.

Key Topics:

  • Open-loop systems (characteristics, advantages, limitations)
  • Closed-loop systems (characteristics, advantages, limitations)
  • Trade-off comparisons
  • Water quality monitoring example

54.3.4 Part 4: PID Control

Topics: PID Theory, Tuning, Hands-On Labs, Implementation Time: ~45 min | Level: Advanced

Master Proportional-Integral-Derivative (PID) control theory and implementation. Learn about P-only limitations, integral windup, derivative action, and practical tuning techniques.

Key Topics:

  • PID fundamentals (P, I, D terms)
  • Home temperature control example
  • P-only control and steady-state error
  • Integral windup problem
  • Derivative action and noise sensitivity
  • Hands-on PID simulation lab
  • Python implementation
  • Production frameworks

54.4 Control System Architecture at a Glance

The following diagram shows the generic closed-loop control architecture that underlies all IoT feedback systems covered in this chapter:

Block diagram of a generic closed-loop IoT control system showing the signal flow from setpoint through error calculation, controller (with P, I, D paths), actuator, physical plant process, and sensor feedback path back to the error calculator, with disturbance inputs affecting the plant.

54.4.1 Open-Loop vs Closed-Loop Comparison

Side-by-side comparison of open-loop and closed-loop control systems. Open-loop shows a linear flow from input through controller and actuator to plant output with no feedback. Closed-loop adds a sensor feedback path from output back to error calculator, enabling self-correction.

54.4.2 PID Controller Term Contributions

Diagram showing how the three PID terms contribute to the control output. The Proportional term reacts to current error magnitude, the Integral term accumulates past error to eliminate steady-state offset, and the Derivative term responds to rate of change to dampen overshoot. All three sum to produce the final control signal.


54.5 Learning Path Recommendation

Beginners: Start with Overview then Feedback Mechanisms

Intermediate: All sections in sequence

Advanced: Jump to PID Control for in-depth control theory


54.6 Worked Example: Smart Greenhouse Temperature Control

This worked example ties together all four parts of the chapter – processes, systems, feedback, and PID control – in a single realistic IoT scenario.

Scenario: You are designing a smart greenhouse that must maintain an internal temperature of 25 degrees C (+/- 1 degree) for optimal tomato growth. The greenhouse has electric heaters, ventilation fans, and temperature sensors connected to an ESP32 microcontroller.

Step 1: Identify the System (Part 1 – Overview)

Component Role Details
Temperature sensor (DHT22) Input Measures greenhouse air temperature
ESP32 microcontroller Controller Runs control algorithm
Electric heater (2 kW) Actuator (heating) Warms the greenhouse
Ventilation fan Actuator (cooling) Expels hot air
Setpoint Reference 25 degrees C target

Step 2: Choose Control Strategy (Part 3 – Control Types)

Approach Pros Cons Verdict
Open-loop (timer) Simple, cheap Cannot adapt to weather changes Not suitable
On/Off closed-loop Simple feedback Temperature oscillates +/- 3 degrees C Too imprecise
PI closed-loop Eliminates steady-state error Slight overshoot possible Good choice
Full PID Minimizes overshoot Derivative amplifies sensor noise Best if sensor is filtered

Decision: Use PI control (Kp + Ki), since DHT22 sensor noise makes the derivative term unreliable without additional filtering.

Step 3: Design the Feedback Loop (Part 2 – Feedback)

  1. Sensor reads current temperature: PV = 18 degrees C
  2. Error calculator: e = SP - PV = 25 - 18 = +7 degrees C (too cold)
  3. PI controller computes: u(t) = Kp * e(t) + Ki * integral of e(t)
  4. Controller activates heater at proportional power level
  5. As temperature rises, error decreases, heater power reduces
  6. Integral term ensures zero steady-state error (no permanent offset)

Step 4: Tune the Controller (Part 4 – PID)

Using conservative tuning for a thermal system (slow dynamics):

  • Kp = 10: For each 1 degree C error, apply 10% heater power
  • Ki = 0.5: Accumulate 0.5% additional power per second of error
  • Sample period = 5 seconds: Thermal systems change slowly

Expected Response:

  • At t=0: Heater at 70% power (Kp * 7 degrees C error)
  • At t=60s: Temperature reaches 22 degrees C, heater at 30% + integral contribution
  • At t=120s: Temperature reaches 24.5 degrees C, heater at 5% + integral holding
  • At t=180s: Temperature stable at 25.0 degrees C (+/- 0.3 degrees C)

Key Design Decision: The integral term eliminates the 1-2 degrees C steady-state error that P-only control would leave. Without Ki, the greenhouse would stabilize at approximately 23 degrees C instead of 25 degrees C.

Try the P-Only Controller Yourself:


Common Pitfalls in Process and Control System Design

1. Using open-loop control where feedback is essential. A timed irrigation system wastes 40-60% more water than a soil-moisture-based closed-loop system. If your output depends on unpredictable environmental conditions, you need feedback.

2. Setting PID gains too aggressively. High proportional gain (Kp) causes oscillation. High integral gain (Ki) causes windup and overshoot. High derivative gain (Kd) amplifies sensor noise. Start conservative and increase gradually.

3. Ignoring sensor noise in the derivative term. The D term computes the rate of change of the error signal. Noisy sensors produce wildly fluctuating derivatives that make the actuator chatter. Always apply a low-pass filter to the sensor signal before computing the derivative, or simply use PI control.

4. Forgetting integral windup protection. When an actuator saturates (e.g., heater at 100%), the integral term continues accumulating error. When the setpoint is finally reached, the bloated integral causes massive overshoot. Implement anti-windup by clamping the integral when the actuator is saturated.

5. Sampling too slowly for the process dynamics. The Nyquist criterion applies to control loops too. If your process can change significantly in 1 second, sampling every 10 seconds will miss critical dynamics and cause instability. Rule of thumb: sample at least 10 times faster than the fastest disturbance you need to reject.


54.7 Knowledge Check

Test your understanding of the key concepts covered across all four parts of this chapter.


54.8 Enhanced Summary

54.8.1 Key Concepts Covered

Concept Definition IoT Relevance
Process A sequence of steps transforming inputs to outputs The algorithm running on the microcontroller
System Interconnected components working as a whole Sensors + MCU + actuators + communication
Open-Loop Control without output measurement Simple, cheap, but cannot adapt
Closed-Loop Control with sensor feedback Self-correcting, essential for precision
Feedback Loop Output measurement fed back to input Foundation of all smart IoT devices
PID Control Three-term controller (P + I + D) Industry standard for precision control

Step 1: Determine if Feedback Control is Needed

Question If YES → Feedback Required If NO → Open-Loop Acceptable
Does output depend on unpredictable disturbances? Wind affects drone → Feedback required Coffee timer (predictable heating)
Must output precisely match a target value? 78°F ± 0.5°F aquarium → Feedback required Notification LED (approximate OK)
Are consequences of control errors severe? Medical pump dosing → Feedback critical Decorative fountain (cosmetic)
Does environment change over time? Battery drains (output varies) → Feedback compensates Wired device (stable power)

Step 2: Choose Control Type

Control Type When to Use Pros Cons Cost IoT Example
Open-Loop Predictable process, no critical accuracy needs Simple ($5), reliable Cannot adapt to disturbances $5-15 Timed irrigation, LED blink
On-Off (Bang-Bang) Acceptable to oscillate ± 10% around target Simple ($15), low tuning effort Temperature swings ± 2-5°C $15-30 Basic thermostat, level control
P-Only Error tolerance 5-10%, fast response Simple ($20), 1 parameter Always has steady-state error $20-35 Fan speed, LED dimming
PI Zero steady-state error required, moderate speed Eliminates offset ($30), robust Slower than PID, tuning effort $30-60 HVAC, aquarium heater, pressure
PID Precision ± 1%, minimal overshoot, fast settling Optimal performance ($50+) Complex tuning, noise sensitive $50-100 Drone, 3D printer, CNC, robotics

Step 3: Evaluate Process Characteristics

Process Time Constant Example Application Recommended Control Loop Frequency
Very fast (<100 ms) Motor position, power converter PID (edge-only) 10-100 Hz
Fast (100 ms - 10 sec) Liquid flow, small heater PI or PID 1-10 Hz
Medium (10 sec - 5 min) Room temperature, pressure PI (most common) 0.1-1 Hz (6-60 sec)
Slow (5+ min) Greenhouse, large tank PI or On-Off 0.01-0.1 Hz (10-100 sec)

Step 4: Assess Sensor Quality

Sensor Noise Level Recommended Control Rationale
Low (<1% of range) PID OK Clean signal supports derivative term
Moderate (1-5%) PI preferred D-term amplifies noise; filter or skip D
High (>5%) On-Off or P-only Feedback unstable; keep it simple

Example 1: Smart Refrigerator

  • Process: Cooling with 10-minute time constant
  • Target: 4°C ± 1°C (food safety)
  • Disturbances: Door openings, ambient temperature
  • Sensor: DS18B20 (± 0.5°C accuracy = low noise)
  • Decision: PI control (Kp = 8, Ki = 0.2, 30-second loop)
  • Result: Maintains 4.0°C ± 0.3°C, eliminates steady-state error from P-only

Example 2: Smart Fan (Room Comfort)

  • Process: Fan speed control
  • Target: 60% speed (comfortable airflow)
  • Disturbances: None significant
  • Precision: ± 10% acceptable (subjective comfort)
  • Decision: P-only control (Kp = 2.0) or even open-loop (60% fixed)
  • Result: Simple, cheap, sufficient for comfort applications

Example 3: Quadcopter Altitude Hold

  • Process: Drone altitude with 200 ms time constant
  • Target: 10.0 m ± 0.2 m (collision avoidance)
  • Disturbances: Wind gusts, battery voltage drop
  • Sensor: Barometer + ultrasonic (clean, 100 Hz update rate)
  • Decision: Full PID (Kp = 12, Ki = 0.5, Kd = 3.0, 10 ms loop)
  • Result: Holds 10.0 m ± 0.1 m in 5 mph wind, 300 ms settling time

Common Mistake Decision Tree:

├─ "I need precise control" → Does NOT automatically mean PID
│   ├─ Check sensor noise first
│   ├─ Check process time constant
│   └─ Try PI before PID (simpler, more robust)
│
├─ "PID is the best control" → NOT always true
│   ├─ 80% of applications work fine with PI
│   ├─ D-term only needed when overshoot is critical + sensor clean
│   └─ On-Off works for many comfort/safety applications
│
└─ "Cloud control is fine for all processes" → DANGEROUS assumption
    ├─ Fast processes (<1 sec) require edge control
    ├─ Cloud adds 100-500 ms latency
    └─ Use cloud for setpoint optimization, not real-time loops

ROI Comparison (smart greenhouse heating):

Control Type Hardware Cost Tuning Effort Temperature Stability Energy Use Total Annual Cost
Open-Loop (timer) $10 0 hours ± 5°C swings 3,500 kWh ($420) $430 (but kills plants)
On-Off $25 1 hour ± 2°C oscillation 2,800 kWh ($336) $361
PI $45 3 hours ± 0.5°C stable 2,200 kWh ($264) $309
PID $80 8 hours ± 0.3°C stable 2,100 kWh ($252) $332 (marginal improvement over PI)

Verdict for greenhouse: PI control ($45 + 3 hours tuning) is the sweet spot – saves $57/year vs On-Off, achieves ± 0.5°C stability (sufficient for plants), and avoids the complexity of full PID.

54.8.2 Control Strategy Selection Guide

Decision tree for selecting an IoT control strategy: Start with 'Does output need to match a target?' If no, use open-loop. If yes, ask 'Is precision critical?' If no, use On-Off control. If yes, ask 'Is sensor data noisy?' If yes, use PI control. If no, use full PID control.

54.8.3 What You Should Remember

  1. Every IoT device is a system executing a process that transforms sensor inputs into actuator outputs
  2. Feedback is the key differentiator between simple and smart devices – it enables self-correction
  3. Closed-loop control always requires a sensor in the feedback path
  4. P-only control always has steady-state error – you need the integral term to eliminate it
  5. PI control handles 80%+ of real IoT applications – full PID is only needed for fast, noise-free systems
  6. Start with conservative tuning and increase gains gradually – aggressive tuning causes oscillation and instability

54.9 Prerequisites

Before diving into this chapter, you should be familiar with:

54.11 What’s Next

If you want to… Read this
Start with processes and systems overview Processes and Systems Overview
Study feedback mechanisms Feedback Mechanisms
Learn about control types Control Types and Cascade
Explore PID control implementation Processes and Systems: PID Control
Go to the core PID fundamentals series Processes and Systems Fundamentals