Virtual Axes Rotation Angles

In some machines, it is possible to define work planes by using rotation angles around virtual axes (X, Y and Z) - regardless of the machine axes geometry. Three virtual rotation angles define a unique rotation matrix, accurately defining the orientation of all three axes.

There are two methods for virtual axis rotations: Euler angles and Spatial angles.

  • Euler angles define rotations around three axes (For example, around Z, then around Y, then around X), where the second and third rotations are done around the new direction of the virtual axis. For instance, if the first rotation around the Z axis was 20 degrees, then the second rotation (around Y) will be done around a new Y direction (rotated in 20 degrees).

  • Spatial angles also define rotations around three axes (For example, around X, then around Y, then around Z), but the rotations are always done around the original axes directions. For instance, if the first rotation is 20 degrees around X, then the second rotation will still be around the original Y direction (not the rotated Y).

Note: there is an interesting mathematical correlation between Euler and Spatial angles - the same angles are used to obtain the required rotation, but in the reverse order. For instance, Euler rotations in the order Z à Y à X give the same rotation matrix as Spatial rotations in the order X à Y à Z using exactly the same rotations around the three axes.

GPP2 provides a statement to calculate virtual axes rotation angles, which can be used on the machine.

  CALC_VIRTUAL_ANGLES <ucs>

The <ucs> argument specifies which UCS should be used for the virtual axes calculation. One of the following predefined constants may be used for the <ucs> argument:

VA_PROC

Current procedure UCS.

VA_CURPOS

A UCS that is defined by the current point orientation. The UCS Z vector is the current point IJK vector, and the UCS X vector is an arbitrary vector perpendicular to it.

Mostly used in 5X drill, where virtual angles must be used to define the work plane for each cycle, based on the hole IJK orientation.

Also valid inside a connection scenario, using the connection IJK.

Must be used in conjunction with the ROT_CURPOS constant in the SET_OUTPUT_UCS statement.

VA_BY_VARS

Use the non-rotated output UCS, as calculated in the SET_OUTPUT_UCS statement.

This UCS is stored in the following variables:

Z axis: I_NONROT_UCS, J_NONROT_UCS and K_NONROT_UCS.

X axis: IX_NONROT_UCS, JX_NONROT_UCS and KX_NONROT_UCS.

The type and order of rotations is defined in the variable VIRTUAL_AXES, which must be set using one of the following predefined GPP constants:

VIRTUAL_AXES_NONE

Virtual angles are not used

EULER_ZYX

Euler angles, order of rotations Z à Y à X

EULER_ZXY

Euler angles, order of rotations Z à X à Y

EULER_XYZ

Euler angles, order of rotations X à Y à Z

EULER_YXZ

Euler angles, order of rotations Y à X à Z

EULER_ZXZ

Euler angles, order of rotations Z à X à Z

EULER_ZYZ

Euler angles, order of rotations Z à Y à Z

SPATIAL_ZYX

Spatial angles, order of rotations Z à Y à X

SPATIAL_ZXY

Spatial angles, order of rotations Z à X à Y

SPATIAL_XYZ

Spatial angles, order of rotations X à Y à Z

SPATIAL_YXZ

Spatial angles, order of rotations Y à X à Z

SPATIAL_ZXZ

Spatial angles, order of rotations Z à X à Z

SPATIAL_ZYZ

Spatial angles, order of rotations Z à Y à Z

The VIRTUAL_AXES variables must be set before the CALC_VIRTUAL_ANGLES statement is used. Typically, it will be set in the STARTUP block, as part of the machine definition process.

Most known machines use Spatial angles with order X à Y à Z or Euler angles with order Z à Y à X.

The results from the CALC_VIRTUAL_ANGLES statement are as follows:

VIRTUAL_ANGLE_1

VIRTUAL_ANGLE_2

VIRTUAL_ANGLE_3

The three virtual axes rotation angles, in degrees.

Example

VIRTUAL_AXES = SPATIAL_XYZ;

...

SET_OUTPUT_UCS POS_PROC ROT_PROC;  // current procedure UCS

CALC_VIRTUAL_ANGLES VA_PROC;       // calculate angles for it

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