PID anti-windup

What is the present status of PID anti-windup?

It’s has been part of the firmware for a long time.

Anti-windup is applied if:

  • The actuator (PWM) is clipped to the maximum
  • The actuator is not reaching its target value

Why are you asking?

I am trying to understand what happens in detail.
Is this written down somewhere?
Is the integrator reset to zero when we have 100% PWM?
I have overshoots due to integrator windup.
This may seem messy, here is where I could use some help to get on…

Hi again,

I may perhaps be somewhat more specific.

  1. What happens when anti-windup is applied? Is the integrator reset to zero and inhibited?
  2. How is “The actuator (PWM) is clipped to the maximum” detected? 100% PWM?
  3. How is “The actuator is not reaching its target value” detected?
  4. Am I able to control action or set any parameters for this to take place?

I am looking forward to your reply, I have the feeling that I am on to something good here.

  1. Anti-windup is a numeric value subtracted from total output.
  2. Achieved PWM setting != desired PWM setting.
  3. Achieved PWM value != achieved PWM setting.
  4. Not really.

For reference, the implementation can be found here.

I do suspect you’re looking in the wrong place. Anti-windup as it is used here is a mechanism intended to handle edge cases. If your I component in the output is causing overshoot, I’d first look at configuration:

  • Too little Kp can cause I to rise too much during step response, while being fine-ish in steady state.
  • Too much Kp can cause I to be too aggressive.
  • Too much Ti can cause I to be too aggressive.
  • Too little Td prevents the D portion from counteracting overshoot caused by P and I.

Do you have any PID graph screenshots for steady state / step response?

To add some more detail to Bob’s already good answer:

The reason to have an integrator is to correct for the situation where you end up slightly under the setpoint, in equilibrium, at the point where the heating/cooling from the P part balances out energy losses to the environment. If this situation of being under the setpoint lasts too long, you want to nudge the output up a bit to find a new equilibrium at the setpoint.

The integrator will increase as long as the input of the PID is under the target value. The speed at which this happens is set by Ti, the integrator time constant. For every period Ti, the I-part will increase with an amount equal to the P-part.

You don’t want the integral to increase while you are still approaching the setpoint, so you want a Ti that is pretty long to make the integral increase only slowly.

Anti-windup ensures that the integral doesn’t increase when the output of the PID is already at its maximum, or not at the target value. If the output is not what the PID wants it to be, there is no point in increasing the output target even further.

So anti-windup does not depend on the PID input. If you have a badly configured PID, that sets the output target too high too early, it is not the job of anti-windup to correct that. Anti-windup only prevents integrator increase when the output target cannot be reached.

If you get overshoot from the integral part, it can have 2 reasons:

  • Ti is too small. This causes the integrator to increase by much already during the ramp up, instead of during the equilibrium after the ramp up.
  • Kp is too low. This causes the ramp up too take much longer than needed, also giving the integral time to increase.

Td (the derivative time constant) should be the last thing you tweak. Start with Td at zero. Get it stable with just PI control. Then you can see if you can increase Kp a bit if you also use a bit of derivative gain to reduce the output when you are moving in the right direction quickly already.

Hi again,
I am implementing a HERMS with a cascade PID. I have it working with 2 P controllers.
Today I decided to turn on I on the MT PID and set the MT PID I = 1000. P is 0.7.
There was no I response. On the PID panel the values on the left with units deg C x h and deg C / h were both zero all the time. I let it reach a stable value.
Where can I go from here?

You can override I, but it’s only temporary. Have you set your Ti setting?

Ti is set to 1000s. What do you mean by override I?

I is the output value from Integral * Kp / Ti. I asked because you actually can manually set the I value. (This is useful if you want to instantly reset the value).

I assume Kp is 0.7?

What is the current temperature error (shown in PID settings)?