Section 1 Editing the Probe Point Program 1. Determine the origin and find the coordinate values of each probe point. First, determine the origin of the workpiece coordinate system in the UG software, then use the UG software to find the point (X Y Z) where the probe point is to be located, and record it for editing the probe point program. 2. Edit the probe point program (the name of the probe point program can be determined by yourself, such as: O6666). The probe point program controls the movement of the probe and requires calling two important probe operation programs O9810 and O9811. Probe point program format example: (The following is an example of programming the Z point probe) %O6666 (PROBE) G91 G28Z0 G90 G0 G17 G40 G49 G69 G80 M6T11 (The probe is installed on the T11 tool holder, and the T11 probe is replaced on the spindle) G90 G00 G54 X-18. Y50. (Quickly locate above the first point to be probed in the G54 coordinate system) M19 (S_ ) (Spindle positioning, S is to rotate the spindle an angle. If it is to probe a point in the Z axis direction, S is not needed. If it is to probe the side, S is needed, that is, to rotate the angle, so that the probe uses one surface of the probe ruby ball to measure when probing each side, reducing the error M05 M17 (open probe) (Open the probe, this instruction is determined by the corresponding port connected during wiring) G43Z50.H11 (Establish the tool length, i.e. read the probe length)
G90G00Z50. (The probe moves down quickly to the Z50. position) N1(Z+POINT1) (Measure the Z value of the first point)
G65P9810X-18. Y50. F3000. (Safely and quickly locate the XY position of the first point, the speed is F3000.)
G65P9810 Z19. (Safely and quickly locate to the safe Z position above the first point, the speed is the same as above, the height here is generally 3MM from the point to be measured below)
G65P9811Z16.08 (Safely and slowly reach the Z position of the first probe point. In addition, after this step of probing the point, it will automatically return to the position of Z19.0 in the previous step)
#601=#142 (#142 is the difference between the theoretical Z16.08 of the first probe point and the actual "Z" probed The value is automatically calculated in O9811 and then passed to #142. #142 passes the obtained value to #601. #601 is the value to be compensated for the first point in the Z direction)
G65P9810 Z20. (Move to the safe height Z20. safely and quickly)
N2(Z+POINT1) (Measure the Z value of the second point) G65P9810X-16.5 Y48.3 F3000. (Safely and quickly locate the XY position of the second point, the speed is F3000.)
G65P9810 Z17. (Safely and quickly locate to the safe Z position above the second point, the speed is the same as above, the height here is generally 3MM from the point to be measured below)
G65P9811Z14.23 (Safely and slowly reach the Z position of the second probe point. In addition, after this step, it will automatically return to the position of Z19.0 in the previous step)
#602=#142 #142 is the difference between the theoretical Z16.08 of the second probe point and the actual "Z real", which is automatically calculated in O9811 and then passed to #142. #142 then passes the obtained value to #601, and #601 is the value to be compensated for the second point in the Z direction) G65P9810 Z35. Safely and quickly move to the safe height Z20.) N3(Z+POINT1) (measure the Z value of the third point) G65P9810X12.5 Y51.1 F3000.G65P9810 Z19.G65P9811Z16.08#603=#142G65P9810 Z20. N4(Z+POINT1) (measure the Z value of the fourth point) G65P9810X12.2 Y49.2 F3000.G65P9810 Z16.G65P9811Z13.73#604=#142G65P9810 Z35................N16(Z+POINT1) (Measure the Z value of the sixteenth point) G65P9810X-16.5 Y-18.2 F3000.G65P9810 Z16.G65P9811Z14.23#616=#142G65P9810 Z35.(The following is to set the tolerance range for the difference Z of each detected point. If the tolerance is exceeded, jump to N20 for execution) #620=0.1 (Set the tolerance to 0.1 and assign it to #620) IF[ABS[#601]GT#620]GOTO20 (If the absolute value of #601 is greater than the value of #620, jump to N20) Execute at)
IF[ABS[#602]GT#620]GOTO20 (If the absolute value of #602 is greater than the value of #620, jump to N20 to execute) IF[ABS[#603]GT#620]GOTO20 (If the absolute value of #603 is greater than the value of #620, jump to N20 to execute)...............M18G91G28Z0M99 N20 #3000=99point cuo wu Z OUT OF TOL (Alarm prompt, Z exceeds tolerance, here "#3000=" can be set as 0-200 additional prompt information)G91G28Z0M99****************
Section 2 Editing the machining program Add the compensation value variables (#601#602 #603......) corresponding to each probe point to the coordinates of the corresponding point in the machining program. (Here we use the compensation Z value to explain. The principle of compensation in the X and Y directions is the same as that of compensation in the Z direction): (i.e., two points are directly connected, each with a Z value) From point A to point B, the compensation differences of probe points A and B are #601 and #602 respectively. If you want the tool to transition from A to B in general, you only need to add the Z compensation value variables of points A and B to the corresponding machining program. The following is the processing program: (taking compensation Z value as an example) O2222G91G28Z0G0G17G40G49G80G90(TOOL:1 DIA.OFF: 1 LEN:1 DIA:10.) T1M6G0G90G54X7.2503Y10.S10000M3 G43H1Z30.M8Z1.
Section 3 Quickly edit processing programs in EXCEL Sometimes you need to add variables to a multi-line program. If you add them one by one manually, it will be very troublesome, with a large workload and easy to make mistakes. The following is a method of using EXCEL to quickly edit programs. Change method: 1. First copy the program to which you want to add variables to Notepad, as shown below:
2. Replace X with "/X/", replace Y with "/Y/", and replace Z with "/Z/", as shown below:
3. Open EXCEL, open the file in step 2, and note that in the Open dialog box, select "All Files" as the file type, then open the file in the previous step, and the dialog box will appear as shown below:
4. Click Next, and the next dialog box will appear, as shown below:
5. Check "Other (0)" and enter the slash "/ ", as shown in the figure:
6. Then, select "Next", "Finish", open the file and complete, you can see that each part is separated, this is the effect you want, as shown in the figure:
7. Add Z and the number 16.31 to each line of the program, as shown in the figure
8. Manually add variables at the starting point and the end point. Since the point in the first line is the starting point, the variable should be the corresponding detected compensation value #601. The 14th line in the above figure is the end point, and the variable should be the corresponding detected compensation value #602. The variables of the above two points can be added manually, as shown in the figure:
9. Add variables to the middle point. To add the variables shown in Figure A above, the method is to first pull the brackets and plus signs to each middle line, and then enter the variables to be added in the middle point, such as #690*1, in the third line of the above figure.
(Here, the difference between the compensation value of the end point and the starting point is evenly distributed to N middle points. Here, it is divided into 12 sections, and its relationship is #690=[#602-#601] / 12 This relationship needs to be added to the program)
Then first pull down "#690*1" to achieve it, as shown below:
Then save the EXCEL as a text txt file, and then open it with Notepad, as shown below:
Delete the empty distance in the middle, and add its corresponding macro variable relationship #690=[#602-3602] /12 before the starting point as shown below





