Process Control - Manually setting PID

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.

Yorg

Well-Known Member
Joined
Jun 3, 2007
Messages
168
Reaction score
1
I have a steam powered mash system with a PID Controller.
These controllers have an autotune function - they will oscillate around a set point and then decide on the appropriate PID parameters.
Unfortunately, in an insulated mash tun, the overshoot takes so long to come back down that the autotune function gives up before it does.
Anyone know how to manually approach determining the PID parameters for such a system?

Cheers.
 
That would all depend on the controller, but let's assume that you have the ability to modify the P, I, & D parameters.

By adjusting the P (especially ) down, it will come closer. The following do a decent job of explaining the PID functions.

PID Temperature Controller Explained - McShane, Inc.

And PID Without a PhD

However, given that you have a autotune, the problem is more in the sampling rate.

I recently moved to a steam mash as well and experienced similar problems - takes a little while , even with stirring, and then shoots up fast!

I am working on my automated steam masher with an Arduino board now. Maybe Yuri will weigh in on this!
 
If you are injecting steam into mash the temperature change at sensing probe is probably delayed enough to give PID controller problems. You could move the steam injection point next to probe to improve response time to a point that the controller will work. As the mash is stirred the controller will cycle steam until mash reaches temp. Using steam is a challenge for control as the heat release from the steam is large and quick, not easy to control as by time temperature changes you usually have to much steam input.
 
So, kladue, since I am implementing a custom PID ( Arduino ) & steam, should I have a longer or shorter measurement time to balance that out?
 
Hi Yorg. Since my controller doesn't have an autotune feature (yet), I'm familiar with manually tuning PID algorithms.

A good resource is the PID entry in wikipedia. They do a good job explaining how the different parameters affect the control.
PID controller - Wikipedia, the free encyclopedia

To manually tune a PID, good data logging is a must to see how the different parameters affect the algorithm. You could start with some generic parameters, get some data, and tweak from there. The "Pid w/o a PhD" article posted earlier had some example parameters, look at Figure 18. Although each system is unique, at least this will give you a starting point. This is a fun way to really get to know your system.

The other option is to autotune it yourself. Again, this assumes that you have good data logging. The Ziegler–Nichols method, which is explained in wikipedia, is a pretty common way for controllers to autotune. Basically set I and D to zero, and increase P until you get an oscillation. Make sure it's oscillating, not settling out! Once you find that critical P, measure the frequency of the oscillation and use the formulas to calculate your new parameters.

I hope to get some more information up on our website related to PID tuning. As we get more and more data from different systems, we'll make sure post them.
 
The main item to pay attention to is the time between samples to provide for large enough error to allow integral and derivative functions to work, then the limiting of the integral factor to prevent windup. If the sample intervals are too short then the error difference is too small, if sample intervals are to long then the controller will not be able to keep up. A sample time between 2 - 10 seconds should get you started, PID settings:p =50, I=.5, D=.5 should work for initial settings. I have built working PID implementations in Java with GUI's for testing and tuning that has incorporated the published code on a couple sites and then some. Hope to have finished final testing of phase2 system code and hardware today and try first full scale system test run this weekend to dial in strike water formulas.
 
Back
Top