Skip to main content
AH / SYSTEMS
01PHYSICAL MOTION CONTROL

Beckhoff TwinCAT 3 Linear Axis Control

Physical axis control using TwinCAT 3, PLCopen motion and EtherCAT.

  • PHYSICAL SYSTEM
  • SOURCE AVAILABLE
  • HARDWARE TESTED
  • TwinCAT 3
  • Structured Text
  • PLCopen Motion
  • EtherCAT
Physical Beckhoff linear-axis test setup with EtherCAT control hardware and end-position sensors.
Physical Beckhoff linear-axis test setup.
OPERATOR /SENSORSTWINCAT PLCPLCopenMOTIONNC AXISETHERCATDRIVEPHYSICALAXIS

INPUTS

Hardware controls and end sensors enter the PLC

Enable, reset, speed, jog and automatic-cycle inputs are evaluated together with the two physical end-position sensors.

CONTROL

TwinCAT separates manual and automatic control

Structured Text coordinates operator intent, interlocks, reset handling and the explicit automatic sequence before motion is commanded.

MOTION & FIELD

PLCopen commands motion through EtherCAT

PLCopen blocks command the configured NC axis, with EtherCAT carrying motion to the drive and mechanism.

PHYSICAL TEST

Movement was checked on the laboratory axis

Movement and end-position behaviour were tested on the physical setup.

HARDWARE SETUP

Physical test setup

Physical Beckhoff linear-axis setup with the axis, labelled end-position sensors and EtherCAT control hardware annotated.
  1. 01Physical linear axis
  2. 02BG01 / BG02 end-position sensors
  3. 03Beckhoff EtherCAT control / I/O hardware

MY CONTRIBUTION

Developing the control sequence and motion interfaces

I developed the Structured Text sequence, configured the motion-block interactions, linked hardware I/O and tested the behaviour on the physical axis. I also created the HMI view used to monitor axis and system states.

ENGINEERING APPROACH

Separating manual control from automatic positioning

The application separates manual jogging from the automatic sequence. Before positioning, it finds both end sensors, stores the measured travel limits and applies a margin before commanding target positions.

STRUCTURED TEXT

Commanding an absolute position through PLCopen Motion

fb_MoveAbs(
    Axis     := Axis_1,
    Execute  := bMoveAbsExec AND bAutoActive,
    Position := fRandomPos,
    Velocity := fVelocityFast
);
...
IF fb_MoveAbs.Error
OR Axis_1.Status.Error
OR bLimitLeftHit
OR bLimitRightHit
OR fb_MoveAbs.Done THEN
Absolute-position command used by the automatic motion sequence. The ellipsis marks omitted source between the command and its completion handling.

IMPLEMENTATION

Control functions kept explicit and testable

  • Manual positive and negative jogging
  • Automatic reference search and absolute positioning
  • MC_Power, MC_Reset, MC_Jog and MC_MoveAbsolute
  • End-position sensing with slow/fast override selection
  • Reset, status, axis-error and operator-indicator handling

RESULT

A repeatable physical-axis test workflow

The completed application supports manual jogging, limit discovery and automatic positioning on the laboratory axis.

NEXT PROJECT · 02

Festo Digital Twin