PID101

AB SLC 5/04 Questions

8 posts in this topic

Couple questions regarding this particular PLC's features and functions. Thank you in advance for the help.

 

1. Does this controller filter the PV? If so, how is it enabled / disabled?

2. How to enable/disable integral windup? 

3. From the manual, I know it has a derivative low pass filter. How do I determine the derivative filter constant?

Share this post


Link to post
Share on other sites

It's been a long time since I set up a PID loop in a SLC so I had to go back and take a look at one. I may have missed something but this is what I found

(1) I don't think so. If you want to filter the input you're going to have to use the fairly rudimentary tools available to create your own filter and process the input variable with it and write that to the PV of the loop. 

(2) I suppose if you're really creative you could write some logic to do that. There are no "easy buttons" in the SLC.

(3) True enough, it "has" a low pass filter, BUT the help file says: "The derivative term (rate) provides smoothing by means of a low pass filter. The cutoff frequency of the filter is 16 times greater than the corner frequency of the derivative term.". In other words the smoothing is provided BY MEANS OF a low pass filter that is built into the loop and not something you can tweak. Tuning the loop is just that- YOU tune the loop based on how it responds to your systsm

Create a PID loop in a dummy program (File/Misc then Select PID) Click on the word PID (top left corner of the box) and hit F1. That will tell you everything there is to know about the SLC PID block (hint- there ain't much to it compared to modern PLC's ). Actually... you don't even need to do that. You have the manual

 

1 person likes this

Share this post


Link to post
Share on other sites
Just now, Michael Lloyd said:

It's been a long time since I set up a PID loop in a SLC so I had to go back and take a look at one. I may have missed something but this is what I found

(1) I don't think so. If you want to filter the input you're going to have to use the fairly rudimentary tools available to create your own filter and process the input variable with it and write that to the PV of the loop. 

(2) I suppose if you're really creative you could write some logic to do that. There are no "easy buttons" in the SLC.

(3) True enough, it "has" a low pass filter, BUT the help file says: "The derivative term (rate) provides smoothing by means of a low pass filter. The cutoff frequency of the filter is 16 times greater than the corner frequency of the derivative term.". In other words the smoothing is provided BY MEANS OF a low pass filter that is built into the loop and not something you can tweak. Tuning the loop is just that- YOU tune the loop based on how it responds to your systsm

Create a PID loop in a dummy program (File/Misc then Select PID) Click on the word PID (top left corner of the box) and hit F1. That will tell you everything there is to know about the SLC PID block (hint- there ain't much to it compared to modern PLC's ). Actually... you don't even need to do that. You have the manual

 

Thank you. This is my first time working with PIDs and am attempting to tune a temperature loop controlled by flow rate with inherent dead time 

Share this post


Link to post
Share on other sites

Ah... loop tuning. I haven't had to do that in a while either.

Is this a real temperature control loop or a theoretical control loop? Ie is there a process that you are controlling or a mathematical exercise?

If the latter, there is a ton of info on YouTube but the problem, like always, is that it's not all useful. A lot of it is regurgitation of theory. I skimmed thru a dozen videos. This one is pretty basic but I liked his presentation:   https://youtu.be/XfAt6hNV8XM He apparently  has 3 different videos, one for P,  one for PI, and one for PID. I'd watch all three (I touch on way toward the end)

If it's an actual process, is it a cascade loop or does the temperature controller modify the heat medium flow valve?

There are a lot of opinions on loop tuning. All are valid for the person that is expressing the opinion, myself included. Opinions abound, you'll have to experience the task and form your own opinion. Your opinion on what works will change.

You can (and I have) calculate the response of the loop and determine P, I, and D from that. It's a valid way to tune. A lot of control engineers use that method. I actually like that method. But if I'm in a plant and the process is swinging, I don't break out my trusty HP, I tune the loop. The "problem" with that is that it is possible to select a value for P, I, and D that will put the process into a "happy place" but it's really like a ping pong ball balancing on a sharp point and ready to fall into instability. It won't take much to perturb the system and you don't want to leave a controller tuned that way. The "manual" tuning process requires that the person doing the tuning pays attention to how the loop(s) that they are tuning affects the process as a whole. Ie a swinging hot oil temperature controller output will induce minute swings in the oil temperature that cause larger swings in downstream processes. Just because the set point and measure are both at 500° F it doesn't mean that the process isn't swinging. Look at the PV with at least one decimal point. 0.4°F of swing can amplify and cause problems downstream. Always keep in mind that it's a control system not just a controller.

The following is how I would tackle some of your problem.

If it's a cascade loop, you need to tune the inner loop first, otherwise you can skip the inner loop tuning. Sometimes cascade loops are warranted. Sometimes they aren't. I guess these days the term is Primary (outer loop) and Secondary (inner loop). I'm going to use old terms :) The inner loop is the flow control valve. It will be a PI loop. NO DERIVATIVE. Turn off integral time (high value, say 15 minutes), turn off Derivative time (higher value than Integral time). Adjust Gain, ignoring offset, until the loop is stable and can "handle" set point changes. This is where opinion and process control experience will kick in. You can't get experience without having experience. Ie, just do it... "Handle set point changes" means pay attention to the process control valve. If to control flow rate the output has to swing (the graph of the output is a sine wave) then you've got an unstable system. Sometimes Gain has to be a compromise between process stability and set point change response, no... actually, it's always a compromise. Tune integral by slowly decreasing integral time (it's possible that you initially set it too low and you'll need to increase integral time to get the desired affect). Bump the process (carefully but enough to initiate a valve response) and watch the control valve output. If integral is too fast the loop will begin to oscillate. Personally I usually adjust integral in "1/2's". Ie if the stating point is 15m, my first change is to 7.5m. If the process destabilizes I'll change it to 11.25m. If it tolerates the change to 7.5m I'll change to 3.75m. then 1.875m... and continue halving the value until it destabilizes. At that point I'll increase it by 1/2  of the difference between the current and previous value (write your changes down as you make them). Still unstable, increase by 1/2 the difference between the current and previous value. At some point in time the system will stabilize. Bump it again and observe the way the process behaves. for a medium or fast process it doesn't take long to establish a good PI setting. 

Tuning an inner loop, like a flow controller, is usually a fairly quick process. Once the inner loop is tuned you can start the outer loop tuning process, which for temperature is usually a little more tedious. Since a cascade loop is basically the output of the first loop connected to the set point of the second loop the inner loop is going to require a smoother response curve (output) than the inner loop. The tuning process is similar to tuning the inner loop except at the end of the process you will bring in derivative. A lot of people hate derivative. Probably because they tried to apply D when it wasn't required. 

Lets consider something at this point- The PID loop is a mathematical function. None of the terms are isolated from the other. By that I mean that each term affects the output in a different way but its the combination of terms that ultimately stabilizes the process. Too much or too little of any term will destabilize the loop. If the process characteristics change (different heat medium, different valve, change in the weather, change in the way the set point is moved (change in operator)) and the loop is tuned "tightly" the loop can destabilize. 

So, how to tune Derivative? Personally, I decrease the derivative time and test the response until I'm satisfied that the loop will not destabilize when "Leroy" comes on shift and slams a 15% output change into the controller. At no point should derivative time be less than integral time. Keep that in mind. 

Bear in mind this this is filled with opinion and poorly remembered theory. It's too bad that everything (mostly) is electronic. You can learn a lot from tuning a pneumatic loop

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
On 8/30/2016 at 7:15 AM, Michael Lloyd said:

Ah... loop tuning. I haven't had to do that in a while either.

Is this a real temperature control loop or a theoretical control loop? Ie is there a process that you are controlling or a mathematical exercise?

If the latter, there is a ton of info on YouTube but the problem, like always, is that it's not all useful. A lot of it is regurgitation of theory. I skimmed thru a dozen videos. This one is pretty basic but I liked his presentation:   https://youtu.be/XfAt6hNV8XM He apparently  has 3 different videos, one for P,  one for PI, and one for PID. I'd watch all three (I touch on way toward the end)

If it's an actual process, is it a cascade loop or does the temperature controller modify the heat medium flow valve?

There are a lot of opinions on loop tuning. All are valid for the person that is expressing the opinion, myself included. Opinions abound, you'll have to experience the task and form your own opinion. Your opinion on what works will change.

You can (and I have) calculate the response of the loop and determine P, I, and D from that. It's a valid way to tune. A lot of control engineers use that method. I actually like that method. But if I'm in a plant and the process is swinging, I don't break out my trusty HP, I tune the loop. The "problem" with that is that it is possible to select a value for P, I, and D that will put the process into a "happy place" but it's really like a ping pong ball balancing on a sharp point and ready to fall into instability. It won't take much to perturb the system and you don't want to leave a controller tuned that way. The "manual" tuning process requires that the person doing the tuning pays attention to how the loop(s) that they are tuning affects the process as a whole. Ie a swinging hot oil temperature controller output will induce minute swings in the oil temperature that cause larger swings in downstream processes. Just because the set point and measure are both at 500° F it doesn't mean that the process isn't swinging. Look at the PV with at least one decimal point. 0.4°F of swing can amplify and cause problems downstream. Always keep in mind that it's a control system not just a controller.

The following is how I would tackle some of your problem.

If it's a cascade loop, you need to tune the inner loop first, otherwise you can skip the inner loop tuning. Sometimes cascade loops are warranted. Sometimes they aren't. I guess these days the term is Primary (outer loop) and Secondary (inner loop). I'm going to use old terms :) The inner loop is the flow control valve. It will be a PI loop. NO DERIVATIVE. Turn off integral time (high value, say 15 minutes), turn off Derivative time (higher value than Integral time). Adjust Gain, ignoring offset, until the loop is stable and can "handle" set point changes. This is where opinion and process control experience will kick in. You can't get experience without having experience. Ie, just do it... "Handle set point changes" means pay attention to the process control valve. If to control flow rate the output has to swing (the graph of the output is a sine wave) then you've got an unstable system. Sometimes Gain has to be a compromise between process stability and set point change response, no... actually, it's always a compromise. Tune integral by slowly decreasing integral time (it's possible that you initially set it too low and you'll need to increase integral time to get the desired affect). Bump the process (carefully but enough to initiate a valve response) and watch the control valve output. If integral is too fast the loop will begin to oscillate. Personally I usually adjust integral in "1/2's". Ie if the stating point is 15m, my first change is to 7.5m. If the process destabilizes I'll change it to 11.25m. If it tolerates the change to 7.5m I'll change to 3.75m. then 1.875m... and continue halving the value until it destabilizes. At that point I'll increase it by 1/2  of the difference between the current and previous value (write your changes down as you make them). Still unstable, increase by 1/2 the difference between the current and previous value. At some point in time the system will stabilize. Bump it again and observe the way the process behaves. for a medium or fast process it doesn't take long to establish a good PI setting. 

Tuning an inner loop, like a flow controller, is usually a fairly quick process. Once the inner loop is tuned you can start the outer loop tuning process, which for temperature is usually a little more tedious. Since a cascade loop is basically the output of the first loop connected to the set point of the second loop the inner loop is going to require a smoother response curve (output) than the inner loop. The tuning process is similar to tuning the inner loop except at the end of the process you will bring in derivative. A lot of people hate derivative. Probably because they tried to apply D when it wasn't required. 

Lets consider something at this point- The PID loop is a mathematical function. None of the terms are isolated from the other. By that I mean that each term affects the output in a different way but its the combination of terms that ultimately stabilizes the process. Too much or too little of any term will destabilize the loop. If the process characteristics change (different heat medium, different valve, change in the weather, change in the way the set point is moved (change in operator)) and the loop is tuned "tightly" the loop can destabilize. 

So, how to tune Derivative? Personally, I decrease the derivative time and test the response until I'm satisfied that the loop will not destabilize when "Leroy" comes on shift and slams a 15% output change into the controller. At no point should derivative time be less than integral time. Keep that in mind. 

Bear in mind this this is filled with opinion and poorly remembered theory. It's too bad that everything (mostly) is electronic. You can learn a lot from tuning a pneumatic loop

Thanks for this great response. I can easily tell you are an expert at this with many years experience under your belt. It's nice to know someone with this type of knowledge!

The loop I am currently tuning is a real process on a condenser. The actuator controls the flow rate of cold water through the condenser based on the desired outlet cold water temperature. My problem so far with this particular loop tuning is, I believe, due to the inherent dead time - the loop tends to overshoot and oscillate around the setpoint. As the PV passes the SP in one direction, the actuator starts to make up for this error. Due to the process's dead time, the error becomes greater and greater with time, and the actuator response continues to grow to try and make up for this error. Meanwhile, the changed water temperature is finally arriving at the temperature sensor and now the PV quickly starts to fall in the opposite direction. Upon passing the SP, it overshoots due to the extreme actuator response and repeats this process again. So far my best bet has been to limit the actuator to operate within a range that keeps my temperature around the SP. But this defeats the purpose of my PID (or does it)

Share this post


Link to post
Share on other sites

(1) Can you put the controller in manual and achieve steady state? If not, where is the disturbance coming from? If you can't control it in manual your PID loop is not likely to be able to control it either

(2) If it can be controlled in manual perhaps it's time to try Ziegler-Nichols tuning method (or whatever the current version is called)- https://youtu.be/dEUGAH4JOdI

I've had good luck with Ziegler-Nichols in the past. For any calculation, garbage in / garbage out applies so take good data. Hopefully you have an HMI and can log the data. As I remember it SLC trending sucks. It's nearly worthless. CLX on the other hand is pretty decent plus you can log the data points and use them in Excel. But that doesn't help you.

(3) If i can't be controlled in manual take a look at the temperature and flow rate around the condenser to see if something other than the process variable you are trying to control is cycling. I was told long ago to "zoom out" and look at the big picture. Something that is seemingly disconnected from your process variable could be perturbing it. 

Share this post


Link to post
Share on other sites
Quote

Upon passing the SP, it overshoots due to the extreme actuator response and repeats this process again. So far my best bet has been to limit the actuator to operate within a range that keeps my temperature around the SP. But this defeats the purpose of my PID (or does it)

I thought I would check to see how things were going. 

I didn't answer the question in quotes above. If the final element (control valve or other means of control) has too much range or too little range it will cause tuning issues. In your case it's possible that your gain (Kc) value is simply too small. In the "old days" Gain was called proportional band and the units were %. 10% Proportional Band is the same thing as saying a Gain of 0.1. The inverse of Proportional band (1/Kc) is Gain and vice versa. In basic terms, % process deviation from setpoint x Gain = percent output change. Ie a 10% deviation in a controller with a Gain of 1 = a 10% output change in a P only controller.

Rather than limit valve travel (which isn't altogether objectionable if it works) try decreasing your Gain setting. Tune one parameter at a time. Gain, then integral. The loop you describe might not need derivative. Derivative "delays" the PI response to try to limit overshoot. I've rarely seen the need for it... well... lets put that another way- In the gas processing there are very few people that fully understand exactly what derivative is for. I've been in that camp and to some degree I still am. If the loop can be tuned to "settle" with Gain and Integral but it takes 4 or 5 cycles instead of 2 or 3,  most techs will use Gain and Integral and not "mess with" Derivative. It's good to know how and when to use it because when you need it, Derivative can help solve a control problem, which brings me to this article: http://blog.opticontrols.com/archives/153

This guy- http://controlguru.com/process-gain-is-the-how-far-variable/ has an example that sounds similar to what you are dealing with. He discusses process gain. Process gain is used to determine loop gain. Loop gain is the sum of all the gain of the parts of the system. As this document http://h240.marcks.cc/downloads/07_loop_gain.pdf points out the guy in the first link is actually writing about process sensitivity not Gain

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

I hadn't had the chance to work on the tuning this prior week but plan to do so in the upcoming week. Your replies continue to teach me a lot about these systems! I will update when I finally get a chance to work on it. Thanks again 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now