EtherCAT Communication Guide for APR System
Version: APR-2026.01 | TwinCAT: 3.1 Build 4024.65
PDO/SDO mapping and CiA-402 protocol reference for HIWIN E1 drives.
Overview
This skill covers EtherCAT communication architecture for the APR dual-axis linear motor system, including process data exchange (PDO), service data access (SDO), and the CiA-402 drive profile standard.
Communication Architecture
┌─────────────────────────────────────────────────────────────────┐ │ Communication Layers │ ├─────────────────────────────────────────────────────────────────┤ │ ┌──────────────┐ │ │ │ TwinCAT │ │ │ │ PLC/NC │ │ │ └──────┬───────┘ │ │ │ │ │ ▼ │ │ ┌──────────────┐ Cyclic (Real-time) │ │ │ PDO │◄──────────────────────► Process Data │ │ │ (Fast I/O) │ Every cycle (1ms) │ │ └──────────────┘ │ │ │ │ ┌──────────────┐ Acyclic (Mailbox) │ │ │ SDO │◄──────────────────────► Parameter Access │ │ │ (Parameters) │ On-demand │ │ └──────────────┘ │ │ │ │ ┌──────────────┐ │ │ │ CiA-402 │ Profile Standard │ │ │ Profile │ Motion Control Objects │ │ └──────────────┘ │ └─────────────────────────────────────────────────────────────────┘
PDO vs SDO
| Feature | PDO | SDO |
|---|---|---|
| Full Name | Process Data Object | Service Data Object |
| Purpose | Real-time control/feedback | Parameter configuration |
| Timing | Every EtherCAT cycle | On-demand (async) |
| Speed | Fast (μs level) | Slow (ms level) |
| Use Case | Position, velocity, status | Setup, diagnostics |
PDO (Process Data Object) - Big Picture
PDO is the "real-time data packet" exchanged every EtherCAT cycle (e.g., 1ms)
- •Think of EtherCAT as having a "delivery truck" every 1ms
- •PDO is what you load into that truck: control word, target position, actual position, status...
- •Fast, fixed length, exchanged every cycle
SDO (Service Data Object) - Big Picture
SDO is like a "settings/parameter" service channel
- •Used to change: max velocity, acceleration limits, following error threshold, PDO mapping...
- •Slow, not every cycle, typically used at startup/tuning/maintenance
- •For example, locking Drive's Max profile velocity is often done via SDO once
CSP vs CSV Mode Selection
For APR system (4.2m travel, 9.7 m/s max, ≥1m constant velocity zone):
CSP (Cyclic Synchronous Position) is recommended because:
- •Precise distance control for constant velocity zone
- •Better multi-axis synchronization
- •Easier trajectory planning (position points)
- •Direct following error protection
| Mode | Code (0x6060) | Command Object | Use Case |
|---|---|---|---|
| CSP | 8 | 0x607A Target Position | Position trajectory |
| CSV | 9 | 0x60FF Target Velocity | Speed control |
Why CSP for Your Application
- •Guaranteed constant velocity distance ≥ 1m: CSP gives "next position point every cycle" - constant velocity is naturally achieved with fixed Δpos/cycle
- •Reach 9.7 m/s within 4.2m: CSP lets you calculate "accel/const/decel" distance allocation directly
- •Dual-axis synchronization: CSP is more intuitive for multi-axis sync, phase lock, following error protection
Minimum Required PDO Mapping (CSP)
RxPDO (Master → Drive)
| Object | Name | Type | Purpose |
|---|---|---|---|
| 0x6040 | Controlword | UINT16 | State machine control |
| 0x6060 | Modes of Operation | INT8 | Set CSP (=8) |
| 0x607A | Target Position | INT32 | Position command (inc) |
| 0x60B2 | Torque Offset | INT16 | Optional: feed-forward |
TxPDO (Drive → Master)
| Object | Name | Type | Purpose |
|---|---|---|---|
| 0x6041 | Statusword | UINT16 | State feedback |
| 0x6064 | Position Actual Value | INT32 | Position feedback (inc) |
| 0x606C | Velocity Actual Value | INT32 | Velocity feedback |
| 0x6061 | Modes of Op Display | INT8 | Confirm CSP active |
Recommended Diagnostic PDO
Strongly Recommended (Debug Essential)
| Object | Name | Direction | Purpose |
|---|---|---|---|
| 0x603F | Error Code | Tx | First-look fault diagnosis |
| 0x60FD | Digital Inputs | Tx | Limit/Home switch status |
| 0x6077 | Torque Actual Value | Tx | Load/friction monitoring |
Optional (Enhanced Control)
| Object | Name | Direction | Purpose |
|---|---|---|---|
| 0x607F | Max Profile Velocity | Tx | Verify speed limit |
| 0x60F4 | Following Error Actual | Tx | Real-time error |
DC Synchronization
Free Run vs DC Sync0
| Mode | Description | Use Case |
|---|---|---|
| Free Run | Async, PDO interval ≥250μs | Simple applications |
| DC Sync0 | Synchronized clocks | Multi-axis (recommended) |
For dual-axis LMSA13L: Use DC Sync0 for precise synchronization.
DC Configuration in TwinCAT
- •EtherCAT Master → Advanced Settings → Distributed Clocks
- •Enable DC for each slave
- •Set Sync0 cycle time = NC Task cycle (e.g., 1ms)
Unit Conversion (Critical)
PDO position values are in increments (inc), not mm.
Calibration Procedure
- •Jog axis at low speed for known distance (e.g., 100mm)
- •Read 0x6064 delta (actual increments)
- •Calculate:
inc_per_mm = delta_inc / 100 - •Configure NC scaling factor
Important Objects
| Object | Unit | Notes |
|---|---|---|
| 0x607A | inc | Target position |
| 0x6064 | inc | Actual position |
| 0x60FF | inc/s | Target velocity |
| 0x607F | inc/s | Max velocity limit |
| 0x6083 | inc/s² | Acceleration |
Object Dictionary Structure
In EtherCAT (CoE = CANopen over EtherCAT), each slave has a built-in "data dictionary":
| Field | Description |
|---|---|
| Index (16-bit) | Main category, e.g., 0x6040 |
| SubIndex (8-bit) | Sub-item, e.g., 0x6040:01 |
| Name | Parameter name, e.g., Controlword |
| Access | Permission: R=Read, W=Write |
| Type | Data type (UINT, DINT...) |
ESI File Management
Import Procedure
- •Copy
HIWIN_MIKROSYSTEM_ED1F_20250107.xmlto:C:\TwinCAT\3.1\Config\Io\EtherCAT\ - •Keep only ONE version (avoid conflicts)
- •TwinCAT → I/O → Devices → Reload Device Descriptions
- •Scan for devices
Troubleshooting
- •"Device not found" → Check ESI file location
- •Version mismatch → Remove duplicate ESI files
- •Wrong PDO mapping → Verify ESI matches firmware
Available References
- •
references/pdo-sdo-cia402.md- Comprehensive explanation of PDO, SDO, CiA402 relationships - •
references/dc-synchronization.md- Free Run vs DC synchronization concepts - •
references/can-canopen.md- CAN bus and CANopen differences - •
references/nq-ec8l-esi.md- Keyence NQ-EC8L ESI configuration reference - •
references/nq-ec8l-xml-analysis.md- Complete XML analysis of NQ-EC8L ESI