AN-054: Ethercat using realtime TC3

Introduction

This appnote shows step by step how to configure realtime operation with TwinCAT3 and ADI Trinamic EtherCAT modules. For example the TMCM-6213 is a six axes controller/driver module for 2-phase bipolar stepper. It supports EtherCAT interface with CoE CiA-402 Drive Profile for all axis. General usage of TwinCAT is not explained.

Preparation

It is recommended to update the ADI Trinamic module:

  • Firmware
  • EEPROM
  • ESI file (.xml)

ADI Trinamic module firmware should be at least v1.09. Example for files notation as follows:

  • TMCM-6213.xml
  • TMCM-6213_CoE_V109.bin
  • TMCM-6213_CoE_V109.hex

The files can be downloaded from the module page: https://www.trinamic.com/products/modules/details/tmcm-6213/

Create a new TwinCAT XAE project

Assign dedicated processor core to TwinCAT


Assignment of processor core needs to be done only once!

The processor core will be used for realtime motion NC_Task

  1. Read from Target
    Figure 1: Available CPU (Windows/Isolated) = 4/0 → no processor core is assigned to TwinCAT yet
  2. Set on target Assign processor core to TwinCAT:
  3. After restart check the Task Manager -> Resource Monitor

The core assignment is permanent. In order to unassign processor core again repeat step 2. Using the Set on targe dialog and set Available (Windows/Isolated): 4/0

For the next steps in this app note, the configuration should be set to Available CPUs (Windows/Isolated): 3/1 

Select assigned processor core

  1. Open TwinCAT Project.

    Project → System → Real-Time → Settings Tab
  2. Choose Isolated CPU core.
  3. Deactivate Windows CPU core.
    Thus the windows core is reserved for TwinCAT real-time operations. In the next step the real-time operation will be activated.

Activate Configuration (Motion Task)

  1. Activate configuration.
    Enter the License code which is generated. 

  2. Execute win8settick.bat as administrator if the following Error shows up. This is a TwinCat specific Error.

If the configuration is active, the green logo shows up in the bottom right corner.

Use Jogging Mode

Axis 1 is driven in Jogging Mode in this section.

  1. Configure Monitoring

    Axis 1 → Parameter → Monitoring → Set Every Value to False (since not provided by the module)

    Confirm every value by clicking on Download.
  2. Set axis 1 to CSP mode. Write 8 to Axis0 Modes of Operation 1

    Modes of Operation as SDO (Firmware v207)
    Modes of Operation as PDO in (Firmware v208)
  3. Enable Controller and Feed Fw/Bw

    Motion → Axes → Axis X → Tab Online → Enabling → Set → All
  4. Use Jog Control Buttons to move the axis X.

作者

Olav_Kahlbaum_blue

Olav Kahlbaum

Olav Kahlbaum works as a Staff Engineer for Firmware at Trinamic part of Analog Devices based in Germany. After finishind his studys of Computer Science in 1998 he joined the Trinamic team in 2000. He mainly develops firmware for stepper motor control modules. During his career at Trinamic he has become one of the inventors of TMCL and has specialized very much in communication protocols like CANopen, EtherCAT and Modbus.