ROT_MAT and ORIGIN CHANGE - Rotation Angle

The rotation angle in 4-axis machines is calculated as follows:

Rotation angle = ATAN (*_ORIGIN / Z_ORIGIN)

where * is I or J.

To obtain the appropriate result, it is recommended to:

  • use FORTRAN ATAN2 function (in external process) and not the ATAN function in the EXF file.

  • define I,J,K_ORIGIN with a precision of 7 decimal places.

The external program may be written as follows:

SUBROUTINE UGPSUB    (NAME, L)

CHARACTER*6         NAME

INTEGER      L

IF (NAME(1:L) .EQ. 'ATANG2') THEN

  CALL ATANG2

ELSEIF . . . .

.

.

.

ENDIF

RETURN

END

C------------------------------------------------

SUBROUTINE ATANG2

C

C H-horizontal value

C V-vertical value

C A-angle result

REAL    H,V,A

C

CALL GTEPGP    ('H',H)

CALL GTEPGP    ('V',V)

C

A = ATAN2 (V,H)

C

C Convert the angle from radians to degrees

C

A = A*180.0/3.1415926

C

C The conversion may vary between machines, according to the machine type.

C (Some machines may use angles 0-360 or +/-180 . . .)

C

CALL STEPGP('A',A)

RETURN

END

C------------------------------------------------

 

External programs like the one displayed above may be called from the EXF file by using the CALL command:

V = I_ORIGIN; H = K_ORIGIN;

CALL "ATANG2" INPAR H V ; OUTPAR A;

YROTATION = A;

Rotation angles in 5-axis machines (rotated table) may be calculated as follows:

1st rotation angle = ATAN ( *_ORIGIN / *_ORIGIN )

2nd rotation angle = ATAN ( *_ORIGIN / (*_ORIGIN * COS [1st rotation angle]))

where * is I, J, or K according to the machine geometry, and ATAN is used as described for 4-axis machines.

The rotation of the first axis affects the *_ORIGIN of the two other axes. This rotation and the first axis to be rotated vary between the machine types.

ROT_MAT1 . . . ROT_MAT9

As explained in this manual, ROT_MAT1. . .ROT_MAT9 are values of MATRIX (3,3). All coordinates are multiplied by that matrix before "sending" to the post.

The UNIT matrix may be initialized at BEGINNING OF TAPE:

ROT_MAT1=1;

ROT_MAT2=0;

ROT_MAT3=0;

ROT_MAT4=0;

ROT_MAT5=1;

ROT_MAT6=0;

ROT_MAT7=0;

ROT_MAT8=0;

ROT_MAT9=1;

TRANS_MATX=0;

TRANS_MATY=0;

TRANS_MATZ=0;

After finding the rotation angle (A), ROT_MAT* values should be updated as follows:

Rotation around X axis:

ROT_MAT1=1;

ROT_MAT2=0;

ROT_MAT3=0;

ROT_MAT4=0;

ROT_MAT5=COS(A);

ROT_MAT6=-SIN(A);

ROT_MAT7=0;

ROT_MAT8=SIN(A);

ROT_MAT9=COS(A);

Rotation around Y axis:

ROT_MAT1=COS(A);

ROT_MAT2=0;

ROT_MAT3=-SIN(A);

ROT_MAT4=0;

ROT_MAT5=1;

ROT_MAT6=0;

ROT_MAT7=SIN(A);

ROT_MAT8=0;

ROT_MAT9=COS(A);

Rotation around Z axis:

ROT_MAT1=COS(A);

ROT_MAT2=SIN(A);

ROT_MAT3=0;

ROT_MAT4=-SIN(A);

ROT_MAT5=COS(A);

ROT_MAT6=0;

ROT_MAT7=0;

ROT_MAT8=0;

ROT_MAT9=1;

Translation Values - TRANS_MAT

The rotation causes the tool end point to move from its original location. Therefore, a translation must be performed to cancel this error.

The translation values are calculated as follows:

  1. Find the physical distance (X, Y and Z) between the origin and the rotation axis, as it will be on the machine.

  2. Rotate those values using the rotation matrix (ROT_MAT1 . . ROT_MAT9).

If the part rotates (rotating table), the physical distance between the origin and rotation axis may be calculated using the following parameters:

  • distance between a fixed point on the machine table and the rotation axis (a fixed value depending on the machine geometry)

  • distance between the MACSYS (MODEL) and the fixed point. Use the POST interaction ENTER MACH.ZERO, and the GPP parameters X_MACH, Y_MACH and Z_MACH.

  • distance between the MACSYS (MODEL) and the origin, GPP parameters X_ORIGIN, Y_ORIGIN and Z_ORIGIN.

If the tool rotates (rotating head), the physical distance between the origin and the rotation axis may be calculated using the following parameters:

  • distance between the face of the spindle and the rotation axis (a fixed value depending on the machine geometry).

  • distance between the tool end point and the face of the spindle.

Use the parameter GAUGE LENGTH in the tool definition and the GPP parameter GAUGE_LEN. As the GAUGE_LEN parameter changes with the tool change, the translation parameters TRANS_MATX . . . TRANS_MATZ must be updated every tool change.

Translation Values - ORIGIN CHANGE (Translation Only)

When TRANS_MAT values are 0, the coordinates are expressed in the current origin coordinate system. To express the coordinates in another origin coordinate system (i.e., the first one), update TRANS_MAT values as follows:

  1. Save the X,Y,Z_ORIGIN of the first origin (i.e., first X,Y,Z).

  2. Calculate the TRANS_MAT values:

TRANS_MATX = X_ORIGIN - FIRSTX

TRANS_MATY = Y_ORIGIN - FIRSTY

TRANS_MATZ = Z_ORIGIN - FIRSTZ

Some functionality may be dependent on the product package. Contact your Reseller if you require a license.