7.6. PID Gains and Tuning#

The gain values affect the controller value. There are many methods to “tune” (select) the gain values for a system. However many systems are tuned manually by trial and error since it is surprisingly effective.

Let’s look at how each term contributes to learn about how to tune (select) appropriate gain values.

7.6.1. Proportional Gain#

The proportional gain controls how quickly the system moves towards the set point. Too low of a value at the system will asymptotically move towards the set point but too high and the system will overshoot the set point and oscillate.

In the example below we are assuming a constant environment.

../../_images/pid_p.png

7.6.2. Integral Gain#

Suppose this time that the external environment is cooling over time. With a P only controller, we get “steady state” error, which is a constant difference from the set point. With a low-moderate P gain the system cannot move quickly enough to correct for the additional error that has accumulated since the last measurement.

../../_images/pid_steady_state.png

To correct for this accumulated error we can introduce the integral term to have a PI controller, which sums up accumulated errors to boost the actuator setting e.g. increasing heating power.

../../_images/pid_pi.png

Notice though that the integral term can cause some amount of overshoot so it should be set conservatively to not introduce oscillations into the system.

7.6.3. Derivative Gain#

The derivative term needs to be set so that it dampens the controller output in a desirable manner. Too low and it won’t provide timely damping and overshoot will remain, too high and it will prevent the system from reaching the set point.

../../_images/pid_d.png