Advanced Control: Don't Use PLC Timers When..

Quite possible:

  • maybe the free-running clock is non-linear in time;
  • maybe STI (Selectable Timed Interrupt) in MicroLogix 1xxx is not the same kind of timed interrupt being discussed here;
Here is the code.


Apologies, I didn't see "selectable timed interrupt" in the readme, so I missed the data. I've never used a micrologix, so I don't know if it qualifies or not, but at the least it sounds plausible.
 
The ML 1100 is a PLC. It is not the micro controller in the PLC. The micro controller in the PLC should have timer/counters that work as I said.
So what is the micro controller in the ML1100 and what timer/counter does it use?


Back in the dark ages we used I8253s and I8254 counter timer chips. These would need to be reloaded after every interrupt. This could cause the variance you see but these are old chips from the early 1980s.


The 80186s I used in the 1980s -2008 had built in timer counters that didn't need to be reloaded by software every interrupt. They reloaded automatically in hardware so they never lost time.


Modern controllers should never lose time by requiring reloading the timer counter by software after each interrupt.
 
Back in the dark ages we used I8253s and I8254 counter timer chips. These would need to be reloaded after every interrupt. This could cause the variance you see but these are old chips from the early 1980s.




The MicroLogix line is part of, or related to, the SLC (Small Logic Controller?) family, from what The Google tells me, and the SLC line came out around 1991. It would not surprise me if older chips were used.


Maybe PeterN could add a caveat in the PDF that Timed Interrupts *should* work that way, but some PLCs do not implement them correctly.


Anyway, even with the 0.2ms "error" in the STI timing, it was easy to implement a better timing algorithm in ladder using the free-running clock; I was surprised that a free-running clock was not universal.
 
Last edited:
We've had to use these methods when accumulating volume flow over a long period of time from an analog signal from a flow meter, as one example.

If you can share I'd like to compare against other accumulator code I've used.
 

Similar Topics

This video shows the things I think about on page 1. I use Laplace transforms a lot. Laplace transforms allow one to express differential...
Replies
2
Views
1,807
Instead of this info getting lost in another thread I will start a new thread. For those that don't know you can search for Advanced Control on...
Replies
8
Views
2,652
This topic deserved to be a separate thread with and Advanced Control header. The first video was made from videos a couple of years back. You...
Replies
3
Views
1,522
Hello dear experts! I use WinCC Advanced Runtime V15 as a HMI for the process. I grab values from AB Micro 850 PLC via Modbus TCP. On the HMI...
Replies
2
Views
2,402
I know this is a PLC forum so I am posting over on eng-tips.com. However, if you want to learn more about tuning a PID you can visit...
Replies
1
Views
1,470
Back
Top Bottom