I am building an e-herms brewery similar to Kal's design. I have made a lot of changes, but I like his workflow and am emulating that. Being the geek that I am (and I suppose most people who spend time in the Automated Brewing Forum are), I am not satisfied with using an off the shelf PID. Instead, I have custom ordered a laser engraved metal keypad from China, and a large GLCD. I am using a spark core to control it, as I will eventually set it up so I can load my recipes from the web to have the mash temp/time preset, as well as hop addition reminders, etc.
I have seen many varying opinions on programming the temperature hold for the HLT. Many people have fooled around with existing PID libraries with varying levels of success. Others have written much simpler pieces of code, and that is the path I am planning on taking. Just curious what others have done? I think that with a large volume of water (10 gallons for 5 gallon batches, and 20 gallons for 10 gallon batches) that decreasing the duty cycle of the element as it approaches setpoint should be sufficient to avoid an overshoot. Here is my pseudo code I have written (but not tested). Anyone see any reason this won't work fairly well?
tempWindow is the number of degrees below setpoint where duty cycle will be varied
delta is the setpoint-actual
min is the minimum duty cycle (so if set to 30, then when the temp approaches the setpoint, it will approach 30)
I will be recirculating the water in the HLT with a pump, and measuring the temp as it exits the HLT like in Kal's design which should prevent any stratification. And my duty cycle will be switching the SSR on/off based on a 5-10 second window.
I think that with some tweaking of my duty cycle window, minimum duty cycle, and my temperature window, I should be able to achieve a decent ramp-up time and hold temps fairly well with minimal overshoot.\
Thoughts?
I have seen many varying opinions on programming the temperature hold for the HLT. Many people have fooled around with existing PID libraries with varying levels of success. Others have written much simpler pieces of code, and that is the path I am planning on taking. Just curious what others have done? I think that with a large volume of water (10 gallons for 5 gallon batches, and 20 gallons for 10 gallon batches) that decreasing the duty cycle of the element as it approaches setpoint should be sufficient to avoid an overshoot. Here is my pseudo code I have written (but not tested). Anyone see any reason this won't work fairly well?
Code:
tempWindow = 5;
min = 30;
if (delta>tempWindow)
output = 100;
else if (delta<=0)
output = 0;
else
output = (delta*(100-min)/tempWindow)+min; //can probably be refactored, this is for readibility
delta is the setpoint-actual
min is the minimum duty cycle (so if set to 30, then when the temp approaches the setpoint, it will approach 30)
I will be recirculating the water in the HLT with a pump, and measuring the temp as it exits the HLT like in Kal's design which should prevent any stratification. And my duty cycle will be switching the SSR on/off based on a 5-10 second window.
I think that with some tweaking of my duty cycle window, minimum duty cycle, and my temperature window, I should be able to achieve a decent ramp-up time and hold temps fairly well with minimal overshoot.\
Thoughts?