basic cnc programming Milling

95
FANUC INDIA FA & ROBOT 1 BASIC PROGRAMMING OF CNC MILLING MACHINE
  • Upload

    -
  • Category

    Documents

  • view

    218
  • download

    47

description

BASIC PROGRAMMING OF CNC MILLING MACHINE

Transcript of basic cnc programming Milling

Page 1: basic cnc programming Milling

FANUC INDIA FA & ROBOT

1

BASIC PROGRAMMING OF CNC MILLING MACHINE

Page 2: basic cnc programming Milling

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

Page 3: basic cnc programming Milling

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

Page 4: basic cnc programming Milling

FANUC INDIA FA & ROBOT

4

General Co-ordinate system

General coordinate system

Page 5: basic cnc programming Milling

FANUC INDIA FA & ROBOT

5Designation of machine axis

Designation of machine axis

Page 6: basic cnc programming Milling

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

Page 7: basic cnc programming Milling

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

Page 8: basic cnc programming Milling

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

Page 9: basic cnc programming Milling

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

Page 10: basic cnc programming Milling

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

Page 11: basic cnc programming Milling

FANUC INDIA FA & ROBOT

11

G54 Workpiece coordinate system 1G55 Workpiece coordinate system 2G56 Workpiece coordinate system 3G57 Workpiece coordinate system 4G58 Workpiece coordinate system 5G59 Workpiece coordinate system 6

Work piece coordinate system - selection

Work piece coordinate system selection

Page 12: basic cnc programming Milling

FANUC INDIA FA & ROBOT

12

Work piece coordinate system Selection

Work piece coordinate system selection

Page 13: basic cnc programming Milling

FANUC INDIA FA & ROBOT

13

Structure of Program

Structure of Program

Page 14: basic cnc programming Milling

FANUC INDIA FA & ROBOT

14Structure of Program

Page 15: basic cnc programming Milling

FANUC INDIA FA & ROBOT

15Structure of Program

Page 16: basic cnc programming Milling

FANUC INDIA FA & ROBOT

16

Block

Structure of Program

Page 17: basic cnc programming Milling

FANUC INDIA FA & ROBOT

17

- Preparatory function- Tool movement related functions

Basic G codes

Basic G codes

Page 18: basic cnc programming Milling

FANUC INDIA FA & ROBOT

18

G94 - Feed per Minute

Basic G codes

Page 19: basic cnc programming Milling

FANUC INDIA FA & ROBOT

19

G95 - Feed per revolution

Basic G codes

Page 20: basic cnc programming Milling

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

Page 21: basic cnc programming Milling

FANUC INDIA FA & ROBOT

21

Absolute and incremental programming

Basic G codes

Page 22: basic cnc programming Milling

FANUC INDIA FA & ROBOT

22

Tool movement in a straight line

Basic G codes

Page 23: basic cnc programming Milling

FANUC INDIA FA & ROBOT

23

Tool movement in a circular path

Basic G codes

Page 24: basic cnc programming Milling

FANUC INDIA FA & ROBOT

24

Direction of circular interpolation

Basic G codes

Page 25: basic cnc programming Milling

FANUC INDIA FA & ROBOT

25

ijk values

Basic G codes

Page 26: basic cnc programming Milling

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

Page 27: basic cnc programming Milling

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 followsG44 H01

H01 – here 01 specifies the address where the difference of tool will be mentioned

Tool length compensation

Page 28: basic cnc programming Milling

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

Page 29: basic cnc programming Milling

FANUC INDIA FA & ROBOT

29

G41 - Cutter radius compensation leftG42 - Cutter radius compensation rightG40 - 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

Page 30: basic cnc programming Milling

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

Page 31: basic cnc programming Milling

FANUC INDIA FA & ROBOT

31

Cutter radius compensation

Cutter radius compensation

Page 32: basic cnc programming Milling

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

Page 33: basic cnc programming Milling

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

Page 34: basic cnc programming Milling

FANUC INDIA FA & ROBOT

34

Operations performed in machining centre

Side cuttingHole machiningFace cutting

Operations in machining centre

Page 35: basic cnc programming Milling

FANUC INDIA FA & ROBOT

35

G54

SQ 150

SQ 200

thickness 20mm

1

3

4

2

Programming Examples

Programming Examples

Page 36: basic cnc programming Milling

FANUC INDIA FA & ROBOT

36

Programming example

Making 150 mm* 150 mm square for a depth of 5mm in a given Billet

AssumptionsWork offset = G54Tool 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

Page 37: basic cnc programming Milling

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

Page 38: basic cnc programming Milling

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

Page 39: basic cnc programming Milling

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

Page 40: basic cnc programming Milling

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

Page 41: basic cnc programming Milling

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

Page 42: basic cnc programming Milling

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 indicates No. 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

Page 43: basic cnc programming Milling

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

Page 44: basic cnc programming Milling

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

Page 45: basic cnc programming Milling

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 indicates No. 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

Page 46: basic cnc programming Milling

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

Page 47: basic cnc programming Milling

FANUC INDIA FA & ROBOT

47

Canned cycles - Drilling

Canned cycles - Drilling

Page 48: basic cnc programming Milling

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

Page 49: basic cnc programming Milling

FANUC INDIA FA & ROBOT

49

BLANK SIZE 100*100*20DIA. 8, FIVE HOLESHOLE1 (20,20)HOLE2 (20,80)HOLE3 (80,80)HOLE4 (80,20)HOLE5 (50,50)

Programming Example

Canned cycles - Drilling

Page 50: basic cnc programming Milling

FANUC INDIA FA & ROBOT

50

PROGRAMMING EXAMPLE

O1005N1 G91 G28 X0 Y0 Z0N2 T01 M06N3 G21N4 G17 G90 G54 G00 X20 Y20N5 G43 H01 Z100N6 M03 S1000 Z20N7 G99 G81 Z-4. R5 F300N8 X80N9 Y80N10 X20N11 X50 Y50N12 G80 G00 Z100N13 G91 G28 X0 Y0 Z0N14 M05N15 M30

Canned cycles - Drilling

Page 51: basic cnc programming Milling

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

Page 52: basic cnc programming Milling

FANUC INDIA FA & ROBOT

52

BLANK SIZE 100*100*20DIA. 8, FIVE HOLESHOLE1 (20,20)HOLE2 (20,80)HOLE3 (80,80)HOLE4 (80,20)HOLE5 (50,50)

PROGRAMMING EXAMPLE

Canned cycles - Drilling

Page 53: basic cnc programming Milling

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

Page 54: basic cnc programming Milling

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

Page 55: basic cnc programming Milling

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

Page 56: basic cnc programming Milling

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*20DIA. 8, FIVE HOLESHOLE1 (20,20)HOLE2 (20,80)HOLE3 (80,80)HOLE4 (80,20)HOLE5 (50,50)

Programming Example

Page 57: basic cnc programming Milling

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

Page 58: basic cnc programming Milling

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

Page 59: basic cnc programming Milling

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

Page 60: basic cnc programming Milling

FANUC INDIA FA & ROBOT

60

BLANK SIZE 100*100*20DIA. 8, FIVE HOLESHOLE1 (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.

Page 61: basic cnc programming Milling

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

Page 62: basic cnc programming Milling

FANUC INDIA FA & ROBOT

62

G85 BORING CYCLESTEP 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

Page 63: basic cnc programming Milling

FANUC INDIA FA & ROBOT

63

DIMNSION OF BLANK 100*100*20HOLE DIA. 10 mmHOLE (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

Page 64: basic cnc programming Milling

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

Page 65: basic cnc programming Milling

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)

Page 66: basic cnc programming Milling

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

Page 67: basic cnc programming Milling

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*20HOLE (50,50)

PROGRAMMING EXAMPLE

Page 68: basic cnc programming Milling

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 operator switches to manual operation mode and perform a manual task, then switches back to memory 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

Page 69: basic cnc programming Milling

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

Page 70: basic cnc programming Milling

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

Page 71: basic cnc programming Milling

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

Page 72: basic cnc programming Milling

FANUC INDIA FA & ROBOT

72

WHEN TO USE THIS CYCLEFor 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*20HOLE DIA. 10 mmHOLE (50,50)

PROGRAMMING EXAMPLE

Page 73: basic cnc programming Milling

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

Page 74: basic cnc programming Milling

FANUC INDIA FA & ROBOT

74

PATTERN OF HOLES

RANDOM HOLE PATTERN

BLANK SIZE = 100*100*20DIA. 8, FIVE HOLESHOLE1 (28,16)HOLE2 (60,32)HOLE3 (88,40)HOLE4 (104,48)

Pattern of holes

Page 75: basic cnc programming Milling

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

Page 76: basic cnc programming Milling

FANUC INDIA FA & ROBOT

76

STRAIGHT ROW HOLE PATTERNFirst 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

Page 77: basic cnc programming Milling

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

Page 78: basic cnc programming Milling

FANUC INDIA FA & ROBOT

78

PATTERN OF HOLES IN AN INCLINED LINE

ANGLE OF THE INCLINED LINE WITH X AXIS = 15DISTANCE BETWEEN HOLES = 40FIRST 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.63703305Y = 40 * sin15 = 10.3527618

Pattern of holes

Page 79: basic cnc programming Milling

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

Page 80: basic cnc programming Milling

FANUC INDIA FA & ROBOT

80

RECTANGULAR GRID PATTERN

DISTANCE OF FIRST HOLEFROM REFERENCE = (20,30)DISTANCE BETWEEN COLUMNS = 25DISTANCE BETWEEN ROWS = 20DIAMETER 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

Page 81: basic cnc programming Milling

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

Page 82: basic cnc programming Milling

FANUC INDIA FA & ROBOT

82

CIRCLE OF HOLES PATTERNDistance of reference point in X axis from the WCS = 75Distance of reference point in Y axis from the WCS = 60Starting angle of the first hole from X axis = 30 deg.Indexing angle between holes = 60, Number of holes = 6Radius of the circle = 50mm, Diameter of holes = 8mm

1

2

3

4

5

6

Pattern of holes

Page 83: basic cnc programming Milling

FANUC INDIA FA & ROBOT

83

Hole # 1X = 75 + 50 * cos30 = 118.30127 Y = 60 + 50 * sin30 = 85.0

Hole # 2X = 75 + 50 * cos90 = 75.0Y = 60 + 50 * sin90 = 110.0

Hole # 3X = 75 + 50 * cos150 = 31.6987298Y = 60 + 50 * sin150 = 85.0

Hole # 4X = 75 + 50 * cos210 = 31.6987298 Y = 60 + 50* sin210 = 35.0

Hole # 5X = 75 + 50 * cos270 = 75.0 Y = 60 + 50 * sin270 = 100.0

Hole # 6X = 75 + 50 * cos330 = 118.30127 Y = 60 + 50* sin330 = 35.0Pattern of holes

Page 84: basic cnc programming Milling

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

Page 85: basic cnc programming Milling

FANUC INDIA FA & ROBOT

85

CIRCLES OF HOLES USING POLAR SYSTEM

Distance of reference point in X axis from the WCS = 75Distance of reference point in Y axis from the WCS = 60Starting angle of the first hole from X axis = 30 deg.Indexing angle between holes = 60, Number of holes = 6Radius of the circle = 50mm, Diameter of holes = 8mm

1

2

3

4

5

6

Pattern of holes

Page 86: basic cnc programming Milling

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

Page 87: basic cnc programming Milling

FANUC INDIA FA & ROBOT

87

CUSTOM MACRO PROGRAMMING

Custom Macro programming

Page 88: basic cnc programming Milling

FANUC INDIA FA & ROBOT

• Part Program prepared using variablesPart Program prepared using variables

• Arithmetic operations possibleArithmetic operations possible

• Conditional statements like GOTO , DO WHILE are usedConditional statements like GOTO , DO WHILE are used

• For developing user defined cyclesFor developing user defined cycles

• Can be easily called from user programCan be easily called from user program

Custom Macro

Custom Macro programming

Page 89: basic cnc programming Milling

FANUC INDIA FA & ROBOT

89

Macro call

Custom Macro programming

Page 90: basic cnc programming Milling

FANUC INDIA FA & ROBOT

Simple Macro Call

Custom Macro programming

Page 91: basic cnc programming Milling

FANUC INDIA FA & ROBOT

91Custom Macro programming

Page 92: basic cnc programming Milling

FANUC INDIA FA & ROBOT

92Custom Macro programming

Page 93: basic cnc programming Milling

FANUC INDIA FA & ROBOT

93Custom Macro programming

Page 94: basic cnc programming Milling

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

Page 95: basic cnc programming Milling

FANUC INDIA FA & ROBOT

95

G66

Custom Macro programming