YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
Loading...
Searching...
No Matches
YARP CiA-402 EtherCAT Device

Overview

This repository provides a YARP device plugin for EtherCAT CiA-402 drives, built on top of SOEM.

It exposes standard YARP motor-control interfaces (IPositionControl, IVelocityControl, ITorqueControl, ICurrentControl, IEncodersTimed, …) while communicating with drives that implement the CiA-402 (IEC 61800-7-201) profile over EtherCAT (CoE).

Key features

  • CiA-402 state machine — automatic power-stage transitions (Shutdown → SwitchedOn → OperationEnabled) with fault handling.
  • Multiple control modes — Profile Position (PP), Cyclic Synchronous Position (CSP), Cyclic Synchronous Velocity (CSV), and Cyclic Synchronous Torque (CST).
  • Dual-encoder support — configurable feedback selection between up to two encoders per axis, with automatic shaft transformations.
  • Simple PID tuning — optional joint-side PID gains automatically converted to drive units.
  • Home-position utility — standalone tool to set and persist homing parameters on the drive's non-volatile memory.
  • Calibration check utility — read-only diagnostic that compares live encoder readings against a reference TOML snapshot and produces a Markdown report.

Documentation sections

Page Description
EtherCAT protocol map (PDOs and SDOs) PDOs, SDOs, unit conversions — the single source of truth for all EtherCAT objects used by the driver.
Control modes and set‑point paths How YARP control modes map to CiA-402 operation modes and which targets are written.
Dual-encoder handling (CiA‑402 EtherCAT device) Encoder mounting semantics, feedback selection, and shaft transformations.
yarp::dev::CiA402MotionControl Main device driver API reference.
CiA402::EthercatManager Low-level EtherCAT master (SOEM wrapper).
CiA402::StoreHome37 Home-position persistence utility.
Check Encoder Calibration Encoder calibration check utility — compare live readings vs. reference TOML.
CiA402::CheckEncoderCalibration Calibration-check utility API reference.

Getting started

Prerequisites

  • CMake ≥ 3.8
  • YARP
  • SOEM
  • toml++ (TOML parser for C++)
  • Linux (tested; raw-socket access required for EtherCAT)

Build

git clone https://github.com/gbionics/yarp-device-ethercat-cia402.git
cd yarp-device-ethercat-cia402
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install

Quick run

# Ensure YARP can find the plugin
export YARP_DATA_DIRS=/path/to/install/share/yarp:$YARP_DATA_DIRS
# Grant raw-socket capabilities
sudo setcap cap_net_raw,cap_net_admin+ep $(which yarprobotinterface)
# Launch
yarprobotinterface --config config/robot/template_1_motor/config.xml

License

BSD-3-Clause — see LICENSE.