Ron Beaufort
Lifetime Supporting Member
Greetings to all,
first things first ... thanks to JohnW for posting those handy tips for “manually” tuning a PID loop ... I agree that they work well for many different types of processes ... I’d just like to add a few words to the instructions that John has given to make it (possibly) a little bit easier for beginners to apply this useful information ...
disclaimer: my notes below are based on using an Allen-Bradley PID set up for the “Dependent/ISA” equation ... selecting the type of PID equation is an option in the PLC-5 and ControlLogix processors ... on the other hand, in the SLC/MicroLogix processors the “Dependent/ISA” equation is the only equation available ...
and so point by point ...
that’s done by putting a “0” in both the “Ti” and the “Td” settings ...
as you increase the “Kc” setting (for Proportional action) in small steps, it’s a good idea to “bump” the process each time you make a change ... if you don’t do this “bumping” action, then it’s possible (for some processes) that the “Kc” setting could be increased step-by-small-step up to a VERY high number without introducing any oscillations at all ... and then WHAM! ... all of a sudden the thing starts oscillating like crazy ... it’s sort of like winding the spring on a grandfather clock that has run all the way down and has stopped ticking ... you can wind the spring tight enough to break it - but until you reach out and start the pendulum swinging, the clock won’t ever start to tick ... the “bump” is usually done by making a sudden significant change to the setpoint - and then JUST-AS-SOON-AS the PID starts to react, put the setpoint right back to its original value ... then watch the resulting oscillations to see how long they take to settle down and die out ... when the oscillations keep going and going continuously (and never settle down), then you’ve reached the “Kc” setting that John is talking about ... the “natural period” that he mentions is the length of time from the crest of one oscillation wave to the crest of the next one ... important: the general idea is to “sneak up” on the “Kc” setting and try to find the MINIMUM value that will cause the sustained oscillations ... note: you don’t have to get down to “nickels-and-dimes” with it (changes of 0.10 are usually fine enough) but don’t use a sledgehammer approach either ...
that’s a common rule of thumb ... and it works adequately in most applications ... but a lot of people set the loop update for about 1/20 of the natural period ... in other words, they have the PID controller “look at the process” and then “calculate a new output” about twice as often as the 1/10 rule of thumb ... they figure that “too often” is better than “not often enough” ... basic idea: as long as the processor’s scan time isn’t an issue, then it doesn’t hurt to go faster than necessary ...
in other words, whatever the minimum “Kc” setting that you dialed in to produce the sustained oscillations, divide it in half ... (example: “2.22” becomes “1.11”) ...
I’m not sure exactly what John means by this ... in my experience, cutting the “Kc” setting in half (as done in the preceding step) is pretty well guaranteed to produce the “steady but with a steady state error” conditions he’s mentioning here ...
for raw beginners, this can be a little bit trickier than it sounds ... the tricky part is that to INcrease the Integral ACTION, you have to DEcrease the Integral setting ... the setting is labeled “Ti” ... but ... remember that we left the Integral action turned “OFF” in Step 1. by entering a value of “0” ... so how (you might wonder) do we now increase the Integral action - by decreasing the entry to a setting of something LESS THAN “0”? ... special rule: the value of “0” turns the Integral action “OFF” ... once you leave the value of “0” behind, then the regular rule of “smaller-setting-means-more-Integral-action” takes over ... this “backwards” rule of DEcreasing the Integral setting “Ti” to get an INcrease in Integral action, creates a lot of problems for people who are just getting started with this PID stuff ... even when they know that they need “more Integral action”, they often go the wrong way with the setting ... this can waste a LOT of extra time (and often waste a LOT of raw materials) and lead to a LOT of frustration ... tip to preserve your sanity: get in the habit of NEVER saying either “increase the Integral” or “decrease the Integral” ... instead, ALWAYS say it one of these ways: “increase the Integral ACTION” or “decrease the Integral SETTING” or “decrease the Integral ACTION” or “increase the Integral SETTING” ... basic idea: by always specifying the ACTION or the SETTING, you’ll remove the ambiguity that causes so much mischief ... of course, once you get used to the way it works, it will become second nature ... but in the meantime, it’s best to nail things down so that there’s as little confusion as possible ...
the Differential action is sort of like Tabasco ... a little bit can go a long way ... simple rule of thumb: whatever amount you’re getting ready to try, use only half as much to get started ... once again, an entry of “0” to the “Td” setting will turn the action “OFF” ... but unlike the “Ti” setting for the Integral action, this time the adjustment direction will make more sense to a beginner ... specifically, an INcrease to the “Td” setting (a bigger number) will cause an INcrease in the Differential action ...
continued in next post ...
first things first ... thanks to JohnW for posting those handy tips for “manually” tuning a PID loop ... I agree that they work well for many different types of processes ... I’d just like to add a few words to the instructions that John has given to make it (possibly) a little bit easier for beginners to apply this useful information ...
disclaimer: my notes below are based on using an Allen-Bradley PID set up for the “Dependent/ISA” equation ... selecting the type of PID equation is an option in the PLC-5 and ControlLogix processors ... on the other hand, in the SLC/MicroLogix processors the “Dependent/ISA” equation is the only equation available ...
and so point by point ...
1.Turn off the I and D components
that’s done by putting a “0” in both the “Ti” and the “Td” settings ...
2.Set the P component until the process oscillates at its natural period
as you increase the “Kc” setting (for Proportional action) in small steps, it’s a good idea to “bump” the process each time you make a change ... if you don’t do this “bumping” action, then it’s possible (for some processes) that the “Kc” setting could be increased step-by-small-step up to a VERY high number without introducing any oscillations at all ... and then WHAM! ... all of a sudden the thing starts oscillating like crazy ... it’s sort of like winding the spring on a grandfather clock that has run all the way down and has stopped ticking ... you can wind the spring tight enough to break it - but until you reach out and start the pendulum swinging, the clock won’t ever start to tick ... the “bump” is usually done by making a sudden significant change to the setpoint - and then JUST-AS-SOON-AS the PID starts to react, put the setpoint right back to its original value ... then watch the resulting oscillations to see how long they take to settle down and die out ... when the oscillations keep going and going continuously (and never settle down), then you’ve reached the “Kc” setting that John is talking about ... the “natural period” that he mentions is the length of time from the crest of one oscillation wave to the crest of the next one ... important: the general idea is to “sneak up” on the “Kc” setting and try to find the MINIMUM value that will cause the sustained oscillations ... note: you don’t have to get down to “nickels-and-dimes” with it (changes of 0.10 are usually fine enough) but don’t use a sledgehammer approach either ...
3.Set the loop update time to 1/10 of the natural period
that’s a common rule of thumb ... and it works adequately in most applications ... but a lot of people set the loop update for about 1/20 of the natural period ... in other words, they have the PID controller “look at the process” and then “calculate a new output” about twice as often as the 1/10 rule of thumb ... they figure that “too often” is better than “not often enough” ... basic idea: as long as the processor’s scan time isn’t an issue, then it doesn’t hurt to go faster than necessary ...
4.Set the P component to about 1/2 that required for oscillation
in other words, whatever the minimum “Kc” setting that you dialed in to produce the sustained oscillations, divide it in half ... (example: “2.22” becomes “1.11”) ...
5.Adjust P until the process is steady but with a steady state error
I’m not sure exactly what John means by this ... in my experience, cutting the “Kc” setting in half (as done in the preceding step) is pretty well guaranteed to produce the “steady but with a steady state error” conditions he’s mentioning here ...
6.increase the I component until the steady state error is within limits
for raw beginners, this can be a little bit trickier than it sounds ... the tricky part is that to INcrease the Integral ACTION, you have to DEcrease the Integral setting ... the setting is labeled “Ti” ... but ... remember that we left the Integral action turned “OFF” in Step 1. by entering a value of “0” ... so how (you might wonder) do we now increase the Integral action - by decreasing the entry to a setting of something LESS THAN “0”? ... special rule: the value of “0” turns the Integral action “OFF” ... once you leave the value of “0” behind, then the regular rule of “smaller-setting-means-more-Integral-action” takes over ... this “backwards” rule of DEcreasing the Integral setting “Ti” to get an INcrease in Integral action, creates a lot of problems for people who are just getting started with this PID stuff ... even when they know that they need “more Integral action”, they often go the wrong way with the setting ... this can waste a LOT of extra time (and often waste a LOT of raw materials) and lead to a LOT of frustration ... tip to preserve your sanity: get in the habit of NEVER saying either “increase the Integral” or “decrease the Integral” ... instead, ALWAYS say it one of these ways: “increase the Integral ACTION” or “decrease the Integral SETTING” or “decrease the Integral ACTION” or “increase the Integral SETTING” ... basic idea: by always specifying the ACTION or the SETTING, you’ll remove the ambiguity that causes so much mischief ... of course, once you get used to the way it works, it will become second nature ... but in the meantime, it’s best to nail things down so that there’s as little confusion as possible ...
7. If external influences cause instability then introduce some D term until the process is stable.
the Differential action is sort of like Tabasco ... a little bit can go a long way ... simple rule of thumb: whatever amount you’re getting ready to try, use only half as much to get started ... once again, an entry of “0” to the “Td” setting will turn the action “OFF” ... but unlike the “Ti” setting for the Integral action, this time the adjustment direction will make more sense to a beginner ... specifically, an INcrease to the “Td” setting (a bigger number) will cause an INcrease in the Differential action ...
continued in next post ...