You are on page 1of 16

CNC MILLING SAMPLE PROGRAM

WHAT IS CIRCULAR INTERPOLATION

Circular Interpolation Concepts Programming Part 1


Definition

A translation of linear axis positions into curved tool motions is called circular interpolation. Another definition is
Circular Interpolation commands are used to move a tool along a circular arc to the commanded end position.

Circular interpolation requires five pieces of informations; an endpoint, a feed rate, a center, a radius, and a
direction of movement. Circular interpolation is a motion of tool in circle. It may be a complete circle or less than.

Before going to discuss five pieces of information for circular interpolation, first it is very important to understand the
elements of circle in detail.

ELEMENTS OF A CIRCLE

ELEMENTS OF A CIRCLE
DEFINATION OF CIRCLE

A circle is defined as a closed curve on a plane, where all points have the same distance from an internal point
called the circle center point.

RADIUS

The radius of a circle is the line segment from the center point to any point on the circle.

DIAMETER

The diameter of a circle is the line segment through the center point of the circle and having both end points on the
circle.

QUADRANT

A quadrant is any one of the four parts of the plane formed by the system of rectangular coordinates.

It is to every programmers benefit to understand the concept of quadrants and their application for circular motions
in milling and turning programs. A circle is programmed in all four quadrants, due to its nature, while most arcs are
programmed within one or two quadrants. When programming the arc vectors I, J, and K, the angular difference
between the arc start and end points is irrelevant. The only purpose of arc vectors is to define a unique arc radius
between two points.

FIVE PIECES OF INFORMATION

Five pieces of information are required for executing a circular interpolation command.

Circular Motion

Item Command

o G17 = arc parallel to XY-plane


o G18 = arc parallel to ZX-plane
o Plane selection o G19 = arc parallel to YZ-plane

o Arc start position coordinates o X, Y, Z

o G02 = Move to a destination point via a clockwise arc.


o Rotation direction o G03 = Move to a destination point via a counterclockwise arc.
o Arc end position (G90) Absolute o X,Y,Z
o Or o Or
o Arc end position (G91) Incremental o X,Y,Z

o R
o Or
o I = is the distance, with specified direction, measured from the start
point of the arc, to the center of the arc, parallel the X axis.
o J= is the distance, with specified direction, measured from the start
o R method (arc radius) point of the arc, to the center of the arc, parallel the Y axis.
o Or o K= is the distance, with specified direction, measured from the start
o I J K method (arc center coordinate) point of the arc, to the center of the arc, parallel the Z axis.

With the help of above information we can easily say that there are two ways to specify the center of the circular arc
that you rotating around.

o Uses of R to specify the radius of the arc.


o Uses of I, J, or K to specify the distance from the starting point to the center of the arc.
USES OF R

The first method is very simple and there is no extra ordinary effort is required to program an Arc or Circle. Just
mention the next point values of X, Y coordinate and use R+value. For many arc programming projects, the direct
radius can be used with the R address, available for majority of control systems. In this case, the angular difference
between the start and end points is very important, because the computer will do its own calculations to find the arc
center. The arc with the angular difference of 180 or less measured between the start and end points, uses
an R positive value. The arc, in which the angular difference is more than 180, uses an R negative value.

For example: see the following picture


Radius Positive Negative

In the above picture, there are two circles. One is dash line circle and the other is solid. These two circles are
intersecting with each other at two points which are shown in black dots.

If the tool motion of dash circle is clockwise from start point to end point than the arc is less than 180. The code for
this motion of tool in absolute mode G90 will look like this.

G02 X34.5 Y20 R18 F100.

And if the tool motion of solid circle is clockwise from start point to end point than the arc is more than 180. The
code for this motion of tool in absolute mode G90 will look like this.

G02 X34.5 Y20 R-18 F100.

When circular interpolation command is activated by a CNC program, any currently active tool motion command is
automatically canceled. This canceling motion is typically G00, G01 or a cycle command.

Circular Interpolation using G90 and G91

G90 X ____ Y____ defines the arc end point in the work co-ordinate system.

G91 X____ Y____ defines the signed distance of the arc end point from the arc start point

R_____ defines the length of the arc radius

The axis of the Arc must be parallel to the X-, Y- or Z-axis of the machine coordinate system. The axis or the plane
perpendicular to the axis is selected with G17 (Z-axis, XY-plane), G18 (Y-axis, XZ-plane) or G19 (X-axis, YZ-plane).
I, J and K are the offsets from the current location. At one time only two of I, J, and K will be used. This will depend
on what arc plane has been selected

o G17 Use I and J


o G18 Use I and K
o G19 Use J and K

The I, J and K arguments specify the DISTANCE from the ARC START POINT to the CENTER POINT of the arc.
Note that the start point of the arc is NOT GIVEN in a G02 or G03 command. The start point is determined by the
location of the cutter when the command is implemented. Also, the center point is never given explicitly in the
command. I, J, and K are DISTANCES. If the geometry of the circle is impossible (to within .0001), an error is
usually thrown.

The following figure shows the four quadrants of circle and I, J calculation from start point to end point. Circle radius
is 50 mm.

Quad I from 0 to 90 Circular Interpolation Concepts

Quad I from 0 to 90
Start Point X50 Y0
End Point X0 Y50
I -50
J 0
G03 X0 Y50 I-50 J0
Quad II from 90 to 180 Circular Interpolation Concepts

Quad II from 90 to 180


Start Point X0 Y50
End Point X-50 Y0
I 0
J -50
G03 X-50 Y0 I0 J-50

Quad III from 180 to 270 Circular Interpolation Concepts

Quad III from 180 to 270


Start Point X-50 Y0
End Point X0 Y-50
I 50
J 0
G03 X0 Y-50 I50 J0

Quad IV from 270 to 0 Circular Interpolation Concepts

Quad IV from 270 to 0


Start Point X0 Y-50
End Point X50 Y0
I 0
J 50
G03 X50 Y0 I0 J50

Program an Arc only Arc Center is given

To program an arc when only the arc center is given (the radius is unknown) use the address letters I and J

o I relates to the address X and is the incremental value and direction (+/-) from the start point of the arc in the X axis to the
arc centre.
o J relates to the address Y and is the incremental value and direction (+/-) from the start point of the arc in the Y axis to the
arc centre.
Program an Arc only Arc Center is given

In this figure the procedure is very clear to calculate I and J values. From the point where arc is started always look
to wards arc midpoint. If the arc is less than a quadrant than you must find out the both I and J values.

G03 X (End Point) Y(End Point) I J

Why Use IJK when R is Easier to Program?

R is easier to define, though its easier to make a mistake and get an incorrect radius. If R is used, and you make a
mistake with the start point or the end point, and the machine can still do the radius, and does it, then youll have an
incorrect radius.

If you make a mistake with the I, J , K method, the machine will be more likely to stop and give you an alarm before
executing it.

Though using an R in a G02 or G03 is still easier and the preferred method to manually program an arc.

What is R

R is the distance from the starting point to the center of the circle.

What is IJK

I = Incremental distance from Start Point to arc center in the X axis.


J = Incremental distance from Start Point to arc center in the Y axis.
K = Incremental distance from Start Point to arc center in the Z axis.

When to Use Negative R

With a positive R, the control will generate a circular path of 180 degrees or less, but to generate a circular path of
over 180 degrees, then specify a negative R. When R is used, a complete 360 degree arc is not possible. X, Y, or Z
is required to specify an endpoint different from the starting point. So anything under a 360 degree arc can be
performed with an R command in a G02 or G03.
How to Cut 360 Degree Arc or Full Circle

Use of I, J, or K is the only way to cut a complete 360 degree arc; in this case, the starting point is the same as the
ending point and no X, Y, or Z is needed. To cut a complete circle of 360 degrees (360), you do not need to specify
an ending point X, Y, or Z; just program I, J, or K to define the center of the circle.

Example Program

NOTE: Example of circular moves are not using cutter compensation, so the circular moves are defined from the
center of the cutter around arc.
G02 G03 with R
O0010 (INTERPOLATION EXERCISE)
T1 M06 (1/2 DIA. 4FLT. END MILL)
G90 G54 G00 X-0.35 Y-0.25
S1450 M03
G43 H01 Z0.1 M08
G01 Z-0.625 F50.
X-0.25 F14.5
Y3.5
G02 X0.5 Y4.25 R0.75
G01 X3.5
G02 X4.25 Y3.5 R0.75
G01 Y0.25
X4.
G03 X3.75 Y0. R0.25
G01 Y-0.25
X-.35
G00 Z1. M09
G28 G91 Z.0 M05
M30

G02 G03 with IJK


O0010 (INTERPOLATION EXERCISE)
T1 M06 (1/2 DIA. 4FLT. END MILL)
G90 G54 G00 X-0.35 Y-0.25
S1450 M03
G43 H01 Z0.1 M08
G01 Z-0.625 F50.
X-0.25 F14.5
Y3.5
G02 X0.5 Y4.25 I0.75 J0.
G01 X3.5
G02 X4.25 Y3.5 I0. J-0.75
G01 Y0.25
X4.
G03 X3.75 Y0. I0. J-0.25
G01 Y-0.25
X-.35
G00 Z1. M09
G28 G91 Z.0 M05
M30

Circular Interpolation using G90 and G91

o G90 X ____ Y____ defines the arc end point in the work co-ordinate system.
o G91 X_____ Y____ defines the signed distance of the arc end point from the arc start point
o I____ J____ defines the signed distance of the arc start point from the center point of the arc

For example: see the following picture.


Circular Interpolation using G90 and G91

Example CNC Programs

CNC Program with G90 CNC Program with G91

G41 G90 G01 X0 Y20 G41 G91 G01 X0 Y20


G02 X10 Y30 I10 J0 G02 X10 Y10 I10 J0
G01 X20 Y30 G01 X10 Y0
G01 X20 Y40 G01 X0 Y10
G02 X30 Y50 I10 J0 G02 X10 Y10 I10 J0
G01 X45 Y50 G01 X15 Y0
G02 X50 Y45 I0 J-5 G02 X5 Y-5 I0 J-5
G01 X50 Y5 G01 X0 Y-40
G02 X40 Y0 I-13.59 J14.68 G02 X-10 Y-5 I-13.59 J14.68
G01 X0 Y0 G01 X-40 Y0

Circular interpolation is quite a bit more demanding on your machine as two axes have to be precisely coordinated.
Drawing a complete circle involves not just coordinated motion but reversal of direction at each of the 4 quadrant
points. These would be the points corresponding to 0, 90, 180, and 270 degrees.

CNC G02 Circular Interpolation Clockwise CNC Milling Sample Program


G90 G00 X-2.0 Y-1.0
G01 X0 Y0 F8.0 ; point A
Y4.0 ; point B
G02 X2.0 Y6.0 R2.0 ; point C
G01 X8.0 ; point D
G02 X9.0 Y2.268 R2.0 ; point E
G01 X0 Y0 ; point A
G00 X-2.0 Y-1.0
CNC Milling Machine Programming Example for Beginners
N05 G0 G90 X40 Y48 Z2 S500 M3
N10 G1 Z-12 F100
N15 X20 Y18 Z-10
N20 G0 Z100
N25 X-20 Y80
N30 M2

N05 The tool traverses in rapid traverse on P1, three axes concurrently, spindle speed = 500 rpm, clockwise
N10 Infeed on Z-12, feed 100 mm/min
N15 Tool travels on a straight line in space on P2
N20 Retraction in rapid traverse
N30 End of program

CNC Milling Circular Interpolation G02 G03 G-Code Program Example


G90
G00 X-1.0 Y-1.0 ; point S
G01 X0 Y0 F7.5 ; point A
Y2.134 ; point B
G03 X0.5 Y3.0 I-0.5 J0.866 ; point C
X0. Y3.866 I-1. J0 ; point D
G01 Y5.5 ; point E
G02 X0.5 Y6.0 I0.5 J0 ; point F
G01 X4.5 ; point G
G02 X6.0 Y4.5 I0 J-1.5 ; point H
G01 Y0 ; point I
X0 ; point A
G00 X-1.0 Y-1.0 ; point S

Circular Interpolation Programming Example 2


N5 G00 G54 G64 G90 G17 X-20 Y-20 Z50
N10 S450 M03 F250 D01 (12.5 MM DIA)
N15 C0
N20 Z5
N25 G01 Z0
N30 Z-5
N35 G42 X0 Y0 M08
N40 X80 Y0
N45 X60 Y30 U10
N50 X80 Y50
N55 X50 Y50
N60 G02 X30 Y30 U20
N65 G01 X10 Y30 U8
N70 X0 Y0
N75 G40 X-20 Y-20
N80 G00 Z50 M09
N85 Y100
N90 M30

Finished Part
After completing the machining process, your job will look like this.
Completed Part
Explanation of CNC G-Code

G00 : Rapid traverse.


G54 : Zero Offset no. 1.
G64 : Continuous-path mode.
G90 : Absolute dimensioning system.
G17 : X-Y plan selection.
G42 : Cutter radius compensation activation (right hand side movement)
G40 : Cutter radius compensation de-active
G02 : Circular Interpolation clockwise
G03 : Circular Interpolation anti-clockwise (counter clockwise)
S : Spindle speed
F : Axis motion feed
M : Cutter motion (3=clockwise, 4=anti-clockwise)
D : Tool no
M08 : Coolant on
M09 : Coolant off
M30 : End of main program

Uses of Circular Interpolation

Circular interpolation is commonly used in profiling on CNC vertical and horizontal machining centers, as well as on
lathes and many other CNC machines, such as simple milling machines, routers, burners, water jet and laser
profilers, wire EDM, and others.

Circular interpolation is used for programming arcs or complete circles in such applications as outside and inside
radius, circular pockets, spherical or conical shapes, radial recesses, grooves, corner breaks, helical cutting, even
large counter bores, etc. The CNC unit will interpolate a defined arc with a very high precision, if the necessary
information is given in the program.

NOTE: you should understand two important things, first is arc start point and the second is arc center point. Find
the values of these things in X, Y axis.
Home work Exercise

ContourPlate
Home work Exercise 2

Contour Plate 2

You might also like