HBT 2015 Big Giveaway - Enter Now

Huge Supporting Membership Discounts - 20% Off

 Home Brew Forums > Truncating Integral Windup?
01-10-2013, 06:16 PM   #1
wdevauld
Feedback Score: 0 reviews
Recipes

Join Date: Jun 2012
Location: Calgary, Alberta
Posts: 29
Liked 4 Times on 4 Posts
Likes Given: 3

 Truncating Integral Windup?

So, when playing around with setpoints, I find that my error integral gets wound up to a large value in that it dominates everything else. While working out the problem, I have been running on PD mode (Setting K_i to zero).

Trying to find a better solution I hit up Wikipedia: http://en.wikipedia.org/wiki/Integral_windup

When I read the fourth solution: 'Preventing the integral term from accumulating above or below pre-determined bounds', I wondered why one of the preferred methods for controlling windup is to have the integral computed over a rolling time window.

Say you have an additional parameter, that instead of going from t=0 you start Now - Parameter seconds/minutes ago and add up all the discrete error. To me this is pretty intuitive although I am hesitant because I can't seem to find any whitepapers/websites that talk about the idea.

So for the process engineers out there, why do we set an absolute deviation on the integral instead of just time truncating it?

__________________

01-10-2013, 11:53 PM   #2
alien
Feedback Score: 1 reviews
Recipes

Join Date: Apr 2012
Posts: 1,235
Liked 65 Times on 58 Posts
Likes Given: 61

Seems an excellent question to me, maybe pitch it to Brett Beauregard who wrote the Brewtroller PID routine.

01-10-2013, 11:57 PM   #3
Protto
Feedback Score: 0 reviews
Recipes

Join Date: Aug 2011
Location: Vangsnes, Norway
Posts: 36
Liked 3 Times on 3 Posts
Likes Given: 2

What I know may not be much, and may not be the answer to your question, but anyway:

One problem with PID in temp-control is if the feedback loop get's too slow, the integral tend to wind up if set to low. The need for low, low gain together with high Integral time may be needed to avoid overshoot. This you probably allready know.

If your controller have no way of deal with the integral windup, it might be better to look at the hardware. How is the sensor set up in relation to the heatsource? Is it a fast acting RIMS (easyer to set up parameters efficiantly)? Is it a slower acting HERMS? HLT? Do you use a pump?

__________________

01-11-2013, 04:44 AM   #4
wdevauld
Feedback Score: 0 reviews
Recipes

Join Date: Jun 2012
Location: Calgary, Alberta
Posts: 29
Liked 4 Times on 4 Posts
Likes Given: 3

Alien, thanks for the contact, I'll see if Brett can tell me why this is a bad idea.

Protto, I'm running a HERMS. Basically a HEX in my HLT, all electric at about 5500 Watts. I circulate through the coil, and keep the water turning in the HLT with two pumps. It is slower naturally than a RIMS and that is likely why if I attempt a complicated mashing schedule I end up with my temperature overshooting.

__________________

01-11-2013, 02:54 PM   #5
br3ttb
Feedback Score: 0 reviews
Recipes

Join Date: Jan 2012
Location: Arlington, MA
Posts: 2

reading through this thread, I would suggest that you're barking up the wrong tree. if you're using the stock brewtroller pid, the overshoot you're seeing isn't caused by reset windup. I don't know if I'd call that version of the pid a well-oiled machine, but it's pretty good. you're likely to do more harm than good changing the internals.

a couple alternate suggestions:
- use less integral action. on this controller that means making the I Term bigger
- try using the SetOutputLimits() function to clamp the maximum output value (you will probably need to rescale your tunings a bit after this)
- this version of the PID library has an optional feed-forward functionality. this could let you do things to the output without confusing the pid. for example, you could force the output to 80% for 2 minutes, then drop it to 20%, all the while having the pid make additional corrections.

Cheers!

__________________

01-11-2013, 03:23 PM   #6
wdevauld
Feedback Score: 0 reviews
Recipes

Join Date: Jun 2012
Location: Calgary, Alberta
Posts: 29
Liked 4 Times on 4 Posts
Likes Given: 3

Br3ttb,
Unfortunately I'm not making use of a brewtroller. Your name came up as an expert in the field. I am currently driving all this using a Raspberry Pi, a ruby PID library and GPIO pins.

I am taking your first piece of advice, and just setting the integral term to zero so it does not effect the output at all. It is 'good enough' for now, this came out as an idea and then some concern because I couldn't find anyone else discussing the truncation of time. I'm not that smart, someone else must have thought about this.

I agree with your assessment via email, that keeping track of a time truncation would introduce a lot of overhead, and would complicate the implementation. I still may do this, I have tonnes of memory available on the Raspberry Pi, so keeping track of the last 5 minutes of 1-second samples would use up about 1kb of memory.

-W

__________________

01-11-2013, 07:31 PM   #7
Protto
Feedback Score: 0 reviews
Recipes

Join Date: Aug 2011
Location: Vangsnes, Norway
Posts: 36
Liked 3 Times on 3 Posts
Likes Given: 2

Since you'r a programmer, could you put in a function that disables the effekt of I if the temp is, lets say 5 deg off set point, and only comes into effekt when your temp is within 5 deg. That way you will avoid integral wind up when stepping up, and the integral will enshure you always reach setpoint. You can also have your P set to a realistic value (higher).

__________________

01-11-2013, 09:05 PM   #8
wdevauld
Feedback Score: 0 reviews
Recipes

Join Date: Jun 2012
Location: Calgary, Alberta
Posts: 29
Liked 4 Times on 4 Posts
Likes Given: 3

Protto, I think I get what you are saying. I believe the difference is not to have the K_i term set to zero if you are far away (5 degrees in your example), I think you want to zero out the error term so that the integral does not accumulate any values.

I may spend some time playing around with the different ideas and report back.

__________________

01-12-2013, 06:00 PM   #9
CapnBry
Feedback Score: 0 reviews
Recipes

Join Date: Oct 2012
Location: Tampa, Florida
Posts: 38
Liked 6 Times on 4 Posts
Likes Given: 1

What I do in my HeaterMeter BBQ Control project is not update the integral sum when the output is 0% or 100%. I also use something I call "integral cut", which zeros out the integral sum the first time the target temperature after setting is reached, which eliminates any large sum built up on the initial rampup.

__________________