Important EtherCAT configuration option

More
02 Oct 2025 07:41 #335693 by Hakan
Info about an option in Linuxcnc-ethercat, lcec.

It is a new option but actually a rediscovered function.
It's an important function when using distributed clock synchronization,
as most do with servo and stepper motor drives.

The syncToRefClock option
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="5" syncToRefClock="true">

This will synchronize LinuxCNC's servo thread to EtherCAT's distributed clock,
the entire timing chain from LinuxCNC to the drives is then in sync.

When using distributed clock synchronization (a drive uses assignActivate="300")
you probably always want to use this option.
If you experience gravel noises, friction noises, etc., or acceleration and
torque spikes that recur every few minutes, this is the option to use.

There are some hal parameters associated with this option, check the documentation
github.com/linuxcnc-ethercat/linuxcnc-et...istributed-clocks.md

The option is just now introduced in the linuxcnc-ethercat code.
Over time this option will be generally available as distributions pick up the latest software version
of linuxcnc-ethercat. But you don't have to wait for it, the "rediscovery" means it is already in lcec,
you enable synchronization by setting a negative value to refClockSyncCycles.

A big thanks to Scott Laird for accepting the pull request and assisting with this.
The following user(s) said Thank You: endian

Please Log in or Create an account to join the conversation.

More
02 Oct 2025 11:39 #335706 by andypugh
Replied by andypugh on topic Important EtherCAT configuration option
Does this require changes in LinuxCNC or was the facility already there?

Please Log in or Create an account to join the conversation.

More
02 Oct 2025 11:51 #335710 by Hakan
Replied by Hakan on topic Important EtherCAT configuration option
No change needed to linuxcnc rt functions.
There is already the functionality needed to modify the call to nanosleep.
There is now closed issue at github where I look at that github.com/LinuxCNC/linuxcnc/issues/3564

What is new is that the option is made an explicit option syncToRefClock.
The old way to invoking the functionality, which works already now, is to
set a negative refSyncClockCycles value. The "-" triggers the function to be on.
This continues to work in linuxcnc spirit, and is now made clear with
both documentation of the function and an explicit option.
 
The following user(s) said Thank You: tommylight, endian, heaven, peterpan

Please Log in or Create an account to join the conversation.

  • heaven
  • Away
  • Junior Member
  • Junior Member
More
02 Oct 2025 14:35 #335727 by heaven
Replied by heaven on topic Important EtherCAT configuration option
For a long time, I've been pondering this issue. I can't find any practical difference between free run and DC mode. Even though I've set up my motor to run in both modes, they seem identical or even worse in DC mode. It feels like I've never actually activated DC mode on LinuxCNC. This could really be a big discovery for me. Thank you very much!

Please Log in or Create an account to join the conversation.

More
02 Oct 2025 20:32 - 02 Oct 2025 20:33 #335744 by endian
Replied by endian on topic Important EtherCAT configuration option
It is pll stuff. It is the main and the most importnt feature of eyhercat. And yes it works like that..I have configured many stuff with -1 in refclock ..dc assign is not 300 every time ... If u have jerking need to increase it twice or triple..

How it will works .. will scotts config stay in negative or do we need rewrite existing stuff to new shape...,?
Last edit: 02 Oct 2025 20:33 by endian.

Please Log in or Create an account to join the conversation.

More
03 Oct 2025 06:03 #335761 by Hakan
Replied by Hakan on topic Important EtherCAT configuration option
Hopefully now more people will learn to use the feature.
The original code is good and refreshingly free from documentation.
The git log says the feature was added 2018 and some iterations were made.

Anyway it is now documented somewhat and the hal pll parameters and pins are described.

Regarding backwards compatibility. I didn't dare to break that and I guess it is up to Scott
what he will do in the future. The coding guideline says to keep backwards compatibility.
The following user(s) said Thank You: endian

Please Log in or Create an account to join the conversation.

  • heaven
  • Away
  • Junior Member
  • Junior Member
More
07 Oct 2025 06:22 - 07 Oct 2025 06:22 #335976 by heaven
Replied by heaven on topic Important EtherCAT configuration option
Today i tried active DC mode on and linuxcnc keep spamming this error:

Failed to get reference clock time: Input/output error
Failed to get reference clock time: Input/output error
Failed to get reference clock time: Input/output error
Failed to get reference clock time: Input/output error
Failed to get reference clock time: Input/output error
Failed to get reference clock time: Input/output error
Failed to get reference clock time: Input/output error

What causes this error? I'm using Linuxcnc 2.9.4 install from iso file.Here is my xml file and driver document:
drive.google.com/file/d/1ZTNpSNYDF0IL-IE...Bn4/view?usp=sharing
 

File Attachment:

File Name: da180_2025-10-07.xml
File Size:1 KB

 
Attachments:
Last edit: 07 Oct 2025 06:22 by heaven.

Please Log in or Create an account to join the conversation.

More
07 Oct 2025 08:45 #335981 by Hakan
Replied by Hakan on topic Important EtherCAT configuration option
Got that too yesterday. Traced it to a bad kernel think it was 6.14-38 or so. Upgrade the kernel is my advice.
 

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum