4.15.7 Example of Mirroring and Coordinate Syetem Rotation: G51/G68


  • G51 mirroring example: SAMPL51A.CNC

;Mirror effect on each plane

G92 X0 Y0 Z0

G91

;

G17 G0 X-35.                ;XY plan

G92 X0 Y0 Z0

M97 P1234                   ;origin route

G51 X Y Z I-1000 J1000 K1000

M97 P1234                   ;Mirror image on the X axis

G50

G51 X Y Z I1000 J-1000 K1000

M97 P1234                   ;Mirror image on the Y axis

G50

G51 X Y Z I-1000 J-1000 K1000

M97 P1234                   ;Mirror image of diagonal third quadrant

G50

;

G18 G0 X35.                 ;ZX plan

G92 X0 Y0 Z0

M97 P1234                   ;origin route

G51 X Y Z I-1000 J1000 K1000

M97 P1234                   ;Mirror image on the X axis

G50

G51 X Y Z I1000 J1000 K-1000

M97 P1234                   ;Mirror image on the Z axis

G50

G51 X Y Z I-1000 J1000 K-1000

M97 P1234                   ;Mirror image of diagonal third quadrant

G50

;

G19 G0 X30.                 ;YZ plan

G92 X0 Y0 Z0

M97 P1234                   ;origin route

G51 X Y Z I1000 J1000 K-1000

M97 P1234                   ;Mirror image on the Z axis

G50

G51 X Y Z I1000 J-1000 K1000

M97 P1234                   ;Mirror image on the Y axis

G50

G51 X Y Z I1000 J-1000 K-1000

M97 P1234                   ;Mirror image of diagonal third quadrant

G50

G0 X-30.

G17 G92 X0 Y0 Z0

M30

;

O1234

G0 X5. Y5. Z5.

G1 X10. F500.

Y10.

X-10.

Y-10.

X10. Y10.

X-10. Y-10. Z12.

Z-12.

G0 X-5. Y-5. Z-5.

M99


Example of G51 Mirroring: SAMPL51A.CNC


  • G68 Rotation and G51 Mirroring ExampleTS68-51A.CNC

;Mirroring and rotation on the XY plane

G17 G91

G92 X0 Y0 Z0

M97 P0123                   ;Original first quadrant path

G51 X Y Z I-1000 J1000 K1000

M97 P0123                   ;Mirror image on the X axis

G50

G51 X Y Z I1000 J-1000 K1000

M97 P0123                   ;Mirror image on the Y axis

G50

G51 X Y Z I-1000 J-1000 K1000

M97 P0123                   ;Diagonal third quadrant mirror

G50

M30

;

;First level subprogram(Rotate Copy)

O0123

M97 P1234                   ;original route

G68 X0 Y0 R90.

M97 P1234                   ;Rotate 90° Copy

G69

M99

;

;Second level subprogram(original path map)

O1234

G0 X10. Y5.

G1 X10. Y10. F1500.

X10.

X10. Y-10.

X-10.

X-5. Y5.

X-5. Y-5.

X-10.

G0 X-10. Y-5.

M99


G68 Sample Graphics (A)


When we modify the contents of subprogram O0123,we get another path:

;Level 1 subprogram (rotate copy)

O0123           ;(case 1)

G68 X0 Y0 R45.

M97 P1234       ;spin 45°

G69             ;Copy path

G68 X0 Y0 R-45.

M97 P1234       ;spin -45°

G69             ;Copy path

M99


G68 Sample Graphics (B)


;First level subroutine (original path map)

O0123           ;(case 2)

M97 P1234       ;original route

G68 X0 Y0 R45.

M97 P1234       ;Rotate 45°

G69             ;copy path

G68 X0 Y0 R90.

M97 P1234       ;Rotate 90°

G69             ;copy path

G68 X0 Y0 R135.

M97 P1234       ;Rotate 135°

G69             ;copy path

M99


G68 Sample Graphics (C)