Modification of the Effective Transformation T and its Effect

Most G-Codes define only the destination point of a movement. Therefore, the interpreter maintains the current position of the tool. This point can be represented in MCS (machine coordinate system) coordinates and PCS (program coordinate system) coordinates while the equation CurrentPointMCS = T * CurrentPointPCS holds. In contrast to the previous implementation, this transformation equation also holds after a modification of T. This behavior is accomplished by adapting the CurrentPointPCS. The MCS (machine coordinate system) point is not adapted, as this would affect the machine. This behavior may be summarized roughly as: When the active transformation is changed, the current PCS (program coordinate system) point is adapted in a way that the modification shows no effect.

Example:

After N10 the coordinates of the current PCS (program coordinate system) and MCS (machine coordinate system) point are [20,10,80], since no transformation is active. The translation changes the current PCS (program coordinate system) point to [28,7,84]. Applying the translation on this point yields the unchanged MCS (machine coordinate system) point [20,10,80]. Hence, the translation shows no effect, although it is active. The block N20 programs a movement to the PCS (program coordinate system) point [25,7,10], which is mapped to the MCS (machine coordinate system) coordinate [17,10,6]. After the invocation of transPop() the current PCS (program coordinate system) point is set to the current MCS (machine coordinate system) point.

N10 G01 X20 Y10 Z80 F6000
!transTranslate(-8,3,-4);
N20 G01 X25 Z10
!transPop();
M02

Example:

If the user wants the PCS (program coordinate system) point to remain unchanged, he has to retrieve and program it, as shown in the following code. However, the desire for an unchanged PCS (program coordinate system) point typically indicates a bad programming style. Actually, there should be no need for the following code.

{
VAR
    pcsX, pcsY, pcsZ : LREAL;
END_VAR

// … G-Code …

frameGet(x=>pcsX,y=>pcsY,z=>pcsZ);
// … modify transformations …
!G01 x=pcsX y=pcsY z=pcsZ F6000
}