B-spline corner smoothing method and system based on maximum curvature optimization
By optimizing the control of vertex distribution and curvature in the B-spline smoothing method, the influence of maximum curvature on processing efficiency in the prior art is solved, and a smoother transition curve and more efficient processing effect is achieved.
Patent Information
- Application Number
- CN202110350758.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-03-31
AI Technical Summary
When using the B-spline curve to smooth the tool trajectory, the influence of the maximum curvature of the transition curve on processing efficiency is not effectively considered, resulting in the problem of tangential discontinuity, fluctuation in feed rate and poor processing quality.
Using the B-spline corner smoothing method based on maximum curvature optimization, the clonal quasi-uniform B-spline curve with 7 control vertices extends the control vertices to the outside of the track, achieving the G3 continuity of the straight line and the curve, and in the forward direction and Under negative maximum approximation error constraints, straight line segment length constraints and maximum curvature constraints, position parameters are optimized to reduce maximum curvature.
Effectively reduce the curvature of the transition curve, improve processing efficiency, ensure processing accuracy, avoid corner transition curves not crossing, and improve tool trajectory consistency.
Smart Images

Figure CN115145146B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of tool path corner smoothing, and in particular to a B-spline corner smoothing method and system based on maximum curvature optimization. Background Art
[0002] The tool path in the CNC system is usually represented by continuous small line segments. The tangential discontinuity between adjacent small line segments leads to feed rate fluctuations and reduces machining efficiency and quality. In order to eliminate the machining problems caused by tangential discontinuity, the existing smoothing methods mainly use curves or spline curves to transition adjacent line segments, including arcs, Bézier curves, B-spline curves, PH-spline curves, etc. Among them, the B-spline curve smoothing method is the most widely used.
[0003] Patent document CN103631198A (application number: CN201310539076.7) discloses a tool path compression method based on G2 continuous Bézier curve, which uses G2 continuous Bézier curve to smooth corners and can effectively achieve data compression, but fails to consider the influence of the maximum curvature of the transition curve on the processing efficiency;
[0004] Patent document CN109918807A (application number: CN201910189683.2) discloses a local tool path smoothing method with optimized curvature, which uses a quintic quasi-uniform B-spline with 7 control vertices to smooth the trajectory, and reduces the curvature peak by controlling the vertex distribution ratio, but fails to further reduce the curvature peak by controlling the positive and negative approximation errors within the error band. Summary of the invention
[0005] In view of the defects in the prior art, the object of the present invention is to provide a B-spline corner smoothing method and system based on maximum curvature optimization.
[0006] The B-spline corner smoothing method based on maximum curvature optimization provided by the present invention comprises the following steps:
[0007] Step 1: Distribute the control vertices, extend two control vertices to the outside of the trajectory, and establish an analytical expression of a cubic quasi-uniform B-spline curve with 7 control vertices and symmetrical distribution of control vertices, so as to achieve G3 continuity at the connection between the straight line and the curve, and the smooth curve shuttles between the inside and outside of the straight line segment;
[0008] Step 2: According to the geometric characteristics of the B-spline curve, determine the curvature of the curve vertex where the maximum curvature is located on the symmetry axis of the transition curve, and establish an analytical expression of the maximum curvature;
[0009] Step 3: Establish an analytical expression of the maximum positive and negative approximation errors of the transition curves of adjacent line segments;
[0010] Step 4: Establish an optimization model for reducing the maximum curvature of the corner smoothing curve under the constraints of positive and negative contour error thresholds, straight line segment length constraints and maximum curvature constraints;
[0011] Step 5: Calculate the optimal values of the position parameters in the optimization model to obtain the optimal smoothing spline curve.
[0012] Preferably, the step 1 comprises:
[0013] In the adjacent straight line segment Q j-1 Q j and Q j Q j+1 A cubic quasi-uniform B-spline curve with symmetrically distributed control vertices is inserted into the corners of the composition, where Q j-1 , Q j is the straight line segment Q j-1 Q j The endpoint, Q j , Q j+1 is the straight line segment Q j Q j+1 The endpoint of the control vertex P i , i = 0, 1, ..., 6, symmetrically distributed about the corner bisector, calculated as follows:
[0014] QUR j =-(d1+d0)t j-1
[0015] P1 j =-d1t j-1
[0016] P1P2=0.5d1t j-1 +ln j
[0017] Q j P6=(d1+d0)t j
[0018] Q j P5=d1t j
[0019] P4P5=0.5d1t j +ln j
[0020]
[0021] in, d1 is the control vertex P1 or P5 to the corner endpoint Q j d0 is the distance between the control vertices P0 and P1 or P5 and P6, l is the distance from P2 to the straight line segment Q j-1 Qj or P4 to straight line segment Q j Q j+1 distance;
[0022] Take the B-spline node vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1] and substitute it into the B-spline curve expression:
[0023]
[0024] The basis function is calculated as follows:
[0025]
[0026] Obtain the analytical expression of the B-spline curve associated with the position parameters d0, d1, and l;
[0027] The subscript i represents the number of the control point; n represents the number of control points. Since the control point numbering starts from 0, the total number of control points is n+1; the subscript p represents the order of the B-spline curve; u represents the B-spline parameter, 0≤u≤1; u i Represents: the i-th node vector; u i+p The i+pth node vector.
[0028] Preferably, the maximum curvature on the transition curve is calculated in step 2, and the process is as follows:
[0029] The first derivative of the B(u) curve is:
[0030]
[0031] The second derivative of the B(u) curve is:
[0032]
[0033] Then the curvature on B(u) is calculated as follows:
[0034]
[0035] The maximum curvature on the curve occurs at u = 0.5, and the curvature at this position is derived as:
[0036]
[0037] Where θ = arccos(t j-1 ·t j ) / 2; ∠Q j-1 Q j Q j+1 The exterior angle is 2θ.
[0038] Preferably, step 3 comprises:
[0039] The maximum positive error is between the control vertex P3 and the corner endpoint Q j Distance:
[0040] δ max =||P3Q j ||=0.5d1sinθ
[0041] With t j-1 The vector is the X-axis direction vector, the corner endpoint Q j As the origin, establish a local coordinate system, convert the control vertex coordinates to the local coordinate system, and determine the maximum negative error by calculating the B(u) value corresponding to the u value where the Y component of the tangent vector in B'(u) is 0. The first-order derivative B'(u) of the B(u) curve is as follows:
[0042]
[0043] in, These are the new coordinates of the control vertices P0, P1, P2, and P3 converted to the local coordinate system;
[0044] Solving for the corresponding u value is:
[0045]
[0046] Substituting into the analytical expression of the B-spline function, we can get the maximum negative error:
[0047]
[0048] Preferably, step 4 comprises:
[0049] Limit the maximum positive and negative approximation errors to the contour positive and negative error threshold δ * , ε * To ensure machining accuracy, the formula is as follows:
[0050] δ max =||P3Q j ||=0.5d1sinθ≤δ *
[0051]
[0052] To ensure that the control vertices do not overlap, the distance parameter is set. To avoid the transition curves of adjacent corners not crossing, ||Q j The length of P0|| does not exceed half of the length of the straight line segment, and the expression is:
[0053] d0=cd1
[0054] d0+d1≤min(0.5||Q j-1 Qj ||,0.5||Q j Q j+1 ||)
[0055] Since the B-spline curve is about ∠Q j-1 Q j Q j+1 The maximum curvature is at u = 0.5, so as long as the curvature on one side is less than κ (u = 0.5), take u∈[0,0.5] side:
[0056]
[0057] Therefore, the optimal model for reducing the maximum curvature is determined as:
[0058]
[0059] Preferably, step 5 comprises:
[0060] When the c value is a fixed value, if the maximum curvature decreases and the position parameters d1 and l increase, the curve will be smoother; when the parameter d1 is greater than the preset threshold, the maximum positive machining error δ max Increase, use the formula of the optimization model to determine the optimal value of the parameter d1 to obtain the optimal curve; to determine the specific value of the optimization parameter l, set the initial value of l to 0, iteratively increase the size of the parameter l and calculate the local maximum curvature of the curve on one side to determine whether it meets the formula of the optimization model. If any of the two boundary conditions is not met, it means that l reaches the maximum value, and thus the value is determined to be the optimal value of the parameter l; substitute the position parameters d1 and l into the analytical expression of the B-spline to obtain the optimal B-spline smoothing curve.
[0061] The B-spline corner smoothing system based on maximum curvature optimization provided by the present invention includes the following modules:
[0062] Module M1: distribute the control vertices, extend two control vertices to the outside of the trajectory, establish an analytical expression of a cubic quasi-uniform B-spline curve with 7 control vertices and symmetrical distribution of control vertices, achieve G3 continuity at the connection between the straight line and the curve, and smooth the curve shuttle between the inside and outside of the straight line segment;
[0063] Module M2: Based on the geometric characteristics of the B-spline curve, determine the curvature of the curve vertex where the maximum curvature is located on the symmetry axis of the transition curve, and establish an analytical expression of the maximum curvature;
[0064] Module M3: Establish analytical expressions for the maximum positive and negative approximation errors of transition curves between adjacent line segments;
[0065] Module M4: Establish an optimization model for reducing the maximum curvature of a corner smoothing curve under the constraints of positive and negative contour error thresholds, straight line segment length constraints, and maximum curvature constraints;
[0066] Module M5: Calculate the optimal value of the position parameter in the optimization model to obtain the optimal smoothing spline curve;
[0067] The module M1 comprises:
[0068] In the adjacent straight line segment Q j-1 Q j and Q j Q j+1 A cubic quasi-uniform B-spline curve with symmetrically distributed control vertices is inserted into the corners of the composition, where Q j-1 , Q j is the straight line segment Q j-1 Q j The endpoint, Q j , Q j+1 is the straight line segment Q j Q j+1 The endpoint of the control vertex P i , i = 0, 1, ..., 6, symmetrically distributed about the corner bisector, calculated as follows:
[0069] QUR j =-(d1+d0)t j-1
[0070] P1 j =-d1t j-1
[0071] P1P2=0.5d1t j-1 +ln j
[0072] Q j P6=(d1+d0)t j
[0073] Q j P5=d1t j
[0074] P4P5=0.5d1t j +ln j
[0075]
[0076] in, d1 is the control vertex P1 or P5 to the corner endpoint Q j d0 is the distance between the control vertices P0 and P1 or P5 and P6, l is the distance from P2 to the straight line segment Q j-1 Q jor P4 to straight line segment Q j Q j+1 distance;
[0077] Take the B-spline node vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1] and substitute it into the B-spline curve expression:
[0078]
[0079] The basis function is calculated as follows:
[0080]
[0081] Obtain the analytical expression of the B-spline curve associated with the position parameters d0, d1, and l;
[0082] The subscript i represents the number of the control point; n represents the number of control points. Since the control point numbering starts from 0, the total number of control points is n+1; the subscript p represents the order of the B-spline curve; u represents the B-spline parameter, 0≤u≤1; u i Represents: the i-th node vector; u i+p The i+pth node vector.
[0083] Preferably, the maximum curvature on the transition curve is calculated in the module M2, and the process is as follows:
[0084] The first derivative of the B(u) curve is:
[0085]
[0086] The second derivative of the B(u) curve is:
[0087]
[0088] Then the curvature on B(u) is calculated as follows:
[0089]
[0090] The maximum curvature on the curve occurs at u = 0.5, and the curvature at this position is derived as:
[0091]
[0092] Where θ = arccos(t j-1 ·t j ) / 2; ∠Q j-1 Q j Q j+1 The exterior angle is 2θ.
[0093] Preferably, the module M3 includes:
[0094] The maximum positive error is between the control vertex P3 and the corner endpoint Q j Distance:
[0095] δ max =||P3Q j ||=0.5d1sinθ
[0096] With t j-1 The vector is the X-axis direction vector, the corner endpoint Q j As the origin, establish a local coordinate system, convert the control vertex coordinates to the local coordinate system, and determine the maximum negative error by calculating the B(u) value corresponding to the u value where the Y component of the tangent vector in B'(u) is 0. The first-order derivative B'(u) of the B(u) curve is as follows:
[0097]
[0098] in, These are the new coordinates of the control vertices P0, P1, P2, and P3 converted to the local coordinate system;
[0099] Solving for the corresponding u value is:
[0100]
[0101] Substituting into the analytical expression of the B-spline function, we can get the maximum negative error:
[0102]
[0103] Preferably, the module M4 includes:
[0104] Limit the maximum positive and negative approximation errors to the contour positive and negative error threshold δ * , ε * To ensure machining accuracy, the formula is as follows:
[0105] δ max =||P3Q j ||=0.5d1sinθ≤δ *
[0106]
[0107] To ensure that the control vertices do not overlap, the distance parameter is set. To avoid the transition curves of adjacent corners not crossing, ||Q j The length of P0|| does not exceed half of the length of the straight line segment, and the expression is:
[0108] d0=cd1
[0109] d0+d1≤min(0.5||Q j-1 Qj ||,0.5||Q j Q j+1 ||)
[0110] Since the B-spline curve is about ∠Q j-1 Q j Q j+1 The maximum curvature is at u = 0.5, so as long as the curvature on one side is less than κ (u = 0.5), take u∈[0,0.5] side:
[0111]
[0112] Therefore, the optimal model for reducing the maximum curvature is determined as:
[0113] maxl
[0114] std0=cd1,
[0115] d0+d1≤min(0.5||Q j-1 Q j ||,0.5||Q j Q j+1 ||),
[0116] δ max =0.5d1sinθ≤δ * ,
[0117]
[0118]
[0119] The module M5 comprises:
[0120] When the c value is a fixed value, if the maximum curvature decreases and the position parameters d1 and l increase, the curve will be smoother; when the parameter d1 is greater than the preset threshold, the maximum positive machining error δ max Increase, use the formula of the optimization model to determine the optimal value of the parameter d1 to obtain the optimal curve; to determine the specific value of the optimization parameter l, set the initial value of l to 0, iteratively increase the size of the parameter l and calculate the local maximum curvature of the curve on one side to determine whether it meets the formula of the optimization model. If any of the two boundary conditions is not met, it means that l reaches the maximum value, and thus the value is determined to be the optimal value of the parameter l; substitute the position parameters d1 and l into the analytical expression of the B-spline to obtain the optimal B-spline smoothing curve.
[0121] Compared with the prior art, the present invention has the following beneficial effects:
[0122] The method of the present invention utilizes a B-spline curve with 7 control vertices to transition adjacent straight line segments. Unlike the existing B-spline curve that only performs smoothing along the inner side of the corner, the proposed transition curve shuttles back and forth between the inner and outer sides of the corner. Under the conditions of satisfying the inner and outer contour error threshold constraints, the straight line segment constraints and the maximum curvature constraints, the curvature of the transition curve can be effectively reduced, thereby improving the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0123] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0124] Figure 1 Schematic diagram of a B-spline smoothing curve with 7 control points;
[0125] Figure 2 Schematic diagram of the impact of optimization parameters. DETAILED DESCRIPTION
[0126] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0127] Embodiment 1:
[0128] The B-spline corner smoothing method based on maximum curvature optimization provided by the present invention comprises the following steps:
[0129] S1. Determine the analytical expression of the smooth B-spline curve;
[0130] S1.1, according to the direction vector of the adjacent straight line segment, the position of the control vertex is determined according to the position parameters d0, d1 and l;
[0131] S1.2, B-spline knot vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1];
[0132] S1.3, determining the analytical expression B(u) of the B-spline transition curve according to the control vertex coordinates and the node vector;
[0133] S2, calculating the maximum curvature on the transition curve;
[0134] S2.1. Determine the first-order derivative and second-order analytical expression of the B(u) transition curve;
[0135] S2.2. Calculate the maximum curvature value κ (u=0.5) on the transition curve according to the curvature formula;
[0136] S3. Determine the analytical expression of the maximum positive and negative approximate errors of the smoothing of the corners of adjacent small line segments;
[0137] S3.1. Determine the analytical expression of the forward maximum approximation error;
[0138] S3.2, determine the analytical expression of the negative maximum approximation error;
[0139] S4, determining an optimization model for reducing the maximum curvature;
[0140] S4.1. Determine the positive and negative error constraints of the contour;
[0141] S4.2, determine the straight line segment length constraint;
[0142] S4.3. Determine the maximum curvature constraint;
[0143] S5, calculating the optimal parameter value and the optimal smoothing spline curve;
[0144] S5.1. Determine the optimal value of parameter d1 according to the optimization model;
[0145] S5.2, set the initial value of parameter l to 0. Iterate and improve parameter l according to the optimization model until the constraint condition cannot be met, and determine the optimal value of parameter l;
[0146] S5.3. Substitute the optimal values of parameters d1 and l into step 1 to obtain the optimal smoothing spline curve.
[0147] Take a specific node vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1], so that the transition curve is tangent to the line connecting the two control vertices extending outward, that is, the curve vertex located on the symmetry axis coincides with a control vertex. Substitute the node vector and the control vertex coordinates into the B-spline expression to obtain the analytical expression of the B-spline curve with respect to the position parameters d0, d1, and l.
[0148] According to the geometric characteristics that the transition curve generated by the specific node vector is tangent to the line connecting the two control vertices extending outward, it can be deduced that the curvature at the vertex of the curve located on the symmetry axis is the maximum curvature, and the analytical expression related to the position parameters d1 and l is obtained, that is,
[0149] The maximum positive approximate error of the transition curve refers to the maximum machining error within the range of adjacent straight line segments, which is the length of the line between the corner endpoint and the vertex of the curve located on the symmetry axis, that is, δ max =||P3Q j ||=0.5d1sinθ.
[0150] The negative maximum approximate error of the transition curve refers to the maximum machining error outside the range of adjacent straight line segments. The negative maximum approximate error is obtained in the local coordinate system by calculating the B(u) value corresponding to the u value of the Y component of the tangent vector in B'(u) being 0, that is,
[0151] An optimization model for reducing the maximum curvature of a corner smoothing curve is established under the constraints of positive and negative contour error thresholds, straight line segment length constraints, and maximum curvature constraints. Based on the optimization model, the optimal values of the position parameters d1 and l can be calculated, thereby calculating the corresponding optimal transition B-spline curve.
[0152] Embodiment 2:
[0153] Example 2 is a preferred example of Example 1.
[0154] The present invention is a B-spline corner smoothing method based on maximum curvature optimization, which includes five steps:
[0155] S1. Determine the analytical expression of the smooth B-spline curve;
[0156] like Figure 1 As shown, in the adjacent straight line segment Q j-1 Q j and Q j Q j+1 A cubic quasi-uniform B-spline curve with symmetrically distributed control vertices is inserted into the corners of the composition, where Q j-1 , Q j is the straight line segment Q j-1 Q j The endpoint, Q j , Q j+1 is the straight line segment Q j Q j+1 The endpoint of the control vertex P i , i = 0, 1, ..., 6, symmetrically distributed about the corner bisector, calculated as follows:
[0157] QUR j =-(d1+d0)t j-1
[0158] P1 j =-d1t j-1
[0159] P1P2=0.5d1t j-1 +ln j
[0160] Q j P6=(d1+d0)t j
[0161] Qj P5=d1t j
[0162] P4P5=0.5d1t j +ln j
[0163]
[0164] in, Where d1 is the distance from the control vertex P1 or P5 to the corner endpoint Q j d0 is the distance between control vertices P0 and P1, P5 and P6, l is the distance from P2 to straight line segment Q j-1 Q j or P4 to straight line segment Q j Q j+1 distance.
[0165] Take the B-spline node vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1] and substitute it into the B-spline curve expression;
[0166]
[0167] The basis function is calculated as follows:
[0168]
[0169] Thus, the analytical expression of the B-spline curve related to the position parameters d0, d1, and l is obtained.
[0170] S2, calculating the maximum curvature on the transition curve;
[0171] The first derivative of the B(u) curve is:
[0172]
[0173] The second derivative of the B(u) curve is:
[0174]
[0175] Then the curvature on B(u) is calculated as follows:
[0176]
[0177] The maximum curvature on the curve occurs at u = 0.5, and the curvature at this position is derived as:
[0178]
[0179] Where θ = arccos(t j-1 ·t j) / 2.
[0180] S3. Determine the analytical expression of the maximum positive and negative approximate errors of the smoothing of the corners of adjacent small line segments;
[0181] like Figure 1 As shown, the maximum positive error is between the control vertex P3 and the corner endpoint Q j Distance:
[0182] δ max =||P3Q j ||=0.5d1sinθ
[0183] With t j-1 The vector is the X-axis direction vector, the corner endpoint Q j As the origin, establish a local coordinate system and convert the control vertex coordinates to the local coordinate system. To determine the maximum negative error, the B(u) value corresponding to the u value where the Y component of the tangent vector in B'(u) is 0 can be calculated. The first-order derivative B'(u) of the B(u) curve is as follows:
[0184]
[0185] in, These are the new coordinates of the control vertices P0, P1, P2, and P3 converted to the local coordinate system.
[0186] Solving for the corresponding u value is:
[0187]
[0188] Substituting into the analytical expression of the B-spline function, we can get the maximum negative error:
[0189]
[0190] S4, determining an optimization model for reducing the maximum curvature;
[0191] In order to ensure the machining accuracy, it is necessary to limit the maximum positive and negative approximation errors to the contour positive and negative error threshold δ * , ε * , the formula is as follows:
[0192] δ max =||P3Q j ||=0.5d1sinθ≤δ *
[0193]
[0194] In addition, to ensure that the control vertices do not overlap, it can be assumed that the distance parameter d0 = cd1. In order to avoid unnecessary crossing of the transition curves of adjacent corners, ||Qj The length of P0|| cannot exceed half the length of the straight line segment:
[0195] d0=cd1
[0196] d0+d1≤min(0.5||Q j-1 Q j ||,0.5||Q j Q j+1 ||)
[0197] Since the B-spline curve is about ∠Q j-1 Q j Q j+1 The maximum curvature is at u = 0.5, so as long as the curvature on one side is less than κ (u = 0.5), take u∈[0,0.5] side:
[0198]
[0199] Therefore, the optimal model for reducing the maximum curvature is determined as:
[0200] maxl
[0201] std0=cd1,
[0202] d0+d1≤min(0.5||Q j-1 Q j ||,0.5||Q j Q j+1 ||),
[0203] δ max =0.5d1sinθ≤δ * ,
[0204]
[0205]
[0206] S5, calculating the optimal parameter value and the optimal smoothing curve;
[0207] When c is a fixed value, Figure 2 It can be concluded that in order to make the curve smoother and the curvature maximum smaller, the position parameters d1 and l need to be increased. However, if the parameter d1 is too large, the maximum positive machining error δ max To obtain the optimal curve, the first three equations of the optimization model can be used to determine the optimal value of parameter d1.
[0208] To determine the specific value of the optimization parameter l, you can set the initial value of l to 0, iteratively increase the size of the parameter l and calculate the local maximum curvature of the curve on one side to determine whether the last two equations in the optimization model are met. If any of the two boundary conditions is not met, it means that l reaches the maximum value, and this value is determined to be the optimal value of the parameter l.
[0209] Substitute the position parameters d1 and l into the analytical expression of B-spline to determine the optimal B-spline smoothing curve.
[0210] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0211] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A B-spline corner smoothing method based on maximum curvature optimization, characterized in that: The steps include: Step 1: Distribute the control vertices, extend two control vertices to the outside of the trajectory, and establish an analytical expression of a cubic quasi-uniform B-spline curve with 7 control vertices and symmetrical distribution of control vertices, so as to achieve G3 continuity at the connection between the straight line and the curve, and the smooth curve shuttles between the inside and outside of the straight line segment; Step 2: According to the geometric characteristics of the B-spline curve, determine the curvature of the curve vertex where the maximum curvature is located on the symmetry axis of the transition curve, and establish an analytical expression of the maximum curvature; Step 3: Establish an analytical expression of the maximum positive and negative approximation errors of the transition curves of adjacent line segments; Step 4: Establish an optimization model for reducing the maximum curvature of the corner smoothing curve under the constraints of positive and negative contour error thresholds, straight line segment length constraints and maximum curvature constraints; Step 5: Calculate the optimal value of the position parameter in the optimization model to obtain the optimal smoothing spline curve; The step 1 comprises: In the adjacent straight line segment Q j-1 Q j and Q j Q j+1 A cubic quasi-uniform B-spline curve with symmetrically distributed control vertices is inserted into the corners of the composition, where Q j-1 , Q j is the straight line segment Q j-1 Q j The endpoint, Q j , Q j+1 is the straight line segment Q j Q j+1 The endpoint of the control vertex P i , i = 0, 1, ..., 6, symmetrically distributed about the corner bisector, calculated as follows: P0Q j =-(d1+d0)t j-1 P1Q j =-d1t j-1 P1P2=0.5d1t j-1 +ln j Q j P6=(d1+d0)t j Q j P5=d1t j P4P5=0.5d1t j +ln j in, d1 is the control vertex P1 or P5 to the corner endpoint Q j d0 is the distance between the control vertices P0 and P1 or P5 and P6, l is the distance from P2 to the straight line segment Q j-1 Q j or P4 to straight line segment Q j Q j+1 distance; Take the B-spline node vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1] and substitute it into the B-spline curve expression: The basis function is calculated as follows: Obtain the analytical expression of the B-spline curve associated with the position parameters d0, d1, and l; The subscript i represents the number of the control point; n represents the number of control points. Since the control point numbering starts from 0, the total number of control points is n+1; the subscript p represents the order of the B-spline curve; u represents the B-spline parameter, 0≤u≤1; u i Represents: the i-th node vector; u i+p The i+pth node vector; In step 2, the maximum curvature on the transition curve is calculated as follows: The first derivative of the B(u) curve is: The second derivative of the B(u) curve is: Then the curvature on B(u) is calculated as follows: The maximum curvature on the curve occurs at u = 0.5, and the curvature at this position is derived as: Where θ = arccos(t j-1 ·t j ) / 2; ∠Q j-1 Q j Q j+1 The external angle of is 2θ; The step 3 comprises: The maximum positive error is between the control vertex P3 and the corner endpoint Q j Distance: d max =||P3Q j ||=0.5d1sinθ With t j-1 The vector is the X-axis direction vector, the corner endpoint Q j As the origin, establish a local coordinate system, convert the control vertex coordinates to the local coordinate system, and determine the maximum negative error by calculating the B(u) value corresponding to the u value where the Y component of the tangent vector in B'(u) is 0. The first-order derivative B'(u) of the B(u) curve is as follows: in, These are the new coordinates of the control vertices P0, P1, P2, and P3 converted to the local coordinate system; Solving for the corresponding u value is: Substituting into the analytical expression of the B-spline function, we can get the maximum negative error: The step 4 comprises: Limit the maximum positive and negative approximation errors to the contour positive and negative error threshold δ * , ε * To ensure machining accuracy, the formula is as follows: d max =||P3Q j ||=0.5d1sinθ≤δ * To ensure that the control vertices do not overlap, the distance parameter is set. To avoid the transition curves of adjacent corners not crossing, ||Q j The length of P0|| does not exceed half of the length of the straight line segment, and the expression is: d0=cd1 d0+d1≤min(0.5||Q j-1 Q j ||,0.5||Q j Q j+1 ||) Since the B-spline curve is about ∠Q j-1 Q j Q j+1 The maximum curvature is at u = 0.5, so as long as the curvature on one side is less than κ (u = 0.5), take u∈[0,0.5] side: Therefore, the optimal model for reducing the maximum curvature is determined as: The step 5 comprises: When the c value is a fixed value, if the maximum curvature decreases and the position parameters d1 and l increase, the curve will be smoother; when the parameter d1 is greater than the preset threshold, the maximum positive machining error δ max Increase, use the formula of the optimization model to determine the optimal value of the parameter d1 to obtain the optimal curve; to determine the specific value of the optimization parameter l, set the initial value of l to 0, iteratively increase the size of the parameter l and calculate the local maximum curvature of the curve on one side to determine whether it meets the formula of the optimization model. If any of the two boundary conditions is not met, it means that l reaches the maximum value, and thus the value is determined to be the optimal value of the parameter l; substitute the position parameters d1 and l into the analytical expression of the B-spline to obtain the optimal B-spline smoothing curve.
2. A B-spline corner smoothing system based on maximum curvature optimization, characterized in that: Includes the following modules: Module M1: distribute the control vertices, extend two control vertices to the outside of the trajectory, establish an analytical expression of a cubic quasi-uniform B-spline curve with 7 control vertices and symmetrical distribution of control vertices, achieve G3 continuity at the connection between the straight line and the curve, and smooth the curve shuttle between the inside and outside of the straight line segment; Module M2: Based on the geometric characteristics of the B-spline curve, determine the curvature of the curve vertex where the maximum curvature is located on the symmetry axis of the transition curve, and establish an analytical expression of the maximum curvature; Module M3: Establish analytical expressions for the maximum positive and negative approximation errors of transition curves between adjacent line segments; Module M4: Establish an optimization model for reducing the maximum curvature of a corner smoothing curve under the constraints of positive and negative contour error thresholds, straight line segment length constraints, and maximum curvature constraints; Module M5: Calculate the optimal value of the position parameter in the optimization model to obtain the optimal smoothing spline curve; The module M1 comprises: In the adjacent straight line segment Q j-1 Q j and Q j Q j+1 A cubic quasi-uniform B-spline curve with symmetrically distributed control vertices is inserted into the corners of the composition, where Q j-1 , Q j is the straight line segment Q j-1 Q j The endpoint, Q j , Q j+1 is the straight line segment Q j Q j+1 The endpoint of the control vertex P i , i = 0, 1, ..., 6, symmetrically distributed about the corner bisector, calculated as follows: P0Q j =-(d1+d0)t j-1 P1Q j =-d1t j-1 P1P2=0.5d1t j-1 +ln j Q j P6=(d1+d0)t j Q j P5=d1t j P4P5=0.5d1t j +ln j in, d1 is the control vertex P1 or P5 to the corner endpoint Q j d0 is the distance between the control vertices P0 and P1 or P5 and P6, l is the distance from P2 to the straight line segment Q j-1 Q j or P4 to straight line segment Q j Q j+1 distance; Take the B-spline node vector U = [0,0,0,0,0.5,0.5,0.5,1,1,1,1] and substitute it into the B-spline curve expression: The basis function is calculated as follows: Obtain the analytical expression of the B-spline curve associated with the position parameters d0, d1, and l; The subscript i represents the number of the control point; n represents the number of control points. Since the control point numbering starts from 0, the total number of control points is n+1; the subscript p represents the order of the B-spline curve; u represents the B-spline parameter, 0≤u≤1; u i Represents: the i-th node vector; u i+p The i+pth node vector; The maximum curvature on the transition curve is calculated in the module M2, and the process is as follows: The first derivative of the B(u) curve is: The second derivative of the B(u) curve is: Then the curvature on B(u) is calculated as follows: The maximum curvature on the curve occurs at u = 0.5, and the curvature at this position is derived as: Where θ = arccos(t j-1 ·t j ) / 2; ∠Q j-1 Q j Q j+1 The external angle of is 2θ; The module M3 comprises: The maximum positive error is between the control vertex P3 and the corner endpoint Q j Distance: d max =||P3Q j ||=0.5d1sinθ With t j-1 The vector is the X-axis direction vector, the corner endpoint Q j As the origin, establish a local coordinate system, convert the control vertex coordinates to the local coordinate system, and determine the maximum negative error by calculating the B(u) value corresponding to the u value where the Y component of the tangent vector in B'(u) is 0. The first-order derivative B'(u) of the B(u) curve is as follows: in, These are the new coordinates of the control vertices P0, P1, P2, and P3 converted to the local coordinate system; Solving for the corresponding u value is: Substituting into the analytical expression of the B-spline function, we can get the maximum negative error: The module M4 comprises: Limit the maximum positive and negative approximation errors to the contour positive and negative error threshold δ * , ε * To ensure machining accuracy, the formula is as follows: d max =||P3Q j ||=0.5d1sinθ≤δ * To ensure that the control vertices do not overlap, the distance parameter is set. To avoid the transition curves of adjacent corners not crossing, ||Q j The length of P0|| does not exceed half of the length of the straight line segment, and the expression is: d0=cd1 d0+d1≤min(0.5||Q j-1 Q j ||,0.5||Q j Q j+1 ||) Since the B-spline curve is about ∠Q j-1 Q j Q j+1 The maximum curvature is at u = 0.5, so as long as the curvature on one side is less than κ (u = 0.5), take u∈[0,0.5] side: Therefore, the optimal model for reducing the maximum curvature is determined as: maxl std0=cd1, d0+d1≤min(0.5||Q j-1 Q j ||,0.5||Q j Q j+1 ||), d max =0.5d1sinθ≤δ * , The module M5 comprises: When the c value is a fixed value, if the maximum curvature decreases and the position parameters d1 and l increase, the curve will be smoother; when the parameter d1 is greater than the preset threshold, the maximum positive machining error δ max Increase, use the formula of the optimization model to determine the optimal value of the parameter d1 to obtain the optimal curve; to determine the specific value of the optimization parameter l, set the initial value of l to 0, iteratively increase the size of the parameter l and calculate the local maximum curvature of the curve on one side to determine whether it meets the formula of the optimization model. If any of the two boundary conditions is not met, it means that l reaches the maximum value, and thus the value is determined to be the optimal value of the parameter l; substitute the position parameters d1 and l into the analytical expression of the B-spline to obtain the optimal B-spline smoothing curve.
Citation Information
Patent Citations
Cutter track compression method based on G2 continuous Bezier curve
CN103631198A
Tool trajectory compression method based on G2 continuous Bézier curve
CN103631198B
Local tool path smoothing method for optimizing curvature
CN109918807A
Curvature fairing method for high-speed numerical control processing track
CN105700466A
Local smoothing method having controllable errors and capable of passing predetermined cutter location points of scattering processing path
CN107255998A