Anda di halaman 1dari 41

INT 383 CAD/CAM

Intro to CNC Programming

What CNC Needs


Preparatory information:
Units Positioning information
Absolute Incremental

Coordinates
X, Y, Z XZ, YZ
2
CNC Programming

What CNC Needs


Machining parameters
Feed rates Spindle speeds

Coolant control
On or off Flood or mist

Tool control
Tool type Tool parameters
3
CNC Programming

What CNC Needs


Cycle functions (type of action required) Miscellaneous control
Spindle
Off On

Direction of rotation
Clockwise Counter-clockwise
4
CNC Programming

Cartesian Coordinate System

5
CNC Programming

Right Hand Rule

6
CNC Programming

Lathe Coordinate System

7
CNC Programming

Mill Coordinate System

Vertical Motion

Longitudinal Motion Transverse Motion


8
CNC Programming

Milling Tool System

9
CNC Programming

Cartesian Plane System

10
CNC Programming

Absolute Coordinates

11
CNC Programming

Incremental Coordinates

12
CNC Programming

Letter Codes
Instructions consist of a letter followed by a number Each letter indicated a specific type of action or information for the machine.
Letters used: N, G, X, Y, Z, I, J, K, F, S, T, M, R

13
CNC Programming

Letter Codes (G & M Codes)


G-codes are preparatory functions that involve actual tool movement M-codes are miscellaneous functions that involve action necessary for machining:
spindle on/off coolant on/off

14
CNC Programming

One block or command line

15
CNC Programming

Letter Codes (G codes)


G00 Rapid Traverse G01 Linear Interpolation G02 Circular Interpolation G03 - Circular Interpolation G17 XY Plane G18 XZ Plane G19 YZ Plane G20 Inch G21 Metric G40 Cutter comp cancel G41 Cutter comp left G42 Cutter comp right G43 Tool length positive G44 - Tool length negative G49 - Tool length cancel G80 Cancel canned cycle G81 Drilling cycle G84 Tapping cycle G90 Absolute mode G91 Incremental mode G98 Retraction to withdrawal plane
16
CNC Programming

Letter Codes (M codes)


M00 Program stop (pause) M01 Optional program stop M02 Program end M03 Spindle on CW M04 Spindle on CCW M05 Spindle stop M06 Tool change M08 Coolant on M09 Coolant off M30 Program stop

17
CNC Programming

M Codes

18
CNC Programming

N-codes
N-codes give an identifying number for each block of information. Increment lines by 5 or 10 Not necessary for machine

19
CNC Programming

Letter Codes (X, Y & Z Codes)


X, Y & Z codes are used to specify the coordinate axis. Number following code defines the coordinate at the end of the move. May require a specific format depending on the controller.

20
CNC Programming

Breaking down the code

21
CNC Programming

Dimension words

22
CNC Programming

Feed rate (F Code)


Feed rate is the rate at which the cutting tool moves along a programming axis. (in/min)
Specified as: Fxx
F10. specifies feed rate of 10 in/min (ipm)

23
CNC Programming

CNC Program Format

CNC Programming

24

Phases of Programming
Phase 1 Program Setup
Phase 2 Material Removal Phase 3 Program Shutdown

25
CNC Programming

Phase 1

Program Setup
CNC Programming 26

Program Number
All CNC programs require a program number. Used to identify specific programs. Allows the multiple storage of programs in memory. Program number usually has an O followed by a 4 digit number. EX: O1025
27
CNC Programming

Safe lines
Safe lines are used to establish the operating parameters of the program and cancel unwanted information from previous programs. Setup line first line of the program that will establish:
Plane selection Programming system Coordinate mode
CNC Programming

28

Sample Program
%O1000 N5 G00 G17 G20 G90 (setup) N10 G40 G49 G80 G98 (cancellation) N15 G43 H5 M06 T2
G17 can be replaced with G18 or G19 G20 can be replaced with G21 G90 can be replaced with G91
CNC Programming

29

Safe Lines
Cancellation line is used to cancel any information from a previous program. Second line of a program and contains:
Cutter compensation cancel Tool length offset cancel Canned cycle cancel Return to reference position

30
CNC Programming

Cancellation Line
%O1000 N5 G00 G17 G20 G90 (setup) N10 G40 G49 G80 G98 (cancellation) N15 G43 H5 M06 T2 G40 Cancel cutter radius compensation G49 Cancel tool length compensation G80 Cancel canned cycle
31
CNC Programming

Phase 2

Material Removal
CNC Programming 32

Material Removal
N20 G00 X0 Y0 Z.1 M03 S2500 (rapid to XY 0 Z- .1 spindle on clockwise N25 G01 Z-.125 F10. (Feed 10 ipm into part .125) N30 G01 X0 Y2.5 (Feed in Y direction 2.5) N35 G00 Z1 (rapid to Z1)

33
CNC Programming

Phase 3

Program Shutdown
CNC Programming 34

Program Shutdown
N50 M05 (spindle off) N55 G91 G28 X0 Y0 Z0 (return to machine home) N60 M30 (program end, return to first line)

35
CNC Programming

Block Formatting
N100 G01 X1 Y1 Z.125 F10 Restriction on block programming
Can only contain one tool movement No more than 4 G-codes per line Only one feed rate per line Only one spindle speed per line Only one M-code per line

36
CNC Programming

Modal Codes
Most G-codes set the machine in a mode which will remain in effect until it is changed by another G-code.
Example: G00 and G01 are modal

37
CNC Programming

Modal Codes

38
CNC Programming

Modal Codes

39
CNC Programming

Putting it together

40
CNC Programming

41
CNC Programming

Anda mungkin juga menyukai