tuning goals
Yo, ganutenator,
So far at least two or three responders have mentioned that you need to “define your goals” before you begin tuning. You probably already know what they mean by that - but just in case you (or more likely other readers) don’t have a clue what a tuning “goal” is, I’ll try to give an overview of the major concepts involved. This is a “broad-brush” approach - and as always every rule has its exceptions - but I think that what follows is a good way to get started.
Note: The figures shown below are just “hand-drawn” sketches which I knocked out in Microsoft Paint. I decided not to put any actual PID tuning parameters on them - there would be too many ways to misinterpret the values - due to differences between brands and models of controllers. We’re just going to talk about the major differences between the curves.
Suppose that we walk into a plant and see the following trends printed out and pinned to the bulletin board - something like a “Tuning Wall of Fame” for visitors to admire. Let’s suppose that these graphs represent examples of temperature control systems for a large oven. And keep in mind that all of these graphs represent different tuning adjustments for the SAME oven.
[attachment]
First let’s take a look at figure 1. This trend tells a story of the oven temperature being controlled at a certain setpoint - when suddenly the operator cranked the setpoint up to a higher value. The controller automatically responded and eventually brought the temperature up to the new setpoint. (By the way, the “setpoint” is the “target” temperature - shown in blue on the trends.)
Next let’s move down and take a look at figure 3. Same story. Here the oven temperature was being controlled at a certain setpoint - when suddenly the operator cranked the setpoint up to a higher value. The controller automatically responded and eventually brought the temperature up to the new setpoint.
Now let’s compare figure 1 to figure 3. Notice that the setpoint changes in each of these trends were identical. But look at the differences in the two temperature responses. Figure 1 shows a system which recovers from the setpoint change with little or no overshoot - and with little or no oscillation. Figure 3 shows a system which responds to the same upset with quite a bit of temporary overshoot - and gives several oscillations before it finally settles down again.
Trick question: Which trend (figure 1 or figure 3) represents the better tuning? Now most people would place their bets on figure 1. Compared to figure 3, this response looks a lot smoother and appears to be under much better control. But the correct answer is: We can’t tell. Until we know what the system is supposed to do - our “goal” - we can’t make an educated decision about which of these two tuning solutions is the one which will really give us the optimum control for our system.
Let’s continue on by looking at figure 2. This trend tells a story of the oven being controlled at a constant setpoint - when all of a sudden, the load on the oven is suddenly increased. Perhaps someone opened the oven door and put in a new batch of cookies. The exact time of the load increase is noted by the tick mark. Notice that when the load on the oven increased, the temperature started to decrease. But then the controller automatically responded and eventually brought the temperature back up onto the setpoint.
Now let’s move down to figure 4. Here we have the same story. The load on the oven increased - the temperature decreased - and the controller automatically responded and eventually brought the temperature back up onto the setpoint.
Now let’s compare figure 2 with figure 4. Figure 2 looks a little sluggish doesn’t it? When our controller is tuned using the values A.AA/B.BB/C.CC it takes the controller a lot longer to get the temperature back on target. In figure 4, we’ve tuned our controller using the values X.XX/Y.YY/Z.ZZ and our controller is much more “aggressive”. It gets the temperature back on target much quicker.
Notice that the tuning values A.AA/B.BB/C.CC are the same in figures 1 and 2 - and the tuning values X.XX/Y.YY/Z.ZZ are the same in figures 3 and 4. Now we’re ready to talk about one of the major “trade-offs” in PID loop tuning.
If we tune for a nice, neat, no-overshoot response to a setpoint change (as in figure 1) - then we’re going to pay for that with a sluggish response to a load change (as in figure 2). On the other hand, if we tune for a quick, aggressive response to a load change (as in figure 4) - then we’re going to pay for that with overshoot and oscillations when we make a setpoint change (as in figure 3).
So - whenever you think about your tuning “goals” - one of the things you need to decide is whether you want to optimize your system for load responses - or whether you want to optimize it for setpoint changes.
Suppose that we’re trying to define our tuning goals - and our oven ALWAYS bakes at 350 degrees F. - then the only upset to the system is going to be load changes. In this case we’d undoubtedly choose the tuning values used in figures 3 and 4. After all, who cares if a setpoint change would give us overshoot and oscillations? We’re never going to change the setpoint anyway.
But suppose that our process cannot tolerate any overshoot or temperature oscillations. Then we’d want to dial in the tuning values used in figures 1 and 2. Sure - our response to load changes is going to be a little more sluggish than we’d like - but that’s the trade-off we’ve got to make.
Now let’s “flashback to reality” - suppose that the boss INSISTS on having his cake and eating it too. He demands the smooth response to setpoint changes shown in figure 1 - but he also demands the quick, aggressive response to load changes shown in figure 4. Many engineers would just try to adopt a set of “compromise” tuning values - something in-between A.AA/B.BB/C.CC and X.XX/Y.YY/Z.ZZ. But not people of our caliber. Since we’re working with a PLC (and not one of those dinky little single-loop controllers) we can have the best of BOTH worlds. Suppose that we program the PLC so that anytime we have a setpoint change - it will automatically move the values A.AA/B.BB/C.CC into our PID controller. That gives us the desired response shown in figure 1. And we also program the PLC so that once the system has settled down near the setpoint - it will automatically move the values X.XX/Y.YY/Z.ZZ into our PID controller. That gives us the desired response shown in figure 4. We’re only talking about two rungs here folks - and now we can offer the boss a system which will automatically adapt to various tuning requirements.
I think I’ve got time to discuss one more trade-off - “stability”. Suppose that the boss now wants to crank the system up a notch - to a higher setpoint as shown in figure 5. Notice that the tuning values X.XX/Y.YY/Z.ZZ which served us so well in figure 4 - now seem to be a little TOO aggressive at this higher setpoint. This is what happens to most systems when you force them to “work harder”. Notice that we’re making the same amount of setpoint change in figure 5 as we did in figure 3. Specifically, the “jump” in our setpoint “spanned” the same number of degrees. But the final temperature that we end up with is much higher in figure 5 - and (oops!) now our controller gives us a response which has a greater tendency to oscillate. Many engineers would decide to “back-off” the tuning adjustments in this case - to compromise. But that would mean that our system would give us a less-than-optimum response when the setpoint was eventually brought back down to the “normal” range shown in figures 1 through 4. Suppose that we really want to impress the boss - I’ll bet we could come up with a better solution.
I hope that this will help some of you - I know that it would have helped me when I first got started with this stuff. For example: The first PID book that I studied referred to the tuning shown in figure 3 as “tight” tuning. Well, it sure didn’t look “tight” to me - and I always thought that the book had a misprint. Years later I realized that they were talking about a “tight” response to a LOAD change - which is the result of the same values used in figure 3. They just never showed figure 3 and figure 4 side-by-side. Live and learn.
Finally, I’m SURE that other responders can offer more detail (and quite possibly some corrections) to what I’ve had time to include here. Party on.