BrewPi Remix – What’s Old is New Again

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk:

balrog

Supporting Member
HBT Supporter
Joined
Nov 26, 2013
Messages
4,358
Reaction score
4,620
Ok. I started the apt get upgrade of the system (following your masochist instructions to do removal etc) then I will see where I am.
 

balrog

Supporting Member
HBT Supporter
Joined
Nov 26, 2013
Messages
4,358
Reaction score
4,620
I know you’re on the edge of your seat waiting to see I am ok so I thought I would let know that all is back. Carry on. Nothing to see here.
 

balrog

Supporting Member
HBT Supporter
Joined
Nov 26, 2013
Messages
4,358
Reaction score
4,620
I"m on a Dell laptop, Buster Debian 10.something.
I was on 0.7.4 according to the www page.
I ran the doUpdate.sh as user brewpi with sudo.
I heard no "Also sprach Zarathustra", but the neighbor was mowing his lawn.
I saw no errors, but I was contemplating my paperclip collection at the time, so...
After reboot, for good measure, the script would not run
I ran apt-get update and apt-get upgrade and time stool still (had to see surgeon for final rotator cuff checkup--all is well there but she said I'm not allowed to fall off my bike any more)
Still no joy

I ran the uninstall as listed on the remix website but the server specified was playing coy. Perhaps I owed it money.
I ran uninstall with another site suggested sympathetically, making sure to orient pin 1 of the cpu to face East
I ran install
All is back.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
@LBussy beer is in the fermenter and BrewPi Remix is running the glycol. The weather has been warm recently, so my water supply can only cool to 60F and I'm dong a lager that I want to start at 48F. The glycol has no problem taking it the rest of the way, so I set BrewPi to a constant beer temperature of 48F until the wort reached pitching temperature. One thing that I noticed is that default Kp, Ki, and Kd settings are a bit too aggressive. The heater kicked on a couple of times as it was cooling the wort to 48F (see attached). I started filling the fermenter at annotation A.

I'm not an expert on PID loops, so I did some googling and found a page that suggested that you only need Kp for a glycol loop. I set Ki = Kd = 0 and Kp = 1.1 and turned on the beer profile, so I'll see how this goes over then next few days. It holds at 48F for 6 hours and then starts a ramp over 100 hours from 48F to 58F.

Let me know if you have better suggestions for the PID constants. Thanks!

Screen Shot 2021-05-23 at 7.18.26 PM.png
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
Definitely need to do some tuning. With Kp = 1.1 and the temperature idle range set to +0.5 and -0.5 F, I get a lot of cycling of the cooling and heating. I'm going to try increasing the idle range to +/- 1.5 F and see if this makes any difference. I think the 27F glycol can drop the temperature very quickly and the cooling overshoots, so the heater turns on.

Any suggestions to make the algorithm more tolerant of the cooling overshoot?

Screen Shot 2021-05-24 at 7.03.33 AM.png
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
PID is black magic. :)

WAY back when I thought I was actually going to use my engineering degree, I was working on building controls. PID loops were always lots of fun. Before auto-tuning loops and other such trickery, we used to spend hours and sometimes days in a large plant tuning the loops manually. I think I have blocked out all of those memories with the other traumatic events in my life.

I need to have a look back at things but there's an overshoot estimator in there which may have tunable points. I also think keeping the glycol within a closer range of your target will help. Instead of using 27° glycol just because you can, keep it at 50° if you are controlling to 70° or something along those lines. Alternatively or perhaps as a complement to that, the use of an orifice or valve to reduce the flow would help. Scribbled in crayon (and ignoring efficiencies and so on): running a gallon of glycol at 27° through a fermenter containing 7 gallons of 70° wort, will result in a ~6° drop in temps. That's pretty significant.

I mean imagine trying to cool off your house by a degree by opening every window and door to the sub-zero weather. It's not unbelievable that you will significantly overshoot your comfort zone. If you open one window, you can control it easier. And using the rest of the above suggestion: if it's 60° degrees outside and you want to drop your house from 72° to 70°, it's pretty simple to open up some windows and get it there without freezing yourself out.

There may also be some benefits to creeping up on your target temps slowly. If you run glycol through the coils or jacket, the beer in immediate contact with that is going to be shocked and the temperature dropped precipitously. If the glycol is closer to the target temp, there's less of a shock to your yeast, and the vessel gets a chance to get some convection going to mix the temperatures inside. This should result in a more homogenous temperature within the vessel. Even a small delta will cool effectively. Glycol and wort are pretty close in mass (in comparison to the mass differential between air and wort.)

So, those are my morning musings - worth exactly what you paid for them. :)
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
I'm not an expert on PID loops, so I did some googling and found a page that suggested that you only need Kp for a glycol loop. I set Ki = Kd = 0 and Kp = 1.1
This is now tracked as #27.

Any suggestions to make the algorithm more tolerant of the cooling overshoot?
There is the ability to adjust the cooling and heating overshoot in advanced settings. These should also be auto-tuning.

Code:
void TempControl::updateEstimatedPeak(uint16_t timeLimit, temperature estimator, uint16_t sinceIdle)
{
    uint16_t activeTime = min(timeLimit, sinceIdle);                                    // heat or cool time in seconds
    temperature estimatedOvershoot = ((long_temperature)estimator * activeTime) / 3600; // overshoot estimator is in overshoot per hour
    if (stateIsCooling())
    {
        estimatedOvershoot = -estimatedOvershoot; // when cooling subtract overshoot from fridge temperature
    }
    cv.estimatedPeak = fridgeSensor->readFastFiltered() + estimatedOvershoot;
}
In theory, it will subtract the overshoot value from the fridge temp which shuts the cooling off sooner. If raising that number doesn't;t help (or doesn't stick) let me know.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
PID is black magic. :)

WAY back when I thought I was actually going to use my engineering degree, I was working on building controls. PID loops were always lots of fun. Before auto-tuning loops and other such trickery, we used to spend hours and sometimes days in a large plant tuning the loops manually. I think I have blocked out all of those memories with the other traumatic events in my life.
I was afraid that you were going to say that! I was looking at the PID algorithm, thinking "this doesn't look so bad, I can figure this out" and then very quickly realized that I was doing this... :)

I need to have a look back at things but there's an overshoot estimator in there which may have tunable points. I also think keeping the glycol within a closer range of your target will help.
I tried to reduce the complexity by setting Kp = 0 to get the algorithm to run as a simple thermostat with the bounds set by the high and low thresholds and left it alone for a day. The period of the cycle has increased and now it is only triggering the cooling to bring the temperature down, rather than cycling the cooling and heating (plot attached). I'll start from here and then work on tuning the PID loop.

Instead of using 27° glycol just because you can, keep it at 50° if you are controlling to 70° or something along those lines. Alternatively or perhaps as a complement to that, the use of an orifice or valve to reduce the flow would help. Scribbled in crayon (and ignoring efficiencies and so on): running a gallon of glycol at 27° through a fermenter containing 7 gallons of 70° wort, will result in a ~6° drop in temps. That's pretty significant.
Agreed. The only problem with this approach is that my glycol chiller also cools my long-draw draught system so I need the glycol set at 27 or 28F to prevent foaming in the lines. Experimentally, I'm seeing a 2F drop at my thermowell with the pump on for 9 minutes. The pump is 9.3 GPM max, but it has a pretty long line with a 6' rise so I'd need to calculate carefully (or measure) how much glycol is going through the loop.

There may also be some benefits to creeping up on your target temps slowly. If you run glycol through the coils or jacket, the beer in immediate contact with that is going to be shocked and the temperature dropped precipitously. If the glycol is closer to the target temp, there's less of a shock to your yeast, and the vessel gets a chance to get some convection going to mix the temperatures inside. This should result in a more homogenous temperature within the vessel. Even a small delta will cool effectively. Glycol and wort are pretty close in mass (in comparison to the mass differential between air and wort.)
I've noticed that I get quite a bit of temperature stratification in my fermenter before active fermentation starts. As a check, I'm monitoring the temperature separately with a tilt and it always reads several degrees higher than the probe in the thermowell until fermentation starts. My probe as reading 48F and the tilt was reading 51F. Convection doesn't seem to be mixing the wort very effectively. Once fermentation starts, the CO2-driven rising and falling of the yeast provides mixes the wort and evens out the temperature. At some point, I'll have to think about the geometry of the fermenter and see if this is expected given the temperature differential. I know how to do this calculation for stars, I need to think about it for wort in a fermenter...

So, those are my morning musings - worth exactly what you paid for them. :)
Thanks! What I have now is the same plant control that I had with my SSBrewtech FTSS controller, but with the logging and automated temperature ramp control that I didn't have before, so even if I get no further with the PID tuning, this is still a win.

Screen Shot 2021-05-25 at 6.23.01 AM.png
 

VictorBrew

Well-Known Member
Joined
Aug 1, 2014
Messages
50
Reaction score
11
What I have now is the same plant control that I had with my SSBrewtech FTSS controller
duncan.brown - So you basically have an on/off control, right? What are your settings to achieve this ... did you just change Kp=0? Also, are you running a different "beta" code base specific for your experiment or are you achieving this with the latest release.

I agree on the "win" of just having the basic "on/off" behavior for now, as the logging and ramp control is so valuable to have.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
@VictorBrew I'm using the glycol branch of the firmware from here and set Kp, Kd, and Ki to zero using the web interface. I set temperature idle range top to 1F and temperature idle range bottom to -1.5F. That gets the behavior in the above plot. Note that the builds in the firmware/ directory don't have some of my changes in, so you'll need to rebuild from source before you install on your arduino, or ask @LBussy to update the hex files.
 

VictorBrew

Well-Known Member
Joined
Aug 1, 2014
Messages
50
Reaction score
11
Got it. I am not sure what all you did in the glycol branch of the firmware, but I wonder if you could use the standard Rev C firmware, set Kp, Kd, and Ki to zero, use Fridge Constant mode and only the Fridge probe to accomplish the same thing?
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Got it. I am not sure what all you did in the glycol branch of the firmware, but I wonder if you could use the standard Rev C firmware, set Kp, Kd, and Ki to zero, use Fridge Constant mode and only the Fridge probe to accomplish the same thing?
Ultimately, that's what we're doing. We've also shortened or removed a lot of the compressor protection. It's built off the I2C firmware branch since that has inherent display capabilities without a shield.

Really the only thing stopping me from making this available as a "beta" test in the existing firmware workflow is a little time testing the scripts. What comes later will be some UI stuff to make it a little more apparent what's going on.
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
I do not believe Remix has any remote logging out to Brewfather (I have used it with BrewPiLess). Is there any activity or thought to add this to Remix?
I added this to the list of things I am tracking in #15. Once I get this other project release (gonna be yuge!) I will have a little more time to add some enhancements.
 

VictorBrew

Well-Known Member
Joined
Aug 1, 2014
Messages
50
Reaction score
11
I added this to the list of things I am tracking in #15. Once I get this other project release (gonna be yuge!) I will have a little more time to add some enhancements.
Sweet! I know there is always a ton of stuff to do and never enough time. Let me know if I can assist in any way when you are able to get to it.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
Got a second batch in this weekend and now both chambers are running great with BrewPi controlling the glycol.

I did a bit more research on PID tuning for glycol and the short answers seems to be "don't, just use hysteresis control," which makes sense given that you're either driving a pump relay or an on/off valve to control the fixed temperature gylcol into the fermenter. There is a post from @Vale71 last summer where they state that they are running an Auber PID for their glycol fermenter loop, but just dropping using it in hysteresis mode rather than PID mode.

@LBussy I don't think much is needed in terms of UI changes. I just turn the fermentation chamber settings off in the graph, so perhaps just a setting to enable/disable the display of the chamber temperature?
 

Attachments

OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Simple is good! I'll give it a look here in a little bit.

One thing that continues to annoy me is that the BrewPi script, while undeniably functional, is a mess. I need to get all that crap into classes and threads so it's not such a hassle every time I want to change something.
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
0.2.13 Firmware Release: Glycol!

Adds glycol support via Beer probe. DO NOT run the Glycol build against a standard compressor setup (refrigerator.) This is only for glycol control. The RevC and I2C shields are for the standard builds and have not changed since 0.2.12.

The Glycol variant uses the I2C pinouts and must use A0 as the OneWire pin.

- 774ca4a use i2c code for glycol (thanks @duncan.brown!)
- 5e93fd3 use the beer sensor for fridge when using glycol (thanks @duncan.brown!)
- 3a7d428 tighten minimum times (thanks @duncan.brown!)
- 1821291 Use Glycol index
- 32617ed Update PID values
- 2e725e2 Fix firmware naming

To switch shield types, use the /home/brewpi/utils/doFlash.sh --shield argument.
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
0.8.0 Feature Release: Glycol Support

This feature release adds support for the Glycol shield and pinouts. No UI changes have been made.

Upgrading

Existing users of BrewPi Remix 0.5.3 and above may upgrade with:
Bash:
sudo /home/brewpi/utils/doUpdate.sh
If you are not on version 0.5.3 or above (or if you have no idea what version you are on,) use the following command to upgrade to the latest version:
Bash:
curl -L upgrade.brewpiremix.com | sudo bash
You must run this from within your /home/brewpi directory or from each chamber's directory in multi-chamber mode.

Tools

No significant changes

Scripts

Commit Summary

- e5a716c Update Python interpreter declaration
- b33d8af Add "glycol" shield type
- 8d7abdc More glycol support

File Changes
Patch Links

- https://github.com/brewpi-remix/brewpi-script-rmx/pull/189.patch
- https://github.com/brewpi-remix/brewpi-script-rmx/pull/189.diff

Web UI

No changes
 

Royski

Well-Known Member
Joined
Oct 28, 2011
Messages
50
Reaction score
4
Location
Washington
Thank you so much for this project! I had an old BrewPi setup with a vintage Pi B and Arduino that I was trying to get working again and had some software trouble. Decided to try a fresh start with a Pi 3B and your software. Was ready to spend a couple hours but it wound up being a super easy install. Once the simple software install was done it was just "plug and play" with the existing Arduino, LCD, and sensors. Cheers!
 

balrog

Supporting Member
HBT Supporter
Joined
Nov 26, 2013
Messages
4,358
Reaction score
4,620
IT would appear that my temp probe measuring room temp needs to be moved as it's "seeing" the heat when the fridge runs...

1625832120159.png


I love looking at data...
 

shtank

Well-Known Member
Joined
Oct 29, 2010
Messages
162
Reaction score
6
Location
Lexington
What's up dudes!?

So grateful to see you guys still helping people make better beer! Cheers to that 🍻

So I built an OG unit Like a decade ago then stopped brewing for awhile got back in, stopped again, got back in... And you guys Lee, Day, Fuzzy and crew have helped me out SO many times. So thank you for all, for all you do!

I went to start the Ole brewpi up this time and ended up with a fresh start and a brand new image. Everything installed and loaded up great, I set the brewpi to 45* and it worked beautiful for a helles I brewed the next day.

But when I woke up the next day I couldn't reach the brewpi by its IP or @brewpi.local. I hooked up the crash cart and can see it is switching very quickly from associated to disconnected from our wifi. So I believe the issue lies somewhere in the wifi.

What is the best way to troubleshoot this and regain control of my lager that needs to come up in temp very so?
 

Attachments

OP
LBussy
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
One of the first things I would check is the signal strength:
Bash:
iwconfig wlan0
You should see something like:
Code:
wlan0     IEEE 802.11abgn  ESSID:"nixcraft5g"
          Mode:Managed  Frequency:5.18 GHz  Access Point: 74:44:44:44:57:FC
          Bit Rate=6 Mb/s   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=41/70  Signal level=-69 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:28   Missed beacon:0
The "signal level" (here, -69dBm) is the important number. The higher it is (less negative) the better. If you see it's in the -70's, you may need to reposition.
 

shtank

Well-Known Member
Joined
Oct 29, 2010
Messages
162
Reaction score
6
Location
Lexington
One of the first things I would check is the signal strength:
Bash:
iwconfig wlan0
You should see something like:
Code:
wlan0     IEEE 802.11abgn  ESSID:"nixcraft5g"
          Mode:Managed  Frequency:5.18 GHz  Access Point: 74:44:44:44:57:FC
          Bit Rate=6 Mb/s   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=41/70  Signal level=-69 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:28   Missed beacon:0
The "signal level" (here, -69dBm) is the important number. The higher it is (less negative) the better. If you see it's in the -70's, you may need to reposition.
What exactly do you mean by "reposition"? Like physically move the device close to the router?
 

shtank

Well-Known Member
Joined
Oct 29, 2010
Messages
162
Reaction score
6
Location
Lexington
That, or sometimes you can just move it a foot or two, or even swap ends.

I had a solid red LED on the pi and couldn't get it to reboot, so starting fresh again. I ordered a new power supply just in case it is a power issue.

My Rpi is an old one that I have had since Fuzzy started the OG thread. Is my Rpi out if date?
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,479
Reaction score
20,330
Location
Stow, MA
I had a couple of original Rpi Model B 512M boards go to Digital Heaven a few years ago. Bought in 2013?
Both expired due to 3.3v regulator failure. I could have fixed them, but they were dogs compared to the Model 2B's I was moving to anyway.
If you have a dodgy board, check the 3.3v...

Cheers!
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
@LBussy quick update on glycol code now that I'm four batches into the new system (two ales and two lagers). Everything is working great. I'll hack at a UI patch to add a checkbox to enable glycol in the maintenance panel. My plan is to have this switch the UI to just show beer temperature and setting and set parameters that seem to work for my setup: PID off and a reasonable hysteresis control band. People might need to tweak the hysteresis control high and low based on their glycol temperature, so I'll add a note to the instructions to do this.

Let me know if this sounds reasonable to you and I'll put a pull request in some time over the weekend or early next week.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
688
Reaction score
585
Location
Syracuse
Forgot to attach some graphs from my tilt logging showing that the beer is seeing reasonable temperatures with glycol.

Here's a fermentation profile from the BrewPi for a lager that follows a Narziss-like schedule:

Screen Shot 2021-08-05 at 6.56.02 PM.png


For comparison, here is the same beer with me manually changing the temperature on the SS Brewtech FTS controller to achieve this temperature profile:

Screen Shot 2021-08-05 at 7.09.38 PM.png


BrewPi is much nicer! Now that I have everything set up, I'll switch to logging the gravity in BrewPi.
 

Attachments

Latest posts

Top