Integral Control Issue?

Hi, so first of all, the BrewPi is amazing. I’m running my second brew right now. Here is my issue: the controller runs excellent the first 10 days or so, but then it starts to oscillate more than what I’d like (about 0.6 deg F peak to peak, period of about 8 hours). I took a look at my integral error and it was over 40 (seems high to me). I suspect the oscillations are due to the integral portion of the controller.

Is there a way to limit/reset the integral error? Is there a way to limit the control of the integral error if it goes over a certain point? Is there something else I can do? Seems to me there should be a period of time where the controller ‘forgets’ the integral error (e.g. integral errors only accumulate for last 12 hours).

Thanks in advance.
-Z

The integral has several checks built in to prevent windup. Also actions that decrease the integrator count double.

Could you please share a zoomed in screenshot of your chart to see what the cause is?

Also share your settings for Kp, Ki and Kd.

Here is a screenshot. Kp: 5, Ki: 0.25, Kd: -1.5 (defaults). I changed them to Kp: 2, Ki: 0.1, Kd: -1.0 per another post (not included on screenshot) on this forum but no joy.

Can you zoom in on the last part of the graph?

It looks like you are not getting much actuator action, but that might be due to the zoom level.

From 19th of May through 21st May it looks like the behavior was probably ‘as expected’ (fairly flat beer temp). Notice that the fridge setting was continuously higher than beer temp. Indeed, fridge setting averaged about two degrees higher than beer temp, and the chamber temp would quickly fall back below 68 as soon as the heat turned off. This tells me the chamber is located in an environment which is colder than 68 degrees.

Then on 22 May you start to see fridge setting dip below and then rise back above beer temp, which seemingly explains the oscillations. In fact the relevant oscillations look to be related to fridge setting, with beer temp oscillations just a secondary effect.

So for me the main question is why the behavior in fridge setting changed at May 22. Was there any environmental change, such as changes in the ambient room temp or local weather?

@Elco, thanks for the help. Here is the zoomed in portion of the graph.

@DanCook, I was away for work/vacation that whole time period. The ambient temperature would have been lower than 68, but I don’t think anything changed on the 22nd. That’s the strange part…why the change in controller behavior?

Just for S’s & G’s, I’ve been working on some Matlab code to process my data…this is the output from this brew:

Can you zoom a bit more on 2 or 3 peaks? It now looks like you have certain peaks without any actuator action on the bottom.

I suspect that your Kp is a bit low compared to Ki, which causes integrator windup (Kp is not doing it, so the controller has to rely on the integral to fix it).