57  Open vs Closed Loop

In 60 Seconds

Open-loop control executes fixed schedules without feedback (e.g., water 10 minutes daily), while closed-loop control uses sensors to self-correct (e.g., water when soil moisture drops below 30%, stop at 70%). Closed-loop irrigation typically saves 30-50% water over open-loop in summer, but requires sensor investment. Choose open-loop for simple, predictable processes; closed-loop when conditions vary significantly.

57.1 Learning Objectives

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

  • Compare open-loop and closed-loop control systems and their trade-offs in cost, accuracy, and complexity
  • Select the appropriate control type based on environmental predictability, precision requirements, and safety constraints
  • Analyze real-world IoT examples (irrigation, streetlighting, water quality) to determine optimal control architecture
  • Design hybrid control strategies that combine open-loop sensing with closed-loop actuation

This chapter covers foundational concepts for designing IoT systems at scale. Think of IoT system design like city planning – you need to consider where devices go, how they communicate, where data is stored, and how everything stays secure. Reference architectures and design principles help you create systems that work reliably and can grow over time.

57.2 Comparing Open and Closed Loop Systems

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

57.2.1 Advantages and Disadvantages

57.3 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

57.3.1 Decision Matrix

Decision tree flowchart for selecting open-loop versus closed-loop control: branches based on whether precision is required, whether the environment is predictable, whether disturbances are expected, and whether safety is critical; leaf nodes recommend open-loop for stable predictable low-cost applications and closed-loop for variable environments requiring self-correction
Figure 57.1: Decision tree: when to use open-loop vs closed-loop

Open-Loop vs Closed-Loop Decision Tree: Precision requirements, environmental predictability, disturbances, cost constraints, and safety considerations determine appropriate control architecture. Most IoT control applications benefit from closed-loop feedback.

Example: Water Quality Monitoring with Feedback

Consider an IoT water quality monitoring system for an aquarium:

Open-Loop Approach (Inadequate):

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

Closed-Loop Approach (Recommended):

Block diagram of aquarium dissolved oxygen closed-loop control: oxygen sensor reads DO level and compares to 7 mg/L setpoint, error signal drives PID controller on ESP32 microcontroller, which adjusts aerator pump speed via PWM to add oxygen when level is low; feedback loop continuously corrects DO level with local control while cloud receives telemetry for monitoring
Figure 57.2: Aquarium O2 control with PID aerator feedback loop

Aquarium O₂ 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. Cloud monitoring provides secondary oversight but doesn’t delay critical control action.

Operation:

  1. Set point: O₂ = 7 mg/L
  2. Sensor measures: O₂ = 6.2 mg/L
  3. Error: +0.8 mg/L (need more oxygen)
  4. Controller increases aerator pump speed
  5. O₂ level rises toward target
  6. Controller reduces pump speed as error decreases
  7. System maintains stable O₂ 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

Open-loop and closed-loop are like doing homework with or without checking your answers!

57.3.2 The Sensor Squad Adventure: The Lemonade Stand

The Sensor Squad opened a lemonade stand on a hot summer day!

Bella the Battery was in charge of making lemonade. “I’ll add exactly 3 spoonfuls of sugar to every glass,” she announced. This was her open-loop recipe – the same every time, no matter what.

But then a kid said, “This is too sweet!” And another said, “This isn’t sweet enough!” Bella was confused – she used the SAME recipe every time!

Sammy the Sensor figured it out. “The lemons are different! Some are really sour and need MORE sugar. Some are sweeter and need LESS sugar. You can’t use the same amount every time!”

“I know!” said Max the Microcontroller. “Let’s TASTE each batch before serving it! If it’s too sour, add more sugar. If it’s too sweet, add more lemon juice!”

This was closed-loop control – checking the output (taste) and adjusting the input (sugar) until it was just right!

“Open-loop is faster,” admitted Bella. “But closed-loop makes BETTER lemonade!”

“And happier customers!” added Lila the LED, flashing green for every perfect glass.

57.3.3 Key Words for Kids

Word What It Means
Open-loop Following a recipe without tasting – same every time
Closed-loop Tasting and adjusting until it’s perfect
Disturbance Something unexpected that changes the result (like sour lemons!)
Self-correcting A system that fixes itself without help

57.3.4 Try This at Home!

The Paper Airplane Distance Game: First, throw a paper airplane at a target using the exact same throw every time (open-loop). Then, adjust each throw based on where the last one landed (closed-loop). Which method gets you closer to the target more consistently?

Hands-on Exercise: Calculate the return on investment for adding closed-loop control to an irrigation system.

Scenario:

  • Agricultural field: 2 hectares
  • Current system: Open-loop timer waters 30 minutes daily at 6 AM
  • Proposed upgrade: Closed-loop with soil moisture sensors ($150 hardware + $50 installation)

Your Task:

  1. Water consumption analysis:
    • Open-loop: 30 min × 365 days × 200 L/min = ______ liters/year
    • Closed-loop (waters only when soil <30% moisture): Estimated 40% reduction
    • Water saved: ______ liters/year
  2. Cost savings:
    • Water cost: $0.003 per liter
    • Annual savings: ______
    • System investment: $200
    • Payback period: ______ months
  3. Environmental benefit:
    • Water saved = ______ Olympic swimming pools (2.5M liters each)
    • Reduced runoff prevents fertilizer pollution

Expected Results:

  • Annual savings should exceed $400-600
  • Payback period: 4-6 months
  • Additional benefits: healthier crops from optimal moisture, reduced erosion

Documentation: Create a simple cost-benefit spreadsheet showing monthly water usage for both systems.

How It Works: Closed-Loop Control Explained

The Four Essential Components:

1. Sensor (Measurement) Continuously measures the actual output state. In an HVAC system, a thermistor reads room temperature every 30 seconds. In irrigation, a capacitive soil moisture sensor measures water content every 5 minutes.

2. Comparator (Error Calculation) Subtracts measured value from setpoint to determine error: - Error = Setpoint - Measured - Example: 22°C target - 20°C actual = +2°C error (too cold) - Example: 40% moisture target - 65% actual = -25% error (too wet, skip watering)

3. Controller (Decision Logic) Processes the error signal and determines corrective action. This can be: - Simple on/off (bang-bang): If error >1°C, turn heater ON; else OFF - Proportional: Heater power = Kp × error (smooth control) - PID: Combines current error, accumulated error, and rate of change

4. Actuator (Physical Action) Executes the controller’s command: - HVAC: Relay activates furnace or air conditioner - Irrigation: Solenoid valve opens to deliver water - Motor control: PWM signal adjusts motor speed

The Loop: Sensor → Comparator → Controller → Actuator → (affects process) → Sensor → … (repeats continuously)

Why Feedback Matters:

  • Without feedback (open-loop): System executes commands blindly, cannot detect failures or changing conditions
  • With feedback (closed-loop): System self-corrects automatically, adapts to disturbances (weather, equipment aging, varying loads)

Real Example - Smart Aquarium Heater:

  • Setpoint: 25°C
  • Sensor reads: 23.5°C
  • Error: +1.5°C (too cold)
  • Controller: Proportional (Kp=20), Output = 20×1.5 = 30% heater power
  • Actuator: PWM drives heater at 30%
  • Result: Water gradually warms, error shrinks, heater power reduces automatically
  • Disturbance handling: If you add 2L of cold water, sensor detects temperature drop immediately and increases heater power—no manual intervention needed

57.4 Concept Relationships

Concept Relationship to Control Types Why It Matters
Feedback Loop Defines the difference between open and closed-loop control Feedback is what enables closed-loop systems to self-correct and adapt
Disturbance Rejection Closed-loop handles disturbances automatically; open-loop cannot Explains why closed-loop is essential in variable environments (weather, usage patterns)
Energy Efficiency Closed-loop adapts output to actual need; open-loop often over/under delivers Typical energy savings: 30-50% for HVAC, irrigation, heating systems
System Stability Closed-loop can oscillate if poorly tuned; open-loop cannot oscillate Tuning (PID gains) is critical for closed-loop performance
Sensor Dependency Closed-loop requires functional sensor; open-loop does not Sensor failure breaks closed-loop control – requires fault detection and fallback
Latency Tolerance Closed-loop is sensitive to feedback delay; open-loop is not Explains why cloud-based control fails for fast processes (motor control, drones)

57.5 See Also

Related chapters that expand on control system architecture:

Key Takeaway

Open-loop control is simpler and cheaper but cannot adapt to changing conditions or disturbances. Closed-loop control uses sensor feedback to self-correct, making it essential when precision matters or the environment is unpredictable. In IoT systems, the most effective architecture often combines both: individual sensor nodes operate open-loop (sense and transmit), while the overall system implements closed-loop control through cloud or edge coordination. Always ask: “Will the environment change unpredictably?” If yes, closed-loop is the right choice.

57.6 Interactive: Closed-Loop vs Open-Loop Energy Comparison

Calculate the energy and cost savings from switching to closed-loop control for an HVAC or irrigation system.

57.7 Worked Example: HVAC Control System Design Comparison

Scenario: A 500 m^2 office floor needs heating/cooling. Target temperature is 22C. Outdoor temperature varies from -5C (winter) to 35C (summer). The system uses a 15 kW heat pump. Compare open-loop and closed-loop approaches.

Open-Loop Design (Timer-Based):

Schedule:
  Winter (Oct-Mar): Heat pump ON at 7:00, OFF at 18:00
  Summer (Apr-Sep): Cooling ON at 9:00, OFF at 17:00
  Weekends: OFF

Daily energy: 15 kW x 11 hours = 165 kWh (winter)
Annual cost: 165 kWh x 180 days x $0.12/kWh = $3,564

Problems observed over 12 months:

  • Overheating on mild winter days (15C outside, heater still running = 28C indoor)
  • Freezing Monday mornings (no weekend heating, pipes at risk)
  • Cooling during cool summer mornings (wasted energy)
  • Employee complaints: 47 comfort tickets per month average

Closed-Loop Design (Thermostat + Occupancy):

Sensors: 8 temperature sensors ($15 each), 4 occupancy sensors ($25 each)
Controller: PLC with PID loop ($200)
Total sensor investment: $320

Control logic:
  IF occupied AND temp < 21C: heat to 22C
  IF occupied AND temp > 23C: cool to 22C
  IF unoccupied AND temp < 15C: heat to 15C (frost protection)
  IF unoccupied: standby mode

Results after 12 months:

Metric Open-Loop Closed-Loop Improvement
Annual energy 29,700 kWh 14,200 kWh 52% reduction
Annual cost $3,564 $1,704 $1,860 saved
Comfort complaints 564/year 38/year 93% reduction
Temperature deviation +/- 6C +/- 1C 6x more precise
Sensor investment $0 $320 Payback: 2.1 months

Payback period calculation: \(T_{payback} = \frac{I_{initial}}{\text{Annual Savings}}\) where investment \(I = \$320\) and savings \(S = \$1,860/\text{year}\). Worked example: Payback time is \(T = 320 / (1860/12) = 320/155 = 2.06\) months. The 52% energy reduction comes from occupancy-aware control: open-loop ran heater \(15kW \times 11hr/day \times 180days = 29,700kWh\), while closed-loop only heated when occupied and at setpoint, reducing to \(14,200kWh\).

Key insight: The $320 sensor investment paid for itself in 2.1 months through energy savings alone. The comfort improvement (93% fewer complaints) was an additional benefit that justified the slightly more complex system design.

57.7.1 Practical IoT Design Considerations

When designing IoT systems, consider:

Sensor Placement:

  • Feedback sensors must accurately measure the controlled variable
  • Minimize latency between actual change and sensor detection
  • Consider sensor accuracy requirements vs. cost

Communication Delays:

  • For distributed systems, network latency affects feedback loop performance
  • Long delays can cause instability
  • May need to implement local closed-loop with cloud monitoring

Failure Modes:

  • What happens if feedback sensor fails?
  • Should system fail-safe (shut down) or continue open-loop?
  • Redundant sensors for critical applications?

Power Constraints:

  • Closed-loop systems consume more power
  • May need to alternate between open and closed loop operation
  • Sleep modes between control actions

57.8 Worked Example: Cold Chain Monitoring for Vaccine Transport

Scenario: A pharmaceutical company ships 500 vaccine containers daily from a central warehouse to 120 clinics. Vaccines must remain between 2C and 8C. Any excursion above 8C for more than 30 minutes renders a shipment worthless ($15,000 per container average).

Open-Loop Approach (Pre-2020):

The company used pre-cooled containers with gel packs calibrated for an 8-hour delivery window. A fixed cooling plan assumed standard ambient conditions.

Procedure:
  1. Pre-cool container to 2C
  2. Insert 4 gel packs (each absorbs 200 kJ)
  3. Seal and dispatch
  4. Check temperature on arrival (too late if excursion occurred)

Problems over 12 months:

Issue Frequency Cost Impact
Summer heat excursions (>35C ambient) 47 containers/year $705,000 lost product
Extended delivery delays (traffic, routing) 23 containers/year $345,000 lost product
Over-cooling in winter (vaccines froze) 12 containers/year $180,000 lost product
False alarm rejections (unknown excursion timing) 31 containers/year $465,000 unnecessary waste
Total annual losses 113 containers $1,695,000

Closed-Loop Approach (IoT Retrofit):

Each container received a $45 IoT sensor kit: temperature/humidity sensor (BME280), cellular modem (LTE-M), GPS, and a Peltier cooling element controlled by a microcontroller.

Control logic:
  IF temp > 6C: activate Peltier cooling (gradual)
  IF temp > 7C: increase Peltier to maximum + alert dispatch
  IF temp < 3C: activate heating element
  IF temp excursion > 8C for > 5 min: flag container, reroute to nearest clinic
  GPS + temp logged every 60 seconds to cloud dashboard

Results after 12 months:

Metric Open-Loop Closed-Loop Improvement
Excursion incidents 113/year 4/year 96% reduction
Product loss cost $1,695,000 $60,000 $1,635,000 saved
IoT system cost $0 $22,500 (500 x $45) Payback: 5 days
Temperature deviation +/- 6C +/- 0.5C 12x more precise
Regulatory audit time 8 hours/audit 15 min (automated logs) 97% reduction

ROI for closed-loop cold chain: \(\text{Payback} = \frac{\text{Investment}}{\text{Daily Savings}} = \frac{\$22,500}{\$1,635,000/365} = \frac{22,500}{4,479} = 5.0\) days. Worked example: With 113 incidents/year at \(\$15,000\) per container, annual loss is \(113 \times 15,000 = \$1,695,000\). Closed-loop reduces this to 4 incidents = \(\$60,000\) loss, saving \(\$1,635,000\) annually. The \(\$45\) IoT kit per container (\(500 \times 45 = \$22,500\) total) pays for itself in under a week.

Key insight: The $22,500 sensor investment paid for itself in 5 days of prevented losses. Beyond cost savings, the continuous temperature log eliminated ambiguity during regulatory audits – inspectors could verify the complete thermal history of every shipment rather than relying on arrival-only spot checks.

57.9 What’s Next

If you want to… Read this
Study feedback mechanisms in depth Feedback Mechanisms
Learn about PID control implementation Processes and Systems: PID Control
Explore PID system fundamentals PID Control Fundamentals
Review the processes overview Processes and Systems Overview
Study PID tuning and applications PID Tuning and Applications

Key Concepts

  • On/Off Control: The simplest control strategy switching the actuator between fully on and fully off states based on whether the process variable exceeds the setpoint — inherently produces oscillation around the setpoint (hysteresis band)
  • Proportional Control: A control mode producing output proportional to error magnitude — faster and smoother than on/off but always has residual steady-state error proportional to the disturbance
  • Cascade Control: A multi-loop strategy where an outer (primary) controller adjusts the setpoint of an inner (secondary) controller — the inner loop must be 3–5× faster than the outer loop for stable operation
  • Feed-Forward Control: A control strategy using measured disturbances to pre-compute corrective action before the disturbance affects the process variable — improves response speed beyond what feedback alone achieves
  • Bang-Bang Control: Another name for on/off control, characterized by switching between maximum and zero actuator output — simple, robust, but inherently oscillatory and unsuitable for precise control
  • Hysteresis Band: A deadband around the setpoint in on/off control within which no switching occurs — prevents rapid cycling by requiring the process variable to move a defined distance past the setpoint before switching actuator state

Common Pitfalls

Applying on/off thermostat control to a pharmaceutical incubator requiring ±0.1°C temperature accuracy. On/off control inherently oscillates ±Hysteresis/2 around setpoint — use PID control when precision matters more than simplicity.

Designing a cascade control system where the outer loop (temperature) runs at the same frequency as the inner loop (heater power). The inner loop must be at least 3–5× faster than the outer loop. Violating this ratio causes the loops to destabilize each other.

Adding feed-forward control based on guessed disturbance-to-output relationships. Incorrect feed-forward gain worsens performance compared to feedback alone. Identify the disturbance-to-output transfer function experimentally before implementing feed-forward.

Implementing cascade control with the inner loop running on a cloud server introducing 100 ms latency per execution. Cascade control requires the inner loop to have sub-10 ms response time — it must run locally on the device or gateway, not in the cloud.