Help - Search - Members - Calendar
Full Version: micrologix PID loop
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
mikey431
I am working on an old program and trying to figure out why the previous programmer do certain things on heater PID loop block of an A-B Micrologix 1200.And I am pretty new on this stuff so stick with me.

The first thing I dont understand is PID mode. I can see through the ladder that the Td is set at 1.15 on PID block but the mode is set at STI but i could not find any STI sub-routine and S:30 word value is 0.I do know if using the Timed mode, the timer need to be set so that the PID block is scanned at the rate that is set by the timer.However, I do not know the advantage of Timed over STI mode and why he does not have a sub-rountine to control Td.

The second question is the loop output signal. The heater loop output ( 0- 100%) is scaled to match the 4-20 mA analog output signal which then is fed to an SCR and send power to heater. I dont know why he has to use this 0-100% output instead of feeding the loop control variable (CV) directly to the 4-20 ma output.I read couple tutor guides on the net and I believe that since the CV has higher resolution then the 0-100% output loop, feeding the CV to analog output will give better heater control. However, I am new to these stuff so I am not sure ...Hope someone can give me some insight on these topic....
Alaric
QUOTE(mikey431 @ Feb 28 2007, 11:54 PM) [snapback]50681[/snapback]

The first thing I dont understand is PID mode. I can see through the ladder that the Td is set at 1.15 on PID block but the mode is set at STI but i could not find any STI sub-routine and S:30 word value is 0.


In the micrologix PLCs the STI is not configured thru the S file. It is set up in a function file.
Look in the project tree to the left in Logix500. Under Controller you will find function files. Click that and select the STI tab.

QUOTE
I do know if using the Timed mode, the timer need to be set so that the PID block is scanned at the rate that is set by the timer.However, I do not know the advantage of Timed over STI mode and why he does not have a sub-rountine to control Td.

The SLC500/Micrologix PID works differently than the PLC5 PID. When using a PID in timed mode on the SLC500 or Micrologix platforms the PID instruction must be on an unconditional rung. You do not use a timer, rather the PID instruciton self times when in timed mode. If you programmed a timer on a rung with the PID in timed mode then when the rung was false the 32 bit integral sum word will be reset (thats bad.) Refer to the instruction set reference manual, this is covered in there.


QUOTE

The second question is the loop output signal
. The heater loop output ( 0- 100%) is scaled to match the 4-20 mA analog output signal which then is fed to an SCR and send power to heater. I dont know why he has to use this 0-100% output instead of feeding the loop control variable (CV) directly to the 4-20 ma output.I read couple tutor guides on the net and I believe that since the CV has higher resolution then the 0-100% output loop, feeding the CV to analog output will give better heater control. However, I am new to these stuff so I am not sure ...Hope someone can give me some insight on these topic..


You are correct. The CV has a higher resolution. The output perecent word only gives you the nearest integer value 0-100% and was intended for information. Directing the CV to the output (properly scaled) would be better.
Ron Beaufort
QUOTE
The first thing I dont understand is PID mode.


not sure what you mean there ...

[attachmentid=4289]

are you talking about the “Time Mode” setting? ... if so, then here’s some information that you definitely need to know ... first of all, the Td setting that you mentioned has NOTHING to do with the “Time Mode” setting ... actually the Td setting is only responsible for tuning/adjusting the Derivative action ... notice that I’ve crossed it out in the figure above - just to show that it has nothing to do with our discussion in this post ... now we WILL have to come back to it later - but let’s ignore it for now ...

QUOTE
the mode is set at STI but i could not find any STI sub-routine and S:30 word value is 0.


looks like you’re thinking about the SLC platform ... in a MicroLogix 1200 you usually have to look in the “Function Files” feature to find an STI ...

[attachmentid=4290]

if you look there and find that an STI is NOT being used, then your original programmer has apparently set the PID up wrong ... that’s assuming that I really understand what you’re saying ... can you post your .RSS file so that we can check for sure? ... just for the record, this is probably the MOST COMMON error in setting up a PID - so I won’t say that your original programmer is in “good” company - but I can assure you that he has a LOT of it ...

QUOTE
I do know if using the Timed mode, the timer need to be set so that the PID block is scanned at the rate that is set by the timer.


not exactly ... that would be true with a PLC-5 or a ControlLogix system ... but not with an SLC or MicroLogix system ... for SLC and MicroLogix, you don’t use a timer ... think of the “timer” as being “built-in” to the PID instruction ... all you have to do is set the “Time Mode” for “TIMED” and set the Loop Update setting for how often you want the PID to be executed ... the PID takes care of the rest ... specifically, in an SLC or MicroLogix system, the PID rung should have only ONE thing on it - and that’s the PID itself ... more specifically, there should NOT be any reference to a timer on that PID rung ... see the rung in the first picture above ...

QUOTE
The second question is the loop output signal. The heater loop output ( 0- 100%) is scaled to match the 4-20 mA analog output signal which then is fed to an SCR and send power to heater. I dont know why he has to use this 0-100% output instead of feeding the loop control variable (CV) directly to the 4-20 ma output.


I can’t say for sure without knowing more (actually ALL) about your system - but here’s something for you to think about ... the output of the PID (the CV) will always range from 0 to 16383 ... now assuming (gosh I hate that word) that you’re using a 1762-IF2OF2 for your analog input and output, there are basically two ways to go ... the module MIGHT be set up for “Raw/Proportional” - or it MIGHT be set up for “Scaled for PID” ... IF (big IF) it’s set for “Scaled for PID” then most programmers would indeed set the PID’s CV setting to go directly to the analog output address ... most programmers would consider the use of the PID’s internal “Control Output CV (%)” value as a step in the wrong direction ... specifically, (as you mentioned) instead of having about 16383 steps of resolution, your system APPEARS to have only 100 steps of resolution ... (my distinguished colleague Peter Nachtwey is NOT going to like that situation) ...

now STOP and think about this - before you DO something to the system ... it might seem natural to go right out and “fix” some of the things that I’ve just mentioned ... do NOT do that ... the system is “sort-of-kind-of” working ok, right? ... if you rush out and change the set up, even in the RIGHT direction, then you’re probably (almost assuredly) going to have to retune it ... that could be very time consuming ... I’d recommend that you leave things the way they are until we’ve had time to go further with this discussion ... and I REALLY do recommend (strongly) that you post your .RSS file ...

also, you might want to read this post ... and be sure to read the next post in that same thread - especially the part about Bubba’s paycheck ... I’ve used that same analogy on my students for several years now - and it seems to help them understand how the PID’s “trigger” (or lack thereof) can affect the PID tuning adjustments better than anything else I’ve tried ...

also there are several basic PID papers that I’ve written on our company’s website ... yes, I know that the website is a wreck - the kid that got paid to “fix” it didn’t do such a great job ... anyway click the link under my signature (below) and go to the “Sample Programs” area ... you can find the same PID material by searching my name and “PID” on the various forums - but the website postings are in an easy to print .PDF format ...

PS Edit ... and it looks like my distinguished colleague Alaric has beaten me to the punch again ... sorry for the duplication ...
Alaric
QUOTE(Ron Beaufort @ Mar 1 2007, 02:14 PM) [snapback]50743[/snapback]

PS Edit ... and it looks like my distinguished colleague Alaric has beaten me to the punch again ... sorry for the duplication ...


But, as usual Ron, you have a gift for presenting through yet simple to understand explanations and easy to follow instruction. Keep up the good work.

mikey431
ony my first question, I meant Time mode.Sorry for the confusion.
Here is my RSS file. The original program has more code in there but I deleted other non-related stuff. Hope you dont mind. [attachmentid=4293]
Alaric
Like my distinguished collegue Ron indicated, it appears that the programmer has made a common error. There is no STI configured. PD14:0 is addressed in Ladder 9 and ladder 9 is a regular subroutine called from rung 2:4. However, PD14:0 is configured to run in STI mode rather than timed mode. This is not good.

However, as Ron indicated, you may not want to go changing everything right away. But there are some things that need to be fixed. In STI mode the PID updates its output everytime it is scanned - from looking at the status file this is somewhere between every 4 and 5 milliseconds rather than the .12 seconds the original programmer thought he was setting up. But it you go making changes right away then the loop will have to be retuned.

The answer to the question "How well does this perform right now?" would be helpful.

[attachmentid=4294]
mikey431
QUOTE(Alaric @ Mar 1 2007, 06:26 PM) [snapback]50761[/snapback]
Like my distinguished collegue Ron indicated, it appears that the programmer has made a common error. There is no STI configured. PD14:0 is addressed in Ladder 9 and ladder 9 is a regular subroutine called from rung 2:4. However, PD14:0 is configured to run in STI mode rather than timed mode. This is not good.

However, as Ron indicated, you may not want to go changing everything right away. But there are some things that need to be fixed. I haven't had time to give the program a really good look over yet.

The answer to the question "How well does this perform right now?" would be helpful.

[attachmentid=4294]



Like you guys suspect, it kinda work but it just sluggish and the feedback i got from the service guys is the system sometimes overshoot on startup...I suspect the time mode may have something to do with it
mikey431
[quote name='mikey431' date='Mar 1 2007, 06:34 PM' post='50762'] [quote name='Alaric' post='50761' date='Mar 1 2007, 06:26 PM'] Like my distinguished collegue Ron indicated, it appears that the programmer has made a common error. There is no STI configured. PD14:0 is addressed in Ladder 9 and ladder 9 is a regular subroutine called from rung 2:4. However, PD14:0 is configured to run in STI mode rather than timed mode. This is not good.

However, as Ron indicated, you may not want to go changing everything right away. But there are some things that need to be fixed. I haven't had time to give the program a really good look over yet.

The answer to the question "How well does this perform right now?" would be helpful.

[attachmentid=4294]

[/quote]

I guess i need to start fixing the Time Mode first
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.