• No results found

AXIS RELATIONSHIPS

Position X-axis

Figure 6-9

Coordinate sheet example - blank form (no data)

START X57.0 Y126.0 X45.0 Y105.0 P1 X108.258 Y105.0 P2 X146.156 Y79.6 P3 X146.156 Y50.0 P4 X173.156 Y23.0 P5 X238.0 Y23.0 P6 Z-axis Y-axis X-axis Position END X238.0 Y62.0 Figure 6-10

QUALITY IN CNC PROGRAMMING

All parts machined on CNC equipment are evaluated by their quality - usually after they are machined. Quality in- spectors check many features - are the dimensions within tolerances? Is the surface finish up to standard? Is there a consistency between parts, etc.? Modern CNC equipment provides optional inspection related features during ma- chining process, for example, in-process gaging. Many machine shops require their CNC machinists to be quality inspectors while the parts are being made. One subject that is equally important, yet not very often mentioned, is qual- ity in CNC programming.

CNC programming starts with a plan. Although number one quality of a CNC programmer is knowledge and skill, there are at least two related and equally important consid- erations in program planning - programmer's personal ap- proach and professional attitude. How the CNC program- mer approaches a certain job, assignment or project will have a great influence on the final outcome of parts pro- duced by the CNC operator. Programmer's attitudes have significant influence on program development and final re- sults. They also have significant influence on the CNC op- erator - it's just human nature.

Ask yourself some questions. As a CNC programmer - are you attentive to detail, are you precision minded, are you well organized, are you concerned if something is not done right? Do you 'cut corners' just to have the job done? Can a program you just developed, or an existing program, be improved further to make it safer and more efficient?

CNC program quality is much more than writing an error free program - that is the absolute prerequisite and goes without saying. Quality in programming includes concern as how a program effects the CNC operator, machine setup, and actual part machining. Quality in programming means constant effort at improvement and desire to make the next program even better.

Consistency in programming is one the best ways to achieve high quality programs. Once a certain method or process been found superior to others, stick with it. Use the same method again and again. CNC operators like nothing less than programs that vary in structure.

Part complexity should never stand in the way - it is only related to your knowledge level and willingness to solve problems. It should be a personal goal to make a program - every program - the best program possible.

7

PART PROGRAM STRUCTURE

Typical CNC program is composed of series of sequen- tial instructions related to machining a part. Each instruc- tion is specified in a format the CNC system can accept, in- terpret and process. Each instruction must also conform to machine tool specifications. This program input method can be defined as an arrangement of machining instruc- tions and related tasks, written in the format of a CNC sys- tem and aimed at a particular machine tool.

Various controls may have different formats, but most are similar. Subtle differences exist among CNC machines from different manufacturers, even those equipped with the same control system. This is common, considering the spe- cific demands individual machine builders place upon the control manufacturer to accommodate many original and unique machine design features. Such variations are usu- ally minor but still important for programming.

BASIC PROGRAMMING TERMS

The field of CNC has its own terminology, special terms and its jargon. It has its own abbreviations and expressions that only people in the field understand. CNC program- ming is only a small section of computerized machining and it has a number of its own expressions. The majority of them relate to the structure of part programs.

There are four basic terms used in CNC programming. They appear in professional articles, books, papers, lec- tures and so on. These words are the key to understanding general CNC terminology:

Character

–

Word

–

Block

–

Program

Each term is very common and equally important in CNC programming and deserves its own detailed explanation.

u

Character

A character is the smallest unit of CNC program. It can have one of three forms:

n Digit n Letter n Symbol

Characters are combined into meaningful CNC words. This combination of digits, letters and symbols is called the alpha-numerical program input.

Digits

There are ten digits, 0 to 9, available for use in a program to create numbers. The digits are used in two modes - one for integer values (numbers without a decimal point), the other for real numbers (numbers with a decimal point). Numbers can have positive or negative values. On some controls, real numbers can be used with or without the dec- imal point. Numbers applied in either mode can only be en- tered within the range that is allowed by the control system.

Letters (Addresses)

All twenty six letters of the English alphabet are available for programming, at least in theory. Most control systems will accept only certain letters and reject others. For exam- ple, a two-axis CNC lathe control will reject the letter Y, as the Y-axis is typically unique to milling operations (milling machines and machining centers). On the other hand, many CNC lathes with milling capabilities will accept the letter (address) Y, if the Y-axis is available. Capital letters are normal designation in CNC programming, but some con- trols accept low case letters with the same meaning as their upper case equivalent. If in doubt, use capital letters.

Every control accepts CAPITAL letters but not all controls accept low case letters

Symbols

Several symbols are used for programming, in addition to the ten digits and twenty six available letters. The most common symbols are the decimal point, minus sign, per- cent sign, parenthesis and others, depending on the control options. Their use in a program is strictly defined. Decimal point is used for values expressed in mm, inches or de- grees. Minus sign is used to identify a dimensional value as negative, percent sign is used for file transfers, and paren- theses are used for program comments and messages.

u

Word

A program word is a combination of alpha-numerical characters, creating a single instruction to the CNC. Each word begins with a capital letter, followed by a number representing a program code or actual value. Typical words indicate axes position, feedrate, speed, preparatory com- mands, miscellaneous functions and many others.

Word is the unit of instruction to the control system

u

Block

Just like one word is used as a single instruction to the CNC system, program block is used as a multiple instruc- tion. A program entered into the control system consists of individual lines of instructions, sequenced in a logical or- der of processing. Each line - called a sequence block or simply a block - is composed of one or several words and each word is composed of two or more characters.

In the control system, each block must be separated from all others. To separate blocks in the MDI (Manual Data In- put) mode at the control, each block has to end with a spe- cial End-Of-Block code (symbol). This code is marked as EOB on the control panel. When preparing part program on a computer using a keyboard, using the Enter key will terminate the block (similar to the old Carriage Return on typewriters). When writing a program on paper first, each program block should occupy only a single line on the pa- per. Each program block contains a series of individual in- structions that are executed simultaneously.

u

Program

Part program structure may vary quite a bit for different controls, but the logical programming approach does not change from one control to another. CNC program usually begins with a program number or similar identification, followed by sequenced blocks of instructions in a logical order. The program ends with a stop code or a program ter- mination symbol, such as the percent sign - %. Some con- trols also require the stop code at the program beginning. Internal documentation and messages to the CNC operator may be located in strategic places within the part program. Programming format has evolved significantly during the years and several formats have emerged.

PROGRAMMING FORMATS

Since the early days of numerical control, three formats had become significant in their time. They are listed in the order of their original introduction:

n Tab Sequential Format no decimal point available

... old NC systems only

n Fixed Format no decimal point available

... old NC systems only

n Word Address Format decimal point available

... typically used with CNC systems

Only the very early control systems use the tab sequen- tial or fixed formats. Both of them disappeared in the early 1970’s and are now obsolete. They have been replaced by much more convenient Word Address Format. Its greatest benefit is using addresses for words and decimal point for- mat when necessary.

WORD ADDRESS FORMAT

The word address format is based on a combination of one letter and one or more digits - Figure 7-1.

In some applications, such a combination can be supple- mented by a symbol, such as a minus sign or a decimal point. Each letter, digit or symbol represents one character in the program and in control memory. This unique alpha- -numerical arrangement creates a word, where the letter is called the word address, followed by numerical data with or without symbols. The word address refers to a specific register of the control memory. Some typical words are: G01 M30 D25 X15.75 N105 H01 Y0 S2500 Z-5.14 F12.0 T0505 T05 /M01 B180.0

The address (letter) in the block defines the word mean- ing and must always be written first. For example, X15.75 is correct, 15.75X is not. No spaces (space characters) are allowed within a word - X 15.75 is not correct - spaces are only allowed before the word, meaning before the letter, between words.

Data always indicate the word numerical assignment. This value varies greatly and depends on the preceding ad- dress. It may represent a sequence number N, a preparatory command G, a miscellaneous function M, an offset register number D or H, a coordinate word X, Y or Z, feedrate func- tion F, spindle function S, tool function T, etc.

Any one word is a series of characters (at least two) that define a single instruction to the machine control unit. The above examples of typical words have the following mean- ing in a CNC program:

G01 Preparatory command

M30 Miscellaneous function

D25 Offset number selection - milling applications

X15.75 Coordinate word - as a positive value

N105 Sequence number (block number)

H01 Tool length offset number

0

Y

6 . 4 8 F 2 7 5 . 0

G

1

N 5

-

6

F

.

-

F 2 7 5 . 0

G 0 1

N 5

Characters Words Block Figure 7-1

Y0 Coordinate word - as zero value

S2500 Spindle speed function

Z-5.14 Coordinate word - as a negative value

F12.0 Feedrate function

T0505 Tool function - turning applications

T05 Tool function - milling applications

/M01 Miscellaneous function w/block skip symbol

B180.0 Indexing table function

Individual program words are instructions grouped to- gether to form logical sequences of programming code. Each sequence that will process one series of instructions simultaneously forms a unit called a sequence block or pro- gram block or - simply a block. The series of blocks is ar- ranged in a logical order that is required to machine a com- plete part or a complete operation is called a part program also known as a CNC program.

The next block shows a rapid tool motion to the absolute position of X13.0Y4.6 within current units setting and with a coolant turned on:

N25 G90 G00 X13.0 Y4.6 M08

+

where . . .

N25 Sequence or block number G90 Absolute mode

G00 Rapid motion mode X13.0 Y4.6 Coordinate location M08 Coolant ON function

The control will always process any single block as one complete unit - never partially. Most controls allow a ran- dom word order in a block, as long as the block number is specified first. Many programmers follow an unofficial - but recommended - order of various words in a block. For example, G-codes are listed first, followed by axes data, than all remaining instructions.

Block number must always be specified first

FORMAT NOTATION

Each program word can only be written in a specific way. The number of digits allowed in a word, depending on the address and maximum number of decimal places, is set by the control manufacturer. Not all letters can be used. Only letters with an assigned meaning can be programmed, ex- cept in a comment. Symbols can be used in only some words, and their position in the word is fixed. Some sym- bols are used only in custom macros - control limitations are important. Symbols supplement the digits and letters and provide them with an additional meaning. Typical pro- gramming symbols are the minus sign, decimal point, per- cent sign and a few others. All symbols are listed in a table on page 47.

u

Short Forms

Control manufacturers often specify the input format in an abbreviated form - Figure 7-2.

Describing the full format description for each meaning would be unnecessarily too long. Consider the following complete and not abbreviated description of address X - as a coordinate word that is used in metric system:

Address X accepts positive or negative data with the maximum of five digits in front of a decimal point and three digits maximum after the decimal point - decimal point is allowed

Absence of decimal point in the notation means that deci- mal point is not used; the absence of a plus/minus (±) sign means that the address value cannot be negative - a lack of sign means a positive value by default.

These samples of format notation explain the shorthand:

G2 Two digits maximum, no decimal point or sign N4 Four digits maximum, no decimal point or sign S5 Five digits maximum, no decimal point or sign F3.2 Five digits maximum, three digits maximum in front of

the decimal point, two digits maximum behind the decimal point, decimal point is allowed, no sign is used

Be extra careful when evaluating shorthand notations from a control manual or other source. There are no indus- try standards and not all control manufacturers use exactly the same methods, so the meaning of short forms listed may vary significantly. Typical list of word addresses, their format notation and description is shown in the following tables. They contain address notations based on typical Fanuc control systems.

ò

Note:

The presented format notation concept is often applied by CAD/CAM software developers for CNC program output using post processors

Number of digits after decimal point Decimal point allowed Number of digits before decimal point Positive or negative value possible Described address

X ± 5 . 3

Figure 7-2

u

Milling System Format

Address descriptions vary for many addresses, depend- ing on the input units. The table below lists metric format descriptions (imperial format is in parenthesis, if applica- ble). Listed are format notations for milling units.

Some addresses have additional meaning when used in special applications

The first column is the address, second column is the for- mat notation, third column is the description:

Address Notation Description A A±5.3 Rotary or Indexing axis - unit isdegrees - used about the X axis

B B±5.3 Rotary or Indexing axis - unit isdegrees - used about the Y axis

D D2 Cutter radius offset number (sometimes uses address H)

F F5.3 Feedrate function - may vary

G G2 Preparatory commands(G3 for extended G-code set)

H H3 Offset number (tool position and/ortool length offset)

I I±5.3

(I±4.4)

Arc center modifier for X axis Shift amount in fixed cycles (X) Corner vector selection for X axis (old type controls)

J J±5.3

(J±4.4)

Arc center modifier for Y axis Shift amount in fixed cycles (Y) Corner vector selection for Y axis (old type controls)

K (KK±5.3±4.4) Arc center modifier for Z axis

K (L) K4 (L4) Fixed cycle repetition count Subprogram repetition count

M M2 Miscellaneous function

(M3 for extended M-function set)

N N5 Block number or sequence number(N4 for older controls)

O O4 (O5) Program number (EIA)or (:4 or :5 for ISO - not common) P4 Subprogram number call

Custom macro number call

P P3 Work offset number - used with G10 P53 Dwell time in milliseconds

P5 Block number in main program when used with M99

Address Notation Description

Q

Q5.3 (Q4.4)

Depth of peck in fixed cycles G73 and G83

Q±5.3 (Q±4.4)

Shift amount in fixed cycle G76 and G87

R R±5.3

(R±4.4)

Retract point in fixed cycles Arc radius designation

S S5 Spindle speed in r/min

T T4 Tool function

X

X±5.3 (X±4.4)

X axis coordinate value designation

X5.3 Dwell function with G04 only

Y Y±5.3

(Y±4.4)

Y axis coordinate value designation

Z Z±5.3

(Z±4.4)

Z axis coordinate value designation

u

Turning System Format

Similar chart as for milling, this one is for lathe systems. A number of definitions are the same and are included only for convenience. Notation is in the metric format, imperial notation is in parenthesis, if applicable to the address.

Some addresses have additional meaning when used in multiple repetitive cycles of the G70 series

or special applications

Address Notation Description A A3 Angle of thread for G76

Angle for direct drawing input

C

C±5.3

(C±4.4) Chamfer for direct drawing input C±5.3 Absolute axis rotation in degrees

D

D4 Number of divisions in G73 D53

(D44)

Depth of cut in G71 and G72 Relief amount in G74 and G75 Depth of first thread in G76

E (E2.6)E3.5 Precision feedrate for threading

F (F2.4)F3.3 Feedrate function - may vary

G G2 Preparatory commands(G3 for extended G-code set)

Address Notation Description

I I±5.3

(I±4.4)

Arc center modifier for X axis Taper height in X for cycles X axis relief in G73 Direction of chamfering Motion amount in X in G74

K K±5.3

(K±4.4)

Arc center modifier for Z axis Taper height in Z for cycles Z axis relief in G73 Direction of chamfering Motion amount in Z in G75 Thread depth in G76

K (L) K4 (L4) Subprogram repetition count

M M2 Miscellaneous function(M3 for extended M-function set)

N N5 Block number or sequence number (N4 for older controls)

O O4 (O5) Program number (EIA)

or (:4 or :5 for ISO - not common)

P P4 (P5)

Subprogram number call Custom macro number call Offset number with G10

Return to block number with M99 Start block number in G71 and G72 P53 Dwell time in milliseconds

Q Q4 (Q5) End block number in G71 and G72

R R±5.3

(R±4.4)

Arc radius designation Arc radius for corners

S S5 Spindle speed in r/min or ft/min

T T4 Tool function

U U±5.3

(U±4.4)

Incremental value in X axis Stock allowance in X axis U5.3 Dwell function with G04

W W±5.3

(W±4.4)

Incremental value in Z axis Stock allowance in Z axis

X

X±5.3

(X±4.4) Absolute value in X axis X5.3 Dwell function with G04 only

Z Z±5.3

(Z±4.4) Absolute value in Z axis

u

Multiple Word Addresses

One feature that is noticeable in both tables is the abun- dance of different meanings for some addresses. This is a necessary feature of the word address format. There are only twenty six letters in the English alphabet but more than that the number of commands and functions. As new control features are added due to technological advance-

ments, even more variations may be necessary in the future. Several addresses have such an established mean- ing (for example, X, Y and Z are coordinate words), that giving them any additional meaning would be confusing. Many letters, on the other hand, are not used very often and their multiple meaning is quite acceptable (typical ad- dresses are I, J, K, P, Q, for example). In addition, the actual meaning of addresses varies between milling and turning systems and even between manufacturers.

The control system has to have some means of accepting a particular word with a precisely defined meaning in the program. In most cases, the preparatory command G will define its meaning, at other times it will be an M function or a setting of system parameters.

SYMBOLS IN CNC PROGRAMMING

In addition to the basic symbols, Fanuc can accept other symbols for different applications. The following table de- scribes all symbols available on Fanuc and compatible con- trol systems:

Symbol Description Comment

.

Decimal point Fractional part of a number

+ Plus sign Positive value or

addition sign in Fanuc macros

-

Minus sign Negative value or

subtraction sign in Fanuc macros

*

Multiplicationsign Multiplication sign inFanuc macros

/ Slash (front slash)

Block skip function symbol or

division sign in Fanuc macros

( ) Parenthesis Program comments & messages % Percent sign Stop code (end of program file)

: Colon Program number designation (rare)

,

Comma Used only within comments [ ] Brackets Calculations in Fanuc macros

; Semicolon Non programmable End-Of-Block symbol (screen display only)

Related documents