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

4. CNC Part Programming

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

4. CNC Part Programming

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

CNC Part

Programming

1
Introduction
 A part program is a sequential list of machining
instructions for the CNC machine to execute.
 These instructions are CNC code that contains all the
information required to machine a part, as specified by the
programmer.
 CNC code consists of blocks (also called lines), each of
which contains an individual command for a movement or
specific action.
 CNC codes are listed sequentially in numbered blocks.
Each movement is made before the next one.

2
Part Programming Steps

3
Introduction
There are many methods to compose a program by using ISO
codes. The most common one is the ISO standardized word and
address format. It divides the whole program into a number of
blocks, and alphabets are used to represent different words within
the blocks. The lengths of the block and word depend on the
needs of the design.

4
Part Programming
The common letters used in part programming are as follows:

N Block number List of G & M codes commonly


found on FANUC
G Preparatory function
X X axis coordinate https://en.wikipedia.org/wiki/G-code
Y Y axis coordinate
Z Z axis coordinate
I X axis location of arc center
J Y axis location of arc center
K Z axis location of arc center
S sets the spindle speed
F assigns a feed rate
T specifies tool to be used
M Miscellaneous function
U Incremental coordinate for X axis
V Incremental coordinate for Y axis
W Incremental coordinate for Z axis
5
Part Programming

 The words within blocks are usually composed of addresses


and numerical values.

 An address is represented by an alphabet (for example: G)


with corresponding numerical values behind it.

 Every address should appear only once in each block.

 Care should be taken for the decimal places of the numerical


value and units etc.

6
List of G & M codes commonly
found on FANUC

https://en.wikipedia.org/wiki/G-code
w
7
8
Part Programming
Table 2 and 3 shows some common G and M codes that are used
in CNC machines.

N20 G00 F60 M06


N20 means sequence no. 20; G00 means the tools moving rapidly to the
appointed position (with given co-ordinates); F60 means the tools moving
with feeding rate of 60 mm per minute; M06 means change of tool, etc.
9
Part Programming

Table 4 lists some blocks in a program as an example.

Several blocks forms a complete CNC machinery program.

10
11
12
(I, J)

13
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 Program set up
N15 M03 S1200
N20 G00 X1.00 Y1.00
N25 Z0.1
N30 G01 Z-0.125 F5.0
N35 G01 X2.0 Y2.0 Material processing
N40 G00 Z1.0
N45 X0 Y0
N50 M05
N55 M30 System shutdown

https://ncviewer.com
14
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 (Absolute Positioning defined wrt part zero
and inch programming)
N10 M06 T2 (Stop for tool change, use tool #2)
N15 M03 S1200 (Turn the spindle on with 1200 rpm)

15
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 Z0.1 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)
16
NC Program Explanation

% (PROGRAM START FLAG)

O1001 (PROGRAM NUMBER No.O1001)

N5 G90 G20 (ABSOLUTE, AND INCH PROGRAMMING)

N10 M06 T2 (TOOL CHANGE, TOOL No.2)

N15 M03 S1200 (SPINDLE ON CW, AT 1200 RPM)

N20 G00 X1.0 Y1.1 (RAPID OVER TO X1,Y1)

N25 Z0.1 (RAPID DOWN TO Z0.1)

N30 G01 Z-0.25 F5 (FEED MOVE DOWN TO 0.25")

N35 Y3 (FEED MOVE TO Y3)


17
N40 X5 (FEED TO X5)

N45 X1.0 Y1.0 Z-0.125 (FEED TO X1,Y1,Z-0.125)

N50 G00 Z1.0 (RAPID UP TO Z1)

N55 G28 X0 Y0 Z0 (BACK TO REFERENCE POINT)

N60 M05 (SPINDLE OFF)

N65 M30 (END OF PROGRAM)

https://ncviewer.com/
18
PART PROGRAMMING - VIDEO CLIP

19
Example - 01

- Workpiece dimensions are (120mm length, 80mm Width, 20mm Thickness).

- Cutting Tool Diameter is 6mm.

- Cutting Depth is 2mm.

- Cutting Speed 2500 rpm.

- Feed rate 2mm / min.

20
%
O0001;
N5 G90 G80 G40 G17 G21 G54 G94;
N10 M06 T01;
N15 M03 S2500 F2;
N20 G00 X60 Y0;
N25 Z2;
N30 G01 Z-2;
N35 Y90;
N40 G00 Z100;
N45 G28 X0 Y0 Z0;
N50 M05;
N55 M30; (End of Program)

21
Example - 02

- Workpiece dimensions is (130mm length, 90mm Width, 15mm Thickness).


- Cutting Tool Diameter is 8mm.
- Cutting Depth is 1mm.
- Cutting Speed 2000 rpm.
- Feed rate 3 mm / rev.

22
%
O0002
N5 G90 G80 G40 G17 G21 G55 G95;
N10 M06 T02;
N15 M03 S2000 F3;
N20 G00 X15 Y20;
N25 Z3;
N30 G01 Z-1;
N35 X115;
N40 X65 Y70;
N45 X15 Y20;
N50 G00 Z100;
N55 G28 X0 Y0 Z0;
N60 M05;
N65 M30; (End of Program) 23
Example - 03

- Workpiece dimensions is (140mm length, 70mm Width, 12mm Thickness).


- Cutting Tool Diameter is 7mm.
- Cutting Depth is 1.5mm.
- Cutting Speed 1500 rpm.
- Feed rate 2.5 mm / min.

24
%
O0003
N5 G90 G80 G40 G17 G21 G57 G94;
N10 M06 T03;
N15 M03 S1500 F2.5;
N20 G00 X20 Y10;
N25 Z3;
N30 G01 Z-1.5 F100;
N35 G02 X120 Y10 R50;
N40 G00 Z100;
N45 G28 X0 Y0 Z0;
N50 M05;
N60 M30; (End of Program)

25
Example – 04

26
Example – 04 (Solution)

27
Example - 05

28
Example – 05 (Solution)

29
x
Example - 06
z

30
x
Example – 06 (Solution)
z

31
Example – 07

32
Example – 07 (Solution)

33
Example – 08

Write part program with incremental dimensioning system. P2 (20, 20)

34
Example – 08 (Solution)

35
Example – 09

Write a part program for this drawing.

36
Example – 09 (Solution)

37
Example – 10

Write part program with absolute and incremental programming

38
Example – 10 (Solution)

39
Compensation Methods in CNC

There are three main compensation methods used


in CNC machines to achieve accuracy and quality
of the process

1. Tool length compensation


2. Tool radius compensation
3. Fixture offset compensation

40
Tool length compensation

41
Target Z position

42
43
Cutter Compensation

Left of the tool path Right of the tool path

44
Cutter Radius Compensation

45
Cutter Radius Compensation

46
Cutter Radius Compensation
Example – 11
Write a manual part program of peripheral milling using end mill D8

47
Cutter Radius Compensation
Example – 11 (Solution)
Write a manual part program of peripheral milling using end mill D8

O 1234
N171 G00 X-15 Y-15 Z50;
N172 G01 Z0;
N172 G41 X0 Y0 F100 D1; (Start-Up Move)
N173 Y40;
N174 X30 Y80;
N175 X60;
N176 G02 X100 Y40 R40;
N177 G01 Y30;
N178 G03 X70 Y0 R30;
N179 G01X0;
N180 G40 X-15 Y-15; (Cancellation Move)
N190 G00 Z50

48
Fixture Offset Compensation
The fixture offset allows the programmer to use the fixture
offset regardless of the position of the workpiece on the
fixture.

When a machining center is processing small workpieces,


the fixture can clamp several workpieces at a time.

The programmer does not need to consider the coordinate


zero point (datum point) of each workpiece during
programming, but only needs to program according to the
respective programmed zero point.

49
Fixture Offset Compensation
The fixture offset
can move the
programmed zero
point of the
machine tool on
each workpiece.

The fixture offset


is executed using
fixture offset
commands G54~
G59.

50
51
52
53
54
55
56

You might also like