HOW TO: Manually Tune a 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.

CodeRage

Death by Magumba!
Joined
Aug 22, 2007
Messages
2,209
Reaction score
71
Location
Melbourne, Fl
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.
 
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.
 
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.
 
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.
 
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.
 
CodeRage-Your the man :rockin:

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.
 
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.
 
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 :mug:

Disclaimer: I have no association with Auber Instruments
 
Back
Top