PID task change.

asalunk

Member
Join Date
Aug 2017
Location
Pune
Posts
8
Hello everyone,

In RSlogix5000 PID loops are running in continuous task. Those are to be configured in periodic task and tuning. can anyone please tell me what steps need to be done.
Thank in Advance.
 
To move the PID to a periodic task you would need to create the task, give it a scheduled time to run, then cut/paste the PID to the periodic task. The help file in RSLogix gives a good explanation of of to create a periodic task. Or you could just use a timer bit before the PID in it's current location so that it does not execute every scan.

Bubba.
 
is any modification in PID parameter like for tuning required for periodic task or keep it as it is like continuous task.
 
Are these ladder-logic "PID" instructions or function block diagram "PIDE" instructions ? I'm going to guess it's a ladder-logic PID.

Are there any timers, subroutines, or other methods being used to make the PID instruction execute periodically, or does it execute every single scan of the PLC ?

The ladder-logic PID requires both that you tell it what the update time is (the Loop Update Time field on the Configuration tab for the instruction), and that you execute the instruction at that rate.

Placing the PID instruction in an unconditional rung in a routine that is executed by a Periodic Task is the most precise way to guarantee execution at a periodic rate.

But it is also possible to get good performance, especially with relatively slow PID loops, by executing a subroutine containing the PID instruction based on a timer, or some other timing method.

If your PID instructions were executed at a rate equal to the PID Loop Update Time field, then you can move them to a periodic task without re-tuning them.

If they were not executed at a rate equal to the PID Loop Update Time field, then they will need to be re-tuned if you change their execution rate.
 
In Studio 5000, if you just plop the PID function block in the ladder like in Logix500, the loop calculations will not function correctly. The calculation will assume it is being called at whatever interval is specified in the PID configuration, say every 100ms, but instead it will be calculated at whatever the current scan time is for the processor, say every 5ms. It may sort of work, because you can adjust the gains for it, but if the scan time ever deviates, the tuning will be messed up.

"Best practice" is to put the PID into a timed task so that the scan time has no effect on the tuning, and it always operates consistently.
 
Last edited:
Storytime: I did a PLC-5 upgrade to ControlLogix a few years ago that had multiple PID loops in a heavily-loaded PLC-5/80 controller.

All of the PID instructions were in a Main Control Program, so they got scanned just like the default MCP, similar to a Continuous Task.

The PLC-5 scan time was around 100 milliseconds, and some of the loops had been configured for 100 ms update times. Others had been configured for 1000 ms update times but then tuned so that they worked even though they were being executed ten times faster.

Of course, just switching the logic to a 1756-L63 made it execute significantly faster; our scan time dropped to under 20 ms. And the loops went wildly out of control.

But we couldn't re-tune them all because of our short time window, so we just approximated how the PLC-5 had been running. Even the mis-tuned loops went into a 100 ms periodic task, and we got pretty good performance out of all of them.
 
So, i just cut my PID routine from continuous who's loop update time is 5 sec task and paste it in periodic task.will it perform as earlier configuration?
 
You MUST examine the PID instruction to see if it is being executed every scan, or if it is being executed periodically.

ONLY after you have determined that can you decide how to correctly configure your new periodic task.

If you can post a screen shot or ZIP and post the *.ACD file, that will help. I am not eager to continue guessing about how your system works.
 
I think from memory the PIDE will execute correctly in a continuous task except that the decimal of the last scan time will be dropped - i.e. if the time between scans was 18.4ms it will use 18ms for its integral and derivative portion of the equation

If it is the PID instruction running unscheduled (without a timer for example) in a continuous task then as other have pointed out its I and D calculations will be all sorts of wrong - however sometimes people come up with creative ways to deal with this

Post PLC file or at least the task that the instruction is running in
 
I think from memory the PIDE will execute correctly in a continuous task except that the decimal of the last scan time will be dropped - i.e. if the time between scans was 18.4ms it will use 18ms for its integral and derivative portion of the equation

If it is the PID instruction running unscheduled (without a timer for example) in a continuous task then as other have pointed out its I and D calculations will be all sorts of wrong - however sometimes people come up with creative ways to deal with this

So you're saying the (essentially) same instruction works differently if it's used in Ladder vs. Function Block? Why wouldn't the system be smart enough to know the context of use of the PID in Ladder and adjust the scan time accordingly?
 
So you're saying the (essentially) same instruction works differently if it's used in Ladder vs. Function Block? Why wouldn't the system be smart enough to know the context of use of the PID in Ladder and adjust the scan time accordingly?

The PIDE instruction is function-block-only, and will internally determine time between execution for use in the computation (if set for "periodic" timing mode). In this respect it is more error-proofed than the PID (no E) instruction. So, in effect, it is making the scan time adjustment.

The legacy PID instruction requires external timing, and has a set-up parameter to specify the time period between executions. There are a variety of ways to do this in the various supported platforms (PLC-5, SLC, CLX, etc.) -- some more reliable and precise than others.

It is still not completely clear which version the OP is referring to.
 
No the PIDE and PID instructions are different animals altogether. The PID is a positional form of the equation, the PIDE is velocity (change of error, not error directly). The PIDE has a lot of auto/man/operator/hand etc. mode handling built in (questionably too much)

The PIDE is only available in function block or ST programming (extra software cost) - Apparently they did this as a form of effectively licensing the autotune feature which they hired a different company to program for them, along with the other process instructions IMC, MMC etc.

The PID instruction is available in ladder or ST

You cannot simply just convert from one to the other - the units are different for one, but also they way they are programmed (all the .bits etc) and the language is different.

If you really wanted to use a PID instruction that could be placed in a continuous task and deal with its update time itself you would have to wrap up the PID instruction in an AOI which can calculate scan time - completely possible, completely unnecessary imo
 

Similar Topics

I was going over the code for one of our process unit and discovered that our PID loops are in the continuous task. I know they are usually placed...
Replies
20
Views
5,918
Hi There I am having a strange problem, i have put all my pids in to a periodic task and now i am having synchronization of the...
Replies
16
Views
6,025
Hi All Is it ok, to have bunch of pid instructions in a continuous task? I have read on this forum in some of the posts that there...
Replies
29
Views
14,152
Hello, I have a motor that we are sending a RPM Speed Output from 0-100% to the VFD. However, the Motor HP needs to be limited to 6000 HP and the...
Replies
3
Views
83
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
589
Back
Top Bottom