G17/G18/G19 – Plane Selection

Author:

In CNC machining, a plane is a flat surface that defines the orientation of the coordinate system and the direction of the tool movement. There are three main planes in CNC: the XY plane, the YZ plane, and the ZX plane. Each plane corresponds to a different axis of rotation for the spindle and the workpiece. To select the desired plane, CNC programmers use the G-code commands G17, G18, and G19. These commands are also known as plane selection codes or modal codes, because they remain active until another plane selection code is issued.

Usage Format

The general format for using the plane selection codes is:

G17/G18/G19

where:

  • G17 selects the XY plane
  • G18 selects the YZ plane
  • G19 selects the ZX plane

The plane selection code must be specified before any other G-code commands that depend on the plane, such as circular interpolation, drilling, or tapping. The plane selection code can be placed on the same line or on a separate line as the other commands.

Explanation

The plane selection codes are used to define the plane of the circular motion for the tool and the workpiece. For example, if the tool needs to move in a circular path on the XY plane, the programmer must use G17 before the circular interpolation command (such as G02 or G03). Similarly, if the tool needs to move in a circular path on the YZ plane, the programmer must use G18, and if the tool needs to move in a circular path on the ZX plane, the programmer must use G19.

The plane selection codes are also used to define the plane of the drilling or tapping operations for the tool and the workpiece. For example, if the tool needs to drill or tap a hole on the XY plane, the programmer must use G17 before the drilling or tapping command (such as G81 or G84). Similarly, if the tool needs to drill or tap a hole on the YZ plane, the programmer must use G18, and if the tool needs to drill or tap a hole on the ZX plane, the programmer must use G19.

The plane selection codes are important for ensuring the accuracy and safety of the CNC machining process. By selecting the correct plane, the programmer can avoid collisions, errors, or damage to the tool, the workpiece, or the machine.

Example

The following is an example of a CNC program that uses the plane selection codes to perform a circular interpolation and a drilling operation on different planes.

% (Program start)
O1000 (Program number)
G90 G94 G17 (Absolute distance mode, feed per minute mode, XY plane selection)
G00 X50 Y50 Z10 (Rapid positioning to X50 Y50 Z10)
G01 Z-5 F100 (Linear interpolation to Z-5 with feed rate 100 mm/min)
G02 X100 Y100 I25 J25 F200 (Circular interpolation clockwise to X100 Y100 with center offset I25 J25 and feed rate 200 mm/min)
G00 Z10 (Rapid positioning to Z10)
G18 (YZ plane selection)
G00 X150 Y50 Z50 (Rapid positioning to X150 Y50 Z50)
G81 Z-10 R5 F150 (Drilling cycle to Z-10 with retract position R5 and feed rate 150 mm/min)
G80 (Cancel drilling cycle)
G00 Z100 (Rapid positioning to Z100)
M30 (Program end)
%

The text diagram below shows the tool path and the planes for the example program.

    Z
    |
    |    / Drill
    |   /
    |  / 
    | / 
    |/ 
    +------------------- Y
   /|
  / |
 /  |
/   |
|   |    / Circular
|   |   /
|   |  /
|   | /
|   |/
|   +------------------- X
|
|
|

 

Leave a Reply

Your email address will not be published. Required fields are marked *