a) It will when you add the integrator.
b) Achieved output value is calculated over the last 2 PWM cycles, which is why it lags a bit
6 hours because you want it to span a few PWM cycles. 4h might also work.
I think trying a 20m PWM period will also help your situation.
Heating the fridge with a 30W heater while you are trying to cool it is silly. Why not put the fan on a 5m PWM at 5% so it runs for 15s every 5 minutes? That’s enough to recirculate the air without heating it too much.
After the last graph, you think Kp is large enough?
I was aiming to maximize it without getting it to oscillate.
Agree, a shorter PWM cycle will help, but tax the compressor more.
I can shorten the cycle time if the fluctuations show themselves in the beer temp. If they don’t, then a longer cycle time is best for the compressor.
I realize this is a cheap, almost disposable freezer, but that commercial upright I’m planning on is almost $2k.
I agree with the fan. I guess all I can claim is being lazy.
I’ll go ahead and wire it up to a relay.
At least it heats up a lot less. When set to zero, the pwm achieved value is set to zero too. I’ll try if I can do a gradual decrease there too. Might work better in relation to the PID.
With the fan not heating things up, I had to lower Kp even more to keep from undershooting. There is still a bit of undershoot from 0600 - 01000, but I think that may have to do with the ambient temp cooling off during that time. I think I’ve settled on a good Kp value.
You can see the ripple of the 5 minute PWM for the fan. As far as cooling beer is concerned, this ripple is meaningless.
I still have the cooling PWM set to 30m, but it seems to have settled on ~60m periods.
I cannot even put into words why, but it seems like 6 hours (6 cycles) is the Ti value I want to try now, still with no Td.
Everything was actually going too slow, and I was thinking of increasing the I action.
Then the output value crashes to zero, just as the temp reaches the set point.
Looks like maybe that is because I lost communications with the temp sensor for a moment.
I was connecting another expansion board and sensor to the Spark and it rebooted.
I am going to blame the PWM reset to that reboot and shorten Ti some more (~90min) and try again at a warmer temp. Warmer should overshoot sooner than colder.
I has a tiny belly that corrects itself, but does not present a problem.
With Ti = 3 hours, the step down to 32°F took over 8 hours to reach the set point, even after increasing Kp to -5.5.
I do not see a need for Td at all.
If I set up a 5°F step down from ambient, it undershoots by almost 5°F, but I am not using this chamber at anything that warm. 68°F is the warmest I get.
I think I am good now, thanks to @Elco@JoeV and the rest of the community here that has shared their learning experience in the past.
Thank you all!
I settled on 3 minutes of filtering.
I found that with 10 minutes, undershoot was induced.
The ripple is not due the fan heating; just the opposite.
I created a graph of the chamber temp along width the fan actuator.
Every time the fan cuts on, the temp drops. It continues to cool for a couple minutes after the fan cuts off. The fan is moving cool air up to where the sensor is.
Glad I could do my very small part here.
I figured there was some black magic between the PID output and the PWM setting.
I figure the same has to be true for the PID to Setpoint Driver offset.
I can’t work out the transfer function, but I’m slowly tuning that beer PID.
Takes way longer to warm up 6 gallons back to ambient than air!