Beruflich Dokumente
Kultur Dokumente
Fanuc G68 Coordinate Rotation G-Code makes it easy for cnc machinist to run a pattern
of operations in a rotated angle.
Here is a basic cnc programming Example which helps to understand the actual working
of G68 coordinate rotation.
Fanuc G68 Program Example
T1 M6
G0 G90 G40 G21 G17 G94 G80
G54 X20 Y0 S1500 M3
G43 Z100 H1
Z5
G81 R3 Z-20 F? M8
X30
X45
G68 X0 Y0 R120
X20 Y0
X30
X45
G68 X0 Y0 R240
X20 Y0
X30
X45
G69 G80
G0 G90 Z100 M30
Main-program
N5 G54
N10 G43 T10 H10 M6
N15 S2000 M3 F300
M98 P030100 ; Subprogram call
N25 G0 Z50
N30 M30
Subprogram
O0100
N10 G91 G68 X10 Y10 R22.5
N15 G90 X30 Y10 Z5
N20 G1 Z-2
N25 X45
N30 G0 Z5
N35 M17
Contents
G50 Cancels the offset/rotation
o Programming
G51 Offset / rotation
o Programming
o Parameters
Programming
G50
Programming
Parameters
Parameter Description
X,Y,Z coordinates of the new origin with respect to the current origin.
J angle between the abscissa of the new origin and the abscissa of the main origin. Positive for counterclockw
I incremental coordinates of the new origin (with respect to the last programmed origin).
K1 rotation/offset with respect to part origin (default).
K2 rotation/offset with respect to the last G51.
K K3 rotation/offset with respect to the programmed point.
Drawing/Image
CNC Program
O1453
G91 G28 X0 Y0 Z0
M06 101
M03 S1000
G90 G54 G43 H1
G52 X100 Y100
G00 X0 Y0
G00 Z5
G16
G81 X80 Y45 Z-16 R2 F200
Y135
Y225
Y315
G15
G52 X300 Y100
G00 X0 Y0
G16
G81 X80 Y45 Z-16 R2
Y135
Y225
Y315
G15
G28 Z0
M30
Drawing/Image
CNC Program
N1 [PROFILE 3
N2 $1M0X-105.I103.Y-63.7J69.3
N3 G17
N4 O1
N5 T1
N6 F1000S1200M3
N7 Z100R
N8 X-20Y27R
N9 Z2R
N10 Z-10
N11 G49I2
N12 G41K2
N13 L=1
N14 G20X0Y0I-25
N15 G21I10
N16 G13X-3J90
N17 G20X0Y63I-3
N18 G13J-90
N19 G21
N20 G51J-72I
N21 L1K4
N22 G51J0
N23 G50
N24 G20X0Y0I-25
N25 G40X-20Y27K2
N26 Z100R
N27 M30
Programming
G15
Programming
G16
The selection of the plane in which polar coordinates can be programmed occurs with G17 – G19.
With the address of the first axis the radius will be programmed,
with the address of the second axis the angle will be programmed,
both related to the workpiece zero point.
Example
Contents
G Codes
NCT Programming Example
G Codes
G Code Function
G15 polar coordinate command cancel
G16 polar coordinate command
G81 drilling, spot boring cycle
Contents
G Codes
NCT Programming Example
G Codes
G Code Function
G15 polar coordinate command cancel
G16 polar coordinate command
G81 drilling, spot boring cycle
%O7073(7.3)
N100 T1
N110 G54 G0 X0 Y0
N120 G43 Z50 H1
N130 S1000 M3 M8
N140 G16 G0 X50 Y-10
N150 G81 X50 YI10 R2 Z-10 L36
N160 G80 G15
N170 G0 Z100
N180 M30
%
Contents
G90 Absolute Coordinate
G91 Incremental Coordinate
Hust CNC Flexibility
o G90 Absolute Coordinate
o G91 Incremental Coordinate
Example CNC Program
o G90 Absolute Coordinate
o G91 Incremental Coordinate
o G90 Absolute Coordinate
The origin (Workpiece Zero Point) is the reference. The coordinates of all points describing the
shape of the work-piece (machine part) are calculated from the origin.
The coordinates of all points describing the shape of the work-piece (machine part) are calculated
from the end point of the previous block.
But in G90 Absolute Coordinate mode U, V, W can be used for axis incremental movement
commands
U is used for X-axis incremental movements.
V is used for Y-axis incremental movements.
W is used for Z-axis incremental movements.
So in short if you are working in G90 Absolute Coordinate mode then if you wish you can make
Incremental movements by using U, V, W.
So there is no need to use G91 Incremental Coordinate command G-Code.
Hust CNC Mill G90 Absolute Coordinates G91 Incremental Coordinate Example
G90 Absolute Coordinate
Mixed Usage
Or
Drawing/Image
CNC Program
Drawing/Image
CNC Program
Contents
G75 Cancels G76
o Programming
G76 Polar coordinate programming
o Programming
o Parameters
Programming
Programming
G76 [X...] [Y...] (with G17)
G76 [Z...] [X...] (with G18)
G76 [Y...] [Z...] (with G19)
Parameters
Parameter Description
X(G17) circumference radius.
Y(G17) angle with respect to the abscissa (positive in the counterclockwise direction).
Fanuc G73 High Speed Peck Drilling cycle performs high–speed peck drilling. It performs
intermittent cutting feed to the bottom of a hole while removing chips from the
hole.
Fanuc G73 High Speed Peck Drilling Cycle is also called Fanuc G73 Chip Break Drilling
Cycle. Fanuc G73 High Speed Peck Drilling Cycle is used on Fanuc control with CNC Milling
machines.
Programming
G73 X Y Z R Q F K
Parameters
Parameter Description
XY Hole position data
Z Z-depth (feed to Z-depth starting from R plane)
R The distance from the initial level to point R level (Position of the R plane)
Q Depth of cut for each cutting feed (depth of each peck)
F Cutting feedrate
K Number of repeats (if required)
Cycle Operation
The tool dips into the workpiece for the infeed Q, drives back (retraction) 1mm to break chips,
dips in again, until end depth is reached, then retracts with rapid feed. Retraction Retraction
amount can be set in parameter 5114
G98 G99
When G98 is active, the Z-axis will return to the start position (initial plane) when it completes a
single operation. When G99 is active, the Z-axis will be returned to the R point (plane) when the
canned cycle completes a single hole. Then the machine will go to the next hole. Generally, G99 is
used for the first drilling operation and G98 is used for the last drilling operation
Cancel G73
To cancel Fanuc G73 canned cycle, use G80 or a group 01 G code. Group 01 G codes G00 :
Positioning (rapid traverse) G01 : Linear interpolation G02 : Circular interpolation or helical
interpolation (CW) G03 : Circular interpolation or helical interpolation (CCW)
Example Program
The following Fanuc G73 Chip Break Drilling Cycle example code shows how to use G73 drilling
cycle and how to use G98 and G99 G-code with G73 cycle.
M3 S2000
G90 G99 G73 X300. Y–250. Z–150. R–100. Q15. F120.
Y–550.
Y–750.
X1000.
Y–550.
G98 Y–750.
G80 G28 G91 X0 Y0 Z0
M5
Contents
G74 Reverse Tapping Cycle
Programming
Parameters
Operation
Feed Calculation
Cancel G74
Parameters
Parameter Description
X Y Hole position data
Z Z-depth (feed to Z-depth starting from R plane)
R Position of the R plane
F Cutting feedrate
Operation
Tapping with G74 tapping cycle is performed by rotating the spindle counter-clockwise. When the
bottom of the hole has been reached, the spindle is rotated in the clockwise direction for retraction.
This operation creates left hand threads.
Feed Calculation
With Rigid Tapping, the ratio between feedrate and spindle speed must be calculated for thread
pitch being cut. The calculation is 1 Threads Per Inch x rpm = tapping feedrate.
F (Feed) = RPM x Pitch.
Cancel G74
G74 Left-hand tapping cycle G-code is modal, so cancelled with G80 otherwise it will execute
tapping operation on every X and/or Y move.
Fanuc G76 Fine Boring Cycle bores a hole precisely. When the bottom of the hole has been
reached, the spindle stops, and the tool is moved away from the machined surface of the
workpiece and retracted.
Fanuc G76 Fine Boring Cycle is used for enlarging borings with boring and facing heads, Fanuc
G76 Fine Boring Cycle is also called Fanuc G76 Fine Drilling Cycle.
Programming
G76 X Y Z R Q P F K
Parameters
Parameter Description
XY Hole position data
Z Absolute hole depth position
R Position of the R plane
Q Shift amount at the bottom of a hole
P Dwell time at the bottom of a hole
F Cutting feedrate
K Number of repeats (if required)
Operation
When the bottom of the hole has been reached, the spindle is stopped at the fixed rotation position,
and the tool is moved in the direction opposite to the tool tip and retracted. This ensures that the
machined surface is not damaged and enables precise and efficient boring to be performed.
Be sure to specify a positive value in Q. If Q is specified with a negative value, the sign is
ignored. Set the direction of shift in bits 4 and 5 of parameter 5101.
Bit 5 Bit 4 = Shift
00 X+
01 X-
10 Y+
11 Y-
Example Program
M3 S500
G90 G99 G76 X300. Y–250. Z–150. R–120. Q5. P1000 F120.
Y–550.
Y–750.
X1000.
Y–550.
G98 Y–750.
G80 G28 G91 X0 Y0 Z0
M5
N10 M06 T1
N20 G90 G00 X12.5 Y10 Z12 S1000 M03
N30 G99 G81 X12.5 Y10 Z-17 R2 F75
N40 Y30
N50 G98 X57.5
N60 G99 Y10
N70 G91 G80 G28 X0 Y0 Z0 M05
N80 M30
Repeat Drilling Example
Repeat drilling with G81 Drilling Cycle
T1 M6
G00 G90 G40 G21 G17 G94
G54 X0 Y0 S1000 M03
G43 H1 Z100
Z3
G81 G99 G91 X20 Y20 R3 Z-20 K3 F100 M08
G80
G00 G90 Z100
M30
OR
T1 M6
G00 G90 G40 G21 G17 G94
G54 X20 Y20 S1000 M03
G43 H1 Z100
Z3
G81 G99 R3 Z-20 F100 M08
G91 X20 Y20 K2
G80
G00 G90 Z100
M30
O1000 ;
T1 M6 ;
G0 G90 G40 G21 G17 G94 G80 ;
G54 X10 Y10 S? M3 ;
G43 Z100 H1 ;
Z5 ;
G81 R3 Z-20 F? M8 ;
Y30 ;
Y50 ;
Y70 ;
X30 ;
X50 ;
X70 ;
X90 ;
Y50 ;
Y30 ;
Y10 ;
X70 ;
X50 ;
X30 ;
G80 ;
G0 G90 Z100
T2 M6 ;
G0 G90 G40 G21 G17 G94 G80 ;
G54 X10 Y10 S? M3 ;
G43 Z100 H1 ;
Z5 ;
G84 G99 G95 R3 Z-20 F1.25 M8 ;
Y30 ;
Y50 ;
Y70 ;
X30 ;
X50 ;
X70 ;
X90 ;
Y50 ;
Y30 ;
Y10 ;
X70 ;
X50 ;
X30 ;
G80 ;
G0 G90 Z100 ;
T0 M6 ;
M30 ;
O1000
T1 M6
G00 G90 G40 G21 G17 G94
G54 X20 Y10 S1000 M03
G43 H1 Z100
Z3
G81 G99 R3 Z-20 F350 M08
G91 X10 Y10 K4
G80
G00 G90 Z100
M30
N10 T1 M6
N20 G00 G90 X0 Y0 Z0
N30 S1450 M03
N40 G81 G99 G91 X50 Y50 Z-120 R-98 K3 F350
N50 G98 G90 G00 X500 Y500
N60 G80
N70 G90 X0 Y0
N80 M30
Explanation
N40 G81 G99 G91 X50 Y50 Z-120 R-98 K3 F350
K3 means that the G81 drilling cycle will repeat three times.
G91 Incremental mode makes the tool to move every time X50 and
Y50
So first hole will be at X50 Y50
Second hole will be at X100 Y100 because
X100 = X50(previous value) + X50 (increment)
Y100 = Y50(previous value) + Y50 (increment)
Third hole will be at X150 Y150 because
X150 = X100(previous value) + X50 (increment)
Y150 = Y100(previous value) + Y50 (increment)
N50 G98 G90 G00 X500 Y500
The fourth hole position is given with G90 Absolute Programming
Mode.
The above code is only possible if you use G91 Incremental
Programming Mode with G81 Drilling cycle, but if you try to use
G90 Absolute Programming Mode with G81 as above you will see
the tool will repeat drilling at the same position.
000000000000000000
O10075
N1 T16 M06
N2 G90 G54 G00 X0.5 Y-0.5
N3 S1450 M03
N4 G43 H16 Z1. M08
N5 G81 G99 Z-0.375 R0.1 F9.
N6 X1.5
N7 Y-1.5
N8 X0.5
N9 G80 G00 Z1. M09
N10 G53 G49 Z0. M05
N11 M30
Explanation
O10075 Program number (there are many programs in cnc memory
so they are distinguished by their number).
N1- Tool change (M06) to tool no.16
N2- Tool rapidly moves (G00) to first drilling position X0.5 Y-0.5
while taking into account Zero-offset-no. 1 (G54)
N3- Drill starts rotating clockwise (M03) with 1450 rpm (S1450).
N4- Drill takes depth Z1. taking into account tool length
compensation (G43 H16), coolant is turned on (M08).
N5- Drilling cycle (G81) parameters, drill depth (Z) and cutting feed
(F) are given, with this command first drill is made at current
position (X0.5 Y-0.5).
N6- As drilling cycle continues it’s work with every axis movement
so next drill is done at X1.5
N7- Third drilling hole at Y-1.5
N8- Fourth drill at X0.5
N9- Drilling cycle is canceled (G80), Coolant is turned off (M09).
N10- Taking Machine-coordinate-system (G53) into account the
drill is taken to Z0 position. Tool length compensation is canceled
(G49), cutter rotation is stopped (M05).
N11- CNC part-program is ended.
G & M Codes
Code Description
T Tool no. used.
M06 Tool change command.
G90 Absolute programming
G54 Zero offset no.1
G00 Rapid traverse
S Cutter speed
M03 Cutter rotation Clockwise
G43 Tool length compensation.
M08 Coolant on.
G81 Fanuc drilling cycle.
F Cutting feed.
G80 Canned cycle cancel.
M09 Coolant off.
G53 Machine coordinate system selection.
G49 Tool length compensation cancel.
M05 Cutter rotation stop.
M30 CNC part-program end.
O10076
N10 T11 M06
N20 G90 G54 G00 X0.5 Y-0.5
N30 S1200 M03
N40 G43 H11 Z1. M08
N50 G82 G99 Z-0.375 P1 R0.1 F7.5
N60 X1.5
N70 Y-1.5
N80 X0.5
N90 G80 G00 Z1. M09
N100 G53 G49 Z0. M05
N110 M30
Note N50 – CNC machines with Fanuc cnc control will use P1000
instead of P1 which is used for Haas CNC machines.
-----------------------------000000000000000
N10 M06 T1
N20 G90 G00 X12.5 Y10 Z12 S1000 M03
N30 G99 G83 X12.5 Y10 Z-17 R2 Q4 F75
N40 Y30
N50 G98 X57.5
N60 G99 Y10
N70 G91 G80 G28 X0 Y0 Z0 M05
N80 M30
---------------------------------------- 0000000000000000
The following G83 peck drilling cycle example code illustrates the use of peck drilling
cycle in an easy to understand way, even the beginner level cnc programmers/cnc
machinists will understand the working with ease.
N1 T1 M06
N2 G90 G54 G00 X.3 Y.3
N3 S1200 M03
N4 G43 H01 Z1. M08
N5 G83 Z-1.5 Q.5 R.1 F10.
N6 X1.2 Y1.2
N7 G80 G00 Z1. M09
N8 G91 G28 Z0. M05
N9 M30
--------------------------00000000000000000000
As G83 is a Peck drilling cycle so the depth for each peck in G83
drilling cycle will be the amount defined with Q.
The tool will take the peck (Q deep)
Then the tool will rapid up to the R plane after each peck
and then back in for the next peck
until Z depth is reached.
Use G98 and G99 for the Z position clearance location for
positioning between holes.
G83 Peck Drilling Cycle Format
G83 X_ Y_ Z_ R_ Q_ F_ K_ ;
X Y – Hole position data
Z – Z-depth (feed to Z-depth starting from R plane)
R – Position of the R plane
Q – Depth of cut for each cutting feed (depth of each peck)
F – Cutting feedrate
K – Number of repeats (if required)
A complete cnc programming example of G83 Peck drilling
cycle G81 Drilling Cycle G83 Peck Drilling with G98 G99 Example
Program
Fanuc G84 Tapping Cycle
G84 tapping cycle performs tapping operation, tapping is performed
by rotating the spindle clockwise, when bottom of the hole has been
reached, the spindle is rotated in the reverse direction for retraction.
This whole operation creates threads.
Contents
Syntax
o Notes
Usage
Working
G98 G99 Modes
Repeat Drilling
Working Example
Syntax
G84 X... Y... Z... R... P... F... K...
Parameter
Description
X
Hole position in x-axis.
Y
Hole position in y-axis.
Z
Depth, tapping from R-plane to Z-depth.
R
Position of the R plane.
P
Dwell time.
K
Number of cycle repetitions (if required)
.
F
Feedrate.
Once given in program G84 tapping cycle is repeated at every axis
movement until G80 is given in program to end tapping cycle.
Notes
Feedrate override is ignored during tapping.
Feed-hold does not stop the machine until the return operation is
completed.
Usage
N150 M6 T2
N160 G90 G00 X60 Y28 Z12 S100 M03
N170 G99 G84 X60 Y28 Z-17 P300 R2 F120
N180 G98 Y12
N190 G91 G80 G28 X0 Y0 Z0 M05
N200 M30
Working
Brief description of how G84 tapping cycle works,
N10 T1 M06
N20 G90 G54 G00 X30 Y25
N30 S100 M03
N40 G43 H01 Z5 M08
N50 G84 Z-20 R2 F1.25
N60 X80 Y50
N70 G80 G00 Z100 M09
N80 M30
----------------0000000000000009999999999999999999999999999999999999999999
Programming
G89 <ENT=..> <RAP=..> <RAL=..> <TIM=..>
Parameters
Parameter Description
ENT Depth quote reached at working feed
RAP Quote reached in rapid at the beginning of cycle
RAL Return Quote reached at rapid
TIM Dwell [sec] to start working movement between ENT and RAP.
ECS G87 Boring with Retraction Cycle
Contents
ECS G87 Boring with Retraction Cycle
Programming
Parameters
ECS G87 Boring with Retraction Cycle
This cycle differs from the “Boring with Spindle Stop” G86 because
in this case, when tool reaches the ENT quote, the spindle is not
only stopped, but oriented in a specific position (through the M19
Function), disengaged with a movement in X and Y and finally
moved in Rapid to the RAL quote.
The cycle Data Entry is activated, in MDI and Edit modes, through
this keys sequence:
Programming
G87 <ENT=..> <RAP=..> <RAL=..> <DAX=..> <DAY=..>
Parameters
Parameter Description
ENT Depth quote reached at working feed
RAP Quote reached in rapid at the beginning of cycle
RAL Return Quote reached at rapid with spindle stopped, oriented and disen
DAX Incremental disengagement movement along X
DAY Incremental disengagement movement along Y
G83 Peck Drilling Cycle (Deep Hole) for Haas CNC
Contents
G83 Deep Hole Peck Drilling Canned Cycle Explanation
G83 Peck Drilling Cycle for Haas CNC Control
G83 Peck Drilling Cycle Format
G83 Peck Drilling Canned Cycle Format – I J K Options
o Haas CNC G83 Deep Hole Peck Drilling Cycle Setting
G83 Deep Hole Peck Drilling Canned Cycle Explanation
G83 Peck Drilling Cycle G-code is modal so that it is activated
every X and/or Y axis move, and it will rapid to that position and
then cause this canned cycle (Drilling) to be executed again, until
it’s canceled (G80).
G83 Peck Drilling Cycle for Haas CNC Control
G83 Peck Drilling Cycle
Haas CNC control gives us more flexibility when dealing with Deep
Hole Peck Drilling (G83).
Haas CNC has two formats of G83 Deep Hole Peck Drilling Cycle.
The first and widely used one is just like the Fanuc CNC control
format as stated below
This G83 drilling cycle format is briefly described here G83 Peck
Drilling Cycle (Deep Hole) for Fanuc
G83 Peck Drilling Cycle Format
G83 X_ Y_ Z_ R_ Q_ F_;
X Y – Hole position data
Z – Z-depth (feed to Z-depth starting from R plane)
R – Position of the R plane
Q – Depth of cut for each cutting feed (depth of each peck)
F – Cutting feedrate
The second format for Haas CNC G83 Deep Hole Peck Drilling
Cycle is below
G83 Peck Drilling Canned Cycle Format – I J K Options
G83 Peck Drilling Cycle with I J K Options
G83 X_ Y_ Z_ I_ J_ K_ R_ F_;
X Y – Hole position data
Z – Z-depth (feed to Z-depth starting from R plane)
R – Position of the R plane
I – Size of first cutting depth
J – Amount to reduce cutting depth each pass
K – Minimum depth of cut
F – Cutting feedrate
The first pass will cut in by I, each succeeding cut will be reduced by
amount J, and the minimum cutting depth is K.
Haas CNC G83 Deep Hole Peck Drilling Cycle Setting
Setting 22 – As the tool pecks deeper into the hole, with each peck it
rapids out to the R-plane, and then back in to a constant specified
distance above the bottom of the hole that was created by the
previous peck. That specified distance is defined in Setting 22.
ECS G85 Boring Cycle
Contents
ECS G85 Boring Cycle
Programming
Parameters
ECS G85 Boring Cycle
The only difference between this cycle and the Standard Drilling
G81 is that the tool return to RAL quote is done at working feed,
between ENT and RAP, and at rapid (G00) from RAP to RAL.
The cycle Data Entry is activated, in MDI and Edit modes, through
this keys sequence:
Programming
G85 <ENT=..> <RAP=..> <RAL=..>
Parameters
Parameter Description
ENT Depth quote reached at working feed
RAP Quote reached in rapid at the beginning of cycle
RAL Return Quote reached at rapid
Programming
G86 <ENT=..> <RAP=..> <RAL=..>
Parameters
Parameter Description
ENT Depth quote reached at working feed
RAP Quote reached in rapid at the beginning of cycle
RAL Return Quote reached at rapid with spindle stopped.
Parameters
Parameter Description
XY Hole position data
Z Absolute hole depth position
R Position of the R plane
Q Shift amount at the bottom of a hole
P Dwell time at the bottom of a hole
F Cutting feedrate
K Number of repeats (if required)
Operation
When the bottom of the hole has been reached, the spindle is stopped
at the fixed rotation position, and the tool is moved in the direction
opposite to the tool tip and retracted. This ensures that the machined
surface is not damaged and enables precise and efficient boring to be
performed.
Be sure to specify a positive value in Q. If Q is specified with a
negative value, the sign is ignored. Set the direction of shift in bits 4
and 5 of parameter 5101.
Bit 5 Bit 4 = Shift
00 X+
01 X-
10 Y+
11 Y-
Example Program
M3 S500
G90 G99 G76 X300. Y–250. Z–150. R–120. Q5. P1000 F120.
Y–550.
Y–750.
X1000.
Y–550.
G98 Y–750.
G80 G28 G91 X0 Y0 Z0
M5