Part machining method and device based on space error model, medium and equipment
By constructing a spatial error model and particle swarm algorithm, the machining origin position of CNC machine tools is solved, and efficient and accurate parts processing is achieved.
Patent Information
- Application Number
- CN202510316452.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, there are errors in the machining process of CNC machine tools, resulting in low processing accuracy of parts, affecting product quality and enterprise competitiveness.
By constructing a spatial error model based on rotor theory, combining particle swarm algorithm, the processing origin position of CNC machine tools is optimized and the processing accuracy is improved.
It significantly improves the processing accuracy of parts, reduces the scrap rate, improves product quality, and improves processing efficiency and stability.
Smart Images

Figure CN120295220A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of mechanical manufacturing, and particularly to a part processing method, device, medium, and equipment based on a spatial error model. Background Art
[0002] With the rapid development of the manufacturing industry, as the core equipment of modern manufacturing, the machining accuracy of numerically controlled machine tools directly affects product quality and the competitiveness of enterprises. However, due to the influence of various factors such as the structure of the machine tool itself, assembly accuracy, thermal deformation, and wear, numerically controlled machine tools will inevitably generate errors during the machining process, thereby affecting the machining accuracy.
[0003] Therefore, how to accurately predict and control the errors of numerically controlled machine tools, optimize the machining process, and improve the machining accuracy has become an important research topic in the current manufacturing industry. Summary of the Invention
[0004] The main purpose of the present disclosure is to provide a part processing method, device, medium, and equipment based on a spatial error model, aiming to solve the technical problem of part quality failures caused by low part machining accuracy in the prior art.
[0005] To achieve the above object, the present disclosure proposes a part processing method based on a spatial error model, including:
[0006] Obtain the error data of the numerically controlled machine tool, where the error data includes geometric error data;
[0007] According to screw theory and the error data, construct a spatial error model of the numerically controlled machine tool, where the spatial error model is used to characterize the possible errors that may occur during the machining process of the numerically controlled machine tool;
[0008] Based on the spatial error model, determine the predicted dimensional accuracy result of the target part within the machining area of the numerically controlled machine tool;
[0009] Based on the particle swarm optimization algorithm and the predicted dimensional accuracy result, optimize the origin position of the target part within the machining area of the numerically controlled machine tool to obtain the target machining position of the target part;
[0010] Machine the target part according to the target machining position.
[0011] Optionally, the determining the predicted dimensional accuracy result of the target part within the machining area of the numerically controlled machine tool based on the spatial error model includes:
[0012] Obtain the geometric error data of the target measurement point within the machining space corresponding to the numerically controlled machine tool;
[0013] According to the least squares method for spatial curve fitting algorithm, the geometric error data is fitted to obtain the fitted spatial geometric error value;
[0014] Based on the spatial geometric error value, calculate the dimensional accuracy of the typical machining features of the target part to determine the predicted dimensional accuracy result.
[0015] Optionally, the calculating the dimensional accuracy of the target part based on the spatial error value to determine the predicted dimensional accuracy result includes:
[0016] Obtain the process programming trajectory of the target part;
[0017] According to the least squares method for spatial curve fitting algorithm, perform error fitting calculation on the typical machining features of the target part and the key points on the process programming trajectory to obtain the part dimensional error of the target part in the numerical control machine tool coordinate system;
[0018] Establish the mapping relationship between the machining coordinate system and the numerical control machine tool coordinate system;
[0019] Based on the mapping relationship, perform spatial coordinate transformation to convert the part dimensional error in the numerical control machine tool coordinate system into the part dimensional error in the machining coordinate system;
[0020] Based on the part dimensional error in the machining coordinate system, determine the predicted dimensional accuracy result.
[0021] Optionally, the performing spatial coordinate transformation based on the mapping relationship to convert the part dimensional error in the numerical control machine tool coordinate system into the part dimensional error in the machining coordinate system includes:
[0022] Determine the initial transformation matrix of the tool coordinate system of the numerical control machine tool relative to the numerical control machine tool coordinate system, where the initial transformation matrix includes the position offset of the tool coordinate system with zero movement in the axis direction relative to the machine tool coordinate system, as well as the tip point coordinates and tool axis vector in the tool coordinate system;
[0023] Obtain the tool movement trajectory of the numerical control machine tool;
[0024] According to the tool movement trajectory, determine the movement transformation matrix of the tool coordinate system relative to the numerical control machine tool coordinate system at the reference position;
[0025] Based on the initial transformation matrix and the movement transformation matrix, determine the complete transformation matrix of the tool coordinate system relative to the numerical control machine tool coordinate system;
[0026] Based on the complete transformation matrix, convert the dimensional error in the numerical control machine tool coordinate system into the dimensional error in the machining coordinate system.
[0027] Optionally, based on the particle swarm algorithm and the predicted dimensional accuracy result, optimize the origin position of the target part within the machining area of the CNC machine tool to obtain the target machining position of the target part, including:
[0028] According to the origin position, randomly initialize the position and velocity of each particle;
[0029] According to the position and velocity of each particle, and the spatial error model, calculate the fitness value of each particle;
[0030] According to the fitness value of each particle, determine the individual optimal solution and the global optimal solution;
[0031] Perform iterative search according to the individual optimal solution and the global optimal solution to determine the target machining position.
[0032] Optionally, characterized in that the iterative search according to the individual optimal solution and the global optimal solution to determine the target machining position includes:
[0033] According to the individual optimal solution and the global optimal solution, update the velocity and position of each particle to obtain the updated particles;
[0034] According to the position and velocity of the updated particles, and the spatial error model, calculate the fitness value of each updated particle;
[0035] Based on the fitness value of each updated particle, update the individual optimal solution and the global optimal solution;
[0036] Determine whether the preset boundary conditions and iteration stop conditions are satisfied;
[0037] If the boundary conditions and the iteration stop conditions are satisfied, determine the target machining position according to the updated global optimal solution.
[0038] Optionally, the CNC machine tool is a multi-axis configuration CNC machine tool, including:
[0039] Linear X-axis, linear Y-axis, linear Z-axis, and rotary A-axis and rotary C-axis;
[0040] The linear X-axis is used to represent the left-right movement direction of the CNC machine tool;
[0041] The linear Y-axis is used to represent the front-back movement direction of the CNC machine tool;
[0042] The linear Z-axis is used to represent the up-down movement direction of the CNC machine tool;
[0043] The rotating A-axis is used to control the target part or the tool of the CNC machine tool to perform a rotational movement according to the axis perpendicular to the machining plane;
[0044] The rotating C-axis is used to control the angular displacement of the target part relative to the tool.
[0045] In addition, to achieve the above object, the present disclosure also provides a part machining device based on a spatial error model. The part machining device based on the spatial error model includes:
[0046] An acquisition module, configured to acquire error data of the CNC machine tool, where the error data includes geometric error data;
[0047] A construction module, configured to construct a spatial error model of the CNC machine tool according to screw theory and the error data, where the spatial error model is used to characterize the possible errors that may occur during the machining process of the CNC machine tool;
[0048] A determination module, configured to determine a predicted dimensional accuracy result of the target part within the machining area of the CNC machine tool based on the spatial error model;
[0049] An optimization module, configured to optimize the origin position of the target part within the machining area of the CNC machine tool based on the particle swarm algorithm and the predicted dimensional accuracy result to obtain the target machining position of the target part;
[0050] A machining module, configured to machine the target part according to the target machining position.
[0051] In addition, to achieve the above object, the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the processor executes the computer program, the above method is implemented.
[0052] In addition, to achieve the above object, the present disclosure also provides an electronic device, which includes a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the above method is implemented.
[0053] In addition, to achieve the above object, the present disclosure also provides a computer program product, which implements the above method when being run by a processor.
[0054] The part processing method, device, medium and equipment based on the spatial error model proposed by the embodiments of the present disclosure construct a spatial error model of the numerical control machine tool according to screw theory and error data. Based on the spatial error model, the predicted dimensional accuracy result of the target part in the machining area of the numerical control machine tool is determined. Then, based on the particle swarm algorithm and the predicted dimensional accuracy result, the origin position of the target part in the machining area of the numerical control machine tool is optimized to obtain the target machining position of the target part. Finally, the target part is machined according to the target machining position. In this way, by using screw theory to construct the spatial error model of the numerical control machine tool, the error behavior of the numerical control machine tool during the machining process can be described and predicted more accurately. Based on this model, the dimensional accuracy result of the target part in the machining area of the numerical control machine tool can be accurately predicted, thereby providing a reliable basis for optimizing the machining origin position of the target part. The optimized machining origin position can significantly improve the machining accuracy, reduce the scrap rate of part machining, and improve the product quality. On the other hand, the application of the particle swarm algorithm makes the optimization process more efficient and accurate. This algorithm can quickly converge to the global optimal solution and find the optimal machining origin position, which not only reduces the calculation time but also improves the machining efficiency. By optimizing the machining origin position, the error during the machining process can be further reduced, and the machining process becomes more stable and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.
[0056] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment related to the solution of the embodiments of the present disclosure;
[0057] Figure 2 It is a schematic flowchart of a part processing method based on a spatial error model related to the solution of the embodiments of the present disclosure;
[0058] Figure 3 It is a block diagram of the structure of a part processing device based on a spatial error model related to the solution of the embodiments of the present disclosure.
[0059] The implementation, functional features and advantages of the object of the present disclosure will be further described in conjunction with the embodiments with reference to the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0060] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0061] Referring to Figure 1 , Figure 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present disclosure.
[0062] Generally, the device includes: at least one processor 301, a memory 302, and a part processing program based on a spatial error model stored on the memory 302 and executable on the processor 301. The part processing program based on the spatial error model is configured to implement the steps of the part processing method based on the spatial error model as described above.
[0063] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one of the hardware forms of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. The processor 301 may also include an AI (Artificial Intelligence) processor, and the AI processor is used to process operations related to the part processing method based on the spatial error model, so that the part processing method model based on the spatial error model can autonomously train and learn to improve efficiency and accuracy.
[0064] The memory 302 may include one or more storage media, which may be non-transitory. The memory 302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory storage media in the memory 302 is used to store at least one instruction for being executed by the processor 301 to implement the part machining method based on the spatial error model provided in the method embodiments of the present disclosure.
[0065] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302, and the communication interface 303 may be connected through a bus or signal lines. Each peripheral device may be connected to the communication interface 303 through a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 304, a display screen 305, and a power supply 306.
[0066] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, and the present embodiment does not limit this.
[0067] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts an electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on. The radio frequency circuit 304 may communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: a metropolitan area network, each generation of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may further include a circuit related to NFC (Near Field Communication), and the present disclosure does not limit this.
[0068] The display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to collect touch signals on or above the surface of the display screen 305. The touch signals can be input to the processor 301 as control signals for processing. At this time, the display screen 305 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, the display screen 305 can be one, the front panel of the electronic device; in other embodiments, the display screen 305 can be at least two, respectively arranged on different surfaces of the electronic device or in a foldable design; in still other embodiments, the display screen 305 can be a flexible display screen, arranged on the curved surface or the folding surface of the electronic device. Even, the display screen 305 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 305 can be prepared using materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0069] The power supply 306 is used to supply power to each component in the electronic device. The power supply 306 can be alternating current, direct current, a disposable battery, or a rechargeable battery. When the power supply 306 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology. Those skilled in the art can understand that Figure 1 the structure shown in does not constitute a limitation on the device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0070] In addition, embodiments of the present disclosure also propose a storage medium, on which a part processing program based on a spatial error model is stored. When the part processing program based on the spatial error model is executed by a processor, the steps of the part processing method based on the spatial error model as described above are implemented. Therefore, details will not be described herein again. In addition, the description of the beneficial effects of using the same method will not be repeated. For the technical details not disclosed in the embodiments of the storage medium involved in the present disclosure, please refer to the description of the method embodiments of the present disclosure. By way of example, the program instructions can be deployed to be executed on one device, or on multiple devices located at one location, or, on multiple devices distributed at multiple locations and interconnected through a communication network.
[0071] Those of ordinary skill in the art can understand that all or part of the processes in implementing the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The above program can be stored in a storage medium. When the program is executed, it can include the processes of the embodiments of the above various methods. Among them, the above storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0072] Currently, most research focuses on the calculation and evaluation of the spatial error of CNC machine tools, aiming to closely combine the accuracy of the machine tool with the machining quality of parts, thereby effectively improving the machining quality of parts and significantly reducing the failures caused by quality problems. This research direction is of great significance for improving the overall performance and machining efficiency of CNC machine tools. In the research field of the spatial error modeling and accuracy prediction of CNC machine tools, for the construction of the CNC spatial error model, the traditional approach mainly relies on the geometric relationship between the moving axes of the machine tool and models the spatial error through the low-order body array, but its calculation efficiency is not good and the calculation process is relatively complex.
[0073] In view of this, the present disclosure provides a part machining method, device, medium, and equipment based on a spatial error model, aiming to closely combine the accuracy of the machine tool with the machining quality of parts, thereby effectively improving the machining quality of parts and reducing the failures caused by quality problems.
[0074] Refer to Figure 2 , Figure 2 which is a schematic flow chart of a part machining method based on a spatial error model according to the embodiment solution of the present disclosure, including the following steps:
[0075] Step S11: Obtain the error data of the CNC machine tool, and the error data includes geometric error data.
[0076] Step S12: According to screw theory and the error data, construct a spatial error model of the CNC machine tool, and the spatial error model is used to characterize the possible errors that may occur during the machining process of the CNC machine tool.
[0077] Step S13: Based on the spatial error model, determine the predicted dimensional accuracy result of the target part within the machining area of the CNC machine tool.
[0078] Step S14: Based on the particle swarm algorithm and the predicted dimensional accuracy result, optimize the origin position of the target part within the machining area of the CNC machine tool to obtain the target machining position of the target part.
[0079] Step S15: Machine the target part according to the target machining position.
[0080] Exemplarily, the error data of the numerical control machine tool can be collected from data sources such as public data sets and web crawlers, or obtained from local data sets or specified folders. It can be obtained in advance or in real time after receiving the part processing, and the embodiments of the present disclosure do not limit this. The error data can include geometric error data such as straightness error, angular error, and positioning error, or can include other types of error data. Specifically, the corresponding error data can be obtained according to actual application requirements, and the embodiments of the present disclosure do not limit this either.
[0081] In addition, corresponding small-angle error hypothesis models, multi-body system kinematics theory models, geometric error sensitivity analysis models, etc. can be constructed according to the obtained error data, and the embodiments of the present disclosure do not specifically limit this.
[0082] Through the above technical solution, according to screw theory and error data, a spatial error model of the numerical control machine tool is constructed. Based on the spatial error model, the predicted dimensional accuracy result of the target part in the machining area of the numerical control machine tool is determined. Then, based on the particle swarm algorithm and the predicted dimensional accuracy result, the origin position of the target part in the machining area of the numerical control machine tool is optimized to obtain the target machining position of the target part. Finally, the target part is machined according to the target machining position. In this way, by using screw theory to construct the spatial error model of the numerical control machine tool, the error behavior of the numerical control machine tool during the machining process can be described and predicted more accurately. Based on this model, the dimensional accuracy result of the target part in the machining area of the numerical control machine tool can be accurately predicted, providing a reliable basis for optimizing the machining origin position of the target part. The optimized machining origin position can significantly improve the machining accuracy, reduce the scrap rate of part machining, and improve the product quality. On the other hand, the application of the particle swarm algorithm makes the optimization process more efficient and accurate. This algorithm can quickly converge to the global optimal solution and find the optimal machining origin position, not only reducing the calculation time but also improving the machining efficiency. By optimizing the machining origin position, the error during the machining process can be further reduced, making the machining process more stable and reliable.
[0083] Furthermore, this technical solution is not only applicable to specific types of numerical control machine tools and part machining processes, but also has strong adaptability and scalability. By collecting different types of error data and constructing corresponding spatial error models, it can be applied to numerical control machine tools of different models and structures and different machining requirements. This provides a flexible solution for various application scenarios in the manufacturing industry.
[0084] By improving the machining accuracy and optimizing the machining process, this technical solution can reduce the scrap rate and rework rate, and lower the production cost. At the same time, since the optimized machining origin position can reduce unnecessary material waste and machine tool wear, the production cost and maintenance cost are further reduced.
[0085] It should be understood that the part processing method based on the spatial error model of the present disclosure can be applied to numerically controlled machine tools with a multi-axis configuration. Therefore, in a possible manner, the numerically controlled machine tool can be a numerically controlled machine tool with a multi-axis configuration, specifically including:
[0086] A linear X-axis, a linear Y-axis, a linear Z-axis, and a rotary A-axis and a rotary C-axis;
[0087] The linear X-axis is used to represent the left-right movement direction of the numerically controlled machine tool;
[0088] The linear Y-axis is used to represent the front-back movement direction of the numerically controlled machine tool;
[0089] The linear Z-axis is used to represent the up-down movement direction of the numerically controlled machine tool;
[0090] The rotary A-axis is used to control the target part or the tool of the numerically controlled machine tool to perform a rotational movement according to the axis perpendicular to the machining plane;
[0091] The rotary C-axis is used to control the angular displacement of the target part relative to the tool.
[0092] It is worth noting that the part processing method based on the spatial error model of the present disclosure can also be applied to multi-axis numerically controlled machine tools including other configurations. The following will take the above-mentioned five-axis configuration numerically controlled machine tool as an example for illustration.
[0093] In a possible manner, based on the spatial error model, determining the predicted dimensional accuracy result of the target part within the machining area of the numerically controlled machine tool includes:
[0094] Obtaining the geometric error data of the target measurement point within the machining space corresponding to the numerically controlled machine tool;
[0095] According to the least squares spatial curve fitting algorithm, performing fitting processing on the geometric error data to obtain the fitted spatial geometric error value;
[0096] Calculating the dimensional accuracy of the typical machining features of the target part through the spatial geometric error value to determine the predicted dimensional accuracy result.
[0097] Exemplarily, after the spatial error model of the numerically controlled machine tool is constructed, first, a geometric accuracy detection instrument for the numerically controlled machine tool can be used for detection, and various geometric errors of the target measurement points in the machining space of the numerically controlled machine tool can be identified and separated to obtain geometric error data. Then, using the least squares method spatial curve fitting algorithm, through fitting calculation of the geometric error data of the target measurement points and combining with the spatial error model of the numerically controlled machine tool, the spatial geometric error value at any position in the machining space of the numerically controlled machine tool can be calculated. Then, based on the obtained spatial geometric error value, the dimensional accuracy of the typical machining features of the target part is calculated to determine the predicted dimensional accuracy result. Among them, the geometric accuracy detection instrument can include a laser interferometer, a laser tracking interferometer, a rotary axis error analyzer, a ballbar, etc.
[0098] It should be understood that in order to simplify the calculation process and improve the calculation efficiency, the influence of thermal error and dynamic error on the error fitting result can be ignored in the present disclosure. For the above-mentioned five-axis numerically controlled machine tool, fitting calculations are respectively performed on the geometric errors of the linear axis and the rotary axis, which can effectively simplify the calculation process, improve the calculation efficiency, and reduce the detection requirements of the spatial error terms of the numerically controlled machine tool and the analysis requirements of the error sources.
[0099] In a possible manner, calculating the dimensional accuracy of the target part through the spatial error value to determine the predicted dimensional accuracy result includes:
[0100] Obtain the process programming trajectory of the target part;
[0101] According to the least squares method spatial curve fitting algorithm, perform error fitting calculations on the typical machining features of the target part and the key points on the process programming trajectory to obtain the part dimensional error of the target part in the numerically controlled machine tool coordinate system;
[0102] Establish the mapping relationship between the machining coordinate system and the numerically controlled machine tool coordinate system;
[0103] Based on the mapping relationship, perform spatial coordinate transformation to convert the part dimensional error in the numerically controlled machine tool coordinate system into the part dimensional error in the machining coordinate system;
[0104] Based on the part dimensional error in the machining coordinate system, determine the predicted dimensional accuracy result.
[0105] Exemplarily, based on the process programming trajectory, machining origin, and measurement origin position information of the machined part, by applying the least squares curve fitting method, the errors of the typical machining features of the target part and the key points on its machining trajectory can be accurately fitted and calculated. This step aims to obtain detailed data on the part size error relative to the machine tool coordinate system. Subsequently, through spatial coordinate transformation technology, an accurate mapping relationship between the machining coordinate system and the machine tool coordinate system is established. Based on this mapping relationship, the predicted machining dimension accuracy of the typical machining features in the machining coordinate system can be accurately solved. This process ensures the predictability and controllability of machining accuracy, providing strong support for improving product quality and machining efficiency.
[0106] Then, convert the part size error in the CNC machine tool coordinate system into the part size error in the machining coordinate system, and then determine the predicted dimension accuracy result based on the part size error in the machining coordinate system.
[0107] In a possible way, based on the mapping relationship, perform spatial coordinate transformation to convert the part size error in the CNC machine tool coordinate system into the part size error in the machining coordinate system, including:
[0108] Determine the initial transformation matrix of the tool coordinate system of the CNC machine tool relative to the CNC machine tool coordinate system. The initial transformation matrix includes the position offset of the tool coordinate system relative to the machine tool coordinate system when the axis movement amount of the tool coordinate system is zero, as well as the tip point coordinates and tool axis vector in the tool coordinate system;
[0109] Obtain the tool movement trajectory of the CNC machine tool;
[0110] According to the tool movement trajectory, determine the movement transformation matrix of the tool coordinate system relative to the CNC machine tool coordinate system at the reference position;
[0111] Based on the initial transformation matrix and the movement transformation matrix, determine the complete transformation matrix of the tool coordinate system relative to the CNC machine tool coordinate system;
[0112] Based on the complete transformation matrix, convert the dimension error in the CNC machine tool coordinate system into the dimension error in the machining coordinate system.
[0113] It should be understood that the initial transformation matrix includes the position offset of the origin of the tool coordinate system relative to the origin of the machine tool coordinate system, as well as the tip point coordinates and tool axis vector in the tool coordinate system. The tool movement trajectory is the movement path of the tool during the machining process of the CNC machine tool. This path is usually defined by the CNC program and describes the movement process of the tool from the starting position to the ending position.
[0114] Based on the tool's motion trajectory, the motion transformation matrix of the tool coordinate system relative to the machine tool coordinate system can be determined at a specific reference position such as a certain machining point or inspection point. This motion transformation matrix describes the changes in the position and orientation of the tool in the machine tool coordinate system when the tool moves from the initial position to the reference position.
[0115] The complete transformation matrix is a combination of the initial transformation matrix and the motion transformation matrix, which describes the total transformation relationship from the machine tool coordinate system to the tool coordinate system, including the initial position and orientation of the tool, as well as the motion changes from the initial position to the reference position.
[0116] Based on the complete transformation matrix, the dimensional error in the machine tool coordinate system can be converted into the dimensional error in the machining coordinate system (or workpiece coordinate system). This conversion process usually involves matrix operations in linear algebra, multiplying the error vector in the machine tool coordinate system by the inverse matrix of the complete transformation matrix to obtain the error vector in the machining coordinate system.
[0117] Exemplarily, the initial transformation matrix can be:
[0118]
[0119] G bt (0) is the motion transformation matrix of the tool coordinate system relative to the CNC machine tool coordinate system at the reference position, and can be:
[0120]
[0121] where P is the coordinate of the tool tip point, O is the tool axis vector, t0 is the position offset of the tool coordinate system relative to the machine tool coordinate system when the movement amount of each axis of the tool is 0, r pt is the coordinate of the tool tip point in the tool coordinate system, r ot is the tool axis vector in the tool coordinate system.
[0122] For the straight line X axis:
[0123]
[0124] For the straight line Y axis:
[0125]
[0126] For the straight line Z axis:
[0127]
[0128] For the rotating A axis:
[0129]
[0130] where θ xLet θ represent the angle through which the A-axis rotation axis rotates; let y0 represent the Y-axis coordinate of the center of rotation of the A-axis in the machine tool coordinate system; let z0 represent the Z-axis coordinate of the center of rotation of the A-axis in the machine tool coordinate system.
[0131] For the rotating C-axis:
[0132]
[0133]
[0134] where θ z represents the angle through which the C-axis rotation axis rotates; let y0 represent the Y-axis coordinate of the center of rotation of the C-axis in the machine tool coordinate system; let x0 represent the X-axis coordinate of the center of rotation of the C-axis in the machine tool coordinate system.
[0135] Combining the above formulas, the tool tip point coordinates P and the tool axis vector O of the tool tip point in the machine tool coordinate system can be obtained. By substituting each error term, the actual position of the tool tip point of the CNC machine tool in the machine tool coordinate system can be obtained, that is, the dimensional error in the CNC machine tool coordinate system is converted into the dimensional error in the machining coordinate system.
[0136] In a possible way, based on the particle swarm algorithm and the predicted dimensional accuracy results, the origin position of the target part in the machining area of the CNC machine tool is optimized to obtain the target machining position of the target part, including:
[0137] According to the origin position, randomly initialize the position and velocity of each particle;
[0138] According to the position and velocity of each particle, and the spatial error model, calculate the fitness value of each particle;
[0139] According to the fitness value of each particle, determine the individual optimal solution and the global optimal solution;
[0140] Perform iterative search according to the individual optimal solution and the global optimal solution to determine the target machining position.
[0141] Exemplarily, after entering the optimization process, first take the given origin position in the machining area of the CNC machine tool as a reference, randomly generate a particle swarm, and initially set the scale of the particle swarm, the particle movement speed, and randomly distribute the initial positions of the particle swarm within the solution domain. The initial position of the particle swarm is the position of the part machining origin (i.e., the origin of the machining coordinate system).
[0142] Then, according to the part features and dimensional accuracy requirements of the target part, construct an objective function for evaluating the quality of the machining position. This objective function is usually a mathematical expression that receives a machining position as input and outputs a numerical value representing the machining accuracy, that is, the fitness value.
[0143] Exemplarily, the objective function of the hole position feature can be expressed as:
[0144]
[0145] where E total represents the overall hole position deviation; E error X represents the positioning deviation in the X direction; E error Y represents the positioning deviation in the Y direction; E error Z represents the positioning deviation in the Z direction; EX represents the positioning deviation in the X direction caused by the movement of the linear axis X; EY represents the positioning deviation in the Y direction caused by the movement of the linear axis Y; EZ represents the positioning deviation in the Z direction caused by the movement of the linear axis Z; EA represents the positioning deviation caused by the movement of the rotary axis A; EC represents the positioning deviation caused by the movement of the rotary axis C; (x1, y1, z1, c1, a1) is the starting coordinate of the tool tip point in the machine coordinate system in the machining program; (x2, y2, z2, c2, a2) is the ending coordinate of the tool tip point in the machine coordinate system in the machining program.
[0146] The objective function of the edge feature can be expressed as:
[0147]
[0148] where E total represents the overall machining deviation; E error X represents the positioning deviation in the X direction; E error Y represents the positioning deviation in the Y direction; E error Z represents the positioning deviation in the Z direction; (x1, y1, z1, c1, a1) represents the starting coordinate of the tool tip point in the machine coordinate system in the machining program; (x2, y2, z2, c2, a2) represents the ending coordinate of the tool tip point in the machine coordinate system in the machining program.
[0149] After the particle initialization is completed, the iterative optimization process is entered. In each round of iteration, the position of each particle is substituted into the spatial error model, and then through calculation, the fitness value of each particle is determined, which reflects the machining accuracy of the machining position corresponding to the particle.
[0150] Then, according to the fitness value of each particle, the individual optimal solution and the global optimal solution are determined. After obtaining the fitness value of each particle, a comparison is made to find the individual with the best fitness value among all the current particles, that is, the individual optimal solution, and the individual with the best fitness value in the historical iteration data, that is, the global optimal solution. These two optimal solutions will be used as references for the movement of the particles in the subsequent iteration.
[0151] Specifically, by comparing the fitness values of each particle, the influence of the settings of each machining origin in the machine tool coordinate system on the final machining accuracy value is obtained, and the optimal fitness is used as the individual optimal solution. According to the part machining process requirements, the global optimal fitness value is set, and the fitness values among each particle are compared to reflect the influence of the settings of each machining origin position in the machine tool coordinate system on the final machining dimensional accuracy, and the optimal fitness value is searched and updated to replace the population optimal solution.
[0152] In a possible way, iterative search is performed according to the individual optimal solution and the population optimal solution to determine the target machining position, including:
[0153] According to the individual optimal solution and the population optimal solution, update the velocity and position of each particle to obtain the updated particles;
[0154] According to the position and velocity of the updated particles, and the spatial error model, calculate the fitness value of each updated particle;
[0155] Based on the fitness values of each updated particle, update the individual optimal solution and the population optimal solution;
[0156] Determine whether the preset boundary conditions and iteration stop conditions are satisfied;
[0157] If the boundary conditions and iteration stop conditions are satisfied, determine the target machining position according to the updated population optimal solution.
[0158] Exemplarily, after determining the individual optimal solution and the population optimal solution, the position and current velocity of each particle are combined with these two optimal solutions to update the position and velocity of each particle. That is, each particle will approach its own individual optimal solution and the optimal solution of the entire population. Through continuous iteration and update, the particle swarm will gradually converge to the optimal machining position, and finally determine the target machining position. Among them, the velocity and position of each particle are both 1 three-dimensional vector.
[0159] The velocity update formula can be:
[0160] V ij (t + 1) = V ij (t) + c1r1(t)[p ij (t) - x ij (t)] + c2r2[p gj (t) - x ij (t)]
[0161] Where: i is the particle number, t is the particle iteration number, j is the search space dimension. In this disclosure, the search space can be set to 3D. c1 and c2 are the individual learning factor and social learning factor of the particle respectively, and their values are set as c1 = c2 = 1. r1 and r2 are random numbers between [0, 1] to avoid getting trapped in the local optimum too quickly. p ij (t) is the optimal objective value passed by the i-th particle after the t-th iteration. p gj (t) is the optimal objective value passed by all particles after the t-th iteration.
[0162] Then, update the position of the particle according to the moving speed of the particle. The update formula for a single particle can be:
[0163] x ij (t + 1) = x ij (t) + v ij (t + 1)
[0164] Exemplarily, the search boundary conditions can be set according to the machining range of the CNC machine tool and the geometric dimensions of the part.
[0165] The size setting of the search domain can be:
[0166] X b = X m - X p
[0167] Where, X b is the range of the search domain in the X direction of space, X m is the range of the X axis of the machine tool, X p is the range of the target part in the X direction. Similarly, the range sizes of the search domains in the Y and Z directions can be obtained.
[0168] Exemplarily, meeting the iteration stop condition can be greater than the optimization iteration number of the particle swarm. The optimization iteration number of the particle swarm can be determined according to the ratio of the geometric dimensions of the part to the machining space of the machine tool.
[0169] The optimization iteration number N can be expressed as:
[0170] N = Volume T / (Volume All × A)
[0171] Where, N is the optimization iteration number, Volume T is the minimum envelope space volume of the target object, Volume All is the space volume of the CNC machine tool, and A is the error evaluation level, which can generally be 0.01 or 0.001. When the iteration number of the particle swarm reaches the optimization iteration number or the change value of the fitness value is less than A, the search stops.
[0172] Reference Figure 3 , Figure 3 As shown in Figure 3 , this is a structural block diagram of a part processing device based on a spatial error model involved in the solution of an embodiment of the present disclosure. Based on the same inventive concept as the foregoing embodiment, the device includes:
[0173] An acquisition module 10, configured to acquire error data of a numerical control machine tool, where the error data includes geometric error data;
[0174] A construction module 20, configured to construct a spatial error model of the numerical control machine tool according to screw theory and the error data, where the spatial error model is used to characterize the errors that may occur during the processing of the numerical control machine tool;
[0175] A determination module 30, configured to determine a predicted dimension accuracy result of the target part within the machining area of the numerical control machine tool based on the spatial error model;
[0176] An optimization module 40, configured to optimize the origin position of the target part within the machining area of the numerical control machine tool based on a particle swarm algorithm and the predicted dimension accuracy result to obtain a target machining position of the target part;
[0177] A machining module 50, configured to machine the target part according to the target machining position. Optionally, the recognition module 20 is used for:
[0178] Optionally, the determination module 30 is used for:
[0179] Acquire geometric error data of a target measurement point within the machining space corresponding to the numerical control machine tool;
[0180] Perform fitting processing on the geometric error data according to the least squares spatial curve fitting algorithm to obtain a fitted spatial geometric error value;
[0181] Calculate the dimension accuracy of the typical machining features of the target part through the spatial geometric error value to determine the predicted dimension accuracy result.
[0182] Optionally, the determination module 30 is used for:
[0183] Acquire the process programming trajectory of the target part;
[0184] Perform error fitting calculation on the typical machining features of the target part and key points on the process programming trajectory according to the least squares spatial curve fitting algorithm to obtain the part dimension error of the target part in the numerical control machine tool coordinate system;
[0185] Establish a mapping relationship between the machining coordinate system and the numerical control machine tool coordinate system;
[0186] Based on the mapping relationship, perform a spatial coordinate transformation to convert the part dimension error in the numerical control machine tool coordinate system into the part dimension error in the machining coordinate system;
[0187] Based on the part dimension error in the machining coordinate system, determine the predicted dimension accuracy result.
[0188] Optionally, the determining module 30 is configured to:
[0189] Determine the initial transformation matrix of the tool coordinate system of the numerical control machine tool relative to the numerical control machine tool coordinate system, where the initial transformation matrix includes the position offset of the tool coordinate system relative to the machine tool coordinate system when the axis movement amount is zero, as well as the tip point coordinates and the tool axis vector in the tool coordinate system;
[0190] Obtain the tool movement trajectory of the numerical control machine tool;
[0191] According to the tool movement trajectory, determine the movement transformation matrix of the tool coordinate system relative to the numerical control machine tool coordinate system at the reference position;
[0192] Based on the initial transformation matrix and the movement transformation matrix, determine the complete transformation matrix of the tool coordinate system relative to the numerical control machine tool coordinate system;
[0193] Based on the complete transformation matrix, convert the dimension error in the numerical control machine tool coordinate system into the dimension error in the machining coordinate system.
[0194] Optionally, the optimization module 40 is configured to:
[0195] According to the origin position, randomly initialize the position and velocity of each particle;
[0196] According to the position and velocity of each particle, and the spatial error model, calculate the fitness value of each particle;
[0197] According to the fitness value of each particle, determine the individual optimal solution and the global optimal solution;
[0198] Perform iterative search according to the individual optimal solution and the global optimal solution to determine the target machining position.
[0199] Optionally, the optimization module 40 is configured to:
[0200] According to the individual optimal solution and the global optimal solution, update the velocity and position of each particle to obtain the updated particles;
[0201] According to the position and velocity of the updated particles, and the spatial error model, calculate the fitness value of each updated particle;
[0202] Update the individual optimal solution and the population optimal solution based on the updated fitness value of each particle.
[0203] Determine whether the preset boundary conditions and iteration stop conditions are satisfied.
[0204] If the boundary conditions and the iteration stop conditions are satisfied, determine the target machining position according to the updated population optimal solution.
[0205] Optionally, the numerical control machine tool is a multi-axis configuration numerical control machine tool, including:
[0206] A linear X-axis, a linear Y-axis, a linear Z-axis, and a rotating A-axis and a rotating C-axis;
[0207] The linear X-axis is used to represent the left-right movement direction of the numerical control machine tool;
[0208] The linear Y-axis is used to represent the front-back movement direction of the numerical control machine tool;
[0209] The linear Z-axis is used to represent the up-down movement direction of the numerical control machine tool;
[0210] The rotating A-axis is used to control the target part or the tool of the numerical control machine tool to perform a rotational movement around an axis perpendicular to the machining plane;
[0211] The rotating C-axis is used to control the angular displacement of the target part relative to the tool.
[0212] It should be noted that since the steps executed by the device in this embodiment are the same as those in the foregoing method embodiment, the specific implementation manners and the achievable technical effects can refer to the foregoing embodiment and will not be elaborated here.
[0213] In addition, in one embodiment, the embodiments of the present disclosure further provide an electronic device, the device includes a processor, a memory, and a computer program stored in the memory, and the computer program realizes the steps of the method in the foregoing embodiment when being run by the processor.
[0214] In addition, in one embodiment, the embodiments of the present disclosure further provide a computer storage medium, and a computer program is stored on the computer storage medium, and the computer program realizes the steps of the method in the foregoing embodiment when being run by the processor.
[0215] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories. The computer may be various computing devices including smart terminals and servers.
[0216] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as a stand-alone program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0217] As an example, the executable instructions may or may not correspond to a file in the file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or, stored in multiple cooperating files (such as files that store one or more modules, subroutines, or portions of code).
[0218] As an example, the executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one location, or, on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0219] It should be noted that in this document, the term "comprising", "may comprise", or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or system. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article, or system comprising that element.
[0220] The serial numbers of the above embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0221] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory / random access memory, magnetic disk, optical disk), and includes several instructions for causing a multimedia terminal device (which may be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in various embodiments of the present disclosure.
[0222] The above are only optional embodiments of the present disclosure, and do not limit the patent scope of the present disclosure. Any equivalent structural transformation made by using the content of the specification and drawings of the present disclosure under the inventive concept of the present disclosure, or any direct / indirect application in other related technical fields is included in the patent protection scope of the present disclosure.
Claims
1. A method for machining parts based on a spatial error model, characterized in that, Including: Obtain error data of a numerically controlled machine tool, where the error data includes geometric error data; Construct a spatial error model of the numerically controlled machine tool according to screw theory and the error data, and the spatial error model is used to characterize the possible errors that may occur during the machining process of the numerically controlled machine tool; Based on the spatial error model, determine the predicted dimensional accuracy result of the target part within the machining area of the numerically controlled machine tool; Based on the particle swarm optimization algorithm and the predicted dimensional accuracy result, optimize the origin position of the target part within the machining area of the numerically controlled machine tool to obtain the target machining position of the target part; Machine the target part according to the target machining position.
2. The method according to claim 1, characterized in that The determining the predicted dimensional accuracy result of the target part within the machining area of the numerically controlled machine tool based on the spatial error model includes: Obtain the geometric error data of the target measurement point within the machining space corresponding to the numerically controlled machine tool; Perform fitting processing on the geometric error data according to the least squares method spatial curve fitting algorithm to obtain the fitted spatial geometric error value; Calculate the dimensional accuracy of the typical machining features of the target part through the spatial geometric error value to determine the predicted dimensional accuracy result.
3. The method according to claim 2, characterized in that, The calculating the dimensional accuracy of the target part through the spatial error value to determine the predicted dimensional accuracy result includes: Obtain the process programming trajectory of the target part; Perform error fitting calculation on the typical machining features of the target part and the key points on the process programming trajectory according to the least squares method spatial curve fitting algorithm to obtain the part dimensional error of the target part in the numerically controlled machine tool coordinate system; Establish the mapping relationship between the machining coordinate system and the numerically controlled machine tool coordinate system; Based on the mapping relationship, perform spatial coordinate transformation to convert the part dimensional error in the numerically controlled machine tool coordinate system into the part dimensional error in the machining coordinate system; Based on the part dimensional error in the machining coordinate system, determine the predicted dimensional accuracy result.
4. The method according to claim 3, wherein The performing spatial coordinate transformation based on the mapping relationship to convert the part dimensional error in the numerically controlled machine tool coordinate system into the part dimensional error in the machining coordinate system includes: Determine the initial transformation matrix of the tool coordinate system of the numerically controlled machine tool relative to the numerically controlled machine tool coordinate system, where the initial transformation matrix includes the position offset of the tool coordinate system relative to the machine tool coordinate system when the axis movement amount is zero, as well as the tip point coordinate and tool axis vector in the tool coordinate system; Obtain the tool movement trajectory of the numerically controlled machine tool; According to the tool movement trajectory, determine the movement transformation matrix of the tool coordinate system relative to the numerically controlled machine tool coordinate system at the reference position; Based on the initial transformation matrix and the movement transformation matrix, determine the complete transformation matrix of the tool coordinate system relative to the numerically controlled machine tool coordinate system; Based on the complete transformation matrix, convert the dimensional error in the numerically controlled machine tool coordinate system into the dimensional error in the machining coordinate system.
5. The method according to claim 1, wherein Optimizing the origin position of the target part within the machining area of the CNC machine tool based on the particle swarm algorithm and the predicted dimensional accuracy result to obtain the target machining position of the target part, including: Randomly initializing the position and velocity of each particle according to the origin position; Calculating the fitness value of each particle according to the position and velocity of each particle and the spatial error model; Determining the individual optimal solution and the global optimal solution according to the fitness value of each particle; Performing iterative search according to the individual optimal solution and the global optimal solution to determine the target machining position.
6. The method according to claim 5, characterized in that The iterative search according to the individual optimal solution and the global optimal solution to determine the target machining position includes: Updating the velocity and position of each particle according to the individual optimal solution and the global optimal solution to obtain the updated particles; Calculating the fitness value of each updated particle according to the position and velocity of the updated particle and the spatial error model; Updating the individual optimal solution and the global optimal solution based on the fitness value of each updated particle; Determining whether the preset boundary conditions and iteration stop conditions are satisfied; If the boundary conditions and the iteration stop conditions are satisfied, determining the target machining position according to the updated global optimal solution.
7. The method according to any one of claims 1 to 6, characterized in that The CNC machine tool is a multi-axis configured CNC machine tool, including: Linear X-axis, linear Y-axis, linear Z-axis, and rotary A-axis and rotary C-axis; The linear X-axis is used to represent the left-right movement direction of the CNC machine tool; The linear Y-axis is used to represent the front-back movement direction of the CNC machine tool; The linear Z-axis is used to represent the up-down movement direction of the CNC machine tool; The rotary A-axis is used to control the target part or the tool of the CNC machine tool to perform rotary motion around an axis perpendicular to the machining plane; The rotary C-axis is used to control the angular displacement of the target part relative to the tool.
8. A part processing device based on a spatial error model, characterized in that, Including: An acquisition module for acquiring error data of the CNC machine tool, where the error data includes geometric error data; A construction module for constructing a spatial error model of the CNC machine tool according to screw theory and the error data, and the spatial error model is used to characterize the possible errors that may occur during the machining process of the CNC machine tool; A determination module for determining the predicted dimensional accuracy result of the target part within the machining area of the CNC machine tool based on the spatial error model; An optimization module for optimizing the origin position of the target part within the machining area of the CNC machine tool based on the particle swarm algorithm and the predicted dimensional accuracy result to obtain the target machining position of the target part; A machining module for machining the target part according to the target machining position.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and the processor executes the computer program to implement the method according to any one of claims 1-7.
10. An electronic device, characterized in that, The electronic device includes a memory and a processor, a computer program is stored in the memory, and the processor executes the computer program to implement the method according to any one of claims 1-7.