70  PID: Open & Closed Loop

In 60 Seconds

Open-loop systems execute fixed commands without feedback (cheap but inaccurate); closed-loop systems measure output and self-correct (accurate but require sensors). For IoT, use open-loop for non-critical tasks (LED patterns) and closed-loop for anything requiring precision – temperature control, motor positioning, or flow regulation.

70.1 Learning Objectives

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

  • Contrast Control Types: Compare open-loop and closed-loop control strategies with specific examples
  • Evaluate System Characteristics: Assess advantages and disadvantages of each approach for a given scenario
  • Apply Decision Frameworks: Select appropriate control architecture using systematic criteria and cost analysis
  • Architect IoT Control Systems: Design edge-vs-cloud control placement based on latency and reliability requirements
MVU: Minimum Viable Understanding

Core concept: Open-loop systems execute predetermined actions blindly (like a timer), while closed-loop systems continuously monitor output and adjust (like a thermostat). Why it matters: Closed-loop systems can self-correct errors and adapt to disturbances, but require sensors and more complexity. Key takeaway: Most IoT control applications benefit from closed-loop feedback, but simple monitoring-only devices may operate open-loop at the device level while the overall system implements feedback through cloud coordination.

Process control in IoT is about automatically adjusting systems to maintain desired conditions. Think of cruise control in a car: it continuously measures your speed, compares it to your target, and adjusts the throttle to keep you on track. IoT systems use similar feedback loops to control everything from room temperature to industrial manufacturing processes.

70.2 Prerequisites

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

70.3 Closed-Loop Feedback Systems

Closed-loop feedback system block diagram showing continuous control cycle with setpoint input, comparator computing error signal, controller processing error to determine corrective action, plant producing output, and feedback sensor measuring output for continuous self-regulation
Figure 70.1: Closed-loop feedback system diagram showing the continuous cycle of sensing, comparing to setpoint, and adjusting output to maintain desired state

In a closed-loop system, a portion of the output is fed back to the input and either added to (positive feedback) or subtracted from (negative feedback) the input signal. This creates a self-regulating system that continuously updates based on current output conditions.

Block diagram of closed-loop feedback system showing setpoint input flowing to comparator, error signal to controller, plant producing output, sensor measuring output and feeding back to comparator to compute new error, illustrating continuous self-correction cycle

Closed-loop feedback block diagram
Figure 70.2: Block diagram of closed-loop feedback system showing setpoint input, comparator computing error signal (setpoint minus measured), controller processing error, process/plant producing output, and feedback sensor creating continuous regulation loop.

Closed-Loop Feedback System Block Diagram: Set point is compared with measured output, generating error signal. Controller processes error and adjusts system input. Feedback sensor creates continuous regulation loop.

Key Components:

  1. Set Point (SP): The desired target value
  2. Error Signal: Difference between set point and measured output
  3. Controller: Processes error and determines corrective action
  4. Process/Plant: The system being controlled
  5. Feedback Sensor: Measures actual output
  6. Comparator: Computes error = SP - measured value
Smart home heating system closed-loop example
Figure 70.3: Smart home heating system as a closed-loop feedback example, showing thermostat sensor, controller, heater actuator, and room temperature feedback
Smart home heating closed-loop control diagram with thermostat, controller, heater, and temperature feedback path
Figure 70.4: Smart Home Heating Control Loop with Temperature Feedback

Smart Home Heating Control Loop: Thermostat compares target (22C) with measured temperature (21C), calculates error (+1C), activates heater, and continuously monitors room temperature to maintain setpoint.

Operation:

  1. User sets desired temperature: 22C
  2. Temperature sensor measures actual temperature: 21C
  3. Error = 22C - 21C = +1C
  4. Controller activates heating system
  5. Room temperature rises toward 22C
  6. As error decreases, heating output adjusts
  7. System maintains temperature within tolerance

70.4 Open-Loop Control Systems

Open-loop control system block diagram showing controller and process operating without feedback, where system executes predetermined actions based solely on input signals without sensing or measuring the actual output state
Figure 70.5: Open-loop control system diagram showing controller and process without feedback - system operates based on predetermined inputs without sensing output

An open-loop system does not monitor or measure its output. It executes a predetermined action based solely on the input, without feedback. This is also called a non-feedback system.

Open-loop system block diagram showing timer input, controller, and process output with no feedback path
Figure 70.6: Open-loop system block diagram with timer-based control without feedback

Open-Loop System Block Diagram: Input (timer setting) determines controller action without measuring output state. System executes predetermined sequence with no knowledge of actual results.

Characteristics:

  • No feedback path from output to input
  • Cannot self-correct for disturbances or errors
  • Simpler and less expensive to implement
  • Suitable when output is predictable and disturbances are minimal
Automatic clothes dryer open-loop example
Figure 70.7: Automatic clothes dryer as an open-loop system example - timer-based operation without moisture sensing feedback
Clothes dryer open-loop control diagram showing timer-based operation without moisture sensing feedback
Figure 70.8: Open-Loop System: Clothes Dryer Timer-Based Operation Without Feedback

Clothes Dryer Open-Loop Operation: Timer runs for preset duration without measuring moisture content. Clothes may be over-dried (energy waste, fabric damage) or under-dried (ineffective) with no adaptive adjustment.

Operation:

  1. User sets timer for 60 minutes
  2. Dryer runs heating element and drum for 60 minutes
  3. Timer expires, dryer stops
  4. No measurement of whether clothes are actually dry

Problem: Clothes might be over-dried (wasted energy, fabric damage) or under-dried (ineffective), but the system has no way to know or adjust.

Modern IoT Enhancement: Adding a humidity sensor creates a closed-loop system that stops when clothes are dry, regardless of time elapsed.

70.5 Open-Loop in IoT Sensing Applications

Open-loop architectures are increasingly common in IoT data collection scenarios where:

  • Device only senses and transmits data
  • No local actuation required
  • Analysis and decision-making occur remotely
  • Feedback loop exists at system level, but not device level
IoT sensor node open-loop architecture showing periodic data collection and transmission to cloud without local actuation
Figure 70.9: IoT sensor node open-loop data collection to cloud platform

IoT Sensor Node Open-Loop Data Collection: Device only senses and transmits data periodically without local actuation. No device-level feedback loop, but human operators or cloud systems may take action based on reported data.

However, at the system level, there may be feedback:

System-level closed-loop IoT irrigation with cloud coordinating open-loop sensor and actuator nodes via rules
Figure 70.10: System-level closed-loop irrigation with cloud-based rule coordination

System-Level Closed-Loop with Device-Level Open-Loop: Individual sensor and actuator nodes operate open-loop (no local feedback), but cloud platform creates system-level feedback by coordinating remote sensing and actuation based on rules.

This architecture demonstrates that while individual devices operate open-loop, the overall IoT system implements closed-loop control through cloud-based coordination.

70.6 Comparing Open and Closed Loop Systems

Understanding the trade-offs between open-loop and closed-loop systems is crucial for IoT system design.

70.6.1 Advantages and Disadvantages

Open-Loop Systems

Advantages:

  • Simple design and implementation
  • Lower cost (no feedback sensors needed)
  • Faster response (no feedback processing delay)
  • No stability issues or oscillations
  • Lower power consumption

Disadvantages:

  • Cannot self-correct errors - critical limitation
  • No knowledge of output condition
  • Sensitive to disturbances and variations
  • Cannot adapt to changing conditions
  • Accuracy depends entirely on calibration
  • Output may drift over time

Best Used When:

  • Output is highly predictable
  • Disturbances are minimal or absent
  • Cost is primary constraint
  • Simple data collection (sensing only)
  • Speed is critical and accuracy is not
Closed-Loop Systems

Advantages:

  • Automatic error correction - key benefit
  • Maintains desired output despite disturbances
  • Reduced sensitivity to component variations
  • Can use inexpensive, less accurate components
  • Adapts to changing conditions
  • Improved accuracy and stability

Disadvantages:

  • More complex design
  • Higher cost (feedback sensors and processing)
  • Potential stability problems if poorly designed
  • Can oscillate around set point
  • Higher power consumption
  • Slower response due to feedback processing

Best Used When:

  • Precision control required
  • Environment is unpredictable
  • Disturbances are likely
  • Safety is critical
  • Long-term stability needed
  • Self-regulation is valuable

70.6.2 Decision Matrix

Decision tree for choosing open-loop vs closed-loop control based on precision, predictability, disturbances, cost, and safety
Figure 70.11: Decision tree for selecting open-loop vs closed-loop control architecture

Open-Loop vs Closed-Loop Decision Tree: Precision requirements, environmental predictability, disturbances, cost constraints, and safety considerations determine appropriate control architecture.

This variant presents a decision framework for architects choosing between control approaches based on system requirements.

Control architecture decision matrix showing three columns for open-loop, edge closed-loop, and cloud closed-loop control, with rows for latency requirements, cost constraints, failure modes, power consumption, and best use cases, helping architects select appropriate control strategy
Figure 70.12: Alternative view: This decision matrix helps IoT architects select appropriate control architecture based on system constraints.

70.7 Practical Example: Water Quality Monitoring

Example: Water Quality Monitoring with Feedback

Consider an IoT water quality monitoring system for an aquarium:

Open-Loop Approach (Inadequate):

  • Oxygen sensor detects low O2 level
  • Data sent to cloud
  • No local action taken
  • Fish may die before human intervention

Closed-Loop Approach (Recommended):

Aquarium dissolved oxygen closed-loop control with sensor measuring O2, controller comparing to setpoint, and aerator pump adjustment
Figure 70.13: Aquarium dissolved oxygen closed-loop control with aerator pump adjustment

Aquarium O2 Control Closed-Loop System: Local microcontroller continuously monitors dissolved oxygen, compares to setpoint (7 mg/L), and adjusts aerator pump speed to maintain safe levels.

Operation:

  1. Set point: O2 = 7 mg/L
  2. Sensor measures: O2 = 6.2 mg/L
  3. Error: +0.8 mg/L (need more oxygen)
  4. Controller increases aerator pump speed
  5. O2 level rises toward target
  6. Controller reduces pump speed as error decreases
  7. System maintains stable O2 level
  8. Cloud also receives data for long-term monitoring

Error Signal Calculation:

Error = Set Point - Measured Value
Error = 7.0 mg/L - 6.2 mg/L = +0.8 mg/L

Positive error → Increase aerator output
Negative error → Decrease aerator output
Zero error → Maintain current output

70.8 Design Considerations: Edge vs Cloud Control

Tradeoff: Local Edge Control vs Cloud-Based Control Loop

Option A: Local Edge Control - PID controller runs on edge device (microcontroller, gateway) with sensor and actuator. Control loop latency 1-10ms, operates independently of network.

Option B: Cloud-Based Control - Sensor data sent to cloud, PID algorithm runs in cloud, commands sent back to actuator. Enables advanced analytics but adds 100-500ms network latency.

Decision Factors:

  • Choose Local Edge when: Control loop requires <50ms response time (motor speed, safety shutoffs), network connectivity is unreliable or intermittent, bandwidth costs are significant (cellular IoT), or system must operate autonomously during outages.

  • Choose Cloud-Based when: Control decisions benefit from cross-device coordination (building HVAC optimizing across 100 zones), advanced ML models improve control quality, historical data analysis drives setpoint adjustments, or remote monitoring and tuning are required.

  • Latency comparison: Local edge achieves 1-10ms control loop. Cloud-based adds 50-200ms (Wi-Fi to internet) or 100-500ms (cellular) round-trip, making it unsuitable for systems with >10Hz disturbance frequencies.

Hybrid approach: Run fast local PID for stability, use cloud for setpoint optimization and supervisory control.

70.9 Interactive: Control Loop Latency Impact

Explore how control loop latency affects system stability for different process speeds.

70.10 Knowledge Check

Open-loop vs closed-loop is like playing a game with your eyes open or closed!

70.10.1 The Sensor Squad Adventure: The Watering Challenge

Sammy the Sensor and Max the Microcontroller had a contest to see who could water the garden better.

Max went first. “Easy!” he said. “I’ll just turn on the sprinkler for exactly 10 minutes every morning.” He set a timer and walked away. But it rained that afternoon – and the garden got SOAKED! The next day was super hot, and the plants wilted because 10 minutes wasn’t enough. Max’s system was open-loop – like watering with your eyes closed!

Then it was Sammy’s turn. Sammy stuck a moisture sensor in the soil. “I’ll check how thirsty the plants are FIRST,” Sammy explained. “If the soil is dry, I water. If it’s wet from rain, I skip it!” When the rainstorm came, Sammy’s system said “Soil is already wet – no watering needed!” On the hot day, it said “Soil is very dry – water for 20 minutes!”

“That’s not fair – you’re cheating!” said Max.

“It’s not cheating,” laughed Bella the Battery. “It’s called feedback! Sammy checks what’s happening before deciding what to do. That’s what makes it a closed-loop system!”

70.10.2 Key Words for Kids

Word What It Means
Open-loop Doing something without checking if it worked (like a timer)
Closed-loop Checking the result and adjusting (like looking before you leap!)
Sensor The “eyes” that check what’s happening
Setpoint The goal you’re trying to reach (like “keep soil at 50% moisture”)

70.10.3 Try This at Home!

The Blindfold Toast Experiment (with a parent’s help!): Try making toast using only a timer (open-loop) vs. watching the toast and popping it when it looks right (closed-loop). Which gives better results? That is the difference between open-loop and closed-loop control!

70.11 Worked Example: Open vs Closed Loop for Street Lighting

Scenario: Birmingham City Council manages 89,000 street lights. They are evaluating two IoT upgrade options to reduce the GBP 7.8 million annual electricity bill (each light: 150W sodium, on 10 hrs/night average).

Option A – Open-Loop (Timer + Astronomical Clock):

  • Lights switch on/off at calculated sunset/sunrise times (adjusted monthly)
  • No sensors, no feedback
  • Hardware: timer relay per cabinet (1 cabinet per 40 lights) = 2,225 cabinets x GBP 45 = GBP 100,125
  • Energy savings: switching off completely from midnight-5am (known low-traffic period)
  • Expected savings: 89,000 x 150W x 5hrs x 365 days = 24.3 GWh/year
  • Cost savings: 24.3 GWh x GBP 0.15/kWh = GBP 3.65 million/year

The closed-loop system’s ROI depends on the extra savings justifying the sensor cost. Let’s calculate payback:

Annual savings difference: \[ \Delta S = (31.6 - 24.3) \text{ GWh/year} \times £0.15/\text{kWh} = £1.095 \text{ million/year} \]

Extra capital cost: \[ \Delta C = (£2{,}848{,}000 + £46{,}900) - £100{,}125 = £2{,}794{,}775 \]

Payback period: \[ \text{Payback} = \frac{£2{,}794{,}775}{£1{,}095{,}000/\text{year}} = 2.55 \text{ years} \]

With a 10-year sensor lifetime, the closed-loop system delivers £8.2 million additional savings over open-loop. The feedback is worth the investment.

Option B – Closed-Loop (PIR Sensors + Adaptive Dimming):

  • Each light has a PIR motion sensor. Lights dim to 20% when no pedestrians/vehicles detected, brighten to 100% on detection
  • Hardware: PIR sensor + dimming controller per light = 89,000 x GBP 32 = GBP 2,848,000
  • Communication: LoRaWAN gateway per 2 km2 (Birmingham = 268 km2) = 134 gateways x GBP 350 = GBP 46,900
  • Cloud platform: GBP 15,000/year
  • Energy savings: Average dimming 65% (lights at 20% for 70% of night, 100% for 30%)
  • Expected savings: 89,000 x 150W x 10hrs x 0.65 x 365 = 31.6 GWh/year
  • Cost savings: 31.6 GWh x GBP 0.15/kWh = GBP 4.74 million/year

5-Year TCO Comparison:

Factor Open-Loop (Timer) Closed-Loop (PIR + Dimming)
Hardware (Year 0) GBP 100,125 GBP 2,894,900
Annual energy savings GBP 3,650,000 GBP 4,740,000
Annual maintenance GBP 12,000 GBP 180,000 (sensor replacements)
Annual platform cost GBP 0 GBP 15,000
5-Year Net Savings GBP 17,790,000 GBP 19,870,000
Payback Period 10 days 2.7 years

Decision: Birmingham deploys both approaches in sequence:

  1. Year 1: Open-loop timer upgrade across all 89,000 lights (GBP 100K investment, 10-day payback). Immediate GBP 3.65M/year savings fund Phase 2.
  2. Year 2-3: Closed-loop PIR retrofit on the 22,000 highest-traffic lights only (parks, high streets, residential), where adaptive dimming provides the greatest marginal benefit
  3. Remaining 67,000 lights on low-traffic roads stay open-loop (the additional GBP 1,090/year saving per light from closed-loop does not justify the GBP 32/light sensor cost on roads with <10 pedestrians/night)

Key Insight: Open-loop and closed-loop are not competing paradigms – they are complementary. The optimal IoT system uses open-loop where conditions are predictable (residential streets at 3 AM are always empty) and closed-loop where conditions vary (park paths may have late-night joggers or dog walkers).

Key Takeaway

Choose open-loop control for simple, predictable, cost-sensitive tasks where the environment rarely changes (LED patterns, basic timers). Choose closed-loop control whenever precision matters, conditions are unpredictable, or safety is involved (temperature regulation, motor control, irrigation). In distributed IoT systems, individual devices may operate open-loop while the overall system implements closed-loop feedback through cloud coordination – the best architectures often combine both approaches at different levels.

Key Concepts

  • Open-Loop Control: A control architecture that applies a predetermined actuator output based on the setpoint alone, without measuring the actual output — simple and stable but cannot compensate for disturbances or parameter variations
  • Closed-Loop Control: A control architecture that continuously measures the process output and adjusts the actuator to minimize the error between measured and desired values — compensates for disturbances and model uncertainty automatically
  • Feedforward Control: A control strategy that uses knowledge of disturbances or setpoint changes to pre-compute corrective action, often combined with feedback (PID) to improve response speed beyond what feedback alone can achieve
  • Plant: The physical system or process being controlled (heating element + room air + thermal mass for a thermostat; motor + gears + load for a servo system), described by a transfer function relating input to output
  • Loop Gain: The total gain around the feedback loop from error signal through controller, actuator, plant, and sensor back to the summing junction — setting loop gain too high causes instability
  • Dead Time (Transport Delay): A pure time delay between when a control action is applied and when its effect first appears in the process variable — common in chemical processes with fluid transport — significantly limiting achievable feedback bandwidth
  • Block Diagram: A graphical representation of a control system showing signal flow between blocks representing subsystems (controller, plant, sensor), with summing junctions for feedback subtraction

Common Pitfalls

Controlling a motor speed in open-loop (fixed PWM duty cycle) in an application where load varies (conveyor belt with varying weight). When load increases, speed drops with no correction. Use tachometer feedback whenever output needs to be held constant under varying load.

Designing PID gains based on first-order process time constant while ignoring the process dead time. Dead time reduces the maximum achievable gain by creating phase lag at high frequencies. A rule of thumb: dead time > process time constant indicates the system is very difficult to control with PID.

Assuming that because the plant (open-loop) is stable, the closed-loop system will also be stable. Adding feedback around an inherently stable plant can destabilize the system if the loop gain is too high or if significant phase lag exists. Stability must be analyzed for the closed-loop system separately.

Declaring a control system working based on nominal operation without injecting test disturbances (step setpoint changes, step load disturbances). Step response testing reveals overshoot, settling time, and steady-state error that may only appear under dynamic conditions.

70.12 Summary

This chapter compared open-loop and closed-loop control systems:

  • Closed-Loop Systems: Continuously monitor output and self-correct errors using feedback sensors
  • Open-Loop Systems: Execute predetermined actions without measuring results
  • Decision Factors: Precision requirements, environmental predictability, disturbances, cost, and safety
  • IoT Architecture: Device-level open-loop with system-level closed-loop is common in distributed IoT
  • Edge vs Cloud: Local edge control for fast response, cloud control for analytics and coordination

70.13 What’s Next

The next chapter explores PID Control Theory, covering the mathematics and behavior of Proportional, Integral, and Derivative control terms.

Previous Current Next
Feedback Fundamentals Open & Closed Loop Systems PID Control Theory