Heat and cool race condition

If I’m reading this graph right, your beer temperature stays within ~0.05 degC of target. The graph looks dramatic, but Y1 only has a range of 18.4 - 20.

It might be a coincidence indeed. The beer temp sometimes drops a single bit (0.0625C).

You can see that it is a bit jumpy on the bit flip on the left side too.

I think the derivative time constant Td of the PID is a bit high and overcompensates. Try lowering it or completely disable it by setting it to zero.

Maybe I’ll introduce a separate user settable filter period for the derivative. Now it auto selects based on Td.

@Bob, @Elco
I am not sure I follow completely

1)The derivative is set to 0s on ALL PIDs (se Step Change image)!
2) look at the fridge temp setting (green curve in Graph above) before and after the update, It is a obvious difference in performance before update vs after, causing an unstability affecting the oscillating behavioir of the cool/heat system. I agree that he resulting beer temp deviation is minimal in absolute value. However, the behavioir of the heat /cool actuators are not optimal from a regulation perspective (energy usage, enviromnetal impact, and frige compressor wear and tear).

Any suggestion to the behavior?

Atle

Could you please add a graph with only the cool/heat pin states? (single click on names in the legend to disable them). That should paint a clearer picture as to what is happening physically.

… not shure this helps (since its downsampled…)

Included one for the last 24h for more detail

Your Ti is very short. The integrator should be for long term corrections and Ti should be multiple PWM cycles.

To get a smoother fridge setpoint, add some filtering in the beer setpoint the PID takes its input from.
It has a Kp of 10, which means that a single bit change of the beer sensor will cause a 0.625 change of the fridge setpoint. Exacty what we see in the graph.

You can also set the extra hold time for the heat and cool mutex constrained so they block they other one longer.

Thanks for the analysis.
-Large Fridge needs long integrator on the beer PID (~50liter batches) to avoid large over/under shoots
-The fridge has good cooling and heating capacity and can respond quickly (fridge temp). A reduction in Kp to the range -5 to -10 might dampen the oscillations.
The PWM cycle for the fridge is 20min with lock time in mutex set to 30m. The Ti covers 3 PWM cycles.
Whats your experience in how many cycles we should let the Ti biuld up by Kp?
Longer Ti would also suggest stronger proportional gain Kp in the system to reduce lag.
Ill, have a migratory approach to the tuning strategies and changing parameters.

However, my original question about any known reason for the obvious difference in behaviour before and after the upgrade is unknown?

Hope I am not anoying here. It is more about understanding changes and system behaviour :slight_smile:

Atle

The biggest change you need to make is to add some filtering to the beer setpoint.

The fluctuations in the fridge setpoint are because of the changing beer temp. With the fridge setpoint moving around quickly, it will be hard for the fridge PIDs to follow.

Smooth the input to the beer PID and it should become smoother. You have the filter set to only 15 seconds.