Cool. Just for clarity: Kp of 15 for driving this offset actuator means that if the beer is 1 degree too low, make the fridge setpoint 15 degrees above beer setpoint. That’s pretty aggressive.
Ack.
I think from earlier, you said:
Kp 5, Ti 4h Td 15m
For some reason my friends, what I though was defaults was:
Kp 20, Ti 2h, Td 0s
I’ll drop Kp to 5, and see how it goes. I’ll leave the others alone and I will try them tomorrow when I can monitor it.
Those changes have definitely tightened up the variance, and it looks much better.
There were made at about 22:00 April 22, the difference after setting in is pretty obvious.
Thanks for that!
I am now tuning my friends fridge which, understandably, has very different behaviour
After a quick blip of the compressor, his fridge only recovers some of the temperature and it needs to wait for the mutex to be released before it can bring the environment back up to the setpoint. My first instincts would be to reduce the cool actuators extra lock time to 10 minutes, which is about where it starts to flatten out after the blip. But I have been wrong on first instincts a couple of times here. Any suggestions?
I’ll say it again, for PID tuning, look at the PID graph. Not the overal temperature. The internals of the PID are what you want to see.
Reducing the lock time is not the solution. You want it at an hour. You don’t want to alternate between heating and cooling. You want to not overshoot.
Probably Kp is too high for the heater. But, PID charts!
Heat Kp is way too high. You are always at 100% or zero. Maybe a bit high on the cooler too.
Mutex lockout time: you want it high, like an hour. If you have just cooled, you want it to rise naturally afterwards. You don’t want to push the process in both directions all the time. You are either only cooling or only heating generally.
Td too high on both. It should just cancel out a bit of P, not be dominant.
Current settings:
Heat: Kp=100, Ti=6h, Td=5m
Cool Kp=-50, Ti=6h, Td-5m
New settings
Heat: Kp=66, Ti=6h, Td=0
Cool Kp=-40, Ti=6h, Td=0
Appreciate the feedback, will see how this goes.
Don’t forget to make sure the cooler locks the mutex for an hour. And perhaps Kp could be even lower.
Yeah, I just upped the heater mutex hold from 20m to an hour also to address what you are saying as just before it recovers is about when the mutex is released
And you are right, less Kp as it it still overshooting
New brew, new interesting behaviour
I have had this beer in the fermenter for about three days and it has settled about 0.2c above my setpoint. 0.2c is fine and I am not worried about that, but I assumed it should hit my set point at some stage.
Initially I think to much of it assuming that the I portion of the beer PID should nudge it to my setpoint over time, but this doesn’t seem to be the case
Kp=5, Ti=4h, Td=15m
My understanding is that the I value will reach it’s maximum contribution after Ti of steady state, so if it has been 0.2 off for 6 it’s no longer going to contribute. Not sure if this is right.
There is no change in temp, do Td obviously won’t contribute, so the only other option is Kp, which I adjusted a couple of time which did help drive it closer to the set point, but it started making the fridge setpoint jump around a lot more.
Those quick jumps in setpoints is where I was changing Kp, first to 6, then to 7, the back to 5 before I went to bed.
Any pointers for reducing this last error?
Below is my Cool PID:
I also seems consistent over the time frame.
Kp=-50,Ti=6h, Td=30m
Please zoom in a bit
I moved Target and Input to Y2, not sure if this helps. Or by zoom did want it over a shorter period?
Also, the CSV for the graph.
graph-Ferment Beer PID-brewpi-downsample_10m.csv (42.7 KB)
Yes, a shorter period.
I think the quick spikes up are causing anti-windup.
You are showing zoomed in graphs of the heater, which is off. The output is negative, as it should be.
The PID for the cooler is what you need to show me. I think your Kp of -50 is too aggressive, resulting in fast swings that the output actuator cannot follow. If the actuator cannot even follow the setting, the integral will not increase further. That’s the goal of anti-windup.
The fast swings in setting for the actuator can be due to the derivative or the high Kp. I think High Kp is the main culprit. You can also increase the filtering a bit in the setpoint.
Cool PID for the last 4 hours
Last 1 Hour
I thought the anti-wind up only kicked in when the output hits 100%
Happy to halve the Kp on the Cool PID from -50 to -25, see what it does.
The cool actuator has minimum on/off time of 1min/5mins
Is it a fridge compressor? Your cycle might be a bit short. 30 or 40 minutes is fine.
The compressor runs for such short burst now that it can hardly build up any pressure. It could be however that your period is shorted by the algorithm because the setting changes quickly. Reducing Kp and Td will help with that.
I was not looking at this correctly. I forgot that it was indirect control.
This makes it a bit more complex. The beer PID, which sets the fridge setpoint, is pretty stable. The output target fluctuates around -1.2 degrees offset, and the fridge fluctuates around that pretty nicely.
I think though that there might be an issue with the derivative lagging the temperature in the cool PID, because of the have filtering that goes with a 30m Td.
Your fridge overshoot seems to be only about 5 minutes. Can you reduce Td to that?
You can see that the integrator for the fridge is zero, because the setting fluctuates so quickly. A less aggressive setup, with reduced Kp will help with that. You want the fridge to run at a steady state with the integral part fairly constant too.
The cool graph is a bit weird and I am a bit puzzled. I will have to try to reproduce this. I would expect the output value should be smoother. Are you on the most recent version?
the 05/27 release dropped just before I put the beer on, so I’m on 2020-05-14T17:28:57.258Z
Cool PID:
Kp -50 to -25
Ti stays at 6h
Td 30m to 5m
The period on the Cool PWM is 30 mins, so I’ll keep that there for the moment.
Early on I had the min on time for the compressor at 3mins, but it would throw it really low as it seems to be super effective. If the change in the cool PID doesn’t help, I’ll look into it.
Where is your fridge sensor placed? If it is really close the wall of the fridge, it might respond quickly, but not be very representative of the air temperature in the fridge.
Here is a potato quality photo:
Its about 20cm from the back wall, 8cm from the side and about 8cm from the beer.
On the back panel, the vents for the cooling are that line that runs mid way up, underneath that coiled up power cord. The air could be blowing on it. I can tape it up and see. Air can come out from the top also. It draws from the space under the MDF, there is a reptile heater down there.