A short cylindrical surface projection fitting method based on LM algorithm
Patent Information
- Application Number
- CN202410310822.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-19
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2044-03-19
AI Technical Summary
其优点是原理简单、易于实现、收敛速度快;但缺点是容易陷入局部最优,导致收敛精度低和不易收敛
[0024]本发明针对在短圆柱面拟合中存在的特征残缺、数据稀疏问题,设计了一种基于LM优化算法的短圆柱面投影拟合方法;利用工件坐标系和测量坐标系之间的变换关系和投影圆度判别法,可以快速估计短圆柱面参数初始值;利用LM优化算法,精确计算得到短圆柱面尺寸参数;可以兼顾效率与精度。
Smart Images

Figure CN118229758B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of three-dimensional measurement and reverse engineering, and relates to a method for fitting the projection of a short cylindrical surface based on the LM algorithm. Background Technology
[0002] In recent years, the increasing demand for intelligent and miniaturized electromechanical products has driven the development of modern mechanical manufacturing technology towards miniaturization, complexity, and precision. The cylindrical feature surfaces of tiny, complex parts manufactured using micro-machining techniques often play a crucial role in load-bearing, connection, and transmission. Their dimensional errors significantly affect the parts' wear resistance, fatigue strength, and service life. Therefore, to ensure the quality of parts upon delivery, it is necessary to use three-dimensional measuring equipment to scan and sample the cylindrical surfaces of the parts, obtaining discrete measurement points. Based on the measurement data, the cylindrical surfaces are accurately fitted to precisely assess their dimensional errors.
[0003] However, due to the small size and complex shape of tiny, complex parts, their cylindrical feature surfaces are typically only 1-3 mm long and less than 5 mm in diameter, and may not be complete cylinders. For fitting such short cylindrical surfaces with incomplete features and sparse data, commonly used methods include the RANSAC algorithm and the particle swarm optimization algorithm. The RANSAC algorithm randomly samples the data and uses the least squares method for fitting, finding as many interior points as possible that match the cylindrical surface model through numerous experiments to obtain the optimal fitting parameters. Its advantage is that it can handle datasets with a large number of exterior points without needing to know the number of exterior points beforehand; however, its disadvantage is strong randomness, requiring numerous iterations for convergence. In the particle swarm optimization algorithm, the solution to the short cylinder fitting problem is considered as a particle in a multidimensional space. The particle iteratively searches and optimizes its position until it finds the optimal solution or reaches a certain number of iterations. Its advantages are simple principle, ease of implementation, and fast convergence speed; however, its disadvantage is that it is prone to getting trapped in local optima, leading to low convergence accuracy and difficulty in achieving convergence. Therefore, existing short cylinder fitting algorithms cannot simultaneously achieve both efficiency and accuracy.
[0004] The Levenberg-Marquardt (LM) algorithm is a nonlinear optimization method based on least squares. Building upon the Newton-Gaussian method and the gradient method, it introduces an adjustment factor α, allowing for adaptive step size adjustment during the iterative fitting of a cylinder, balancing iterative efficiency and accuracy. However, the initial value directly affects the accuracy of the LM algorithm, potentially causing it to get trapped in local optima. Therefore, due to the incomplete features and sparse measurement data of short cylindrical surfaces, a fast and accurate method for fitting their dimensional parameters is lacking. Summary of the Invention
[0005] To efficiently and accurately calculate the dimensions and orientation parameters of short cylindrical surfaces, this invention proposes a projection fitting method for short cylindrical surfaces based on the LM algorithm.
[0006] This invention is achieved using the following technical solution:
[0007] A method for fitting the projection of a short cylindrical surface based on the LM algorithm includes the following steps:
[0008] (1) Parameter estimation of cylindrical surface: The point set P{p} is obtained by measuring the short cylinder. k (x k ,y k ,z k Based on the transformation relationship between the measurement coordinate system and the workpiece coordinate system, estimate the radius r0 and axial direction of the short cylindrical surface in the measurement coordinate system. A point p0(x0,y0,z0) on the axis.
[0009] (2) Generation of unit vector set: Generate a uniformly dense unit vector set N{(n xj ,n yj ,n zi The unit vectors in the vector set form a hemisphere in the coordinate system.
[0010]
[0011] Where: n xj n yj n zi These represent the components of the unit vector in the x, y, and z directions, respectively; m is a control parameter used to adjust the density of the generated unit vector set.
[0012] (3) Estimation of initial values of cylindrical surface parameters using the projection roundness discrimination method: In the unit vector set N, search for and... All unit vectors whose Euclidean distance does not exceed r0 Let the point set P{p k (x k ,y k ,z k |k=1,2,...,n} Directional projection yields the point set P'{p' k (x' k ,y' k ,z' k |k=1,2,...,n};Based on the least squares method, the center (x') of a three-dimensional circle is obtained by fitting the point set P'. c ,y' c ,z' c and radius r c'; Calculate the roundness evaluation function φ according to equation (2) i traversal Make φ i The minimum fitted parameter center (x') c ,y' c ,z' c ) and radius r c 'As the initial value.'
[0013]
[0014] (4) Establishment of the objective function: Construct a mathematical model of the cylindrical surface, as shown in equation (3); regard the sum of the squares of the distances from each point in the point set P to the cylindrical surface determined by equation (3) as the objective function, and calculate the cylindrical surface radius r0 and axial direction that minimize the objective function according to equation (4). A point p0(x0, y0, z0) on the axis has 7 parameters:
[0015]
[0016]
[0017] In the formula: A = c(y-y0)-b(z-z0), B = a(z-z0)-c(x-x0), C = b(x-x0)-a(y-y0), (x,y,z) are the three-dimensional coordinates of the measurement point, and X is the list of cylindrical surface parameters [a,b,c,x0,y0,z0,r0].
[0018] (5) LM algorithm iterative optimization: Taking the initial values of the cylindrical surface parameters obtained in step (3) as X0, the following recursive formula is obtained according to the principle of the LM algorithm:
[0019] X k+1 =X k -(J k T J k +μ k I) -1 J k T F(X k (10)
[0020] In the formula: J k Represents the function F(X) k The Jacobian matrix of μ k X is a regulation factor greater than 0. k This is the list of cylindrical surface parameters obtained in the k-th iteration.
[0021] (6) Convergence criterion: If ||J(X) k ) T F(Xk If || < ε, where ε is a pre-defined convergence condition, stop iteration and output X. k As the optimal solution; or, if ||X k+1 -X k ||<δ, where δ is a pre-defined convergence criterion, and the output is X. k+1 As the optimal solution; if none of these conditions are met, then calculate t = φ(X). k )-φ(X k+1 If t>0, μ k+1 =0.1μ k If t < 0, μ k+1 =10μ k X k+1 =X k , k = k + 1, return to step (5) and continue iterating.
[0022] Thus, the fitting of the short cylindrical surface was completed and its optimal parameters were obtained.
[0023] The beneficial effects of this invention are as follows:
[0024] This invention addresses the problems of feature incompleteness and data sparsity in short cylindrical surface fitting by designing a short cylindrical surface projection fitting method based on the LM optimization algorithm. By utilizing the transformation relationship between the workpiece coordinate system and the measurement coordinate system and the projection roundness discrimination method, the initial values of the short cylindrical surface parameters can be quickly estimated. The LM optimization algorithm is used to accurately calculate the dimensional parameters of the short cylindrical surface, thus balancing efficiency and accuracy. Attached Figure Description
[0025] Figure 1 A schematic diagram illustrating the RANSAC algorithm fitting a short cylinder problem;
[0026] Figure 2 The flowchart shows the steps of the short cylindrical surface projection fitting method based on the LM algorithm.
[0027] Figure 3 A schematic diagram for determining the roundness of a projection onto a set of unit vectors;
[0028] Figure 4 This is a schematic diagram of the simulation data for a short cylindrical surface. Detailed Implementation
[0029] like Figure 2 The figure shows a method for fitting the projection of a short cylindrical surface based on the LM algorithm according to the present invention. The method specifically includes the following steps:
[0030] (1) Parameter estimation of cylindrical surface: The point set P{p} is obtained by measuring the short cylinder. k (x k ,y k ,z kBased on the transformation relationship between the measurement coordinate system and the workpiece coordinate system, estimate the radius r0 and axial direction of the short cylindrical surface in the measurement coordinate system. A point p0(x0,y0,z0) on the axis;
[0031] (2) Generation of unit vector set: Generate a uniformly dense unit vector set N{(n xj ,n yj ,n zi )}:
[0032]
[0033] Where: n xj n yj n zi These represent the components of the unit vector in the x, y, and z directions, respectively; m is a control parameter used to adjust the density of the generated unit vector set.
[0034] (3) Estimation of initial values of cylindrical surface parameters using the projection roundness discrimination method: In the unit vector set N, search for and... All unit vectors whose Euclidean distance does not exceed r0 Let the point set P{p k (x k ,y k ,z k |k=1,2,...,n} Directional projection yields the point set P'{p' k (x' k ,y' k ,z' k |k=1,2,...,n};Based on the least squares method, the center (x') of a three-dimensional circle is obtained by fitting the point set P'. c ,y' c ,z' c and radius r c '; Calculate the roundness evaluation function φ according to equation (2) i traversal Make φ i The minimum fitted parameter center (x') c ,y' c ,z' c ) and radius r c 'As initial value:'
[0035]
[0036] (4) Establishment of the objective function: Construct a mathematical model of the cylindrical surface, as shown in equation (3); regard the sum of the squares of the distances from each point in the point set P to the cylindrical surface determined by equation (3) as the objective function, and calculate the cylindrical surface radius r0 and axial direction that minimize the objective function according to equation (4). A point p0(x0, y0, z0) on the axis has 7 parameters:
[0037]
[0038]
[0039] In the formula: A = c(y-y0)-b(z-z0), B = a(z-z0)-c(x-x0), C = b(x-x0)-a(y-y0), (x,y,z) are the three-dimensional coordinates of the measurement point, and X is the list of cylindrical surface parameters [a,b,c,x0,y0,z0,r0];
[0040] (5) LM algorithm iterative optimization: Taking the initial values of the cylindrical surface parameters obtained in step (3) as X0, the following recursive formula is obtained according to the principle of the LM algorithm:
[0041] X k+1 =X k -(J k T J k +μ k I) -1 J k T F(X k (15)
[0042] In the formula: J k Represents the function F(X) k The Jacobian matrix of μ k X is a regulation factor greater than 0. k This is the list of cylindrical surface parameters obtained in the k-th iteration;
[0043] (6) Convergence criterion: If ||J(X) k ) T F(X k If || < ε, where ε is a pre-defined convergence condition, stop iteration and output X. k As the optimal solution; or, if ||X k+1 -X k ||<δ, where δ is a pre-defined convergence criterion, and the output is X. k+1 As the optimal solution; if none of these conditions are met, then calculate t = φ(X). k )-φ(X k+1 If t>0, μ k+1 =0.1μ kIf t < 0, μ k+1 =10μ k X k+1 =X k , k = k + 1, return to step (5) and continue iterating.
[0044] To evaluate the effectiveness and robustness of the algorithm of this invention, a cylindrical surface with a radius of 3, a normal vector (1, 1, 1) passing through the origin was generated. Sampling was performed on one-third of its circumference surface, and random noise with an extreme value of 0.03 was added to the sampling points in the radial direction of the cylinder to simulate the measurement data of a short cylindrical surface of a real part. Multiple sets of simulated data were generated, and the short cylindrical surface was fitted using both the method proposed in this invention and the RANSAC method. The fitting results were compared with the true values (Table 1). The method of this invention can accurately fit the cylindrical surface; the radius calculation result differs from the true value by no more than 0.015, and the axial direction calculation result is very stable.
[0045] Figure 1 This diagram illustrates the result of fitting a short cylindrical surface with incomplete features using RANSAC. Given a limited number of iterations and relatively low accuracy requirements, due to the incompleteness of the data and the randomness of the RANSAC algorithm, some data may not fall within the cylindrical surface fitted by RANSAC, resulting in inaccurate fitting results.
[0046] Figure 3 This diagram illustrates the unit vector set and the projection roundness judgment method. The hemispherical portion in the diagram represents the generated unit vector set, with each point in the hemisphere corresponding to a unit vector. r0, These are estimates of the radius and normal vector of the short cylindrical surface. The measurement point set P (i.e., points on the cylindrical surface) is mapped to the unit vector set and... Projecting a unit vector with a Euclidean distance not exceeding r0, fitting a 3D circle based on the projection points, and obtaining the initial values of the cylindrical surface parameters by judging the degree of roundness.
[0047] Figure 4 The simulation data is for a short cylindrical surface. A cylindrical surface with a radius of 3, a normal vector (1, 1, 1) passing through the origin is generated. Sampling is performed on 1 / 3 of its circumference surface. Random noise with an extreme value of 0.03 is added to the sampling points in the radial direction of the cylinder to simulate the measurement data of a real short cylindrical surface of a part. After obtaining the simulation data, it is fitted using the RANSAC method and the method proposed in this invention, respectively. The fitting results are shown in Table 1.
[0048] Table 1. Comparison of results between the RANSAC method and the short cylindrical surface projection fitting method based on the LM algorithm.
[0049]
Claims
1. A method for fitting the projection of a short cylindrical surface based on the LM algorithm, characterized in that, Includes the following steps: (1) Parameter estimation of cylindrical surface: The point set P{p} is obtained by measuring the short cylinder. k (x k ,y k ,z k Based on the transformation relationship between the measurement coordinate system and the workpiece coordinate system, estimate the radius r0 and axial direction of the short cylindrical surface in the measurement coordinate system. A point p0(x0,y0,z0) on the axis; (2) Generation of unit vector set: Generate a uniformly dense unit vector set N{(n xj ,n yj ,n zi )}: Where: n xj n yj n zi These represent the components of the unit vector in the x, y, and z directions, respectively; m is a control parameter used to adjust the density of the generated unit vector set. (3) Estimation of initial values of cylindrical surface parameters using the projection roundness discrimination method: In the unit vector set N, search for and... All unit vectors whose Euclidean distance does not exceed r0 Let the point set P{p k (x k ,y k ,z k |k=1,2,...,n} Directional projection yields the point set P'{p' k (x' k ,y' k ,z' k |k=1,2,...,n};Based on the least squares method, the center (x') of a three-dimensional circle is obtained by fitting the point set P'. c ,y' c ,z' c and radius r c '; Calculate the roundness evaluation function φ according to equation (2) i traversal Make φ i The minimum fitted parameter center (x') c ,y' c ,z' c ) and radius r c 'As initial value:' (4) Establishment of the objective function: Construct a mathematical model of the cylindrical surface, as shown in equation (3); regard the sum of the squares of the distances from each point in the point set P to the cylindrical surface determined by equation (3) as the objective function, and calculate the cylindrical surface radius r0 and axial direction that minimize the objective function according to equation (4). A point p0(x0, y0, z0) on the axis has 7 parameters: In the formula: A = c(y-y0)-b(z-z0), B = a(z-z0)-c(x-x0), C = b(x-x0)-a(y-y0), (x,y,z) are the three-dimensional coordinates of the measurement point, and X is the parameter list of the cylindrical surface. [a,b,c,x0,y0,z0,r0]; (5) Iterative optimization of LM algorithm: Taking the initial values of the cylindrical surface parameters obtained in step (3) as X0, the following recursive formula is obtained according to the principle of LM algorithm: X k+1 =X k -(J k T J k +μ k I) -1 J k T F(X k ) (5) In the formula: J k Represents the function F(X) k The Jacobian matrix of μ k X is a regulation factor greater than 0. k This is the list of cylindrical surface parameters obtained in the k-th iteration; (6) Convergence criterion: If ||J(X) k ) T F(X k If || < ε, where ε is a pre-defined convergence condition, stop iteration and output X. k As the optimal solution; or, if ||X k+1 -X k ||<δ, where δ is a pre-defined convergence criterion, and the output is X. k+1 As the optimal solution; if none of these conditions are met, then calculate t = φ(X). k )-φ(X k+1 If t>0, μ k+1 =0.1μ k If t < 0, μ k+1 =10μ k X k+1 =X k , k = k + 1, return to step (5) and continue iterating.
Citation Information
Patent Citations
Steel member cylinder fitting algorithm
CN111027010A
Modeling method for projection of complex micro-feature spherical crown to cylindrical surface
CN112861385A