timer in continuous task

pittlei

Member
Join Date
Sep 2019
Location
Chicago, IL
Posts
10
I have a question in the rslogix 5000 timer.

for example, I have a 1s timer in a continuous task.

does it mean the timer is not actually 1s but (1s + unknown overhead)?

thanks
 
I am trying to use the timer to set up the PID instruction parameter

in some youtube tutorial, for the PID instruction, the loop update time needs to match with the timer setting.

However, the rslogix 5000 HELP file indicates we shall use periodic task for the PID instruction, instead of the timer in continuous task.

I am trying to understand which way is better.

thanks
 
The timer will time to about 1s, however, like many things there could be an error but quite small, periodic tasks will interrupt any scan so they will be quite consistent. for PID in most circumstances a few milliseconds will not have a major effect (except for those purists out there). however, periodic is probably best for consistency. I have never had any real problems even adjusting the periodic task on PID's has normally not had a great effect on the process within limits.
 
Yes, the actual scan period times will be long: mean cycle times will be about half a millisecond (or more*) longer than the nominal timer setting for the method chosen (single time, ping-pong (cascading) timers, STI) Using the internal clocks directly can provide better accuracy.



That said, a few ms out of a second long will is unlikely to affect the PID algorithm significantly; even if it did the mean fractional delay could be determined by calibration and simply be converted to offsets of the time-based PID parameters.





TL;DR



* The tests that gave those results had minimal processing e.g. < 1ms/scan; I expect the error of the timer- and STI-based means wrt the nominal target is of order the per-scan time, so if your scans take 10ms, then expect errors of order 5-10ms. This is not the case for the FRC and RTC methods; they will always have errors of means of order the resolution of the measuring technique.


e.g

  • If you use a single self-resetting timer in the continuous running scan, the start of scans when the timer is detected as expired (.DN (done) bit is 1, in A-B jargon), which in turn would trigger an execution of the PID instruction, will be about 1000.5ms with a standard deviation of about half a millisecond.
  • If you use an STI routine, the starts of the interrupt routines will be about 1000.2ms with a standard deviation of about a third of a millisecond.
Better methods to get closer to the targeted time involve either the free-running clock (FRC; MicroLogix 1xxx; target resolution 0.1ms) or the real-time clock (RTC; target resolution 1s); the mean time between timed scans using these methods will be 1000.02 or better, although the standard deviation will be similar to the other methods.


Cf here; plotted data are in PNGs here. The single timer case, with its double-humped frequency distribution, does not apply exactly to the PID case, but the cascading timer case does:


cascading_timers_freq.png




The image below is for a single repeating timer running
 
Last edited:

Similar Topics

Hello again. SoI need to read data from another controller every 60 seconds. I put in a TON and I get one read. I want to reset the same timer...
Replies
4
Views
3,103
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
215
Question to anyone with ideas about my thoughts on upgrading a very vintage timer, which is being used to switch between 2 5hp domestic water...
Replies
14
Views
364
why my timer only executes once here? After first time i use it, ET stays at 0ms all the time. It is in FB
Replies
5
Views
288
Good morning guys, I'm searching for a Timer relay which accomplishes the "flasher" condition in the photo attached, however, I need the ability...
Replies
2
Views
532
Back
Top Bottom