Using 6 (or More) Axes Machines

With the machine simulator, it is possible to define and control 6 (or more) axes machines. When writing a post-processor for such a machine, it is very important to be able to view the motions on the machine simulator.

GPP2 supports up to 9 additional axes on the machine simulator. They can be used in addition to the basic 5 axes (X, Y, Z, Alpha and Beta). These axes may be linear or rotary.

In order to use such an extra axis, the following steps should be taken:

  • The axis letter is defined, using the GPP2 variables, MACH_SIM_LETTER1 to MACH_SIM_LETTER9.

  • The EX2 program must provide the values to the additional axis, through the GPP2 variables MACH_SIM_AXIS1 to MACH_SIM_AXIS9. Typically, these values only change during machine re-configuration.

  • The additional axes must be be specified in the simulator data order variable (so GPP2 will know to output them in the simulator motion file). The digits 1 to 9 represent the additional nine axes.

For instance, setting the MACH_SIM_ORDER variable to "XYZAB1" tells GPP2 to output the additional axis 1, under the letter specified in MACH_SIM_LETTER1 and with values provided in MACH_SIM_AXIS1.

In some cases, the additional axes may be used to actually substitute some of the regular machine axes. For instance, some machines have two Z axes, one extending to a given limit and the other one that can reach further. In such a case, the data provided by GPP2 in Z_CURPOS may be broken to two other simulator axes (given any appropriate logic).

  MACH_SIM_ORDER = "XY12"; // assume no rotary axes

  MACH_SIM_LETTER1 = "Z";  // you can use the letter Z for the new axis!

  MACH_SIM_LETTER2 = "W";  // this is the secondary Z axis

In each linear motion block, the value of Z_CURPOS will be broken in two, and the two variables, MACH_SIM_AXIS1 and MACH_SIM_AXIS2 will be assigned the proper values. The data will be output to the simulator as a 4-axis linear machine.

The following lines demonstrate such EX2 code, assuming that the major Z axis can reach no more than 500, and the minor Z axis is used above 500. The lines also demonstrate how to output the G-code numbers.

Regarding the machine simulator output, there is no need to do anything special with the MACH_SIM_AXIS1/2 variables. It is enough to set their values.

IF_SET (Z_CURPOS)               // Z has changed

  IF (Z_CURPOS <= 500)          // test value against threshold

    MACH_SIM_AXIS1 = Z_CURPOS;  // major can handle point

    MACH_SIM_AXIS2 = 0;         // minor not used

  ELSE                          // Z is above 500

    MACH_SIM_AXIS1 = 500;       // major reaches 500

    MACH_SIM_AXIS2 = Z_CURPOS - 500; // minor does the rest

  END_IF;

  OUTPUT " "MACH_SIM_LETTER1 MACH_SIM_AXIS1; // create G-code

  OUTPUT " "MACH_SIM_LETTER1 MACH_SIM_AXIS1;

  SET_OFF Z_CURPOS;             // set off, for next block!

END_IF;

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