Skip to main content
SearchRequest review

Motion & AGV

Commissioning EtherCAT Servo Axes in CODESYS: The Order That Matters

Commission EtherCAT servo axes in CODESYS SoftMotion in a fixed sequence: clear conflicting drive I/O assignments, set the drive synchronisation cycle and reboot first; then add EtherCAT Master SoftMotion, declare CiA 402 axes, match the master cycle time identically to the drive, trim unused PDOs, verify scaling, and power before enabling the axis group. Final tuning and safety remain subject to engineering review.

Engineers working at an open control cabinet with a schematic on a laptop and printed drawings — AI-generated visualisation, not a customer site.
Editorial visualization — a generic commissioning bench, not a customer site, project record or test result. AI-generated; not a customer site or test record.

The failure looks like tuning. It usually is not.

Two servo axes on an EtherCAT bus, a CODESYS controller, a motion program that compiles cleanly — and the axes jitter, drift, or refuse to enable. The instinct is to open the tuning parameters.

In practice, most of these failures are configuration-order failures. Something was set on the controller that contradicts something set in the drive, and the bus is running with two different ideas of the same value. Working through the setup in a fixed order removes most of that class of problem before it appears, whether on a two-axis stage or on high-axis wire-harness and discrete machinery and new-energy production lines.

Commissioning stepWhere configuredTypical failure symptom if skipped
1. Clear conflicting terminal I/OServo driveBus commands run while a pre-assigned DI holds the drive disabled
2. Set sync period, save & power-cycleServo driveDrive displays new parameter but executes old bus cycle
3. Add EtherCAT Master SoftMotionCODESYS device treePlain master exposes raw PDOs only; no CiA 402 axis blocks
4. Declare CiA 402 axis & modulo modeBeneath each slaveWrong linear/rotary wrap mimics an encoder jump
5. Bind physical NIC & match cycle timeMaster settingsZero slaves scanned, or periodic jitter resembling resonance
6. Trim cyclic PDO mappingSlave process dataExcess PDO payload exhausts 1 ms cycle budget on high-axis buses
7. Enter encoder-to-unit scalingCiA 402 scaling tabCommanded 100 mm move travels the wrong physical distance
8. Power group, then enable groupPLCopen / SoftMotionGroup motion blocks refuse to execute on unpowered slaves

1. Prepare the drive before touching the controller

Drive-side preparation comes first, because several of its settings must later be matched exactly on the master.

Clear conflicting I/O assignments. Servo drives ship with digital inputs pre-assigned to functions such as enable and operating-mode selection. Under fieldbus control, those functions come from the bus. If a physical input is still mapped to enable, the drive can end up taking contradictory instructions — bus says run, terminal says disabled. Remove the assignments the application does not use, and keep only genuine field signals such as home and hardware overtravel switches.

Set the synchronisation cycle, and note the value. The drive has its own synchronisation period and distributed-clock setting. Whatever value you choose here must be entered identically on the master later. Mismatch is the classic cause of motion that looks unstable at constant command.

Save and reboot. Several drive parameters take effect only after the control parameters are stored to non-volatile memory and power is cycled. Skipping this produces a drive that reports the new configuration while still behaving on the old one — a particularly time-consuming failure to diagnose, because everything on screen looks correct.

2. Choose the right master

CODESYS offers more than one EtherCAT master object, and the choice is not cosmetic.

A plain EtherCAT master gives you the bus and its process data. The SoftMotion variant additionally supports CiA 402 axis objects, which is what allows the drives to be commanded with standard PLCopen motion function blocks rather than by writing control words and status words by hand.

If the application is motion — coordinated axes, electronic camming, interpolation, robotics, CNC — choose the SoftMotion master. Retrofitting it after a program has been written against raw process data means rewriting that program.

Adding the master creates a dedicated EtherCAT task. Leave its task priority alone unless there is a documented architectural reason; its timing is part of the bus contract.

3. Add a CiA 402 axis for each drive

Scan or manually add each drive as a slave using the manufacturer’s ESI XML file, then add a CiA 402 axis beneath it. The axis object is what the motion function blocks address.

At this point the axis type is declared — linear or rotary, real or virtual — and software limits can be set. Two points worth deciding deliberately rather than by default:

  • Rotary versus linear changes how position wraps. A rotary axis modulo-wraps; a linear axis does not. Choosing wrongly produces position behaviour that looks like an encoder fault.
  • Virtual axes are genuinely useful during commissioning. A virtual master axis lets cam tables, sequencing and interpolation logic be tested before any real drive is energised.

4. Match the cycle time, and pick the right network interface

Two settings on the master page cause a disproportionate share of commissioning time.

The network interface. A controller with more than one Ethernet port uses one for standard Ethernet — programming, HMI, upstream plant network — and another for the deterministic EtherCAT segment. Selecting the wrong port produces a master that finds zero slaves with no other error symptom. Confirm which physical RJ45 port carries the EtherCAT MAC on the controller hardware in front of you.

The cycle time. This must equal the synchronisation period configured in the drive in step 1. Typical machine values are 1 ms, 2 ms or 4 ms. Faster is not automatically better: the cycle has to be achievable by the controller CPU with the full application running, across every axis on the segment. A cycle time the controller cannot sustain degrades motion in ways that resemble mechanical resonance.

5. Map only the process data the application uses

Each drive exchanges cyclic data with the master through PDOs — receive PDOs carrying target position, velocity or torque commands, and transmit PDOs carrying actual feedback and status words.

Default mappings usually work on bench setups, but the mapping is worth reviewing before scaling up axis count. Every mapped object consumes bus bandwidth and copy time on every cycle. On a two-axis machine this rarely matters; on a 32- to 64-axis segment running at 1 ms, an unexamined default mapping is a common reason the intended cycle time cannot be achieved cleanly.

Map what the application reads or writes. Control word, status word and actual position are almost always needed; objects nothing in the PLC program consumes are cyclic load without benefit.

6. Set the scaling before the first move

The axis needs to know how encoder increments relate to user units — increments per motor revolution, gear ratio, and leadscrew pitch or pulley circumference where mechanics intervene.

Get this wrong and every subsequent move is wrong by the same factor. A commanded 100 mm move that travels 10 mm is a scaling error, not a servo loop error, and no amount of gain tuning corrects it. Name the axis meaningfully at the same time; Axis_Infeed_X is worth ten seconds compared with SM_Drive_GenericDSP402.

Two engineers comparing a wiring schematic against a control component at a desk — AI-generated visualisation, not a customer site.
Editorial visualization — scaling, terminal I/O and PDO mapping are checked against the schematic before the first commanded move; not a customer site, project record or test result.

7. Group the axes, then power and enable — in that order

Coordinated multi-axis motion requires an axis group. Creating one maps the physical CiA 402 drives to the kinematic model and creates the planning task that performs trajectory calculation.

Keep two distinct PLCopen state steps separate in your state machine:

  • Power (MC_Power) energises the individual drives.
  • Group enable (MC_GroupEnable) transfers coordinated control of those axes to the group planner.

Trigger the group-enable block from the Status outputs of the individual axis power blocks so control transfers only once every drive in the group reports powered and fault-free.

8. Understand what the motion type guarantees

PLCopen Part 4 — the specification CODESYS SoftMotion Robotics implements — distinguishes two move families:

  • Point-to-point (MC_MoveDirectAbsolute) fixes only the start and destination. All axes accelerate and decelerate together, but the spatial path depends on kinematics rather than a geometric line.
  • Continuous-path (MC_MoveLinearAbsolute, MC_MoveCircularAbsolute) enforces path geometry, velocity, acceleration and jerk along the tool route — mandatory for dispensing, cutting, welding or obstacle clearance.

9. Interpolated and CNC motion

Where paths come from DIN 66025 G-code or cam/CNC tables, decide the compile mode at creation: a fixed OutQueue mode cannot substitute runtime PLC variables into the G-code, whereas SMC_CNC_REF supports runtime parameters. Choosing the fixed queue mode when recipes require variable coordinates forces a program rebuild later.

Boundaries and limitations

  • This guide covers the commissioning sequence for CODESYS SoftMotion over EtherCAT; exact parameter numbers, ESI XML revisions and firmware constraints belong to each drive and controller manufacturer’s manual.
  • Distributed-clock stability depends on controller CPU load, slave count, shielded Cat5e/Cat6 cabling and grounding; bench and machine validation on the actual hardware stack is required before production release.
  • Functional safety (hardwired E-stop, STO, SS1, SLS) and machine-level risk assessment remain the responsibility of the OEM or system integrator; cyclic EtherCAT motion commands are not a safety channel unless Safety-over-EtherCAT (FSoE) hardware is explicitly specified and certified.
  • Any cross-brand controller or servo drive option is a candidate replacement — subject to engineering review; availability and commercial terms are confirmed at RFQ.

Sources and where this fits

The EtherCAT Technology Group maintains protocol and Distributed Clock specifications at ethercat.org, and PLCopen maintains the CiA 402 / Part 4 coordinated-motion function block standards at plcopen.org.

Controllers that run CODESYS EtherCAT masters are listed under PLC and motion controllers, with matched drives and integrated actuators under servo and motion. Where existing PLC and motion logic must be ported from another platform, PLC and HMI programming scopes the rebuild from your machine sequence and I/O list. Protocol terms are defined in the industrial automation glossary.

Questions engineers ask

Why do EtherCAT servo axes jitter in CODESYS even when the program compiles cleanly?

The most common cause is a mismatch between the synchronisation period stored inside the servo drive and the cycle time configured on the CODESYS EtherCAT master, or skipping a drive save-and-reboot after changing bus parameters. Verify both sides run the exact same cycle period before adjusting servo loop gains.

Should I select EtherCAT Master or EtherCAT Master SoftMotion in CODESYS?

Select EtherCAT Master SoftMotion whenever the machine needs CiA 402 axis objects, PLCopen motion function blocks, electronic camming or coordinated multi-axis groups. The plain EtherCAT master only exchanges raw process data and requires manual bit-level control-word state machines.

Why does my CODESYS EtherCAT master scan zero slaves on a multi-port controller?

Multi-port motion controllers dedicate specific Ethernet MAC interfaces to standard TCP/IP (HMI, programming, MES) and a dedicated deterministic NIC to EtherCAT. Binding the master to the wrong interface name results in zero discovered slaves without a compile error; browse and select the physical EtherCAT port MAC on the live target.

How fast should the EtherCAT cycle time be for multi-axis servo motion?

Typical industrial motion cycles are 1 ms, 2 ms or 4 ms. Choose the fastest cycle that the controller CPU can sustain with zero lost frames while full PLC logic, cam calculation and HMI communications are running; an overloaded 1 ms task causes worse jitter than a stable 2 ms cycle.

Why does a servo drive ignore bus enable commands in CODESYS SoftMotion?

Many servo drives ship from the factory with a physical digital input pre-assigned to Servo-On or mode switching. When that terminal stays open, it overrides or conflicts with the CiA 402 control word `0x6040`. Clear unused DI function assignments in the drive software, save to EEPROM and power-cycle the drive.

Why does a commanded 100 mm move travel the wrong physical distance?

Wrong travel distance is almost always an axis-scaling mismatch — encoder increments per revolution, gearbox ratio, or ballscrew/belt feed constant — rather than a tuning or following-error issue. Check the CiA 402 scaling numerator and denominator with a slow jog and physical rule before running automatic sequences.

When should I trim default EtherCAT PDO mappings on servo drives?

Review and trim unused PDO objects whenever bus axis count rises into the dozens or cycle time drops to 1 ms or below. Removing unconsumed torque, touch-probe or auxiliary status registers shrinks frame size and controller copy overhead on every bus cycle.

What is the difference between MC Power and MC GroupEnable in CODESYS SoftMotion?

`MC_Power` closes the power stage on each individual servo axis, whereas `MC_GroupEnable` hands coordinated trajectory control of those axes to an axis-group planner. Always wait for all member `MC_Power.Status` bits to turn true before triggering `MC_GroupEnable`.

Can an existing Mitsubishi, Siemens or Omron motion project auto-convert into CODESYS?

No. Cross-platform PLC and motion projects cannot be machine-translated reliably because axis state machines, cam tables, homing modes and hardware interrupts differ across vendors. Any cross-brand controller or servo package is a candidate replacement — subject to engineering review and structured program re-implementation.

Need this reviewed against a real application?

This guide explains the engineering workflow, not a model-level selection. Send the installed devices, interfaces, operating conditions, and acceptance criteria for an application review.

Request review
Technical guideRequest review