1. What This Tool Does
This software models the internal execution cycle of Programmable Logic Controllers (PLCs) and Programmable Automation Controllers (PACs). It moves beyond simple instruction counting by simulating the complex interaction between Continuous Tasks, Periodic Interrupts, and Communication Overhead.
It is designed for System Integrators and Control Engineers to validate CPU selection during the design phase, ensuring the chosen hardware can handle the required logic, motion axes, and network traffic without tripping watchdog timers or causing task overlaps.
2. The Importance of Scan Time in Industrial Automation
Unlike general-purpose computing, industrial control relies on Determinism. The "Scan Time" is the heartbeat of the automation system. If the scan time is too high or fluctuates wildly (Jitter), the consequences can be severe:
- Missed Inputs: Short duration sensor pulses (e.g., product counting sensors) may be missed if the scan time exceeds the pulse duration.
- PID Instability: Control loops rely on a consistent time delta ($dt$) for integration and differentiation. Jitter causes the derivative term to spike, leading to erratic valve/VFD behavior.
- Motion Errors: High-speed packaging machines require precise synchronization. Lag in logic execution results in position errors and product waste.
3. Deep Dive: IEC 61131-3 Task Models
Modern PACs (like Rockwell ControlLogix or Siemens S7-1500) utilize a multitasking operating system. Understanding the task priority model is crucial for accurate estimation.
Task Types Explained
- Continuous Task: The lowest priority task. It runs in the background, utilizing whatever CPU time is left after interrupts and system overhead are processed. Most general logic (safety interlocks, sequencing) resides here.
- Periodic Task (Interrupt): A high-priority task triggered by a timer (e.g., every 10ms). It interrupts the continuous task. Used for PID loops and Motion planning. The calculator's "Interrupt Load" factor models this preemption.
- Event Task: Triggered by a specific hardware event (e.g., Input Registration). These provide the fastest response but are non-deterministic regarding scan impact.
4. Network Overhead: EtherNet/IP vs. PROFINET
The choice of fieldbus protocol significantly impacts CPU load. This calculator applies specific overhead factors based on the protocol selected:
- EtherNet/IP (CIP): Uses the TCP/IP stack. The CPU must encapsulate/decapsulate CIP packets inside UDP frames. This context switching adds noticeable overhead (~80µs per node) for implicit I/O messaging.
- PROFINET RT: Operates at Layer 2 (Data Link), bypassing the TCP/IP stack for real-time data. This creates significantly less CPU burden (~30µs per node), allowing for faster scan times with high node counts.
- Modbus TCP: While simple, the connection-oriented nature of TCP and the request/response model creates relatively high CPU overhead per transaction (~150µs) compared to cyclic protocols.
5. The Nyquist Theorem & PID Update Rates
A common engineering error is placing PID loops in the Continuous Task. This violates the requirements for stable discrete-time control. PID loops should be in a Periodic Task.
The Golden Rule: The scan rate of the PID task must be at least 5 to 10 times faster than the process time constant ($\tau$). For a temperature loop with a 10-second response time, a 1-second scan is sufficient. For a pressure loop with a 50ms response, a 5ms scan is required.