Lec. 05 06 07 08 Part Programming
Lec. 05 06 07 08 Part Programming
In CNC (Computer Numerical Control), the instructions are stored as a program in a micro-
computer attached to the machine.
CNC APPLICATIONS
• Machining
Turning ~ Lathes, Turning Centre
Milling ~ Machining Centres
• Forming
➢ 2D
Plasma and Laser Cutting
Blanking and punching
➢ 3D
Rapid Prototyping CNC Vertical Machining Centre 2
INTRODUCTION
Programming languages
First systems developed and use a programming language similar to
FORTRAN or BASIC
Automatically Programmed Tools (APT) and its many variants
COMPACT II
CNC manufacturers
3
CNC Controller
The software which controls the program in different interface languages is known as the
controller.
FANUC
SINUMERIK
HEIDENHAIN
MAZATROL
MAZAK
4
AXIS NOMENCLATURE
5
CNC-Introduction-Axis nomenclature
6
CNC-Introduction-Axis nomenclature
7
CNC-Introduction-Multi-axis nomenclature
8
AXIS NOMENCLATURE
A+
C+
VIDO VIDEO
9
AXIS NOMENCLATURE
Reference systems
M - Machine Zero or home: This is set by the manufacturer as the origin of the coordinate
system of the machine.
W -Part zero or point of origin of the part: This is the origin point that is set for
programming the measurements of the part. It can be freely selected by the programmer.
10
AXIS NOMENCLATURE
Reference systems
11
CNC MACHINE SETUP AND OPERATION
12
CNC-REFERENCE SYSTEMS
Machine Reference (R) setting T1 T2 T3 T4
R R R R
TOOL LENGTH
COMPENSATION OFF
G44 L1 L2 L3 L4
OFFSET TABLE
TOOL LENGTH
COMPENSATION ON
G43
R R R R
13
CNC-REFERENCE SYSTEMS
Machine Reference (R) setting
R R R R
W
L1 < 0
W L3 < 0 L4 = 0
L2 > 0
Low accuracy.
Time consuming method.
Only tool length (L) values are measured.
Tool is rotating and thus, part or referencing block gets marked.
14
CNC_Reference systems_Machine reference setting_Tool on the workpiece
15
CNC-REFERENCE SYSTEMS
Machine Reference (R) setting
L1=0 L2<0
VIDEO L1
L2
z1
z2
Good accuracy.
Time consuming method. 50 50
M
Only tool length (L) values are measured.
L1= z1-50 L2= z2-50
Part or referencing block does not get marked. TOOL LENGTH MEASUREMENT
16
CNC-REFERENCE SYSTEMS
Part zero (W) setting
Vise stop
Clamps (with or without centering pins) Vise (with or without vise stop)
17
CNC-REFERENCE SYSTEMS
Part zero (W) setting
VISE Z VISE Z
Y Y
X
X
Y Y
Y Y
X Z
X Z
Symmetry
X-Y axis part symmetry Stationary chuck & Y axis part symmetry
18
CNC_Reference systems_Part zero setting_Using the tool
19
CNC-REFERENCE SYSTEMS
Part zero (W) setting
Z
VISE CLAMP
Y
X
X
Z
X Z
X
Stationary chuck & left lower part Stationary chuck & Y axis part symmetry
20
CNC-REFERENCE SYSTEMS
Part zero (W) setting
VIDEO
Low accuracy. Low accuracy.
Tool is rotating and thus, part gets VIDEO
marked.
X Optical edge finder similar
Y DATUM SETTING X
DATUM SETTING
Z Y
21
CNC-REFERENCE SYSTEMS
Part zero (W) setting
High accuracy.
X
Y DATUM SETTING
VIDEO VIDEO Z
22
CNC-REFERENCE SYSTEMS
Part zero (W) setting
23
BASIC ISO PART PROGRAMMING
24
BASIC ISO PROGRAMMING
Block structure
N**** G** X****.*** Y****.*** Z****.*** A****.*** B****.*** C****.*** F****.** S****.**
Speed function
Block identification
Identifies the block of information.
The programmed F is effective working in linear The maximum S value is limited by the machine
(G01) or circular (G02, G03). parameters.
26
BASIC ISO PROGRAMMING
Tool number (T)
The "T" code identifies the tool position in the tool magazine.
27
BASIC ISO PROGRAMMING
M functions DESCRIPTION
M00 Program STOP / Spindle STOP / Coolant OFF
M03 Spindle ON clockwise
M04 Spindle ON counterclockwise
M05 Spindle STOP
M06 Tool change
M08 Coolant ON
M09 Coolant OFF
M30 End of program
28
BASIC ISO PROGRAMMING
G39 * Chamfer
29
BASIC ISO PROGRAMMING
G00 X Y G01 X Y
TP TP
(TP) (TP)
(SP) (SP)
… …
N80 G00 X500 Y300 N120 G01 X500 Y300 F400
… …
30
BASIC ISO PROGRAMMING
Preparatory functions or G-codes
Rapid traverse (G00) Linear interpolation (G01)
EXERCISE 1
= SP
31
BASIC ISO PROGRAMMING
Preparatory functions or G-codes
Clockwise circular interpolation (G02)
G02 X Y I J G03 X Y I J
CC
TP TP
J J
CC
SP I I
SP
… …
N60 G02 X300 Y300 I200 J0 N60 G03 X300 Y300 I0 J200
… …
32
BASIC ISO PROGRAMMING
G02 X Y R G03 X Y R
TP
SP
TP
SP
… …
R+ N40 G02 X400 Y150 R150 R+ N40 G03 X400 Y300 R150
… …
… …
N40 G02 X400 Y150 R-150 N40 G03 X400 Y300 R-150
… …
33
BASIC ISO PROGRAMMING
EXERCISE 2 EXERCISE 3
SP SP
w w
EXERCISE 4 EXERCISE 5
SP SP
w w
34
BASIC ISO PROGRAMMING
Preparatory functions or G-codes
Clockwise circular interpolation (G02)
EXERCISE 6
SP
35
BASIC ISO PROGRAMMING
Preparatory functions or G-codes
Absolute programming (G90)
Incremental programming (G91)
G91: The positioning data corresponds to the distance to be travelled from the point where the
tool is situated.
= SP
EXERCISE 7 EXERCISE 8
SP
SP
37
BASIC ISO PROGRAMMING
The CNC automatically calculates the path the tool should follow based on the contour of the part
and the tool radius value stored in the tool offset table.
38
BASIC ISO PROGRAMMING
G36 R G39 R
It rounds a corner with a determined radius, It chamfers corners between two straight lines,
without having to calculate the center nor the without having to calculate intersection points.
start and end points of the arc. Function G39 is not modal.
Function G36 is not modal.
… …
N60 G01 G36 R5 X250 Y450 F400 N60 G01 G39 R15 X350 Y600 F400
N70 G01 X400 Y0 N70 G01 X500 Y0
… …
39
BASIC ISO PROGRAMMING
100
80
60
60
SP
40
Security
20
distance ~ 2 mm
20 40 60 80 100
N00 T1 D1 ; Ø28mm end-mill, assign tool 1 value D1
N10 M06 ; Tool change action
N20 G00 G43 X14 Y40 Z100 F400 S1500 M03
N30 G00 Z58
N40 G01 X116 Y40
N50 G00 X116 Y54
N60 G01 X14 Y54
N70 G00 X14 Y68
N80 G01 X116 Y68
N90 G00 X116 Y82
N100 G01 X14 Y82
N110 G00 X14 Y96
N120 G01 X116 Y96
N130 G00 Z100
N130 M30 ; End of program
40
BASIC ISO PROGRAMMING
Tool entry & exit should always be perpendicular to the workpiece contour.
Tool entry & exit should be avoided to be from a workpiece edge may produce burr.
SP G41
…
22.5
30 N50 G01 G41 X77.5 Y70 F400
N60 G01 X100 Y70
70 • N70 G01
N80 G03
X100 Y60
X85 Y45 I0 J-15
60 N90 G02 X70 Y30 I-15 J0
N100 G01 X50 Y30
45 N110 G01 X20 Y20
N120 G01 X25 Y70
30 N130 G03 X55 Y70 I15 J0
N140 G01 X77.5 Y70
20
N150 G01 G40 X77.5 Y100
…
20 25 50 55 70 85 100
41