# IgH EtherCAT 主站

**IgH EtherCAT 主站（IgH EtherCAT Master）**是面向 Linux 的开源 EtherCAT 主站实现，以 C 语言编写，设计为适用于 Linux 2.6 或更新版本的内核模块。它由德国（Germany）埃森（Essen）的 IgH 工程共同体（Ingenieurgemeinschaft IgH）的弗洛里安·波泽（Florian Pose）创建，作为 EtherLab 工具包的一部分发布；源代码现在位于 gitlab.com/etherlab.org/ethercat。<sup>[1](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)</sup><sup> • </sup><sup>[2](https://etherlab.org/en_GB/ethercat)</sup><sup> • </sup><sup>[3](https://github.com/Kinovarobotics/igh_ethercat_master/blob/release/1.6.9-kinova/README.md)</sup> EtherCAT 主站是 EtherCAT 工业以太网网络中的控制节点：它配置从站，并与从站循环交换过程数据。IgH 主站是与 rt-labs 维护的简单开放 EtherCAT 主站（Simple Open EtherCAT Master，SOEM）并列的两大广泛使用的开源 EtherCAT 主站协议栈之一。<sup>[4](https://www.acontis.com/zh/acontis-ec-master-vs-open-source.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 面向 Linux 的开源 EtherCAT 主站，以内核模块实现，并配有用户空间库和命令行工具<sup>[1](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)</sup> |
| 开发者 | 弗洛里安·波泽，IgH 工程共同体，埃森；EtherLab 项目的一部分<sup>[1](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)</sup> |
| 许可证 | 主站代码采用 GPL 第 2 版；用户空间库采用 LGPL 第 2.1 版，以允许静态链接<sup>[5](https://etherlab.org/download/ethercat/ethercat-1.5.2.pdf)</sup> |
| 协议 | CoE、EoE、FoE、SoE 和 VoE 邮箱协议；分布式时钟；线缆冗余<sup>[6](https://www.ethercat.org/en/products/263FCDB7639F4DDFB3587C18F46BA289.htm)</sup> |
| 当前版本 | 1.6.13（2026 年 9 月），位于 stable-1.6 分支；1.5.4 分支也在维护<sup>[7](https://gitlab.com/etherlab.org/ethercat/-/tags)</sup> |
| 实时支持 | RTAI、Xenomai（包括 RTDM）、RT-Preempt 和 ADEOS；支持实时补丁，但并非必需<sup>[3](https://github.com/Kinovarobotics/igh_ethercat_master/blob/release/1.6.9-kinova/README.md)</sup> |
| 实测抖动 | 在 Ubuntu 22.04 搭配 Xenomai 3.3 上，数据包时序标准差为空闲时 178 ns、压力下 396 ns，略优于同一测试中 SOEM 的 202 ns 和 499 ns<sup>[8](https://www.kci.go.kr/kciportal/ci/sereArticleSearch/ciSereArtiView.kci?sereArticleSearchBean.artiId=ART003251855)</sup> |

## 架构

该主站被集成进 [Linux 内核](https://www.edgepedia.org/zh/linux-kernel)，这一早期设计决策有两个明确给出的原因。内核代码比用户空间代码具有更好的实时特性，因为由定时器中断触发的周期性工作避免了耗时的上下文切换；而且主站必须通过网络设备驱动直接与以太网硬件通信，而这些驱动本来就在内核中。<sup>[1](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)</sup>

该环境由三部分组成。主站模块是一个内核模块，可以包含多个主站实例，每个实例在模块加载时绑定到一个或多个由 [MAC 地址](https://www.edgepedia.org/zh/mac-address)标识的以太网设备。设备模块是支持 EtherCAT 的以太网驱动模块，它们通过设备接口将各自的网卡提供给主站；被主站拒绝的驱动会交还内核的常规网络栈。应用程序是用户编写的程序，它通过应用接口请求主站，然后提供总线配置并交换过程数据。应用程序可以是直接使用该接口的内核模块，也可以是使用 EtherCAT 库或面向实时环境的 RTDM 库的用户空间程序。<sup>[1](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)</sup>

每个主站都经历三个阶段：等待其以太网设备的孤立阶段（orphaned phase）；其状态机自动扫描总线并处理 SDO 访问等尚待处理的操作的空闲阶段（idle phase）；以及应用程序请求主站并激活总线后的运行阶段（operation phase）。<sup>[1](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)</sup>

## 过程数据与应用接口

从站以过程数据对象（Process Data Objects，PDO）的形式提供输入和输出。应用程序注册 PDO 条目以进行循环交换，已注册条目的总和构成过程数据映像，通过逻辑内存访问的数据报进行交换。该映像通过域（domain）管理；域对 PDO 交换进行分组，且是必需的：至少必须存在一个域。域之所以存在，部分原因在于单个 EtherCAT 数据报受[以太网帧](https://www.edgepedia.org/zh/ethernet-frame)大小限制，最多为 1500 − 2 − 12 − 2 = 1484 字节的过程数据，因此更大的映像必须拆分到多个帧中，而域会自动处理这种拆分。域还允许不同的 PDO 组以不同速率交换，这样温度等缓慢变化的值就不会浪费总线带宽。<sup>[5](https://etherlab.org/download/ethercat/ethercat-1.5.2.pdf)</sup>

应用接口定义在头文件 ecrt.h 中，提供请求和释放主站、创建域、配置从站（包括 PDO 和 SDO）以及激活总线的函数。在调用 ecrt_master_activate() 之后，应用程序接管通信，并且必须循环调用 ecrt_master_send() 和 ecrt_master_receive()。大多数配置函数可能阻塞，必须运行在 Linux 进程上下文中；只有一小组标记为 rt_safe 的函数（它们不分配内存也不阻塞）可以从 [Xenomai](https://www.edgepedia.org/zh/xenomai) 或 [RTAI](https://www.edgepedia.org/zh/rtai) 任务等实时上下文中调用。<sup>[9](https://docs.etherlab.org/ethercat/1.6/doxygen/apiusage.html)</sup>

## 协议与功能覆盖

该主站实现了主要的 EtherCAT 邮箱协议：EtherCAT 上的 [CANopen](https://www.edgepedia.org/zh/canopen)（CoE），支持 SDO 上传、下载和字典列举；EtherCAT 上的以太网（EoE），为支持 EoE 的从站提供虚拟网络接口；EtherCAT 上的厂商特定协议（VoE）；EtherCAT 上的文件访问（FoE），用于加载和存储文件；以及 EtherCAT 上的伺服行规（SoE），支持 IDN 访问。<sup>[6](https://www.ethercat.org/en/products/263FCDB7639F4DDFB3587C18F46BA289.htm)</sup><sup> • </sup><sup>[5](https://etherlab.org/download/ethercat/ethercat-1.5.2.pdf)</sup> 支持分布式时钟，可自动配置 DC 从站，并以参考时钟为基准对从站时钟进行偏移与漂移补偿。<sup>[10](https://ethercatcpp.lirmm.net/ethercatcpp-framework/pages/available_ethercat_lib.html)</sup>

**冗余与诊断。** 冗余总线运行会在每条主站链路上发送过程数据报，因此只要每个从站仍在至少一条链路上可达，单根线缆断裂就不会中断交换；使用两个以太网设备无法处理双重故障。虚拟只读网络接口允许使用 [Wireshark](https://www.edgepedia.org/zh/wireshark) 等工具监控流量，而无需额外硬件；命令行工具 ethercat 为诊断提供完整的总线访问，包括从站列表、SDO 访问、寄存器和 SII（EEPROM）访问，以及应用层状态控制。<sup>[5](https://etherlab.org/download/ethercat/ethercat-1.5.2.pdf)</sup><sup> • </sup><sup>[6](https://www.ethercat.org/en/products/263FCDB7639F4DDFB3587C18F46BA289.htm)</sup>

**设备驱动。** 针对广泛使用的以太网控制器（如 8139too、e100、e1000、e1000e、igb、igc 和 r8169）提供了原生 EtherCAT 驱动，其可用性取决于内核版本；通用驱动和 ccat 驱动则独立于内核版本工作。通用驱动在任何网络接口上使用原始套接字，代价是性能有所损失；原生驱动则面向实时用途以无中断方式运行。<sup>[11](https://docs.etherlab.org/ethercat/1.6/doxygen/devicedrivers.html)</sup><sup> • </sup><sup>[6](https://www.ethercat.org/en/products/263FCDB7639F4DDFB3587C18F46BA289.htm)</sup>

**仿真。** 第二个用户空间库 libfakeethercat 暴露一组有限的用户空间 API，使应用程序可以在没有主站或使用仿真 EtherCAT 从站的情况下运行，适用于空跑测试。<sup>[3](https://github.com/Kinovarobotics/igh_ethercat_master/blob/release/1.6.9-kinova/README.md)</sup>

## 版本与发布策略

1.6.0 版于 2024 年 6 月公布。它新增了 API 方法，将原生以太网驱动的支持范围更新至内核 6.1，取消了对 3.0 之前内核的支持，并使 stable-1.6 成为默认分支，原 master 分支更名为 devel。从 1.6 版起，项目采用语义化版本控制。<sup>[12](https://lists.etherlab.org/pipermail/etherlab-announce/2024-June/000034.html)</sup> 此后，1.6 系列通过定期的小版本发布推进到 1.6.13，于 2026 年 9 月打标签；较旧的 1.5.4 分支也在 2026 年 7 月获得维护标签。<sup>[7](https://gitlab.com/etherlab.org/ethercat/-/tags)</sup> 1.6.1 版引入了用于空跑运行的仿真库，1.6.0 版则在应用接口中新增了 EoE 配置方法和总线扫描进度 API。<sup>[7](https://gitlab.com/etherlab.org/ethercat/-/tags)</sup><sup> • </sup><sup>[13](https://docs.etherlab.org/ethercat/1.6/doxygen/group__ApplicationInterface.html)</sup>

## 与 SOEM 的比较

这两个开源协议栈的主要区别在于运行位置。[SOEM](https://www.edgepedia.org/zh/soem) 是一个用户空间 C 库，因此可移植到 Linux 系统以及 QNX 等其他符合 POSIX 的实时操作系统，并可与任何支持原始套接字的网络接口配合使用；不过，它的实时性能取决于 RTnet 等实时网络驱动。IgH 主站以 Linux 内核模块实现，包含针对几种常见以太网芯片的原生驱动，以及针对 Linux 内核所支持芯片的通用驱动，这限制了它在硬件不同的机器之间的可移植性。<sup>[14](https://upcommons.upc.edu/server/api/core/bitstreams/cdacea6f-fe14-414d-b479-068ff6a7d5d8/content)</sup><sup> • </sup><sup>[8](https://www.kci.go.kr/kciportal/ci/sereArticleSearch/ciSereArtiView.kci?sereArticleSearchBean.artiId=ART003251855)</sup><sup> • </sup><sup>[22](https://docs.etherlab.org/ethercat/1.6/pdf/ethercat_doc.pdf)</sup>

韩国技术教育大学（Korea University of Technology and Education）的姜成镇（Sungjin Kang）在 2025 年的一项研究中，将两个协议栈部署在 Ubuntu 22.04 与 Xenomai 3.3 实时框架上，并在空闲和压力条件下进行测量。两者都实现了稳定的 1 kHz 周期性控制，平均延迟为亚微秒级，约 0.9 μs；空闲时最大抖动低于 3.6 μs，压力下升至 14 至 15 μs。在数据包层面，SOEM 的时序标准差为空闲时约 202 ns、压力下 499 ns，而 EtherLab 测得 178 ns 和 396 ns，在所有测试条件下都略优。<sup>[8](https://www.kci.go.kr/kciportal/ci/sereArticleSearch/ciSereArtiView.kci?sereArticleSearchBean.artiId=ART003251855)</sup> 实践者指南也反映了同样的取舍：当开发者能够控制机器、内核与构建过程，并且需要 FoE 固件传输、EoE 或线缆冗余等功能时，推荐使用 IgH EtherLab；SOEM 适合较小的 C 项目，而 Rust 协议栈 ethercrab 适合交叉编译部署。<sup>[15](https://www.mutexer.com/blog/ethercat-open-source-libraries)</sup>

## 在机器人技术与研究中的应用

该主站是 Linux 上机器人控制的常见基础。斯特拉斯堡大学（University of Strasbourg）ICube 实验室（ICube Laboratory）的 ethercat_driver_ros2 项目在 IgH 主站之上实现了 ros2_control 硬件接口，将每个 EtherCAT 主站定义为一个带有主站 ID 和控制频率的硬件接口，并将从站模块定义为插件。<sup>[16](https://github.com/ICube-Robotics/ethercat_driver_ros2)</sup><sup> • </sup><sup>[17](https://github.com/ICube-Robotics/ethercat_driver_ros2/blob/jazzy/ethercat_driver_ros2/sphinx/quickstart/configuration.rst)</sup> 其他项目使用 Motorcortex 库将其封装用于 ROS；一个七自由度机械臂控制栈通过自定义的 IgH 硬件接口运行 1000 Hz 的 EtherCAT 通信循环。<sup>[18](https://github.com/synapticon/ros_ethercat_igh)</sup><sup> • </sup><sup>[19](https://github.com/xiaobailong866/erob-ros2-control)</sup> 在研究中，一个运行在实时抢占式 Linux 上的开源 EtherCAT 主站已被用于脊柱外科手术机器人的多轴控制器，并在首台原型上评估了周期性、抖动和执行时间。<sup>[20](https://arxiv.org/abs/2401.08583)</sup> 一项在 ARM 和 x86 平台上、Xenomai 下研究该主站的工作，还评估了它从用户空间进行硬实时多轴伺服控制时的执行时间。<sup>[21](https://pure.seoultech.ac.kr/en/publications/comparative-analysis-of-a-user-space-ethercat-master-application-/)</sup>

## References

1. [IgH EtherCAT Master 1.5 Documentation, Architecture (Florian Pose, Ingenieurgemeinschaft IgH)](https://docs.etherlab.org/ethercat/1.5/pdf/ethercat_doc.pdf)
2. [EtherCAT-Master, EtherLab project page](https://etherlab.org/en_GB/ethercat)
3. [IgH EtherCAT Master README (Kinova Robotics mirror, release 1.6.9)](https://github.com/Kinovarobotics/igh_ethercat_master/blob/release/1.6.9-kinova/README.md)
4. [acontis EC-Master vs Open Source (IgH EtherCAT-Master and SOEM), acontis technologies](https://www.acontis.com/zh/acontis-ec-master-vs-open-source.html)
5. [IgH EtherCAT Master 1.5.2 Documentation, features and license](https://etherlab.org/download/ethercat/ethercat-1.5.2.pdf)
6. [EtherCAT Master for Linux as part of EtherLab, EtherCAT Technology Group product page](https://www.ethercat.org/en/products/263FCDB7639F4DDFB3587C18F46BA289.htm)
7. [Tags, EtherLab / EtherCAT Master, GitLab](https://gitlab.com/etherlab.org/ethercat/-/tags)
8. [Sungjin Kang (2025). Performance Comparison of Open-Source Based Real-Time EtherCAT Masters. Journal of the Semiconductor & Display Technology 24(3), 121–126.](https://www.kci.go.kr/kciportal/ci/sereArticleSearch/ciSereArtiView.kci?sereArticleSearchBean.artiId=ART003251855)
9. [IgH EtherCAT Master: Notes regarding API Usage, Doxygen documentation 1.6](https://docs.etherlab.org/ethercat/1.6/doxygen/apiusage.html)
10. [Description of available EtherCAT libraries, EtherCtP++ framework, LIRMM](https://ethercatcpp.lirmm.net/ethercatcpp-framework/pages/available_ethercat_lib.html)
11. [IgH EtherCAT Master: Device Drivers, Doxygen documentation 1.6](https://docs.etherlab.org/ethercat/1.6/doxygen/devicedrivers.html)
12. [EtherCAT master 1.6.0 release announcement, etherlab-announce mailing list, June 2024](https://lists.etherlab.org/pipermail/etherlab-announce/2024-June/000034.html)
13. [IgH EtherCAT Master: EtherCAT Application Interface, Doxygen documentation 1.6](https://docs.etherlab.org/ethercat/1.6/doxygen/group__ApplicationInterface.html)
14. [Control de movimiento de un robot móvil omnidireccional, Universitat Politècnica de Catalunya thesis](https://upcommons.upc.edu/server/api/core/bitstreams/cdacea6f-fe14-414d-b479-068ff6a7d5d8/content)
15. [The best open source EtherCAT libraries, and what to use when, mutexer Blog](https://www.mutexer.com/blog/ethercat-open-source-libraries)
16. [ethercat_driver_ros2: Hardware Interface for EtherCAT module integration with ros2_control, ICube-Robotics](https://github.com/ICube-Robotics/ethercat_driver_ros2)
17. [ethercat_driver_ros2 configuration documentation, ICube-Robotics](https://github.com/ICube-Robotics/ethercat_driver_ros2/blob/jazzy/ethercat_driver_ros2/sphinx/quickstart/configuration.rst)
18. [ros_ethercat_igh: EtherCAT ROS support based on IgH Master and Motorcortex, Synapticon](https://github.com/synapticon/ros_ethercat_igh)
19. [erob-ros2-control: ROS 2 + MoveIt 2 + ros2_control + IgH EtherCAT control stack for a 7-DOF robotic arm](https://github.com/xiaobailong866/erob-ros2-control)
20. [Veysi Adin, Chunwoo Kim (2023). Development of Control Framework for Spine Surgery Robot Using EtherCAT. arXiv:2401.08583.](https://arxiv.org/abs/2401.08583)
21. [Raimarius Delgado, Byoung Wook Choi (2017). Comparative analysis of a user space EtherCAT master application for hard real-time control. International Journal of Applied Engineering Research 12(8), 1675–1682.](https://pure.seoultech.ac.kr/en/publications/comparative-analysis-of-a-user-space-ethercat-master-application-/)
22. [docs.etherlab.org](https://docs.etherlab.org/ethercat/1.6/pdf/ethercat_doc.pdf)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › 机器人软件、人工智能与方法 › 机器人中间件、框架与行为架构

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/igh-ethercat-master

English original: https://www.edgepedia.org/igh-ethercat-master
