EtherCAT synchronization
So-called EtherCAT telegrams (ECT) are sent by the EtherCAT master to all connected EtherCAT slave controllers (ESC). An ESC is an electronic module that performs continually synchronous sequences of calculations and/or data copying actions, based on the ECT, at a certain time interval (clock). The configuration file of the ESC describes which information from the ECT is processed and how. In drive technology it is extremely important that the synchronicity of the data and the slaves is always ensured due to the very short cycle times. The synchronicity of the slaves is achieved via so-called “Distributed Clocks” and information on this can be read in the EtherCAT documentation. The following description deals exclusively with the synchronisation of the data.
EtherCAT Master
The EtherCAT master reads the AX5000 config. file and writes "DT0= 250 µs" and "DT1= NC cycle time" to the corresponding ESC registers once during the system start-up. These values are continuously read by the ESC from the register and serve Sync0 und Sync1. If the contents of this register are lost or if the values are overwritten during operation, this leads to problems with Sync0 and/or Sync1.
EtherCAT slave controller (ESC)
The ESC of the AX5000 regularly sends two signals (Sync0 and Sync1) for synchronization (DT0andDT1) to the CPU of the AX5000.
Sync0
The interrupts "i" from "Sync0" are sent as standard every 250 µs. If an interrupt fails to arrive (see F0), the CPU generates the error code F414 and the connected axes are brought to a standstill with the "EStop ramp".
Additional error messages:
The Sync0 cycle time may only be configured with 62.5 µs, 125 µs or 250 µs, otherwise the CPU generates the error code F409.
If the synchronization "Sync0" is not activated in the ESC, the CPU generates the error code F410.
If the pulse length of the interrupt no longer conforms to the standard, the CPU generates the error code F411.
In the case of each error message the connected axes are brought to a standstill with the "EStop ramp".
Sync1
The interrupts "i" of "Sync1" are sent as standard in accordance with the NC cycle time. This cycle time is always a multiple of Sync0 and is 1 ms as standard. If an interrupt fails to arrive (see F1), the CPU likewise generates the error code F414 and the connected axes are brought to a standstill with the "EStop ramp".
Additional error messages:
The Sync1 cycle time must be a multiple of the Sync0 cycle time and must be identical to the parameters "S-0-0001 and S-0-0002", otherwise the CPU generates the error code F412.
If the synchronization "Sync1" is not activated in the ESC, the CPU generates the error code F413.
If the pulse length of the interrupt no longer conforms to the standard, the CPU generates the error code F411.
In the case of each error message the connected axes are brought to a standstill with the "EStop ramp".
End of telegram (EOT)
The ESC reads the ECT as soon as it arrives; the correct time is shortly before Sync1. The data intended for the ESC are then read from the ECT and written into the data area of SyncMan2. The EOT thus lags slightly behind the interrupt of Sync1 by the time DT2; the status of SyncMan2 is subsequently set to "SyncMan written". The CPU only copies the data from SyncMan2 into its own memory area if this status is "SyncMan written" at the time of Sync1. The data are not copied if the status is not "SyncMan written" (see F2); if the data cannot be copied twice in succession, the CPU generates the error code F415 and the connected axes are brought to a standstill with the "EStop ramp".
Jitter! The tolerance for the presence of the telegram at the correct time, due to "jitter" etc., is ZERO. The EtherCAT master must ensure that the data arrive at the SyncMan2 in time. |
Special notes concerning the diagnostic message F415 “Distributed Clocks: process data synchronisation”
The real-time behavior of the machine is continuously monitored during operation. An important component of this monitoring is the synchronization of all hardware and software components involved in data transfer. The illustrations below represent a simplified example of this data transfer. The focus is on the drive tasks “NC” and “PLC”.
Example 1
- The CPU timer sends interrupts on a regular basis (default: base time = 1 ms)
- The individual tasks are now processed in accordance with the rules of task management.
- Task management:
Since the task takes up a greater or smaller amount of time due to a higher or lower number of computing processes, the “I/O update” should be parameterized directly after the entry point (a) at the start of the task. This excludes one source of incorrect synchronization.
A further source of error is an unfavorable prioritization of the individual tasks (see below). - Following the “I/O update”, the resulting data are transferred to the TwinCAT-IO system and subsequently dispatched by EtherCAT telegram to the connected devices. The EtherCAT telegram passes through each physically connected device and hands over or picks up only the data for this device.
- The order of task calculation depends among other things on the prioritization of the tasks. If a task has a higher priority, it is also calculated first and can send its data to the TwinCAT-IO system, which then dispatches the telegram. Problems usually occur when individual tasks have different cycle times; see below.
Prioritisation
The following graph describes the effects of prioritization on the synchronization of the data.
Assumptions:
Sync1 = 3 ms
NC cycle time = 3 ms
NC priority = 10
PLC cycle time = 2 ms
PLC priority = 5
NC data are to be transmitted cyclically to the drive. Although the PLC requires time to compute, no data are transmitted to the drive.
Due to its higher priority, the PLC task is always calculated before the NC task; these tasks affect each other at the start point time ‘0 ms’ and then repetitively every ‘6 ms’, i.e. 2x Sync1. However, the ESC expects the EtherCAT telegram with the NC data at each Sync1 (3 ms). That is not ensured, however, because the more highly prioritized PLC task is always calculated before the NC task and thus in the case of synchronous mapping the telegram start is delayed. For this reason the NC telegram arrives somewhat later every 6 ms and can thus cause the F415 error in the AX5000.
Example 2
- The CPU timer sends interrupts on a regular basis (default: base time = 1 ms)
- The individual tasks are now processed in accordance with the rules of task management.
- Task management:
Since the task takes up a greater or smaller amount of time due to a higher or lower number of computing processes, the “I/O update” should be parameterized directly after the entry point (a) at the start of the task. This excludes one source of incorrect synchronization.
A further source of error is an unfavorable prioritization of the individual tasks (see below). - Following the “I/O update”, the resulting data are transferred to the TwinCAT-IO system and subsequently dispatched by EtherCAT telegram to the connected devices. The EtherCAT telegram passes through each physically connected device and hands over or picks up only the data for this device.
- The order of task calculation depends among other things on the prioritization of the tasks. If a task has a higher priority, it is also calculated first and can send its data to the TwinCAT-IO system, which then dispatches the telegram. Problems usually occur when individual tasks have different cycle times; see below.
Prioritisation
The following graph describes the effects of prioritization on the synchronization of the data.
Assumptions:
Sync1 = 3 ms
NC cycle time = 2 ms
NC priority = 5
PLC cycle time = 3 ms
PLC priority = 25
NC task serves only devices in SyncUnit 1, synchronous mapping
PLC task serves only devices in SyncUnit 2, synchronous mapping
NC and PLC data are to be transferred cyclically.
Due to its higher priority, the NC task is always calculated before the PLC task and the telegram is accordingly also sent first; these tasks affect each other at the start point time ‘0 ms’ and then repetitively every ‘6 ms’, i.e. 2x Sync1. However, the ESC expects an EtherCAT telegram at each Sync1 (3 ms). This is not a problem in SyncUnit 1, which is served by the NC, since the more highly prioritised NC always sends the telegram in the same time pattern. However, the PLC telegram arrives somewhat later every 6 ms and can thus cause the F415 error in the AX5000 in SyncUnit 2.