You are on page 1of 41

BENHA UNIVERSITY

Faculty of Engineering

COMPUTER NUMERICAL
CONTROL (CNC)
PROGRAMMING

Dr. Ashraf HASSAN

Department of Mechanical Engineering


COMPUTER-AIDED PART
PROGRAMMING I

AUTOMATICALLY
PROGRAMMED TOOLS (APT)
Steps in computer-aided part programming
* The part programmer’s job: defining the part geometry –
specifying the operation sequence & tool path
* The computer’s job: Input translation – arithmetic calculation –
cutter offset computation - postprocssor

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 336


THE APT LANGUAGE:
Four types of statements
 Geometry statements: define the geometric
elements that comprise the workpart.
 Motion statements: describe the path taken by the
cutting tool.
 Postprocessor statements: apply to the specific
machine tool and control system: feeds & speeds.
 Auxiliary statements: identify part, tool, tolerances
…etc.

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 337


GEOMETRY STATEMENTS
 Point: P1=POINT/5,4,0
 Line: L3=LINE/P3,P4
OR,
L4=LINE/P5,PARLEL,L3
 Plane: PL1=PLANE/P1,P4,P5
PL2=PLANE/P2,PARLEL,PL1
 Circle:
C1=CIRCLE/CENTER,P1,RADIUS,5

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 338


EXAMPLE (22)
EXAMPLE ( 22 )

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 340


Geometry statements
P0=POINT/0,-1,0
P1=POINT/6,1.125,0
P2=POINT/0,0,0
P3=POINT/6,0,0
P4=POINT/1.75,4.5,0
L1=LINE/P2,P3
C1=CIRCLE/CENTER,P1,RADIUS,1.125
L2=LINE/P4,LEFT,TANTO,C1 ( ‫تضع نفسل فى المرمز وظهرك لنقطة‬
‫)األصل وتنظر للخط تجده على اليسار‬

L3=LINE/P2,P4
PL1=PLANE/P2,P3,P4
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 341
Other geometry statements
CIRCLE DEFINITION

 C1=CIRCLE/4,3,0,2
(center & radius, Fig.)
 C3=CIRCLE/CENTER,(P
OINT/5,10,0),P2
 C1=CIRCLE/CENTER,P1,
TANTO,L1 (Fig.)
 C1=CIRCLE/P2,P3,P4
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 342
LINE DEFINITION:
L1=LINE/2,1,0,5,3,0 (Fig.)
L1=LINE/P1,LEFT,TANTO,
C1 (Fig.) ( ‫تضع نفسل فى المرمز‬
‫وظهرك لنقطة األصل وتنظر للخط‬
‫)تجده على اليسار‬
L3=LINE/P1,LEFT,ATANGL
,20 (Fig.)
L4=LINE/P1,LEFT,ATANGL
,30,L3 (Fig.)

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 343


 L6=LINE/P2,PERPTO, L3
 L7=LINE/LEFT,TANTO,C3, LEFT,
TANTO, C4 ( ‫تضع نفسل فى المرمز‬
‫وظهرك لنقطة األصل وتنظر للخط‬
‫)تجده على اليسار‬
L8=LINE/LEFT,TANTO,C3,RIGHT,
TANTO, C4
 L9=LINE/RIGHT,TANTO,C3,LEFT,
TANTO, C4
 L10=LINE/RIGHT,TANTO,C3,RIGHT
, TANTO, C4

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 344


PLANE DEFINITION
 PL1=PLANE/P1,P2,P3
 PL2=PLANE/P4,PARLEL,PL1
 PL3=PLANE/PERPTO,PL1,P5,
P6

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 345


POINT DEFINITION:
 P1=POINT/L1,L2
 P2=POINT/YLARGE,INTOF, L3,C1
 P3=POINT/XLARGE,INTOF, L3,C1
 P4=POINT/YLARGE,INTOF, C1,C2
 P5=POINT/YSMALL,INTOF,C1, C2
 P6=POINT/CENTER,C1

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 346


MOTION STATEMENTS
 At the start, the tool must be given a starting
point (FROM statement occurs only at start of
the motion sequence:
FROM/TARG OR,
FROM/-2,-2,0
1. PTP MOTIONS (ONLY 2):
GOTO/P2 (ABSOLUTE)
GOTO/2,7,0
GODLTA/0,0,-1 (INCREMENTAL)

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 347


EXAMPLE (23)
EX (23)

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 349


EX (23)

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 350


The part to be
programmed is a drilling
job. Three holes are to be
drilled at a diameter of
(31/64) in. The close
hole size requires
reaming to 0.5 in
diameter. Recommended
speeds and feeds are:
592 rpm, 3.55 in/min for
drilling and 382, 3.82
in/min for reaming
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 351
EXAMPLE (24)
EXAMPLE (24)
The workpart shown in the Fig below is to be
completed in an NC drill press. The outline of
the part has already been completed and the
five holes are to be drilled. The axis system is
to be located with the origin at the lower left-
hand corner. The part is 3/8 in thick. Write the
APT geometry statements and the sequence of
motion statements to perform the drilling
sequence. The target point is at (-1,-3).
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 353
Geometry statements
P0=POINT/-1,-3,2 (The plane Z=0 ¼’’ above the part surface)
P1=POINT/1.5,0.9,0 (manual drilling)
P2=POINT/1.5,3.6,0 (manual drilling)
P3=POINT/4,3.6,0 (manual drilling)
P4=POINT/6,2,0
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 354
P5=POINT/7,3.6,0 GODLTA/0,0,-1
Motion statements GODLTA/0,0,1
FROM/P0 GOTO/P4
GOTO/P1 GODLTA/0,0,-1
GODLTA/0,0,-1 GODLTA/0,0,1
GODLTA/0,0,1 GOTO/P5
GOTO/P2 GODLTA/0,0,-1
GODLTA/0,0,-1 GODLTA/0,0,1
GODLTA/0,0,1 GOTO/P0
GOTO/P3
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 355
CONTOURING
MOTIONS:
The tool is directed
along 2 intersected
surfaces: 1. drive
surface 2. part
surface
3. check surface:
stops the
movement of the
tool. It is used with
modifier words:
TO, ON, PAST &
TANTO (next Fig)

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 356


Ashraf HASSAN Computer Numerical Control (CNC) Progamming 357
 The programmer must keep in mind where the tool
comes from (2nd Fig).
 At the start, the tool must be given a starting point
(FROM statement occurs only at start of the motion
sequence:
FROM/TARG OR,
FROM/-2,-2,0
GO/TO,PL1,TO,PL2,TO,PL3 (initialize
contouring & different than GOTO Statement)
The tool is instructed to move to the intersection of the
drive surface (PL1), the part surface (PL2), and the check
surface (PL3). The periphery of the cutter is tangent to
PL1 & PL3 (TO). The 3 surfaces must be specified in the
order: drive surface, part surface & check surface.
It is not necessary to repeat the part surface (EX 3rd Fig).
GORGT/PL3, PAST,PL4 OR
GORGT/L3,PAST,L4 (planes could be
substituted by lines)
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 358
EXAMPLE (25)
EXAMPLE ( 25 )

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 360


EXAMPLE (25)
The following is a list of motion statements to machine
the part shown in the Fig. above (Example (22)). The
sequence begins with tool located at the target point P0.
FROM/P0
GO/TO,L1,TO,PL1,TO,L3
GORGT/L1,TANTO,C1
GOFWD/C1,PAST,L2
GOFWD/L2,PAST,L3
GOLFT/L3,PAST,L1
GOTO/P0
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 361
EXAMPLE (26)
EXAMPLE (26)

A profile milling operation is to be performed


to generate the outline of the part shown in
Fig below. The 2 holes are already drilled in
the part. The part is ½ in thick. Write the
APT geometry statements to define the part
outline and the sequence of motion
statements to perform the profile milling
sequence. The target point is at (-3,-3).

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 363


Geometry statements
P0=POINT/-3,-3,2 (plane Z=0 about 3/4’’ below the part surface)
P1=POINT/0,0,0
P2=POINT/6,0,0
P3=POINT/6,1.875,0
P4=POINT/2,3.75,0
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 364
P5=POINT/0,3.75,0 L6=LINE/P1,P5
PL1=PLANE/P1,P2,P3
P6=POINT/3,2.875,0 Motion statements
L1=LINE/P1,P2 FROM/P0
GO/TO,L1,TO,PL1,TO,
L2=LINE/P2,P3 L6
C1=CIRCLE/P6,RA GORGT/L1,PAST,L2
DIUS,1 GOLFT/L2,PAST,L3
GOLFT/L3,TANTO,C1
L3=LINE/P3,RIGHT,
GOFWD/C1,TANTO,L4
TANTO,C1 GOFWD/L4,PAST,L5
L4=LINE/P4,LEFT, GOLFT/L5,PAST,L6
TANTO,C1 GOLFT/L6,PAST,L1
GO/TO, P0
L5=LINE/P4,P5
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 365
QUIZ
QUIZ (14)

Write the
motion
statements
for the tool
path shown
in Fig.
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 367
POSTPROCESSOR STATEMENTS

These are statements that control the operation of


the spindle, the feed and other features of the
machine tool.

COOLNT/ON RAPID
END (stops the m/c to change tool manually)
SPINDL/ON SPINDL/1250,CCW
FEDRAT/6 (in/min) TURRET/T30
MACHIN/DRILL, 3

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 368


AUXILIARY STATEMENTS
These statements are used for cutter size
definition, part identification…..
CLPRNT (cutter location printout)
CUTTER/0.5 (cutter offset will be calculated
based on this definition. Here the cutter path must
be offset from the part outline by 0.25 in)
PARTNO TOOLNO/3572,6
OUTOL/ (Fig, next page) INTOL/ (Fig)
TOLER/.005 (inner & outer tolerances are equal)
FINI (last word in program)
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 369
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 370
A complete APT program
Example (27)
Assume the workpiece is a low carbon steel plate which has
been previously cut in the rough shape of the part outline. The
tool is a ½ in diameter end milling cutter. Typical cutting
conditions are cutting speed =573 rpm and feed= 2.29 in/min.
PARTNO EXAMPLE PART (first statement) (auxiliary)
MACHIN/MILL,1 (post)
CLPRNT (auxiliary)
INTOL/.001
OUTOL/.001
CUTTER/.5
P0=POINT/0,-1,0 (geometry)
Ashraf HASSAN Computer Numerical Control (CNC) Progamming 371
EXAMPLE ( 27 )

Ashraf HASSAN Computer Numerical Control (CNC) Progamming 372


P1=POINT/6,1.125,0 FEDRAT/2.29
P2=POINT/0,0,0 COOLNT/ON
P3=POINT/6,0,0 Motion statements
P4=POINT/1.75,4.5,0 FROM/P0
GO/TO,L1,TO,PL1,TO,L3
L1=LINE/P2,P3
GORGT/L1,TANTO,C1
C1=CIRCLE/CENTER,P GOFWD/C1,PAST,L2
1,RADIUS,1.125 GOFWD/L2,PAST,L3
L2=LINE/P4,LEFT GOLFT/L3,PAST,L1
TANTO,C1 RAPID (Post)
L3=LINE/P2,P4 GOTO/P0
PL1=PLANE/P2,P3,P4 COOLNT/OFF
FINI (last statement)
SPINDL/573
Ashraf HASSAN
(post) Computer Numerical Control (CNC) Progamming 373
THANK YOU VERY MUCH

You might also like