is PID really needed?

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

GatorDad

Well-Known Member
Joined
Mar 29, 2011
Messages
220
Reaction score
5
Location
Brandon
I'm controlling temps in my fermentation chamber with an old linux 'puter and some extra parts. Now that I'm working my way into all grain, I was thinking about expanding this system to control the mashing process temps in a HERMS system.

A long time ago in a galaxy far far away, I did some PID stuff in C. I was dusting off that code last night in order to port to PHP... and I'm sure this will label me as a heretic, but.... it occurs to me that PID is probably overkill for the project. A large tub of HLT water (5+ gallons) being used to passively heat the mash (MLT) can't possibly respond fast enough to warrant a PID algo. Seems to me a simple hysteresis would work just fine for this... Eh?
 
My experience has been that a simple hysteresis will overshoot by about 2 degrees in 10 gallons of water. Probably not enough to be overly concerned with...
 
If your temp rise is slow then pid is not needed. There will be a little carryover heat when the relay or contactor opens but not much. If you had enough heat to cause a fast rise then an SCR and pid would be needed. Another trick for multiple heating elements would be to stage them with a pid loop. In our big electric boilers we use a staging controller that takes in an analog signal from a pid and energizes stages as needed.
 
To get true pid control, if you're using electrical elements you need pwm to reduce the on time as the error decreases. If you're using gas you'll need a modulating air valve for infinite control of burner btu also correlated to the error signal. As you stated with the slow response time on/off control is more than adequate.
 
rosier9: What heater wattage are you using?

Cuffers: Just one 10 gallon rubbermaid and a 1500w heater element. I don't have big electric boilers. :)

jdieter: I'm not buying a pwm switch (I'm doing this on the cheap). I could simulate it, but I just don't think it's worth the effort.

My goal is to do this in bash scripts - not a program "proper". As such, it'll run stateless. I may code a ramping function, but I won't bother with it until I see some empirical evidence I need to. All I'm doing here is heating water to a temperature. Given a somewhat reliable water source, its properties won't change significantly. This is not a slurry of constantly changing density - it's water. And it behaves in a repeatable, predictable fashion. I have discussed this with myself at great length, and we both agree. :)

KISS is my only goal here. Wait. That's not accurate: beer is my only goal! :mug:
 
Sorry I can't help u with your question, however you say
you are controlling your temps with a computer? I do some php/mysql programming for websites and would like to know more about how you hook up your computer to manage your temps.
 
If all you want is beer then hysteresis is all it takes. The evil thing about mashing though is that a few degrees variation can make the difference between getting spot on the beer you wanted with the predicted finishing gravity, or getting a thinner or sweeter beer than you had hoped. You could start with a hysteresis and see how it goes. Switch to PID if you think you need it. Software is great that way, no changes to the hardware.
 
Gatordad, I mistated regarding pwm, you are not reducing the on time but reducing output so the power to the element negates the error in the system. I'm assuming you'll be using a ss relay and without controlling frequency and voltage it's still on/off isn't it?
 
I'm using the 1-wire file system (owfs) for linux to control the 1-wire devices, and some stuff of my own to control the parallel port relays. Nothing fancy - it's really quite simple...


Sorry I can't help u with your question, however you say
you are controlling your temps with a computer? I do some php/mysql programming for websites and would like to know more about how you hook up your computer to manage your temps.
 
Agreed. I just don't think I'm going to see temp variations of 2 degrees. The DS18S20's provide 4 decimal places to the temperature reading. I don't have to (and won't) turn the heating element on/off at whole number temperatures. That window can be vary narrow.

The mash tun, which is a rubbermaid 10 gallon cooler, doesn't seem to lose more than one degree per hour anyway. Take that solution (which is at stable target temperature), run it through a heat exchanger in another mass of water that is within +-1/2 degree of target. I just don't see temperature swings of 2 degrees in this system. I don't see how it's possible (without a device failure).


If all you want is beer then hysteresis is all it takes. The evil thing about mashing though is that a few degrees variation can make the difference between getting spot on the beer you wanted with the predicted finishing gravity, or getting a thinner or sweeter beer than you had hoped. You could start with a hysteresis and see how it goes. Switch to PID if you think you need it. Software is great that way, no changes to the hardware.
 
Yup. But as I stated before, I ain't buying no pwm switch (all my "extra" money finds its way to Gainesville). To simulate a pwm with a ssr you have to play games with "on time". I'm trying to keep this simple, and, I just don't think it's necessary.


Gatordad, I mistated regarding pwm, you are not reducing the on time but reducing output so the power to the element negates the error in the system. I'm assuming you'll be using a ss relay and without controlling frequency and voltage it's still on/off isn't it?
 
Agreed. I just don't think I'm going to see temp variations of 2 degrees. The DS18S20's provide 4 decimal places to the temperature reading. I don't have to (and won't) turn the heating element on/off at whole number temperatures. That window can be vary narrow.

The mash tun, which is a rubbermaid 10 gallon cooler, doesn't seem to lose more than one degree per hour anyway. Take that solution (which is at stable target temperature), run it through a heat exchanger in another mass of water that is within +-1/2 degree of target. I just don't see temperature swings of 2 degrees in this system. I don't see how it's possible (without a device failure).

That's all true if you do not have overshoot in the system. With hysteresis the element is always all on or off which tend to exacerbate overshoot problems. Just try the hysteresis approach and see how it goes, it might work just fine, especially if you have a stirring device in the HERMS vessel. Without a stirrer I think you will see quite a bit of overshoot and stratification of the hot water.
 
Overshoot won't be an issue. The square wave effects of hysteresis are buffered by the large mass of water (in an insulated environment). If we were chatting about a 5500w element in 1 gallon of water, in a metal non-insulated pot, polled once every 60 seconds, waiting for a 1 degree change, sure. But we're not. :)

Stirrer? Well, of course. Entropy and all that jazz.


That's all true if you do not have overshoot in the system. With hysteresis the element is always all on or off which tend to exacerbate overshoot problems. Just try the hysteresis approach and see how it goes, it might work just fine, especially if you have a stirring device in the HERMS vessel. Without a stirrer I think you will see quite a bit of overshoot and stratification of the hot water.
 
Quaffer hit on one of the problems I'm still trying to solve with my MT. It's a direct fired false bottom keg with a stirrer and a Honeywell UDC3000 controller. I have a permanent t/c in the middle of the keg and an long t/c through the lid to meaure temp stratifacation. I get a 3-5dgf variation from 1" above the false bottom to 1" below the mash top surface. The variation starts at the high end and drops to low end about 15 minutes in to the mash. Currently re-designing the stirrer to get better mixing and I'm a little slow on rpm at 20, would like to be at 30-35rpm. I had a 50rpm stirrer which gave me a 1 dgf differential, but it caused to much splashing in the mash. Overshoot is an issue for me also so I use the feed-forward parameter of the controller. PID control would be an excellent way to control overshoot and flatline at the setpoint, but I would have to build a stepper with position fdbk to contol the burner. Anyway my point for this thread is temp stratification & overshoot can be an issue.
 
jdieter,

Our setups seem rather different. Gas firing a large metal pot (keggle?) full of water. Yea, I'll bet stratification and overshoot are a problem with that kind of heat sink. :)

To be clear: I'm not saying PID isn't a good general solution for many things. I've used and written PID firmware many times over in the past (astro imaging, robotics, etc). However, for this particular application (mine, not yours), I believe PID is overkill.

Use case: a HERMS setup that is operating within the confines of two 10 gallon insulated coolers, with the HLT heated by a single centered 1500watt element (with agitation) and the MLT heated passively by the HLT. Given these parameters, and the ability to react very quickly to very small changes in the HLT temps, I don't expect to see the MLT drift more than a fraction of a degree.

I'm almost done with the (free!) electronics and will be testing the above this weekend. I'll post results. :)
 
Back
Top