Skip to content

Manual PID adjustment

Stefan Hirschmann edited this page Apr 8, 2017 · 2 revisions

This tutorial was originally written by CodeRage in the homebrewtalk forum.

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 doesn't 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.