Three-axis numerical control milling machine tool path generation method and equipment based on elevation fitting and medium

Through the three-axis CNC milling machine tool path generation method based on elevation fitting, the problem of tool path generation in customized production is solved, and fast and accurate tool path generation is achieved, processing efficiency and quality is improved, the processing of complex workpieces is supported, and production automation is promoted.

CN120335392APending Publication Date: 2025-07-18FOSHAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510287758.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When facing customized online production, the existing CNC milling machine programming method requires a large number of experienced personnel and resources, and cannot quickly generate unique models, resulting in long production cycles and high costs.

Method used

The three-axis CNC milling machine tool path generation method based on elevation fit is adopted. By reconstructing the XY plane equidistant grid of the model to be processed, a two-dimensional matrix of the model and cutting surface elevation is established, the fitting height of the processing reference path is calculated, and an accurate machining tool path is generated.

Benefits of technology

It realizes rapid and precise tool path generation, improves processing efficiency and quality, reduces material waste, reduces production costs, supports the processing of complex workpieces, and promotes production automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335392A_ABST
    Figure CN120335392A_ABST
Patent Text Reader

Abstract

The invention discloses a three-axis numerical control milling machine tool path generation method and equipment based on elevation fitting and a medium, and relates to the technical field of numerical control milling machine tool path generation. The three-axis numerical control milling machine tool path generation method based on elevation fitting comprises the steps that according to a to-be-machined workpiece model and machining precision, an XY plane equidistant grid of the to-be-machined workpiece model is reconstructed; a model elevation two-dimensional matrix of the to-be-machined workpiece model is established in the Z-axis direction; a machining cutter model is constructed, and a cutting surface elevation two-dimensional matrix of the machining cutter model is established in the Z-axis direction according to the intervals of the XY plane equidistant grids; according to the boundary square frame of the to-be-machined workpiece model, a machining reference path is established; according to the model elevation two-dimensional matrix and the cutting surface elevation two-dimensional matrix, respectively calculating the fitting height of each calculation point in the processing reference path; and integrating the fitting heights of all the calculation points in the machining reference path to form a machining tool path. By adopting the method, the tool path can be quickly generated for different workpieces to be machined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tool path generation for numerically controlled milling machines, and particularly to a method, device, and medium for generating tool paths for three-axis numerically controlled milling machines based on elevation fitting. Background Art

[0002] Numerical control machining refers to a machining process method for machining parts on numerically controlled machine tools. A machining method that controls the displacement of parts and tools with digital information is an effective way to solve problems such as variable part varieties, small batch sizes, complex shapes, high precision, etc., and to achieve high-efficiency and automated machining. A numerically controlled milling machine is a type of numerically controlled machine tool. Corresponding to a traditional milling machine, a numerically controlled milling machine completes machining through numerical control programming.

[0003] During the machining process of a numerically controlled milling machine, the preparation of the numerical control machining program is an important link. Existing processes usually use three-dimensional design software for product model design, and then use manual (human) programming or professional software for automatic programming to complete the preparation of the numerical control machining program. Regardless of the programming method used, it requires personnel with rich numerical control programming experience to lead, consumes a certain amount of time and materials, and is verified through trial machining on the numerically controlled milling machine. For batch processing, it is still acceptable to manufacturers.

[0004] Driven by the wave of intelligent manufacturing, with the continuous transformation and upgrading of industries, people's consumption willingness and quality are constantly improving, and the online customized consumption model has gradually become a new trend. The new challenge brought by online customization is that each commodity may be a unique model. If the existing numerical control programming and debugging methods are used, a large number of numerically controlled programming personnel with rich experience, a large number of equipment and experimental consumables, and a long production cycle are required to meet the production and processing requirements, which obviously cannot meet this emerging business model.

[0005] Therefore, it is urgent to design a method, device, and medium for generating tool paths for three-axis numerically controlled milling machines based on elevation fitting to solve the above problems. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a method, device, and medium for generating tool paths for three-axis numerically controlled milling machines based on elevation fitting, which can quickly generate tool paths for different workpieces to be machined.

[0007] To solve the above technical problems, the present invention provides a method for generating a tool path of a three-axis CNC milling machine based on elevation fitting, including: reconstructing an equidistant grid of the XY plane of the workpiece model to be machined according to the workpiece model to be machined and the machining accuracy; establishing a two-dimensional matrix of the model elevation of the workpiece model to be machined along the Z-axis direction; constructing a machining tool model, and establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model along the Z-axis direction according to the spacing of the equidistant grid of the XY plane; establishing a machining reference path according to the boundary box of the workpiece model to be machined; calculating the fitting height of each calculation point in the machining reference path according to the two-dimensional matrix of the model elevation and the two-dimensional matrix of the cutting surface elevation; integrating the fitting heights of all calculation points in the machining reference path to form a machining tool path.

[0008] As an improvement of the above solution, the step of reconstructing the equidistant grid of the XY plane of the workpiece model to be machined according to the workpiece model to be machined and the machining accuracy includes: obtaining the boundary box of the workpiece model to be machined; calculating the defined ranges of the X-axis and Y-axis of the workpiece model to be machined according to the boundary box; calculating the common integral multiple of the step intervals; comparing the step intervals with the machining accuracy to determine whether the step intervals are greater than the machining accuracy; if the determination is yes, reducing the step intervals by an integral multiple until the step intervals are less than the machining accuracy; if the determination is no, reconstructing the equidistant grid of the XY plane of the workpiece model to be machined according to the step intervals.

[0009] As an improvement of the above solution, the step of establishing a two-dimensional matrix of the model elevation of the workpiece model to be machined along the Z-axis direction includes: respectively calculating the X coordinates and Y coordinates of each grid point on the equidistant grid of the XY plane; projecting each grid point onto the workpiece model to be machined along the Z-axis direction according to the X coordinates and Y coordinates to form a plurality of Z coordinates corresponding to the grid points on the workpiece model to be machined; taking the maximum Z coordinate among the plurality of Z coordinates corresponding to the grid points as the elevation data of the corresponding grid point; establishing a two-dimensional matrix of the model elevation of the workpiece model to be machined according to the elevation data of each grid point.

[0010] As an improvement of the above solution, the step of constructing a machining tool model and establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model along the Z-axis direction according to the spacing of the equidistant grid of the XY plane includes: constructing a machining tool model according to the parameters of the machining tool; taking the lowest point of the Z-axis center of the machining tool model as the three-dimensional zero point of the machining tool model, and establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model according to the spacing of the equidistant grid of the XY plane.

[0011] As an improvement of the above solution, the step of establishing the two-dimensional matrix of the cutting surface elevation of the machining tool model according to the spacing of the equidistant grid in the XY plane includes: respectively calculating the X coordinate and Y coordinate of each grid point on the equidistant grid in the XY plane; according to the X coordinate and Y coordinate, project each grid point onto the machining tool model along the Z-axis direction to form a plurality of Z coordinates corresponding to the grid points on the machining tool model; use the maximum Z coordinate among the plurality of Z coordinates corresponding to the grid points as the elevation data of the corresponding grid point; establish the two-dimensional matrix of the cutting surface elevation of the machining tool model according to the elevation data of each grid point.

[0012] As an improvement of the above solution, the step of establishing the machining reference path according to the boundary rectangle of the workpiece model to be machined includes: S201, taking one coordinate axis in the XY plane as the main axis and the other coordinate axis in the XY plane as the secondary axis; S202, obtaining the boundary rectangle of the workpiece model to be machined; S203, calculating the maximum coordinate of the main axis, the minimum coordinate of the main axis, the maximum coordinate of the secondary axis, and the minimum coordinate of the secondary axis of the boundary rectangle in the XY plane; S204, taking the position of the minimum coordinate of the main axis and the minimum coordinate of the secondary axis as the initial reference point; S205, keeping the coordinate of the secondary axis unchanged, and gradually adjusting the coordinate of the main axis from the minimum coordinate of the main axis to the maximum coordinate of the main axis according to the preset step length to form a new reference point; S206, increasing the coordinate of the secondary axis by the preset step length; S207, judging whether the coordinate of the secondary axis is greater than the maximum coordinate of the secondary axis. If the judgment result is no, keep the coordinate of the secondary axis unchanged, and gradually adjust the coordinate of the main axis from the maximum coordinate of the main axis to the minimum coordinate of the main axis according to the preset step length to form a new reference point, and then increase the coordinate of the secondary axis by the preset step length and return to step S205. If the judgment result is yes, record all the reference points in sequence as path point sequences to establish the machining reference path.

[0013] As an improvement of the above solution, the step of respectively calculating the fitting height of each calculation point in the machining reference path according to the two-dimensional matrix of the model elevation and the two-dimensional matrix of the cutting surface elevation includes: sequentially accessing each calculation point of the machining reference path according to the path point sequence of the machining reference path; respectively obtaining a local two-dimensional matrix with the same scale as the two-dimensional matrix of the cutting surface elevation in the two-dimensional matrix of the model elevation according to the X coordinate and Y coordinate of the calculation point; calculating the fitting height of each calculation point according to the local two-dimensional matrix and the two-dimensional matrix of the cutting surface elevation.

[0014] As an improvement of the above solution, the step of integrating the fitting heights of all calculation points in the machining reference path to form a machining tool path includes: generating an initial machining instruction sequence according to the model of the machine tool; generating a G00 instruction to move the machining tool to a machining safety point; setting the safe machining depth of a single instruction when generating the instruction; generating machining instructions for the machining path point sequence sequentially using a G01 sequence according to the fitting height; generating an instruction to restore the machine machining state at the end of the tool path according to the model of the machine tool; and generating a G00 instruction to move the machining tool back to the machining safety point at the end of the tool path.

[0015] The present invention also discloses a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.

[0016] The present invention also discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0017] The beneficial effects of implementing the present invention are as follows:

[0018] The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting of the present invention can efficiently complete the generation of an accurate tool path and quickly generate a tool path for different workpieces to be machined through grid reconstruction, establishing a two-dimensional matrix, and establishing a machining reference path.

[0019] Furthermore, the method for generating a tool path of a three-axis CNC milling machine based on elevation fitting of the present invention realizes high-precision machining, improves the machining quality, and ensures the consistency between the machining result and the design model by ensuring that the distance between adjacent points in the X-axis and Y-axis directions of the XY-plane equidistant grid is less than the machining accuracy. Description of the Drawings

[0020] Figure 1 It is a flowchart of an embodiment of the method for generating a tool path of a three-axis CNC milling machine based on elevation fitting of the present invention;

[0021] Figure 2 It is a schematic diagram of the boundary box of the workpiece model to be machined in the method for generating a tool path of a three-axis CNC milling machine based on elevation fitting of the present invention;

[0022] Figure 3 It is an effect diagram after the XY-plane equidistant grid reconstruction of the workpiece model to be machined when viewed from the Z-axis direction in the method for generating a tool path of a three-axis CNC milling machine based on elevation fitting of the present invention;

[0023] Figure 4 It is a schematic diagram of the tool parameters of a flat-end milling cutter in the method for generating a tool path of a three-axis CNC milling machine based on elevation fitting of the present invention;

[0024] Figure 5Schematic diagram of the tool parameters of the taper ball nose cutter in the tool path generation method of the three-axis CNC milling machine based on elevation fitting of the present invention;

[0025] Figure 6 Flowchart of an embodiment for establishing a machining reference path according to the boundary box of the workpiece model in the tool path generation method of the three-axis CNC milling machine based on elevation fitting of the present invention. Detailed implementation manners

[0026] To make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. It should be noted that the orientation terms such as up, down, left, right, front, back, inner, and outer that appear or will appear in the present invention are only based on the accompanying drawings of the present invention, and they do not specifically limit the present invention.

[0027] See Figure 1 , Figure 1 which shows the flowchart of an embodiment of the tool path generation method of the three-axis CNC milling machine based on elevation fitting of the present invention, including:

[0028] S101. Reconstruct the equidistant grid of the XY plane of the workpiece model to be machined according to the workpiece model to be machined and the machining accuracy;

[0029] It should be noted that when reconstructing the equidistant grid of the XY plane of the workpiece model to be machined, it is necessary to ensure that the distance between adjacent points in the X-axis and Y-axis directions in the equidistant grid of the XY plane is less than the machining accuracy. The specific steps include:

[0030] (1) Obtain the boundary box of the workpiece model to be machined;

[0031] As Figure 2 shown, Figure 2 the dashed box in MAX is the boundary box. The maximum coordinate X of the X-axis of the workpiece model to be machined, X MIN , the minimum coordinate X of the X-axis, X MAX , the maximum coordinate Y of the Y-axis, Y MIN , the minimum coordinate Y of the Y-axis, Y MAX , the maximum coordinate Z of the Z-axis, Z MIN and the minimum coordinate Z of the Z-axis, Z

[0032] (2) Calculate the defined ranges of the X-axis and Y-axis of the workpiece model to be machined according to the boundary box;

[0033] Specifically, the defined range X of the X-axis, X Interval is:

[0034] X Interval = X MAX - X MIN

[0035] Similarly, the defined range of the Y-axis is Y Interval is:

[0036] Y Interval = Y MAX - Y MIN

[0037] (3) Calculate the step interval of the common integral multiple according to the defined range;

[0038] Since the X, Y, and Z values in the three-dimensional space of the workpiece model to be processed are all floating-point numbers, multiply X Interval , Y Interval meeting the machining accuracy by 10 n times, where the value of n can be determined according to the machining accuracy;

[0039] X Interval and Y Interval are multiplied by 10 n times, and after converting to integers, calculate the greatest common divisor XY Interval of X Interval and Y Step , then reduce XY Step by 10 n times to obtain the real value of the step size, that is, XY Step / 10 n = step interval;

[0040] (4) Compare the step interval with the machining accuracy to determine whether the step interval is greater than the machining accuracy;

[0041] (5) If the judgment is yes, then reduce the step interval by an integral multiple until the step interval is less than the machining accuracy;

[0042] (6) If the judgment is no, reconstruct the XY-plane equidistant grid of the workpiece model to be processed according to the step interval (see Figure 3 ).

[0043] Let the machining accuracy be M accuracy , if XY Step / 10 n > M accuracy , iteratively decrease XY Step , until XY Step / 10 n > M accuracy ;

[0044] S102. Establish a two-dimensional matrix of the model elevation of the workpiece model to be processed along the Z-axis direction;

[0045] Furthermore, the step of establishing the two-dimensional matrix of the model elevation of the workpiece model to be processed along the Z-axis direction includes:

[0046] (1) Calculate the X coordinate and Y coordinate of each grid point on the equidistant grid in the XY plane respectively;

[0047] (2) Project each grid point onto the workpiece model to be machined along the Z-axis direction according to the X coordinate and Y coordinate, so as to form a plurality of Z coordinates corresponding to the grid points on the workpiece model to be machined;

[0048] Specifically, taking the lower left corner of the XY plane of the boundary box of the workpiece model to be machined as the zero point, map and construct the two-dimensional matrix of the model elevation. The mapping method is to subtract the corresponding XY coordinates of the coordinate points in the workpiece model to be machined from the XY coordinates of the boundary box and divide by XY Step , to obtain the XY subscripts of the two-dimensional matrix of the model elevation; then, store the Z coordinate at the XY position of the coordinate points in the workpiece model to be machined into the corresponding Z subscript of the XY subscript of the two-dimensional matrix of the model elevation.

[0049] (3) Take the maximum Z coordinate among the plurality of Z coordinates corresponding to the grid points as the elevation data of the corresponding grid points;

[0050] It should be noted that since the workpiece model to be machined is a closed body in three-dimensional space, only one of the upper and lower surfaces of the model can be machined in one operation by three-axis numerical control engraving. Therefore, there will be multiple Z coordinates when projecting the Z coordinates, and the maximum Z coordinate in the current orientation is taken as the projection point.

[0051] (4) Establish the two-dimensional matrix of the model elevation of the workpiece model to be machined according to the elevation data of each grid point.

[0052] Repeat the above process until all the points in the three-dimensional space in the reconstructed workpiece model to be machined are projected onto the two-dimensional matrix of the model elevation, that is, the two-dimensional matrix of the model elevation of the workpiece model to be machined is established.

[0053] Step S102 mainly completes the establishment of the two-dimensional matrix of the model elevation along the Z direction of the reconstructed workpiece model to be machined; and the basis for the tool path elevation fitting calculation is directly related to the workpiece model to be machined, that is, it reflects the differences of different workpiece models to be machined, indicating that the present invention has universality for different workpiece models to be machined.

[0054] S103. Construct a machining tool model, and establish a two-dimensional matrix of the cutting surface elevation of the machining tool model along the Z-axis direction according to the spacing of the equidistant grid in the XY plane;

[0055] Correspondingly, the three-dimensional model space data of the machining tool model can be generated, and a two-dimensional matrix of the cutting surface elevation is established along the Z-axis direction with the three-dimensional zero point of the tool model as the reference point according to the same spacing as the equidistant grid in the XY plane. The specific steps include:

[0056] (1)Construct a machining tool model based on the parameters of the machining tool;

[0057] Taking jade processing as an example, the common machining tools in three-axis CNC carving are mainly flat-end milling cutters (see Figure 4 ) and taper ball-nose cutters (see Figure 5 ); among them:

[0058] The tool parameters of the flat-end milling cutter are tool length L1 and tool diameter D1;

[0059] The tool parameters of the taper ball-nose cutter are tool length L2, tool diameter D2, ball-nose taper angle a, and ball-nose taper radius R, where the length and radius are usually in mm;

[0060] (2)Taking the lowest point at the center of the Z-axis of the machining tool model as the three-dimensional zero point of the machining tool model, establish a two-dimensional matrix of the cutting surface elevation according to the spacing of the equidistant grid in the XY plane.

[0061] Generate the machining tool model with the lowest point at the center of the Z-axis of the machining tool as the three-dimensional zero point of the machining tool according to the type and parameters of the machining tool; and construct a two-dimensional matrix of the cutting depth data of the corresponding machining tool.

[0062] Step S103 mainly completes the generation of the three-dimensional model of the machining tool and the establishment of the two-dimensional matrix of the cutting depth data. Due to the different types and parameters of the machining tools, there are significant differences in the three-dimensional models of the machining tools. During the cutting process, the machining depths that can be implemented according to the machining target model are also different. Therefore, it is necessary to process separately according to the type and parameters of the machining tool to make the present invention universal.

[0063] S104, establish a machining reference path according to the boundary box of the workpiece model to be machined;

[0064] Furthermore, step S104 generates the boundary box of the workpiece model to be machined, and based on the maximum and minimum values of the X / Y axes of this boundary box, with the selected spacing of the grid as the step size, constructs a Z-shaped machining reference path with the X-axis as the main direction from small to large first and then the Y-axis from small to large, or a Z-shaped machining reference path with the Y-axis as the main direction.

[0065] As Figure 6 shown, the step of establishing a machining reference path according to the boundary box of the workpiece model to be machined includes:

[0066] S201, take one coordinate axis in the XY plane as the main axis and the other coordinate axis in the XY plane as the sub-axis;

[0067] S202, obtain the boundary box of the workpiece model to be machined;

[0068] S203. Calculate the maximum coordinate, minimum coordinate of the main axis, maximum coordinate of the secondary axis, and minimum coordinate of the secondary axis of the boundary rectangle in the XY plane;

[0069] S204. Use the positions of the minimum coordinate of the main axis and the minimum coordinate of the secondary axis as the initial reference points;

[0070] S205. Keep the coordinates of the secondary axis unchanged, and adjust the coordinates of the main axis from the minimum coordinate of the main axis to the maximum coordinate of the main axis step by step according to a preset step size to form new reference points;

[0071] S206. Increase the coordinates of the secondary axis by the preset step size;

[0072] S207. Determine whether the coordinates of the secondary axis are greater than the maximum coordinate of the secondary axis; if the determination result is no, keep the coordinates of the secondary axis unchanged, adjust the coordinates of the main axis from the maximum coordinate of the main axis to the minimum coordinate of the main axis step by step according to a preset step size to form new reference points, then increase the coordinates of the secondary axis by the preset step size, and return to step S205; if the determination result is yes, record all the reference points in sequence as path points to establish a machining reference path.

[0073] For example, when the X-axis is the main axis, the steps for specifically establishing a machining reference path with the X-axis as the main axis are as follows:

[0074] (1) Take the X-axis as the main axis and the Y-axis as the secondary axis;

[0075] (2) Obtain the boundary rectangle of the workpiece model to be machined;

[0076] (3) Calculate the maximum coordinate X MAX of the X-axis, the minimum coordinate X MIN of the main axis, the maximum coordinate Y MAX of the secondary axis, and the minimum coordinate Y MIN of the secondary axis in the XY plane;

[0077] (4) Use (X MIN , Y MIN ) as the initial reference point;

[0078] (5) Keep the coordinates of the Y-axis unchanged, and adjust the coordinates of the X-axis from the minimum coordinate X MIN of the main axis to the maximum coordinate X MAX step by step according to a preset step size to form new reference points;

[0079] (6) Increase the coordinates of the secondary axis Y by the preset step size;

[0080] (7) Determine whether the coordinates of the secondary axis Y are greater than the maximum coordinate Y MAX; When the judgment is no, keep the coordinates of the secondary axis Y unchanged, and according to the preset step size, adjust the coordinates of the main axis X from the maximum coordinate X of the main axis MAX gradually adjust to the minimum coordinate X of the main axis MIN , to form a new reference point, then after increasing the coordinates of the secondary axis Y by the preset step size, return to step (5); when the judgment is yes, record all the reference points in sequence as path points to establish a machining reference path.

[0081] For another example, when the Y axis is the main axis, the specific steps to establish the machining reference path with the Y axis as the main axis are as follows:

[0082] (1) Take the Y axis as the main axis and the X axis as the secondary axis;

[0083] (2) Obtain the boundary rectangle of the workpiece model to be machined;

[0084] (3) Calculate the maximum coordinate X of the X axis, the minimum coordinate X of the main axis, the maximum coordinate Y of the secondary axis, and the minimum coordinate Y of the secondary axis in the XY plane of the boundary rectangle; MAX the minimum coordinate X of the main axis MIN the maximum coordinate Y of the secondary axis MAX and the minimum coordinate Y of the secondary axis MIN ;

[0085] (4) Take (X MIN , Y MIN ) as the initial reference point;

[0086] (5) Keep the coordinates of the X axis unchanged, and according to the preset step size, adjust the coordinates of the Y axis from the minimum coordinate Y of the main axis MIN gradually adjust to the maximum coordinate Y of the main axis MAX , to form a new reference point;

[0087] (6) Increase the coordinates of the secondary axis X by the preset step size;

[0088] (7) Determine whether the coordinates of the secondary axis X are greater than the maximum coordinate X of the secondary axis MAX ; When the judgment is no, keep the coordinates of the secondary axis X unchanged, and according to the preset step size, adjust the coordinates of the main axis Y from the maximum coordinate Y of the main axis MAX gradually adjust to the minimum coordinate Y of the main axis MIN , to form a new reference point, then after increasing the coordinates of the secondary axis X by the preset step size, return to step (5); when the judgment is yes, record all the reference points in sequence as path points to establish a machining reference path.

[0089] Step S104 is related to the machining process. Currently, the Z self-machining reference path with the X axis or Y axis as the main direction is often used. To generate this path, it is necessary to follow the boundary rectangle of the workpiece model to be machined so that the machining reference path just covers the machining area, thereby determining the order of elevation fitting calculation.

[0090] S105. Calculate the fitting height of each calculation point in the machining reference path respectively according to the model elevation two-dimensional matrix and the cutting surface elevation two-dimensional matrix.

[0091] In step S105, the Z-direction elevation fitting calculation for each point in the machining reference path is completed sequentially. Whether the generated result is correct is related to the effectiveness of the generated tool path, which is the core calculation of the present invention. The specific steps include:

[0092] (1) Access each calculation point in the machining reference path sequentially according to the path point order of the machining reference path.

[0093] Traverse each point in the machining reference path in sequence. It is necessary to strictly maintain the traversal order consistent with the order of the generated machining path, otherwise the tool path will be chaotic and lead to tool breakage. During the traversal process, when accessing each point in the machining reference path, the three-dimensional zero point of the tool is aligned with that point.

[0094] (2) Obtain a local two-dimensional matrix with the same scale as the cutting surface elevation two-dimensional matrix in the model elevation two-dimensional matrix respectively according to the X coordinate and Y coordinate of the calculation point.

[0095] (3) Calculate the fitting height of each calculation point according to the local two-dimensional matrix and the cutting surface elevation two-dimensional matrix respectively.

[0096] According to the X coordinate and Y coordinate of the machining reference path, calculate the corresponding array element position in the machining model elevation two-dimensional matrix; then, taking the area covered by the cutting surface elevation two-dimensional matrix (i.e., the local two-dimensional matrix) as the standard, calculate the fitting height difference Z Difference (i.e., the maximum value of the Z coordinate difference); finally, record the X coordinate, Y coordinate and Z Difference in sequence, where the fitting height = the corresponding Z coordinate + the fitting height difference Z Difference .

[0097] Therefore, in step S105, according to the selected machining reference path, when reaching each calculation point in the path, according to the selected machining reference path, when reaching each calculation point in the path, calculate the Z-direction elevation fitting of the machining part elevation data and the tool elevation data, obtain the fitting height, and record this height as the lowest position of the tool cutting at the current position.

[0098] S106. Integrate the fitting heights of all calculation points in the machining reference path to form a machining tool path.

[0099] Further, the step of integrating the fitting heights of all calculation points in the machining reference path to form a machining tool path includes:

[0100] (1) Generate an initial machining instruction sequence according to the machine type of the machine tool.

[0101] (2) Generate a G00 command to move the machining tool to the machining safety point;

[0102] (3) Set the safe machining depth of a single command when generating commands;

[0103] (4) According to the fitted height, sequentially generate machining commands for the machining path point sequence using the G01 sequence;

[0104] (5) Generate a command to restore the machine machining state at the end of the tool path according to the machine type;

[0105] (6) Generate a G00 command to move the machining tool back to the machining safety point at the end of the tool path. More preferably, if multiple machining tools are required to complete the machining, the above point sequence generation and machining code generation should be completed separately for the machining tools in different machining stages; after the return of each machining tool code, a tool change command should be generated according to the machine type.

[0106] Correspondingly, the present invention also discloses a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented. At the same time, the present invention also discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0107] In summary, the method for generating a tool path for a three-axis CNC milling machine based on elevation fitting of the present invention can efficiently complete the generation of accurate tool paths through grid reconstruction, establishment of a two-dimensional matrix, and establishment of a machining reference path, etc., and can quickly generate tool paths for different workpieces to be machined. By applying the present invention, reasonable tool path planning can be realized, and the machining efficiency can be improved; by increasing the tool path density, the accuracy and roughness of the machining surface can be reduced, and the machining quality can be guaranteed; accurate tool paths are generated to ensure the effective utilization of materials, reduce material waste caused by improper machining, reduce production costs, and improve the economic benefits of enterprises; efficient tool path generation helps to reasonably schedule the production schedule of the machine tool and improve the utilization efficiency of the equipment; this method is applicable to workpieces with complex shapes or complex curved surfaces, making the machining of these workpieces possible; the automatic generation of tool paths is an important link to realize production automation, which can reduce manual intervention and improve the automation level of the production process, meeting the requirements of modern manufacturing for high precision and high efficiency. With the continuous development of numerical control technology, tool path planning technology is also constantly innovating, promoting the progress of the entire manufacturing technology.

[0108] The above is the preferred implementation manner of the present invention. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.

Claims

1. A tool path generation method for a three-axis CNC milling machine based on elevation fitting, characterized in that, Comprising: Reconstructing an equidistant grid on the XY plane of the workpiece model to be machined according to the workpiece model to be machined and the machining accuracy; Establishing a two-dimensional matrix of the model elevation of the workpiece model to be machined along the Z-axis direction; Constructing a machining tool model and establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model along the Z-axis direction according to the spacing of the equidistant grid on the XY plane; Establishing a machining reference path according to the boundary box of the workpiece model to be machined; Calculating the fitting height of each calculation point in the machining reference path respectively according to the two-dimensional matrix of the model elevation and the two-dimensional matrix of the cutting surface elevation; Integrating the fitting heights of all calculation points in the machining reference path to form a machining tool path.

2. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 1, wherein The step of reconstructing the equidistant grid on the XY plane of the workpiece model to be machined according to the workpiece model to be machined and the machining accuracy includes: Obtaining the boundary box of the workpiece model to be machined; Calculating the defined ranges of the X-axis and Y-axis of the workpiece model to be machined according to the boundary box; Calculating the common multiple step interval according to the defined ranges; Comparing the step interval with the machining accuracy to determine whether the step interval is greater than the machining accuracy; When the determination is yes, reducing the step interval by an integer multiple until the step interval is less than the machining accuracy; When the determination is no, reconstructing the equidistant grid on the XY plane of the workpiece model to be machined according to the step interval.

3. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 1, wherein, The step of establishing a two-dimensional matrix of the model elevation of the workpiece model to be machined along the Z-axis direction includes: Calculating the X coordinate and Y coordinate of each grid point on the equidistant grid on the XY plane respectively; Projecting each grid point along the Z-axis direction onto the workpiece model to be machined according to the X coordinate and Y coordinate to form a plurality of Z coordinates corresponding to the grid points on the workpiece model to be machined; Taking the maximum Z coordinate among the plurality of Z coordinates corresponding to the grid point as the elevation data of the corresponding grid point; Establishing a two-dimensional matrix of the model elevation of the workpiece model to be machined according to the elevation data of each grid point.

4. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 1, wherein The step of constructing a machining tool model and establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model along the Z-axis direction according to the spacing of the equidistant grid on the XY plane includes: Constructing a machining tool model according to the parameters of the machining tool; Taking the lowest point at the center of the Z-axis of the machining tool model as the three-dimensional zero point of the machining tool model and establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model according to the spacing of the equidistant grid on the XY plane.

5. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 4, wherein The step of establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model according to the spacing of the equidistant grid on the XY plane includes: Calculating the X coordinate and Y coordinate of each grid point on the equidistant grid on the XY plane respectively; Projecting each grid point along the Z-axis direction onto the machining tool model according to the X coordinate and Y coordinate to form a plurality of Z coordinates corresponding to the grid points on the machining tool model; Taking the maximum Z coordinate among the plurality of Z coordinates corresponding to the grid point as the elevation data of the corresponding grid point; Establishing a two-dimensional matrix of the cutting surface elevation of the machining tool model according to the elevation data of each grid point.

6. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 1, wherein, The step of establishing a machining reference path according to the boundary box of the workpiece model to be machined includes: S201, Take one coordinate axis in the XY plane as the main axis and the other coordinate axis in the XY plane as the secondary axis; S202, Obtain the boundary bounding box of the workpiece model to be machined; S203, Calculate the maximum main axis coordinate, minimum main axis coordinate, maximum secondary axis coordinate, and minimum secondary axis coordinate of the boundary bounding box in the XY plane; S204, Use the position of the minimum main axis coordinate and the minimum secondary axis coordinate as the initial reference point; S205, Keep the coordinate of the secondary axis unchanged, and adjust the coordinate of the main axis step by step from the minimum main axis coordinate to the maximum main axis coordinate according to the preset step size to form a new reference point; S206, Increase the coordinate of the secondary axis by the preset step size; S207, Determine whether the coordinate of the secondary axis is greater than the maximum secondary axis coordinate. If the determination is no, keep the coordinate of the secondary axis unchanged, adjust the coordinate of the main axis step by step from the maximum main axis coordinate to the minimum main axis coordinate according to the preset step size to form a new reference point, and then increase the coordinate of the secondary axis by the preset step size and return to step S205. If the determination is yes, sequentially record all the reference points as path point sequences to establish a machining reference path.

7. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 1, characterized in that The step of calculating the fitting height of each calculation point in the machining reference path according to the model elevation two-dimensional matrix and the cutting surface elevation two-dimensional matrix respectively includes: According to the path point sequence of the machining reference path, sequentially access each calculation point of the machining reference path; Respectively obtain a local two-dimensional matrix with the same scale as the cutting surface elevation two-dimensional matrix in the model elevation two-dimensional matrix according to the X coordinate and Y coordinate of the calculation point; Calculate the fitting height of each calculation point according to the local two-dimensional matrix and the cutting surface elevation two-dimensional matrix respectively.

8. The method for generating a tool path of a three-axis CNC milling machine based on elevation fitting according to claim 7, characterized in that, The step of integrating the fitting heights of all calculation points in the machining reference path to form a machining tool path includes: Generate an initial machining instruction sequence according to the type of the machine tool; Generate a G00 instruction to move the machining tool to the machining safety point; Set the safe machining depth of a single instruction when generating the instruction; Generate machining instructions for the machining path point sequence sequentially using the G01 sequence according to the fitting height; Generate an instruction to restore the machine machining state at the end of the tool path according to the type of the machine tool; Generate a G00 instruction to move the machining tool back to the machining safety point at the end of the tool path.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 8.