• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

BCS 2 Vessel No Sparge Garage Brewery Build

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
There is no time scale on that graph. Anyway, not sure it matters but the graph shows an unstable system, which is an incorrectly tuned PID system. Those coefficients are the default so they should work with a moderately sized system (enough thermal mass, which yours has).
 
There is no time scale on that graph. Anyway, not sure it matters but the graph shows an unstable system, which is an incorrectly tuned PID system. Those coefficients are the default so they should work with a moderately sized system (enough thermal mass, which yours has).

yea I believe each grid is 5 minutes. But yea I think we can all agree its not even close to intune.
 
Can you explain what the integral clamps do?

Something like this, starting from the algorithm from the BCS wiki:

Code:
pid_output = pTerm + iTerm - dTerm;

where
pTerm = pGain * err;
iTerm = iGain * iState;
dTerm = dGain * (curr_temp - previous_temp);

The pTerm is simply the difference in the setpoint and actual temperature multiplied by some factor. For example lets say the setpoint is 152 and the actual temperature is 150, and we are using the default gains, the pTerm would = (20 * (152-150)) = 20*2 = 40% duty cycle. The iTerm would = (0.5 * (152-150)) + previous_iTerm = previous_iTerm + 1% duty cycle. Let's forget about the dTerm for the moment.

You can see that the iTerm accumulates. If we started out at a real low temperature or we're climbing slowly, the iTerm *by it self* could grow to 200+% duty cycle or what ever. Lets say our actual temp is now at 153, the pTerm would calculate to (20*-1)=-20% duty cycle but without limits the accumulated iTerm could be at +1,000% duty cycle or even higher! In this situation it might take a really long time for the iTerm to come back down to a reasonable level if it's only coming down at (0.5*-1)=-0.5% at a time. This is called windup. The integral clamp allows you to set upper and lower bounds to the iTerm and help mitigate windup.

Code:
pid_output = pTerm + iTerm - dTerm;

where
pTerm = pGain * err;

iTerm = iGain * iState;
  if iTerm < lower_i_limit then
    iTerm = lower_i_limit
  else if iTerm > upper_i_limit then
    iTerm = upper_i_limit
  end if

dTerm = dGain * (curr_temp - previous_temp);
 
I did see the wiki and am going to be mucking with it more tonight for sure. Can you explain what the integral clamps do? I don't understand them. I believe I understand the pulse ones but not the integral limits.

The integral has a tendency to "wind up". This is when the temp has been below the setpoint for a while and the integral value has reached its max. Once you get above the setpoint the output will still be on until the integral unwinds. This will cause your overshoot to be larger and longer in duration. By limiting the max of the integral it won't windup as much and therefore will take less time to unwind during the initial overshoot.

I set the min integral to 0 because we will never need a negative steady state integral. By letting the integral go negative during the overshoot, it will take longer for it to turn positive again after the temp falls back below the setpoint after the initial overshoot.

Long story short the integral clamps are used to reduce overshoot and settling times.
 
Something like this, starting from the algorithm from the BCS wiki:

Code:
pid_output = pTerm + iTerm - dTerm;

where
pTerm = pGain * err;
iTerm = iGain * iState;
dTerm = dGain * (curr_temp - previous_temp);

The pTerm is simply the difference in the setpoint and actual temperature multiplied by some factor. For example lets say the setpoint is 152 and the actual temperature is 150, and we are using the default gains, the pTerm would = (20 * (152-150)) = 20*2 = 40% duty cycle. The iTerm would = (0.5 * (152-150)) + previous_iTerm = previous_iTerm + 1% duty cycle. Let's forget about the dTerm for the moment.

You can see that the iTerm accumulates. If we started out at a real low temperature or we're climbing slowly, the iTerm *by it self* could grow to 200+% duty cycle or what ever. Lets say our actual temp is now at 153, the pTerm would calculate to (20*-1)=-20% duty cycle but without limits the iTerm could be at +1,000% duty cycle or even higher! In this situation it might take a really long time for the iTerm to come back down to a reasonable level. This is called windup. The integral clamp allows you to set upper and lower bounds to the iTerm and help mitigate windup.

Code:
pid_output = pTerm + iTerm - dTerm;

where
pTerm = pGain * err;

iTerm = iGain * iState;
  if iTerm < lower_i_limit then
    iTerm = lower_i_limit
  else if iTerm > upper_i_limit then
    iTerm = upper_i_limit
  end if

dTerm = dGain * (curr_temp - previous_temp);
awesome that was super helpful. they are defaulted to 0-100, I assume this is a decent starting point for this type of system, but now I can tweak them and know what they do if need be. :)
 
I set the min integral to 0 because we will never need a negative steady state integral. By letting the integral go negative during the overshoot, it will take longer for it to turn positive again after the temp falls back below the setpoint after the initial overshoot.

This is very sound advice, and I had not considered it before. Since heating or cooling is "one-way", flattening this makes sense.
 
This is very sound advice, and I had not considered it before. Since heating or cooling is "one-way", flattening this makes sense.

Makes perfect sense.

In the same vein, just off the top of my head, what about setting the upper bound to something around the system's 'maintenance' duty-cycle. Maybe that's a little too subjective.
 
Makes perfect sense.

In the same vein, just off the top of my head, what about setting the upper bound to something around the system's 'maintenance' duty-cycle. Maybe that's a little too subjective.

I do something similar. I set the upper limit to 2-3 times the steady state integral value. This part is subjective as the steady state value will be different from day to day depending on the ambient temperature.
 
Yea I can get you pics next time im outside. Its basically a Tee made out of 1/2 copper pipe and has a stainless steel wool ball at the base, works and cleans up insanely good and just sits there no installation. The ball does fit 1/2 tubing, its a little big but hose clamps on either side of it keep it from sliding around on the hose. Here is the float and I can get you pics of it on the hose as well.


Thanks!

So does it tie into your drain valve or are you siphoning with it?
 
Thanks!

So does it tie into your drain valve or are you siphoning with it?

u0xwRTj.jpg

QANV9zb.jpg

Oef33mK.jpg

AkdZWAF.jpg
 
Good day all. some cool things happened. My car started (yay weather above -10), IPA has krausen, nothing crazy but its going somewhere. and PID is way way way more in tune. Its still oscillating by about .4 +- around setpoint with waves being around 2 minutes, not super sure how to dial that in but we are way closer. Dialing back max integer to 10 and max pulse to 25 were really helpfull. 'i' was definitely getting wound up and causing the massive overshoots. Probes are reading temp of trusted thermometer as well. So definitely progress. I will brew again this weekend with hopefully better results. And maybe just maybe there is a whisper of a hope the IPA will be drinkable.
:mug:
 
Good day all. some cool things happened. My car started (yay weather above -10), IPA has krausen, nothing crazy but its going somewhere. and PID is way way way more in tune. Its still oscillating by about .4 +- around setpoint with waves being around 2 minutes, not super sure how to dial that in but we are way closer. Dialing back max integer to 10 and max pulse to 25 were really helpfull. 'i' was definitely getting wound up and causing the massive overshoots. Probes are reading temp of trusted thermometer as well. So definitely progress. I will brew again this weekend with hopefully better results. And maybe just maybe there is a whisper of a hope the IPA will be drinkable.
:mug:

Really cool pickup tube you have there!
Did you need to calibrate your temp probes? I have to do mine looks like. I have filled my HLT for clean process today and hopefully can calibrate the temp probes too. One seems off by a good 7º, others might be a little more accurate.
Is your build the one with the float switches in the drain tube? Was wondering if those worked as intended if so.

TD
 
Really cool pickup tube you have there!
Did you need to calibrate your temp probes? I have to do mine looks like. I have filled my HLT for clean process today and hopefully can calibrate the temp probes too. One seems off by a good 7º, others might be a little more accurate.
Is your build the one with the float switches in the drain tube? Was wondering if those worked as intended if so.

TD

They came calibrated by brewers hardware, so I haven't touched them. Yep I have the float switches in the Tee below each pot for pump cut offs, they work amazing so far. Even at full open they do not trip until the water is too low. Workes perfect for hands off lautering.
 
They came calibrated by brewers hardware, so I haven't touched them. Yep I have the float switches in the Tee below each pot for pump cut offs, they work amazing so far. Even at full open they do not trip until the water is too low. Workes perfect for hands off lautering.

BCS uses thermistors right?
 
Yeah, let's hear it.

Out of curiosity what did you end up with for your PID coefficients?
 
Mash from last brew day; setpoint 154, blue is return, green is MLT. Still has oscillation but nowhere near last time.
uOKKDb4.png

wB2o7lj.png


I knew it was going to be a bad day when my bcs was reading 2 degrees in the garage. The short version, everything was frozen, so frozen one of the ball valves broke. was able to take it apart and mend it during the mash. Lines apparently didn't drain fully so they had sections of solid ice in them. Ended up doing an hour or so whirlpool because I couldn't thaw the chiller for the life of me. Decided to just rack to carboy and chill in icy water. After cleaning up and taking the chiller inside and thawing it fully sad news was found. There was water left in the outer coil of the chiller that froze and appears to have collapsed the inner tube the wort runs through. Pretty sure its ruined beyond repair. I will cut it open to make sure but sadly I think its dead. I cant blow air through either end, its sealed shut. Here is a pic of the fallen trooper. Loved this chiller, it always worked perfect, 1 pass and done.
Q9Amwqt.jpg


Good news though, Austinhomebrew has a pretty sick deal on counterflows so I picked one of those up. Should be a lot easier to mount and drain. And I learned I think in the winter I need to take the hoses off and let them fully drain, and store the ball valves in open position when not in use. So yea any tips on how to tighten up the PID more or is this about as good as I should expect when its about 150 degreese colder ambient temp.
 
Ya... me neever. I guess that is why most in cold Wx try to brew indoors! Sorry about the expansion properties of freezing water!

Regarding the PID loop... something is wrong. It is still unstable (oscillation gets bigger over time), and that is almost hard to do. Also, the response is pretty slow... almost 8 minutes peak to peak. I think your D is too high, but certainly this needs to be tuned. BTW, you could have fixed this by changing it to a fixed duty cycle and modifying it slightly over time yourself. I see you capped the output pulse to 25% - this could be needed but with properly tuned PID this should not be necessary. I don't remember your system - will go back and look and maybe make some recommendations.
 
Ya... me neever. I guess that is why most in cold Wx try to brew indoors! Sorry about the expansion properties of freezing water!

Regarding the PID loop... something is wrong. It is still unstable (oscillation gets bigger over time), and that is almost hard to do. Also, the response is pretty slow... almost 8 minutes peak to peak. I think your D is too high, but certainly this needs to be tuned. BTW, you could have fixed this by changing it to a fixed duty cycle and modifying it slightly over time yourself. I see you capped the output pulse to 25% - this could be needed but with properly tuned PID this should not be necessary. I don't remember your system - will go back and look and maybe make some recommendations.

Yea its definitely better but not ideal. I need to just sit down again with the tuner probably and watch it graph while i tweak. Sadly its like 1 tweak per 20-30 minutes though at the moment so its a slow process.
 
Back
Top