Strange Graph Plotting

I’ve been running Brewpi for several months flawlessly. It’s been helping me make great brews. Thank you Brewpi team! Just recently while using a temperature controlled profile fermentation, the graph plotting changed and I don’t know why? Brewpi accuracy was within a 0.5 degrees, suddenly it’s moved to parallel the temp profile and moved to a 1 degree difference. The amplitude of both the fridge setting and the fridge temp have been reduced. Could this be a sensor fault? Loss of Calibration? Any suggestions?? Thank you!

This effect appears to have started around March 30 of the current ferment, right? It’s difficult to tell from the graph but it looks like up until that date your Beer Temp and Beer Setting were in very close proximity, but the two plots diverged even before you ramped up above 65F (diacetyl rest?) and have stayed consistently apart since then.

Perhaps not coincidentally it also appears that, starting March 30, your Fridge Temp started oscillating pretty fast even though there seems to be little actuator activity during that same period (and Fridge Setting stopped oscillating at this same time). The number of actuator events starting at March 30 definitely does not correspond to the number of oscillations on Fridge Temp over that same period. Granted, we’re typically talking about <= 2 degrees amplitude on the variations in Fridge Temp, but the regularity and frequency of these oscillations indicates that it’s not a natural effect like daytime rise in ambient temp. Did you take any updates to the Brewpi code or Spark/RPi firmware during the current ferment? Did a cat get into the fridge and start pawing at the fridge sensor?

I have created an Excel spreadsheet which takes the CSV download and plots beer temp, beer setting, and % error. I bet you would see about 0.1% error with this same spreadsheet until Mar 30, and then a step-function jump to about 1.5%.

Hi Dan,

Thanks for the fast reply. You are correct the system was working perfect until March 30. Does Brewpi auto update in any way? I’ve uploaded the stderr.txt log, it shows a temperature sensor disconnect at pin#18. What do you think happened? Thanks for the help, I really appreciate it.

stderr.pdf (57.4 KB)

I’m not aware that BrewPi does any auto-updates. Is it possible that your temp sensor is one of those which Elco has mentioned may have a bad crimp? Refer to the pinned thread entitled “Bad RJ11 crimp on temperature sensors in early orders”. I’m not sure what constitutes an early order but from your original post it sounds like you have had your sensors for at least a few months.

Over the past 24 hours I have also seen some unexpected behavior w.r.t. a decoupling between Beer Temp and Beer Setting, which is why I got involved early on this thread. Throughout my current logging BT and BS were inseparable as the temp ramped up from 65F to 71F. But when the cold crash started there was an immediate decoupling. See here:

At the outset of the cold crash Beer Temp decided to get about 1.5F of separation from Beer Setting and then track it down roughly in parallel. The cooling cycles were frequent and very short during this period, averaging about 4.5 minutes of cooling before going Idle for 15 mins. But it’s surely within the freezer’s capability to remain on longer, so I was puzzled that this didn’t happen.

BS’s downward ramp got less severe and eventually BT caught up with BS at about 47F, then tracked it closely. Notice during this period of normal behavior that the cooling cycles doubled in length and happened less frequently.

But then, at about 39F and for unknown reasons, BT went off the rails again and the cooling cycles went back to being short and frequent. I have started to fiddle with Kp, Ki, etc. in an attempt to see if I can force the freezer to stay on longer.

My current Advanced Settings are:

  • Temperature format = F
  • Temperature setting minimum = 25
  • Temperature setting maximum = 86
  • PID: Kp = 7.5
  • PID: Ki = 0.125
  • PID: Kd = -1.5
  • PID: maximum = 18
  • Integrator: maximum temp error °F = 0.898
  • Temperature idle range top = 1.799
  • Temperature idle range bottom = -1.799
  • Heating target upper bound = 0.537
  • Heating target lower bound = -0.357
  • Cooling target upper bound = 0.357
  • Cooling target lower bound = -0.537
  • Maximum time in seconds for heating overshoot estimator = 600
  • Maximum time in seconds for cooling overshoot estimator = 1200
  • Beer fast filter delay time = 78 seconds
  • Beer slow filter delay time = 159 seconds
  • Beer slope filter delay time = 8 minutes
  • Fridge fast filter delay time = 18 seconds
  • Fridge slow filter delay time = 159 seconds
  • Fridge slope filter delay time = 4 minutes
  • Use light as heater = No
  • Trigger rotary encoder at every = Full step

Hi Dan,

My settings are quite difference from yours. Maybe we can solve this problem since we both seem to have the same issue. Here’s my current Advanced Settings:

•Temperature format = F
•Temperature setting minimum = 33.8
•Temperature setting maximum = 86.0
•PID: Kp = 2.5
•PID: Ki = 1.0
•PID: Kd = -0.25
•PID: maximum = 4.998
•Integrator: maximum temp error °F = 0.248
•Temperature idle range top = 1.248
•Temperature idle range bottom = -1.248
•Heating target upper bound = 0.537
•Heating target lower bound = -0.357
•Cooling target upper bound = 0.357
•Cooling target lower bound = -0.537
•Maximum time in seconds for heating overshoot estimator = 600
•Maximum time in seconds for cooling overshoot estimator = 1200
•Beer fast filter delay time = 78 seconds
•Beer slow filter delay time = 159 seconds
•Beer slope filter delay time = 8 minutes
•Fridge fast filter delay time = 78 seconds
•Fridge slow filter delay time = 159 seconds
•Fridge slope filter delay time = 4 minutes
•Use light as heater = No
•Trigger rotary encoder at every = Full step



Reply as linked Topic


 Watching

You will receive notifications because you created this topic.

Suggested Topics






No graph after changing to a new brew/profile Troubleshooting 9 108 Feb 27
Error setting Constant Mode with Spark Troubleshooting 8 125 4d
Trouble flashing spark 0.2.7 and now 0.2.6 does not load Troubleshooting 3 57 24h
Instructions for Spark Troubleshooting 13 282 7h
Traceback - Beer Name Troubleshooting 3 97 Jan 12

Want to read more? Browse other topics in Troubleshooting or view latest topics.

OK, so the only differences are shown in the table below. I can explain the first difference: I know that I want to cold crash down to 33.8, and there is no way my beer will crash into that value if the minimum Fridge Temp is also 33.8. The other settings I am not sure yet what their detailed explanation is.

I manually bumped Kp up to 7.5 upon noticing that it allowed my fridge to drive the Beer Temp down faster. And I manually lowered Ki to 0.125 from its earlier value of .25 based on an Elco recommendation to another poster, not sure if it was the right thing to do in my case. Every other field is untouched by human hands.

Keep in mind that the fridge setting is the result of the PID calculation of the beer error. The heater and cooler make the blue line track the orange line.

To change the orange line, change Kp, Kd, Ki.
Kp: proportional, main driver, determines how far the fridge setting is from the beer temp. Error*kp = difference
Kd: derivative, if the temp is already dropping, raise setting to prevent overshoot.
Ki: integrator, accumulated error. This prevents steady state errors.

iMaxError disables the integrator when the difference is large. This could be at play here in combination with a low Kp. Dan, I think that was the issue for you at 6 am. It kicked back in at 6 pm

Thanks Elco & Dan for you hard work on this situation. Dan, I’ve made changes to my Kp, kd, Ki, also. I will keep you posted on my progress. The deviation between beer setting & beer temp have changed by 0.5 degress over the last 8 hrs closer to perfection. The big question is why do we have to “recalibrate” the PID settings? See the latest progress:
BrewpiGraph.pdf (553.6 KB)

You mainly want to increase the max error for the integral. Especially during ramps when the setpoint is continuously moving away, the integrator will fix that. It is not active in your graph.

Thanks Elco for all the help. I will try that next. Take care… :grinning:

I recommend people to pay attention to the settings which were in effect during previous logs (is this info captured?), especially those sessions which exhibited ideal behavior. There have been occasions, I would term them as successes, where the setpoint was reached fairly quickly and then held during ramps both up and down. On other occasions I have seen a pretty consistent gap between Beer Temp and Beer Setting, even though longer and/or more frequent actuator activity could easily close this gap. Consider the graph below, where the setpoint is currently moving up and the beer is tracking, but with a consistent 2F offset. More heater activity would close the gap but this isn’t happening.

So based on Elco’s latest reply I just increased “Integrator: maximum temp error °F” to 2.0, which is roughly double its prior value. I will report back on the results.

I guess I am confused here guys. I tend to over simplify things however, if you just default your PID settings what is your result? I think it’s great you are tweaking for performance/accuracy but it sounds like you have some snake eating its tail issues here.

Here’s the latest on the corrections to Kp, Kd, Ki and the Integrator: maximum temp error °F. I’ve changed Ki value to 0.125 from 1.0, Kd value to -0.75 from 0.25, Kp remained the same at 2.5. The PID seemed to re-regulate itself back where it used to be with a 0 to 0.2 of a degree accuracy. The Fridge Setting is one again “moving” in harmony. Elco & Dan, thanks for all the help and input. I have a better understanding of what’s going on now.

My graph from 4/4/2015 was with the default PID settings, prior to changing one value (Integrator). Having since made that change, the behavior seems to be more as expected. I’ll post more recent results in a day or two.

The issue is that, prior to the past few days, I had never made changes to the default PID values and typically saw good correlation between Beer Temp and Beer Setting. But I recently started seeing wacky behavior and only began fiddling with the parameters because of it.

I personally have had no complications. I understand the logic of the modifications. I was simply suggesting it to the other posters as a diagnostic step. Obviously for you the tweaks improved the issue.

I think my issues have been solved. Yesterday (April 4) I reset all of the PID parameters to their default values, then set “Integrator: maximum temp error °F” to 2.0, based on Elco’s recommendation.

You can see from the results below that, other than times where I manually inserted a new target temp into the test, my Beer Temp and Beer Setting have been tightly coupled. Right now there’s nothing but 17 gallons of water in my chamber but a week from now it will be 17 gallons of wort, so hopefully the good behavior will still be in effect then!