Brew Pi v3 first brew PID tuning question


Greetings all. This post is a non-critical request for tuning assistance. BrewPi is working great. Just wondering if a little further PID tuning will reduce heat/cool cycling.

Here’s the first week of fermentation:

Here’s the fermentation chamber, a 7 cubic foot chest freezer with 12V low-CFM fan and a 100W ceramic heat (IR) bulb.

The wort started off warm ~ 77 F. (Our ground water is warm.) We pitched on top of the previous yeast cake (S05). Fermentation peaked and started to subside by Aug 29. The beer was strongly exothermic for 24 hours or so.

We’re having a heat wave, so the ambient temp is quite warm. The beer sensor is in a thermal well. The freezer sensor is hanging around the neck of the carboy.

Here are the PID parameters:

Beer to Fridge

I’m surprised that the heater is turning on at all. Do any PID tweaks come to mind? Mind you, I have absolutely no complaints about the stable beer temp. Nice work Elco and contributors!


I think it is the large Td in the beer to fridge PID.

It is probably not needed and can be reduced to something much less, like 60 or 120.
You can also increase the input filtering of the PID.

This will result in a smoother fridge setting.

Finally, you can increase the dead time, so it cannot switch from heating to cooling so fast. I think an hour (3600) or two (7200) would be good.

Please note that heating here is not full power heating. It’s probably heating very gently at 1% power.


Excellent. That is exactly the type of feedback I needed. Thank you.


Different setup, but mine appears to wait 30 min after heating, but not 30 min after cooling.

Any thoughts?


Those are two separate parameters.


They are not, unless you are running a DIY build. On the Spark 3, the dead time is for both.


In that case… my spark 3 has a bug?


At the same time this happened, I see a small dip in the beer setting.
Could it be the case that the spark lost power or was reset at those times? You should be able to see this in the logs.


It appear so, this is a different time period

Oct 24 2017 07:09:14 Serial Error: read failed: [Errno 104] Connection reset by peer)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/brewpi/", line 110, in __listen_thread
if self.writeln("") > 0:
File "/home/brewpi/", line 56, in writeln
return self.write(data + "\n")
File "/home/brewpi/", line 59, in write
File "/home/brewpi/", line 75, in exit_on_fatal_error
File "/home/brewpi/", line 38, in stop
self.thread.join() # wait for background thread to terminate
File "/usr/lib/python2.7/", line 931, in join
raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread

Oct 24 2017 07:09:16 Lost serial connection. Cannot write to serial
Terminating due to fatal serial error
Oct 24 2017 07:09:47 Notification: Script started for beer 'Lager attempt 1'
Oct 24 2017 07:09:47 Connecting to controller...
Oct 24 2017


I think it lost its WiFi connection. In your router, can you set it to a static channel? The firmware doesn’t handle channel switching correctly. I’m still waiting for an answer from particle related to this.