Chapter 4 - Part Programming-Manual Programming
Chapter 4 - Part Programming-Manual Programming
CNC MACHINING
TOPIC 4: NC PART
PROGRAMMING
LECTURER:
DR. MUSFIRAH ABDUL HADI
Lecture Objectives
0000 0 0101 5
0001 1 0110 6
0010 2 0111 7
0011 3 1000 8
0100 4 1001 9
Manual Part Programming
• List of M code:-
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
Basic Concept of Part Programming
• Example:
• G09 , Exact Stop Check
Modal and Non-Modal G Codes
(Cont’d)
Explanation of Commonly Used
G Codes
• M99: -An M99 ends a sub-program and returns back to the next
line in the main program after the M98 sub-program call.
Sub Program Commands
• To call a sub program the M98 code is used followed by PØØØØ (the
number of the sub program required).
For example,
M98 P2000
This command is read call program number 2000.
• At the end of a sub program, the M99 code is entered. This returns
control to the main program. The M99 code will return control to the
next block after the M98 sub program call block in the main program.
• If the code M99 PØØØØ is entered, control will pass to the main
program at a block with the N number equal to that of the P number
stated after the M99 code.
• For example,
M99 P0160
• This command is read return to the main program at block number
N0160.
Sub Program Repeat Command
• A call command can be set to call a sub program repeatedly.
This call can specify upto 999 repetitions of a sub program.
Call Sub
Command Number of times Program
the subprogram is Number
to be repeated
• For example,
• M98 P100001
• This command is read call the sub program number 0001 ten times.
Main Program
Structure
Sub Program Structure
Reference Point and Return
G28 Return To Reference Point, set optional intermediate point. The G28 code is
used to return to the machine zero position on all axes. If an X, Y, Z, or A axis is on
the same block and specifies a location, only those axes will move and return to
the machines‟ zero reference point and the movement to the machines„ zero
reference point will be through that specified location.
Format
N_ G00 X__ Y__Z__
Format
N__ G01 X__ Y__Z__ F__
G02 G03
G02/03 Circular Interpolation
G02/03 Circular Interpolation
Cutter Radius Compensation (CRC)
G40 Tool nose radius compensation Cancel
G41 Tool nose radius compensation Left
G42 Tool nose radius compensation Right
Format: -
G41 X_ Y_D_;
G42 X_ Y_D_;
Tool length compensation
(G43/G44)
Tool length compensation
(G43/G44)
Canned Cycles
Canned or fixed cycles are programming aids that simplify programming. Canned
cycles combine many programming operations and are designed to shorten the
program length, minimize mathematical calculations, and use minimal tool motions.
When the tool gets to the bottom of the hole, it can return back to the plane of R
point and the initialized plane initialized by G98/G99.
Canned Cycles
N100 G81 R3 E9 N7 Z-0.5 - For milling from N03 to N09 with repeated cycle 7 times
2. Computer-Assisted Part
Programming
• Manual part programming can be tedious. However, in
computer-assisted programming, the tasks are divided
between the programmer and the computer.
• APT (Automatically Programmed Tool) is the most widely used
processor.
• The various tasks in computer-assisted part programming are
divided between
• The human part programmer
• The computer
Computer-Assisted Part
Programming
Example :
Geometry Elements :
1. Points
2. Lines
3. Circles
Computer-Assisted Part
Programming
Ex. Cont. :
points x , y , z coordinates
L1=Line/P1 , P2
C1 = Circle/Center , P8 , Radius , 30 .
GOLFT/L2 , TANTO , C1
• EX :