7.1 CNC
7.1 CNC
7.1 CNC
Dr Atul Thakur
Assistant Professor
Department of Mechanical Engineering
CNC Machines
CNC : Computer Numerical Control
Machine
Program
Control Unit
Machine
CNC Overview
By integrating a computer processor, computer numerical control
(CNC) is obtained or “CNC”
allows part machining programs to be edited and stored in the
computer memory
permit diagnostics and quality control functions during actual
machining.
All CNC machining begins with a part program,
a sequential instructions or coded commands that direct the specific
machine functions.
Part program may be
manually generated or,
using computer aided part programming systems.
Basic Principle of CNC
All computer controlled machines are able to accurately and
repeatedly control motion in various directions
Each of these directions of motion known as axis
Depending on the machine type there are commonly two to five
axes
Two types of CNC axes
linear axis in which movement is in a straight line,
rotary axis with motion following a circular path
Absolute Incremental
CNC Code - Information Required
Preparatory Information: units, incremental or absolute
positioning
Coordinates: X,Y,Z, RX,RY,RZ
Machining Parameters: Feed rate and spindle speed
Coolant Control: On/Off, Flood, Mist
Tool Control: Tool and tool parameters
Cycle Functions: Type of action required
Miscellaneous Control: Spindle on/off, direction of rotation,
stops for part movement
N,G,X,Y,Z,A,B,C,I,J,K,F,S,T,R,M
Codes (G and M)
G-codes: Preparatory Functions
– involve actual tool moves
M-codes: Miscellaneous
Functions – involve actions necessary
for machining (i.e.,spindle on/off,
coolant on/off)
Letter G - Codes
M – Codes
Codes (N)
N-codes: Gives an
identifying number for
each block of information
It is generally good
practice to increment each
block number by 5 or 10
to allow additional blocks
to be inserted if future
changes are required.
Codes (X, Y, Z)
X, Y, and Z codes are
used to specify the
coordinate axis.
Number following the
code defines the
coordinate at the end of
the move relative to an
incremental or absolute
reference point
Codes (I, J, K)
I, J, and K codes
are used to specify
the coordinate axis
when defining the
center of a circle.
Number following the
code defines the
respective coordinate
for the center of the
circle
Codes (F, S, T)
F-code: used to specify
the feed rate
Relative translation of tool
w.r.t. work piece
S-code: used to specify
the spindle speed
T-code: used to specify
the tool identification
number associated with the
tool to be used in subsequent
operations.
Example
Setup
% Program start flag. Placed at the beginning of each
program
:1025 Program identification number. Follows the program
start flag at the beginning of each program
G90 G20 (Absolute units, inches)
M06 T3 (Stop for tool change, use tool # 3)
M03 S1250 (Turn the spindle on CW to 1250 rpm)
Cutting
G00 X1 Y1 (Rapid to X1,Y1 from origin point)
Z0.1 (Rapid down to Z0.1)
G01 Z-0.125 F5 (Feed Z-0.125 with feed 5 inch/min)
G00 Z1 (Retract fast to Z1)
X0Y0 (Retract fast to origin)
Shutdown
M05 (Stop spindle)
M30 (End of program)
Additional Information
Restrictions on CNC blocks
Each may contain only one tool move
Each may contain any number of non-tool move G-codes
Each may contain only one feedrate
Each may contain only one specified tool or spindle speed
The block numbers should be sequential
Both the program start flag and the program number must be
independent of all other commands (on separate lines)
The data within a block should follow the sequence shown in
the above sample block
Modal G Code
Most G-codes set the machine in a “mode” which stays in
effect until it is changed or cancelled by another G code.
These commands are called “modal”.