Home Brew Forums (http://www.homebrewtalk.com/forum.php)
-   DIY Projects (http://www.homebrewtalk.com/f51/)
-   -   HOW TO: Manually Tune a PID (http://www.homebrewtalk.com/f51/how-manually-tune-pid-174020/)

 CodeRage 04-20-2010 12:02 AM

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.

 willynilly 04-20-2010 12:13 AM

Subscribed....

 Poobah58 04-20-2010 12:48 AM

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.

 CodeRage 04-20-2010 12:52 AM

Quote:
 Originally Posted by Poobah58 (Post 2014509) 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.

 jkarp 04-20-2010 02:30 AM

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.

 Ohio-Ed 04-20-2010 03:05 AM

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.

 Chosenwon 04-20-2010 04:14 PM

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.

 Brewmoor 04-20-2010 04:18 PM

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.

 All times are GMT. The time now is 04:02 PM.