Skip to content

L08: Disturbances + Setpoint Changes

Prerequisites: L06-L07 | Effort: 60 min | Seborg: Chapter 12


Learning Objectives

By the end of this lesson you will:

  1. โœ… Distinguish between load rejection and setpoint tracking
  2. โœ… Implement step disturbances in simulation
  3. โœ… Understand 2-DOF PID and setpoint weighting
  4. โœ… Track disturbance metadata in data pipeline
  5. โœ… Generate realistic operational scenarios (disturbances + SP changes)

Theory Recap: Disturbances vs Setpoints (Seborg Ch. 12)

Two fundamental control tasks:

Load Rejection (Disturbance Rejection)

  • Goal: Maintain PV at setpoint despite unmeasured disturbances
  • Example: Keep reactor temp at 80ยฐC when feed temp varies
  • Tuning priority: Fast integral action (high Ki)
  • Performance metric: Peak deviation, recovery time

Setpoint Tracking

  • Goal: Follow changing setpoints smoothly
  • Example: Ramp reactor temp from 60ยฐC โ†’ 80ยฐC during startup
  • Tuning priority: Avoid derivative kick, smooth response
  • Performance metric: Overshoot, rise time

The Problem: - Standard PID can't optimize both tasks simultaneously - Aggressive tuning for load rejection โ†’ overshoot on SP changes - Conservative tuning for SP tracking โ†’ slow disturbance recovery

Solution: 2-Degree-of-Freedom (2-DOF) PID

Setpoint weighting:

u(t) = Kpยท(ฮฒยทSP - PV) + Kiยทโˆซ(SP - PV)dt + Kdยท(-dPV/dt)

Where: - ฮฒ = Setpoint weight (0 to 1) - ฮฒ = 1: Standard PID (aggressive SP tracking) - ฮฒ = 0: P-term only responds to disturbances (smooth SP tracking) - ฮฒ = 0.5: Balanced

Benefits: - Eliminates derivative kick on SP changes (dPV/dt instead of dError/dt) - Reduces proportional overshoot on SP changes - Still responds aggressively to disturbances


Odibi Hands-On

Example 1: Load Rejection Test

Scenario: Tank level control with inlet flow disturbance

# load_rejection.yaml
# Step disturbance at t=60 min: Inlet flow 100 โ†’ 120 gpm
# SP constant at 50%
# Measure: Peak deviation, recovery time

Working example: /examples/cheme_course/L08_disturbances/load_rejection.yaml

Key metrics: - Peak deviation: Max |SP - PV| after disturbance - Recovery time: Time to return within ยฑ2% of SP - IAE: Integral of absolute error


Example 2: Setpoint Tracking Test

Scenario: Tank level SP change with no disturbance

# setpoint_tracking.yaml
# SP step at t=60 min: 50% โ†’ 60%
# No disturbances
# Measure: Overshoot, rise time, settling time

Working example: /examples/cheme_course/L08_disturbances/setpoint_tracking.yaml

Key metrics: - Overshoot: Max(PV - SP_final) / (SP_final - SP_initial) ร— 100% - Rise time: Time from 10% to 90% of final value - Settling time: Time to stay within ยฑ2% of final value


Example 3: Combined Scenario (Realistic Operations)

Scenario: Multiple disturbances + SP changes (like real plant)

# operational_scenario.yaml
# t=0-60 min: Steady at 50%
# t=60 min: Disturbance (inlet +10 gpm)
# t=120 min: SP change 50% โ†’ 55%
# t=180 min: Another disturbance (inlet -5 gpm)
# t=240 min: SP change 55% โ†’ 50%

Working example: /examples/cheme_course/L08_disturbances/operational_scenario.yaml

Metadata tracking:

# Track disturbance events
- name: disturbance_active
  data_type: boolean
  generator:
    type: derived
    expression: "minutes_elapsed >= 60 and minutes_elapsed < 180"

- name: disturbance_type
  data_type: string
  generator:
    type: derived
    expression: >
      'inlet_increase' if minutes_elapsed >= 60 and minutes_elapsed < 120
      else ('inlet_decrease' if minutes_elapsed >= 180 and minutes_elapsed < 240
      else 'none')

- name: setpoint_change_active
  data_type: boolean
  generator:
    type: derived
    expression: "minutes_elapsed in [120, 240]"


Data Engineering Insights

Why disturbance tracking matters:

  1. Root cause analysis
  2. Tag data with disturbance events (feed pump trip, ambient temp change)
  3. Correlate controller performance with disturbance type
  4. "Why did level spike at 3am?" โ†’ Check disturbance log

  5. Controller performance monitoring

  6. Calculate load rejection metrics from historian data
  7. Detect degradation: Recovery time increasing โ†’ Fouling? Valve sticking?
  8. Compare actual vs simulated response

  9. Synthetic data for ML

  10. Generate 1000s of disturbance scenarios
  11. Train anomaly detector: "Normal disturbance response" vs "Abnormal"
  12. Augment rare events (pump failures) for training

  13. Operator training scenarios

  14. Realistic disturbance profiles (feed composition swing)
  15. Measure operator response time
  16. Test new operating procedures

Exercises

Exercise 1: Measure Load Rejection

Run load_rejection.yaml with different tunings: - PI: Kp=2.0, Ki=0.1 - Aggressive: Kp=4.0, Ki=0.5 - Conservative: Kp=1.0, Ki=0.05

Calculate peak deviation and recovery time for each.

Exercise 2: Setpoint Overshoot

Modify setpoint_tracking.yaml: - Add large SP step (50% โ†’ 70%) - Compare overshoot with Kp = [1, 2, 4, 8] - Plot overshoot vs Kp

Exercise 3: Simultaneous Disturbance + SP

Create scenario where disturbance and SP change occur at same time: - Can controller handle both? - Does it prioritize SP or disturbance?

Exercise 4: Metadata Enrichment

Add disturbance classification to operational_scenario.yaml: - "small" (<10 gpm), "medium" (10-20 gpm), "large" (>20 gpm) - Calculate average recovery time by class


Reflection: Real Plant Scenarios

Common disturbances in process plants:

Process Typical Disturbances
Heat exchanger Inlet temp, flow rate, fouling
Distillation column Feed composition, pressure, reflux flow
Reactor Feed rate, catalyst activity, cooling water temp
Tank level Inlet flow, outlet demand, pump speed

Red flags in historian data: - Large SP changes with no operator annotation โ†’ Automatic program? - Frequent disturbances at same time daily โ†’ Upstream schedule? - Controller struggles with one disturbance type โ†’ Poorly tuned?

Best practices: - Log disturbance events (tags, alarms, operator notes) - Separate SP changes (planned) from disturbances (unplanned) - Track controller metrics by scenario type


Summary

Key Takeaways: - โœ… Load rejection โ‰  setpoint tracking (different tuning priorities) - โœ… Disturbances are unmeasured, SP changes are planned - โœ… Track disturbance metadata for analysis - โœ… Realistic scenarios combine both - โœ… 2-DOF PID optimizes both tasks (advanced topic)

Next Lesson: L09: System Identification - PRBS signals and model fitting


Additional Resources