Posted by: davidhayden | February 28, 2010

Proven Tips, Tools and Tactics: Understanding G02 and G03


Cutting arcs on a CNC machine is one of the most basic programming task you can do. The keys to successful arc cutting involve knowing where you are going, what plane you are on, the direction of the arc and the arc center location.
 

 

Code Data

Code: G02/G03 (for most new controls G2 and G3 are more commonly used)
Modal: Yes
Group: 01
Action: Circular Moves
ANSI Std: Yes
Requirements: Point to move to, Feed Rate at which to move
Options: I,J,K and R
Conflicting G Codes G00, G01, G04, All Canned Cycles, Any other G code in Groups 00, 01 or 09

Description and How to Use G02/G03

Arcs are programmed using G02/G03 codes. Specifically:

  • G2/G02 – Clockwise Interpolation * Move a destination point via a clockwise arc at the programmed feed rate.
  • G3/G03 – Counterclockwise Interpolation * Move a destination point via a counterclockwise arc at the programmed feed rate.

So you see, Like the G01 code, G02/G03 commands require that you know the current location of the machine tool with respect to the part, the point where the arc will end and feedrate at which you want to cut the arc.

In addition to the above you also need to know the location of the arc center with respect to the start point of the arc. The start point of the arc is that point to which you move the machine where the arc is to begin.

Imagine a vertical line and you are moving along the line from bottom to top. As you get to the end of the line you can turn to the right or you can turn to the left. Whether the arc turns to the right or left is determined by the arc center. So if you want to make an arc off to the right, you know your arc center is to the right of the tool. Clearly then, to make a left turn, your arc center will be to the left of the tool.

To further determine the arc location, you need to know upon which axis the arc center lies. In the example above, moving up the vertical line, if the vertical line is considered the Y axis in a standard rectangular coordinate system (XY Plane), then the arc center would necessarily be located on line parallel to the X axis (left or right).

If you were to follow along a horizontal line to the right and wanted to place an arc at the end, the arc center would be located in a +Y or -Y direction; thus on a axis parallel to the Y axis (up or down).

The same is true of arcs made on a XZ or YZ plane. Your movement will be along one axis and the arc center will be along the opposite axis.

Where it gets a little tricky is when you are moving at an angle to any given axis. At that point your arc center will be a function of both axis and you will have to use a little simple trigonometry to correctly locate the arc centers.

The Commands to tell the machine where the arc center is located are the I, J and K commands. As a general rule, they are defined as shown below but be aware some machine controls use different methods to define the arc centers. You will want to consult the programming manual for your machine to determine if they used a system other than the one described here.

  • I = An incremental distance and direction from the start point of the arc to the arc center along the X axis.
  • K = An incremental distance and direction from the start point of the arc to the arc center along the Z axis.
  • J = An incremental distance and direction from the start point of the arc to the arc center along the Y axis.

Another critical aspect of programming arcs is knowing upon which plane you are programming the arc. Imagine you have a book in front of you. As you look at it you have a top surface 2 end surfaces, a front and back surface and bottom surface.

Now, if you want to draw a clockwise arc on the top surface, your pen will move in one direction. But let’s say you hold the book so you are looking at the right end. To draw a clockwise arc on the end of the book requires a different motion that it did to draw the arc on the face.

Therefore you must tell the machine the plane upon which the arc motion should take place. The commands the define the plane for creating arcs are the G17, G18 and G19. They are defined as follows:

  • G17 – The X, Y plane
  • G18 – The X, Z plane
  • G19 – The Y, Z plane

The most common plane mills use for working on the face of a part is the XY (G17) plane. Lathes are typically programmed where moves in and out from center line are X moves and moves towards and away from the chuck are Z moves. So for the most common arc plane for lathes is the XZ (G18) plane)

Here are a couple examples:

Assume the current location of the tool is at X0, Y0, Z0 and that the programming is in inches. The desired move is for an arc starting up the Y axis and moving clockwise 90 degrees. The programmed arc is to be .5 inches. The feedrate for the programmed arc is to be 15 inches per minute.

G94 Sets the mode of the motion to be in inches per minute.
G17 Sets the plane for the arc to be the XY plane.
G02 X.5 Y.5 I.5 F15. The G02 commands a clockwise arc. The X and Y define an end point .5 inches to the right of and .5 inches above the X0 Y0 start point. Since the command is clockwise, the arc center will be .5 inches in an X positive direction as defined by I.5

To do the opposite and move to a counterclockwise point, the code would be as follows:

G03 X-.5 Y.5 I-.5 F15. The G03 commands a counterclockwise arc. The X and Y define an end point – .5 inches to the left of and .5 inches above the X0 Y0 start point. Since the command is counterclockwise, the arc center will be -.5 inches in an X negative direction as defined by I-.5

Lets flip this around and program the arc going down and to the right of our X0 Y0 start point.

G02 X.5 Y-.5 J-.5 F15. The G02 commands a clockwise arc. The X and Y define an end point .5 inches to the right of and .5 inches below the X0 Y0 start point. Since the command is clockwise, the arc center will be .5 inches in an Y negative direction as defined by J-.5

The code to program the arc going up would be as show here:

G03 X.5 Y.5 J.5 F15. The G03 commands a counterclockwise arc. The X and Y define an end point .5 inches to the right of and .5 inches above the X0 Y0 start point. Since the command is counterclockwise, the arc center will be .5 inches in an Y positive direction as defined by J.5

Summary

Commanding a CNC machine to make arcs is relatively simple once you have clarified in your mind:

  • The destination or end point of the arc.
  • The correct plane upon which the arc is to be cut.
  • The arc center with respect to the starting point.

For a complete introduction to the fundamentals of CNC programming, take a look at 7 Easy Steps to CNC Programming . . . A Beginner’s Guide or 7 Easy Steps to CNC Programming . . . A Beginner’s Guide, the Ebook

About these ads

Responses

  1. [...] learn how to use the G02 and G03 to cut arcs click here [...]

  2. [...] from a G00 code.     Whether commanding linear interpolation (G01) or circular interpolation (G02/G03) you are telling the machine that you want ALL axis to arrive at the programmed point at the exact [...]

  3. [...] a G00 code.    Whether commanding linear interpolation (G01) or circular interpolation (G02/G03) you are telling the machine that you want ALL axis to arrive at the programmed point at the exact [...]

  4. [...] learn how to use the G02 and G03 to cut arcs click here [...]

  5. [...] G03  G17 X5.0 Y13.378 R.25 [...]


Categories

Follow

Get every new post delivered to your Inbox.

Join 377 other followers

%d bloggers like this: