Programming language for CNC machine tools. Learn again, but in practice. Additional functions and symbols when programming CNC machines

Programming New HAAS CNC Lathes for Beginners – The best way learn to use machine tools without experience. HAAS has many years of experience in the production of lathes for processing various materials.

The HAAS CNC lathe is one of her best inventions. The presence of numerical program control has made it possible to achieve practically full automation workflow. But you can launch it only with special knowledge.

CNC HAAS

The American company HAAS is one of the four largest producers machine tools. The company has more than 160 thousand units designed for precision turning. The manufacturer's goal is to produce devices that can provide high performance at maximum simple operation. To start up Haas machines, a minimum of steps are required.

The equipment has powerful control functions that can be used by pressing just one key on the stand. To install the device in starting position, exists special button. Further use milling device is possible after introducing certain combinations. Each combination is responsible for a specific function of the equipment. A special stand is provided for introducing combinations.

The advantage of the machines is that there is no need for manual entry numbers One of these functions is the measurement of the displacement indicator of the working mechanism. After measurement, the CNC system stores the value, so they can be used for mass production. If necessary, you can refer to the instrument manual on the rack panel. It is also represented by a separate key.

The most important and frequently used functions of HAAS CNC routers are:

  • Tool Offset Measure – measuring;
  • Next Tool – repeat the task;
  • Help – assistance in using the unit.

Another advantage of the devices is the presence of a search bar, thanks to which you can find necessary information and functions. For search reference information There are two separate keys for the main codes.

Peculiarities

HAAS machines differ from similar devices manufactured by other companies in the presence closed system. It is independent from other manufacturers, so training on HAAS machines must be done individually.

Milling devices are equipped with modern stands and have standard keyboard, with which you can quickly find the desired function. There are no encrypted codes to remember or write down. Each key has a specific function.

The control handwheel is used in various modes. With its help you can carry out quick editing functions and tasks. He is also responsible for correcting values ​​and checking settings.

The main advantages of numerically controlled machines are:

  • the presence of single-key operations;
  • the ability to use the control handwheel not only to rotate the axes;
  • equipping with a 15-inch LCD color display.

If there is a need to use external device or downloading the program, the package includes USB port. With it you can connect additional drives, or configure the unit.

Usage

The principle of operation on HAAS lathes is simpler than with its analogues. The peculiarity is that thanks to same system An operator who has learned to use a milling device will be able to handle other units. Regardless of the software version, the equipment has the same screen behind any rack. Only the functions in the settings line change.

It is important for the user to remember three main functions:

  • Setup – to configure the device;
  • Edit – for editing operations;
  • Operation – for working with the unit.

After starting the lathe, information about its status is displayed on a separate screen. On it you can see data on the load on the device, its speed, the estimated time to complete the task, and much more.

CNC allows for intuitive use. Numeric software control equipped with a dialogue system, thanks to which even inexperienced user will be able to use metal-cutting devices without operating skills. After creating a task, you can save it as a program. A separate button is also responsible for this.

In the future, the saved program can be used again without entering the data again.

The system has a locking function in case of an unexpected situation. It protects the program from uninstallation, as well as the configured settings. The operator should be aware of the monitoring function ultimate load, which protects the device from wear.

Stages

The use of machine equipment is carried out in several stages:

  • milling machine equipped with Haas CNC is driven in initial position;
  • implementation of programming;
  • preparatory functions are exhibited;
  • auxiliary functions are set;
  • the assigned task is completed.

Digital servo motors and innovative position sensors ensure smooth and precise operation. If there is an improved software lathes process workpieces at a higher level.

Advantages

HAAS machines are recommended for beginners because they can minimize operator involvement in turning and making parts. The most significant advantage of the units is the presence wireless system on intuitive programming. The system is responsible for how correctly turning is performed, and also adjusts the settings if they go astray or are not suitable for the intended purpose.

The program allows the user to enter ready-made drawings. This function will make it possible not to compose new task actually lathe. Another advantage is the ability to perform multi-pass 3D processing.

Machine maintenance is carried out through one department. All HAAS service employees are capable of performing comprehensive maintenance and repair of equipment. Maintenance is carried out simultaneously for both the machine and the CNC system.

The machine control unit is connected to the numerical control system and the design of the device. Thanks to this, in the event of a malfunction, a high-speed repair function is provided.

One of the most interesting and effective methods Processing programming is parametric programming. Surprisingly, most technologists and programmers, although they have heard about this method, do not know how to use it at all. In this section, you will become familiar with the theory of parametric programming and touch on the basics of the macro language of the CNC system of a modern machine tool.

Most CNC machine systems have at their disposal special language for parametric programming (macro programming). For example, in the Fanuc control system this language is called Macro B. If you are at least a little familiar with the Basic programming language, then you can easily understand Macro B. We will consider the commands and functions of this particular language in detail. In a typical control program, you specify various G codes and directions and amounts of movement using numeric values. For example, G10 or X100. However, the machine's control system can do the same using variables.

The variable symbol in Macro B is the # sign. For example, you can specify the following expressions in your program:


#1=100
#2=200
#3=#1+#2

This means that variable #1 is assigned the value 100 and variable #2 is assigned the value 200. Variable #3 will be the result of the sum of variable #1 and variable #2. With the same success, you can write the G-code:


#25=1
G#25

Variable #1 is assigned the value 1. Then the second line will essentially denote the G1 linear interpolation code. Various arithmetic and logical operations can be performed with variables, which allows you to create “smart” processing programs or various machine cycles.

There is an area in the CNC system memory in which variable values ​​are stored. You can look into this area if you find the CNC memory section, which is usually called MACRO or VARIABLES. You can assign values ​​to variables not only within the program, but also directly - by entering values ​​into the registers of this memory. Let me give you a few examples. You can create a program like this:

#1=25
#2=30
#3=#2+#1

In this case, values ​​are assigned to variables within the program. To change the numerical values ​​of variables #1 and #2 in the future, you will have to edit the program.

More can be realized convenient option, which will allow you to change the values ​​of variables at any time without changing the program itself:

As you can see, variables #1 and #2 are not assigned any values ​​in the program. The machine operator can enter the MACRO variable area and enter any numeric value for any variable.

All system variables CNC can be divided into 4 types:

  • zero;
  • local;
  • are common;
  • systemic.

Local variables can be used inside macros to store data. When the power is turned off, local variables are reset to zero. For most zero-series Fanuc CNC machines, local variables are numbers from 1 to 33.

General Variables can work inside various parametric programs and macros. When the power is turned off, some common variables are reset to zero and some retain their values. Most zero series Fanuc CNC machines have common variables with numbers from 100 to 999.

System Variables used to read and write various system information– data on tool position, compensation values, time, etc. System variable numbers for Fanuc zero series start from 1000.

Null Variables always equal to zero.

To perform arithmetic and logical operations, the Macro B language provides a set of commands and operators.

Table 10.1. Basic arithmetic and logical instructions

Macro commands are used to control variables and perform various logical operations. Macro commands in the Macro B language are similar to BASIC commands.

Unconditional GOTO command is intended to transfer control to a specific program block. The command format is as follows:

  • GOTO N – unconditional transition to frame N;
  • GOTO #A – unconditional jump to the block set by the variable #A.

Example:

N10 G01 X100
N20 G01 X-100
N30 GOTO 10

After block N30 has been executed, the TNC moves to block N10. Then it works again with frames N20 and N30 - an endless loop is obtained.

IF condition command allows you to perform various actions with a condition. After IF, some expression is indicated. If this expression is true, then the instruction (for example, an unconditional jump instruction) located in the block with IF is executed. If the expression is invalid, the command in the IF frame is not executed and control is transferred to the next frame.

The command format is as follows:

IF [#a GT #b] GOTO N

Example:

#1=100
#2=80
N10 G01 X200
N20 IF [#1 GT #2] GOTO 40
N30 G01 X300
N40 M30

At first program example Variables #1 and #2 are assigned the values ​​100 and 80 respectively. In frame N20 the condition is checked. If variable value #1 greater value variable #2, the GOTO command is executed to program end block N40. In our case, the expression is considered valid, since 100 is greater than 80. As a result, after the execution of frame N10, a transition to frame N40 occurs, that is, frame N30 is not executed.

In the same program you can change the values ​​of variables:

#1=100
#2=120
N10 G01 X200
N20 IF [#1 GT #2] GOTO 40
N30 G01 X300
N40M30

In the second case, the condition in frame N20 will not be valid, since 100 is not greater than 120. As a result, after execution of frame N10, there is no transition to frame N40, that is, frame N30 is executed as usual.

The expression [#1 GT #2] uses comparison operators. In table 10.2 operators are summarized for comparison language variables Macro V.

Table 10.2. Comparison Operators

WHILE command allows you to repeat various actions with a condition. While the specified expression is considered valid, the part of the program limited by the DO and END commands is executed. If the expression is not true, then control is transferred to the frame following END.

% O1000 #1=0 #2=1 WHILE [#2 LE 10] DO 1; #1=#1+#2 #2=#2+1 END 1 M30 %

Macro program called a program that is located in the memory of the control system and contains various macro commands. The macro program can be called from regular program using G code, similar to canned cycles. When calling a macro program, it is possible to directly transfer values ​​for macro program variables.

The G65 command is intended to call a macro program non-modally. The format for this command is:

where G65 is the macro program call command; Р_ – number of the called macroprogram; L_ – number of repetitions of the macroprogram; A_ and B_ – addresses and values ​​of local variables.

G65 P9010 L2 A121 B303 – macro program 9010 is called 2 times, the corresponding local variables are assigned values ​​121 and 303.

You need to know which local variable is assigned a value by which address. For example, for the Fanuc 0-MD control system the following dependencies will be valid:

Table 10.3. Mapping addresses to local variables

Address Variable
A
B
C
D
E
F
H
I
J
K
M
Q
R
S
T
U
V
W
X
Y
Z
#1
#2
#3
#7
#8
#9
#11
#4
#5
#6
#13
#17
#18
#19
#20
#21
#22
#23
#24
#25
#26

Now you can start creating a simple but very useful parametric program. Quite often there is a need to process several holes located at a certain radius and passing through a certain angle (Fig. 10.7). To free the programmer from tedious reworking of the program if the radius, angle or number of holes changes, we will create a processing program that will allow the operator to enter radius and angle values ​​and perform a drilling operation along a circle with any dimensions.

To drill holes we will use the G81 canned cycle. The angle at which the holes are located is measured from the X axis counterclockwise (positive angle).

You need to set:

  • the radius of the circle on which the holes are located;
  • starting angle (the angle at which the first hole is located);
  • relative angle (the angle through which the remaining holes follow);
  • total number of holes.

All this data must be presented in parametric form, that is, using variables.

Let
#100= radius of the circle where the holes are located;
#101= start angle;
#102= relative angle;
#103= total number of holes.

Rice. 10.7. Let's create a parametric program for processing a part with unknown dimensions

In order to create a parametric program, it is necessary to come up with an algorithm that allows you to change the behavior of the processing program depending on the values ​​of the specified variables. In our case, the basis of the NC is the standard drilling cycle G81. It remains to find the law that describes the coordinates of the centers of the holes for any original values radius, angles and an arbitrary number of holes.

%
O2000
N10 G21 G90 G80 G54 G40 G49 G00
N20 G17

The first frames of the program will be standard. These are the program number, safety string and G17 XY plane selection code.

Since the coordinates of the centers of the holes are specified using the radius and angle, that is, in the polar coordinate system, we will indicate the G16 code in block N30.

N40 T1 M6
N45 G43 HI Z100
N50 S1000 M03
#120=0

In frame N60 we put the drilling cycle G81 and the coordinates of the center of the first hole. As you remember, in the case of working with polar coordinates, X denotes the radius, and Y defines the angle. The radius and start angle values ​​are known and are set by variables #100 (radius) and #101 (start angle). Some variable is introduced #120 s zero value. This variable represents a counter. A little later you will understand the purpose of this variable.

N60 G98 G81 X#100 Y#101 Z-5 R0.5 F50

Variable #103 is responsible for the total number of holes. Since we have already drilled the first hole, we will reduce #103 by 1. Thus, frame N70 provides a count of the remaining holes. And frame N75 increases the value of variable #120 by 1.

N70 #103=#103-1
N75 #120=#120+1

If the number of holes left to drill is zero, then cancel the drilling cycle, turn off the spindle speed and end the program.

N80 IF [#103 EQ 0] GOTO 120

In frame N80, the value of variable #103 is compared with zero. If variable #103 is zero, then control is transferred to block N120 at the end of the program. If variable #103 is not zero, then the next frame is executed.

N90 #130=#102*#120
N95#110=#101+#130

Block N90 is intended for determining the angular increment. New variable #110 is the sum of #101 (start angle) and #130 (angle increment). The N95 block provides the calculation of the angle of the subsequent hole.

The new drilling angle is then specified and control is transferred to block N70.

N100 Y#110
N110 GOTO 70

Using block N70, a closed loop is created that calculates the coordinates of the hole centers and drills until the value of variable #103 is zero. If value #103 becomes equal to zero, then control will be transferred to frame N120.

N120 G80
N125 M05
N130 G15
N140 M30
%

The final blocks of the program are intended to cancel the canned cycle (G80), turn off the spindle speed (M05), turn off the polar coordinate mode (G15) and end the program (M30).

% О2000 N10 G21 G90 G80 G54 G40 G49 G00 N20 G17 N30 G16 N40 T1 M6 N45 G43 H1 Z100 N50 S1000 M03 #120=0 N60 G98 G81 X#100 Y#101 Z-5 R0.5 F50 N70 #103=#103 -1 N75 #120=#120+1 N80 IF [#103 EQ 0] GOTO 120 N90 #130=#102*#120 N95 #110=#101+#130 N100 Y#110 N110 GOTO 70 N120 G80 N125 M05 N130 G15 N140 M30%

Any parametric program must be thoroughly tested before it reaches the machine. Most likely, you will not be able to check such a program using the CP editor and backplot, since it contains variables. The most reliable check in in this case– this is the substitution of values ​​for input variables and “unwinding” of the algorithm with specific numbers.

Let's assume that the machine operator has received a part drawing (Figure 10.8) for machining holes. He must set the G54 zero point to the center of the part, measure the length of the drill and install it in the spindle. You should then enter the MACRO variable area and enter the following numeric values:

Variable No. Meaning

100
101
102
103
104
105

12.5
45
20
4
0
0

Rice. 10.8. Instead of variables in the drawing there are specific sizes and the number of holes is known

To check the created parametric program, it is enough to substitute specific values ​​of the variables and, “scrolling” the algorithm, get a regular program.

The same program can be written in the usual form:

% О2000 N10 G21 G90 G80 G54 G40 G49 G00 N20 G17 N30 G16 N40 T1 M6 N45 G43 H1 Z100 N50 S1000 M03 N60 G98 G81 X12.5 Y45 Z-5 R0.5 F50 N100 Y65 N100 Y85 N100 Y105 N1 20 G80 N125 M05 N130 G15 N140 M30%

Now let's try to create a macro program that will function similarly to a canned loop. To process the part shown in Fig. 10.8, the machine operator must enter and execute the following command:

G65 P9010 I12.5 A45 B20 H4

In this case, our parametric program (with the new number O9010) should already be in the CNC memory. As a rule, macro programs have numbers 9000 and higher and are not available for free editing. The G65 command is intended to call a macro program non-modally. In this case, addresses I, A, B, H in a block with G65 transfer their numerical values ​​to certain local variables. To find the correspondence of addresses to local variables, you can use the table. 10.3.

We can tweak the variables in our program by inserting following lines to the program:

#100=#4
#101=#1
#102=#2
#103=#11

As a result, we get the macro program:

% О9010 #100=#4 #101=#1 #102=#2 #103=#11 N10 G21 G90 G80 G54 G40 G49 G00 N20 G17 N30 G16 N40 T1 M6 N45 G43 H1 Z100 N50 S1000 M03 #120=0 N60 G98 G81 X#100 Y#101 Z-5 R0.5 F50 N70 #103=#103-1 N75 #120=#120+1 N80 IF [#103 EQ 0] GOTO 120 N90 #130=#102*#120 N95 #110=#101+#130 N100 Y#110 N110 GOTO 70 N120 G80 N125 M05 N130 G15 N140 M30 %

Although the parametric program we created is not optimal, it clearly demonstrates ample opportunities this method for creating effective NC programs and various machine cycles.

2.1 Structure and content of the NC program

Note

The guideline for developing a part program is DIN 66025.

A (CNC/parts machining) program consists of a sequence of NC blocks (see following table). Each frame represents one processing step. Statements are written in the frame in the form of words. The last block in the execution sequence contains a special word for the end of the program: M2, M17 or M30.

;a comment

;1st frame

;2nd frame

;end of program (last frame)

Program names

Each program has its own name, which is freely chosen when creating the program, subject to the following conditions (except for the punched tape format):

The first two characters must be letters (also a letter with an underscore)

other letters, numbers

MPF100 or WELLE or

The CNC only displays the first 24 characters of the program ID.

Punched tape format

File names:

File names may include characters

0...9, A...Z, a...z or _ and have maximum length in 24 characters.

File names must have a 3-letter extension (_xxx).

Data in punched tape format can be created separately or processed in an editor. The file name stored in the CNC memory begins with "_N_".

A file in punched tape format is entered %<имя>, "%" should be in the first column of the first line.

%_N_WELLE123_MPF = part program WELLE123 or

%Flansch3_MPF = Flansch3 part program

Further information on transferring, creating and saving part programs can be found in:

/BAD/, /BEM/ Operating Instructions for HMI Advanced, HMI Embedded chapter "Control area Program"/"Control area Services"

2.2 Language elements of a programming language

The language elements of a programming language are defined

character set with uppercase/lowercase letters and numbers

words with address and sequence of numbers

personnel and personnel structure

frame length with max. possible number of characters

sequence of words in a frame with a table of addresses and their meaning

main and auxiliary personnel

frame number

addresses with table for important addresses and explanations

addresses valid modally or in a frame

addresses with axial extension with table of extended address writing

fixed addresses with table and value data for standard installation

fixed addresses with axial extension with table and indication of value for standard installation

set addresses indicating the set address letters

predefined computational functions, as well as arithmetic, logical operators and comparison operators with corresponding value assignments

identifiers, e.g. variables, subroutines, code words, DIN addresses and jump marks

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Character set

The following symbols are available for creating NC programs:

Capital letters

A, B, C, D, E, F, G, H, I, J, K, L, M, N,(O),P, Q, R, S, T, U, V, W, X, Y, Z

In doing so, take into account:

Do not confuse the letter "O" with the number "0".

Lower case

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

Note Capital and lower case do not differ.

1, 2, 3, 4, 5, 6, 7, 8, 9

Special symbols

% Program start symbol (only for creating a program on an external PC)

< меньше

> more

: Main frame, end of label, linking operator

= Assignment, part of equality

/ Division, frame skip

* Multiplication

Addition

- Subtraction, negative sign

" Quotes, identification for a string of characters

" Apostrophe, identification for special numeric data: hexadecimal, binary

? Reserved

! Reserved

Fundamentals of CNC programming 2.2 Language elements of a programming language

Note Hidden special characters are treated as space characters.

CNC programs consist of blocks; frames in turn consist of words.

A CNC Language word consists of an address symbol and a digit or sequence of digits representing the arithmetic value.

The address symbol for a word is a letter. A sequence of numbers may include a sign and a decimal point, and the sign always appears between the letters of the address and the sequence of numbers. The positive sign (+) is not recorded.

Personnel and personnel structure

An NC program consists of individual blocks, a block of (several) words.

The block must contain all the data to perform the work operation, and ends with the character "LF" (LINE FEED = new line).

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Note

The "LF" character is not written; it is created automatically when switching lines.

Frame length

A frame can consist of max. of 512 characters (including comment and end-of-frame character

"LF").

Note Typically, the current frame display shows three frames with a max.

66 characters each. Comments are also shown. Messages are shown in a separate message window.

Sequence of words in a frame

To make the structure of the frame clearer, the words of the frame should be arranged as follows:

N10 G... X... Y... Z... F... S... T... D... M... H...

Meaning

Frame number address

Frame number

Move function

Travel information

Speed

Tool

Tool offset number

Additional feature

Helper function

Note Some addresses can be used multiple times in one block (e.g. G..., M..., H...)

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Main/auxiliary frame

There are two types of frames:

main personnel and

support personnel

The main frame must contain all the words necessary to start the technological cycle from the program section starting with the main frame.

Note Main blocks can be located in both main and subprograms. The control system is not

checks whether the main frame contains all the necessary information.

Frame number

Main frames are designated by the main frame number. The main frame number consists of the symbol ":" and a positive integer (frame number). The frame number always appears at the beginning of the frame.

Note The main block numbers within the program must be unique in order to obtain

unambiguous search result.

:10 D2 F200 S900 M3

Auxiliary frames are identified by the auxiliary frame number. The auxiliary block number consists of the character "N" and a positive integer (block number). The frame number always appears at the beginning of the frame.

Note The auxiliary block numbers within the program must be unique so that

get an unambiguous search result.

The sequence of frame numbers can be any, but an increasing sequence of frame numbers is recommended. You can program NC blocks without block numbers.

Fundamentals Programming Manual, Edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Addresses are fixed or settable identifiers for the axes (X, Y, ...), spindle speed (S), feed (F), circle radius (CR), etc.

Example: N10 X100

Important addresses

Note

Rotary axis

pourable

Regrinding interval for path functions

fixed

Rotary axis

pourable

Rotary axis

pourable

Chamfering a contour corner

fixed

Cutting edge number

fixed

fixed

FA[axis ]=... or

Axial feed

fixed

FA[spindle]=... or

(only if the spindle number is specified via a variable)

Move function

fixed

Helper function

fixed

Rec. function without stopping reading

Interpolation parameter

installable

Interpolation parameter

installable

Interpolation parameter

installable

Calling a subroutine

fixed

Add. function

fixed

Add. function without stopping reading

Auxiliary frame

fixed

Trajectory percentage

fixed

Number of program runs

fixed

Positioning axis

fixed

POSA[axis]=…

fixed

Spindle position

fixed

Spindle position beyond block boundary

fixed

installable

R0=... to Rn=...

R-parameter, n can be set via MD

fixed

(standard 0 - 99)

installable

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Rounding the corner of a path

fixed

Rounding the corner of a contour (modal)

fixed

Spindle speed

fixed

Tool number

fixed

installable

installable

installable

installable

"absolute

" incremental

installable

installable

Aperture angle

installable

Polar angle

installable

Circle radius

installable

Polar radius

fixed

Main frame

installable

"fixed"

This address ID is available for a specific function. Machine manufacturer

"installable"

The machine manufacturer can assign a different name to these addresses via machine data.

Modal/frame-by-frame addresses

Modally valid addresses retain their significance with the programmed value until (in all subsequent blocks) a new value is programmed at the same address. Block-valid addresses only retain their significance in the block in which they were programmed. Example:

Fundamentals of CNC programming 2.2 Language elements of a programming language

Extended addresses

Extended writing of addresses allows you to systematize large quantity axes and spindles. The extended address consists of a digital extension or a variable identifier written in square brackets and assigned an arithmetic expression using the "=" symbol.

Extended address spelling is allowed only for the following simple addresses:

Meaning

Axis addresses

Interpolation Options

Spindle speed

Spindle position

Additional functions

Secondary functions

Tool number

The number (index) in extended address writing for addresses M, H, S, as well as for SPOS and SPOSA can be replaced by a variable. In this case, the variable identifier is in square brackets.

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Fixed addresses

The following addresses are fixed:

Value (default setting)

Cutting edge number

Move function

Helper function

Calling a subroutine

Additional feature

Auxiliary frame

Number of program runs

R-parameter

Spindle speed

Tool number

: Main frame

Programming example: N10 G54 T9 D2

Fixed addresses with axial extension

Value (default setting)

Axial value (variable axis programming)

Axial acceleration

Axial feed

Axial feed for handwheel overlay

Axial feed limitation

Interpolation parameters (variable axis programming)

Axial offset

Polynomial coefficient

Positioning axis

Positioning axis across block boundary

Explanation:

When programming with axial extension, the axis to be moved is in square brackets.

Full list of all fixed established addresses can be found in the application.

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Settable addresses

Addresses can be specified either as an axis letter (with a numeric extension if necessary) or as a free identifier.

Note The addresses to be set must be unambiguous within the control system, i.e. one and the same

the same address identifier cannot be used for various types addresses.

The types of addresses differ:

axial values ​​and end points

interpolation parameters

submissions

resurfacing criteria

measurement

behavior of axes and spindles

Settable address letters are: A, B, C, E, I, J, K, Q, U, V, W, X, Y, Z

Note The names of the settable addresses can be changed by the user via machine data.

X1, Y30, U2, I25, E25, E1=90, …

Digital expansion has one or two positions and is always positive. Address ID:

The writing of the address can be supplemented by adding other letters. Example:

Addition

Subtraction

Multiplication

Attention: (type INT)/ (typeINT)= (typeREAL); for example, 3/4 = 0.75

Division, for variable type INT and REAL

Attention: (type INT )DIV (type INT )= (type INT ); for example, 3 DIV 4 = 0

Extracting the fractional part (for INT type only) gives the remainder of the division

INT, for example, 3 MOD 4=3

: Linking operator (y frame variables)

arcsine

arc cosine

Arctangent2

Square root

Meaning

2nd degree (square)

Integer part

Round to the nearest integer

Natural logarithm

Exponential function

Comparison and logical operators

Comparison operators and

Meaning

logical operators

more or equal

less or equal

negation

exclusive "OR"

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

In arithmetic expressions using parentheses you can set the processing sequence of all operators, thereby deviating from the usual rules of precedence.

Value assignments Addresses can be assigned values. Values ​​are assigned

in different ways depending on the type of address identifier.

The "=" character must be written between the address identifier and the value if

the address identifier consists of more than one letter,

a value consists of more than one constant.

The "=" character is not needed if the address identifier is a single letter and the value consists of only one constant. Signs are allowed, a separation character is allowed after the letters of the address.

Example of assigning values

;assigning a value (10)

address X, "=" not required

;assigning a value (10)

address (X) with;digital

extension(1), "=" required

;axis names from transfer parameters

;axis name as index when accessing axis data

;indirect axis programming

X=10*(5+SIN(37.5))

;assigning a value via a numeric expression, "=" required

Note: The digital extension must always be followed by special character "=", "(", "[", ")",

"]", "," or operator to distinguish an address identifier with a numeric extension from address letters with a value.

Identifier Words (according to DIN 66025) are supplemented with identifiers (names). These extensions have the same meaning within an NC block as words. Identifiers must be unambiguous. The same identifier cannot be used for different objects.

Identifiers can be recorded for:

variable

system variable

user variable

subroutines

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

CNC Programming Basics

code words

DIN addresses with multiple letters

transition markers

Structure

The ID consists of a maximum of 32 characters. The following symbols can be used:

letters

underscores

numbers

The first two characters must be letters or underscores, and there must be no separator characters between individual characters (see following pages).

Example: CMIRROR, CDON

Note Reserved codewords cannot be used as

identifiers. Separating characters between individual characters are not allowed.

Note Number of characters for individual identifiers

program names: 24 characters

Axis ID: 8 characters

variable identifier: 31 characters

Identifier naming rules

To avoid name overlap, the following rules are used:

All identifiers starting with “CYCLE” or “_” are reserved for cycles

All identifiers starting with “CCS” are reserved for cycles compiled by SIEMENS.

Custom compiled loops begin with "CC".

Other reservations

The "RL" identifier is reserved for conventional lathes.

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

CNC Programming Basics

2.2 Language elements of a programming language

Identifiers starting with "E_" are reserved for programming

Variable IDs

For variables used by the system, the first letter is replaced by the "$" symbol. This symbol cannot be used for user-defined variables.

Examples (see "List of system variables"): $P_IFRAME, $P_F

For variables with digital extension, leading zeros have no meaning (R01 corresponds to R1). Separating characters are allowed before the digital extension.

Array IDs

The same rules apply to array identifiers as to elementary variables. Addressing R variables as an array is possible.

Example: R=…

Data types

A variable can hide a numeric value (or several) or a symbol (or several), for example, an address letter.

What data type is allowed for the corresponding variable is determined when the variables are defined. For system variables and predefined variable type installed. The elementary variable types/data types are:

Meaning

Range of values

Integers (integers)

signed quantities

Real numbers (fractional)

±(10-300 … 10+300)

numbers with decimal point, LONG

Truth values: TRUE (1)

ASCII character, according to code 0 ... 255

Character string, number of characters

Sequence of values

in […], max. 200 characters

axis names only (axis addresses)

all available in the channel

axis identifiers

Geometric data for

displacement, rotation,

scaling, mirroring

These same elementary types can be composed into arrays. At most, two-dimensional arrays are possible.

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Permanent

Integer constants

An integer value with or without a sign, for example as an assignment to an address Examples:

; assigning the value +10.25 to address X

; assigning the value -10.25 to address X

; assigning value +0.25

; assigning value +0.25

address X, without the introductory "0"

; assigning the value –0.1*10-3 to address X

Note If for an address with a permissible entry of a decimal point after the decimal point

If more places are recorded than the number of places allocated for this address, it is rounded up to the number of places allocated.

X0 cannot be replaced by X.

G01 X0 cannot be replaced by G01 X! Hexadecimal constants

Constants with a hexadecimal interpretation are also possible. In this case, the letters "A" to "F" serve as hexadecimal digits from 10 to 15.

Hexadecimal constants are enclosed between two apostrophes and begin with the letter "H" followed by hexadecimal value. Separating characters between letters and numbers are allowed.

$MC_TOOL_MANAGEMENT_MASK="H3C7F";assignment of hexadecimal numbers

machine data

The maximum number of characters is limited by the range of values integer type data.

Binary constants Constants that are interpreted binary are also possible. In this case, only the numbers “0” and “1” are used.

Binary constants are enclosed between apostrophes and begin with the letter "B" followed by the binary value. Separating characters between digits are allowed.

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Example machine data (see also “Advanced programming”):

Program segment

A program segment consists of one main block and several auxiliary blocks.

:10 D2 F200 S900 M3 N20 G1 X14 Y35

Skipping frames

Blocks that are not executed every time the program is executed (for example, debugging a program) may be skipped.

Frames that should be skipped are indicated by a "/" (slash) character before the frame number. Several consecutive frames may also be skipped. Statements in skipped frames are not executed, the program continues on the corresponding next, non-skipped frame.

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Example of skipping frames

;performed

;omitted

;performed

;omitted

;performed

Up to 10 skip levels can be programmed. For one program frame

processing parts, only 1 pass level can be specified:

;frame is skipped (1st skip level)

;frame is skipped (2nd skip level)

;frame is skipped (3rd skip level)

;frame is skipped (8th skip level)

;frame is skipped (9th skip level)

;frame is skipped (skip level 10)

Machine manufacturer The number of skip levels that can be used depends on the machine

indication data. Skip blocks of skip levels /0 to /9 are activated via the operator panel in the "Machine" operating area (see /BAD, BEM/ HMI Advanced/Embedded Operating Instructions), in the "Program Control" or "Adaptive Control" menu.

Note Variable program executions can also be created by using

system and user variables for conditional transitions.

Goals (tags)

By defining jump targets (labels), branches can be programmed within the program.

Label names are specified with a minimum of 2 and a maximum of 32 characters (letters, numbers, underscore). The first two characters must be letters or underscores. The label name is followed by a colon (":").

For other information, see

Literature: /PGA/, Programming Guide "Advanced Programming"

Programming manual, edition 10.2004, 6FC5 298-7AB00-0PP1

Fundamentals of CNC programming 2.2 Language elements of a programming language

Note Labels must be unique within the program.

Markers are always at the beginning of the frame. If there is a program number, the label appears immediately after the block number.

Programming machining on CNC machines carried out in a language usually called ISO 7-bit language or G and M code language. The G and M code language is based on the provisions of the International Organization for Standardization (ISO) and the Electronics Industry Association (EIA).

Manufacturers of CNC systems adhere to these standards to describe basic functions, but take liberties and deviations from the rules when it comes to special features their systems.

Japanese FANUC (FANUC CORPORATION) CNC systems were among the first to be adapted to work with G and M codes and using this standard to the fullest extent. Currently, FANUC racks are the most common both abroad and in Russia.

CNC systems from other well-known manufacturers, such as SINUMERIK (SIEMENS AG) and HEIDENHAIN, also have the ability to work with G and M codes, but some specific codes may differ. You can learn about the difference in programming specific functions from the documentation for the specific CNC system.

There are three machining programming methods for CNC machines:

  • Manual programming.

All CNC machine operators and programmer technologists must have good show about manual programming techniques. It is like primary classes at school, in which education provides the basis for subsequent education.

  • Programming on the CNC console.

When programs are created and entered directly on the CNC machine using the keyboard and display. For example, the machine operator can verify the NC or select the required canned cycle using special pictograms and paste it into the code control program.

  • Programming using CAD/CAM system.

Programming using a CAD/CAM system allows you to “raise” the process of writing processing programs by more high level. Working with a CAD/CAM system, a technologist-programmer relieves himself of labor-intensive mathematical calculations and receives tools that significantly increase the speed of writing control programs.

A set of commands in a programming language corresponding to the operating algorithm of a machine for processing a specific workpiece is called control program (CP).

A control program consists of a sequence of blocks and usually begins with the program start symbol (%) and ends with M02 or M30.

Each program block represents one processing step and (depending on the CNC) can begin with a block number (N1...N10, etc.) and end with the end of block symbol (;).

A control program block consists of statements in word form (G91, M30, X10., etc.). A word consists of a symbol (address) and a number representing an arithmetic value.

Addresses X, Y, Z, U, V, W, P, Q, R, A, B, C, D, E are dimensional movements, used to designate the coordinate axes along which movements are carried out.

Words describing movement may have a (+) or (-) sign. If there is no sign, the displacement is considered positive.

Addresses I, J, K mean interpolation parameters.

G - preparatory function.

M - auxiliary function.

S - main movement function.

F - feed function.

T, D, H - tool functions.

Symbols may take on different meanings depending on the specific CNC.

G codes for CNC

G00- fast positioning.

The G00 function is used to perform rapid movement of the cutting tool to a machining position or to a safe position. Rapid traverse is never used to perform machining, since the speed of movement of the machine's actuator is very high. Code G00 is canceled by codes: G01, G02, G03.

G01- linear interpolation.

Function G01 is used to perform linear movements at a given speed (F). When programming, the coordinates of the end point are specified in absolute values(G90) or increments (G91) with corresponding movement addresses (for example X, Y, Z). Code G01 is canceled by codes: G00, G02, G03.

G02- circular interpolation clockwise.

Function G02 is designed to move the tool along an arc (circle) in a clockwise direction at a given speed (F). During programming, the coordinates of the end point are specified in absolute values ​​(G90) or incremental values ​​(G91) with the corresponding movement addresses (for example, X, Y, Z).

Code G02 is canceled by codes: G00, G01, G03.

G03- circular interpolation counterclockwise.

Function G03 is designed to move the tool along an arc (circle) in a counterclockwise direction at a specified speed (F). During programming, the coordinates of the end point are specified in absolute values ​​(G90) or incremental values ​​(G91) with the corresponding movement addresses (for example, X, Y, Z).

The interpolation parameters I, J, K, which determine the coordinates of the center of the circular arc in the selected plane, are programmed in increments from the starting point to the center of the circle, in directions parallel to the X, Y, Z axes, respectively.

Code G03 is canceled by codes: G00, G01, G02.

G04- pause.

Function G04 - command to perform holding time with given time. This code is programmed along with an X or P address, which specifies the length of the dwell time. Typically, this time is from 0.001 to 99999.999 seconds. For example, G04 X2.5 - pause 2.5 seconds, G04 P1000 - pause 1 second.

G17- selection of the XY plane.

The G17 code is for selecting the XY plane as the working plane. The XY plane becomes dominant when using circular interpolation, coordinate system rotation, and canned drilling cycles.

G18- selection of the XZ plane.

The G18 code is for selecting the XZ plane as the working plane. The XZ plane becomes dominant when using circular interpolation, coordinate system rotation and canned drilling cycles.

G19- selection of the YZ plane.

The G19 code is for selecting the YZ plane as the working plane. The YZ plane becomes dominant when using circular interpolation, coordinate system rotation, and canned drilling cycles.

G40- Cancel tool radius compensation.

Function G40 cancels action automatic correction to tool radius G41 and G42.

G41- left tool radius compensation.

The G41 function is used to enable automatic compensation for the radius of the tool located to the left of the machined surface (when viewed from the tool in the direction of its movement relative to the workpiece). Programmable together with the tool function (D).

G42- right tool radius compensation.

The G42 function is used to enable automatic compensation for the radius of a tool located to the right of the surface being machined (when viewed from the tool in the direction of its movement relative to the workpiece). Programmable together with the tool function (D).

G43- correction for tool position.

Function G43 is used for tool length compensation. Programmable together with the tool function (H).

G54 - G59- specified offset.

Bias working system coordinates of the part relative to the machine coordinate system.

G70- input of inch data.

Function G70 activates the inch data mode.

G71- input of metric data.

Function G71 activates the metric data mode.

G80- canceling the constant cycle.

A function that cancels any canned loop.

G81- standard drilling cycle.

The G81 cycle is designed for centering and drilling holes. Movement during processing occurs at the working feed. Movement to the starting position after processing in progress at fast feed.

G82- holding drilling.

The G82 cycle is designed for drilling and countersinking holes. The movement during processing occurs at the working feed with a pause at the end. The movement to the starting position after processing occurs at an accelerated feed.

G83- intermittent drilling cycle.

The G83 cycle is designed for deep hole drilling. The movement during the machining process occurs at the working feed with periodic withdrawal of the tool into the retraction plane. The movement to the starting position after processing occurs at an accelerated feed.

G84- thread cutting cycle.

The G84 cycle is designed for tapping threads. The movement during machining occurs at the working feed, the spindle rotates in a given direction. The movement to the starting position after processing occurs at the working feed with reverse rotation of the spindle.

G85- standard boring cycle.

The G85 cycle is designed for reaming and boring holes. Movement during processing occurs at the working feed. The movement to the starting position after processing occurs at the working feed.

G86- boring cycle with spindle rotation stop.

The G86 cycle is designed for boring holes. Movement during processing occurs at the working feed. At the end of processing, the spindle stops. The movement to the starting position after processing occurs at an accelerated feed.

G87- boring cycle with manual retraction.

The G87 cycle is designed for boring holes. Movement during processing occurs at the working feed. At the end of processing, the spindle stops. The movement to the starting position after processing is done manually.

G90- mode absolute positioning.

In the absolute positioning mode G90, the movements of the actuators are made relative to the zero point of the working coordinate system G54-G59 (programmed where the tool should move). G90 code is canceled using code relative positioning G91.

G91- relative positioning mode.

In the relative (incremental) positioning mode G91, the zero position is each time taken to be the position of the actuator, which it occupied before moving to the next reference point (it is programmed how much the tool should move). The G91 code is canceled by the G90 absolute positioning code.

G94- feed rate in inches/millimeters per minute.

Using the G94 function, the specified feedrate is set in inches or millimeters per minute. Programmable together with the feed function (F). Code G94 is canceled by code G95.

G95- feed rate in inches/millimeters per revolution.

Using the G95 function, the specified feedrate is set in inches or millimeters per spindle revolution. Those. Feedrate F is synchronized with spindle speed S. Code G95 is canceled by code G94.

M codes for CNC

M00- programmable stop.

When the control system executes command M00, a stop occurs. All axial movements stop, while the spindle (in most machines) continues to rotate. The program resumes from the next frame after pressing the "Start" button.

M01- stop with confirmation.

Code M01 acts similarly to M00, but is executed only after confirmation from the machine control panel. If the confirmation key is pressed, block reading from M01 is stopped. If the key is not pressed, then frame M01 is skipped and the execution of the NC is not interrupted.

M02- end of the program.

Code M02 indicates the end of the program and causes the spindle to stop, the feed to stop, and the cooling to turn off.

M0Z- spindle rotation clockwise.

Using code M0Z, direct rotation of the spindle with the programmed speed (S) is activated. Code M03 is valid until it is canceled using M04 or M05.

M04- spindle rotation counterclockwise.

Using code M04, reverse rotation of the spindle with the programmed speed (S) is activated. Code M04 is valid until it is canceled using M03 or M05.

M05- spindle stop.

Code M05 stops spindle rotation, but does not stop axial movement.

M06- tool change.

Using code M06, the tool attached to the spindle is changed to a tool in the ready position in the tool magazine.

M07- turning on cooling No. 2.

Code M07 includes the supply of coolant to the processing zone in spray form, if the machine has such a capability.

M08- turning on cooling No. 1.

Code M08 includes the supply of coolant to the processing zone in the form of a jet.

M09- cooling off.

Code M09 turns off coolant and overrides commands M07 and M08.

M10- clamp.

Code M10 refers to work with the clamping device of the moving parts of the machine.

M11- release.

Code M11 refers to working with the clamping device of the moving parts of the machine.

MZ0- end of information.

Code MZ0 informs the control system about the completion of the program, stops the spindle, stops the feed, and turns off the cooling.

Additional functions and symbols when programming CNC machines

X, Y, Z- axial movement commands.

A, B, C- commands for circular movement around the X, Y, Z axes, respectively.

I, J, K- circular interpolation parameters parallel to the X, Y, Z axes, respectively.

With circular interpolation G02 or G03, R defines the radius that connects the start and end points of the arc. In canned cycles, R determines the position of the retraction plane. When working with a rotation command, R determines the angle of rotation of the coordinate system.

D- tool radius compensation value.

N- tool length compensation value.

F- feed function.

S- main movement function.

T- a value that determines the number of the tool that needs to be moved to the change position by rotating the tool magazine.

N- numbering of UE frames.

/ - skip frame.

(...) - comments in the UP.

The manual presents the basics of manual programming and adjustment of CNC metal-cutting machines in small-scale production. The issues of compiling calculation and technological maps are considered, fragments of control programs for CNC machines are given. elements of setting up CNC machines are presented.
Intended for students studying in the areas 150900 “Technology, equipment and automation of mechanical engineering production”. 150700 “Mechanical Engineering” and the profile “Machines and technology of highly efficient material processing processes.”

Technological preparation of production on CNC machines.
Trend modern production - «... constant update production is an objective process fundamentally connected with scientific and technological progress and interdependent by it.” Main ways to update products:
modernization of outdated models and designs:
development and production of fundamentally new, unparalleled products:
product renewal associated with changes in its consumer qualities:
updating or modernization of products related to the improvement of production methods or processes.

Intensification of the pace of product renewal is possible in production. equipped with computer numerical control (CNC) equipment.

To produce a given product at the enterprise, it is necessary to carry out technical preparation of production. Technical training production is divided into design preparation, technological preparation and scheduling. Design preparation for production includes the development of a product design with the preparation of all necessary design documentation.

TABLE OF CONTENTS
INTRODUCTION
1. BASICS OF PROGRAMMING FOR CNC MACHINES
1.2. Numerical software control of equipment
1.3. Design Features technological process on CNC machines
1.4. Coordinate system and machine reference points
1.5. Control program structure
1.6. Control program format
1.7. Coding of preparatory functions
1.8. Cycle programming
1.8.1. Technological solutions in cycles
1.8.2. Cycle programming
1.9. Coding Helper Functions
1.10. Programming dimensional movements
1.10.1. Development of calculation and technological map
1.10.2. Features of the development of RTK for lathes
1.10.3. Features of the development of RTK for milling machines
1.10.4. Features of the development of RTK for drilling machines
1.10.5. Linear interpolation
1.10.6. Setting dimensions in increments
1.10.7. Specifying dimensions in absolute values
1.10.8. Programming circular interpolation
1.11. Floating zero input
1.12. Threading
1.13. Machine status programming
1.14. Tool offset programming
1.15. Programming subroutines
1.16. Development of a setup map
2. BASICS OF SETTING UP CNC MACHINES
2.1. Procedure for setting up CNC machines
2.2. Setting up CNC lathes
2.2.1. Features of setting up CNC lathes
2.2.2. Preparation, adjustment and installation of cutting and auxiliary tool
2.2.3. Requirements for cutting tools for CNC machines
2.2.4. Setting the working parts of the machine to their original position
2.3. Setting up CNC milling machines
2.3.1. Machine zeros
2.3.2. Milling machine equipment
2.3.3. Linking the workpiece and cutting tool
2.4. Setting up multi-operational CNC machines
2.4.1. Installation of workpieces on a metal-cutting machine
2.4.2. Placing workpieces on the table
2.4.3. Securing workpieces on the table
2.4.4. Installing the workpiece in the fixture
2.4.5. Requirements for machine tools
2.4.6. Requirements for fixtures for multi-operational machines
2.4.7. Adjustable and non-adjustable devices
2.4.8. Preparation, adjustment and installation of cutting and auxiliary tools
2.5. Debugging the control program on the machine
2.6. Development of control programs obtained using CAD/CAM systems
2.7. Technological parameters of control program execution accuracy
3. SELF-TEST QUESTIONS
4. REFERENCES
5.APPLICATIONS
5.1. Basic symbols on CNC control panels (GOST 24505-80)
5.2. Symbols of CNC control panels (GOST 24505-80)
5.3. Additional symbols for the IR320PMF4 machine
5.4. Additional symbols for the STP220AP machine
5.5. Preparatory functions of the Mill 155
5.6. Preparatory functions of the IR320PMF4 machine
5.7. Preparatory functions of the STP220AP machine
5.8. Auxiliary functions of the IR320PMF4 and STP220AP machines.

Free download e-book V convenient format, watch and read:
Download the book Basics of programming and setting up CNC machines, Dolzhikov V.P., 2011 - fileskachat.com, fast and free download.

  • Electrical equipment of diesel locomotives and diesel trains, Belozerov I.N., Balaev A.A., Bazhenov A.A., 2017
  • Theoretical foundations of accelerated assessment and forecasting of the reliability of technical systems, Gishvarov A.S., Timashev S.A., 2012