EtherCAT systems utilize distributed clocks (DC) to synchronize interaction among its local slave devices with a high degree of precision. In a distributed machine control environment, it’s often required to synchronize I/O devices and drives connected to different master units. The components must therefore have a common local “time” so all devices can access it all times. A slave device may need to react to another slave device connected to the same or different master. The reaction needs to occur at the same exact instance of time, thus requiring tight synchronization among devices.
Along with local synchronization of a few production lines with the same source can also be implemented in the boundaries of one production line. The master clock in such cases is referred to as “Grandmaster clock” or “External Time Clock”. Typically, common synchronization protocols are used for the synchronization. For example:
- Sources: UTC world time, network time, adjacent control system, radio clocks (in Central Europe: DCF77)
- Procedures: GPS, radio clocks, NTP (NetworkTimeProtocol), SNTP (Simple NTP), PTP (IEEE1588), distributed clocks DC
Using external synchronization, the following precisions may be realized depending on hardware:
- NTP/SNTP~ms range
- PTP < 1 µs
- DC < 100 ns
The procedure of DC initialization in case of external synchronization does not differ from the procedure described earlier: calculating propagation delay, system time offset, and drift compensation.
In case of External synchronization, Master polls the device with External clock periodically. As soon as the device answers that it has received data (sets certain bit), Master receives time of External clock and then adjusts Reference clock (marked as M in the picture) in accordance with the received value.
The image below shows propagation of Reference Clock time through the rest of DC slaves (marked with “S”).
To configure DC synchronization among several Masters (the Multimaster functionality), one master device “Sync Master” must be configured to synchronize with a local slave device (defined as reference clock). The other master devices must be configured to work in external synchronization mode synchronizing to the “Sync Master”.
Synchronization using IEEE 1588
In such cases, the Grandmaster clock is an external clock that supports IEEE 1588 protocol. This protocol defines mechanisms to synchronize devices in a Standard Ethernet Network.
Algorithm for calculating time variations between the DC Reference Clock and the Grandmaster clock may be implemented within the master or within a special slave (e.g. Beckhoff EL6688).
Note: KPA EtherCAT Master stack currently supports external synchronization only through a special device.
1588 telegrams are latched at a legacy Ethernet port (implemented within device: EL6688) with a high precise timestamp in the slave. This external Timestamp can be compared to the high precise DC System Time (1). The result is a TimeControlValue that holds the information if the DC Time runs to fast or to slow. This TimeControlValue will be send to the Master (2) that can adjust the DC Reference Clock in the bus (3)
Synchronization using a Bridge Device
External synchronization of two or more EtherCAT production lines may be implemented through Bridge devices (e.g. Beckhoff EL6692 ).
Typically, a Bridge device has 2 EtherCAT Slave Controllers “ESCs”. While the primary port (ESC #1) is connected to the first EtherCAT network the secondary port (ESC #2) is connected to the other network. The Bridge internally calculates delta time between the two networks and transmits it out as “TimeControlValue”. While both networks are operating in DC synchronization, the secondary master uses TimeControlValue to adjust its reference clock and track the primary network, hence all devices are in synchronization.