BrewPi 0.4.0 is out! This release is a complete rework of the control algorithms, you can read more about those here:
This posts describes what you need to know to update and to configure your BrewPi.
For the change log, check GitHub:
Arduino users
This new release did not fit into an Arduino and it is unlikely we can make it fit in the future. To keep using your Arduino version of BrewPi, and to prevent our update scripts from updating the UI to something that only works with 0.4.0 and later, change your branch to the âlegacyâ branch. Run the updater with --ask
. It will ask you which branch to check out. Choose âlegacyâ.
cd ~/brewpi-tools
sudo python updater.py --ask
Updating your BrewPi (BrewPi Spark Only)
To update to the latest release, you can simply run our update script from the brewpi-tools repo.
If you followed or guide, this will be in ~/brewpi-tools/
So log into your brewpi via SSH (for example using putty
And then run the following commands:
cd ~/brewpi-tools
sudo python updater.py
Quick tip: use TAB to auto-complete file names. Youâll make less errors.
The updater will update the script, web interface and dependencies. It will then ask to check for updates for your controller
Thatâs it. If you are up-to-date.
If you installed the web interface and script manually, you will have to update them manually. You can probably do this with a git pull. To update the controller run:
cd /home/brewpi/utils
sudo python updateFirmware.py
Configuring your devices
Setting up your devices has not changed. If you are lucky, they have even been restored for you.
There is one new device function: manual actuator.
If a device is configured as a manual actuator, you will get a toggle button in the device manager. This is available for digital pins and valves.
The new control algorithm and PWM
To control fermentation, BrewPi has now 3 PIDs, as described in this topic:
There is a PID for your heater, a PID for your cooler and a PID to convert the beer temperature error into a fridge setpoint. For each of these PIDs, you can configure:
- Kp: the proportional gain. The output will be Kp * error.
- Ti: the integral time constant. The proportional part is added to the integral each second. The output is integral/Ti. In other words, the integral grows the proportional part every Ti seconds.
- Td: The derivative time constant. The derivative (degrees per second) of the input is multiplied by -Td. This will lower the output when the controller is approaching the setpoint fast. Td* derivative should equal the amount of overshoot you expect.
The output of the heater PID and the cooler PID control a is a percentage (0-100). At 100, the actuator is fully ON.
The output of the beer-to-fridge PID is a temperature difference between the fridge setpoint and the beer setpoint.
The default settings should probably be okay for fermentation. For mashing, I will create a new topic.
Filtering:
The temperature filtering has moved inside each PID as an input filter and a derivative filter. My suggestion for fermentation is:
Beer-to-fridge filters: 18s and 78s.
Cooler: input 18s, derivative 78s.
Heater: input 18s, derivative 78s.
Other settings
For the heater, the PWM period is 4 seconds: it will give a variable width pulse every 4 seconds.
For the cooler, this period is 20 minutes.
For the cooler, there is a minimum ON time and minimum OFF time. This is to protect your compressor. These minimum times will be honored regardless of the PWM value. The controller is smart enough to achieve the correct average while working around them.
For the beer to fridge PID, you can set the maximum difference between fridge and beer setpoint, to prevent the fridge setpoint from running to far away from your beer setpoint.
Want to know the details?
On the control algorithm tab, you will find the state of all control objects on the controller. It is very complicated and not user friendly, but it will allow you to see all the details of what the algorithm has calculated internally.
Update 0.4.1
I discovered some things not working well in the algorithm when a heater and cooler were used to control a small volume that reacts quickly. This update prevents integrator windup and overshoot by reading back what the actuator has achieved within its constraints (minimum on/off time, mutex group dead time, etc).
It also has some changes that make the derivative work much better, which also helps to correct overshoot.
The default settings have been changed with this release. It is recommended to not restore your settings when updating from 0.4.0. You can restore your devices.