The contribution from the integral term is proportional to both the magnitude of the error and the duration of the error. The integral
in a PID controller is the sum of the instantaneous error over time and
gives the accumulated offset that should have been corrected
previously. The accumulated error is then multiplied by the integral
gain (
) and added to the controller output.

The integral term is given by:
The integral term accelerates the movement of the process towards
setpoint and eliminates the residual steady-state error that occurs with
a pure proportional controller. However, since the integral term
responds to accumulated errors from the past, it can cause the present
value to overshoot the setpoint value (see the section on loop tuning).