Unit V CNC Programming

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Unit V

CNC Part Programming


CNC Part Programming
Concept of Work Zero and Machine Zero

Work Zero

It is location from which program starts or operation starts also called as floating
zero.

Machine zero

From this location will not go. It is called as fix zero.


Machine Zero / Home position

● On all CNC machines, machine zens is located at the positive end of each
axis travel range means, from machine zero toll will not go beyond.
● It is also called as fixed zero or home position. Machine control unit
understand the dimensions provided will respect to the machine zero

Workpiece Zero and Program Zero


It is a location in CNC machine from which actual machining starts. It is also called
as floating zero as it varies from job to job.
Step in NC Manufacturing
The steps involved in NC manufacturing are explained below:

(1) Process planning and scheduling : This is the initial stage of manufacturing. The drawing are studied
and the operations of manufacturing are listed. Details such as, sequencing of operation, conventional and
NC machining and the requirements of tooling and their availability is studied and planned. Based on these
setup sheets are developed

(2) Part programming : The setup sheets are then used to develop a part program. The program can be
either written manually or can be computer generated.

(3) Tape preparation : The program generated in the previous step is to be converted into a machine
language program and is then placed on a proper input media such as paper tape, floppy disk hard disc etc.
Step in NC Manufacturing

(4) Tape Verification : The accuracy of program can be then lesser by a dry run on the machine or on a
plotter which traces out the tool paths programmed by the user. After dry run modification if any are done to
the part program

(5) Production : The ready to use program with the necessary setup sheets and part drawing are then
provided to the NC machine operator for production

Process planning
Part Programming Tape preparation Tape Verification Production
and scheduling
CNC Part Programming
➢ Part Programme-It is set of instructions given to CNC machine for
machining required component.
➢ Each line in programme is called BLOCK and each block is one complete
instruction..
➢ Programme consists of no of blocks & block contains no of words.

Types of part programming

Manual part programming

Computer aided part programming.


Manual Part Program
The program for machining a particular work piece not only depends from person
to person, but also varies from machine to machine. Distant controllers use
different syntax in instructing the machine tools. However there are similarities
between codes and by understanding the basics of the codes, one can easily
adopt to other controllers with minor changes
Principles of an NC program
Actual syntax of the program varies from machine to machine. However, regardless of the
kind of controller used, a typical Nc-CNC program consist of six blocks.

(1) Program start up

This section serves to issue any commands required at the start of the tape only ex- setting
the program to the millimeter mode would be needed only at the beginning of the program.

(2) Tool safely block

This serves to issue commands to cancel any machine modes that would have remained
active in case of interrupted tool cycles. By issuing certain initialization commands, the
programmer can ensure the safely of the mk tool.
Principles of an NC program

(3) Tool load blocks

This section deals with the selection and sequencing of the tool, either manually or by etc.
This section also deals with tool length compensation

(4) Tool motion blocks

This section deals with the code for the actual cutting tool motion. The machining work is
done in this section.

(5) Tool cancel blocks

The tool cancel section turns off the tool compensation features and returns the tool to its
storage either manually or through the ATO.
Principles of an NC program

(6) End of type blocks

The end of program blocks issue any commands necessary after all tool motion is complete,
but before the program terminates. In most of the cases, this section consists of the end of
the program code.

Program Tool Tool Tool Tool End


Start safety load motion cancel Of type
up blocks blocks blocks blocks blocks
Axes configuration
X axes moves from right to left as you
face the machine
Y axes move toward and away from
you.
The Z axes is the spindle movement up
and down spindle .
A move toward work is Z(-Z)
A move away from work is Z(+ Z)
Cartesian Coordinate System
When points are located on a
workpiece, two straight intersecting
lines, one vertical and one horizontal,
are used. These lines must be at right
angles to each other, and the point
where they cross is called the origin, or
zero point as shown in fig 1.
Cartesian Coordinate System
The three-dimensional coordinate planes
are shown in fig 2.
● The X and Y planes (axes) are
horizontal and represent horizontal
machine table motions.
● The Z plane or axis represents the
vertical tool motion. The plus (+) and
minus (-) signs indicate the direction
from the zero point (origin) along the
axis of movement.
● The four quadrants formed when the
XY axes cross are numbered in a
counterclockwise direction
Cartesian Coordinate System
➢ All positions located in quadrant 1 would be positive (X+) and
positive (Y+).
➢ In the second quadrant, all positions would be negative X (X-)
and positive (Y+).
➢ In the third quadrant, all locations would be negative X (X-)
and negative (Y-).
➢ In the fourth quadrant, all locations would be positive X (X+)
and negative Y (Y-).

In Fig. 3 ,

❏ For point A would be 2 units to the right of the Y axis and 2


units above the X axis. Assume that each unit equals 1.000.
The location of point A would be X + 2.000 and Y + 2.000.
❏ For point B, the location would be X + 1.000 and Y - 2.000.

In CNC programming it is not necessary to indicate plus (+) values


since these are assumed. However, the minus (-) values must be
indicated. For example, the locations of both A and B would be
indicated as follows: Fig. 3 The quadrants formed when the X and Y axes cross
are used to accurately locate points from the XY zero, or
A X2.000 Y2.000 B X1.000 Y-2.000 origin, point.
:
Codes

➢ The most common codes used when programming CNC machines


tools are G-codes (preparatory functions) and M codes
(miscellaneous functions).
➢ Other codes such as F, S, D and T are used for machine functions
such as feed, speed, cutter diameter offset, tool number, etc.
N Codes
➢ Gives an identifying number for each block of information.
Eg N100,N110…
➢ 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.
G Codes (Preparatory function)
➢ Preparatory functions, called G codes, are used to determine the
geometry of tool movements and operating state of the machine
controller; functions such as linear cutting movements, drilling
operations and specifying the units of measurement.
➢ They are normally programmed at the start of a block.
A G code is made from the G address letter and a two digit number as
follows,
M Codes (Miscellaneous function)
➢ Miscellaneous functions, called M codes, are used by the CNC control
to command on/off signals to the machine functions.
i.e. MØ3 - spindle forward (CW), MØ5 - spindle off, etc...
➢ The functions allocated to lower M code numbers are constant in most
CNC controls, although the higher M code number functions can vary
from one make of controller to the next.
An M code is made from the M address letter and a two digit number as
follows,
X,Y, and Z Codes
● 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.
Eg X10.5, Y55, Z45…
I,J, and K Codes
I, J, and K codes are used to specify the coordinate axis when defining the
center of a circle FOR CIRCULAR INTERPOLATION.
➢ I-incremental dim in X axis during circular interpolation.
➢ J-incremental dim in Y axis during circular interpolation
➢ K-incremental dim in Z axis during circular interpolation
eg. G02 X44 YI00 I 00 J40
G03 X25 Y 50 I10 J-50
F,S, and T Codes
➢ F-code: used to specify the feed rate
F100 G94, F.2 G95
➢ S-code: used to specify the spindle speed
S2400 M03, S500 M04
➢ T-code: used to specify the tool identification number associated with the
tool to be used in subsequent operations.
T0101 OR T1010
F,S, and T Codes
➢ F-code: used to specify the feed rate
F100 G94, F.2 G95
➢ S-code: used to specify the spindle speed
S2400 M03, S500 M04
➢ T-code: used to specify the tool identification number associated with the
tool to be used in subsequent operations.
T0101 OR T1010
Programming Key WORDS
O - Program number (Used for F – Feed rate designation
program identification) S - Spindle speed designation
N - Sequence number (Used for H - Tool length offset designation
line identification) D - Tool radius offset designation
G - Preparatory function T - Tool Designation
X - X axis designation M - Miscellaneous function
Y - Y axis designation
Z - Z axis designation
R - Radius designation
Modal commands:
Commands issued in the NC program that will stay in effect until it is
changed by some other command, like, feed rate selection, coolant selection,
etc.
A modal G code, once programmed into a block, will affect any subsequent
blocks of the program without having to be restated. Additionally, modal G
codes are further split into groups according to their task and function. A modal
G code will remain active until another G code from the same group is
programmed into a block, or it is cancelled.

Non modal commands:


A non-modal G code must be programmed into every block when it is
required.
G Codes
GØØ (Rapid Positioning)

The GØØ code executes a non cutting


movement, at a rapid feedrate, to a
specific coordinate position in the
working area
GØ1 (Linear Interpolation)

The GØ1 code executes a cutting


movement following a straight line, at
a set feedrate.
GØ2 GØ3 (Circular Interpolation)

The GØ2 code executes a cutting


movement following a clockwise circular
path, at a set feedrate.
➢ The GØ3 code executes a cutting
movement following an
anticlockwise circular path, at a set
feedrate.
➢ The definitions of clockwise (GØ2)
and anticlockwise (GØ3) are fixed
according to the system of
coordinates in the diagram below.
GØ2 GØ3 (Circular Interpolation)
GØ2 (Clockwise)
GØ3 (Anticlockwise)
G90 (Absolute positioning):
In this mode, the desired target position of the tool for a particular move is
given relative to the origin point of the program.

G91 (Incremental positioning):


In this mode, the next target position for the tool is given relative to the
current tool position.
M Codes
MØØ (Program Stop)

MØØ - Program Stop.


When the machine controller reads the code MØØ within a block, it halts
the program. The [CYCLE START] key must be pressed to allow the program
to continue.

MØ1 (Optional Stop)

MØ1* - Optional Stop.


The MØ1 code performs the same function as the MØØ code, except the
machine controller only recognises the signal to halt the program if the optional
[STOP] input key is activated.
MØ3 (Spindle Forward)

MØ3 - Spindle Forward (Clockwise).


The clockwise direction of the spindle is determined by viewing from the
back of the machine headstock, along the Z axis towards the tailstock. The
spindle start command is activated at the beginning of the block in which it is
programmed, ie, before any axis movement occurs.

MØ4 (Spindle Reverse)

MØ4 - Spindle Reverse (Counter Clockwise).


An MØ4 code acts in the same way as an MØ3 code, only the spindle
rotates in the opposite direction.
MØ5 (Spindle Stop)
MØ5 - Spindle Stop.
The MØ5 code, to stop the spindle rotating, is activated at the end of the
block in which it is programmed, ie, after any axis movement.

MØ6 (Automatic Tool Change)

MØ6 - Automatic Tool Change.


This code activates the machine turret and is followed by the code T_ _ _,
instructing it to move to the stated tool number.
For example :
MØ6 TØ3Ø3 ;
This command is read change automatically from the current tool number
to tool number 3.
Thank You

You might also like