HOW TO: Manually Tune a PID - Home Brew Forums

 Home Brew Forums > HOW TO: Manually Tune a PID

04-19-2010, 11:02 PM   #1
CodeRage
Death by Magumba!

Recipes

Aug 2007
Melbourne, Fl
Posts: 2,222
Liked 50 Times on 21 Posts

Auto tune doesn't always work or is fickle, manually tuning can be a daunting task. let's see if we can crash course yah in the fine art of PID tuning.

Let's define Error, it is the difference of the process variable and the set point. Say you are at 100 deg and your set point is 160 then your Error is 60. (if you were at 220 with the same set point you would have a -60 error)

Proportion is a proportion of the error so with an error of 60 and a P of 100 (%) is an output of 60. So this is the thing to consider. How far away from the set point do you want 100% output to be? The 8 deg over shoot suggests to me that you want it around there, so lets say 8 deg. 8* P/100 = 100% output, So P = 1250; for starters. The P is going to be what gets you up to the set point faster.

So test run that with some test water. (I and D = 1).

You will see it may over shoot or it may not get to the set point. If it doesnt get to the setpoint, bump the P up some. You want some over shoot at this point.

Next let it all cool down a bit.

Derivative looks at the rate of change or acceleration of the process variable (PV), ie how fast it is changing. So let's set the D value to 50% of the P value for giggles and run the process that way. The D is what stops the overshoot. If you still over shoot bump the D up and try again. if the output seems to slow down too much when it is real far from the SP than D is probably too high.

Now it may take a little while for it to get to the SP or it may stabilize some where other than the SP, this is a good thing.

I is the amount of error accumulated over time. So the longer and farther away the PV is from the SP the more aggressive I will change the output. With this kind of set up you want a fairly low I value, lets say 20. (It's easier to work up). I is what fixes the steady state error. ie the PID has the PV under control but it isn't near the SP. Move I up until you get the quickest time to the set point, if it starts to overshoot or oscillate I is too high.

It takes some time but a properly tuned loop is good for peace of mind.
__________________
Brutus 20e build | Electrical Primer for Brewers | Auber SYL-2362A2 PID Install & Config
So as I am walking out the door this morning I think to my self:
"self, going to work on Monday is like knowing you're going to get kicked in the nuts. You just don't know when or by who"

04-19-2010, 11:13 PM   #2
willynilly
Registered User
Recipes

Feb 2010
Avon
Posts: 728
Liked 8 Times on 7 Posts

Subscribed....

Bezel Likes This
04-19-2010, 11:48 PM   #3
Poobah58

Recipes

Jun 2007
New Milford, CT
Posts: 2,249
Liked 69 Times on 61 Posts

Good info, but (IMO) you really don't need derivative in our applications. It should only be used on fast changing loads. I set my proportional band (gain) until I overshoot a bit, then use the integral (reset) to settle out the oscillations.
__________________
The liver is evil and must be punished

04-19-2010, 11:52 PM   #4
CodeRage
Death by Magumba!

Recipes

Aug 2007
Melbourne, Fl
Posts: 2,222
Liked 50 Times on 21 Posts

Quote:
 Originally Posted by Poobah58 Good info, but (IMO) you really don't need derivative in our applications. It should only be used on fast changing loads. I set my proportional band (gain) until I overshoot a bit, then use the integral (reset) to settle out the oscillations.
It's important in a RIMS application.

For HERMS and BKs, you are correct.
__________________
Brutus 20e build | Electrical Primer for Brewers | Auber SYL-2362A2 PID Install & Config
So as I am walking out the door this morning I think to my self:
"self, going to work on Monday is like knowing you're going to get kicked in the nuts. You just don't know when or by who"

04-20-2010, 01:30 AM   #5
jkarp

Recipes

Jun 2008
Elizabeth, CO
Posts: 2,112
Liked 45 Times on 35 Posts

Well done CodeRage. With these good descriptions of the values, folks can also use auto-tune as a starting point and adjust accordingly for the behaviors they're seeing. I had to bump I up a bit on my system in the early days.

04-20-2010, 02:05 AM   #6
Ohio-Ed

Recipes

Nov 2008
Posts: 2,067
Liked 20 Times on 19 Posts

CodeRage -

Thanks for the write up. I have a BCS-460 which as you know, does not have auto tune mode.
I need to tune the PID's and this will definitely help.

04-20-2010, 03:14 PM   #7
Chosenwon
Recipes

Jul 2008
Posts: 103
Liked 2 Times on 2 Posts

This is exactly the kind of information I have been looking for, looks like I will be doing some experimenting when I get home from work.

Thanks again.

04-20-2010, 03:18 PM   #8
Brewmoor

Recipes

Aug 2009
Posts: 929
Liked 15 Times on 15 Posts

Thank you,

I have been having quirky issues with my PID. I have done auto tune several times and feel as though something might not be right. I think I might try to do it manually now.
__________________
"What the mind can conceive and believe, the mind can achieve."

My build thread. Compact Single Tier!

01-06-2017, 07:00 PM   #9
Schreiner

Recipes

Feb 2012
Wausau, WI
Posts: 113
Liked 20 Times on 18 Posts

Subd

01-06-2017, 07:16 PM   #10
doug293cz
BIABer, Beer Math Nerd
Recipes

May 2014
Renton, WA
Posts: 4,424
Liked 1511 Times on 1106 Posts

One way to avoid all the hassles of getting your PID tuned to be stable in your system is to get an Auber Instruments EZBoil (DSPR120 or DSPR300) controller instead. The EZBoils have demonstrated that they are better at holding mash temps than poorly tuned PID's, and they don't require complex tuning procedures. They also have a better boil power control function than PID's operated in manual mode. They are the only controller I recommend.

Brew on

Disclaimer: I have no association with Auber Instruments