You are on page 1of 12

Subject : Computer Aided Manufacturing

Topic : CNC Programming

3/23/2020 Dr.A.Shanmuganathan 1
NC Part Programming

1. Manual part programming


2. Manual data input
3. Computer-assisted part programming
4. Part programming using CAD/CAM

3/23/2020 Dr.A.Shanmuganathan 2
Creating Instructions for NC
• Bit - 0 or 1 = absence or presence of hole in the
tape
• Character - row of bits across the tape(sequence of
bits forms a character)
• Word - sequence of characters (e.g., y-axis
position)
• Block - collection of words to form one complete
instruction
• Part program - sequence of instructions (blocks)

3/23/2020 Dr.A.Shanmuganathan 3
Letter Addresses
 Letter Addresses are variables used in G- and M-codes to make words. Most G-codes contain a
variable, defined by the programmer, for each specific function. Each designation used in CNC
programming is called a letter address.
The letters used for programming are as follows:
 N Block number
 G Preparatory function
 X X axis coordinate
 Y Y axis coordinate
 Z Z axis coordinate
 I X axis location of arc center
 J Y axis location of arc center
 K Z axis location of arc center
 S sets the spindle speed
 F assigns a feed rate
 T specifies tool to be used
 M Miscellaneous function
 U Incremental coordinate for X axis
 V Incremental coordinate for Y axis
 W Incremental coordinate for Z axis
3/23/2020 Dr.A.Shanmuganathan 4
G-codes & M-codes

3/23/2020 Dr.A.Shanmuganathan 5
3/23/2020 Dr.A.Shanmuganathan 6
3/23/2020 Dr.A.Shanmuganathan 7
Word Address format

The RS274-D is a word address format

Each line of program == 1 block

Each block is composed of several instructions, or (words)

Sequence and format of words:

N3 G2 X+1.4 Y+1.4 Z+1.4 I1.4 J1.4 K1.4 F3.2 S4 T4 M2

sequence no destination coordinates dist to center of circle tool

feed rate spindle speed


preparatory function
miscellaneous function
3/23/2020 Dr.A.Shanmuganathan 8
Three Major Phases of A CNC Program

• The following shows the three major phases of a CNC program.

%
: 1001
N5 G90 G20 Program set up
N10 M06 T2
N15 M03 S1200
N20 G00 X1.00 Y1.00
N25 Z0.125
N30 G01 Z-0.125 F5.0 Material removal
N35 G01 X2.0 Y2.0
N40 G00 Z1.0
N45 X0 Y0
N50 M05
N55 M30 System shutdown

3/23/2020 Dr.A.Shanmuganathan 9
Three Major Phases of A CNC Program

1. Program Setup
The program setup contains all the instructions that prepare the machine for operation.
% Program start flag
: 1001 Four-digit program number
N5 G90 G20 Use absolute units and inch programming
N10 M06 T2 Stop for tool change, use tool #2
N15 M03 S1200 Turn the spindle on CW to 1200 rpm

3/23/2020 Dr.A.Shanmuganathan 10
Three Major Phases of A CNC Program

2. Material Removal
The material removal phase deals exclusively with the actual cutting feed moves.
N20 G00 X1.0 Y1.0 Rapid move to (X1, Y1) from origin
N25 Z0.1 Rapid down to Z1.0 just above the part
N30 G01 Z-0.125 F5.0 Feed down to Z-0.125 at 5 ipm
N35 X2.0 Y2.0 Feed diagonally to X2 and Y2
N40 G00 Z1.0 Rapid up to Z1 (clear the part)
N45 X0 Y0 Rapid back home X0 Y0

3. System shutdown
The system shutdown phase contains the G- and M-codes that turn off all the options that
were turned on in the setup phase.
N50 M05 Turn the spindle off
N55 M30 End of program

3/23/2020 Dr.A.Shanmuganathan 11
Popularly used Blocks and Block formats

3/23/2020 Dr.A.Shanmuganathan 12

You might also like