Adding digital inpouts to Rtelligent ECT60 cia402

More
20 Apr 2024 13:35 #298727 by kate
I have working setup of Rtelligent ECT60  cia402 compatible closed loop stepper controllers. All basic stuff is working with LinuxCNC/Axis but now I would like to use digital inputs from controller. I have an issue, i can't read input bits in HAL side, with they read allways FALSE even i can see bits toggling with ethercat command. I assume that I miss some configuration somewhere. 

Manual of ECT60 www.rtelligent.net/upload/wenjian/Steppe...%20User%20Manual.pdf

Inputs are under 0x60FD and I can read them with:
ethercat upload -p 0 -t uint32 0x60fd 0

Then I have added lines to to ethercat-conf.xml
<syncManager idx="3" dir="in">
  <pdo idx="1a00">
    <pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="cia-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="606C" subIdx="00" bitLen="32" halPin="actual-velocity" halType="s32"/>
    <pdoEntry idx="6077" subIdx="00" bitLen="32" halPin="actual-torque" halType="s32"/>
    <pdoEntry idx="60FD" subIdx="16" bitLen="1" halPin="input1" halType="bit"/>
    <pdoEntry idx="60FD" subIdx="17" bitLen="1" halPin="input2" halType="bit"/>
    <pdoEntry idx="60FD" subIdx="18" bitLen="1" halPin="input3" halType="bit"/>
    <pdoEntry idx="60FD" subIdx="19" bitLen="1" halPin="input4" halType="bit"/>
    <pdoEntry idx="60FD" subIdx="20" bitLen="1" halPin="input5" halType="bit"/>
    <pdoEntry idx="60FD" subIdx="21" bitLen="1" halPin="input6" halType="bit"/>
  </pdo>
</syncManager>

I can see pins under lcec.0.0.input1 and so far but thet always reads as FALSE in halmeter

I can also see same pdo values under  ethercat pdos -p 0SM3: PhysAddr 0x1400, DefaultSize    0, ControlRegister 0x20, Enable 1
 TxPDO 0x1a00 "TXPDO 1 Mapping Parameter "
   PDO entry 0x60fd:16,  1 bit, ""
   PDO entry 0x60fd:17,  1 bit, ""
   PDO entry 0x60fd:18,  1 bit, ""

 

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

More
20 Apr 2024 18:53 #298744 by scottlaird
I haven't tested the digital ins or outs enough yet, but there's actually an ECT60 driver in the latest version of the linuxcnc-ethercat package.

You can *probably* just use this in your XML:
<slave idx="1" type="ECT60" name="D1"/>

One thing with the RTelligent EtherCAT stepper drives is that their inputs and outputs *mostly* have pre-defined uses, and you'll probably need to disable that to use them directly with LinuxCNC.

You can probably get a useful config example by just running `lcec_configgen` after updating to v1.29 or higher. It'll just print out a sample config and won't overwrite anything. Here's what I see for my ECT60 when I do that:
    <slave idx="7" type="ECT60" name="D29">
      <!-- Enable support for Cyclic Synchronous Position mode. -->
      <modParam name="enableCSP" value="true"/>

      <!-- Enable support for Cyclic Synchronous Velocity mode. -->
      <modParam name="enableCSV" value="false"/>

      <!-- Maximum stepper Amps. -->
      <modParam name="peakCurrent_amps" value="6.0"/>

      <!-- Operation mode: openloop, closedloop, or foc. -->
      <modParam name="controlMode" value="closedloop"/>

      <!-- Number of encoder steps per revolution. -->
      <modParam name="encoderResolution" value="4000"/>

      <!-- Output 1 use: general, alarm, brake, in-place. -->
      <modParam name="output1Func" value="alarm"/>

      <!-- Output 2 use: general, alarm, brake, in-place. -->
      <modParam name="output2Func" value="brake"/>

      <!-- Input 3 use: general, cw-limit, ccw-limit, home, clear-fault, emergency-stop, motor-offline, probe1, probe2 -->
      <modParam name="input3Func" value="cw-limit"/>

      <!-- Input 4 use: general, cw-limit, ccw-limit, home, clear-fault, emergency-stop, motor-offline, probe1, probe2 -->
      <modParam name="input4Func" value="ccw-limit"/>

      <!-- Input 5 use: general, cw-limit, ccw-limit, home, clear-fault, emergency-stop, motor-offline, probe1, probe2 -->
      <modParam name="input5Func" value="home"/>

      <!-- Input 6 use: general, cw-limit, ccw-limit, home, clear-fault, emergency-stop, motor-offline, probe1, probe2 -->
      <modParam name="input6Func" value="motor-offline"/>

    </slave>

Let me know if you run into any problems, this is still under active development.

Alternately, if you want the `generic` config to work, you'll need (at a minimum) to wrap the individual inputs in a complex block if you want to break out individual bits of a single PDO entry into their own HAL pins. See some of the examples in the source tree (which, admittedly, need a lot of attention). Something like this example:
      <syncManager idx="2" dir="out">
        <pdo idx="0018">
          <pdoEntry idx="0086" subIdx="00" bitLen="16" halType="complex">
            <complexEntry bitLen="6"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.realtime-0" halType="bit"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.realtime-1" halType="bit"/>
            <complexEntry bitLen="2" halPin="srv0-ctrl.opmode-low" halType="u32"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.sync" halType="u32"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.opmode-high" halType="bit"/>
            <complexEntry bitLen="1"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.restart" halType="bit"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.enable" halType="bit"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.drv-on" halType="bit"/>
          </pdoEntry>
          <pdoEntry idx="0018" subIdx="00" bitLen="32" halPin="srv0-vel-cmd" halType="s32"/>
        </pdo>

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

Time to create page: 0.365 seconds
Powered by Kunena Forum