Sudden oscillation 0.4.1

My BrewPi Spark is running on version 0.4.1 with complete standard settings, the only thing I changed is the minimum cooler on time to 300 second.

The setup was running just fine for days. There was no change to the setup at all, not even the slightes movement of the sensor or anything. I am now getting a huge oscillation:

What is the best way to completly reset the spark / BrewPi? How could I solve this problem? Which values should I provide for you to be able to help?

This BrewPi is beeing used for a Kegerator which is at my lager temperature of 1 degree celsius. The beer sensor is in a 1L bottle and the mode is Beer constant. This setup was running fine with 0.2.11.

Can you provide a zoomed in screenshot of the middle part and the right part of the chart?

Sorry, I had to go home, I have not setup remote access. It looks like during the last few hours it stabilized a little, I will tell you tomorrow if it really did. However, still no change to the setup at all.



Some information’s about my setup that might be helpful:

  • There is only a cooler, no heating device
  • The beer sensor is actually no in the beer but in a 1 liter bottle filled with water. When in Beer Constant Mode BrewPi is actually controlling this bottle
  • The fridge sensor is in front of the fan and should therefore really measure the correct temperature

Let me know what further information’s you need.

Please show including your fridge temperature. And tell me what your filtering settings are for the PIDs



I did no changes to the filtering settings at all, so basically all factory default.
Beer-to-Fridge proportional gain (Kp): 2
Beer-to-Fridge integral time constant (Ti): 7200
Beer-to-Fridge derivative time constant (Td): 50
Maximum difference between fridge and beer set point (= output of PID): 10
Beer-to-Fridge Input filter delay time: 159 seconds
Beer-to-Fridge Derivative filter delay time: 159 seconds
Cooler proportional gain (Kp):5
Cooler integral time constant (Ti): 1800
Cooler derivative time constant (Td): 60
Cooler PWM period (seconds): 1200
Cooler minimum OFF time: 300
Cooler minimum ON time: 300
Cooler Input filter delay time: 39 seconds
Cooler Derivative filter delay time: 159 seconds

Btw, is it normal that the “Control Algorithm” looks like that?

Please zoom in on 4-5 cycles, I cannot see enough detail with so many cycles on the screen.



Another info: My fan is only running when the fridge is cooling. This explains why the temperature always raises when the fridge starts cooling. I wanted to changes this, but I think it is no a good moment right now. Or should I just try “always on”?

The algorithm is designed to work like this: the fridge temperature responds first to the actuators, then the beer is cooled/heated by the air in the fridge. Please place your fridge sensors at a place for which this is true (closer to the back of the fridge).

It looks like as soon as the fridge turns on, the beer and fridge temperature rises. Can you explain that?

If the temperature rises when the cooler turns on, of course the algorithm will be confused. I would switch the fan to constant on. Or set it up as manual actuator. That will probably fix most of your problems. We can take it from there after you have made that change.

I don’t think the position of my sensors is bad. This setups has been running for multiple month without any problem at all. It has also been running fine on 0.4.1 and in my opinion such an oscilation can not be explained with the sensor position if the sensors have not been moved.

As I have written my fan is only on when the cooling is running. This is also the reason why my temperature raises once the cooling and therefore the fan starts. The algorythm of BrewPi has handled this without any problems in the past.

Well, it has stabalized now and the problem is therefore solved. I also changed the fan to always on which improved the precision quite a bit. However, the oscilation I got out of nothing still not explained so far.

This chart gives a hint for the cause of the oscillation:

As you can see, the fridge response is a bit delayed compared to the setpoint and the beer a bit delayed after the fridge temperature. Recirculating the air continuously instead of only when the fridge is on reduces these delays.

Why is it oscillating? When the beer temp is too high, the fridge setpoint is under the beer setpoint, but once the fridge temp has reached that previous setpoint (delayed), the beer has already cooled.

I think the behavior will be a lot better if you reduce the time constant for the cooler integrator (Ti). The fridge does not reach the setpoint, so the integrator slowly increases. Then later, when it is under setpoint, the integrator increases. But the integrator seems to be adjusting too slow, and is always behind.

OK, I have changed “Cooler integral time constant (Ti): 1800” to 900. I will report back how things changed.