EtherCAT + CiA402 Servo: OP state reached, but axis won’t move (only Following E

More
24 Nov 2025 09:32 #339126 by Hakan
The stat-zero-speed comes directly from the drive, 12th bit of the statusword. 
No other processing is done. It seems there is some tolerance for zero.
Maybe your drive has some tolerance setting for this, mine didn't.

If the position is drifting in one direction I think you can check actual-velocity in hal
and switch modes when actual-velocity == 0.
Might combine this with oneshot component, so when actual-speed == 0,
you start oneshot to wait say 0.5 second before switching modes.
All done in hal at least when prototyping.
 

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

  • aDm1N
  • aDm1N's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
28 Nov 2025 21:33 #339399 by aDm1N
I now have reliable switching between spindle mode (PV) and C-axis mode (CSP).
The key issue was not the controlword itself, but the fact that the commanded and actual position of the drive did not match at the moment of switching.To fix this, I’m using a small custom HAL component (c_pos_sync).
While in spindle/PV mode it continuously feeds the C-axis command position with the actual position (a “follow” mode).
When switching to C-axis mode, this offset is preserved — so there is no position jump and no mode-fluttering anymore.With this in place:
  • M3/M4 work normally in PV mode
  • M5 stops correctly
  • M64/M65 switch to C-axis mode without instability
  • G0/G1 C… moves work as expected
  • Switching back to spindle mode is also stable
The zero-speed bit from the statusword is now used only for diagnostics, not as a gating condition for switching — this was the original cause of the Mode 3 ↔ Mode 8 oscillation.M19 is not fully tuned yet (separate topic), but it no longer affects the mode switching.I’ll attach the HAL file and the small sync component in the thread.
Attachments:
The following user(s) said Thank You: tommylight

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

Time to create page: 0.059 seconds
Powered by Kunena Forum