Set Output UCS

With advanced 5X machines, it is often required to output the G-code in reference to another UCS, not the original home UCS. In some cases, the zero point needs to be shifted - for instance to the current procedure UCS zero point. In other cases, the output UCS orientation must be changed.

The rule is simple - the output UCS must be the same UCS in which the machine controller is expecting coordinates.

GPP2 provides one statement to control the UCS it uses as the output UCS.

  SET_OUTPUT_UCS <position> <orientation>;

The <position> argument may be one of the following predefined GPP constants:

POS_RESET

Sets the output UCS position to (0,0,0) - the default position. The output UCS zero is the same as the REF UCS zero. This is the original machine home position.

POS_REF

Sets the output UCS position to the position of the REF zero point (taking the table rotation into consideration). This is the home position as viewed on the table (or in Cimatron NC).

POS_PROC

Sets the output UCS position to the position of the current procedure UCS. All output coordinates will be referenced to the procedure UCS (as in Cimatron NC TP list).

POS_BY_VARS

Sets the output UCS position to the position stated in the following three variables: X_NONROT_UCS, Y_NONROT_UCS and Z_NONROT_UCS. The variables should be set to the desired position before the command is used.

POS_NO_CHANGE

This constant is in fact identical to POS_BY_VARS, and uses the data in the three variables. It is only provided for better EX2 program clarity.

POS_NO_CHANGE is used when the output UCS position needs to stay unchanged (the command is used to change the orientation only). The three position variables must not be modified and POS_NO_CHANGE used.

Making changes to the output UCS position variables (X_NONROT_UCS, etc.) and using POS_NO_CHANGE will not work as expected. POS_NO_CHANGE is really identical to POS_BY_VARS, so the position will be changed according to the values in the position variables.

The <orientation> argument may be one of the following predefined GPP constants:

ROT_RESET

Sets the output UCS orientation to be parallel to the REF UCS - the default orientation.

ROT_PROC

Sets the output UCS orientation to the current procedure UCS orientation.

ROT_WORKPLANE

Sets the output UCS orientation to the one calculated with the CALC_WORKPLANE_UCS statement.

See section on CALC_WORKPLANE_UCS for more detailed discussion on calculating work planes.

ROT_CURPOS

Sets the output UCS to a UCS that is calculated based on the current (or connection) point orientation. The UCS Z vector is the current point IJK vector, and the UCS X vector is an arbitrary vector perpendicular to it.

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

Must be used in conjunction with the VA_CURPOS option of the CALC_VIRTUAL_ANGLES statement.

ROT_BY_VARS

Sets the output UCS orientation to the one defined by the following six variables: I_NONROT_UCS, J_NONROT_UCS and K_NONROT_UCS define the UCS Z axis direction, and IX_NONROT_UCS, JX_NONROT_UCS and KX_NONROT_UCS define the UCS X axis direction.

The variables should be set to the desired values before the command is used.

ROT_NO_CHANGE

This constant is in fact identical to ROT_BY_VARS, and uses the data in the six variables. It is only provided for better EX2 program clarity.

ROT_NO_CHANGE is used when the output UCS orientation needs to stay unchanged (the command is used to change the position only). The six orientation variables (I_NONROT_UCS, etc.) must not be modified and ROT_NO_CHANGE used.

Example

SET_OUTPUT_UCS  POS_RESET  ROT_RESET;     

// reset output UCS (this is the default setting)

SET_OUTPUT_UCS  POS_PROC  ROT_NO_CHANGE;  

// shift zero point to the current procedure zero - leave orientation as is

SET_OUTPUT_UCS  POS_PROC  ROT_PROC;

// output UCS is now identical to the current procedure UCS

SET_OUTPUT_UCS  POS_NO_CHANGE  ROT_WORKPLANE;

// rotate output UCS according to work plane orientation - leave zero point unchanged

The values of the current GPP output UCS are always shown in the following global system variables:

X_OUTPUT_UCS

Y_OUTPUT_UCS

Z_OUTPUT_UCS

Output UCS zero point (expressed in REF UCS terms)

I_OUTPUT_UCS

J_OUTPUT_UCS

K_OUTPUT_UCS

Output UCS Z axis direction (expressed in REF UCS terms)

IX_OUTPUT_UCS

JX_OUTPUT_UCS

KX_OUTPUT_UCS

Output UCS X axis direction (expressed in REF UCS terms)

Each time the SET_OUTPUT_UCS statement is executed, these nine variables are set to reflect the new output UCS. In some cases, the variables are also used as input to the command (when POS_BY_VARS is used).

In addition to these nine variables, GPP2 also updates another set of nine variables, that describe the same UCS, but ignoring the table rotation. These variables will be needed later to set the machine to match the GPP settings.

X_NONROT_UCS

Y_NONROT_UCS

Z_NONROT_UCS

Output UCS zero point (expressed in REF UCS terms - without any table rotations)

I_NONROT_UCS

J_NONROT_UCS

K_NONROT_UCS

Output UCS Z axis direction (expressed in REF UCS terms - without any table rotations)

IX_NONROT_UCS

JX_NONROT_UCS

KX_NONROT_UCS

Output UCS X axis direction (expressed in REF UCS terms - without any table rotations)

For instance, in order to shift the zero point to the current procedure origin, the machine may need a "DATUM SHIFT" command. This command needs the position vector before any rotations - this data will be available in the X_NONROT_UCS, Y_NONROT_UCS and Z_NONROT_UCS variables.

SET_OUTPUT_UCS Improvement

One of the advanced options of the SET_OUTPUT_UCS command is to set the position and/or the rotation of the output UCS by explicitly setting the UCS by variables. See the POS_BY_VARS and ROT_BY_VARS options.

When using one of these options, the EX2 program needs to set the output UCS variables (X_OUTPUT_UCS to Z_OUTPUT_UCS for position, I_OUTPUT_UCS to K_OUTPUT_UCS and IX_OUTPUT_UCS to KX_OUTPUT_UCS for rotation) before it uses the SET_OUTPUT_UCS command. It was necessary to define these variables taking into account any table rotation that exists at that moment. These variables refer to the output UCS in the machine (REF) coordinate system, and thus include any table rotation and translation.

However, the PP programmer may find it easier to define the non-rotated output UCS - the output UCS as seen on the part itself, ignoring any table rotation. In such a case, GPP2 would apply the table rotation and translation and simplify the process for the PP developer.

In order to take advantage of this method, the EX2 program needs to set the non-rotated output UCS variables before invoking the SET_OUTPUT_UCS command:

X_NONROT_UCS, Y_NONROT_UCS and Z_NONROT_UCS define the UCS zero position

I_NONROT_UCS, J_NONROT_UCS and K_NONROT_UCS define the UCS Z axis orientation

IX_NONROT_UCS, JX_NONROT_UCS and KX_NONROT_UCS define the UCS X axis orientation

When using the POS_BY_VARS option, the 3 position variables should be set.

When using the ROT_BY_VARS option, the 6 orientation variables should be set.

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