Ss Brewing Technologies Giveaway!

 Home Brew Forums > HOW TO: Manually Tune a PID
04-19-2010, 11:02 PM   #1
CodeRage
Death by Magumba!
Feedback Score: 0 reviews

Recipes

Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 29 Times on 16 Posts
Likes Given: 5

 HOW TO: Manually Tune a PID

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
Feedback Score: 0 reviews
Recipes

Join Date: Feb 2010
Location: Avon
Posts: 728
Liked 5 Times on 5 Posts

Subscribed....

__________________

Bezel Likes This
04-19-2010, 11:48 PM   #3
Poobah58
Feedback Score: 1 reviews

Recipes

Join Date: Jun 2007
Location: New Milford, CT
Posts: 2,214
Liked 54 Times on 47 Posts
Likes Given: 24

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!
Feedback Score: 0 reviews

Recipes

Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 29 Times on 16 Posts
Likes Given: 5

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
Beer Herder
Feedback Score: 0 reviews

Recipes

Join Date: Jun 2008
Location: Elizabeth, CO
Posts: 2,105
Liked 33 Times on 29 Posts
Likes Given: 4

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
Feedback Score: 0 reviews

Recipes

Join Date: Nov 2008
Posts: 2,072
Liked 19 Times on 18 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
Feedback Score: 0 reviews
Recipes

Join Date: Jul 2008
Posts: 105
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
Feedback Score: 0 reviews

Recipes

Join Date: Aug 2009
Posts: 1,094
Liked 13 Times on 13 Posts
Likes Given: 13

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!

 Quick Reply Message: Options Quote message in reply?