manual - festo · 1. introduction 8 festo gdcp-cmxr-c2-st-en 1002nh 1. introduction this document...
TRANSCRIPT
Trimming: On top: 61.5 mm Underneath: 61.5 mm Left: 43.5 mm Right: 43.5 mm
Controller
Manual Programming instructions CMXR Tracking
Manual 571 706 en 1002NH [751 521]
Festo GDCP-CMXR-C2-ST-EN 1002NH 3
Original ________________________________________________________ de
Edition __________________________________________________ en 1002NH
Designation _____________________________________ GDCP-CMXR-C2-ST-EN
Order no. ___________________________________________________ 571706
(Festo AG & Co KG., D-73726 Esslingen, Germany, 2010)
Internet: http://www.festo.com
E-mail: [email protected]
The reproduction of this document and disclosure to third parties and the utilisation or communication of its contents without explicit authorization is prohibited. Offenders will be held liable for compensation of damages. All rights reserved, in particular the right to carry out patent, utility model or ornamental design registrations.
4 Festo GDCP-CMXR-C2-ST-EN 1002NH
Index of revisions
Author:
Name of manual:
Filename:
File saved at:
Serial no. Description Index of revisions Date of amendment
001 Creation 1002NH 15.04.2010
Trademarks
TABLE OF CONTENTS
Festo GDCP-CMXR-C2-ST-EN 1002NH 5
TABLE OF CONTENTS
1. Introduction .......................................................................................................... 8
2. Safety instructions ................................................................................................ 9
2.1 Using the documentation ..................................................................................... 9
2.2 Recommended operating conditions .................................................................... 9
2.3 Qualified personnel ........................................................................................... 10
2.4 Safety instructions regarding the products ........................................................ 10
2.5 Safety instructions regarding this manual .......................................................... 10
2.6 Safety instructions for the described product..................................................... 11
3. Hardware ............................................................................................................ 12
3.1 Encoder ............................................................................................................. 12
3.1.1 Encoder connection via Festo CMMx drive .......................................... 13
3.1.2 Standard encoder with 5 V or 24 V signals .......................................... 15
3.2 Object sensing ................................................................................................... 16
3.2.1 Connection of a digital sensor ............................................................ 16
3.2.2 Connection of Festo Vision ................................................................. 17
4. Software .............................................................................................................. 18
5. General tracking function .................................................................................... 19
5.1 Mode of operation ............................................................................................. 19
5.2 FTL programming ............................................................................................... 20
5.3 Relationships of the reference systems .............................................................. 21
5.3.1 Start tracking, moving reference system, SetRefSysDyn ..................... 21
5.3.2 Stop tracking ...................................................................................... 23
5.3.3 Exchange of information to the PLC .................................................... 23
5.4 PLC programming .............................................................................................. 25
5.4.1 Module RCTR_UpdateFrameInterface, update reference system ......... 25
5.5 Applications ...................................................................................................... 28
5.5.1 Placing parts into a mould .................................................................. 28
5.5.2 Tracking of movements at a bending press ......................................... 30
TABLE OF CONTENTS
6 Festo GDCP-CMXR-C2-ST-EN 1002NH
6. Linear tracking .................................................................................................... 33
6.1 Conveyor systems .............................................................................................. 34
6.1.1 Constellations of conveyor systems .................................................... 34
6.1.2 Zero point .......................................................................................... 35
6.1.3 Alignment ........................................................................................... 36
6.2 Encoder system, belt length, sensor position ..................................................... 36
6.3 Object memory, object protocol ......................................................................... 37
6.4 Processing the objects ....................................................................................... 38
6.4.1 Object tracking ................................................................................... 39
6.5 Setting the objects............................................................................................. 40
7. FTL programming of linear tracking .................................................................... 41
7.1 Object data ........................................................................................................ 41
7.2 CONVEYOR module ............................................................................................ 44
7.2.1 Method start/stop processing, <Begin, End> ....................................... 47
7.2.2 Method wait for next object, <Wait> ..................................................... 48
7.2.3 Method wait until object reachable, <WaitReachable> ......................... 51
7.2.4 Method end object, <Done> ................................................................. 54
7.3 Conveyor module visualisation pages ................................................................ 56
7.3.1 Configuration page ............................................................................. 57
7.3.2 Object memory ................................................................................... 58
7.3.3 Object protocol .................................................................................. 59
7.3.4 Part diagnostics ................................................................................. 60
7.3.5 Statistics page ................................................................................... 61
8. PLC programming of linear tracking .................................................................... 62
8.1 Mode of operation ............................................................................................. 62
8.1.1 Functions of the PLC ........................................................................... 63
8.1.2 Contents of the library RcTracking.lib ................................................. 63
8.2 Object administration ........................................................................................ 64
8.2.1 Object processing with automatic deletion of objects ......................... 65
8.2.2 Object processing with manual deletion of objects ............................. 67
8.3 Object data, object memory ............................................................................... 68
8.3.1 Object data type TRCTR_OBJECT ......................................................... 68
8.3.2 Object status TRCTR_ObjectState ....................................................... 70
8.3.3 Add object, module RCTR_AddObject ................................................. 71
8.3.4 Delete object, module RCTR_RemoveObject ....................................... 73
8.3.5 Read out object data, module RCTR_ReadBuffer ................................ 75
TABLE OF CONTENTS
Festo GDCP-CMXR-C2-ST-EN 1002NH 7
8.4 Conveyor system ............................................................................................... 77
8.4.1 Module RCTR_UpdateConvInterface ................................................... 77
8.4.2 Example calculation of ConvReNum / ConvResDenom ........................ 81
8.5 Object protocol .................................................................................................. 82
8.5.1 Module RCTR_ReadLog, ..................................................................... 83
8.5.2 Module RCTR_GetLog ......................................................................... 85
8.5.3 Module RCTR_GetLatestLog ............................................................... 87
8.6 Reset object memory, object protocol ................................................................ 89
8.6.1 Module RCTR_ResetData .................................................................... 89
8.7 Reading the statistical data ............................................................................... 91
8.7.1 Module RCTR_ReadStatistic ............................................................... 91
8.8 Signal conditioning in the PLC ............................................................................ 94
8.8.1 Module RCSP_LagCompensator ......................................................... 95
8.8.2 Module RCSP_SignalInfo .................................................................... 97
8.8.3 Module RCSP_SmoothingFilter ........................................................... 98
8.8.4 Module RCSP_DynLimitFilter .............................................................. 99
8.9 Messages of the modules ................................................................................ 100
8.9.1 System errors (fatal errors)............................................................... 100
8.9.2 Error ................................................................................................. 102
8.9.3 Warnings .......................................................................................... 105
8.9.4 Information ...................................................................................... 108
8.10 Sensor integration ........................................................................................... 109
9. Linear tracking applications .............................................................................. 110
9.1 Creation of FTL programs ................................................................................. 110
9.2 Applications with a conveyor system ............................................................... 110
9.2.1 Processing of similar objects without sorting .................................... 110
9.2.2 Processing of similar objects, with sorting ........................................ 111
9.2.3 Changing the reference system ........................................................ 113
9.2.4 Placing object correctly positioned on belt ....................................... 114
9.2.5 Arraying objects correctly positioned on belt .................................... 115
1. Introduction
8 Festo GDCP-CMXR-C2-ST-EN 1002NH
1. Introduction This document describes the Tracking technology package and serves the programming of translatory tracking applications on conveyor systems and general tracking functions with the CMXR robot control system. 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.
Note
Use of the Tracking technology package requires that the user is familiar with the FTL (Festo Teach Language) programming language and SPS programming according to CoDeSys. If a vision system is used, the corresponding documentation and instructions must be observed.
2. Safety instructions
Festo GDCP-CMXR-C2-ST-EN 1002NH 9
2. Safety instructions
2.1 Using the documentation
This document is intended for users and programmers of robots that work together with the Festo CMXR system. There is an introduction to operation and programming. Appropriate personnel training is a requirement.
2.2 Recommended operating conditions
Warning
The Festo CMXR system is not intended for safety-relevant control tasks (e.g.: shutdown in emergency or monitoring reduced speeds).
The Festo CMXR system conforms only to category B of EN13849-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.
Festo is not liable for any damage due to non-compliance with the warning instructions in these operating instructions.
Note
The safety instructions in chapter 2.3 ff. must be read through completely prior to commissioning.
If the documentation is not clearly understood in this language, please ask and inform the supplier.
The excellent and reliable operation of the control system depends on its proper and professional transport, storage, mounting and installation as well as on careful operation and maintenance.
2. Safety instructions
10 Festo GDCP-CMXR-C2-ST-EN 1002NH
2.3 Qualified personnel
Note
Only trained and qualified personnel should be allowed to handle the electrical installations.
2.4 Safety instructions regarding the products
Warning
DANGER!
The special waste specifications must be observed when disposing of the batteries.
Although batteries have a low voltage, they can give off enough current in a short circuit to cause combustible materials to ignite. They must not, therefore, be disposed of together with conductive materials (such as metal chips, wire wool contaminated with oil etc.).
ESD
Electrostatically sensitive components: Improper handling can result in damage to components.
Warning
DANGER!
Dangerous movements!
Danger of death, serious bodily injury or material damage due to unintentional movement of the axes!
2.5 Safety instructions regarding this manual
Warning
DANGER!
Considerable property damage and personal injury can occur if these instructions are not observed.
Caution
Failure to comply can result in severe property damage.
2. Safety instructions
Festo GDCP-CMXR-C2-ST-EN 1002NH 11
2.6 Safety instructions for the described product
Warning
Danger!
Danger of death due to insufficient EMERGENCY-STOP devices!
Emergency-stop devices must remain operative and accessible in all operating modes of the system. Unlocking the EMERGENCY-STOP device must not cause an uncontrolled restart of the system!
First check the EMERGENCY-STOP chain, then switch on!
Warning
DANGER!
Danger to people and equipment!
Test every new program before commissioning the system!
Warning
DANGER!
Retrofittings and modifications may impair the safety of the system!
The consequences of this could be personal injury, material damage or damage to the environment. Possible retrofittings or modifications to the system with component parts from external manufacturers must therefore be approved by Festo.
Warning
DANGER!
Dangerous voltage!
If not otherwise specified, maintenance work must always be carried out with the system switched off! At the same time, the system must be protected against being restarted again by unauthorised persons or unintentionally.
Any measuring or test work required on the system must be carried out by expert electrical technicians.
Caution
Only spare parts approved by Festo may be used.
3. Hardware
12 Festo GDCP-CMXR-C2-ST-EN 1002NH
3. Hardware The CMXR control system of type CMXR-C2 shall be used for executing the Tracking technology package.
Illustration of CMXR-C2 robot control:
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. For that an encoder extension module with the type code CECX-2G2 is needed at the CMXR-C2 control.
The encoder card has 2 inputs that can each be used for one conveyor system. In the case of more than 2 conveyor systems (max. 4), an additional encoder card is necessary.
Note
The CMXR hardware manual must be observed when mounting the encoder card.
The CECX-2G2 module has encoder inputs of signal types TTL 5 V and 24 V. This specification must conform to the encoder used. If the drive of the conveyor system is equipped with a Festo drive of the series CMMx (e.g. CMMP-AS or CMMS-AS), the encoder
output of the drive regulator can be used.
The pin allocation of the encoder connections is described in the following chapters.
X2: Encoder 1
X3: Encoder 2
3. Hardware
Festo GDCP-CMXR-C2-ST-EN 1002NH 13
3.1.1 Encoder connection via Festo CMMx drive
The encoder emulation output of the CMMx drive regulator works with TTL 5V signal levels. The pin allocation of the respective inputs/outputs is described in the following.
Signal CMMx drive regulator CECX-2G2 encoder card
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 Sub-D, 9 pin, male Sub-D, 9 pin, male
Table 3.1 CMMx encoder connection pin allocation
Note
To avoid malfunctions, the earthing concept must be taken into account in placing the screening.
To operate the encoder card with the TTL 5V signal, the corresponding setting must be made when configuring the module card. Configuration within the FCT software is represented in the following.
Selection of the
5V signal type
4-fold evaluation
Activate latch input
Adjust input type
according to the
documentation
3. Hardware
14 Festo GDCP-CMXR-C2-ST-EN 1002NH
To use the encoder emulation of the drive regulator, it must be activated within 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, it must be set with regard to the resolution (number of lines = number of increments per revolution). Here, the maximum value of 16384 must be set. The following illustration shows setting of the encoder resolution within the CMMP-AS configuration.
Activation of the encoder simulation
Selection Menu option Application data
A new encoder simulation menu appears
Setting the resolution
3. Hardware
Festo GDCP-CMXR-C2-ST-EN 1002NH 15
3.1.2 Standard encoder with 5 V or 24 V signals
If a general encoder is used, it can be employed with signal types 5 V or 24 V. The pin allocation of the CECX-2G2 encoder card with the signal types 5 V and 24 V is described in the following.
Signal CECX-2G2, 24 V signal CECX-2G2, 5 V signal
A+ 5 5
A- - 9
B+ 4 4
B- - 8
N+ 3 3
N- - 7
GND, 0V 1 1
Screening - -
Encoder power supply 5V - 6
Encoder power supply 24V 2 -
Plug Sub-D, 9 pin, male Sub-D, 9 pin, male
Table 3.2 CECX-2G2 encoder card pin allocation
Note
To avoid malfunctions, the earthing concept must be taken into account in placing the screening.
To operate the encoder card with the available signal type, the corresponding setting must be made when configuring the module card. Configuration within the FCT software is
represented in the following.
Note
The encoder's resolution must be at least 2000 pulses per revolution. To increase the resolution, the 4-fold evaluation must be set in the configuration of the encoder card.
Selection of the 5V or
24V signal type
4-fold evaluation
Activate latch input
Adjust input type
according to the
documentation
3. Hardware
16 Festo GDCP-CMXR-C2-ST-EN 1002NH
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-2G2 encoder card. The sensor connections are depicted in the following.
The encoder card 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 light barrier, is used for object sensing, it has to be connected to the respective latch input of the encoder card.
The following illustration shows connection of a digital sensor to the latch input DI0.
Note
When connecting the digital sensor, the connection requirements in the encoder card hardware manual must be taken into account.
24 V supply
Latch input DI0 for encoder X2
Latch input DI1 for encoder X3
E
Conveyor belt
Encoder connection to X2
Connection to latch input DI0
3. Hardware
Festo GDCP-CMXR-C2-ST-EN 1002NH 17
3.2.2 Connection of Festo Vision
When using the Festo vision system, the vision system's flash output must be connected to the encoder card's latch input. Data transmission is carried out via Ethernet.
Connection over Ethernet
To minimize the network load, use of an intelligent Ethernet switch is recommended. To set up a local network, the connection to the vision system and handheld terminal, for xample, and possibly to another CMXR controller should be made over the X5 Ethernet port. The X7 Ethernet port can also be used, but this is intended for connection of remote networks, since it has a gateway address.
Configuration of Festo Vision
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 belt
Connection to latch input DI0
Encoder connection to X2
Ethernet switch
Ethernet port X5
CMXR-C2
4. Software
18 Festo GDCP-CMXR-C2-ST-EN 1002NH
4. Software The Tracking technology package is included in the related CMXR-C2 FCT plug-in. This can be loaded via the download area of the Festo homepage www.Festo.com. With installation of the FCT plug-in, the operating system of the CMXR controller, which contains the software of the Tracking technology package, is available and can be loaded onto the CMXR-C2 hardware.
To place the CMXR controller in operation, the memory card with the operating system must first be installed. This can be carried out over an active Ethernet connection or a card reader.
The procedure for initialization should be taken from the FCT software help.
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 19
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 graphic shows the configuration of motion control and PLC:
To activate the tracking, the moving reference system must be activated in the FTL program with the command SetRefSysDyn. To supply the reference system with values, in the PLC the encoder values are prepared, for example, and fed to the reference system over system modules. The next pages describe the necessary functions.
Mobile axis system (tracking axis)
Position sensor, 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
E M
E E
5. General tracking function
20 Festo GDCP-CMXR-C2-ST-EN 1002NH
5.2 FTL programming
In FTL, users have available variables for the tracking frames that are needed to create a reference system. These are in the system-global variable range. Provision of values to these variables has to be triggered on the PLC. The PLC can write these FTL variables through 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 Application
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.
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 21
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 static reference systems that are part of FTL programming, there is the command SetRefSysDyn for defining a dynamic (moving) reference system. This moving reference system is needed to implement 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 Parameter Command SetRefSysDyn
Use of the SetRefSysDyn macro is treated in the following chapters on the subject of tracking.
Tracking basis system
E M
E E
X
Y
Z
X
Y
Z
X
Y
Z
Reference system e.g. WORLD
Moving reference system
FrameInterface
Tracking axis
5. General tracking function
22 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 a reference to the world coordinate system for the kinematics is to be made, you have to reference the world system variable.
Caution
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)
:
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 23
5.3.2 Stop tracking
To stop tracking, a static reference system, e.g. WOLRD, must be activated. This can be carried out with the FTL macros SetRefSys, SetRefSys3P or SetRefSysWorld. But 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)
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. In the FTL programming, this variable is checked with a WAIT instruction. If the conveyor has the corresponding value, tracking is activated in FTL with the SetRefSysDyn command.
:
Lin(pos1)
// wait until conveyor system is at position 230
WAIT plc_InDint[3] >= 230
SetRefSysDyn(refTrack)
Lin(pos2)
:
5. General tracking function
24 Festo GDCP-CMXR-C2-ST-EN 1002NH
Example, start tracking from the PLC:
Following the same principle as the interrogation of the conveyor system, a start of the trackings 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)
:
E M
E E
X
Y
Z
X
Y
Z
Moving reference system Moving axis system
Tracking basis system = zero point
plc_VarDint[3] =StartValue
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 25
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” task, which is called up cyclically with the MotionTimer.
Note
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
Variable 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
5. General tracking function
26 Festo GDCP-CMXR-C2-ST-EN 1002NH
Enable : BOOL
This signal activates the module; it must be applied statically.
FrameNumber : DINT
Number of the des frame data range. Range of values is 0 to 7.
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
Variable 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.
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 27
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.
AnyTrackingActive : BOOL
A tracking operation is active, that is, currently the set reference system is a moving reference system.
ThisTrackingActive : BOOL
This reference system (of the specified ports) is set actively in tracking operation.
5. General tracking function
28 Festo GDCP-CMXR-C2-ST-EN 1002NH
5.5 Applications
This chapter describes examples of applications, 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. But 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
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 29
Example:
The following variables are used in the following example:
plc_InDint[5], this is the command variable for start, 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.
When start has taken place, 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)
:
Note
When the tracking stops, note that it cannot stop exactly at the desired conveyor position due to reaction times and braking ramps of the set dynamic response.
5. General tracking function
30 Festo GDCP-CMXR-C2-ST-EN 1002NH
5.5.2 Tracking of movements at 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 now 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. To do this, a reference system is defined on the bending edge of the
workpiece:
Bending press
Kinematics
X
Z
X
Z
Displacement encoder
A
A
Starting state:
Kinematics insert position Bending press top
Finished state:
Kinematik in bending end position Bending press bottom
Displacement encoder
X
Z
Y
Position stamp at start of tracking
Coordinate system for tracking
X
O
b
j
e
5. General tracking function
Festo GDCP-CMXR-C2-ST-EN 1002NH 31
Sequence:
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 FTL example, the tracking of the PLC 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)
// run command to activate tracking
Lin(pos1)
// bending procedure is running
// wait for start of PLC
WAIT (plc_InDint[3] = 2)
// tracking off
SetRefSysWorld()
// run out of the press, set down part
Lin(pos3)
:
5. General tracking function
32 Festo GDCP-CMXR-C2-ST-EN 1002NH
6. Linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 33
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 diagram illustrates the relationship between motion and process control:
Sequence:
The position of the conveyor system is recognised and administered by the PLC. Further, the PLC takes over control of a sensor system for object sensing, e.g. a camera or light barrier. Now the objects within the PLC program are sorted or selected as desired and
fed to the motion control via an internal interface.
Conveyor system
Objects
Object recognition, e.g. with camera or light barrier
Position sensor, e.g. encoder
Kinematics
FTL
Program
PLC
Program
Process control (PLC) Motion control
CMXR-C2
ID = 13
Shared memory
Objects
ID = 47
6. Linear tracking
34 Festo GDCP-CMXR-C2-ST-EN 1002NH
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.
Note
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. light barrier 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.
Note
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 illustrations 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
6. Linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 35
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. light barrier, vision system, have to be calibrated to this shared zero point.
M
M
M M
Kinematics working space
Kinematics coordinate system Shared zero point on the conveyor
6. Linear tracking
36 Festo GDCP-CMXR-C2-ST-EN 1002NH
6.1.3 Alignment
Ideally, the level of the conveyor system is vertical to the Cartesian Z-axis of the kinematics system. But the conveyor system has to be measured and set up.
Note
Based on the application, the conveyor level must be aligned correspondingly precisely to the X-Y level of the kinematics system. Discrepancies can have an influence on the gripping positions or even cause damage to the tool and object.
Note
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, such as with an encoder, must reproduce the path of the belt very precisely.
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.
6. Linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 37
6.3 Object memory, object protocol
For saving the objects, every conveyor system has 2 memory areas:
Object memory with a maximum of 16 places
Object protocol with 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 can 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 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.
Conveyor system Objects
Sensor, e.g. with camera
Kinematics
Keep distance as small as possible
Conveyor system
Encoder with contact
roller on the belt
Example of tap-off of belt position in the
working space:
6. Linear tracking
38 Festo GDCP-CMXR-C2-ST-EN 1002NH
6.4 Processing the objects
To be able to process the individual objects, the position and location of the object must be known. These data are 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.
Note
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 to 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.
The following illustration shows objects on a conveyor system:
Note
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.
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
6. Linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 39
6.4.1 Object 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 related to the moving object
Lin(AbovePos)
Lin(TakePos)
Lin(AbovePos)
// activation of a static reference system = tracking switched
off
SetRefSysWorld()
// run command to activate system WOLRD
Lin(WaitPos)
:
6. Linear tracking
40 Festo GDCP-CMXR-C2-ST-EN 1002NH
6.5 Setting the objects
The PLC has the task of detecting objects and feeding them to the object memory in the CMXR control system. 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 time desired time and then processes the current objects in the object memory.
Note
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.
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 41
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. These data are 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 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 userId can be used by the application program to identify objects. Administration and assignment are carried out by the application program in the PLC.
7. FTL programming of linear tracking
42 Festo GDCP-CMXR-C2-ST-EN 1002NH
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.
Caution
If a program sequence that is not processed in the main run is programmed, 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.
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 43
Representation of the variables within the tracking system:
The parameters of the individual areas are treated in the following chapter.
X
Start of work space = minWorkArea
minWork End of area for objects = maxAcceptArea
Y
workDistance < 0
X
Y
hasLeftArea = TRUE isReachable = TRUE
workDistance < 0
End of work space = maxWorkArea
7. FTL programming of linear tracking
44 Festo GDCP-CMXR-C2-ST-EN 1002NH
7.2 CONVEYOR module
The CONVEYOR module is the illustration of the 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.
Note
The maximum number of conveyor systems is limited to 4. And so a maximum of 4 CONVEYOR modules can be created.
The following illustration 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 are 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 space = minWorkArea
End of area for objects = maxAcceptArea
work space = maxWorkArea
X
E
n
d
of X+, positive direction of the conveyor
Reference system of
an object
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 45
Instancing
Instancing of the “CONVEYOR” module establishes the name with which the function of the linear tracking can be used in the FTL programs.
Instancing
<Instance name> : CONVEYOR( <interface> : MAPTO CONVITF,
<refSys> : MAPTO REFSYS,
<dataComplete> : BOOL
< minWorkArea> : REAL,
< maxAcceptArea> : REAL,
< maxWorkArea> : REAL )
Note
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)
Variable 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
7. FTL programming of linear tracking
46 Festo GDCP-CMXR-C2-ST-EN 1002NH
interface : MAPTO CONVITF
The index describes a reference to the memory area in which the object data are 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. Important is that the conveyor direction always points in the positive X direction. If, for example, a camera system for object sensing is integrated, it must be calibrated to the same reference
system.
minWorkArea, maxWorkArea, maxAcceptArea : REAL
These 3 parameters describe the beginning and end of the work space of the kinematics system in relationship to the reference system of the conveyor system. The parameter 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 position. This limit must be determined in experiments.
The variables are presented in the graphic on page 44.
Methods
The CONVEYOR module has the following methods:
Method Manual
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
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 47
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 (see chapter 8.4 Module RCTR_UpdateConvInterface on page 77). It signals the PLC 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 any 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
7. FTL programming of linear tracking
48 Festo GDCP-CMXR-C2-ST-EN 1002NH
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.
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.
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 49
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 eMacroWarningTrackItfNotActive 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 eMacroWarnInitTrackObjFailed 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 return
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.
7. FTL programming of linear tracking
50 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 meets the attribute. And so the method returns the object with ID = 17. It is the first object in the memory that equals 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.
Note
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.
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 51
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.
WaitReachable, like the WAIT instruction, works in the FTL program. There are 2 cases for
this:
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.
7. FTL programming of linear tracking
52 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 eMacroWarningTrackItfNotActive The tracking interface is not active at the PLC.
-*)
3787 Info eMacroInfoTrack-WaitReachPLCAbort
The method was cancelled by the PLC 1
*) - = no return
Table 7.10 Messages Method WaitReachable
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.
Note
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)
:
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 53
Caution
If the variable isReachable is used, such as for IF branches, observe that such instructions must be 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.
7. FTL programming of linear tracking
54 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 can be read out and processed by the PLC.
Note
When Done is called, data, such as the position of the conveyor system, date, time are saved internally to the object. These data are used for further diagnosis. For this reason, the method Done should be called up very quickly, so that the determined data are as current as possible.
Syntax
<Instance name>.Done( <object> : TRACKOBJECT,
OPT <state> : BOOL)
Variable Type Significance
object TRACKOBJECT Object data of the involved 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 parameter State. It is stored in the object status and can be processed further on the PLC page. See chapter 8.3.1 Object data type TRCTR_OBJECT on page 67.
TRUE Object successfully processed
FALSE Processing was not successful.
If this optional parameter is not specified, the value TRUE is always set for this object and so transmitted as Status to the PLC.
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 55
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 are invalid. -
2559 Warning eMacroWarningTrackItfNotActive The conveyor interface is not active on the PLC.
-
*) - = no return
Table 7.12 Messages Method Done
Note
Calling up Done 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 Done 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)
:
7. FTL programming of linear tracking
56 Festo GDCP-CMXR-C2-ST-EN 1002NH
7.3 Conveyor module visualisation pages
If a project is loaded with a created Conveyor module, a visualisation page of the Conveyor
module can be called up via the pushbutton on the handheld terminal. Data can be changed and viewed on this page.
Note
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
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 57
7.3.1 Configuration page
The configuration page of the Conveyor module includes the parameters of the module as well as other data that are 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 instance
7. FTL programming of linear tracking
58 Festo GDCP-CMXR-C2-ST-EN 1002NH
7.3.2 Object memory
This page displays the 16 memory locations of the internal object memory. The description of the object memory is located in chapter 6.3
Object memory, object protocol on page 37.
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 conveyor system's
zero point.
State Current status of the object; it can change 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 from the columns X, Y and A are the position values of the object in its recognition, e.g. via a vision system.
Selection of the module instance Switching to other objects
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 59
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. The description of the object memory is located in chapter 6.3 Object memory, object protocol on page 37.
The following softkeys are used for navigation:
Displays the 8 oldest objects, whereby the bottom object is the oldest
Displays starting with the newest object
Page up
Page down
Displays 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
7. FTL programming of linear tracking
60 Festo GDCP-CMXR-C2-ST-EN 1002NH
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.
Illustrated as minimum and maximum value are:
conveyor speed,
the 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
7. FTL programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 61
7.3.5 Statistics page
The data of the objects are illustrated on the statistics data. Recording can be done with this visualisation page, such as to investigate effects of process optimisations. 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.
8. PLC programming of linear tracking
62 Festo GDCP-CMXR-C2-ST-EN 1002NH
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. Further information on programming of the PLC can be taken from the corresponding documentation.
The module library RcTracking.lib is available to create a tracking application.
8.1 Mode of operation
The CMXR-C2 control system has a shared memory that the process control and motion
control (Robotic 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 by a vision system, for example. 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.
Caution
For the tracking function to work properly, the modules must be called up in the “MotionTask” task, so 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 taken from the description of the individual modules.
PLC
FTL program shared
memory
Motion control
System module
wn object memory
O
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 63
8.1.1 Functions of the PLC
The PLC is responsible for the complete parts administration. This means the PLC is responsible for:
sending the object data into the object memory,
optionally deletion of the object data from the object memory,
reading out the object status from the object and protocol memory.
optionally construction of statistics in the user program
To identify objects, coupling of a sensor system, e.g. light barrier, vision system, must be
integrated in the user program. If necessary, a parts administration of the detected objects must be built in.
Note
Modules are offered 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 name 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 log
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
All modules are described in the following chapters. Only the description of the module RCTR_UpdateFrameInterface is located in the chapter 5.4.1 Module RCTR_UpdateFrame on page 25.
8. PLC programming of linear tracking
64 Festo GDCP-CMXR-C2-ST-EN 1002NH
8.2 Object administration
Administration of the objects is managed in 2 submemories:
object memory for active parts that are being processed
object protocol for processed parts.
Each Conveyor has its own submemory. The object data themselves are managed within a data structure.
Note
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 by PLC
Possible visualisation statistics
Object protocol for archiving of
max. 1024 objects
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 65
8.2.1 Object processing with automatic deletion of objects
There is the possibility that the CMXR control system 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 have the following configuration:
Sending of objects with RCTR_AddObject module
Possibly reading out of statistics, object memory and object protocol for diagnostics and visualisation
Use of the RCTR_RemoveObjekt module is not possible.
8. PLC programming of linear tracking
66 Festo GDCP-CMXR-C2-ST-EN 1002NH
The process of automatic object deletion is illustrated in the following graphic. The different software areas involved are marked in colour.
Due to the FTL program, the sequence in reading out the objects with CONVEYOR.Wait does not have to be identical to the sequence of adding through 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
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 log
Visualisation statistics
Sensors for object sensing
Internal object administration
Set System function FTL user program
Colour key:
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 67
8.2.2 Object processing with manual deletion of objects
The following graphic illustrates the process of manual object deletion (through the user PLC program). The different software areas involved are marked in colour.
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 log
Visualisation statistics
Sensors for object sensing
Internal object administration
PLC user program System function FTL user program
Colour key:
Object processed
Object from work space
8. PLC programming of linear tracking
68 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 for identification
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
This is an identification for internal purposes This value is assigned internally and cannot be changed by the user.
userId : DINT
This is an identification number for the object and 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 (16 objects) and object protocol (1024 objects).
state : TRCTR_ObjectState
Returns the object status. The object status is returned in the shape of an enumeration. The possible statuses are described in chapter 8.3.2 Object status on page 70.
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 69
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.
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 can be 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 identification.
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 band movement, Y is the direction lateral to the direction of movement and Z the height above the conveyor belt.
If new objects are recognised using sensors (e.g. light barrier), 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.
Note that the orientations (A, B and C) are specified in the form of the rights system. In addition, orientations must be specified according to the Euler convention ZYZ.
Note
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 at the handheld terminal is displayed.
8. PLC programming of linear tracking
70 Festo GDCP-CMXR-C2-ST-EN 1002NH
attribute : DWORD
Attributes of the object. These can be defined via a vision system, for example, or decribed 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.
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 contains 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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 71
8.3.3 Add object, module RCTR_AddObject
With the module RCTR_AddObject, object data are 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 are taken over into the object
memory. If no further object can be accepted, e.g. memory is full,
an error is signalled 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 following variables of the structured data type TRCTR_Object with corresponding data:
userId
detectionPos
attribute
All other data are not relevant for adding an object. These are generated by the system or
at the execution time.
8. PLC programming of linear tracking
72 Festo GDCP-CMXR-C2-ST-EN 1002NH
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 73
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.
Note
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 while deleting the object, this flag is 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
8. PLC programming of linear tracking
74 Festo GDCP-CMXR-C2-ST-EN 1002NH
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 75
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 are 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
Note
If no valid object is in the specified memory location, the status Unknown is returned in the variable Object.state.
8. PLC programming of linear tracking
76 Festo GDCP-CMXR-C2-ST-EN 1002NH
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 77
8.4 Conveyor 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 light barrier, for example, as well as determination of the position of the conveyor system is not a component of the module and must be made separately.
Note
Processing of the module must take place in the MotionTask.
8. PLC programming of linear tracking
78 Festo GDCP-CMXR-C2-ST-EN 1002NH
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.
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 79
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 log. If the object
log is empty, this index is set to -1.
Table 8.11 Data of module RCTR_UpdateConvInterface
8. PLC programming of linear tracking
80 Festo GDCP-CMXR-C2-ST-EN 1002NH
Note
For the sum of the variables WaitingObjects and ActiveObjects, the rule is:
WaitingObjects + ActiveObjects <= 16
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.
X
X
X
X
Y Y
Y
Reference system of the conveyor
Start of work space = minWorkArea
End of area for objects = maxAcceptArea
End of work space = maxWorkArea
X
Y
X+, positive direction of the conveyor
ObjectInRestrictedArea = TRUE
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 81
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
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 made to calculate the ratio of conveyor path to increments.
Calculation:
ConvResNum = 46117 increments
ConvResDenom = 836 mm
These two values must be entered in the respective input variables of the Conveyor module.
8. PLC programming of linear tracking
82 Festo GDCP-CMXR-C2-ST-EN 1002NH
8.5 Object protocol
As soon as an object leaves the object memory, e.g. calling of the module RCTR_RemoveObject, it is recorded in the object protocol. Here, the objects are held in a memory, whereby a maximum of 1024 protocols can be stored. The last 1024 entered protocols are entered. If an additional entry is made, the oldest entry is deleted.
Note
The data of the object protocol are 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 msec.
Note
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. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 83
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.
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 are 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 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
8. PLC programming of linear tracking
84 Festo GDCP-CMXR-C2-ST-EN 1002NH
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId. The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 85
8.5.2 Module RCTR_GetLog
The module RCTR_ReadLog reads an object's data out of the protocol memory using the UserId.
Note
If there are several objects in the memory with the same UserId, the first one found with this Id is output. To achieve secure access, duplicate UserIds must 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 are 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 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
8. PLC programming of linear tracking
86 Festo GDCP-CMXR-C2-ST-EN 1002NH
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId. The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 87
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.
Note
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.
8. PLC programming of linear tracking
88 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 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 are 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
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId.
The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 89
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
8. PLC programming of linear tracking
90 Festo GDCP-CMXR-C2-ST-EN 1002NH
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId. The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 91
8.7 Reading the statistical data
In the motion control, statistical data are 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.
And so an individual statistics evaluation can be prepared within the PLC, such as an hourly, daily or weekly evaluation.
Note
The statistical data are 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 msec.
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 are reset.
This is only possible if the Enable input is set to FALSE.
8. PLC programming of linear tracking
92 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 with setting of 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.
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 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 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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 93
Error numbers
In case of an error (Error = TRUE), an error number is displayed with ErrorId. The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
Note
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.
8. PLC programming of linear tracking
94 Festo GDCP-CMXR-C2-ST-EN 1002NH
8.8 Signal conditioning in the PLC
Encoder signals in practice very often 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.
Note
Filtering of the encoder signals influences the temporal behaviour of the tracking movement.
Some functional modules 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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 95
8.8.1 Module RCSP_LagCompensator
To compensate for system-related inactive times, a module is offered 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, max. 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 output 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.
Note
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 Motion-Task) 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.
8. PLC programming of linear tracking
96 Festo GDCP-CMXR-C2-ST-EN 1002NH
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. The related error numbers are described in chapter 8.9 Messages of the modules on page 100.
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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 97
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 are 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
Position 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
8. PLC programming of linear tracking
98 Festo GDCP-CMXR-C2-ST-EN 1002NH
8.8.3 Module RCSP_SmoothingFilter
The 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
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 99
8.8.4 Module RCSP_DynLimitFilter
The 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 further strongly increased if the built-in “pre-filter” (= smoothing filter) itself is activated with a short time (approx. 2-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 ConvResNum /
ConvResDenom. 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
8. PLC programming of linear tracking
100 Festo GDCP-CMXR-C2-ST-EN 1002NH
8.9 Messages of the modules
The following describes all messages generated by the modules. The named enumerations are defined within the library McUtils.lib in CoDeSys.
There is a difference 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 functional modules) 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)
Remedy 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)
Remedy Check system configuration.
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 101
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)
Remedy 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)
Remedy 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.
Remedy Check system configuration
8. PLC programming of linear tracking
102 Festo GDCP-CMXR-C2-ST-EN 1002NH
8.9.2 Error
Message number 10201
Message type Error
Enumeration eMCE_ErrTrackNotInitialized
Message text %1: Tracking is not initialised
Parameter 1: Functional module from which the error was issued
Effect Functional module cannot be executed
Cause Tracking is not initialised; module can therefore not be used.
RCTR_UpdateConvInterface must be called up before.
Remedy Check application
Message number 10202
Message type Error
Enumeration eMCE_ErrTrackInvalidInterface
Message text %1: Invalid conveyor index %2 (permissible range of values: %3..%4)
Parameter 1: Name of the called functional module.
2: Interface index
3: Smallest permissible index.
4: Largest permissible index.
Effect Functional module is not carried out.
Cause Functional module was called with an invalid interface index.
Remedy Check application.
Message number 10203
Message type Error
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 Functional module is not carried out.
Cause Module was called with invalid port index
Remedy Check application.
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 103
Message number 10204
Message type Error
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 Functional module is not carried out.
Cause RCTR_ReadBuffer was called with invalid index.
Remedy Check application.
Message number 10205
Message type Error
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 Functional module is not carried out.
Cause RCTR_ReadLog was called with invalid index.
Remedy Check application.
8. PLC programming of linear tracking
104 Festo GDCP-CMXR-C2-ST-EN 1002NH
Message number 10206
Message type Error
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 Functional module is not executed, tracking function cannot be used.
Cause RCTR_UpdateConvInterface was called with an invalid value for convResNum.
Remedy Check application.
Message number 10207
Message type Error
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 Functional module is not executed, tracking function cannot be used.
Cause RCTR_UpdateConvInterface was called with an invalid value for convResDenom.
Remedy Check application.
Message number 10209
Message type Error
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 Functional module is not carried out.
Cause RCSP_LagCompensator was called with an invalid value for LagTime.
Remedy Check application.
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 105
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 Functional module is not carried out.
Cause Object with specified ID was not found
Remedy 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 functional module.
Effect Functional module is not carried out.
Cause Object with specified ID was not found
Remedy 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 functional module.
Effect Functional module is not carried out.
Cause Object with specified ID was not found
Remedy Check application.
8. PLC programming of linear tracking
106 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 functional module.
Effect Object is not processed.
Cause Object was rejected by the conveyor
Remedy 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.
Remedy 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 functional module.
Effect Execution of the functional module failed.
Cause Object from parts recognition could not be entered in the object memory;
the buffer is full
Remedy Check application.
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 107
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 functional module.
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.
Remedy 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 functional module.
Effect Module is not executed.
Cause Internal error in object administration.
Remedy 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 functional module.
Effect Module cannot be executed.
Cause Internal error in object administration.
Remedy If the problem occurs again, contact system supplier
8. PLC programming of linear tracking
108 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 Functional module is not carried out.
Cause RCTR_ReadNextLogObject was called without prior execution of
RCTR_ReadFirstLogObject.
Remedy 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.
Remedy 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.
Remedy None
8. PLC programming of linear tracking
Festo GDCP-CMXR-C2-ST-EN 1002NH 109
8.10 Sensor integration
A sensor is necessary to recognise objects on the conveyor system. A light barrier 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 not-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. light barrier, 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:
9. Linear tracking applications
110 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 non-moving 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 examples of applications, 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 is, 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
Vakuum.Set()
// over part
Lin(AbovePos)
// gripping position
Lin(TakePos)
// gripping time
WaitTime(0)
// over part
9. Linear tracking applications
Festo GDCP-CMXR-C2-ST-EN 1002NH 111
Lin(AbovePos)
// reference system WORLD
SetRefSysWorld()
// delete part from memory
Conv1.Done(PartData)
Lin(AboveReleasePos)
// set down 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 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
// waiting for object with ID available
Conv1.Wait(PartData, PartId)
9. Linear tracking applications
112 Festo GDCP-CMXR-C2-ST-EN 1002NH
// wait for part in the work space
Conv1.WaitReachable(PartData)
// set reference system of the object
SetRefSysDyn(PartData.RefSys)
Vakuum.Set() // gripper vacuum on
Lin(AbovePos) // over part
Lin(TakePos) // gripping position
WaitTime(0) // gripping time
Lin(AbovePos) // over part
SetRefSysWorld() // reference system WORLD
Conv1.Done(PartData) // delete part from memory
Lin(AboveReleasePos)
Lin(ReleasePos) // set down 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
:
9. Linear tracking applications
Festo GDCP-CMXR-C2-ST-EN 1002NH 113
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. Linear tracking applications
114 Festo GDCP-CMXR-C2-ST-EN 1002NH
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 correspondingly 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.
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)
Vakuum.Set() // gripper vacuum on
Lin(AbovePos) // over part
Lin(TakePos) // gripping position
WaitTime(0) // gripping time
Lin(AbovePos) // over 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) // over part
Lin(TakePos) // gripping position
Vacuum.Reset() // gripper vacuum off
WaitTime(10) // vacuum waiting time
Lin(AbovePos) // over part
RefSysWorld() // reference system WORLD
Conv1.Done(PartData) // delete part from memory
END_WHILE
:
9. Linear tracking applications
Festo GDCP-CMXR-C2-ST-EN 1002NH 115
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 interval 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 in 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
Loose objects jects arrayed and aligned
on 0 degrees
Ob
9. Linear tracking applications
116 Festo GDCP-CMXR-C2-ST-EN 1002NH
newRef.baseRs := MAP(FirstPart.refsys)
newRef.a := 90 - FirstPart.refSys.frame.a
SetRefSys(newRef)
// global variable for distance calculation
DistanceY := 0
CALL PutPart
// Y offset 20mm 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 20mm 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
:
9. Linear tracking applications
Festo GDCP-CMXR-C2-ST-EN 1002NH 117
FTL subprogram TakePart
This program takes the part from the conveyor with a vacuum gripper.
Vakuum.Set() // gripper vacuum on
Lin(AbovePos) // over part
Lin(TakePos) // gripping position
WaitTime(0) // gripping time
Lin(AbovePos) // over part
FTL subprogram PutPart
The part is placed with the PutPart program. The position is determined through the active reference system.
AbovePos.y := DistanceY
Lin(AbovePos) // over part
TakePos.y := DistanceY
Lin(TakePos) // gripping position
Vacuum.Reset() // gripper vacuum off
WaitTime(10) // vacuum waiting time
Lin(AbovePos) // over part
Example with “empty” objects
In this example, the PLC creates empty objects, which illustrate the later sequence. So that the sequence of “empty” objects will be recognised, the PLC creates this series with defined IDs, e.g. 11, 12, 13. The real objects get, for example, the ID = 1.
“Empty” objects
Conveyor
9. Linear tracking applications
118 Festo GDCP-CMXR-C2-ST-EN 1002NH
:
Conv1.Begin() // activate conveyor system
SetRefSysWorld()
Lin(WaitPos) // at wait position
Id := 11
WHILE TRUE DO
// waiting 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
// waiting 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
: