Notes to Commissioning
Notice | |
Basic information about external TwinCAT synchronization The EL6688 is an EtherCAT slave for time synchronization. Please regard the explanations in the EtherCAT system documentation from chapter "EtherCAT synchronization". |
Quick start as slave clock
(Item 3 optional - StartUp list for the exchange case)
1. Generate configuration in TwinCAT: Right-click on EtherCAT devices and "Scan boxes" or manually create configuration
2. Make CoE settings for the EL6688 (in PreOP – see note)
- Set PTP common (0xF880:01) to "IEEE1588-2008 (PTPv2) – Slave Only Clock" (corresponds to 32dec)
- Set the PTPv2 settings (0xF882) as in the PTP Master (grandmaster) (see Mutual Settings)
- Ethernet Settings (0xF8E0): enter valid IP address and subnet mask
- Subsequently, changes must be permanently saved by writing "0x65766173" into index 0x1010 (see note)
3. Add CoE settings to the StartUp list (for the exchange case)
Special features or start-up behavior If a terminal is replaced with a new Beckhoff terminal, it will have the factory settings. It is therefore recommended to link all changes in the CoE directory of an EtherCAT slave in the startup list of the slave, which is sent to the slave at each startup of the EtherCAT fieldbus in the PreOP/SafeOP or SafeOP/OP transition. In this way a replacement EtherCAT slave can automatically be parameterized with the specifications of the user. Please note for the EL6688: immediately when the terminal starts up, the PTP clock is started with the parameters stored in the CoE, i.e. already in the INIT state. A change of the PTP settings in the CoE, e. g. by the StartUp list in the later PreOp/SafeOP, only becomes effective at the next/subsequent start from INIT, since the PTP clock cannot be changed during operation. After changing the PTP settings the terminal must pass through the INIT state once, e.g. by restarting EtherCAT, PowerOn/Off of the terminal or state change from the PLC. This also applies to the special case of initial commissioning with factory settings or after changes to the PTP settings: only during the subsequent startup after INIT does the PTP Clock operate as intended. |
4. Check EtherCAT master settings
- a) Master settings → Info Data: enable "Include DC Time Offsets"
- b) Distributed Clocks → DC Mode: DC in use -> DC Time controlled by External Sync Device (External Mode) - as a result, this TwinCAT system now becomes a "time slave" and follows the external PTP time
5. If not already done, create a task and link it with EtherCAT
e.g. Cycle time: 1ms, if necessary with autostart:
6. Check that, at the latest from now on, the EL6688 is connected to the grandmaster via the X1-port (RJ45).
7. Activate TwinCAT configuration and start TwinCAT in RUN mode
8. Diagnosis via PTP Diag (0xFA80)
- “PTP State” should change from "LISTENING" to "SLAVE" after 10 - 15 seconds
- "Sync Event Sequence Counter" should count up according to the sync interval of the grandmaster
9. Diagnosis via FB_EcExtSyncCheck (TC2) or FB_EcExtSyncCheck64 (TC3)
- "Offset From Master" should now settle around "0" in accordance with the hardware in use and its accuracy (typ. less than ±1000 ns = 1 µs)
- For this purpose the following sample program can be used.
Sample program Download
For further information, see chapter "Answers to frequently asked questions"
General notes
Changing the settings Always use the following procedure for changing CoE settings in the EL6688: |
- EtherCAT cycle time: 1 ms is recommended; the slower the cycle time, the less accurate the synchronization
- Due to the BMCA it takes several seconds before the EL6688 can supply analyzable data. After the clock startup the bus is monitored for approx. 10 seconds so that any available grandmasters can be found. The EL6688 is ready for operation when the toggle bits in the process data are operational.
- Synchronization accuracy: with the EL6688 precisions of up to ±350 ns can be achieved, depending on the hardware type used.
The shorter the sync interval selected, the better the synchronization accuracy and settling will be after the TwinCAT start. - Basics regarding the time synchronization direction EL6688 (Slave) → TwinCAT:
In this mode of operation the EL6688 receives the PTP frames and operates itself as a PTP Slave Clock. In the TwinCAT/EtherCAT system it operates as an external reference clock, but not necessarily as the EtherCAT reference clock at the same time. The forwarding of the time control is incumbent on the EtherCAT master employed (TwinCAT). Hence, the control sequence as follows: - The processor of the EL6688 receives the PTP frames several times per second. The frame contains the so-called external timestamp, if necessary with adjustment information.
In the same moment as it receives a PTP frame, the processor reads the DC time – the internal timestamp – from the local EtherCAT Distributed Clock in the ESC.
Hence pairs are continuously formed from internal and external timestamp, from which the readjustment requirement can be derived. - These pairs are not processed in the EL6688, but conveyed as cyclic process data to the EtherCAT master (TwinCAT).
- The latter evaluates these pairs at its own discretion/ability and
- if necessary regulates its own real-time, which controls the sending of the EtherCAT frames.
- adjusts the DC reference clock, which is usually realized in the first DC-capable EtherCAT slave. Hence, the Distributed Clock system follows the external PTP Master Clock. As a consequence of this the cyclic ARMW command of the EtherCAT master in turn distributes this "DC reference" time to subordinated DC slaves further back in the EtherCAT strand - The functional chain is thus represented as follows: External PTP master clock → EL6688 as PTP slave clock → Internal /external timestamp as PDO to the EtherCAT master → Adjustment of the internal real-time and adjustment of the DC reference clock.
The position of the EL6688 in the EtherCAT strand is thus insignificant for the time control; the EL6688 itself has no possibility to affect its own Distributed Clock. - Procedure 1-Step/2-Step with PTP v1/v2: no setting is possible in this context.
- EL6688 as master: only 2-step possible, i.e. with follow-up message.
Against 2-step slave: possible
Against 1-step slave: depends exclusively on the slave itself and the intermediate network infrastructure (switch, boundary clock...). The slave and the infrastructure must be able to evaluate the 2-step flag and to cope with the 2-step sync and follow-up messages of the grandmaster. - EL6688 as slave
Against 2-step master: possible
Against 1-step master: possible
Process data
Sync Mode | 0: no synchronization |
Control Value Update Toggle | only for SYNC slave. toggles every time when the control value was updated |
Time Stamp Update Toggle | only for SYNC slave. toggles every time when the control value was updated |
External device not connected | TRUE: no external synchronization found (always TRUE if device operates as SYNC master) |
Internal Time Stamp | only for SYNC slave. DC time stamp at the same time as the external time stamp |
External Time Stamp | only for SYNC slave. external time stamp recalculated in DC units (ns) |
Time Control Value | TwinCAT does not use this value. |
Default state
- PTPv1 Slave (Index 0xF880:01)
- SyncInterval (Index 0xF881:03): 2 seconds
- DomainName (Index 0xF881:01): _DFLT
- Own IP: 0.0.0.0
- Own MAC: 00.01.05.xx.xx.xx (Beckhoff)
Supported PTP modes
Operation mode |
Note |
---|---|
PTPv1 SlaveOnly |
from SW02 |
PTPv1 Grandmaster |
from SW03 |
PTPv1 Best Master Clock |
on request |
PTPv2 SlaveOnly |
from SW03 |
PTPv2 Grandmaster |
from SW07 |
PTPv2 Best Master Clock |
on request |
Mutual settings
Depending on the protocol used, the following settings must match in the grandmaster clock and the slave clock(s). For setting the EL6688 see the CoE list from index 0xF880. Changes must be saved permanently by writing 0x65766173 into index 0x1010:01.
- PTPv1
- DomainName
- SyncInterval
- Delay Request Interval - PTPv2
- TransportLayer
- DomainNumber
- DelayMechanism (disabled, End2End, Peer2Peer [from FW10])
- SyncInterval
- Delay Request Interval
Quality settings
For setting the EL6688 see the CoE list from index 0xF880. Changes must be saved permanently by writing 0x65766173 into index 0x1010:01.
- PTPv1
"Clock Stratum": the smaller this value, the better quality the master certifies itself
"Preferred": this flag indicates that this clock is to be used preferentially as master
Both values influence the BMCA in the network. - PTPv2
Priority1+2 correspond to Stratum+Preferred
TwinCAT settings
Distributed clocks (DC) timing settings
We recommended manually selecting the EL6688 as reference clock through "DC in use".
- Independent DC Time: one of the EL terminals (generally the first terminal supporting distributed clocks (DC)) is the reference clock to which all other DC terminals are adjusted. Even an EL6688 that may be present in the system is adjusted to this reference clock as a DC slave. Selection of the reference clock in the dialog above.
This setting is useful if the EL6688 is operated as PTP grandmaster clock and another EtherCAT system is to be synchronized. - DC Time controlled by TwinCAT: the DC reference clock is adjusted to the local TwinCAT time.
- DC Time controlled by External Sync Device: if the EtherCAT system is to be adjusted to a higher-level clock, the External Sync Device can be selected here.
This setting is useful if the EL6688 is operated as a PTP slave clock and another EtherCAT system is to synchronize its own.
TwinCAT behavior
After the EtherCAT startup the EL6688 takes a few seconds before it can supply data for the synchronization. This is indicated by toggling bits in the process data. Depending on the environment, a few more seconds may elapse before full synchronization is achieved.
Operation of the EL6688 as PTPv1 master
The SyncInterval of the sent SyncTelegrams can be changed. The default is 2 sec.
Stratum = 0 is automatically set, forcing this clock to act as grandmaster for the network.
In master mode the EL6688 reports "External device not connected" in the process data
Operation of the EL6688 as PTPv2 master
The SyncInterval as well as the AnnounceInterval of the sent Sync or Announce telegrams can be changed, default: Sync=1 s, Announce=2 s
The master operation can be forced by setting Priority1 = 1 and Priority2 = 1 as grandmaster in the network.
In master mode the EL6688 reports "External device not connected" in the process data
Operation of the EL6688 as PTPv1 slave
Stratum = 255 is set to prevent this clock being use as grandmaster in the network.
Own IP address: the EL6688 can be allocated a dedicated IP address, under which it sends its DelayRequest messages, for example. It can also be used for ping control. As far as the set Delay Request Interval is not equal to "disabled", then an IP address ≠ 0 is mandatory.
Operation of the EL6688 as PTPv2 slave
Slave operation can be forced by setting Priority1 = 255 and Priority2 = 255, so this clock will never be used as a grandmaster in the network.
Own IP address: the EL6688 can be allocated a dedicated IP address, under which it sends its (P)DelayRequest messages, for example. It can also be used for ping control. PTPv2 defines two different transport layers:
Layer 2 "PTP over ETHERNET": IP address ≠ 0 is not required for delay mechanism (only relevant for ping control)
Layer 3 "PTP over UDP": IP address ≠ 0 is required for delay mechanism (E2E or P2P) and ping control