How kubabuda/ecat_servo works
Project type and purpose
• This is an embedded‐focused, open‐source servo‐drive device implementation for the EtherCAT CoE CiA402 standard, targeting STM32 (F1/F4) and Arduino platforms.
• The core is the “cia402device” library, which implements the CiA402 state machine and PDO interfaces. The rest of the repo contains documentation and multiple PlatformIO example projects (SOES‐based, EasyCAT‐based, Arduino) showing how to hook the core into different EtherCAT slave stacks and hardware.
File structure
– Root: LICENSE, README.md, high‐level docs/ and examples/ folders.
– cia402device/
• / – public headers for the CiA402 API
• lib/cia402device – the implementation (cia402device.c/h)
• src/main.c – a minimal demo/main stub
• test/ – unit tests of the core library
• platformio.ini – build config for the core device library
– docs/ – markdown and generated HTML docs explaining hardware boards, software tools, design decisions
– examples/ – sub-folders, each a complete PlatformIO project that layers:
• / – app headers
• lib/ – BSP (STM32 or Arduino HAL), EtherCAT slave stack (SOES or EasyCAT), plus cia402device pulled in
• src/ – application entry (main.c/.cpp + control‐loop integration)
• test/ – any example‐specific tests
• platformio.ini – build & upload instructions
README for additional insights
• The README clarifies that EtherCAT frames come in over SPI from either a LAN9252 or AX58100 ESC chip, processed by a slave stack (SOES or EasyCAT), then fed into the CiA402 state machine in the core library.
• Example projects show how to wire up: ESC chip → STM32 HAL/BSP → SOES/EasyCAT → cia402device → your motion control logic.