G50, G51 - Scaling / Mirroring (Optional):
G51 scales program G-codes relative to a
scaling center point defined as position (X, Y, and Z).
G50 – Cancels the scaling factor applied
A G51
applies scaling/mirror to all positions, lines, and arcs following this G-code
until a G50 are entered. Specify scaling factors with a value I, J, K. The X,
Y, and Z parameters are the coordinates of the scaling center. If the scaling
center is not specified, the default scaling center is the current cutter
position. To mirror, enter a negative value for the scaling factor.
Example, Scaling:
G51 X0.0 Y0.0 Z0.0 I3.0 J2 K1; turn scaling
on
G00 X0.0 Y0.0 Z1.0; rapid to x0, y0, Z1
G01 X1.0 Y0.0 Z1.0; line to X1, Y0, Z1
G01 X1.0 Y1.0 Z1.0; line to X1, Y1, Z1
G01 X0.0 Y1.0 Z1.0; line to X0, Y1, Z1
G01 X0.0 Y0.0 Z1.0; line to X0, Y0, Z1
G01 X0.0 Y0.0 Z0.0; line to X0, Y0, Z0
G50; cancel scale
For this G51, the following program lines
were scaled 3:1 in the X direction, 2:1 in the Y direction, and
1:1 in the Z direction. If no scale factor is
specified, the default is 1:1 for all axes.
Example, Mirroring:
G51 X-0.5 Y0.0 Z.0 I-1 J1 K1; turn mirror on.
G00 X0.0 Y0.0 Z1.0; rapid traverse to X0, Y0,
Z1
G01 X1.0 Y0.5 Z1.0; line to X1, Y.5, Z1
G01 X0.0 Y1.0 Z1.0; line to X0, Y1, Z1
G01 X0.0 Y0.0 Z1.0; line to X0, Y0, Z1
G50; cancel scale
If scaling factors are the same for all the
axes, parameter P can be used.
Example:
G51 X1.0 Y2.0 Z0.0 P2.5; scale all axes a
factor of 2.5. If an arc is scaled with uneven scaling factors, the result will
depend on how the arc center and radius were specified: