Method and device for extracting surface NC machining information based on B-spline surface reconstruction
Through the B-spline surface reconstruction method, the rapidity, smoothness and accuracy problems of the surface reconstruction algorithm when dealing with disordered knife sites are solved, and efficient and accurate surface CNC machining is achieved.
Patent Information
- Application Number
- CN202411740343.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-11-29
AI Technical Summary
In the prior art, surface reconstruction algorithms are difficult to take into account the requirements of speed, smoothness and accuracy when dealing with disordered spatial discrete tool sites.
Using a method based on B-spline surface reconstruction, the B-spline surface parameters are determined by obtaining tool site information, calculating accuracy and smooth energy indicators, generating comprehensive indicators, solving the tool positioning surface reconstruction problem, reconstructing the tool positioning surface and extracting processing information.
It effectively improves the quality and efficiency of complex surface processing, improves the accuracy and stability of surface CNC machining, and reduces machining errors.
Smart Images

Figure CN119575869B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of numerical control system information processing, and in particular to a method and device for extracting surface numerical control machining information based on B-spline surface reconstruction. Background Art
[0002] Among related technologies, surface reconstruction technology is a type of technology that can reconstruct a complete continuous surface based on a large number of discrete points. In the context of surface CNC machining, the tool positioning surface can be reversely reconstructed using the tool location information contained in the machining program. The tool positioning surface has obvious advantages over the discrete tool location information in the machining program. On the one hand, the tool positioning surface has good positional continuity, which helps to improve the smoothness and consistency of the surface machining process; on the other hand, the detailed geometric information extracted based on the tool positioning surface (such as curvature, normal, etc.) can be further used for tasks such as machining program optimization, trajectory smoothing, speed planning and interpolation, further improving machining quality.
[0003] However, in related technologies, surface reconstruction algorithms usually find it difficult to balance the requirements of speed, smoothness and accuracy when processing disordered spatially discrete tool positions, and urgently need to be improved. Summary of the Invention
[0004] The present application provides a method and device for extracting surface CNC machining information based on B-spline surface reconstruction to solve the problem in related technologies that surface reconstruction algorithms are generally difficult to balance the requirements of speed, smoothness and accuracy when processing disordered spatial discrete tool position points.
[0005] The first aspect of the present application provides a method for extracting surface CNC machining information based on B-spline surface reconstruction, comprising the following steps: obtaining three-dimensional spatial position information of at least one surface machining tool position point; parameterizing the at least one surface machining tool position point based on the three-dimensional spatial position information; determining the B-spline surface parameters of the tool positioning surface based on the parameterized tool position point; determining the accuracy index of the tool positioning surface based on the sum of the squares of the deviations between all tool position points and the tool positioning surface based on the B-spline surface parameters to calculate a regression matrix; determining the smoothing energy index of the tool positioning surface to calculate a smoothing energy matrix; determining a comprehensive index based on the accuracy index and the smoothing energy index to generate a tool positioning surface reconstruction problem based on the comprehensive index; solving the tool positioning surface reconstruction problem to obtain a tool positioning surface reconstruction structure and extracting surface CNC machining information.
[0006] Through the above technical solution, the embodiment of the present application can effectively reconstruct the tool positioning surface and extract processing information by obtaining tool location point information and a series of processing. Tool location point parameterization can handle disordered scattered points, making subsequent calculations more accurate. Determining the parameters of the B-spline surface is flexible and the quasi-uniform node vector is selected to ensure the surface quality. The precision index calculation is scientific, based on the sum of squared deviations combined with matrix expression and regression matrix calculation to accurately quantify the precision requirements. The smoothing energy index takes into account multiple factors, based on the thin plate energy definition and through matrix calculation, taking into account stability and smoothness. The comprehensive index introduces adjustable precision and smoothness tendency to meet different needs. The linear equation system is solved quickly and the results are optimal, which improves the calculation speed and fitting effect. The final extracted processing information can further optimize the surface CNC machining and effectively improve the quality and efficiency of complex surface machining.
[0007] Optionally, in one embodiment of the present application, the tool position parameterization of the at least one surface machining tool position point based on the three-dimensional spatial position information includes: projecting the at least one surface machining tool position point onto a target two-dimensional projection plane according to a preset projection vector; dividing the target two-dimensional projection plane into enclosing rectangular areas surrounding the projection points corresponding to all tool position points; based on the two-dimensional position relationship within the target projection plane, linearly mapping the enclosing rectangular areas to unit rectangles in the parameter domain of the B-spline surface according to a preset length relationship, so as to calculate the parameter value corresponding to each tool position point according to the mapping relationship.
[0008] Through the above technical solution, the embodiment of the present application can realize the effective conversion from three-dimensional space to two-dimensional plane by projecting the tool position points of the surface machining onto a two-dimensional projection plane and dividing the enclosing rectangular area, thereby simplifying the difficulty of data processing. Based on the linear mapping method of the two-dimensional position relationship, the connection between the tool position points and the parameter domain of the B-spline surface is cleverly established, so that each tool position point can accurately obtain the corresponding parameter value, providing a reliable foundation for subsequent calculations. It not only improves the accuracy and rationality of parameterization, but also can better adapt to the processing of disordered scattered points, laying a solid foundation for subsequent work such as tool positioning surface reconstruction and CNC machining information extraction, and helps to improve the accuracy, efficiency and stability of the entire surface CNC machining process.
[0009] Optionally, in one embodiment of the present application, determining the B-spline surface parameters of the tool positioning surface includes: using the standard definition of the B-spline surface to determine the tool positioning surface, selecting the degree and number of control points of the B-spline surface, and selecting a quasi-uniform node vector to define the B-spline surface parameters.
[0010] Through the above technical solution, the embodiment of the present application can use the standard definition of B-spline surface to determine the tool positioning surface, providing a solid theoretical basis for the precise construction of the surface. In the definition process, the degree of B-spline surface can be flexibly selected, and high-order surfaces can bring high-order continuity, which helps to improve the smoothness and accuracy of the tool positioning surface when fitting complex shapes, and better adapt to various complex surface processing requirements. At the same time, the number of control points can be selected as needed, so that the solution can find a balance between the amount of calculation and the fitting accuracy, which not only ensures the degree of fit between the tool positioning surface and the actual processing situation, but also takes into account the computational efficiency. The selection of quasi-uniform node vectors can ensure that the nodes are evenly distributed, further enhancing the effect of surface reconstruction, making the reconstructed tool positioning surface more uniform and smoother on the whole, so that in the subsequent surface CNC processing, it can effectively improve the processing quality and reduce the processing errors caused by discontinuous or uneven surfaces.
[0011] Optionally, in one embodiment of the present application, the calculation of the regression matrix includes: calculating the B-spline basis matrix corresponding to the parameter value of each tool position point; reshaping the corresponding B-spline basis matrix into corresponding row vectors in a preset order; and arranging the corresponding row vectors vertically to form the regression matrix.
[0012] Through the above technical solution, the embodiment of the present application can accurately quantify the relationship between the tool position point and the B-spline surface by calculating the B-spline basis matrix corresponding to the parameter value of each tool position point, providing key basic data for subsequent processing. Based on this, the data is reshaped into row vectors in sequence. This reshaping method can make the data structure more regular and orderly, which is convenient for unified calculation and analysis. The reshaped row vectors are arranged vertically to form a regression matrix, which cleverly integrates the relevant information of all tool position points, so that the regression matrix can comprehensively and systematically reflect the characteristics of the tool position points in the B-spline surface parameterization process. The regression matrix plays a core role in the subsequent calculation of the accuracy index of the tool positioning surface, which helps to improve the accuracy and efficiency of the calculation, thereby laying a solid foundation for the entire tool positioning surface reconstruction and CNC machining information extraction process, and effectively improving the precision control and quality assurance capabilities of CNC machining of complex surfaces.
[0013] Optionally, in one embodiment of the present application, the calculation formula of the smoothing energy index is:
[0014]
[0015] in, is the control point D with coordinates i, j in the control point network i,j The second-order difference along the parameter u direction at the position is calculated as follows: is the control point D with coordinates i, j in the control point network i,jThe second-order difference along the parameter v direction at the position is calculated as follows:
[0016] Through the above technical solution, the embodiment of the present application can define the smoothing energy index by accumulating the sum of the squares of the second-order differences of each control point in the control point network in two directions. It can effectively quantify the smoothness of the tool positioning surface from an energy perspective, and comprehensively capture the bending characteristics of the surface in different directions, thereby more accurately measuring the smoothness of the surface.
[0017] Optionally, in one embodiment of the present application, the tool positioning surface reconstruction problem is:
[0018]
[0019] Among them, P CL is the tool point set matrix, A is the regression matrix, Q is the smoothing energy matrix, λ is the scale factor, and D is the control point matrix to be solved.
[0020] Through the above technical solution, the embodiment of the present application can realize the reconstruction of the tool positioning surface by minimizing the objective function, so that the reconstruction process can not only meet the accuracy requirements, but also take into account the smoothness of the surface, avoiding the situation where the surface is not smooth due to excessive pursuit of accuracy or the accuracy is sacrificed due to excessive pursuit of smoothness.
[0021] The second aspect of the present application provides a surface CNC machining information extraction device based on B-spline surface reconstruction, including: an acquisition module for acquiring the three-dimensional spatial position information of at least one surface machining tool position point; a parameterization module for parameterizing the at least one surface machining tool position point based on the three-dimensional spatial position information; a parameter determination module for determining the B-spline surface parameters of the tool positioning surface based on the parameterized tool position point; a first calculation module for determining the accuracy index of the tool positioning surface based on the B-spline surface parameters and the sum of the squares of the deviations between all tool positions and the tool positioning surface to calculate the regression matrix; a second calculation module for determining the smoothing energy index of the tool positioning surface to calculate the smoothing energy matrix generation module; a generation module for determining a comprehensive index based on the accuracy index and the smoothing energy index to generate a tool positioning surface reconstruction problem based on the comprehensive index; an extraction module for solving the tool positioning surface reconstruction problem to obtain a tool positioning surface reconstruction structure and extract surface CNC machining information.
[0022] Through the above technical solution, the embodiment of the present application can effectively reconstruct the tool positioning surface and extract processing information by obtaining tool location point information and a series of processing. Tool location point parameterization can handle disordered scattered points, making subsequent calculations more accurate. Determining the parameters of the B-spline surface is flexible and the quasi-uniform node vector is selected to ensure the surface quality. The precision index calculation is scientific, based on the sum of squared deviations combined with matrix expression and regression matrix calculation to accurately quantify the precision requirements. The smoothing energy index takes into account multiple factors, based on the thin plate energy definition and through matrix calculation, taking into account stability and smoothness. The comprehensive index introduces adjustable precision and smoothness tendency to meet different needs. The linear equation system is solved quickly and the results are optimal, which improves the calculation speed and fitting effect. The final extracted processing information can further optimize the surface CNC machining and effectively improve the quality and efficiency of complex surface machining.
[0023] Optionally, in one embodiment of the present application, the parameterization module includes: a projection unit for projecting the at least one surface machining tool position point onto a target two-dimensional projection plane according to a preset projection vector; a zoning unit for dividing the target two-dimensional projection plane into enclosing rectangular areas surrounding the projection points corresponding to all tool position points; and a calculation unit for linearly mapping the enclosing rectangular areas to unit rectangles in the parameter domain of the B-spline surface according to a preset length relationship based on the two-dimensional position relationship in the target projection plane, so as to calculate the parameter value corresponding to each tool position point according to the mapping relationship.
[0024] Through the above technical solution, the embodiment of the present application can realize the effective conversion from three-dimensional space to two-dimensional plane by projecting the tool position points of the surface machining onto a two-dimensional projection plane and dividing the enclosing rectangular area, thereby simplifying the difficulty of data processing. Based on the linear mapping method of the two-dimensional position relationship, the connection between the tool position points and the parameter domain of the B-spline surface is cleverly established, so that each tool position point can accurately obtain the corresponding parameter value, providing a reliable foundation for subsequent calculations. It not only improves the accuracy and rationality of parameterization, but also can better adapt to the processing of disordered scattered points, laying a solid foundation for subsequent work such as tool positioning surface reconstruction and CNC machining information extraction, and helps to improve the accuracy, efficiency and stability of the entire surface CNC machining process.
[0025] Optionally, in one embodiment of the present application, the parameter determination module includes: using the standard definition of the B-spline surface to determine the tool positioning surface, selecting the degree and number of control points of the B-spline surface, and selecting a quasi-uniform node vector to define the B-spline surface parameters.
[0026] Through the above technical solution, the embodiment of the present application can use the standard definition of B-spline surface to determine the tool positioning surface, providing a solid theoretical basis for the precise construction of the surface. In the definition process, the degree of B-spline surface can be flexibly selected, and high-order surfaces can bring high-order continuity, which helps to improve the smoothness and accuracy of the tool positioning surface when fitting complex shapes, and better adapt to various complex surface processing requirements. At the same time, the number of control points can be selected as needed, so that the solution can find a balance between the amount of calculation and the fitting accuracy, which not only ensures the degree of fit between the tool positioning surface and the actual processing situation, but also takes into account the computational efficiency. The selection of quasi-uniform node vectors can ensure that the nodes are evenly distributed, further enhancing the effect of surface reconstruction, making the reconstructed tool positioning surface more uniform and smoother on the whole, so that in the subsequent surface CNC processing, it can effectively improve the processing quality and reduce the processing errors caused by discontinuous or uneven surfaces.
[0027] Optionally, in one embodiment of the present application, the first calculation module includes: a calculation unit for calculating the B-spline basis matrix corresponding to the parameter value of each tool position point; a reshaping unit for reshaping the corresponding B-spline basis matrix into a corresponding row vector in a preset order; and a regression matrix construction unit for arranging the corresponding row vectors vertically to form the regression matrix.
[0028] Through the above technical solution, the embodiment of the present application can accurately quantify the relationship between the tool position point and the B-spline surface by calculating the B-spline basis matrix corresponding to the parameter value of each tool position point, providing key basic data for subsequent processing. Based on this, the data is reshaped into row vectors in sequence. This reshaping method can make the data structure more regular and orderly, which is convenient for unified calculation and analysis. The reshaped row vectors are arranged vertically to form a regression matrix, which cleverly integrates the relevant information of all tool position points, so that the regression matrix can comprehensively and systematically reflect the characteristics of the tool position points in the B-spline surface parameterization process. The regression matrix plays a core role in the subsequent calculation of the accuracy index of the tool positioning surface, which helps to improve the accuracy and efficiency of the calculation, thereby laying a solid foundation for the entire tool positioning surface reconstruction and CNC machining information extraction process, and effectively improving the precision control and quality assurance capabilities of CNC machining of complex surfaces.
[0029] Optionally, in one embodiment of the present application, the calculation formula of the smoothing energy index is:
[0030]
[0031] in, is the control point D with coordinates i, j in the control point network i,j The second-order difference along the parameter u direction at the position is calculated as follows: is the control point D with coordinates i, j in the control point network i,j The second-order difference along the parameter v direction at the position is calculated as follows:
[0032] Through the above technical solution, the embodiment of the present application can define the smoothing energy index by accumulating the sum of the squares of the second-order differences of each control point in the control point network in two directions. It can effectively quantify the smoothness of the tool positioning surface from an energy perspective, and comprehensively capture the bending characteristics of the surface in different directions, thereby more accurately measuring the smoothness of the surface.
[0033] Optionally, in one embodiment of the present application, the tool positioning surface reconstruction problem is:
[0034]
[0035] Among them, P CL is the tool point set matrix, A is the regression matrix, Q is the smoothing energy matrix, λ is the scale factor, and D is the control point matrix to be solved.
[0036] Through the above technical solution, the embodiment of the present application can realize the reconstruction of the tool positioning surface by minimizing the objective function, so that the reconstruction process can not only meet the accuracy requirements, but also take into account the smoothness of the surface, avoiding the situation where the surface is not smooth due to excessive pursuit of accuracy or the accuracy is sacrificed due to excessive pursuit of smoothness.
[0037] The third aspect of the present application 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 executes the program to implement the surface CNC machining information extraction method based on B-spline surface reconstruction as described in the above embodiment.
[0038] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned surface CNC machining information extraction method based on B-spline surface reconstruction.
[0039] The fifth aspect of the present application provides a computer program product, including a computer program, which, when executed, is used to implement the above-mentioned method for extracting surface CNC machining information based on spline surface reconstruction.
[0040] After obtaining the tool location information, the embodiment of the present application can effectively reconstruct the tool positioning surface and extract processing information through the steps of tool location parameterization, B-spline surface parameter determination, accuracy and smoothing energy index calculation, comprehensive index construction, and linear equation solution. Tool location parameterization realizes the conversion from three-dimensional to two-dimensional, simplifies data processing, and accurately establishes the connection between tool location and B-spline surface parameter domain, adapts to disordered scattered point processing, and lays the foundation for subsequent work. The B-spline surface parameter definition is flexible, and the selection of the degree, the number of control points, and the use of quasi-uniform node vectors ensure the surface quality and improve the fitting accuracy and computational efficiency of complex shapes. The regression matrix construction link accurately quantifies the relationship and integrates information, plays a key role in the calculation of accuracy indexes, and improves the accuracy control capability. The smoothing energy index comprehensively quantifies the smoothness of the surface from an energy perspective, and the optimization formula of the tool positioning surface reconstruction problem takes into account both accuracy and smoothness, ultimately effectively improving the quality, efficiency, accuracy, high efficiency and stability of complex surface processing, reducing processing errors, and providing strong support for surface CNC processing.
[0041] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0043] Figure 1 A flowchart of a method for extracting surface NC machining information based on B-spline surface reconstruction according to an embodiment of the present application;
[0044] Figure 2 Schematic diagram of the obtained tool position location and its parameterization process according to a specific embodiment of the present application;
[0045] Figure 3 A schematic diagram of calculating the smoothing energy index of a control point network according to a specific embodiment of the present application;
[0046] Figure 4 is a schematic diagram of a reconstructed tool positioning surface result according to a specific embodiment of the present application;
[0047] Figure 5 Schematic diagram of surface normal information based on tool positioning surface extraction according to a specific embodiment of the present application;
[0048] Figure 6 A schematic structural diagram of a device for extracting surface NC machining information based on B-spline surface reconstruction according to an embodiment of the present application;
[0049] Figure 7This is a diagram illustrating an example structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0051] The following describes the surface CNC machining information extraction method and device based on B-spline surface reconstruction according to an embodiment of the present application with reference to the accompanying drawings. In view of the problem that the surface reconstruction algorithm in the related technologies mentioned in the above background technology is usually difficult to take into account the requirements of speed, smoothness and precision when processing disordered spatial discrete tool position points, the present application provides a surface CNC machining information extraction method based on B-spline surface reconstruction. In this method, the tool positioning surface can be effectively reconstructed and the machining information can be extracted by obtaining tool position point information and a series of processing. Tool position point parameterization can handle disordered scattered points, making subsequent calculations more accurate. The determination of B-spline surface parameters is flexible and the quasi-uniform node vector is preferred to ensure the surface quality. The accuracy index calculation is scientific, based on the sum of squared deviations combined with matrix expression and regression matrix calculation to accurately quantify the accuracy requirements. The smoothing energy index takes into account multiple factors, is defined based on the thin plate energy and is calculated through matrix, taking into account both stability and smoothness. The comprehensive index introduces adjustable accuracy and smoothness tendency to meet different needs. The linear equations are solved quickly and optimally, improving computational speed and fitting performance. The resulting extracted machining information can further optimize surface CNC machining, effectively improving the quality and efficiency of complex surface machining. This solves the problem in related technologies where surface reconstruction algorithms often struggle to balance speed, smoothness, and accuracy when processing disordered, spatially discrete tool locations.
[0052] Specifically, Figure 1 A flow chart of a method for extracting surface CNC machining information based on B-spline surface reconstruction provided in an embodiment of the present application.
[0053] like Figure 1 As shown, the surface NC machining information extraction method based on B-spline surface reconstruction includes the following steps:
[0054] In step S101 , the three-dimensional spatial position information of at least one curved surface machining tool position point is obtained.
[0055] It can be understood that the tool position point for surface machining refers to the position of the tool center point in three-dimensional space at the moment when the tool cutting edge contacts the machined surface during the surface CNC machining process.
[0056] In the actual execution process, when the processing equipment runs according to the processing path, the measuring equipment will measure the tool position point at a specific time node or key position point, read the surface NC processing program, and obtain the three-dimensional spatial position information of a series of surface processing tool position points, which is recorded as the tool position point set:
[0057] P CL ={p k =(x k ,y k ,z k )∈R 3 |k=1,2,…,N}.
[0058] The embodiment of the present application can use a measuring device to measure the tool position point at a specific node when the processing equipment is running, accurately obtain the position of the tool center point in three-dimensional space, form a tool position point set, and provide basic and critical data support for subsequent processing, ensuring the accuracy of the processing path and surface shape.
[0059] In step S102, the at least one surface machining tool location point is parameterized based on the three-dimensional spatial position information.
[0060] It can be understood that tool point parameterization is the process of converting tool points in three-dimensional surface machining into a set of parameters according to certain rules and methods. These parameters can more conveniently describe the characteristics and positional relationships of tool points in subsequent calculations and processing.
[0061] Optionally, in one embodiment of the present application, the tool position parameterization of the at least one surface machining tool position point based on the three-dimensional spatial position information includes: projecting the at least one surface machining tool position point onto a target two-dimensional projection plane according to a preset projection vector; dividing the target two-dimensional projection plane into enclosing rectangular areas surrounding the projection points corresponding to all tool position points; based on the two-dimensional position relationship within the target projection plane, linearly mapping the enclosing rectangular areas to unit rectangles in the parameter domain of the B-spline surface according to a preset length relationship, so as to calculate the parameter value corresponding to each tool position point according to the mapping relationship.
[0062] In actual implementation, the tool location points are treated as randomly scattered points in three-dimensional space and projected onto a two-dimensional projection plane according to the specified projection vector. Within the projection plane, an enclosing rectangle is drawn that encompasses all the projected tool location points. The length, width, and direction of the enclosing rectangle can be arbitrarily selected, but for better accuracy and smoothness of the subsequent fitting, it is recommended to optimize the length, width, and direction of the enclosing rectangle to minimize them.
[0063] Furthermore, based on the two-dimensional position relationship in the projection plane, the enclosing rectangular area is linearly mapped to the unit rectangle in the u,v parameter domain of the B-spline surface {(u,v)|u∈[0,1],v∈[0,1]} according to the length relationship, and each tool position point p is calculated according to the mapping relationship. k The corresponding parameter value (u k ,v k )∈[0,1]×[0,1], completing the parameterization of the tool position point.
[0064] The embodiment of the present application can effectively reduce the data dimension by projecting the disordered scattered points (surface machining tool positions) in three-dimensional space onto a two-dimensional projection plane, thereby simplifying the complexity of subsequent processing. Delimiting the enclosing rectangular area and optimizing its length, width and direction can, to a certain extent, preliminarily organize and organize the tool positions, which is conducive to improving the accuracy and efficiency of subsequent calculations. Based on the two-dimensional position relationship, linear mapping is performed to the unit rectangle of the B-spline surface parameter domain, and the connection between the tool positions and the B-spline surface parameters is cleverly established, so that each tool position can obtain the corresponding parameter value, providing convenient and accurate basic data for subsequent tool positioning surface construction, precision calculation and other operations. This method can better adapt to the distribution of tool positions. Whether the tool position distribution is regular or irregular, it can effectively perform parameterization processing, thereby improving the precision control of the entire surface CNC machining process, the surface fitting effect and the quality of the final product. While ensuring accuracy, it helps to improve the calculation speed and processing efficiency, providing strong technical support for complex surface processing.
[0065] In step S103 , the B-spline surface parameters of the tool positioning surface are determined based on the parameterized tool position points.
[0066] It can be understood that the B-spline surface parameters are a mathematical model used to describe and construct a surface, and its parameters include the degree of the B-spline surface, the number of control points, the node vector, etc.
[0067] In actual implementation, the tool positioning surface is determined using the standard definition of a B-spline surface, and the degree and number of control points of the B-spline surface are selected, as well as a quasi-uniform node vector, to define the B-spline surface parameters.
[0068] Specifically, this application uses B-spline surface to fit the tool position point and reconstruct it into tool positioning surface, using the standard definition of B-spline surface In this definition, p B is a point on the B-spline surface, (u,v) is a point p B The corresponding parameter, D ij,i=0,1,…,m,j=0,1,…n are the control points of the B-spline surface. All the control points form a control point network of size (m+1)×(n+1). N i,p (u) and N j,q (v) are the B-spline basis functions corresponding to the parameters u and v respectively. The specific form of the B-spline basis function is the node vector U = [u0, u1, ..., u m+p+1 ] and V=[x0,v1,…,v n+q+1 ] and the degrees p and q of the B-spline.
[0069] In particular, to ensure sufficient surface smoothness, the present invention does not restrict the degrees p and q of the B-spline surface, that is, the degrees p and q of the B-spline surface can be selected as any positive integer greater than or equal to 2, and higher-order surfaces have high-order continuity. This application does not restrict the number of control points of the B-spline surface, that is, the number of control points of the B-spline surface (m+1)×(n+1) can be arbitrarily selected. Generally speaking, the larger the number of control points, the higher the accuracy of the tool positioning surface fitting, but at the same time, the greater the computational complexity of the fitting algorithm.
[0070] Furthermore, after the degree p and q of the B-spline surface and the number m and n of the B-spline surface control points are determined, in order to ensure a uniform and smooth surface reconstruction effect, the present application preferably uses a quasi-uniform node vector, that is, the node vector U = [u0, u1, ..., u m+p+1 ] have a repetition degree of p+1, that is, u0=u1=…=u p =0,u m+1 =u m+2 =…=u m+p+1 =1, and all other internal nodes are evenly distributed between 0 and 1. Similarly, the node vector V = [v0,v1,…,v n+q+1 The two endpoints of ] have a repetition degree q+1, that is, u0=u1=…=u q =0,u n+1 =u n+2 =…=u n+q+1 =1, and all other internal nodes are evenly distributed between 0 and 1.
[0071] The embodiment of the present application can reconstruct the tool positioning surface by adopting the standard definition of B-spline surface, which provides a solid theoretical basis for surface construction and ensures the standardization and accuracy of the surface. There is no limit on the number of B-spline surfaces, and high-order surfaces can be selected according to actual needs to obtain high-order continuity, thereby ensuring the smoothness of the surface and meeting the strict requirements for surface quality in complex surface processing. The flexible selection of the number of control points makes it possible to balance between accuracy and computational complexity, and can improve the fitting accuracy by increasing the number of control points, and appropriately reduce the number of control points to reduce the computational complexity when the accuracy requirements are not particularly high. The preferred quasi-uniform node vector can effectively ensure that the surface reconstruction effect is uniform and smooth, making the reconstructed tool positioning surface more ideal in overall morphology. This method of comprehensively considering multiple factors and flexibly selecting parameters can construct a high-quality tool positioning surface, which provides reliable guarantees for the subsequent CNC machining information extraction, machining accuracy improvement and smooth progress of complex surface machining based on the surface, greatly improving the adaptability and effectiveness of the entire surface CNC machining process.
[0072] In step S104, based on the B-spline surface parameters, the accuracy index of the tool positioning surface is determined according to the square sum of the deviations between all tool position points and the tool positioning surface, so as to calculate a regression matrix.
[0073] It's understood that the accuracy index of the tool positioning surface is a quantitative measure of how closely the tool positioning surface fits the actual tool location points. This application defines it as the sum of the squares of the deviations between all tool location points and the tool positioning surface. The deviation is the distance from a tool location point to its corresponding point on the tool positioning surface. The squared and cumulative sum of the deviations for each tool location point indicates that the smaller the squared value, the closer the tool positioning surface is to the actual distribution of tool location points, i.e., the higher the accuracy.
[0074] Optionally, in one embodiment of the present application, the calculation of the regression matrix includes: calculating the B-spline basis matrix corresponding to the parameter value of each tool position point; reshaping the corresponding B-spline basis matrix into corresponding row vectors in a preset order; and arranging the corresponding row vectors vertically to form the regression matrix.
[0075] This application is based on the knife point set P obtained in step S101 CL ={p k =(x k ,y k ,z k )∈R 3 |k=1,2,…,N} and the parameterization result (u k ,v k )∈[0,1]×[0,1], using the B-spline surface definition in step S103 Perform random scattered point fitting to construct the tool positioning surface.
[0076] Specifically, a basic feature of the tool positioning surface is that all tool positions are approximately located on the tool positioning surface, and the tool position p k The parameters on the B-spline surface are (u k ,v k ) B,k The distance is as small as possible. This basic feature actually describes the accuracy requirement of the tool positioning surface. This application uses the "sum of squares of deviations" indicator commonly used in mathematics to quantitatively describe this accuracy requirement. k , and its deviation from the tool positioning surface can be expressed as:
[0077]
[0078] Therefore, the quantitative accuracy index of the tool positioning surface is defined as:
[0079]
[0080] Furthermore, in order to facilitate the rapid calculation of surface fitting, the present application expresses both the tool locus set and the control point set in matrix form. The tool locus set is expressed in matrix form, and the matrix form is as follows:
[0081]
[0082] The size of the tool location matrix is (N×3). ij , i=0,1,…,m,j=0,1,…n, the number of them is (m+1)×(n+1). In order to fully express the control point set using a two-dimensional matrix, the i and j dimensions of the control point network are reshaped in the order of i first and then j as the first dimension of the control point matrix, and the spatial coordinates of the control points are used as the second dimension of the control point matrix. Therefore, the control point matrix can be written as:
[0083] D [(m+1)×(n+1)×3]
[0084] =[D 00 T D 10 T … D m0 T D 01 T D 11 T … D m1 T … D 0n T D 1n T … D mn T ]T
[0085] The size of the control point matrix is [(m+1)×(n+1)]×3.
[0086] In some embodiments, the tool location matrix and the control point matrix can be used to represent the accuracy index of the tool positioning surface as E=|P CL -AD‖ 2 The matrix expression of this accuracy index is equivalent to the above definition, where matrix A is called the regression matrix, which contains the information of the tool point parameterization and the information of the B-spline surface definition. The size of the regression matrix A is N×[(m+1)×n+1]. The following describes how to calculate the regression matrix A: First, for each tool point pk, the B-spline basis matrix corresponding to the parameter value pk is calculated as:
[0087]
[0088] The size of the matrix is (m+1)×(n+1); secondly, each two-dimensional B-spline basis matrix N k Reshape it into a row vector of 1×[(m+1)×(n+1)] in the order of rows first and columns. This process corresponds to the reshaping process of the control point network above. The reshaped row vector is:
[0089]
[0090] Finally, each knife point p k The reshaped row vectors are arranged vertically to form the regression matrix:
[0091]
[0092] The embodiment of the present application can determine the accuracy index by calculating the sum of the squares of the deviations between the tool position point and the tool positioning surface. This method quantifies the deviation into a specific numerical value, which can intuitively and accurately reflect the degree of fit between the tool positioning surface and the actual tool position point, so that the accuracy evaluation has a clear and objective standard. Taking the sum of the squares of the deviations as the basis, the problem of positive and negative deviations offsetting each other is avoided, and the overall deviation of all tool position points is considered more comprehensively. The characteristic that the smaller the value, the higher the accuracy provides a clear direction for optimizing the tool positioning surface. When adjusting the surface parameters or improving the processing strategy, the adjustment effect can be quickly judged based on this indicator, effectively improving the optimization efficiency. At the same time, high-precision fitting helps to make the tool motion trajectory more in line with the actual processing requirements in subsequent CNC processing, reduce processing errors, improve product quality, and provide reliable data support and decision-making basis for quality control and process improvement of the entire processing process, effectively ensuring the accuracy and stability of complex surface processing.
[0093] In step S105 , the smoothing energy index of the tool positioning surface is determined to calculate a smoothing energy matrix.
[0094] It's understood that the smoothing energy index is a quantitative measure of the smoothness of tool positioning surfaces. Physically and mathematically, it reflects the smoothness and continuity of a surface. A smooth surface ensures smoother tool movement during machining, reducing tool vibration and wear, and is crucial for both machining accuracy and surface quality.
[0095] On the one hand, the high surface quality requirements of surface CNC machining place a high demand on the smoothness of the tool positioning surface. On the other hand, when fitting a B-spline surface to disordered scattered points, if the distribution of scattered points is uneven, the surface fitting may be unstable in some areas due to the small number of scattered points. Adding constraints other than the accuracy index will help to resolve this instability. Therefore, this application proposes a smoothness index based on the energy description of the tool positioning surface.
[0096] In some cases, the smoothness of a general free-form surface is considered from the energy perspective. The thin plate bending energy of a free-form surface can be expressed as Q = ∫ s (κ1 2 +κ2 2 )dA, where κ1 and κ2 are the principal curvatures of the surface, and dA is the differential area element on the surface. The energy of the surface is directly related to the curvature of the surface. Minimizing the bending energy of the surface often means optimal smoothness. The definition of the B-spline surface used in this application has been described in step S103. Therefore, the tool positioning surface is composed of the control point network D ij ,i=0,1,…,m,j=0,1,…n completely determines, in order to quantitatively describe the smoothness of the tool positioning surface, this application is inspired by the "thin plate bending energy" and proposes a tool positioning surface smoothness energy index that can be calculated through a control point network.
[0097] The formula for defining the smoothing energy index of the tool positioning surface in this application is as follows:
[0098]
[0099] In the formula Represents the "energy" of each control point in the control point network, where the control point D i,j The second-order difference in the u and v directions and To approximate the “principal curvature” of the local control point network. i,j The second-order difference at is calculated by its position with the two adjacent points on the control point network, and the second-order difference in the u direction is The second-order difference in the v direction is If the control point D i,j If the tool is at the edge of the control point network, the "principal curvature" in the corresponding direction is considered to be zero. After excluding the edge control points, the smoothing energy index of the tool positioning surface can be expressed as
[0100] Specifically, a significant advantage of the smoothing energy index Q of the tool positioning surface proposed in this application is that Q is the sum of all control points D i,j The quadratic form, that is, Q can be expressed as all control points D i,j In order to facilitate the rapid calculation of surface fitting, this application expresses the smoothing energy index Q as a quadratic matrix representation Q=D T QD, according to the reshaping relationship of the control point matrix D and the above smoothing energy index expression The smoothing energy matrix Q can be calculated. The matrix Q is a symmetric positive definite matrix with a size of [(m+1)×(n+1)]×[(m+1)×(n+1)].
[0101] The embodiments of the present application can effectively reduce vibration and wear during tool movement by ensuring smooth curved surfaces, greatly improving machining accuracy and making the surface quality of the processed product more delicate and uniform. From the perspective of the production process, this indicator provides a reliable basis for quality control during the machining process, helping to predict and optimize possible machining problems caused by uneven curved surfaces in advance, thereby reducing scrap rates and improving production efficiency. It also provides a useful reference for the rational selection and use of cutting tools, extending tool life, and reducing production costs.
[0102] In step S106, a comprehensive index is determined according to the accuracy index and the smoothing energy index, so as to generate a tool positioning surface reconstruction problem based on the comprehensive index.
[0103] It is understandable that the tool positioning surface reconstruction problem is described as a mathematical problem based on comprehensive indicators. It is usually presented as an optimization problem. For example, by minimizing the various contents included in the comprehensive indicators (such as the accuracy index and the smoothing energy index), the optimal parameters of the tool positioning surface (such as the control point positions and node vectors of the B-spline surface) are determined to achieve the reconstruction of the tool positioning surface. It has good smoothness while meeting the accuracy requirements, providing a high-quality tool positioning surface foundation for subsequent CNC machining.
[0104] Specifically, the comprehensive accuracy index and the smoothing energy index, this application defines the tool positioning surface comprehensive index as f(D)=E+λQ=‖P CL -AD‖ 2 +λD TQD, the definition introduces a scaling factor λ to adjust the fitting process's tendency towards accuracy and smoothness. Under the definition of the comprehensive index of the tool positioning surface, the tool positioning surface reconstruction can be expressed as the following mathematical problem:
[0105]
[0106] The embodiment of the present application can comprehensively consider the precision index and the smoothing energy index to define a comprehensive index of the tool positioning surface. By introducing the proportional factor λ, the tendency of the fitting process towards precision and smoothness can be flexibly adjusted, thereby balancing the two requirements and avoiding the situation where only one is emphasized while the other is ignored. The tool positioning surface reconstruction problem is constructed with this comprehensive index and presented in the form of an optimization problem, clearly and explicitly focusing on determining the optimal parameters of the tool positioning surface, such as the control point position, the node vector, etc., by minimizing the relevant content. In this way, the reconstructed tool positioning surface can not only accurately fit the tool position point and meet the precision requirements, but also have good smoothness, creating a high-quality foundation for subsequent CNC machining, helping to improve the quality and efficiency of the entire CNC machining, reducing machining errors caused by insufficient surface precision or insufficient smoothness, and ensuring that the processed products meet high standards.
[0107] In step S107, the tool positioning surface reconstruction problem is solved to obtain a tool positioning surface reconstruction structure and extract surface NC machining information.
[0108] It can be understood that the tool positioning surface reconstruction structure refers to the structure composed of the specific shape and corresponding parameters of the tool positioning surface determined after solving the tool positioning surface reconstruction problem, and the surface CNC machining information is further analyzed and extracted from the obtained tool positioning surface reconstruction structure, which is data and information closely related to the surface CNC machining process.
[0109] In the actual execution process, since the smoothing energy matrix Q is a symmetric positive definite matrix, the mathematical problem proposed in step S106 has an analytical solution, and the analytical solution is the optimal solution that minimizes the comprehensive index. Solving the mathematical problem and setting the comprehensive index gradient to 0, we can obtain the linear equation system (A T A+λQ)D=A T P CL , then the optimal analytical solution of the control point matrix is D=(A T A+λQ) - 1 A T P CL .
[0110] Specifically, the final calculation process of the tool positioning surface reconstruction method proposed in this application is the analytical solution of a system of linear equations, so classical mathematical methods such as QR decomposition can be applied to quickly solve them. This makes the proposed tool positioning surface reconstruction method have a significant computing speed advantage compared to other surface reconstruction technologies that require iterative solutions.
[0111] The reconstruction result of the tool positioning surface reconstruction method proposed in this application theoretically reaches the optimal solution with the minimum comprehensive index, which makes the proposed tool positioning surface reconstruction method have significant advantages in fitting error and smoothness. Although the inherent contradiction between fitting error and smoothness in surface reconstruction cannot be avoided, the introduced proportional factor can be used to adjust the fitting process's tendency towards accuracy and smoothness to meet actual usage needs.
[0112] Furthermore, after the control point solution is completed, the tool positioning surface reconstruction result can be checked. In terms of accuracy, each tool position point p can be calculated. k Deviation from the corresponding point on the tool positioning surface The maximum and average deviations are used as the accuracy check results for the tool positioning surface reconstruction. In terms of smoothness, the tool positioning surface image can be drawn to directly observe the surface smoothness, or quantitative indicators such as surface slope, curvature, and bending energy can be used to check the surface smoothness.
[0113] It's important to note that the discrete tool location information in the machining program indicates that when the tool is located at these discrete tool location points and the lines connecting them, complex surfaces can be machined. In contrast, the present invention reconstructs a complete, continuous tool positioning surface in the form of a B-spline surface. This allows machining of complex surfaces when the tool is located anywhere on the tool positioning surface. Therefore, the tool positioning surface actually contains richer information for surface CNC machining.
[0114] The following introduces several types of surface NC machining information extraction and usage methods by way of examples:
[0115] First, use the calculation method of the B-spline surface normal to extract the normal information of the tool positioning surface: According to the expression of the B-spline surface The tangent vector along the u and v directions of any point on it can be calculated Calculate the cross product of the two tangent vectors to get the normal vector The normal information extracted from the tool positioning surface can be further used to optimize the tool posture in surface CNC machining. For example, the tool direction can always be made along the normal of the tool positioning surface, or the tool direction can always maintain a certain inclination angle with the normal of the tool positioning surface.
[0116] Second, the curvature information of the tool positioning surface is extracted by using the calculation method of the B-spline surface curvature: According to the expression of the B-spline surface The curvature information of any point on it can be calculated. For example, the curvature of a point along the u and v directions on the B-spline surface are and The curvature along other specified directions is Where d is a unit vector in a specified direction. Principal curvature and Gaussian curvature at that point can also be calculated. Curvature information extracted from the tool positioning surface can be further used for speed planning in surface CNC machining. For example, the speed planning process can limit feed rates to smaller areas of large curvature to ensure surface quality, while also applying larger feed rates to smaller areas of curvature to improve machining efficiency.
[0117] The present application is described in detail below with reference to a specific embodiment.
[0118] 1) Read a free-form surface NC machining program and obtain the surface machining tool locations. In this embodiment, the number of tool locations is 1960.
[0119] 2) Complete the parameterization of the tool position. The obtained tool position and its parameterization process are as follows: Figure 2 As shown, the tool position points are regarded as disordered scattered points in three-dimensional space, and are projected onto a two-dimensional projection plane according to the specified projection vector. In the projection plane, an enclosing rectangular area that can enclose all the tool position projection points is delineated. Based on the two-dimensional position relationship in the projection plane, the enclosing rectangular area is linearly mapped to the unit rectangle in the u,v parameter domain of the B-spline surface {(u,v)|u∈[0,1],v∈[0,1]} according to the length relationship, and each tool position point p is calculated according to the mapping relationship. k The corresponding parameter value (u k ,v k )∈[0,1]×[0,1], completing the parameterization of the tool position point.
[0120] 3) Define the B-spline surface parameters for the tool positioning surface. Select the B-spline degree p = 3 and q = 3. This bicubic B-spline surface achieves C2 continuity, meeting the continuity requirements of general CNC machining. The number of control points on the B-spline surface is m = 10 and n = 10, resulting in a control point network size of 11 × 11. Select quasi-uniform knot vectors: knot vector U = [0, 0, 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 1, 1, 1], and knot vector V = [0, 0, 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 1, 1, 1].
[0121] 4) Calculate the regression matrix according to the accuracy index and calculation method of the tool positioning surface defined in S104
[0122] 5) Calculate the smoothing energy index according to the smoothing energy index and calculation method of the tool positioning surface defined in step S105 and the smoothing energy matrix Q. Figure 3 The control point D in the control point network is shown in i,j The calculation of "energy" at the control point D i,j The second-order difference at is calculated by its position with the two adjacent points on the control point network, and the second-order difference in the u direction is The second-order difference in the v direction is
[0123] 6) Select the proportional factor λ = 0.01, and obtain the comprehensive index of accuracy and smoothness of the tool positioning surface as E + 0.01Q.
[0124] 7) Solve the linear equations (A T A+λQ)D=A T P CL , obtain the optimal solution of the control point matrix and realize the reconstruction of the tool positioning surface. After inspection, the maximum position deviation of the reconstructed tool positioning surface in this embodiment from the original tool position point is 0.076mm, and the average position deviation is 0.0081mm. The tool positioning surface reconstructed in this embodiment is as follows Figure 4 As shown, it can be seen that it has good smoothness.
[0125] 8) Extract normal information based on the reconstructed tool positioning surface, Figure 5 This is a schematic diagram of normal information extraction, with normal vectors marked at some locations on the tool positioning surface.
[0126] According to the method for extracting surface NC machining information based on B-spline surface reconstruction proposed in the embodiment of the present application, the tool positioning surface can be effectively reconstructed and machining information can be extracted by obtaining tool position point information and a series of processing. Tool position point parameterization can handle disordered scattered points, making subsequent calculations more accurate. Determining the parameters of the B-spline surface is flexible and the quasi-uniform node vector is selected to ensure the surface quality. The accuracy index calculation is scientific, based on the sum of squared deviations combined with matrix expression and regression matrix calculation to accurately quantify the accuracy requirements. The smoothing energy index takes into account multiple factors, is defined based on the thin plate energy and is calculated through matrix calculation, taking into account both stability and smoothness. The comprehensive index introduces adjustable accuracy and smoothness tendency to meet different needs. The linear equation system is solved quickly and the results are optimal, which improves the calculation speed and fitting effect. The final extracted machining information can further optimize surface NC machining and effectively improve the quality and efficiency of complex surface machining.
[0127] Next, a surface CNC machining information extraction device based on B-spline surface reconstruction proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.
[0128] Figure 6 It is a block diagram of a surface CNC machining information extraction device based on B-spline surface reconstruction according to an embodiment of the present application.
[0129] like Figure 6 As shown, the surface NC machining information extraction device 10 based on B-spline surface reconstruction includes: an acquisition module 100, a parameterization module 200, a parameter determination module 300, a first calculation module 400, a second calculation module 500, a generation module 600 and an extraction module 700.
[0130] Specifically, the acquisition module 100 is used to acquire the three-dimensional spatial position information of at least one surface machining tool position point.
[0131] The parameterization module 200 is configured to parameterize the at least one surface machining tool location point based on the three-dimensional spatial position information.
[0132] The parameter determination module 300 is used to determine the B-spline surface parameters of the tool positioning surface based on the parameterized tool position point.
[0133] The first calculation module 400 is used to determine the accuracy index of the tool positioning surface based on the B-spline surface parameters and the sum of squares of deviations between all tool position points and the tool positioning surface, so as to calculate a regression matrix.
[0134] The second calculation module 500 is used to determine the smoothing energy index of the tool positioning surface to calculate the smoothing energy matrix generation module.
[0135] The generation module 600 is used to determine a comprehensive index according to the precision index and the smoothing energy index, so as to generate a tool positioning surface reconstruction problem based on the comprehensive index.
[0136] The extraction module 700 is used to solve the tool positioning surface reconstruction problem to obtain the tool positioning surface reconstruction structure and extract the surface NC machining information.
[0137] Optionally, in one embodiment of the present application, the parameterization module 200 includes: a projection unit, a zoning unit, and a calculation unit.
[0138] The projection unit is used to project the at least one curved surface machining tool position point onto a target two-dimensional projection plane according to a preset projection vector.
[0139] The area division unit is used to divide the target two-dimensional projection plane into enclosing rectangular areas that surround the projection points corresponding to all the tool position points.
[0140] A calculation unit is used to linearly map the enclosing rectangular area to a unit rectangle in the parameter domain of the B-spline surface according to a preset length relationship based on the two-dimensional position relationship in the target projection plane, so as to calculate the parameter value corresponding to each tool position point according to the mapping relationship.
[0141] Optionally, in one embodiment of the present application, the parameter determination module 300 includes: using the standard definition of the B-spline surface to determine the tool positioning surface, selecting the degree and number of control points of the B-spline surface, and selecting a quasi-uniform node vector to define the B-spline surface parameters.
[0142] Optionally, in one embodiment of the present application, the first calculation module 400 includes: a calculation unit, a reshaping unit and a regression matrix construction unit.
[0143] The calculation unit is used to calculate the B-spline basis matrix corresponding to the parameter value of each tool position point.
[0144] A reshaping unit is used to reshape the corresponding B-spline basis matrix into a corresponding row vector in a preset order based on the corresponding B-spline basis matrix.
[0145] The regression matrix construction unit is used to arrange the corresponding row vectors vertically to form the regression matrix.
[0146] Optionally, in one embodiment of the present application, the calculation formula of the smoothing energy index is:
[0147]
[0148] in, is the control point D with coordinates i, j in the control point network i,j The second-order difference along the parameter u direction at the position is calculated as follows: is the control point D with coordinates i, j in the control point network i,j The second-order difference along the parameter v direction at the position is calculated as follows:
[0149] Optionally, in one embodiment of the present application, the tool positioning surface reconstruction problem is:
[0150]
[0151] Among them, P CL is the tool point set matrix, A is the regression matrix, Q is the smoothing energy matrix, λ is the scale factor, and D is the control point matrix to be solved.
[0152] It should be noted that the above explanation of the embodiment of the method for extracting surface NC machining information based on B-spline surface reconstruction is also applicable to the device for extracting surface NC machining information based on B-spline surface reconstruction in this embodiment, and will not be repeated here.
[0153] According to the surface CNC machining information extraction device based on B-spline surface reconstruction proposed in the embodiment of the present application, the tool positioning surface can be effectively reconstructed and the machining information can be extracted by obtaining the tool position point information and a series of processing. The parameterization of the tool position point can handle disordered scattered points, making subsequent calculations more accurate. The determination of B-spline surface parameters is flexible and the quasi-uniform node vector is optimized to ensure the surface quality. The precision index calculation is scientific, based on the sum of squared deviations combined with matrix expression and regression matrix calculation to accurately quantify the precision requirements. The smoothing energy index takes into account multiple factors, is defined based on the thin plate energy and is calculated through matrix calculation, taking into account both stability and smoothness. The comprehensive index introduces adjustable precision and smoothness tendency to meet different needs. The linear equation system is solved quickly and the results are optimal, which improves the calculation speed and fitting effect. The final extracted machining information can further optimize the surface CNC machining and effectively improve the quality and efficiency of complex surface machining.
[0154] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0155] Memory 701 , processor 702 , and computer programs stored in the memory 701 and executable on the processor 702 .
[0156] When the processor 702 executes the program, the surface numerical control machining information extraction method based on spline surface reconstruction provided in the above embodiment is implemented.
[0157] Furthermore, the electronic device further includes:
[0158] The communication interface 703 is used for communication between the memory 701 and the processor 702 .
[0159] The memory 701 is used to store computer programs that can be run on the processor 702 .
[0160] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0161] If the memory 701, processor 702, and communication interface 703 are implemented independently, the communication interface 703, memory 701, and processor 702 can be interconnected via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0162] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.
[0163] The processor 702 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0164] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for extracting surface CNC machining information based on spline surface reconstruction.
[0165] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed, is used to implement the above-mentioned method for extracting surface numerical control machining information based on spline surface reconstruction.
[0166] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0167] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0168] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing a custom logical function or process step, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed in a different order than shown or discussed, including performing functions in a substantially simultaneous manner or in a reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application pertain.
[0169] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or N wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program can be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing it in other suitable ways as necessary, and then storing it in a computer memory.
[0170] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented using hardware, as in another embodiment, it can be implemented using any one or a combination of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0171] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0172] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0173] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. A method for extracting surface NC machining information based on B-spline surface reconstruction, characterized in that: The following steps are involved: Obtaining three-dimensional spatial position information of at least one surface machining tool position point; Parameterizing the at least one surface machining tool location point based on the three-dimensional spatial position information; Based on the parameterized tool position point, the B-spline surface parameters of the tool positioning surface are determined; Based on the B-spline surface parameters, the accuracy index of the tool positioning surface is determined according to the square sum of the deviations between all tool position points and the tool positioning surface to calculate the regression matrix; The calculation of the regression matrix includes: calculating the B-spline basis matrix corresponding to the parameter value of each tool position point; reshaping the corresponding B-spline basis matrix into corresponding row vectors according to a preset order; and arranging the corresponding row vectors vertically to form the regression matrix; Determining a smoothing energy index of the tool positioning surface to calculate a smoothing energy matrix; Determining a comprehensive index according to the accuracy index and the smoothing energy index, so as to generate a tool positioning surface reconstruction problem based on the comprehensive index; Solving the tool positioning surface reconstruction problem to obtain a tool positioning surface reconstruction structure and extracting surface NC machining information; The tool positioning surface reconstruction problem is: , in, is the knife point set matrix, is the regression matrix, is the smoothing energy matrix, is the scale factor, is the control point matrix to be solved; Among them, the size of the control point matrix is .
2. The method according to claim 1, characterized in that The parameterizing of the at least one surface machining tool location point based on the three-dimensional spatial position information includes: Projecting the at least one curved surface machining tool position point onto a target two-dimensional projection plane according to a preset projection vector; In the target two-dimensional projection plane, a rectangular area is divided to surround the projection points corresponding to all the tool position points; Based on the two-dimensional position relationship in the target two-dimensional projection plane, the enclosing rectangular area is linearly mapped to a unit rectangle in the parameter domain of the B-spline surface according to a preset length relationship, so as to calculate the parameter value corresponding to each tool position point according to the mapping relationship.
3. The method according to claim 1, characterized in that The step of determining the B-spline surface parameters of the tool positioning surface includes: The tool positioning surface is determined using a standard definition of a B-spline surface, and the degree and number of control points of the B-spline surface are selected, as well as a quasi-uniform node vector, to define the B-spline surface parameters.
4. The method according to claim 1, wherein The calculation formula of the smoothing energy index is: , in, is the control point with coordinates i, j in the control point network The second-order difference along the parameter u direction at the position is calculated as follows: , is the control point with coordinates i, j in the control point network The second-order difference along the parameter v direction at the position is calculated as follows: .
5. A device for extracting surface NC machining information based on B-spline surface reconstruction, characterized in that: include: An acquisition module, used for acquiring three-dimensional spatial position information of at least one surface machining tool position point; A parameterization module, configured to parameterize the at least one surface machining tool location point based on the three-dimensional spatial position information; The parameter determination module is used to determine the B-spline surface parameters of the tool positioning surface based on the parameterized tool position point; A first calculation module is configured to determine an accuracy index of the tool positioning surface based on the B-spline surface parameters and the sum of squares of deviations between all tool position points and the tool positioning surface, so as to calculate a regression matrix; The first calculation module includes: a calculation unit for calculating the B-spline basis matrix corresponding to the parameter value of each tool position point; a reshaping unit for reshaping the corresponding B-spline basis matrix into corresponding row vectors according to a preset order; and a regression matrix construction unit for arranging the corresponding row vectors longitudinally to form the regression matrix. A second calculation module is used to determine the smoothing energy index of the tool positioning surface to calculate the smoothing energy matrix; a generating module, configured to determine a comprehensive index according to the precision index and the smoothing energy index, so as to generate a tool positioning surface reconstruction problem based on the comprehensive index; An extraction module is used to solve the tool positioning surface reconstruction problem to obtain a tool positioning surface reconstruction structure and extract surface NC machining information; The tool positioning surface reconstruction problem is: , in, is the knife point set matrix, is the regression matrix, is the smoothing energy matrix, is the scale factor, is the control point matrix to be solved; Among them, the size of the control point matrix is .
6. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for extracting surface NC machining information based on B-spline surface reconstruction as described in any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the surface numerical control machining information extraction method based on B-spline surface reconstruction as described in any one of claims 1 to 4.
8. A computer program product comprising a computer program, characterized in that The computer program is executed to implement the method for extracting surface numerical control machining information based on B-spline surface reconstruction according to any one of claims 1 to 4.
Citation Information
Patent Citations
NURBS curve surface fairing generation method in vehicle shell modeling
CN115358009A
Optical curved surface construction method based on B-spline
CN116880060A