Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
492 views

UNIT 7 - CNC - Lecture 3 - Programming

The document discusses CNC programming and codes. It provides information on preparatory codes like G codes for different motion types and M codes for miscellaneous functions. It describes proving a part program, motion statements, tool paths for different geometry, canned cycles for repetitive motions, subroutines, mirroring and repetitions. Diagrams and examples are given to illustrate linear, circular and tool movements along with drilling cycles.

Uploaded by

Rakshith
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
492 views

UNIT 7 - CNC - Lecture 3 - Programming

The document discusses CNC programming and codes. It provides information on preparatory codes like G codes for different motion types and M codes for miscellaneous functions. It describes proving a part program, motion statements, tool paths for different geometry, canned cycles for repetitive motions, subroutines, mirroring and repetitions. Diagrams and examples are given to illustrate linear, circular and tool movements along with drilling cycles.

Uploaded by

Rakshith
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

CNC Programming

Automated Programming Tool APT Language


Preparation of CNC programs and proving
them is first step to machine the part.
CNC programs are also called part programs.
There are two types of codes are used in CNC
programming:

preparatory codes (G Codes) GO Codes


miscellaneous codes (M codes)

CNC Programming
Proving a Part Program
Study the part
Identify the machine
tool(s)
Identify operations and
tooling
Determine process
parameters
Develop part program
Simulate tool path
Dry run
Cut single part

CNC Programming

CNC Programming
Motion Statements
G00 Linear Movement (rapid)
G01 Linear Movement (feed)
G02 Circular Movement (cw feed)
G03 Circular Movement (ccw feed)

CNC Programming
G00 Linear Movement (rapid)
Y
55

G00 X55 Y60

60

10

(0, 0)

24

CNC Programming

+Z

+
X
Tool at (25, 35)
G00 X0 Z35
G00 X0 Z0

CNC Programming
Initial Diameter = 10
mm
Final Diameter = 6 mm
Depth of cut = 1 mm
Width of cut = 8 mm

G00 X4 Z1
G01 Z-8
G00 X5 Z1
G00 X 3
G01 Z-8
G00 X4 Z1

CNC Programming
(0, 55)
Y

30
35

18
X

G01
G01
G01
G01
G01
G01
G01

X30 Y55
X30 Y20
X48 Y20
X48 Y0
X106 Y0
X106 Y28
X72 Y28

34
28

20
58

G01
G01
G01
G01
G01
G01
G01

X30
Y20
X48
Y0
X106
Y28
X72

G91
G01
G01
G01
G01
G01
G01
G01

X30
Y-35
X18
Y-20
X58
Y28
X-34

CNC Programming
Preparatory NC Codes
G00
G01
G02
G03
G70
G71
G94
G95
G96
G97
G90
G91

Linear Movement (rapid)


Linear Movement (feed)
Circular Movement (cw)
Circular Movement (ccw)
Inch units
Metric units
Feed in mm/min
Feed in mm/rev
Speed in mm/min
Speed in RPM
Absolute dimensions
incremental dimensions

G17 XY Plane
G18 ZX Plane
G19 YZ Plane

CNC Programming
G02 Circular Movement (Clockwise)
Y

G02

X34 Y0 I0 J-24
G02 X34 Y0 R24

10
24

(0, 0)

CNC Programming
G02 Circular Movement (Clockwise)

Full Circles with IJK


or R?

CNC Programming
Miscellaneous NC Codes
M02
M03
M04
M05
M06
M07
M09

End of program
Clockwise rotation of spindle
Counter-clockwise rotation of spindle
Stop rotation of main spindle
Tool change
Coolant on
Coolant of

CNC Programming
N0010
N0011
N0012
N0013
N0014
N0015

G90
G01
G01
G91
G01
G01

X1 Y2
X2 Y2
X1
X1 Y1

(4,3)

(1,2
)

(0,0)

(2,2
)

(3,2)

CNC Programming

(400, 500,
50)
Linear Movement
(rapid)

All dimensions in mm
Depth of hole = 4 mm
Hole Diameter = 5 mm
60

10
0

80
50

20

30
40

15

80

G00
G01
Linear Movement (feed)
G02
Circular Movement (cw)
G03
Circular Movement
(ccw)
G70
Inch units
G71
Metric units
G94
Feed in mm/min
G95
Feed in mm/rev
G96
Speed in mm/min
G97
Speed in RPM
G90
Absolute dimensions
G91
incremental dimensions
G17 XY Plane
G18 ZX Plane
G19 YZ Plane
M02
End of program
M03
Clockwise rotation of
spindle
M04
Counter-clockwise
rotation of spindle
M05 Stop rotation of main
spindle
M06 Tool change

CNC Programming
N10 G71 G90 G94 G97 M03 M07 S500
N20 G01 X90 Y10 F200
N30 G02 X90 Y10 R20
N40 G00 X100 Y10
N50 G00 X80 Y0
Why N10, N20, N30 & not N11,
N60 G91
N12, N13 etc?
N70 G01 X90 Y120
N80 G03 X40 Y0 R15
N90 G00 X20 Y20
N100 M05 M09
N110 M02

CNC Programming
Depth of cut = 3 mm

50

31

40

60

50

60

CNC Programming
Part
profile

Cutter Radius Compensation

Tool Path

CNC Programming
Cutter Radius Compensation

G42 Cutter Radius compensation Right


Cutting tool is on the RIGHT side of the part in the
direction of movement

CNC Programming
Cutter Radius Compensation

G41 Cutter Radius compensation Left


Cutting tool is on the LEFT side of the part in the direction
of movement

CNC Programming
Cutter Radius Compensation
G40 Cutter Radius compensation CANCEL

G41 Cutter Radius compensation Left


Cutting tool is on the LEFT side of the part in the direction
of movement
G42 Cutter Radius compensation Right
Cutting tool is on the RIGHT side of the part in the
direction of movement

CNC Programming

CNC Programming

CNC Programming
MODAL
Modal code is efective until
cancelled by another
command

NON MODAL

Examples:

Non Modal code is


efective only for a
single block or line of
code
Examples:

G40
G41
G91
G71

G01
G02
G00
G03

CNC Programming
Mirror Images
Fanuc Controller

MAHO Controller

M20 cancellation of mirroring image

G73 X-1 Mirror image on X axis

M21 Mirror image on X axis

G73 X1 Mirror image on X axis


cancel

M22 Mirror image on Y axis


M23 Mirror image on Z axis

G73 Y-1 Mirror image on Y axis


G73 Y1 Mirror image on Y axis
cancel
G73 Z-1 Mirror image on Z axis
G73 Z1 Mirror image on Z axis
cancel

CNC Programming
Mirror Images
M21 Mirror image on X axisY
(20,10
)

(-20,5)

(5,10)

(5,5)

(5,10
)

(5,5
)

(20,1
0)

(20,
5)
X

All X values are


Negated

CNC Programming
Mirror Images
M22 Mirror image on Y axisY
(5,10
)

(20,1
0)

(5,5
)
(5,-5)

(20,
X
5)
(20,5)

All Y values are


Negated
(5,-10)

20,10)

CNC Programming
Repetitions
G25 N-G25 N-- L--

N10 G71 G90 G94 G97 M03 M07


S500
N20 G01 X90 Y10 F200
N30 G02 X90 Y10 R20
N40 G00 X100 Y10
N50 G00 X80 Y0
N60 G25 N20.50
N70 G91
N80 G25 L2 N20.50
N90 M02 M17

CNC Programming
Subroutines
A SET OF CODES WITH A DIFFERENT NAME WRITTEN AT THE END OF
THE MAIN CODE

P0001
N5 G90 G71 G17
N10 G0 X20 Y20
N15 Z5
N20 PPP20
N 25 G0 X60 Y20
N30 PPP 20
N35 G0 X60 Y60
N40 PPP20
N45 G0 X20 Y60
N50 PPP20
N55 G0 Z100
N60 M02

PPP20
N5 G91
N10 G1 Z-2 F200
N15 X20
N20 Y20
N25 X-20
N30 Y-20
N35 Z5
N40 G90

CNC Programming
Mirror Images

CNC Programming
Canned Cycles
Motion repeated a number of times
Common motions irrespective of the position of the
tool
Example: Drilling
Position the drill bit at the center of the hole and a
little above the surface Rapid movement
Move to the required depth in feed motion
Return to the starting position

CNC Programming
Canned Cycles

G81 Drilling
G82 Counter sinking
G82 Deep Hole drilling
G84 Tapping
G85,86,87,88,89 Boring
L95 Rough Turning
L97 Thread Cutting

CNC Programming
Canned Cycles

G81 - Drilling Cycle


G81 X Y Z R
X, Y (x,y) position of the center of the hole
Z - The depth up to which the hole is to be
drilled
R Position of the clearance plane (+z axis)
R

CNC Programming
G81 - Drilling
Cycles

N10 G81 X35 Y25 Z-10 R5


F100

50

N20 X 50 Y 80

80
80

N30 X80 Y40

35

N40 G80 X0 Y0 Z10


25

40

G80 Cancel Drilling


cycle

You might also like