Cnc Programming Basics

Preview:

DESCRIPTION

engineering

Citation preview

CNC Prg. Basics 1

CNC Programming Basics

Program structureEvery program consists of:1. Program Start

The program start is the program number. The program number begins with character/letter O.

2. Program ContentsNC blocks

3. Program EndM30 for a main programM17 for a sub-program

CNC Prg. Basics 2

CNC Program Numbers

Program Numbers

O6999 . . .O0256O0255 . . .O0000

CNC Prg. Basics 3

CNC Program Blocks (1)

• N is the address• Block numbers from

N0000 to• N9999• A block consists of

number and words• Words are contents of a

block• Block numbers are

selected in the jumps of ten for the purpose of insertion

CNC Prg. Basics 4

CNC Program Blocks (2)

• A block consists of one or more blocks

• A Word consists of a character (address) and a number.

• Every address has a certain meaning, on which the corresponding number depends

CNC Prg. Basics 5

CNC Prg. Syntax Regulations

• The maximum block length must not exceeded four lines. If max. length exceeded alarm 650 occurs.

• Every block starts with a block number.• After the block numbers follows the G

command.• Words consists of coordinates X(U), Z(W).• For G02, G03 program interpolation parameter

I and K are placed after X(U), Z(W).• The F word (feed, thread pitch).• The S word (cutting speed).• The T word (tool address).• The M word (additional functions).

CNC Prg. Basics 6

Absolute Value Programming

P0 N… …P0 P1 N… G01 X40. Z25. F…P1 P2 N… G01 X60. Z-40. F…P2 N… …

Absolute coordinatesystem

Example:

CNC Prg. Basics 7

Incremental Value Programming

Incremental coordinatesystem

Example: P0 N… …P0 P1 N… G01 U5. W-25. F…P1 P2 N… G01 X10. Z-15. F…P2 N… …

CNC Prg. Basics 8

Mixed Programming

Mixed coordinatesystem

Example: P0 N… …P0 P1 N… G01 U5. W-25. F…P1 P2 N… G01 X60. Z-15. F…P2 N… …

CNC Prg. Basics 9

Self-holding Functions (1)

• The majority of G and M commands and other words are self-holding, remain active until overwritten or deactivated/deselected.

• Aimed to simplify and to reduce programming tasks. Example: G41 can be deactivated by issuing G40 command.

CNC Prg. Basics 10

Self-holding Functions (2)

Take-over of G00 commands in block N0110In block N0120 G00 is deactivated by G01. G01 is active.

N0100 G00 X50. Z+10.N0110 X36. Z+2.N0120 G01 X40. Z-10. F…

N0050 M03N0060 … …N0120 M04

Example 1:

Example 2:

M03 activated at N0050 and effective from N0050 through N120. M03 deactivated at N0120 by M04 command

CNC Prg. Basics 11

Reference Points

M = Machine zero point.(unchangeable ref. Point determined by machine manufacturer)N = Tool mounting reference pointW = Work piece zero point. (can be freely determined by the programmer and can be moved within program

CNC Prg. Basics 12

Work piece (1)

CNC Prg. Basics 13

Work piece (2)

CNC Prg. Basics 14

G & M Commands

G00: Rapid traverseG01: Linear interpolationG02: Circular interpolation clockwiseG03: Circular interpolation counter clockwiseG70: Measuring in Inch (USA)G71: Measuring in mm (Other countries)

M03: Spindle ON clockwiseM04: Spindle ON counter clockwiseM20: Tailstock backM21: Tailstock forward

CNC Prg. Basics 15

G00, Rapid Traverse

Absolute dimensions of the target point coordinates:N030 G90N040 G00 X48 Z-26An absolute X coordinate related to the diameter.

Incremental dimensions of the target point coordinates:N030 G91N040 G00 X-10,5 Z-31

Tool position X69 Z5

CNC Prg. Basics 16

G01, Linear Interpolation

P0: tool position

G90:N030 G00 X39 Z2N040 G01 X39 Z0N050 G90N060 G01 X48 Z-37G91:N030 G00 X39 Z2N040 G01 X39 Z0N050 G91N060 G01 X4.5 Z-37

G01 X… Z…

CNC Prg. Basics 17

G90 & G91 Commands

G90G01 X+140 Z-90 Target point abs.

G91G01 X+40 Z-60Target point incr.PO: Start Point

P1: Target Point

Recommended