Skip to content

Function Blocks

FB_KinematicAxisRef

(implements I_KinematicAxisRef)

Serves as basis to connect Kinematic to all ACS and MCS Axis. The FB is prepared to DOF=6. Configured DOF needs to be set in Property DegreesOfFreedomConfigured. Default is DOF=6.

This FB decouples the ACS and MCS Axis from the Kinematic. This way it is possible ot interchange the Kinematic Transformation Objects without PLC Restart.

FB_KinematicGroup

(extends FB_ComponentBase, implements I_KinematicGroup)

Serves as manager for all Kinematic Group functions. Requires to be linked to desired kinematic transformation object via NCTOPLC_NCICHANNEL_REF and PLCTONC_NCICHANNEL_REF.

Info

Kinematic State Diagram applies for this Functionblock.

Properties

Property Type Access Description
KinematicAxisIds ST_KinAxes R/W Get/Set Kinematic Axis Ids corresponding ot ACS and MCS Axis Objects
KinematicStatus E_KinStatus R Get the current Kinematic Object Status
KinMetaInfo U_KinMetaInfo R/W Get/Set the current Kinematic Object Configuration for Forward Transformation
iAxisRef I_KinematicAxisRef R/W Sets ACS and MCS Axes to Base Object from FB_KinematicAxisRef

Info

You select the OID from the Kinematic in “Symbol Initialization” of the PLC instance. image

Methods

Method Return Type Access Description
BuildKinGroup BOOL Public Returns TRUE Command was accepted
DissolveKinGroup BOOL Public Returns TRUE Command was accepted
ResetKinGroup BOOL Public Returns TRUE Command was accepted
CalcKinPosition BOOL Protected Returns TRUE Command was accepted
SetKinematicParameter BOOL Public Returns TRUE Command was accepted, Sets Parameter for Kinematic Object via OID and PID for Tool and Kinematic
PresetRotationExtRotationRange BOOL The function block FB_KinPresetRotation sets the rotational state. The rotational state is not persistent and must be reset after a TwinCAT restart or if a path is started after an ACS axis movement (direct mode)
ActivateExtRotationRange BOOL Returns TRUE Command was accepted. Extends the rotation of the Kinematic Object to full circle.
DeactivateExtRotationRange BOOL Returns TRUE Command was accepted. Resets rotation behavior back to default.

BuildKinGroup()

METHOD PUBLIC BuildKinGroup : BOOL

Executes the build of the Kinematic object. ACS and MCS Axis Ids from KinematicAxisIds are applied to the kinematic object selected.

Target State is Cartesian mode. E_KinStatus.KinStatus_Ready

DissolveKinGroup()

METHOD PUBLIC DissolveKinGroup : BOOL

If Kinematic Group is built, by executing this command, the Kinematic connection will be dissolved. ACS Axis will be standalone.

Target State is Joint mode. E_KinStatus.KinStatus_Empty

ResetKinGroup()

METHOD PUBLIC ResetKinGroup : BOOL

Reset Kinematic Group in case of E_KinStatus.KinStatus_Error. This function can also be used to transfer the Kinematic from E_KinStatus.KinStatus_Pending to E_KinStatus.KinStatus_Ready in case the Kinematic was not enabled at Build.

CalcKinPosition()

1
2
3
4
5
6
7
METHOD PROTECTED CalcKinPosition : BOOL
VAR_INPUT
    ACS : ARRAY[1..8] OF LREAL;
END_VAR
VAR_OUTPUT
    MCS : ARRAY[1..8] OF LREAL;
END_VAR

Calculates 4 times per second the MCS positions based on the configured Kinematic transformation, the current ACS positions and KinMetaInfo.

Warning

To receive correct forward transformation positions KinMetaInfo applies for Scara and 5D Type Robots.

SetKinematicParameter()

1
2
3
4
5
6
7
8
METHOD SetKinematicParameter : BOOL
VAR_INPUT
    KinPTCID        : PTCID;
    (* PTCID given is Tool PTCID, If False Parameter change is requested in main Kinematic Object*)
    isToolPTCID     : BOOL;
    Length          : UDINT;
    Value           : PVOID;
END_VAR

Set individual Kinematic or Tool Parameter via the OID and PTCID in the Kinematic Object. The PTCID can be found in the Parameter View of your Kinematic Object.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
VAR_INST
    _ChangeToolParameter : BOOL;
    _ChangeKinParameter  : BOOL;
    _Parameter           : LREAL;
END_VAR

IF _ChangeToolParameter THEN
    DeltaKinematic.SetKinematicParameter(   KinPTCID    := KINEMATIC_PTCID.PTCID_TOOL_X_OFFSET,
                                            isToolPTCID := TRUE,
                                            Len         := SIZEOF(_Parameter),
                                            Value       := ADR(_Parameter));
    _ChangeToolParameter := FALSE;
END_IF
IF _ChangeKinParameter THEN
    DeltaKinematic.SetKinematicParameter(   KinPTCID    := KINEMATIC_PTCID.DELTA_INNER_ARM_LENGTH,
                                            isToolPTCID := FALSE,
                                            Len         := SIZEOF(_Parameter),
                                            Value       := ADR(_Parameter));
    _ChangeKinParameter := FALSE;
END_IF

PresetRotationExtRotationRange()

1
2
3
4
METHOD PresetRotationExtRotationRange : BOOL
VAR_INPUT
    Rotation                            : ARRAY[1..3] OF LREAL; // Relates to 3 rotations availabe e.g. Rx, Ry, Rz.
END_VAR

Information to extended Rotation Range to find here.

ActivateExtRotationRange()

METHOD ActivateExtRotationRange : BOOL

Activates FB_KinExtendedRotationRange. It is required to set Rotation with PresetRotationExtRotationRange() before calling this Method.

Information to extended Rotation Range to find here.

DeactivateExtRotationRange()

METHOD DeactivateExtRotationRange : BOOL

Deactivates extended rotation back to default of your Kinematic.

FB_ComponentKinematicBase

(extends FB_KinematicGroup, implements I_Kinematic)

Serves as Functionblock for basic Robotic functions such as moving Joint Axis and Cartesian Axis. This FB also manages the correct implementation of the Kinematic Boot-up and Enabling sequence.

Errors are indicated by the AdsError

Properties

Property Type Access Description
ActPosition ST_KinematicPosition R Returns current position of ACS and MCS Drives
Enabled BOOL R Returns True if the Robotic System is enabled
InPosition BOOL R Returns True if the Robotic System is at Target Position with all its Axis
Moving BOOL R Returns True if one or more Axis is moving. Limits are set in the NC Axis Object
Override LREAL W Set Override for Robotic System
TargetMotionParameter ST_KinematicMotionParameter R/W Get/Set the motion Parameter of ACS and MCS Axis (Acceleration, Deceleration, Jerk, Position)
iAxisRef I_KinematicAxisRef W Set interface to Axis Reference Object. Direct access to ACS and MCS axis configured in Motion

Methods

Method Return Type Access Description
Disable BOOL Returns TRUE Command was accepted, Disables the Robotic System MC_Power
Enable BOOL Returns TRUE Command was accepted, Enables the Robotic System ACS and MCS Axes MC_Power
JogCartesianAxis BOOL Returns TRUE Command was accepted, Jogs one Cartesian Axis
JogJoint BOOL Returns TRUE Command was accepted, Jogs one Joint Axis
Stop BOOL Returns TRUE Command was accepted, Stops all movement of the Robotic System
MoveToPointJoint BOOL Returns TRUE Command was accepted, Moves to target System in Joint Mode via the ACS system

Disable()

METHOD PUBLIC Disable : BOOL

Disable all Axes connected to Kinematic Object.

Enable()

METHOD PUBLIC Enable : BOOL

Enable all Axes connected to Kinematic Object. Trigger run of Enabling sequence if Kinematic Group was built before Kinematic was disabled.

JogCartesianAxis()

1
2
3
4
5
6
7
METHOD JogCartesianAxis : BOOL
VAR_INPUT
    Axisx       : UDINT(1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM);
    Forward     : BOOL;
    Backward    : BOOL;
    JogMode     : E_JogMode;
END_VAR

Individual Job of Cartesian Axis. Possible Jog Modes are E_JogMode.MC_JOGMODE_STANDARD_FAST and E_JogMode.MC_JOGMODE_STANDARD_SLOW.

JogJoint()

1
2
3
4
5
6
7
METHOD JogJoint : BOOL
VAR_INPUT
    Jointx      : UDINT(1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM);
    Forward     : BOOL;
    Backward    : BOOL;
    JogMode     : E_JogMode;
END_VAR

Individual Job of Joint Axis. Possible Jog Modes are E_JogMode.MC_JOGMODE_STANDARD_FAST and E_JogMode.MC_JOGMODE_STANDARD_SLOW.

Stop()

1
2
3
4
5
6
7
8
METHOD PUBLIC Stop : BOOL
VAR_INPUT
    (*In Kinematic Base FB deceleration Input and Jerk input for Stop() are not used. 
    Intention is that for each of the possible 6 Axis a different Dcc and Dcc-Jerk might be possible.
    If the Inputs are needed, the function can be overloaded and programmed as desired. *)
    Deceleration : LREAL;
    Jerk         : LREAL;
END_VAR

Immediate Stop of all movement. Stop-Parameter set in TargetMotionParameter. If TargetMotionParameter Deceleration for specific axis is 0, default value from last command active is used according to MC_Halt.

MoveToPointJoint()

METHOD MoveToPointJoint : BOOL

Moves ACS System to Target Position - implementation pending!

FB_KinematicMotionAmpBase

(extends FB_BaseFB, implements I_KinematicCm)

Manages functions of TF5420 Advanced Motion Package Pick-Place. Functions as add-on to Kinematic Module for Cartesian Coordinated Movements for Robot Systems up to DOF=4.

Follows AMP state diagram:

Properties

Property Type Access Description
CmState ST_KinematicComponentAmp_CmGroupState R Get current state of coordinated motion Group
CmIdentAxis1 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_X
CmIdentAxis2 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_Y
CmIdentAxis3 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_Z
CmIdentAxis4 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_C1
CmGroupRef AXES_GROUP_REF W Access to Coordinated Motion Group Instance
CmAxisCount UDINT W Set connected Axis, defined by Kinematic DOF
CmAxisRef REFERENCE TO ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF AXIS_REF W Set Axis Reference for Advanced Motion Package to FB

Methods

Method Return Type Description
AddCircularMoveToPath BOOL Returns TRUE when the move was added -> up to 30 adds per cycle possible
AddLinearMoveToPath BOOL Returns TRUE when the move was added -> up to 30 adds per cycle possible
DisableCmGroup BOOL Returns TRUE Command was accepted, Disables the Kinematic Motion Group
EnableCmGroup BOOL Returns TRUE Command was accepted, Enables the Kinematic Motion Group
StartMovePath BOOL Returns TRUE Command was accepted, Starts the move of the prepared Path
UngroupCmGroup BOOL Returns TRUE Command was accepted, Dissolves the Motion Group
BuildCmGroup Bool Returns TRUE Command was accepted, Add all DOF Axis to the Motion Group
ClearPath Bool Returns TRUE Command was accepted, Clears CM Path to prepare for next motion path
Stop BOOL Returns TRUE Command was accepted, Stops movement of CM Group or MCS/ACS System depending on Group/Kinematic State
SetOverride Bool Set Override for CM Group
Reset Bool Reset of CM Group
MapStatus ST_KinematicComponentAmp_CmGroupState CM-Status read and map to property CmState
TrackConveyorBelt Bool Returns TRUE Command was accepted, activates the tracking of a linear movement in space e.g. Conveyor
SetCoordinateTransform Bool Returns TRUE Command was accepted, add Coordinate Transformation to Cm Group

AddCircularMoveToPath

1
2
3
4
METHOD AddCircularMoveToPath : BOOL
VAR_INPUT
    AmpPoint : REFERENCE TO ST_AmpPoint;
END_VAR

Add a Circular Path segment to the Move-Path.

Closer description to the Path Parameter can be found here: Parameter

AddLinearMoveToPath

1
2
3
4
METHOD AddLinearMoveToPath : BOOL
VAR_INPUT
    AmpPoint : REFERENCE TO ST_AmpPoint;
END_VAR

Add a Linear Path segment to the Move-Path.

Closer description to the Path Parameter can be found here: Parameter

ClearPath

METHOD ClearPath : BOOL

Clears all movement segments from path.

StartMovePath

1
2
3
4
METHOD StartMovePath : BOOL
VAR_INPUT
    ChangePath : BOOL;
END_VAR

Executes the movement of the prepared path. If change of Path is required or new path needs to be started ChangePath = TRUE switches path.

Second Path can be prepared while first Path is executed by calling AddCircularMoveToPath or AddLinearMoveToPath.

DisableCmGroup

METHOD DisableCmGroup : BOOL

Following the State Diagram, the CM group will be disabled.

EnableCmGroup

METHOD EnableCmGroup : BOOL

Following the State Diagram, the CM group will be enabled.

UngroupCmGroup

METHOD UngroupCmGroup : BOOL

All Axis grouped to the CM Group will be released.

BuildCmGroup

METHOD PUBLIC BuildCmGroup : BOOL

CM Group will be built with the associated Axis_Ref in CmAxisRef.

TrackConveyorBelt

1
2
3
4
5
6
METHOD TrackConveyorBelt : BOOL
VAR_INPUT
    ObjectParameter : REFERENCE TO ST_AmpPoint;
    MasterRefPos    : LREAL;
    McCoordRef      : MC_COORD_REF;
END_VAR

Track Conveyor Belt Description

Track Conveyor Belt Configuration

Motion Parameter to start tracking are defined via the variables of ST_AmpPoint.

SetCoordinateTransform

1
2
3
VAR_INPUT
    McCoordRef : MC_COORD_REF;
END_VAR

Configuration

FB_ComponentKinematicMotionAmp

(extends FB_ComponentKinematicBase, implements I_KinematicCm)

Wrapper to integrate Basic Kinematic functions with FB_KinematicMotionAmpBase Extends functions for movement with Teach Point Management.

Properties

Property Type Access Description
CmState ST_KinematicComponentAmp_CmGroupState R Get current state of coordinated motion Group
CmIdentAxis1 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_X
CmIdentAxis2 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_Y
CmIdentAxis3 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_Z
CmIdentAxis4 IDENT_IN_GROUP_REF W Set allocation of Group axes to the depending cartesian Axis e.g. MCS_C1
CmGroupRef AXES_GROUP_REF W Access to Coordinated Motion Group Instance
ChangeOccurred BOOL R/W Change to one or more Points in Buffer has been detected. User can by this indication update the recipe. User needs to reset this variable to detect next change.
Points REFERENCE TO ARRAY[0..Parameter_Kinematic.MaxPoints] OF ST_AmpPoint R/W Access to Point Buffer

Methods

Method Return Type Description
AddCircularMoveToPath BOOL Returns TRUE when the move was added -> up to 30 adds per cycle possible
AddLinearMoveToPath BOOL Returns TRUE when the move was added -> up to 30 adds per cycle possible
DisableCmGroup BOOL Returns TRUE Command was accepted, Disables the Kinematic Motion Group
EnableCmGroup BOOL Returns TRUE Command was accepted, Enables the Kinematic Motion Group
StartMovePath BOOL Returns TRUE Command was accepted, Starts the move of the prepared Path
UngroupCmGroup BOOL Returns TRUE Command was accepted, Dissolves the Motion Group
BuildCmGroup Bool Returns TRUE Command was accepted, Add all DOF Axis to the Motion Group
ClearPath Bool Returns TRUE Command was accepted, Clears CM Path to prepare for next motion path
Stop BOOL Returns TRUE Command was accepted, Stops movement of CM Group or MCS/ACS System depending on Group/Kinematic State
TrackConveyorBelt Bool Returns TRUE Command was accepted, activates the tracking of a linear movement in space e.g. Conveyor
SetCoordinateTransform Bool Returns TRUE Command was accepted, add Coordinate Transformation to Cm Group
SetOverride Bool Set Override for CM Group
Reset Bool Reset of CM Group
MoveToPointCartesian BOOL Moves to one single selected point via AMP functions
GetPoint ST_AmpPoint Get Point Values for selected Point Index
SetPoint BOOL Set Point to Point input Value

AddCircularMoveToPath

1
2
3
4
METHOD AddCircularMoveToPath : BOOL
VAR_INPUT
    PointIndex : UDINT;
END_VAR

Add a Circular Path segment to the Move-Path. Index for Point is Point Buffer accessible via Property Points, max count of points determined by Parameter_Kinematic.MaxPoints.

Closer description to the Path Parameter can be found here: Parameter

AddLinearMoveToPath

1
2
3
4
METHOD AddLinearMoveToPath : BOOL
VAR_INPUT
    PointIndex : UDINT;
END_VAR

Add a Linear Path segment to the Move-Path. Index for Point is Point Buffer accessible via Property Points, max count of points determined by Parameter_Kinematic.MaxPoints.

Closer description to the Path Parameter can be found here: Parameter

FB_KinematicCamming

(Extends FB_CyclicFB implements I_KinematicCamming)

This FB provides the basic functionality for MC_Camming to move an axes system via cam tables. It implements and uses TF5050.

Properties

Property Type Access Description
CammingActive BOOL R Connected Axes System is Cammed in to Cam Table
CamAxisCount UDINT W Sets the amount of axes connected to the FB. Relates directly to the DOF of the Kinematic System
CamAxisRef REFERENCE TO ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF AXIS_REF R/W References the selected Axes of the Kinematic System
CamMaster REFERENCE TO AXIS_REF R References the Cam Master Axis
CamInOptions ST_CamInOptions R/W Set options for CamIn
CamTableSlaveDynamics ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF ST_CamTableSlaveDynamics R Slave dynamics read with ReadCamTableSlaveDynamics()

Methods

Method Return Type Description
CamClearPath BOOL Returns TRUE Command was accepted, Delete preset Cam Table Points
CamIn BOOL Returns TRUE Command was accepted, Cam In connected axes to cam table
CamOut BOOL Returns TRUE Command was accepted, Cam Out connected axes from cam table
CamStartMovePath BOOL Returns TRUE Command was accepted, Delete preset Cam Table Points
CamAddPointToPath BOOL Returns TRUE Command was accepted, this function will add one Point to the executing Cam Table
CamAddMotionPointByAxis BOOL Returns TRUE Command was accepted, this function will add one Point to the executing Cam Table
Disable BOOL Returns TRUE Command was accepted, this function will disable the Cam Virtual Master along with the Cammed In Slave Drives
Enable BOOL Returns TRUE Command was accepted, this function will enable the Cam Virtual Master along with the Cammed In Slave Drives
Reset BOOL Returns TRUE Command was accepted, this function will reset the Cam Virtual Master along with the Cammed In Slave Drives
SetOverride BOOL Returns TRUE Command was accepted, Sets the override for the Virtual Master and therefore for the Cam Table movement
Stop BOOL Returns TRUE Command was accepted, Stops all movement
ReadCamTableSlaveDynamics BOOL Returns TRUE Reads the cam table slave dynamics at the Master Position and saves it in Property CamTableSlaveDynamics

CamAddPointToPath()

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
METHOD CamAddPointToPath : BOOL
VAR_INPUT
    MotionFunctionFirstPoint : MC_MotionFunctionType := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5; // Motion Function Type of initial Point in Cam Table. Start Postion is defined by current Positon of Axes.
    MotionFunctionThisPoint  : MC_MotionFunctionType := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5; // Motion Function Type of this Point to be added to Cam-Table
    PointNumber              : UDINT(2..Parameter_Kinematic.MaxCammingPositionsPerTable); // Number of Point to be added to Cam Table, must be strictly increasing without gaps
    TotalPointsInTable       : UDINT(2..Parameter_Kinematic.MaxCammingPositionsPerTable); // Total Number of Points in final Cam Table
    Point                    : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL; // Slave Position at this Point in Cam Table
    PointVelocity            : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL; // Slave Velocity at this Point in Cam Table
    PointAcceleration        : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL; // Slave Acceleration at this Point in Cam Table
    PointJerk                : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL; // Slave Jerk at this Point in Cam Table
END_VAR

Adds one Point to the cam table. Start Point in Table is always defined by the current position of the System. Subsequent added destination Points defined by the input values will be added to the cam table. Before starting to add points it needs to be clear by setting TotalPointsInTable to the final point number.

The cam table will be built when TotalPointsInTable equals PointNumber, when last point was successfully added.

As user the Motion Function of each point can be defined. This can be dangerous as it defines how the system moves! Read TF5050 carefully -> MC_MotionFunctionType

The start point is always defined. With MotionFunctionFirstPoint the motion function of the first point can be influenced.

As default motion function MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5 is recommended. Each point starts and ends with velocity zero.

In case velocity/acceleration/deceleration is desired to be unequal zero, use PointVelocity,PointAcceleration and PointJerk to influence the derivatives of the velocity in this point of the cam table.

CamAddMotionPointByAxis()

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
METHOD CamAddMotionPointByAxis : BOOL
VAR_INPUT
    Axis                     : UDINT(1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX);                   // Axis Number to add point to Cam table
    MotionFunctionFirstPoint : MC_MotionFunctionType := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5; // Motion Function Type of initial Point in Cam Table. Start Postion is defined by current Positon of Axes.
    MotionFunctionThisPoint  : MC_MotionFunctionType := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5; // Motion Function Type of this Point to be added to Cam-Table
    PointNumber              : UDINT(1..Parameter_Kinematic.MaxCammingPositionsPerTable);              // Number of Point to be added to Cam Table, must be strictly increasing without gaps
    TotalPointsInTable       : UDINT(2..Parameter_Kinematic.MaxCammingPositionsPerTable);              // Total Number of Points in final Cam Table
    MasterPosition           : LREAL;                                                                  // Master Position for this Motion Point scaled to 1
    SlavePosition            : LREAL;                                                                  // Slave Position at this Point in Cam Table
    PointVelocity            : LREAL;                                                                  // Slave Velocity at this Point in Cam Table
    PointAcceleration        : LREAL;                                                                  // Slave Acceleration at this Point in Cam Table
    PointJerk                : LREAL;                                                                  // Slave Jerk at this Point in Cam Table
END_VAR

CamAddMotionPointByAxis() differentiates from CamAddPointToPath() that it can create a cam table by Axis.

With Parameter CammingFirstPointInTableByUser equals TRUE the first point in Cam table can be changed from Cam Master starting position to user defined. Therefore use CamAddMotionPointByAxis() to set Point 1 to the desired Master and Slave Position by Axis.

The scaling of the Master is defined by 0.0 to 1.0 (no unit). Within this range for each Axis one cam table can be created with variable Point count PointNumber.

CamAddPointToPath() evenly divides the Master range 0.0 to 1.0 by the number of points TotalPointsInTable(). With CamAddMotionPointByAxis() the user must create the relationship between Master Positions and slave Positions by axis. The TotalPointsInTable is by Axis in CamAddMotionPointByAxis().

CamIn()

METHOD CamIn : BOOL

Cam in Axes system from CamAxisRef to created Cam Tables.

CamStartMovePath()

1
2
3
4
5
6
7
METHOD CamStartMovePath : BOOL
VAR_INPUT
    TargetMoveVelocity      : LREAL := Parameter_Kinematic.CamDefaultMoveVelocity; // Move Velocity for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
    TargetMoveAcceleration  : LREAL := Parameter_Kinematic.CamDefaultMoveAcceleration; // Move Acceleration for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
    TargetMoveDeceleration  : LREAL := Parameter_Kinematic.CamDefaultMoveDeceleration; // Move Deceleration for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
    TargetMoveJerk          : LREAL := Parameter_Kinematic.CamDefaultMoveJerk; // Move Jerk for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
END_VAR

Move created Cam Table with the given motion parameter inputs of this method. The default values of Parameter_Kinematic can be used.

All associated axes via CamAxisRef will try to follow the motion inputs of this method. It will result in a motion fault if they are selected incorrectly. E.g. if acceleration can not be achieved by one or more physical axes.

CamOut ()

METHOD CamOut : BOOL

Cam out Axes CamAxisRef system from Cam Tables.

CamClearPath()

METHOD CamClearPath : BOOL

Clears cam table points set with CamAddPointToPath().

FB_ComponentKinematicMotionCamming

(Extends FB_ComponentKinematicBase implements I_KinematicCamming)

Functions as add-on to Kinematic Module for Joint and Cartesian Coordinated Movements in Robot Systems up to DOF=6. It uses the functions of Camming to create Cam Tables for movement paths and therefore enables coordinated movement for axes systems.

Warning

Selecting Cam Table Motion profile is fully accessible by the user and can lead to dangerous behavior of the Robotic System. Read TF5050 Documentation carefully!

Properties

Property Type Access Description
CammingActive BOOL R Connected Axes System is Cammed in to Cam Table
CamAxisCount UDINT W Sets the amount of axes connected to the FB. Relates directly to the DOF of the Kinematic System
CamAxisRef REFERENCE TO ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF AXIS_REF R/W References the selected Axes of the Kinematic System
Points REFERENCE TO ARRAY[0..Parameter_Kinematic.MaxPoints] OF ST_BasePoint R/W Access to Point Buffer
ChangeOccurred BOOL R/W Change to one or more Points in Buffer has been detected. User can by this indication update the recipe. User needs to reset this variable to detect next change.
CamMasterAcs REFERENCE TO AXIS_REF R References the Cam Master Axis for ACS
CamMasterMcs REFERENCE TO AXIS_REF R References the Cam Master Axis for MCS
CamInOptionsACS ST_CamInOptions R/W Set options for CamIn ACS
CamInOptionsMCS ST_CamInOptions R/W Set options for CamIn MCS
CamTableSlaveDynamicsACS ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF ST_CamTableSlaveDynamics R Slave dynamics read with ReadCamTableSlaveDynamicsACS()
CamTableSlaveDynamicsMCS ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF ST_CamTableSlaveDynamics R Slave dynamics read with ReadCamTableSlaveDynamicsMCS()

Methods

Method Return Type Description
CamClearPath BOOL Returns TRUE Command was accepted, Delete preset Cam Table Points
CamIn BOOL Returns TRUE Command was accepted, Cam In connected axes to cam table
CamOut BOOL Returns TRUE Command was accepted, Cam Out connected axes from cam table
CamStartMovePath BOOL Returns TRUE Command was accepted, Delete preset Cam Table Points
CamAddPointToPath BOOL Returns TRUE Command was accepted, this function will add one Point to the executing Cam Table
CamAddMotionPointByAxis BOOL Returns TRUE Command was accepted, this function will add one Point to the executing Cam Table
Disable BOOL Returns TRUE Command was accepted,
Enable BOOL Returns TRUE Command was accepted,
Reset BOOL Returns TRUE Command was accepted,
SetOverride BOOL Returns TRUE Command was accepted,
Stop BOOL Returns TRUE Command was accepted,
GetPoint ST_BasePoint Get Point Values for selected Point Index
SetPoint BOOL Set Point to Point input Value
ReadCamTableSlaveDynamicsACS BOOL Returns TRUE Reads the cam table slave dynamics at the Master Position and saves it in Property CamTableSlaveDynamicsACS
ReadCamTableSlaveDynamicsMCS BOOL Returns TRUE Reads the cam table slave dynamics at the Master Position and saves it in Property CamTableSlaveDynamicsMCS

Warning

For description of this Methods see FB_KinematicCamming The implementation of those methods distinct between ACS (Joint Mode) and MCS (Cartesian Mode).

Take for example CamIn. If the Kinematic System is in Cartesian Mode, it will CamIn the MCS axes to the cam table. If the Kinematic System is in Joint Mode it will Cam In the ACS axes and execute the movements on the ACS level.

It is important to select the Joint Mode or Cartesian Mode before building the Points and execute the Cam In along with Start Move Path.