Sign in to follow this  
Followers 0
zeratul

RSLOGIX5000 PID

10 posts in this topic

Hi, I got lined up on a system that has four heaters zones where each zone has three thermocouples, where i should control the temperature to stay at 100 degrees C I have 2 thermocouple input cards (each thermocouple sends its data through one channel of the input cards) I also have one analog output with 4 used channels (Each channel controls one heater zone (wich consist of 4 Thermocouples). I was told to use PIDs. I researched the PID as much as i could , but still didn't figure out how to aproach the solutions. I am not sure if i can do it with 1 pid or 4 pid instructions I am also having trouble understanding the PID configuration and tuning (although i read eveything about it at rockwell and the help menu) I am using rslogix5000 Any suggestions or tips or help manuals will be apreciated

Share this post


Link to post
Share on other sites
Just to clarify some things so we understand correctly. 1. You have Four (4) Zones Call them 1, 2, 3 & 4. 2. Each zone has three Therocouples call them A, B & C. Thus 1A, 1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C, 4A, 4B & 4C are thermocouples. 3. You mention 2 thermocouple input cards using 1 channel each. How does this reconcile to the 12 thermocouples above? 4. You have an analog output for each Heater Zone. 5. You want a PID to control each analog output so each zone stays 100 degrees C. 6. You have not made a decision whether you'll use the average, lowest, highest or only one of the three thermocouples to represent a zones temperature into the PID. Am I on track in understanding your situation?

Share this post


Link to post
Share on other sites
Bob, Thanks for you reply.. And sure you are on the right track The first thermocouple input card gives me the reading of the (1A,1B,1C, 2A,2B,2C,3A,3B) and the second card reads(3C,4A,4B,4C,4D).. and the other four channels are spares. I am thinking about using avarages i.e for zone 1 PID : CV = 1A + 1B + 1C/3 and the same for the other three .. Am I thinking right about this ?? What do i need to give the PID other than CV and Pv ?? When you double click the PID instrunction a setup box pops up ... and here what i still dont understand after reading the help. TUNINING :setpoint (isn't logically driven ?? ) setoutput output bias prop,integral,and derivative gains (are the read only?? or do i need to manipulate them) Configuration menu: PID equation control action derivative off update time CV high and low deadband value Are all these necessary for the instruction?? I've been doing PLCs for long time but this is my first none automotive project and i feel kinda lost Thanks agian for any help

Share this post


Link to post
Share on other sites
First, stop and take a deep breathe. Got it? OK. Loop controls are not trivial in general and especially in the situation you are probably going to encounter. Let's take this one step at a time. 1. All closed loop controls work roughly the same way. You have a SP (set point), CV (control variable, aka output), and a PV (process variable, aka input). The goal of the control loop is to adjust the CV so that the SP equals the PV. Before we go any further then, we have just ONE input controlling ONE output to try to match ONE setpoint. You have 12 or 16 inputs (it wasn't clear) controlling 4 outputs. You have to decide right away how to combine those inputs. For instance, if any of the thermocouples are clearly out of range (way too high or too low) indicating a broken or shorted thermocouple, then you will probably want to ignore them. For the remainder, most commonly you will be either taking the lowest, highest, or average value, or perhaps a median or some other tricky formula of your own design such as a weighted average. Whatever you do, it needs to come up with a SINGLE input value for each output. 2. There are several different methods to achieve the control aspect of things. To begin with, there is "open" vs. "closed", also known as "feed forward" and "feed back" loops. In an open or feed forward loop, you simply perform some math on the SP and feed the result to the CV. The PV is ignored. These types of "loops" have much faster response speeds than closed loop controllers because closed loop controllers only adjust things based on the errors (after the fact). Often the output of both types is summed together before being sent to the actual output to control the device. 3. The closed loop controller looks at the difference between the PV and the SP (the error signal) and adjusts the CV (output) to try to make the PV and SP match. It does not take changes to the set point into consideration in general, only the error signal. Thus the reason that the open loop controller deals with changes in set points so much better. There are several types of controllers such as IMC (internal model control), SMC (sliding mode control), and the one you mentioned, PID (proportional, integral, derivative control, plus variations which turn various P/I/D terms off). Each has certain distinct advantages in certain applications. For instance, PID loops work best with low process lags (if you change the CV, the PV responds very quickly), linear responses and consistent process gains (the same size change in CV results in the same change in the PV every time), and non-integrating loops (the error value does not go into exponential runaway). IMC controllers are much more tolerant of long process lags and process gain issues but intolerant of process linearity issues and integrating loops. Sliding mode controllers are very tolerant of pretty much all of the above except for integrating loops and can be a bit on the slow side to converge. The reason I'm mentioning these alternatives is because in general sliding mode controllers tend to work very good as process heating controllers where PID loops don't tend to work so well. 4. Now more importantly, it is important that any of these controllers are operated either by taking timing into consideration or else run with consistent timing. What do I mean by that? All of the closed loop controllers have gain settings that are in terms of time. They are programmed as if "time" is consistent...that is, the controller gets run say once every 100 ms or once every second. If you put the controller code in your continuous task and don't go through some sort of gyration to fix the timing issue, your controller will not run consistently. So the general rule is to always put the code into a periodic task. Start by setting up a periodic task specifically for your control loops no matter which PLC you are using. There are alternatives but this is the simplest way that gives you consistent results. 5. Ok, so far you should have code that is transforming your thermocouple inputs into a single PV. Now create the PID instruction itself, one for each output. First fill in the variable where you calculated your PV. Ignore tieback (used for interfacing to external discrete PID loop controllers such as Honeywell UDC's). Fill in the CV as the output variable for your analog output. Ignore the master loop and inhold stuff. Enter 0's for any of the parameters that you won't be using. 6. You need to enter the set point into the loop_structure.SP member to be able to adjust your set points. Also make sure to turn on .PVT (process variable tracking), .DOE (derivative of error), and clear .PE (use independent gain equation) and .NDF (turn on derivative smoothing). If you don't know what these mean, use my suggestions. You can always experiment later. 7. Now manual/auto control is another area that is a bit strange. There are multiple manual modes. The one I recommend is "software manual". The other manual modes are again for interfacing to some sort of external controller. To set the loop into manual mode, set the .SWM bit. To put it in automatic, clear this bit. Don't touch the .MO bit! I know what it says...trust me, just don't touch it. When you are in software manual mode, use the ".SO" value to set the output. In software manual mode, the PID controller will copy the value of .SO into the .CV (control value). While in this mode, the PID loop internal values "track" the .SO value and don't go into "windup" (runaway). While in automatic mode, the .SO value is changed by the PID controller to reflect the actual current .CV. When you go back to software manual mode, then it again releases control. This provides for smooth transitions between auto and manual mode (so-called "bumpless" transfers). 8. Your 3 gains (P, I, D) are in the .KP, .KI, and .KD variables. Now setting these things can be done extremely scientifically but almost everyone does a seat-of-the-pants method which I'll explain, mostly because Zigler-Nichols has never been tremendously successful for me. Now you need to make yourself a trend chart. On this chart you want to see the 3 key variables (CV, SP, and PV). Once you got your trend chart running, also make sure you have the loop controls in front of you so that you can control everything in another window. Now turn everything on and put the loop in manual (.SWM) control with the .SO (output) value set to something very low. You may have to go back and tune it again later so I recommend that you actually build a loop tuning screen in your operator interface specifically for doing this. Now make at least 2 or 3 step changes to the .SO value and watch what happens. Wait until the .PV settles out and calculate the actual gain. In other words, if you adjust the .SO value by x%, what percentage does the .PV increase by? This ratio is your process gain and the value of .KP should be exactly equal to that. So you just determined your first gain. 9. For the others, it's a bit trickier. Set the set point (.SP) close to where the .PV (process variable) is actually at. Initially set .KI equal to 10% of the .KP value. Now put the loop in manual. You should see the loop "pull in" (adjust the .CV value until SP=PV). Now change the SP and observe how it responds again. Carefully adjust KI by a factor of 10 and try to get it to pull in faster. If it starts oscillating, then back off. Then once you got it close, switch from multiplying/dividing by 10 to a factor of 2. Continue tuning until whenever you change the SP, you get a "25% overshoot" followed by the loop pretty much levelling out after that. We'll fix the overshoot in a minute. 10. Finally, start with .KD at 10% of the value of KI. Slowly increase it and notice how what KD tends to do is to provide a very quick correction to the .CV that helps the loop "pull in" even faster and helps narrow some of the overshoots. KD will help you whenever there is a disturbance in the system. It helps correct process disturbances whereas KI is all about pulling in the loop and PV is all about setting the initial gain (guess). 11. Now start running product through there. This isn't a one-time affair. It will take some additional adjustments (usually doubling or halving gains, followed by making much smaller moves after that) because an "idle" heating system has a different system gain from a real one. 12. If you want to try "auto tuners", my recommendation is to use them with caution. Sometimes they work well and sometimes not. Interestingly enough the above tuning method even though it is "seat of the pants" calculated EXACTLY THE SAME GAINS as the software product from ControlSoft. Or if you have RS-Logix 5000 Professional, there is a loop tuner available in there. Or, instead of the PID instruction, switch to the PIDE instruction. You will have to put it in a function block diagram but it also has an autotuner built right into the PLC firmware. I've never used this instruction yet though so I can't really tell you much else about it. 13. If you are having trouble getting the loops to stabilize, realize that you are probably fighting one of two things. Process heating applications usually are notorious for long lags (the time it takes for the PV to respond after you change the CV is very long), and they are notorious for integrating loops (errors in the loop tend to exponentially increase/decrease rather than remaining at a fixed value). If this is the case you may find that you will have to set the KP low, the KI even lower, and have a fairly high KD value. KD tends to help keep things stable while KI slowly corrects the errors. Your gains will be very low since both lag and integrating properties are fighting against making very fast changes. 14. Or you can instead use a sliding mode controller. These are often much better at controlling process heating applications than PID. And there's really only one parameter to tune. Search for "SMC" or "sliding mode controller" on this forum for references on how to do it.
1 person likes this

Share this post


Link to post
Share on other sites
Paul is right, heaters are slow changing, when I worked in heat treating, we hardly ever used the D in the PID. So basically it was a PI loop or the D was set to a very low gain to take it out of the equation.

Share this post


Link to post
Share on other sites
That's not quite what I said. I was alluding to the fact that getting these things to work right is highly process specific, and in the last two process heating problems I dealt with, one was trivially easy (almost any PID parameters will work reasonably well), while the other one was a very ugly bear. It has to be the toughest loop that I ever tried to tune. After 2 years of the current operation I'm still not 100% satisfied with the result but I would have to spend a lot more money and several months worth of work to get it to control better, and even then I'm not really sure if I wouldn't just run into some other process limitation. If you have a reasonably stable system with little to no external disturbances such as a batch oven (like the one that most people have in their houses), PI loops will work extremely well. For instance, I recently tuned up the controls for a large afterburner treating about 35K SCFM of flue gas off of a cupola. The exhaust gas flow rate is reasonably consistent. There is some cycling going on but relative to the reaction rate of the control loop, it's pretty slow. So the "standard" controls (large P, smaller I, very little D) does the trick. Even in these scenarios depending on placement of the thermocouples (and faith in the readings), integrating processes may come into play (resulting in loop oscillation) without using some derivative gain to keep it in check. At the same plant, I have another animal entirely. It's a large heat treating oven (35 MMBTU/hour) which processes 50-70 tons per hour of product, split into 5 zones including a rapid cool zone that is over 300 feet long with about 100 total burners. The product is produced in 4 semi-batch production lines which feed the oven. The loading rates over both the macro and micro scales are constantly varying. In addition, I don't have a lot of thermocouples to work with and the goal anyways is to produce consistent PRODUCT TEMPERATURE. The product slowly moves through the oven and the entire oven works on radiative heating. So the burners heat the refractory which in turn radiates onto the product. An operator regularly checks product temperature and adjusts the set points accordingly (human master loop in a cascaded system). In this scenario, the heat load is constantly changing, relatively speaking, which means that the process gains are also constantly changing. In addition, process response lags are very long because first the refractory has to be heated which in turn heats the product, which produces the result. In addition, the loop is integrating because it is very easy to over/under fire onto the brick for too long. Once you do that, the brick tends to remain at an elevated or low temperature and continues to radiate onto the product at the wrong rate, leading to an integrating process problem. The end result is that process stability is the critical factor, and accuracy is a secondary goal. In this oven, it is critical to react quickly and decisively to process upsets. So the correct tuning factors tend to be roughly D=12, P=8, and I is about 1. That was the best hand tuning effort I could make. So I enlisted ControlSoft's autotuner and it came up with nearly the exact same gains.

Share this post


Link to post
Share on other sites
Paulenger, hopefully zeratul's system will be similar to yours but probably not. There are equations for calculating the controller gains or time constants given the plant gain, time constants and dead time. From these equations one can symbolically see the relationships between the controller gains. One can gain in sight by studying these formulas because then you can we what really affects what. Until I know the plant parameters I would not suggest gains. So here is my Christmas present to you all For a SOPDT system ( second order plus dead time ) Kc=(T0+T1)/(K*(Tc+dt)) Ti=T0+T1 Td=T0*T1/(T0+T1) where: Kc is the ISA PID controller gain Ti is the integrator time consant Td is the derivative time constant T0 and T1 are the two plant time constants. Normally one is for the heater and the other is for the mass being heated. dt is the dead time. This reflects the transport time of heat. Now you can see that the ratio of Ti/Td is T0*T1/(T0+T1)^2 So what are the chances that Td is 10% of Ti? So how does one determine K,T0,T1 and dt? A couple of years ago I posted a Scilab program on www.plcs.net that read time, control and PV data and compute the plant parameters. Even if you don't use system identification software one can easily determine the gain using the method mentioned in earlier posts. The dead time is also easy to determine. This leaves just the two time constants to determine by trial and error. It would make good estimates of the two time constants and then calculate the controller gains. In stead of tweaking the controller gains I would adjust my estimate of the time constants and recalculate the controller gains. This way the conroller gains are all adjusted at the same time.

Share this post


Link to post
Share on other sites
Thank you guys for your replies, I got the jump start i needed and I started designing the logic file.. Power up on the system will be at the 10'th of next month and ill keep you updated if I need further help. Feel free to add any comments or advices as I will be checking the forum on daily basis. Thank you again

Share this post


Link to post
Share on other sites
if you can post your program file, we'll be glad to take a look at it for you ... good luck with your project ...

Share this post


Link to post
Share on other sites

hello

please how can i implement discrete function in rslogix 5000

for ex.

y(n)=-a1y(n-1)-y(n-2)+b1u(n-1)+ b2u(n-2)

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
Sign in to follow this  
Followers 0