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
BASIC ISO PART PROGRAMMING
14
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.
16
BASIC ISO PROGRAMMING
Tool number (T)
The "T" code identifies the tool position in the tool magazine.
17
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
18
BASIC ISO PROGRAMMING
G39 * Chamfer
19
BASIC ISO PROGRAMMING
G00 X Y G01 X Y
TP TP
(TP) (TP)
(SP) (SP)
… …
N80 G00 X500 Y300 N120 G01 X500 Y300 F400
… …
20
BASIC ISO PROGRAMMING
Preparatory functions or G-codes
Rapid traverse (G00) Linear interpolation (G01)
EXERCISE 1
= SP
21
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
… …
22
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
… …
23
BASIC ISO PROGRAMMING
EXERCISE 2 EXERCISE 3
SP SP
w w
EXERCISE 4 EXERCISE 5
SP SP
w w
24
BASIC ISO PROGRAMMING
Preparatory functions or G-codes
Clockwise circular interpolation (G02)
EXERCISE 6
SP
25
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
27
Profile Milling: BASIC ISO PROGRAMMING
%0606
N00 G54 D1 T1;
N01 G00 X0 Y0 Z5;
N02 M03 S1000 M08;
N03 G01 X0 Y0 Z-2 F50;
N04 G01 X70 Y0;
N05 G02 X90 Y0 U10;
N06 G01 X140 Y0;
N07 G03 X140 Y50 U25;
N08 G01 X80 Y50;
N09 G01 X50 Y80;
(Profile: Depth of cut: 2 mm)
N10 G01 X20 Y80;
N11 G01 X20 Y60;
N12 G03 X20 Y40 U10;
N13 G01 X20 Y20;
N14 G01 X0 Y0;
N15 G00 X0 Y0 Z5;
N16 M05;
N17 M02;
28
Part Programming-SINUMERIK System 810
M53 - M58 Mirror Functions
M17-End of Subroutine
29
Part Programming-SINUMERIK System 810
Mirror Images
31
Part Programming-SINUMERIK System 810
Mirror Images
L201
N00 G42 G00 X5 Y5 Z5
N02 G01 Z-10 F10
N03 X45 Y5
N04 G02 X85 Y5 U20
N05 G01 X125 Y5
N06 X125 Y125 Profile Milling
N07 X85 Y125
N08 G02 X45 Y125 U20
N09 G01 X5 Y125
N10 G01 X5 Y5
N11 G40 G00 Z5
N13 M17
32
Part Programming-SINUMERIK System 810
Mirror Images
M53 No mirror axis X
M54 Mirror axis X
L200
N01 L201
N02 M54 P1
N03 L201 Mirroring the X values
N04 M53 P1
N05 G00 Z5
N06 M17
33
Part Programming-SINUMERIK System 810
Mirror Images
%2875
N01 G54 D1 T1 M03 S1000
N05 L200
N06 M56 P1 Mirroring the Y
N07 L200 values
N08 M55 P1
N09 G00 Z5
N10 M30
34
Part Programming-SINUMERIK System 810
Mirror Images
%2875
N01 G54 D1 T1 M03 S1000
N05 L200
N06 M56 P1 Mirroring the Y R20
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.
36
BASIC ISO PROGRAMMING
Face milling
70
100
80
60
60
SP
40
Security
20
distance ~ 2 mm
20 40 60 80 100
N00 G54 T1 D1 ; Ø28mm end-mill, assign tool 1
value D1
N10 M06 ; Tool change action
N20 G00 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
37
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
38