Ss Brewing Technologies Giveaway!

Home Brew Forums > Home Brewing Beer > DIY Projects > HOW TO: Manually Tune a PID
Reply
 
LinkBack Thread Tools
Old 04-19-2010, 11:02 PM   #1
CodeRage
Death by Magumba!
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
CodeRage's Avatar
Recipes 
 
Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 29 Times on 16 Posts
Likes Given: 5

Default 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"
CodeRage is offline
 
Reply With Quote Quick reply to this message
Old 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

Default

Subscribed....

__________________
willynilly is offline
Bezel Likes This 
Reply With Quote Quick reply to this message
Old 04-19-2010, 11:48 PM   #3
Poobah58
HBT_LIFETIMESUPPORTER.png
Feedback Score: 1 reviews
 
Poobah58's Avatar
Recipes 
 
Join Date: Jun 2007
Location: New Milford, CT
Posts: 2,214
Liked 54 Times on 47 Posts
Likes Given: 24

Default

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.

__________________
Mead Lane Brewing
The liver is evil and must be punished
Poobah58 is offline
 
Reply With Quote Quick reply to this message
Old 04-19-2010, 11:52 PM   #4
CodeRage
Death by Magumba!
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
CodeRage's Avatar
Recipes 
 
Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 29 Times on 16 Posts
Likes Given: 5

Default

Quote:
Originally Posted by Poobah58 View Post
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"
CodeRage is offline
 
Reply With Quote Quick reply to this message
Old 04-20-2010, 01:30 AM   #5
jkarp
Beer Herder
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
jkarp's Avatar
Recipes 
 
Join Date: Jun 2008
Location: Elizabeth, CO
Posts: 2,105
Liked 33 Times on 29 Posts
Likes Given: 4

Default

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.

__________________
jkarp is offline
 
Reply With Quote Quick reply to this message
Old 04-20-2010, 02:05 AM   #6
Ohio-Ed
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
Ohio-Ed's Avatar
Recipes 
 
Join Date: Nov 2008
Posts: 2,072
Liked 19 Times on 18 Posts

Default

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.

__________________
Ohio-Ed is offline
 
Reply With Quote Quick reply to this message
Old 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

Default

CodeRage-Your the man

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.

__________________
Chosenwon is offline
 
Reply With Quote Quick reply to this message
Old 04-20-2010, 03:18 PM   #8
Brewmoor
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
Brewmoor's Avatar
Recipes 
 
Join Date: Aug 2009
Location: Colorado
Posts: 1,094
Liked 13 Times on 13 Posts
Likes Given: 13

Default

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!

Brewmoor is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Manually controlled HERMS McCuckerson Equipment/Sanitation 25 06-21-2014 05:30 PM
IBU tune in ChickenSoop Beginners Beer Brewing Forum 11 01-12-2009 06:57 PM
Process Control - Manually setting PID Yorg Equipment/Sanitation 5 11-11-2008 07:27 PM
How to manually siphon? kontreren Beginners Beer Brewing Forum 6 08-27-2008 01:33 PM
Name That Tune! Cheesefood General Chit Chat 14 04-07-2007 01:18 AM