Question on PID settings, brewpi+spark setup (with 0.4.4) and tilt

Hi all,

A question on how to dial in my PID, after temperature is less stable than with the previous release.

I’ve set up brewpi (with spark) on the latest release past Saturday. I was especially grateful to see that latest errors were taken care of, such as reported in the ‘brewpi froze my beer’ topics – I have had similar under/overshoots and a pause in functioning.

I’ve started a brew past saturday, in beer-constant mode (18degC). Pitching temp may have been too high (though similar temp hydrated yeast slurry and wort), but I think the undershoot (-1.5degC) caused the yeast to stall. After repitching fresh yeast two days later, it’s underway now, but with +/-0.5degC variability, and this used to be less.

How can I adapt the settings?

My setup: 15L glass fermenting vessle with beer probe in a thermowell, latest raspberry NOOBS release, latest brewpi & spark releases (0.4.4 stable), tilt release of last week (not the update of 3-4 days ago). All settings default - or am I overlooking something?

Beer-to-fridge Kp=2, Ti=7200, Td=1200, max diff=10, input delay = 18sec, filter delay = 159,
Cooler Kp=10, Ti=1800, Td=200, PWM=1200, min off = 180, min on=120, input delay = 18, filter delay = 159
Heater1 Kp=10, Ti=600, Td=60, PWM=4, input delay=18, filter delay=159
Heater2 is reported in settings but I am using none.
Dead time = 1800

Edit: I’ve seen that the beer-to-fridge settings may be changed, but to what extent? Eg:

  • b2f Td from 1200 to 2400?
  • b2f max dif from 10 to 5?
  • b2f filter delay from 159 to 300?
    Or should I tweak the settings separately for heating/cooling?

Thanks for your effort and help!

I guess @Elco is able to give you some great tips. My tip is only to switch from beer constant to beer profile. You are asking it to switch from 18C to 20C in zero time. If you instead program in a rise of 1 degree every three hours you will probablu get a nicer curve. In addition, you will be more kind to the yeast :slight_smile:

I think the problem here is how slow the beer responds, which gives the integrator time to wind up.

The anti-windup doesn’t kick in because:

  • The fridge temperature is at the setpoint
  • The fridge setpoint is not clipped to min/max

You can also look at it differently: your proportional gain is not getting the beer to the setpoint (within the time the integrator increases), so the integrator is doing a job that should be done by the proportional gain.

What you need is:

  • Higher beer-to-fridge Kp. At least 5. This is the main one.
  • Your other suggested changes also sound good. You should also make the integrator slower to respond, by increasing Ti.

Don’t change your heater/cooler settings. The fridge temperature is following the setpoint just fine.

Thanks @Espen and @Elco! I’m beginning to realise what I can learn regarding the PID…

I will change the beer-to-fridge Kp (2 to 8), Ti (from 7200 to 10800), Td (from 1200 to 2400), and max difference (from 10 to 5).

Regarding the fermenting volume; should I lower these values again if I want to ferment 5L instead of 10L (in a smaller glass vessel), as 5L changes temperature more quickly, or are these values primarily dependent on the efficacy of the fridge?

They do depend on the volume and therefore the slowness of the beer temperature, but probably they’ll work for both.

Thanks for the earlier reactions, I’ve updated the parameters and things are going well. I’m running different pilot runs with different volumes and think I’ve come to an optimum with the above settings. (b2f Kp =10, b2f Ti=10800, b2f Td=1400)

I’m wondering though, is the irregular graph for the fridge setting OK? It used to be much smoother (see above).

To get a smoother fridge setting, increase the beer-to-fridge filtering settings (both filters).