Chapter 6

Process Dynamics & Control

Feedback loops, PID controllers, and stability analysis.

Process control is essential for maintaining safe, efficient, and consistent operation of chemical processes. It involves measuring process variables, comparing them to desired setpoints, and manipulating process inputs to maintain control.

Control System Fundamentals

Basic Elements

  • Process: The system being controlled
  • Sensor: Measures process variables
  • Controller: Computes control action
  • Final control element: Executes control action (valve, pump, etc.)

Control Objectives

  • Safety: Prevent hazardous conditions
  • Product quality: Maintain specifications
  • Efficiency: Optimize resource usage
  • Environmental compliance: Meet regulations

PID Control

Proportional (P) Control

Output proportional to error:

u(t)=Kce(t)+u0u(t) = K_c e(t) + u_0

Where:

  • u(t)u(t) = controller output
  • KcK_c = controller gain
  • e(t)e(t) = error (setpoint - measurement)
  • u0u_0 = bias (steady-state output)

Integral (I) Control

Eliminates steady-state error:

u(t)=1τI0te(t)dtu(t) = \frac{1}{\tau_I} \int_0^t e(t) dt

Derivative (D) Control

Anticipates future error:

u(t)=τDde(t)dtu(t) = \tau_D \frac{de(t)}{dt}

Complete PID Controller

u(t)=Kc[e(t)+1τI0te(t)dt+τDde(t)dt]+u0u(t) = K_c \left[ e(t) + \frac{1}{\tau_I} \int_0^t e(t) dt + \tau_D \frac{de(t)}{dt} \right] + u_0

Process Dynamics

First-Order Systems

Common model for many processes:

τpdy(t)dt+y(t)=Kpu(t)\tau_p \frac{dy(t)}{dt} + y(t) = K_p u(t)

Where:

  • τp\tau_p = process time constant
  • KpK_p = process gain

Second-Order Systems

For processes with oscillation:

τ2d2y(t)dt2+2ζτdy(t)dt+y(t)=Kpu(t)\tau^2 \frac{d^2y(t)}{dt^2} + 2\zeta\tau \frac{dy(t)}{dt} + y(t) = K_p u(t)

Where ζ\zeta is the damping coefficient.

Stability Analysis

Bode Plot

Frequency response analysis showing gain and phase margins.

Root Locus

Graphical method showing how closed-loop poles move with controller gain.

Nyquist Criterion

Determines stability from open-loop frequency response.

Advanced Control Strategies

Cascade Control

Uses multiple controllers for improved performance.

Feedforward Control

Compensates for measurable disturbances before they affect the process.

Model Predictive Control (MPC)

Uses process model to optimize future control actions.

Advanced Process Control Concepts

State-Space Representation

Modern control systems often use state-space models:

x˙=Ax+Bu\dot{x} = Ax + Bu y=Cx+Duy = Cx + Du

Where:

  • xx = state vector
  • uu = input vector
  • yy = output vector
  • AA = system matrix
  • BB = input matrix
  • CC = output matrix
  • DD = feedthrough matrix

Controllability and Observability

Controllability: Ability to drive the system to any desired state

Rank[B AB A2B  An1B]=n\text{Rank}[B \ AB \ A^2B \ \cdots \ A^{n-1}B] = n

Observability: Ability to determine initial state from outputs

Rank[CT ATCT (AT)2CT  (AT)n1CT]=n\text{Rank}[C^T \ A^TC^T \ (A^T)^2C^T \ \cdots \ (A^T)^{n-1}C^T] = n

Robust Control

H-infinity Control: Minimizes worst-case performance Mu-synthesis: Handles structured uncertainty Sliding Mode Control: Robust to parameter variations

Adaptive Control

Self-Tuning Regulators: Automatically adjust controller parameters Model Reference Adaptive Control: Forces system to follow reference model Gain Scheduling: Changes controller parameters based on operating conditions

Nonlinear Control

Feedback Linearization: Transforms nonlinear system to linear form Backstepping: Recursive design for strict-feedback systems Lyapunov-Based Control: Uses energy functions for stability

Multivariable Control

Relative Gain Array (RGA): Measures interaction between loops

Λ=K(K1)T\Lambda = K \circ (K^{-1})^T

Where KK is the steady-state gain matrix and \circ denotes element-wise multiplication.

Decentralized Control: Uses multiple single-loop controllers Centralized Control: Uses full multivariable controller

Digital Control Systems

Sampling Theorem: Must sample at least twice the highest frequency Z-Transform: Discrete equivalent of Laplace transform Discrete PID: Digital implementation with sampling time TsT_s

Process Identification and Modeling

System Identification Methods

  • Step testing: Simple but disruptive
  • Pulse testing: Less disruptive than step
  • PRBS (Pseudo-Random Binary Sequence): Optimal for identification
  • Frequency response: Uses sine wave inputs

Model Validation

  • Residual analysis: Check for correlation in errors
  • Cross-validation: Use different data for validation
  • Akaike Information Criterion (AIC): Balances model complexity and fit

First-Principles Modeling

Based on fundamental physical and chemical laws:

  • Mass balances
  • Energy balances
  • Momentum balances
  • Thermodynamic relationships

Empirical Modeling

ARX Models: AutoRegressive with eXogenous inputs

y(k)=a1y(k1)any(kn)+b1u(k1)++bmu(km)+e(k)y(k) = -a_1y(k-1) - \cdots - a_ny(k-n) + b_1u(k-1) + \cdots + b_mu(k-m) + e(k)

State-Space Models: From input-output data using subspace methods

Control System Implementation

Hardware Components

  • Sensors: Temperature, pressure, flow, level, composition
  • Actuators: Control valves, variable speed drives, heaters
  • Controllers: PLC, DCS, embedded systems
  • Communication: Fieldbus, Ethernet, wireless

Software Architecture

  • SCADA Systems: Supervisory Control and Data Acquisition
  • DCS: Distributed Control Systems
  • PLC Programming: Ladder logic, function blocks, structured text
  • HMI Design: Human-Machine Interface principles

Safety Systems

  • SIS: Safety Instrumented Systems
  • ESD: Emergency Shutdown Systems
  • Alarm Management: Rationalization and prioritization
  • Layers of Protection Analysis (LOPA)

Performance Monitoring

  • Control Performance Assessment (CPA)
  • Key Performance Indicators (KPIs)
  • Fault Detection and Diagnosis (FDD)
  • Maintenance Scheduling

Real-World Application: Advanced Chemical Reactor Control

A jacketed CSTR with multiple reactions requires sophisticated control:

Advanced Control Strategy

Multivariable Control Approach:

  • Primary controlled variables: Temperature, composition, level
  • Manipulated variables: Cooling flow, feed rate, agitation speed
  • Disturbance variables: Feed composition, ambient temperature

Control Architecture:

  • Cascade control: Inner loop (jacket temperature), outer loop (reactor temperature)
  • Feedforward control: Compensate for feed flow changes
  • Model Predictive Control: Handle constraints and interactions
  • Adaptive control: Adjust for catalyst deactivation

Safety Systems:

  • SIL 2 Safety System: Independent temperature and pressure trips
  • Emergency cooling: Backup cooling system
  • Vent system: Pressure relief for runaway reactions

Advanced Tuning Methods

Internal Model Control (IMC) Tuning: For first-order plus dead time processes:

Kc=τKp(λ+θ)K_c = \frac{\tau}{K_p(\lambda + \theta)} τI=τ\tau_I = \tau τD=0\tau_D = 0

Where λ\lambda is the closed-loop time constant.

Lambda Tuning: Direct specification of closed-loop response:

Kc=τKpλK_c = \frac{\tau}{K_p\lambda} τI=τ\tau_I = \tau

Optimization-Based Tuning: Minimize performance index:

J=0[e2(t)+ρu2(t)]dtJ = \int_0^\infty [e^2(t) + \rho u^2(t)] dt

Tuning Example with Advanced Methods

Using multiple tuning approaches for comparison:

import numpy as np

# Process parameters from advanced identification
Kp = 2.0        # Process gain (°C/% valve)
tau = 5.0       # Time constant (min)
theta = 1.0     # Dead time (min)

# TODO: Calculate PID parameters using multiple tuning methods
# Compare Ziegler-Nichols, Cohen-Coon, IMC, and Lambda tuning

# Ziegler-Nichols (ultimate cycle method)
Ku = 1.2 * (1/Kp) * (tau/theta)  # Approximate ultimate gain
Pu = 2 * theta  # Approximate ultimate period

Kc_zn = 0.6 * Ku
tau_I_zn = Pu / 2
tau_D_zn = Pu / 8

# Cohen-Coon method
Kc_cc = (1/Kp) * (tau/theta) * (4/3 + theta/(4*tau))
tau_I_cc = theta * (32 + 6*theta/tau) / (13 + 8*theta/tau)
tau_D_cc = 4 * theta / (11 + 2*theta/tau)

# IMC method (lambda = theta)
lambda_imc = theta
Kc_imc = tau / (Kp * (lambda_imc + theta))
tau_I_imc = tau
tau_D_imc = 0

# Lambda tuning (lambda = 2*tau for robust control)
lambda_lam = 2 * tau
Kc_lam = tau / (Kp * lambda_lam)
tau_I_lam = tau

print("PID Tuning Comparison:")
print("Method\t\tKc\ttau_I\ttau_D")
print(f"Ziegler-Nichols\t{Kc_zn:.2f}\t{tau_I_zn:.2f}\t{tau_D_zn:.2f}")
print(f"Cohen-Coon\t{Kc_cc:.2f}\t{tau_I_cc:.2f}\t{tau_D_cc:.2f}")
print(f"IMC\t\t{Kc_imc:.2f}\t{tau_I_imc:.2f}\t{tau_D_imc:.2f}")
print(f"Lambda\t\t{Kc_lam:.2f}\t{tau_I_lam:.2f}\t-")

# Calculate performance metrics for each method
def performance_metrics(Kc, tau_I, tau_D):
    # Simplified performance calculation
    overshoot = max(0, 20 * (1 - Kc * Kp))  # Rough estimate
    settling_time = tau * (1 + 2/ Kc / Kp)  # Rough estimate
    return overshoot, settling_time

metrics_zn = performance_metrics(Kc_zn, tau_I_zn, tau_D_zn)
metrics_cc = performance_metrics(Kc_cc, tau_I_cc, tau_D_cc)
metrics_imc = performance_metrics(Kc_imc, tau_I_imc, tau_D_imc)
metrics_lam = performance_metrics(Kc_lam, tau_I_lam, 0)

print("\nPerformance Comparison:")
print("Method\t\tOvershoot\tSettling Time")
print(f"Z-N\t\t{metrics_zn[0]:.1f}%\t\t{metrics_zn[1]:.1f} min")
print(f"Cohen-Coon\t{metrics_cc[0]:.1f}%\t\t{metrics_cc[1]:.1f} min")
print(f"IMC\t\t{metrics_imc[0]:.1f}%\t\t{metrics_imc[1]:.1f} min")
print(f"Lambda\t\t{metrics_lam[0]:.1f}%\t\t{metrics_lam[1]:.1f} min")

Your Challenge: Control System Design and Tuning

In this exercise, you'll design a control system for a distillation column and tune the controllers for optimal performance.

Goal: Design and tune PID controllers for a distillation column's temperature and level control loops.

System Description

A distillation column separating methanol and water:

Temperature Control Loop (Tray 15):

  • Process gain: 1.5 °C/% reflux
  • Time constant: 8 minutes
  • Dead time: 2 minutes
  • Setpoint: 75°C

Level Control Loop (Reflux Drum):

  • Process gain: 0.8 % level/% valve
  • Time constant: 3 minutes
  • Dead time: 0.5 minutes
  • Setpoint: 50%
# Temperature control loop parameters
Kp_temp = 1.5    # °C/%
tau_temp = 8.0   # min
theta_temp = 2.0 # min

# Level control loop parameters  
Kp_level = 0.8   # %/%
tau_level = 3.0  # min
theta_level = 0.5 # min

# TODO: Tune PID controllers using appropriate methods
# For temperature: Use Cohen-Coon method (slow process with significant dead time)
# For level: Use Ziegler-Nichols method (faster process)

# Cohen-Coon tuning for temperature
Kc_temp = 0
tau_I_temp = 0
tau_D_temp = 0

# Ziegler-Nichols tuning for level
Kc_level = 0
tau_I_level = 0
tau_D_level = 0

print("Temperature Control Loop (Cohen-Coon):")
print(f"  Kc: {Kc_temp:.2f}")
print(f"  tau_I: {tau_I_temp:.2f} min") 
print(f"  tau_D: {tau_D_temp:.2f} min")

print("\nLevel Control Loop (Ziegler-Nichols):")
print(f"  Kc: {Kc_level:.2f}")
print(f"  tau_I: {tau_I_level:.2f} min")
print(f"  tau_D: {tau_D_level:.2f} min")

# Evaluate control performance
temp_overshoot = 0  # Estimate based on tuning
level_overshoot = 0

print(f"\nExpected temperature overshoot: {temp_overshoot:.1f}%")
print(f"Expected level overshoot: {level_overshoot:.1f}%")

What would be the effect of increasing the derivative time? How would you modify the tuning for a more aggressive response?

ELI10 Explanation

Simple analogy for better understanding

Process control is like having a smart thermostat for chemical plants. Just as a thermostat keeps your house at the right temperature by turning the heater on and off, process control systems automatically adjust valves, pumps, and heaters to keep chemical processes running smoothly. They use sensors to measure things like temperature and pressure, then make adjustments to keep everything within safe and efficient limits. The most common type of controller (PID) works like a careful driver - it adjusts based on how far you are from the target (proportional), how long you've been off (integral), and how fast you're approaching (derivative).

Self-Examination

Q1.

What are the three components of a PID controller and how do they work together?

Q2.

How do chemical engineers design control systems for unstable processes?

Q3.

Why is stability analysis important in process control design?