Search This Blog

Sunday, November 23, 2014

G17-G18-G19 Plane selection

G-Code G17, G18, and G19 plane selection.

Plane selection:
In a CNC programming there are 3 G-codes for plane selection during the NC programming that are used to define the two axes of either X, Y or Z. The plane selection is modal and stays in effect for all until you command another circular plane.

The 3 Plane selection G-Codes are:


G17 for XY Plane
G18 for XZ Plane
G19 for YZ Plane
When machine is powered on, the default for plane selection is G17 for the XY plane. This means that the XY plane is already selected without programming in a G17, so the G17 XY-plane will always be active when you Power On the machine.

G17 XY Plane Selection:

G17 Format:

G17 G02 X_Y_ I_ J_

G17 is the G-code used for selection of XY plane in a CNC programming. In this plane arc is parallel to XY plane and the circular motion is defined as clockwise for the operator looking down onto the XY table from above.

NOTE: In G17 Cutter Compensation can be only applied for X and Y movement but not on Z


Example G17:

O1001                                                            (G17 XY CIRCULAR PLANE)
N170 T1 M06                                                 (1/2 DIA. 4 FLT E.M.)
N171 G90 G54 G00 X4. Y3.25 S2600 M03   (XY start point of arc)
N172 G43 H01 Z0.1 M08
N173 G01 Z-0.375 F50.
N174 G17 G02 X5.25 Y2. R1.25 F10.            (G17 circular motion XY plane)
N175 G00 Z0.1
N176 X5. Y-.25                                               (G17 is the default when you power up machine)
N177 G01 Z-0.375 F50.
N178 X3.25 Y0.8 F10.
N179 Y-.25
N180 G00 Z1.
N181 X-0.25 Y1.
N182 G01 Z-0.375 F50.
N183 G17 G03 X1. Y-0.25 R1.25 F10.          (G17 circular motion XY plane)
N184 G00 Z1. M09
N185 G53 G49 Y0. Z0. M05
N186 M30


G18 XZ CIRCULAR PLANE SELECTION:

G18 Format:

G18 G02 X_Z_ I_ K_


The G18 code is used for doing circular motion in the XZ Plane. In G18 arc is parallel to XZ plane. In these diagrams shown here you need to look at the circular direction as if you're standing at the back of the machine looking toward the spindle, for the G02 clockwise and G03 counter clockwise directions in the G18 XZ circular plane.

NOTE: In G18 Cutter Compensation can be only applied for X and Z movement but not on Y

Example G18  ZX CIRCULAR PLANE SELECTION)

N171 T13 M06                                                   (1/2 DIA. 2 FLT BALL E.M.)
N172 G90 G54 G17 G00 X1.5 Y0. S2600 M03 (XY start point of arc)
N173 G43 H13 Z0.1 M08
N174 G01 Z0. F20.
N175 M97 P200 L80                                           (Local sub-routine call done 80 times with L80)
N176 G17 G00 Z1. M09                                      (Switch back to G17 XY-plane when done using G18)
N177 G53 G49 Y0. Z0. M05
N178 M30
                     (Local sub-routine N179 called by M97 P200 on line N105, repeated 80 times with L80)
N179 G91 G01 Y-0.01                                        (Local sub-routine N200 called by M97 on line N105)
N180 G90
N181 G18 G02 X3. Z0. R0.75 F12.                     (G18 circular motion ZX plane)
N182 G91 G01 Y-0.01
N183 G90
N184 G18 G03 X1.5 Z0. R0.75 F12.                  (G18 circular motion ZX plane)
N185 M99                                                           (An M99 will cause the program to jump back to the next line after the M97 sub-routine call in the main program.)


G19 YZ CIRCULAR PLANE SELECTION:

G19 Format:

G19 G02 Y_Z_ J_ K_


The G19 code is used for doing circular motion in the YZ plane. In G19 arc is parallel to YZ plane and you need to look at the circular direction as if you're standing on the right side of machine where the machine control is, looking toward the other end, for the G02 clockwise and G03 counter clockwise directions in the G19 YZ circular plane.

NOTE: In G19 Cutter Compensation can be only applied for Y and Z movement but not on X





Example For (G19 YZ CIRCULAR PLANE SELECTION):

N171 T13 M06 (1/2 DIA. 2 FLT BALL E.M.)
N172 G90 G54 G17 G00 X0. Y1.5 S2600 M03 (XY start point of arc)
N173 G43 H13 Z0.1 M08
N174 G01 Z0. F20.
N175 M97 P100 L80 (Local sub-routine call done 80 times with L80)
N176 G17 G00 Z1. M09 (Switch back to G17 XY-plane when finished using G19)
N177 G53 G49 Y0. Z0. M05
N1788 M30
(Local sub-routine N100 called by M97 P100 in line N5, repeated 80 times with L80)
N100 G91 G01 X-0.01
N101 G90
N102 G19 G03 Y3. Z0. R0.75 F12. (G19 circular motion YZ plane)
N103 G91 G01 X-0.01
N104 G90
N105 G19 G02 Y1.5 Z0. R.75 F12. (G19 circular motion YZ plane)
N106 M99 (An M99 will cause the program to jump back to the next line after the M97 sub-routine call in the main program.)