0% found this document useful (0 votes)
6 views

L2-Part Program and G-code for Milling

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

L2-Part Program and G-code for Milling

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

Programming

Part program

• A part program is a computer program giving all the manufacturing details


and the part identification.

• Each work-piece requires its own part program.

Structure of the part program

• It is formed in a certain structure that may consists of:

o Main program:
▪ Header
▪ Core part (Operation part)
▪ End of file
o Sub-programs

Program header: It contains all ID for the programmer, the manufactured part,
the dates, the machines and others. Some examples are:
(FILE NAME …………….. O5421.CNC)
(Programmer ……………... Ziad Hosny)
(PART ID ………………… Bush for machine no. 468432)
(DATE originated ………… 10/03/2023)
(LAST Modified ………….. 12/01/2024)
(CONTROL ………………. Fanuc-301)
(UNITS …………………… Metric)
(RAW MATERIAL ………. Steel 306 block 400x200x30)
-
-
-

Operation part:
o It contains all the operational instructions (similar to the manually
done known as “operation sheet”). It is written in certain format with
a code that the machine controller can read, compile and analyse.
o The format structure and codes differ from a controller to another.
o This part consists of the different operations that will be performed.
Each operation is written in a line (known as Block). Each block is
separated from all others by a symbol “EOB”. As an example of two
separate Blocks:
N10 G00 X3 Y2.5 Z-1 T2 M06
N20 G01 X12 Y2 F4.2 S700 M03

o Each block consists of words (N10 , G00 , X3 , Y2.5 , S700


……. Etc)
o Each word consists of a combination of digit (0, 1, 2, … 9), letter (A,
B, C, ….. Z), and symbol (+, -, /, *, ….).

End of file symbol: Each part program is usually ended with an end of file
symbol “%”.

Subprograms:
- It is a separate group of operations that can be executed whenever it has
been called from inside the main program.
- The main program can call any different numbers of subroutines
- The subroutine can call another subroutine as shown in fig. 1 (known as
nesting).

Sequence Block
o The contents of one block will be processed as a single unit before the
control processes any following block of instruction.
o A block includes:
- Block number N
- Preparatory commands G
- Auxiliary functions M
- Axis motion commands X Y Z A B C U V W…
- Words related to axes I J K R Q …
- Machine or tool function S F T

Block Numbering
o Block number has an address N or O.
o It is the 1st word in the block.
o used to organize the program.
o Used to delete a block, insert a block, jump to a block.
o The number that follows indicates how many digits is allowed to be
written after the address, e.g. N4 allows the programmer to mark the
blocks either N5 , N34 , N453 up to N9999.

Preparatory Functions
For CNC Machining Centre

Cod Modal Example Notes


e
G20 Imperial √ All dimension
units X, Y, Z, …. A
G21 Metric units √ All dimension
X, Y, Z, …. A
G90 Absolute √ • To move
dimensioning origin. i.e
N20 Xx1 Y
N22 Xx2 Y
N24 Xx3 Y
N26 Xx4 Y
N28 Xx5 Y
G91 Incremental √ • To move
dimensioning previous p
N20 X(x1
N22 X(x2
N24 X(x3
N26 X(x4
N28 X(x5
G00 Rapid √ Left figure: Start point (0,0) & end point (5,12)
positioning N20 G00 X5 Y12

Right figure: Start point (5,12,0) & end point (5,12,100)


N20 G00 X5 Z100

• If feed va
• Although
motion in
G01 Linear √ N23 G01 X12 Z34 F40 • Move wit
interpolation • Feed valu

G02 Circular √
interpolation
(CW)
G03 Circular √
interpolation
(CCW)

G04 Dwell N23 G04 X2.5 • It is a time


N23 G04 U2.5 • Always pr
N23 G04 P2500 • In this tim
functions
processing
• If decimal
the examp
• U is used
G15 Polar N2 G17 G40 G80
Coordinate N3 G90 G54 G00 X0 Y0 S900 M03 (PIVOT POINT)
Command N4 G43 Z1.0 H01 M08
cancel N5 G16 (POLAR COORDINATES ON)
G16 Polar √ N6 G99 G81 X6.8 Y0 R0.1 Z-0.163 F3.0
Coordinate N7 X6.8 Y60.0
Command N8 X6.8 Y120.0
N9 X6.8 Y180.0
N10 X6.8 Y240.0
N11 X6.8 Y300.0
N12 G15 (POLAR COORDINATES OFF)
N13 G80 M09
N14 G91 G28 Z0 M05
N15 G28 X0 Y0
G17 XY-plane √ • Cuttin
designation

G18 ZX-plane √ • Cuttin


designation

G19 YZ-plane √ • Cuttin


designation

G28 Machine zero Sends any programmed slide to its machine reference (zero) position G28 is not pro
return such as:
N67 G
N67 G
N67 G
ref
the
inte
N222 G28 Z-0
N223 G28 X9
G40 Cutter radius √ It cancels the r
compensation
cancel
G41 Cutter radius √ G41 is used w
compensation to be cut of the
– left G42 is used w
G42 Cutter radius √ to be cut of the
compensation
– right

G43 √ N50 G43 Z1.0 H05 The value registered in H05 is added to all the following
G44 √ Z movements
N55 G44 Z1.0 H06 The value registered in H06 is subtracted from all the
following Z movements
Z1.0 means 1.0 mm target position above the part zero
Programming H00 cancels tool offset
G49 Cancels the G43 or G44
G50 Scaling √
function
cancel
G51 Scaling √
function
G52 Temporary √ G52 Xxx Yyy
shift in the When the cont
active G59) by xx, yy
coordinate
system

O1453
G91 G28 X0 Y0 Z0 (Move the work
M06 101 offset to the 1st
M03 S1000 P.C.D from the
G90 G54 G43 H1
G52 X100 Y100
G54 origin)
G00 X0 Y0
G00 Z5
G16
. (Move the work
. offset to the 2nd
G15 P.C.D from the
G52 X300 Y100 G54 origin)
G00 X0 Y0
G16

G53 Machine G53 G0 X0 Y0 Z0 (Sets the machines datum as the active coordinate system This code tem
Coordinate and moves to that position) system. This c
Selection point for each
G53 will rever

G54: Work √ N10 G54; (sel


G95 coordinate N20 G56; (sel

G68 Coordinate
system
rotation
G69 Coordinate
system
rotation
cancel
G73 High speed √
deep hole
drilling cycle

G80 Fixed cycle


cancel
G81 Drilling cycle √

G82 Drilling cycle √


with dwell
G83 Peck drilling √
cycle

G84 Right hand √


tapping cycle

G85 Boring cycle √


G86 Boring cycle √
G87 Bach boring √
cycle
G88 Boring cycle √
G89 Boring cycle √
G92 Temporary % G92 X~ Y~ Z~
work offsets G00 G90 G55 X0 Y0 (Rapid to G54 origin) X~ is the X-ax
G92 X10 Y10 (Shifts The origin of G54 by 10,10 - No movement) Y~ is the Y-ax
G00 G90 G55 X0 Y0 (Rapid movement to the newly defined origin) Z~ is the Z-ax
G92 X-10 Y-10 (Shifts the origin back to the original values - No movement) A~ is the A-ax
G00 G90 G55 X0 Y0 (Rapid movement to the original G55 origin) • G92 is no
• G92 canc
• To cancel

G98 Return to √
initial level in
a fixed cycle
G99 Return to R- √
level in a
fixed cycle

You might also like