Motion Calculate Transform Position with Orientation (MCTPO)

This information applies to the
Compact GuardLogix
5380,
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580, and
GuardLogix
5580 controllers.
Use the Motion Calculate Transform Position with Orientation (MCTPO) instruction to:
  • Compute the Cartesian positions, given the joint positions, when the Transform Direction is configured to Forward.
  • Compute the Joint positions, given the Cartesian positions, when the Transform Direction is configured to Inverse.
  • This is a transitional instruction. Follow these steps when using it:
    • In ladder logic, insert an instruction to toggle the rung-condition-in from false to true each time the instruction should execute.
    • In a Structured Text routine, insert a condition for the instruction to cause it to execute only on a transition.
Architecture and safety support
Architecture
Standard
Safety
CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers
Yes
No
Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers
Yes
No
Available Languages
Ladder Diagram
MCTPO_LD_avail lang_v31
Function Block
This instruction is not available in function block.
Structured Text
MCTPO(CartesianSystem, RobotSystem, MotionControl, WorkFrame, ToolFrame, Direction, ReferencePosition, TransformPosition, RobotConfiguration, TurnsCounter);
Operands
IMPORTANT:
Do not use the same tag name for more than one instruction in the same program. Do not write to any instruction output tag under any circumstances.
IMPORTANT:
If instruction operands are changed while in Run mode, the pending edits must be accepted and the controller mode cycled from Program to Run for the changes to take effect.
Configuration
This table provides the operands used to configure the instruction. These operands cannot be changed at runtime.
Operand
Data Type
Format
Description
Cartesian System
COORDINATE_SYSTEM
Tag
Cartesian coordinate system used to program the moves.
For controllers that support the REF_TO motion data types, the coordinate system operand type can be replaced by the REF_TO_COORDINATE_SYSTEM type.
Robot System
COORDINATE_SYSTEM
Tag
Non-Cartesian coordinate system that controls the actual equipment.
Reference to Non-Cartesian coordinate system that controls the actual equipment.For controllers that support the REF_TO motion data types, the coordinate system operand type can be replaced by the REF_TO_COORDINATE_SYSTEM type.
Motion Control
MOTION_INSTRUCTION
Tag
The control tag for the instruction
Work Frame
POSITION_DATA
Immediate Tag
Work Frame offsets are the offsets used to locate the user Work frame of the Robot relative to the origin of the Robot base frame. These offsets consist of an XYZ and RxRyRz value. This allows the programs to be written in the user work space or world frame and transformed to the Robot base frame.
To rotate the target position around the X, Y, or Z axis or offset the target position along the X, Y, or Z axis of the Robot base coordinate system, enter the degrees of rotation into the Rx, Ry, and Rz tag members in units of degrees of rotation. Enter the offset distances into X, Y, and Z tag members in coordination units. Set the ID member to a value greater than or equal to zero.
To maintain the work frame at the robot base frame, leave structured values at zero, or set the operand tag value to zero.
Tool Frame
POSITION_DATA
Immediate Tag
Tool Center Point (TCP) offsets are the offsets used to locate the tool center relative to the center of the End of Arm. These offsets consist of an XYZ and RxRyRz value.
To have the target position account for an attached tool having translation and/or orientation offsets, enter the tool offset distances into X, Y, and Z tag members in coordination units. Enter the degrees of tool rotation into the Rx, Ry, and Rz tag members in units of degrees of rotation. Set the ID member to a value greater than or equal to zero.
To have the target position reflect only the point at the end-of-arm, leave the structure values at zero, or set the operand tag value to zero.
For further information of configuring coordinate systems refer to the Motion Coordinate System User Manual, publication MOTION-UM002.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. A major fault can occur if an uninitialized reference or a reference of the incorrect type is passed to the Coordinate System operands. See Index Through Arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
Same as Rung-condition-in is false.
Rung-condition-in is false
The .EN, .DN, .ER are cleared to false.
Rung-condition-in is true and .EN bit is false
The .EN bit is set to true and the instruction executes.
Rung-condition-in is true and .EN bit is true
N/A
Postscan
Same as Rung-condition-in is false.
Structured Text
Condition/State
Action Taken
Prescan
See Prescan in the Ladder Diagram table.
Normal execution
See Rung-condition-in is false, followed by Rung-condition-in is true in the Ladder Diagram table.
Postscan
See Postscan in the Ladder Diagram table.
Inputs
Operand
Data Type
Format
Description
Transform Direction
DINT
Tag
To calculate Cartesian position, select Forward(0). To calculate Robot joint positions, select Inverse(1).
Reference Position
REAL[6]
Tag
If the transform direction is forward, enter an array that has joint angles.
If the transform direction is inverse, enter an array that has Cartesian positions.
Robot Configuration
DINT
Tag
Bit 0 of the Robot Configuration is a don't care, and is ignored for TD = Inverse and TD = Forward.
This input operand is valid only for the Inverse Transform Direction.
List of bit values:
Bit0
– Robot Configuration Change(1)/Same(0)
Bit1
– Lefty(1)/Righty(0)
Bit2
– Above(1)/Below(0)
Bit3
– Flip(1)/No flip(0)
Robot Configuration must be zero (0) for Delta robot geometries.
Robot Turns Counters
INT16[4]
Tag
A counter indicating the number of times the 180 degree point is crossed in the +/- direction that the respective axis has turned.
If Transform Direction is Forward, the value is computed by the system and returned via this tag. If Transform Direction is Inverse, this value determines final joint positions.
The following are array index assignment for the joint axes turns count:
Index 0 - J1 axis
Index 1 - J4 axis
Index 3 - J6 axis
Index 4 - Reserved
Outputs
Operand
Data Type
Format
Description
Transform Position
REAL[6]
Tag
Array that stores the calculated position.
If the transform direction is:
  • Inverse then an array has the Joint Angles.
  • Forward then an array has the Cartesian Positions.
    • workframe offset Rx isn’t 0 or
    • workframe offset Ry isn’t 0 or
    • toolframe offset Rx isn’t 0 or
    • toolframe offset Ry isn’t 0
    • workframe offset Rx isn’t 0 or
    • workframe offset Ry isn’t 0 or
    • toolframe offset Rx isn’t 0 or
    • toolframe offset Rz isn’t 0
Robot Turns Counters
INT16[4]
Tag
If Transform Direction is Forward, this value is computed by the system and returned via this tag.
Robot Configuration
DINT
Tag
This output operand is valid only for the Forward Transform Direction.
In Forward Transform, the value is computed by the system and returned through this tag.
For Delta Robot geometries, robot configuration output is always zero.
IMPORTANT:
For 4-Axis Articulated Dependent Robot geometries, if you enter a cartesian position that maps to the Joint value of -179.00 for J2, the MCTPO inverse transform returns the error JOINT_ANGLE_EXCEEDED due to a rounding error in Kinematics Calculations.
For J3 limits, refer to the user documentation supplied by your robot manufacturer.
Fault Codes
An error occurs at runtime if invalid operand values are provided.
Extended Error Codes
Extended Error codes provide additional instruction-specific information for the Error Codes that are generic to other instructions. See Motion Error Codes (ERR) for Motion Instructions. Extended Error Codes meaning depends on the corresponding Error Codes.
Error Code
EX_ERROR Code
Description
13
3
Value Out Of Range (base angle)
Any orientation angle Greater than symbol 360 or Less than symbol -360.
13
3
Value Out Of Range (base ID)
ID equals any negative value.
13
4
Value Out Of Range (tool angle)
Any orientation angle Greater than symbol 360 or Less than symbol -360.
13
4
Value Out Of Range (tool ID)
ID equals any negative value.
13
5
Parameter Out Of Range
Transform Direction.
13
6
Parameter Out Of Range
Reference pos array end Less than symbol 6
13
6
Parameter Out Of Range
Input position Rx, Ry, or Rz exists and value Greater than symbolPlus or Minus sign 180 degrees
13
6
Parameter Out Of Range
Operand 6
If robot geometry is Delta J1J2J6 or Delta J1J2J3J6 and if input position Rx exists and is not equal to 180°.
If robot geometry is Delta J1J2J6 or Delta J1J2J3J6 and if input position Ry is not equal to 0°.
If robot geometry is Delta J1J2J3J4J5 and if input position Rx exists and value is not equal to 0° or 180°.
13
7
Parameter Out Of Range
Transform pos array end Less than symbol 6
13
9
Parameter Out Of Range
Any turns counter provided for the inverse transform exceeds 127 or -127 turns.
61
1
Connection Conflict
Transform Motion Group Error
Cartesian or Robot coordinate system is ungrouped or associated to a different motion group from the other.
61
2
Connection Conflict
Transform Duplicate Systems Error
Operand 0 and Operand 1 are the same coordinate system type
61
3
Connection Conflict
Transform Source Dimension Error
Transform dimension of the Cartesian coordinate system is < 2.
61
4
Connection Conflict
Transform Target Dimension Error
Robot coordinate system Transform Dimension is equal to zero.
61
9
Connection Conflict
Transform Axes Overlap Error
An axis is a member of both the Cartesian and Robot systems.
61
12
Connection Conflict
Transform Invalid Link Length
Link length values for any robot geometry must be Greater than symbol0.0 units.
61
15
Connection Conflict
Transform Invalid Delta Configuration
Link Length1 must not be equal to LinkLength2
End Effector Offset1 Re must not be negative
For Delta J1J2J6 and Delta J1J2J3J6 End Effector Offset3(D3) must not be negative
(Link length 1 + Rb - Re) must be less than link length 2
(Link length 1 + Rb – Re) must be positive or greater than zero
61
18
Connection Conflict
Transform Invalid Articulated Configuration
When the offset value is invalid for Articulated Independent J1J2J3J4J5J6 geometry, this error is generated.
Base offset Yb must be equal to 0.0
End-Effector offset Ye must be equal to 0.0
End-Effector offset Ze must be equal to 0.0
67
1
Invalid Transform Position
MOP Invalid Rx orientation
Invalid Rx orientation value at EOA transformations. For 4 axis geometries (Delta, SCARA, Articulated Dependent) only Rx = 180 deg position is allowed. For all other positions, it will generate error.
67
2
Invalid Transform Position
MOP Invalid Ry orientation
Invalid Ry orientation value at EOA transformations. For 4 axis geometries, after removing work frame and tool frame, there should not be any Ry orientation values at EOA.
67
3
Invalid Transform Position
MOP Invalid Ry orientation
147
3 - 5
Invalid Orientation Scaling Constant
Extended error code 3 : Rx
Extended error code 4 : Ry
Extended error code 5 : Rz
Orientation axis
has scaling constant Greater than symbol MAX_K_CONSTANT_FOR_ORIENTATION_AXIS. or
has scaling constant which is not Integer or
has Conversion ratio between Coordination Units and Position Units other than 1:1.
148
3 -5
MCPM Orientation Offset Not Zero
Rx orientation offset not valid.
Extended error code 3 : Rx orientation offset not valid.
Extended error code 4 : Ry orientation offset not valid.
Extended error code 5 : Rz orientation offset not valid.
If robot Geometry is (MO_CD_J1J2J6 or MO_CD_J1J2J3J6) and:
Or if robot Geometry is MO_CD_J1J2J3J4J5 and:
151
1
Joint Angle J1 Beyond Limits
For details, refer to the geometry specific configuration sections for the joint range limitation.
151
2
Joint Angle J2 Beyond Limits
For details, refer to the geometry specific configuration sections for the joint range limitation.
151
3
Joint Angle J3 Beyond Limits
For details, refer to the geometry specific configuration sections for the joint range limitation.
151
4
Joint Angle J4 Beyond Limits
For details, refer to the geometry specific configuration sections for the joint range limitation.
151
5
Joint Angle J5 Beyond Limits
For details, refer to the geometry specific configuration sections for the joint range limitation.
151
6
Joint Angle J6 Beyond Limits
For details, refer to the geometry specific configuration sections for the joint range limitation.
153
1
Invalid Translation Position
MOP Invalid X Translation
Translation on X axis is Invalid
153
2
Invalid Translation Position
MOP Invalid Y Translation
Translation on Y axis is Invalid
153
3
Invalid Translation Position
MOP Invalid Z Translation
Translation on Z axis is Invalid
156
1
Singularity Condition Error
Joint 1 axis is close to Arm Singularity condition in 6-axis Articulated Independent Geometry
Ext Error 1: Arm Singularity Condition
156
2
Singularity Condition Error
Joint 3 axis is close to Elbow Singularity condition in 6-axis Articulated Independent Geometry
Ext Error 2: Elbow Singularity Condition
156
3
Singularity Condition Error
Joint 5 axis is close to Wrist Singularity condition in 6-axis Articulated Independent Geometry
Ext Error 1: Wrist Singularity Condition
Example
Ladder Diagram
This example illustrates an MCTPO instruction with Transform Direction as Inverse, where the user feeds Cartesian positions and turns counter as input. The instruction computes the corresponding target joint angle positions and is written to the Transform Position parameter as the output.
MCTPO_LD_Example_v31
This example illustrates the MCTPO instruction with Transform Direction as Forward. The target positions are guided into the Reference position operand as input. The instruction computes the corresponding Cartesian positions and turns counter as the output.
MCTPO_ex 2
Structured Text
MCTPO(CS1, CS2, MCTPo1[0], BaseFrame, ToolFrame, Forward, refPos[0], transPos[0], robotConfig[0], TurnsCounter[0]);
TIP:
For further information on creating geometries with orientation support, see the Motion Coordinate System User Manual publication MOTION-UM002.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.