Ethercat random jitter fix
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 1261
- Thank you received: 441
08 Mar 2026 15:56 #344029
by Hakan
Replied by Hakan on topic Ethercat random jitter fix
Better yet, enable synchronization with syncToRefClock="true"
github.com/linuxcnc-ethercat/linuxcnc-et...s.md#master-settings
The refClockSyncCycles is how often to synchronize the clocks between the slaves
which is something different altogether, and doesn't help this problem.
github.com/linuxcnc-ethercat/linuxcnc-et...s.md#master-settings
The refClockSyncCycles is how often to synchronize the clocks between the slaves
which is something different altogether, and doesn't help this problem.
The following user(s) said Thank You: andrax, TAKUYA
Please Log in or Create an account to join the conversation.
- TAKUYA
- Offline
- New Member
-
Less
More
- Posts: 11
- Thank you received: 0
08 Mar 2026 16:04 #344030
by TAKUYA
Replied by TAKUYA on topic Ethercat random jitter fix
I currently have refClockSyncCycles="-1" which according to the docs you linked above, means its enabled for backwards compatibility. Sadly, I have these mentioned issues where the axis starts clunking randomly (on a random axis) after some time. Its a fresh install from end of january. Does SyncToRefClock still need to be set?
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 1261
- Thank you received: 441
08 Mar 2026 16:35 #344031
by Hakan
Replied by Hakan on topic Ethercat random jitter fix
There was a bug with "-1", fixed now but it sounds like you have it.
Use a positive value in refClockSyncCycles and set syncToRefClock="true"
and that should hopefully fix it.
Use a positive value in refClockSyncCycles and set syncToRefClock="true"
and that should hopefully fix it.
Please Log in or Create an account to join the conversation.
- TAKUYA
- Offline
- New Member
-
Less
More
- Posts: 11
- Thank you received: 0
08 Mar 2026 17:18 - 08 Mar 2026 17:19 #344032
by TAKUYA
Replied by TAKUYA on topic Ethercat random jitter fix
Now as in just recently or in the patch from last year? or reaaally recently
Also, what does the refClockSyncCycles value do and is there any baseline on what to set it at?
Also, what does the refClockSyncCycles value do and is there any baseline on what to set it at?
Last edit: 08 Mar 2026 17:19 by TAKUYA.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 1261
- Thank you received: 441
08 Mar 2026 17:51 #344033
by Hakan
Replied by Hakan on topic Ethercat random jitter fix
Dec 27 it looks like from github. Actually, the bug shouldn't affect you.
A negative refClockSyncCycles value should switch on the PLL and synchronize servo loop time with DC time.
You can always check the lcec.pll-* hal variables. If some of them move, it's on.
refClockSyncCycles is how often the master sends a synchronization signal to the slaves to compensate for clock drift.
I use 1000 because the slaves' DC clock run pretty accurate as it is. Many people use 1 as value.
I have not seen that any number is better than the other, maybe there is, but feel free to use any number you prefer.
A negative refClockSyncCycles value should switch on the PLL and synchronize servo loop time with DC time.
You can always check the lcec.pll-* hal variables. If some of them move, it's on.
refClockSyncCycles is how often the master sends a synchronization signal to the slaves to compensate for clock drift.
I use 1000 because the slaves' DC clock run pretty accurate as it is. Many people use 1 as value.
I have not seen that any number is better than the other, maybe there is, but feel free to use any number you prefer.
The following user(s) said Thank You: TAKUYA
Please Log in or Create an account to join the conversation.
- Atsu
- Away
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
09 Mar 2026 06:50 - 09 Mar 2026 06:57 #344045
by Atsu
Replied by Atsu on topic Ethercat random jitter fix
I could share my experience with this issue. Attached is a link to a video showing how the jitter sounds on StepperOnline A6 servos. This is exaggerated by disabling the synchronization. Once synchronization is enabled (syncToRefClock="true" or refClockSyncCycles="-1"), it still happens but much more rarely, just like grandixximo explained at the start of this post. Last week, I upgraded to the latest version of linuxcnc-ethercat, and am currently testing how the changes committed at the end of 2025 affect my machine configuration.
https://imgur.com/a/FXSuvOS
https://imgur.com/a/FXSuvOS
Last edit: 09 Mar 2026 06:57 by Atsu. Reason: Fixed italic text for the link
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 1261
- Thank you received: 441
09 Mar 2026 07:06 #344046
by Hakan
Replied by Hakan on topic Ethercat random jitter fix
After activation of PLL there shouldn't be any random clicks anymore.
Check dmesg if you get any errors there, it can be the network adapter too.
Check dmesg if you get any errors there, it can be the network adapter too.
Please Log in or Create an account to join the conversation.
- grandixximo
-
Topic Author
- Away
- Premium Member
-
Less
More
- Posts: 150
- Thank you received: 247
09 Mar 2026 07:07 #344047
by grandixximo
Replied by grandixximo on topic Ethercat random jitter fix
An official release is still a few months out, the details are been worked out, still discussing and will soon get to testing on real hardware, the objective is indeed running ethercat more reliably, the current release is non-deterministic, there is nothing you can do as a user to completely get rid of the jitter noise if you have non zero CPU latency, we will hopefully find an agreeable solution for all parties, some XML settings may require changing, will try to document it all, the problems are known, now is just about finding a solution from which all can benefit.Okay, thank you.
I had already thought that the issue had something to do with packet loss when starting LinuxCNC.
However, this seems to occur during operation, which I have not yet experienced. If this work results in ethercat running more stably, I will simply wait until Sascha announces an official patch, which will likely be available via update.
Until then, I will simply stick with refClockSyncCycles="1">.
The following user(s) said Thank You: Atsu
Please Log in or Create an account to join the conversation.
- grandixximo
-
Topic Author
- Away
- Premium Member
-
Less
More
- Posts: 150
- Thank you received: 247
09 Mar 2026 07:39 #344048
by grandixximo
the above is my patch, which I tested on real hardware, both
refClockSyncCycles="5"
or any other positive number, this will have linuxcnc ask the slaves to sync to it every 5 cycles, put in whatever number you need to get phased in the time frame you desire, there is a dc-phased pin which tells you when you are phased, you can link that with iocontrol.0.enable-out so that you won't be able to turn on the machine till the distributed clock is properly phased.
also working
refClockSyncCycles="-1"
or
syncToRefClock="true"
This is working with linuxcnc drifting its own phase to sync to the slaves, this is done every cycle, it is slightly more CPU intensive, as it is happening every cycle, but will phase pretty quick and works just as well in my testing.
github.com/sittner/linuxcnc-ethercat
if you are willing to do some testing of what we are building towards, you can test Sasha's current release
github.com/sittner/linuxcnc-ethercat/tre...2ea38d79aa47a58b89f7
This I believe only works well with
refClockSyncCycles="-1"
at the moment, more testers would be appreciated, I will do my own testing of this soon.
Replied by grandixximo on topic Ethercat random jitter fix
github.com/linuxcnc-ethercat/linuxcnc-et...84ef36b53f0b734eaedfNow as in just recently or in the patch from last year? or reaaally recently
Also, what does the refClockSyncCycles value do and is there any baseline on what to set it at?
the above is my patch, which I tested on real hardware, both
refClockSyncCycles="5"
or any other positive number, this will have linuxcnc ask the slaves to sync to it every 5 cycles, put in whatever number you need to get phased in the time frame you desire, there is a dc-phased pin which tells you when you are phased, you can link that with iocontrol.0.enable-out so that you won't be able to turn on the machine till the distributed clock is properly phased.
also working
refClockSyncCycles="-1"
or
syncToRefClock="true"
This is working with linuxcnc drifting its own phase to sync to the slaves, this is done every cycle, it is slightly more CPU intensive, as it is happening every cycle, but will phase pretty quick and works just as well in my testing.
github.com/sittner/linuxcnc-ethercat
if you are willing to do some testing of what we are building towards, you can test Sasha's current release
github.com/sittner/linuxcnc-ethercat/tre...2ea38d79aa47a58b89f7
This I believe only works well with
refClockSyncCycles="-1"
at the moment, more testers would be appreciated, I will do my own testing of this soon.
Please Log in or Create an account to join the conversation.
- grandixximo
-
Topic Author
- Away
- Premium Member
-
Less
More
- Posts: 150
- Thank you received: 247
09 Mar 2026 07:41 #344049
by grandixximo
github.com/linuxcnc-ethercat/linuxcnc-et...84ef36b53f0b734eaedf
this I have tested and works well, unfortunately Scott has not been around to merge it, so it is not in the main linuxcnc-ethercat repo yet, but it is a better version
Replied by grandixximo on topic Ethercat random jitter fix
Thank you for the independent testing, if you want a better versionI could share my experience with this issue. Attached is a link to a video showing how the jitter sounds on StepperOnline A6 servos. This is exaggerated by disabling the synchronization. Once synchronization is enabled (syncToRefClock="true" or refClockSyncCycles="-1"), it still happens but much more rarely, just like grandixximo explained at the start of this post. Last week, I upgraded to the latest version of linuxcnc-ethercat, and am currently testing how the changes committed at the end of 2025 affect my machine configuration.
https://imgur.com/a/FXSuvOS
github.com/linuxcnc-ethercat/linuxcnc-et...84ef36b53f0b734eaedf
this I have tested and works well, unfortunately Scott has not been around to merge it, so it is not in the main linuxcnc-ethercat repo yet, but it is a better version
Please Log in or Create an account to join the conversation.
Time to create page: 0.108 seconds