# Discussion on post processing of measuring cycle o

2022-08-02
• Detail

Talking about the post-processing of measuring cycle of WFL turning and milling compound machine tool

wfl turning and milling compound machine tool can not only have powerful multi axis machining function, but also automatically align and measure parts. With these functions, the turning milling compound machine tool can not only greatly improve the machining accuracy of parts, but also greatly improve the machining efficiency of parts

wfl turning milling compound machine tool has powerful functions and high efficiency. It not only has turning, multi axis milling and boring, but also has a variety of measurement cycles. Therefore, the programming is more complex. In actual production, although manual programming can also realize these functions, manual programming also has certain limitations. Therefore, it is of great significance to realize the computer automatic programming of turning milling compound machine tools

taking a simple measurement cycle "probe" of WFL machine tool as an example, the following describes how to use NX software programming and post-processing to output the measurement cycle of WFL turning milling compound machine tool

I. code definition of machine tool measurement cycle

to write a correct post-processing program that can output "probe", we must first understand the meaning of the WFL turning milling compound machine tool measurement cycle "probe" - the meaning of the measurement cycle is to measure the track points on the random axis. The format of the measurement cycle is probe (ax, DIS, MP, Num). The meanings of the parameters are as follows

◎ ax: measuring axis. The moving axis of the probe defined by ax approaches the workpiece at a very fast feed rate (generally at the speed of G0), and then measures. There are three measuring axes on the WFL turning and milling compound machine tool, x1, Y1 and Z1, that is, the X, y and Z axes of the machine tool

◎ dis: the moving distance of the probe. The distance between the measuring track point (i.e. the point to be measured on the part) and the starting point (the point at which G1 is started) must be within the distance defined by DIS, that is, the distance between the two must be less than this value. If the distance between the measuring track point and the starting point is greater than this value, the probe cannot measure the measuring track point. The dis value can be positive or negative, indicating whether the motion direction of the measurement track is along the positive or negative direction of the measurement axis

◎ num: after the first measurement of the track point, the probe will withdraw slightly along the measurement axis, and then repeat the measurement of the track point at the normal measurement feed rate. The number of repetitions is specified by num, generally 3 times

◎ MP: Specifies the storage location of measurement results. The measurement results are output to the memory unit MC of the machine tool_ In P , it is stored in the memory of the machine tool with MP as the index and becomes the measuring point MC_ POINT〔MP〕。

as long as we correctly define these four parameters in the post-processing program and realize their output, we can output the correct machine code of the measurement cycle

the following machine tool code is a practical example of probe application. The measured parts and measuring points are shown in Figure 1

...

n035 g54

n040 G0 x1=48 y1=0 c1=0 z1=10

n045 probe ("Z1", -15, 1, 3)

n050 G0 x1=93

n055 G0 z1=-50

n060 probe ("Z1", -15, 2, 3)

...

in this machine tool code, probe ("Z1 the measuring point of", -15, 1, 3) is MP1, and the position of MP1 is specified by the program in the previous sentence of the code. In this example, the position of the measuring point MP1 is (48, 0, 0), the probe measures along the negative direction of the machine tool Z1 axis, the defined moving distance of the probe is 15, the measuring starting point of the probe is z1=10, the measuring track point is from the position z1=0, the distance from the measuring track point to the measuring starting point is 10, which is less than the moving distance of the probe 15, and the measuring results are stored in the machine tool memory MC_ P  and memory cell MC_ In point , repeat the measurement for 3 times

The measuring point of

probe ("Z1", -15, 2, 3) is, and the position of MP2 is specified by the first two sentences of the code. MP2 in this example, the position of measuring point MP2 is (93, 0, 0). The measuring head measures along the negative direction of the Z1 axis of the machine tool. The defined moving distance of the measuring head is 15, the measuring starting point of the measuring head is the position of z1=-50, the measuring track point is from the position of z1=-60, and the distance between the measuring track point and the measuring starting point is 10, Less than the probe movement distance of 15. The measurement results are stored in the machine memory MC_ P  and memory cell MC_ In point 

it should be noted that this is the stack storage mode. After the second measurement, MC_ P  the stored value is automatically moved to MC_ P , up to MC_ P , repeat the measurement for 3 times at this point

II. How to use the post processor to realize the correct output of machine tool code

writing this measurement in NX 6.0 also involves the pre-processing of multi-disciplinary and multi field technical innovation quantity cycle. In nx6.0, it is easy to write the correct pre-processing by operating "probe_point". The task of post-processing is to translate the pre-processing program into the machine tool code probe (ax, DIS, MP, Num) that can be recognized by WFL turning milling compound machine tool. Please note: the execution procedures of the programs mentioned later are the execution sequence of post-processing. The following are the methods and steps to define and output the correct machine code

1. Output measurement axis ax

the post-processing program to realize this output is as follows (the post-processing programs are all written in Tcl language)

global mom_ probe_ Direction

global axis

global dis

global mp

we should try our best to avoid

if{\$mom_probeu direction = = "Xax is"} {

set axis x1}

if{\$momu probeu direction = = "yaxis"} {

set axis y1}

if{\$momu probe_direction = = "zaxis"} {

set axis z1}

mom_ output_ The literal "probe (\$axis, \$dis, \$mp, 3)"

post handler is used to define the output main program. mom_ probe_ Direction is the system variable of NX, and axis, DIS and MP are user-defined variables. mom_ probe_ Direction has three values in the system, namely "xaxis", "yaxis" and "zaxis". When the measurement direction in NX operation is x-axis, its value is "xaxis"; When the measurement direction in NX operation is y-axis, its value is "yaxis"; When the measurement direction in NX operation is z-axis, its value is "zaxis". In this way, you can use this system variable as a condition and use the if judgment statement to judge, corresponding to the variable "axis" in the output program, that is, the value of "ax" in probe (ax, DIS, MP, Num). The program is interpreted as: when mom_ probe_ When direction is "xaxis", assign "X1" to "axis"; When mom_ probe_ When direction is "yaxis", assign "Y1" to "axis"; When mom_ probe_ When the direction is "Za Xis", assign "Z1" to "axis" and output at last

The meanings of some parameters in the

program are: globe refers to global variables; If indicates judgment condition\$ Is the value character; Set means to assign values to the following parameters (please refer to the Tcl language textbook for details)

2. Output dis

"dis" output should be divided into the following three steps:

(1) calculate the value of the measurement starting point. Before each measurement cycle operation, run the following procedures to calculate the X, y and Z coordinate values of the starting point (the values are defined by the parameters x1u bofore, y1u bofore and z1u bofore, which are user-defined variables). In the following TCL program, mom_ mcs_ The G detection method is mostly a system variable whose oto is NX, and its storage method is an array, where mom_ mcs_ Go- to (0) automatically stores the value of the current machining coordinate system X, mom_ mcs_ Goto (1) automatically stores the value of the current machining coordinate system y, mom_ mcs_ Goto (2) automatically stores the values of the current machining coordinate system Z, and these variables are consistent with the coordinate values in the CLSF file

global mom_ mcs_ goto

global X1_ bofore

global Y1_ bofore

global Z1_ bofore

set X1_ bofore\$ mom_ mcs_ goto (0)

set Y1_ bofore\$ mom_ mcs_ goto (1)

set Z1_ bofore\$ mom_ mcs_ Goto (2)

(2) calculate the measurement track points. After each measurement cycle, execute the following procedures to calculate the X, y and Z coordinate values of the measurement track points, whose values are respectively determined by the parameter x1_ when、Y1_ When and Z1_ When definition (all three are user-defined variables)

global mom_ mcs_ goto

global X1_ when

global Y1_ when

global Z1_ when

set X1_ when \$ mom_ mcs_ goto (0)

set Y1_ when \$ mom_ mcs_ goto (1)

set Z1_ when \$ mom_ mcs_ Goto (2)

(3) calculate dis. At the end of the measurement cycle, the following procedure can calculate "dis". "Dis" is represented by the user-defined variable "dis" in the post-processing program. If the value of the measurement starting point minus the measurement track point is greater than zero, it means that the measurement track is moving in a negative direction along the measurement axis. At this time, subtract the coordinate value of the measurement starting point from the coordinate value of the measurement track point, and then subtract a constant to obtain DIS, which can ensure that the moving distance of the probe is greater than the distance between the measurement track point and the starting point. If the value of the measurement starting point minus the measurement track point is less than zero, it means that the measurement track is moving in a positive direction along the measurement axis. At this time, subtract the coordinate value of the measurement starting point from the coordinate value of the measurement track point, and add a constant to obtain DIS, which can ensure that the moving distance of the probe is greater than the distance between the measurement track point and the starting point. The NX post-processing procedure is as follows

if {\$ X1_bofore-\$ X1_ when>0｝ {

set dis [expr(\$ X1_ when-\$ X1_bofore-10)]}

if {\$ X1_bofore-\$ X1_ when0｝ {

set dis [expr(\$ Y1_ when-\$ Y1_bofore-10)]}

if {\$ Y1_bofore-\$ Y1_ when0｝ {

set dis [expr(\$ Z1_ when-\$ Z1_bofore-10)]}

if {\$ Z1_bofore-\$ Z1_ when

Related Topics