Sync Problem LinuxCNC + EL8EC400F

More
14 Sep 2025 10:35 #334970 by Ahmed.emara
Sync Problem LinuxCNC + EL8EC400F was created by Ahmed.emara
I am running LinuxCNC with EtherCAT  and Leadshine EL8-EC400F servo drives in Cyclic Synchronous Position (CSP) mode. I’m struggling with jitter / noise that seems to be related to Distributed Clock (DC) synchronization between LinuxCNC and the drives.
My Machine Setup:
  • Controller: LinuxCNC (2.9.4) + EtherCAT (lcec)
  • Drives: 5 × Leadshine EL8-EC400F
  • Mode: CiA-402 CSP (0x6060 = 8) ( Control mode CSP)
  • Interpolation time (0x60C2): Read-only, fixed at 2 ms (
    value=2
    ,
    index=-3
    )
  • Servo thread: 2 ms (2000000 ns) in LinuxCNC INI
Please the attached XML for EtherCAT communication settings.
My problem is as follows : 
  • When I jog axes in LinuxCNC, the motors make a raspy / friction-like noise.
  • In HALScope, I see large torque and acceleration spikes at the same time.
  • In Leadshine MotionStudio → Diagnostics, I see the counter “Synchronization overflow times” increasing steadily during motion.
  • However, when I test motion with the Leadshine tuning software (without LinuxCNC), the motors run perfectly smooth.
what i tried so far : 
 
  • Matched SERVO_PERIOD,
    appTimePeriod
    , and
    sync0Cycle
    to 2 ms.
  • Tested different
    refClockSyncCycles
    values:
    • 5
      (every 10 ms) → overflow counter increased faster.
    • 1
      (every 2 ms) → better, but still some overflows.
    • 0.5
      (every 1 ms half-cycle) +
      sync0Shift=10000
      → gave the best result so far, but the overflow counter still increments slowly.
  • Increased
    sync0Shift
    from 1 µs up to 20 µs → small improvements, but not fully stable.
  • Checked 0x60C2 (interpolation time) → confirmed it is read-only fixed at 2 ms, so I cannot change the drives to 1 ms.
Also i noticed in the tunner motion studio that all the drivers has EtherCAT slave ID = 2 , while it should be configured by the master which is wired.
 
my Questions : 
  • Is it valid/expected that
    refClockSyncCycles="0.5"
    works better than
    1
    or
    5
    ? Or does this mean I have a deeper DC setup issue?
  • For LinuxCNC + EL8 drives fixed at 2 ms interpolation, what is the recommended refClockSyncCycles and sync0Shift strategy?
  • Has anyone successfully run EL8-EC400F in CSP under LinuxCNC without sync overflows?
  • Any advice on NIC/IRQ tuning (isolated cores, rt-preempt) that could help with reducing these overflows?
Attachments:

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

More
14 Sep 2025 12:13 #334972 by Hakan
Replied by Hakan on topic Sync Problem LinuxCNC + EL8EC400F
github.com/linuxcnc-ethercat/linuxcnc-et...uration-reference.md
refClockSyncCycles tells how often the slaves' clocks are synchronized. "1000" should be fine, and "1" and "5" also.
I don't think you can have a floating point number there but I could be wrong.

I have a suspicion on what is going on, it has happened before with other drives, for me included.

I am not familiar with the Leadshine software. It runs on a Windows computer, right? And how does that computer
connect to the drive? I read Modbus somewhere. Just to see the difference with linuxcnc and ethercat.
What is the explanation of the Synchronization overflow times message, what does it mean?

What latency number do you have for the linuxcnc computer? And what network adapter does it have?
The following user(s) said Thank You: tommylight

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

More
14 Sep 2025 12:28 #334973 by Ahmed.emara
Replied by Ahmed.emara on topic Sync Problem LinuxCNC + EL8EC400F
Synchronization overflow times” = the number of times the drive saw Sync0 + PDOs outside the valid window.
there is a tab in the tunner called diagnose that monitor the sync parameter for the communication, please check the attached screenshot from the tunner.
this screenshot is token while jogging the machine, jitter random sounds appears from the motor in random time there is no pattern.

the leadshine tunner app " motion studio" runs on seperate PC connected to the driver via USB.
 
Attachments:

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

More
14 Sep 2025 12:55 #334974 by Hakan
Replied by Hakan on topic Sync Problem LinuxCNC + EL8EC400F
Well, then I would say my suspicion is confirmed. The explanation says it.

The thing is that DC is very precise, and the ethercat master can follow the DC time of the slaves very precisely.
The first ethercat slave determines the DC clock speed.

But Linuxcnc's clock, used for the servo period and base period, is not synchronized with ethercat's DC.
One clock always runs slightly faster/slower.

The consequence of this is that when one clock is overtaking the other, there will be either double PDO or no PDO sent during an ethercat cycle. If there is no data sent one cycle the drive sees that as "stay on the current position" which means a hard brake if it is moving. Or move double delta this time, which means huge acceleration.
Latency and a not so suitable NIC makes it worse, the duration for one clock to overtaking the other becomes longer and more of these hits and misses takes place.

What can you do? Work on latency. Use an Intel NIC. See if your drive have some limitations you can set like max-acceleration. In short, see if your drive can handle hits and misses in a better way.

One would like to see Linuxcnc's clock synchronized with ethercat's DC, but it isn't.
 

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

Time to create page: 0.070 seconds
Powered by Kunena Forum