TrjCompute: Trajectory Calculation Function (ACTION_TRF = 26900)
(Original Document)
At a Glance
The TrjCompute function can be used to upload trajectories to the TSX CSY 85 module.
It relies on the following elements for its execution:
NOTE: The parameter table can be created either directly by entering the parameters into the word table, or by importing this table using the graphics-based TjE (Trajectory Editor) software.
The following pages indicate the syntax to be used, followed by a description of all interpolations supported by this function and their codes.
WARNING
UNEXPECTED APPLICATION BEHAVIOR
You must reset the ALLOW_ACQUIRE bit of the group of slave axes before launching the TrjCompute function.
You can then revalidate the group by positioning the ALLOW_ACQUIRE and CONTROL_ACQUIRE bits to 1.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Function Syntax
The TrjCompute function is executed:
TRF_RECIPE %CHr.m.c (table_length, trajectory_table)
Parameter
Description
%CHr.m.c
Channel associated with module channel group consisting of the slave axes and master axis of the trajectory to be calculated.
Table_length
Number of words in the trajectory table. The calculation formula is as follows:
Table_length = 6 + number of axes + number of words per point * number of points:
  • Number of axes: Number of slave axes 2 or 3.
  • Number of words per point: 17 for 2 axes and 19 for 3 axes.
  • Number of points: Number of reference points characterizing the movement.
Trajectory_table
First word in the table containing the parameters of the trajectory, this table contains a header and as many blocks as there are trajectory segments required to complete this movement. This table is described in detail below.
Example: TRF_RECIPE %CH3.21 (93,100); for movement on 2 axes, with 5 characteristic points and one table located in %MW100.
Feedback Code
Feedback codes for the TRF RECIPE function following the trajectory calculation 26900 are available in words %MDWxy.i.4 and %Mfxy.i.6 indicating:
The trajectory calculation time may require several seconds, according to the complexity of the described trajectory. Example: For 35 master points, the calculation time is approximately 3 seconds.
Data returned by action code ACTION_TRF = 26900 (%MWr.m.c.10)
Object
Type
Symbol
Description
%MDr.m.c.4
Integer
RETURN_TRF_1
Number of points in the trajectory
%MFr.m.c.6
Floating point
RETURN_TRF_2
Length of the trajectory
Trajectory Table Header
The table below describes the content of the header of the trajectory table starting at address %MWi:
Memory address
Description
%MWi
Number of points to be interpolated
%MWi+1
Number of slave axes used for the trajectory
%MWi+2
Memory shift for each interpolation point:
  • 17 with 2 slave axes
  • 19 with 3 slave axes
%MWi+3
Interpolation table version (enter the value 0 for now)
%MWi+4
Reserved
%MWi+5
Reserved
%MWi+6
Identifier (ID) of X axis
%MWi+7
Identifier (ID) of Y axis
%MWi+8
Identifier (ID) of Z axis
Note: If the movement only uses two axes, this word does not exist and the table header only comprises 8 words.
NOTE: Do not confuse the number of the channel associated with the axis with the axis ID. You can use the GetAxisID function (code 523) to obtain the ID of an axis (use the WRITE_CMD instruction).
Trajectory Table Body
The table body contains a series of blocks, which characterize each segment of the trajectory. Each block contains an identical number of words, which contain the interpolation parameters for each segment.
The table below describes a typical segment of a trajectory table, where the table header starts at address %MWi:
Memory address
Parameter
Description
%MFj (1)
XCoord
Coordinate based on the X axis of the characteristic point of the segment.
%MFj+2
YCoord
Coordinate based on the Y axis of the characteristic point of the segment.
%MFj+4
ZCoord
Coordinate based on the Z axis of the characteristic point of the segment.
Note: If the movement only uses two axes, this parameter does not exist and the block associated with this segment only contains 17 words instead of 19.
%MFj+6
ParF0
Vset: Setpoint speed of this segment.
%MFj+8
ParF1
Parameter ParF1, determined by the type of interpolation.
%MFj+10
ParF2
Parameter ParF2, determined by the type of interpolation.
%MFj+12
ParF3
Parameter ParF3, determined by the type of interpolation.
%MWj+14
ParW0
Segment interpolation type:
  • 0: Linear
  • 1: Linear with 3º polynomial interpolation connection
  • 2: Linear with link using 5º polynomial interpolation connection
  • 10: Linear with circular interpolation connection
  • 11: Circular via calculation of circle radius
  • 12: Circular via calculation of circle center
  • 100: Only for point P0, to indicate that the movement is along a tangent axis
  • 101: Only for point P0, to indicate that the movement is along a tangent axis but shifted by 180° in relation to code 100 (other side of the curve).
%MWj+15
ParW1
Parameter ParW1, determined by the type of interpolation.
%MWj+16
ParW2
Parameter ParW2, determined by the type of interpolation.
%MWj+17
ParW3
Parameter ParW3, determined by the type of interpolation.
%MWj+18
ParW4
Parameter ParW4, determined by the type of interpolation.
Legend
(1) j = 6 + number of axes, j = 9 if the trajectory is configured on 3 axes, j = 8 if it is configured on 2 axes.
NOTE: Some or all of these different parameters are used depending on the type of interpolation selected for each segment. For a complete trajectory table, the blocks characterizing each segment must be positioned consecutively one after the other.
NOTE: The Characteristic Point of a segment (XCoord, YCoord, ZCoord) is the point reached by the segment. The P0 point is the start point of the trajectory and is required in specific cases, such as for a closed trajectory, in order to be able to calculate the trajectory length.
Error Codes
When this function is used, the error codes common to all types of interpolation, which can be returned in word %MWr.m.c.3, are as follows:
Code
Description
9502
The maximum number of points for a cam has been exceeded.
9503
The maximum number of axes has been exceeded.
9505
The point number configured for one of the cams is not sufficient to execute the function.
9507
Cam not configured.
9510
The maximum number of points for a table has been exceeded.