Ethercat DC clock
- wang
- Offline
- Premium Member
Less
More
- Posts: 85
- Thank you received: 0
26 Jul 2021 09:10 #215938
by wang
Ethercat DC clock was created by wang
Hi
I have a problem and need your help (thank you)
Both the Ethercat master station and the slave station have their own DC clocks that need to be synchronized. Different drives have different DC clock frequency requirements. I want to know how linuxcnc and Ethercat handle these clock requirements. How much can the clock frequency reach at the same time?
My thanks (wang)
I have a problem and need your help (thank you)
Both the Ethercat master station and the slave station have their own DC clocks that need to be synchronized. Different drives have different DC clock frequency requirements. I want to know how linuxcnc and Ethercat handle these clock requirements. How much can the clock frequency reach at the same time?
My thanks (wang)
Please Log in or Create an account to join the conversation.
- rollfree
- Offline
- Senior Member
Less
More
- Posts: 59
- Thank you received: 11
26 Jul 2021 21:10 - 26 Jul 2021 21:11 #215991
by rollfree
Replied by rollfree on topic Ethercat DC clock
It depends not on LinuxCNC, but on EtherCAT protocol (and master). By default first slave in the EtherCAT-chain works as DC-master.
In original version of IgH EtherCAT master module were some errors in section, responsible for initial synchronization. In patched versions on github is it mostly corrected.
In original version of IgH EtherCAT master module were some errors in section, responsible for initial synchronization. In patched versions on github is it mostly corrected.
Last edit: 26 Jul 2021 21:11 by rollfree.
Please Log in or Create an account to join the conversation.
- wang
- Offline
- Premium Member
Less
More
- Posts: 85
- Thank you received: 0
27 Jul 2021 01:01 #216004
by wang
Replied by wang on topic Ethercat DC clock
Glad to see your reply
Can you be more detailed? Or give me a website where I can learn this part.
Will IGH EtherCAT automatically and flexibly match the clocks of all slaves? Or set all slave clocks to one frequency? (Because different drives have different clock frequencies)
Can you be more detailed? Or give me a website where I can learn this part.
Will IGH EtherCAT automatically and flexibly match the clocks of all slaves? Or set all slave clocks to one frequency? (Because different drives have different clock frequencies)
Please Log in or Create an account to join the conversation.
- rollfree
- Offline
- Senior Member
Less
More
- Posts: 59
- Thank you received: 11
27 Jul 2021 02:09 - 27 Jul 2021 02:19 #216005
by rollfree
Replied by rollfree on topic Ethercat DC clock
It's not true, I think.
Master precisely synchronize net-time on all members of EtherCAT domain. This time is the same for all nodes. So every node can use sync pulse in exact same time.
For reference clock server use HW clock from 1. slave in the chain. So after synchronization all slaves has very accurate same time, with compensated delay on other nodes and cables between nodes.
It's according to EtherCAT specification. Nothing special on LinuxCNC.
See www.ethercat.org/en/technology.html#1.5
1.5 Distributed Clocks for High-Precision Synchronization
Master precisely synchronize net-time on all members of EtherCAT domain. This time is the same for all nodes. So every node can use sync pulse in exact same time.
For reference clock server use HW clock from 1. slave in the chain. So after synchronization all slaves has very accurate same time, with compensated delay on other nodes and cables between nodes.
It's according to EtherCAT specification. Nothing special on LinuxCNC.
See www.ethercat.org/en/technology.html#1.5
1.5 Distributed Clocks for High-Precision Synchronization
Last edit: 27 Jul 2021 02:19 by rollfree.
Please Log in or Create an account to join the conversation.
- Coyote
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 0
06 Jan 2024 16:50 #289980
by Coyote
Replied by Coyote on topic Ethercat DC clock
Old question, but still it is not 100% clear to me. Let we suppose we have a system with synchronous Ethercat operation (either velocity CSV or position CSP), where trajectory is computed each 1ms (SERVO_PERIOD = TRAJ_PERIOD = 100000).
Now if I understand correctly, the Ethercat master runs realtime on RT_PREEMPT Kernel, but the synchronization is made with the help of the first Ethercat slave, which sends the SYNC over the bus. Then all slave clocks are tuned with the use of the TimeShift,...but how the master is tuned? It shall synchronize as well, adjusting the time shift of the RT clock, thus servo thread and EMCMOT. Is this accomplished in LCNC? Or I missed entire point of view?
Now if I understand correctly, the Ethercat master runs realtime on RT_PREEMPT Kernel, but the synchronization is made with the help of the first Ethercat slave, which sends the SYNC over the bus. Then all slave clocks are tuned with the use of the TimeShift,...but how the master is tuned? It shall synchronize as well, adjusting the time shift of the RT clock, thus servo thread and EMCMOT. Is this accomplished in LCNC? Or I missed entire point of view?
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
Less
More
- Posts: 10780
- Thank you received: 3549
06 Jan 2024 19:23 #289987
by rodw
Replied by rodw on topic Ethercat DC clock
I might be wrong, but I don't think the ethercat bus needs to be synced with our servo-thread. It might update faster than this. Its just that very millisecond we can read or write to the bus. Remember we have an interconnecting driver so we don't control the master.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 504
- Thank you received: 157
06 Jan 2024 20:49 #290000
by Hakan
Replied by Hakan on topic Ethercat DC clock
It depends on the settings in ethercat-conf.xml how the synchronization between servo-thread and ethercat cyclic cycles takes place (or not).
The best way to ensure the servo-thread and ethercat cycles are out of phase is to use distributed clocks. Then the slaves execute very precisely in time but the servo-thread is not nearly as precise and out of phase (or if they just by luck happen to be in phase).
To synchronize ethercat slaves with the servo-thread the slaveuse the SM synchronization, that is the slave does its work when it receives a SM frame from the master. Which will be once per servo-thread if set up that way.
Try with refClockSyncCycles="-1" in the master line in ethercat-conf.xml.
The best way to ensure the servo-thread and ethercat cycles are out of phase is to use distributed clocks. Then the slaves execute very precisely in time but the servo-thread is not nearly as precise and out of phase (or if they just by luck happen to be in phase).
To synchronize ethercat slaves with the servo-thread the slaveuse the SM synchronization, that is the slave does its work when it receives a SM frame from the master. Which will be once per servo-thread if set up that way.
Try with refClockSyncCycles="-1" in the master line in ethercat-conf.xml.
Please Log in or Create an account to join the conversation.
- Coyote
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 0
07 Jan 2024 11:32 #290077
by Coyote
But these threads shall execute at the exact same rate.
The jitter and phase shift are not so important, as the fact that clock discrepancy would accumulate over time and then we have a missing / overrun frame sometime. I have found a patch that Sacha did:
github.com/sittner/linuxcnc-ethercat/blo...-functions-2.8.patch
Basically it re-schedules the RT application with added time shift. The application in question is the EC master, which runs in servo thread. Not sure which RT threads are affected when adding this shift, or EC master runs completely indifferent.
Replied by Coyote on topic Ethercat DC clock
I do think: the trajectory has to be computed and then sent to EC slaves, With EC methods, traj. planner and EC master could run in separate parallel tasks, since the input states are 1 cycle old and computed output states are for 1 cycle ahead.I might be wrong, but I don't think the ethercat bus needs to be synced with our servo-thread. It might update faster than this. Its just that very millisecond we can read or write to the bus. Remember we have an interconnecting driver so we don't control the master.
But these threads shall execute at the exact same rate.
The jitter and phase shift are not so important, as the fact that clock discrepancy would accumulate over time and then we have a missing / overrun frame sometime. I have found a patch that Sacha did:
github.com/sittner/linuxcnc-ethercat/blo...-functions-2.8.patch
Basically it re-schedules the RT application with added time shift. The application in question is the EC master, which runs in servo thread. Not sure which RT threads are affected when adding this shift, or EC master runs completely indifferent.
Please Log in or Create an account to join the conversation.
Time to create page: 0.119 seconds