Releases: BrewPi/firmware
0.4.1 Algorithm improvements
Algorithm improvements to prevent overshoot and cycling.
- PWM actuator can return actual achieved PWM value based on output pin state history. This is used for anti-windup
- Anti-windup gain is different for clipping to min/max and not reaching output value due to physical limits and constraints
- When an actuator is held low by the mutex group dead time, do not let the duty build up.
- Always apply anti-windup when actuator at zero
- Derivative filter now stores values multiplied by 1024, so it can better handle small values. This makes the derivative work much better for slow changing temperatures
- New default settings with less filtering (so less delay between sensor and actuator action) and more derivative gain to prevent overshoot
0.4.0 PWM and new control algorithms
This release brings PWM support to BrewPi and splits out the control algorithm in smaller classes and independent objects.
Control
- Modular control algorithm, which is easy to scale to multiple control loops later.
- New fixed point class to represent internal temperatures and variables
- Fridge temperature now also controlled by PID. Overshoot estimation has been removed.
- PID class
- Filtering has moved inside this PID class instead of in temperature sensor class
- How integrator anti-windup is implemented has been completely reworked. It now reads back the actuator state to see if it is saturated and compensates.
- PID constants are now defined as Kp, Ti and Td (time constants for integral and derivative, instead of gains)
- Setpoint class: setpoints can be shared by multiple PIDs and are independent.
- Controller state is output as JSON using ESJ
Actuators
- Many new actuator classes, that can have each other as target. Composite PWM classes can make up more complex actuators.
- PWM actuator
- Drives another digital actuator
- Configurable PWM frequency
- Automatically adapts to achieve correct average if the actuator below has a minimum ON or OFF time. It can skip high or low cycles when near the minimum or maximum.
- Time limited actuator: guards that the actuator it is driving is high/low for a minimum time.
- Mutex actuator: Actuators can be made mutually exclusive by adding them to a Mutex group, which keeps track of their priority and serves as an arbiter to determine who can go active. Also manages a dead time for switching between actuators.
- Support for DS2413 actuators, which can also be driven with PWM
- Fixed bugs in DS2413 code. Now both outputs work correctly.
- Support for valve controller boards based on the DS2408
- Cascaded control is now implemented with a SetPoint actuator that offsets one setpoint with another
- Minimum ON and OFF time for a fridge is now configurable
General
- Boost test framework and new unit tests
- New simulations in unit tests, which output CSV files that can be plotted with Python.
- Time out on touch screen calibration on the Photon
- Temperature output is now unfiltered
- Prevent the same actuator or function to be installed twice in device manager
- Fixed alarm/buzzer sounding weird
Preliminary alpha release with PWM
Warning: untested, unstable, use at your own risk
This is a preliminary release of BrewPi with PWM actuators. I am releasing this now, because I am going on vacation in 3 days, but it sill might be usefull for some of you guys who want to control mashing or sous vide cooking. This has not been tested enough. It will have bugs. Keep an eye on it.
This is not the multi-PID PWM release I have been working on, this is just a quick fix to use PWM with BrewPi.
A quick hack to help you guys out now, until the proper firmware is out.
For fermentation control, please use release 0.2.11
How does it differ from 0.2.11?
A lot has changed compared to 0.2.11 in this release. The biggest change is that PWM is used for the actuators.
The actuators are still tied to the fridge temperature. I have only tested this release by controlling sous vide cooking in fridge constant mode.
PWM actuators
This release has pulse width modulated outputs (the ability to turn on a heater for x %), instead of full on.
The PWM duty is given by a PI controller and based on the Fridge temperature (proportional + integral). The settings for the proportional and integral gain can be changed in advanced settings. There is no auto tuning. You will have to tune manually.
In the device manager, if you check 'read values' you can see the PWM value (0-255). The proportional part is easily calculated (Kp * temperature error) and the remainder is the integral part. That can help you with tuning. Overshoot can result from too high Ki or too high Kp. I have set some defaults, but you'll have to tweak them for your setup.
Software PWM
The PWM outputs are updated irregularly, but the ON/OFF times that result are tracked and adjusted to maintain the correct average duty. Due this this, sometime a pulse will be skipped for low PWM values.
It should be possible to use PWM with OneWire actuators (on our SSR breakout board), but I have not tested this recently.
Compressor safety
The fridge output is also driven with PWM in this release. However, underneath the PWM driver is a class that protects the compressor with a minimum ON and minimum OFF time. Defaults are 2 minutes minimum ON time, 3 minutes minimum OFF time.
These are honored regardless of PWM. The PWM driver will compensate in the next cycle if it was ON or OFF longer than it wanted due to the minimum times. I have not tested this release in a fridge and I don't recommend using it for fermentation (your own risk). You might damage your fridge or ruin your beer.
PWM period
The PWM period is configurable, but I recommend leaving the defaults. These are 4 seconds for the heater, 10 minutes for the cooler.
Stripped Parts
In this release, peak detection has been removed. The integrator anti-windup has also been altered. This release does no auto-tuning at all. The waiting states (waiting to cool, waiting to heat) have also been removed.
Web interface compatibility
For the web interface, check out the feature/pwm-actuators
branch.
You can do this with our update script.
Run the update script with --ask to be presented with a choice which branch to check out:
sudo ~/brewpi-tools/updater.py --ask
When given this choice, choose the feature/pwm-actuators
branch:
Available branches on the remote 'origin' for /var/www:
[0] develop
[1] feature/pwm-actuators
[2] master
[3] Skip updating this repository
Enter the number of the branch you wish to update [master]: 1
Programming your Photon/Core
I have updated flashDfu.py to download releases by tag.
flashDfu.py (in the script/utils directory) will download the firmware for you. Do not use the web interface. Stop the BrewPi script. Then put your Photon/Core in DFU mode by holding the mode/setup button while you plug in the USB cable. After 5 seconds, it will start blinking yellow to indicate it is in DFU mode.
On the BrewPi Spark V1, the mode button is under the hole closest to the Dutch flag.
You can get the PWM actuators release by running:
sudo python /home/brewpi/utils/flashDfu.py --tag 0.3.0a
If you have a Photon running an up to date system image, you can automatically reboot it in DFU mode:
sudo python /home/brewpi/utils/flashDfu.py --tag 0.3.0a --autodfu
flashDfu.py will download the firmware for you and flashes it to your core/photon. Then it resets the EEPROM, a necessary step. If it does not say it has reset the EEPROM (after opening the serial port), but it has updated your device, do this manually by running:
echo -ne 'E\n' > /dev/ttyACM0
(assuming your device is /dev/tty/ACM0, check with ls/dev/ttyA*)
0.2.11 Photon support
Whats new?
This release adds support for the Particle Photon.
It also fixes a small bug in sensor calibration.
How to update?
The update process for the Spark Core is the same as before, just upload via the web interface.
For a Photon or unprogrammed Spark Core, please update your script and then run util/flashDfu.py
You will have to put your device in DFU mode by holding the mode/setup button for 5 seconds after reset. flashDfu.py will also update the system framework on the Photon.
0.2.10
0.2.9
Firmware 0.2.8: Fermentation GUI
This release adds a new GUI screen for fermentation control which shows beer temperature, fridge temperature, room temperature, setpoints, mode and current state (heating/cooling/etc).
It also adds Arduino support again. We do not recommend the Arduino for new users, but want to support our existing users on the Arduino platform as long this is possibible.
For a full list of changes, please refer to our changelog.
Firmware 0.2.7 (only for spark - alpha release)
This release changes 2 things from 0.2.6:
- The buttons to toggle actuators on the test screen read the actual pin state, so when the BrewPi temperature control algorithm changes the pin state, the UI stays up to date and does not interfere.
- The output pins default to non-inverted on the Spark, to match the hardware.
This release should be usable as a temp controller. It still shows the hardware test UI on the screen, but when the controller is configured in fridge or beer control mode, it reduces the update frequency and does not interfere.
You can flash it to your Spark Core and try controlling a fridge. Please be aware that this is a very early release and do not trust it with beer.
To flash it via the web UI, please update both brewpi-script and brewpi-www to the latest commit in develop.
Updated release with bugfix for serial timeout and moved tag at 10-3-2015 to fix issues with temp sensors address not being received correctly from the Raspberry Pi.
Firmware 0.2.6 FCS
- Hardware test screen with instructions for upgrading
- temp sensors connected and monitored
- actuators to be toggled.
- Full brewpi app is running in the background, controller is presently disabled by default, but can be enabled in the web UI.
- We will be releasing often - at least every 2 weeks. Firmware updates via the web UI.