RSLogix 500 PID

meroglu

Member
Join Date
Apr 2007
Location
Denver
Posts
4
Greetings all,

I'm new to PLC and I've been reading through many of the posts concerning PID process control in RSLogix 500. I have programmed the control incorporating all that I've gathered through all these great posts and replies, however I am not getting the PID to fully control my process and wanted to ask what I am missing.

I've got a pump that puts out a 0-100% output signal to set flow that is measured on a flowmeter from 0 to 1500 milliliters. The idea is to set the flowrate and have the pump dial in the frequency to maintain the flow set point. What I have done is taken the 0-1500 milliliter flowrate and scaled it to 0-16383 to use at N17:14 for the process variable of the PID. I've then taken the 0-16383 control variable N7:85 and scaled that back to 0-100 to send to the pump.

pidrung1.JPG



I do get the frequency to start the pump and give me flow, however it doesn't seem to be responding to the error or trying to close the gap between the flow set point and measured flow. The frequency on the pump seems to be a function of the Gain from the following set up screen and no actual controlling occurs.

pidsetup.JPG


The above pic is with the process off, so in actual operation the setpoint SP would have a number: 1092 corresponding to SP of 100 ml/min. There is a corresponding control output CV(%) say 12.1% which seems to correspond only to whatever I set the Gain to. Let's say at a gain of 1.0, I get a flow at the meter of 89 ml/min and NO ACTION takes place in order to close the gap, i.e. the frequency does not increase. At a Gain of 1.1, I get an output of 12.6% and a flow close to 100 ml/min, but it isn't actually being controlled by the PID.

What I thought might be the problem is the scaled error SE box had 0 even with the process running (I thought since it doesn't register an error, it doesn't see the need to take action) so I have added another rung (not displayed) to mov the calculated error to this bit, again this did nothing for the PID to actually control the pump. I know I am missing something here, can someone more experienced please help me out? Thanks for all your patience and excuse my ignorance.

Thanks in advance,
pd
 
Greetings meroglu ...



and welcome to the forum ... sorry that I don’t have time to do more than glance at your post right now ... but I can tell you this much ...



pid_wrong_a.JPG





that Process Variable entry looks VERY suspicious ... note that you’re starting your PID control block at N17:0 ... and the control block takes up 23 words of memory ... therefore N17:14 (which you’ve entered as your PV) is being taken from WITHIN that block of memory ... that’s not right ...



the PV should be taken from some OUTSIDE source ... usually it’s a transmitter in the field ... note that it MUST be scaled from 0 to 16383 for the PID to give good results ...



I’ll try to look at your post in more detail - but I can’t make any promises when that will happen ... I’m sure that others on the forum can help with your problem ... maybe what I’ve said here will help get you going ...


PS Edit ... I just noticed that this is a PID in RSLogix500 - not RSLogix5 ... that timer Done bit needs to go away ... specifically, in RSLogix500 the rung for the PID instruction should be UNCONDITIONAL (bare) except for the PID itself ... more specifically, the "trigger" arrangement should NOT be used ... also set the "Time Mode" for "TIMED" instead of for "STI" ...

sorry for the "hit and miss" approach ... I'm teaching this week and trying to play "forum" during my lunch break ...
 
Last edited:
What I have done is taken the 0-1500 milliliter flowrate and scaled it to 0-16383 to use at N17:14 for the process variable of the PID.
Try using N17:23 for your Process Variable address. Ron is correct, you must skip at least 23 words to allow room for the PID internal stuff.
I've then taken the 0-16383 control variable N7:85 and scaled that back to 0-100 to send to the pump.
Normally you should scale the 0-16383 to the digital equivalent of your Pump Variable Frequency Drive (VFD) INPUT signal requirement, which is probably NOT 0-100% but 0 to 10 volts, or 4 to 20 miliamperes. 4-20 miliamperes is equal to digital 6242 to 31208 for an Allen-Bradley 1746-NO4I Output Module. 0-10 volts would require scaling 0-16383 up to 0-32764.
 
Last edited:
Thanks for the responses!

The pics from above are actually the 20th (or so) and last-state of an iterative process to try different addresses to get this to function properly. The help document indicated that the 14th word of the PID block was the Process Variable address of the PID so I thought I'd try writing the value from the flowmeter to this location (thinking the PID would use it there).

After reading the above, I've changed the location of the Process Variable address to N7:86. Do I need leave all 23 words for internal use in my programming logic? Right now I am moving the user-defined set point to word 2, which is supposed to be the PID Set Point, is this also wrong? If so, how does the PID know what the SP is? This is a crucial ingredient I must be handling incorrectly!

Lancie1, your second paragraph is making me scratch my chin. I'm going to run out there and see exactly how the 0-100% is later scaled before being sent to the pump. Are you suggesting the PID scales to this range and outputs to the module directly, bypassing 0-100% to be scaled later in the program?
 
Thanks for the responses!



you’re welcome ...

After reading the above, I've changed the location of the Process Variable address to N7:86.



that’s better - as long as nothing else in your program makes use of N7:86 ...



Do I need leave all 23 words for internal use in my programming logic?



yes ... that’s how much “real estate” the PID is going to take up ... you can’t change that ...



Right now I am moving the user-defined set point to word 2, which is supposed to be the PID Set Point, is this also wrong?



no, that part is correct ...



question for you: did you take out the “trigger” mechanism from the PID's rung? ... you're doomed until that is taken care of ... it might be a good idea to post your .RSS program file - as long as it’s not “trade secret” type stuff ...
 
Lancie1, your second paragraph is making me scratch my chin. I'm going to run out there and see exactly how the 0-100% is later scaled before being sent to the pump. Are you suggesting the PID scales to this range and outputs to the module directly, bypassing 0-100% to be scaled later in the program?
No, I am not trying to confuse you more. I was just pointing out that the 0-100% output from the PID is actually a digital number from 0-16383. This number has to be converted to something that can be used by your Analog Output Module, so that it can generate a proportional signal to the VFD Pump drive. Usually the analog output module has the input range of 4262-31208 (for a 4-20 miliamp output, if you are using the PID range) which will not match your PID output range, unless you first scale it somehow, before sending it to the VFD as a current or voltage signal.

Basic question: What are you sending to the VFD Pump drive, a voltage or a current signal?
 
Last edited:
Typo correction, courtesy of Ron B: The 4-20 mA range is 6242-31208. I must learn to type with toes instead of thumbs.
 
Alright, I've just gotten back from looking at the program again and the good news is the PID appears to be trying to do some controlling!

However, it looks like Lancie1 has his finger on something important. The 0-100% signal is later multiplied by 308.4 (???) before it is outputed to the Pump. Does this indicate a 0-30840 signal being sent to the pump? The pump is indeed 4-20mA. It seems to me (from my limited knowledge) that the scaling was done in a fudge-factor sort of way by the original programmers and not actually scaled correctly. Does 0-30840 register in anyone's experience or why it may legitimately be done this way? I couldn't make sense of it.

Ron, do you mean the Timer and its DN bit on the PID rung? Is that incorrect?

With that being said, the PID controls the flow to a different SP than that entered. For example, when a SP of 125 ml/min is entered, it seems to output a frequency corresponding to about 65 ml/min flow. This can be moved closer to the actual SP by increasing the Gain on the PID, but I really think the output to the pump is causing the problem.

I am not allowed to upload the entire RSS file but I can get away with pasting images of the program rungs in question. What I will do is make an image of the rungs showing the whole section of the program from process variable, control variable, their scaling, signal to the pump.

Thanks again,
 
Ron, do you mean the Timer and its DN bit on the PID rung? Is that incorrect?



yes, that arrangement is INCORRECT for RSLogix500 ... once again, in RSLogix500, the PID rung should have NOTHING on it except for the PID instruction itself ...



on the other hand, the “external trigger/timer” that you’ve posted would be correct for MOST RSLogix5 applications ... many programmers confuse the two platforms when setting up PID control ...



most of the “big picture” concepts related to this particular issue are covered near the end of this post and in the rest of the thread it appears in ...



preview: with an “external trigger” such as you’ve shown, the RSLogix500 PID will have VERY little or NO Integral action - regardless of how you tune it ...



again, I wish I had more time to work on this ... good luck ...
 
Last edited:
Since you have no integral (reset) term, you will always have a steady state error. The size of the error will be inversely proportional to the controller gain (Kc).

Re-read the multitude of threads on the subject of PID. Ron Beaufort has written screeds on the topic and in layman's terms.
 
The 0-100% signal is later multiplied by 308.4 (???) before it is outputed to the Pump. Does this indicate a 0-30840 signal being sent to the pump?
Yes, if "SC" on the Flag list of your PID setup screen is set to 1 for Setpoint Scaling. That indicates that your ouput is a true 0 to 100, not the old standard 0-16383 PID output range.
 
Hi again,

Thanks again to all of you who have offered input into my PID problem and pointing me in the right direction. After you guys helped me get the general programming and setup right, we figured out the tuning of the application and it now works like a champ.

As a general feedback for those who happen to read this thread in the future, the problem I was having was completely due to:

1) Not setting up the PID rung correctly for RSLogix version used. This information needs to be acknowledged on a separate level when users are simply trying to identify programming examples. Sometimes the programming is similar enough to be mistaken by those who don't know better, it certainly happened to me.

2) Understand the words the PID requires and do not pass any information into the 23 word block other than the process SP.

3) Scale the PV and CV signals appropriately for the PID and ensure the CV variable is scaled back appropriately for the device. For me this was 16383 scaled to a 4-20 mA signal, 6242-31208 as provided by Lancie/Ron above.

4) Only after addressing the above 3 points, should you even begin to think about tuning. I made the mistake of thinking the setup might be correct and the problem may be a tuning issue, but I've realized it was premature only later.

These are the summary pointers I have thought to close this thread with to hopefully give general direction to people in the future that are searching the forum for information. I hope you all the best and thanks to everyone again.

meroglu
 
meroglu,
Excellent summary. It nice to see someone come back and acknowledge the help they receive.
And the summation of the solutions to your problem can only help others as you pointed out. Good job, my hats off to you. This is the way it should be done.
 
I am using PID instruction on SLC500 PLC for the first time. I have to tune it for controlling water level using a valve which operates at 4-20 mA signal. Can someone tell me how to know the values of Kc, Td and Ti and all that stuff.

Thanks in advance.
 
pid for rslogix 500 micrologix1200

hi can anyone help me with how to program a PID for rslogix 500 micrologix 1200 series AB PLC. please give examples and how to enter parameters for all the variables.

thank you
 

Similar Topics

Hi, Long time not in the forum, and not in the programming. I´m getting back. I was issued a conversion from RSLogix 500 to RSLogix 5000 (studio...
Replies
0
Views
1,271
I have 3 valves that I need to open for 1 minute every 30 minutes, but not all at the same time. I have one TON timer (Start Blowdowns Timer)...
Replies
15
Views
4,577
Hi good people I have a question regarding a program on a machines heater control, I have 3 x heater contactor controlled via a plc It looks...
Replies
5
Views
1,749
Hello All, This forum has been of great help for me As i mentioned in my earlier posts that I am a learner so pardon me if I ask silly questions...
Replies
9
Views
3,156
I am attempting to use the PID instruction in RSLogix 500, with a Micrologix 1400 PLC. I have I:2.3 (4 - 20 mA) scaled for 0 to 10000, and stored...
Replies
7
Views
6,180
Back
Top Bottom