Design and application of error-proof program for Siemens system tool compensation setting

Basic principle

In NC machining, when the program starts running, the tool specified by the programming is generally called first, and the machining block is executed after reading the currently valid tool radius parameter.

In order to achieve the purpose of tool compensation and error prevention, the judgment module should be inserted between the two program statements before the machining block is run after reading the currently valid tool radius parameter. It is judged by the qualification condition whether the currently valid tool radius value is within the appropriate value range: the program that meets the condition continues to execute downward; the program that does not meet the condition will jump to run the alarm block and terminate the program (see Figure 1).

2. Main programming instructions and system parameters

In order to realize the tool offset error prevention function shown in the principle of error prevention, the execution program should include three elements: 1 to retrieve the currently valid tool radius value. 2 Perform logical operations and conditional judgments. 3 Perform program jump and display alarm information.

The following is a detailed description of the programming commands and system parameters necessary for programming in conjunction with the Siemens SINUMERIK system.

(1) Retrieve the currently valid tool radius value The current valid tool radius value is obtained by reading the system variable. In the SINUMERIK system, "$TC_DP6[t,d]" is a system variable that represents the value of a given tool geometry radius, where t is the tool number and d is the tool offset address number. The commonly accepted readable call form is "$TC_DP6[$P_TOOLNO, $P_TOOL]", where "$P_TOOLNO" is the system variable representing the currently active tool number, and "$P_TOOL" is the currently valid tool offset address. The system variable of the number. So the expression "$TC_DP6[$P_TOOLNO, $P_TOOL]" represents the tool geometry radius value of the currently valid tool number.

There is another system variable "$P_TOOLP" for the tool number, which represents the programmable tool number, which is the number corresponding to T in the NC program. For example, if T21 is written during programming, the system will assign 21 to "$P_TOOLP". The tool management function that comes with the SINUMERIK system gives the number in the tool management list corresponding to the T command number, which may not match the actual tool position number. If the use of "$P_TOOLP" as the calling variable may cause an assignment error, it is not recommended.

(2) Conditional judgment The instruction for guiding (two-choice type) conditional judgment in SINUMERIK system is IF, and its complete instruction set is: IF-ELSE-ENDIF. The standard programming syntax is as follows:

IF <conditional expression>

Block 1

ELSE

Block 2

ENDIF

If the logical return value of the expression is judged to be YES, that is, when the qualified condition is satisfied, the program will execute the following program segment 1; if the logic return value is FALSE, that is, if the qualification condition is not satisfied, then the program will execute the ELSE-directed program segment. 2. In the actual application, some auxiliary commands such as ELSE and ENDIF can be omitted.

(3) Logical operations In the conditional judgment expressions, logical operations (also called Boolean operations, which can only be used for Boolean variables) can be applied as needed. The main logical operators are: AND, OR, NOT, XOR. There are often more than one condition for the tool compensation value. In order to make the limit condition more rigorous and safe, it is generally necessary to limit the maximum value and the minimum value. Therefore, the operator OR is usually used to connect the truth expression of the conditional judgment.

(4) Program line jump In the SINUMERIK system, program line jump instructions that can change the program operation sequence include GOTO, GOTOB, and GOTOF. Among them GOTO searches forward according to the given target, if not searched and then searches backward; GOTOB is the jumping target backward; GOTOF is the jumping target forward. For the machining program, the forward direction is to the end of the program, and the reverse is to the beginning of the program. According to the preset program structure, the jump target is in the forward position, so the GOTOB command is not available, and can be programmed using GOTO or GOTOF commands.

The standard programming syntax is as follows:

GOTO <jump target>

GOTOF <jump target>

Jump targets can be labels, program line numbers, strings, etc., but must consist of more than two letters or numbers, and the first two symbols must be letters or underscores.

There must be a colon after the jump target block marker, otherwise it will not be searched. For example, "LAB LE:" means that when GOTO LABLE is executed, the program will query and jump to the block marked with "LABLE:".

(5) Displaying alarm information In the SINUMERIK system, the command to display the programmable information on the machine operation monitor is "MSG()". The programming syntax is as follows:

MSG ("Content") is generally used in conjunction with the G4 F... command when using the "MSG()" instruction. Where F is the length of time the pause is in s.

The main purpose of this instruction is to pause the program for the corresponding time. This allows the content displayed by "MSG()" to be maintained on the monitor so that the operator can read the content in time.

3. Programming examples and instructions

(1) Processing content A blind hole with a diameter of 25 mm is machined on the end face of a rectangular parallelepiped. The position dimensions are shown in Fig. 2.

Processing equipment: horizontal machining center; CNC system:

SINUMERIK 840D; cutting tool: φ10mm solid carbide milling cutter; programming method: contour programming.

(2) Programming and analysis

N010 T21 M6 D1 (tool change)

N020 G54 (establishing the workpiece coordinate system)

N030 G0 G90 G40 X0 Y0 Z100 (program origin)

N040 S900 M3 (spindle forward rotation)

N050 IF $TC_DP6[$P_TOOLNO, $P_TOOLND]<5 OR$TC_DP6[$P_TOOLNO, $P_TOOLND]>9 GOTO LABLE (Conditional judgment, when the tool radius value is less than 5mm or greater than 9mm, the program jumps to the LABLE line)

N060 ELSE (When the tool radius value is 5 to 9 mm, the downstream program is executed)

N070 TRANS X100 Y50 (coordinate system zero offset)

N080 Z47 (safe distance)

N090 G1 Z35 F100 M8 (feed to the bottom of the hole, the cutting fluid is open)

N100 G41 Y12.5 (feed to the upper wall of the blind hole)

N110 G3 Y12.5 CR=12.5 (milling circumference)

N120 G1 G40 Y0 (retracted hole center)

N130 G0 Z100 M9 (retraction, cutting fluid off)

N140 ENDIF (end judgment)

N150 M5 (spindle stop)

N160 M30 (program stop)

N170 LABLE: MSG("WARNING:THE TOOL RADIUS IS

INCURRECT!PLEASE CHECK IT!") (display alarm information)

N180 G4 F5 (pause 5s)

N190 M5 (spindle stop)

N200 M30 (program stop)

When the program starts running to line N050, the program will judge whether the currently valid tool radius value meets the requirements: if it is 5~9mm, the program will continue to execute the next line in order until the end of the N140 line program; if it is less than 5mm or greater than 9mm The program will jump to the N150 line to prompt an error message, and the program stops after a pause of 5s.

4. Conclusion

In this paper, the basic form of NC program tool compensation and error prevention is obtained by using the relevant instructions of SINUMERIK system, and the programming technology is simple and universal, which can effectively control the correctness of manual tool compensation setting.

Fold Insect Screen

Fold Insect Screen,Foldable Insect Screen,Door Pleated Insect Screen,Insect Screen Waterproof Folding

wuqiang huihuang fiberglass factory , https://www.hh-windowmesh.com