General Questions about using ethercat
- Tntmold
- Away
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
02 May 2025 17:59 #327517
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
Thanks for the reply but I believe I made all those changes and it made no difference, did I do it wrong or is the problem something else?
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 659
- Thank you received: 214
02 May 2025 19:02 - 02 May 2025 19:42 #327527
by Hakan
Replied by Hakan on topic General Questions about using ethercat
Maybe lcec doesn't find the device or it doesn't go to OP.
From "ethercat slaves", are they in OP?
In halshow, can you see the pin lcec.0.0.statusword?
Any clues from "sudo dmesg", the last say 50 lines are of interest.
Edit. I looked a bit closer at the ethercat-conf.xml file.
You have double info, which I haven't seen before. Where does the info in that file come from?
I am not used to see a lot of PDOs in syncManager 0 and 1, but always have the PDOs
in SM 2 and SM 3. And you have the info there as well.
Can you test to replace the contents in ethercat-conf.xml of the clients with this
From "ethercat slaves", are they in OP?
In halshow, can you see the pin lcec.0.0.statusword?
Any clues from "sudo dmesg", the last say 50 lines are of interest.
Edit. I looked a bit closer at the ethercat-conf.xml file.
You have double info, which I haven't seen before. Where does the info in that file come from?
I am not used to see a lot of PDOs in syncManager 0 and 1, but always have the PDOs
in SM 2 and SM 3. And you have the info there as well.
Can you test to replace the contents in ethercat-conf.xml of the clients with this
<slave idx="0" fill in the rest in this line
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="controlword" halType="u32"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="s32"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="target-position" halType="s32"/>
<pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="statusword" halType="u32"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode-display" halType="s32"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actual-position" halType="s32"/>
<pdoEntry idx="60FF" subIdx="00" bitLen="32" halPin="target-velocity" halType="s32"/>
</pdo>
</syncManager>
</slave>
Last edit: 02 May 2025 19:42 by Hakan.
Please Log in or Create an account to join the conversation.
- Tntmold
- Away
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
02 May 2025 20:09 #327542
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
ethercat slaves indicates drives are in PREOP
halshow shows no pins
sudo dmesg output:
[3991690.001706] EtherCAT DEBUG 0: ec_master_send_datagrams(device_index = 0)
[3991690.001707] EtherCAT DEBUG 0: Adding datagram 0x0B
[3991690.001708] EtherCAT DEBUG 0: frame size: 46
[3991690.001709] EtherCAT DEBUG 0: Sending frame:
[3991690.001709] EtherCAT DEBUG: FF FF FF FF FF FF 2C 44 FD 25 D0 28 88 A4 0E 10
[3991690.001714] EtherCAT DEBUG: 04 0B 01 00 30 01 02 00 00 00 00 00 00 00 00 00
[3991690.001719] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.001723] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009637] EtherCAT DEBUG 0: Received frame:
[3991690.009639] EtherCAT DEBUG: FF FF FF FF FF FF 2E 44 FD 25 D0 28 88 A4 0E 10
[3991690.009645] EtherCAT DEBUG: 04 0B 01 00 30 01 02 40 00 00 02 00 01 00 00 00
[3991690.009650] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009655] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009663] EtherCAT DEBUG 0: ec_master_send_datagrams(device_index = 0)
[3991690.009664] EtherCAT DEBUG 0: Adding datagram 0x0C
[3991690.009665] EtherCAT DEBUG 0: frame size: 46
[3991690.009666] EtherCAT DEBUG 0: Sending frame:
[3991690.009666] EtherCAT DEBUG: FF FF FF FF FF FF 2C 44 FD 25 D0 28 88 A4 0E 10
[3991690.009671] EtherCAT DEBUG: 04 0C 02 00 30 01 02 00 00 00 00 00 00 00 00 00
[3991690.009676] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009681] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00
The ethercat-conf.xml file came from the output of the command lcec_configgen
I replaced ethercat-conf.xml with your suggestions, and still get the same error
phil@SodickA:~/linuxcnc/configs/sim.axis$ linuxcnc lathe.ini
LINUXCNC - 2.9.3
Machine configuration directory is '/home/phil/linuxcnc/configs/sim.axis'
Machine configuration file is 'lathe.ini'
Starting LinuxCNC...
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./ethercat.hal
./ethercat.hal:50: Pin 'lcec.0.0.statusword' does not exist
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/phil/linuxcnc_debug.txt
and
/home/phil/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
halshow shows no pins
sudo dmesg output:
[3991690.001706] EtherCAT DEBUG 0: ec_master_send_datagrams(device_index = 0)
[3991690.001707] EtherCAT DEBUG 0: Adding datagram 0x0B
[3991690.001708] EtherCAT DEBUG 0: frame size: 46
[3991690.001709] EtherCAT DEBUG 0: Sending frame:
[3991690.001709] EtherCAT DEBUG: FF FF FF FF FF FF 2C 44 FD 25 D0 28 88 A4 0E 10
[3991690.001714] EtherCAT DEBUG: 04 0B 01 00 30 01 02 00 00 00 00 00 00 00 00 00
[3991690.001719] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.001723] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009637] EtherCAT DEBUG 0: Received frame:
[3991690.009639] EtherCAT DEBUG: FF FF FF FF FF FF 2E 44 FD 25 D0 28 88 A4 0E 10
[3991690.009645] EtherCAT DEBUG: 04 0B 01 00 30 01 02 40 00 00 02 00 01 00 00 00
[3991690.009650] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009655] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009663] EtherCAT DEBUG 0: ec_master_send_datagrams(device_index = 0)
[3991690.009664] EtherCAT DEBUG 0: Adding datagram 0x0C
[3991690.009665] EtherCAT DEBUG 0: frame size: 46
[3991690.009666] EtherCAT DEBUG 0: Sending frame:
[3991690.009666] EtherCAT DEBUG: FF FF FF FF FF FF 2C 44 FD 25 D0 28 88 A4 0E 10
[3991690.009671] EtherCAT DEBUG: 04 0C 02 00 30 01 02 00 00 00 00 00 00 00 00 00
[3991690.009676] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[3991690.009681] EtherCAT DEBUG: 00 00 00 00 00 00 00 00 00 00 00 00
The ethercat-conf.xml file came from the output of the command lcec_configgen
I replaced ethercat-conf.xml with your suggestions, and still get the same error
phil@SodickA:~/linuxcnc/configs/sim.axis$ linuxcnc lathe.ini
LINUXCNC - 2.9.3
Machine configuration directory is '/home/phil/linuxcnc/configs/sim.axis'
Machine configuration file is 'lathe.ini'
Starting LinuxCNC...
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./ethercat.hal
./ethercat.hal:50: Pin 'lcec.0.0.statusword' does not exist
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/phil/linuxcnc_debug.txt
and
/home/phil/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11227
- Thank you received: 3750
02 May 2025 21:10 #327551
by rodw
Replied by rodw on topic General Questions about using ethercat
This is not an Ethercat issue. Its your syntax error in hal
Use standard debugging.
Run Linuxcnc from the command line so errors are reported in the console.
Read the error message, Comment out the offending line (line 50) with a #
Continue to comment out errors until the config loads.
Use Halshow to review pin names. Work out what the correct pin name is and correct your hal file.
easy!
Use standard debugging.
Run Linuxcnc from the command line so errors are reported in the console.
Read the error message, Comment out the offending line (line 50) with a #
Continue to comment out errors until the config loads.
Use Halshow to review pin names. Work out what the correct pin name is and correct your hal file.
easy!
The following user(s) said Thank You: Tntmold
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 659
- Thank you received: 214
02 May 2025 21:28 #327555
by Hakan
Replied by Hakan on topic General Questions about using ethercat
Maybe not ethercat as such but an lcec issue.
There are so many places this can go wrong, syntax mistakes.
Now I saw another thing. There is a name="D1" in the client line.
Then you should use lcec.0.D1 instead of lcec.0.0
There are so many places this can go wrong, syntax mistakes.
Now I saw another thing. There is a name="D1" in the client line.
Then you should use lcec.0.D1 instead of lcec.0.0
The following user(s) said Thank You: Tntmold
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11227
- Thank you received: 3750
02 May 2025 21:36 #327557
by rodw
following the troubleshooting I outlined would unearth it all.
Replied by rodw on topic General Questions about using ethercat
lcec is Ethercat (the Linuxcnc ethercat hal driver)Maybe not ethercat as such but an lcec issue.
following the troubleshooting I outlined would unearth it all.
The following user(s) said Thank You: Tntmold
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 659
- Thank you received: 214
02 May 2025 21:54 #327560
by Hakan
Replied by Hakan on topic General Questions about using ethercat
Lcec isn't ethercat it is just an interface to ethercat, at the most a driver to use ethercat.
How well do you think your method works in this case?
Maybe if there was a detailed guide on how to set this up, and what to do in case of problem?
More than once I have wished to refer to RTFM but there isn't one.
How well do you think your method works in this case?
Maybe if there was a detailed guide on how to set this up, and what to do in case of problem?
More than once I have wished to refer to RTFM but there isn't one.
Please Log in or Create an account to join the conversation.
- Tntmold
- Away
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
02 May 2025 22:16 #327562
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
Thanks for the help, it loaded after changing lcec name to D1 and D2, and after I commented out several lines.
ethercat slaves shows both are on OP mode, but I am sure I don't currently have enough pins defined for motion control.
I need to work out what those line problems are, some are just not defined and some are type mismatch, but I may be able to work that out.
ethercat slaves shows both are on OP mode, but I am sure I don't currently have enough pins defined for motion control.
I need to work out what those line problems are, some are just not defined and some are type mismatch, but I may be able to work that out.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 659
- Thank you received: 214
03 May 2025 07:04 #327587
by Hakan
Replied by Hakan on topic General Questions about using ethercat
Good to hear, wouldn't surprise me if you change D1 and D2 to X and Z.
That config should be enough to move the axis. Try it.
Then you need to add limit switches and other switches if you have that, spindle control, pendant or gamepad and so on.
Now when linuxcnc is up and running you can easily inspect pins' values using halshow.
The drive and motors are closed-loop I guess, then you will see actual-position change when you rotate the motor shaft, even by just a little if the motors are active.
That config should be enough to move the axis. Try it.
Then you need to add limit switches and other switches if you have that, spindle control, pendant or gamepad and so on.
Now when linuxcnc is up and running you can easily inspect pins' values using halshow.
The drive and motors are closed-loop I guess, then you will see actual-position change when you rotate the motor shaft, even by just a little if the motors are active.
Please Log in or Create an account to join the conversation.
Time to create page: 0.136 seconds