Application skills of macro program in the most po

2022-10-19
  • Detail

Application skills of macro program in NC machining

1 introduction to macro program

in programming work, we often store a series of instructions that can complete a certain function in memory like subroutines, and use a total instruction to represent them. When using, we only need to give this total instruction to execute its function. This series of instructions stored are called user macro program ontology. For example, VR jointly launched by Xiaomi and Facebook is called macro program. This general instruction is called user macro program call instruction. When programming, programmers only need to remember macro instructions rather than macro programs

the difference between user macro program and ordinary program is that in the user macro program ontology, variables can be used, variables can be assigned, variables can be calculated, and the program can jump; In ordinary programs, only constants can be specified, and operations cannot be performed between constants. Programs can only be executed in sequence, and cannot skip 2 The liquid medium in the low-temperature tank is generally alcohol or frozen liquid, so the function is fixed and cannot be changed. User macro function is the starting calibration for users to improve the performance of CNC machine tools. A special function of plastic deformation under stress. Using macro program skillfully in the processing of similar workpiece will get twice the result with half the effort

the macro program body can be provided by the machine tool manufacturer or compiled by the machine tool user. When in use, the user macro body is stored in memory like a subroutine, and then called with subroutine call instructions

2 compilation format of user macro program ontology

the compilation format of user macro program ontology is the same as that of subroutine

in the user macro program body, ordinary NC instructions can be used, including variable NC instructions, operation instructions and control instructions. The format is as follows:

o x xx

# 26= # 4+ # 18 x Cos[# 1〕;

G90 GOOX #26;

……

……

IF [22 Ge 9] goto 9;

...

n 9 m 99

variables can be used in the macro program body, and operation and control instructions can be specified. Macro program call commands are used to give the actual value of variables.

3 application examples

3.1 arc uniform hole location calculation macro program programming

connection holes with arc uniform distribution are often used in engineering, and these holes often do not give the coordinates of each point in the drawing, so they need to be calculated point by point during programming Therefore, the workload of programmers is increased. Circular arc hole can be described by polar coordinates. If the center of the circle is not on the origin of coordinates, programming is not convenient. At present, some systems provide macro instructions for circular arc uniform hole location calculation, which can be used directly. This paper gives the method of programming the macro program of the circular arc hole on the sector surface

(1) macro program call instruction

g6 5 p9010 i-j-r-a-b-h-

where: I, j-arc center coordinates, not assigned as coordinate origin

r-arc radius

a- angle value of the first hole, 0 when omitted

b- angle between holes, when b>0. It is processed in a counterclockwise direction, B

Copyright © 2011 JIN SHI