Systems & software · topic D7 · 35 hours
Fieldbus networking & real-time behavior (EtherCAT / Ethernet / Modbus)
The bus sets the system's real-time ceiling. Physical-layer details belong to E14 / E15 / E18; this lesson only handles 'how multiple devices become one synchronized system': topology, master-slave, clocks, and how the cycle is computed.
What to learn
- EtherCAT: slaves read and written on the fly, distributed clocks (DC), cycle and jitter metrics, and why 125–1000 µs is achievable
- Ethernet layers: what PHY and MAC each handle, the queuing delay switches introduce, and how PTP achieves sub-microsecond sync
- CANopen and PDO / SDO: why the practical sync-cycle ceiling sits around 500 Hz
- Modbus RTU vs Modbus TCP: the throughput ceiling of question-and-answer, and why it can only do 'integration', never 'control'
- Do the math: 10 axes × 8 bytes — the fastest CAN sync cycle at 1 Mbps; and why 250 µs suffices for EtherCAT with the same data volume
- Topology choices: line, ring, star — fault domains and the cost of redundancy
The lesson · plain words
EtherCAT, Ethernet, and Modbus are the three most common 'wires' on a robot. Their difference is not connector shape but time behavior: who guarantees delivery within 100 microseconds, and who can only try its best.
This page builds your intuition for the 'bus cycle'.
EtherCAT: the frame flies through every slave
Ordinary Ethernet requires every switch to 'receive-store-lookup-forward', costing tens of microseconds per hop with jitter. EtherCAT inverts it: one frame leaves the master and, as it flies through each slave, reads and writes data on the way; when the frame returns to the master a cycle is complete — the whole chain runs at the hundred-microsecond level with jitter under 1 microsecond.
Watch the animation: drag the slave count and EtherCAT's cycle grows only slowly and linearly; switch to plain Ethernet mode and each hop's store-and-forward delay immediately blows up both cycle and jitter.
Interactive figure · drag it and see
The selection logic: layering by real-time need
Hard real-time motion control (servo loops, safety I/O): EtherCAT/PROFINET IRT, hundred-microsecond cycles. Process monitoring and configuration: plain Ethernet (TCP/IP), milliseconds do not matter. Legacy devices/sensors: Modbus RTU (serial), tens of milliseconds, winning on universality.
The robot norm is a mixed network: an EtherCAT loop for real time, Ethernet for perception and monitoring, Modbus for third-party devices. Three networks separated by gateways, none dragging the others down.
The EtherCAT engineering trio
① Topology: daisy-chain or tree; ring redundancy (one broken wire does not take down the network) must be actively configured; ② distributed clocks: the whole chain synced to within 1 microsecond — the precondition for multi-axis coordination; ③ cycle planning: PDO mapping decides how many bytes each cycle exchanges; the bigger the mapping, the longer the cycle.
Debugging tools: the Wireshark plugin decodes EtherCAT frames directly; on the master side watch the TwinCAT/soem state machine. The classic symptom of a slave dropping offline is 'an axis's status word stuck at 0x50, never reaching 0x23' — learning to read status words makes debugging ten times faster.
The path of learning and using
Use soem (the open-source master) + one EtherCAT slave: get the state machine INIT→PREOP→SAFEOP→OP running, read PDOs, write PDOs — and you have digested the core. For simulation, start with a virtual slave.
Interview favorites: why EtherCAT is fast (on-the-fly reads/writes), what distributed clocks do, and why Modbus is slow (master-slave polling + serial baud rate).
Three questions — do you really get it?
1. The fundamental reason EtherCAT beats ordinary Ethernet?
- AThicker cables
- BIt uses fiber optics
- CThe frame reads and writes while flying through each slave, no store-and-forward
Show answer
C. On-the-fly processing compresses per-hop latency to the nanosecond level — the whole chain in one cycle.
2. Which of these fits ordinary Ethernet best?
- AUploading vision results and remote monitoring
- BMulti-axis distributed-clock synchronization
- CA 1 kHz servo loop
Show answer
A. Monitoring traffic oblivious to millisecond jitter belongs on standard Ethernet; leave the real-time bus for hard real-time.
3. Modbus's main shortcoming?
- AThe protocol is not open
- BComplicated wiring
- CMaster-slave polling plus serial speed limits — poor cycle and real-time behavior
Show answer
C. One master polls many slaves over serial at 9600–115200 bps — inherently slow. Its strength is broad device support.
Keep going deeper
Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.
How it fails in the field
- Forcing 1 kHz ten-axis sync onto CAN, then 'solving' it by lowering the frequency, while believing the code was at fault
- Miscalculating bus load; adding two axes immediately starts dropping frames
- Using Modbus for real-time control: question-and-answer round-trip latency never reaches the millisecond level
- Believing Ethernet is 'real-time because bandwidth is large': without PTP and priority scheduling, its jitter is worse than CAN's
You have learned enough when
The Chinese edition carries the full topic page for Fieldbus networking & real-time behavior (EtherCAT / Ethernet / Modbus), including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/D7/.