HVAC Systems Encyclopedia

A comprehensive encyclopedia of heating, ventilation, and air conditioning systems

PID Controllers in HVAC Applications

Control Fundamentals

PID controllers regulate HVAC processes through feedback loops. The algorithm combines three control actions—proportional, integral, and derivative—to minimize error between setpoint and measured value.

Mathematical Foundation

The PID control equation in continuous form:

$$ u(t) = K_p e(t) + K_i \int_0^t e(\tau) d\tau + K_d \frac{de(t)}{dt} $$

Where:

  • $u(t)$ = controller output (0-100%)
  • $e(t)$ = error signal = setpoint - measurement
  • $K_p$ = proportional gain
  • $K_i$ = integral gain
  • $K_d$ = derivative gain

Discrete Implementation

Digital controllers use discrete-time approximation:

$$ u_n = K_p e_n + K_i T_s \sum_{k=0}^n e_k + K_d \frac{e_n - e_{n-1}}{T_s} $$

Where:

  • $T_s$ = sampling time (seconds)
  • $n$ = current sample index

Control Actions

PID Component Contributions


graph TD
    E[Error Signal] --> P[Proportional
Immediate Response] E --> I[Integral
Eliminate Offset] E --> D[Derivative
Dampen Oscillation] P --> O[Controller Output] I --> O D --> O style P fill:#f99,stroke:#333 style I fill:#9f9,stroke:#333 style D fill:#99f,stroke:#333

Proportional Action

Direct response to current error:

$$ u_P = K_p \cdot e $$

Characteristics:

  • Immediate correction
  • Proportional band: $PB = 100 / K_p$ (%)
  • Inherent offset at steady state

Example: If $K_p = 2.0$ and $e = 3°C$:

$$ u_P = 2.0 \times 3 = 6\% \text{ output increase} $$

Integral Action

Accumulates error over time to eliminate offset:

$$ u_I = K_i \int_0^t e(\tau) d\tau $$

Characteristics:

  • Eliminates steady-state error
  • Slower response than proportional
  • Can cause overshoot and oscillation
  • Integral time: $T_i = K_p / K_i$ (seconds)

Derivative Action

Responds to rate of change:

$$ u_D = K_d \frac{de}{dt} $$

Characteristics:

  • Anticipatory control
  • Dampens overshoot
  • Sensitive to measurement noise
  • Derivative time: $T_d = K_d / K_p$ (seconds)

Standard Form

Alternative PID formulation using time constants:

$$ u(t) = K_p \left[ e(t) + \frac{1}{T_i} \int_0^t e(\tau) d\tau + T_d \frac{de(t)}{dt} \right] $$

Where:

  • $T_i$ = integral time (reset time)
  • $T_d$ = derivative time (rate time)

HVAC Applications

PID Applications in HVAC Systems

| Process | Control Variable | Manipulated Variable | Typical Tuning | |---------|-----------------|---------------------|----------------| | **Temperature Control** | Space temp | Valve position | P=2-4, I=180-300s | | **Humidity Control** | RH% | Steam valve | P=1-2, I=300-600s | | **Pressure Control** | Duct static | Fan speed | P=1-3, I=60-120s | | **Flow Control** | Flow rate | Pump speed | P=0.5-1.5, I=30-60s | | **CO₂ Control** | CO₂ ppm | Damper position | P=0.2-0.5, I=120-240s |

Tuning Methods

Ziegler-Nichols Ultimate Method

  1. Set $K_i = 0$ and $K_d = 0$
  2. Increase $K_p$ until sustained oscillation occurs
  3. Record ultimate gain $K_u$ and period $P_u$
  4. Calculate PID parameters:
$$ \begin{aligned} K_p &= 0.6 K_u \\ T_i &= 0.5 P_u \\ T_d &= 0.125 P_u \end{aligned} $$

Example:

  • $K_u = 8.0$
  • $P_u = 120$ seconds
$$ \begin{aligned} K_p &= 0.6 \times 8.0 = 4.8 \\ K_i &= K_p / T_i = 4.8 / 60 = 0.08 \\ K_d &= K_p \times T_d = 4.8 \times 15 = 72 \end{aligned} $$

Cohen-Coon Method

For first-order plus dead time (FOPDT) processes:

$$ G(s) = \frac{K e^{-\theta s}}{\tau s + 1} $$

PID parameters:

$$ \begin{aligned} K_p &= \frac{1.35 \tau}{K \theta} \left(1 + \frac{\theta}{4\tau}\right) \\ T_i &= \theta \left(\frac{2.5 + 0.5\theta/\tau}{1 + 0.6\theta/\tau}\right) \\ T_d &= \frac{0.37 \theta}{1 + 0.2\theta/\tau} \end{aligned} $$

Lambda Tuning

Specify desired closed-loop time constant $\lambda$:

$$ \begin{aligned} K_p &= \frac{\tau}{K(\lambda + \theta)} \\ T_i &= \tau \\ T_d &= 0 \end{aligned} $$

Guideline: $\lambda = 1.5\theta$ for good performance

Control Loop Performance

Step Response Characteristics


graph LR
    A[Setpoint Change] --> B[Rise Time]
    B --> C[Overshoot]
    C --> D[Settling Time]
    D --> E[Steady State]
    style B fill:#9f9,stroke:#333
    style C fill:#f99,stroke:#333
    style D fill:#99f,stroke:#333

  

Performance Metrics

Rise Time ($t_r$): Time to reach 90% of setpoint

Overshoot ($M_p$):

$$ M_p = \frac{y_{max} - y_{ss}}{y_{ss}} \times 100\% $$

Settling Time ($t_s$): Time to remain within ±2% of setpoint

Integral Absolute Error (IAE):

$$ IAE = \int_0^\infty |e(t)| dt $$

Anti-Windup Strategies

Integral windup occurs when controller output saturates. Implement anti-windup:

Back-Calculation Method

$$ \frac{du_i}{dt} = K_i e + \frac{1}{T_t}(u_{sat} - u) $$

Where:

  • $T_t$ = tracking time constant (typically $T_t = \sqrt{T_i T_d}$)
  • $u_{sat}$ = saturated output

Conditional Integration

Disable integral action when:

  • Output at limits AND
  • Error would increase integral term
$$ u_i(n+1) = \begin{cases} u_i(n) + K_i T_s e(n) & \text{if not saturated} \\ u_i(n) & \text{if saturated and } e \cdot \text{sign}(u - u_{sat}) > 0 \end{cases} $$

Derivative Filtering

Raw derivative amplifies measurement noise. Apply first-order filter:

$$ \frac{de_f}{dt} = \frac{1}{T_f}\left(\frac{de}{dt} - e_f\right) $$

Where $T_f = T_d / N$ and $N = 3$ to 10

Discrete approximation:

$$ u_{D,n} = \frac{K_d}{T_f + T_s}\left[T_f \cdot u_{D,n-1} + K_d(e_n - e_{n-1})\right] $$

Cascade Control

Inner fast loop controls valve position; outer slow loop controls temperature:

Cascade Control Structure


graph LR
    SP[Temp Setpoint] --> PC[Primary Controller
Temperature] PC --> SP2[Valve Setpoint] SP2 --> SC[Secondary Controller
Valve Position] SC --> V[Valve] V --> P[Process] P -->|Temp Feedback| PC V -->|Position Feedback| SC style PC fill:#f96,stroke:#333 style SC fill:#69f,stroke:#333

Tuning Sequence:

  1. Tune secondary (fast) loop first
  2. Tune primary (slow) loop with secondary active
  3. Primary loop integral time: $T_{i,primary} \ge 4 \times T_{i,secondary}$

Gain Scheduling

Adapt PID parameters to operating conditions:

$$ K_p(x) = K_{p,0} + \alpha x $$

Where $x$ = scheduling variable (load, setpoint, etc.)

Example: VAV box control

  • High flow: Lower gain (faster valve)
  • Low flow: Higher gain (sluggish valve)

Practical Implementation

Bumpless Transfer

When switching from manual to automatic mode:

$$ u_i(t_0) = u_{manual} - K_p e(t_0) - K_d \frac{de(t_0)}{dt} $$

Output Rate Limiting

Protect actuators from excessive slew rates:

$$ \Delta u_{max} = \pm \frac{u_{range}}{t_{full-stroke}} \times T_s $$

Troubleshooting

PID Control Problems and Solutions

| Symptom | Probable Cause | Correction | |---------|---------------|------------| | **Oscillation** | Excessive gain | Reduce $K_p$, increase $T_i$ | | **Slow response** | Low gain | Increase $K_p$, decrease $T_i$ | | **Offset** | No integral | Enable integral action | | **Overshoot** | Fast integral | Increase $T_i$ | | **Noise sensitivity** | Derivative gain | Add filtering, reduce $K_d$ | | **Windup** | Saturation | Implement anti-windup |

Advanced Topics

Model Predictive Control (MPC)

Optimizes control trajectory over prediction horizon:

$$ \min_{u} \sum_{k=1}^{N_p} \left[ Q(y_k - r_k)^2 + R(u_k - u_{k-1})^2 \right] $$

Where:

  • $N_p$ = prediction horizon
  • $Q$, $R$ = weighting matrices
  • $y_k$ = predicted output
  • $r_k$ = reference trajectory

Adaptive PID

Self-tuning algorithms adjust parameters online:

  1. Recursive parameter estimation
  2. Controller design from estimated model
  3. Update PID gains
  4. Repeat each cycle

Conclusion

PID control remains the dominant strategy in HVAC automation due to simplicity and robustness. Proper tuning matches controller dynamics to process characteristics, achieving stable regulation with minimal overshoot.

The three control actions serve distinct purposes: proportional provides immediate correction, integral eliminates steady-state error, and derivative dampens oscillation. Understanding these mechanisms enables systematic troubleshooting and performance optimization.

Modern implementations incorporate anti-windup protection, derivative filtering, and adaptive features to handle real-world constraints and disturbances.


Technical content by Evgeniy Gantman, HVAC Research Engineer