Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
34 views

Chapter 4 - Part Programming-Manual Programming

The document discusses NC part programming which involves planning machining steps on CNC machines. It covers topics like manual and computer-assisted programming, basic programming concepts including G and M codes, tool and feed rate commands, absolute and incremental positioning, subprograms, and establishing a reference point.

Uploaded by

adamemperor7
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Chapter 4 - Part Programming-Manual Programming

The document discusses NC part programming which involves planning machining steps on CNC machines. It covers topics like manual and computer-assisted programming, basic programming concepts including G and M codes, tool and feed rate commands, absolute and incremental positioning, subprograms, and establishing a reference point.

Uploaded by

adamemperor7
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

BTM 3334

CNC MACHINING

TOPIC 4: NC PART
PROGRAMMING

LECTURER:
DR. MUSFIRAH ABDUL HADI
Lecture Objectives

• At the end of the lecture, you will be able to:


Interpret and use ISO format of CNC part
programming.
Use important G and M codes in CNC part
programming.
 Set various compensations on CNC.
 Prepare simple part programming (milling)
using ISO format.
Prepare simple part programming (turning)
using ISO format.
What the Programmer has to do to
make Part Programming?

1. Study the relevant component drawing thoroughly.


2. Identify the type of material to be machined.
3. Determine the specifications & function of M/C to be used.
4. Decide the dimension and mode: -metric or inch.
5. Decide the coordinate system: -Absolute or Incremental.
6. Identify the plane of cutting.
7. Determine the cutting parameters for the job/tool combination.
8. Decide the feed rate programming: -MM/MIN or M/Rev.
9. Check the tooling required.
10.Establish the sequence of machining operations.
11.Identify whether use of special features like Subroutines, Mirror,
Imaging etc. is required or not.
12.Decide the mode of storing the part program once it is completed.
NC Part Programming
• Consists of planning and documenting the sequence of
processing steps to be performed on an NC machine .

• Methods of part programming :


1. Manual part programming.
2. Computer-assisted part programming.
3. Part programming using CAD/CAM.
4. Manual data input.
1. Manual Part Programming
• The programmer prepares the NC code using a low-level
machine language, which is based on binary numbers.
This language is understood by the MCU.
• NC uses a combination of binary and decimal number
systems . Called the “binary-coded decimal (BCD)
system”.
• Each of the ten digits in decimal system is coded with
four-digit binary number, for example, the decimal
value 1250 is coded in BCD as in the following table .
• Standard part programming language: RS 274-D
(Gerber, GN-code)
Binary Coded Decimal System
Binary & Decimal Number
Conversion

Binary Decimal Binary Decimal

0000 0 0101 5

0001 1 0110 6

0010 2 0111 7

0011 3 1000 8

0100 4 1001 9
Manual Part Programming

• In addition to numerical values, the NC coding system provides


for alphabetical characteristics and other symbols . A “word”
specifies a detail about the operation, such as x-position, y-
position, feed rate and spindle speed .
• A “block” is one complete NC instruction, it specifies the
destination for the move, speed and feed .
• “Block format” or (tape format) is the organization of “words”
within a block .
• Modern Controllers use the word address format which uses a
letter prefix and spaces to separate words, order of words is
important .
Basic ISO Programming: Block
Structure
The RS274-D is a word address format

Each line of program == 1 block

Each block is composed of several instructions, or (words)

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 M2

sequence no destination coordinates dist to center of circle tool

feed rate spindle speed


preparatory function
miscellaneous function
Types of Words
O – Program number (used for program identification)
N - sequence number prefix (used for line identification)
G - preparatory words
• Example: G00 = PTP rapid traverse move
X, Y, Z - prefixes for x, y, and z-axes
F - feed rate prefix
R - radius
S - spindle speed
H – tool length offset
T - tool selection
M - miscellaneous command
• Example: M07 = turn cutting fluid on
Basic Concept of Part Programming
Preparatory important command (G code)
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
G28 Automatic zero return
G40 Cutter compensation cancel
G41 Cutter compensation left
G42 Cutter compensation right
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
Basic Concept of Part Programming
Miscellaneous important command (M code)
• M codes vary from machine to machine depending on the functions
available on it. They are decided by the manufacturer of the machine. The
M codes listed below are the common ones.

• 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

• Feed commands (F code)


Used to specify the cutter feed rates in inch per
minute
• Speed commands (S code)
Used to specify the spindle speed in rpm.
• Tool commands (T code)
Specifies which tool to be used, machines with
automatic tool changer.
Example: Word Address Format

N001 G00 X07000 Y03000 M03


N002 Y06000
Modal and Non-Modal G Codes
• Modal (Retained) G Codes:
• A modal G code will remain active until another G
code from the same group is programmed into a
block, or it is cancelled.
• For Example:
• G01 and G00 are modal G codes from group 1:
• G01 X _ _ _ _ ;
•Y _ _ _ _ ; G01 is effective in this range.
•X _ _ _ _ ;
• G00Z _ _ _ _ ; G00 replaces the G01 command.
Modal and Non-Modal G Codes
(Cont’d)
• Non-modal (one-shot) G codes:

• A non-modal G code must be programmed into


block when it is required, i.e, it is only effective in
the block in which it is specified.

• Example:
• G09 , Exact Stop Check
Modal and Non-Modal G Codes
(Cont’d)
Explanation of Commonly Used
G Codes

• G00 –Preparatory code to control final position of the tool


and not concerned with the path that is followed in
arriving at the final destination.
• G01 –Tool is required to move in a straight line connecting
current position and final position. Used for tool
movement without any machining-point to point control.
(linear interpolation)
• G02 –Tool path followed is along an arc specified by I, J
and K codes.( circular interpolation)
Explanation of Commonly Used
G Codes
G90 ABSOLUTE POSITION COMMAND
When using a G90 absolute position command, each dimension or move
is referenced from a fixed point, known as ABSOLUTE ZERO (part zero).
Absolute zero is usually set at the corner edge of a part, or at the center
of a square or round part, or an existing bore. ABSOLUTE ZERO is where
the dimensions of a part program are defined from. Absolute dimensions
are referenced from a known point on the part, and can be any point the
operator chooses, such as the upper-left corner, center of a round part, or
an existing bore.

G91 INCREMENTAL POSITION COMMAND


This code is modal and changes the way axis motion commands are
interpreted. G91 makes all subsequent commands incremental.
Subprogram

• A subprogram is a separate program called up by another


program. The use of subprograms can significantly reduce the
amount of programming on some parts. Subprogram allow the
CNC programmer to define a series of commands which might
be repeated several times in a program and, instead of
repeating them many times, they can be “called up” when
needed. A subprogram call is done with M98 and a PØØØØ. The
P code command identifies the O program number being used
when executed with M98

• 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

• A sub program must be saved to memory using a four digit number.

• 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.

• A sub program call command (M98 PØØØØ) can be specified along


with a move command in the same block.
For example,
G01 X42.5 M98 P1000;
Sub Program Commands

• 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.

M98 PØØØ ØØØØ

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: -G91 G28 X0 Y0 Z0;


G00 Rapid Traverse

When the tool being positioned at a point preparatory to a cutting


motion, to save time it is moved along a straight line at Rapid traverse, at
a fixed traverse rate which is pre-programmed into the machine's control
system. Typical rapid traverse rates are 10 to 25 m /min., but can be as
high as 80 m/min.

Format
N_ G00 X__ Y__Z__

cutter move from the existing point to


the target point at the fastest speed of
the machine.
G01 Linear interpolation
(feed traverse)
The tool moves along a straight line in one or two axis simultaneously at a
programmed linear speed, the feed rate.

Format
N__ G01 X__ Y__Z__ F__

cutter move from the existing point to the


target point along a straight line at the speed
designated by the F address
G02/03 Circular interpolation

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.

Examples : drilling, peck drilling, tapping, boring, back spot facing.


G81 Drilling cycle
G82 Drilling cycle with dwell (Counter bore cycle)
G83 Peck drilling cycle / deep drill
G84 Right hand tapping cycle
G85 Boring / Reaming cycle
G86 Boring cycle
G87 Back boring cycle
G74 Left hand tapping cycle
G76 Fine boring cycle
G98/G99 plane of return point
G80 Cancel canned cycle

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

• Simplest of operation as it (the program) only needs to specify


the coordinates of the hole and type of machine motions to be
performed
• Comprise of a G, X & Y coordinate, Z depth, R clearance anf F
codes
• The following sequence of operations automatically occur:
• Rapid move to the X and Y coordinate of the hole center
• Rapid move to the Z-axis clearance plane, R
• Feed to Z-axis final depth
• Rapid back to either the Z-axis initial position or the Z-axis clearance plane, R
• The program only needs the next hole coordinates to perform
the same operation again
Drilling Canned Cycle (G81)
G81 is a canned cycle for drilling holes in a single drill stroke. Its motion is
rapid motion to R plane, feed down (into the hole) and rapid up (out of
the hole) to the R level or to the initial Z level (Z initial)
G81 Xn Yn Zn Rn Fn
Example of 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

• Sequence of activities in computer-assisted part programming


Computer-Assisted Part
Programming

1) The Part Programmers Job (Done 1st)


• The machining instructions are written in English-like
statements that are subsequently translated by the computer
into low-level machine code of the MCU.
• The two main tasks for the programmer are :
1. Define the geometry of the part .
2. Specify the tool path and operation sequence .
Computer-Assisted Part
Programming

Example :

Geometry Elements :
1. Points
2. Lines
3. Circles
Computer-Assisted Part
Programming

Ex. Cont. :

(High level language /general purpose)


APT : Automatically programmed tooling
Computer-Assisted Part
Programming
Ex. Cont. :
1- Define the geometry :
P4=point/35,90,0

points x , y , z coordinates
L1=Line/P1 , P2
C1 = Circle/Center , P8 , Radius , 30 .

Circle center of circle location circle radius


Computer-Assisted Part
Programming
2- Total path & sequence :

• Outline contouring : if cutting tool at P2 (along L1), to cut along L2 :

GOLFT/L2 , TANTO , C1

Turn left onto L2 Tangent to Circle

• Continuous path motion command

• EX :

GOTO/PS (move the tool to point 5 )

• Cutting Speed & feed rates must be also specified .


Computer-Assisted Part
Programming
(2) Computer Tasks (Done next) : (after programmer’s job)
1. Input translation : result in an output file called PROFIL.
2. Arithmetic & Cutter offset computations : result in an output
file called CLFILE (Cutter location file)
3. Editing : output file called CLDATA (Machine Commands), it
depends on the type of the machine tool (low-level code) for
the controller of the machine tool.
4. Post-processing : a separate computer program . (specific to
the concerned tool)
• O/P of post processing is a G-codes program in addition to x ,
y , z coordinates , S , F , M word address format .
• Post processing is an interface between APT & the machine
tool .
3. NC Part Programming Using
CAD/CAM
• A CAD/CAM System is a computer graphics system
that integrates design and manufacturing functions
. It can perform NC part programming .

• In this method , the computer does most of the


part programmer’s Job.
CAD/CAM Advantages

1. Part program can be simulated off-line on the CAD/CAM


system to verify its accuracy.
2. Time & cost of the operation can be determined by the
CAD/CAM system .

3. Automatic tool selection .

4. Automatic optimization of speeds & feeds for work


material & operations .

5. Immediate visual verification of geometric elements .


Geometry definition using
CAD/CAM
• A computer graphics model of each part is developed by the
designer . The model contains geometric , dimensional and
material specifications for the part .

•The model is stored in a database, in order to perform NC


operations, the programmer retrieves the part geometry
model from storage , and uses that model to construct the
cutter (Tool) path . Where the geometry is already defined .
Geometry definition using
CAD/CAM

•Geometric elements are then labeled (with symbols) ,


e.g.: lines(L1,L2) , circles(CI,C2) , etc ….

•Sometimes , they are already labeled .

•Points are defined in a coordinate system using the


computer graphics system .

• Lines & circles are defined from the points .


Tool path generation using
CAD/CAM

• Most CAD/CAM systems have tool libraries that can be called


by the programmer.

• The programmer decides which tool is appropriate for the


operation at hand. Then he/she specifies it for the tool path ,
this permits the tool diameter to be entered automatically
for tool offset calculations.

• New tools can be added to the library as needed.


Tool path generation using
CAD/CAM

• Tool path can be defined using the interactive graphics system


by entering the motion commands one-by-one.
• Individual statements in APT are entered , and the CAD/CAM
system provides immediate graphics display of the action
resulting from the command.
• A more advanced approach for generating tool path
commands is to use an automatic software module, which is a
subroutine that executes the machines cycle provided that it
is given the required parameters .
• An animated simulation can be provided for validation
purposes .
Computer – Automated Part
Programming

• It is a futuristic fully automated NC part programming


procedure.

• Given the geometric model of the part, the system could


accomplish NC part programming without human assistance .

• Example of machining cycles available in automatic


programming modules include facing , shoulder facing ,
lettering , and threading.
Facing and Shoulder Facing
Mastercam
• It is the leading commercial CAD/CAM software package for
CNC part Programming.

• Files from other CAD packages can be translated for use


within Master cam as well.

• The input includes the part geometry , work piece


orientation & material , type of operation (e.g. milling ) ,
cutting tool, cutting parameters (e.g. hole depth ) , &
matching post process for the machine tool.

• The output would be a word address format program.


4. Manual Data Input (MDI)

• The machine operator performs the part


programming task at the machine tool . The
programmer manually enters the part geometry data
and motion commands directly into the MCU.
• MDI is AKA conversational programming. It requires
minimal initial investment , but it is more prone to
errors . It typically includes a monitor & keyboard.
• Entering commands can be done using a menu –
driven procedure→ that is responding to a series of
questions.
Lathe Programming Examples
• The CNC lathe operation such as simple facing, turning, taper turning, thread,
boring, parting off etc. The X-axis and Z-axis are taken as the direction of
transverse motion of the tool post and the axis of the spindle respectively. To
prepare part programs using G-codes and M-codes. The following examples
illustrated the part program for different components.
Lathe Programming Examples
Milling Programming Examples
• The CNC milling machine, the motion is possible in three axes, X-axis, Y-
axis and Z-axis. The movement of Z-axis is taken as positive when tool
moves away from the job or vice versa.
Exercise
Answer

You might also like