Integration / EtherCAT

EtherCAT bus configuration and SOEM integration.

All TK actuators expose a CiA 402 profile over EtherCAT. This guide covers ESI file installation, bus scan with IgH, CoE object dictionary, and SOEM-based C++ example code.

CiA 402
Motion drive profile (DS402)
1 ms
EtherCAT cycle time (minimum)
IgH + SOEM
Both masters supported
Integration / EtherCAT

EtherCAT Setup

ESI File Installation

The TK EtherCAT Slave Information (ESI) file is included in the firmware package at $TKND_FIRMWARE_PKG/esi/Tendonkindle_TK_Series.xml. Copy it to your EtherCAT master's ESI directory:

sudo cp Tendonkindle_TK_Series.xml \
  /etc/ethercat/esi/

The ESI file covers all three TK models. Object dictionary entries differ by model — check Device.Name = TK-120 / TK-240 / TK-480 in the file.

Bus Scan with IgH

After connecting actuators in daisy-chain topology and applying 48 VDC:

ethercat slaves
# Output:
# 0  0:0  PREOP  +  Tendonkindle TK-120
# 1  0:1  PREOP  +  Tendonkindle TK-240
# 2  0:2  PREOP  +  Tendonkindle TK-480

Each slave comes up in PREOP state. Request SAFEOP and then OP:

ethercat states -a OP

CoE Object Dictionary (Key Entries)

IndexSubNameAccess
0x60400Control word (NMT)RW
0x60410Status wordRO
0x60600Modes of operationRW
0x60640Position actual valueRO
0x607A0Target positionRW
0x60FF0Target velocityRW
0x60710Target torqueRW
0x20010Node ID (Tendonkindle custom)RW
0x20100Impedance stiffness KpRW
0x20110Impedance damping KdRW

SOEM Example (C++)

#include <soem/ethercat.h>
#include <cstdio>

int main() {
  char iface[] = "eth0";
  if (ec_init(iface) > 0) {
    if (ec_config_init(FALSE) > 0) {
      ec_config_map(&IOmap);
      ec_configdc();
      ec_statecheck(0, EC_STATE_SAFE_OP, EC_TIMEOUTSTATE);
      ec_slave[0].state = EC_STATE_OPERATIONAL;
      ec_writestate(0);
      int8_t *mode = (int8_t*)ec_slave[1].outputs;
      *mode = 10; // cyclic sync torque mode
      ec_send_processdata();
      ec_receive_processdata(EC_TIMEOUTRET);
    }
    ec_close();
  }
  return 0;
}

Mode 8 = cyclic sync position; Mode 9 = cyclic sync velocity; Mode 10 = cyclic sync torque. Set via object 0x6060.

IgH EtherCAT Master Config

Add to /etc/ethercat.conf:

MASTER0_DEVICE="eth0"
MASTER0_BACKUP=""
DEVICE_MODULES="generic"

Then restart the master and verify slaves are detected:

sudo systemctl restart ethercat
ethercat slaves

Related guides

ROS 2 Integration CANopen Setup API Reference
Request Engineering Sample