PIDE's in periodic tasks RSLogix 5000

BENNY

Member
Join Date
Mar 2003
Posts
22
I am currently adding pide's to an existing RSLogix 5000 program (ver 13)for controlling our scrubbers. I am putting the pide's in a periodic task. I'm wondering how many pide's would be good to place in a periodic task or would it be better to place each one in its own periodic task ? I would appreciate any help with this and thanks in advance.
 
Benny

In your case here it would depend on what you need you scan time to be and how much each PID increases that. If scan time isn't an issue then put them in one. If it is give them each their own and call them incrementally so as to never increase your cycle time beyond your project tolerances. I am sure that there are those who will have there own preferences but your project requirements will dictate what you need to do here.
 
I would create multiple programs under one periodic task and schedule those program to all run. Put one PID per program. This way you can have local tag space for each of your PIDs, so you can use the same tagnames for consistency, but yet each tag is still unique because it is local to the program.
 
A separate but related question.

Assume I have 5 periodic tasks I want to run. Further assume I want them all to run on 10msec interrupt times. Is the logic engine smart enough to stagger the scheduling so I only get one periodic task run every two milliseconds or does it queue them all up and run them at once? One way will have a much more significant impact on scan time than the other.

Keith
 
You can put them in one periodic task only if loop update time is the same.

PIDE uses loop update time from the periodic task so it is very important to have periodic trigger rate exactly equal to the loop update time.
 
kamenges said:
A separate but related question.
Assume I have 5 periodic tasks I want to run. Further assume I want them all to run on 10msec interrupt times. Is the logic engine smart enough to stagger the scheduling so I only get one periodic task run every two milliseconds or does it queue them all up and run them at once? One way will have a much more significant impact on scan time than the other.
All depends on priority level.
If all 5 tasks have same level, CLX will execute them one at the time assuming nothing with higher priority will interrupt it.
 
I understand it will execute them sequentially (assuming same priority and no higher priority interrupts). But does the logic engine execute them immidiately, back to back, in the same interrupt timeslice or does the engine inject some dead time between them to allow for cyclic program processing. The only real requirement is that the task occur on a fixed time delta, not that it be timed to any other timed event.


Keith
 
kamenges said:
I understand it will execute them sequentially (assuming same priority and no higher priority interrupts). But does the logic engine execute them immidiately, back to back, in the same interrupt timeslice or does the engine inject some dead time between them to allow for cyclic program processing. The only real requirement is that the task occur on a fixed time delta, not that it be timed to any other timed event.

Yes, all will be executed them immidiately, back to back, in the same interrupt timeslice.
CLX does not create schedule like ControlNet does
 
Originally posted by Contr_Conn:

Yes, all will be executed them immidiately, back to back, in the same interrupt timeslice.
CLX does not create schedule like ControlNet does

That could hurt. You definitely need to be a bit careful about what and how often you call stuff. Periodic interrupts might have a serious effect on scan time.

Keith
 
kamenges said:
That could hurt. You definitely need to be a bit careful about what and how often you call stuff. Periodic interrupts might have a serious effect on scan time.
Keith,

I think logix has few ways to avoid this:
Normally periodic tasks for PIDE have rate 0.5-2sec
If you set rate for each task little different they will not interfere:
Example: 500ms, 505ms, 510ms etc.
Technically whole controller program should use periodic tasks:
Something like this:
- high rate for critical areas 3ms
- medium rate for regular logix - 15ms
- non-critical applications and HMIs sevices 200ms

In my opinion Continous Task should not be used at all.
Every task should have an RPI.
Cont task is a remnant of old PLC school.
 
I think this is getting more complicated than it has to be...

The only reasons I would create more than one periodic task with the same prioity and rate would be:
I need more programs than will fit in a single task. Not as big a problem since they increased from 32 to 100.
Logical separation (different areas etc.)

I certainly would not create multiple periodic tasks at the same priority and rate in hopes of somehow improving performance, because it just isn't going to help.

If you want your PID loops to process correctly (especially the integral and derivative terms) then they need to be in a periodic task at the highest priority. This will guarantee that the PID loops will be executed at precise intervals. Any task that executes at a higher priority will induce some jitter in the PID loops. Note that you can certainly execute other tasks at a faster rate than the PID task with no problem at all.

 
Last edited:
If you want your PID loops to process correctly (especially the integral and derivative terms) then they need to be in a periodic task at the highest priority. This will guarantee that the PID loops will be executed at precise intervals. Any task that executes at a higher priority will induce some jitter in the PID loops. Note that you can certainly execute other tasks at a faster rate than the PID task with no problem at all.
This is true for high speed PID loops with few ms loop update time
Most of applications of PID are for heating and filling applications with loop update time from 0.1 sec and higher
It will be nothing wrong if this task interrupted or executed with slight time deviation (less that 1%)
 
kamenges said:
A separate but related question.

Assume I have 5 periodic tasks I want to run. Further assume I want them all to run on 10msec interrupt times. Is the logic engine smart enough to stagger the scheduling so I only get one periodic task run every two milliseconds or does it queue them all up and run them at once? One way will have a much more significant impact on scan time than the other.

Keith

Again, even in that case, unless you plan to have an exceptional amount of routines (and I hope you don't, as the main cyclic task would suffer), I'd schedule a single 2msec task, and then make the main routine call each subtask in order.

So, first scan, initialize a 'sub-task' integer to 0, and then in the interrupt task, just use some compares to call your other sub-tasks, then at the last rung add one to the sub-task integer, if it's over 5, reset it to zero.

The compares should be 'sub-task = 0 jsr sub1', 'sub-task = 1 jsr sub2' etc.

That will keep things timed as you want, and not incur the overhead of too many periodic tasks.
 
Contr_Conn said:
If you set rate for each task little different they will not interfere:
Example: 500ms, 505ms, 510ms etc.

This arrangement will definitely lower the rate at which the programs conflict, but it won't eliminate them. Every once in a while all three of those programs are going to try to execute at the same time (kind of a grand alignment of the planets). When that happens, two of them are going to run late. How often this happens is impacted by how long each program executes. If it's more than 5ms, it happens often. Conflicts between just two of the programs happen more often.

My preference for this situation would be to put all three programs in the same periodic task but arrange as follows:
Execute first, any program that requires accurate timing and let the remaining programs jitter if they can tolerate it.
Or if all the programs require accurate timing, then first execute the program that has the most stable execution time. And execute the program with the least stable execution time last.

Or re-write the programs so the execution time is more stable. The programs would necessarily run slower, but take the same amount of time on every scan.

In reality, most programs don't have these requirements and you can arrange your programs within the task in whatever order looks nice. <g>

I do like your recommendation about using only periodic tasks and leaving the continuous task empty. I've played with that style but haven't put it on a plant floor yet. I agree that it's a carryover from the PLC5 "let it go as fast as it can" style.
 

Similar Topics

i am slowly finding my way on how to use a PIDE and it raised a question- i have other programs written by two contract integrators that used PIDE...
Replies
4
Views
3,823
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
110
Have a logix controller and I'm using the PIDE block for the autotuner. I've got the hang of doing it for direct control things like pressure...
Replies
21
Views
1,669
Studio 5000 version 34. Have error on PIDE CVFaulted (Status1.2), Control variable (CV) health bad. No more information online or in...
Replies
3
Views
937
Hi everyone, I am trying to add a control loop to my HMI interface however I keep getting the following issue, any idea why this would happen?
Replies
8
Views
1,563
Back
Top Bottom