Distributed Clocks (DC)
DC is an optional feature, and not every application needs it. If you control a single device or simple I/O, you do not need to configure DC. Cases that need DC: synchronized motion across multiple servo axes, and high-precision synchronized sampling. Not sure whether you need it? Leave it unconfigured for now; if the device requires DC synchronization, the state transition reports an explicit error.
What is DC?
DC (Distributed Clocks) is a hardware unit inside the EtherCAT slave controller (ESC). It synchronizes the local clocks of different EtherCAT devices to one common system time.
Distributed clocks are the hardware basis for precise synchronization: they make all slaves work together at microsecond-level accuracy. Not every slave supports DC; check the device's ESI file to confirm support.
Why is DC needed?
In high-precision motion control and synchronization applications, several devices must act in precise synchrony:
DC application scenarios
| Application | Description |
|---|---|
| Multi-axis motion control | Several servo axes move in precise synchrony, as used in printing, packaging, electronics assembly and similar |
| Distributed I/O | I/O modules at different locations sample inputs and drive outputs in synchrony |
| High-speed measurement | Several sensors sample in synchrony so the data shares one time base |
| Synchronized output | Multiple PWM, pulse and similar signals are output in precise synchrony |
How DC works
Device roles
From the point of view of DC synchronization, devices that use DC fall into two roles:
- Reference clock (Reference Clock - R): holds the system time and provides the time base for all other synchronized devices
- Slave clock (Slave Clocks - S): adjusts against the reference clock, follows the system time and stays within the permitted deviation
The master scores the candidates by DC capability, the SYNC0 configuration in the ESI and PDO preference, and picks the reference clock — usually the first slave in the ring that has DC capability. The choice is sticky: a controlled switch happens only when the original reference station is no longer a candidate, or when the topology or the capability evidence changes; during OP the switch is deferred. Do not change it manually.
Synchronization process
DC hardware synchronization has two stages:
Initial synchronization
Align each slave's local clock — independent to begin with — to the system time:
Drift compensation
Continuously compensate the deviation of the local clock from the system time (caused by differences in quartz oscillator parameters, temperature drift, aging and similar):
Drift compensation commands are sent together with the process data frames, keeping synchronization accuracy over time.
SYNC signals
The DC unit can generate two synchronization signals: SYNC0 and SYNC1.
What SYNC0 and SYNC1 are for
| Signal | Typical use |
|---|---|
| SYNC0 | Triggers input data sampling so that all slaves read their inputs at the same moment |
| SYNC1 | Triggers output data updates so that all slaves update their outputs at the same moment |
Used together, SYNC0 and SYNC1 make it possible to:
- have all slaves sample inputs at the same precise instant
- have all slaves update outputs at the same precise instant
- reserve data processing time through the offset of SYNC1 from SYNC0
DC configuration parameters
DC configuration splits into master configuration and slave configuration.
Master configuration (global)
Settings that apply to the whole network:
| Parameter | Description |
|---|---|
| Reference Clock | The reference clock device (selected automatically; do not change it manually) |
| SYNC Shift Time | The timing relationship between the start of the master control task and generation of the SYNC0 event |
Slave configuration (per slave)
Individual settings for each slave (taken from the ESI file):
SYNC0 configuration:
- Cycle Time: SYNC0 cycle time (either proportional to the communication cycle, or fixed)
- Shift Time: extra offset time for this slave
SYNC1 configuration:
- Cycle Time: SYNC1 cycle time (either synchronized to the communication cycle or to SYNC0)
- Shift Time: offset of SYNC1 relative to SYNC0
Slave DC configuration is defined by the ESI file: defaults the device manufacturer set for the application. Do not change slave configuration manually, or normal device operation may be affected.
DC synchronization mode
The DC-based synchronization mode is called DC-Synchronous mode; only slaves whose ESI file declares DC support are synchronized.
Available states
| Synchronization mechanism | PREOP | SAFEOP | OP |
|---|---|---|---|
| DC clock synchronization | ✓ | ✓ | ✓ |
| SYNC signals | ✗ | ✓ | ✓ |
DC clock synchronization runs in every state, while SYNC signals are active only in SAFEOP and OP.
Synchronization accuracy
DC synchronization deviation is typically within a few microseconds:
| Metric | Typical value |
|---|---|
| Clock synchronization accuracy | Deviation can be kept within a few microseconds |
| SYNC0/SYNC1 jitter | Depends on the ESC type (a device-level figure) |
| Multi-axis synchronization error | Deviation can be kept within a few microseconds |
With a suitable slave ESC and DC configuration, this accuracy meets the synchronization requirements of common multi-axis motion control.
How master cycle time affects DC synchronization
The master's cycle time (Cycle Time) has a major effect on DC synchronization and is a key factor in the overall synchronization performance of the system.
Effect of cycle time
SYNC0/SYNC1 cycle configuration
The SYNC0 and SYNC1 cycles are usually configured as a proportion of the master cycle time:
| Configuration | Description | Where it fits |
|---|---|---|
| Synchronized to the cycle time | SYNC0 = N × master cycle time | Most applications (recommended) |
| Fixed cycle | SYNC0 independent of the master cycle time | Special applications (such as high-speed sampling) |
In most applications the SYNC0 cycle is set equal to the master cycle time (1:1), so every communication cycle contains exactly one synchronization event.
Effect of cycle time jitter
Jitter in the master cycle time directly affects DC synchronization performance:
Ideal cycle time:
Cycle 1 Cycle 2 Cycle 3 Cycle 4
|---1ms---|---1ms---|---1ms---|---1ms---|
Stable, low jitter
Cycle time with jitter:
|--0.98ms--|--1.02ms--|--0.99ms--|--1.01ms--|
↑ Large jitter, degrades synchronization accuracy
| Cycle time jitter | Effect on DC synchronization |
|---|---|
| Within a few microseconds | Good; synchronization deviation can reach the few-microsecond level |
| 1-10 µs | Fair; suits most motion control applications |
| > 10 µs | Poor; may affect high-precision synchronization |
| > 100 µs | Unacceptable; synchronization accuracy cannot be guaranteed |
Choosing a cycle time
| Application type | Recommended cycle time | Notes |
|---|---|---|
| High-speed motion control | 250 µs - 500 µs | Multi-axis servo, printing machinery |
| General motion control | 1 ms | Most common; balances performance and load |
| Distributed I/O | 1 ms - 4 ms | I/O modules, sensor acquisition |
| Low-speed process control | 10 ms - 100 ms | Slow control such as temperature and pressure |
The master must keep the cycle time stable; otherwise you get:
- lower DC synchronization accuracy
- unstable SYNC0/SYNC1 signals
- synchronization failures in the slave application layer
- jitter in motion control
Master cycle time and SYNC Shift Time
SYNC Shift Time defines the timing relationship between the start of the master control task and the SYNC0 event.
Timeline
| Time | Event | Description |
|---|---|---|
| t = 0 | Master task starts | Control logic processing begins and output data is prepared |
| t = Shift Time | SYNC0 fires | Slaves sample inputs and update outputs in synchrony |
| t = cycle time | Next cycle starts | The master task starts again |
Calculation
SYNC Shift Time = cycle time × (50% ~ 80%)
Example: cycle time = 1000 µs
- Recommended range: 500 ~ 800 µs
- Typical value: 600 µs (60% of cycle time)
Effect of different Shift Time values
| Shift Time | Share | Advantage | Drawback | Where it fits |
|---|---|---|---|---|
| < 50% | Too small | - | Data may not be ready | Not recommended |
| 50% - 60% | Moderate | Balances processing time and synchronization delay | - | General applications |
| 60% - 80% | Large | Ample data processing time | Slightly more delay | Complex control logic |
| > 80% | Too large | - | May collide with the next cycle | Not recommended |
What Shift Time does
- Data processing time: reserves enough time for the master to finish the control logic calculation
- Communication margin: ensures output data reaches the slaves before SYNC0 fires
- Collision avoidance: prevents the current cycle's communication from colliding with the start of the next cycle's task
- Synchronization accuracy: guarantees that slaves sample and output at the precise instant, so multiple devices stay in synchrony
Example configuration
The table below gives example configurations and recommended values (recommendations, not product limits; the cycle time has no product-imposed lower limit, and the configured value is applied as given):
| Cycle time | Recommended Shift Time | Notes |
|---|---|---|
| 125 µs | 70 - 100 µs | High-speed applications that need fast response |
| 250 µs | 140 - 200 µs | Very high-speed multi-axis synchronization |
| 500 µs | 280 - 400 µs | High-speed motion control |
| 1000 µs | 600 - 800 µs | Standard motion control (most common) |
| 4000 µs | 2500 - 3200 µs | Distributed I/O |
Monitoring the cycle time
To keep DC synchronization quality, monitor the master cycle time continuously:
| Metric | Target | Notes |
|---|---|---|
| Average cycle time | = setpoint ± 0.1% | Keeps the cycle time accurate |
| Maximum jitter | Within a few microseconds (on Windows, 1.2 µs average / 4.5 µs maximum) | Keeps jitter within an acceptable range |
| Maximum/minimum cycle time | < ±1% deviation | Detects abnormal conditions |
| Cycle timeout count | 0 | Avoids any timeout |
- Using the DarraRT real-time driver significantly reduces cycle jitter.