Strange temperature behavior

Hi
I’m having some trouble figuring out whats going on with the beer temp in my fermentation chamber. It startet out fine with temperature spot on ±0,05 c the first few days, then it started swinging over 1C before it calmed down a bit to ± 0,1c. Now it seems like it ramps up again and is +.0,25C . I’m running legacy firmware on a nodemcu and fermentrack. Anything I can adjust or do I have to throw it all away and buy a Spark? Hope someone can help me out :slight_smile:


Temperature probe is from brewpi. One in a thermowell and one hanging freely in the air. There are 2 pc fans circulating air.

Your beer temp is lagging a bit on the fridge temp. This causes them to be out of phase and causes the oscillation.

To reduce the lag:

  • Less filtering on the beer temp gives less delay in the software.
  • Less integral action will reduce the build up of fridge temp offset.
  • More proportional action will reduce the need for integral action. The integral should really only act in steady state situations. If it is involved in step responses it is doing work that should be done by the proportional part and it will cause overshoot. A too low proportional gain will result it the integral trying to correct this, but the integral is slow to respond by design.
  • Measure fridge temp close to heater and cooler, so you are not building up more heat/cold than you measure.

With our new BrewBlox software on the spark, there are a bit more options for tweaking and you can see charts of all the internal values in the PID, so it is a bit easier to pin down the exact cause. The algorithms have changed a lot too.

But you should be able to tweak this to get better results. I suggest starting with no integral or derivative gain and tweaking proportional gain first. Then add a bit of integral to correct steady state. You probably don’t need derivative gain at all.

Thanks for your help :blush:
So I should set Ki and kd to 0 and kp to 10?

Yes, start with that. Optimize for Kp first, then tune Ki.

Hi again
Seems like it holds the temperature pretty good but overshoots about 0,4C when heating. Is this OK or is it possible to tune out?
Kp 10, Ki 0,1 and Kd 0.

That overshoot after a ramp is basically unavoidable with how BrewPi legacy works.
The integrator will increase to keep up with the setpoint running away and when it suddenly stops running away it takes some time to decrease again.

The integral will not increase when the output is already at max, so if you can make it clip to the max (lower max difference between fridge and beer or higher Kp) it will not wind up.

Not doing a ramp, but just an instant step will also keep the actuator at max and will cause less of an overshoot than a slow ramp funny enough.

1 Like