LinuxCNC and Beckhoff AX5000 servo drives

More
22 Apr 2026 17:56 - 22 Apr 2026 18:00 #345844 by Surmetall
Replied by Surmetall on topic LinuxCNC and Beckhoff AX5000 servo drives
Thank you for your help, and sorry for taking up your time. I hope to learn this myself as soon as possible so I won’t have to bother anyone.The exported file was called “.tnzip” for some reason I have no idea why. I renamed it to “.zip” so I can upload it here.
Attachments:
Last edit: 22 Apr 2026 18:00 by Surmetall.
The following user(s) said Thank You: endian

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

More
22 Apr 2026 19:09 #345847 by endian
Replied by endian on topic LinuxCNC and Beckhoff AX5000 servo drives

Thank you for your help, and sorry for taking up your time. I hope to learn this myself as soon as possible so I won’t have to bother anyone.The exported file was called “.tnzip” for some reason I have no idea why. I renamed it to “.zip” so I can upload it here.
 

here is output.. check it all
Attachments:
The following user(s) said Thank You: Surmetall

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

More
22 Apr 2026 19:33 #345848 by Surmetall
Replied by Surmetall on topic LinuxCNC and Beckhoff AX5000 servo drives
Damn, I was afraid of that, unfortunately I had to leave the workshop… just missed it. Thanks for doing it right away today! Sorry for my vad Timing....Thanks a lot for exporting it, I’ll test it tomorrow evening right away!I’m afraid I won’t be able to sleep tonight :O

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

More
23 Apr 2026 15:02 - 23 Apr 2026 15:05 #345877 by Surmetall
Replied by Surmetall on topic LinuxCNC and Beckhoff AX5000 servo drives
Hi endian,thank you again. I made a completely clean test now with only the AX5125 connected on the EtherCAT bus, no other slaves connected.

I used your files from the zip exactly for the AX test. The startup initCmds file is your Antrieb-1-AX5-0-initCmds.xml unchanged. I only pointed my machine config to that file.

Current result is much better now:
the AX5125 reaches OP when it is the only slave on the bus.Current ethercat slaves output is:
0 0:0 OP + AX5125-0000-0216 EtherCAT Drive (SoE, 1 Ch.)

The important dmesg lines are these:
EtherCAT WARNING 0-0: Slave does not support changing the PDO mapping!
Currently mapped PDO entries: 0x0086:00/16 0x002F:00/32. Entries to map: 0x0086:01/16 0x002F:01/32 0x0024:01/32 0x0050:01/16 0x81E4:01/32 0x81E5:01/32EtherCAT WARNING 0-0: Slave does not support changing the PDO mapping!
Currently mapped PDO entries: 0x0087:00/16 0x0033:00/32 0x00BD:00/32. Entries to map: 0x0087:01/16 0x0033:01/32 0x00BD:01/32 0x0054:01/16 0x0028:01/32 0x81CC:01/16 0x81CD:01/16EtherCAT 0: Slave states on main device: OP.My currently active AX slave config is:
slave idx 0
type generic
vid 0x00000002
pid 0x14056012
name Antrieb-1-AX5-0
configPdos trueMDT PDO 0018 entries requested by config:
0086:01 16 bit
002F:01 32 bit
0024:01 32 bit
0050:01 16 bit
81E4:01 32 bit
81E5:01 32 bitAT PDO 0010 entries requested by config:
0087:01 16 bit
0033:01 32 bit
00BD:01 32 bit
0054:01 16 bit
0028:01 32 bit
81CC:01 16 bit
81CD:01 16 bitDC config currently used:
assignActivate 730
sync0Cycle 250000
sync0Shift 0
sync1Cycle 750000
sync1Shift 0

So the situation now seems to be:
before, the drive stayed in PREOP plus ERROR with MBX_SOE.
now, with only the AX and your startup file, it reaches OP.
but the drive reports that its current mapped PDOs are still the smaller set with subindex 00, while the config wants the extended subindex 01 mapping.

My main question is:
is this already the expected next step, meaning I should now reduce the config to the fixed PDO set the drive actually reports as mapped, or is there still a missing startup/configuration step that should switch the AX5125 to the full 01 PDO mapping?
In other words: now that the drive reaches OP, what is the correct next step before I put the other slaves back on the bus?

Thanks a lot for your help. 
Last edit: 23 Apr 2026 15:05 by Surmetall.

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

More
25 Apr 2026 05:59 #345906 by endian
Replied by endian on topic LinuxCNC and Beckhoff AX5000 servo drives
Difference between 00 and 01 is bug at master/slave layer... If you will map everything at 00 it will works just few IDNs and main number of then will produce mess .. i do not know why it is that but its the fact ..

Second bug what many year ago was reported by @bkt or other skillfull user was that not supporting stuff mapping pdo is present and and mailbox is not changing... But it was fake data because main volume this ax5 have mapping pdos ON if an EEPROM does not tell you else....its just forgoten message from early days

I think its correct you can add other slave to your TC3 project.. give them naming with string length less than 16 chars and it will works well

Post command + output of you situation then here I can check it..

Thankfully we have that translator and its save anybody non nerdy in lcec one half life.. because I lost it too
 
The following user(s) said Thank You: Surmetall

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

More
27 Apr 2026 16:44 - 27 Apr 2026 16:47 #345991 by Surmetall
Replied by Surmetall on topic LinuxCNC and Beckhoff AX5000 servo drives
Hi endian,

I spent quite a few hours on this again today and tried to narrow it down properly instead of guessing.
On the full 13-slave bus, all other slaves go OP but the AX5125 at slave 7 still drops to PREOP + ERROR. The relevant lines are

:ethercat slaves:
7 0:7 PREOP E AX5125-0000-0216 EtherCAT Drive (SoE, 1 Ch.)

dmesg:
EtherCAT WARNING 0-7: Slave does not support changing the PDO mapping!
Currently mapped PDO entries: 0x0086:00/16 0x002F:00/32. Entries to map: 0x0086:01/16 0x002F:01/32 0x0024:01/32 0x0050:01/16 0x81E4:01/32 0x81E5:01/32

EtherCAT WARNING 0-7: Slave does not support changing the PDO mapping!
Currently mapped PDO entries: 0x0087:00/16 0x0033:00/32 0x00BD:00/32. Entries to map: 0x0087:01/16 0x0033:01/32 0x00BD:01/32 0x0054:01/16 0x0028:01/32 0x81CC:01/16 0x81CD:01/16
EtherCAT ERROR 0-7: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
EtherCAT ERROR 0-7: AL status message 0x0045: "MBX_SOE".

I also made an AX-only test again. Earlier the AX could reach OP by itself, but I still could not get the motor to actually rotate from LinuxCNC. I tried both a direct velocity-command approach and then a stepgen/position-command approach. The command chain seems to work up to the AX command pin, but the motor still does not move.

From the AX-only spin test:
halcmd getp lcec.0.Antrieb-1-AX5-0.slave-oper
FALSE
halcmd getp lcec.0.Antrieb-1-AX5-0.slave-state-op
FALSE
halcmd getp lcec.0.Antrieb-1-AX5-0.Drive-status-wo-6
40960
halcmd getp spindle.0.speed-cmd-rps
8.333333
halcmd getp stepgen.0.velocity-cmd
8.333333
halcmd getp stepgen.0.position-fb
157.122
halcmd getp sercos.0.pos-cmd
157.1553
halcmd getp lcec.0.Antrieb-1-AX5-0.Position-comman-1
164824253

ethercat slaves:
0 0:0 SAFEOP E AX5125-0000-0216 EtherCAT Drive (SoE, 1 Ch.)
dmesg:
EtherCAT ERROR 0-0: Failed to set OP state, slave refused state change (SAFEOP + ERROR).
EtherCAT ERROR 0-0: AL status message 0x001A: "Synchronization error".

I also tested removing IDNs 32972, 32969, 32971 and 32970 once from initCmds, but that changed nothing, so I restored the original file again.
So at this point I have two clear observations:
on the full bus the AX still fails with MBX_SOE,
and on the AX-only LinuxCNC spindle test I can generate command values but still cannot get the drive to rotate.

What would you check next? I am little bit out of ideas. Thanks for your time! 

greetings 

Tom
Last edit: 27 Apr 2026 16:47 by Surmetall.

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

More
28 Apr 2026 16:06 - 28 Apr 2026 16:23 #346015 by endian
Replied by endian on topic LinuxCNC and Beckhoff AX5000 servo drives
put all AX5xxx first and any other devices behind it ... if translator created the config it is pure master swap to linuxcnc master which is probably OK... but I am just a man and its just a software ...

check sizes of ethercat IDN in the SM and maybe subindexes ...

check if all you have 0x01 ... if they are not change them

share .xml config its tricky to tell you more if there is just small part of the dmesg outcome...

EtherCAT ERROR 0-7: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
EtherCAT ERROR 0-7: AL status message 0x0045: "MBX_SOE".

move(means cut off where it is and put it at the bottom of the file) in init commands from anywhere to the bottom like below -

<InitCmd>
<Transition>IP</Transition>
<Comment><![CDATA[Report diagnostics information]]></Comment>
<Timeout>0</Timeout>
<OpCode>3</OpCode>
<DriveNo>0</DriveNo>
<IDN>33072</IDN>
<Elements>64</Elements>
<Attribute>0</Attribute>
<Data>0100</Data>
</InitCmd>
</InitCmds>
</SoE>
</EtherCATMailbox>
EtherCAT ERROR 0-0: Failed to set OP state, slave refused state change (SAFEOP + ERROR).
EtherCAT ERROR 0-0: AL status message 0x001A: "Synchronization error".

which ethercat driver you are using for control the AX ? generic or native 
Last edit: 28 Apr 2026 16:23 by endian. Reason: startup edit
The following user(s) said Thank You: Surmetall

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

More
29 Apr 2026 07:34 #346033 by Surmetall
Replied by Surmetall on topic LinuxCNC and Beckhoff AX5000 servo drives
Hi endian,

thanks a lot.
I am using the generic driver.
Yes, the AX5125 is currently at slave 7. I will move it to the first position on the bus as soon as I am back in the shop.

The current active AX PDO entries in ethercat-conf.xml use subIdx="00", not 0x01:
0x0086:00
0x002F:00
0x0087:00
0x0033:00
0x00BD:00

Current active AX config:
generic
configPdos="false"
reduced PDO mapping
dcConf assignActivate="730" sync0Cycle="250000" sync1Cycle="0"
I also exported the AX5125 selected item from TwinCAT and now have the full SoE InitCmd export.

My next steps are:
move the AX5125 to the first position on the bus
change the active PDO subindexes from 00 to 01
move IDN 33072 to the end of the InitCmd list

I am very grateful for your help and also for your converter tool.
At the moment I am also using AI to help me work through this problem. I am not blindly copying what it suggests. I mainly use it to learn how this integration works.
My long-term goal is to add a second AX double motor drive as well, but first I want to get this AX5125 running and understand what I did wrong so I can avoid the same mistakes in the future.
What also makes me curious is that your export/converter result worked much better than my own attempt.
Do you have any idea what I may have done wrong when exporting or preparing the file?

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

Time to create page: 0.085 seconds
Powered by Kunena Forum