MC_MoveCircularAbsolutePreparation

MC_MoveCircularAbsolutePreparation 1:

TF5410
TwinCAT 3 Motion Collision Avoidance

TF5420
TwinCAT 3 Motion Pick-and-Place

 

MC Group with Pick-and-Place

MC Group Coordinated Motion

MC_MoveCircularAbsolutePreparation 2:

MC_MoveCircularAbsolutePreparation 3:

MC_MoveCircularAbsolutePreparation 4:

The function block adds an absolute circular motion to the table of segments in the PathData structure. After creating a table, it can be executed via MC_MovePath. The function block MC_MoveCircularAbsolutePreparation can be called several times per cycle. A maximum of 30 entries are allowed per PathData table.

MC_MoveCircularAbsolutePreparation 5:

Resetting a table

A table is not reset during execution. To reset, the method ClearPath() must be called from MC_PATH_DATA_REF.

MC_MoveCircularAbsolutePreparation 6: VAR_INPUT

VAR_INPUT
    CircMode                 : MC_CIRC_MODE := mcCircModeInvalid;
    AuxPoint                 : POINTER TO MC_LREAL;
    AuxPointCount            : UDINT;
    EndPoint                 : POINTER TO MC_LREAL;
    EndPointCount            : UDINT;
    PathChoice               : MC_CIRC_PATHCHOICE := mcCircPathchoiceCounterClockwise;
    Velocity                 : MC_LREAL := MC_INVALID;
    Acceleration             : MC_LREAL := MC_DEFAULT;
    Deceleration             : MC_LREAL := MC_DEFAULT;
    Jerk                     : MC_LREAL := MC_DEFAULT;
    BufferMode               : MC_BUFFER_MODE := mcAborting;
    TransitionMode           : MC_TRANSITION_MODE := mcTransModeNone;
    TransitionParameter      : POINTER TO MC_LREAL;
    TransitionParameterCount : UDINT;
    InvokeId                 : UDINT;
    DynamicConstraints       : REFERENCE TO IPlcDynamicConstraint := 0;
END_VAR

Name

Type

Description

CircMode

MC_CIRC_MODE

Specifies which circle definition is used to program the circle. Specifies the meaning of the "AuxPoint" input signal (see MC_CIRC_MODE).

AuxPoint

POINTER TO MC_LREAL

Pointer to an array [1..AuxPointCount] of the AuxPoint vector. The interpretation of the AuxPoint vector depends on the rotation convention (see MC Group Coordinated Motion or MC Group with Pick-and-Place) and is always (x, y, z).

AuxPointCount

UDINT

Dimension of the AuxPoint vector. Must be 3. If a 2D rotation convention (see MC Group Coordinated Motion or MC Group with Pick-and-Place) is used, the input value must also be 3. With a 2D rotation convention and CircMode of mcCircModeBorder or mcCircModeCenter, the component that is independent of the working plane must be set to MC_Ignore (see MC_LREAL/Special Input Values).

EndPoint

POINTER TO MC_LREAL

Pointer to an array [1..EndPointCount] of the target position vector.

EndPointCount

UDINT

Dimension of the EndPoint vector. Must match the number of axes in the axis convention (see MC Group Coordinated Motion or MC Group with Pick-and-Place).

PathChoice

MC_CIRC_PATHCHOICE

Defines the direction of rotation with respect to the normal vector. The input is ignored if the input CircMode is set to mcCircModeBorder (see MC_CIRC_PATHCHOICE).

Velocity

MC_LREAL

The maximum velocity for the programmed segment. The velocity does not always have to be reached. The velocity must be set >0.

Acceleration

MC_LREAL

Maximum path acceleration for the programmed segment. Special input values can be used. MC_DEFAULT executes the command with default axis values. MC_MAXIMUM executes the command with the maximum axis values. The acceleration must be set ≥1.

Deceleration

MC_LREAL

Maximum path deceleration for the programmed segment. Special input values can be used. MC_DEFAULT executes the command with default axis values. MC_MAXIMUM executes the command with the maximum axis values. The deceleration must be set ≥1.

Jerk

MC_LREAL

Path jerk for the programmed segment. Special input values can be used. MC_DEFAULT executes the command with default axis values. The jerk must be set ≥100.

From TF5400 V3.2.27:
MC_MAXIMUM is supported for MC Group Coordinated Motion. Here MC_MAXIMUM = 100 * MC_DEFAULT.

BufferMode

MC_BUFFER_MODE

Defines how successive motion commands are to be processed (see MC_BUFFER_MODE).

Transition mode

MC_TRANSITION_MODE

Defines the blending mode (see MC_TRANSITION_MODE).

TransitionParameter

POINTER TO MC_LREAL

Pointer to array [1..TransitionParameterCount] of blending parameters. Transition parameters define the blending from the last programmed position (see MC_TRANSITION_MODE).

TransitionParameterCount

UDINT

Number of blending parameters.

InvokeId

UDINT

Segment ID for analysis purposes.

DynamicContraints

REFERENCE TO IPlcDynamicConstraint

From TF5400 V3.2.27, MC Group Coordinated Motion:
Optional input to further limit the allowed values for velocity, acceleration, deceleration or jerk during motion.

MC_MoveCircularAbsolutePreparation 7: MC_MoveCircularAbsolutePreparation 8: VAR_IN_OUT

VAR_IN_OUT
    PathData                 : MC_PATH_DATA_REF;
END_VAR

Name

Type

Description

PathData

MC_PATH_DATA_REF

Table containing the segments of a path. The table is written by MC_Move…Preparation and executed by MC_MovePath (see MC_PATH_DATA_REF).

MC_MoveCircularAbsolutePreparation 9: VAR_OUTPUT

VAR_OUTPUT
    Error                    : BOOL;
    ErrorId                  : UDINT;
END_VAR

Name

Type

Description

Error

BOOL

This output becomes TRUE if an error has occurred during command execution.

ErrorId

UDINT

Contains the command-specific error code of the last executed command. Details of the error code can be found in the ADS error documentation or in the NC error documentation (error codes 0x4nnn and 0x8nnn).

Sample of center point programming

Assuming a path consisting of 4 segments as shown in the figure is to be programmed in mcCircModeCenter mode: the user defines the center of the circle as an auxiliary point ("AuxPoint"). When using mcCircModeCenter, the input MC_CIRC_PATHCHOICE determines the direction of rotation. Since the plane is defined by the cross product, mcCircPathchoiceCounterClockwise must be selected for both circle segments N20 and N30.

MC_MoveCircularAbsolutePreparation 10:
VAR
    Buffer                                  : ARRAY[1..4096] OF BYTE;
    Path                                    : MC_PATH_DATA_REF (ADR(buffer), SIZEOF(buffer));
    fbMoveLinPrep                           : MC_MoveLinearAbsolutePreparation;
    fbMoveCircPrep                          : MC_MoveCircularAbsolutePreparation;

    aTargetPos                              : ARRAY[1..cAxesCount] OF MC_LREAL;
    aCircPos                                : ARRAY[1..cAxesCount] OF MC_LREAL;
    aAuxPoint                               : ARRAY[1..3] OF MC_LREAL;
    aTransitionParam                        : ARRAY[1..2] OF MC_LREAL;
END_VAR
VAR CONSTANT
    cAxesCount                              : UINT:=3;
END_VAR
    fbMoveLinPrep.Position                  := ADR(aTargetPos);
    fbMoveLinPrep.PositionCount             := cAxesCount;
    fbMoveLinPrep.TransitionParameter       := ADR(aTransitionParam);
    fbMoveLinPrep.TransitionParameterCount  := 2;
    fbMoveLinPrep.BufferMode                := mcBuffered;
    fbMoveLinPrep.TransitionMode            := mcTransModeNone;

    fbMoveCircPrep.EndPoint                 := ADR(aTargetPos);
    fbMoveCircPrep.EndPointCount            := cAxesCount;
    fbMoveCircPrep.AuxPoint                 := ADR(aAuxPoint);
    fbMoveCircPrep.AuxPointCount            := 3;
    fbMoveCircPrep.CircMode                 := mcCircModeCenter;
    fbMoveCircPrep.TransitionParameter      := ADR(aTransitionParam);
    fbMoveCircPrep.TransitionParameterCount := 2;
    fbMoveCircPrep.BufferMode               := mcBuffered;
    fbMoveCircPrep.TransitionMode           := mcTransModeNone;

    aTargetPos[1]                           := 200;
    aTargetPos[2]                           := 0;
    aTargetPos[3]                           := 0;
    aTransitionParam[1]                     := 0;
    aTransitionParam[2]                     := 0;
    fbMoveLinPrep(PathData:= path, Velocity:= 3000, InvokeId:= 10);

    aTargetPos[1]                           := 300;
    aTargetPos[2]                           := -100;
    aTargetPos[3]                           := 0;
    aAuxPoint[1]                            := 200;
    aAuxPoint[2]                            := -100;
    aAuxPoint[3]                            := 0;
    aTransitionParam[1]                     := 0;
    aTransitionParam[2]                     := 0;
    fbMoveCircPrep(PathData:= path, PathChoice:= mcCircPathchoiceCounterClockwise, Velocity:= 1000, InvokeId:= 20);

    aTargetPos[1]                           := 400;
    aTargetPos[2]                           := -200;
    aTargetPos[3]                           := 0;
    aAuxPoint[1]                            := 400;
    aAuxPoint[2]                            := -100;
    aAuxPoint[3]                            := 0;
    aTransitionParam[1]                     := 0;
    aTransitionParam[2]                     := 0;
    fbMoveCircPrep(PathData:= path, PathChoice:= mcCircPathchoiceCounterClockwise, Velocity:= 1000, InvokeId:= 30);

    aTargetPos[1]                           := 600;
    aTargetPos[2]                           := -200;
    aTargetPos[3]                           := 100;
    aTransitionParam[1]                     := 0;
    aTransitionParam[2]                     := 0;
    fbMoveLinPrep(PathData:= path, Velocity:= 3000, InvokeId:= 40);

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT V3.1.4018.26

TF5400 Advanced Motion Pack V3.1.2.47

PC or CX (x86 or x64)

Tc3_McCoordinatedMotion, Tc2_MC2