multi-axis controller cmxr-c2€¦ · tracking functions with the cmxr-c2 multi-axis controller....

116
Multi-axis controller CMXR-C2 Description Tracking programming instructions 571706 1501a [8039867]

Upload: others

Post on 09-Jul-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Multi-axis controller

CMXR-C2

Description Tracking programming instructions

571706 1501a [8039867]

Page 2: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear
Page 3: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Version ______________________________________________________________ 1501a

Designation _____________________________________________ GDCP-CMXR-C2-ST-EN

Order no. ___________________________________________________________ 571706

(Festo AG & Co., 73726 Esslingen, 2015)

Internet: http://www.festo.com

E-mail: [email protected]

Reproduction, distribution and utilisation of this document, as well as the communication of its contents to others without explicit authorisation, is prohibited. Offenders will be held liable for damages. All rights reserved, in particular the right to file patent, utility model and registered design applications.

Festo GDCP-CMXR-C2-ST-EN 1501a 3

Page 4: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Revisions index

Originator:

Manual name: GDCP-CMXR-C2-ST

Filename:

File storage location:

Consec. no. Description Revisions index Date of revision

001 Creation 1002NH 2010-04-15

002 Revision 1501a 2015-01-15

Table 1.1 Directory of revisions

Specified directives/standards

Issue status

EN ISO 13849-1:2008-12

Table 1.2 Directives/standards specified in the document

4 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 5: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Instructions on this documentation

This documentation describes the Tracking technology package and is intended for programmers and users of robots that work in conjunction with the Festo CMXR system.

Identification of dangers and instructions on how to avoid them:

Warning

Dangers which can lead to death or serious injuries.

Caution

Dangers which can lead to slight injuries or to serious material damage.

Other symbols:

Note

Material damage or failure of function.

Recommendation, tip, reference to other documentation.

Necessary or useful accessories.

Information on environmentally friendly use.

Text designation:

• Activities that can be carried out in any order.

1. Activities which should be carried out in the specified sequence.

− General lists.

Festo GDCP-CMXR-C2-ST-EN 1501a 5

Page 6: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Table of contents

Table of contents

1. Safety and requirements for product use .............................................................. 9

1.1 Security ............................................................................................................... 9 1.1.1 General safety information ................................................................... 9 1.1.2 Use for intended purpose ................................................................... 10

1.2 Requirements for product use............................................................................ 11 1.2.1 Qualification of specialised personnel ................................................ 11

1.3 Service .............................................................................................................. 11

2. Introduction ........................................................................................................ 12

3. Hardware ............................................................................................................ 13

3.1 Encoder ............................................................................................................. 13 3.1.1 Encoder connection via Festo CMMx drive .......................................... 14 3.1.2 Standard encoder with 5 V or 24 V signals .......................................... 16

3.2 Object sensing ................................................................................................... 17 3.2.1 Connection of a digital sensor ............................................................ 17 3.2.2 Connecting the Festo vision system .................................................... 18

4. Software .............................................................................................................. 19

5. General tracking function .................................................................................... 20

5.1 Mode of operation ............................................................................................. 20

5.2 FTL programming ............................................................................................... 21

5.3 Relationships of the reference systems .............................................................. 22 5.3.1 Start tracking, moving reference system, SetRefSysDyn ..................... 22 5.3.2 Stop tracking ...................................................................................... 24 5.3.3 Exchange of information to the PLC .................................................... 25

5.4 PLC programming .............................................................................................. 26 5.4.1 Module RCTR_UpdateFrameInterface, update reference system ......... 26

5.5 Applications ...................................................................................................... 28 5.5.1 Placing parts into a mould .................................................................. 28 5.5.2 Tracking of movements on a bending press ........................................ 30

6. Linear tracking .................................................................................................... 32

6.1 Conveyor systems .............................................................................................. 33 6.1.1 Constellations of conveyor systems .................................................... 33 6.1.2 Zero point .......................................................................................... 34 6.1.3 Orientation ......................................................................................... 35

6.2 Encoder system, belt length, sensor position ..................................................... 35

6.3 Object memory, object protocol ......................................................................... 36

6 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 7: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Table of contents

6.4 Processing the objects ....................................................................................... 36 6.4.1 Tracking ............................................................................................. 37

6.5 Setting the objects............................................................................................. 38

7. FTL programming of linear tracking .................................................................... 39

7.1 Object data ........................................................................................................ 39

7.2 CONVEYOR module ............................................................................................ 42 7.2.1 Method start/stop processing, <Begin, End> ....................................... 45 7.2.2 Method wait for next object, <Wait> ..................................................... 46 7.2.3 Method wait until object reachable, <WaitReachable> ......................... 49 7.2.4 Method end object, <Done> ................................................................. 51

7.3 Conveyor module visualisation pages ................................................................ 53 7.3.1 Configuration page ............................................................................. 54 7.3.2 Object memory ................................................................................... 55 7.3.3 Object protocol .................................................................................. 56 7.3.4 Part diagnostics ................................................................................. 57 7.3.5 Statistics page ................................................................................... 58

8. PLC programming of linear tracking .................................................................... 59

8.1 Mode of operation ............................................................................................. 59 8.1.1 Functions of the PLC ........................................................................... 60 8.1.2 Contents of the library RcTracking.lib ................................................. 60

8.2 Object administration ........................................................................................ 61 8.2.1 Object processing with automatic deletion of objects ......................... 62 8.2.2 Object processing with manual deletion of objects ............................. 64

8.3 Object data, object memory ............................................................................... 65 8.3.1 Object data type TRCTR_OBJECT ......................................................... 65 8.3.2 Object status TRCTR_ObjectState ....................................................... 67 8.3.3 Add object, module RCTR_AddObject ................................................. 68 8.3.4 Delete object, module RCTR_RemoveObject ....................................... 70 8.3.5 Read out object data, module RCTR_ReadBuffer ................................ 72

8.4 Delivery system ................................................................................................. 74 8.4.1 Module RCTR_UpdateConvInterface ................................................... 74 8.4.2 Example calculation of ConvReNum / ConvResDenom ........................ 78

8.5 Object protocol .................................................................................................. 78 8.5.1 Module RCTR_ReadLog ...................................................................... 78 8.5.2 Module RCTR_GetLog ......................................................................... 80 8.5.3 Module RCTR_GetLatestLog ............................................................... 82

8.6 Reset object memory, object protocol ................................................................ 84 8.6.1 Module RCTR_ResetData .................................................................... 84

8.7 Reading the statistical data ............................................................................... 86 8.7.1 Module RCTR_ReadStatistic ............................................................... 86

Festo GDCP-CMXR-C2-ST-EN 1501a 7

Page 8: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8.8 Signal conditioning in the PLC ............................................................................ 89 8.8.1 Module RCSP_LagCompensator ......................................................... 90 8.8.2 Module RCSP_SignalInfo .................................................................... 92 8.8.3 Module RCSP_SmoothingFilter ........................................................... 93 8.8.4 Module RCSP_DynLimitFilter .............................................................. 94

8.9 Messages of the modules .................................................................................. 95 8.9.1 System errors (fatal errors)................................................................. 95 8.9.2 Faults ................................................................................................. 97 8.9.3 Warnings .......................................................................................... 100 8.9.4 Information ...................................................................................... 103

8.10 Sensor integration ........................................................................................... 104

9. Linear tracking applications .............................................................................. 105

9.1 Creation of FTL programs ................................................................................. 105

9.2 Applications with a conveyor system ............................................................... 105 9.2.1 Processing of similar objects without sorting .................................... 105 9.2.2 Processing of similar objects, with sorting ........................................ 106 9.2.3 Changing the reference system ........................................................ 108 9.2.4 Placing object correctly positioned on belt ....................................... 108 9.2.5 Arraying objects correctly positioned on belt .................................... 110

8 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 9: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

1 Safety and requirements for product use

1. Safety and requirements for product use

1.1 Security

1.1.1 General safety information

Warning

Insufficient emergency stop equipment.

All emergency stop equipment must remain operative and accessible in all operating modes of the system. Unlocking the emergency stop equipment must not cause an uncontrolled restart of the system!

First check the emergency stop chain, then switch on!

Warning

Unintentional movement of the actuators

Test a new program before commissioning the machine or system.

Warning

Dangerous voltage!

• Unless otherwise specified, maintenance work must always be carried out with the system switched off! When doing this, safeguard the system from being restarted unintentionally or being restarted by unauthorised personnel.

Measuring or test work required on the system should only be carried out by electrical technicians.

Warning

Retrofittings and modifications may impair the safety of the system!

Only use spare parts approved by Festo.

Note

Damage to the product from incorrect handling.

• Never remove or insert a plug connector when powered. • Observe the handling specifications for electrostatically sensitive

devices.

Festo GDCP-CMXR-C2-ST-EN 1501a 9

Page 10: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

1 Safety and requirements for product use

1.1.2 Use for intended purpose The CMXR multi-axis controller is intended to operate a kinematics system in the environment of a machine or automated system.

• Only use the multi-axis controller as follows:

− In perfect technical condition

− in original status without unauthorised modifications, except for the adaptations described in this documentation

− within the limits of the product defined through the technical data

− in an industrial environment.

Warning

The CMXR multi-axis controller is not intended for safety-relevant control tasks (e.g. stopping in the event of an emergency or monitoring of reduced speeds).

The CMXR multi-axis controller conforms to category B of EN ISO 13849-1 and is thus not adequate for the implementation of safety functions for the protection of persons.

• Additional external protective measures that ensure the safe operating status of the entire system even in the event of a malfunction must be adopted for safety-relevant control tasks or for the safety of persons.

Note

The products or system components described may only be used for the applications set out in the description and only in combination with the recommended or permitted external devices.

Note

In the event of damage caused by unauthorised manipulation or other than intended use, the guarantee is invalidated and the manufacturer is not liable for damages.

10 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 11: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

1 Safety and requirements for product use

1.2 Requirements for product use • Provide this documentation to the following persons:

− Design engineer

− Installer

− Commissioner of the machine or system

• Comply with the specifications of the documentation. Follow all accompanying documentation and the documentation of any associated accessories.

• Take the following into consideration for the destination:

− Applicable legal regulations

− Regulations and standards

− Regulations of the testing organisations and insurers

− National specifications

For correct and safe use:

• Observe all warnings and notes.

• Comply with all load limits of the product and the connected components.

1.2.1 Qualification of specialised personnel • The product should only be installed by specialized personnel with corresponding

qualifications.

The following knowledge is required: − installation and operation of electrical control systems

− applicable regulations for operating safety-engineering systems

− Applicable regulations for accident prevention and operational reliability

− Documentation and mode of operation of the product.

1.3 Service • Please consult your local Festo service or write to the following e-mail address if you

have any technical problems ( [email protected]).

Festo GDCP-CMXR-C2-ST-EN 1501a 11

Page 12: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

2 Introduction

2. Introduction This document describes the Tracking technology package and serves for the programming of translatory tracking applications on conveyor systems and general tracking functions with the CMXR-C2 multi-axis controller.

Movements of a kinematics system can thereby be coordinated or synchronised with linear movements of conveyor systems.

The following illustration shows a basic design of a tracking application, consisting of a kinematics system, a control cabinet and a linear conveyor system.

Use of the Tracking technology package requires that the user is familiar with the FTL (Festo Teach Language) programming language and PLC programming according to CoDeSys.

If a vision system is used, the corresponding documentation and instructions must be observed.

12 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 13: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

3 Hardware

3. Hardware The CMXR-C2 multi-axis controller is to be used for executing the Tracking technology package.

Figure: Multi-axis controller CMXR-C2:

3.1 Encoder A special hardware design is needed to implement a tracking application. To determine the position of the workpieces to be followed, feedback in the form of an encoder signal is needed.

The encoder interface, type CECX-C-2G2, is required on the multi-axis controller for this purpose. This is equipped with 2 inputs, each of which can be used for a conveyor system. When using more than 2 conveyor systems (maximum of 4), an additional encoder interface is necessary.

When mounting the encoder interface, the mounting and installation description must be observed ( GDCP-CMXR-C2-HW-…).

The CECX-C-2G2 encoder interface has encoder inputs of signal types TTL 5 V and 24 V. This specification must conform to the encoder used. If the conveyor system's drive is equipped with a Festo drive from the CMMx series (e.g. CMMP-AS or CMMS-AS), the drive controller's encoder output can be used. The pin allocation of the encoder connections is described in the following sections.

X2: Encoder 1

X3: Encoder 2

Festo GDCP-CMXR-C2-ST-EN 1501a 13

Page 14: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

3 Hardware

3.1.1 Encoder connection via Festo CMMx drive The encoder emulation output of the CMMx drive controller works with a 5 V TTL signal level. The pin allocation for each of the inputs/outputs is described below.

Signal CMMx drive regulator Encoder interface CECX-C-2G2

A+ 1 5

A– 6 9

B+ 2 4

B– 7 8

N+ 3 3

N– 8 7

GND, 0 V 4 1

Screening 9 –

Plug connector Sub-D 9-pin (pin) Sub-D 9-pin (pin)

Table 3.1 Pin allocation for CMMx encoder connection

Note

To avoid malfunctions, the earthing concept must be taken into account when applying the screening.

To operate the encoder interface with the 5 V TTL signal, the corresponding setting must be made when configuring the module card. The configuration within the FCT software is shown below.

Selection of the 5 V

signal type

4-fold evaluation

Activate latch input

Adjust input type

according to the

documentation

14 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 15: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

3 Hardware

To use the encoder emulation of the drive controller, it must be activated within the configuration of the respective device.

The following illustration shows activation of the encoder emulation within configuration of the CMMP-AS motor controller.

After the encoder emulation is activated, the resolution (number of lines = number of increments per revolution) must be set. The maximum value of 16384 must be set here.

The screenshot below shows how to set the encoder resolution within the CMMP-AS configuration.

Activation of the encoder simulation

Select the Application Data menu item

A new encoder simulation menu appears

Set the resolution

Festo GDCP-CMXR-C2-ST-EN 1501a 15

Page 16: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

3 Hardware

3.1.2 Standard encoder with 5 V or 24 V signals If a general encoder is used, it can be used with 5 V or 24 V signal types. The pin allocation of the CECX-C-2G2 encoder interface with signal types 5 V and 24 V is described below.

Signal CECX-C-2G2, 24 V signal CECX-C-2G2, 5 V signal

A+ 5 5

A– – 9

B+ 4 4

B– – 8

N+ 3 3

N– – 7

GND, 0 V 1 1

Screening – –

Encoder power supply 5 V – 6

Encoder power supply 24 V 2 –

Plug connector Sub-D 9-pin (pin) Sub-D 9-pin (pin)

Table 3.2 Pin allocation for encoder card CECX-C-2G2

Note

To avoid malfunctions, the earthing concept must be taken into account when applying the screening.

To operate the encoder interface with the available signal type, the corresponding setting must be made when configuring the module card. The configuration within the FCT software is shown below.

The encoder's resolution must be at least 2000 pulses per revolution. To increase the resolution, set 4-fold evaluation in the configuration of the encoder interface.

Selection of 5 V or 24 V

signal type

4-fold evaluation

Activate latch input

Adjust input type

according to the

documentation

16 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 17: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

3 Hardware

3.2 Object sensing To carry out an object sensing, a corresponding sensor is necessary. A simple sensor with a digital output or the Festo vision system can be used. To achieve synchronisation of object sensing with the conveyor system, the sensor must be connected to the latch input of the CECX-C-2G2 encoder interface. The sensor connections are depicted below.

The encoder interface has 2 latch inputs. The DI0 input works in connection with the encoder input X2, the DI1 input with the encoder input X3.

3.2.1 Connection of a digital sensor If a digital sensor, e.g. a through-beam sensor, is used for object sensing, it must be connected to the respective latch input of the encoder interface.

The following figure shows the connection of a digital sensor to the latch input DI0.

When connecting the digital sensor, the connection requirements of the encoder interface must be taken into account.

24 V supply

Latch input DI0 for encoder X2

Latch input DI1 for encoder X3

E

Conveyor

Encoder connection to X2

Connection to latch input DI0

Festo GDCP-CMXR-C2-ST-EN 1501a 17

Page 18: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

3 Hardware

3.2.2 Connecting the Festo vision system When using the Festo vision system, the vision system's flash output must be connected to the latch input of the encoder interface for object synchronisation. Data transmission is carried out via Ethernet.

Connection via Ethernet

To minimize the network load, use of an Ethernet switch is recommended. To set up a local network, the connection to the vision system and operator unit, for example, and possibly to another CMXR control system, should be made via the [X5] Ethernet port.

The [X7] Ethernet port can also be used, but this is intended for connection of remote networks, as it has a gateway address.

Configuration

When configuring the vision system, the corresponding documentation must be considered. To use the flash output of the vision system, the digital output must be configured as “external lighting” within the configuration.

E

Conveyor

Connection to latch input DI0

Encoder connection to X2

Ethernet switch

Ethernet port X5

CMXR-C2

18 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 19: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

4 Software

4. Software The Tracking technology package is included in the associated FCT plug-in CMXR-C2.

The FCT plug-in CMXR-C2 is available for download from the Festo Support Portal ( www.festo.com/sp).

When installing the FCT plug-in CMXR-C2, the operating system of the multi-axis controller, which contains the software of the Tracking technology package, is available and can be loaded onto the CMXR hardware.

To commission the multi-axis controller, the memory card with the operating system must first be installed. This can be done over an active Ethernet connection or using a card reader.

The procedure for initialization should be taken from the Help section of the FCT software.

Festo GDCP-CMXR-C2-ST-EN 1501a 19

Page 20: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5. General tracking function The general tracking function describes pursuit of one or more stand-alone axes with a kinematics system. How the movements can be followed depends on the degrees of freedom of the kinematics system itself. Additional movements of the kinematics system can be superimposed on this movement to process the part, such as filling of a sealing compound.

5.1 Mode of operation The tracking function is activated in the FTL program. For this, a reference system is accessed that is calculated in the PLC and provided with values. The PLC makes available 8 reference systems that can be used for tracking. Through a common memory area, the PLC can exchange the data of the reference systems with the motion control.

The following figure shows the configuration of motion control and the PLC:

To activate the tracking function, the moving reference system must be activated in the FTL program with the command SetRefSysDyn. To supply the reference system with values, the encoder values are prepared in the PLC, for example, and fed to the reference system via system modules.

The necessary functions are described on the following pages.

Mobile axis system (tracking axis)

Position transmitter, e.g.

encoder

FTL

Program

PLC

Program

Process control (PLC) Motion control

CMXR-C2

Kinematics

X = 100, Y = 10

Shared memory

Reference systems

X = 13, Y = -56, A = 34.5

M

E

20 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 21: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5.2 FTL programming In FTL, users have variables available for the tracking frames that are needed to create a reference system. These are in the system-global variable range.

The provision of values to these variables must be triggered via the PLC. The PLC can write these FTL variables via system modules.

Syntax

FrameInterface : ARRAY [8] OF FRAMEITF

These variables are a structured data type that contains the Cartesian position and orientation (according to Euler ZYZ) for the tracking position.

Configuration of FRAMEITF data type

Variable Type Significance Usage

x MAPTO REAL Shift, X-coordinate [mm] read only

y MAPTO REAL Shift, Y-coordinate [mm] read only

z MAPTO REAL Shift, Z-coordinate [mm] read only

a MAPTO REAL Orientation A-coordinate [degree] read only

b MAPTO REAL Orientation B-coordinate [degree] read only

c MAPTO REAL Orientation C-coordinate [degree] read only

itfActive MAPTO BOOL Flag signals that the coordinates were written by the PLC. read only

Table 5.1 Configuration of FRAMEITF data type

All variables can only be read in the FTL program. A description of the variables is not possible.

Festo GDCP-CMXR-C2-ST-EN 1501a 21

Page 22: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5.3 Relationships of the reference systems The reference systems are depicted in the following illustration. The moving tracking axis shown is depicted for simplicity as a more linear system and can also consist of an axis of rotation or combinations.

The basis system for the tracking movement is related to the WORLD system, for example. This basis system represents the zero point for the tracking movement. If the tracking is activated, the moving reference system is the same as the tracking basis system. Based on the moving tracking axis, the moving reference system is now calculated by the PLC and shifts to the tracking basis system.

5.3.1 Start tracking, moving reference system, SetRefSysDyn As an extension to the existing static reference systems, you can use the SetRefSysDyn command to define a dynamic (moving) reference system. This moving reference system is required for the implementation of the tracking function.

To provide the reference system with values, programs on the internal PLC must be implemented. The PLC is responsible for calculation of the reference system values.

Syntax

SetRefSysDyn(<refSys> : REFSYSVAR)

Parameter Significance Unit

refSys Reference system, which is provided with values through the

internal PLC.

Units of length and angle

Table 5.2 SetRefSysDyn command parameter

Use of the SetRefSysDyn macro is treated in the following chapters on the subject of tracking.

Tracking basis system

M

E

X

Y

Z

X

Y

Z

X

Y

Z

Reference system e.g. WORLD

Moving reference system

FrameInterface

Tracking axis

22 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 23: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

REFSYSDATA data type configuration: − baseRefSys : REFSYS Related to the basis system for tracking

− frame : FRAMEITF Related to a data range of shift values

Another reference on which the reference system has an additive impact can be specified using the baseRs parameter.

If reference is to be made to the world coordinate system for the kinematics, the world system variable must be referenced.

If the tracking reference system is activated, all Cartesian movement commands refer to this moving reference system in future.

To activate tracking, a Cartesian positioning command must take place after the reference system is called up. Only then is the tracking movement synchronised.

Example

Data:

refTrack : REFSYSVAR := (MAP(baseTrack),FrameInterface[0]))

Program:

:

SetRefSysDyn(refTrack)

// Running in tracking operation

Lin(pos1)

Lin(pos2)

:

Festo GDCP-CMXR-C2-ST-EN 1501a 23

Page 24: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5.3.2 Stop tracking To stop tracking, a static reference system, e.g. WORLD, must be activated. This can be carried out with the FTL macros SetRefSys, SetRefSys3P or SetRefSysWorld. However, to transfer the tracking movement into a static system, an additional Cartesian positioning command is needed in the static reference system. The synchronised movement is thereby transferred into the static reference system.

Example:

:

SetRefSysDyn(refTrack)

// Running in tracking operation

Lin(pos1)

Lin(pos2)

:

// Release of tracking operation

SetRefSysWorld()

// Additional run command to stop tracking

Lin(home)

24 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 25: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5.3.3 Exchange of information to the PLC If a handshake with the PLC is necessary for the sequence in the FTL program, all interface variables, e.g. plc_InDint, can be used for this. Definition is thereby the task of the application programming.

Example – waiting for a specific value of the conveyor:

The interface variable plc_InDint[3] is cyclically described by the PLC with the conveyor value. This variable is checked with a WAIT instruction. If the conveyor has the corresponding value, tracking is activated via FTL with the SetRefSysDyn command.

:

Lin(pos1)

// Wait until conveyor system is at position 230

WAIT plc_InDint[3] >= 230

SetRefSysDyn(refTrack)

Lin(pos2)

:

Example – start tracking from the PLC:

Following the same principle as the sensing of the conveyor system, a start of the tracking process can be implemented through the variable interface independent of the conveyor. In the example, the variable plc_InDint[5] is used as an information source for the start.

:

Lin(pos1)

// Wait until start

WAIT plc_InDint[5] = 1

SetRefSysDyn(refTrack)

Lin(pos2)

:

M

E

X

Y

Z

X

Y

Z

Moving reference system Moving axis system

Tracking basis system = zero point

plc_VarDint[3] =StartValue

Festo GDCP-CMXR-C2-ST-EN 1501a 25

Page 26: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5.4 PLC programming To use the tracking function, program sequences must be created on the PLC to provide the related reference systems with values.

The modules needed for this are contained in the CoDeSys library RcTracking.lib.

5.4.1 Module RCTR_UpdateFrameInterface, update reference system

With the RCTR_UpdateFrameInterface module, values from the PLC are written on the maximum 8 available reference systems. For the tracking function to work properly, the module must be called up in the MotionTask. The MotionTask must be called up cyclically with the MotionTimer.

Depending on the quality of the position signal, it may be necessary to prepare or smooth it accordingly before use. Function blocks in the library RcSignalProcessing.lib are available for this purpose.

Input data

Variables Type Significance

Enable BOOL Activating the module

FrameNumber DINT Index of the frame system from the PLC

X, Y, Z REAL Cartesian position [mm]

a, b, c REAL Cartesian orientation [degree]

Table 5.3 Input data for RCTR_UpdateFrameInterface module

Enable : BOOL This signal activates the module; it must be applied statically.

FrameNumber : DINT Number of the frame data range. Range of values is 0 to 7.

26 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 27: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

X, Y, Z : REAL Coordinates of the shift in unit mm.

A, B, C : REAL Coordinates of orientation according to the Euler convention ZYZ, in the unit degree.

Output data

Variables Type Significance

ACTIVE BOOL Module is active

Error BOOL Invalid input data

ErrorID TMCE_ErrorID Error number

AnyProgramActive BOOL An FTL program is active

AnyTrackingActive BOOL Tracking is active

ThisTrackingActive BOOL This reference system is active

Table 5.4 Output data for module RCTR_UpdateFrameInterface

Active : BOOL Module is active. This is the acknowledgment to the input enable.

Error : BOOL Group signal, if = TRUE, there is a error. The related error number can be taken from the output ErrorID.

ErrorID : TMCE_ErrorID Return value of the message number. This value is only valid when the output error has the status TRUE. The message numbers are defined in the McUtils.lib.

Message number Significance

0 No error

10001 eMCE_FatalErrMappingFailed

10002 eMCE_FatalErrNullPointer

10003 eMCE_FatalErrDiffMemSize

10005 eMCE_FatalErrMissingCfgParam

10100 eMCE_FatalErrWriteShMem

10203 eMCE_ErrTrackInvalidFrameItf

Table 5.5 Message numbers, module RCTR_UpdateFrameInterface

AnyProgramActive : BOOL The status = TRUE signals that an FTL program is active.

Festo GDCP-CMXR-C2-ST-EN 1501a 27

Page 28: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

AnyTrackingActive : BOOL A tracking operation is active, i.e. a currently set reference system is a moving reference system.

ThisTrackingActive : BOOL This reference system (of the specified ports) is set actively in tracking operation.

5.5 Applications The following chapter describes examples of applications and combinations of conveyor systems.

This chapter does not claim to be complete or correct.

5.5.1 Placing parts into a mould In this example, an insert must be placed into an injection mould. The mould contains a core-puller, which must first be pulled out of the mould to permit entering the mould without collision. To save cycle time, the kinematics with the insert must be moved into the mould at the same time as the core-puller is pulled out. For this the core-puller has a measuring system, with which the position of the core-puller can be determined. With the tracking function, the exiting core-puller can now be followed.

Schematic structure of the application:

Core-puller

Injection mould

Insert

Kinematics

28 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 29: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

Example:

The following variables are used in the example below: − plc_InDint[5], command variable for start and stop. This is written by the PLC, initially

deleted in the FTL program.

− plc_InDint[6], setpoint specification for the PLC of the tracking axis distance that has to be followed.

After starting, tracking is activated in the FTL program. The PLC supplies the data frame of the reference system until the distance of variable plc_OutDint[6] is reached. After that, it terminates tracking with value = 2 in the variable plc_InDint[5].

:

// Tracking distance

plc_OutDint[6] := 346

Lin(pos1)

// Wait until start

WAIT (plc_InDint[5] = 1)

SetRefSysDyn(refTrack)

// Activate run command for tracking

Lin(pos2)

WAIT (plc_InDint[5] = 2)

SetRefSysWorld()

// Run command to stop tracking

Lin(pos3)

:

When the tracking stops, it cannot stop exactly at the desired conveyor position due to reaction times and braking ramps of the set dynamic response.

Festo GDCP-CMXR-C2-ST-EN 1501a 29

Page 30: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

5.5.2 Tracking of movements on a bending press A kinematics system with 2 linear axes and a wrist axis is installed as a handling system on a metal panel bending press. The kinematics system must place a metal panel into the bending press with a defined position. In the bending process, when the stamp of the press moves, the kinematics system must follow the bending of the metal panel and hold it constantly. After the bending process, the bending press opens and the panel can be repositioned for another procedure.

The following illustration shows the procedure:

To follow the bending tool and track the kinematics system in bending, the kinematics system is synchronised with the bending movement via a measuring system on the bending press. For this purpose, a reference system is defined on the bending edge of the workpiece.

Bending press

Kinematics

X

Z

X

Z

Measuring system

A

A

Starting state: • Kinematics insert position • Bending press top

Finished state: • Kinematic in bending end position • Bending press bottom

Displacement encoder

X

Z

Y

Position stamp at start of tracking

Coordinate system for tracking

X

Z

Y

30 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 31: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

5 General tracking function

Process description: − The workpiece is inserted.

− The press moves.

− When the press reaches the workpiece, tracking is activated.

− The press stamp presses the workpiece into the bending die, while at the same time, due to tracking, the reference system is shifted in the Z-direction and, based on the depth and bending angle, rotated around the Y-axis. This shift of the reference system is calculated through the internal PLC and fed to the motion control.

− The kinematics system automatically moves into the end position based on the moving reference system.

Example of FTL program:

In the following example, the tracking is activated and stopped by the PLC via the variable plc_InDint[3]. The bending angle of the bending die must be known in the PLC in order to calculate the rotation of the reference system.

:

// Run to start position

Lin(StartPos)

// Wait for start of PLC

WAIT (plc_InDint[3] = 1)

// Setting of the reference system

SetRefSysDyn(TrackAxis1)

// Activate run command for tracking

Lin(pos1)

// Bending process running

// Wait for start of PLC

WAIT (plc_InDint[3] = 2)

// Tracking off

SetRefSysWorld()

// Run out of the press, set down part

Lin(pos3)

:

Festo GDCP-CMXR-C2-ST-EN 1501a 31

Page 32: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

6. Linear tracking This tracking function serves to synchronise the kinematics movement with a moved object, e.g. a workpiece on a linear conveyor belt. The processes needed for this are created in the FTL programming language and via the integrated PLC (CoDeSys). Through a common memory area, the required data can be exchanged between the systems.

Tracking is conceived so that the PLC is completely in charge of parts administration. It also bears responsibility for this. This means, the PLC is responsible for storing and deleting objects while the motion control takes care of processing the objects.

The following figure illustrates the relationship between motion and process control:

Process description:

The position of the conveyor system is recognised and administered by the PLC. Furthermore, the PLC takes over control of the sensors for object sensing, e.g. a camera or through-beam sensor. Now the objects within the PLC program are sorted or selected as desired and fed to the motion control via an internal interface.

Delivery system

Objects

Object sensing, e.g. with camera or through-beam sensor

Position transmitter,

e.g. encoder

Kinematics

FTL

Program

PLC

Program

Process control (PLC) Motion control

CMXR-C2

ID = 13

Shared memory

used

ID = 47

32 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 33: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

The motion control saves these objects in an internal object memory. This object memory can be accessed using the FTL program and an individual object can be activated in this way. The kinematics system now follows the object, which can be taken from the conveyor system, for example.

To implement a tracking application, programs have to be created on both the motion control page and the process control (PLC) page.

6.1 Conveyor systems The conveyor system moves the objects through the working space of the kinematics system. To identify the location and position of the objects, a sensor, e.g. through-beam sensor or vision system must be installed in front of the working space. The maximum number of conveyor systems within a CMXR control system is limited to 4.

Only linear systems whose positive direction of movement runs along the positive Cartesian X-axis of the kinematics system are possible as conveyor systems.

6.1.1 Constellations of conveyor systems The following figures show possible constellations with different types of conveyor systems.

A physical conveyor with multiple part tracks, in which each track has its own part sensor:

M Sensors for part recognition

Festo GDCP-CMXR-C2-ST-EN 1501a 33

Page 34: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

4 physical conveyors:

6.1.2 Zero point For the application design, there is a shared zero point for all participating systems that have a coordinate system. This means that kinematics systems and the sensors, e.g. through-beam sensor and vision system, have to be calibrated to this shared zero point.

M

M

M M

Kinematics working space

Coordinate system for the kinematics Shared zero point on the

conveyor

34 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 35: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

6.1.3 Orientation Ideally, the level of the conveyor system is vertical to the Cartesian Z-axis of the kinematics system. The conveyor system, however, must be measured and set up.

Note

Based on the application, the conveyor level must be aligned accordingly and precisely to the X-Y level of the kinematics system. Discrepancies can have an influence on the gripping position or even cause damage to the tool and object.

Only linear systems whose positive direction of movement runs along the positive Cartesian X-axis of the kinematics system are possible as conveyor systems.

6.2 Encoder system, belt length, sensor position The encoder signal determines the position and speed of the objects. This signal is decisive for good path behaviour.

To achieve a corresponding precision, the following must be observed: − The distance between sensor position and work space of the kinematics system

should be as small as possible.

− Recording of the belt position, e.g. via an encoder, must reproduce the path of the belt very accurately.

− If controller systems have an elasticity, it is appropriate to install the encoder between the working space of the kinematics system and the sensor position. In this way, the belt position is recorded directly.

Delivery system Objects

Sensor e.g. with camera

Kinematics

Keep distance as small as possible

Delivery system

Encoder with contact

roller on the belt

Example of tap-off of belt position in the working

space:

Festo GDCP-CMXR-C2-ST-EN 1501a 35

Page 36: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

6.3 Object memory, object protocol For saving the objects, every conveyor system has 2 memory areas: − Object memory (maximum 16 places).

− Object protocol (1024 places, executed as ring memory).

Object memory

The object memory can record a maximum of 16 objects. This is supplied with data from the PLC. The FTL program has access to this memory through the corresponding methods and is able to process the objects. This memory is the object interface between the PLC and FTL program. If a selective call of the objects is used, the object call follows the “first-in, first-out” principle. This means, the first of the objects sent by the PLC is processed first. Optionally, the objects can be selectively recalled through an attribute.

Object protocol

The object protocol has 1024 object places. If an object leaves the object memory, because it has already been processed, for example, it is automatically shifted into the object protocol. If necessary, the PLC can now read out this object and process it further. As this memory is implemented as a ring memory, after 1024 objects the original ones are overwritten. The FTL program has no access to the object protocol.

6.4 Processing the objects To be able to process the individual objects, the position and location of the object must be known. This data is transmitted by the PLC to the object memory. To enable the motion control to move to these objects, each object gets its own reference system with the object data, that is, the origin of the reference system is determined through the object data.

In addition, these objects are now moved through the conveyor system. This position of the conveyor system, which is calculated cyclically, is now added in the motion control to the reference systems of the individual objects. As a result, the position of the objects on the conveyor system is recognised and secured.

Through activation of the reference system of an object, the motion control through its internal functions is able to follow the moving object and process it.

The objects are related to a defined reference system on the conveyor system. The reference system must be determined so that the positive X-axis of the reference system points in the positive conveyor direction.

If an object position is determined by a vision system, for example, this must be determined relative to the defined reference system.

36 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 37: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

The following figure shows objects on a conveyor system:

Each conveyor system has its own object memory. This can record a maximum of 16 objects that are set by the PLC. If objects are processed and approved by the motion control, the PLC can determine additional objects.

6.4.1 Tracking If the reference system of an object (from the object data) within the FTL program is activated as a dynamic system, tracking is automatically active. The kinematics system tracks the object based on the position of the dynamic reference system. If a Cartesian positioning command is now initiated, this is valid within the now active reference system of the object.

As the reference system of the object is a dynamic reference system, the FTL macro SetRefSysDyn must be used for activation.

Example:

:

SetRefSysWorld()

Lin(WaitPos)

// Activation of the object reference system = switch on tracking

// The kinematics system now moves with the conveyor system

SetRefSysDyn(part.RefSys)

// Run to positions in relation to the moving object

Lin(AbovePos)

Lin(TakePos)

Lin(AbovePos)

// Activation of a static reference system = tracking switched off

Reference system

of the conveyor

Positive direction of the conveyor = positive X-axis of the conveyor reference system

Reference system

of an object

Y

X

X X

Y

Y Y

Y

X

Festo GDCP-CMXR-C2-ST-EN 1501a 37

Page 38: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

6 Linear tracking

SetRefSysWorld()

// Run command to activate system WORLD

Lin(WaitPos)

:

6.5 Setting the objects The PLC has the task of detecting objects and feeding them to the object memory in the CMXR multi-axis controller. This procedure is uncoupled from processing of the objects by the FTL program.

This means: − If places are available in the object memory, the PLC can send objects.

− Objects that are not processed are deleted automatically or by the PLC, depending on the configuration; through the now free places, the PLC can send new objects.

− The FTL program can be started at any desired time and then process the current objects in the object memory.

If it is not desired that unprocessed objects leave the work space of the kinematics system, the status can be identified in the PLC through the application program and, for example, the conveyor system can be stopped.

38 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 39: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7. FTL programming of linear tracking Programming of the tracking function in FTL is based on the use of modules that have to be instanced.

7.1 Object data Each object has data that are needed for identification and processing of the object. This data is summarised within the structured data type TRACKOBJECT and are needed in the modules and methods for processing the objects.

Syntax <name> : TRACKOBJECT := ( <id> : DINT,

<userId >: DINT,

< refSys >: REFSYSVAR,

< attribute> : DINT

< isReachable> : BOOL,

< hasLeftArea> : BOOL,

< workDistance> : REAL)

Variable Type Significance

id DINT Object ID for identification through the system (internal use)

userId DINT ID for identification through the user

refSys REFSYSVAR Moving reference system of the object

attribute DINT Attributes of the object

isReachable BOOL Shows that the object is reachable

hasLeftArea BOOL Object has left the work space

workDistance REAL Position of the object in relation to the work space

Table 7.1 Data type PART

id : DINT (read only) The variable id is an identification of the object for system-internal processes. It is assigned internally and is not relevant for the application program.

userId : DINT (read only) The variable userId can be used by the application program to identify objects. Administration and assignment are carried out by the application program in the PLC.

Festo GDCP-CMXR-C2-ST-EN 1501a 39

Page 40: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

refSys : REFSYSVAR (read only) The variable RefSys contains the moving reference system. This is cyclically supplied by the PLC with the values fitting the encoder of the conveyor. This variable is used in combination with the macro SetRefSysDyn to activate the tracking.

attribute : DINT (read/write) The attributes are used to classify the object. These are set by the PLC and evaluated within the FTL program, such as to process a special series of objects.

isReachable : BOOL (read only) This Boolean variable signals that the object is located within an area on the conveyor. The PLC can switch the area boundary. If the conveyor belt is stopped, the area boundary is the work space boundary. But in operation, the area boundary for objects is valid.

This variable can be used for interrogating or waiting until the part is in the area.

When programming a program sequence that is not processed in the main run, the status of the objects at the time of program execution can be changed as a result of conveyor movement.

Example: :

IF partData.isReachable THEN

:

END_IF

:

WAIT partData.isReachable

:

hasLeftArea : BOOL (read only) Shows that the object has left the work space.

workDistance : REAL (read only) This is the position of the object on the conveyor in relation to the defined working space. The position can be used, for example, to wait until an object has moved at least a certain distance into the working space.

A position < 0 shows that the object is still in front of the work space.

If position > 0, the object is beyond the start of the work space.

40 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 41: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

Representation of the variables within the tracking system:

The parameters of the individual areas are treated in the following section.

X

Start of work area = minWorkArea

End of area for objects = maxAcceptArea

Y

workDistance > 0

X

Y

hasLeftArea = TRUE isReachable = TRUE

workDistance < 0

End of work area = maxWorkArea

Festo GDCP-CMXR-C2-ST-EN 1501a 41

Page 42: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.2 CONVEYOR module The CONVEYOR module is the illustration of a conveyor system in the CMXR control system. Needed to establish the conveyor system is a reference system whose positive X-axis represents the positive conveyor direction. Further, with regard to the specified reference system, the beginning and end of the work space of the kinematics system must be specified on the conveyor system. An additional parameter is the end of area for processing the objects. This value establishes the position of the object on the conveyor system at which the object can be processed at the latest time.

The maximum number of conveyor systems is limited to 4. And so a maximum of 4 CONVEYOR modules can be created.

The following figure shows the 3 parameters on a conveyor system.

Besides these working space data, the CONVEYOR module also needs an assignment to an object memory, whose maximum number is limited to 4. The object data is exchanged between the motion control and PLC through this interface.

X

X X

X

Y

Y Y

Y

Reference system

of the conveyor

Processing area

Start of work area = minWorkArea

End of area for objects = maxAcceptArea

End of work area = maxWorkArea

X

Y

X+, positive direction of the conveyor

Reference system

of an object

42 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 43: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

Instancing

Instancing of the “CONVEYOR” module establishes the name with which the function of the linear tracking can be used in the FTL programs.

Syntax <Instance name> : CONVEYOR( <interface> : MAPTO CONVITF,

<refSys> : MAPTO REFSYS,

<dataComplete> : BOOL

< minWorkArea> : REAL,

< maxAcceptArea> : REAL,

< maxWorkArea> : REAL )

In all currently loaded FTL projects, only one instance can exist per ConvInterface.

And so a maximum of 4 different CONVEYORs can be instanced simultaneously.

Example of instancing in the datafile (*.tid):

Conv1 : CONVEYOR := (MAP(ConvInterface[0]), MAP(trackBase), TRUE, 800, 1280, 1310)

Variables for instancing

Variable Type Significance

interface MAPTO CONVITF System variable as reference to the object memory

refSys MAPTO REFSYS Basis reference system, all positions or the moving reference

systems reference themselves to this system

dataComplete BOOL Internal data variable that cannot be changed

minWorkArea REAL X-coordinate from the start of the work space

maxWorkArea REAL X-coordinate from the end of the work space

maxAcceptArea REAL X-coordinate, end of area up to which objects are processed.

Table 7.2 Variables CONVEYOR module

Festo GDCP-CMXR-C2-ST-EN 1501a 43

Page 44: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

interface : MAPTO CONVITF The index describes a reference to the memory area in which the object data is stored. Each conveyor has its own memory area. A maximum of 4 areas are available.

Made available for connection with the object memories are 4 system variables that must be used for the assignment:

System variable Significance

ConvInterface[0] Object memory 1

ConvInterface[1] Object memory 2

ConvInterface[2] Object memory 3

ConvInterface[3] Object memory 4

Table 7.3 Object memory system variable

refSys : MAPTO REFSYS This is the statistical reference system of the conveyor system. What is important is that the conveyor direction always points in the positive X direction. If, for example, a vision system for object sensing is integrated, it must be calibrated to the same reference system.

minWorkArea, maxWorkArea, maxAcceptArea : REAL These 3 variables describe the beginning and end of the work space of the kinematics system in relationship to the reference system of the conveyor system ( Ошибка! Используйте вкладку "Главная" для применения Überschrift 2 к тексту, который должен здесь отображаться. Ошибка! Используйте вкладку "Главная" для применения Überschrift 2 к тексту, который должен здесь отображаться.).

The variable maxAcceptArea is the limit of the area up to which the objects are processed. Related to the conveyor speed and necessary movements in tracking, e.g. lifting objects, it must be set so that the kinematics system does not reach the end positions. This limit is to be determined through testing.

Methods

The CONVEYOR module has the following methods:

Method Description

Begin Start of processing

End End processing

Wait Wait for the next object

WaitReachable Wait until object is in a reachable position

Done Acknowledgment that object processing is completed

Table 7.4 Methods of CONVEYOR module

44 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 45: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.2.1 Method start/stop processing, <Begin, End> The method Begin sets the output RcActive of the RcConveyor module to TRUE on the interface to the PLC ( 8.4 Module RCTR_UpdateConvInterface). The PLC is thereby signaled that the motion control is ready.

The method End sets this variable to FALSE. Further actions must be programmed in the PLC.

Use of Begin and End has no influence on the tracking function and is not necessary for this. They serve only as information for functions in the PLC program.

Syntax

<Instance name>.Begin( )

<Instance name>.End( )

Example

:

// Activate signal to the PLC tracking

Conv1.Begin()

:

Lin(pos1)

:

// End signal to the PLC tracking

Conv1.End()

:

Message numbers

Number Type Message Id Cause Return value

1165 Error eRcErrorVarNotMapped Function was called up without previously connecting the module with a conveyor interface.

Table 7.5 Messages Method Begin and End

Festo GDCP-CMXR-C2-ST-EN 1501a 45

Page 46: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.2.2 Method wait for next object, <Wait> With this method, the next object is read from the memory located at the front-most position. If no order is important in object processing, with this method the objects can be processed in the order in which the PLC sent them to the motion control.

If there is currently no object in the memory, the FTL program stops until an additional object is sent by the PLC.

Syntax

<Instance name>.Wait( object : TRACKOBJECT,

OPT attribute : DINT,

OPT distance : REAL):DINT

Variable Type Significance

object TRACKOBJECT Returns the object data

attribute DINT Optional value for an attribute

distance REAL Optional value for the conveyor path

Table 7.6 Variable Method Wait

object : TRACKOBJECT Returns the data structure of the next object selected via the Wait method based on the specifications.

attribute : DINT Definition of attributes for classifying objects. If a value is specified for this optional parameter, a search is made for the next object in the list that fulfils this attribute.

If the value 0 is entered as the attribute, it has the same effect as no entered attribute.

The next possible object is activated.

distance : REAL The distance is measured that the conveyor travelled since the Wait command. The method is cancelled if the measured distance is greater than specified in the “distance” parameter. When Wait is called, the conveyor path is measured relative to the time of the call. If this distance is exceeded, the Wait method is cancelled. This status can be queried via the method's return value.

46 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 47: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

Message numbers, return values:

Message number

Type Message Id Cause Return value

1165 Error eRcErrorVarNotMapped Function was called up without previously connecting the module with a conveyor interface.

2

1412 Error eMacroErrorNotInitialized Tracking module was not initialised.

2

2559 Warning eMacroWarningTrackItfNot

Active

The tracking interface is not active at the PLC.

–*)

2758 Warning eMacroWarnTrack-

WorkObjActive Transferred object structure contains object that is not active yet.

2760 Warning eMacroWarnInitTrackObjFai

led

Tracking system could not be created

2

3785 Info eMacroInfoTrackWait-

DistExceeded Specified maximum waiting distance was exceeded.

1

3786 Info eMacroInfoTrack-

WaitPLCAbort The method was cancelled by the PLC

1

*) – = no feedback

Table 7.7 Messages Method Wait

Mode of operation

All available objects are available to the motion control in a memory area. The Wait method searches through this memory for the next object that corresponds to the specifications with attributes, if applicable.

The following table shows an example for a memory configuration:

User ID Shift Attribute

12 X = 132, Y = 45, A= 6.75 45

17 X= 34.5, Y=67, A= -34.8 79

39 X = 101.6, Y= 89.5, A= 0.8 79

17 X= 78.3, Y=34.6, A=-15.8 45

39 X= 49.2, Y=66.9, A= 45.7 45

Table 7.8 Memory configuration

The top element is the oldest object in the memory. With the Wait method, the memory is always searched through from the start until an object is found that meets the requirements.

Festo GDCP-CMXR-C2-ST-EN 1501a 47

Page 48: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

Examples:

Conv1.Wait(partData)

The call is made without attributes. The method returns the object with ID = 12.

Conv1.Wait(partData, 79)

Now, using the attribute, a search is made for the object that corresponds to the attribute. And so the method returns the object with ID = 17. This is the first object in the memory that corresponds to the transmitted attribute.

Conv1.Wait(firstPart, 45)

Conv1.Wait(nextPart, 45)

The first call returns the object with ID = 12; the next call returns the object with ID = 17. Each object can be read out only once.

If an object is read out of the memory with the Wait method, it remains contained in it. An additional call of Wait then immediately accesses one of the next objects. The previously read-out object is thus not read out again. If necessary, this must be secured in variables within the FTL program.

48 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 49: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.2.3 Method wait until object reachable, <WaitReachable> The method WaitReachable waits until the specified object is in the processing area of the kinematics system. The required object data must previously be read out with the method Wait.

Syntax

<Instance name>.WaitReachable( <object> : TRACKOBJECT): DINT

Variable Type Significance

object TRACKOBJECT Object data that were previously determined with Wait.

Table 7.9 Variables Method WaitReachable

object : TRACKOBJECT Transfer of the object data previously read out with the method Wait. The WaitReachable method works like the WAIT instruction in the FTL program.

A distinction is made between the following 2 cases:

In the precalculation of movement commands, it is recognised that the object is reachable: If it is recognised in advance of the program calculation that an object is reachable, the method is ended immediately and the program execution continued. Skipping of individual positions is thus possible and unproblematic.

The object is not reachable in the actual processing of movement commands: If the actual program processing reaches the method WaitReachable without the object being reachable, program processing stops. This results in stopping of the kinematics system. The precalculation of movement commands is stopped until the object is located in the work space.

Messages, return values:

Number Type Message Id Cause Return value

1165 Error eRcErrorVarNotMapped Function was called up without previously connecting the module with a conveyor interface.

2

1412 Error eMacroErrorNotInitialized Tracking module was not initialised.

2

2559 Warning eMacroWarningTrackItfNot

Active

The tracking interface is not active at the PLC.

–*)

3787 Info eMacroInfoTrack-WaitReachPLCAbort

The method was cancelled by the PLC

1

*) – = no feedback

Table 7.10 Messages Method WaitReachable

Festo GDCP-CMXR-C2-ST-EN 1501a 49

Page 50: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

As an alternative to the method WaitReachable, the Boolean variable isReachable, located in the read-out object data, can be used for checking and waiting.

If an object is not yet in the processing area of the kinematics system, the kinematics system can already be prepositioned at the start of the work space. The status of the object can be read out with the variable isReachable.

Example:

In the following example, the kinematics system is already prepositioned at the start of the work space, since the object is not yet reachable.

:

Lin(Pos)

Conv1.Wait(partData)

IF NOT partData.isReachable THEN

// Determination of the Y-position

waitPos.y := partData.refsys.y

// X-position beginning of work space

waitPos.x := 580

Lin(waitPos)

END_IF

WAIT partData.isReachable

SetRefSysDyn(partData.refsys)

Lin(partPos)

:

If the variable isReachable is used, e.g. for IF branches, such instructions are executed in advance of the FTL program processing. The status of the variable isReachable could have changed at the time of the main run, but this will no longer be considered in the main run.

50 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 51: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.2.4 Method end object, <Done> The method Done is used to identify an object as processed. When it is called, the transferred object is removed from the object memory and can no longer be used. This means that the reference system for this object is no longer valid and so can no longer be used. After Done is called, the object is copied with all its data into the protocol memory, which is implemented on the PLC page. If necessary, these data can be used for additional processing in the PLC.

When the method Done is executed, the position of the object in relation to the conveyor as well as a time stamp with date and time is automatically saved in the object data.

This data can be read out and processed by the PLC and used for further diagnostics. For this reason, the method Done should be called up very quickly, so that the determined data is as current as possible.

Syntax <Instance name>.Done( <object> : TRACKOBJECT,

OPT <state> : BOOL)

Variable Type Significance

object TRACKOBJECT Object data of the affected object

state BOOL Return value of processing

Table 7.11 Variables Method WaitReachable

object: TRACKOBJECT Data of the object.

state : BOOL A processing status can be set with the optional state variable. This is stored in the object status and can be further processed on the PLC page ( 8.3.1 Object data type TRCTR_OBJECT).

TRUE Object successfully processed.

FALSE Processing was not successful.

If this optional variable is not specified, the value TRUE is always set for this object and thus transmitted as the Status to the PLC.

Festo GDCP-CMXR-C2-ST-EN 1501a 51

Page 52: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

Possible messages:

Number Type Message Id Cause Return value

1165 Error eRcErrorVarNotMapped Function was called up without previously connecting the module with a conveyor interface.

–*)

1783 Error eMacroErrorTrackInvalidObject Function was called up with invalid object data

1784 Error eMacroErrorTrackFrameNotMapped Object's tracking data is invalid.

2559 Warning eMacroWarningTrackItfNotActive The conveyor interface is not active on the PLC.

*) – = no feedback

Table 7.12 Messages Method Done

Calling up the Done method is not permitted while the object's reference system is active. For the object data to be removed from the object memory, another reference system must be activated before the Done method is called.

Example:

:

Lin(Pos)

Conv1.Wait(partData)

// Reference system of the object

SetRefSysDyn(partData.refsys)

Lin(AbovePartPos)

Lin(TakePos)

Vacuum.Set()

Lin(AbovePartPos)

// New reference system

SetRefSysWorld()

// Delete object

Conv1.Done(partData)

:

52 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 53: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.3 Conveyor module visualisation pages If a project is loaded with a created Conveyor module, a visualisation page of the module can be called up via the pushbutton on the operator unit.

Data can be changed and viewed on this page.

Data can only be changed when no program with Tracking function is loaded. A view of the data is always possible.

With entry into the visualisation mask, the configuration page of the Conveyor module appears. Other masks can be selected using the softkeys.

Illustration of configuration page:

Meaning of the softkeys:

Configuration page

Object memory

Object protocol

Part diagnostics

Statistics page

Pushbutton for

visualisation pages Tracking

visualisation page

Festo GDCP-CMXR-C2-ST-EN 1501a 53

Page 54: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.3.1 Configuration page The configuration page of the Conveyor module includes the parameters of the module as well as other data that is used for display purposes and cannot be changed.

Illustration of configuration page:

Number Changeable Module variable Significance

1 Yes Interface Interface to the internal object memory

2 Yes refSys Reference system of the conveyor

3 Yes minWorkArea Start of the work space, related to the zero point of the

conveyor.

4 Yes maxWorkArea End of the work space, related to the zero point of the

conveyor.

5 Yes maxAcceptArea Last position to process objects, related to the zero point of

the conveyor.

6 No – Tracking module ready

7 No iftActive Module activated through the PLC

Table 7.13 Configuration page data

3

1

7

2

4

5

6 Selection of the module

54 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 55: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.3.2 Object memory This page displays the 16 memory locations of the internal object memory ( 6.3

Object memory, object protocol).

The display of the object memory comprises 8 objects. Shifting to the other objects is made via the pushbuttons or .

Column name Significance

Idx Index of the object in the object memory from 0 to 15.

UserID User identification, which is assigned by the PLC program via the module

RCTR_AddObject.

Attribute Object attributes set by the PLC user program.

Actpos Current position of the object on the conveyor system, related to the zero point of the

conveyor system.

State Current status of the object; this can change at any time.

X Cartesian X position during identification of the object.

Y Cartesian Y position during identification of the object.

A Orientation according to Euler, rotation around the Z-axis during identification of the

object.

Table 7.14 Meaning of object memory columns

The data displayed in columns X, Y and A represent the position values of the object when detected, e.g. via a vision system.

Selection of the module instance Switching to other objects

Festo GDCP-CMXR-C2-ST-EN 1501a 55

Page 56: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.3.3 Object protocol The object protocol with its 1024 records, which contain the history of the processed objects, is shown on this page ( 6.3 Object memory, object protocol).

The following softkeys are used for navigation:

Display of the 8 oldest objects, whereby the bottom object is the oldest.

Display starting with the newest object.

scroll back a page.

scroll forward a page.

Display of the newest object with automatic update of the display.

Column name Significance

Idx Index of the object in the object memory from 0 to 15.

Time Time stamp of when the entry was made.

UserID User identification, which is assigned by the PLC program via the module

RCTR_AddObject.

Attribute Object attributes set by the PLC user program.

Endp. Conveyor position at which the object status Processed was set.

State Status of the object during entry in the object protocol.

X Cartesian X position during identification of the object.

Y Cartesian Y position during identification of the object.

A Orientation according to Euler, rotation around the Z-axis during identification of the

object.

Table 7.15 Meaning of object protocol columns

Selection of the module instance Manual input of the display's start index

56 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 57: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.3.4 Part diagnostics The Part diagnostics page illustrates the data of the last processed object as well as minimum and maximum values of all processed objects.

The following are displayed as a minimum and maximum value: − Conveyor speed

− Average of the processed objects per minute

− Position value X, Y and A with the respective UserID

This illustration can be used to diagnose the position data of the Part recognition. The conveyor speed is determined via the mean value of the last 10 actual values.

Resetting of displayed values:

The conveyor speed is reset through the rising edge at the Enable input of the module RCTR_UpdateConvInterface via the PLC. Resetting of the object data is carried out with each Reset statistic via the module RCTR_ReadStatistic, which is also controlled from the PLC.

Selection of the module instance

Last processed object

Values of the conveyor and processed objects/minute

Min./max. value of X, Y and A with related UserID

Festo GDCP-CMXR-C2-ST-EN 1501a 57

Page 58: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

7 FTL programming of linear tracking

7.3.5 Statistics page The data of the objects are illustrated on the statistics data. Records can be conducted with this page, e.g. to investigate effects of process optimizations.

Recording can be reset via the softkey . This does not affect the long-term statistical record in the PLC.

Selection of the module instance

Received objects

Processed objects

Non-processed objects

Active objects that are waiting and in process.

58 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 59: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8. PLC programming of linear tracking This chapter describes the programming of the PLC based on CoDeSys V 2.3 for the tracking application with linear conveyor systems. The module library RcTracking.lib is available to create a tracking application.

For additional information on programming the PLC, please refer to the corresponding documentation.

8.1 Mode of operation The CMXR-C2 multi-axis controller has a shared memory that the process control and motion control (RC) can access. With modules, the PLC can now copy objects into this shared memory. Ideally, the PLC has its own object memory in which objects are stored that are identified, for example, by a vision system. This object memory must be created individually, suitable for the application.

The total of object memories in the shared memory is 4. Each object memory can accept a maximum of 16 objects. If objects are processed and deleted by the motion control, the PLC can copy additional objects into this memory.

The modules must be called up in the MotionTask, so that they can be updated cyclically with the MotionTimer.

If these modules are assigned to another task, the tracking function will not work.

The necessity of assigning to the MotionTask can be inferred from the description of the individual modules.

PLC

FTL program Object

memory in the

shared

memory

Motion control

System module

Own object memory

Festo GDCP-CMXR-C2-ST-EN 1501a 59

Page 60: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.1.1 Functions of the PLC The PLC is in charge of the complete parts administration process and is responsible for: − Sending the object data into the object memory,

− Deletion of the object data from the object memory (optional),

− Reading out the object status from the object and protocol memory,

− Construction of statistics in the user program (optional).

In order to identify objects, the coupling of a sensor system, e.g. through-beam sensor, vision system, etc. must be integrated in the user program. If necessary, a parts administration of the detected objects must be built in.

Modules are available to operate the tracking function from the PLC. These are stored in the library RcTracking.lib.

8.1.2 Contents of the library RcTracking.lib The following table illustrates the modules in the library RcTracking.lib.

Module Significance

RCTR_UpdateFrameInterface Update dynamic reference system

RCTR_UpdateConvInterface Module for the conveyor unit

RCTR_AddObject Write objects into the memory

RCTR_RemoveObject Delete objects from the memory

RCTR_ReadBuffer Read out object memory

RCTR_ReadLog Read out object protocol

RCTR_GetLog Read out specific object from object protocol

RCTR_GetLatestLog Automatically read out object from protocol

RCTR_ResetData Clear memory

RCTR_ReadStatistic Read out statistic data

Table 8.1 Modules library RcTracking.lib

The modules are described in detail in the following chapters.

Only the description of the module RCTR_UpdateFrameInterface is located in another chapter ( 5.4.1 Module RCTR_UpdateFrame).

60 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 61: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.2 Object administration Administration of the objects is managed in 2 sub-memories: − Object memory for active parts that are being processed.

− Object protocol for processed parts.

Each conveyor module has its own sub-memory. The object data themselves are managed within a data structure.

The system provides 4 conveyor systems. Each conveyor system has its own object memory with 16 objects and a protocol memory for up to 1024 objects.

Object 1

Object 2

Object 3

Object ….

Object 16

Object memory

Object memory for processing of max. 16

objects Process objects through FTL program

Object 1

Object 2

Object 3

Object ….

Object 1024

Object protocol

Objects automatically in the object protocol through the system

Add objects through PLC

Read out object protocol through PLC

Possible visualisation of statistics

Object protocol for archiving of max.

1024 objects

Festo GDCP-CMXR-C2-ST-EN 1501a 61

Page 62: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.2.1 Object processing with automatic deletion of objects It is possible that the multi-axis controller automatically deletes processed objects or objects that have moved from the working space. This behaviour is determined via the ManualRemoveObjects input of the RCTR_UpdateConvInterface module. Setting the input to FALSE activates this function.

This procedure makes sense when the objects are not interesting for further use, for example because the conveyor system has an object return or a subsequent kinematics system has its own sensors for renewed object sensing.

The PLC program must be constructed as follows: − Sending of objects via the RCTR_AddObject module

− Possible reading out of statistics, object memory and object protocol for diagnostics and visualisation

Use of the RCTR_RemoveObjekt module is not possible.

62 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 63: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

The process of automatic object deletion is illustrated in the following figure.

The sequence in reading out the objects with CONVEYOR.Wait does not have to match the sequence of adding via the module RCTR_AddObject.

Object 1

Object 2

Object 3

Object ….

Object 16

Object memory

Read out object CONVEYOR.Wait

Set status object processed

CONVEYOR.Done

Add object RCTR_AddObject

Object 1

Object 2

Object 3

Object ….

Object 1024

Object protocol

Set status object out of the work space

Check objects whether processed or out of the

work space

Delete objects from memory and copy

into protocol.

Read out object memory

Read out object protocol

Visualisation statistics

Sensors for object sensing

Internal object administration

PLC user program System function FTL user program

Key:

Festo GDCP-CMXR-C2-ST-EN 1501a 63

Page 64: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.2.2 Object processing with manual deletion of objects The following figure illustrates the process of manual object deletion by the PLC user program.

Further processing of objects that may have moved from the work space can, for example, be executed so that the objects are returned to the internal object administration of the user program and they are made available to another kinematics system.

Object 1

Object 2

Object 3

Object ….

Object 16

Object memory

Read out object CONVEYOR.Wait

Set status object processed

CONVEYOR.Done

Add object RCTR_AddObject

Object 1

Object 2

Object 3

Object ….

Object 1024

Object protocol

Set status object out of the work space

Check objects with RCTR_GetLatestLog

Delete objects from memory with module

RCTR_RemoveObject, automatically copied into

protocol.

Read out object memory

Read out object protocol

Visualisation statistics

Sensors for object sensing

Internal object administration

PLC user program System function FTL user program

Key:

Object processed

Object from work space

64 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 65: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.3 Object data, object memory To process the data of individual objects, these must be stored within a data structure. This structure is used in the modules described in the following.

8.3.1 Object data type TRCTR_OBJECT

Structure variables data type TRCTR_OBJECT:

Variable Type Significance

id DINT Identification of the object

userId DINT Identification of the user

state TRCTR_ObjectState Status of the object

logDate DATE Date of completion of processing

logTime TIME Time of completion of processing

detectionPos DINT Conveyor position at detection

donePos REAL Position of the object at ready message

pos TRCTR_CartFrame Position of the object

attribute DWORD Attribute of the object

workAreaReserve REAL Working area reserve

Table 8.2 Data type TRCTR_OBJECT

Id : DINT Identification for internal purposes. This value is assigned internally and cannot be changed by the user.

userId : DINT Identification number for the object. This is defined and assigned by the user. This identification is not used internally in the system and has a significance for the user. It is advisable to use this Id only once within the object memory and object protocol.

state : TRCTR_ObjectState Return of the object status in the form of an enumeration ( 8.3.2 Object status).

logDate : DATE, logTime : TIME These two variables include date and time at which the object was reported finished.

detectionPos : DINT Encoder value in increments at the time of object sensing.

Festo GDCP-CMXR-C2-ST-EN 1501a 65

Page 66: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

donePos : REAL Position of the object on the conveyor belt at the time at which the Done method was called up in the FTL program. This value is used, for example, to determine in what area of the conveyor parts were processed. This can be used, for example, to control the speed of the conveyor in order to fully use the kinematics system.

pos : TRCTR_CartFrame Cartesian position and orientation of the object at detection.

Structure variables data type TRCTR_CartFrame:

Variable Type Significance

x, y, z REAL Cartesian position

a, b, c REAL Cartesian orientation

Table 8.3 Data type TRCTR_CartFrame

This structure is used to specify the position of an object related to the origin of the part recognition. − X is positive in the direction of conveyor belt movement,

− Y is the direction lateral to the direction of movement and

− Z is the height above the conveyor belt.

If new objects are recognised using sensors (e.g. through-beam sensor), the position of the object is typically 0 (all 6 elements of TRCTR_CartFrame are 0). If a camera is used, X and Y as well as A (rotation around Z) can normally be determined. The orientations (A, B and C) must be specified in the form of the rights system. In addition, orientations must be specified according to the Euler convention ZYZ.

If a rotation of the object around Z is needed and the kinematics system used has 4 degrees of freedom, the rotation must be specified in A and not in C.

Due to the 4 degrees of freedom, only A is displayed on the operator unit.

attribute : DWORD Attributes of the object. These can be defined via a vision system, for example, or described by the PLC according to a special pattern. This attribute can be accessed in the FTL programming and, if necessary, objects selected from the memory.

workAreaReserve : REAL Specification of the working space reserve of objects. This value is specified as a percentage and refers to the gripping point (CONVEYOR.Done) on the area CONVEYOR.minWorkArea to CONVEYOR.maxWorkArea.

66 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 67: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.3.2 Object status TRCTR_ObjectState Each object in the memory has a status that is saved in the object data.

The following table shows the respective statuses.

Enumeration Value Significance

eRCTR_ObjectStateUnknown 0 Object status unknown

eRCTR_ObjectStateSuccess 1 Object successfully processed, deleted from memory

eRCTR_ObjectStateError 2 Object not successfully processed, deleted from memory

eRCTR_ObjectStateLeftArea 3 Object has left the work space without being processed,

deleted from memory

eRCTR_ObjectStateRejected 4 Object was rejected by the controller (internal object

processing error).

eRCTR_ObjectStateDoneError 11 Method Done called up with status = FALSE, not

successfully processed

eRCTR_ObjectStateLeftAreaDetected 12 Object has left the work space without being processed

eRCTR_ObjectStateLeftArea 13 Object has left the work space unprocessed, but is still in

the object memory

eRCTR_ObjectStateUnprocessed 14 Object was rejected by the controller (internal object

processing error), but is still in the object memory.

eRCTR_ObjectStateWaiting 20 Object is ready and has not yet been picked up with

method Wait.

eRCTR_ObjectStateWorking 21 Object was picked up with method Wait and is in processing

eRCTR_ObjectStateInRestrArea 22 Object is located in the area between MaxAcceptArea and

MaxWorkArea

Table 8.4 Object status TRCTR_ObjectState

Festo GDCP-CMXR-C2-ST-EN 1501a 67

Page 68: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.3.3 Add object, module RCTR_AddObject With the module RCTR_AddObject, object data is written to the object memory. Parts recognition must be programmed separately.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0.

EXECUTE BOOL With the rising edge, the object data is taken over into the object

memory. If no further object can be accepted, e.g. memory is full,

an error is signaled with the output variable Error. The output

variable ErrorId then includes the corresponding error code.

Object TRCTR_OBJECT Object data of the new object to be created.

Output data

Done BOOL If = TRUE, then the object data were successfully accepted in the

object memory.

Error BOOL If an error is triggered through acceptance of the new object data,

this is shown through this output variable (= TRUE).

ErrorID TMCE_ErrorID In case of an error (partError = TRUE), an error number is

displayed with PartErrorId

Table 8.5 Data for module RCTR_AddObject

To create an object, the data of the input variable Object must be described. It is thereby necessary to provide the variables of the structured data type TRCTR_Object with corresponding data: − userId

− detectionPos

− attribute

All other data is not relevant for adding an object. These are generated by the system or at the execution time.

68 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 69: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_AddObject

Message number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

10260 eMCE_WarnTrackBufferFull

Table 8.6 Error numbers for module RCTR_AddObject

Festo GDCP-CMXR-C2-ST-EN 1501a 69

Page 70: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.3.4 Delete object, module RCTR_RemoveObject The module RCTR_RemoveObject deletes individual objects from the object memory. Objects that are currently being worked on (status eRCTR_ObjectStateWorking) cannot be deleted.

If the input ManualRemoveObjects in the module RCTR_UpdateConvInterface is set to False, objects that are processed or have left the work space are automatically deleted from the memory. In this case, deletion is not necessary.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0

EXECUTE BOOL With the rising edge, the specified object is deleted from the

memory.

Object TRCTR_OBJECT To delete the corresponding object, its object data must be

specified.

Output data

Done BOOL When deletion is successful, this signal is TRUE.

Error BOOL If an error is generated during deletion of the object, this flag is

set to TRUE.

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed

with ErrorId.

Table 8.7 Data of module RCTR_RemoveObject

70 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 71: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_RemoveObject

Error number ErrorID

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

10251 eMCE_WarnTrackBufferObjNotFound

10265 eMCE_WarnTrackRemoveActiveObject

Table 8.8 Error numbers of module RCTR_RemoveObject

Festo GDCP-CMXR-C2-ST-EN 1501a 71

Page 72: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.3.5 Read out object data, module RCTR_ReadBuffer The object memory has the function of administering objects for processing. This memory is described via the PLC; the FTL program takes it for further processing. The object memory can administer a maximum of 16 objects.

Reading object data out of the object memory is controlled through the memory's index. The range of values of the index goes from 0 to 15.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0.

EXECUTE BOOL With the rising edge, the status of the object is read out.

Index DINT Access to one of the 16 memory locations of the object memory

from which the data is to be read out. Valid are the values 0 to 15.

Output data

Done BOOL With the rising edge of the signal, the data at the outputs are valid

and can be processed.

Error BOOL There is an error

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed

with ErrorId.

Object TRCTR_OBJECT Returns the object data.

Table 8.9 Data of module RCTR_ReadBuffer

If no valid object is in the specified memory location, the status Unknown is returned in the variable Object.state.

72 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 73: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ReadBuffer

Error number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

10204 eMCE_ErrTrackInvalidBufferIdx

Table 8.10 Message numbers of RCTR_ReadBuffer

Festo GDCP-CMXR-C2-ST-EN 1501a 73

Page 74: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.4 Delivery system

8.4.1 Module RCTR_UpdateConvInterface The CoDeSys module RCTR_UpdateConvInterface activates a conveyor system with its object memory and protocol memory. Without calling up of the module, and thus activation of a conveyor system, no other module can access memory areas.

Functions of the module: − Transfer of the conveyor position = encoder position

− Definition of the conveyor unit (e.g. mm) through factors.

− Cyclical updating of objects in the object memory with the current conveyor position.

− Activation of functions, e.g. enable of the area of the working space end.

Parts recognition through a vision system or a through-beam sensor, for example, as well as determination of the position of the conveyor system is not a component of the module and must be created separately.

Processing of the module must take place in the MotionTask.

For the sum of the variables WaitingObjects and ActiveObjects, the rule is:

WaitingObjects + ActiveObjects <= 16

74 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 75: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Input data

Enable BOOL This signal activates the module. It must be statically on. If this

signal has the value = FALSE, no further object can be taken

with the method Wait() in the FTL program. The Enable signal is

essential for object processing.

InterfaceNumber DINT The connection to the internal object memories is made

through the index. There are a maximum of 4 object memories.

The permitted range of values is 0 to 3. The first object memory

is reference by 0.

ConvPos DINT The absolute position of the conveyor is specified here in

increments. Overflows are automatically taken into account in

the module.

ConvResNum DINT These two whole-number values determine a factor for

conversion of increments into the desired unit, e.g. millimetres.

Calculation is made by the division of ConvResNum /

ConvResDenom. Division of the increments with this factor

results in the desired unit.

ConvResDenom DINT

ManualRemoveObjects BOOL If this flag is set (= TRUE), processed objects (in FTL call-up of

the method Done) or objects that leave the work space must be

deleted from the object memory with the module

RCTR_RemoveObject.

If the input has the status FALSE (standard setting), the objects

are automatically deleted from the memory by the system.

AllowRestrictedArea BOOL This flag activates the area beyond the acceptance limit up to

the work space end. As a rule, this is activated by the PLC

during a conveyor stop.

AbortWait BOOL With the rising edge, all waiting objects in the object memory

are cancelled.

In the FTL program, the module methods Wait or

WaitReachable of the Conveyor module return the

corresponding status.

Festo GDCP-CMXR-C2-ST-EN 1501a 75

Page 76: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Output data

ACTIVE BOOL Module is active. This is the acknowledgment to the input

enable.

RcActive BOOL If the FTL program calls up the method Begin, this output

has the status TRUE. This output is reset with call-up of the

method End or at the end of the FTL program. This

information, if desired, can be processed further in the

PLC.

Error BOOL If an error is present, this flag is set to TRUE.

ErrorID TMCE_ErrorID In case of an error (partError = TRUE), an error number is

displayed with PartErrorId

AnyProgramActive BOOL An FTL program is active.

AnyTrackingActive BOOL This signal shows that the tracking operation is active. A

currently set reference system is a moving system (FTL

Macro SetRefSysDyn).

ThisTrackingActive BOOL Tracking is controlled by a reference system administered

by this Conveyor module.

RobWaitActive BOOL With the method Wait, the FTL program waits for the next

object.

RobWaitReachableActice BOOL With the method WaitReachable, the FTL program waits

until the selected object is reachable.

WaitingObjects DINT Number of parts in the parts buffer that have not yet been

read out with the method Wait.

ActiveObjects DINT Number of parts in the object memory that are in process.

These were read out of the memory with the method Wait

in the FTL program. The method Done was not called up

yet.

BufferReady BOOL In the object memory, there is space for at least one

additional object. As long as this flag has the status TRUE,

additional objects can be written to the memory with the

module RCTR_AddObject.

ObjectInRestrictedArea BOOL This flag signals that at least one object is located behind

the accept area. This area is reachable from the kinematics

system, but not in the tracking operation. If necessary, the

conveyor can be stopped with this signal. To pick up the

parts, the area must now be activated with the input

allowRestrictedArea. After the parts are picked up from

this area, the conveyor can be restarted.

ActLogIndex DINT Index of the most current entry in the object protocol. If

the object protocol is empty, this index is set to -1.

Table 8.11 Data of module RCTR_UpdateConvInterface

76 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 77: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Sketch of the area behind the area end for objects and the work space end. If at least one object is in this area, the output variable ObjectInRestrictedArea has the status TRUE.

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorID ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ConvInterfaceUpdate.

Error number Significance

0 No error

10001 eMCE_FatalErrMappingFailed

10002 eMCE_FatalErrNullPointer

10003 eMCE_FatalErrDiffMemSize

10005 eMCE_FatalErrMissingCfgParam

10100 eMCE_FatalErrWriteShMem

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

10203 eMCE_ErrTrackInvalidFrameItf

10206 eMCE_ErrTrackInvalidConvResNum

10207 eMCE_ErrTrackInvalidConvResDenom

Table 8.12 Error number of module RCTR_UpdateConvInterface

X

X X

X

Y

Y Y

Y

Reference system

of the conveyor

Start of work area = minWorkArea

End of area for objects = maxAcceptArea

End of work area = maxWorkArea

X

Y

X+, positive direction of the conveyor

ObjectInRestrictedArea = TRUE

Festo GDCP-CMXR-C2-ST-EN 1501a 77

Page 78: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.4.2 Example calculation of ConvReNum / ConvResDenom For one conveyor, 46117 increments are measured after a distance of 836 mm. From these values, a numerator and denominator now have to be determined to calculate the ratio of conveyor path to increments. − ConvResNum = 46117 increments

− ConvResDenom = 836 mm

These two values must be entered in the respective input variables of the Conveyor module.

8.5 Object protocol As soon as an object leaves the object memory, e.g. through calling of the module RCTR_RemoveObject, this is recorded in the object protocol (maximum 1024). The last 1024 entered protocols are entered. If an additional entry is made, the oldest entry is deleted.

The data of this protocol is used for diagnostics and visualisation. It is not necessary and not recommended to call up these data in the MotionTask. To save calculation time, these modules should be called up in higher interval steps, e.g. 100 ms.

Objects that are completely processed can be identified by reading the object protocol. Additional steps, e.g. deletion via module RCTR_RemoveObjekt, can then be carried out.

The following modules are available:

Module Significance

RCTR_ReadLog Reading using the object protocol index

RCTR_GetLog Reading using the UserId

RCTR_GetLatestLog Automatic reading

Table 8.13 Modules for object protocol

8.5.1 Module RCTR_ReadLog With the module RCTR_ReadLog, the object protocol can be read using the object index. The range of values of the index goes from 0 to 1023.

78 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 79: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0.

EXECUTE BOOL With the rising edge, the data is read out.

Index DINT UserId, which was specified with the module RCTR_AddObject

when the object was created. Using this Id, the data of the

suitable object is looked for in the protocol memory and made

available at the Object output.

Output data

Done BOOL With the rising edge of the signal, the data at the outputs are valid

and can be processed.

Error BOOL If an error is generated while reading the object, this flag is set to

TRUE.

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed

with ErrorId.

Object TRCTR_OBJECT Returns the object data.

Table 8.14 Data of module RCTR_ReadLog

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ReadLog

Error number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

10205 eMCE_ErrTrackInvalidLogIdx

Table 8.15 Error numbers of module RCTR_ReadLog

Festo GDCP-CMXR-C2-ST-EN 1501a 79

Page 80: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.5.2 Module RCTR_GetLog The module RCTR_ReadLog can read an object's data from the protocol memory using the UserId.

If there are several objects in the memory with the same UserId, the first object found with this Id is output.

In order to ensure secure access, duplicate UserIds are to be avoided.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0.

EXECUTE BOOL With the rising edge, the data is read out.

UserID DINT UserId, which was specified with the module RCTR_AddObject

when the object was created. Using this Id, the data of the

suitable object is looked for in the protocol memory and made

available at the Object output.

Output data

Done BOOL With the rising edge of the signal, the data at the outputs are valid

and can be processed.

Error BOOL If an error is generated while reading the object, this flag is set to

TRUE.

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed

with ErrorId.

Object TRCTR_OBJECT Returns the object data.

Table 8.16 Data of module RCTR_GetLog

80 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 81: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ReadLog

Error number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

10252 eMCE_WarnTrackLogObjNotFound

Table 8.17 Error numbers of module RCTR_GetLog

Festo GDCP-CMXR-C2-ST-EN 1501a 81

Page 82: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.5.3 Module RCTR_GetLatestLog The module RCTR_GetLatestLog creates an automatic process for reading out the object protocol. After activation, the module automatically reports at the DataReady output that a protocol entry is available and makes this available at the Object data output. The procedure is triggered again by an acknowledgement at the AckData input.

If the input ManualRemoveObjects in the module RCTR_UpdateConvInterface is set to True, objects that are processed or have left the work space are not automatically deleted. In this case, they must be read out with the module RCTR_GetLatestLog and deleted with RCTR_RemoveObject.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0.

Enable BOOL With the rising edge at the Enable input, the module is activated.

The status is displayed via the Active output

AckData BOOL With the rising edge, the DataReady output reacts to acknowledge

and finish the reading.

Output data

ACTIVE BOOL The status TRUE displays that the module is active. The

requirement is that the Enable input has the status TRUE.

Error BOOL If an error is generated while reading the object, this flag is set to

TRUE.

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed

with ErrorId.

DataReady BOOL The rising edge of DataReady signals that the data is now

available at the Object output.

Object TRCTR_Object Returns the object data.

Overflow BOOL The status True displays that the ring buffer was overwritten since

the last read-out.

Table 8.18 Data of module RCTR_GetLatestLog

82 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 83: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ReadLatestLog

Error number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

Table 8.19 Error numbers of module RCTR_GetLatestLog

Festo GDCP-CMXR-C2-ST-EN 1501a 83

Page 84: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.6 Reset object memory, object protocol

8.6.1 Module RCTR_ResetData This module deletes all parts from the object memory and object protocol and resets the statistical data.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through

the index. There are a maximum of 4 object memories. The

permitted range of values is 0 to 3. The first object memory is

reference by 0.

EXECUTE BOOL With the rising edge at Execute, the object memory and project

protocol are deleted. After deletion, the Done output is set to the

status TRUE.

ResetBuffer BOOL Select deletion of the object memory.

ResetLog BOOL Select deletion of the object protocol.

Output data

Done BOOL The rising edge at the Done output signals that the memories

were deleted. The falling edge of the Execute input resets the

Done output.

Error BOOL If an error is generated during deletion, this flag is set to TRUE.

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed

with ErrorId.

Table 8.20 Data of module RCTR_ResetData

84 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 85: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ResetData

Error number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

Table 8.21 Error numbers of module RCTR_ResetData

Festo GDCP-CMXR-C2-ST-EN 1501a 85

Page 86: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.7 Reading the statistical data In the motion control, statistical data is stored over the time. These values are continuously updated. No attention is paid if the range of values of the individual variables is exceeded. To avoid this, these values must be read and saved at corresponding time intervals.

An individual statistical evaluation can thereby be created within the PLC. This includes, for example, an hourly, daily or weekly evaluation.

The statistical data is used for diagnostics and visualisation. It is not necessary and not recommended to call up these data in the MotionTask. To save calculation time, these modules should be called up in higher interval steps, e.g. 100 ms.

8.7.1 Module RCTR_ReadStatistic The module RCTR_ReadStatistic reads the recorded statistical values. The time period for reading and saving must be individually determined in the PLC.

Input data

InterfaceNumber DINT The connection to the internal object memories is made through the

index. There are a maximum of 4 object memories. The permitted

range of values is 0 to 3. The first object memory is reference by 0.

Enable BOOL The static signal TRUE switches on the data output. The Reset input

must be at FALSE.

Reset BOOL With the rising edge of Reset, the statistical data is reset. This is

only possible if the Enable input is set to FALSE.

86 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 87: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Output data

ACTIVE BOOL This output is statically at TRUE if Active = TRUE and there is no

error. It signals that the data output onto the variables is active.

Error BOOL TRUE = error when reading the object.

ErrorID TMCE_ErrorID Active error number when Error = TRUE.

ResetDone BOOL Signal TRUE at this output displays that the Reset was executed.

Resetting of the output occurs when setting the Reset input to

FALSE.

ReceivedObjects DINT Number of objects that were sent to the object memory with the

module RCTR_AddObject. It does not matter here whether the call-

up of the module was successful.

AcceptedObjects DINT Number of objects that were successfully entered into the object

memory through the module RCTR_AddObject

OperatedObjects DINT Number of objects that were picked up in the FTL program with the

method CONVEYOR. Wait.

FinishedObjects DINT Number of objects that were identified as processed in the FTL

program with the method CONVEYOR.Done. The status (TRUE or

FALSE) transferred with CONVEYOR.Done is thereby insignificant.

SuccessfulObjects DINT Number of objects that were identified as successfully processed in

the FTL program with the method CONVEYOR.Done and TRUE

transferred as the status.

NotSuccessfulObjects DINT Number of objects that were identified as successfully processed in

the FTL program with the method CONVEYOR.Done and FALSE

transferred as the status.

MissedObjects DINT Number of objects that moved out of the work space without being

processed.

AvgWorkAreaReserve REAL Average work area reserve of the number of objects specified

under SuccessfulObjects. This value is specified as a percentage

and refers to the area CONVEYOR.minWorkArea to

CONVEYOR.maxWorkArea.

Table 8.22 Data of module RCTR_ReadStatistic

Festo GDCP-CMXR-C2-ST-EN 1501a 87

Page 88: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_ReadStatistic

Error number Significance

0 No error

10201 eMCE_ErrTrackNotInitialized

10202 eMCE_ErrTrackInvalidInterface

Table 8.23 Error numbers of module RCTR_ReadStatistic

The system can be optimised via the PLC with the information on the average work area reserve. A possibility for optimisation would be to regulate the belt speed to fully use the kinematics system.

88 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 89: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.8 Signal conditioning in the PLC Encoder signals in practice frequently have disturbing pulses. In order to generate a smooth movement of the kinematics system in tracking operation, the encoder signal should be conditioned through corresponding filter methods.

A disadvantage of the filter methods is that a temporal delay of the movements can often result. If the conveyor is brought to a standstill in a jerky manner, the system, due to the filter, still needs some interpolation cycles to process the encoder signal. A filter method should therefore filter only as strongly as is absolutely necessary.

Filtering of the encoder signals influences the temporal behaviour of the tracking movement.

Some function blocks are available in the library RcSignalProcessing.lib to condition the tracking signal in the tracking application.

Module name Significance

RCSP_LagCompensator Position precontrol due to system-related inactive times

RCSP_SignalInfo Signal information

RCSP_SmoothingFilter Signal filter for encoder signal, sliding mean value filter of signal

speed

RCSP_DynLimitFilter Signal filter for encoder signal, speed- and acceleration-limiting

filter of the signal

Table 8. 24 Modules of library RcSignalProcessing.lib

Festo GDCP-CMXR-C2-ST-EN 1501a 89

Page 90: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.8.1 Module RCSP_LagCompensator To compensate for system-related inactive times, a module is available that uses the current speed to extrapolate a pre-controlled position for some system cycles.

The position values specified at the Pos input are cyclically stored in a ring buffer. For the calculation, the mean value is now determined from the last values (number from LagTime input, maximum 19). The difference between the mean value and the new specification at the Pos input is added to the value of the Pos input and issued at the Predicted Pos output. This determines the current speed.

The first time the module is called up, the internal ring buffer is initialised with the transferred position value.

For further processing, the PredictedPos output is connected to the ConvPos input at the module RCTR_UpdateConvInterface. This updates the position of the objects.

Processing of the module must take place in the MotionTask.

Input data

Enable BOOL Activating the module. The status TRUE must be statically present

at the Enable input. If the edge is positive, the internal memory is

deleted and all values are set to the value transferred with Pos

input.

LagTime TIME Number of system cycles (cycles of the MotionTask) that should be

pre-controlled through the module to compensate for inactive

times. A maximum of 19 cycles can be specified.

Pos DINT Absolute position in increments, e.g. position of an encoder or also

a position already otherwise prepared

90 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 91: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Output data

ACTIVE BOOL The status TRUE at the Active output shows that the module is

active and the output position at the PredictedPos output is valid.

Error BOOL If an error is present, this flag is set to TRUE.

ErrorID TMCE_ErrorID In case of an error (Error = TRUE), an error number is displayed with

ErrorId.

PredictedPos DINT Changed position in increments.

Table 8.25 Data of module RCTR_ResetData

Error numbers

In case of an error (Error = TRUE), an error number is displayed with ErrorId ( 8.9 Messages of the modules).

The following table includes the error numbers of the module RCTR_LagCompensator:

Error number Significance

0 No error

10209 eMCE_ErrTrackInvalidLagTime

Table 8.26 Error numbers of module RCSP_LagCompensator

Festo GDCP-CMXR-C2-ST-EN 1501a 91

Page 92: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.8.2 Module RCSP_SignalInfo This module calculates the dynamic data of the conveyor. This requires entry of the numerator and denominator (ratio of encoder increments to driven path) analogously to the Conveyor module. These data is used for diagnostics and have no effects on the application.

Input data

InPos DINT Position in increments, e.g. position of a position transmitter or

also a position already otherwise prepared.

ResNum DINT These two whole-number values determine a factor for conversion

of increments into the desired unit, e.g. millimetres. Calculation is

made by the division of ConvResNum / ConvResDenom. Division

of the increments with this factor results in the desired unit.

ResDenom DINT

SwoVarName STRING(80) If a variable name is specified here, characteristic data of the

signal are reported under this name to the software oscilloscope

and so can be recorded.

Output data

Item REAL Current position of the encoder [mm]

Velocity REAL Current speed of the encoder signal [mm/s]

Acceleration REAL Current acceleration of the encoder signal [mm/s²]

Jerk REAL Current jerk of the encoder signal [mm/s³]

Table 8.27 Data of module RCTR_SignalInfo

92 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 93: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.8.3 Module RCSP_SmoothingFilter The module RCSP_SmoothingFilter averages the speed of the signal for a specific, specified duration. That causes a strong smoothing and time delay of the signal.

Input data

Enable BOOL The rising edge activates the filter module. For operation, the

status TRUE must be statically present

InPos DINT Position value in increments.

Smoothing TIME Time over which the signal is averaged.

Output data

ACTIVE REAL Output status = TRUE shows that the filter module is active and so

the output at the OutPos output is valid.

OutPos REAL Output of the filtered position in increments. If the filter is not

active or no time is specified, the input value is fed through

directly. The filter is switched off in this case.

Table 8.28 Data of module RCTR_SmoothingFilter

Festo GDCP-CMXR-C2-ST-EN 1501a 93

Page 94: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.8.4 Module RCSP_DynLimitFilter The module DynLimitFilter is a signal filter which limits the input signal by means of belt limitation of speed and acceleration. This filter can be used to smooth a very noisy signal without strongly limiting the reaction capability. Additionally, the smoothing effect is increased further if the built-in “pre-filter” (= smoothingFilter) itself is activated with a short time (approx. 2 to 5 times the cycle time).

Input data

Enable BOOL The rising edge activates the filter module. For operation, the

status TRUE must be statically present.

InPos DINT Position value in increments.

ResNum DINT These two whole-number values determine a factor for

conversion of increments into the desired unit, e.g.

millimetres. Calculation is made by the division of ResNum /

ResDenom. Division of the increments with this factor results

in the desired unit.

ResDenom DINT

PreFilterSmoothingTime TIME The duration over which the pre-filter averages the signal

speed.

MaxVelocity REAL Maximum speed in mm/sec at the output signal. If 0 is

specified, the speed is not limited.

MaxAcceleration REAL Maximum acceleration in mm/sec² at the output signal. If 0 is

specified, the acceleration is not limited.

Output data

ACTIVE BOOL Output status = TRUE shows that the filter module is active

and so the output at the OutPos output is valid.

OutPos DINT Filtered position in increments. If the filter is not active or no

time has been specified, the input position is fed through

directly. In this case, the filter does not work.

OutResNum DINT Output of the numerator and denominator with which the

position was calculated. OutResDenom DINT

Table 8.29 Data of module RCTR_DynLimitFilter

94 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 95: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.9 Messages of the modules The following section describes all messages generated by the modules. The named enumerations are defined within the library McUtils.lib in CoDeSys.

A distinction is made between internal errors and user errors. If an internal error occurs, the system supplier should be contacted. User errors occur due to improper application programming and can be repaired by users themselves (e.g. invalid data at the inputs of the function blocks) or can also occur in normal operation (e.g. more parts on the conveyor belt than can be processed because the conveyor belt is set too fast, for example).

8.9.1 System errors (fatal errors)

Message number 10001

Message type fatal error

Enumeration eMCE_FatalErrMappingFailed

Message text Shared memory not found: '%1'

Parameter 1: Name of the shared memory

Effect The controller is stopped.

Cause Error in mapping the shared memories for communication between FTL and PLC

(internal error)

Action Check system configuration

Message number 10002

Message type fatal error

Enumeration eMCE_FatalErrNullPointer

Message text Pointer at shared memory is zero: '%1'

Parameter 1: Name of the shared memory

Effect The controller is stopped.

Cause Error in mapping the shared memories for communication between FTL and PLC

(internal error)

Action Check system configuration.

Festo GDCP-CMXR-C2-ST-EN 1501a 95

Page 96: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Message number 10003

Message type fatal error

Enumeration eMCE_FatalErrDiffMemSize

Message text Unexpected size of the shared memory '%1': %3, %2

Parameter 1: Name of the shared memory

2: Expected size of the shared memory

3: Current size of the shared memory

Effect The controller is stopped.

Cause The size of the PLC data structure does not fit together with the size of the shared

memories for communication between FTL and PLC (internal error)

Action Check system configuration

Message number 10005

Message type fatal error

Enumeration eMCE_FatalErrMissingCfgParam

Message text Catalogue entry %1 could not be read.

Parameter 1: Name of the catalogue entry.

Effect Application cannot be executed.

Cause The frame type (Euler or Kardan) could not be read from the catalogue (internal

error)

Action Check system configuration

Message number 10100

Message type fatal error

Enumeration eMCE_FatalErrWriteShMem

Message text Interface version (%2) is not supported by Rc.lib (%3) ('%1').

Parameter 1: Name of the shared memory

2: Expected interface version

3: Current interface version

Effect The controller is stopped.

Cause The interface version is not supported by RC.lib.

Action Check system configuration

96 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 97: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.9.2 Faults

Message number 10201

Message type Faults

Enumeration eMCE_ErrTrackNotInitialized

Message text %1: Tracking is not initialised

Parameter 1: Function block from which the error was issued

Effect Function block cannot be executed

Cause Tracking is not initialised; module can therefore not be used.

RCTR_UpdateConvInterface must be called up before.

Action Check application

Message number 10202

Message type Faults

Enumeration eMCE_ErrTrackInvalidInterface

Message text %1: Invalid conveyor index %2 (permissible range of values: %3..%4)

Parameter 1: Name of the called function block.

2: Interface index

3: Smallest permissible index.

4: Largest permissible index.

Effect Function block is not carried out.

Cause Function block was called with an invalid interface index.

Action Check application.

Message number 10203

Message type Faults

Enumeration eMCE_ErrTrackInvalidFrameItf

Message text Invalid frame index %1 (permissible range of values: %2..%3)

Parameter 1: Frame index

2: Smallest permissible index.

3: Largest permissible index.

Effect Function block is not carried out.

Cause Module was called with invalid port index

Action Check application.

Festo GDCP-CMXR-C2-ST-EN 1501a 97

Page 98: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Message number 10204

Message type Faults

Enumeration eMCE_ErrTrackInvalidBufferIdx

Message text Conveyor %1: RCTR_ReadBuffer was called with invalid buffer index %2 (permissible

range of values: %3..%4)

Parameter 1: Index of the conveyor.

2: Programmed index

3: Smallest permissible index.

4: Largest permissible index.

Effect Function block is not carried out.

Cause RCTR_ReadBuffer was called with invalid index.

Action Check application.

Message number 10205

Message type Faults

Enumeration eMCE_ErrTrackInvalidLogIdx

Message text Conveyor %1: RCTR_ReadLog was called with invalid protocol index %2 (permissible

range of values: %3..%4)

Parameter 1: Index of the conveyor.

2: Programmed index

3: Smallest permissible index.

4: Largest permissible index.

Effect Function block is not carried out.

Cause RCTR_ReadLog was called with invalid index

Action Check application.

98 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 99: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Message number 10206

Message type Faults

Enumeration eMCE_ErrTrackInvalidConvResNum

Message text Conveyor %1: Invalid numerator %2 of the Encoder resolution (value must not equal

0)

Parameter 1: Index of the conveyor.

2: Specified numerator.

Effect Function block is not executed, tracking function cannot be used.

Cause RCTR_UpdateConvInterface was called with an invalid value for convResNum.

Action Check application.

Message number 10207

Message type Faults

Enumeration eMCE_ErrTrackInvalidConvResDenom

Message text Conveyor %1: Invalid denominator %2 of the Encoder resolution (value must not

equal 0)

Parameter 1: Index of the conveyor.

2: Specified denominator.

Effect Function block is not executed, tracking function cannot be used.

Cause RCTR_UpdateConvInterface was called with an invalid value for convResDenom.

Action Check application.

Message number 10209

Message type Faults

Enumeration eMCE_ErrTrackInvalidLagTime

Message text RCSP_LagCompensator: Invalid inactive time: %1 ms (inactive time must not be

greater than %2 ms)

Parameter 1: Specified LagTime.

2: Largest permissible LagTime.

Effect Function block is not carried out.

Cause RCSP_LagCompensator was called with an invalid value for LagTime.

Action Check application.

Festo GDCP-CMXR-C2-ST-EN 1501a 99

Page 100: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.9.3 Warnings

Message number 10250

Message type Warning

Enumeration eMCE_WarnTrackObjFrameNotFound

Message text Conveyor %1: Object #%2 was not found in internal frame list

Parameter 1: Index of the conveyor.

2: UserId of the object.

Effect Function block is not carried out.

Cause Object with specified ID was not found

Action Check application.

Message number 10251

Message type Warning

Enumeration eMCE_WarnTrackBufferObjNotFound

Message text %3: Object #%2 was not found in the object memory of conveyor %1

Parameter 1: Index of the conveyor.

2: UserId of the object.

3: Name of the called function block.

Effect Function block is not carried out.

Cause Object with specified ID was not found

Action Check application.

Message number 10252

Message type Warning

Enumeration eMCE_WarnTrackLogObjNotFound

Message text %3: Object #%2 was not found in the protocol memory of conveyor %1

Parameter 1: Index of the conveyor.

2: ID of the object.

3: Name of the called function block.

Effect Function block is not carried out.

Cause Object with specified ID was not found

Action Check application.

100 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 101: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Message number 10253

Message type Warning

Enumeration eMCE_WarnTrackObjRejected

Message text %3: Object #1 was rejected by the conveyor - error: %2

Parameter 1: UserId of the object.

2: Error number

3: Name of the called function block.

Effect Object is not processed.

Cause Object was rejected by the conveyor

Action Check conveyor.

Message number 10254

Message type Warning

Enumeration eMCE_WarnTrackObjNotAccepted

Message text Conveyor %1: Object #%2 was not accepted by RC

Parameter 1: Index of the conveyor.

2: UserId of the object.

Effect The object cannot be processed.

Cause The object was rejected by the internal interface of the RobotControl.

Action Check application.

Message number 10260

Message type Warning

Enumeration eMCE_WarnTrackBufferFull

Message text %3: Object #%2 cannot be entered in the object memory of conveyor %1; the object

memory is full

Parameter 1: Index of the conveyor.

2: ID of the object.

3: Name of the called function block.

Effect Execution of the function block failed.

Cause Object from parts recognition could not be entered in the object memory; the buffer

is full

Action Check application.

Festo GDCP-CMXR-C2-ST-EN 1501a 101

Page 102: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Message number 10261

Message type Warning

Enumeration eMCE_WarnTrackLogOverflow

Message text %3: The protocol of conveyor %1 has overflowed (last read object: %2)

Parameter 1: Index of the conveyor.

2: UserId of the last read object.

3: Name of the called function block.

Effect Not all processed objects could be read from the object protocol.

Cause Too many objects have been processed since the last reading of an object from the

protocol memory.

Action Check application.

Message number 10262

Message type Warning

Enumeration eMCE_WarnTrackRemoveFromBufFail

Message text %3: Object #%2 could not be removed from the object memory of conveyor %1

Parameter 1: Index of the conveyor.

2: UserId of the object.

3: Name of the called function block.

Effect Module is not executed.

Cause Internal error in object administration.

Action Check application.

Message number 10263

Message type Warning

Enumeration eMCE_WarnTrackAddToLogFailed

Message text %3: Object #%2 could not be entered in the protocol of conveyor %1

Parameter 1: Index of the conveyor.

2: ID of the object.

3: Name of the called function block.

Effect Module cannot be executed.

Cause Internal error in object administration.

Action If the problem occurs again, contact system supplier

102 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 103: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

Message number 10264

Message type Warning

Enumeration eMCE_WarnLogIteratorNotInitialized

Message text Conveyor %1: RCTR_ReadFirstLogObject must be called once before the first call of

RCTR_ReadNextLogObject

Parameter 1: Index of the conveyor.

Effect Function block is not carried out.

Cause RCTR_ReadNextLogObject was called without prior execution of

RCTR_ReadFirstLogObject.

Action Call RCTR_ReadFirstLogObject.

8.9.4 Information

Message number 10280

Message type Info

Enumeration eMCE_InfoTrackObjectAborted

Message text Conveyor %1: Request of a new object was cancelled (object #%2)

Parameter 1: Index of the conveyor.

2: UserID of the object.

Effect None

Cause Cancellation of the request of the application.

Action None

Message number 10281

Message type Info

Enumeration eMCE_InfoTrackObjLeftArea

Message text Conveyor %1: Object #%2 has left the work space

Parameter 1: Index of the conveyor.

2: ID of the object.

Effect Object was not processed.

Cause The object left the work space before it was processed.

Action None

Festo GDCP-CMXR-C2-ST-EN 1501a 103

Page 104: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

8 PLC programming of linear tracking

8.10 Sensor integration A sensor is necessary to recognise objects on the conveyor system. A through-beam sensor or vision system, for example, can be used. In order to feed the recognised objects to the motion control, a software module is needed that carries out object administration of the recognised objects.

Functions of the object administration: − Interface to a software module for coupling to a sensor.

− Administration of the received data.

− Transmission of the received objects to the motion control.

− Reception of the processed or not-processed objects from the motion control.

− If available, transmission of the non-processed object to a subsequent kinematics system with further CMXR control.

Object 1

Object 2

Object 3

Object 4

Object …..

Object administration

Module for coupling of the sensor system

Sensor, e.g. through-beam sensor, vision

Transmit objects with module RCTR_AddObject

into object memory.

Read and administer optional status of the

objects with corresponding modules.

PLC user program

System function

Colour key:

104 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 105: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

9. Linear tracking applications

9.1 Creation of FTL programs When creating FTL programs, the actual tracking movement is not relevant at first. The FTL programs are first created without tracking movement, which is equal to processing of a stationary object. After startup of this process, the tracking movement is superimposed and tested through use of the dynamic reference system of the actual programmed path.

9.2 Applications with a conveyor system This chapter describes application examples and combinations of conveyor systems. This chapter does not claim to be complete or correct.

9.2.1 Processing of similar objects without sorting In this application, objects moved by a conveyor must be grasped and set down at a fixed position. The sequence for removal of the objects is determined by the sequence in the object memory. That means, no additional sorting of the objects in the memory is executed.

:

SetRefSysWorld()

// At wait position

Lin(WaitPos)

// Activate conveyor

Conv1.Begin()

WHILE TRUE DO

// Wait for next part

Conv1.Wait(PartData)

// Wait for part in the work space

Conv1.WaitReachable(PartData)

// Set reference system of the object

SetRefSysDyn(PartData.RefSys)

// Gripper vacuum on

Vacuum.Set()

// Above part

Lin(AbovePos)

// Gripping position

Lin(TakePos)

// Gripping time

WaitTime(0)

// Above part

Festo GDCP-CMXR-C2-ST-EN 1501a 105

Page 106: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

Lin(AbovePos)

// Reference system WORLD

SetRefSysWorld()

// Delete part from memory

Conv1.Done(PartData)

Lin(AboveReleasePos)

// Deposit position

Lin(ReleasePos)

// Gripper vacuum off

Vacuum.Reset()

// Vacuum waiting time

WaitTime(10)

Lin(AboveReleasePos)

END_WHILE :

9.2.2 Processing of similar objects, with sorting The objects lying on a belt must be removed and processed in a specific sequence. Sorting takes place using the object attribute in the object data.

The first object must have the attribute 13, the second object attribute 28 and the third object attribute 17.

:

SetRefSysWorld()

// At wait position

Lin(WaitPos)

Index := 0

// Activate conveyor system

Conv1.Begin()

WHILE TRUE DO

// Calculation of parts ID

IF Index = 0 THEN

PartId := 13

ELSIF Index = 1 THEN

PartId := 28

ELSIF Index = 2 THEN

PartId := 17

END_IF

106 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 107: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

// Waiting for object with ID available

Conv1.Wait(PartData, PartId)

// Wait for part in the work space

Conv1.WaitReachable(PartData)

// Set reference system of the object

SetRefSysDyn(PartData.RefSys)

Vacuum.Set() // Gripper vacuum on

Lin(AbovePos) // Above part

Lin(TakePos) // Gripping position

WaitTime(0) // Gripping time

Lin(AbovePos) // Above part

SetRefSysWorld() // Reference system WORLD

Conv1.Done(PartData) // Delete part from memory

Lin(AboveReleasePos)

Lin(ReleasePos) // Deposit position

Vacuum.Reset() // Gripper vacuum off

WaitTime(10) // Vacuum waiting time

Lin(AboveReleasePos)

// Index for PartId

Index := Index + 1

IF Index = 3 THEN

Index := 0 END_IF

END_WHILE :

Festo GDCP-CMXR-C2-ST-EN 1501a 107

Page 108: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

9.2.3 Changing the reference system The reference system included in the object data is read-only and so cannot be written in the FTL program. If the FTL programming requires a shift of the reference system, such as to simplify programming with a series of moving objects, linking of a static with a dynamic reference system can be programmed.

Example

:

// Fetch object data

Conv1.WaitObj(partData)

:

// Reference static to moving system

newRef.baseRs := MAP(partData.refsys)

// Shift, rotation of the system

newRef.a := 30

newRef.x := 100

// Activation of the system

SetRefSys(newRef)

:

9.2.4 Placing object correctly positioned on belt An object is to be placed on the belt at the same position with a defined orientation of 90 degrees (rotation around Z). To do this, the object is raised in the tracking operation, its orientation aligned and placed on the same position on the belt.

There are 2 possibilities to solve this problem: − The lifted part is rotated further by the difference of the orientation and the placing

position likewise by the same value.

− After calculation of the orientation difference, the reference system of the object is overwritten in the object memory, which is active immediately. The placing position must thus be recalculated. The new orientation is now automatically taken into account through the changed reference system.

108 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 109: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

Example with change of the object reference system

:

RefSysWorld()

Lin(WaitPos) // At wait position

Conv1.Begin() // Activate conveyor system

WHILE TRUE DO

Conv1.Wait(PartData) // Wait for next part

// Wait for part in the work space

Conv1.WaitReachable(PartData)

// Set reference system of the object

SetRefSysDyn(PartData.RefSys)

Vacuum.Set() // Gripper vacuum on

Lin(AbovePos) // Above part

Lin(TakePos) // Gripping position

WaitTime(0) // Gripping time

Lin(AbovePos) // Above part

// Changing of the object reference system

newRef.baseRs := MAP(PartData.refSys)

Distance := 90 – PartData.refSys.frame.a

newRef.a := PartData.refSys.frame.a + Distance

SetRefSys(newRef)

Lin(AbovePos) // Above part

Lin(TakePos) // Gripping position

Vacuum.Reset() // Gripper vacuum off

WaitTime(10) // Vacuum waiting time

Lin(AbovePos) // Above part

RefSysWorld() // Reference system WORLD

Conv1.Done(PartData) // Delete part from memory

END_WHILE :

Festo GDCP-CMXR-C2-ST-EN 1501a 109

Page 110: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

9.2.5 Arraying objects correctly positioned on belt On a conveyor system, an object is to be aligned from the rotation to 0 degrees. An additional 2 objects must be placed on the belt correctly positioned and at a defined distance of 5 mm. All objects on the conveyor system are similar; there are not variants. The width of the objects is 30 mm.

If the orientation of the object series is known, it can be programmed within the FTL programming. It is also possible for the PLC to generate empty objects and place these correctly positioned in the object memory. In this case, FTL programming is simpler.

Example with position determination in FTL

:

// Activate conveyor system

Conv1.Begin()

SetRefSysWorld()

// At wait position

Lin(WaitPos)

WHILE TRUE DO

// Wait for first part

Conv1.Wait(FirstPart)

// Wait for part in the work space

Conv1.WaitReachable(FirstPart)

// Set reference system of the object

SetRefSysDyn(FirstPart.refSys)

CALL TakePart

// Turn back to 0 degrees

// Changing of the object reference system

newRef.baseRs := MAP(FirstPart.refsys)

Loose objects Objects arrayed and

aligned on 0 degrees

Conveyor

110 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 111: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

newRef.a := 90 - FirstPart.refSys.frame.a

SetRefSys(newRef)

// Global variable for distance calculation

DistanceY := 0

CALL PutPart

// Y offset 20 mm for next part

DistanceY := DistanceY + 20

// Wait for next part

Conv1.Wait(NextPart)

// Wait for part in the work space

Conv1.WaitReachable(NextPart)

// Set reference system of the object

SetRefSysDyn(NextPart.refSys)

CALL TakePart

// Reference system of the first object

SetRefSys(newRef)

Conv1.Done(NextPart) // Delete part from memory

CALL PutPart

// Y offset 20 mm for next part

DistanceY := DistanceY + 20

Conv1.Wait(NextPart) // Wait for next part

// Wait for part in the work space

Conv1.WaitReachable(NextPart)

// Set reference system of the object

SetRefSysDyn(NextPart.refSys)

CALL TakePart

// Reference system of the first object

SetRefSys(newRef)

Conv1.Done(NextPart) // Delete part from memory

CALL PutPart

// All 3 parts are set down

SetRefSysWorld() // Reference system WORLD

Conv1.Done(FirstPart) // Delete part from memory

Lin(WaitPos)

END_WHILE :

Festo GDCP-CMXR-C2-ST-EN 1501a 111

Page 112: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

FTL sub-program TakePart

This program takes the part from the conveyor with a vacuum gripper.

Vacuum.Set() // Gripper vacuum on

Lin(AbovePos) // Above part

Lin(TakePos) // Gripping position

WaitTime(0) // Gripping time

Lin(AbovePos) // Above part

FTL sub-program PutPart

The part is placed with the PutPart program. The position is determined through the active reference system.

AbovePos.y := DistanceY

Lin(AbovePos) // Above part

TakePos.y := DistanceY

Lin(TakePos) // Gripping position

Vacuum.Reset() // Gripper vacuum off

WaitTime(10) // Vacuum waiting time

Lin(AbovePos) // Above part

Example with “empty” objects

In this example, the PLC creates empty objects, which illustrate the later sequence. To ensure the sequence of “empty” objects is recognised, the PLC creates this series with defined IDs (e.g. 11, 12, 13). The real objects, for example, are issued with the ID = 1.

Loose objects “Empty” objects

Conveyor

112 Festo GDCP-CMXR-C2-ST-EN 1501a

Page 113: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

9 Linear tracking applications

:

Conv1.Begin() // Activate conveyor system

SetRefSysWorld()

Lin(WaitPos) // At wait position

Id := 11

WHILE TRUE DO

// Wait for object ID = 1

Conv1.Wait(bluePart, 1) // Wait for first part

// Wait for part in the work space

Conv1.WaitReachable(bluePart)

// Set reference system of the object

SetRefSysDyn(bluePart.refSys)

CALL TakePart

// Wait for empty object, ID = 11

Conv1.Wait(emptyPart, Id) // Wait for first part

// Wait for part in the work space

Conv1.WaitReachable(emptyPart)

// Set reference system of the object

SetRefSysDyn(emptyPart.refSys)

Conv1.Done(bluePart)

CALL PutPart

SetRefSysWorld() // Reference system WORLD

Conv1.Done(emptyPart) // Delete part from memory

// Calculation of parts ID

Id := Id + 1

IF Id = 14 THEN

Id := 11

END_IF

END_WHILE :

Festo GDCP-CMXR-C2-ST-EN 1501a 113

Page 114: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear
Page 115: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear
Page 116: Multi-axis controller CMXR-C2€¦ · tracking functions with the CMXR-C2 multi-axis controller. Movements of a kinematics system can thereby be coordinated or synchronised with linear

Copyright:

Festo AG & Co. KG Postfach D-73726 Esslingen, Germany Phone: +49 711 347 0 Fax: +49 711 347 2144 E-mail: [email protected]

The reproduction, distribution or sale of this document or communication of its contents to others without express authorisation is prohibited. Offenders will be held liable for damages. All rights reserved in the event that a patent, utility model or design patent is registered.

Internet: www.festo.com Original: de Version: 1501a