Overshoot on first run

Just got my BrewPi set up, and running a test now on an SS concial filled with 23 litres of PBW (it needed a clean anyway).

For my first test, I decided to try and ramp down from 28C to 18.5C - this is somewhat similar to what I will be doing on brew days, although I will probably start a little lower (23 C or so).

Setup is a larder fridge with the 7 gal conical, beer probe in thermowell with a 45 W tube heater at the bottom of the fridge. Fan runs constantly, all BrewPi settings are stock and the software was installed last week (sorry - I couldn’t find a way to retrieve the version - is there an easy way to do this?).

Here is the graph from my first 12 hours or so:

The issue is the big (in BrewPi terms) overshoot of a full 1 degree C. The big spike in fridge temp is when I opened the door to check the fan, and fridge temps never seem to be the same after that - but I think this might be coincidental, as beer temp was nearing target at this point. The thing that I find curious is that the fridge target temp never gets above the beer temp, even though the beer has spent some hours below its target.

Any ideas, or is this something that will just improve with time as the algorithm “learns”? I would imagine that my setup is a very standard one.

Yes, both probes are connected - the lower of the two temp displays swaps between fridge/room, but you can see the fridge temp graph as the blue line.

After leaving it running overnight, temp has now overshot 0.3 C over. It just looks like my beer temperature is very laggy (thermowell is quite deep within the beer). What PID parameters do I need to adjust to help with this? I’m also curious as to why the heater hasn’t been called on at all - is this normal? I must admit I haven’t tested the heater operation via BrewPi yet - was hoping this test run would do that.

Graph of last night:

It looks like you have set beer-to-fridge Kp to a very low value.
This results in the proportional part of PID being very low, and the integrator needs to do all the work and winds up.

You can be much more aggressive with your beer to fridge temperature difference. Increase beer to fridge Kp (multiply by 4 or 5).

Your heater has not been active, because heating was not needed to reach the fridge setting. It needed to cool to keep the fridge temp around the setpoint.

What is your beer-to-fridge filtering set to? I think you should increase the filtering, especially for the derivitive part, so you can get a smoother fridge setting.

Thanks Elco. As I mentioned, I haven’t changed any settings since installing last week.

B2F Kp = 2
B2F Ti = 7200
B2F Td = 1200
Max Set Point = 10 C
B2F input delay = 18 s
B2F derivative delay = 159 s

The cooling/heating seem quite responsive (I have tested the heater since my original post), the issue seems to be with the calculation of the set point.

Yes, exactly. B2F Kp = 2 is very slow. It means that if your beer temp is 1 degree too low, the fridge temp will be 2 degrees above beer temp. Increase Kp to 10 and the control will be a lot faster.

Thanks Elco, I will give it a go and report back on this thread.
I also read something about reducing the max set point (from 10C to 5C) to help prevent overshoot. Something else to try?
I’ll also increase the B2F derivative filter and see how that goes.

Lowering the beer-to-fridge max difference can also help against integrator windup, but I think I would leave it at 10C for you.

If the beer to fridge difference clips against the minimum/maximum, the integrator will not increase. That is why it could help. But your first step is to increase Kp, so your fridge temp is further away from the beer temp.

Hi Elco,
This is definitely a lot better than it was, but I am still getting up to 0.4 C overshoot. Not terrible, but I’m sure it that it can still be improved?

The settings now are as before, but with B2F Kp = 10 and B2F derivative delay = 649 seconds:

That indeed looks better. It seems that especially the ramps are a problem. I think you can set Kp even higher, so the beer temp will approach the setting faster and then the fridge temp is lowered to keep following the ramp.

Also make sure you are running 0.4.3. That release improved how the derivative is calculated: as the derivative of the error instead of the beer temp (which only affects ramps).

Thanks Elco, I will give it a go. The thing that seems weird to me, just looking at the graphs, is that the fridge set point stays above/below the required temp even after it has been reached. It seems to me that if every control action was shifted forward by about an hour, everything would align much more neatly, so I need to get rid of that lag somehow. I saw you mention elsewhere that increasing the integral time constant could help as well - worth a try?

Also could you please tell me an easy way to check which version I am running? I can’t see anything in the GUI.

Edit: OK - don’t worry. Found a mention in stderr.txt and I am indeed running 0.4.3.

I think your best way to resolve this would be to make sure the integrator does not wind up, only for actual long term errors. You can do that by increasing Kp to make sure it clips against the max temp difference.