-
Notifications
You must be signed in to change notification settings - Fork 0
Recommended Tuning Procedure
The controller should normally be tuned in stages.
Configure:
pid.setTunings(
Kp,
0.0,
0.0);Increase Kp until the system responds sufficiently fast without becoming excessively oscillatory.
A pure proportional controller may leave a steady-state error. That is acceptable during this step.
Next configure:
pid.setTunings(
Kp,
0.0,
Kd);Increase Kd gradually.
The derivative term should reduce the output when the measured value approaches the setpoint quickly.
Desired behavior:
Process value
Setpoint -----------------------------------
+-------------
+--+
+--+
+--+
---------------------+
The objective is to slow the approach before the setpoint is crossed.
If the D term becomes noisy, increase the derivative filter time constant.
Example:
pid.setDerivativeFilter(0.5);Only after P and D behave well should Ki be introduced.
Example:
pid.setTunings(
Kp,
Ki,
Kd);Use a small Ki.
The purpose of the integral term should primarily be to remove the remaining steady-state error.
For slow systems it is recommended to combine integral action with:
pid.setIntegralActivationRange(...);This prevents the integral term from accumulating excessively while the process is still far away from the setpoint.
Example:
pid.setTolerance(2);This freezes the integral term within ±2 % of the setpoint.
P and D remain active.
This avoids unnecessary integral activity around the target value.
Example:
pid.setOutputSlewRate(150.0);Use the slew-rate limiter when the actuator or process reacts too aggressively to large controller output changes.
The slew-rate limiter should not be used as a replacement for correct PID tuning. It is an additional constraint on actuator dynamics.
Assume:
Setpoint = 100
Integral activation range = 10
Tolerance = 2 %
Then the integral term behaves approximately as follows:
Actual value Integral behavior
< 90 Disabled
90 ... 97 Active
98 ... 102 Frozen
103 ... 110 Active
> 110 Disabled
P and D remain active over the entire range.