My friend Zhou Weiquan, a senior engineer, has been engaged in CNC applications for more than 40 years and has done technology and processing of thousands of parts.
He once went to Japan to study CNC application technology and has published two monographs: "Development and Application of CNC Turning/Milling Macro Programs" and "CNC Turning and Milling of Threads" (published by Machinery Press).
He has many research results, which I will introduce one after another. Here is a general macro program that you can use.
After assigning values to 13 variables, they can be used directly. Interested friends can read the comments and compare the programming diagrams to understand how it is compiled. This is his third case.
The third result of Zhou Weiquan's research
General macro program for helical milling of cylindrical and tapered holes using various milling cutters
O101; (General macro program for spiral milling cylindrical holes and tapered holes with various milling cutters, the X-Y origin is set at the center of the hole, and the Z-axis origin is set at the upper end face of the workpiece)
N01 #100=_; (#100 is the diameter correction value during processing. When you want to increase the hole diameter, take a positive value, otherwise take a negative value. Theoretically, it is 0)
N02#1=a; (#1 represents the half cone angle of the cone, which is equal to 0 for a cylindrical hole)
N03#2=b; (#2 represents the major diameter of the cylinder or cone in the upper plane)
N04#11=h; (#11 represents the height of the cylinder or cone)
N05#3=c; (#3 represents the vertical layer spacing during milling)
N06#4=i; (#4 represents the step angle of step milling, which can be selected as appropriate)
N07#5=j; (#5 represents the Z value of the moving point, the initial value of this assignment is the air tangent distance above the top surface)
N08#7=d; (#7 represents the major diameter of the milling cutter D)
N09#18=r; (#18 represents the blade radius)
N10#19=s; (#19 represents spindle speed S)
N11#20=t; (#20 represents the tool length compensation number)
N12#21=u; (#21 is the code for clockwise/counterclockwise milling, take 3 for clockwise milling, and take 2 for counterclockwise milling)
N13#22=v; (#22 represents the amount of tool feed per minute)
N14#26=z; (#26 represents the Z coordinate value of the start position and end position of the milling cutter)
N21 #8=#18*[1-SIN[#1]];(#8 represents the Z-direction distance from the cutting point to the bottom surface of the milling cutter)
N22 #9=0;(#9 represents the moving angle, assign the initial value 0 in this section)
N23 #10=#2/2+[#5+#8]*TAN[#1]+#18*[1-COS[#1]]-#7/2+#100/2;(#10 represents The distance between the center line of the milling cutter and the center of the cone)
N24 #12=#3*#4/360;(#12 represents the distance of descent in each step)
N25 #13=#3*TAN[#1]; (#13 represents the difference between the radii of the two circles)
N26 #14=#13*#4/360;(#14 represents the radius reduction value at each step)
N27 G54 G94 G00 X0 Y0 Z#26; (Set the workpiece coordinate system, feed per minute, and the milling cutter translates to the starting point above the cone center)
N28 S#19 M03; (Spindle starts to rotate)
N29 G43 H#20 Z#5; (Let the milling cutter add the Z-direction length compensation value and then drop to the cutting starting plane)
N30 G#21X#10 R[#10/2] F#22; (The milling cutter turns half a turn in the horizontal plane to insert the cutter)
N31 WHILE [#5 GT -[#11+#8]] DO 1; (Loop head: if the conditions are met, loop execution between N32 and N38 segments)
N32 #9=#9+[#21*2-5]*#4; (In down milling/up milling, the moving angle is increased or decreased by one step angle respectively to prepare for one step of cutting)
N33 #10=#10-#14; (Recalculate the distance between the milling cutter center line and the cone center)
N34 #15=#10*COS[#9];(Recalculate the X coordinate value of the moving point)
N35 #16=#10*SIN[#9];(Recalculate the Y coordinate value of the moving point)
N36 G#21
N37 #5=#5-#12;(Recalculate the Z coordinate value of the moving point)
N38 END 1; (end of loop: if the conditions are met, loop execution between N14 and N19 segments)
N39 #9=#9+[#21*2-5]*#4; (During down milling/up milling, the moving angle is increased or decreased by one step angle respectively to prepare for a full circle of horizontal milling)
N40 #10=#2/2-#11*TAN[#1]+#18*[1-COS[#1]]-#7/2+#100/2; (calculate the bottom milling cutter center line and taper distance between hearts)
N41 G#21
N42I[-#10*COS[#9]] J[-#10*SIN[#9]]; (mill a complete circle horizontally in the end plane)
N43G00 X0 Y0; (The milling cutter translates to coincide with the cone center line)
N44G49 Z#26; (The milling cutter cancels the length compensation and rises to #26 above the taper plane)
N45M05; (Spindle stalled)
N46M30;
Below are three types of milling cutter diagrams for milling cylindrical holes and tapered holes.
picture
Below is a diagram for programming.
picture
Example:
The following is an application example of this general macro program: using a ball nose cutter to mill a tapered bottom hole with an NPT0.5 internal thread and an inverted 120-degree angle.
picture
The following is the specific assignment of the tapered bottom hole and the inverted 120-degree angle for milling NPT0.5 internal threads.
%
O102; (Assignment of spiral milling NPT0.5 threaded conical bottom hole with φ10 ball end milling cutter, X-Y origin is set at the center of the hole, and Z-axis origin is set at the upper end face of the workpiece)
N01#100=_; (#100 is the diameter correction value during processing. When you want to increase the hole diameter, take a positive value, otherwise take a negative value. Theoretically, it is 0)
N02 #1=1.79; (#1 represents the half cone angle of the cone, which is equal to 0 for a cylindrical hole)
N03 #2=18.321;(#2 represents the major diameter of the cylinder or cone in the upper plane)
N04 #11=15; (#11 represents the height of the cylinder or cone)
N05 #3=0.5; (#3 represents the vertical layer spacing during milling)
N06 #4=30; (#4 represents the step angle of step milling, which can be selected as appropriate)
N07 #5=0.5; (#5 represents the Z value of the moving point, the initial value of this assignment is the air tangent distance above the top surface)
N08 #7=10; (#7 represents the major diameter of the milling cutter D)
N09 #18=5; (#18 represents the blade radius)
N10 #19=1500; (#19 represents spindle speed S)
N11 #20=1; (#20 represents the tool length compensation number)
N12 #21=2; (#21 is the code for clockwise/counterclockwise milling, take 3 for clockwise milling, and take 2 for counterclockwise milling)
N13 #22=50; (#22 represents the amount of tool feed per minute)
N14 #26=100; (#26 represents the Z coordinate value of the start position and end position of the milling cutter)
…
%
%
O103; (Assignment of 120-degree chamfer for spiral milling NPT0.5 thread with φ10 ball end milling cutter, X-Y origin is at the center of the hole, and Z-axis origin is set at the upper end face of the workpiece)
N01#100=_; (#100 is the diameter correction value during processing. When you want to increase the hole diameter, take a positive value, otherwise take a negative value. Theoretically, it is 0)
N02 #1=60; (#1 represents the half cone angle of the cone, which is equal to 0 for a cylindrical hole)
N03 #2=22.321;(#2 represents the major diameter of the cylinder or cone in the upper plane)
N04 #11=1.8; (#11 represents the height of the cylinder or cone)
N05 #3=0.2; (#3 represents the vertical layer spacing during milling)
N06 #4=30; (#4 represents the step angle of step milling, which can be selected as appropriate)
N07 #5=0.25; (#5 represents the Z value of the moving point, the initial value of this assignment is the air tangent distance above the top surface)
N08 #7=10; (#7 represents the major diameter of the milling cutter D)
N09 #18=5; (#18 represents the blade radius)
N10 #19=1500; (#19 represents spindle speed S)
N11 #20=1; (#20 represents the tool length compensation number)
N12 #21=2; (#21 is the code for clockwise/counterclockwise milling, take 3 for clockwise milling, and take 2 for counterclockwise milling)
N13 #22=50; (#22 represents the amount of tool feed per minute)
N14 #26=100; (#26 represents the Z coordinate value of the start position and end position of the milling cutter)
…
%





