Upload
mahesh-namdev
View
1.501
Download
15
Tags:
Embed Size (px)
Citation preview
FANUC INDIA FA & ROBOT
1
BASIC PROGRAMMING OF
CNC MILLING MACHINE
FANUC INDIA FA & ROBOT
2
Course contents Page No.
General coordinate System 04
Designation of machine axes 05
Machine coordinate system 06
Work coordinate system 07
Work datum setting procedure 09
Work coordinate system – Selection 11
Structure of
program 13
2Course contents
FANUC INDIA FA & ROBOT
Course contents Page No.
Basic G codes 17
Basic M codes 26
Tool length compensation 27
Cutter radius compensation 29
Programming Examples 35
Canned cycles – Drilling 47
Pattern of holes 74
Custom macro programming 87
FANUC INDIA FA & ROBOT
4
General Co-ordinate system
General coordinate system
FANUC INDIA FA & ROBOT
5Designation of machine axis
Designation of machine axis
FANUC INDIA FA & ROBOT
6Machine coordinate system
• The point that is specific to
machine and serves as the
reference of the machine
is referred to as the
machine zero point
• Machine tool builder sets a
machine zero point for
each machine
Machine coordinate system
FANUC INDIA FA & ROBOT
7Work coordinate system
A coordinate system used for
machining a workpiece is
referred to as a workpiece
coordinate system
A workpiece co-ordinate system
is also called as work reference
zero or work datum
The work datum will be set by
the user before the machining
process begins
Work co- ordinate system
FANUC INDIA FA & ROBOT
8Work coordinate system
A coordinate system used
for machining a workpiece is
referred to as a workpiece
coordinate system
A workpiece co-ordinate
system is also called as
work reference zero or work
datum
The work datum will be set
by the user before the
machining process begins
Work co- ordinate system
FANUC INDIA FA & ROBOT
9
Work datum setting procedure
Move the work table and spindle head
to the reference position
Attach a dial gauge or fix the reference
tool in the spindle
Bring the tool towards the work piece
in rapid mode or manually and make
the tool to touch on the surface of the
workpiece and note the Z axis reading.
Then add the tool length with the same
sign to get the Z co ordinate value and
note down this value
WCS
MCS
Work datum setting procedure
FANUC INDIA FA & ROBOT
10
Work datum setting procedure cont.,
Then move the tool to any one edge
and make the tool to touch the edge
and note down the readings of X and
Y axes.ADD /subtract the radius of
the tool from the readings
The readings will be the distance
between the machine zero and work
zero point
Record noted X, Y, Z values in any
one of the work coordinate G codes
(G54 to G59)
Work datum setting procedure
FANUC INDIA FA & ROBOT
11
G54 Workpiece coordinate system 1
G55 Workpiece coordinate system 2
G56 Workpiece coordinate system 3
G57 Workpiece coordinate system 4
G58 Workpiece coordinate system 5
G59 Workpiece coordinate system 6
Work piece coordinate system - selection
Work piece coordinate system selection
FANUC INDIA FA & ROBOT
12
Work piece coordinate system Selection
Work piece coordinate system selection
FANUC INDIA FA & ROBOT
13
Structure of Program
Structure of Program
FANUC INDIA FA & ROBOT
14Structure of Program
FANUC INDIA FA & ROBOT
15Structure of Program
FANUC INDIA FA & ROBOT
16
Block
Structure of Program
FANUC INDIA FA & ROBOT
17
- Preparatory function
- Tool movement related functions
Basic G codes
Basic G codes
FANUC INDIA FA & ROBOT
18
G94 - Feed per Minute
Basic G codes
FANUC INDIA FA & ROBOT
19
G95 - Feed per revolution
Basic G codes
FANUC INDIA FA & ROBOT
20
Co ordinate value & Dimensioning
- Absolute G90 & Incremental G91 Programming
- Inch & Metric Programming – G20 & G21
- Decimal Point Programming – PRM 3401#0=1
Basic G codes
FANUC INDIA FA & ROBOT
21
Absolute and incremental programming
Basic G codes
FANUC INDIA FA & ROBOT
22
Tool movement in a straight line
Basic G codes
FANUC INDIA FA & ROBOT
23
Tool movement in a circular path
Basic G codes
FANUC INDIA FA & ROBOT
24
Direction of circular interpolation
Basic G codes
FANUC INDIA FA & ROBOT
25
ijk values
Basic G codes
FANUC INDIA FA & ROBOT
26
Basic M codes
- Miscellaneous function
- Machine operations related
functions
• M01 – Optional stop
• M02 – Program stop
• M03 – Spindle on, CW
• M04 – Spindle on, CCW
• M05 – Spindle stop
• M06 – Turret indexing
• M07 – Coolant on
• M08 – Coolant on
• M09 – Coolant off
• M30 – Program stop and rewind
Basic M codes
FANUC INDIA FA & ROBOT
27
Tool length compensation
The procedure of mentioning the difference of length of tool assumed during
programming and actual tool used for machining is called tool length compensation
1) If the actual tool length is more than the assumed tool, the difference should be
mentioned as follows
G43 H01
H01 – here 01 specifies the address where the difference
of tool will be mentioned
2) If the actual tool length is less than the assumed tool, the difference should be
mentioned as follows
G44 H01
H01 – here 01 specifies the address where the difference
of tool will be mentioned
Tool length compensation
FANUC INDIA FA & ROBOT
28
Tool length compensation
• G43 - Tool length offset plus
• G44 - Tool length offset minus
• G49 - Tool length compensation cancel
Tool length compensation
FANUC INDIA FA & ROBOT
29
G41 - Cutter radius compensation left
G42 - Cutter radius compensation right
G40 - Cutter radius compensation
cancel
Cutter radius compensation
-When the Endmill cutter of some specified
diameter is commanded to position at a location,
actually the centre point of the cutter only
coincide with the addressed point of the work
piece.
- So, t is necessary to shift the cutter for a radius
amount towards left or right from the position.
The procedure of shifting the tool of radius
amount is called as Cutter Radius
Compensation
Cutter radius compensation
FANUC INDIA FA & ROBOT
30
Type of operation
Direction of movement
Type of compensation
External Clockwise G41
External Counter clockwise
G42
Internal Clockwise G42
Internal Counter clockwise
G41
The type of compensation is selected from
the starting point as follows
Cutter radius compensation
Cutter radius compensation
FANUC INDIA FA & ROBOT
31
Cutter radius compensation
Cutter radius compensation
FANUC INDIA FA & ROBOT
32
G41 - Cutter radius compensation left
G41 D07;
Here, D specifies the address of
offset at which the radius of tool
will be mentioned
Cutter radius compensation
FANUC INDIA FA & ROBOT
33
G42 - Cutter radius compensation right
G41 D07;
Here, D specifies the
address of offset at which
the radius of tool will be
mentioned
Cutter radius compensation
FANUC INDIA FA & ROBOT
34
Operations performed in machining centre
Side cutting
Hole machining
Face cutting
Operations in machining centre
FANUC INDIA FA & ROBOT
35
G54
SQ 150
SQ 200
thickness
20mm
1
3
4
2
Programming Examples
Programming Examples
FANUC INDIA FA & ROBOT
36
Programming example
Making 150 mm* 150 mm square
for a depth of 5mm in a given Billet
Assumptions
Work offset = G54
Tool length compensation = H01
Point X co ordinate value
Y co ordinate value
1 25 25
2 25 175
3 175 175
4 175 25
Programming Examples
FANUC INDIA FA & ROBOT
37
O1001 ; Program Number
N1 G21 G94 ; Metric input, Feed in mm/min.
N2 G91 G28 X0 Y0 Z0 ; The tool is moved to home position
N3 T01 M06 ; (Dia. 15 mm End drill)
N4 G90 G54 G00 X25.0 Y25.0 ; Work offset call
N5 G43 H01 Z100.0 ; Tool length compensation call
N6 M03 S1000 Z20 ; Positioning above the starting point and spindle starts rotating at 1000 rpm
N7 G01 Z-5.0 F400 ; The tool is moved inside work of -5.0 mm
N8 Y175.0 ; The tool is moved to second corner
N9 X175.0 ; The tool is moved to third corner
N10 Y25.0 ; The tool is moved to fourth corner
N11 X25.0 ; The tool is moved back to first corner
N12 G00 Z100.0 M05 ; The tool is taken out of the work and spindle stop
N13 G91 G28 X0 Y0 Z0 ; The tool is moved back to home position
N14 M30 ; Program stop snd rewind
Programming Examples
FANUC INDIA FA & ROBOT
38
1
2
3 4
5
6
78
Blank size: 150mm*150mm*20mm
Point X Y
1 0 25
2 0 50
3 45 150
4 105 150
5 150 50
6 150 25
7 125 0
8 25 0
G55
PROGRAMMING EXAMPLE WITHOUT SUB PROGRAM
Programming Examples
FANUC INDIA FA & ROBOT
39
O1002 ; Program Number
N1 G21 G94 ; Metric input, Feed in mm/min.
N2 G91 G28 X0 Y0 Z0 ; The tool is moved to home position
N3 T01 M06 ; (Dia. 15 mm End drill)
N4 G90 G55 G00 X-25.0 Y-25.0 ; Work offset call
N5 G43 H01 Z100.0 ; Tool length compensation call
N6 M03 S1000 Z20 ; Positioning above the starting point and spindle starts rotating at 1000 rpm
N7 G01 Z-20.0 F400 ; The tool is moved inside work of -20.0 mm
N8 G41 G01 X0.0 Y0.0 D01 ; Cutter radius compensation call
N9 G01 X0.0 Y50.0 ; The tool is moved to point 2
N10 G01 X45.0 Y150.0 ; The tool is moved to point 3
N11 G01 X105.0 Y150.0 ; The tool is moved to point 4
N12 G01 X150.0 Y50.0 ; The tool is moved to point 5
N13 G01 X150.0 Y25.0 ; The tool is moved to point 6
Programming Examples
FANUC INDIA FA & ROBOT
40
N14 G01 X125.0 Y0.0 ; The tool is moved point 7
N15 G01 X25.0 Y0.0 ; The tool is moved to point 8
N16 G01 X0.0 Y25.0 ; The tool is moved to point 1
N17 G40 G00 X-25.0 Y-25.0 ; The tool is moved back to starting position
N18 G00 Z100.0 M05 ; The tool is taken out of the work and spindle stop
N19 G91 G28 X0 Y0 Z0 ; The tool is moved back to home position
N20 M30 ; Program stop and rewind
Programming Examples
FANUC INDIA FA & ROBOT
41
1
2
3 4
5
6
78
Blank size: 150mm*150mm*20mm
Point X Y
1 0 25
2 0 50
3 45 150
4 105 150
5 150 50
6 150 25
7 125 0
8 25 0
G55
PROGRAMMING EXAMPLE WITH SUB PROGRAM
Programming Examples
FANUC INDIA FA & ROBOT
42
O1003 ; Program Number
N1 G21 G94 ; Metric input, Feed in mm/min.
N2 G91 G28 X0 Y0 Z0 ; The tool is moved to home position
N3 T01 M06 ; (Dia. 15 mm End drill)
N4 G90 G55 G00 X-25.0 Y-25.0 ; Work offset call
N5 G43 H01 Z100.0 ; Tool length compensation call
N6 M03 S1000 Z20 ; Positioning above the starting point and spindle starts rotating at 1000 rpm
N7 G01 Z0.0 F400 ; The tool is moved To Z0.0
N8 M98 P1500 L10 ; Sub program No.1500 call, L indicatesNo. of times
N18 G00 Z100.0 M05 ; The tool is taken out of the work and spindle stop
N19 G91 G28 X0 Y0 Z0 ; The tool is moved back to home position
N20 M30 ; Program stop snd rewind
Programming Examples
FANUC INDIA FA & ROBOT
43
O 1500 ; Sub program No
N200 G91 Z-2.0 F400 ; The tool is moved incrementally -2 mm
N210 G90 G41 G01 X0.0 Y0.0 Cutter Radius comp. (left),F400 D01 ; The tool is moved towards work piece
N220 G01 X0.0 Y50.0 ; The tool is moved to point 2
N230 G01 X45.0 Y150.0 ; The tool is moved to point 3
N240 G01 X105.0 Y150.0 ; The tool is moved to point 4
N250 G01 X150.0 Y50.0 ; The tool is moved to point 5
N260 G01 X150.0 Y25.0 ; The tool is moved point 6
N270 G01 X125.0 Y0.0 ; The tool is moved to point 7
N280 G01 X25.0 Y0.0 ; The tool is moved to point 8
N290 G01 X0.0 Y25.0 ; The tool is moved to point 1
N17 G40 G00 X-25.0 Y-25.0 ; The tool is moved back to starting position
N310 M99 ; Sub program end
Programming Examples
FANUC INDIA FA & ROBOT
44
1
2 3 4 5
678
Blank size: 200mm*200mm*20mm
Point X Y
1 0 0
2 0 200
3 75 200
4 125 200
5 200 200
6 200 0
7 125 0
8 75 0
G57
PROGRAMMING EXAMPLE WITH SUB PROGRAM
R25
R25
Programming Examples
FANUC INDIA FA & ROBOT
45
O1004 ; Program Number
N1 G21 G94 ; Metric input, Feed in mm/min.
N2 G91 G28 X0 Y0 Z0 ; The tool is moved to home position
N3 T01 M06 ; (Dia. 15 mm End drill)
N4 G90 G57 G00 X-25.0 Y-25.0 ; Work offset call
N5 G43 H01 Z100.0 ; Tool length compensation call
N6 M03 S1000 Z20 ; Positioning above the starting point and spindle starts rotating at 1000 rpm
N7 G01 Z0.0 F400 ; The tool is moved To Z0.0
N8 M98 P1501 L10 ; Sub program No.1500 call, L indicatesNo. of times
N18 G00 Z100.0 M05 ; The tool is taken out of the work and spindle stop
N19 G91 G28 X0 Y0 Z0 ; The tool is moved back to home position
N20 M30 ; Program stop snd rewind
Programming Examples
FANUC INDIA FA & ROBOT
46
O 1501 ; Sub program No
N200 G91 Z-2.0 F400 ; The tool is moved incrementally -2 mm
N210 G90 G41 G01 X0.0 Y0.0 Cutter Radius comp. (left),F400 D01 ; The tool is moved towards work piece
N220 G01 X0 Y200.0 ; The tool is moved to point 2
N230 G01 X75.0 Y200.0 ; The tool is moved to point 3
N240 G03 X125.0 Y200.0 R25.0 ; The tool is moved to point 4 with CIP-CCW
N250 G01 X200.0 Y200.0 ; The tool is moved to point 5
N260 G01 X200.0 Y0 ; The tool is moved point 6
N270 G01 X125.0 Y0 ; The tool is moved to point 7
N280 G03 X75.0 Y0 R25.0 ; The tool is moved to point 8 with CIP CCW
N290 G01 X0 Y0 ; The tool is moved to point 1
N17 G40 G00 X-25.0 Y-25.0 ; The tool is moved back to starting position
N310 M99 ; Sub program end
Programming Examples
FANUC INDIA FA & ROBOT
47
Canned cycles - Drilling
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
48
STEP Description of the cycle
1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Rapid retract to initial/reference level
FORMAT AND EXPLANATION
G81 X…. Y…. R…. Z…. F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)F = Federate specification
G81 SPOT DRILLING CYCLE
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
49
BLANK SIZE
100*100*20
DIA. 8, FIVE HOLES
HOLE1 (20,20)
HOLE2 (20,80)
HOLE3 (80,80)
HOLE4 (80,20)
HOLE5 (50,50)
Programming Example
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
50
PROGRAMMING EXAMPLE
O1005
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X20 Y20
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G81 Z-4. R5 F300
N8 X80
N9 Y80
N10 X20N11 X50 Y50
N12 G80 G00 Z100
N13 G91 G28 X0 Y0 Z0
N14 M05
N15 M30
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
51
STEP Description of the cycle
1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Dwell at the depth in millisecond
5 Rapid retract to initial/reference level
G82 COUNTER BORING CYCLE
Format and explanation
G82 X…. Y…. R…. Z…. P….F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)P = Dwell time in millisecondsF = Federate specification
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
52
BLANK SIZE
100*100*20
DIA. 8, FIVE HOLES
HOLE1 (20,20)
HOLE2 (20,80)
HOLE3 (80,80)
HOLE4 (80,20)
HOLE5 (50,50)
PROGRAMMING EXAMPLE
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
53
O1006
N1 G91 G28 X0 Y0 Z0
N2 T02 M06
N3 G21
N4 G17 G90 G54 G00 X20 Y20
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G82 Z-15. R5 P2000 F300
N8 X80
N9 Y80
N10 X20
N11 X50 Y50
N12 G80 G00 Z100 M05
N13 G91 G28 X0 Y0 Z0
N14 M30
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
54
DEEP HOLE DRILLING HIGH SPEED DEEP HOLE CYCLE
STEP Description of the cycle STEP Description of the cycle
1 Rapid motion to hole position 1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth by the amount of specified depth
3 Feed rate motion to Z depth by the amount of specified depth
4 Rapid retract to safety level/R level
4 Rapid retract by a clearance value (clearance value is set by a system parameter)
5 Rapid motion to the previous depth less a clearance (clearance is set by a system parameter)
5 Feed rate motion in Z axis by the distance specified plus clearance
6 Steps 3,4, and 5 repeat until the programmed Z depth is reached
6 Steps 4 and 5 repeat until the programmed Z depth is reached
7 Rapid retract to safety/R level 7 Rapid retract to safety/R level
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
55
FORMAT AND EXPLANATION
G73 X…. Y…. R…. Z…. Q….F…. G83 X…. Y…. R…. Z…. Q….F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)Q = Pecking depth (Micron)F = Federate specification
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)Q = Pecking depth (Micron)F = Federate specification
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
56
WHEN TO USE DEEP HOLE DRILLING CYCLE (G83)
For deep hole drilling, also known as peck drilling, where the drill has to be
retracted above the part (to a clearance position) after drilling to a certain depth.
WHEN TO USE HIGH SPEED DEEP HOLE DRILLING CYCLE(G73)
For deep hole drilling, also known as peck drilling, where the chip breaking is ore
important than the full retract of the drill from the holes. This type often used for a
long series drills, when a full retract is not very important.
Canned cycles - Drilling
BLANK SIZE
100*100*20
DIA. 8, FIVE HOLES
HOLE1 (20,20)
HOLE2 (20,80)
HOLE3 (80,80)
HOLE4 (80,20)
HOLE5 (50,50)
Programming Example
FANUC INDIA FA & ROBOT
57
O1007
N1 G91 G28 X0 Y0 Z0
N2 T03 M06
N3 G21
N4 G17 G90 G54 G00 X20 Y20
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G83 Z-30. R5 Q8000 F300 or G73 Z-30 R5 Q8000 F300
N8 X80
N9 Y80
N10 X20
N11 X50 Y50
N12 G80 G00 Z100 M05
N14 G91 G28 X0 Y0 Z0
N15 M30
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
58
TAPPING CYCLE - STANDARD TAPPING CYCLE - REVERSE
STEP Description of the Cycle STEP Description of the cycle
1 Rapid motion to hole position 1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth 3 Feed rate motion to Z depth
4 Spindle rotation stop 4 Spindle rotation stop
5 Spindle reverse rotation (M04) and feed rate back to safety/R level
5 Spindle reverse rotation (M04) and feed rate back to safety/R level
6 Spindle rotation stop 6 Spindle rotation stop
7 Spindle rotation normal 7 Spindle rotation normal
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
59
FORMAT AND EXPLANATION
G84 X…. Y…. R…. Z….R… F…. G74 X…. Y…. R…. Z…R….. F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)F = Federate specification
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)F = Federate specification
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
60
BLANK SIZE
100*100*20
DIA. 8, FIVE HOLES
HOLE1 (20,20)
HOLE2 (20,80)
HOLE3 (80,80)
HOLE4 (80,20)
HOLE5 (50,50)
Canned cycles - Drilling
PROGRAMMING EXAMPLE
The important notes for the tapping operation
• Safety/reference level should be higher in the tapping cycle than in the other cycles to
follow for the stabilization of the feed rate, due to acceleration
• Feed rate section for the tap is very important. In tapping, there is a direct relationship
between the spindle speed and the lead of the tap. This relationship must be maintained at
all the times.
• The override switches on the control panel used for spindle speed and feed rate, are
ineffective during these cycles.
• Tapping motion (in or out of the part) will be completed even if the feed hold key is
pressed during tapping cycle processing for safety reasons.
FANUC INDIA FA & ROBOT
61
O1008
N1 G91 G28 X0 Y0 Z0
N2 T03 M06
N3 G21
N4 G17 G90 G54 G00 X20 Y20
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G84 Z-15. R5 F300 or G74 Z-30 R5 F300 (Feed = RPM * Pitch)
N8 X80
N9 Y80
N10 X20
N11 X50 Y50
N12 G80 G00 Z100 M05
N13 G91 G28 X0 Y0 Z0
N14 M30
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
62
G85 BORING CYCLE
STEP Description of the cycle
1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Feed rate motion back to safety/R level
Canned cycles - Drilling
G85 X…. Y…. R…. Z…. F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)F = Feed rate specification
FANUC INDIA FA & ROBOT
63
DIMNSION OF
BLANK
100*100*20
HOLE DIA. 10 mm
HOLE (50,50)
Canned cycles - Drilling
WHEN TO USE THIS CYCLE
This cycle is typically used for boring and reaming operations.
This cycle is used in cases where the tool motion into and out of
holes should improve the hole surface finish, its dimensional
tolerances and/or its concentricity, roundness, etc.
PROGRAMMING EXAMPLE
FANUC INDIA FA & ROBOT
64
PROGRAMMING EXAMPLE
O1009
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X50 Y50
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G85 Z-20. R5 F300
N8 G80 G00Z100 M05
N9 G91 G28 X0 Y0 Z0
N10 M30
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
65
PRECISION BORING CYCLE (G76)
STEP Description of the cycle
1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Spindle rotation stop
5 Shifting in programmed direction
6 Rapid retract to reference level
Canned cycles - Drilling
STEP Description of the cycle
1 Rapid motion to hole position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Spindle rotation stop
5 Rapid retract to reference level
ROUGH BORING CYCLE (G86)
FANUC INDIA FA & ROBOT
66
G86 X…. Y…. R…. Z…Q... F (rough)G76 X…. Y…. R…. Z…I…J... F ….(fine)
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)F = Federate specificationQ = amount of shift for boringI, J = amount of shift
Format and Explanation
FANUC INDIA FA & ROBOT
67
O1009
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X50 Y50
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G86 Z-20. R5 F300
N8 G80 Z100
N9 G91 G28 X0 Y0 Z0
N10 M05
N11 M30
Canned cycles - Drilling
DIMNSION OF
BLANK 100*100*20
HOLE (50,50)
PROGRAMMING EXAMPLE
FANUC INDIA FA & ROBOT
68
BORING CYCLE (G88)
STEP Description of the cycle
1 Rapid motion to XY position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Dwell at the depth in milliseconds
5 Spindle rotation stops (feed hold condition is generated and the CNC operatorswitches to manual operation mode and perform a manual task, then switches back tomemory mode)
6 Rapid retract to safety/reference level
7 Spindle rotation on
Canned cycles - Drilling
G88 X…. Y…. R…. Z….P… F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)P = Dwell time in millisecondsF = Federate specification
FANUC INDIA FA & ROBOT
69
WHEN TO USE THIS CYCLE
This cycle is rare. Its use is limited to boring operations with special tools that require
manual interference at the bottom of a hole. This cycle may be used by some tool
manufacturers for certain operations.
Canned cycles - Drilling
DIMNSION OF
BLANK
100*100*20
HOLE (50,50)
PROGRAMMING EXAMPLE
FANUC INDIA FA & ROBOT
70
O1010
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X50 Y50
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G88 Z-20. R5 P2000 F300
N8 G80 G00 Z100 M05
N9 G91 G28 X0 Y0 Z0
N10 M30
Canned cycles - Drilling
FANUC INDIA FA & ROBOT
71
BORING (REAMING) CYCLE (G89)
STEP Description of the cycle
1 Rapid motion to XY position
2 Rapid motion to safety level/reference level
3 Feed rate motion to Z depth
4 Dwell at the depth
5 Feed rate motion back to safety/R level
Canned cycles - Drilling
G89 X…. Y…. R…. Z…. P…F….
X = Hole position in X axis Y = Hole position in Y axis R = Reference position (Z axis st. point)Z = Final depth (abs.)P = dwell time in millisecondsF = Federate specification
FANUC INDIA FA & ROBOT
72
WHEN TO USE THIS CYCLE
For boring operations, when the feed rate is required for the in and out directions
of the machined hole, with a specified dwell at the bottom. The dwell is the only
value that distinguishes this cycle from the cycle85/G85.
Canned cycles - Drilling
DIMNSIONS OF BLANK
100*100*20
HOLE DIA. 10 mm
HOLE (50,50)
PROGRAMMING EXAMPLE
FANUC INDIA FA & ROBOT
73
O1011
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X50 Y50
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G85 Z-20. R5 P2000 F300
N8 G80 G00 Z100 M05
N9 G91 G28 X0 Y0 Z0
N10 M30
Pattern of holes
FANUC INDIA FA & ROBOT
74
PATTERN OF HOLES
RANDOM HOLE PATTERN
BLANK SIZE =
100*100*20
DIA. 8, FIVE HOLES
HOLE1 (28,16)
HOLE2 (60,32)
HOLE3 (88,40)
HOLE4 (104,48)
Pattern of holes
FANUC INDIA FA & ROBOT
75
O1012
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X28 Y16
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G83 Z-30. R5 Q8000 F300
N8 X60 Y32
N9 X88 Y40
N10 X104 Y 48
N11 G80 G00 Z100 M05
N13 G91 G28 X0 Y0 Z0
N14 M30
Pattern of holes
FANUC INDIA FA & ROBOT
76
STRAIGHT ROW HOLE PATTERN
First hole dimension
from ref. = (15,10)
distance between
holes = 20,
diameter of
holes = 10 mm
Pattern of holes
O1013
N1G21 G94
N2 G91 G28 X0 Y0 Z0
N3 T01 M06
N4 G17 G90 G54 G00 X15 Y10
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G83 Z-30. R5 Q8000 F300
N8 G91 X20.0 K5
N9 G80 G00 Z100 M05
N10 G28 X0 Y0 Z0
N11 M30
FANUC INDIA FA & ROBOT
77
O1014
N1 G91 G28 X0 Y0 Z0
N2 T01 M06
N3 G21
N4 G17 G90 G54 G00 X15 Y10
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G83 Z-30. R5 Q8000 F300
N8 G91 X20.0 K5
N9 G80 G00 Z100 M05
N10 G28 X0 Y0 Z0
N11 M30
Pattern of holes
FANUC INDIA FA & ROBOT
78
PATTERN OF HOLES IN AN INCLINED LINE
ANGLE OF THE INCLINED LINE WITH X AXIS = 15
DISTANCE BETWEEN HOLES = 40
FIRST HOLE DIMENSION IS (20,20)
DIAMETER OF HOLES = 10 mm
The following calculation is required in FANUC to find distance between
holes in X axis and in Y axis.
X = 40 * cos15 = 38.63703305
Y = 40 * sin15 = 10.3527618
Pattern of holes
FANUC INDIA FA & ROBOT
79
O1015
N1 G21 G94
N2 G91 G28 X0 Y0 Z0
N3 T01 M06
N4 G17 G90 G54 G00 X20 Y20
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G83 Z-30. R5 Q8000 F300
N8 G91 X38.6370 Y10.3527 K5
N9 G80 G00 Z100 M05
N10 G28 X0 Y0 Z0
N11 M30
Pattern of holes
FANUC INDIA FA & ROBOT
80
RECTANGULAR GRID PATTERN
DISTANCE OF FIRST HOLE
FROM REFERENCE = (20,30)
DISTANCE BETWEEN COLUMNS = 25
DISTANCE BETWEEN ROWS = 20
DIAMETER OF HOLES = 10 mm
Pattern of holes
PROGRAMMING EXAMPLE
O1016
N1 G21 G94
N2 G91 G28 X0 Y0 Z0
N3 T01 M06
N4 G17 G90 G54 G00 X20 Y30
N5 G43 H01 Z100
N6 M03 S1000 Z20
FANUC INDIA FA & ROBOT
81
N7 G99 G83 Z-30. R5 Q8000 F300
N8 G91 Y20 K6
N9 X25
N10 Y-20 K6
N11 X25
N12 Y20 K6
N13 X25
N14 Y-20 K6
N15 X25
N16 Y20 K6
N17 G80 G00 Z100 M05
N18 G28 X0 Y0 Z0
N30 M30
Pattern of holes
FANUC INDIA FA & ROBOT
82
CIRCLE OF HOLES PATTERNDistance of reference point in X axis from the WCS = 75
Distance of reference point in Y axis from the WCS = 60
Starting angle of the first hole from X axis = 30 deg.
Indexing angle between holes = 60, Number of holes = 6
Radius of the circle = 50mm, Diameter of holes = 8mm
1
2
3
4
5
6
Pattern of holes
FANUC INDIA FA & ROBOT
83
Hole # 1
X = 75 + 50 * cos30 = 118.30127
Y = 60 + 50 * sin30 = 85.0
Hole # 2
X = 75 + 50 * cos90 = 75.0
Y = 60 + 50 * sin90 = 110.0
Hole # 3
X = 75 + 50 * cos150 = 31.6987298
Y = 60 + 50 * sin150 = 85.0
Hole # 4
X = 75 + 50 * cos210 = 31.6987298
Y = 60 + 50* sin210 = 35.0
Hole # 5
X = 75 + 50 * cos270 = 75.0
Y = 60 + 50 * sin270 = 100.0
Hole # 6
X = 75 + 50 * cos330 = 118.30127
Y = 60 + 50* sin330 = 35.0
Pattern of holes
FANUC INDIA FA & ROBOT
84
O1017
N1 G91 G28 X0 Y0 Z0
N2 T03 M06
N3 G21
N4 G17 G90 G54 G00 X118.3012 Y85.0
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G99 G83 Z-30. R5 Q8000 F300
N8 X75.0 Y110.0
N9 X31.6987 Y85.0
N10 X31.6987 Y35.0
N11 X75.0 Y10
N12 X118.301 Y35.0
N13 G80 G00 Z100 M05
N14 G91 G28 X0 Y0 Z0
N15 M30
Pattern of holes
FANUC INDIA FA & ROBOT
85
CIRCLES OF HOLES USING POLAR SYSTEM
Distance of reference point in X axis from the WCS = 75
Distance of reference point in Y axis from the WCS = 60
Starting angle of the first hole from X axis = 30 deg.
Indexing angle between holes = 60, Number of holes = 6
Radius of the circle = 50mm, Diameter of holes = 8mm
1
2
3
4
5
6
Pattern of holes
FANUC INDIA FA & ROBOT
86
O1018
N1 G91 G28 X0 Y0 Z0
N2 T03 M06
N3 G21
N4 G17 G90 G54 G00 X75.0 Y60.0
N5 G43 H01 Z100
N6 M03 S1000 Z20
N7 G16; POLAR SYSTEM ON
N8 G99 G83 X50 Y30 Z-30. R5 Q8000 F300
N9 X50 Y90
N10 X50 Y150
N11 X50 Y210
N12 X50 Y270
N13 X50 Y330
N14 G15 ; POLAR SYSTEM OFF
N15 G80 G00 Z100 M05
N16 G91 G28 X0 Y0 Z0
N17 M30
Pattern of holes
FANUC INDIA FA & ROBOT
87
CUSTOM MACRO PROGRAMMING
Custom Macro programming
FANUC INDIA FA & ROBOT
• Part Program prepared using variables
• Arithmetic operations possible
• Conditional statements like GOTO , DO WHILE are used
• For developing user defined cycles
• Can be easily called from user program
Custom Macro
Custom Macro programming
FANUC INDIA FA & ROBOT
89
Macro call
Custom Macro programming
FANUC INDIA FA & ROBOT
Simple Macro Call
Custom Macro programming
FANUC INDIA FA & ROBOT
91Custom Macro programming
FANUC INDIA FA & ROBOT
92Custom Macro programming
FANUC INDIA FA & ROBOT
93Custom Macro programming
FANUC INDIA FA & ROBOT
• Once G66 is issued to specify a modal call a macro is
called after a block specifying movement along axes is
executed. This continues until G67 is issued to cancel a
modal call.
Model Macro Call- G66
Custom Macro programming
FANUC INDIA FA & ROBOT
95
G66
Custom Macro programming