Back to Index

Definition: pid("id", sp, pv, kp, ki, kd, dt_ms, out_min, out_max)

Computes a PID output using controller state stored by id. The function returns a float result and updates internal integral/derivative terms.

Arguments

Example

every(1000) {
  out = pid("pump", 40, temp(), 1.0, 0.1, 0.05, 1000, 0, 100);
  actuator(1) = out;
}