title: I don't understand Integral part of PID controller
body: <p>I dont understand integral part of PID controller. Let's assume this pseudocode from Wikipedia:</p>
  
  <pre><code>previous_error = 0
  integral = 0 
  start:
    error = setpoint - measured_value
    integral = integral + error*dt
    derivative = (error - previous_error)/dt
    output = Kp*error + Ki*integral + Kd*derivative
    previous_error = error
    wait(dt)
    goto start
  </code></pre>
  
  <p>Integral is set to zero in the beginning. And then in the loop it's integrating the error over the time. When I make a (positive) change in measured value or setpoint, the error will become positive and integral will "eat" the values over the time (from the beginning). But what I dont understand is, when error stabilizes back to zero, the integral part will still have some value (integrated errors over time) and will still contribute to the output value of controller, but it should not.</p>
  
  <p>Can somebody explain me that please?</p>