RS5000 PID instruction help?

jbjbj

Member
Join Date
Aug 2005
Location
Buffalo NY
Posts
13
This is the first time I am trying to use a RSLogix 5000 PID and my lack of understanding this is version of a PID instruction is driving me crazy.

I am trying to control temperature ( avg. of 2 thermocouples ) using a proportional steam valve ( primary heat with the secondary (heating) fluid being 30% glycol.

My main problem is getting the PID configured/scaled correctly.

I am at the end of development and thought I would simulate the PIDs before shipping, to get a feel for how they respond.

However, I can’t get it to do anything except slam on and off.

This very well could be due to my P and I setting, since I can’t figure what the values are relative to ( max/min PV scaling?, eng units?, DINT? ) but my lack of understanding ( and ability to decipher the available help ) goes deeper than that with this PID instruction.



So…. Mainly working on PID_TEMP in “Heating”

I scale, in the PLC, the HMI temp set point to –346 to 2192 = 0 to 16383 ( type j thermocouple limits) and move that to PID_TEMP.SP, fine and well.

My process variable (DRY_SHELF_TEMP_AVG_PID) is from temp inputs also scaled (in PLC) 0-16383.

My Control variable is assigned to an analog out (Local:7:O.Ch1Data ) configured to 4-20 Ma.

I had an arbitrary P of 300 and I of 100.

I set up a couple to test bits to toggle on and off as required to enable the PID and allow me to write new temperature feed back. First attempt had no PID internal scaling set.

This would respond to a difference of set point vs. feedback by slamming the output (CV) on or off. At least it goes in the right direction.



I then noticed that I had no scaling set, so I set max/min PV 16383 to 0. Same results. eng units? Hmm. , I tried both none and –346 to 2192, this was now giving me odd process variable “display” on the PID.



I guess it comes down to I can’t fathom the relationships between these settings to The PID function and the relationship (scale ) of the P and I settings.



( oh yeah, on line I see a tieback value 4095-0 and can’t do anything about it, (regardless of PID enabled checkbox resets)



If I can get these working here, I can “tune” via brute force if required in the field.



Hopefully someone here has some experience with the 5000 PID (dependent version) and might be able to point me in the right direction.



I’ve attached the preliminary program (RS5000 v15) and for reference a HMI screen shot of the main process.



Thanks!!!

*edit* I can't post an .ACD type file and it's also to big 327k :(
 
I recently went through this with a temperature control PID.

First, the 5000 PID doesn't assume anything. Make sure you go through the config tabs and set the scaling. There's a CV scaling that hides back there.

Use the same scaling for PV and SP. Use 0-100 (%) for output, to help troubleshooting. Also scale your output card channel to 0-100.

Your "slamming" is because you have the gain set to an ungodly high value. Unless I know beforehand, I usually start "slow" with a gain of 1, and an integral of .5. After it's enabled, you can watch the loop and tune it for best performance.

I have found with PIDs, unless you know the exact behavior of every component in the process, start with the minimum config. Add to itif you need to. Starting complicated will make you a very frustrated programmer.

My earlier topic on my experience:
http://www.plctalk.net/qanda/showthread.php?t=26743
 
Last edited:
I think you may be overcomplicating things. The CLX PID instruction can handle everything in REAL engineering values so you should not need to have any complicated scaling. This is much simpler than the SLC/Micrologix setup. I would also point out that your Prop Gain is far too high ( by a factor of 100 at a guess). Once again the PID terms should be entered in eng. units. Finally, in CLX you need to set up some kind of clock to call the PID instruction at the required interval. Have you done this?
Andybr
 
Thanks!.

I figured I could try to zip it to size but was booted from the office.

What instruction help that there is states.

PV unscaled maximum:
Enter a maximum PV value (.MAXI) that equals the maximum unscaled value received from the analog input channel for the PV value.

And as the analog input configuration choices include "scaled for PID" I assumed that would be a good choice. This gives me a 0-16383 value foe my input. I also assumed that that the PID instruction should be operating with a 0-16383 range. As such a P gain of around 300 would be a nice lowish starting point. Or so I thought.

I will re config my temp in to eng units and my analog outs to 0-100, and gains down a 1.0 and .5.

I will have to re-do all the effected HMI display readings that are effected but that is ok as long as the PID works.

If I bring my PV into the PID in Eng units, what should I do to the Eng unit field in the instruction? I will set both to –346 to 2192 and see what happens.

As far as a clocking the thing, I assumed that just enabling the instruction with pre-conditions would kick it on. I will have to look into that part.

Thanks.

attached is the prelimenary version. I haven't incorperated any of the sugestions yet.
 
Last edited:
Actually my first next attempt will be to leave sp and pv alone (as they are both scaled the same, i.e. "PID" but set the "eng unit field" in the instruction to –346 to 2192. I will re config the analog out to 0-100.

I should get a chance to get back to the unit this afternoon. I will follow up with results.

Thanks again folks.
 
jbjbj

In order for the PID instruction to evaluate at the required intervals you must have some form of clock. There are a number of ways to do this but the most common are:-

i) Put the PID instruction in a scheduled task with the task interval set at the desired value.
ii) Use a timer to generate a clock pulse at the desired interval.

i) is more accurate but ii) is more flexible if you have many loops with different required intervals. In either case you must also enter the interval you are using into the PID instruction. If you simply place the instruction on a rung in your main routine it will evaluate on every scan but will assume that each scan time is the value you enter in the PID dialog.
Andybr
 
Sorry jbjbj

I have only just looked at your code and there is a clear issue with the PID instruction. You do indeed need a clock pulse to run the instruction as I previously suggested but you also need to run the instruction all of the time regardless of your conditional rung. If you run the programme as it is now the instruction will never be processed when SWM is selected so this part of your programme will not work.
Andybr
 
Thanks Andybr.

I was getting myself more confused it seems.

I thought the SWM would be a way to move different outputs to the analog out depending on the pre-conditions.
I wont use that but
1- run the PID all the time ( I assume adding a pulse as the PID pre-condition does that)
2- buffer the PID out to a new tag
3- move either a value ( usually 0 but I may add a pre-heat stage of 10-20% open) or the PID new buffer value to the analog output, with the move chosen by the former pre-conditions.

Thanks!

*edit* hmm, this may wind up the PID. Also move a temperary SP to keep the PID output off?
 
Last edited:
jbjbj
By all means keep the SWM. This will do what you want and will prevent wind up. Just move the PID instruction onto another run so that it is triggered by a clock pulse continuously.
Andybr
 


And as the analog input configuration choices include "scaled for PID" I assumed that would be a good choice. This gives me a 0-16383 value foe my input.



that “scaled for PID” choice is more applicable to Allen-Bradley’s SLC platform ... it ALWAYS and MUST work on a range of 0 to 16383 for optimum control ... since the 1769-IF8 module that you’re using for your analog input can also be used with SLC systems, the 0 to 16383 “scaled for PID” range is included in the module’s setup ... your CLX platform has much more flexibility in its PID configuration ...



I also assumed that that the PID instruction should be operating with a 0-16383 range. As such a P gain of around 300 would be a nice lowish starting point.



as others have already told you, 300 is WAY TOO HIGH ... 1.00 is much more reasonable to get started ... it’s very rare to see a Proportional setting much higher than 14.00 or so - but it does happen in some types of systems ... rule of thumb: if your Proportional setting is much higher than about 3.00 or 4.00 then something MIGHT be wrong ... again - this is JUST a “rule of thumb” - so don’t get hung up on it ... sort of like “my new car gets 350 miles per gallon” ... well, MAYBE it does ... but that number sure sounds fishy doesn’t it? ...



Hopefully someone here has some experience with the 5000 PID (dependent version) and might be able to point me in the right direction.



here you mentioned the “dependent version” - but the file you posted is set for the “independent version” ... this can be a MAJOR source of confusion ... survival tip: IF (big IF) you’re already sort-of-kind-of familiar (or better yet, VERY familiar) with the “dependent gains” equation from some other PLC platform, then set your PID equation for “dependent gains” before you go any further ... here’s just one MAJOR issue along these lines:



with the “dependent” setting you must use a SMALLER NUMBER to get MORE Integral action ...



with the “independent” setting you must use a BIGGER NUMBER to get MORE Integral action ...



plus the relative values of the Integral setting numbers are very different ...



and as Andybr pointed out, you definitely DO need SOMETHING to “clock” the PID ... note that in the SLC system, you do NOT use a “clock” or “trigger” instruction on the PID rung ... if you’re more familiar with the SLC/MicroLogix platforms, then this might be causing some of your confusion ...



back to the “clock” or “trigger” idea ... as others have said, this can be done by putting the PID in a periodic task ... or it can be done by using a timer’s Done bit to “trigger” the PID instruction ... survival tip: just use the simpler “timer done bit trigger” idea - and be sure to set the PID’s “Loop Update Time” setting to match the timer’s interval ... ALWAYS KEEP THOSE SETTINGS MATCHED ...



but if you decide to go the “Periodic Task” route, be sure to set the PID’s “Loop Update Time” setting to match the task’s periodic interval ... ALWAYS KEEP THOSE SETTINGS MATCHED ...



going forward: keep posting your files ... that’s the best way to get this thing nailed down ... this project sounds like a lot of fun ... I just wish that I had more time to help ... rest assured that you have plenty of qualified help here at the forum ...



good luck with your project ...
 
I've been reading some of the responses here and in another thread. My experience may be different, but in the thread I linked to above, my PID instruction has no trouble with using scaled engineering values. As long as the number is positive, I believe a number is just a number to the PID. Of course, the SP and PV have to be scaled the same.

Also, I didn't use a clock pulse. There is an update time in the istruction, and I used that. It is working properly.

This was on a 1756-L61. I didn't realize there was that much difference between contrologix and compactlogix processors.
 
Greetings tomalbright ...

you said:

Also, I didn't use a clock pulse. There is an update time in the istruction, and I used that. It is working properly.

well, if it's working I won't argue with success ... but you might want to take a look at the two posts which start here ...

I tried to show that under certain conditions (varying scan times, etc.) the loop may intermittently "detune" itself if the "trigger" event isn't properly set up ...

also the numbers that are used for the Integral and Derivative settings can seem "way-out-of-whack" when the "trigger" event isn't properly used ...

incidentally, I've seen several instances where people have complained about "calculated" or even "autotuned" values for PID tuning which were "way-out-in-left-field" and totally useless ... in many cases, the reasons that the calculated and recommended values didn't work was that the PID wasn't being triggered correctly ... hopefully that idea is adequately brought out in the second post - about Bubba's paycheck ...

but then - back to reality ...

as long as the processor's scan time doesn't vary that much - and as long as no one really cares about the "weird" PID settings (for Integral and Derivative action) - then everything can simmer along just fine with no problems ...

that's probably what's happening in your case ... and once again, I have no intention of arguing with success ... obviously you've got enough PID experiece behind you to make the system perform correctly ...

but still, I just feel more comfortable in telling our new friend jbjbj to stay more in line with "generally recommended" practices ... at least until he's gained enough experience to know when the "rules" can be safely "bent" ...
 
OK, I have been back through the documentation and I see what you mean. My scan time is pretty fast, so maybe that is taking care of it. I set the loop update time for 10 seconds, but I believe because of the way I have it set up, I am updating every scan. It's a temperature control, so a very slow process update. I'll have to change a few things to see how it acts. Even though it seems OK, I understand what you were getting at in the other thread, and I'd rather err on the side of caution by configuring it correctly.

Configuring it the way I did was an old habit. PLC-2,3,5... all a little different, and Contrologix is even more different. I'm learning in spite of myself!
 
Not so!

Ideally the PID would be working with infinite resolution to simulate an analog PID. Unfortunately this is not possible with digital systems.

tomalbright said:
IAs long as the number is positive, I believe a number is just a number to the PID.
You want to scale your PID properly so that you take advantage of all the resoltion available. High resolution feedback and constant sampling times allows one to be more aggressive when using the derivative gains when derivative gains are required.

The PIDs should be clocked properly as Ron advises. This allows one to calculate PID gains when plant parameters can be determined. If the PIDs are not clocked properly the auto tuning software will never work correctly.
 

Similar Topics

Hello All, Let me first start out by saying this is a great forum. I've found a lot of useful information on this forum and am glad to have...
Replies
27
Views
21,055
I'm trying to control a slow process where we only get an updated PV every 5-10 minutes. Right now we do a pseudo-automatic control that works...
Replies
7
Views
3,344
Hi Guys I have a cooler using evaps to set up PID to control the humidity. I put ugly step logic in it but although it works (+/- 4% humidity...
Replies
0
Views
1,078
Hello all, I am new to 5000 and am trying to set up a PID block. I need to control fan speed VFD using a temp indication. I have the temp coming...
Replies
11
Views
2,036
Good Morning, This may be an easy question for some...but I'll need a little guidance. I have a project where under a particular condition I...
Replies
2
Views
1,612
Back
Top Bottom