0% found this document useful (0 votes)
168 views93 pages

CH 3-Part II - CNC Machine Tools

Here is the manual part program for the given process: O0001 (Program name) T0101 (Tool call for facing tool) S500 M03 (Spindle speed 500rpm) G00 X100 Z100 (Rapid positioning) G01 Z0 F0.2 (Facing cut) G00 Z100 (Retract tool) T0202 (Tool call for turning tool) G00 X50 Z50 (Positioning for turning) G01 Z-50 F0.3 (Turning cut) G00 X100 Z100 (Retract tool) M30 (End program) This program performs facing operation followed by turning operation for the given

Uploaded by

Ashenafi Dress
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views93 pages

CH 3-Part II - CNC Machine Tools

Here is the manual part program for the given process: O0001 (Program name) T0101 (Tool call for facing tool) S500 M03 (Spindle speed 500rpm) G00 X100 Z100 (Rapid positioning) G01 Z0 F0.2 (Facing cut) G00 Z100 (Retract tool) T0202 (Tool call for turning tool) G00 X50 Z50 (Positioning for turning) G01 Z-50 F0.3 (Turning cut) G00 X100 Z100 (Retract tool) M30 (End program) This program performs facing operation followed by turning operation for the given

Uploaded by

Ashenafi Dress
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 93

CNC Machine Tool System

-
Manual NC Part
Programming

April 2020

1
1. Manual NC Part Programming
1.1. Programming fundamentals
a. Coordinates systems and references
points
 Part programming requires establishment of some
reference points.
 Three reference points are either set by
manufacturer or user.
i. Machine Zero (machine coordinate system)
 Its is a fixed point set by the machine tool
2
Cont’d…
ii. Program Origin
 It is also called home position of the tool.
 It is point from where the tool starts for its motion while executing a program
and returns back at the end of the cycle.
 This can be any point within the workspace of the tool which is sufficiently
away from the part.
 In case of CNC lathe, it is a point where tool change is carried out.

iii. Part Origin (work piece coordinating systems)


 It can be set at any point inside the machine's electronic grid system.
 Establishing the part origin is also known as zero shift, work shift, floating
zero or datum.
 Usually part origin needs to be defined for each new setup.
3
Cont’d…
 Generally, Z axis of the workpiece coordinate system coincides
with the spindle axis.
 The programmer use this point as a base to write the intended
movement of the tooling.

4
1.2: Positioning Cont’d…
The way of specifying
coordinate values of path’s
end point or target position in
programming are 3 in kinds:

a. Absolute programming
 All references are made
to the origin of the
coordinate system.
 X/Z axis absolute
coordinate values are
presented by X--, Z— 5
2. Incremental programming
 It uses the preceding point in a sequence of points as a
reference.
 X/Z axis incremental coordinate values are presented by U--, W–

3. Compound programming
 Uses the absolute programming and incremental program
together.
 Specified by X--,W-- or U--, Z-- 6
Ex. 1: Define the coordinates of points p0-p6 both in
absolute & incremental mode.

7
Soln: Cont’d…

G90 G91
Absolute X Y Increment X Y

P0 X0 Y0 P0 X0 Y0
P0-P1 X-20 Y-20 P0-P1 X-20 Y-20

P0-P2 X12 Y-20 P1-P2 X32 Y0


P0-P3 X20 Y-12 P2-P3 X8 Y8

P0-P4 X20 Y14 P3-P4 X0 Y26


P0-P5 X12 Y20 P4-P5 X-8 Y6
P0-P6 X-20 Y20 P5-P6 X-32 Y0

8
Example 2

9
1.3. Interpolation Methods
 Interpolation is defined as a planar or three dimensional
contour formed by path of 2 or multiple axes moving at the
same time.
 Here four methods are discussed:
 Linear interpolation: Straight line between two points
in space.
 Circular interpolation: Circular arc defined by starting
point, end point, center or radius, and direction.
 Helical interpolation: Circular plus linear motion.
 Parabolic and cubic interpolation: Free form curves
using higher order equations.
10
1.4. Structure of NC program
Cont’d…
 A program consists of a sequence of blocks, beginning with
“OXXXX” (program name) and ending with “%”; a block
begins with block number and ends with “;”.
See the general structure of program as follows:

 A CNC program consists of blocks, words and address. 12


a. Block
Cont’d…
 It’s a command given to the control unit.
 A block is composed of one or more words.
b. Word
 It is composed of an identification letter and several
numerals. example: the command for a feed rate of
200mm/min is F200.
c. Address
 It’s the identification letter at the beginning of each word.

13
1.4.1: Explanation of Words
1. Sequence number (N address):
 Its used to identify the block and its always placed at the
beginning of the block.
 The sequence number need not to be consecutive.

2. Coordinate word (X/Y/Z Address)


 It specifies the target point of the tool movement (absolute
dimension system) or the distance to be moved (incremental
dimension)
 The word is composed of the address of the axis to be moved
and the value and direction of the movement.
3. Parameter for circular interpolation (I/J/K address)
 It specify the distance measured from the start point of the
arc to the centre. 14
4. Preparatory function (G address)
 It determines how the tool is to move to the
programmed target. The most common G codes are listed
below

15
5. Spindle function (S Address)
 The spindle speed is commanded under an S address and is always in
revolution per minute.
 The following table gives the surface cutting speeds for some common
materials:

6. Feed function (F Address)


 The unit may be in mm/min (in the case of milling machine) or in
mm/rev (in the case of turning machine).
 The following table gives the chip load per tooth of milling cutters
cutting some common materials:

16
7. Tool Function (T Address)
 The selection of tool is commanded under a T address.
8. Miscellaneous functions
 It’s a function programmed to control the machine operation
other than coordinate movement.
 The most common M functions are as follows:

17
2: Manual Part Programming For NC Lathe
2.1: G codes(preparatory functions)
 G00 (Positioning)
 Each axes moves as much as commanded data in rapid feed
rate.
 Command Format: G00 X(U)__Z(W)__

Absolute programming
G00 X150.0 Z100.0
X200.0 Z200.0
Incremental
programming
G00 U150.0 W100.0
18
Example:

N100 G00 X25 Z5;

19
 G01 (Linear interpolation)
 Each axes moves straightly as much as commanded data in
commanded rate.
 Command Format: G01 X(U)___ Z(W)___ F___

Absolute programming
G01 X150.0 Z100.0 F0.2;
X200.0 Z200.0;
Incremental programming
G01 U150.0 W100.0 F0.2
U50.0 W100.0
20
Example 1:
N100 G01 X25.0 Z-30.0 F0.2

21
Example 2: Cutting path from Φ40 to Φ60

Absolute programming
G01 X60 Z7 F0.2;
Incremental programming
G01 U20 W-25F0.2;
Compound programming
G01 X60 W-25F0.2 ;
Compound programming
G01 U20 Z7 F0.2 ;

22
 Circular interpolation: G02 & G03
Command format:

Command function:
 G02 movement path is clockwise arc from starting point to end
point.
 G03 movement path is counterclockwise arc from starting point
to end point.
 I = Coordinates of center point – that of starting point in X
direction;
 K = Coordinates of center point – that of starting point in Z
direction.
23
 Command the path

G03 path
G02 path

24
Example 1:

Absolute programming
G03 X63.06 Z-20.0 R19.26 F0.2 ;
Incremental programming
G03 U17.81 W-20.0 R19.26 F0.2 ;
Absolute programming
G03 X63.06 Z-20.0 I17.68 K-6.37 F0.2;
Incremental programming
G03 U17.81 W-20.0 I17.68 K-6.37 F0.2;

25
Example 2: Write a manual part program to generate the ff profile.

O0001
G21 M03 S200 ;
G00 X0 Z3.0 M08 ;
G01 Z0 F0.2;
G03 X20.0 Z-10.0 R10.0;
G01 Z-50.0;
G02 X100.0 Z-74.385 R45.0;
G01 Z-114.385;
G00 X200.0 Z200.0 M05 M09;
M30;

26
Example 3:
Process: Facing process, turning
process
Dimension: ø105 x 86L
Material: mild steel

DOC for stock removal


2-3 mm
DOC for finishing
1mm

Condition of using tool


tool Process type
T01 Stock removal
facing
T02 finishing
T03 Stock removal
turning 27
T04 finishing
M06 Tool change
> The tool change command typically has the tool
number and a tool change command.
> When the command is executed, the tool changer
causes the commanded tool to come to the spindle.
Format:
 M06Taa
 aa is the tool number
 M06 is the tool change command.
 G04 (Dwell)
 Command format: G04 P__ ; or
G04 X__ ; or
G04 U__ ;
 Command function:
 each axis stops the motion, the modal of G commands and the reserved
data, state are not changed, and execute the next block after dwelling
the defined time.
 G04 is non-modal.
 the dwell value is programmed using the address letters X/U (time in
seconds) or P (time in 1/1000 seconds)
 Ex. G04 X1.5; This command is read perform a dwell of 1.5 seconds.
G04 P2500; This command is ready to perform a dwell of 2.5
seconds. 29
 G20/G21 (imperial/metric data input)
 The machine controller can be programmed in either Imperial (inch) unit
input (G20) or Metric (millimeter) unit input (G21).

 G28 (Reference automatic return)


 Command format: G28 X(u) Z(w)
 By command, commanded axis automatically returns to the reference.
 G32 (Thread cycle)
 Command format: G32 Z(w) F ; or
X(u) Z(w) F ;
 G32 is applied to only single block and its modal.
 Values of over travel δ1 and δ2 can be calculated as:

 1  3 . 6 * L * n 1800 where
L = Lead of thread
 2  L * n 1800
30
n = rev/min of spindle
Example 1: Straight lead
Lead of screw : 3mm
δ1 : 5mm
δ2 : 1.5mm
Depth of cut : 1mm(2cut
two times)

(ABSOLUTE)
N0005 G90 G21 S900 M03 ;
N0010 G00 X90.0 Z5.0 M08 ;
N0015 X48.0 ;
N0020 G32 Z-71.5 F0.3 ;
N0025 G00 X90.0
N0030 Z5.0 ;
N0035 X46.0 ;
N0040 G32 Z-71.5 ;
N0045 G00 X90.0 ;
N0050 Z5.0;
N0055 X150.0 Z150.0 T0100 ;
N0060 M30 ; 31
Example 2
ABSOLUTE
N0005 G90 G21 S900 M03 ;
N0010 G00 X90.0 Z5.0 ;
N0015 X23.0;
N0020 G32 X48.0 Z-71.5 F3.0 ;
N0025 G00 X90.0 ;
N0030 Z5.0 ;
N0035 X21.0 ;
N0040 G32 X46.0 Z-71.5 ;
Lead of screw: 3mm N0045 G00 X90.0 ;
δ1: 5mm N0050 Z5.0 ;
δ2: 1.5mm N0055 X150.0 Z150.0 Mo5Mo9T0100 ;
Depth of cut: 1mm(2cut two N0060 M30 ;
times)

32
INCREMENTAL

N0005 G90 G21 S800 M03 ;


N0010 G00 X90.0 Z5.0 ;
N0015 U-67.974 ;
N0020 G32 U27.321 W-76.5 F3.0 ;
N0025 G00 U40.438 ;
N0030 W76.5 ;
N0035 U-68.948 ;
N0040 G32 U27.321 W-76.5 ;
N0045 G00 X90.0 ;
N0050 W76.5 ;
N0055 X150.0 Z150.0 T0100 ;
N0060 M30 ; 33
2.2.1.1: Fixed cycle command
To simplify programming, the system defines G command of single
machining cycle with one block to complete the rapid traverse to
position, linear/thread cutting and rapid traverse to return to the
starting point:
 G90 (Axial cutting cycle)
 Command format: G90 X(U) __ Z(W) __ F__; (cylinder cutting)
G90 X(U) __ Z(W) __ R__ F__; (taper cutting)
 Command function: From starting point, the cutting cycle of
cylindrical surface or taper surface is completed by radial feeding(X) and
axial (Z or X and Z) cutting. where X(U): X coordinate at the end point of
Z.
Z(W) : End point
R- : When cutting from the start point to X+ direction
R+ : When cutting from the start point to X- direction
34
R : Inclination(Designate the radius value)
35
36
Example 1: Cylindrical cycle

O0013
N010 G21 G90;
N015 MO3 S300 T0101 ;
N020 G00 X56.0 Z2.0 M08 ;
N025 G90 X51.0 W-32.0 F0.25 ;
X46.0 ;
X41.0 ;
X36.0 ;
X31.0 ;
X30.0 ;
N030 G28 U0 W0 ;
N035 M30 ;
Example 2:
O0012
N010 G21 G90;
N015 MO3 S300 T0101 ;
N020 G00 X61.0 Z2.0 M08 ;
N025 G90 X55.0 W–42.0 F0.25 ;
X50.0 ;
X45.0 ;
X40.0 ;
Z-12.0 R-1.5 ;
Z-26.0 R-3.25 ;
Z-40 R-5 ;
N030 G28 U0 W0 ;
N035 M30 ;

38
 (G94) Radial cutting cycle
 Command format: G94 X(U) __ Z(W) __ F__; (face cutting)
G94 X(U) __ Z(W) __ R__ F__; (taper face
cutting)
 Command function: From starting point, the cutting cycle
of cylindrical surface or taper surface is completed by radial
feeding (X) and axial (Z or X and Z) cutting.

39
 Cycle process:
① Z rapidly traverses from starting point to cutting starting
point;
② Cutting feed (linear interpolation) from the cutting starting
point to cutting end point;
③ Z executes the tool retraction at the cutting feed rate
(opposite direction to the above-mentioned ①
④ The tool rapidly traverses to return to the starting point and
the cycle is completed.

40
Example 1:

O0014
N010 G21 G90 ; Z–12.0 ;
N015 MO3 S300 T0101 ; Z–14.0 ;

N020 G00 X85.0 Z2.0 M08 ; Z–16.0 ;

N025 G94 X40.0 Z–2.0 F0.2 ; Z–18.0 ;


Z-19.7 ;
Z–4.0 ;
Z–20.0 ;
Z–6.0 ;
N030 G28 U0 W0 ;
Z–8.0 ;
N035 M30 ; 41
Z–10.0 ;
Example 2: G94 Stock removal cycle in facing
O0015
N010 G21 G90 M08 ;
N015 MO3 S300 T0303 ;
N020 G00 X85.0 Z2.0 ;
N025 G94 X12.0 Z-2.0 F0.2 ;
Z-4.0 ;
Z-6.0 ;
Z-7.0 ;
X 40.0 Z-9.0 ;
Z-11.0 ;
Z-13.0 ;
Z-15.0 ;
Z-17.0 ;
N030 G0 X200.0 Z200.0 T0300 ;
N035 M30 ;
42
CNC Drilling
Ex. 1 CNC Drilling
Four holes of 15mm in diameter
A drill of 15mm dia available
All part dimensions are given in mm.
CNC Drilling: Tool At Start
Algorithm
Move To Hole Position
Move Just Above Hole
Top
Turn On Spindle
View
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR THE
Front REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Tool At Start

Move To Hole Position


Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR THE
Front REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Algorithm
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
Move To Hole Position
Move Just Above Hole
Top
View Turn On Spindle
Turn On Coolant
Plunge Hole
Move Out Of Hole
REPEAT THE ABOVE INSTRNS FOR
Front THE REMAINING 3 HOLES
View Move Away
Turn Off Spindle
Turn Off Coolant
CNC Program for Drilling Tool At Start

Top
View

Front
View
Tool At Start

y
Top
View

Front
View
Tool At Start
N01 G90 G71 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
y N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
x N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
z N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
Tool At Start
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M07
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
Tool At Start
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
Tool At Start
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
Tool At Start
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
Tool At Start
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
Tool At Start
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
N01 G90 G21 G95
N02G00 X25.0 Y25.0
N03 G00 Z0.1 M08
N04 M03 S600
Top N05 G01 Z-20.0 F0.5
View N06 G00 Z0.1
N07 G00 X75.0
No8 G01 -20.0
N09 G00 Z0.1
N10 G00 X75.0Y75.0
N11 G01Z-20.0
N12 G00 Z0.1
N13 G00X25.0
Front N14 G01 Z-20.0

View N15 G00 Z0.1


N16 G00 X250.0 Y250.0
N17 M05 M09
N18 M02
2.3: Manual Part Programming For NC Milling

Vertical milling machine

Horizontal milling machine

76
2.3.1: G codes(preparatory functions)

Basic Preparatory NC Codes

G00 Linear Movement (rapid) G95 Feed in mm/rev

G01 Linear Movement (feed) G96 Speed m/min


G02 Circular Movement (cw) G97 Speed in RPM

G03 Circular Movement (ccw)

G20 Inch units

G21 Metric units

G90 Absolute dimensions


G91 incremental dimensions

G94 Feed in mm/min


77
 Plane selection G17 ~ G19
 Command format : G17……XY plane
G18……ZX plane
G19……YZ plane
 Command function: use G commands to select the plane of
the arc interpolation.
 Command explanation: G17, G18, G19 are modal, and the
plane does not change in the block without the command.

78
CNC Milling
2D - Surface Machining
CNC Programming
CNC Programming
N00 G90 G21 G17 G94 ;
N01 G00 X0 Y-4;
N02 G01 X54 Y-4 F0.2;
N03 G01 X54 Y24;
N04 G01 X50 Y24;
N05 G02 X29 Y45 I0 J21;
N06 G03 X-29 Y45 I-29 J0;
N07 G02 X-50 Y24 I-21 J0;
N08 G01 X-54 Y-24;
Tool radius = 4 mm (tool at X = 0, Y = -4)
N09 G01 X-54 Y-4;
Tool starts from origin and returns to origin
N10 G01 X0 Y-4;
Only motion statements
N11 G00 X100 Y100;
All motions are feed motions
N11 M30;
CNC Programming

N04 G02 X29 Y45 I0 J21


N05 G03 X-29 Y45 I-29 J0
N06 G02 X-50 Y24 I-21 J0

Options
N04 G02 X29 Y45 R21
N05 G03 X-29 Y45 R29
Tool radius = 4 mm (tool at X = 0, Y = -4) N06 G02 X-50 Y24 R21
Tool starts from origin and returns to origin
Only motion statements
All motions are feed motions
Options
N00 G42
N01 G00 X0 Y-4 N01 G00 X0Y0
N02 G01 X54 Y-4 N02 G01 X50 Y0
N03 G01 X54 Y24 N03 G01 X50 Y20
N04 G01 X50 Y24 N04 G02 X25 Y45 I0 J25
N05 G02 X29 Y45 I0 J21 N05 G03 X-25 Y45 I-25 J0
N06 G03 X-29 Y45 I-29 J0 N06 G02 X-50 Y20 I-25 J0
N07 G02 X-50 Y24 I-21 J0 N07 G01 X-50 Y0
N08 G01 X-54 Y-24 N08 G01 X0 Y0
N09 G01 X-54 Y-4 N09 G00X100 Y100 G40
N10 G01 X0 Y-4 N10 M30;
Tool Radius Compensation
G41 Radius Compensation (left)
G40 Cancel Compensation
G42 radius Compensation (right)

Use G42 Use G41

Use G41 Use G42


 Mirroring (G10-G13)
 Command format: G10 ; (Cancellation of mirroring image)
G11 ; (Mirror image on X axis)
G12 ; (Mirror image on Y axis)
G13 ; (Mirror image on Z axis)
 Command function: It is used when features of components
shares symmetry about one or more axes and are also
dimensionally identical.

Example:
Profile depth
= 2mm

85
O0002 N040 G03 X2 Y8 R6;
N045 G01 X0 Y10;
N005 G21 G17 M08 G90; N050 G00 Z10;
N010 M03 S500; N055 G00 X0 Y0;
N015 G00 X0 Y0; N060 G11;
N020 G00 X10; N065 G25 N020.055;
N025 G00 Z2; N070 G00 X100 Y100 G10 M05
N030 G01 Z-2; M09;
N035 G01 X8 Y2; N075 M30;
 Shifting origin (G92)
 Command format:
G92 X__ Y__ ; Where: X and Y
values are positions after
shifting.
 Command function:  It is used
to temporarily shift the origin
to the reference point
86
specified.
Example:

O0004 N055 Y0 ;
N005 G21 G17 M08 G90 ; N060 G00 Z10 ;

N010 M03 S500 ; N065 G92 X30 Y30 ;


N015 G00 X0 Y0 ; N070 G00 X0 Y0 ;
N020 G00 Z2 ; N075 G00 Z2 ;
N025 G92 X10 Y10 ; N080 G25
N035.055 ;
N030 G00 X0 Z0 ; N085 G00 Z10 ;
N035 G01 Z-2 ; N090 M30 ;
N040 X10 ;
N045 Y10 ; 87
N050 X0 ;
 Scaling (G72)
 Command format: G72 K__ ;
Where: K: the scaling factor.
 Command function: It is used to program geometrically
similar components with varying sizes. The scaling command
can be cancelled by using the statement G72 K1.0.

Example:

88
Cont’d…

O0007
N055 G00 Z10;
N005 G21 G17 M08 G90;
N060 G00 X0 Y0;
N010 M03 S500;
N065 G72 K2.0;
N015 G00 X0 Y0;
N070 G25 N020.050;
N020 G00 Y25;
N075 G00 Z10;
N025 G01 Z-2;
N080 G00 X0 Y0;
N030 X-25;
N085 G72 K3.0;
N035 Y-25;
N090 G25 N020.050;
N040 X25;
N095 G00 Z10;
N045 Y25;
N100 G00 X0 Y0;
N050 X0;
N095 G72 K1.0;
N105 M30;
89
Summary of G Codes
G00 Rapid linear movement
G01 Linear feed movement
G02 Circular movement (CW)
G03 Circular movement (CCW)
G70 Inch units
G71 Metric units
G90 absolute dimension
G91 incremental dimension
G94 Feed per minute
G95 Feed per revolution
G96 Constant surface speed
G97 Speed in RPM
G40 Cancel cutter compensation
G41 Cutter compensation (left)
G42 Cutter compensation (right)
Summary of M Codes

M02 End of program


M03 Spindle on CW
M04 Spindle on CCW
M05 Spindle Off
M06 Tool Change
M08 Coolant On
M09 Coolant Off
M10 Clamp Workpiece
M11 Unclamp Workpiece
Quiz 1 – (15 mins)

• Write a full manual part program for manufacturing the


following part using CNC machine.
? ?
S ?
QN

You might also like