1. Problem Statement and Observed Behavior
A field installation centered on a Siemens SIMATIC S7-1500 CPU 1515F-2 PN (catalog 6ES7515-2FM02-0AB0 or later -2AM/-2FM revisions) is showing deterministic-looking cycle time spikes every 100 ms that break motion and positioning performance. The reported symptom is reproducible and unambiguous:
- OB1 free cycle baseline: 1 ms on the configured hardware.
- Periodic spike: 8 to 9 ms every 100 ms.
- Spike amplitude: +7 to +8 ms over baseline.
- Pattern persists even with OB1 fully empty (no FB/FC calls, no direct logic).
- Spike remains after communication load is varied between 15 % and 50 %.
The combination of "empty OB1 spikes" and "independent of comm load setting" is a strong indicator that the spike is not generated by user program execution and not generated by the configured PG/HMI/OPC UA traffic slice. It points instead at the CPU firmware's background scheduling, the PROFINET/PROFIBUS IO update scheduler, or external traffic ingress.
- Position lag between interpolated axes using TO/technology objects.
- Jitter on TO output cam / measuring input timestamps.
- Late MC_-commands if MC servo is hosted in OB1.
2. Hardware Configuration Analysis
Before chasing firmware or network causes, map the actual installed topology. The reported configuration is:
| Slot / Position | Module | Catalog (typical) | Role |
|---|---|---|---|
| 1 | CPU 1515F-2 PN | 6ES7515-2FM02-0AB0 | Controller, PROFINET I/O + TCP/IP |
| 2 | CP 1542-5 | 6GK7542-5FX10-0XE0 | PROFIBUS master for VFDs |
| PROFIBUS | ~10 x Danfoss VFDs | FC-302 / iC7 / VLT series | Drive bus (DP-V0/DP-V1) |
| PROFINET A | 10 x ET 200 Eco PN | 6ES7148-6JH00-0BN0 (typical) | IP67 remote I/O |
| PROFINET B | 2 x IM 155-6 PN | 6ES7155-6AU30-0BN0 | Cabinet remote I/O head |
Several of these components contribute predictable background load on the CPU:
- ET 200 Eco is a PROFINET IO device with fixed 1 ms update granularity on most digital modules. Ten devices on the same PN subnet, even when fully idle, each generate a small per-cycle process-image refresh task in the controller's PN stack.
- IM 155-6 PN is the ET 200 SP head module. Multiple IM 155s each create a separate PN AR (Application Relationship) and a separate scheduler slot.
- CP 1542-5 hosts the PROFIBUS master. It exchanges data with the CPU via a backplane mechanism (separate from the PN scheduler). Even at low configured comm load, the backplane handshake has a base cost.
- Danfoss drives on PROFIBUS poll their PPOs (Parameter Process Object) at the configured DP cycle. Ten drives synchronized on the same PROFIBUS line can produce a 100 ms or sub-100 ms master poll that, on the backplane, may surface as an OB1 spike.
3. Root Cause Matrix for 100 ms Cycle Spikes
Use the table below to triage by frequency of occurrence in field reports. Each row gives the diagnostic that confirms or eliminates the cause.
| # | Probable cause | Confirming diagnostic | Eliminates with |
|---|---|---|---|
| R1 | PROFINET IO update / AR keep-alive from 10 ET 200 Eco devices | Wireshark on PN port, look for cyclic frames every 100 ms | Disconnect Eco daisy chain and re-measure |
| R2 | PROFIBUS DP cycle resync via CP 1542-5 | Trace PROFIBUS with PROFITrace; CPU diag buffer | Disable one drive at a time |
| R3 | OPC UA / S7-comm server background task (data block subscription) | Online > Diagnostics > Connection list; TIA trace of OPC UA calls | Stop OPC UA server, re-measure |
| R4 | HMI / WinCC cyclic polling of tags | WinCC tag logging interval; disconnect HMI | Disconnect HMI Ethernet cable |
| R5 | PG/PC (TIA Portal online) holding an online connection | Disconnect TIA, re-measure | All PG connections closed |
| R6 | External device scanning the PLC (DDoS, SNMP poller, NADA) | Wireshark + port mirror between PLC and switch | Firewall / VLAN isolation |
| R7 | CPU firmware background (e.g. diagnostic OBs scheduling) | Read CPU diagnostic buffer; check OB82/OB83/OB86/OB100/OB121 | Disable non-mandatory OBs |
| R8 | Isochronous mode NOT enabled, drive PPO bursts fall into OB1 | Check PROFIBUS properties in TIA - "isochronous" tickbox | Enable isochronous on CP 1542-5 + drive |
| R9 | Web server of CPU serving periodic requests | Disable web server in CPU properties > Web | Web server off, user "none" |
| R10 | Time sync (NTP) packet handling on the CPU | Check NTP server, see spike at 100 ms cadence | Disable NTP, use CPU RTC |
For the reported "empty OB1 spikes every 100 ms" symptom, R1, R2, R3, R4, R6, R8, R9 are the highest probability candidates. R7 is typically not exactly 100 ms periodic and is usually a one-shot or triggered response, so the rigid 100 ms period is a strong argument against it.
4. OB1 Free-Cycle Model vs. OB3x Cyclic Interrupt
The S7-1500 task model is part of TIA Portal's Program resources. The default architecture on a fresh project is:
- OB 1 - free-cyclic (or "main") task. Runs to completion, then restarts after a configurable minimum cycle time if one is set, or immediately if not set.
- OB 3x - cyclic interrupt tasks, x = 1..9. Hardware-timed via the CPU's internal tick generator. Phases are independently configurable from 500 us to 60 s.
- OB 6x - event-driven OBs (e.g., OB 82 - diagnostic, OB 83 - plug, OB 86 - rack fault, OB 121 - programming error).
The 100 ms spike pattern does not match a single OB3x tick. It does match a PN or DP cycle of 100 ms, which is the default PROFINET update time for many lower-cost IO devices. ET 200 Eco modules, when their "Update time" is left at "Automatic" in TIA, will often negotiate to 1 ms minimum, but the controller's Application Relationship keep-alive and certain re-sync behaviors fire at 100 ms multiples. The spike is the CPU's PN stack re-synchronizing with the IO device scheduler.
4.1 Minimum cycle time and OB1 watchdog
Two parameters under CPU properties > Cycle control the spike shape:
- Minimum cycle time - pads OB1 to a minimum. Default = not set. Setting to 1 ms smooths out sub-ms variance but does NOT remove 100 ms spikes, only stretches OB1.
- Watchdog time - 100 to 6000 ms. If OB1 takes longer than this, the CPU goes STOP. Watchdog is unrelated to spikes but is a hard upper bound on motion design.
For motion, set Minimum cycle time to 1 ms as a baseline. This is independent of the 100 ms spike issue.
5. Isochronous Mode for PROFIBUS CP 1542-5
Isochronous mode ties the application (an OB, typically OB 61..OB 64) to a fixed tick of the PROFIBUS / PROFINET bus cycle. When isochronous mode is enabled, the OB runs exactly when the bus has new process data ready, and the drive's setpoints are released on the bus at deterministic instants.
For Danfoss VFDs on PROFIBUS, isochronous mode requires:
- Drive supports isochronous mode on PROFIBUS. Many FC-302 / VLT drives support DP-V2 with clock synchronisation (SUPI/SUPY protocols). Verify in the drive parameter list: parameter group 9-6x (PROFIdrive-related). The drive must have a clock-slave capable option.
- CP 1542-5 must be set as isochronous. In TIA: CP 1542-5 > Properties > PROFIBUS > Isochronous mode. Tick the box and assign a DP cycle (e.g., 1 ms, 2 ms, 4 ms).
- A constant bus cycle time is required. All nodes on the PROFIBUS segment must be configured for the same constant cycle. The TIA constant bus cycle wizard enforces this.
- Motion OB - typically OB 61 (servo), OB 62, OB 63, or OB 64 is added and bound to the isochronous tick. Move the drive setpoint / actual handling code into this OB. OB1 should not handle the fast drive setpoints.
When isochronous mode is correctly configured, the DP cycle replaces the OB1 free-cycle for drive communication. The 100 ms spike, if it originated from a DP poll aggregation, is absorbed into the isochronous tick.
6. Communication Load Parameter Tuning
The communication load parameter in the CPU properties defines the fraction of the OB1 cycle reserved for non-deterministic communication (PG, HMI, OPC UA, S7 routing, web server). The relationship is:
t_cycle_actual = t_OB1 / (1 - f_comm)
where f_comm is the communication load fraction (e.g. 0.20 for 20 %). So at 20 %, 20 % of the OB1 budget is sliced out for comm and 80 % is OB1 user code. The CPU's PN stack uses part of that comm slice continuously, regardless of OB1 emptiness.
Test points reported in the field:
| Comm load | Effect on OB1 baseline | Effect on 100 ms spike |
|---|---|---|
| 5 % | OB1 effective 95 % | Spike amplitude unchanged (suggests spike is not comm-driven) |
| 15 % | OB1 effective 85 % | Spike visible, +7 ms |
| 20 % (Siemens default) | OB1 effective 80 % | Spike visible, +7 ms |
| 50 % | OB1 effective 50 % | Spike visible, scaled but unchanged in pattern |
Because the spike persists at low comm load, it is not the comm slice that is being scheduled in the OB1 budget. The slice is the time the comm tasks steal from the user code; if the spike were from comm stealing, lowering comm load would lower the spike. The fact that it does not tells us the spike is the comm task itself running, not the comm load weighting.
For motion systems, a typical safe comm load is 15-20 %. Below 10 % the HMI tags and OPC UA subscriptions can starve. Above 30 %, OB1 becomes a small fraction of the cycle and motion jitter rises.
7. Network Forensics with Wireshark
A non-Siemens device on the same Ethernet segment that periodically contacts the CPU (an SNMP poller, an NMS agent, a PC browser service scanning, a security camera, a printer's management card) is a well-known cause of 100 ms-cadence spikes. To prove or eliminate it:
- Insert a managed switch with port mirroring between the CPU and the PN network. Mirroring the CPU's port to a laptop port is preferred.
- On the laptop, run Wireshark on that port. Capture for 20-30 seconds. The CPU will be the source/destination of many frames; the uninvited frames are the candidates.
- Apply a display filter to find non-PROFINET traffic to/from the CPU:
ip.addr == <CPU_IP> and not pn_io and not pn_dcp and not arp - Look for:
- ICMP pings at <=100 ms cadence from a single source.
- TCP SYN bursts from a single device (S7, ISO-on-TCP, OPC UA) at 100 ms.
- UDP/TCP traffic from printers, cameras, building management.
- Eliminate by isolating the CPU on a separate VLAN / subnet. The CPU's PROFINET port should not be the same broadcast domain as the office network.
8. ET 200 Eco and IM 155 Update Rate Configuration
The PROFINET update time is a per-device value negotiated between the controller and the IO device. Leaving it on "Automatic" is convenient but lets the controller's scheduler pick whatever fits. To control jitter:
- For each ET 200 Eco: Properties > PROFINET interface > Update time > "Fixed" and set a value (e.g. 1 ms, 2 ms, 4 ms). 2 ms is typical for Eco digital modules.
- For each IM 155-6 PN: same. ET 200 SP modules can go to 250 us. For Eco + IM 155 head, 1 ms is the practical floor.
- Reduce Number of submodules per AR by splitting the Eco daisy chain into two ARs at the switch, so the PN stack is not regenerating one AR for ten devices.
- If Eco modules do not need 1 ms IO, push them to 4 ms or 8 ms. The 100 ms spike pattern emerges from scheduler interaction when a few devices are on fast update and others are on slow update. All-same-update-time removes the spike.
8.1 Reduction of IO device count per controller
Ten Eco + 2 IM 155s = 12 PROFINET ARs. The 1515F-2 PN supports up to 128 IO devices / 256 ARs, but the per-AR scheduler cost is real. A spike of 7 ms every 100 ms is consistent with a stack walk of 12 ARs that all line up on the same 100 ms system tick. Stagger the Eco devices' update times by 1 ms each (1, 2, 3, ..., 10 ms) to flatten the spike pattern.
9. Step-by-Step Diagnostic Procedure
Run this sequence top-down; each step is non-destructive and reversible. Do not skip ahead.
- Capture the spike shape with TIA trace. In the project online: CPU > Online & Diagnostics > Traces > Cycle time. Record 10 seconds. Confirm the spike is at exactly 100 ms and not at 10 ms / 50 ms / 1 s.
- Disconnect TIA Portal from the CPU. Close the project. Re-measure. If spike disappears, R5 is implicated.
- Disconnect HMI Ethernet cable. Re-measure. If spike disappears, R4 is implicated.
- Disable the OPC UA server on the CPU: CPU properties > OPC UA > Server > Off. Re-measure.
- Disable the Web server: CPU properties > Web > Off. Re-measure.
- Mirror the PN port with a managed switch. Run Wireshark. Apply the filter from section 7.
- Disconnect the Eco daisy chain at the first Eco. Re-measure. If spike disappears, R1.
- Power off Danfoss drives on the PROFIBUS segment one at a time. If spike disappears at N drives removed, R2 is implicated.
- Read CPU diagnostic buffer: Online & Diagnostics > Diagnostic buffer. Look for OB82/OB83/OB86 entries clustered at 100 ms. If yes, IO events are the source.
- Set Minimum cycle time to 1 ms: CPU properties > Cycle. Re-measure. The spike is reduced by approximately the original 1 ms baseline - 1 ms.
- Pin all PN update times: walk through every Eco and IM 155, set a fixed update time. Re-measure.
- Enable isochronous mode on the CP 1542-5 if drives support it. Move drive exchange code to OB 61/62/63/64. Re-measure.
At the end of these steps, the spike is either gone or attributed to a specific cause with a specific mitigation. Don't accept "spike is part of the system" - in motion design it is not acceptable.
10. Verification and Acceptance Test
After applying a fix, run an acceptance test before signing off the system:
| Metric | Target | How to measure |
|---|---|---|
| OB1 cycle time, mean | < 4 ms (typical motion budget) | TIA trace, 60 s sample |
| OB1 cycle time, max | < 8 ms (motion S7-1500 budget) | TIA trace, 60 s sample |
| OB1 cycle time, stddev | < 0.5 ms | Compute from trace log |
| Spike period | No 100 ms spike (or < 1 ms above mean) | FFT of trace log |
| Isochronous OB (if used) | Tick = configured value, jitter < 5 us | Add time-stamp output in OB 61 |
| Drive bus cycle, max | <= configured cycle | PROFIBUS analyser / PROFINET record |
| Comm load, runtime | < 20 % | CPU diag buffer "Cycle time" |
Record the TIA trace, the Wireshark capture, and the diagnostic buffer at sign-off. These artifacts are the engineering evidence of compliance with the motion specification.
10.1 Quick field test (no tools)
If a laptop with TIA is not available, use a manual trace:
// In OB1, write to a global DB:
"cycle_log".last_cycle_ms := "RT_INFO".OB1_cycle_time;
IF "cycle_log".last_cycle_ms > 5000 THEN
"cycle_log".spike_count := "cycle_log".spike_count + 1;
"cycle_log".last_spike_time := "RT_INFO".clock_read;
END_IF;
Watch the spike count over 5 minutes. If it rises by 5 x 60 / 0.1 = 3000, the 100 ms spike is confirmed; if it does not rise, OB1 is fine and the perceived motion issue is elsewhere (drive-side, encoder-side, or application code).
11. Field-Proven Recommendations and Caveats
- For motion-critical work, do not host drive setpoint exchanges in OB1. Use isochronous mode + OB 61-64, or, if isochronous is not available, use OB 35 / OB 30 with phase offset to the bus cycle.
- Never leave PROFINET update time on Automatic. Always set a fixed value. The 100 ms spike is a signature of mixed update times being negotiated.
- Isolate the IO network from the office network. A 1515F-2 PN with X1 (IO) and X2 (management) on the same subnet is a field failure waiting to happen.
- Default comm load of 20 % is good for HMI, bad for motion. Reduce to 5-10 % if no heavy OPC UA / S7-comm.
- Verify drive isochronous capability with the drive vendor before specifying a 1 ms drive bus cycle. Most FC-302 / iC2 / iC7 support it with the right firmware option.
- Document the spike, do not hide it. If a residual 1-2 ms spike remains, the motion designer needs to know so that axis servo parameter tuning accounts for it.
12. Frequently Asked Questions
Why does my S7-1500 cycle time spike every 100 ms even with an empty OB1?
The CPU's PROFINET and PROFIBUS schedulers run independently of OB1 and consume a slice of the cycle that the user program cannot see. With 10 ET 200 Eco + 2 IM 155 + a CP 1542-5, the PN/DP AR (Application Relationship) scheduler walks 12+ ARs on a 100 ms tick. Pin the PROFINET update time to a fixed value (e.g. 1-2 ms) on every device, isolate the IO network from office traffic, and verify with Wireshark that no non-PROFINET frames reach the CPU.
Does lowering the communication load parameter remove the 100 ms spike?
Usually no. The communication load parameter scales how much of the cycle is reserved for comm tasks; it does not change how often the comm stack runs. If the spike is still present at 5 % comm load, the spike is not comm-load-driven; it is comm-task-driven. Move drive exchange code into an isochronous OB (OB 61-64) bound to the PROFIBUS cycle instead of OB1.
Can I use isochronous mode with the CP 1542-5 and Danfoss drives?
Yes, if the CP 1542-5 firmware supports isochronous mode (current Siemens S7-1500 CPs do) and the Danfoss drive has the PROFIdrive clock-synchronisation option enabled (typical on FC-302 / VLT with PROFIBUS option, parameter 9-60/9-64 cluster). Enable "Isochronous mode" on the CP's PROFIBUS properties, set a constant bus cycle (e.g. 2 ms), and bind the motion code to OB 61 (or 62/63/64).
What is the difference between OB1 free-cycle and a cyclic interrupt OB like OB35?
OB1 runs to completion, then waits for the minimum cycle time (or restarts immediately if not set), and is interrupted by higher-priority OBs. A cyclic interrupt OB (OB 30..OB 38) is hardware-timed: it is launched at exact phase intervals (e.g. OB 35 at 100 ms). For deterministic motion, use a cyclic interrupt OB or, better, an isochronous OB. The default 100 ms OB35 is too slow for most servo work - use OB 30 (1 ms..) or OB 61 (isochronous).
How do I capture the cycle time in TIA Portal to prove the spike?
Go online, right-click the CPU, select "Online & Diagnostics > Traces", add the cycle time tag, set a 10-30 s sample window, and trigger on threshold (e.g. 4 ms). Export the trace to CSV and plot it; an FFT shows the 100 ms peak clearly. You can also read the runtime tag RT_INFO.OB1_cycle_time from user code and log it to a data block for offline analysis.