Festo HomingLibrary

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Description

www.festo.de
Library for using drive-controlled
homing with motor controller from
Festo_HomingLibrary Festo. The library is developed for
using in TwinCAT environment with
CiA402 drive profile.

07.05.2019
Table of content

1 Important instructions................................................................................................................................... 4
1.1 Designated use ................................................................................................................................... 4
1.2 Version overview ................................................................................................................................. 4
1.3 Safety instructions .............................................................................................................................. 5
1.4 Danger categories ............................................................................................................................... 5
1.5 Marking special information ............................................................................................................... 6

2 Introduction ................................................................................................................................................... 7
2.1 Basic principles ................................................................................................................................... 7
2.2 Release information ............................................................................................................................ 7
2.3 Characteristic of homing run ............................................................................................................... 8
2.3.1 NC-controlled homing............................................................................................................. 8
2.3.2 Drive-controlled homing ......................................................................................................... 8

3 Content of the Festo_HomingLibrary ............................................................................................................. 9


3.1 Overview ............................................................................................................................................. 9
3.2 Festo_MC_Home ............................................................................................................................... 10
3.3 Festo _MC_ReadAxisError ................................................................................................................. 13

4 Instruction guide for motor controller with EtherCAT interface ................................................................... 14


4.1 Configure CMMP-AS drive with EtherCAT in FCT ................................................................................ 14
4.2 Configure EMCA-EC drive with EtherCAT in FCT ................................................................................. 15
4.3 Configure an EtherCAT drive in TwinCAT 3 ......................................................................................... 15
4.3.1 Import a new EtherCAT-Slave-Information (ESI) xml ............................................................. 15
4.3.2 Append a Festo drive to the EtherCAT master ....................................................................... 16
4.4 Insertion of a NC-Axis........................................................................................................................ 17
4.5 Assignment of the NC-axis variables to EtherCAT slave ..................................................................... 18

5 Instruction guide for drive configuration with CANopen ............................................................................. 20


5.1 Configure an CMMP-AS drive with CANopen in FCT ........................................................................... 20
5.2 Configure an CANopen drive in TwinCAT 3 ......................................................................................... 21
5.2.1 Create a CANopen Drive Configuration in TwinCAT ............................................................... 21
5.2.2 Append a Festo CANopen Axis to the CAN Master ................................................................ 21
5.3 Insertion of a NC-Axis........................................................................................................................ 22

6 Moving of the NC axis with the online interface .......................................................................................... 24

7 Linking of the NC axis and the PLC program ................................................................................................ 25

3
Important instructions

1 Important instructions
1.1 Designated use
This library is for using drive-controlled homing with motor controller from Festo in CiA402 drive profile. Drive-
controlled homing is carried out automatically by the drive. It is only started by the control system. The library is
designed in TwinCAT 2 and TwinCAT 3 environment form Beckhoff.

Read the "Safety instructions" and instructions on the designated use of the relevant devices, components and
modules. If additional commercially available components such as sensors and actuators are connected, the
specified limits for pressures, temperatures, electrical data, torques, etc. must not be exceeded.

Target group
This manual is intended exclusively for technicians trained in control and automation technology, who have
experience in installation, commissioning, programming and diagnostics of positioning systems and the relevant
fieldbus. They must have a good knowledge of TwinCAT and their NC-axis programming.

Service
Please contact your local Festo service partner or write to the following e-mail address if you have any technical
problems.
service_international@festo.com

Note
The specified library will not be supported by TwinCAT XAE engineering enviroments older than
version 3.1.4020.0. (Reason: Compiler version is not compatible).

1.2 Version overview


Author Date Library Version Comments

chmm 09.03.2018 3.1.20.0 Library created

Bugfix for CMMT-AS


chmm 03.12.2018 3.1.20.1
CMMT-ST added

chmm 07.05.2018 3.1.20.2 Function block "Festo_MC_ReadAxisError" for CMMT-AS


and CMMT-ST released

4
Important instructions

1.3 Safety instructions


When commissioning and programming positioning systems, you must observe the safety regulations in the
manuals and operating instructions for the components used.
The user must make sure there is nobody within the positioning range of the connected actuators or axis
systems. Access to the possible danger area must be prevented by suitable measures such as barriers and
warning signs.

Warning
Pneumatic and electric axes can move with high force and at high speed. Collisions can lead to serious
injury to people and damage to components.
• Make sure that nobody can place their hand in the positioning range of the axes or other
connected actuators and that there are no objects in the positioning path while the system is
still connected to a power supply.

Warning
Parameterisation errors can cause injury to people and damage to property.
• Only enable the controller if the axis system has been installed and parameterised by
technically qualified staff.

1.4 Danger categories


This Help contains information on the possible dangers that can occur if the product is not used as designated.
This information is marked with a signal word (warning, caution, etc.), placed on a grey background and
additionally marked with a pictogram. A distinction is made between the following danger warnings:

Warning
... means that serious injury to people and damage to property can occur if this warning is not
observed.

Caution
... means that injury to people and damage to property can occur if this warning is not observed.

Note
... means that damage to property can occur if this warning is not observed.

You can find information on how special information is represented under "Marking special information" (see
chapter 1.4).

5
Important instructions

1.5 Marking special information


Pictograms
The following pictograms mark passages in the text that contain special information.

Information: Recommendations, tips and references to other sources of information.

Text markings
1. Figures denote activities that must be carried out in the order specified.
• Bullets denote activities that may be carried out in any desired order.
o denote general listings.

Further conventions
[Project | New] Menu items are framed in square brackets, for example the [New] command in the [Project]
menu opens a new project.
"OK" The names of windows, dialogs and buttons, e.g. "Message window," "Import project,"
"OK" as well as designations are displayed in inverted commas.
CTRL Names of keys on the PC keyboard are represented in the text with uppercase letters
(e.g. ENTER KEY, CTRL, C, F1 etc.).
CTRL+C For some functions you need to press two keys simultaneously. For example, press and hold
down the CTRL key and also press the C key. This is written in the text as CTRL+C.
If "click" or "double-click" is mentioned, this always applies to the left-hand mouse button. If
the right-hand mouse button is to be used, this will be explicitly mentioned.

6
2 Introduction
2.1 Basic principles
This documentation will guide you through the steps to integrate a Festo motor controller in the Beckhoff
TwinCAT environment using CiA402 drive profile. The precondition is a good knowledge of TwinCAT and their NC-
axis programming. Additionally you need FCT (Festo Configuration Tool) to setup the servo controller. Please
note that you might need different Plugins for FCT for different servo controllers like CMMP-AS, EMCA-EC, etc. All
Festo software is available on our web site in the support portal.

To control the Festo drives with TwinCAT PLC-Control, we recommend using the Motion Library
provided by Beckhoff, for example Tc2_Mc2.

Warning
This document is only a help to integrate the Festo drive into the TwinCAT environment. In order to
establish a safe operation, it is necessary to take into account all the parts of the system and their
safety information

2.2 Release information


The “Festo_HomingLibrary” is tested and released for following Festo products:

Motor Controller Fieldbus Drive-Profile Firmware FCT PlugIn Cycle time


CMMP-AS-M3 EtherCAT CiA402 4.0.1501.1.4 or higher 2.3.0.0 or higher 2 ms + n*1 ms
CAN
EMCA-EC EtherCAT CiA402 1.4.0.9 or higher 1.5.0.56 or higher 2 ms + n*1 ms
CMMT-AS EtherCAT CiA402 14.0.4.102 and higher - 1 ms + n*1 ms
CMMT-ST EtherCAT CiA402 14.0.4.102 and higher - 1 ms + n*1 ms

Note
Always observe the information and safety instructions in the documentation of the motor controller.

7
Introduction

2.3 Characteristic of homing run


To run an electrical drive system, the system must be referenced. This can be done in several ways
- Via the Festo Configuration Tool (FCT)
- Via fieldbus NC-controlled homing
- Via fieldbus drive-controlled homing (more complex because it is necessary to switch the operating
modes)

In a running system, it is only possible to use the last two aforementioned methods.

2.3.1 NC-controlled homing


By using the NC driven homing run, you should use the MC_Home function block from Beckhoff.

Figure 1: MC_Home function block (source: Beckhoff)

The limit switches have to be connected to the PLC.

The observation of the axis limits has to be done by the NC.


The controller internal SW limits must be deactivated by the start-up parameters.

We recommend the NC driven homing run! This is Beckhoff standard. Please refer to the Beckhoff
documentation for how to use the MC_Home function block.

2.3.2 Drive-controlled homing


By using the drive-controlled homing, the home run is carried out automatically by the drive. It is only started by
the control system.

Figure 2 : Festo_MC_Home function block

Homing Method of the motor controller must be configured with FCT (Festo Configuration Tool).

8
3 Content of the Festo_HomingLibrary

3.1 Overview
The “Festo_HomingLibrary” is composed out of two function blocks:
- Festo_MC_Home --> starting the drive-controlled home run
- Festo_MC_ReadAxisError --> reading the most recent error number of the device

The “Festo_HomingLibrary” uses the following libraries from TwinCAT:


- Standard
- Tc2_EtherCAT
- Tc2_MC2
- Tc2_Standard

- Tc2_System

9
Content of the Festo_HomingLibrary

3.2 Festo_MC_Home
Function block to start the drive-controlled homing run. This FB will control the “modes of operation” of the drive
additionally. You must connect the PDO (CiA402 Object 16#6060) for EtherCAT devices manually (see example).
With a rising edge at "Execute" the following homing procedure of the Festo motor controller will start:
1. Identification of connected drive and fieldbus interface
2. Disable "lag distance monitoring position" by NC-axis (if monitoring is active)
3. Reset referenced bit of NC-axis
4. Write "modes of operation" of connected drive to mode 6 (homing mode)
5. Start homing run
6. Wait until drive-controlled homing run is finished
7. Set position of NC-axis
8. Enable "lag distance monitoring position" by NC-axis (if monitoring was active before homing run)
9. Set referenced bit of NC-axis
10. Set "modes of operation" back to commanded mode (input at function block)

Figure 3: Festo_MC_Home function block

Var_Input_Output
Variable Type Description

Axis Axis_Ref Reference to the axis

Var_Input
Variable Type Description

Execute BOOL Starts homing procedure with rising edge

SetModesOfOperation SINT Commanded “modes of operation” (object 16#6060) of drive


according CiA402 specification

Var_Ouput
Variable Type Description

Done BOOL Homing run finished successfully

ModesOfOperation SINT Output of “modes of operation” (object 16#6060) which must be


connected to drive.

Busy BOOL Homing procedure is active

CommandAborted BOOL Homing procedure was aborted

Error BOOL Signals that an error has occurred within the function block

ErrorId WORD Error identification

ErrorString STRING String with detailed error information

10
Content of the Festo_HomingLibrary

Example
Following figure shows you an example how enabling and starting drive-controlled homing run could be done.
After home run the drive is starting two relative movements.

11
Content of the Festo_HomingLibrary

After you declared the function block “Festo_MC_Home” and built the project, TwinCAT will create a variable
instance of “ModesOfOperation”. This instance must link to the PDO of Festo motor controller manually (see
figure below).

12
Content of the Festo_HomingLibrary

3.3 Festo _MC_ReadAxisError


Function block for reading the most recent axis error of the motor controller.

Function block is NOT supported by EMCA-EC motor unit at moment.

Figure 4: Festo_MC_ReadAxisError

Var_Input_Output
Variable Type Description

Axis Axis_Ref Reference to the axis

Var_Input
Variable Type Description

Enable Bool As long as "Enable" is true, axis error will be read

Var_Ouput
Variable Type Description

Valid BOOL If true, a valid set of outputs is available at FB

Busy BOOL Reading of axis error is active

AxisErrorID UDINT Value of the actual axis error

AxisErrorString STRING String with axis error information

Error BOOL Signals that an error has occurred within the function block

ErrorId WORD Error identification

ErrorString STRING String with detailed error information

13
4 Instruction guide for motor controller with EtherCAT interface
4.1 Configure CMMP-AS drive with EtherCAT in FCT
After the successful electrical installation of the drive, it has to be configured with FCT. The following steps only
comprise the specific Beckhoff NC configurations.
No Action Comment
1 Check the optional card slots.
The EtherCAT-card has to be installed in the second slot.

2 Activate the interpolated position mode (7)

3 Select CiA402 as the protocol under the fieldbus configuration tab.


The drive cycle time must be the same like in the Beckhoff NC.

4 The scaling needs to be equal to the Beckhoff NC interface (for example 10^-4 mm).

14
Instruction guide for motor controller with EtherCAT interface

4.2 Configure EMCA-EC drive with EtherCAT in FCT


After the successful electrical installation of the drive, it has to be configured with FCT. The following steps only
comprise the specific Beckhoff NC configurations.
No Action Comment
1 Check the drive configuration. Drive must be an EMCA-EC-..-…-EC drive.

2 Set “Cycle Time” and “Device Profile”.

3 The scaling needs to be equal to the Beckhoff NC interface (for example 10^-5 r).

4.3 Configure an EtherCAT drive in TwinCAT 3


4.3.1 Import a new EtherCAT-Slave-Information (ESI) xml
No Action Comment
1 If the TwinCAT development environment (Visual Studio) is started, close it.
2 Copy the latest xml-file of the drive to the folder C:\TwinCAT\3.1\Config\Io\EtherCAT.
3 Restart Visual Studio

15
Instruction guide for motor controller with EtherCAT interface

4.3.2 Append a Festo drive to the EtherCAT master


No Action Comment
1 Add a “EtherCAT master device” task to the TwinCAT I/O configuration.
2 Click on the EtherCAT master and insert a new item.

3 Choose the type of your Festo axis for driving with NC-Control.

4 Check if “DC Operation Mode” is set to “DC for synchronization” and set cycle time to
same value as configured in drive by FCT (see chapter 4.1 and chapter 4.2).

5
You can see after “Activate Configuration” ( ) and “Restart TwinCAT System” ( )
the current state of the drive in the tab “Online”, if you logged in.

16
Instruction guide for motor controller with EtherCAT interface

4.4 Insertion of a NC-Axis


No Action Comment
1 Adding the task and axis
1.1 Add a “NC/PtP NCI Configuration” task to the TwinCAT Motion configuration.
1.2 Add a NC axis of type "Continuous axis" to the NC task.
2 Axis Settings
2.1 To create a relation between the NC Axis and the Festo Axis, both components must be
linked to one another. Link the NC axis to the Festo drive as seen below. Check also the
chosen axis type. In this view you can also see the cycle time of the NC-task.

2.2 Enter the velocities and dynamics of your system. Remember that these values must not
exceed the parameters configured in FCT

3 Encoder settings
3.1 The scaling factor must match the value entered under factor group in FCT, otherwise
the position units will not be sent correctly to the setpoint generator.
The reference system is important for the homing. If you want to home the axis via NC
(which is preferable), "incremental" must be selected here.
If you use a multi turn drive, you have to reference the drive with the FCT before first
usage. In this case select “absolute” as reference system.

17
Instruction guide for motor controller with EtherCAT interface

4.5 Assignment of the NC-axis variables to EtherCAT slave


Connect the NC-axis with the drive in the Motion configuration. Ensure that all necessary variables are
connected. Remember that you must connect the PDO (CiA402 Object 16#6060) for EtherCAT devices manually.
This is necessary for using the function block “Festo_MC_Home”, this will control the “modes of operation” of
the drive additionally.

4.5.1 CMMP-AS with EtherCAT interface


The assignment of the input and output variables is done automatically when you connect the NC-
axis with the drive (see chapter 4.4). With a CMMP-AS-with EtherCAT interface you must assign the
output variable “IP_Data_Record” manually (orange frame and orange arrow in figure below).

18
Instruction guide for motor controller with EtherCAT interface

4.5.2 EMCA-EC and CMMT-AS and CMMT-ST with EtherCAT interface

The assignment of the input and output variables is done automatically when you connect the NC-
axis with the drive (see chapter 4.4).

19
5 Instruction guide for drive configuration with CANopen
5.1 Configure an CMMP-AS drive with CANopen in FCT
After the electrical installation, you must configure the drive with FCT. In the following the Beckhoff NC specific
adjustments are described only.
No Action Comment
1

2 Activate the interpolated position mode (7)

3 Select CiA402 as the protocol under the fieldbus configuration tab. The bit rate must The bit rate
match the one configured in the CANopen Master. must be
equal for all
the
participants
in the
network

4 The scaling needs to be equal to the Beckhoff NC interface.

20
Instruction guide for motor controller with CANopen interface

5.2 Configure an CANopen drive in TwinCAT 3


5.2.1 Create a CANopen Drive Configuration in TwinCAT
Create a device configuration and insert all the necessary I/O devices.

5.2.2 Append a Festo CANopen Axis to the CAN Master


No Action Comment
1 An easy way to append a Festo CANopen Axis to the Beckhoff CAN Master is to import the You´ll find
predefined axis which is configured for working with the Beckhoff NC. the “tce-
file” in the
device
description
folder in the
Festo_Homi
ngLibrary

Select the “tce-file” of your wired motor controller:

21
Instruction guide for motor controller with CANopen interface

2 Set the slave to the NodeID you have configured in the FCT.

3 To adjust the PDOs to the right node, select the SDOs tab. Here you can see the SDOs Entries of
which are sent during the startup. The parameters of the predefined drive are configured “IP Time”
for the NodeID 3. Adapt the marked parameters to the NodeID you have specified for not needed
your drive for CMMP-
AS, adjust
them in the
FCT

5.3 Insertion of a NC-Axis


See chapter 4.3. You must do the same steps as in chapter 4.3.

22
Instruction guide for motor controller with CANopen interface

5.4 Assignment of the NC-axis variables to CANopen slave


Connect the NC-axis with the drive in the Motion configuration. Ensure that all necessary variables are
connected.

The assignment of the input and output variables is done automatically when you connect the NC-
axis with the drive.

23
6 Moving of the NC axis with the online interface
Warning
Electric axes can move with high force and at high speed. Collisions can lead to serious injury to
people and damage to components.
• Make sure that nobody can place their hand in the positioning range of the axes or other
connected actuators and that there are no objects in the positioning path while the system is
still connected to a power supply.

1 Go online to the PLC.

2
Click “Activate Configuration” ( ) and “Restart TwinCAT System” ( ).
3 Go to the online interface of the axis and enable the drive. Now you can move the drive. If you want
to use the
driving
home
button (F5),
you have to
note the
Character-
istic of NC-
controlled
homing
(see
chapter
2.3).

24
7 Linking of the NC axis and the PLC program
After you have created the PLC program you need to link this program to your NC-axis configuration. Therefore,
every axis needs its own NC-axis structure. Before linking the program to the NC-axis, you must add the
“Tc2_MC2” library from Beckhoff to the project, declare the variable “AXIS_REF” and build the project (see
figures below).

For reading or writing objects from object dictionary of the motor controller through an SDO (Service
Data Object) access you must use the library “Tc2_EtherCAT” (EtherCAT) or “Tc2_System“ (CAN)
from Beckhoff. More information how to use the function blocks “FB_EcCoeSdoRead”,
“FB_EcCoeSdoWrite”, “ADSRead” and “ADSWrite” in this libraries you will find in the Beckhoff
Information System.

25
Copyright:
Festo AG & Co. KG
Ruiter Straße 82
73726 Esslingen
Germany

Phone:
+49 711 347-0

Fax:
+49 711 347-2144

E-mail:
service_international@festo.com
Reproduction, distribution or sale of this document or communication
Internet:
of its contents to others without express authorization is
www.festo.com
prohibited. Offenders will be liable for damages. All rights reserved
in the event that a patent, utility model or design patent is
registered. Original: en

26

You might also like