0 votes
59 views
in cnc programming by (9.4k points)

In this article, we describe circular interpolation which is called G02 and G03 code on Haas CNC machines.

G02 and G03 codes are Circular interpolation motion commands on Haas CNC controller and also most of other controllers.

Cycle Format

G02 X… Y… Z… A… R… I… J… K… F…
G03 X… Y… Z… A… R… I… J… K… F…

F – Feedrate
*I – Distance along X Axis to center of circle
*J – Distance along Y Axis to center of circle
*K – Distance along Z Axis to center of circle
*R – Radius of circle
*X – X-Axis motion command
*Y – Y-Axis motion command
*Z – Z-Axis motion command
*A – A-Axis motion command
* Indicates optional

Note : I,J and K is the preferred method to program a radius. R is suitable for general radii.
These G codes are used to specify circular motion. Two axes are necessary to complete
circular motion and the correct plane, G17-G19, must be used. There are two methods of
commanding a G02 or G03, the first is using the I, J, K addresses and the second is using
the R address.

Using I, J, K addresses

I, J and K address are used to locate the arc center in relation to the start point. In other
words, the I, J, K addresses are the distances from the starting point to the center of the
circle. Only the I, J, or K specific to the selected plane are allowed (G17 uses IJ, G18 uses
IK and G19 uses JK). The X, Y, and Z commands specify the end point of the arc. If the X,
Y, and Z location for the selected plane is not specified, the endpoint of the arc is the same
as the starting point for that axis.
To cut a full circle the I, J, K addresses must be used; using an R address will not work.
To cut a full circle, do not specify an ending point (X, Y, and Z ); program I, J, or K to define the center of the circle. For example:
G02 I3.0 J4.0 (Assumes G17; XY plane) ;

Using the R address

The R-value defines the distance from the starting point to the center of the circle. Use a
positive R-value for radii of 180° or less, and a negative R-value for radii more than 180°.

Positive R Address Programming Example

F7.5: Positive R Address Programming Example

%
O60021 (G02 POSITIVE R ADDRESS) ;
(G54 X0 Y0 is at the bottom-left of part) ;
(Z0 is on top of the part) ;
(T1 is a .5 in dia endmill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X-0.25 Y-0.25 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Activate tool offset 1) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G01 Z-0.5 F20. (Feed to cutting depth) ;
G01 Y1.5 F12. (Feed to Y1.5) ;
G02 X1.884 Y2.384 R1.25 (CW circular motion) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%

Negative R Address Programming Example

F7.6: Negative R Address Programming Example

%
O60022 (G02 NEGATIVE R ADDRESS) ;
(G54 X0 Y0 is at the bottom-left of part) ;
(Z0 is on top of the part) ;
(T1 is a .5 in dia endmill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X-0.25 Y-0.25 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Activate tool offset 1) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G01 Z-0.5 F20. (Feed to cutting depth) ;
G01 Y1.5 F12. (Feed to Y1.5) ;
G02 X1.884 Y0.616 R-1.25 (CW circular motion) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%

Thread Milling

Thread milling uses a standard G02 or G03 move to create the circular move in X-Y, then
adds a Z move on the same block to create the thread pitch. This generates one turn of the
thread; the multiple teeth of the cutter generate the rest. Typical block of code:
N100 G02 I-1.0 Z-.05 F5. (generates 1-inch radius for 20-pitch thread) ;

Thread milling notes

Internal holes smaller than 3/8 inch may not be possible or practical. Always climb cut
the cutter.
Use a G03 to cut I.D. threads or a G02 to cut O.D. threads. An I.D. right hand thread will
move up in the Z-Axis by the amount of one thread pitch. An O.D. right hand thread will
move down in the Z-Axis by the amount of one thread pitch. PITCH = 1/Threads per inch
(Example – 1.0 divided by 8 TPI = .125)
This program I.D. thread mills a 1.5 diameter x 8 TPI hole with a 0.750″ diameter x 1.0″
thread hob.
1. To start, take the hole diameter (1.500). Subtract the cutter diameter .750 and then
divide by 2. (1.500 – .75) / 2 = .375
The result (.375) is the distance the cutter starts from the I.D. of the part.
2. After the initial positioning, the next step of the program is to turn on cutter
compensation and move to the I.D. of the circle.
3. The next step is to program a complete circle (G02 or G03) with a Z-Axis command
of the amount of one full pitch of the thread (this is called Helical Interpolation).
4. The last step is to move away from the I.D. of the circle and turn off cutter
compensation.
You cannot turn cutter compensation off or on during an arc movement. You must program
a linear move, either in the X or Y Axis, to move the tool to and from the diameter to cut.
This move will be the maximum compensation amount that you can adjust.

Thread Milling Example

F7.7: Thread Milling Example, 1.5 Diameter X 8 TPI: [1]Tool Path, [2] Turn on and off cutter compensation.

Note : Many thread mill manufacturers offer free online software to help you create your threading programs
%
O60023 (G03 THREAD MILL 1.5-8 UNC) ;
(G54 X0 Y0 is at the center of the bore) ;
(Z0 is on top of the part) ;
(T1 is a .5 in dia thread mill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X0 Y0 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Activate tool offset 1) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G01 Z-0.5156 F50. (Feed to starting depth) ;
(Z-0.5 minus 1/8th of the pitch = Z-0.5156) ;
G41 X0.25 Y-0.25 F10. D01 (cutter comp on) ;
G03 X0.5 Y0 I0 J0.25 Z-0.5 (Arc into thread) ;
(Ramps up by 1/8th of the pitch) ;
I-0.5 J0 Z-0.375 F20. (Cuts full thread) ;
(Z moving up by the pitch value to Z-0.375) ;
X0.25 Y0.25 I-0.25 J0 Z-0.3594 (Arc out of thread) ;
(Ramp up by 1/8th of the pitch) ;
G40 G01 X0 Y1 (cutter comp off) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%
N5 = XY at the center of the hole
N7 = Thread depth, minus 1/8 pitch
N8 = Enable Cutter Compensation
N9 = Arcs into thread, ramps up by 1/8 pitch
N10 = Cuts full thread, Z moving up by the pitch value
N11 = Arcs out of thread, ramps up 1/8 pitch
N12 = Cancel Cutter Compensation
Note : Maximum cutter compensation adjustability is 0.175.

Outside Diameter (O.D.) Thread Milling

%
O60024 (G02 G03 THREAD MILL 2.0-16 UNC) ;
(G54 X0 Y0 is at the center of the post) ;
(Z0 is on top of the opost) ;
(T1 is a .5 in dia thread mill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X0 Y2.4 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Activate tool offset 1) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G00 Z-1. (Rapids to Z-1.) ;
G01 G41 D01 X-0.5 Y1.4 F20. (Linear move) ;
(Cutter comp on) ;
G03 X0 Y0.962 R0.5 F25. (Arc into thread) ;
G02 J-0.962 Z-1.0625 (Cut threads while lowering Z) ;
G03 X0.5 Y1.4 R0.5 (Arc out of thread) ;
G01 G40 X0 Y2.4 F20. (Linear move) ;
(Cutter comp off) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%
Note : A cutter compensation move can consist of any X or Y move from any position as long as the move is greater than the amount being compensated.

Single-Point Thread Milling

This program is for a 1.0″ diameter hole with a cutter diameter of 0.500″ and a thread pitch of 0.125 (8TPI). This program positions itself in Absolute G90 and then switches to G91 Incremental mode on line N7.
The use of an Lxx value on line N10 allows us to repeat the thread milling arc multiple
times, with a Single-Point Thread Mill.
%
O60025 (G03 SNGL PNT THREAD MILL 1.5-8 UNC) ;
(G54 X0 Y0 is at the center of the bore) ;
(Z0 is on top of the part) ;
(T1 is a .5 in dia thread mill) ;
(BEGIN PREPARATION BLOCKS) ;
T1 M06 (Select tool 1) ;
G00 G90 G40 G49 G54 (Safe startup) ;
G00 G54 X0 Y0 (Rapid to 1st position) ;
S1000 M03 (Spindle on CW) ;
G43 H01 Z0.1 (Activate tool offset 1) ;
M08 (Coolant on) ;
(BEGIN CUTTING BLOCKS) ;
G91 G01 Z-0.5156 F50. (Feed to starting depth) ;
(Z-0.5 minus 1/8th of the pitch = Z-0.5156) ;
G41 X0.25 Y-0.25 F20. D01 (Cutter comp on) ;
G03 X0.25 Y0.25 I0 J0.25 Z0.0156 (Arc into thread) ;
(Ramps up by 1/8th of the pitch) ;
I-0.5 J0 Z0.125 L5 (Thread cut, repeat 5 times) ;
X-0.25 Y0.25 I-0.25 J0 Z0.0156 (Arc out of thread) ;
(Ramps up by 1/8th of the pitch) ;
G40 G01 X-0.25 Y-0.25 (Cutter comp off) ;
(BEGIN COMPLETION BLOCKS) ;
G00 Z0.1 M09 (Rapid retract, Coolant off) ;
G53 G49 Z0 M05 (Z home, Spindle off) ;
G53 Y0 (Y home) ;
M30 (End program) ;
%
Specific line description:
N5 = XY at the center of the hole
N7 = Thread depth, minus 1/8 pitch. Switches to G91
N8 = Enable Cutter Compensation
N9 = Arcs into thread, ramps up by 1/8 pitch
N10 = Cuts full thread, Z moving up by the pitch value
N11 = Arcs out of thread, ramps up 1/8 pitch
N12 = Cancel Cutter Compensation
N13 = Switches back to G90 Absolute positioning

Helical Motion

Helical (spiral) motion is possible with G02 or G03 by programming the linear axis that is
not in the selected plane. This third axis will be moved along the specified axis in a linear
manner, while the other two axes will be moved in the circular motion. The speed of each
axis will be controlled so that the helical rate matches the programmed feedrate.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...