Motion: EtherCAT

In order to build an application based on an EtherCAT servo drive, you must add an EtherCAT Master COM module to your Hardware Configuration.

Adding the EtherCAT Master COM module

  1. In the Solution Explorer, click Hardware Configuration>Uni-I/O & Uni-COM and then select your EtherCAT module.

 

Adding EtherCAT Drives & Motors

  1. In the Solution Explorer, click Hardware Configuration>Motion Drives>Servo and then select Servo Drives.

  2. In the Toolbox, select an EtherCAT UMD (Unitronics Motion Drive). An EtherCAT Drive is marked by an E, such as the UMD-E3 shown below.

  3. Double-click or drag your UMD into the Servo Drives window; UniLogic assigns it a default name.

  4. The drive's Properties opens; note that UniLogic automatically creates two structs under the IO tab; one struct to support the drive; the other to support the drive's I/Os.

  5. Click Motor Series and select your series, and then select your motor's model; UniLogic displays the motor's properties.

EtherCAT Servo Drives

Adding a Configuration

  1. Select Servo Configurations in the Solution Explorer. In the Toolbox, double-click or drag your EtherCAT UMD into the Configuration window; UniLogic creates a Configuration. An EtherCAT Drive is marked by an E, such as the UMD-E3 shown below

  2. Open the Configuration either by clicking it in the Solution Explorer or the Servo Configurations window.

 

The image below shows a Configuration along with the default parameter values.
In the image, the right side shows groups of parameters. The groups outlined in green are specific to UniLogic:

Editing Parameters

To edit a parameter, click it in the Configured Value column. If the parameter can be edited, this will either open a drop-down or allow you to directly enter/edit a value. Note the Description Window, which provides information for the selected parameter.

The Configuration parameters are directly related to the EtherCAT Servo Drive struct. In the struct, note the parameter Index numbers. These enable you to read and write values in your application; for example in the image below, JOG speed is index 0.

 

After you edit the Configuration via UniLogic, you can write the changes to the Configuration in one of two ways.
In your Ladder application, either:

  1. Load the data from the Configuration to the Servo struct via the Servo Ladder Function Servo Load Configuration from File.

  2. Write the data from the Servo struct to the servo itself via the Ladder function: Servo Write Configuration.

Or

  1. Use the function Write Modified Parameters to write any data you have modified directly to the device, without first loading it to the struct. If the Write operation is successful, the successfully modified values are updated in the struct.

 

Additional Configuration Methods

You can export a Configuration file from the project, edit it, and import it.

Right-click a specific Configuration
to export it to Excel.

Right-click Servo Configurations to import a file from Excel.

 

 

EtherCAT Master Module Struct

This is a system struct.

 

 

Parameter Name

Data Type

 

 

USB Flash Inserted

BIT

Is ON when there is a DOK in the modules USB port

 

Module Connected

BIT

Turns ON when the module is physically connected to CPU

 

Module Ready

BIT

Startup complete, Module  is ready to start communication with the CPU

 

Module Type

UINT8

Value indicates Module type:

0 = UAC-02EC2

 

Initialization Status

UINT32

Status indications:

0 = Not initialized

3 = Topology Mismatch: the order of the EtherCAT elements in the project' Hardware Configurations does not match the order in which they are physically connected to the controller

5 = Initialized successfully

Other codes= Internal

 

Current Firmware Version

STRING-ASCII

Indicates the firmware version currently installed in the module.

 

Inserted Image Version

STRING-ASCII

Indicates the firmware version on the connected DOK

 

Average cycles between diagnostics packages

UINT32

Statistics

 

Average time between diagnostics packages

UINT32

Statistics

 

PI Send Errors Count

UINT32

Statistics  

 

PI Receive Errors Count

UINT32

Statistics

 

Wrong Working Counter Frames

UINT32

Statistics  

 

Slave Response Time;

UINT32

Statistics

 

Light all LEDs up

BIT

Internal

 

Average Cycle Time

UINT32

Internal

 

Min Cycle Time

UINT32

Internal

 

Max Cycle Time

UINT32

Internal

 

Communication Active

BIT

ON when communication between CPU and module is ok

 

Diagnostics Mode

BIT

ON when module is in motion diagnostics mode

 

Reserved

UINT32f0...821

 

 

Master Bus OK

BIT

ON when Bus is OK

 

Mandatory> slave is in wrong state

BIT

 

 

Mandatory slave is offline

BIT

 

 

Hot-connect slave is in wrong state

BIT

 

 

Hot-connect slave is offline

BIT

 

 

ViolationTimeCntr

UINT32

Internal

 

EtherCat master state

UINT32

Internal

 

EtherCAT Structs

In addition to the EtherCAT System Struct, UniLogic creates two structs for each EtherCAT drive you include in your application, one for the drive and one for I/O.

 Note that the parameters of the drive struct will vary according to the drive model. Please refer to the drive manual for the complete list.

EtherCAT Drive Struct

Parameter Name

Data Type

Description

Enable Communication

BIT

Turn this ON to allow communications between UniStream and the Servo drive.
This bit is On by default.

This bit must be on in order for the drive to function; when it is OFF the PLC cannot communicate with the drive.

Current Configuration Name

STRING-ASCII

The name assigned to the Servo drive

Communication Statistics

UINT32

[Action successes counter]

 

UINT32

[Action failures counter]

 

UINT32

[Action timeout counter]

 

UINT32

[Message sent]

 

UINT32

[Messages received successfully]

 

UINT32

[Message received erroneously]

 

UINT32

[Failed SDO Index]

 

UINT32

[Failed SDO SubIndex]

 

UINT32

 

Function selection switches

UINT16

[Servo General Parameters1]

 

UINT16

[Servo General Parameters2]

 

UINT16

[Servo General Parameters3]

 

UINT16

[Servo General Parameters4]

 

UINT16

[Servo General Parameters5]

 

UINT16

[Servo General Parameters6]

 

UINT16

[Servo General Parameters7]

 

UINT16

[Servo General Parameters8]

 

UINT16

[Electronic Gear]

 

UINT16

 

Parameters of servo gain

UINT16

[Autotuning Settings]

 

UINT16

[Machine Rigidity Setting]

 

UINT16

[Speed Loop Gain]

 

UINT16

[Speed Loop Integral Time Constant]

 

UINT16

[Position Loop Gain]

 

UINT16

[Torque Reference Filter Time Constant]

 

UINT16

[Servo gain]

 

UINT16

[_2nd Speed Loop Gain]

 

UINT16

[_2nd Speed Loop Integral Time]

 

UINT16

[_2nd Position Loop Gain]

 

UINT16

[_2nd Torque Reference Filter Time Constant]

 

UINT16

[Speed Bias]

 

UINT16

[Speed Feedforward]

 

UINT16

[Speed Feedforward Filter Time Constant]

 

UINT16

[Torque Feedforward]

 

UINT16

[Torque Feedforward Filter Time Constant]

 

UINT16

[P/PI Switching Condition]

 

UINT16

[Torque Switching Threshold]

 

UINT16

[Offset Counter Switching Threshold]

 

UINT16

[Setting Acceleration Speed Switching Threshold]

 

UINT16

[Setting Speed Switching Threshold]

 

UINT16

[Gain Switching Condition]

 

UINT16

[Gain Switching Waiting Time]

 

UINT16

[Switch Threshold Level]

 

UINT16

[Actual Speed Threshold]

 

UINT16

[Position Loop Gain Switching Time]

 

UINT16

[Hysteresis Switching]

 

UINT16

[Low Speed Detection Filter]

 

UINT16

[Speed Gain Acceleration Relationship During Online Autotuning]

 

UINT16

[Low Speed Correction Coefficient]

 

UINT16

[Friction Load]

 

UINT16

[Speed Lag Ring of Friction Compensation]

 

UINT16

[Viscous Friction Load]

 

UINT16

[Notch Filters 1 Trap Width]

 

UINT16

[Notch Filters 2 Trap Width]

 

UINT16

 

Position control related parameters

UINT16

[PG Divider]

 

UINT16

[_16 Bit 1st Electronic Gear Numerator]

 

UINT16

[_16 Bit Electronic Gear Denominator]

 

UINT16

[_16 Bit 2nd Electronic Gear Numerator]

 

UINT16

[Position Reference Filter Time Constant]

 

UINT16

[Position Reference Filter Mode Selection]

 

UINT16

 

Speed control related parameters

UINT16

[JOG Speed]

 

UINT16

[Soft Start Acceleration Time]

 

UINT16

[Soft Start Deceleration Time]

 

UINT16

[Speed Reference Filter Time Constant]

 

UINT16

[S Curve Rise Time]

 

UINT16

[Speed Reference Curve Mode]

 

UINT16

[S Form Selection]

 

UINT16

[DP Communication JOG Speed]

 

UINT16

 

Torque control related parameters

UINT16

[Forward Internal Torque Limit]

 

UINT16

[Reverse Internal Torque Limit]

 

UINT16

[Forward External Torque Limit]

 

UINT16

[Reverse External Torque Limit]

 

UINT16

[Reversal Connections Braking Torque Limit]

 

UINT16

[Speed Limit During Torque Control]

 

UINT16

[_1st Notch Filter Frequency]

 

UINT16

[_1st Notch Filter Depth]

 

UINT16

[_2nd Notch Filter Frequency]

 

UINT16

[_2nd Notch Filter Depth]

 

UINT16

[Frequency of Low Frequency Jitter]

 

UINT16

[Damp of Low Frequency Jitter]

 

UINT16

[Torque Control Delay Time]

 

UINT16

[Torque Control Speed Lag]

 

UINT16

 

Parameters to control I/O port

UINT16

[Positioning Error]

 

UINT16

[Coincidence Difference]

 

UINT16

[Zero Clamp Speed]

 

UINT16

[Rotation Detection Speed]

 

UINT16

[Position Error Pulse Counter Overflow Alarm Selection]

 

UINT16

[Servo On Waiting Time]

 

UINT16

[Basic Waiting Flow]

 

UINT16

[Brake Waiting Speed]

 

UINT16

[Brake Waiting Time]

 

UINT16

[Inputs Selection Group1]

 

UINT16

[Inputs Selection Group2]

 

UINT16

[Outputs Selection]

 

UINT16

[Inputs Enable Group1]

 

UINT16

[Inputs Enable Group2]

 

UINT16

[Input Port Filter]

 

UINT16

[Alarm Port Filter]

 

UINT16

[Inputs Inverse Group1]

 

UINT16

[Inputs Inverse Group2]

 

UINT16

[Dynamic Brake Time]

 

UINT16

[Serial Encoder Error Time]

 

UINT16

[Position Complete Time]

 

UINT16

[Regenerative Resistor]

 

UINT16

[Overload Alarm Threshold]

 

UINT16

[Outputs Inverse]

 

UINT16

[Torque Detection Signal Output Threshold Value]

 

UINT16

[Torque Detection Output Signal Time]

 

UINT16

 

PT gear ratio

UINT16

[_32 Bit 1st Electronic Gear Numerator (H)]

 

UINT16

[_32 Bit 1st Electronic Gear Numerator (L)]

 

UINT16

[_32 Bit Electronic Gear Denominator (H)]

 

UINT16

[_32 Bit Electronic Gear Denominator (L)]

 

UINT16

[_32 Bit 2nd Electronic Gear Numerator (H)]

 

UINT16

[_32 Bit 2nd Electronic Gear Numerator (L)]

 

UINT16

 

Monitor Parameters

UINT16

[Actual servomotor speed]

 

UINT16

[Input speed reference]

 

UINT16

[Input torque reference (with respect to rated torque)]

 

UINT16

[Internal torque reference (with respect to rated torque)]

 

UINT16

[Number of encoder rotation angle pulses]

 

UINT16

[Input signal monitor]

 

UINT16

[Encoder signal monitor]

 

UINT16

[Output signal monitor]

 

UINT16

[Frequency given by pulse]

 

UINT16

[Number of servomotor rotation pulses]

 

UINT16

[Pulse rate of servomotor rotated]

 

UINT16

[Error pulse counter lower 16 digit]

 

UINT16

[Error pulse counter higher 16 digit]

 

UINT16

[Number of pulses given]

 

UINT16

[Number of pulses given (x10000)]

 

UINT16

[Load inertia percentage]

 

UINT16

[Servomotor overload ratio]

 

UINT16

[Encoder EEPROM  saves motor and encoder  types and correlation information]

 

UINT16

[Nikon Encode  internal Temperature]

  

EtherCAT I/O Struct

Parameter Name

Data Type

Description

Enable Outputs

BIT

Off by default
Turn this ON to update the physical outputs at each Ladder cycle

When it is OFF the outputs will not be updated..

Slave state

UINT16

The 'State' variable holds the current EtherCAT state and link status of the EtherCAT slave device.

 

    0x___1 = Slave in 'INIT' state

    0x___2 = Slave in 'PREOP' state

    0x___3 = Slave in 'BOOT' state

    0x___4 = Slave in 'SAFEOP' state

    0x___8 = Slave in 'OP' state

    0x001_ = Slave signals error

    0x002_ = Invalid vendorId, productCode... read

    0x004_ = Initialization error occurred

    0x010_ = Slave not present

    0x020_ = Slave signals link error

    0x040_ = Slave signals missing link

    0x080_ = Slave signals unexpected link

    0x100_ = Communication port A

    0x200_ = Communication port B

    0x400_ = Communication port C

    0x800_ = Communication port D

Slave Error

UINT16

Generated by UniLogic:

0x0 - Ok, 0x1 - Offline, 0x2 - Error EtherCAT state. 0x4 - Not configured, 0x8 - Wrong configuration, 0x10 - Init command error, 0x20 - Mailbox init command error

         

Related Topics

Axis Structs

UMD Servo Firmware Update

Servo COM Functions

MC Function Blocks

Multi-Axes MC Functions (EtherCAT)

Servo: Ready-made Motion Code

Motion: Diagnostics & Tuning

Servo Motion Complete Error Codes

Axis Homing Methods

Motion: EtherCAT