Overview
EtherCAT Distributed Clocks (DC) synchronize all slave devices to a single reference clock with sub-microsecond accuracy. The first DC-capable slave in the ring becomes the reference clock; all others discipline their local clocks against it.
Enabling Distributed Clocks
Add the following to /etc/adeeb/master.conf:
[distributed_clocks]
enabled = true
sync0_cycle_time_ns = 1000000 # 1 ms
sync0_shift_time_ns = 125000 # 125 µs shift from cycle start
drift_filter_gain = 0.01 Reference Clock Selection
By default, the master selects the first DC-capable slave as the reference. To pin a specific slave:
[distributed_clocks]
reference_slave = 1 # 0-indexed position in ring Propagation Delay Measurement
The master automatically measures propagation delays during startup by sending frames and measuring the time difference at each slave port. This runs once at PREOP → SAFEOP transition and repeats if topology changes are detected.
View measured delays:
adeeb-ctl dc show-delays Tuning Synchronization Quality
- Lower
drift_filter_gainfor smoother correction at the cost of slower convergence - Set
sync0_shift_time_nsto approximately 10–20% of the cycle time to give slaves processing margin - Use
adeeb-ctl dc statsto view jitter histograms in real time
Validating Synchronization
adeeb-ctl dc stats --interval 5s Target values for production deployments: mean error < 100 ns, max jitter < 1 µs.