You are on page 1of 10

www.Vidyarthiplus.

com

Introduction:
CAM Definition: - CAM is the term which means computer aided manufacturing. It can be
defined as the use of computer system to plan, manage, and control the operations of a
manufacturing plant through direct or indirect computer interface with the production
resources of the plants.
CNC Definition:
CNC (Computer Numerical Control) is the general term used for a system which controls the
functions of a machine tool using coded instructions processed by a computer.
CNC Manufacturing Process:
The sequence below shows the main stages involved in producing a component on a CNC
system:
1) A part program is written, using G and M codes. This describes the sequence of operations
that the machine must perform in order to manufacture the component. This program can be
produced off-line, i.e., away from the machine, either manually or with the aid of a
CAD/CAM system.
2) The part program is loaded into the machines computer, called the controller. At this stage,
the program can still be edited or simulated using the machine controller keypad/input
device.
3) The machine controller processes the part program and sends signals to the machine
components directing the machine through the required sequence of operations necessary to
manufacture the component.
Definition of Programming:
Programming is the process of creating a set of commands such as cutter movement,
feed rate and spindle speed, in order for the machine to perform some operations.
Main Programs are written using I.S.O. address codes listed below: -
Addresses: -
N - Refers to the block number.
G - Refers to the G code (Preparatory function).
X - Refers to the absolute distance traveled by the slide tool in the X axis direction.
U - Refers to the incremental distance traveled by the slide tool in the X axis direction.
Z - Refers to the absolute distance traveled by the slide tool in the Z axis direction.
W - Refers to the incremental distance traveled by the slide tool in the Z axis direction.
F - Refers to the feed rate.
M - Refers to the M code (Miscellaneous function).

www.Vidyarthiplus.com
www.Vidyarthiplus.com

S - Refers to the spindle speed.


T - Refers to the tooling management.
Each block, or program line, contains addresses which appear in this order:
N, G, X (or U), Z (or W), F, M, S, T;
When the main program calls one sub program into operation, the process is called a one-
loop sub program call. It is possible to program a maximum four-loop sub program call
within the main program.
G & M CODES FOR TURNING OPERATION (XL TURN Two Axes - X & Z)
G00: Positioning in Rapid.
G01: Linear Positioning in Feed.
G02: Circular Interpolation CW.
G03: Circular Interpolation CCW.
G04: Dwell.
G20: Input in Inch.
G21: Input in Metric.
G28: Go To Reference Position.
G40: Cutter Compensation Cancels.
G41: Cutter Compensation Left.
G42: Cutter Compensation Right.
G50: Clamp Spindle
G50: Coordinate Setting
G70: Finishing Cycle
G71: Stock Removal in Turning
G72: Multiple Facing
G73: Pattern Repeating
G74: Peck Drilling Cycle
G76: Multiple Threading cycle
G81: Drilling Cycle
G90: Turning Cycle
G94: Facing Cycle
G96: Constant Surface
G97: Var. Surface
G98: Feed per Minute
G99: Feed per Rev.

www.Vidyarthiplus.com
www.Vidyarthiplus.com

Fundamentals of CNC Programming


Introduction :( G Codes with Explanation): -
G Codes (Preparatory Functions):- 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.
G00 (Rapid Positioning / Traverse)
The G00 code executes a non cutting movement, at a rapid feed rate, to a specific co-ordinate
position in the working area (absolute co-ordinate movement) or when a certain distance
from a previously stated position (incremental co-ordinate movement) is programmed.
A G00 command is written in the following format:
G00 X _ _ _ _ Z _ _ _ _;
G01 (Linear Interpolation)
The G01 code executes a cutting movement following a straight line, at a set feed rate.
A G01 command is written in the following format:
G01 X (or U) _ _ _ _ Z (or W) _ _ _ _;
G02/03 Format
The format to program a circular interpolation in Cartesian co-ordinates using a known
radius for the arc is as follows:
To follow a clockwise circular path,
Absolute G02 X-- Z-- R--
Incremental G02 +/-U-- +/-W-- R--
To follow an anticlockwise circular path,
Absolute G03 X-- Z-- R--
Incremental G03 +/-U-- +/-W-- R--
Where: - G02 or G03 defines the direction of the circular interpolation.
X or +/-U defines the co-ordinate value of the arcs end point along the X axis.
Z or +/-W defines the co-ordinate value of the arcs end point along the Z axis.
R- Defines the length of the arcs radius.
G71 (Stock Removal in X Axis)
The G71 code commands a multiple repetitive cycle, sometimes referred to as a canned
cycle. The G71 cycle is similar to the G72 cycle except that the cut is applied in the X axis.
Canned cycles are used within a CNC program to simplify programming, since only the

www.Vidyarthiplus.com
www.Vidyarthiplus.com

dimensions describing the required component profile are required. The CNC control will
then generate the roughing cuts needed to make this component profile, from within its own
memory. A G71 command is written in the following format:
G71 U (1) R--- ;
G71 P ns Q nf U (2) W-- F -- ;
Where: -
P - Starting Block
Q - end Block
U1 - Depth of cut
U2 - finishing allowance along X axis
W - finishing allowance along Z axis
R - Retraction
F - Feed Rate
G72 (Stock Removal in Facing)
The G72 code commands a multiple repetitive cycle, sometimes referred to as a canned
cycle. The G72 cycle is similar to the G71 cycle except that the cut is applied in the Z axis.
Canned cycles are used within a CNC program to simplify programming, since only the
dimensions describing the required component profile are required. The CNC control will
then generate the roughing cuts needed to make this component profile, from within its own
memory. A G72 command is written in the following format:
G72 W (1) R--- ;
G72 P ns Q nf U --- W (2) F -- ;
G73 (Pattern Repeating)
The function of the G73 canned cycle is to permit the cutting of a programmed profile
repeatedly. It is mainly used for machined parts where the rough shape has already been
formed by either rough machining, forging or casting.
A G73 command is written in the following format: G73 U (1) -- R --- ;
G73 P ns Q nf U (2) -- W (2) -- F ;
The definitions of P ns, Q nf, U (2), W (2) and F are the same as those in the G71 and G72 code.
U (1) = (D-d)/2;
R = No.of cuts required = (U (1) / Depth of cut) + 1;

G70 (Finishing Cycle)


After part profile rough cutting has been completed, using the G71, G72 or G73 codes, the

www.Vidyarthiplus.com
www.Vidyarthiplus.com

G70 code can be used to perform a finishing cut/pass.


A G70 finishing pass command is written in the following format: G70 P ns Q nf S F
Where: - (P) ns is the sequence number of the start block for the finishing pass.
(Q) nf is the sequence number of the last block for the finishing pass
G74 (End Face Peck Drilling Cycle)
The G74 code instructs the machine to perform a peck drilling cycle. The centerline of the
drill runs parallel to the Z axis, i.e., the drill will make holes in the face end of the billet.
Peck drilling refers to the method used for removing the material, i.e., the drill will move a
set amount into the material, then withdraw to allow swarf and scrap drop out, before cutting
further into the material.
The G74 code allows two different methods of drilling:
A tipped U-drill can drill into a billet, then move along the X axis and repeat the operation several
times if required, i.e., it can be used to drill holes off-centre.
A standard drill can also be used. If the words X , P and R are omitted from the G74 command,
a hole will be generated by pecking in stages (each stage measuring a depth of Q) to a total depth of Z
A G74 command is written in the following format:
G74 R-- (1);
G74 X (U) -- Z (W) -- P-- Q -- R-- (2) F -- ;
G75 (Outer / Internal Dia. Drilling & Grooving Cycle)
The G75 command permits drilling and grooving in the X axis A chip break cycle is also
possible - chip breaking is the same as drilling in pecking stages to limit swarf size.
A G75 command is written in the following format: -
G75 R-- (1);
G75 X (U) -- Z (W) -- P-- Q -- R-- (2) F-- ;
Where: - The definitions of R (1), (U), Z (W), P, Q, R (2) and F are the same as G74.
R (1) is the peck return amount.
R (2) is the retract move at the base of the groove.
X (U) is the diameter of the bore if step over is used
(i.e., stepping along the X axis to repeat the peck cycle)
Z (W) is the depth of the bore.
F is the feed rate.

www.Vidyarthiplus.com
www.Vidyarthiplus.com

P is the step over in the X axis measured in microns (without sign).


Q is the pecking depth in the Z axis measured in microns (without sign).
G76 (Multiple Thread Cutting Cycle)
The G76 command contains, within two blocks, all the information required to generate a
standard thread form and pitch. A G76 uses one edge cutting to reduce the load on the tool tip.
A G76 command is written in the following format:
G76 P (A) / (B) / (C) -- Q (Min) R --- ;
G76 X (U) --- Z (W) --- P (DEP) Q (1st) F---
Where: -
P (A) is the number of thread finishing passes (1 to 99).
P (B) is the chamfer amount. This is the angle at which the tool leaves the billet, at the end of the
thread cutting cycle.
P (C) is the angle of the tool tip (80, 60, 55, 30, 29 and 0). Note - (A), (B) and (C) are all
specified at the same time by the address P,
Example: P036060 = number of cuts is 03, chamfer amount of 60 and tool angle of 60.
Q (Min) is the minimum cutting depth (in microns). When the depth of the cut calculated by the
CNC control becomes less than this limit, the cutting depth is clamped at this minimum value.
R is the finishing allowance. This is the final, or finishing, cuts applied to the thread. The number
of stages to complete this finishing allowance is determined by the value of P(A), i.e., the value
of R divided by the P(A) number of finishing passes equals the value of each finishing allowance
stage.
X (U) is the end position of the thread in the X axis (the core diameter).
Z (W) is the end position of the thread in the Z axis.
P (DEP) is the depth of the thread as a radius value (in microns).
Q (1st) is the depth of the first pass as a radius value (in microns).
F is the size of the thread pitch.

Miscellaneous Functions (M CODES) for XLTURN:


M00 - Program Stop: - This function is used to stop machining operation so as to perform
inspection, adjustment, measurement, removal of chips confirmation tool wear etc.
M01 - Optional Stop: - It has the same function as M00 but performs only when the Optional

www.Vidyarthiplus.com
www.Vidyarthiplus.com

stop button on the machine control panel is turned on. When the button is turned off, this
function is ignored.
M02 - End of program: - When machine completed all operations.
M03 - Spindle turns on and rotates in clockwise direction.
M04 - Spindle turns on and rotates in anti-clockwise direction.
M05 - Spindle rotation Stop.
M06 - Auto Tool Change: - It is used for changing tool when executed. Select the required tool
before using this function. Example: - M06 T01
M07 - Blown air or mist coolant is applied.
M08 -Coolant on: - Flood coolant is supplied.
M09 - Coolant off: - Cancel M07 and M08.
M19 - Oriented Spindle Stop: - When using this function, the spindle rotates and Stops at a
predetermined position. It is mainly used in Auto tool change and Boring processes.
M30 - End of program and rewind: - It has the same function as M02 but it will search for the
head of the program (rewind) after completed all operations.

www.Vidyarthiplus.com
www.Vidyarthiplus.com

G & M CODES FOR MILLING OPERATION (XL MILL -Three axes X, Y & Z):

G Codes:
G01, G02 and G03 are same as it is used in XL turning operation.

G90 (Absolute Zero Command)


When G90 is active, all co-ordinates are relative to the work piece datum (the zero position).
Note 1: The G90 code is active when:
1) The machine power is first switched on.
2) The reset button on the CRT/MDI controller panel is pressed.
3) The Emergency Stop button is pressed.

G91 (Incremental Command)


When G91 is active, all movement command values are distance moved
(including the +/- sign) from last known programmed position.

G94 (Feed per Minute)


When G94 is active, all federates stated within the program are defined in either
millimeters per minute when operating in G21 Metric Mode, or inches per minute when
operating in G20 Imperial Mode.
G98 (Return to Initial Level)
A G98 code, when used within a canned cycle, will return the drill or boring bar back to
the initial level after machining a hole.
G99 (Return to R Point Level)
A G99 code, when used within a canned cycle, will return the drill or boring bar back to
the R point level after machining a hole.

G73 (High Speed Peck Drilling)


A G73 (High Speed Peck drilling) command is written in the following format:
(G90 or G91) (G98 or G99) G73 X.... Y.... Z.... Q.... F....;
When machining, the drill is positioned at the co-ordinate point of the first hole, for the X
and Y axes and at the initial level, for the Z axis. The G73 command is then read into the

www.Vidyarthiplus.com
www.Vidyarthiplus.com

machine controller and the cycle begins.


The drill will rapid traverse to the R point level and begin to feed in, until a cut-in
distance of Q is attained. At this point, the drill will retract a small distance (set within the
machine controller). A cut-in distance of Q at the same feed rate will begin again, followed by a
similar retraction. These movements will continue until the total Z depth has been reached.
The drill will rapid traverse out to the Initial level, if a G98 code is programmed within
the cycle, or to the R point level, if a G99 code is programmed within the cycle. At this point the
next block is read into the machine controller. If this block contains an X, Y or X and Y co-
ordinate the drill will position itself at that point and the high speed peck drilling cycle will begin
again.

G170 - G173 (Circular/Rectangular Pockets)


The following canned cycles, when programmed correctly, will machine either a circular
pocket to any diameter and depth, or a rectangular pocket to any side length and depth. Both
canned cycles require two blocks of information each; with each block having its own G code:
G170 - Circular Pocket
G171 - Circular Pocket
G172 - Rectangular Pocket
G173 - Rectangular Pocket
Note 1
Great care must be taken when using these canned cycles, since each canned cycle
can be written three different ways.
This is achieved according to the values assigned following the addresses P, I and J in
canned cycle G170-171 and the values assigned following the addresses P, I and K in canned
cycle G172-173. By adding these values, the cutter will move in a different path when
machining.

www.Vidyarthiplus.com
www.Vidyarthiplus.com

M Codes:
M70 (Mirror in X On): -
This code changes the sign of X within a program around the datum.
For example, G01 X25.5;
M70
G01 X25.5; (Tool would move to X-25.5).

M71 (Mirror in Y On): -


This code changes the sign of Y within a program around the datum.
For example, G01 Y25.5;
M70
G01 Y25.5; (Tool would move to Y-25.5).
M80 (Mirror in X off): - This code cancels the mirror image in the X axis.
M81 (Mirror in Y off): - This code cancels the mirror image in the Y axis.
M98 (Sub Program Call): - This code will cause the machine controller to jump across from the
main program to read a different program in its memory (called a sub program).
M99 (Sub Program Call and Return): - On the last line of a sub program, the code M99 is
entered. This reverts control back to the main program.
If an M99 code is programmed at the end of a main program, a continuous loop will be
established.
If an M99 code is followed by a block number, P_ _ _ _, control will return to the program line
with the same number as stated in P_ _ _ _.

www.Vidyarthiplus.com

You might also like