Mirroring (G21/G22/G23/G20)

Mirroring (G21/G22/G23/G20)

For mirroring, the definition "mental coordinates" is introduced. Before or in case of de-selected mirroring functions, programmed and mental coordinates are identical. If a mirroring is active, the mental coordinates are the values inputted by the programmer. The programmed coordinates are mirrored, i.e. are in fact traversed.

The following mirroring functions are available (e.g. X-Y plane):

G21 Mirroring of programmed path on the Y-axis (modal)
x m = - x p
ym = yp
G22 Mirroring of programmed path on the X-axis (modal)
xm = xp
ym = - yp
G23 Superimposing of G21 and G22 (modal)
xm= - xp
ym = - yp
G20 Deselection of mirroring (modal)
Mirroring (G21/G22/G23/G20) 1:
Fig. 4.21: Mental and programmed coordinates associated with G21

xm, ym : Mental coordinates

xp, yp : Programmed coordinates

xa, ya : Absolute coordinates

Contours to be mirrored are to be specified in a sub routine. This sub routine is called after the mirroring function. The mirroring is modal.

Mirroring (G21/G22/G23/G20) 2:

If the mirroring is programmed during selected tool radius compensation, the side of the compensation does alter. That means, under active G41, the equidistant to programmed path after mirroring will be calculated to the right of the contour (G42: TRC right of the contour). This happens even if the traverse direction itself has possibly changed.

Programming example

%L DREIECK (Subroutine: )
N10 G90 X10 Y20 (Determination of the (mental)coordinates)
N20 G91 X10 Y-10 (to be mirrored )
N30 X-10 Y-10
N40 Y20
N50 M29
%SPIEGELUNG (Main program: )
N10 G92 G90 X60 Y40 (Coordinate preset )
N20 G01 F500 (Linear interpolation with feed 500)
N30 G21 (Mirroring on the Y-axis )
N40 LL DREIECK (Deselection of mirroring )
N60 G92 X0 Y0 (Withdrawal of coordinate preset)
N70 M30
Mirroring (G21/G22/G23/G20) 3:
Fig. 4.22: Example for mirroring

CAUTION

mirroring circles

Generally, only programmed coordinates will be mirrored (so in case of a full circle just the center-point coordinates). After the selection of mirroring the mirrored ending point will directly be traversed. The starting point of the traversing movement will not be mirrored.
In the traversing block only the ending point but not the complete traversing movement will be mirrored ().
If the traversing block is a full circle and the starting/ending points are not on 0/0, the mirroring of the center-point coordinates results to a new circle radius and a changed contour ()!

Mirroring (G21/G22/G23/G20) 4:
Fig. 4.23: Mirroring of the ending point in the traversing block.
Mirroring (G21/G22/G23/G20) 5:
Fig. 4.24: Changing the contour when mirroring a full circle.

3-D considerations:

If the mirroring functions are chosen in a plane other than the XY-plane (G18, G19) then, it should be noted, that under circular interpolation the direction of rotation possibly changes, depending upon the selected plane: Further, the mirroring has no influence on the Z-coordinate, i.e. mental and programmed values in Z-direction are always identical.

Mirroring (G21/G22/G23/G20) 6:
Fig. 4.25: Effects of mirroring functions upon direction of the circular rotation at different planes