User's Manual

PMAC User Manual
196 Writing Programs for PMAC
Absolute Displacement
The ADIS{constant} (absolute displacement) command sets up the displacement portion of the
selected matrix by making the three displacement values (D1, D2, & D3) equal to the three Q-variables
starting with the one specified with {constant}. For instance, ADIS 25 would make the X-
displacement equal to Q25, the Y-displacement equal to Q26, and the Z-displacement equal to Q27.
Incremental Displacement
The IDIS{constant} (incremental displacement) command changes the displacement portion of the
selected matrix by adding the values of the three Q-variables to the existing displacement.
Absolute Rotation/Scaling
The AROT{constant} (absolute rotation) command sets up the rotation/scaling portion of the selected
matrix by making the nine rotation/scaling values equal to the nine Q-variables starting with the one
specified by {constant}. For instance, AROT 71 would make R11 in the matrix equal to Q71, R12
equal to Q72, and so on, to R33 equal to Q79.
Incremental Rotation/Scaling
The IROT{constant} (incremental rotation) command changes the rotation/scaling portion of the
selected matrix by multiplying it by a matrix consisting of the nine Q-variables starting with the one
specified by {constant}. This has the effect of adding angles of rotation, and multiplying scale
factors. For instance, IROT 100 would multiply the existing matrix by multiplying it by a matrix
consisting of the values of Q100 to Q108.
After using any of these commands, any changes to the Q-variables used do not change the selected
matrix. Another command using the Q-variables must be executed to change the selected matrix.
When using axis matrix transformation for scaling, do not use the R radius specification for circular
interpolation, because the radius will not scale with the axes. Use the IJK center vector specification
instead.
Calculation Implications
It takes one to two milliseconds to perform the matrix transformation for every move involving the X, Y,
or Z axis. This will decrease the maximum block execution rate for the motion program. A two-axis
system that was capable of 400 blocks per second without matrix transformation will be capable of only
about 250 blocks per second once matrix transformation has been activated with the TSEL command. To
disable the matrix transformation calculations, use TSELECT0, which deselects all matrices, and stops
the matrix calculation overhead.
Examples
These concepts are probably best illustrated with some simple examples. In actual use, much more
sophisticated things may be done with the matrices, especially with the inclusion of math and logic.
Scaling Example
If the axis definition statements scaled the axes in units of millimeters, but it should be programmed in
inches at least temporarily, set up the matrix as follows:
TSEL 1 ; Select Matrix 1
Q11=25.4 Q12=0 Q13=0 ; Variables for first row
Q14=0 Q15=25.4 Q16=0 ; Variables for second row
Q17=0 Q18=0 Q19=25.4 ; Variables for third row
AROT 11 ; Use Q11-Q19 for matrix
Notice that pure scaling uses only the primary diagonal of the matrix. The scaling is done with respect to
the origin of the coordinate system. Of course, the Q-variable values do not have to be assigned three per
command line, but this is for program readability.