I'm learning about PID controllers and one thing I don't quite understand from the pseudocode and formulas is the apparent persistence of the "Integral" portion.

For example, imagine the position is low and is adjusted with minimal oscillation to reach the set point. At that point however, the "Integral" will be low because of the duration of time spent low, and will forever stay low, thereby forcing the system to eventually compensate by overcorrecting and staying "high" for a period of time.

I feel like it would be appropriate to "reset" it when the system stabilizes or have an ongoing dampening process which slowly dampens it to zero.

Does that make sense or is there something I have misunderstood?

  • 1
    $\begingroup$ See if my answer to electronics.stackexchange.com/questions/346730/… helps clarify your thoughts. If not then please add a bit more to your question to clarify the problem. The main point is that when stable the P & D terms will go to zero and the output will be determined entirely by the I term. $\endgroup$
    – Transistor
    Jan 18 at 22:58
  • $\begingroup$ I initially had this though too, but then I figured it out why a reset wasn't there. I can't remember exactly what it was though. I think it was that by introducing a reset, you are introducing non-linear behaviour so that changes your entire control model to something other than PID, which by definition PID cannot account for. So instead you just leave the the integral term as is and give it time to "relearn" and rely on the D term to dampen the transient effects of the integral term. Abruptly changing the integral offset a massive amount while the system is in full swing isn't healthy. $\endgroup$
    – DKNguyen
    Jan 18 at 23:44
  • $\begingroup$ @Transistor That's a very good writeup, thank you for that. I think the fundamental misunderstanding I had was that I understood that the PID output is the delta of the output, and not the actual value of the output, so I expected the output to be 0 when the system is stable. Is it correct then, that the PID system outputs the actual end value of the control system? $\endgroup$ Jan 19 at 0:10
  • $\begingroup$ @CaptainCodeman Yes generally. Though that said there are extensions to pid where it slowly forgets the integral value because this summing up can be a problem if you are for a long time far away from target. $\endgroup$
    – joojaa
    Jan 19 at 4:59

1 Answer 1


You are absolutely correct. In fact this is a common, real world problem, even with industrial PID controllers. It is often referred to as "integral windup".

There are many solutions, but they fall outside of the "pure" PID algorithm. The general idea is that the integral factor is there to compensate for droop when the system is at steady state. So if you're not near steady state you may want to zero out the integral error accumulator. Another crude solution is to limit the maximum accumulated error. The overshoot you described will still occur, but the amplitude will be limited.

  • $\begingroup$ thank you for the detailed explanation $\endgroup$ Jan 21 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.