0% found this document useful (0 votes)
646 views

Unit No 5 CNC Part Programming

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

Unit No 5 CNC Part Programming

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

Unit No 5

CNC Part Programming


 Tool Positioning Systems
In NC programming the following two types of Positioning Systems or Modes of programming are
used:
i. Absolute System ii. Incremental System

i. Absolute System
In this system the positions are indicated from fixed zero point or reference point. An example of this
type of dimensioning is shown in given figures. In this case the zero or reference point is the left hand
bottom corner of the workpiece and all dimension are given from that point.
A drawback of this system is that if an error creeps in a dimension it continuous to be.

ii. Incremental System


In this system the tool positions or locations are indicated with reference to a previously known
location. Example is shown in given figure.
An inherent drawback of this system is that is an error creeps into the dimensions of any
location all locations marked after that will carry this error.

The Codes Used are


G90 –Absolute Coordinate System
G91 – Incremental Coordinate System
 Motion Control System:
They are also known as Positioning Control System. There are three basic systems used to control
these motions
i. Point to Point System
ii. Straight Line or Straight cut System
iii. Contouring or Continues path system

i. Point to Point System


This system is commonly used in many operations like drilling, boaring, tapping, reaming etc., where
the primary requirement is of accurately locating the tool or the workpiece at some specified location
to perform the desired operation. This system involves positioning of tool or workpiece from one
coordinate location to another.

ii. Straight Line or Straight cut System

This system in away can be considered as an


extension of the point to point system. In this system
the cutting tool can be move along straight line only
which are parallel to the principal axis of motion i.e.
X-axis, Y-axis and Z-axis. In this system it not
possible to combine the motion of different axes.
That’s why it is not possible to make angular cuts on
the NC machine operating on this control system

iii. Contouring or Continues path system


It implies controlled and coordinated
simultaneous movement of different slides of
the machine tool to enable predetermined
relative motions of the tool and workpiece
during the entire machining operation. It means
that motion of tool and workpiece are
controlled along may axes simultaneously in
this system which will facilates machining of
different types of curved surfaces and profile
contours.
 Interpolation
Interpolation is the term used to describe the method to facilitate the movement of the tool of NC
machine from one program point to next program point along a predefined path. The Interpolation
can be done in following ways:
i. Linear Interpolation –Along a straight line
ii. Circular Interpolation- Along an Arc or Circle
iii. Helical Interpolation – Along a Helical Path
iv. Parabolic Interpolation – Along aa parabolic path
v. Cubic Interpolation – Movement of tool maintaining boundary profile
G00 Rapid Positioning
G01 Linear Interpolation
G02 Circular Interpolation Clockwise
G03 Circular Interpolation Anti Clockwise

 Unit Group
This group of codes specifies the units in which the program is to be interpreted.
G20 In inch units
G21 In mm units

 Active Plane Selection

G17 X-Y Plane Selection


G18 X-Z Plane Selection
G19 Y-Z Plane Selection

 Motion Group
This is the most important group of codes used in part programming.

 Dwell G04
This is to give a delay in the program. When the G04 code is encountered the controller stops at
that particular point for specified time mentioned in the block
N045 G04 X3.0 This calls for a stoppage of the control for a period of 3seconds.
CNC Part Programming Format
NC information is generally programmed in blocks of words. Each word conforms to the EIA
standards and they are written on a horizontal line. If five complete words are not included in
each block, the machine control unit (MCU) will not recognize the information; therefore the
control unit will not be activated. It consists of a character N followed by a three digit number
raising from 0 to 999.

Using the example shown in Figure. The words are as follows :

N001 - Represents the sequence number of the operation.


G01 - Represents linear interpolation.
X12345 - Will move the table in a positive direction along the X-axis.
Y06789 - Will move the table along the Y-axis.
M03 - Spindle on CW and
; - End of block.
-
 Machine Origin Co-Ordinate System:
Machine origin co-ordinate system is the axes co-ordinate system having the origin at machine zero.
- Machine Zero – M:
The points of intersection of the spindle axis and the plane of spindle front face are taken as
machine zero.

 Work Piece Co-Ordinate System:


This is the co-ordinate system having the origin at work piece zero. This co-ordinate system is used
for the purpose of programming co-ordinates of different points on the work piece.
- Work Piece Zero – W:
Work piece zero is the zero defined for programming the work piece dimensions. It can be
freely selected.

 Machine Reference Point Co-Ordinate System :


This is the machine co-ordinate system having the origin at machine reference point.
- Machine Reference Point – R:
There is a difference between machine origin and machine reference point. A programmer has to
know this part clearly. The reference point R is a point defined by the machine manufacturer which is
to be approached when the control is switched on and which synchronizes the system. The reference
dimension is defined in the machine data.
 Standard G and M Codes
The total numbers of these codes are 100, out of which some of important codes are given as
under with their functions:
SYMBOLS USED

% – Main Programme (1 to 9999)


L – Sub program (1 to 999)/Home position
N – Sequence of block number.
Lf – Block end (EOB) means “; or *”
T – Tool number or Tool station number
D – Tool offset
S – Spindle speed
F – Feed
M – Switching function
G – Transverse commands
R – Parameters
I, J, K – Circle parameters
B/U/R – Radius
X/Y/Z – Axis coordinates
P – Passes.

G codes for CNC turning


In CNC turning there is some change in G codes as compared to CNC mill. The codes are listed below:

G00 – Rapid movement in a linear direction.


G01- Linear machining.
G02 – Clockwise machining.
G03 – Counter-clockwise machining.
G04 – Dwell
G09 – Motion Exact stop check
G10 – Programmable data input
G17 – Select X-Y plane
G18 – Select X-Z plane
G19 – Select Y-Z plane
G20 – Programming is in inches
G21 – Programming is in mm
G27 – Reference point return check
G28 – Return to point of reference
G29 – Return to point of reference
G30 – Return to 2nd, 3rd, and 4th point of reference
G32 – Canned Constant lead threading (like G01 synchronized with spindle)
G40 – Tool cutter compensation off (radius comp.)
G41 – Tool cutter compensation left (radius comp.)
G42 – Tool cutter compensation right (radius comp.)
G43 – Tool length compensation (positive)
G44 – Tool length compensation (negative)
G49 – Tool length compensation cancel
G50 – Reset all scale factors to 1.0
G51 – Turn on scale factors
G52 – Local work shift for all coordinate systems
G53 – Machine coordinate system (cancel work offsets)
G54 – Work coordinate system (1st Workpiece)
G55 – Work coordinate system (2nd Workpiece)
G56 – Work coordinate system (3rd Workpiece)
G57 – Work coordinate system (4th Workpiece)
G58 – Work coordinate system (5th Workpiece)
G59 – Work coordinate system (6th Workpiece)
G70 – Finish Turning Cycle (canned)
G71 – Rough Turning Cycle (canned)
G72 – Rough Facing Cycle (canned)
G73 – Pattern Repeating Cycle (canned)
G74 – Peck Drilling Cycle (canned)
G75 – Grooving Cycle (canned)
G76 – Threading Cycle (canned)
G80 – Cancel canned cycle (canned)
G83 – Face drilling cycle (canned)
G84 – Face Tapping cycle (canned)
G86 – Boring canned cycle, spindle stop, rapid out (canned)
G87 – Side Drilling Cycle (canned)
G88 – Side Tapping Cycle (canned)
G89 – Side Boring Cycle (canned)
G90 – Absolute programming (type B and C systems)
G91 – Incremental programming (type B and C systems)
G92 – Thread Cutting Cycle (canned)
G94 – End face Turning Cycle
G96 – Constant Surface Speed ON
G97 – Constant Surface Speed Cancel
G98 – Feed rate in mm/min
G99 – Feed rate in mm/rev

M codes in CNC
M codes in CNC are almost the same for turning and milling. M codes are usually used for turning
ON/OFF various processes. The following are the M codes.

M00 – Program stop


M01 – Optional stop
M02 – Program end
M03 – Spindle start
M04 – Spindle start (anti-clockwise)
M05 – Spindle stop
M06 – Tool change
M07 – Coolant ON (Within the spindle)
M08 – Coolant ON
M09 – Coolant OFF
M30 – End program
M98 – Call subroutine
M99 – End subroutine
CANNED CYCLES

G70 Finishing cycle


G71 Stock removal in turning
G72 Stock removal in facing
G73 Pattern repeating
G74 Peck drilling
G76 Multiple threading cycle
G codes for CNC milling
The following are some of the commonly used G codes and their description in CNC milling.

G00 – Rapid positioning


G01 – Linear travel/interpolation
G02 – Circular travel/interpolation (clockwise)
G03 – Circular interpolation (Anti-clockwise)
G04 – Dwell
G10 – Programmable data input
G17 – XY plane selection
G18 – ZX plane selection
G19 – YZ plane selection
G20 – Programming in inch units
G21 – Programming in metric units
G27 – Reference point return check
G28 – Automatic return to point of reference
G29 – Automatic return from the point of reference
G30 – Return to 2nd, 3rd, or 4th point of reference
G40 – Cutter diameter compensation cancel
G41 – Cutter diameter compensation left
G42 – Cutter diameter compensation right
G43 – Tool length compensation in positive (+) sign
G44 – Tool length compensation in a negative (-) sign
G45 – Tool offset increase
G46 – Tool offset decrease
G49 – Tool length offset cancel
G53 – Machine coordinate system
G54-59 – Work coordinate system
G80 – Canned cycle cancel
G81 – Drilling cycle canned
G82 – Counter boring or countersinking cycle canned
G83 – Peck drilling cycle (canned)
G84 – Tapping cycle (canned)
G85 – Reaming cycle (canned)
G86 – Boring cycle (canned)
G90 – Absolute positioning
G91 – Incremental positioning
G92 – Zero preset
G94 – Feed rate in mm/min
G95 – Feed rate in mm/rev
G96 – Constant surface speed control
G97 – Constant surface speed control cancel
Part Programming Examples
 Step Turning
E.g.1 prepare a part program for stepped component given below, use spindle speed 2016 & feed per
minute 403 mm / min. Workpiece size Ø30 x 80 mm.

Coordinate Table - Absolute


Position X Y Z
Home 150 0 100
1 0 0 0
2 30 0 0

` 40 3 28 0 1
4 28 0 -40
5 32 0 -40
6 27 0 1
7 27 0 -40

Part Program

%;
N001 O1234; Program No
N002 G28 U0.0 W0.0; Automatic Return to reference position
N003 G21 G90 G94; Input in mm, Absolute Programming , Feed mm/min
T0101 M08 M03 S800; Tool change, Coolant On, Spindle on CW, Spindle rotate with speed
N004
M06 2016 rpm

N005 G00 X0.0 Y0.0; Rapid Feed


N006 G01 X30 Z0.0; Facing Operation
N007 G00 X28 Z2.0 ; Rapid Feed
N008 G01 X28 Z-40 F403; Linear Interpolation (First cut 2mm)
N009 G01 X32 Z-40; Tool Move to relive workpiece
N010 G00 X27 Z2.0 ;
N011 G01 X27 Z -40 F403; Linear Interpolation (Second cut 1mm)= Step created 27 mm
N012 G01 X32 Z-40; Tool Move to relive workpiece
N013 M09 M05; Coolant Off, Spindle Stop
N014 G28 U0.0 W0.0; Automatic Return to reference position
N015 M02 or M30 ; End of program
E.g. Prepare a part program for stepped component given below use spindle speed 800 rpm &
feed per minute 477 mm / min. Workpiece
size Ø50 x 100 mm. Coordinate Table - Operation Detail
Absolute
Position X Y Z
Home 150 0 100 Tool Change Position
1 0 0 0 Program Center
2 50 0 0 Facing Operation
3 46 0 1 Rapid Feed
4 46 0 -60 First cut Step 01
5 50 0 -60
6 50 0 1
7 42 0 1
8 42 0 -60 Second Cut Step 01
9 50 0 -60
10 50 0 1
11 40 0 1
12 40 0 -60 Finishing Cut Step 01
13 50 0 -60
14 50 0 1
15 40 0 1
16 36 0 1
17 36 0 -25 First cut Step 02
18 40 0 -25
19 40 0 1
20 34 0 1
21 34 0 -25 Finishing Cut Step 02
22 40 0 -25
23 100 0 75
Part Program

%;
N001 O1234; Program No
N002 G28 U0.0 W0.0; Automatic Return to reference position
N003 G21 G90 G94; Input in mm, Absolute Programming , Feed mm/min
T0101 M08 M03 S800; Tool change, Coolant On, Spindle on CW, Spindle rotate with speed
N004
M06; 2016 rpm

N005 G00 X0.0 Y0.0; Rapid Feed


N006 G01 X50 Z0.0; Facing Operation
N007 G00 X50 Z1; Rapid Feed
N008 X46; Rapid Feed
N009 G01 X46 Z-60 F477; Linear Interpolation , Feed 477 mm/min (First cut Step 01)
N010 X50; Relieve tool from workpiece
N011 G00 X50 Z1; Rapid Feed
N012 G00 X42; Rapid Feed
N013 G01 X42 Z-60; Linear Interpolation , Feed 477 mm/min (Second Cut Step 01)
N014 X50; Rapid Feed
N015 G00 X50 Z1; Rapid Feed
N016 G00 X40;; Rapid Feed
N017 G01 X40 Z-60; Linear Interpolation , Feed 477 mm/min (Finishing Cut Step 01)
N018 X50; Relieve tool from workpiece
N019 G00 X50 Z1; Rapid Feed
N020 G00 X40 Z1; Rapid Feed
N021 G00 X36 Z1; Rapid Feed
N022 G01 X36 Z-25; Linear Interpolation , Feed 477 mm/min (First cut Step 02)
N023 G00 X40; Rapid Feed
N024 X40 Z1; Rapid Feed
N025 X34 Z1; Rapid Feed
N026 G01 X34 Z-25; Linear Interpolation , Feed 477 mm/min (Finishing Cut Step 02)
N027 X40; Relieve tool from workpiece
N028 M09 M05; Coolant Off, Spindle Stop
N029 G28 U0.0 W0.0; Automatic Return to reference position
N030 M02 or M30; End of program
 Taper Turning

%;
N001 O1234;
N002 G28 U0.0 W0.0; Automatic Return to reference position
N003 G21 G90 G98; Input in mm, Absolute Programming , Feed mm/min
Coolant On, , Spindle on CW, Spindle rotate with speed 2016 rpm, Tool
N004 M08 M03 S800 M06T0101;
change
N005 G00 X15 Z1 ;
N006 GOO X15 Z0 ;
N007 G00 X13 ;
N008 G01 X15 Z-30 F0.5 ;
N009 G00 X15 Z1 ;
N010 G00 X11 Z0 ;
N011 G01 X15 Z-30 F0.2 ;
N012 G00 X15 Z1;
N013 G00 X10 Z0 ;
N014 G01 X15 Z-30 F0.2 ;
N015 G28 U0.0 W0.0; Automatic Return to reference position
N016 M09 M05; Coolant Off, Spindle Stop
N017 M02 or M30; End of program
Q. Prepare a part program to machine the workpiece shown in Fig. No. 2 on CNC lathe
(Exam- Summer 2017)

R15

N01 012345;

NO2 G28 U0.0 W0.0;

N03 G21 G90 G98 G92 X5 Z5

N04 M08 M03 S2500 M06 T0101;

N05 G00 X00 Z2;

N06 G01 XO ZO;

N07 G03 X15 Z-15 R15 F2;

N08 G01 X15 Z-30;

N09 G01 X20 Z-30

N10 G01 X20 Z-70;

N11 G28 U0.0 W0.0;

N12 M09 M05;

N13 M30;
Write a part program for job as shown in Fig. No. 1. Take only finish cut. Use, Spindle
speed = 1500 rpm and feed rate = 0.1 mm/rev. Assume suitable data if necessary.
(Exam- Summer 2018)

Solution
X Z
Point
Coordinate Coordinate
P0 00 5
P1 00 0
P2 20 0
P3 40 -10
P4 40 -30
P5 60 -80
P6 60 -120
P7 70 -120

012345; Program no.


N001 G28 U0.0 W0.0; Return to reference position
N002 G21 G90 G99; Input in mm, Absolute Programming,G99 for Feed in mm/rev
N003 M06 T0101 M08; Tool change tool no. tool offset no. coolant ON
N004 M03 S1500; Spindle Start clockwise with 1500 rpm
N005 G00 X0.0 Z5.0; Move the tool rapidly to point P0
N006 G01 X0.0 Z0.0 F0.1; Move the tool with Feed rate of 0.1mm/rev topoint P1 (Touch Point)
N007 G01 X20.0 Z0.0; Facing Operation up to point P2
N008 G03 X40.0 Z-10.0 R10 After facing circular Interpolation CCW withRadii =10 mm up to Point P3
N009 G01 X40.0 Z - 30.0; After radius of 10 mm plain turningup to point P4
N010 G01 X60.0 Z - 80.0; After that taper turning up to point P5
N011 G01 X60.0 Z – 120.0; After taper turning plain turning up to point P6
N012 G01 X70.0 Z – 120.0; Lastly tool is taken away from work piece up to point P7
N013 M09 M05; Coolant STOP, Spindle STOP
N014 G28 U0.0 W0.0; Return to reference position
N015 M30; End of Program
Q. Write part program for a job as shown in Fig. No. 1. Take only finish cut. Spindle
speed is 1200 rpm and feed rate is 150 mm/rev. Assume suitable machining data, if
necessary. (Exam- Winter 2017)

Solution
Point X Coordinate Z Coordinate
P0 00 05
P1 00 00
P2 10 00
P3 50 -20
P4 50 -30
P5 50 -40
P6 50 -80

N001 G28 U0.0 W0.0;


N002 G21 G90 G99;
N003 M06 T0101 M08;
N004 M03 S1200;
N005 G00 X 0.0 Z 5.0;
N006 G01 X 0.0 Z 0.0 F 150;
N007 G01 X 10.0 Z 0.0;
N008 G01 X 50.0 Z - 20.0;
N009 G01 X 50.0 Z - 30.0;
N010 G02 X 50.0 Z - 40.0;
N011 G01 X 50.0 Z – 80.0;
N012 G01 X 60.0 Z – 80.0;
N013 M05 M09;
N014 G28 U 0.0 W 0.0;
N015 M30;
O. Write CNC programme for turning a component as shown in Figure No. 1. Assume
suitable data if necessary (Exam- Winter 2018)

Solution
Point X Coordinate Z Coordinate
P0 00 05
P1 00 00
P2 30 00
P3 50 -20
P4 50 -70
P5 80 -70
P6 80 -110
P7 82 -110

012345; Program no.


N001 G28 U0.0 W0.0; Return to reference position
N002 G21 G90 G99; Input in mm, Absolute Programming,G99 for Feed in mm/rev
N003 M06 T0101 M08; Tool change tool no. tool offset no. coolant ON
N004 M03 S1500; Spindle Start clockwise with 1500 rpm
N005 G00 X0.0 Z5.0; Move the tool rapidly to point P0
N006 G01 X0.0 Z0.0 F0.1; Move the tool with Feed rate of 0.1mm/rev to point P1 (Touch Point)
N007 G01 X30.0 Z0.0; Move the tool with linearly Feed rate of 0.1mm/rev to point P2
N008 G01 X50.0 Z-20.0; Move the tool linearly with Feed rate of 0.1mm/rev to point P3
N009 G01 X50.0 Z-70.0; Move the tool linearly with Feed rate of 0.1mm/rev to point P4
N010 G01 X80.0 Z-70.0; Move the tool linearly with Feed rate of 0.1mm/rev to point P5
N011 G01 X80.0 Z-110.0; Move the tool linearly with Feed rate of 0.1mm/rev to point P6
N012 G01 X82.0 Z-110.0; Move the tool linearly with Feed rate of 0.1mm/rev to point P7(away from workpiece)
N013 M09 M05; Coolant STOP, Spindle STOP
N014 G28 U0.0 W0.0; Return to reference position
N015 M30 End of Program
Calculate the cutting parameters and prepare process sheet for the component shown
in Fig. No.1. with neat diagram. All dimensions are in mm. Given: Raw material -
Aluminium, stock size φ14 X42 length, feed (f) = 0.2 mm/rev, cutting speed (V) = 90
m/min. Consider work zero (W) as per the Fig. No.1.

Solution
Given Data: V = 90 m/min.,
f = 0.2 mm/rev., D = 14 mm,
Depth of cut, dc = 1 mm, Length of Cut, l= 25 mm Cutting Parameters:
Spindle Speed: V = πDN/1000 N = 2043 rpm.
Feed: f = 0.2 mm/rev. Depth of Cut: dc = 1 mm
Point X Coordinate Z Coordinate
P0 00 02
P1 00 00
P2 12 00
P3 12 -25
P4 14 -25
P5 14 -41
P6 20 -41

012345; Program no.


N001 G28 U0.0 W0.0; Return to reference position
N002 G21 G90 G99; Input in mm, Absolute Programming,G99 for Feed in mm/rev
N003 M06 T0101 M08; Tool change tool no. tool offset no. coolant ON
N004 M03 S2043; Spindle Start clockwise with 2043 rpm
N005 G00 X0.0 Z2.0; Move the tool rapidly to point P0
N006 G01 X0.0 Z0.0 F0.2;
N007 G01 X12.0 Z0.0;
N008 G01 X12.0 Z -25.0;
N009 G01 X14.0 Z -25.0;
N010 G01 X14.0 Z -41.0;
N011 G01 X20.0 Z -41.0
N012 G28 U0.0 W0.0;
N013 M09 M05;
N014 M30
Part Program for Profile Turning

N10 T0101
N20 G92 S1000 M42 Spindle speed limitation.

N30 G96 S200 M03 Constant surface speed

N40 G00 X0 Z5
N50 G01 Z0 F0.5 `
N60 G01 X80 F0.2
X : End point of arc in x-axis.
Z : End point of arc in z-axis.
N70 G02 X100 Z-30 I50 K0 I : Distance from arc start point to arc center point in x-axis.
K : Distance from arc start point to arc center point in z-axis.
N80 G01 Z-120
N90 G00 X200 Z200
M30

N20 G50 S2000 T0300


N30 G96 S200 M03
N40 G00 X0 Z3.0 T0303 M08
N50 G42 G01 Z0 F0.2
N60 G03 X20.0 Z-10.0 R10.0
N70 G01 Z-50.0
N80 G02 X100.0 Z-74.385 R45.0
N80 G01 Z-125.0
N90 G40 U2.0 W1.0
N100 G00 X200.0 Z200.0 M09 T0300
N110 M30
Canned Cycles
G71 Code:
Structure: G71 U 0.00 R0.00 P000 Q000 U0.00 W0.00 F0.00
U- Depth of Cut
R – Tool Retraction value
P- First line of Subroutine
Q- Last line of Subroutine
U- Amount let on workpiece for finishing on X axis
W- Amount let on workpiece for finishing on Z axis
F- Feed rate
G70 Code
Structure: G70 P000 Q000

%;
N001 O1234; Program No
N002 G28 U0.0 W0.0; Automatic Return to reference position
N003 G21 G90 G94; Input in mm, Absolute Programming , Feed mm/min
T0101 M08 M03 S800; Tool change, Coolant On, Spindle on CW, Spindle rotate
N004
M06; with speed 2016 rpm

N005 G00 X125 Z2 ;


N006 G71 U 1.0 R 0.5 ;
N007 G71 P120 Q220 U0.00 W0.00 F0.2 ;
N120 G00 X105 Z0 ;
G01 X105 Z0 ;
N220 G01 X125 Z-40 F0.2 ;
N008 G70 P120 Q120 ;
N009 G28 U0.0 W0.0; Automatic Return to reference position
N010 M09 M05; Coolant Off, Spindle Stop
N011 M02 or M30; End of program
%;
N001 O1234; Program No
N002 G28 U0.0 W0.0; Automatic Return to reference position
N003 G21 G90 G94; Input in mm, Absolute Programming , Feed mm/min
T0101 M08 M03 S800; Tool change, Coolant On, Spindle on CW, Spindle rotate
N004
M06; with speed 2016 rpm

N005 G00 X62 Z5 ;


N006 G71 U1.0 R0.5 ;
N007 G71 P10 Q20 U0.00 W0.00 F0.2
N10 G00 X25 Z0 ;
G01 X25 Z-7.5 F0.2 ;
G01 X40 Z-15 F0.2 ;
G01 X60 Z-35 F0.2
N20 G01 X60 ;
N008 G70 P10 Q20 ;
N009 G28 U0.0 W0.0; Automatic Return to reference position
N010 M09 M05; Coolant Off, Spindle Stop
N011 M02 or M30; End of program
 Taper Turning and Profile Cutting :

%
N10 012345 Name of main program.
Absolute co-ordinate system , metric input in 'mm' , feed rate
N20 G90 G21 G99 F0.2 ; per revolution F0.2 .

N30 M06 T04 04 ; Tool changing command , select tool no 4.


N40 M03 S1200 ; Spindle ON clockwise at speed 1200 rpm.

N50 M08 ; Coolant ON

N60 G28 U0 W0 ; Tool at reference point where U0 and W0


Turning cycle command where depth of cut for X axis is 0.5(total
N70 G71 U0.5 R1 ; dia reduce each cut is 1) and tool relive distance 1 mm.

Turning cycle command , actual operation start from block no.


80 and actual operation end at block no. 150 ,finishing along X
N80 G71 P80 Q150 U0.5 W0.1 ; axis 0.5 , and finishing along Z axis is 0.1

N90 G01 X0 Z0 ; Rapid command where tool at X 0 and Z 0 .[P1]


N100 G01 X14 Z-10 ; Linear interpolation command where X14 and Z-10 .[P2]

N110 G01 Z-20 ; Linear interpolation command where X14 and Z-20 .[P3]
Circular interpolation counter clockwise (external radius),
N120 G03 X20 Z-23 R3 ;
where X20 ,Z-23 and R3 .[P4]
N130 G01 Z-33 ; Linear interpolation command where X20 and Z-33 .[P5]

N140 G01 X22 ; Linear interpolation command where X22 and Z-33 .[P6]

N150 G01 Z-48 Linear interpolation command where X22 and Z-48 .[P7]

N160 G01 X25 ; Linear interpolation command where X25 and Z-48 .[P8]

N170 G28 U0 W0 ; Tool at reference point where U0 and W0.


N180 M05 M09 M30 ; Spindle stop , coolant off, main prog end .
Part Program For Profile Turning Canned Cycle
Feed 0.15 mm/rev, Spindle Speed1200 rpm

%
N10 012345 Name of main program.
Absolute co-ordinate system , metric input in 'mm' , feed rate
N20 G90 G21 G99 F0.2 ;
per revolution F0.2
N30 M06 T04 04 ; Tool changing command , select tool no 4.
N40 M03 S1200 ; Spindle ON clockwise at speed 1200 rpm.
N50 M08 ; Coolant ON
N60 G28 U0 W0 ; Tool at reference point where U0 and W0
Turning cycle command where depth of cut for X axis is 0.5(total
N70 G71 U0.5 R1 ;
dia reduce each cut is 1) and tool relive distance 1 mm.
Turning cycle command , actual operation start from block no.
N80 G71 P100 Q300 U0.0 W0.0 ; 80 and actual operation end at block no. 150,finishing along X
axis 0 , and finishing along Z axis is 0
N100 G00 X0 Z0 ; Rapid command , where X0 and Z0
G01 X30 Z0 ; Linear interpolation command where X30 and Z0 .
G01 X30 Z-22 ; Linear interpolation command where X30 and Z-22 .
Circular interpolation clockwise command where X40 , Z-27 and
G02 X40 Z-27 R5 F 015 ;
radius 5 .
G01 X55 ; Linear interpolation command where X55 and Z-27 .
Circular interpolation counter clockwise command where X80 ,
G03 X80 Z-57 CR80 ;
Z-57 and radius 80
G01 Z-62 ; Linear interpolation command where X80 and Z-62 ;
N300 G01 X85 ; Linear interpolation command where X85 and Z-62 ;
Finish machining cycle , actual operation start from block no. 80
N90 G70 P100 Q300 F0.05 ; and actual operation end at block no. 150 , feed rate for finishing
cut 0.05
N100 G28 U0 W0 ; Tool at reference point where U0 and W0
N110 M05 M09 M30 ; Spindle stop , coolant off, main prog end .
 Part Program for Drilling Operation
 Part program for Threading Operation

N10 M06 T01 01 ;


N20 M04 G97 S1000 ;
N30 G00 X45 Z5 ;
N40 G76 P020060 Q100 R50 ;
N50 G76 X38.7 Z-50 P1227 Q100 F2 ;
N60 G00 X45 Z5 ;
N70 M05 M09 M30 ;

DESCRIPTION OF MAIN PROGRAM :-

N10- Tool change command , select tool no. 1


N20- Spindle ON anti clockwise , constant spindle speed command , speed is 1000 rpm
N30- Rapid action command where X45 and Z5 .
N40- Threading cycle command , P020060
( P02 = No. of finished path
00 = Chamfer amount at end
60 = Angle of tool tip ) ,
Q100 = Each cut is 0.1 mm ,
R20 = finishing allowance 0.02mm
N50- Threading cycle command , Minor dia X axis , threading along Z- axis up to -50 , Threading depth
, Depth of finish cut 0.1 mm , pitch is 2 .

: M40X2

Major diameter is 40
Pitch is 2
Thread depth calculation = Pitch x 0.61363
= 2 x 0.61363
= 1.227 mm in micron is 1227
Minor diameter = 40-1.23 = 38.7 mm
N60- Rapid action command where X45 and Z5 .
N70- Spindle off , coolant off , main program end .
CNC Part Programming for Milling Operation
1. Prepare a part program for machining
component as shown in Fig. No. 1. Use following
data: cutting speed: 1200 rpm, feed: 60
mm/min, thickness of component 3 mm, Tool
reference position is 4 mm above the surface of
the workpiece. Assume suitable data if any.
Neglect cutter radius compensation

Solution

POSITION X Y Z
Home 0 0 4
PO 0 0 0
P1 0 50 -4
P2 10 60 -4
P3 60 60 -4
P4 60 10 -4
P5 60 0 -4

N01 G90 G21 G94 G40 G42;

N02 G00 X00 Z4;

N03 G01 X0 Z0 Y0 F 60;

NO4 G01 Z-3;

N05 G01 X0 Y50;

N06 G02 X10 Y60 R10 F60;

N07 G01 X60 Y60;

N08 G01 X60 Y10;

N09 G01 X50 Y00;

N10 G01 X00 Y00;

N11 G28 U0 W0;

N12 M05 M09 M30;


2. Prepare process sheet and calculate cutting
parameter for the following component with neat
diagram. Use HSS end milling cutter of Ø20mm. Raw
material – Aluminum Raw material size= 60 X 60
Feed of 8 mm thicknes rate=0.2 mm/rev. Cutting
speed= 90 m/min.

Solution

POSITION X Y Z
Home 0 0 4
PO 0 0 0 Part Program
P0’ 0 0 -8
N01 G90 G21 G95 G40 G42;
P1 0 50 -8
P2 10 60 -8 N02 G00 X00 Z4;
P3 50 60 -8
P4 60 50 -8 N03 G01 X0 Z0 Y0 F 60;
P5 60 10 -8
P6 50 00 -8 NO4 G01 Z-8;
P7 10 00 -8
P8 00 10 -8 N05 G01 X0 Y50;

N06 G03 X10 Y60 R10 F90;

N07 G01 X50 Y60;

N08 G03 X60 Y50 R10 F90;

N09 G01 X600 Y10;

N10 G02 X50 Y00 R10 F90;

N10 G01 X10 Y00;

N11 G03 X00 Y10 R10 F90

N11 G28 U0 W0;

N12 M05 M09 M30;


3. Develop a part program for CNC milling for the part
shown in Fig. 2 using ISO format. Take spindle speed
800 rpm, feed 80 mm/min. Depth of slot 5 mm. Assume
suitable detail necessary. Neglect cutter compensation.
(Summer-22)

Solution

POSITION X Y Z Solution
Home 0 0 4
PO 0 0 0 N01 G90 G21 G94 G40 G41;
P0’ 0 0 -5
P1 16 20 -5 N02 G00 X00 Y00 Z4;
P2 50 80 -5
N03 G01 X16 Y20 Z4 F 80;
P3 84 20 -5
P4 16 20 -5
N04 G01 Z-5

N05 G01 X50 Y80 F80;

N06 G01 X84 Y20 F80;

N07 G01 X16 Y20 F80;

N08 G28 U0 W0;

N09 M05 M09 M30;


4. Develop a part program for CNC milling for the part shown in Fig. 2 using ISO format. Take
spindle speed 1400 rpm, feed 150 mm/min. Thickness of work piece is 10mm. Assume
suitable detail necessary. Neglect cutter compensation.

012345
N10 G21 G90 G94
N20 G28 U0W0
N30 M03 S1400 M08
N40 G00 X0 Y0 Z10
N50 G00 X25 Y40
N60 G01 Z-15 F150
N70 Z5 F150
N80 G00 X60 Y55
N90 G01 Z-15 F150
N100 Z5
N110 G00 X80 Y75
N120 G01 Z-15
N130 Z5
N140 G28 U0 W0
N150 M09 M30

You might also like