Ethercat protocol not responding
- akg1904
- Offline
- Premium Member
Less
More
- Posts: 98
- Thank you received: 3
31 Jan 2023 06:15 #263302
by akg1904
Ethercat protocol not responding was created by akg1904
Hi,
I've been trying to get linuxcnc working via the ethercat protocol but am a little stuck.
I've installed Ethercat following the guide linked below:
forum.linuxcnc.org/ethercat/45336-etherc...step-by-step?start=0
I believe I was successful in installing it because I got the following in terminal:
Command:
"halcmd show pin lcec"
Response:
Component Pins:
Owner Type Dir Value Name
4 u32 OUT 0x00000001 lcec.conf.master-count
4 u32 OUT 0x00000001 lcec.conf.slave-count
Command:
"ethercat cstruct"
Response:
/* Master 0, Slave 0
* Vendor ID: 0x00000539
* Product code: 0x02200301
* Revision number: 0x00080019
*/
ec_pdo_entry_info_t slave_0_pdo_entries = {
{0x6040, 0x00, 16},
{0x607a, 0x00, 32},
{0x6041, 0x00, 16},
{0x6064, 0x00, 32},
};
ec_pdo_info_t slave_0_pdos = {
{0x1601, 2, slave_0_pdo_entries + 0}, /* 2nd Receive PDO mapping */
{0x1a01, 2, slave_0_pdo_entries + 2}, /* 2nd Transmit PDO mapping */
};
ec_sync_info_t slave_0_syncs = {
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
{2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
{3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
{0xff}
};
So I proceeded to run linuxcnc (axis GUI) all went well with no error messages in terminal.
However when I tried to jog my servo motor, it didn't move.
I moved the motor by hand but there was no difference in the DRO reading on the display either.
Now I don't know what I have done wrong...
I have checked my wiring and all seems fine so I'm left thinking it has something to do with the configuration or integration.
I have attached my ini, hal and xml files for reference.
ini
xml
hal
Has anyone faced a similar problem before or does anyone have any ideas of what might be going wrong???
Thanks in advance,
Abhishek
I've been trying to get linuxcnc working via the ethercat protocol but am a little stuck.
I've installed Ethercat following the guide linked below:
forum.linuxcnc.org/ethercat/45336-etherc...step-by-step?start=0
I believe I was successful in installing it because I got the following in terminal:
Command:
"halcmd show pin lcec"
Response:
Component Pins:
Owner Type Dir Value Name
4 u32 OUT 0x00000001 lcec.conf.master-count
4 u32 OUT 0x00000001 lcec.conf.slave-count
Command:
"ethercat cstruct"
Response:
/* Master 0, Slave 0
* Vendor ID: 0x00000539
* Product code: 0x02200301
* Revision number: 0x00080019
*/
ec_pdo_entry_info_t slave_0_pdo_entries = {
{0x6040, 0x00, 16},
{0x607a, 0x00, 32},
{0x6041, 0x00, 16},
{0x6064, 0x00, 32},
};
ec_pdo_info_t slave_0_pdos = {
{0x1601, 2, slave_0_pdo_entries + 0}, /* 2nd Receive PDO mapping */
{0x1a01, 2, slave_0_pdo_entries + 2}, /* 2nd Transmit PDO mapping */
};
ec_sync_info_t slave_0_syncs = {
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
{2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
{3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE},
{0xff}
};
So I proceeded to run linuxcnc (axis GUI) all went well with no error messages in terminal.
However when I tried to jog my servo motor, it didn't move.
I moved the motor by hand but there was no difference in the DRO reading on the display either.
Now I don't know what I have done wrong...
I have checked my wiring and all seems fine so I'm left thinking it has something to do with the configuration or integration.
I have attached my ini, hal and xml files for reference.
ini
xml
hal
Has anyone faced a similar problem before or does anyone have any ideas of what might be going wrong???
Thanks in advance,
Abhishek
Attachments:
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10702
- Thank you received: 3531
31 Jan 2023 07:52 #263309
by rodw
Replied by rodw on topic Ethercat protocol not responding
please copy output from
ethercat slaves
ethercat slaves
The following user(s) said Thank You: xwq
Please Log in or Create an account to join the conversation.
- akg1904
- Offline
- Premium Member
Less
More
- Posts: 98
- Thank you received: 3
31 Jan 2023 08:47 #263316
by akg1904
Replied by akg1904 on topic Ethercat protocol not responding
Hi Rodw,
Thanks once again for replying.
I think you want to see the Response of command "ethercat slaves"
Command:
"ethercat slaves"
Response:
0 1:0 PREOP + 0x00000539:0x02200301
Command:
"ethercat slaves -v"
Response:
=== Master 0, Slave 0 ===
Alias: 1
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000539
Product code: 0x02200301
Revision number: 0x00080019
Serial number: 0x00000000
DL information:
FMMU bit operation: yes
Distributed clocks: yes, 32 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 518943038 0 0
1 MII down closed no - - - -
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x1000/128, TX: 0x1080/128
Standard RX: 0x1000/128, TX: 0x1080/128
Supported protocols: EoE, CoE, FoE
General:
Group:
Image name:
Order number:
Device name:
CoE details:
Enable SDO: yes
Enable SDO Info: yes
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: yes
Current consumption: 0 mA
I hope with this we might figure out the error
Regards
Abhishek
Thanks once again for replying.
I think you want to see the Response of command "ethercat slaves"
Command:
"ethercat slaves"
Response:
0 1:0 PREOP + 0x00000539:0x02200301
Command:
"ethercat slaves -v"
Response:
=== Master 0, Slave 0 ===
Alias: 1
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000539
Product code: 0x02200301
Revision number: 0x00080019
Serial number: 0x00000000
DL information:
FMMU bit operation: yes
Distributed clocks: yes, 32 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 518943038 0 0
1 MII down closed no - - - -
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x1000/128, TX: 0x1080/128
Standard RX: 0x1000/128, TX: 0x1080/128
Supported protocols: EoE, CoE, FoE
General:
Group:
Image name:
Order number:
Device name:
CoE details:
Enable SDO: yes
Enable SDO Info: yes
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: yes
Current consumption: 0 mA
I hope with this we might figure out the error
Regards
Abhishek
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10702
- Thank you received: 3531
31 Jan 2023 09:25 #263321
by rodw
Replied by rodw on topic Ethercat protocol not responding
run linuxcnc from the command line and look for errors.
With linuxcnc running, in a new console window type ethercat slaves again and share. It should show a different status
With linuxcnc running, in a new console window type ethercat slaves again and share. It should show a different status
Please Log in or Create an account to join the conversation.
- akg1904
- Offline
- Premium Member
Less
More
- Posts: 98
- Thank you received: 3
31 Jan 2023 10:26 #263333
by akg1904
Replied by akg1904 on topic Ethercat protocol not responding
Hi Rodw,
I ran linuxcnc from the command line but there was no error which I could Identify.
Command:
"ethercat slaves"
Response:
0 1:0 PREOP E 0x00000539:0x02200301
Command:
"ethercat slaves -v"
Response:
=== Master 0, Slave 0 ===
Alias: 1
Device: Main
State: PREOP
Flag: E
Identity:
Vendor Id: 0x00000539
Product code: 0x02200301
Revision number: 0x00080019
Serial number: 0x00000000
DL information:
FMMU bit operation: yes
Distributed clocks: yes, 32 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 518943038 0 0
1 MII down closed no - - - -
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x1000/128, TX: 0x1080/128
Standard RX: 0x1000/128, TX: 0x1080/128
Supported protocols: EoE, CoE, FoE
General:
Group:
Image name:
Order number:
Device name:
CoE details:
Enable SDO: yes
Enable SDO Info: yes
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: yes
Current consumption: 0 mA
Note: I have directly connected the servo drive to my PC without any Bus-Coupler like Bechkoff(EK 1100), etc...
Could this be causing any problems?
Regards
Abhishek
I ran linuxcnc from the command line but there was no error which I could Identify.
Command:
"ethercat slaves"
Response:
0 1:0 PREOP E 0x00000539:0x02200301
Command:
"ethercat slaves -v"
Response:
=== Master 0, Slave 0 ===
Alias: 1
Device: Main
State: PREOP
Flag: E
Identity:
Vendor Id: 0x00000539
Product code: 0x02200301
Revision number: 0x00080019
Serial number: 0x00000000
DL information:
FMMU bit operation: yes
Distributed clocks: yes, 32 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 518943038 0 0
1 MII down closed no - - - -
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x1000/128, TX: 0x1080/128
Standard RX: 0x1000/128, TX: 0x1080/128
Supported protocols: EoE, CoE, FoE
General:
Group:
Image name:
Order number:
Device name:
CoE details:
Enable SDO: yes
Enable SDO Info: yes
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: yes
Current consumption: 0 mA
Note: I have directly connected the servo drive to my PC without any Bus-Coupler like Bechkoff(EK 1100), etc...
Could this be causing any problems?
Regards
Abhishek
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10702
- Thank you received: 3531
31 Jan 2023 10:51 #263334
by rodw
Replied by rodw on topic Ethercat protocol not responding
I think the slave state should change once linuxcnc is opened.
I can't help further.
I can't help further.
The following user(s) said Thank You: akg1904
Please Log in or Create an account to join the conversation.
- db1981
- Offline
- Platinum Member
Less
More
- Posts: 790
- Thank you received: 275
31 Jan 2023 12:41 #263345
by db1981
Replied by db1981 on topic Ethercat protocol not responding
check the dmesg output after starting linuxcnc, if there is nothing obivous set debug level to 1 "ethercat debug 1" and check again
Please Log in or Create an account to join the conversation.
- akg1904
- Offline
- Premium Member
Less
More
- Posts: 98
- Thank you received: 3
31 Jan 2023 13:41 #263356
by akg1904
Replied by akg1904 on topic Ethercat protocol not responding
Thanks Rodw for all your help, I really appreciate it.
I did a little bit of research and by typing the following command I got some response which give more detail information
Command:
sudo dmesg
Response:
[ 5.627340] EtherCAT: Master driver 1.6.0-rc1 unknown
[ 5.627452] EtherCAT: 1 master waiting for devices.
[ 5.635705] ec_generic: EtherCAT master generic Ethernet device module 1.6.0-rc1 unknown
[ 5.635714] EtherCAT: Accepting 1C:1B:0D:12:9F:8F as main device for master 0.
[ 5.635726] ec_generic: Binding socket to interface 2 (enp1s0).
[ 5.666467] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 5.666668] EtherCAT 0: Link state of ecm0 changed to UP.
[ 5.674399] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[ 6.182096] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[ 6.183690] r8169 0000:01:00.0: firmware: failed to load rtl_nic/rtl8168g-2.fw (-2)
[ 6.184341] r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168g-2.fw failed with error -2
[ 6.184344] r8169 0000:01:00.0 enp1s0: unable to load firmware patch rtl_nic/rtl8168g-2.fw (-2)
[ 6.184571] Generic PHY r8169-100:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-100:00, irq=IGNORE)
[ 6.190351] EtherCAT 0: Link state of ecm0 changed to DOWN.
[ 6.284799] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[ 6.317610] IPv6: ADDRCONF(NETDEV_UP): enx006f000126bb: link is not ready
[ 6.319923] IPv6: ADDRCONF(NETDEV_UP): enx006f000126bb: link is not ready
[ 6.668969] IPv6: ADDRCONF(NETDEV_CHANGE): enx006f000126bb: link becomes ready
[ 6.677326] asix 1-8:1.0 enx006f000126bb: link up, 100Mbps, full-duplex, lpa 0xC5E1
[ 6.977853] broken atomic modeset userspace detected, disabling atomic
[ 7.917529] r8169 0000:01:00.0 enp1s0: Link is Up - 100Mbps/Full - flow control off
[ 7.917548] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready
[ 7.922397] EtherCAT 0: Link state of ecm0 changed to UP.
[ 7.930401] EtherCAT 0: 1 slave(s) responding on main device.
[ 7.930406] EtherCAT 0: Slave states on main device: PREOP.
[ 7.930502] EtherCAT 0: Scanning bus.
[ 7.940800] EtherCAT 0: Bus scanning completed in 8 ms.
[ 7.940803] EtherCAT 0: Using slave 0 as DC reference clock.
[ 8.493519] fuse init (API version 7.27)
[ 11.220067] rfkill: input handler disabled
[ 260.551951] EtherCAT: Requesting master 0...
[ 260.551953] EtherCAT: Successfully requested master 0.
[ 260.552139] EtherCAT 0: Domain0: Logical address 0x00000000, 46 byte, expected working counter 3.
[ 260.552141] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 46 byte, type LRW at 000000006b7f61bb.
[ 260.552148] EtherCAT 0: Master thread exited.
[ 260.552149] EtherCAT 0: Starting EtherCAT-OP thread.
[ 260.552170] EtherCAT WARNING 0: 61 datagrams TIMED OUT!
[ 260.811521] EtherCAT ERROR 0-0: SDO download 0x1C12:00 (1 bytes) aborted.
[ 260.811525] EtherCAT ERROR 0-0: SDO abort message 0x06040041: "The object cannot be mapped into the PDO".
[ 260.811526] EtherCAT WARNING 0-0: Failed to set number of assigned PDOs of SM2.
[ 260.811527] EtherCAT WARNING 0-0: Currently assigned PDOs: (none). PDOs to assign: 0x1600
[ 260.811529] EtherCAT WARNING 0-0: PDO configuration failed.
[ 260.820520] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[ 260.821519] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[ 260.823519] EtherCAT 0-0: Acknowledged state PREOP.
As I can see from the info that the slave is refusing to change the state and I can't figure it out
If someone got this type of problem kindly help me out .
Thanks and Regards
Abhishek
I did a little bit of research and by typing the following command I got some response which give more detail information
Command:
sudo dmesg
Response:
[ 5.627340] EtherCAT: Master driver 1.6.0-rc1 unknown
[ 5.627452] EtherCAT: 1 master waiting for devices.
[ 5.635705] ec_generic: EtherCAT master generic Ethernet device module 1.6.0-rc1 unknown
[ 5.635714] EtherCAT: Accepting 1C:1B:0D:12:9F:8F as main device for master 0.
[ 5.635726] ec_generic: Binding socket to interface 2 (enp1s0).
[ 5.666467] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 5.666668] EtherCAT 0: Link state of ecm0 changed to UP.
[ 5.674399] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[ 6.182096] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[ 6.183690] r8169 0000:01:00.0: firmware: failed to load rtl_nic/rtl8168g-2.fw (-2)
[ 6.184341] r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168g-2.fw failed with error -2
[ 6.184344] r8169 0000:01:00.0 enp1s0: unable to load firmware patch rtl_nic/rtl8168g-2.fw (-2)
[ 6.184571] Generic PHY r8169-100:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-100:00, irq=IGNORE)
[ 6.190351] EtherCAT 0: Link state of ecm0 changed to DOWN.
[ 6.284799] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[ 6.317610] IPv6: ADDRCONF(NETDEV_UP): enx006f000126bb: link is not ready
[ 6.319923] IPv6: ADDRCONF(NETDEV_UP): enx006f000126bb: link is not ready
[ 6.668969] IPv6: ADDRCONF(NETDEV_CHANGE): enx006f000126bb: link becomes ready
[ 6.677326] asix 1-8:1.0 enx006f000126bb: link up, 100Mbps, full-duplex, lpa 0xC5E1
[ 6.977853] broken atomic modeset userspace detected, disabling atomic
[ 7.917529] r8169 0000:01:00.0 enp1s0: Link is Up - 100Mbps/Full - flow control off
[ 7.917548] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready
[ 7.922397] EtherCAT 0: Link state of ecm0 changed to UP.
[ 7.930401] EtherCAT 0: 1 slave(s) responding on main device.
[ 7.930406] EtherCAT 0: Slave states on main device: PREOP.
[ 7.930502] EtherCAT 0: Scanning bus.
[ 7.940800] EtherCAT 0: Bus scanning completed in 8 ms.
[ 7.940803] EtherCAT 0: Using slave 0 as DC reference clock.
[ 8.493519] fuse init (API version 7.27)
[ 11.220067] rfkill: input handler disabled
[ 260.551951] EtherCAT: Requesting master 0...
[ 260.551953] EtherCAT: Successfully requested master 0.
[ 260.552139] EtherCAT 0: Domain0: Logical address 0x00000000, 46 byte, expected working counter 3.
[ 260.552141] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 46 byte, type LRW at 000000006b7f61bb.
[ 260.552148] EtherCAT 0: Master thread exited.
[ 260.552149] EtherCAT 0: Starting EtherCAT-OP thread.
[ 260.552170] EtherCAT WARNING 0: 61 datagrams TIMED OUT!
[ 260.811521] EtherCAT ERROR 0-0: SDO download 0x1C12:00 (1 bytes) aborted.
[ 260.811525] EtherCAT ERROR 0-0: SDO abort message 0x06040041: "The object cannot be mapped into the PDO".
[ 260.811526] EtherCAT WARNING 0-0: Failed to set number of assigned PDOs of SM2.
[ 260.811527] EtherCAT WARNING 0-0: Currently assigned PDOs: (none). PDOs to assign: 0x1600
[ 260.811529] EtherCAT WARNING 0-0: PDO configuration failed.
[ 260.820520] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[ 260.821519] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[ 260.823519] EtherCAT 0-0: Acknowledged state PREOP.
As I can see from the info that the slave is refusing to change the state and I can't figure it out
If someone got this type of problem kindly help me out .
Thanks and Regards
Abhishek
Please Log in or Create an account to join the conversation.
- akg1904
- Offline
- Premium Member
Less
More
- Posts: 98
- Thank you received: 3
31 Jan 2023 13:44 - 31 Jan 2023 14:13 #263357
by akg1904
Replied by akg1904 on topic Ethercat protocol not responding
Hi db1981,
After setting debug level to 1 using "ethercat debug 1" in terminal
I did dmesg and I got response which I have attached in text file below:
I can see some changes but cannot figure out the cause of error
Thanks and Regards
Abhishek
After setting debug level to 1 using "ethercat debug 1" in terminal
I did dmesg and I got response which I have attached in text file below:
I can see some changes but cannot figure out the cause of error
Thanks and Regards
Abhishek
Attachments:
Last edit: 31 Jan 2023 14:13 by akg1904.
Please Log in or Create an account to join the conversation.
- db1981
- Offline
- Platinum Member
Less
More
- Posts: 790
- Thank you received: 275
31 Jan 2023 14:45 #263363
by db1981
Replied by db1981 on topic Ethercat protocol not responding
one or more register from your slave can not be mapped to pdo, because the slave doesn'T support this.
what type of slave is this?
please post output from "ethercat pdos"
what type of slave is this?
please post output from "ethercat pdos"
Please Log in or Create an account to join the conversation.
Time to create page: 0.096 seconds