[etherlab-users] DC questions

Graeme Foot Graeme.Foot at touchcut.com
Mon Jun 13 00:27:36 CEST 2016


Hi,

1) Distributed clocks can work in a couple of ways, but all ways require a slave DC master which should be the first DC slave in the network.  Note: some slaves can act as a DC time master even though they are not fully DC capable:

a) EtherCAT master is the master clock:
  - The computer is used as the DC master for the entire system.  
    ecrt_master_application_time() must be called every cycle to tell the EtherLab master what the current PC time is.
  - Call ecrt_master_sync_reference_clock() to tell the slave DC master to sync to the EtherLab masters time.
  - Call ecrt_master_sync_slave_clocks() to tell all other DC slaves to sync to the slave DC master

b) Slave DC master is the master clock. What I do is:
  - Get the slave DC masters time using ecrt_master_reference_clock_time() and sync the EtherLab masters cycle and time to it
  - Call ecrt_master_sync_slave_clocks() to tell all other DC slaves to sync to the slave DC master
  - Call ecrt_master_application_time() with the next cycles master time

Note: With option b you need to adjust your masters PC's time by the drift time from the slave DC master time and adjust your realtime cycle to suit.  I do this by having a wrapper around the time calls to rt_get_time() and use rt_sleep_until() (I use RTAI) rather than using a fixed periodic cycle.

Option b is the best, because option a has way too much jitter and the slaves find it very hard to synchronise.  Note: option b is the default option used via TwinCAT.


2) Yes, call ecrt_master_sync_slave_clocks() every cycle (and ecrt_master_application_time() and ecrt_master_reference_clock_time()).  Just before the ecrt_master_send() call to reduce jitter.


3) No, only call ecrt_slave_config_dc() on slaves that support DC and are going to be used with DC.


Regards,
Graeme.


-----Original Message-----
From: etherlab-users [mailto:etherlab-users-bounces at etherlab.org] On Behalf Of Tommaso
Sent: Friday, 10 June 2016 7:14 p.m.
To: etherlab-users at etherlab.org
Subject: [etherlab-users] DC questions

Good morning,

In the master documentation is reported, in DC section, that the reference clock is the one of the first slave that supports this functionality. This reference can be synchronized with the master clock.
My questions, based on the 'dc_user' example, are the following:
1 - calling cyclically the function 'ecrt_master_sync_reference_clock()' 
I have that the reference clock is the one of the master? Only for this case is useful to call the function 'ecrt_master_application_time()' or I have to call it every time I want to use the DC?
2 - the function 'ecrt_master_sync_slave_clocks()' is used for the synchronization of all the slave clocks for every reference clock? If I want to exploit the DC functionality I have always to call it cyclically?
3 - it makes sense to call 'ecrt_slave_config_dc()' even for slaves which do not support the DC functionality, like the EL2004?

Thank you for your help.

Best regards,

Tommaso
_______________________________________________
etherlab-users mailing list
etherlab-users at etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users



More information about the Etherlab-users mailing list