You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old June 8th, 2005, 03:45 PM   #16
ToddM
Member
United States

ToddM is offline
 
ToddM's Avatar
 
Join Date: Oct 2004
Location: Cascade Va.
Posts: 106
I got those screenshots in the wrong place, but ya'll get the idea ......Later Todd
  Reply With Quote
Old June 8th, 2005, 04:57 PM   #17
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,320
Greetings Todd,



sorry that I’m short on time ... can’t look at scaling, etc. right now ... but here’s one MAJOR issue ... you should change your PID “Time Mode” entry from “STI” to “TIMED” ... if you’re going to use “STI” mode, then the PID should be located in an STI file ... yours isn’t ... it’s located in Ladder File #2 and so it’s being executed on each and every scan ... not just once each 0.01 seconds like your “Loop Update” setting indicates ... this is going to cause your Integral and Derivative actions to be erratic (when and if you use them) ... also the settings for these will be “out in left field” from the settings we’d normally expect to see ... I’ve made several posts in the past about this "PID timing" issue ... it would probably be a good idea to search them up ...



I’ll try to look at your scaling tonight ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.

  Reply With Quote
Old June 8th, 2005, 08:28 PM   #18
ToddM
Member
United States

ToddM is offline
 
ToddM's Avatar
 
Join Date: Oct 2004
Location: Cascade Va.
Posts: 106
Thanks for your time

Hi Folks.... Again thanks for your time and attention. Ron...As per your suggestion I searched your posts {about 125 of about 500 of them} and found "PID loop update time and external trigger" I plan on taking it to work tommorow and reading through it. Do you recall others on this subject? If so I'll dig more later.

Thanks again.....Todd
  Reply With Quote
Old June 8th, 2005, 11:05 PM   #19
leitmotif
Member
United States

leitmotif is offline
 
Join Date: Nov 2004
Location: Seattle Wa. USA
Posts: 3,680
Tod

He also wrote "what is P (and I) (and D) in PID. Look all three up. well worth the time to read them. I did and learned a lot.

Dan Bentler
  Reply With Quote
Old June 9th, 2005, 07:25 AM   #20
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,376
I'M NOT AN EXPERT ON PID IN A SLC, but I think you should condition the PID block rung with a timer. The timer should be set to make the PID block execute at the same frequency as you have in the Loop Update parameter.

Someone please correct me if I am wrong.
  Reply With Quote
Old June 9th, 2005, 07:34 AM   #21
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,320
Greetings OkiePC,

with the SLC platform, the PID should be on an unconditional rung ... the "trigger" is built-in ... you're probably thinking of the larger PLC-5 platform ... that one (usually) does require an external "trigger" on the PID rung ...

note: if the SLC processor ever scans the PID with "false" logic, then unpleasant things happen to the Integral term ... basically, the Integral action goes back to zero and has to start over again ...

and note to Todd,

this post covers most of the issues associated with the way you have your PID's "Time Mode" set up ... I suggest that you start by reading the first post in the thread .... sorry that I still haven't had time to look at your scaling yet ...

and incidentally, the P, I, and D papers that Dan was kind enough to mention are available as PDF files in the "sample lesson" section of my company's website ... since they're each quite long, the PDF format is usually easier to handle than printing them out from the forum ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; June 9th, 2005 at 07:50 AM.
  Reply With Quote
Old June 9th, 2005, 09:09 PM   #22
ToddM
Member
United States

ToddM is offline
 
ToddM's Avatar
 
Join Date: Oct 2004
Location: Cascade Va.
Posts: 106
1st pop quiz

Hi folks... My 1st pop quiz. What have I learned so far? I need to change my "Time mode" to Timed and when in "timed mode" my PID funtion is "looked at" every "Loop update" time by the program.{does this make sense to anyone but me?} STI mode is "looked at" every scan of the program. Someone grade me before I go to far!!!!

Later...Todd
  Reply With Quote
Old June 10th, 2005, 07:32 AM   #23
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,320
Greetings Todd,



Quote:
when in "timed mode" my PID funtion is "looked at" every "Loop update" time by the program.




it makes sense ... but there’s a more accurate way to say it ... this is better:



Quote:
when in “timed mode” my PID function is “looked at” every scan ... but it is only “executed” by the processor every “Loop Update” time ...




specifically, the processor “sees” the PID (and actually updates the PID’s internal timer in the background) ... but the PID calculations (for P and I and D) are only done when the PID’s internal timer says “ok, time’s up ... now it’s time to calculate a new value for CV” ... so in this mode, you just have to leave the rung “true” continuously and the PID’s internal timer automatically takes care of “triggering” the PID into making its calculations on a proper schedule ...



Quote:
STI mode is "looked at" every scan of the program.




better would be:



Quote:
STI mode is “executed” by the processor on each and every scan ...




specifically, the calculations for P and I and D are done each and every time the processor scans the PID rung with true logic ... in this mode, the system expects YOU (the programmer) to make sure that the processor only scans the PID rung with the proper timing ... specifically, the timing of WHEN the PID rung gets scanned should match the setting of the “Update Time” on the PID setup screen ...



disclaimer: remember that we’re discussing the PID for an SLC processor here ... the rules are different with the larger PLC-5 system ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; June 10th, 2005 at 07:41 AM.
  Reply With Quote
Old June 10th, 2005, 07:58 AM   #24
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,376
Ron...thanks for the info regarding the differences between SLC and PLC5 PID instructions. I have a bad habit of generalizing when it comes to these processors, and it's caused me to put my foot in my mouth yet again. I looked at all my SLC programs and found three written by a vendor and one that I wrote that violate the rule by using a timer/DN to condition the PID block. Now I guess I'll have to get my butt out on the plant floor and fix them. A question for you first:

I need my PID action to "freeze" when a motor stops turning, and pick up where it left off when the motor starts again. Can I do this by enabling the manual bit? And do I need to MOV the PV to the SP while in manual?

Thanks
Paul C.
  Reply With Quote
Old June 10th, 2005, 01:12 PM   #25
ToddM
Member
United States

ToddM is offline
 
ToddM's Avatar
 
Join Date: Oct 2004
Location: Cascade Va.
Posts: 106
Ron. Thanks...This really clears it up in my mind and makes even more sense now. {Did I ever tell you that "You da man!!!"?} Thanks Okie for hanging in on this thread.

Later....Todd
  Reply With Quote
Old June 11th, 2005, 06:32 AM   #26
ToddM
Member
United States

ToddM is offline
 
ToddM's Avatar
 
Join Date: Oct 2004
Location: Cascade Va.
Posts: 106
Also.. Before I get too far along...

Hi folks... Before I get too far along in my project, Could I get your opinion on my method of trimming my analog output to the slave drive. If you go back and look at my code you'll see that I plan on manipulating the offset to trim the output. At 1st I was trying to manipulate the rate, but thats when I ran into the issue of math over run faults. Is this an acceptable method?

Thanks and Later....Todd
  Reply With Quote
Old June 12th, 2005, 10:46 AM   #27
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,320
response for OkiePC ...

Greetings Paul,



regarding the tendency to “generalize” when it comes to the Allen-Bradley PLC-5 and SLC-500 platforms ... you’re certainly not alone there ... while the two platforms are more similar than they are different, some of the biggest differences of all come into play with the PID instructions ... and there are MAJOR differences in this area ...



as for your setups that use an external timer to “trigger” the PID ... I think that you’ll find that the existing configuration acts more like a Proportional-only controller than anything else ... since the Integral action gets cancelled out each time the PID rung is scanned with false logic, the Integral term likely contributes little or nothing to the CV ... the Derivative action (if you’re using it) also usually acts weird with this “external trigger” setup ... you’ll almost certainly have to retune the loops once you correct the timing issues ... but once that’s done, you’ll probably see much more consistent operation ...



Quote:
I need my PID action to “freeze” when a motor stops turning, and pick up where it left off when the motor starts again. Can I do this by enabling the manual bit?




in simplest terms, yes ... with the SLC platform, the PID instruction just quits driving the CV location while operating in the manual mode ... so “freezes” is a perfectly good word for the action involved ...



side trip: note that this is very different from the PID as used in the PLC-5 ... there the manual mode (actually there are two modes which can be considered “manual”) continues to drive the CV ... the value used for the CV comes from either the “Tieback” or from the “Set Output” setting – depending on which of the two “manual” modes is currently selected ... and just to make it even more interesting, the “Set Output” mode is usually called the “Software Manual” (SWM) mode when working with the PD-type control block ...



Quote:
And do I need to MOV the PV to the SP while in manual?




this depends on your application ... but most probably not ... the big question is: what will you do with the SP once you leave the manual mode and go back to automatic? ... if the answer is simply: “put the SP back where it was originally” then there is probably little reason to change the SP while you’re in the manual mode ...







here we have a simple system which uses a “dummy” input to the PID ... from point A to point B the PV (red trace) is tracking the SP “right on target” at a setting of 4096 ... the CV is simmering along at 1638 from point M to point N ... at point B the SP is suddenly increased from 4096 to a new setting of 5734 at point C ... the Proportional action responds by increasing the CV from point N to point O ... the PV continues on from point B to point E ... remember that for this demonstration it’s just a “dummy” signal and cannot change ... the Integral action responds to the continuous error by ramping the CV up from point O to point P ... and now we come to your question ...



at point P the PID is placed in the manual mode ... notice that the CV simply “freezes” at its current value as it goes from point P to point Q ... then at point Q the PID is returned to the automatic mode ... notice that the Integral action picks up right where it left off and continues ramping the CV from point Q to point R ... if I understand your question, this is the action you want ...



at point R we try a slightly different approach ... again the PID is placed in manual mode ... but this time we also force the SP to take on the current PV value ... so the SP goes from point D down to point E ... meanwhile the CV remains “frozen” at its current value and continues on from point R to point S ...



at point S we return to the automatic mode ... but what good is automatic mode if we leave the SP at its “not-quite-right” setting of 4096? ... and so at point F we raise the SP back up to our desired setting of 5734 ... the PID responds to the sudden increase in “error” with a “bump” in the CV from point S to point T ...



now remember that I don’t know anything about your system ... but “smart money” says that you probably don’t want that annoying “bump” in the CV to occur each time you switch over from the manual mode to the automatic mode ... if so, then my best guess is that changing the SP while in the manual mode is probably just going to cause more trouble than it’s worth ...



now to close out with a brief discussion of the pitfalls of using an external “trigger” for a PID rung with the SLC platform ...







here we’ve started a test with our SP dialed in at 5734 ... the PV is a “dummy” which has been set for demonstration purposes at a constant 4096 ... we’ll keep our PID in the “TIMED” mode throughout the entire test ... when the test was started, the PID rung was being “triggered” once each 1.00 second by a timer’s Done bit ... if we run through the basic math involved with our “start test” conditions, we get E=SP-PV ... so 5734 minus 4096 gives 1638 for an Error signal ... if we multiply that by our Proportional (Kc) setting of 0.80 we get 1310 ... and that’s what the PID is cranking out for its CV reading as we start the test at point A ... and notice that our Integral action has been turned off by a Ti setting of 0.00 ... specifically, we’re using a Proportional-only controller for our “start test” conditions ... and also note that our improper “triggering” of the PID rung has no effect (pro or con) on our Proportional action ... because the Proportional action is instantaneous and is not “time related” ...



at point B we’ve dialed in some much-needed Integral action by changing our Ti setting to 0.50 ... but notice that the Integral action takes all the way to point C before it has any effect at all on the CV ... and even at that point, the Integral action is just a wimpy little increase of only 43 units ... we need more power ...



and so at point D we decide to scrap that improper external “trigger” arrangement for the PID rung ... and now look at our Integral action kick in and start ramping our CV signal up ...



summing up, the biggest problem with using an external “trigger” for a PID rung with the SLC platform is that the arrangement pretty much neutralizes any effect of the Integral term ... remember that the Integral action is “zeroed out” each time the rung is scanned with false logic ... and so then the Integral has to “start over” again each time the rung is scanned with true logic ... the poor Integral has a very hard time trying to make any headway at all with this type of arrangement ...



I hope this helps ... and thanks for bringing the subject up for discussion ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; June 12th, 2005 at 10:52 AM.
  Reply With Quote
Old June 13th, 2005, 09:16 AM   #28
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,376
Ron, your explanations are outstanding!

Many Thanks
Paul C.
  Reply With Quote
Old June 18th, 2005, 03:45 PM   #29
ToddM
Member
United States

ToddM is offline
 
ToddM's Avatar
 
Join Date: Oct 2004
Location: Cascade Va.
Posts: 106
Quote:
Hi folks... Before I get too far along in my project, Could I get your opinion on my method of trimming my analog output to the slave drive. If you go back and look at my code you'll see that I plan on manipulating the offset to trim the output. At 1st I was trying to manipulate the rate, but thats when I ran into the issue of math over run faults. Is this an acceptable method?

Thanks and Later....Todd
I thought I'd try this again, in case someone hadn't seen it. I would appreciate any and all opinions or suggestions.

Thanks and Later....Todd
  Reply With Quote
Old June 18th, 2005, 06:59 PM   #30
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
CLEARLY...

All posts made to this point are over Todd's head.

Gee, doesn't that seem to be the nature of Canned-PID Routines when one must be subjected to the math involved in the particular Canned-Routines.

There ARE better ways!

You can ALWAYS roll-yer-own!

That, however, requires that you understand how to handle math in a dynamic situation.

Damn, I've always wanted to take the time to develop an explanation for rolling-yer-own. It is, however, very extensive... very math-intensive.

Maybe...

PS...

This roll-yer-own, through ladder, can work fine if the speed/timing demands are not too great. If they are, then a specially PID routine might be more in order. If not, then roll-yer-own works very well!

Last edited by Terry Woods; June 18th, 2005 at 07:09 PM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
AB PLC5 PIDs Derek McFarland LIVE PLC Questions And Answers 23 March 2nd, 2005 01:18 AM
SLC 5/05 PID Time Mode Question Dwarfer1 LIVE PLC Questions And Answers 7 December 15th, 2004 03:52 AM
just another PID / SLC question Mathias LIVE PLC Questions And Answers 9 December 14th, 2004 03:33 PM
Use a PID? MarBa LIVE PLC Questions And Answers 4 May 8th, 2003 08:31 PM
how often should I trigger the PID? Ron Beaufort LIVE PLC Questions And Answers 11 February 22nd, 2003 10:57 AM


All times are GMT -5. The time now is 09:37 PM.


.