MODULE – 3
Design to
Manufacturing
Part - I
Basics of NC, CNC
and DNC
NC/CNC MACHINES
Numerical Control:
Amethod of automation in which various functions of
machine tools are controlled by letters, numbers or
symbols.
Runs on a program fed to it, without human operator.
The NC program consists of a set of instructions or
statements for controlling the motion of the drivers of the
machine tool as well as the motion of the cutting tool.
In NC machine tools,
following functions may be
automatic
1. Starting & stopping of machine tool spindle.
2. Controlling the spindle speed.
3. Positioning the tool tip at desired locations
and guiding it along desired paths by
automatic control of the motion of slides.
4. Changing of tools.
5. Controlling the feed rate automatically
Principle of NC machine tool
Machine tool Data Flow Machine Control
Unit
Machine Tool Machine Control
Data Flow
Unit
Feed back
Application of NC machine
tool
1. Complex Contours
2. Prototyping tools
3. Accuracy
4. Many setups and time
5. Design change
6. Costly inspection
Advantages of NC
1. Less time and less expensive
2. Accuracy
3. Less scrap
4. Inspection time is reduced
5. Lead time
6. Variety of machining operations so reduced no. of
machine
7. Reduce setup time
8. Machine cost time are predictable before mfg.
9. No fatigue
10. Optimum feed and speed of tool
11. Modification in design
12. Rigid construction
Limitation of NC
1. Cost of machine tool is high and tooling
cost
2. Skilled people staff requirement
3. Training for software & hardware
4. Higher maintenance cost
5. Higher running cost
Elements of NC manufacturing
system
1. Machine Control Unit (MCU)
2. Machine Tool and NC tooling
3. Part Program and part drawing
1. Machine Control Unit
The most significant change in a conventional
machine tool and an NC controlled machine
tool is the presence of a MCU.
This unit can be in form of a panel housed
separately and can be situated in a cabinet.
The MCU is the control unit which regulates
the path of the tool, spindle speeds, feed
rate, tool change and several other functions
of the machine tool.
The MCU has a tape reader or an input device
to accept the part program from the user.
MCU converts the part program on the
punched tape (or through any other media)
into desired command signals for the
actuation system. MCU is thus the brain
behind the machine tool function.
2. Machine tool
Machine tool is that component of the
system which performs useful work. Number
of different standard kinds of machine tools
such as turning centres, milling machines,
drilling and grinding machines, coordinate
measuring machines etc..
A machine tool comprises of spindles,
motors and the control units. An important
feature of an NC system is the distinctive
tooling used for these machines. Each of the
cutting tool is set in a different adaptor.
3. Part Program and Part
Drawings
The program carrying instructions is an
important part of the NC system.
It gives a step by step instruction to the machine
tool for carrying out the operations as required.
The part program directs the machine tool
spindle and positions it with respect to the work
table on which the part to be machined is fixed.
Advanced instructions such as selection of
spindle speeds, cutting tools and other functions
can be a part of the program.
A number of languages are available for part
programming. The most popular is the APT
language
The programs have to be fed to the control
unit through some form of an input media.
Earlier, a punched tape was used as a form
of input. This tape was in the form of a long
roll of one inch width paper having punched
holes.
The holes were punched through a punching
machine and its hole pattern followed
standard codes by EIA ( Electronics
Industries Association).
The tape medium is now obsolete and in
current times magnetic cassettes, floppy
discs or the main disc drive of a computer
can be used to enter the program.
In modern machines, the MCU comes
equipped with a keyboard, which can be
directly used to manipulate and enter the
part program.
Types of NC systems
1. Point To Point ( Positioning
system)
The point to point is the most elementary form
of motion control.
In this the cutting tool moves from one
location to another.
While travelling from one location to another,
the path or speed at which it is not important.
Once the tool reaches the final position,
machining begins.
NC drill machines and spot welding machines
are typical examples of PTP control.
2. Straight cut NC
A straight cut control system is capable of
controlling the cutting tool parallel to one of
the major axes, at a controlled rate suitable
for machining.
It should be noted that this kind of an NC
system is not capable of angular cutting as the
system has motion control along one axis only.
The PTP and straight cut NC are also called as
finite positioning system.
Straight cut Nc systems can also perform PTP
operations with ease.
Milling operations, step turning are the
examples of straight cut NC system
3. Contouring Path NC or
Continuous Path NC
This is one of the most complex and
expensive systems as it can simultaneously
control more than one axes for complicated
machining of contours and surfaces.
This kind of a system can machine straight
or plane surfaces at any orientation, circular
paths, conical paths or any other
mathematically defined curve.
The contouring system machines by
continuously changing the rates of x and y
motion with respect to time.
Milling and turning operations by this
system can generate complicated
components very effectively.
A contouring NC has the ability to move its
drive motors at varying speeds while
positioning the system and hence cutting of
angles and arcs can be easily made.
Coordinate System and
Machine Motion
The purpose of defining the machine tool
coordinate axes is to provide a means of
locating a tool in relation to the workpiece.
Depending upon the machine, the location
of points on the machine can be done by
several methods. An important location of
the machine is the origin.
A NC machine can be define the origin in two
ways:
Fixed Zero or Floating Zero
1. Fixed Zero ( Machine Zero)
In a fixed zero or machine zero method, the
origin is always predefined.
Generally it is the lowermost left corner of
the worktable.
All other points on the worktable hence lie
defined by +x and +y positions from this
point.
2. Floating Zero ( Job Zero)
In modern NC machines, the concept of floating
Zero or Job Zero is provided.
This concept allows the operator to define his
origin.
This makes it convenient to develop programs
for symmetric parts by providing the origin at
the point of symmetry in the workpiece, rather
than convert the geometry about some fixed
point provided on the worktable.
This setting of the zero is done manually by the
operator, by positioning the tool about the
point at which the origin is to be defined.
Positioning of tool
1. Absolute Positioning
Absolute positioning of the tool locates the
position of the tool in absolute terms with
respect to the defined origin.
In given fig. the current location of the tool
is at A(30,20). From this point, the tool is to
move to the next location B.
In the Absolute Positioning system, the
point B would be defined by x = +60 and y =
+40 about the origin.
2. Incremental Positioning
In an incremental Positioning system, the
position of the tool can be specified relative
to the previous location.
As shown in fig. the current location of the
tool is at point A(30,20). From this point, the
tool is to move to the next location B.
In incremental Positioning system, the point
B would be defined by the increments in the
X and Y axis about point A.
Thus to reach the location B from A, the tool
is to move by x= +30 and y=+20 to reach
the necessary location.
Application of NC
Metal cutting m/c tools
Press working m/c tools
Welding machines
Inspection machines
Automatic machines
Assembly machines
Tube bending
Flame cutting
Industrial robots
Automated knitting machines
Cloth cutting
Automatic riveting
NC Word Address Format
This is one of the most common machine
code format.
It was developed as a tape programming
format.
It is also known as Variable Block Format, as
the program lines in this code may have
blocks of varying lengths.
WAF uses alphanumeric characters in
programming. The first character is an
alphabet and is also the address character.
NC Word Address Format
(WAF)
Sequence number
Preparatory code (G code)
Coordinates (X,Y,Z) word
Feed rate (f word)
Cutting Speed ( S word) S = 12*V / (pi *D )
Tool selection
Miscellaneous function ( M function)
1. Sequence Number ( N )
This is a block sequence number and is used
to number the lines of the NC code.
N numbers are ignored by the controller
during program execution.
Blocks can be searched by the controller
through the sequence number N.
2. Preparatory Function ( G
code)
This is commonly referred as G codes.
These functions change the control mode of
the machine.
The G code is typically followed by two
digits.
Examples: G00, G01,G02,G03, G71..etc
3. Coordinates (X,Y,Z,U,V,W)
These designate positions of the tools.
For two-axes system, only two words would
be specified.
In case of multiple – axes, other words such
as U, V and W would be needed to specify
additional axes.
Different NC systems use different formats
for expressing coordinates.
Example x – 4520 or x – 45.20
4. Feed rate function ( F)
This word is used to define the feed rate of
operation, for example F2.5 (mm per
revolution)
5. Cutting Speed Function (S)
This word is used to define the spindle
speed.
Example: S1500
(means 1500 rpm)
6. Tool Change ( T)
Most NC machines have tool magazines with
ATC’s.
For programming each tool an index number
is associated with it. Thus a T04 statement
would bring tool number 4 in ready position.
7. Miscellaneous Functions
( M Functions)
These functions initiate miscellaneous
functions such as turning ON and OFF of the
spindle, coolant ON and OFF , end the
program etc…
Example: M00, M01,M02, M30 etc…
Tape formats
Word address format
Tab sequential format
Fixed block format
Computer Numerical Control
CNC is an NC system that utilizes a dedicated,
stored program in computer to perform some or
all of the basic numerical control functions.
The typical cnc system uses a minicomputer as
the controller unit.
Advantages of CNC
1. Program storage
2. Online Part programming and Editing
3. Flexibility of the System
4. Fixed cycle, subroutines and custom built macros
5. Interpolations
6. Positioning features for setup
7. Expanded tool compensations
8. Easier maintenance of CNC with diagnostic software
9. Digitizing software
10. Communication interface
11. Metric conversions
Difference between NC and
CNC
Parameter NC CNC
Input mechanism Punch tape and Program is fed
punch card with the help of
keyboard
Alteration in Not possible Can be changed
operation
parameter
Memory to store Not available Memory storage is
information available in
computer
Cost Less expensive Highly expensive
Maintenance Low High
Accuracy Moderately Extensively
Parameter NC CNC
operator Must be highly Not must be
skilled highly skilled
required
Flexibility less High
Time consumption High less
Direct Numerical Control
DNC can be defined as a manufacturing
system in which number of machines are
controlled by a computer through direct
connection & in real time.
The system consists of four components:
Central computer
Bulk memory
Tele communication lines
Machine tools
Advantages of DNC
Control of more than one machine by the
computer
Greater computational capability
Remote computer location
Elimination of tapes
Difference between CNC & DNC
CNC DNC
Remote controlling of working It facilitate remote control
operation is not possible
Integral part of machine Not a integral part of machine,
DNC computer can locate a
distance from the machines
CNC machine has a Whereas DNC machine manage
transferring machine the information distribution to
instructions the number of machines
CNC machine a computer – By using DNC machine
controller NC machine programmer can control more
than one machine as required
CNC software is used to It does not only control the
increase the particular equipment but also serves as a
capacity of machine tool part of the management
information system
Adaptive Control
It is technique of automatically adjusting of
cutting parameters such as speeds, feeds and
depth of cuts etc. to an optimum satisfaction level
during machining operation, and the maximum
metal removal which will result in minimum
machining cost.
It is feedback system.
Cutting parameters are based on the experience.
Types of Adaptive Control
Adaptive control with optimization system
Adaptive control with constraints system
Geometric adaptive control systems
Adaptive Control with
Optimization system
Performance is optimized according to the given
prescribed index of performance.
Maximum production rate or minimum machining cost
IP = MRR / TWR
Adaptive Control with Constraints
system
Machining conditions (feed, speed)are maximized within
given limits of machines ( force, torque, power).
Tool condition monitor
Tool vibration sensor
Spindle torque sensor
Geometric Adaptive Control
systems
Used in finish machining
Main principle is : high cutting speed for better
surface finish
Various sensors are mounted on machine.
Part – II
CNC Turning
( Lathe)
Programming
Part programming
Part programming consists of a sequence of
instructions to be performed on the NC /
CNC machine.
There are two types
Manual Part Programming
Computer assist Part Programming
In order to prepared part programming the
programmer decides the order of
manufacturing operations required to
produce components.
The choice of machine tool and cutting tool
depends upon the operation.
Each line of program is numbered in
sequence, the details of operation are
stated and the x, y and z coordinates are
given.
Steps involved in Part
Programming
1. Prepare the process plan
2. Identify the machine tool
3. Select the drive axes
4. Choose tool
5. Determine machining parameters such as feed,
depth of cut, cutting speed
6. Make job and tool set – up plan
7. Decide the tool path
8. Write a part program
9. Test the program
10. Run the program
G – Codes
G – Code Lathe Function
G00 Rapid travel – axis motion at maximum speed
G01 Linear interpolation
G02 Clockwise circular motion using two axes in a single
program block
G03 Counter Clockwise circular motion using two axes in
a single program block
G10 Tool length offset
G20 Inch Programming ( some system)
G21 Metric Programming ( some system)
G28 Return to reference point
G29 Return from reference point
G – Codes Lath Function
G40 Cancel tool nose radius
G41 Tool nose radius compensation, left
G42 Tool nose radius compensation, right
G70 Finishing cycle
G71 Stock removal in turning
G72 Stock removal in facing
G73 Pattern repeating
G74 Peck drilling on Z axis
G75 Groove cutting on X axis
G76 Multiple thread cutting cycle
G – Codes Lathe Function
G90 Absolute positioning
G91 Incremental positioning
G94 Feed rate ( per min)
G95 Feed rate ( per revolution)
G96 Constant surface speed control
G97 Constant surface speed control,
cancel
Miscellaneous Functions
( M Functions)
M – Codes Function
M00 Program stop
M01 Optional or planned stop
M02 End of program
M03 Spindle ON – clockwise rotation
M04 Spindle ON- Counter clockwise
M05 Spindle OFF
M06 Tool change
M07 Coolant ON
M09 Coolant OFF
M30 End of the tape – will rewind
automatically
M– Function
Codes
M40 Low speed range in geared lathe
M41 Medium speed range in geared
lathe
M42 High speed range in geared lathe
M98 Call Subprogram
M99 Return to calling program
Machining formulas
Spindle RPM = 1000 * V/ (pi * D)
Where V = cutting speed, m /min
D = Diameter of the part or cutter revolving
in the spindle
The values of cutting speed vary from
material to material and type of machinning
Calculation of V( Cutting Speed)
Cutting Speed, V(m/min)
Material Lathe Drilling Milling
Tool steel 15 15 12
Cast iron 18 18 15
Mild steel 30 30 25
Brass, soft bronze 60 60 50
Aluminium, magnesium 90 90 60
Feed rates
1. lathe:
Feed in (mm/rev) FMMPR = 0.05 to 0.7
Feed in (mm/min) FMMPM = FMMPR X Spindle
RPM
2. Drilling
Drill Size Feed Rate (mm/rev), FMMPR
<3 mm 0.025 – 0.050
3 – 6 mm 0.05 – 0.100
6 – 12 mm 0.100 – 0.200
12 – 25 mm 0.200 – 0.400
Feed in (mm/min) FMMPM = FMMPR X Spindle RPM
3. Milling
Feed in (mm/min) FMMPM = Spindle RPM X Z X
f
Z= no. of teeth on the cutter
f= feed per tooth, mm/tooth
Material f (feed per tooth) mm
/tooth
Face Side mill End
mill mill
Low carbon steel 0.25 0.13 0.13
Medium carbon steel 0.22 0.13 0.10
High carbon steel 0.15 0.08 0.05
Stainless steel 0.15 0.10 0.05
Cast iron 0.30 0.15 0.15
Brass, Bronze 0.35 0.20 0.15
Aluminium 0.50 0.30 0.25
Problem – 1 :
Write a part program for given sand
component. Assume the speed of the
spindle is 1500 RPM and feed rate is 2.5 in
rev.
Figure
Program 1:
%
O0001;
N20 G28 U0.0 W0.0; (reference position) point - 1
N30 G21 G95 M42; (G21 for metric, G95 Feed rate
in rev, m42 mid speed geared)
N40 M03 S1500 M07; ( M03 spindle on , M05
coolant on)
N50 M06 T0101; (M06 tool change)
N60 G00 Z5.0 X0.0; (G00 rapid travel) point -2
N70 G01 Z0.0 F2.5 (G01 linear interpolation )
point - 3
N80 X20.0 point - 4
N90 G01 Z – 20.0; point - 5
N100 G01 X50.0; point -6
N110 G01 Z – 40.0 ;point - 7
N120 G01 X60.0; point - 8
N130 G00 Z0.0; point - 9
N140 M05 M09; (M05 spindle off)
N150 G28 U0.0 W0.0; point – 10
( G28 reference position)
N160 M30; ( end of Program and tape rewind)
Diagram
Problem – 2
Write a part program for given forged
component. Assume the speed of the
spindle is 1800 RPM and feed rate is 2.0 in
rev.
Program :
%
O0002;
N20 G28 U0.0 W0.0; point - 1
N30 G21 G95 M42;
N40 M03 S1800 M07;
N50 M06 T0101;
N60 G00 X0.0 Z5.0 M08; point - 2
N70 G01 Z0.0 F2.0 point - 3
N80 G01 X50.0; point - 4
N90 G01 Z-40.0; point - 5
N100 G01 X80.0; point - 6
N110 G01 Z-60.0; point – 7
N120 G01 X100.0; point – 8
N130 G01 Z-100.0; point - 9
N140 G01 X110.0; point - 10
N150 G00 Z5.0; point -11
N160 M05 M09;
N170 G28 U0.0 W0.0; point-12
N180 M30;
Diagram
Problem - 3
Write a part program for given forged
component. Assume the speed of the
spindle is 2000 RPM and feed rate is 2.0 in
rev.
Program
%
O0003;
N20 G28 U0.0 W0.0; point - 1
N30 G21 G95 M42;
N40 M03 S2000 M07;
N50 M06 T0101;
N60 G00 X0.0 Z5.0 M08; point - 2
N70 G01 Z0.0 F2.0 point - 3
N80 G01 X25.0; point - 4
N90 Z – 7.5; POINT - 5
N100 G01 X 40.0 Z- 15.0 F1.5 ; POINT - 6
N110 G01 Z – 25.0 F2.0; POINT – 7
N120 G01 X 60.0 Z – 35.0 F1.2 ; POINT - 8
N130 G01 X70.0; POINT -9
N140 G00 Z5.0; POINT -10
N150 M05 M09;
N160 G28 U0.0 W0.0 ; POINT – 11
N170 M30;
Problem – 4
Write a part program for given forged
component. Assume the speed of the
spindle is 2000 RPM and feed rate is 2.0 in
rev.
Program :
%
O0004;
N20 G28 U0.0 W0.0; point - 1
N30 G21 G95 M42;
N40 M03 S2000 M07;
N50 M06 T0101;
N60 G00 X0.0 Z5.0 M08; point - 2
N70 G01 Z0.0 F2.0 point - 3
N80 G03 X20.0 Z – 20.0 R10.0 F1.5 ; point - 4
N90 G01 Z – 45.0 F2.0; POINT – 5
N100 G01 X 40.0 Z – 80.0 F1.2; POINT – 6
N110 G01 Z – 105.0 F2.0 ; POINT – 7
N120 G02 X 70.0 Z – 120.0 R15.0 F1.0 ; POINT
–8
N130 G01 Z – 160.0 F1.75; POINT – 9
N140 X 80.0; POINT – 10
N150 G00 Z5.0; POINT - 11
N160 M05 M09;
N170 G28 U0.0 W0.0; POINT – 12
N180 M30;
Diagram
Canned cycles on Lathes
It is a process that can be executed with one command
instead of programming a series of individual moves.
When you machine a hole, you perform a group of well
defined motion.
Canned cycle performs these repetitive motion with a
simple set of codes.
Canned or fixed cycles are programming aids that simplify
programming.
Canned cycles combine many programming operations and
are designed to shorten the program length, minimize
mathematical calculations, and use minimal tool motions.
Examples: drilling, peck drilling, tapping, boring,
threading
Advantages of Canned Cycles
Reduced lengths of part program.
Less time required developing the program.
No need to write the same instructions
again and again in the program.
Less memory required in the control unit.
G71 : Stock Removal in
Turning (Rough Turn Cycle)
G71 turning cycle is used for rough-material removal
from a CNC lathe component. G71 turning cycle makes
large diameter cutting easy. Cutting can be done in
simple straight line or a complex contour can also be
machined very easily.
Through G71 turning cycle parameters CNC machinists
can control
• Depth of cut.
• Retract height.
• Finishing allowance in x-axis and z-axis.
• Cycle cutting-feed, spindle speed.
Programming :
G71 U . . . R . . . ;
G71 P . . . Q . . . U . . . W . . . F . . . S . . . ;
First block
Parameter Description
U Depth of cut
R Retract height
Second block
Parameter Description
P Contour start block number
Q Contour end block number
U Finishing allowance in x – axis
W Finishing allowance in z – axis
F Feed rate during G71 cycle
S Spindle speed during G71 cycle
G71 : Turning Diagram
G71 Turning cycle overview
G71 turning cycle cuts the whole contour
repeatedly which is given in P Q blocks.
Depth of every cut can be controlled by first-block U
value.
Second-block U W are the finishing allowances
which can be given if you want to make a finish cut
with G70 finishing cycle.
F is cutting feed and S is spindle speed (given in
second-block) which are used during G71 turning
cycle.
Note – The F and S given inside P Q block will not be
used during G71 turning cycle, they are used with
G70 finishing cycle if later called.
N80 G71 U2.0 R1.0 ;
N90 G71 P100 Q110 U0.3 W0.0 F0.2 ;
N100 G01 X70.0 ;
N110 Z – 50.0 ;
G70: Finish Face and Turn
Cycle
A G70 code is used to finishing face and
turning on Lathes. A typical block for the
use of this cycle would be:
N60 G70 P150 Q220
N60 is sequence number
G70 is code for finish cycle
P150 indicates the sequence number at
which the finish pass begins
Q220 indicates the sequence number at
which the finish pass ends
Problem – 5
Write a manual part program for machining
the component shown in fig. Use roughing
and finishing cycles for part programming.
Assume spindle speed as 500 rpm and feed
rate as 0.5 mm / rev.
Program :
%
N10 O0005;
N20 G28 U0.0 W0.0; point - 0
N30 G21 G95 M42;
N40 M03 S500 M07;
N50 M06 T0101;
(FACING OPERATION)
N60 G00 X0.0 Z5.0 M08; point - 1
N70 G01 Z0.0 F 0.5 point – 2
N80 X105.0; POINT – 3
N90 G00 Z5.0 G97 ; POINT – 4
( G97 Constant surface speed control, cancel)
(TURNING)
N100 G71 U 2.0 R1.0 ;
N110 G71 P120 Q200 U 0.5 W 0.0 F 0.5;
N120 G00 X 40.0 Z 5.0 ; POINT – 5
N130 G01 Z0.0; POINT - 6
N140 Z – 15.0 ; POINT – 7
N150 G02 X50.0 Z-20.0 R5.0; POINT - 8
N160 G01 X80.0; POINT - 9
N170 Z-65.0; POINT – 10
N180 G02 X90.0 Z-70.0 R5.0; POINT – 11
N190 G01 X100.0; POINT – 12
N200 G00 X105.0 Z5.0; POINT – 13
N205 G28 U0.0 W0.0;
(FINISHING)
N210 M06 T0202;
N220 G70 P120 Q200;
N230 G28 U0.0 W0.0; POINT - 14
N240 M05 M09;
N250 M30;
Diagram
Problem - 6
Write a manual part program for machining
the component shown in fig. Use roughing
and finishing cycles for part programming.
Assume spindle speed as 500 rpm and feed
rate as 0.5 mm / rev.
Program :
%
N10 O0005;
N20 G28 U0.0 W0.0; point - 0
N30 G21 G95 M42;
N40 M03 S500 M07;
N50 M06 T0101;
(FACING OPERATION)
N60 G00 X0.0 Z5.0 M08; point - 1
N70 G01 Z0.0 F 0.5 point – 2
N80 X65.0; POINT – 3
N90 G00 Z5.0 G97 ; POINT – 4
N100 G71 U2.0 R1.0;
N110 G71 P120 Q180 U1.0 W0.0 F0.25;
N120 G00 X20.0 Z5.0; POINT – 5
N130 G01 Z0.0; POINT – 6
N140 Z-10.0; POINT – 7
N150 G02 X40.0 Z-20.0 R10.0; POINT – 7
N160 G01 Z-30.0; POINT – 8
N170 G01 X60.0 Z-50.0; POINT – 9
N175 G01 X65.0; POINT -10
N180 G00 Z5.0 ; POINT – 11
N185 G28 U0.0 W0.0;
N190 M06 T0202;
N200 G70 P110 Q180 ;
N205 G28 U0.0 W0.0; POINT – 12
N210 M05 M09;
N220 M30;
Diagram
G72 : Stock Removal in
Facing (Rough Facing
Cycle)
A G72 code is used to rough facing and is
very similar to that for stock removal in
turning. In this case, the cutting operation is
performed parallel to X axis.
Through G72 facing cycle parameters CNC
machinists can control
• Depth of cut.
• Retract height.
• Finishing allowance in x-axis and z-axis.
• Cycle cutting-feed, spindle speed.
Programming :
G72 W . . . R . . . ;
G72 P... Q...U...W... F...S... ;
First block
Parameter Description
W Depth of cut
R Retract height
Second block
Parameter Description
P Contour start block number
Q Contour end block number
U Finishing allowance in x – axis
W Finishing allowance in z – axis
F Feed rate during G71 cycle
S Spindle speed during G71 cycle
G72 : Facing Diagram
G76 : Multiple Threading
Cycle
There are different methods available for
programming threading operations. Tapered
screws and scroll threads can be cut by using a
G32 code.
A G32 code can be used the following syntax:
N10 G32 X40.0 Z – 20.0 F2.5;
This generates one pass of thread. Depending on
the depth of the thread, multiple passes would
be required to generate the threading.
Instead of writing multiple lines using G32 code,
a multiple cycle is available by using the canned
cycle called by G76 code.
When a G76 code is issued, the machine
makes a threading pass, then automatically
retracts the tool to the reference X – axis
position and returns it to the Z – axis start
position. Then it automatically repeats the
procedure until the final depth of the thread
is achieved,
When cutting threads, the relationship
between spindle speed and the tool federate
are critical. When a G76 code is issued, the
federate controls are not available to the
operator.
An important thing to note is that before
beginning a thread pass, a certain distance
α must be allowed ahead of the part face to
the lathe carriage time to accelerate to the
proper federate. The absence of this
distance may result in improper leads on the
first few threads.
On similar lines, a stopping distance β
should be provided to ensure proper
retrieval for the tool. The magnitude of α
and β varies from machine to machine and
should be read from the manuals.
Programming :
G76 P _ _ _ Q __ R __ ;
G76 X _ Z_ P _ Q_ F_ ;
First block
Parameter Description
P 1. First two digit represents finish passes
2. Next two digits represents chamfer
angle
3. Last two digits represents angle of tool
Q Minimum cutting depth in micron
R Finishing allowances in microns
Second block
Paramet Description
er
X 1. Indicates minor diameter in case of external
threads
d=D-2k
2. Major diameter in case of internal threads
D=d+2k
Z Thread length
P Height of thread in micron ( = pitch /1.63)
Q Depth of initial cut in micron
F Pitch of the thread
Problem - 7
Write a manual part program for machining
the threading portion of the components
shown in fig.
Assume spindle speed as 450 rpm.
Program:
%
O0007;
N10 G28 U0.0 W0.0;
N20 G95 G21 M42;
N30 G00 X0.0 Z5.0;
N40 M06 T0101;
N50 S450 M04;
N60 M07;
N70 G00 X22.0 Z5.0;
N80 G76 P010060 Q300 R100;
(single finish pass indicated by 01,no chamfer (00) and angle of
tool 60)
N90 X16.932 Z-20.0 P1534 Q300 F2.5;
(X = minor diameter = major dia – 2*k)
(k = pitch / 1.63 = 1.534 so X = 20 – 2*1.534 = 16.932)
(P= height of thread = pitch / 1.63 = 2.5/1.63 = 1.534mm)
(Q = depth of initial cut in micron = 0.3mm)
(F = pitch of threads is 2.5mm)
N100 G28 U0.0 W0.0;
N110 M05 M09;
N120 M30;
Problem – 8
Write a complete part program for
machining the components shown in fig.
Program :
%
O0008;
N10 G28 U0.0 W0.0;
N20 G95 G21 M42;
N30 M06 T0101;
N40 S1000 M03;
N50 G00 X0.0 Z5.0; POINT – 1
(FACING)
N60 G01 Z0.0 F1.2; POINT - 2
N70 X42.0; POINT - 3
N80 G00 Z5.0 G97 ; POINT – 4
N90 G71 U2.0 R1.0;
N100 G71 P110 Q180 U0.5 W0.0 F0.25;
N110 G00 X26.0 ; POINT – 5
( 2mm chamfer so 30-2*2=26)
N120 G01 X30.0 Z-2.0; POINT – 6
N130 Z-16.0 ; POINT - 7
N140 G02 X30.0 Z-28.0 R12.0; POINT – 8
N150 G01 Z-43.0; POINT - 9
N160 G01 X40.0 Z-48.0; POINT -10
N170 G01 Z-60.0; POINT – 11
N180 G00 X45.0 Z5.0; POINT -12
N190 M05;
(threading)
N200 T0202 M06;
N210 S400 M04;
N220 G00 X30.0 Z5.0;
N230 G76 P010060 Q300 R100;
(finishing cut =01, chamfer = 00 (no), tool angle
=60)
N240 G76 X27.546 Z-16.0 P1227 Q300 F2.0;
Height of thread = k=p/1.63=2/1.63 =1.227
Minor dia = 30 – 2*1.227 = 27.546
Q= depth of initial cut =0.3mm
F= pitch =2mm
N250 G28 U0.0 W0.0;
N260 M05;
N270 M09;
N280 M30;
Diagram
G75: Groove cutting on X -
Axis
A groove can be cut on the X – axis by the
canned cycle.
This cycle allows for incremental machining
in the X and Z axis.
Syntex
N50 G75 R_ ;
Parameter Description
R Indicates thee relief or escape of the
tool /
Retract
N60 G75 X_ Z_ P_ Q_ F_ ;
Parameter Description
X The finished groove diameter
Z Width or end point of the groove
P The incremental depth of cut on the
X axis in micron
Q The incremental depth of cut on the
Z axis in microns
F Feed rate in mm/rev
Problem – 9
develop a program using appropriate G and
M codes to turn a MS bar of size and shape
shown in fig. Use various canned cycles for
roughing, grooving and threading
operations. Assume suitable data for speed,
feed and depth of cut. The raw material size
is dia 30 X 60 bar.
Program:
%
O0009;
N10 G28 U0.0 W0.0;
N20 G95 G21 M42;
N30 M06 T0101;
N40 S1000 M03;
N50 G00 X0.0 Z5.0; POINT – 1
(FACING)
N60 G01 Z0.0 F1.2; POINT - 2
N70 X32.0;POINT - 3
N80 G00 Z5.0 ; POINT – 4
(TURNING)
N90 G71 U2.0 R1.0;
N100 G71 P110 Q150 U0.5 W0.0 F0.5;
N110 G00 X20.0 Z0.0; POINT – 5
N120 G01 Z-45.0; POINT – 6
N130 G02 X30.0 Z-45.0 R5.0; POINT - 7
N140 G01 Z-60.0; POINT – 8
N150 G00 X35.0 Z0.0; POINT – 9
N160 M05 M09;
N170 G28 U0.0 W0.0;
N180 T0202 M06;
N190 M03 S1500;
N200 M07;
N210 G70 P110 Q150;
N220 M05 M09;
N230 G28 U0.0 W0.0;
N240 M03 S1500 M07;
(GROOVING – 2MM WIDTH)
N250 S800 M03;
N245 T0303 M06;
N260 M07;
N270 G00 X30.0 Z0.0; POINT – 1’
N280 Z-25.0; POINT – 2’
N290 X22.0; POINT – 3’
N300 G75 R1.0;
N310 G75 X14.0 Z-28.0 P1500 Q500 F0.2; POINT – 4’
N320 G00 X30.0; POINT – 5’
N330 G28 U0.0 W0.0;
N340 M05 M09;
(THREADING)
N350 T0505 M06;
N360 S500 M04 M07;
N370 G00 X20.0 Z5.0; POINT – P
N380 G76 P010060 Q300 R100;
N390 G76 X16.932 Z-25.0 P1534 Q300 F2.5; POINT – Q
N400 G28 U0.0 W0.0;
N410 M05 M09;
M30;
G74 : Drilling Cycle
Part - III
CNC Milling
Programming
G – Codes
G – Code Milling Function
G40 Cancel cutter diameter
compensation
G41 Cutter diameter compensation, left
G42 Cutter diameter compensation, right
G43 Tool length compensation (positive)
on
G44 Tool length compensation
(negative) on
G49 Tool length compensation OFF
G70 Inch programming
G71 Metric programming
G– Milling Function
Code
G76 Fine boring cycle
G80 Cancel Canned Cycle
G81 Drilling cycle
G82 Counterboring cycle
G84 Tapping cycle
G87 Boring peck
G92 Repositioning or resetting the origin
point
G98 Return to initial level
G99 Return to reference level
Tool length Compensation
There are two basic methods to account for
tool lengths: pre-setting the tool and CNC
controller’s tool length compensation.
In a preset tool method, the tool length is
measured and the known length can then be
added into the program’s Z – axis
coordinates to account for the tool. This is
called as presetting the tool. This method
requires special tool setting equipment for
accurate measurement of tools.
In a CNC machine setup, a programmable
tool register is available. A tool register is a
memory location in the computer where the
tool length may be stored. When a particular
tool is called, the necessary information for
the tool offset is called from the tool
register. The MCU then shifts the Z axis by
the amount stored in the offset register.
Cutter Diameter compensation
In profile cutting operations, an allowance is
to be provided for the cutter radius in the
programmed coordinates.
For example, consider a component as shown
in fig. The tool path is the one decided by the
spindle axis center line.
Depending upon the cutter radius, the
programmer will have to generate new
coordinate positions.
This is complicated and would also mean
editing the program everytime the cutter
diameter changes.
Most CNC machines have a built – in –
feature called Cutter Diameter
Compensation that allows the user to input
the cutter diameter compensation for each
tool. This allowance is read by the control
system, the moment the tool is selected and
it alters the tool path by a among contained
in the cutter compensation register.
Thus the programmer can now write a
program based on the component profile,
without worrying about the cutting tool
dimensions.
G40: Cutter Diameter Compensation Cancel
G41: Cutter Diameter Compensation LEFT
G42: Cutter Diameter Compensation RIGHT
Problem – 1
Write a manual part program for the
component shown in fig. Assume the new
product as cast iron and the machining is to
achieve the various dimensions.
Program
Drill dia = 10 mm
Raw material = cast iron (means cutting speed = 18 m/min)
RPM = 1000 X V / (pi*D) = 576 rpm
Milling : assume ,cutter dia = 10 mm
So cutting speed = 15 m/min
RPM = 480 rpm
Assume no. of teeth Z = 4
Feed in (mm/min) FMMPM = Spindle RPM X Z X f
= 480 X 4 X0.15 = 288 mm/min = 290 mm/min
%
O0001;
G00 G40 G80 G71 G90;
(G40 cancel cutter diameter compensation, G80 cancel
drill cycle, G71 metric, G90 absolute dimension)
T01 M06; ( DRILLING)
S575 M03 M07;
G43 Z0.0 H01; (tool length offset )
G00 X25.0 Y25.0;
G81 X25.0 Y25.0 Z-15.0 R1.0 F115; POINT – 1
X125.0 Y75.0; POINT – 2
G80 G00 Z0.0 ;
M05 M09;
G00 G40 G80 G71 G90;
T02 M06; ( MILLING)
G00 X175.0 Y30.0 S480 M03; POINT - 3
G42 G43 M07 (cutter compensation right and
cutter length compensation on)
G43 Z0.0 H01;
G01 Z-12.0 F290;
G01 X150.0; POINT - 4
Y100.0; POINT - 5
X50.0 ; POINT – 6
G01 X0.0 Y50.0; POINT - 7
Y0.0; POINT - 8
X120.0; POINT – 9
G02 X150.0 Y30.0 R30.0; POINT - 4
G00 X175.0 ; POINT – 3
Z20.0;
G40;
M05 M09;
M30;
#REGION
$AddRegPart 1,25,25
G92 X25 Y25 Z20
T1 M06
G00 X25 Y25 Z5
G81 Z-5 R1 S575 M03 F115 M08
X125 Y75
G80
M05 M09
T2 M06
G00 X175 Y25
Z5
S480 M03 F290
G01 Y30 Z-20
Y100
X50
G01 X0 Y50
Y00
X120
G02 X150 Y30 R30
G00 Z20
M05 M09 M30
#ENDREGION
( for CNC simulator – the size of
component is 150 X 100 X 20 mm)
Program – 2
Write a NC part program to machine by
using G and M code to cut a slot of 5mm
deep for the given component. Using an
endmill of 6mm diameter and assume
suitable machining parameters.
Milling : assume ,cutter dia = 6 mm
So cutting speed = 15 m/min
RPM = 800 rpm
Assume no. of teeth Z = 4
Feed in (mm/min) FMMPM = Spindle RPM X Z X
f
= 800 X 4 X0.15 = 480 mm/min
%
O0002;
G00 G40 G80 G71 G90;
(G40 cancel cutter diameter compensation, G80 cancel
drill cycle, G71 metric, G90 absolute dimension)
T0101 M06; ( MILLING)
M07;
G41;
G43 Z0.0 H01;
S800 M03;
G00 X15.0 Y15.0 Z-7 F480 ;
G01 Y65.0 ;
G02 X35.0 Y65.0 R10.0;
G03 X65.0 Y65.0 R15.0;
G01 X75.0;
Y30.0;
G01 X60.0 Y15.0;
X15.0;
G00 Z5.0 M05 M09;
M30;
$AddRegPart 1,20,20
G92 X20 Y20 Z5
(ASSUME RAW MATERIAL 90 x 90 x 20)
T1 M06
G00 X15 Y15
G01 Z-5 F250 S800
Y65
G02 X35 Y65 R10
G03 X65 Y65 R15
G01 X75
Y30
G01 X60 Y15
G01 X15
G00 Z5
M05 M09
M30
Prpgram – 3
Write a manual part program for the
component shown in fig. Assume the raw
product as cast and the machining is to
achieve the various dimensions. The
thickness of the casting is 10mm.
Milling : assume ,cutter dia = 10 mm
So cutting speed = 15 m/min
RPM = 480 rpm
Assume no. of teeth Z = 4
Feed in (mm/min) FMMPM = Spindle RPM X Z X
f
= 480 X 4 X0.15 = 288 mm/min = 290
mm/min
%
O0003;
G00 G40 G80 G71 G90;
(G40 cancel cutter diameter compensation,
G80 cancel drill cycle, G71 metric, G90
absolute dimension)
T0101 M06; ( MILLING)
S480 M03 M07;
G42;
G43 Z0.0 H01;
G00 X110.0 Y10.0; point – 1
Z-15.0 F290 ;
G01 X100.0 ; POINT - 2
Y10.0; POINT - 3
G02 X50.0 Y60.0 R50.0; POINT -4
G01 X40.0; POINT - 5
Y35.0; POINT - 6
X0.0; POINT -7
Y25.0; POINT -8
G02 X25.0 Y25.0 R25.0; POINT - 9
G01 X100.0; POINT - 2
G00 G40 M05 M09;
M30;
#region
$AddRegPart 1,25,25
G92 X25 Y25 Z20
T1 M06G00 X110 Y20 Z5
S480 M03 F290
G00 X100 Y0.0
G01 X100 Z-10
G02 X50 Y60 R50
G01 X40
Y35
X00
Y25
G02 X25 Y0 R25
G01 X100
M05 M09 M30
#endregion
PROBLEM – 4
Write a manual part program for the
component shown in fig. Assume the raw
product as cast and the machining is to
achieve the various dimensions. The
thickness of the casting is 10mm.
Milling : assume ,cutter dia = 10 mm
So cutting speed = 15 m/min
RPM = 480 rpm
Assume no. of teeth Z = 4
Feed in (mm/min) FMMPM = Spindle RPM X Z X
f
= 480 X 4 X0.15 = 288 mm/min = 290
mm/min
%
O0004;
G00 G40 G80 G71 G90;
(G40 cancel cutter diameter compensation, G80 cancel
drill cycle, G71 metric, G90 absolute dimension)
T0101 M06; ( MILLING)
S480 M03 M07;
G41;
G43 Z0.0 H01;
G00 X15.0 Y15.0; point – 1
Z-15.0 F290 ;
G01 Y70.0 ; POINT – 2
G02 X30.0 Y85.0 R15.0 ; POINT – 4
G01X85.0; POINT - 5
Y15.0; POINT – 6
X15.0; POINT – 1
G00 Z2.0 ;
M05 M09;
Drill dia = 10 mm
Raw material = cast iron (means cutting speed =
18 m/min)
RPM = 1000 X V / (pi*D) = 576 rpm
Milling : assume ,cutter dia = 10 mm
So cutting speed = 15 m/min
RPM = 480 rpm
Assume no. of teeth Z = 4
Feed in (mm/min) FMMPM = Spindle RPM X Z X f
= 480 X 4 X0.15 = 288 mm/min = 290 mm/min
T02 M06; ( DRILLING)
S575 M03 M07;
G43 Z0.0 H01; (tool length offset )
G00 X30.0 Y30.0 Z2.0 ; POINT – S1
G81 Z-15 R1 M03 M08;
Y70 ; POINT – S2
X70; POINT – S3
Y30; POINT – S4
G80 Z50;
M30;
#region
$AddRegPart 1,30,30
G92 X30 Y30 Z20
T2 M06
G00 X30 Y30
G81 Z-5 R1 M03 M08
Y70
X70
Y30
G80
Z5
T1 M06
G00 X15 Y15 Z2
G01 Z-5 F250 S2000 M03
Y70
G02 X30 Y85 R85
G01 X85
Y15
X15
G00 Z2
M30
#endregion
Problem:
Write a manual part program for machining the
plate as shown in fig. The complete machining is
to be done from a rectangular solid plate of
thickness 10mm is available. Assume the job
material is mild steel.
Drilling parameters
Drill dia is =8mm
V = 30 m / min
RPM = 320 V / D = 1200 rpm
Feed = 0.1 mm / rev. = 0.1 X 1200 = 120
mm/min
Milling :
D = 25 mm
V = 25 m/min
RPM = 320 V / D = 320 rpm
For end mill cutter f = 0.1 mm / tooth
Assume Z = no. of teeth = 4
F MMPM = Spindle RPM X Z X f = 128 mm / min
Milling :
D = 10 mm
V = 25 m/min
RPM = 320 V / D = 800 rpm
For end mill cutter f = 0.1 mm / tooth
Assume Z = no. of teeth = 4
F MMPM = Spindle RPM X Z X f = 320 mm / min
%
O005;
G00 G40 G80 G71 G90;
G28 T0101 M06;
M03 S320;
M05;
Subprogram OR Subroutinnes
A subprogram or subroutine is a separate
program called by another program. The use
of subprograms can significantly reduce the
amount of programming required on some
parts.
When subprogram statement is issued in the
main NC program, the MCU switches to the
subprogram and it is executed. At the end of
the subprogram, the command is again
directed to the main program as shown in
fig.
Subprograms are used when repetitive
machining is required at different
orientations.
For calling a subprogram the word M98 is
used along with the word P<subprogram ID
1020 in this case>.
This is followed by the word L and a numeral
which indicates the number of times the
subprogram is to be executed. L1 would thus
mean that the subprogram will be executed
one time.
The subprograms end with the word M99 and
the control is then passed back to the main
calling program.
Problem:
Write a manual part program for given
figure using sub praogramming.
Program
01000
#region
$AddRegPart 1,20,20
G92 X20 Y20 Z20
T1 M06
G17 G80
G00 X10 Y10 S800 M03
G81 Z-20 F180 M08
M98 P1001
:1001
Y30
y50
Y70
X30
X50
X70
X90
Y50
Y30
Y10
x70
x50
x30
g80
m99
m30
Problem :
Write a program for the drilling operation as
required for the component shown in fig.
Assume plate thickness as 10mm, spindle
speed as 1500 rpm and feed rate as
150mm / min.
Program
#region
$AddRegPart 1,20,20
G92 X20 Y20 Z10
T1 M06
G17 G80
G00 X20 Y20 S1500 M03
G81 Z-10 F150
M98 P1001
X60 Y20
M98 P1001
X100 Y20
M98 P1001
X140 Y20
M98 P1001
G80
M99
M30
:1001
G91 X-10 Y10
Y-20
X20
Y20
G90
M99
#ENDREGION