Ethercat drive configuration woes

More
3 days 3 hours ago #350537 by tuxcnc

So tried lcec.activate, but that results in an error that activate isn't a valid command.
 
Should be:
Code:
initf lcec.activate servo-thread

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

More
3 days 1 hour ago #350540 by mwc
To follow up with the lcec_configgen output, this is what it generated -

<slave idx="2" type="generic" vid="0x00000a79" pid="0x00001000" name="D3">
      <!--CL3-E57H-->
      <syncManager idx="0" dir="out">
        <pdo idx="1a01">
          <!--TxPDO 2-->
          <pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="u32"/>
          <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="2-statusword" halType="u32"/>
          <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="position-actual-value" halType="s32"/>
          <pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digital-inputs" halType="u32"/>
          <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="modes-of-operation-display" halType="s32"/>
        </pdo>
        <pdo idx="1601">
          <!--RxPDO 2-->
          <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="2-controlword" halType="u32"/>
          <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="modes-of-operation" halType="s32"/>
          <pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="2-target-position" halType="s32"/>
          <pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="u32"/>
          <pdoEntry idx="6099" subIdx="01" bitLen="32" halPin="search-switch" halType="u32"/>
          <pdoEntry idx="6099" subIdx="02" bitLen="32" halPin="search-zero" halType="u32"/>
        </pdo>
      </syncManager>
      <syncManager idx="1" dir="out"/>
      <syncManager idx="2" dir="out">
        <pdo idx="1600">
          <pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="out-controlword" halType="u32"/>
          <pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="mode-of-operation" halType="s32"/>
          <pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="out-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="in-statusword" halType="u32"/>
          <pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="mode-of-operation-display" halType="s32"/>
          <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="position-actual" halType="s32"/>
          <pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="velocity-actual" halType="s32"/>
          <pdoEntry idx="6077" subIdx="00" bitLen="16" halPin="torque-actual" halType="s32"/>
        </pdo>
      </syncManager>
    </slave>


Which without editting results in this error -

Debug file information:
Note: Using POSIX realtime
Failed to register PDO entry: No such file or directory
LCEC: master 0 syncUnit default PDO entry registration failed
LCEC: failure, clearing config
LCEC: exiting
LCEC: returning -EINVAL
lcec: rtapi_app_main: Invalid argument (-22)
./my_EtherCAT.hal:10: waitpid failed /usr/bin/rtapi_app lcec
./my_EtherCAT.hal:10: /usr/bin/rtapi_app exited without becoming ready
./my_EtherCAT.hal:10: insmod for lcec failed, returned -1
1740
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime


Is there any kind of documentation about syncmanagers anywhere that explains what is required/how they work?

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

More
3 days 1 hour ago #350541 by tommylight
Code:
lcec: rtapi_app_main: Invalid argument (-22)
Is there a
loadrt lcec
line in the hal file?
If yes, there is something not right in that line.
-
This is just an educated guess from the error as i have no experience with EtherCat.

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

More
3 days 37 minutes ago #350544 by mwc
Yes.

The only thing I changed to test that XML snippet, was to remove the Z-axis stuff from the hal file, then paste that snippet in to replace the existing Z slave (slave 2) information.
The names used in my handcoded XML vary from the lcec_configgen names, so I can't do a straightforward copy and paste, but just running the XML with no hal parameter linking is enough to establish if the XML is good.

Ultimately if the XML is good, the ethercat slaves should be configured, even if hal makes no use of them.

It seems to be an error with how the ethercat PDOs are defined, but I've so far not found any kind of definitive guide about syncmanagers/PDOs, and what is expected.

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

More
2 days 21 hours ago #350550 by rodw
Here you go
ethercat_conf.xml = my known good config for Lichuan 4 axis open loop drive. Yours should be the same, just one less axis
ethercat_gen.xml is the lcec_configgen generated file. nice and short. When you get your xml working, raise an issue at  github.com/linuxcnc-ethercat

Reference this earlier issue #474  github.com/linuxcnc-ethercat/linuxcnc-ethercat/issues/474

install just your Drive on the ethercat bus and share these files:
ethercat pdos > pdos.txt
ethercat sdos > sdos.txt
ethercat slaves -v > lichuan.txt

Hopefully grandixximo will add support for your drive too. I think it probbaly just needs a tweak to the driver to support < 4 axes

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

More
2 days 21 hours ago #350551 by rodw

So tried lcec.activate, but that results in an error that activate isn't a valid command.
 
Should be:
Code:
initf lcec.activate servo-thread
YOu need to have the latest ethercat driver installed together with ethercat from that repo not from iGh

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

Time to create page: 0.493 seconds
Powered by Kunena Forum