2

I was under the impression that the P, I and D terms of a PID controller should be calculated independently of each other. That is, they would all use the same error information, but none of the three terms would be affected by either of the other 2.

But I'm looking at the microcontroller code for a turbocharger boost control system, and it appears to take the derivative term into account when calculating the integral term. If the d term is above a certain threshold, then the integral term is set to its full negative value. To me it seems to defeat the purpose of calculating 3 separate terms. This is from a real, working system so I know it functions correctly.

Is that kind of thing typical in PID controllers?

Neil_UK
  • 158,152
  • 3
  • 173
  • 387
John B
  • 223
  • 1
  • 5

1 Answers1

3

Yes, it's to prevent overshoot. The PID controller output will saturate so driving the integral term to the opposite extreme can prevent a large overshoot.

There are many approaches to this problem.

The basic issue is that the integral term continues to integrate even with the output saturated, but even in an ideal situation with a PID controller there is overshoot which may be undesirable. This is also called "reset windup".

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • Do you have a list of names for similar tweaks to PID algorithms? And why would you not have an algorithm that take over when the derivative term exceeds a threshold, but instead do something roundabout like acting through the integral term? – DKNguyen Apr 09 '20 at 20:35
  • 1
    @DKNguyen We called it ARW (anti-reset windup) and overshoot protection. There may be other names. I'm not sure how you would just use the integral term. Even if you clamp it at, say, 10% of full scale, the setpoint will effectively be shifted upward by 10% so you'll get a relatively big overshoot. The simplest approach is to stop integrating or clamp when the output is saturated but that's often insufficient. – Spehro Pefhany Apr 09 '20 at 21:32
  • Sorry, I think you misunderstood my question. What I really meant to ask was why would you not have an independent algorithm override the PID when the derivative terms is too high? It seems a bit roundabout to modify the integral term based on the derivative term. (I never meant to ask how you would do it with just using integral term) – DKNguyen Apr 09 '20 at 23:45
  • @DKNguyen The algorithm they chose is based on the rate of change of the process variable (if it's changing very quickly in the positive direction then preload the integrator with a negative constant). The rate of change, of course, is the derivative term with a tuning constant multiplier. There's a natural ratio between I and D tuning constants with typical tuning of a whole class of systems so it makes some sense to me. – Spehro Pefhany Apr 09 '20 at 23:50