0% found this document useful (0 votes)
72 views53 pages

CNC Programming Basics

CNC programming involves writing a series of commands called part programs that direct the motion of machine tools. Part programs are made up of blocks containing addresses and values. Important aspects of programming include axis designations, units, G and M codes, coordinates, feed rates and spindle speeds, and tool control. Proper programming requires adhering to syntax rules and sequencing of commands to achieve the desired tool motions and machining operations.

Uploaded by

pramod Chougule
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)
72 views53 pages

CNC Programming Basics

CNC programming involves writing a series of commands called part programs that direct the motion of machine tools. Part programs are made up of blocks containing addresses and values. Important aspects of programming include axis designations, units, G and M codes, coordinates, feed rates and spindle speeds, and tool control. Proper programming requires adhering to syntax rules and sequencing of commands to achieve the desired tool motions and machining operations.

Uploaded by

pramod Chougule
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/ 53

CNC PROGRAMMING BASICS

 CNC instructions are called part program


commands.
OR
A series of commands which “direct” the
cutter motion and support systems of the
machine tool.
CNC PROGRAMMING BASICS

 When running, a part program is


interpreted one command line at a time
until all lines are completed.

 Commands, which are also referred to as


blocks, are made up of words which each
begin with a letter address and end with a
numerical value.
IMPORTANT THINGS TO KNOW

 Machine Axis Designation


 Units, incremental or absolute positioning
 G-code & M-code (Language of machine)
 Coordinates: X,Y,Z, RX,RY,RZ
 Feed rate and spindle speed
 Tool Control: Tool and tool parameters
MACHINE AXIS DESIGNATION
 Used for the tool path
 Must be identical to the coordinate system used by the
CNC machine

1 2 3

X - Primary Linear U - Secondary axis A - Angular axis around


Axis  parallel to X axis  X axis
 
Y - Primary Linear V - Secondary axis B - Angular axis around
Axis  parallel to Y axis Y axis 
   
Z - Primary Linear W- Secondary axis C - Angular axis around
Axis parallel to Z axis. Z axis.
MACHINE AXIS DESIGNATION

Vertical milling
center

Horizontal
Milling
Center
MACHINE AXIS DESIGNATION
 More complex CNC machines have the
capability of executing additional rotary motions
(4th and 5th axes).
UNITS - INCREMENTAL OR ABSOLUTE
POSITIONING
 Absolute system
UNITS - INCREMENTAL OR ABSOLUTE POSITIONING

 Incremental system
ZERO POINT OR ZERO DATUM
 There are two methods of specifying
this zero point

1. FIXED ZERO : It is the zero point of NC machine


tool fixed by manufacturer.

It is always located at the same position of the


machine tool.
ZERO POINT OR ZERO DATUM

2. FLOATING ZERO : It is the zero point of the


NC machine tool set by the operator at any position
on the machine.

The part programmer decides this zero point


depending on his programming suitability and
communicates the same to the operator.

Operator sets this floating zero before starting the


operation.
REFERENCE POINTS
 MACHINE REFERENCE : It is the
reference points fixed by the
manufacturer.
REFERENCE POINTS
 WORK
REFERENCE It
is the floating
zero on the work
piece.

 It is set by
operator and also
varies from job to
job.
PROGRAMMING KEY LETTERS
 N – Block number/Sequence number
 G - Preparatory function
 X - X axis designation
 Y - Y axis designation
 Z - Z axis designation
 R - Radius designation
 F - Feed rate designation
 S - Spindle speed designation
 H - Tool length offset designation
 D - Tool radius offset designation
 T - Tool Designation
 M - Miscellaneous function
IMPORTANT G CODES
 G00 - Rapid Transverse
 G01 - Linear Interpolation
 G02 - Circular Interpolation, CW
 G03 - Circular Interpolation, CCW
 G17 - XY Plane, G18 XZ Plane, G19 YZ Plane
 G20/G70 - Inch units
 G21/G71 - Metric Units
 G40 - Cutter compensation cancel
 G41 - Cutter compensation left
 G42 - Cutter compensation right
IMPORTANT G CODES

 G43 - Tool length compensation (plus)


 G43 - Tool length compensation (plus)
 G44 - Tool length compensation (minus)
 G49 - Tool length compensation cancel
 G80 - Cancel canned cycles
 G81 - Drilling cycle
 G82 - Counter boring cycle
 G83 - Deep hole drilling cycle
 G90 - Absolute positioning
 G91 - Incremental positioning
IMPORTANT M CODES

 M00 - Program stop


 M01 - Optional program stop
 M02 - Program end
 M03 - Spindle on clockwise
 M04 - Spindle on counterclockwise
 M05 - Spindle stop
 M06 - Tool change
 M08 - Coolant on
 M09 - Coolant off
 M10 - Clamps on
 M11 - Clamps off
 M30 - Program stop, reset to start
RULES FOR PROGRAMMING

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 M2s

destination coordinates dist to centre of circle tool


sequence no

feed rate spindle speed


preparatory function

miscellaneous function
RULES FOR PROGRAMMING

 Restrictions on CNC blocks

• Each may contain only one tool move

• Each may contain only one feed rate

• Each may contain only one specified tool or spindle speed

• The block numbers should be sequential

• The data within a block should follow the sequence shown

in the above sample block


Programming Example

Raw Material Finished Part


y
Programming Example
G55 X200 Y80
Program 1- 0015

x N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X30 Y60 Z-0.5 XY Feed 75
N008 G01 X0 Y40 Z-0.5 XY Feed 75
N009 G01 X0 Y0 Z-0.5 XY Feed 75
N010 G81 R3 E9 N7 Z-0.5
N011 M05
N012 M02
y Programming Example
Tool Change
G55 X200 Y80
Program 2 - 0016
N001 M06 T2
N002 M03 rpm 400
x
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XYFeed 150 ZFeed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150
N010 G01 X50 Y45 Z10 Z Feed 150
N011 G01 X50 Y45 Z-10 Z Feed 75
N012 G01 X50 Y45 Z10 Z Feed 150
N013 M05
N014 M02
Program Interpretation
G55 X200 Y80
Setting the datum to the lower left corner of the work
piece
Program Interpretation
G55 X200 Y80

Program 1 - 0015

Program Identification Number


Program Interpretation

G55 X200 Y80

Program 1

N001 M06 T1

N001 Sequence Number

M06 Tool Change (End Mill with Diameter=12mm)

T1 Tool Number
Program Interpretation

G55 X200 Y80

Program 1

N001 M06 T1

N002 M03 rpm 400

Start rotating the spindle clockwise with 400 rpm


Program Interpretation

G55 X200 Y80

Program 1

N001 M06 T1

N002 M03 rpm 400

N003 G01 X-8 Y0 Z0 XY Feed 150

Go to Safe Position with feed 150mm/min


Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1

N002 M03 rpm 400

N003 G01 X-8 Y0 Z0 XY Feed 150

N004 G01 X-8 Y0 Z-0.5 Z Feed 150

Lower the end mill to determine the depth of cut


Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75

Move from the lower left


corner of the work piece to
the right lower one cutting
with feed=75mm/min
Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75

Move from the lower left corner of the


work piece to the right lower one
cutting with feed=75mm/min
Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X-30 Y60 Z-0.5 XY Feed 75

Cutting the horizontally up to


X= -30
Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X30 Y60 Z-0.5 XY Feed 75
N008 G01 X0 Y40 Z-0.5 XY Feed 75

Cutting to X=0 & Y=40


Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X30 Y60 Z-0.5 XY Feed 75
N008 G01 X0 Y40 Z-0.5 XY Feed 75
N009 G01 X0 Y0 Z-0.5 XY Feed 75

Complete the countering


Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X30 Y60 Z-0.5 XY Feed 75
N008 G01 X0 Y40 Z-0.5 XY Feed 75
N009 G01 X0 Y0 Z-0.5 XY Feed 75
N010 G81 R3 E9 N7 Z-0.5

Repeat 7 times blocks from N003 to N009 with


incremental offset of Z=-0.5
Program Interpretation
G55 X200 Y80

Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X30 Y60 Z-0.5 XY Feed 75
N008 G01 X0 Y40 Z-0.5 XY Feed 75
N009 G01 X0 Y0 Z-0.5 XY Feed 75
N010 G81 R3 E9 N7 Z-0.5
N011 M05

Spindle Off
Program Interpretation
G55 X200 Y80
Program 1

N001 M06 T1
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X-8 Y0 Z-0.5 Z Feed 150
N005 G01 X70 Y0 Z-0.5 XY Feed 75
N006 G01 X70 Y60 Z-0.5 XY Feed 75
N007 G01 X30 Y60 Z-0.5 XY Feed 75
N008 G01 X0 Y40 Z-0.5 XY Feed 75
N009 G01 X0 Y0 Z-0.5 XY Feed 75
N010 G81 R3 E9 N7 Z-0.5
N011 M05
N012 M02

End Program
Program Interpretation

Tool Change

Changing the tool


Program Interpretation
Tool Change

G55 X200 Y80


Setting the datum to the lower left corner of the work
piece
Program Interpretation

Tool Change

G55 X200 Y80

Program 2 - 0016

Program Identification Number


Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2

N001 Sequence Number


M06 Tool Change (Drill with Diameter=6mm)
T2 Tool Number
Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400

Start rotating the spindle clockwise with 400 rpm


Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150

Go to Safe Position with feed 150mm/min


Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150

Stop above the center of the first hole


Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150
Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75

Start Drill the first hole


Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150

Retract to a position above the hole


Program Interpretation

Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150

Stop above the center of the second hole


Program Interpretation
Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150
Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75

Drill the second hole


Program Interpretation
Tool Change

G55 X200 Y80

Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150

Retract to a position above the second hole


Program Interpretation
Tool Change
G55 X200 Y80
Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150
N010 G01 X50 Y45 Z10 Z Feed 150

Stop above the center of the third hole


Program Interpretation
Tool Change
G55 X200 Y80
Program 2

N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150
Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150
N010 G01 X50 Y45 Z10 Z Feed 150
N011 G01 X50 Y45 Z-10 Z Feed 75

Drill the third hole


Program Interpretation
Tool Change
G55 X200 Y80
Program 2
N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150
N010 G01 X50 Y45 Z10 Z Feed 150
N011 G01 X50 Y45 Z-10 Z Feed 75
N012 G01 X50 Y45 Z10 Z Feed 150

Retract to a position above the third hole


Program Interpretation
Tool Change
G55 X200 Y80
Program 2
N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150
N010 G01 X50 Y45 Z10 Z Feed 150
N011 G01 X50 Y45 Z-10 Z Feed 75
N012 G01 X50 Y45 Z10 Z Feed 150
N013 M05
Spindle off
Program Interpretation
Tool Change
G55 X200 Y80
Program 2
N001 M06 T2
N002 M03 rpm 400
N003 G01 X-8 Y0 Z0 XY Feed 150
N004 G01 X20 Y15 Z10 XY Feed 150 Z Feed 150
N005 G01 X20 Y15 Z-10 Z Feed 75
N006 G01 X20 Y15 Z10 Z Feed 150
N007 G01 X50 Y15 Z10 Z Feed 150
N008 G01 X50 Y15 Z-10 Z Feed 75
N009 G01 X50 Y15 Z10 Z Feed 150
N010 G01 X50 Y45 Z10 Z Feed 150
N011 G01 X50 Y45 Z-10 Z Feed 75
N012 G01 X50 Y45 Z10 Z Feed 150
N013 M05
N014 M02
End Program
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy