Chinese servo drive SG-AS problem with EtherCAT version startup

More
3 years 6 months ago #269101 by Stean
Hello,
LinuxCNC is a great project!

I'm trying to start a Chinese servodrive over the EtherCAT bus (previously I've used the analog version with success these drives have been working hard for 3 years with no problems).
After a many days of trying EtherCAT version, I need and ask for some help and suggestions.

My current state before Linux launch:

~$ ethercat master
Master0
  Phase: Idle
  Active: no
  Slaves: 1
  Ethernet devices:
    Main: b8:ae:ed:b7:47:18 (attached)
      Link: UP
      Tx frames:   25700
      Tx bytes:    2041896
      Rx frames:   25699
      Rx bytes:    2041836
      Tx errors:   0
      Tx frame rate [1/s]:    125    125    122
      Tx rate [KByte/s]:      7.3    7.4    7.8
      Rx frame rate [1/s]:    125    125    122
      Rx rate [KByte/s]:      7.3    7.4    7.8
    Common:
      Tx frames:   25700
      Tx bytes:    2041896
      Rx frames:   25699
      Rx bytes:    2041836
      Lost frames: 0
      Tx frame rate [1/s]:    125    125    122
      Tx rate [KByte/s]:      7.3    7.4    7.8
      Rx frame rate [1/s]:    125    125    122
      Rx rate [KByte/s]:      7.3    7.4    7.8
      Loss rate [1/s]:          0      0      0
      Frame loss [%]:         0.0    0.0    0.0
  Distributed clocks:
    Reference clock:   Slave 0
    DC reference time: 0
    Application time:  0
                       2000-01-01 00:00:00.000000000


~$ ethercat slaves
0  0:0  PREOP  +  SG-AS EtherCAT(COE) Servo Drives Rev1.0



~$ ethercat slaves -v
=== Master 0, Slave 0 ===
Device: Main
State: PREOP
Flag: +
Identity:
  Vendor Id:       0x00000bf8
  Product code:    0x00000001
  Revision number: 0x00010008
  Serial number:   0x00000000
DL information:
  FMMU bit operation: no
  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             -   3144418126           0           0
   1  MII   down  closed  no              -            -           -           -
   2  N/A   down  closed  no              -            -           -           -
   3  N/A   down  closed  no              -            -           -           -
Mailboxes:
  Bootstrap RX: 0x0000/0, TX: 0x0000/0
  Standard  RX: 0x1800/384, TX: 0x1a00/384
  Supported protocols: CoE
General:
  Group: Drive
  Image name: DRIVE
  Order number: SG-ASE
  Device name: SG-AS EtherCAT(COE) Servo Drives Rev1.0
  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: yes
    Enable notLRW: no
  Current consumption: 0 mA

So EtherCAT and Slave is visible.

~$ sudo dmesg

[   18.499238] EtherCAT 0: Starting EtherCAT-IDLE thread.
[   18.499406] EtherCAT 0: Link state of ecm0 changed to UP.
[   18.511309] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[   19.511206] EtherCAT WARNING 0: 124 datagrams TIMED OUT!
[   20.511312] EtherCAT WARNING 0: 124 datagrams TIMED OUT!
[   21.515325] EtherCAT WARNING 0: 123 datagrams TIMED OUT!
[   22.515330] EtherCAT WARNING 0: 121 datagrams TIMED OUT!
[   23.515201] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[   24.523246] EtherCAT WARNING 0: 117 datagrams TIMED OUT!
[   25.132276] IPv6: ADDRCONF(NETDEV_UP): enp2s0f0: link is not ready
[   25.133215] RTL8211B Gigabit Ethernet r8169-200:00: attached PHY driver [RTL8211B Gigabit Ethernet] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[   25.139207] EtherCAT 0: Link state of ecm0 changed to DOWN.
[   25.232527] IPv6: ADDRCONF(NETDEV_UP): enp2s0f0: link is not ready
[   25.233386] r8169 0000:02:00.0 enp2s0f0: Link is Down
[   26.304994] broken atomic modeset userspace detected, disabling atomic
[   26.823190] r8169 0000:02:00.0 enp2s0f0: Link is Up - 100Mbps/Full - flow control off
[   26.823202] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0f0: link becomes ready
[   26.823224] EtherCAT 0: Link state of ecm0 changed to UP.
[   26.831198] EtherCAT 0: 1 slave(s) responding on main device.
[   26.831202] EtherCAT 0: Slave states on main device: INIT.
[   26.831328] EtherCAT 0: Scanning bus.
[   26.863969] EtherCAT 0: Bus scanning completed in 32 ms.
[   26.863971] EtherCAT 0: Using slave 0 as DC reference clock.
[   26.871213] EtherCAT 0: Slave states on main device: PREOP.
[   30.106146] EtherCAT ERROR 0-0: SDO information error response while fetching SDO 0x0678!
[   30.106150] EtherCAT ERROR 0-0: SDO abort message 0x06010000: "Unsupported access to an object".

these last errors not looking good but drive no error.


Now LinuxCNC starting ...

~$ ethercat slaves
0  0:0  OP  +  SG-AS EtherCAT(COE) Servo Drives Rev1.0

OP + looks very good, but now there is a problem with the drive, reports error 40 (bus communication error)

Drive is still in OP mode and I can read the actual position :

~$ ethercat upload -p 0 -t int32 0x6064 0
0x0016336e 1454958

But when the drive has this error I can`t enable and moving.
LinuxCNC does not show actual position and no value with hal commands,
works only ethercat upload ...

Below some more information after LinuxCNC starting, looks bad ...

~$ sudo dmesg
[   26.823202] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s0f0: link becomes ready
[   26.823224] EtherCAT 0: Link state of ecm0 changed to UP.
[   26.831198] EtherCAT 0: 1 slave(s) responding on main device.
[   26.831202] EtherCAT 0: Slave states on main device: INIT.
[   26.831328] EtherCAT 0: Scanning bus.
[   26.863969] EtherCAT 0: Bus scanning completed in 32 ms.
[   26.863971] EtherCAT 0: Using slave 0 as DC reference clock.
[   26.871213] EtherCAT 0: Slave states on main device: PREOP.
[   30.106146] EtherCAT ERROR 0-0: SDO information error response while fetching SDO 0x0678!
[   30.106150] EtherCAT ERROR 0-0: SDO abort message 0x06010000: "Unsupported access to an object".
[  274.670316] EtherCAT: Requesting master 0...
[  274.670318] EtherCAT: Successfully requested master 0.
[  274.670443] EtherCAT 0: Domain0: Logical address 0x00000000, 24 byte, expected working counter 3.
[  274.670444] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 24 byte, type LRW.
[  274.670451] EtherCAT 0: Master thread exited.
[  274.670453] EtherCAT 0: Starting EtherCAT-OP thread.
[  274.670475] EtherCAT WARNING 0: 76 datagrams TIMED OUT!
[  274.771154] EtherCAT 0: Slave states on main device: OP.

~$ ethercat master
Master0
  Phase: Operation
  Active: yes
  Slaves: 1
  Ethernet devices:
    Main: b8:ae:ed:b7:47:18 (attached)
      Link: UP
      Tx frames:   156809
      Tx bytes:    12988464
      Rx frames:   156808
      Rx bytes:    12988380
      Tx errors:   0
      Tx frame rate [1/s]:   1000   1000    883
      Tx rate [KByte/s]:     83.5   83.5   73.4
      Rx frame rate [1/s]:   1000   1000    883
      Rx rate [KByte/s]:     83.5   83.5   73.4
    Common:
      Tx frames:   156809
      Tx bytes:    12988464
      Rx frames:   156808
      Rx bytes:    12988380
      Lost frames: 0
      Tx frame rate [1/s]:   1000   1000    883
      Tx rate [KByte/s]:     83.5   83.5   73.4
      Rx frame rate [1/s]:   1000   1000    883
      Rx rate [KByte/s]:     83.5   83.5   73.4
      Loss rate [1/s]:          0      0      0
      Frame loss [%]:         0.0    0.0    0.0
  Distributed clocks:
    Reference clock:   Slave 0
    DC reference time: 734870317937489000
    Application time:  734870438688243819
                       2023-04-15 10:40:38.688243819
tomasz@debian:~$ ethercat pdos
SM0: PhysAddr 0x1800, DefaultSize  384, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1a00, DefaultSize  384, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1000, DefaultSize   10, ControlRegister 0x24, Enable 1
  RxPDO 0x1601 ""
    PDO entry 0x607a:00, 32 bit, ""
    PDO entry 0x60ff:00, 32 bit, ""
    PDO entry 0x6040:00, 16 bit, ""
SM3: PhysAddr 0x1100, DefaultSize   10, ControlRegister 0x00, Enable 1
  TxPDO 0x1a01 ""
    PDO entry 0x6064:00, 32 bit, ""
    PDO entry 0x606c:00, 32 bit, ""
    PDO entry 0x6041:00, 16 bit, ""
tomasz@debian:~$ halcmd show pin lcec
Component Pins:
Owner   Type  Dir         Value  Name
    27  s32   OUT             0  lcec.0.0.actual-position ==> 0-drv-act-pos
    27  s32   OUT             0  lcec.0.0.actual-torque
    27  s32   OUT             0  lcec.0.0.actual-velocity ==> 0-drv-act-velo
    27  u32   IN     0x00000004  lcec.0.0.cia-controlword <== 0-controlword
    27  u32   OUT    0x00000000  lcec.0.0.cia-statusword ==> 0-statusword
    27  s32   IN              0  lcec.0.0.opmode <== 0-modes-of-operation
    27  s32   OUT             0  lcec.0.0.opmode-display ==> 0-opmode-display
    27  bit   OUT         FALSE  lcec.0.0.slave-online
    27  bit   OUT         FALSE  lcec.0.0.slave-oper
    27  bit   OUT         FALSE  lcec.0.0.slave-state-init
    27  bit   OUT         FALSE  lcec.0.0.slave-state-op
    27  bit   OUT         FALSE  lcec.0.0.slave-state-preop
    27  bit   OUT         FALSE  lcec.0.0.slave-state-safeop
    27  s32   IN              0  lcec.0.0.target-position <== 0-drv-target-pos
    27  s32   IN              0  lcec.0.0.target-velocity <== 0-drv-target-velo
    27  bit   OUT          TRUE  lcec.0.all-op
    27  bit   OUT          TRUE  lcec.0.link-up
    27  s32   OUT             0  lcec.0.read.time
    27  u32   OUT    0x00000001  lcec.0.slaves-responding
    27  bit   OUT         FALSE  lcec.0.state-init
    27  bit   OUT          TRUE  lcec.0.state-op
    27  bit   OUT         FALSE  lcec.0.state-preop
    27  bit   OUT         FALSE  lcec.0.state-safeop
    27  s32   OUT             0  lcec.0.write.time
    27  bit   OUT          TRUE  lcec.all-op
    24  u32   OUT    0x00000001  lcec.conf.master-count
    24  u32   OUT    0x00000001  lcec.conf.slave-count
    27  bit   OUT          TRUE  lcec.link-up
    27  s32   OUT          6356  lcec.read-all.time
    27  u32   OUT    0x00000001  lcec.slaves-responding
    27  bit   OUT         FALSE  lcec.state-init
    27  bit   OUT          TRUE  lcec.state-op
    27  bit   OUT         FALSE  lcec.state-preop
    27  bit   OUT         FALSE  lcec.state-safeop
    27  s32   OUT         13801  lcec.write-all.time

This EtherCAT drive works with other controls e.g. Beckhoff,
maybe I am doing something wrong ?

Regards,
Tom

ps. link to manual

www.dropbox.com/s/f0qcixoivto9b4o/SG-AS%...%20protocol.pdf?dl=0












 

Please Log in to join the conversation.

More
3 years 6 months ago #269133 by rodw
You have not set pid="0x00000001" in your xml file
Value is taken the from the ethercat slaves command

Try that and report back

Please Log in to join the conversation.

More
3 years 6 months ago #269144 by Stean
I tried different settings that's why I deleted it, but when I went back it`s same problem.

<slave idx="0" type="generic" vid="00000bf8" pid="0x00000001" configPdos="true">

LinuxCNC starting then on drive ERROR 40 "bus communication error", LinuxCNC not returns any error.

sudo dmesg
[  318.112664] EtherCAT: Requesting master 0...
[  318.112667] EtherCAT: Successfully requested master 0.
[  318.112806] EtherCAT 0: Domain0: Logical address 0x00000000, 24 byte, expected working counter 3.
[  318.112807] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 24 byte, type LRW.
[  318.112814] EtherCAT 0: Master thread exited.
[  318.112816] EtherCAT 0: Starting EtherCAT-OP thread.
[  318.112837] EtherCAT WARNING 0: 115 datagrams TIMED OUT!
[  319.185752] EtherCAT 0: Domain 0: Working counter changed to 3/3.
[  319.191077] EtherCAT 0: Slave states on main device: OP.

 

Please Log in to join the conversation.

More
3 years 6 months ago #269148 by Stean
maybe Debug will say more ...

Warning: Spoiler!

Please Log in to join the conversation.

More
3 years 6 months ago #269151 by Stean
I have noticed that when I reset the servodrive without shutting down LinuxCNC, then the drive becomes visible in the DRO and shows the actual position, the drive has no error and it`s in working order "bb".

Please Log in to join the conversation.

More
3 years 6 months ago #269152 by Stean
..  also when I switch machine power on, then drive switched to "run" and working in JOG mode !
The problem to be solved, why the error 40 occurs. m
Maybe someone had a similar problem (?)

Thank you RodW.

Please Log in to join the conversation.

More
3 years 6 months ago #269155 by Stean
... and you're right with an empty pid="" it doesn't work, that's why I lost a lot of time.
I observed that if I set Control Word to RESET (128) before starting LinuxCNC and before Power ON, then no error on drive.

thank you Rod

Please Log in to join the conversation.

More
2 years 6 months ago #298531 by pheanoukma
Hi man, I have the same error as yours, can u tell me on how u fix ur sg as drives from showing up the error 40 communication lost error and THESE abort msg

Please Log in to join the conversation.

More
2 years 3 months ago #305902 by ghl.bhrt@gmail.com
I have same issue, does anyone fixed it?
Thanks,
Bharat

Please Log in to join the conversation.

Time to create page: 0.125 seconds
Powered by Kunena Forum