Anda di halaman 1dari 104

CNC PROGRAMMING

1
Basic Concepts of Part Programming
Different Types of Format

Fixed Sequential Format

Tab Sequential Format

Word Address Format (EIA RS-274-D standard)

2
Address
Word
Function
A Rotation about the X-axis
B Rotation about the Y-axis
C Rotation about the Z-axis
F Feedrate commands
G Preparatory commands
I Circular interpolation X-axis offset
J Circular interpolation Y-axis offset
K Circular interpolation Z-axis offset
M Miscellaneous commands
N Sequence number
R Arc radius
S Spindle speed
T Tool number
X X-axis data
Y Y-axis data
Z Z-axis data
3
4
Basic Concept of Part Programming
Part programming contains geometric data about the part and motion
information to move the cutting tool with respect to the work piece.
Basically, the machine receives instructions as a sequence of blocks
containing commands to set machine parameters; speed, feed and other
relevant information.
A block is equivalent to a line of codes in a part program. Character
N135 G01 X1.0 Y1.0 Z0.125 T01 F5.0

Coordinates
Special function
Block number
G-code
Tool number
NC Coordinate Systems
To program the NC processing equipment, a standard axis system must be
defined by which the position of the workhead relative to the workpart can be
specified.
There are two axis systems used in NC, one for flat and prismatic parts and the
other for rotational parts.
Both axis systems are based on the Cartesian Coordinate System.
5
The axis system for flat and prismatic parts consists of:
1. Three linear axes (X, Y, Z) in Cartesian coordinate system.
2. Three rotational axes (A, B, C)
In most machine tool applications, the x-axes and y-axes are used to move and
position the worktable to which the part is attached, and the z-axis is used to
control the vertical position of the cutting tool
NC Coordinate Systems
6
The axis system for rotational parts is shown below
The path of the cutting tool relative to the rotating workpiece is defined in the
x-z plane.
The x-axis is the radial location of the tool.
The z-axis is parallel to the axis of rotation of the part.
NC Coordinate Systems
7
The Right-hand rule of
Coordinates
8
CNC Turning Machines
9
CNC Milling Machines
Vertical
Horizontal
In the area of milling systems, three most common machine
tools are available:

CNC Vertical Machining Center VMC
CNC Horizontal Machining Center HMC
10
Three Major Phases of A CNC Program
The following shows the three major phases of a CNC program.
%
: 1001
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X1.00 Y1.00
N25 Z0.125
N30 G01 Z-0.125 F5.0
N35 G01 X2.0 Y2.0
N40 G00 Z1.0
N45 X0 Y0
N50 M05
N55 M30
Program set up
Material removal
System shutdown
11
Three Major Phases of A CNC Program:
1. Program Setup
The program setup contains all the instructions that prepare the machine for
operation.
% Program start flag
: 1001 Four-digit program number
N5 G90 G20 Use absolute units and inch programming
N10 M06 T2 Stop for tool change, use tool #2
N15 M03 S1200 Turn the spindle on CW to 1200 rpm
12
Three Major Phases of A CNC Program:
2. Material Removal
The material removal phase deals exclusively with the actual cutting feed moves.
N20 G00 X1.0 Y1.0 Rapid move to (X1, Y1) from origin
N25 Z0.1 Rapid down to Z1.0 just above the part
N30 G01 Z-0.125 F5.0 Feed down to Z-0.125 at 5 ipm
N35 X2.0 Y2.0 Feed diagonally to X2 and Y2
N40 G00 Z1.0 Rapid up to Z1 (clear the part)
N45 X0 Y0 Rapid back home X0 Y0
3. System shutdown
The system shutdown phase contains the G- and M-codes that turn off all the
options that were turned on in the setup phase.

N50 M05 Turn the spindle off
N55 M30 End of program

13

14
Basic Guidelines for Programming
The sequence of words (address characters plus
parameters) in an NC block must appear in the
following order when more than one address character
is used per block:
N, G, X, Y, Z, I,J, K, F, S, T, M, ;

Only one of each address character can be used per
block, except some G codes. For instance, you can
place one G code from the Interpolation Group and
one G code from the Programming Mode Group in the
same block. However, you can not place two codes
from one group in the same block.
15
Some codes don't have to be repeated in
every block. The mill will use the same value
until you change it.
Example: N3 G01 X.5 Y2 F1
N4 Y3.5
The first block in a program should move the
tool away from the workpiece to a safe point
(where the tool is not touching the workpiece)
to turn on the spindle.
Example:- NO G00 G9O Z.1
N1 M3
16
The third instruction in a program, after the spindle is
turned on, should move the tool to the start point, the
point where machining begins.
Example:- N2 G00 G90 X.5 Y.5

The end of a part program should move the tool back to
the start point so the tool will be ready to cut the next part.
Example: N5 G00 Z.1
N6 X.5 Y.5 M5
N7 M2
you can leave out extra zero's as long as they have no affect
on the value. For instance you can write
N6 G00 X0.500 Y1.500
as N6 G0 X.5 Y1.5 saving six characters.
17
Example 1: Write a part program to obtain the model shown below from the
profile of given size. FACE MILL TO REDUCE THICKNESS BY 2mm USING 50mm DIA.
MILL TOOL.
100
75
18
0001

G00 G28 G21 G91 X0 Y0 Z0
M06 T05
M03 S1000
G90 G00 X-30 Y20 Z5
G00 Z-2
G01 X130 Y20 F40
G00 Y55
G01 X-30
G00 Z5
G91 G28 X0 Y0 Z0
M05 M09
M30
19
Example 2 : Write a part program to perform
the linear slotting operation with 3mm depth
on the component as shown in the figure.
20
0002

N01 G21
N02 G91 G28 Z0
N03 G28 X0 Y0
N04 G90
N05 M06 T01
N06 M03 S1000
N07G00 Z2
N08 G00 X10 Y10
N09 G01 Z-3 F50
N10 X10 Y90
N11 X90 Y90
N12 X90 Y10
N13 X10 Y10
N14 G00 Z5
N15 G91 G28 Z0
N16 G28 X0 Y0
N17 M05
N 18 M30
21
7
5

Mill circular slot using slot mill of 4 mm
Example 3: Write a part program to obtain the model shown below from the
workpiece of given size.
100
15
2
49
37.5
50
22
0003
N01 G21 G91 G28 Z0
N02 G28 X0 Y0
N03 G90
N04 M06 T01
N05 M03 S1000
N06 G00 X50 Y13
N07 G01 Z-2 F20
N07 G02 X50 Y62 R24.5 F50
N08 G02 X50 Y13 R24.5 F50
N09 G00 Z2
N10 G91 G28 Z0
N11 G28 X0 Y0
N12 M05
N13 M30




23
Example 4: Write a part program to perform slotting operation as shown below
from the profile of given size. Take Radius as 25 mm and Depth of cut 10mm
(-50, 0) (0, 0) (50, 0)
(50,20)
(25,45) (-25,45)
(-50,20)
N01 G21 G91 G28 X0 Y0 Z0
N02 M06 T04
N03 M03 S1000
N04 G90
N04 G00 X50 Y0 Z5
N05 G01 Z-10 F50
N06 G01 X100 Y0
N07 G01 X100 Y20
N08 G02 X75 Y45 R25
N09 G03 X25 Y45 R25
N10 G02 X0 Y20 R25
N11 G01 X0 Y0
N13 G01 X50 Y0
N12 G00 X0 Y0 Z0
N13 M05
N14 M30






Write a part program to obtain the model shown
below from the profile of given size. Operation: Slot
mill of dia. 4mm. Take Billet size of 100 X 100mm,
Radius of circular slot 25mm and Depth of cut
10mm
26
(80, 80)
N01 G21 G94
N02 G91 G28 X0 Y0 Z0
N03 G90
N04 M06 T01
N05 M03 S1000
N06 G00 X50 Y37.5
N07 G01 Z-10 F50
N08 G02 X50 Y62.5 Z-10 R12.5 F50
N09 G02 X50 Y37.5 Z-10 R12.5
N10 G00 Z10
N11 G00 X10 Y10
N12 G01 X10 Y10 Z-10
N13 G01 X80 Y10
N14 G01 X80 Y80
N15 G01 X10 Y80
N16 G01 X10 Y10
N17 G00 Z10
N18 G28 X0 Y0 Z0
N19 M05 M09
N20 M30

27
(80, 80)
Example 5: Write a part program to obtain the model shown below from the
profile of given size. CONTOUR MILL USING 20mm DIA.

G00 G28 G91 X0 Y0 Z0
M06 T02
M03 S1000
G90 G00 X-15 Y15 Z5
G00 Z-3
G01 G41 X4 F40
G01 X4 Y60
G01 X15 Y71
G01 X85 Y71
G01 X96 Y60
G01 X96 Y15
G01 X85 Y4
G01 X15 Y4
G01 X4 Y15
G40 X-15
G00 Z5
G91 G28 X0 Y0 Z0
M05 M09
M30

30
Example 6: Write a part program to obtain the model shown below from the
profile of given size.
Drill 4 holes at the corners using drill bit of 5 mm
33
Canned Cycle
34
A sequence of machine operations initiated by a single G code.
Canned cycles act as shortcuts that simplify the program.


The five operations in a canned cycle:
Positioning of the X and Y axes

Rapid traverse to the R plane

Drill, boring & tapping

Operation at the bottom of hole

Retraction to the R

G00 G91 G28 Z0
G28 X0 Y0
M06 T5
M03 S1200
G90 G00 X6 Y6 Z5
G81 G99 G90 Z-20 R2 F50
X94
Y69
X6
G80
G91 G28 X0 Y0 Z0
M05
M30

36
7
5

Mill circular pocket using slot mill of 12 mm
Example 7) Write a part program to obtain the model shown below from the workpiece
of given size.
100
15
2
30
37.5
50
38
G170 R0 P0 Q3 X10 Y10 Z - 5 I0 J0 K24
G171 P75 S1000 R50 F45 B1500 J15

R - Position of tool to start cycle
P - Roughing (0) / finishing (1)
Q - Peck increment for each cut
X,Y & Z - Coordinates of bottom center of the circular pocket.
I & J - Finishing allowance for side and pocket base
K - Radius of circular pocket
P - Cutter movement percentage for next step
S - Roughing spindle speed
R - Roughing feed in Z direction
F - Roughing feed in XY directions
B - Finishing spindle speed
J - Finishing feed
G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01
M03 S1000
G00 X50 Y37.5 Z5
G01 Z0 F20
G91
G170 R0 P0 Q1 X0 Y0 Z-2 I0 J0 K-15
G171 P45 S1200 R25 F50 B1300 J40
G28 Z0
G28 X0 Y0
M05
M30


40
Example 8 ) Write a part program to obtain the model shown below from the workpiece
of given size.
G0 G91 G28 Z0 M39
G28 X0 Y0
M06 T1
M03 S1000
G90 G00 X-30 Y20 Z5
Z-1
G01 X130 Y20 F40
G0 Y55
G01 X-30
G0 Z5
G91 G28 X0 Y0 Z0
M05
M06 T2
M03 S1300
G90 G00 X-15 Y15 Z5
Z-4
G01 G41 X4 F40
Y60
X15 Y71
X85
X96 Y60
Y15
X85 Y4
X15
X4 Y15
G40 X-15
G00 Z5
G91 G28 X0 Y0 Z0
M5
M06 T3
M03 S1200
G90 Z5 M08
G0 X50 Y13
G01 Z-3 F20
G02 X50 Y62 R24.5 F50
G02 X50 Y13 R24.5
G0 Z0
G28 G91 G0 Z0 X0 Y0

M05
M06 T4
M03 S1000
G90 G0 X50 Y37.5Z5
G1 Z-1 F20
G91
G170 R0 P0 Q1 X0 Y0 Z-2 I0 J0 K-15
G171 P45 S1200 R25 F50 B1300 J40
G00 G28 Z0 X0 Y0
M5
M06 T5
M03 S1200
G90 G00 X6 Y6 Z5
G81 G99 G90 Z-20 R3 F50
G90 X94
Y69
X6
G80
G91 G28 X0 Y0 Z0
M05 M30
Mirroring
42
M70 Mirror along X
ON

M71 Mirror along Y
ON

M80 Mirror along X
OFF

M81 Mirror along Y
OFF

M98 subprogram Call

M99 Subprogram End

43
Note:
Width of slot = 4 mm and Depth of Cut= 1mm
44
G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01
M03 S1000
G00 X0 Y0 Z5
M98 P0015000
M70
M98 P0015000
M80
M70
M71
M98 P0015000
M80
M81


M71
M98 P0015000
M81
G00 Z5
G91 G28 Z0
G28 X0 Y0
M05
M30
Subprogram
:5000
G00 X10 Y10 Z5
G01 Z-1 F20
X40
X10 Y40
Y10
G01 Z5
G00 X0 Y0
M99

45
G51 Scaling Function
G50

Scaling Function Cancel

Scaling
46

G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01
M03 S1500
G00 X0 Y0
M98 P0012424
G00 X0 Y0
M98 P0012425
G91 G28 Z0
G28 X0 Y0
M05
M30


Subprogram 2:
:2424
G90 G00 X-40 Y-40 Z5
G01 Z-1 F40
X-40 Y40
X40 Y40
X40 Y-40
X-40 Y-40
G01 Z5
M99
Subprogram 1:
:2425
G51 P0.5
M98 P0012424
G50
M99

47
G68 X.. Y.. R.. (Coordinate system rotation )

X, Y Hole Center

R Rotation Angle

G69 (Coordinate system rotation Cancel )

G73 High speed Peck Drilling Cycle

Rotation
48
G21 G94
G91 G28 Z0
G28 X0 Y0
G90
M06 T01
M03 S1500
G00 X25 Y25 Z5
G68 X0 Y0 R0
M98 P0012323
G68 X0 Y0 R45
M98 P0012323
G68 X0 Y0 R90
M98 P0012323
G68 X0 Y0 R135
M98 P0012323

G68 X0 Y0 R180
M98 P0012323
G68 X0 Y0 R225
M98 P0012323
G68 X0 Y0 R270
M98 P0012323
G68 X0 Y0 R315
M98 P001 2323
G69
G91 G28 Z0
G28 X0 Y0
M05
M30
Subprogram:
:2323
G99 G90G73 X25 Y25 Z-5 Q1 R3 F80
G00 Z5
G80
M99


49
CNC PROGRAMMING TURNING OPERATIONS
Exercise 1: Facing cycle (G94)
G99 G28 U0 W0 (TAKING THE TOOL TO HOME POSITION INCREMENTALLY,)
M06 T1 (TOOL CHANGE,TO TOOL NO 1)
M39
G97 M03 S1100 (SPINDLE ON, GAURD CLOSE)
G00 X34 Z2 (INITIAL POSITIONING CLOSE TO THE WORKPIECE)
G99 G94 X0 Z-0.5 F0.1 (FACING, WIDTH 0.5 MM, FEED RATE IN MM/REV)
Z-1
Z-1.5
Z-2
G28 U0 W0 (HOMING)
M05 (SPINDLE STOP)
M38 (GAURD OPEN)
M30 (PROGRAM END)
Exercise 2: Turning cycle (G90)
G99 G28 U0 W0
M06 T1
G97 M03 S1100
G00 X32 Z2
G90 X31 Z-45 F.1
X30
X29 Z-30
X28
X27
X26
X25 Z-15
X24
X23
X22
G28 U0 W0
M05
M30
Exercise 3: Taper turning cycle (G90 R-)
G99 G28 U0 W0
M06 T1
G97 M03 S1000
G0 X32 Z2
G90 X31 Z-45 F0.1
X30
G90 X31 Z-44 R-0.5
X31 R-1
X31 R-1.5
X31 R-2
X31 R-2.5
X31 R-3
X31 R-3.5
X31 R-4
X31 R-4.5
X31 R-5
X31 R-5.5
X31 R-5.75
G28 U0 W0
M05
M09 M38
M30
Exercise 4: Stock removal Turning cycle (G71)
G99 G28 U0 W0
M06 T1
G97 S1500 M03 M39
G00 X32 Z2
G71 U0.5 R0.5
G71 P07 Q14 U0.1 W0.1 F0.1
N07 G00 X10
G1 Z-12
G02 X16 Z-15 R3
G1 X22 Z-30
G02 X26 Z-32 R2
G03 X30 Z-34 R2
G01 Z-44
N14 X32
G70 P07 Q14
G28 U0 W0
M05 M09
M30
54
G99 G28 U0 W0
M06 T1
G97 S1500 M03 M39
G00 X34 Z2
G72 W0.5 R0.5
G72 P07 Q13 U0.1 W0.1 F0.1
N07 G00 Z-17
G1 X32
X26 Z-14
X20
G02 X12 Z-10 R4
G1 X8 Z0
N13 Z2
G70 P07 Q13
G28 U0 W0
M05 M09
M30
Exercise 5: Stock removal Facing cycle (G72)
Exercise 6: Threading cycle (G76)
G99 G28 U0 W0
M06 T1
G97 S110 M13 M39
G00 X32 Z2
G90 X31 Z-40 F0.1
X30
X29
X28
X27
X26
X25
X24
X23
X22
X21
X20
G00 X14
G01 X22 Z-2
M05 M09
G28 U0W0
M06 T02
G97 S250 M13
G00 X22 Z2
G76 P034560 Q100 R0.06
G76 X18.08 Z-30 P960 Q150 F1.5
G28 U0 W0 M05 M09
M30
56
The portion at the end of a threaded shank which is not cut or
rolled to full depth, but which provides a transition between full
depth threads and the fastener shank or head.
Thread Runout
Screw Thread terminology
Pitch
Crest
Root
Flank
Thread
Angle
Pitch line
Axis of thread
Axial thickness
Addendum
Dedendum
Flank
angle
Major dia
Pitch dia Minor dia
EXTERNAL THREAD TERMINOLOGY
Tool Nose Radius Compensation
58
59
60
61
Computer-Assisted Part Programming
Write machine instructions using natural language type
statements
Statements translated into machine code of the MCU
APT (Automatically Programmed Tool) Language
COMPUTER ASSISTED PART PROGRAMMING
There are various programming languages developed in the recent past, such
as,
APT (Automatically Programmed Tools),
ADAPT, EXAPT, VNIAPT
AUTOSPOT,
COMPAT-II,
PROMPT,
ROMANCE,
SPLIT
- are used for writing a computer programme, which has English like
statements. A translator known as compiler program is used to translate it in a
form acceptable to MCU.
Computer assisted part programming
APT (Automatically Programmed Tool)
- Machining instructions are written in English-like statements that are
translated by the computer into the low-level
- It is used for more complex jobs.

machine code of the MCU.
The various tasks in computer-assisted part programming are divided
between;


The human part
The computer.
programmer
Sequence of activities in computer-assisted part programming
Part Programmer's Job :
Two main tasks of the programmer:
1- Define the part geometry
2- Specify the tool path and Operation Sequence
1- Define the part geometry
Underlying assumption: no matter how complex the part geometry, it is composed of
basic geometric elements and mathematically defined surfaces
Geometry elements are sometimes defined only for use in specifying tool path
Examples of part geometry definitions:
P4 = POINT/35, 90,0
L1 = LINE/P1, P2
C1 = CIRCLE/CENTER, P8, RADIUS, 30.0
2- Specify the tool path and Operation Sequence
Tool path consists of a sequence of points or connected line and arc segments, using previously
defined geometry elements
Point-to-Point command: GOTO/P0
Continuous path command: GOLFT/L2, TANTO, C1
Other Functions in Computer-Assisted Part Programming
Specifying cutting speeds and feed rates
Designating cutter size (for tool offset calculations)
Specifying tolerances in circular interpolation
Naming the program
Identifying the machine tool
Computer Tasks in Computer-Assisted part programming
1. Input translation converts the coded instructions in the part program into
computer usable form.

2. Arithmetic and cutter offset computations performs the mathematical
computations to define the part surface and generate the tool path, including cutter
offset compensation (CLFILE)

3. Editing Provides readable data on cutter locations and machine tool operating
commands (CLDATA).

4. Postprocessing Converts into low level code that can be interpreted by the
MCU
There are four basic types of statements in the APT language:
Geometry statements, also called definition statements; are used to define the
geometry elements that comprise the part.
1.
2. Motion commands; are used to specify the tool path.
3. Postprocessor statements; control the machine tool operation, for example, to
specify speeds and feeds, set tolerance values for circular interpolation, and
actuate other capabilities of the machine tool.
4. Auxiliary statements; a group of miscellaneous statements used to name the part
program, insert comments in the program and accomplish similar functions.
APT vocabulary words consist of six or fewer characters. The characters are
almost always letters of the alphabet.
Geometry statements:
The points, lines, and surfaces must be defined in the program prior to
specifying the motion statements. The general form of an APT geometry statement is
the following
SYMBOL = GEOMETRY TYPE/descriptive data
as an example; P1 = POINT/20.0, 40.0, 60.0
A symbol can be any combination of six or fewer alphabetical and numerical
characters, at-least one of which must be alphabetical. Also symbol cannot be APT
vocabulary word.
Symbol Permissible or Not and Why

P1 Permissible
PZL Permissible
ABCDEF Permissible
PABCDEF Not Permissible, Too many Characters (Maximum 6 characters)
POINT Not Permissible, APT vocabulary word
P1.5 Not Permissible, only alphabet and numerical characters allowed

Points: Specification of a point can be accomplished by the following:
1)
Designating its x-, y-, and z-coordinates;
P1 = POINT/15.0, 10.0, 25.0
2)
As the intersection of two intersecting lines;
P2 = POINT/INTOF, L1, L2
L1 and L2 are two previously defined lines.
Lines: A line in APT is considered to be of infinite length in both directions.
Specification of a line can be accomplished by the following:
Two points through which it passes;
L1 = LINE/P3, P4
P3 and P4 are two previously defined points.
1)
2) Passes through point (P5) and parallel to another line (L3) that has been
previously defined;
L2 = LINE/P5, PARLEL,L3
Planes: In APT, a plane extends indefinitely. A plane can be defined by the
following:
1) Three points through which it passes;
PL1 = PLANE/P1, P2, P3
P1, P2 and P3 must be non-collinear.
2) Passes through point (P2) and parallel to another plane (PL1) that has been
previously defined;

PL2 = PLANE/P2, PARLEL, PL1
Circles: In APT, a circle is considered to be a cylindrical surface that is
perpendicular to the plane and extends to infinitely in the z-direction.
A circle can be defined by the following;
Its center and radius;
C1 = CIRCLE/CENTER, P1, RADIUS, 25.0
1)
2) Three points through which it passes;
C2 = CIRCLE/P4, P5, P6
The three points must not be collinear.
2. MOTION STATEMENTS
APT motion statements have a general format:
motion command / descriptive data
e.g. GOTO / P1
At the beginning of the motion statements tool must be given a starting
point
FROM / P0
Or FROM / -2, -2, 0

In APT there are two basic types of motion statements:
a) Point to Point motion
b) Contouring motion


POINT TO POINT MOTION
There are only two basic point to point motion commands

GOTO:
The GOTO statement instructs the tool to go to a particular point location
specified in the descriptive data.
e.g. GOTO / P2
GOTO / 2, 7, 0

GODLTA:
The GODLTA command specifies an incremental move for the tool.

e,g, GODLTA / 2, 7, 0
EXAMPLE OF POINT TO POINT MOTION
Drill three through holes of 0.5 diameter at P1, P2, P3. The part is 0.5 thick.
EXAMPLE OF POINT TO POINT MOTION
P1=POINT/1,2,0.5
P2=POINT/1,1,0.5
P3=POINT/3.5,1.5,0.5
P0=POINT/-1,3,2
FROM/P0
GOTO/P1
GODLTA/0,0,-0.5
GODLTA/0,0,0.5
GOTO/P2
GODLTA/0,0,-0.5
GODLTA/0,0,0.5
GOTO/P3
GODLTA/0,0,-0.5
GODLTA/0,0,0.5
GOTO/P0
CONTOURING MOTION
How to approach the check surface
Modifier words, such as TO, ON, PAST or TANTO, are used to govern the
position of the tool in relation to the check surface.
How to use the drive surface
Motion statements, GOLFT (go to the left), GOFWD (go forward) and
GORGT(go to the right), are also used to control the cutter motion.
EXAMPLE OF CONTOURING MOTION STATEMENTS
EXAMPLE OF CONTOURING MOTION STATEMENTS
FROM/P0
GO/TO,L1,TO,PL1,TO,L5
GORGT/L1,PAST,L2
GOLFT/L2,TO,L3
GORGT/L3,TANTO,C1
GOFWD/C1,PAST,L4
GOLFT/L5,PAST,L1
GOTO/P0
83
POST PROCESSOR STATEMENTS :
To write complete program, statements must be written that controls operations of the spindle,
feed and other features of the machine tools.
Post processor statement are,
COOLANT/ MACHIN/
END RAPID
FEDRAT/ SPINDL/
AUXILLIARY STATEMENTS :

A group of miscellaneous statements used to name the part program, cutter size, part
identification, insert comments in the program and accomplish similar functions.
Auxiliary statement are,
CLPRNT/ INTOL/
CUTTER / OUTOL/
FINI PARTNO
86
MACRO STATEMENTS :

Symbol = MACRO/ Parameter definition(s)
TERMAC
Activating MACRO subroutine
CALL/symbol, parameter specification
Example
DRI LL =MACRO/PX
GOTO/PX
GODLTA/0,0,-2.5
GODLTA/0,0,2.5
TERMAC
CALL/DRILL,PX=P1
CALL/DRILL,PX=P2




y
x
EXAMPLE 1 DRILLING & MILLING OPERATION

Write the APT program to generate the given profile.
EX 1.1 The drill will be operated at a feed of 0.05mm/rev and a spindle speed of 1000 rev/min.
At the beginning of the job, the drill point will be positioned at a target point located at
X=0, Y=-50, and Z=10 (in mm).

EX 1.2 For milling operation : Feed = 50 mm/min., Speed = 1000 rev/min.,
Cutter diam. = 20 mm.

PARTNO SAMPLE PART DRILLING OPERATION
MACHIN/DRILL,02
CLPRNT
UNITS/MM
REMARK Part geometry, Points are defined 10 mm above part surface.
P0 = POINT/0, -50.0, 10.0
P5 = POINT/70.0, 30.0, 10.0
P6 = POINT/120.0, 30.0, 10.0
P7 = POINT/70.0, 60.0, 10.0
REMARK Drill bit motion statements.
FROM/P0
RAPID
GOTO/P5
SPINDL/1000, CLW
FEDRAT/MMPR,0.05
GODLTA/0, 0, -25.0
GODLTA/0, 0, 25.0
RAPID GOTO/P6
GODLTA/0, 0, -25.0
GODLTA/0, 0, 25.0
RAPID GOTO/P7
GODLTA/0, 0, -25.0
GODLTA/0, 0, 25.0
RAPID GOTO/P0
SPINDL/OFF
FINI
PARTNO SAMPLE PART MILLING OPERATION
MACHIN/MILLING,01
CLPRNT
UNITS/MM
CUTTER/20.0
REMARK Part geometry, Points and Lines are defined 25 mm below part top surface.
P0 = POINT/0, -50.0, 10.0
P1 = POINT/0, 0, -25.0
P2 = POINT/160.0, 0, -25.0
P3 = POINT/160.0, 60.0, -25.0
P4 = POINT/35.0, 90.0, -25.0
P8 = POINT/130.0, 60.0, -25.0
L1 = LINE/P1, P2
L2 = LINE/P2, P3
C1 = CIRCLE/CENTER, P8, RADIUS, 30.0
L3 = LINE/P4, LEFT, TANTO, C1
L4 = LINE/P4, P1
PL1 = PLANE/P1, P2, P4
REMARK Milling cutter motion statements.
FROM/P0
SPINDL/1000, CLW
FEDRAT/50
GO/TO, L1, TO, PL1, TO, L4
GORGT/L1, PAST, L2
GOLFT/L2, TANTO, C1
GOFWD/C1, PAST, L3
GOFWD/L3, PAST, L4
GOLFT/L4, PAST, L1
RAPID GOTO/P0
SPINDL/OFF
FINI

90
Example 2:
A profile milling operation is to be performed to generate the outline of the
part in the figure shown below. Disregard the two holes in the part. They have
already been drilled and will be used to clamp the part to the machine table .
Write the complete APT program
PARTNO EXAMPLE 2
MACHIN/MILLING,04
CLPRNT
INTOL/0.0001
UNITS/MM CUTTER/20.0
P0 = POINT/0, -1, 0
P1 = POINT/0, 0, 0
P2 = POINT/6, 0, 0
P3 = POINT/6, 1.88, 0
P4 = POINT/2.0, 3.75, 0
P5=POINT/0, 3.75, 0
L1 = LINE/P1, P2
L2=LINE/P2, P3
L3=LINE/P1, P5
L4=LINE/P5, P4
P6=POINT/3, 2.88, 0
C1 = CIRCLE/CENTER, P6, RADIUS, 1
L5 = LINE/P3, LEFT, TANTO, C1
L6 = LINE/P4, RIGHT, TANTO, C1
PL1 = PLANE/P1, P2, P3
SPINDL/573, CLW
FEEDRAT/2.29 COOLNT/ON
FROM/P0
GO/TO, L1, TO, PL1, TO, L3
GOFWD/L1, PAST, L2
GOLFT/L2, PAST, L5
GOLFT/L5, TANTO, C1
GOFWD/C1, PAST, L6
GOFWD/L4, PAST, L3
GOLFT/L3, PAST, L1
RAPID
GOTO/P0
SPINDL/OFF
FINI
EXAMPLE 2
Graphic based software using menu driven technique improves the user
friendliness.

The part programmer can create the geometrical model in the CAM package or
directly extract the geometrical model from the CAD/CAM database.

Built in tool motion commands can assist the part programmer to calculate the
tool paths automatically.

The programmer can verify the tool paths through the graphic display using the
animation function of the CAM system.
CNC programming with Interactive Graphic System
NC Part Programming Using CAD/CAM
AUTOMATED INSPECTION
METHODS OF AUTOMATED INSPECTION
Offline Inspection
On-line/in-process,
On-line/post process inspection.
1. Off-line Inspection Methods

In off-line inspection, the inspection equipment is usually dedicated and does not
make any physical contact with machine tools. There is always a time delay between
production and inspection.

Manual inspection is common that tend to promote the use of offline inspection that
include:
1. Variability of the process is well within the design tolerance,
2. Processing conditions are stable and the risk of significant deviation in the process
is small, and
3. Cost incurred during inspection is high in comparison to the cost of few defective
parts.

2. On-line/In-process and On-line/Post-process Inspection Methods

If the task of inspection is done as the parts are manufactured, then it is called as
online inspection.

There are two variations of on-line inspection -
If the inspection is performed during the manufacturing operation, it is called on-
line/in-process inspection.

If the inspection is performed immediately following the production process, it is
called on-line/post-process inspection.
COORDINATE MEASURING MACHINE
A coordinate measuring machine is an electromechanical system designed to perform
coordinate metrology.

In three-dimensional coordinate system, a basic CMM is composed of the following
components.
Probe head and probe,
Mechanical structure and displacement transducer,
Drive system and control units, and
Digital computer system with application software.
99
Horizontal Structure Gantry Structure
Column Structure Bridge Structure Cantilever Structure
CMM Controls
On the basis of operating and controlling of CMM, it can be classified in the four
following ways :

1. Manual drive,
2. Manual drive with computer-assisted data processing, (CADP)
3. Motor drive with computer-assisted data processing,
4. Direct Computer Control (DCC) with computer-assisted data processing.
The probe is physically moved by human operator along the machines axes for making
contact with the part and the measurements are recorded in manual drive CMM.

The three orthogonal slides are designed to be nearly frictionless to permit the
probe to be free floating in the x, y, and z-directions.

A digital readout provides the measurements that the operator can record either
manually or with paper printout.

Only operator is allowed to carry out calculations on the data that includes the
enumeration of the centre and hole diameter.
1. Manual drive
Data processing and computational capability for performing the calculations that are
required to evaluate a given part feature are provided by a CMM with manual drive
CMM with computer-assisted data processing.

The different types of data processing and computations are ranging from simple
conversions of metric units to more complicated geometry calculations, such as
determining the angle between two planes.

The probe is free floating and permits the operator to bring it into contact with the
desired part surfaces.
2. Manual drive with computer-assisted data processing
Electric motors are used in a motor driven CMM with the computer-assisted data
processing to drive the probe along the machine axes under the operator control.

The motion is controlled by joystick or similar devices.

The collisions between the probe and the part are reduced by low-power stepping
motor and friction clutches.
3. Motor drive with computer-assisted data processing
CMM with direct computer control (DCC) operates just like a CNC machine tool.

It is power driven and the movements of the coordinate axes are controlled by a
dedicated computer under program control.

Various data processing is performed by the computer and it also keeps record of
the measurements made during inspection.

DCC CMM requires a part programming facility.
4. Direct Computer Control with computer-assisted data processing.

Anda mungkin juga menyukai