Problems with Lichuan Ethercat servo drive

More
20 Apr 2024 15:47 - 20 Apr 2024 16:12 #298736 by Sandro
Nice that you've got it working! And thank you for sharing your configuration.

I have now received my drive as well and tested with the config of yours. Unfortunately no luck so far. Here is what is reported back with "sudo dmesg -wH":

[Apr20 19:33] EtherCAT: Requesting master 0...
[  +0.000002] EtherCAT: Successfully requested master 0.
[  +0.000175] EtherCAT 0: Domain0: Logical address 0x00000000, 196 byte, expected working counter 1.
[  +0.000002] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 196 byte, type LWR.
[  +0.000006] EtherCAT 0: Master thread exited.
[  +0.000001] EtherCAT 0: Starting EtherCAT-OP thread.
[  +0.000021] EtherCAT WARNING 0: 1 datagram UNMATCHED!
[  +4.295428] EtherCAT ERROR 0-0: Timeout while setting state OP.
[  +0.007773] EtherCAT 0: Slave states on main device: SAFEOP.
[ +12.904002] EtherCAT 0: Slave states on main device: SAFEOP + ERROR.


ethercat slaves -v reports the following, so address should be correct:

=== Master 0, Slave 0 ===
Device: Main
State: PREOP
Flag: +
Identity:
  Vendor Id:       0x00000766
  Product code:    0x00000402
  Revision number: 0x00000204
  Serial number:   0x00000000
DL information:
  FMMU bit operation: no
  Distributed clocks: yes, 64 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             -   3652581971           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: 0x1000/128, TX: 0x1100/128
  Supported protocols: CoE
General:
  Group: EtherCAT Driver
  Image name:
  Order number:
  Device name: LC10E_V1.04
  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: no
  Current consumption: 0 mA

Sorry I don't know how to format code here.
Last edit: 20 Apr 2024 16:12 by Sandro.

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

More
22 Apr 2024 18:59 - 22 Apr 2024 19:00 #298857 by trisa25
Have you ran this command from the configuration folder?
sudo halcompile --install cia402.comp
Last edit: 22 Apr 2024 19:00 by trisa25.

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

More
22 Apr 2024 19:46 #298859 by Sandro
Yes I ran that command according to the ethercat installation guide. I have tried on both an Intel system and RPI5. If I set ethercat debug level to 1, I see a lot of unmatched datagram warnings. Since I have tested with your xml and cofig, I assume, the issue lies elswere.

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

More
22 Apr 2024 20:00 #298861 by trisa25
Can you try manually toggling slave states by:
ethercat state -p0 PREOP
Now the drive should show 40ry

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

More
23 Apr 2024 13:42 - 23 Apr 2024 13:45 #298908 by Sandro
Alright I can check on the weekend. If I remember correctly when starting LCNC the diplay went from 20ry (preop?) to 40ry (safeop?) to 4hry after about 10 sec (safeop + error). When exiting it went back to 20ry.

Did you have to do some special configuration on the driver end?
Last edit: 23 Apr 2024 13:45 by Sandro.

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

More
23 Apr 2024 13:58 - 23 Apr 2024 14:12 #298912 by drboeller
I have exact the same problem with this drive.

Tried:
ethercat state -p0 PREOP -> drive shows 20ry, 2 is flashing
ethercat state -p0 INIT -> drive shows 10ry
ethercat state -p0 SAFEOP -> drive shows 20ry, 2 is flashing
ethercat state -p0 OP -> drive shows 20ry, 2 is flashing

Linuxcnc startup:
20ry
Switch machine on
40ry
10s later
F0ry and log shows safeop+error

Log Shows:
  +3,998716] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[  +5,004000] EtherCAT ERROR 0-0: Timeout while setting state OP.
Last edit: 23 Apr 2024 14:12 by drboeller.

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

More
27 Apr 2024 14:05 - 27 Apr 2024 14:15 #299186 by Sandro
Yes this is exactly the behavior I ment to describe. I observed the dmesg while manually trying to switch the states:

ethercat state -p0 INIT


Display shows "_10ry", not flashing, and dmesg:

[Apr27 15:54] EtherCAT DEBUG 0-0: Changing state from PREOP to INIT.
[ +0.000003] EtherCAT DEBUG 0-0: Configuring...
[ +0.000874] EtherCAT DEBUG 0-0: Now in INIT.
[ +0.000001] EtherCAT DEBUG 0-0: Clearing FMMU configurations...
[ +0.000277] EtherCAT DEBUG 0-0: Clearing sync manager configurations...
[ +0.000277] EtherCAT DEBUG 0-0: Clearing DC assignment...
[ +0.000278] EtherCAT DEBUG 0-0: Finished configuration.
[ +0.010270] EtherCAT 0: Slave states on main device: INIT.


ethercat state -p0 SAFEOP


Display shows "_20ry", the two is flashing, and dmesg:

[Apr27 15:57] EtherCAT DEBUG 0-0: Changing state from INIT to SAFEOP.
[  +0.000008] EtherCAT DEBUG 0-0: Configuring...
[  +0.000692] EtherCAT DEBUG 0-0: Now in INIT.
[  +0.000003] EtherCAT DEBUG 0-0: Clearing FMMU configurations...
[  +0.000297] EtherCAT DEBUG 0-0: Clearing sync manager configurations...
[  +0.000305] EtherCAT DEBUG 0-0: Clearing DC assignment...
[  +0.000304] EtherCAT DEBUG 0-0: Configuring mailbox sync managers...
[  +0.000003] EtherCAT DEBUG 0-0: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1
[  +0.000007] EtherCAT DEBUG 0-0: SM1: Addr 0x1100, Size 128, Ctrl 0x22, En 1
[  +0.000294] EtherCAT DEBUG 0-0: Assigning SII access to PDI.
[  +0.001423] EtherCAT DEBUG 0-0: Now in PREOP.
[  +0.000003] EtherCAT DEBUG 0-0: Assigning SII access back to EtherCAT.
[  +0.000261] EtherCAT DEBUG 0-0: SM2: Addr 0x1200, Size   0, Ctrl 0x64, En 0
[  +0.000005] EtherCAT DEBUG 0-0: SM3: Addr 0x1300, Size   0, Ctrl 0x20, En 0
[  +0.000808] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[  +0.000311] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[  +0.000537] EtherCAT 0-0: Acknowledged state PREOP.
[  +0.006737] EtherCAT 0: Slave states on main device: PREOP.


ethercat state -p0 OP


Display shows "_20ry", the two is flashing, and dmesg:

[Apr27 16:00] EtherCAT DEBUG 0-0: Changing state from PREOP to OP.
[  +0.000002] EtherCAT DEBUG 0-0: Configuring...
[  +0.000881] EtherCAT DEBUG 0-0: Now in INIT.
[  +0.000000] EtherCAT DEBUG 0-0: Clearing FMMU configurations...
[  +0.000277] EtherCAT DEBUG 0-0: Clearing sync manager configurations...
[  +0.000278] EtherCAT DEBUG 0-0: Clearing DC assignment...
[  +0.000279] EtherCAT DEBUG 0-0: Configuring mailbox sync managers...
[  +0.000001] EtherCAT DEBUG 0-0: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1
[  +0.000001] EtherCAT DEBUG 0-0: SM1: Addr 0x1100, Size 128, Ctrl 0x22, En 1
[  +0.000274] EtherCAT DEBUG 0-0: Assigning SII access to PDI.
[  +0.000802] EtherCAT DEBUG 0-0: Now in PREOP.
[  +0.000001] EtherCAT DEBUG 0-0: Assigning SII access back to EtherCAT.
[  +0.000272] EtherCAT DEBUG 0-0: SM2: Addr 0x1200, Size   0, Ctrl 0x64, En 0
[  +0.000001] EtherCAT DEBUG 0-0: SM3: Addr 0x1300, Size   0, Ctrl 0x20, En 0
[  +0.000838] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[  +0.000274] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[  +0.000835] EtherCAT 0-0: Acknowledged state PREOP.


Startup of LCNC:

Display shows "_F0ry", not flashing, and dmesg:
.
.
.
[  +0.001993] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[  +0.000001] EtherCAT DEBUG 0-0:    ref_time=767542016736603000
[  +0.000001] EtherCAT DEBUG 0-0:    app_time=767542021916008181
[  +0.000001] EtherCAT DEBUG 0-0:  start_time=767542022016008181
[  +0.000001] EtherCAT DEBUG 0-0:       cycle=1000000
[  +0.000001] EtherCAT DEBUG 0-0:  shift_time=0
[  +0.000001] EtherCAT DEBUG 0-0:   remainder=405181
[  +0.000001] EtherCAT DEBUG 0-0:        start=767542022016603000
[  +0.000000] EtherCAT DEBUG 0-0: Setting DC cyclic operation start time to 767542022016603000.
[  +0.001992] EtherCAT DEBUG 0-0: Setting DC AssignActivate to 0x0300.
[  +0.004009] EtherCAT DEBUG 0-0: Now in SAFEOP.
[  +5.001992] EtherCAT ERROR 0-0: Timeout while setting state OP.
[  +0.007631] EtherCAT 0: Slave states on main device: SAFEOP.
[ +12.904001] EtherCAT 0: Slave states on main device: SAFEOP + ERROR.
[  +0.007998] EtherCAT DEBUG 0-0: SAFEOP -> SAFEOP + ERROR.


I find this interesting when manually switching states:

[  +0.000274] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
Last edit: 27 Apr 2024 14:15 by Sandro.

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

More
28 Apr 2024 17:06 - 29 Apr 2024 07:13 #299261 by Sandro
I managed to get the drive to OP state when starting LCNC, but only when I uncomment all PDO adresses in the xml.
Last edit: 29 Apr 2024 07:13 by Sandro.

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

More
30 Apr 2024 13:37 #299395 by drboeller
I tried to run the servo with twincat and the esi config file. This worked. Then i tried to remap the pdo´s in twincat so that they match with the ethercat-config.xml. Still the same issue.

Then i deleted the PDO mapping with command:
ethercat -p0 --type uint8 download 0x1600 0 0
ethercat -p0 --type uint8 download 0x1a00 0 0

Now im able to get the servo in OP mode using:
ethercat states OP

After starting linuxcnc, the pdos are remapped and the same error (previus post) occurs.

Really dont know what to do now, that doesnt make sense to me, espacially that it doesnt work when i set the pdos with twincat.

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

More
01 May 2024 21:42 #299511 by scottlaird
If you look at the PDO output from post #1, it looks like it's using somewhat unusual PDO addresses -- 0x1b01 and 0x1701, while the XML file going around uses 0x1600 and 0x1a00. PDO mapping and addresses seems to vary a *lot* between various CiA 402 Ethercat devices that I've seen. Examples:

- RTelligent ECT60. Supports 3x RX and TX PDOs with 12 entries each, at 0x1600, 0x1601, and 0x1602.
- RTelligent ECT60X2. Supports 2x RX and TX PDOs with 12 entries each, at 0x1600 and 0x1610. 0x1601 returns an error. 0x1620 returns an error.
- Leadshine 2CS3E-D507. Supports 3x RX and TX PDOs with 8 entries each at 0x1600, 0x1601, etc. Setting 0x1600:09 returns an error.
- Omron MX2. Supports 512x (!) RX and TX PDOs with 2 (!) entries each, at 0x1600-0x17ff. Setting 0x1600:03 returns an error.

I suspect there are some devices that will let you use anything in that general range for PDOs, and just follow whatever you put into the sync manager config. Others are *extremely* limited. Even better, a lot of this depends on the exact firmware involved, and the firmware doesn't always match the documentation. For example, RTelligent's ESI claims that the ECT60X2 has the same config as the ECT60, but mine *really* doesn't.

Deleting the PDO config mostly just means that there's no way to tell the device what to do; that's the important part of the config :-).

To start with, what does `ethercat pdos` show *after power-cycling but before running LinuxCNC*? And what does your XML file look like?

I just broke down and ordered a cheap Lichuan LC10E, so hopefully there will be a driver for it by late May, but that depends on shipping and my work schedule.
The following user(s) said Thank You: rodw, Sandro, cncLab

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

Time to create page: 0.220 seconds
Powered by Kunena Forum