Numerical control machine tool cutter machining path planning method, system, equipment and medium
Through the automated path planning method based on the large language model, the problems of manual dependence and insufficient efficiency and accuracy in CNC machine tool tool path planning are solved, and efficient and accurate tool path planning is achieved.
Patent Information
- Application Number
- CN202410953257.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-11
AI Technical Summary
Existing CNC machine tool tool machining path planning methods rely on expert rules and experience, are cumbersome and prone to introduce human errors, and cannot fully consider complex workpiece geometries and variable factors, resulting in loss of efficiency and accuracy.
An automated path planning method based on a large language model is used to obtain the point cloud model and cutting instructions for preprocessing, and a pre-trained language model such as Vicuna-13B is used for fine-tuning to generate a token sequence of tool cutting postures to achieve automated path planning.
It reduces the workload of manually defining rules, improves processing efficiency and accuracy, and can more comprehensively consider the workpiece geometry and processing requirements to generate high-efficiency, high-precision processing paths.
Smart Images

Figure CN118760053A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of numerical control machining, and in particular relates to a method, system, equipment and medium for planning machining paths of tool tools for numerical control machine tools. Background Art
[0002] CNC machine tool tool processing path planning refers to the process of determining the tool path during the CNC machine tool processing process to achieve the process of processing the workpiece. Further explanation, CNC machine tool tool processing path planning needs to comprehensively consider multiple factors such as workpiece geometry, processing requirements, tool type, cutting performance, etc. In addition, when determining the tool processing path, it is also necessary to follow certain principles and rules to achieve high-efficiency and high-precision processing.
[0003] Existing traditional CNC machine tool tool path planning methods usually rely on expert rules and experience, and require manual definition and adjustment of rules and parameters, involving tedious manual calculations and coding implementation. For example, a method for planning a smooth and interference-free tool path for five-axis CNC machining in the prior art requires manual establishment of geometric models of the tool, workpiece, and obstacles, on which the tool path can be finally output.
[0004] In recent years, large language models have shown a rapid development trend and have shown broad application potential in many fields. This technological innovation is also reflected in the field of tool path planning. By deeply learning the inherent patterns and laws in the data, large language models can automatically capture and understand the key features of tool path planning, which can significantly reduce the workload of manually defining rules. In addition, large language models have excellent text understanding capabilities and can more accurately grasp task requirements and the geometric characteristics of workpieces. This feature makes large language models a strong candidate in the field of automated path planning, which is expected to significantly improve processing efficiency and accuracy. Although large language models have shown great potential in many aspects, there is currently no CNC machine tool tool processing path planning method that is completely based on large language models that has been successfully developed and widely used. Summary of the invention
[0005] The purpose of the present invention is to provide a method, system, device and medium for CNC machine tool tool processing path planning to solve one or more of the above-mentioned technical problems. The technical solution provided by the present invention is specifically a CNC machine tool tool processing path planning solution based on a large language model, which can accurately plan the tool processing path according to the input point cloud model and cutting instructions using a fine-tuned large language model, which can reduce the workload of manually defining rules and improve processing efficiency and accuracy.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a method for planning a machining path of a CNC machine tool, comprising the following steps:
[0008] Obtaining the point cloud model of the workpiece to be cut and the cutting instructions;
[0009] The point cloud model and cutting instructions of the workpiece to be cut are preprocessed by using a preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions;
[0010] Based on the feature embedding of the point cloud model and cutting instructions, the fine-tuned large language model is used to plan the tool path and obtain the token sequence that represents the tool cutting posture.
[0011] The token sequence representing the tool cutting posture is detokenized to obtain the tool cutting posture sequence.
[0012] A further improvement of the present invention is that the step of preprocessing the point cloud model of the workpiece to be cut and the cutting instructions by using the preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions comprises:
[0013] Use the pre-trained point cloud encoder to encode the point cloud model to obtain the feature embedding of the point cloud model;
[0014] The cutting instruction is encoded into a subword sequence using SentencePiecetokenizer to obtain a token representation. After obtaining the token representation of the cutting instruction, the discrete token is mapped to a continuous vector space by embedding a lookup table to obtain semantic information, which is used as a feature embedding for the cutting instruction.
[0015] A further improvement of the present invention is that the step of obtaining the fine-tuned large language model includes:
[0016] Use the Vicuna-13B model as the pre-trained language model;
[0017] Based on the data set, the pre-trained language model is fine-tuned using the LoRA fine-tuning technology to obtain a fine-tuned large language model;
[0018] The data set is constructed based on actual planning data of tool processing paths of CNC machine tools.
[0019] A further improvement of the present invention is that the step of fine-tuning the pre-trained language model based on the data set using the LoRA fine-tuning technology to obtain a fine-tuned large language model includes:
[0020] Based on the data set, the point cloud model and cutting instructions in the data sample are preprocessed to obtain feature embedding of the point cloud model and cutting instructions used as input, and a token sequence corresponding to the tool cutting posture sequence used as a training label;
[0021] During supervised training, the feature embedding of the point cloud model and cutting instructions in the data sample is input into the pre-trained language model, and the LoRA fine-tuning technology is used to train the model to output a token sequence corresponding to the expected tool cutting posture.
[0022] A further improvement of the present invention is that the step of obtaining the token sequence corresponding to the tool cutting posture sequence includes:
[0023] The least common 588 subwords in SentencePiecetokenizer are used to tokenize the tool cutting postures and obtain the token sequence corresponding to the tool cutting posture sequence.
[0024] Among them, 480 subwords out of 588 subwords are used to encode position information, encoding the x, y and z coordinates in a ratio of 160:160:160 respectively; the remaining 108 subwords out of 588 subwords are used to encode angle information, encoding the angles around the x-axis, y-axis and z-axis in a ratio of 36:36:36; 6 tokens represent a tool cutting posture.
[0025] A further improvement of the present invention is that, when the supervised training is performed, the feature embedding of the point cloud model and the cutting instruction in the data sample is input into the pre-trained language model, and the step of using the LoRA fine-tuning technology to train the model to output a token sequence corresponding to the expected tool cutting posture includes:
[0026] For the weight matrix W0 of the pre-trained language model, the LoRA fine-tuning technology uses a low-rank decomposition method to constrain the update amount ΔW=BA of the pre-trained language model weight; wherein the ranks of the matrix A and the matrix B are both lower than the preset threshold value;
[0027] During the training process, the parameters of the pre-trained language model are fixed, and only matrix A and matrix B are trained; the pre-trained language model parameters are combined after multiplying the trained matrix B with matrix A to serve as the fine-tuned pre-trained language model parameters; the input and output dimensions of the pre-trained language model remain unchanged.
[0028] A further improvement of the present invention is that, during the supervised training, the feature embedding of the point cloud model and the cutting instruction in the data sample is input into the pre-trained language model, and the LoRA fine-tuning technology is used to train the model to output a token sequence corresponding to the desired tool cutting posture.
[0029] When fine-tuning training, the loss function L(θ) is used for optimization;
[0030]
[0031] In the formula, s prefix Contains point cloud model S 3D The feature embedding of and the feature embedding of cutting instructions, The token currently output by PLM; is the token output by PLM at the previous moment; T represents the length of the token sequence that PLM expects to output; L is the loss of the network during fine-tuning, and the network is fine-tuned by reducing the loss.
[0032] A second aspect of the present invention provides a CNC machine tool tool processing path planning system, comprising:
[0033] A data acquisition module, used to obtain a point cloud model of a workpiece to be cut and cutting instructions;
[0034] A preprocessing module, used for preprocessing the point cloud model and cutting instructions of the workpiece to be cut by using a preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions;
[0035] The path planning module is used to plan tool paths based on the feature embedding of the point cloud model and cutting instructions, using a fine-tuned large language model to obtain a token sequence that represents the tool cutting posture;
[0036] The post-processing module is used to detokenize the token sequence representing the tool cutting posture to obtain the tool cutting posture sequence.
[0037] A third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a CNC machine tool tool processing path planning method as described in any one of the first aspects of the present invention when executing the program.
[0038] According to a fourth aspect of the present invention, there is provided a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for planning a tool machining path for a CNC machine tool as described in any one of the first aspects of the present invention is implemented.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The existing traditional CNC machine tool tool processing path planning method relies on the manual definition of expert rules and experience, and the adjustment of rules and parameters is a cumbersome process that easily introduces human errors and subjective factors. In addition, for complex processing tasks and variable workpiece geometries, the existing traditional methods often cannot fully consider all factors, resulting in efficiency and precision loss. In response to the above-mentioned problems in the prior art, the embodiment of the present invention specifically discloses a new CNC machine tool tool processing path planning method, which is an automated path planning method based on a large language model, which can solve the challenges in the existing traditional CNC machine tool tool processing path planning method; compared with the traditional method of manually defining rules, the technical solution of the present invention realizes an automated path planning process, and the application of a large language model makes the path planning process more intelligent, and can accurately infer the tool processing path based on the input data, reducing the workload of manually defining rules. Specifically, the technical solution of the present invention utilizes the learning ability and semantic understanding ability of a large language model, and can accurately infer the tool processing path based on the input point cloud model and cutting instructions during the path planning process; compared with traditional methods, the method based on a large language model of the present invention can more comprehensively consider factors such as the workpiece geometry and processing requirements, and automatically generate high-efficiency and high-precision processing paths.
[0041] In the present invention, Vicuna-13B is used as a pre-trained language model (PLM), and Vicuna-13B is fine-tuned based on the collected CNC machine tool tool path planning data set. Through this method, a large language model can be applied to the path planning task in an economical and efficient manner. Further explanatory, the fine-tuning process utilizes the CNC machine tool tool path planning data set, so that the model can better understand and learn the characteristics and laws of path planning; such a method can effectively utilize the capabilities of the pre-trained language model and transfer it to a specific path planning task, thereby improving the efficiency and accuracy of path planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below; obviously, the drawings described below are some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 It is a flow chart of a method for planning a machining path for a CNC machine tool in an embodiment of the present invention.
[0044] Figure 2Schematic diagram of the Vicuna-13B workflow in an embodiment of the present invention.
[0045] Figure 3 It is a schematic diagram of the LoRA implementation principle in an embodiment of the present invention.
[0046] Figure 4 It is a schematic diagram of the overall network architecture in an embodiment of the present invention.
[0047] Figure 5 It is a schematic diagram of a tool processing path planning system for a CNC machine tool in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0049] See also Figure 1 In an embodiment of the present invention, a method for planning a machining path of a CNC machine tool is provided, specifically a method for planning a machining path of a CNC machine tool based on a large language model, comprising the following steps:
[0050] Step 1, obtaining a point cloud model of a workpiece to be cut and a cutting instruction (explanatory, the cutting instruction can be set according to user requirements);
[0051] Step 2: preprocessing the point cloud model and cutting instructions of the workpiece to be cut using a preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions;
[0052] Step 3: Based on the point cloud model obtained in step 2 and the feature embedding of the cutting instructions, the fine-tuned large language model is used to perform tool path planning to obtain a token sequence representing the tool cutting posture;
[0053] Step 4: detokenize the token sequence representing the tool cutting posture obtained in step 3 to obtain the tool cutting posture sequence.
[0054] In the technical solution provided by the embodiment of the present invention, the ultimate expectation is to obtain the path planning result of the tool, which is in the form of a continuous sequence of tool cutting postures; specifically, the technical solution of the embodiment of the present invention is to de-tokenize the token sequence output by the fine-tuned large language model to obtain the desired tool cutting posture sequence.
[0055] Explanatory, the existing traditional CNC machine tool tool processing path planning method relies on expert rules and experience to manually define, adjust rules and adjust parameters, which is a cumbersome process that easily introduces human errors and subjective factors; in addition, for complex processing tasks and variable workpiece geometries, the existing traditional methods often cannot fully consider all factors, resulting in efficiency and precision loss. In response to the above-mentioned problems in the prior art, the embodiment of the present invention specifically discloses an automated path planning method based on a large language model. Compared with the traditional method of manually defining rules, the technical solution of the present invention realizes an automated path planning process. The application of the large language model makes the path planning process more intelligent, and can accurately infer the tool processing path based on the input data, reducing the workload of manually defining rules.
[0056] In one embodiment of the present invention, in step 2, the point cloud model of the workpiece to be cut and the cutting instructions are preprocessed using a preprocessing network to obtain feature embedding of the point cloud model of the workpiece to be cut and the cutting instructions, which specifically includes:
[0057] Encode the point cloud model using a pre-trained point cloud encoder (e.g., PointNet++, weight freezing) to obtain feature embedding of the point cloud;
[0058] Use SentencePiecetokenizer (which, explanatory, contains 32,000 subwords) to encode the cutting instructions into a subword sequence, i.e., its token representation; after obtaining the token representation of the cutting instructions, the discrete tokens are mapped to the continuous vector space through the embedding lookup table to obtain their semantic information, which is the final "feature embedding of the cutting instructions".
[0059] In an embodiment of the present invention, a GPT-style autoregressive language model is used as a prefix, and the point cloud model and cutting instructions are used as prefixes, and it is expected that the large language model will output the path planning results for the tool. Through the above-mentioned preprocessing steps of the embodiment of the present invention, feature embeddings corresponding to the point cloud model and user instructions can be obtained. This method can convert point cloud data, user instructions and path planning results into a machine-processable form, which can be received and processed by a large language model, providing a basis for subsequent model training and inference. In summary, the embodiment of the present invention can achieve the processing and optimization of path planning tasks by inputting feature embeddings into PLM and using the token sequence generated by PLM to represent the path planning results of the tool.
[0060] In one embodiment of the present invention, in step 3, the step of obtaining the fine-tuned large language model includes:
[0061] Use the Vicuna-13B model as the pre-trained language model;
[0062] Based on the data set, the pre-trained language model is fine-tuned using the LoRA fine-tuning technology to obtain a fine-tuned large language model; wherein the data set is constructed based on the actual planning data of the CNC machine tool tool processing path.
[0063] In the embodiment of the present invention, the pre-trained language model is fine-tuned based on the data set using the LoRA fine-tuning technology to obtain a fine-tuned large language model. Further explanation is as follows:
[0064] In the stage of fine-tuning the pre-trained language model using the dataset, it is also necessary to pre-process the point cloud model and the user's cutting instructions, and tokenize the tool cutting posture sequence; for specific examples, the pre-processing method disclosed in step 2 can be used;
[0065] For a specific tool cutting posture, the least common 588 subwords in SentencePiecetokenizer are used to tokenize it; among them, 480 subwords are used to encode position information, encoding x, y and z coordinates in a ratio of 160:160:160 respectively; the remaining 108 subwords encode the angles around the x-axis, y-axis and z-axis in a ratio of 36:36:36; based on this, 6 tokens can represent a specific cutting posture (6 tokens represent the x, y, z coordinates of the tool and the rotation angles around the x-axis, y-axis and z-axis respectively);
[0066] Finally, based on the data set, the feature embedding of the point cloud model and cutting instructions is input into the model, and the LoRA fine-tuning technology is used to train the model to output a token sequence corresponding to the expected tool cutting posture sequence.
[0067] In the technical solution of the embodiment of the present invention, data is first collected, then corresponding preprocessing is performed, and then the large language model is fine-tuned (specifically, only the large language model is fine-tuned with the help of loRA technology, and the weights of other modules (such as the 3D encoder module) are frozen, and no parameter update is performed), and finally a trained language model suitable for tool path planning tasks is obtained.
[0068] See also Figure 2 , a specific explanation of the pre-trained language model Vicuna-13B: LLaMA (LargeLanguage Model Meta AI) is an open and efficient large-scale basic language model released by Meta AI. It includes four versions, namely 7B (7 billion), 13B (13 billion), 33B (33 billion) and 65B (65 billion) parameter models; the training data sets of these models are derived from public data sets, and no custom data sets are used, ensuring compatibility and reproducibility with open source. After tokenization, the entire training data set contains approximately 1.4T tokens. The LLaMa-13B model has 13 billion parameters, which can surpass GPT-3 (with 175 billion parameters) in most benchmarks and can run on a single V100 GPU. The largest 65 billion parameter version of the LLaMA model is comparable to Google's Chinchilla-70B and PaLM-540B. Vicuna-13B is a model fine-tuned using supervised data based on LLaMa-13B. Its dataset comes from user conversation data generated by ShareGPT.com, with a total of 70,000 conversations. Figure 2 An overview of the Vicuna-13B process is shown, including data, training, serving, and evaluation; user sharing conversations (illustratively, such as sharing GPT); supervised instruction fine-tuning of LLaMA; distributed serving using FastChat; and output evaluation using GPT-4. ShareGPT is a ChatGPT data sharing site where users can upload ChatGPT answers they think are interesting. Preliminary evaluation using GPT-4 shows that Vicuna-13B has reached more than 90% of the quality of OpenAI's ChatGPT and Google's Bard, and outperforms other models such as LLaMA and Stanford's Alpaca in more than 90% of the cases.
[0069] See also Figure 3In the embodiment of the present invention, in order to overcome the difficulty of aligning multiple modal information and make better use of the potential information of PLM, a large language model fine-tuning method based on low-rank adaptation, LoRA (Low-Rank Adaptation), is used to fine-tune PLM. Explanation: LoRA simulates full parameter fine-tuning by adding a bypass matrix. It is one of the most common and effective fine-tuning methods at present, and can be effectively combined with other parameter efficient fine-tuning methods. Other large language model fine-tuning methods, such as Adapter Tuning, require increasing the number of model layers, resulting in additional reasoning delays; Prefix-Tuning is difficult to train, and the sequence reserved for Prompt occupies the input sequence space of downstream tasks, thereby affecting the performance of the model; P-tuning v2 easily leads to the forgetting of old knowledge, resulting in a significant decrease in the performance of the fine-tuned model on the previous problem. By adopting the LoRA method, the embodiment of the present invention can avoid the influence of the above problems, so that the model can better adapt to specific tasks after fine-tuning without losing previous knowledge.
[0070] Further explanatory, the theoretical basis of LoRA lies in the over-parameterized nature of the model. Despite having a large number of parameters, the intrinsic dimension of neural network models (such as Transformer) is actually relatively small, and the model mainly relies on this low intrinsic dimension to complete task adaptation; pre-trained language models have low intrinsic dimension and can adapt to the full parameter space through effective learning. Based on this observation, LoRA assumes that during the task adaptation process, the amount of weight update also has low intrinsic dimension.
[0071] In order to realize this assumption, for the weight matrix W0 of the pre-trained language model, LoRA uses low-rank decomposition to constrain the update amount ΔW=BA of the pre-trained language model weight. The ranks of the two matrices A and B are low. During the training process, the pre-trained weights are fixed and no longer updated by gradients. Only A and B are trained. After the training, the updated parameters W=W0+BA can be used to obtain the fine-tuned model.
[0072] Example Explanation: The implementation process of LoRA includes:
[0073] (1) Add a bypass next to the original PLM to perform dimensionality reduction and then dimensionality increase operations to simulate the intrinsic rank;
[0074] (2) Initialize the dimension reduction matrix A with a random Gaussian distribution and initialize the dimension increase matrix B with a zero matrix to ensure that the bypass matrix is still a zero matrix at the beginning of training;
[0075] (3) During training, the parameters of PLM are fixed and only matrix A and matrix B are trained;
[0076] (4) After training is completed, the B matrix is multiplied by the A matrix and the pre-trained language model parameters are combined as the fine-tuned model parameters. The input and output dimensions of the model remain unchanged.
[0077] In one embodiment of the present invention, when fine-tuning is performed, optimization is performed by relying on the following functions, specifically including:
[0078] The feature embedding of point cloud model and cutting instruction (i.e., s prefix ) as input and provide it to PLM;
[0079] PLM processes these inputs and generates a series of output token sequences, and expects these token sequences to represent the tool path planning results after detokenization;
[0080] It should be noted that the current output token of PLM Not only depends on prefix , and the token output at the previous moment This means that the model will take into account the previously generated content when generating each token, thus forming the coherence of the context. Therefore, in order to fine-tune PLM, the following formula is used as the loss function to optimize PLM;
[0081] The loss function L(θ) is expressed as,
[0082]
[0083] In the formula, s prefix Contains point cloud model (S 3D ) feature embedding and cutting instruction feature embedding, The token currently output by PLM; is the token output by PLM at the previous moment; T represents the length of the token sequence that PLM expects to output; L is the loss of the network during fine-tuning, and the network is fine-tuned by reducing this loss.
[0084] The application stage (also known as the reasoning stage) of the fine-tuned large language model includes: embedding the features of the point cloud model and the cutting instructions into the fine-tuned large language model, and the large language model outputs a specific token sequence to characterize the cutting posture sequence of the tool, and then de-tokenizes the token sequence to obtain the cutting posture sequence of the tool (to further explain, in the fine-tuning stage, the tool cutting posture needs to be tokenized for training; in the application stage, the token sequence output by the large language model needs to be de-tokenized to obtain the final tool cutting posture sequence).
[0085] In the technical solution provided by the embodiment of the present invention, the actual data of the tool processing path planning of the CNC machine tool can be collected through experiments and a data set can be formed; based on the above data set, the Vicuna-13B model is fine-tuned in the expectation that the fine-tuned large language model can complete the tool path planning task; the Vicuna-13B model is fine-tuned with the help of the LoRA fine-tuning technology, thereby achieving low-cost and efficient fine-tuning of the model. Further explanatory, the LoRA fine-tuning technology constrains the pre-trained language model by low-rank decomposition, so that only some parameters need to be adjusted to adapt to specific tasks. The trained model can accurately plan the tool processing path according to the input point cloud model and cutting instructions, thereby improving efficiency and accuracy. In summary, in order to make the large language model adapt to specific processing tasks and field requirements, the pre-trained language model is fine-tuned in the embodiment of the present invention; wherein, the fine-tuning process uses the data of the data set for supervised learning, so that the model can better understand the requirements and characteristics of the processing task; through fine-tuning, the model can capture the key features of tool path planning, thereby generating a more optimized processing path. The path planning method in the technical solution of the embodiment of the present invention can comprehensively consider multiple factors, such as the geometry of the workpiece, processing requirements, etc. By combining the input point cloud model and cutting instruction information, as well as the semantics and contextual knowledge learned by the pre-trained language model, it can generate a tool processing path that better meets actual needs. This comprehensive consideration method helps to improve processing efficiency and accuracy, and reduce the risk of human error.
[0086] In a specific exemplary embodiment of the present invention, the steps of collecting actual data of CNC machine tool tool processing path planning through experiments and forming a data set include:
[0087] Select cylinders of different lengths and use the cutting command "cut the cylinder of the first diameter size into the cylinder of the second diameter size"; the "first diameter size" indicates the original diameter size of the cylinder, and the "second diameter size" indicates the target diameter size after the cylinder is cut;
[0088] Use a five-axis CNC machine tool to perform actual cutting of the cylinder according to the given cutting instructions, keep the tool type, cutting force and cutting speed unchanged, and record the position and direction of the tool during the cutting process, that is, the tool cutting posture sequence;
[0089] By changing the original diameter and target diameter of the cylinder, a variety of data samples can be obtained; in addition, when conducting experiments and collecting data, it is necessary to ensure the consistency of other influencing factors, such as material properties and tool wear, to ensure the reliability and accuracy of the experimental data; in addition, it is necessary to obtain a point cloud model of each cylinder used (including the surface and internal points of the cylinder). Further explanatory, the specific steps for obtaining the point cloud model of each cylinder used include: converting the CAD model of the cylinder into a voxel representation, where each voxel represents a three-dimensional volume unit; by applying voxels to the CAD model of the cylinder, a voxel representation of the cylinder can be obtained, and the points inside each voxel are extracted as point cloud data, so that a point cloud model inside the cylinder can be obtained.
[0090] For example, Figure 4 As shown, the instruction is: Please help me plan the tool path to cut a cylindrical workpiece from 100mm to 50mm in diameter.
[0091] In the technical solution of the specific embodiment of the present invention, the steps for collecting the data set for the cylindrical cutting task are disclosed, and the large language model can be trained according to this, so as to complete the cylindrical cutting task; further, if there are other cutting task requirements, the data set can also be collected by the above method. The data set collection method of the embodiment of the present invention can provide rich data, covering cylindrical cutting tasks of different diameters and lengths, so that the large language model can learn and understand the tool path planning under different circumstances; by collecting and using these data, the large language model can learn the patterns and rules of cylindrical cutting tasks of different diameters and lengths, so as to generate a more accurate and satisfactory tool path. In summary, the technical solution of the present invention can comprehensively consider multiple factors such as the workpiece geometry and processing requirements, so as to generate a tool processing path that is more in line with actual needs. This comprehensive consideration can improve the processing efficiency and accuracy, making the processing process more efficient and reliable. Through the path planning method based on the large language model, the technical solution of the present invention can generate an optimized processing path. The model can automatically capture and understand the key features of the tool path planning, so as to generate a high-efficiency and high-precision processing path based on multiple factors. This optimized path can improve the processing quality and reduce the waste of processing time and resources. The large language model in the technical solution of the present invention can be fine-tuned to adapt to specific processing tasks and field requirements. This makes the technical solution more adaptable and flexible, and can plan paths for different types of workpieces and processing requirements, and adjust and optimize according to actual conditions.
[0092] In summary, the technical solution disclosed in the embodiment of the present invention utilizes the learning ability and semantic understanding ability of a large language model. By pre-training the language model on large-scale text data, the model can learn rich semantics and language patterns; in the path planning process, the model can accurately infer the processing path of the tool based on the input point cloud model and cutting instructions. Compared with the traditional method, the method based on the large language model of the present invention can more comprehensively consider factors such as the workpiece geometry and processing requirements, and automatically generate high-efficiency and high-precision processing paths. The technical solution of the embodiment of the present invention overcomes the cumbersomeness and restrictiveness of manually defining rules in the traditional method by introducing an automated path planning method of a large language model, and realizes more efficient and high-precision CNC machine tool tool processing path planning. The advantages of the technical solution of the embodiment of the present invention lie in the automated and intelligent path planning process, comprehensive consideration of multiple factors, optimization of the processing path, and the ability of adaptability and flexibility. These advantages are expected to significantly improve processing efficiency and precision, and bring significant progress to the field of CNC machine tool processing.
[0093] The following are device embodiments of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.
[0094] See also Figure 5 In an embodiment of the present invention, a CNC machine tool tool processing path planning system is provided, comprising:
[0095] A data acquisition module, used to obtain a point cloud model of a workpiece to be cut and cutting instructions;
[0096] A preprocessing module, used for preprocessing the point cloud model and cutting instructions of the workpiece to be cut by using a preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions;
[0097] The path planning module is used to plan tool paths based on the feature embedding of the point cloud model and cutting instructions, using a fine-tuned large language model to obtain a token sequence that represents the tool cutting posture;
[0098] The post-processing module is used to detokenize the token sequence representing the tool cutting posture to obtain the tool cutting posture sequence.
[0099] In one embodiment of the present invention, a computer device is provided, the computer device comprising a processor and a memory, the memory is used to store a computer program, the computer program comprises program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used to perform the operation of the CNC machine tool tool processing path planning method disclosed in the embodiment of the present invention.
[0100] In one embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the CNC machine tool tool processing path planning method in the above embodiment.
[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0103] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for planning a machining path for a CNC machine tool, characterized in that: The following steps are involved: Obtaining the point cloud model of the workpiece to be cut and the cutting instructions; The preprocessing network is used to preprocess the point cloud model and cutting instructions of the workpiece to be cut, and feature embedding of the point cloud model and the cutting instructions is obtained; Based on the feature embedding of the point cloud model and cutting instructions, the fine-tuned large language model is used to plan the tool path and obtain the token sequence that represents the tool cutting posture. The token sequence representing the tool cutting posture is detokenized to obtain the tool cutting posture sequence.
2. A method for planning a machining path for a CNC machine tool according to claim 1, characterized in that: The step of preprocessing the point cloud model and cutting instructions of the workpiece to be cut by using the preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions includes: Use the pre-trained point cloud encoder to encode the point cloud model to obtain the feature embedding of the point cloud model; The cutting instruction is encoded into a subword sequence using SentencePiecetokenizer to obtain a token representation. After obtaining the token representation of the cutting instruction, the discrete token is mapped to a continuous vector space by embedding a lookup table to obtain semantic information, which is used as a feature embedding for the cutting instruction.
3. A method for planning a machining path for a CNC machine tool according to claim 1, characterized in that: The steps of obtaining the fine-tuned large language model include: Use the Vicuna-13B model as the pre-trained language model; Based on the data set, the pre-trained language model is fine-tuned using the LoRA fine-tuning technology to obtain a fine-tuned large language model; The data set is constructed based on actual planning data of tool processing paths of CNC machine tools.
4. A method for planning a machining path for a CNC machine tool according to claim 3, characterized in that: The step of fine-tuning the pre-trained language model based on the data set using the LoRA fine-tuning technology to obtain a fine-tuned large language model includes: Based on the data set, the point cloud model and cutting instructions in the data sample are preprocessed to obtain feature embedding of the point cloud model and cutting instructions used as input, and a token sequence corresponding to the tool cutting posture sequence used as a training label; During supervised training, the feature embedding of the point cloud model and cutting instructions in the data sample is input into the pre-trained language model, and the LoRA fine-tuning technology is used to train the model to output a token sequence corresponding to the expected tool cutting posture.
5. A method for planning a machining path for a CNC machine tool according to claim 4, characterized in that: The steps of obtaining the token sequence corresponding to the tool cutting posture sequence include: The least common 588 subwords in SentencePiecetokenizer are used to tokenize the tool cutting postures and obtain the token sequence corresponding to the tool cutting posture sequence. Among them, 480 subwords out of 588 subwords are used to encode position information, encoding the x, y and z coordinates in a ratio of 160:160:160 respectively; the remaining 108 subwords out of 588 subwords are used to encode angle information, encoding the angles around the x-axis, y-axis and z-axis in a ratio of 36:36:36; 6 tokens represent a tool cutting posture.
6. A method for planning a machining path for a CNC machine tool according to claim 4, characterized in that: When the supervised training is performed, the feature embedding of the point cloud model and the cutting instruction in the data sample is input into the pre-trained language model, and the steps of using the LoRA fine-tuning technology to train the model to output a token sequence corresponding to the expected tool cutting posture include: For the weight matrix W0 of the pre-trained language model, the LoRA fine-tuning technology uses a low-rank decomposition method to constrain the update amount ΔW=BA of the pre-trained language model weight; wherein the ranks of the matrix A and the matrix B are both lower than the preset threshold value; During the training process, the parameters of the pre-trained language model are fixed, and only matrix A and matrix B are trained; the pre-trained language model parameters are combined after multiplying the trained matrix B with matrix A to serve as the fine-tuned pre-trained language model parameters; the input and output dimensions of the pre-trained language model remain unchanged.
7. A method for planning a machining path for a CNC machine tool according to claim 4, characterized in that: During the supervised training, the feature embedding of the point cloud model and the cutting instruction in the data sample is input into the pre-trained language model, and the LoRA fine-tuning technology is used to train the model to output a token sequence corresponding to the expected tool cutting posture. When fine-tuning training, the loss function L(θ) is used for optimization; In the formula, s prefix Contains point cloud model S 3D The feature embedding of and the feature embedding of cutting instructions, The token currently output by PLM; is the token output by PLM at the previous moment; T represents the length of the token sequence that PLM expects to output; L is the loss of the network during fine-tuning, and the network is fine-tuned by reducing the loss.
8. A CNC machine tool tool processing path planning system, characterized in that: include: A data acquisition module, used to obtain a point cloud model of a workpiece to be cut and cutting instructions; A preprocessing module, used for preprocessing the point cloud model and cutting instructions of the workpiece to be cut by using a preprocessing network to obtain feature embedding of the point cloud model and the cutting instructions; The path planning module is used to plan tool paths based on the feature embedding of the point cloud model and cutting instructions, using a fine-tuned large language model to obtain a token sequence that represents the tool cutting posture; The post-processing module is used to detokenize the token sequence representing the tool cutting posture to obtain the tool cutting posture sequence.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the CNC machine tool tool machining path planning method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for planning a tool machining path for a CNC machine tool is implemented as claimed in any one of claims 1 to 7.
Citation Information
Cited By
Knowledge model-based prediction method for machine tools
LU509019B1
Knowledge-model-based prediction method for machine tools
WO2026109677A1
