Method for milling regular polygon in numerical control turning center
By designing macro programs in the CNC turning system, the processing and arc transition of polygons of different shapes is automatically realized, which solves the problems of cumbersome and error-prone parts processing and programming in the existing technology, and achieves an efficient and accurate machining process.
Patent Information
- Application Number
- CN202411662267.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-07
AI Technical Summary
When processing parts of different shapes, materials and processing allowances, existing CNC turning technology requires frequent rewriting of CNC programs and calculating various coordinate points. The process is cumbersome and prone to errors.
Using the FANUC CNC operating system, the design macro program defines the dimensions in the part diagram with variables, and expresses the coordinate point relationship through mathematical calculations, automatically realizes the processing and arc transition of polygons in different shapes, and incorporates the tool radius compensation function to simplify the programming process.
There is no need to rewrite the CNC program, and no need to calculate coordinate points before programming. The whole process is simple and accurate, improving work efficiency and ensuring product quality.
Smart Images

Figure CN119566379A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of numerical control turning, and in particular relates to a method for milling regular polygons in a numerical control turning center. Background Art
[0002] Compared with ordinary fasteners, aviation fasteners have the characteristics of diverse structures, high strength, light weight, and rich material categories. Most of the square and hexagonal wrench-type nuts and bolts processed in the existing technology are processed by milling. Due to the wide variety of products, different sizes and materials, each time a different product is processed, the CNC program needs to be rewritten, and each coordinate point needs to be calculated before programming. The whole process is time-consuming, labor-intensive, and prone to errors. Summary of the invention
[0003] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide a method for milling regular polygons in a CNC turning center, which does not require rewriting the CNC program for processing different products, does not require calculating each coordinate point before programming, and the whole process is simple and error-free.
[0004] The purpose of the present invention and the solution of its main technical problems are achieved by adopting the following technical solutions: A method for milling regular polygons in a CNC turning center of the present invention is characterized by comprising the following steps: 1) Select CNC operating system: The CNC operating system used is FANUC's turning center; 2) Macro programming: Define the dimensions that need to be guaranteed in the part drawing with variables, and express the relationship between the variables and the coordinate points during machine tool processing with a mathematical calculation process. Change the variable address C assignment to automatically realize the processing of polygons of different shapes. Change the variable address B assignment to automatically realize the transition of arcs of any size at the sharp corners of the polygon. Change the variable address A assignment, H assignment, and Q assignment to automatically realize radial layered processing. When A and H are set equal, it is a one-time processing without layering. Layered processing is mainly used for large-sized parts or when the cutting allowance is large due to material substitution. Change the variable address K assignment and S assignment to select different cutting amounts according to different processing materials. Change the variable address R assignment to select milling cutters of different specifications. Change the variable address T assignment to determine the axial size of the polygon. The tool radius compensation function is incorporated into the macro program. By modifying the tool radius compensation value, the dimensional accuracy is adjusted. The use process is very convenient. Add a regular polygon milling macro program, enter the macro program into the machine tool, and start the power milling cutter to perform linkage interpolation feeding of the X-axis and C-axis. 3) Select the tool: Equipped with at least one axial power tool; 4) Select the milling cutter: Purchase standard end mills; 5) Processing: The parts are processed according to the general processing technology, and the regular polygon parts are processed using macro programs.
[0005] Compared with the prior art, the present invention has obvious beneficial effects. From the above technical scheme, it can be known that: the numerical control operating system used is a FANUC turning center; the dimensions that need to be guaranteed in the part drawing are defined by variables, and the relationship between the variables and the coordinate points during machine tool processing is expressed in the form of a mathematical calculation process. The variable address C assignment is changed to automatically realize the processing of different polygons, the variable address B assignment is changed to automatically realize the transition of arcs of any size at the sharp corners of the polygon, the variable address A assignment, H assignment, and Q assignment are changed to automatically realize radial layered processing. When A and H are set equal, it is a one-time processing without layering. Layered processing is mainly used for large-sized parts or when the cutting allowance is large due to material substitution. The variable address K assignment and S assignment are changed, and different cutting amounts are selected according to different processing materials. The variable address R assignment is changed to select milling cutters of different specifications. The variable address T assignment is changed to determine the axial size of the polygon. The tool radius compensation function is programmed into the macro program. By modifying the tool radius compensation value, the dimensional accuracy is adjusted. The use process is very convenient. The regular polygon milling macro program is added. The macro program is entered into the machine tool to start the power milling cutter to perform the linkage interpolation feed of the X-axis and C-axis; equipped with at least one axial power tool; purchase a standard end mill; according to the general processing technology, the regular polygon part uses the macro program. Through the compilation of the macro program, the programming of the more cumbersome and error-prone links of parts with different shapes, different materials and different processing allowances is simplified, thereby effectively improving the programming efficiency and ensuring a stable quality state. The differences in the processed parts are: 1. The number of polygon sides is different, including triangles, quadrilaterals, hexagons, etc. 2. The materials of the parts are different, including aluminum alloy, carbon steel, titanium alloy, stainless steel, high-temperature alloy, etc. The choice of cutting amount is different for different processed materials. 3. Different processing allowances have different process methods. When the allowance is small, the processing is completed in one pass. When the allowance is large, layered rough and fine processing is required. Since the processed product has other structural features, other structural features are normally edited according to the general processing technology. When processing to the polygon milling step, a calling program instruction segment is written in the main program. The calling program instruction segment can assign variables and call the macro program at the same time. The specific polygon size corresponding to each variable is defined by the program editor. Set the variable parameters and give special meanings. The coordinate points that need to be defined or calculated in the part drawing are represented by variables. The relationship between variables is represented by mathematical formulas. For parts with different shapes, different materials and different processing allowances, only the corresponding variables need to be modified to automatically generate the corresponding processing program. The meaning of each variable: Through the assignment of variables (changing the assignment of address C), the processing of different polygons can be automatically realized, such as triangles, squares, pentagons, hexagons, etc. Through the assignment of variables (changing the assignment of address B), the transition of arcs of any size at the sharp corners of the polygon can be automatically realized.The common hexagonal milling program processes one plane at a time, and the spindle clamps the raw material and rotates 60° each time. The six processed planes are combined into a hexagon. Therefore, burrs are easily generated at the intersection of each plane, which brings processing difficulty and burden to the subsequent process. The macro program of the present invention incorporates the hexagonal sharp corner rounding instruction, and the processed product directly avoids the generation of burrs. Through variable assignment (changing address A assignment, H assignment, Q assignment), radial layered processing can be automatically realized. For large-sized parts or when the cutting allowance is large due to material substitution, layered processing (see. Figure 1 ) instructions can achieve the effect of rough and fine machining, ensure dimensional stability while obtaining good surface roughness, and avoid work hardening defects caused by excessive cutting thickness. Change the variable address K assignment and S assignment, select different cutting amounts according to different processing materials, change the variable address R assignment, select milling cutters of different specifications, change the variable address T assignment, and determine the axial size of the polygon. The tool radius compensation function is incorporated into the macro program of the present invention. The dimensional accuracy can be adjusted by modifying the tool radius compensation value, and the use process is very convenient. The development of regular polygon milling macro programs is conducive to the solidification and management of CNC programs, and avoids the situation where the same type of products have diverse programs, uneven processing efficiency, and unstable processing quality.
[0006] Representation of FANUC system variables A variable is composed of the symbol # followed by the variable number, that is: #i (i=1, 2, 3, ...) For example: #5 #109 #1005 It can also be expressed in the form of #<expression>, such as: #[#100] #[#1001-1] #[#6 / 2] Introduction to operation instructions: Various operations can be performed between variables, and between variables and constants. The operators that can be used are: + (sum), - (subtraction), * (product), / (quotient), SIN (sine), COS (cosine), TAN (tangent), ATAN (inverse tangent), SQRT (square root), ABS (absolute value), etc.
[0007] The correspondence between FANUC macro program addresses and variable numbers: address variable address variable A #1 B #2 C #3 D #7 E #8 F #9 H #11 I #4 J #5 K #6 M #13 Q #17 R #18 S #19 T #20 U #21 V #22 W #23 X #24 Y #25 Z #26 Macro program control instructions The following control instructions can control the program flow of the macro program: WHILE [<condition>] DOm(m=1,2,3) … END m When <condition> is established, the program segment from "DO m" to "END m" is repeatedly executed; If the <conditional expression> is not satisfied, the program will be executed from the next block after "END m".
[0008] There are the following types of <Conditional>: #j EQ #k (whether #j = #k) #j NE #k (whether #j ≠ #k) #j GT #k (Is #j > #k) #j LT #k (Is #j < #k) #j GE #k (Is #j ≥ #k) #j LE #k (whether #j ≤ #k) Mathematical processing before programming (the following is the mathematical calculation process), see Figure 2 ; The regular hexagon is placed in the coordinate system as Figure 2 As shown: To process the upper right corner of the hexagon, you need to use variables to represent the X and C coordinate values of point 6 and point 7, and double the X coordinate (a requirement for turning center programming). When programming, use straight line and circular arc instructions for interpolation processing.
[0009] Coordinate calculation of point 7: (1) Calculation of the X coordinate of point 7: #8=#4 Line 15 = #1 / COS[#8] Line segment 45 = #2 / COS[#8] Segment 14 = Segment 15 - Segment 45 Segment 12 = Segment 14 * COS[#4] Line segment 23 = #2* COS[#4-#8] Therefore, the X coordinate of point 7 is: (segment 12 + segment 23) * 2 (1) Calculation of the C coordinate of point 7: Segment 24 = Segment 14 * sin[#4] Therefore, the C coordinate of point 7 is: #2* sin[#4-#8]+line segment 24 Calculation of coordinates of point 6: (1) Calculation of the X coordinate of point 6: Line segment 86 = #2* COS[#4+#8] Therefore, the X coordinate of point 6 is: (line segment 12 + line segment 86) * 2 (2) Calculation of the C coordinate of point 6: Line segment 84 = #2* sin[#4+#8] Therefore, the C coordinate of point 6 is: line segment 24 + line segment 84 After calculating the coordinates of one corner of the hexagon, the coordinates of the remaining corners are automatically calculated by the CNC system using macro program variable loops. Calculation and interpolation processing are performed simultaneously to produce a complete hexagon.
[0010] Compilation of macro program for regular hexagon milling in turning center: Macro program call instruction segment: % O5555 T0101 G65P8000A4.96B0.05C6J2500K300H0.3Q4.96R8S2000T7.3 M99 M30 % Notes: O5555 Program name T0101 is the milling cutter number; G65: modal call; P: Call macro program command (P8000 means calling macro program No. 8000); A: The size of the hexagon to be processed along the X direction (according to the process file, the hexagonal opposite side size is required to be 9.92mm, so the value is half of the hexagonal size, set to A4.96); B: is the transition radius of the hexagonal corner arc (set the hexagonal corner chamfer size according to the hexagonal diagonal size requirements in the process file); C: the number of faces of the processed product’s regular polyhedron (C6 means a regular hexagonal structure); J: feed and retract; K: feed rate during milling; H: finishing allowance during layered machining; Q: The first cutting value during layered processing; R: milling cutter diameter; S: milling cutter speed; T: Axial length of the milled square (set according to the axial length of the hexagonal structure required by the process document); General macro program: % O8000 (program name) M14 (Start C axis) G28C0 (C-axis return to zero) M103S#19 (power milling cutter forward rotation) #4=360 / #3 / 2 (calculate the starting angle) #7=360+#4 (calculate the end angle) #8=#4 (value transfer) #13=360 / #3 (angle increment) G0G40X[#1 / COS[#4]*2+#18+4.0]Z10.0 (fast positioning) Z-#20 (Quick Positioning) G112 (Start polar coordinate interpolation function) WHILE[#1GE#17]DO2 (loop statement) #4=360 / #3 / 2 (angle calculation) WHILE[#4LE#7]DO1 (loop statement) #500=#2*SIN[#4-#8] (mathematical calculation processing) #501=#2*COS[#4-#8] (mathematical calculation processing) #502=#1 / COS[#8] (mathematical calculation processing) #503=#2 / COS[#8] (mathematical calculation processing) #504=#502-#503 (mathematical calculation processing) #505=#504*COS[#4] (mathematical calculation processing) #506=#504*SIN[#4] (mathematical calculation processing) #507=#505+#501 (mathematical calculation processing) #508=#506+#500 (mathematical calculation processing) #509=#2*SIN[#4+#8] (mathematical calculation processing) #510=#2*COS[#4+#8] (mathematical calculation processing) #511=#505+#510 (mathematical calculation processing) #512=#506+#509 (mathematical calculation processing) G1G94G42X[#507*2]C#508F#6 (Set tool radius compensation linear interpolation) G3X[#511*2]C#512R#2 (circular interpolation) #4=#4+#13 (angle increasing) END1 (End statement) G1G40U4.0H[#18 / 2+3.0]F#5 (Cancel tool radius compensation and linear interpolation retraction) X[#1 / COS[#8]*2+#18+5.0]C0 (Linear interpolation retraction) #1=#1-#11 (Layered processing) END2 (end statement) G113 (turn off polar coordinate interpolation function) G0Z40.0 (Z-axis retraction) X40.0 (X-axis retract) M105 (power milling cutter stop) M15 (Close C axis) M99 (subroutine ends and returns) % The present invention solves the problem of repeated programming for parts of different shapes, different materials and different machining allowances through a method for milling regular polygons in a turning center, avoids programming in a relatively cumbersome and error-prone manner, greatly improves work efficiency and ensures product quality. The present invention incorporates polygon corner rounding instructions into a macro program, and the processed product is free of burrs. The present invention is aimed at the case where the machining allowance is large, and the macro program can automatically perform radial layered processing (see Figure 1 ), can achieve the effect of rough and fine machining, ensure dimensional accuracy while obtaining good surface roughness, and avoid work hardening defects caused by excessive cutting depth. The development of regular polygon milling macro programs is conducive to the solidification of CNC programs, avoiding the occurrence of diverse programs for the same type of products, high processing efficiency, and good processing quality. In short; the present invention does not need to rewrite CNC programs for processing different products, and does not need to calculate each coordinate point before programming. The whole process is simple and error-free. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is the excess removal diagram of layered milling of the present invention; Figure 2 It is a mathematical processing diagram before programming of the present invention. DETAILED DESCRIPTION
[0012] The specific implementation methods, structures, features and functions of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0013] Example 1 A method for milling regular polygons in a CNC turning center of the present invention is characterized by comprising the following steps: 1) Select CNC operating system: The CNC operating system used is FANUC's turning center; 2) Macro programming: Define the dimensions that need to be guaranteed in the part drawing with variables, and express the relationship between the variables and the coordinate points during machine tool processing in the form of a mathematical calculation process. Change the variable address C assignment to automatically realize the processing of polygons of different shapes. Change the variable address B assignment to automatically realize the transition of arcs of any size at the sharp corners of the polygon. Change the variable address A assignment, H assignment, and Q assignment to automatically realize radial layered processing. When A and H are set equal, it is a one-time processing without layering. Layered processing is mainly used for large-sized parts or when the cutting allowance is large due to material substitution. Change the variable address K assignment and S assignment to select different cutting amounts according to different processing materials. Change the variable address R assignment to select milling cutters of different specifications. Change the variable address T assignment to determine the axial size of the polygon. The tool radius compensation function is included in the macro program. By modifying the tool radius compensation value, the dimensional accuracy is adjusted. The use process is very convenient. Add a regular polygon milling macro program, enter the macro program into the machine tool, and start the power milling cutter to perform linkage interpolation feeding of the X-axis and C-axis; 3) Select the tool: Equipped with at least one axial power tool; 4) Select the milling cutter: Purchase standard end mills; 5) Processing: The parts are processed according to the general processing technology, and the regular polygon parts are processed using macro programs.
Claims
1. A method for milling regular polygons in a CNC turning center, characterized in that: The steps include: 1) Select CNC operating system: The CNC operating system used is FANUC's turning center; 2) Macro programming: Define the dimensions that need to be guaranteed in the part drawing with variables, and express the relationship between the variables and the coordinate points during machine tool processing with a mathematical calculation process. Change the variable address C assignment to automatically realize the processing of polygons of different shapes. Change the variable address B assignment to automatically realize the transition of arcs of any size at the sharp corners of the polygon. Change the variable address A assignment, H assignment, and Q assignment to automatically realize radial layered processing. When A and H are set equal, it is a one-time processing without layering. Layered processing is mainly used for large-sized parts or when the cutting allowance is large due to material substitution. Change the variable address K assignment and S assignment to select different cutting amounts according to different processing materials. Change the variable address R assignment to select milling cutters of different specifications. Change the variable address T assignment to determine the axial size of the polygon. The tool radius compensation function is included in the macro program. By modifying the tool radius compensation value, the dimensional accuracy is adjusted. The use process is very convenient. Add a regular polygon milling macro program, enter the macro program into the machine tool, and start the power milling cutter to perform linkage interpolation feeding of the X-axis and C-axis. 3) Select the tool: Equipped with at least one axial power tool; 4) Select the milling cutter: Purchase standard end mills; 5) Processing: The parts are processed according to the general processing technology, and the regular polygon parts are processed using macro programs.
Citation Information
Patent Citations
Rough milling and finish turning combined processing method of nonmetal large-lead trapezoidal threads
CN109719462A
Method for processing ellipses by macro-program modular programming of Fanuc system
CN111190389A
Method for turning tensile samples of different feeding profiles by using macro program=
CN111804932A
Arc groove machining method
CN112620757A
Automatic measurement method and batch compensation processing method for processing waveguide slot
CN115562162A