A linear path global fairing and curvature optimization method based on ph curve
By constructing 11-order PH curves to replace the tool path of CNC machine tools, the problem of interference between adjacent transition curves when the corners of continuous short straight segments are smooth is solved, achieving efficient corner transitions and curvature optimization, and improving the machining efficiency and accuracy of CNC machine tools.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2026-06-01
- Publication Date
- 2026-06-30
AI Technical Summary
Existing local corner smoothing methods are prone to interference between adjacent transition curves when processing continuous short straight segments, resulting in an abnormally large curvature extremum. This limits the feed rate of the tool when passing through corners and reduces the machining efficiency of CNC machine tools.
A linear path global smoothing and curvature optimization method based on PH curves is adopted. By constructing an 11th-order PH curve to replace the local polyline path containing corners and straight line segments, the complete PH curve is generated by utilizing the continuity of the first derivative and the second derivative and the tangential parallel constraint, thereby reducing the curvature peak.
It effectively eliminates interference between adjacent transition curves, reduces the peak value of path curvature, improves the corner transition speed and overall cutting efficiency of the machine tool, avoids machine tool chatter, and meets the requirements of CNC machine tools for high-speed and high-precision machining.
Smart Images

Figure CN122308497A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CNC machining technology, and in particular to a method for global smoothing and curvature optimization of linear paths based on pH curves. Background Technology
[0002] In CNC machining, when the tool moves along a linear path and encounters a tangential discontinuity at a junction point, the CNC machine tool must reduce its speed to zero at that point. This frequent start-stop operation significantly reduces machining efficiency and easily causes machine tool chatter, making it difficult to leverage the advantages of CNC machine tools in high-speed and high-precision machining. Existing local corner smoothing methods typically only process individual corners. This can easily lead to interference between adjacent transition curves when processing continuous short straight segments, causing an abnormally large curvature extremum of the actual transition curve, thus severely limiting the feed rate of the tool when passing through corners.
[0003] Therefore, how to solve the interference between adjacent transition curves when the corners of continuous short straight segments are aligned and reduce the peak curvature has become an urgent technical problem to be solved. Summary of the Invention
[0004] The main objective of this invention is to provide a method for global smoothing and curvature optimization of linear paths based on the pH curve, which aims to solve the problem of interference between adjacent transition curves and reduce the peak curvature when smoothing corners of continuous short straight lines.
[0005] To achieve the above objectives, this invention proposes a method for global smoothing and curvature optimization of linear paths based on pH curves, comprising the following steps: Obtain the original toolpath for CNC machining. The original toolpath includes a first straight line segment, a second straight line segment, and a third straight line segment connected in sequence. The first straight line segment intersects the second straight line segment at a first corner, and the second straight line segment intersects the third straight line segment at a second corner. An 11th-order PH curve is constructed to replace the local polyline path containing the first corner, the second straight line segment, and the second corner, and the 11th-order PH curve is used as the actual machining trajectory of the CNC machine tool; wherein, the generation process of the 11th-order PH curve includes: Based on a preset upper limit for approximate error, the offset distances that satisfy the preset upper limit for approximate error are determined according to the angle bisectors of the interior angles of the first corner and the second corner, respectively, and the entry point and exit point of the 11th PH curve are determined on the first straight line segment and the third straight line segment, respectively. Based on the first derivative continuity and second derivative continuity constraints at the entry point and the exit point, calculate the four initial complex coefficients used to determine the endpoint states in the 11th degree PH curve. At the intermediate parameter point of the 11th PH curve, a tangential parallel constraint is established relative to the unit direction of the second straight line segment, and a distance constraint is established relative to the second straight line segment that satisfies the preset upper limit of approximate error. Equations are established based on the displacement continuity constraint between the entry point and the exit point, the tangential parallel constraint, and the distance constraint. The two undetermined complex coefficients used to determine the internal morphology of the 11th-order PH curve are then solved using the four initial complex coefficients to generate the complete 11th-order PH curve. The curvature parameters and arc length parameters corresponding to the 11th-order PH curve are input to the CNC system of the CNC machine tool. The CNC system generates interpolation commands based on the curvature parameters and arc length parameters, and drives the tool to perform machining along the 11th-order PH curve based on the interpolation commands.
[0006] Preferably, the step of calculating the four initial complex coefficients used to determine the endpoint states in the 11th-order PH curve based on the first-order derivative continuity and second-order derivative continuity constraints at the entry point and the exit point specifically includes: For a given first derivative at the aforementioned entry point Second-order derivative and the first derivative at the exit point Second-order derivative Determine the four initial complex coefficients. , , , The following relationship must be satisfied: ,and In order to make The complex root whose direction is consistent with the tangential direction at the entry point; ; ,and In order to make The complex root whose direction is consistent with the tangential direction at the exit point; .
[0007] Preferably, the complex form of the entry point is obtained. and the complex form of the exit point And obtain the displacement in complex form between the entry point and the exit point. The displacement equations for the 11th PH curves corresponding to the displacement continuity constraint are as follows: ; in, and These are the two complex coefficients to be determined; , and The coefficient of the quadratic term is , and , , ; ; ; ; in, , and These are the complex coefficients in the displacement equation; , , and These are the four initial complex coefficients; The entry point is in its complex form; The exit point is in complex form; The complex form of the exit point The complex form of the entry point Complex displacements between, and .
[0008] Preferably, the intermediate parameter point is a curve parameter. The point at which the 11th pH curve is located, and the point at the intermediate parameter point. Represented as: ; in, The curve parameter is located at the intermediate parameter point. ; The point on the 11th pH curve at the intermediate parameter point; For constant terms; and The coefficient of the linear term; , and The coefficient of the quadratic term is , and , , ; ; ; ; in, The entry point is in its complex form; , , and These are the four initial complex coefficients.
[0009] Preferably, establishing a tangential parallel constraint relative to the unit direction of the second straight line segment specifically includes: The first derivative of the 11th pH curve at the intermediate parameter point Represented as: ; in, Let be the intermediate variable composed of the four initial complex coefficients, and ; , , and These are the four initial complex coefficients; and These are the two complex coefficients to be determined; Let be the complex number corresponding to the unit direction vector of the second line segment, and ; The operator represents the imaginary part of a complex number; by making the tangent of the curve at the intermediate parameter point parallel to the second line segment, the following tangential constraint equation is obtained: .
[0010] Preferably, establishing a distance constraint relative to the second straight line segment that satisfies the preset upper limit of approximate error specifically includes: The distance between the intermediate parameter point on the 11th pH curve and the second straight line segment is set to a specified distance. ,in , Given the preset upper limit of approximation error, the distance constraint equation is obtained: ; in, , Let the complex form of a reference point on the second line segment be given. , , , , , Representing vectors The conjugate of complex numbers, This represents an operator that takes the imaginary part of a complex number; and after generating the 11th-order PH curve, the maximum deviation distance of the 11th-order PH curve relative to the second straight line segment is calculated. When the maximum deviation distance is greater than the preset upper limit of approximation error, the specified distance is reduced. Alternatively, the entry point and the exit point can be adjusted along the first straight line segment and the third straight line segment respectively, and the two complex coefficients to be solved again until the maximum deviation distance is less than or equal to the preset upper limit of approximate error.
[0011] Preferably, the step of solving for the two undetermined complex coefficients in the 11th pH curve, which are used to determine the internal morphology, by combining the four initial complex coefficients, specifically includes: The complex coefficients to be determined and Let each be a complex number consisting of an unknown real part and an unknown imaginary part, respectively. , ,in, The imaginary unit, , , and All are unknown real number variables; and an unknown real number vector is defined. ; Represent the known coefficients using their real and imaginary parts: , , , , , , , , , , , , , ,in and They represent The real and imaginary parts; The displacement equation, the tangential constraint equation, and the distance constraint equation are transformed into a function of the unknown real vector. Four quadratic real equations: Real part equation of displacement constraint: ; Imaginary part equation of displacement constraint: ; Tangential constraint equations: ; Distance constraint equations: ;in, , , and It is a real symmetric matrix. , , and It is a column vector of real coefficients. , , and For constant terms; Solving the four quadratic real equations simultaneously yields the unknown real vector. The solution is then used to determine the two complex coefficients to be determined. and .
[0012] Preferably, the real symmetric matrices in the four quadratic real equations , , and They are represented as follows: ; ; ; ; The vectors and constants in the equation are expressed as follows: , ; , ; , ; , ,in express The imaginary part.
[0013] Preferably, generating the complete 11 pH curves specifically includes: make And based on the four initial complex coefficients , , , and the two complex coefficients obtained by solving. , Calculate the 12 control points of the 11 pH curves. to Its recursive relation is expressed as: ; ; ; ; ; ; ; ; ; ; ; Based on the calculated 12 control points, construct the complete 11 pH curves. ;in, For the 11 pH curves, in terms of curve parameters The point in complex form at that location, For the first One control point, For 11th-order Bernstein basis functions, For control point indexes.
[0014] Preferably, the method further includes: The curvature of the complete 11th pH curve generated by analytical calculation and arc length ; Wherein, the curvature ; In the formula, the first derivative of the curve Second derivative of the curve ;in, For curve parameters, and ; For the 11 pH curves at parameters Curvature at that point; The first derivative of the 11th pH curve; The second derivative of the 11th pH curve; for The conjugate of complex numbers; Operators that take the imaginary part of a complex number; , and These are the control points for the 11th pH curve; for Second Bernstein basis functions; For the index of the control point or Bernstein function, Represents the modulus of a complex number; The arc length ;in, The arc length of the 11th pH curve; and For summation index; and The complex coefficients of the fifth-order complex polynomial; for The conjugate of complex numbers; , and All are binomial coefficients. The sum of the subscripts of the binomial coefficients; The curvature and arc length obtained from the analytical calculation are input into the CNC system of the CNC machine tool for real-time machining command interpolation.
[0015] The above technical solution has the following advantages: This application obtains the original toolpath for CNC machining, which includes a first straight line segment, a second straight line segment, and a third straight line segment. It constructs an 11th-order PH curve to replace the local polyline path containing the first corner, the second straight line segment, and the second corner. The 11th-order PH curve is then used as the actual machining trajectory of the CNC machine tool. Based on a preset upper limit for approximate error, offset distances satisfying the preset upper limit for approximate error are determined according to the angle bisectors of the interior angles of the first and second corners. The entry and exit points of the 11th-order PH curve are determined on the first and third straight line segments, respectively. Based on the entry point... Based on the continuity constraints of the first and second derivatives at the exit point, four initial complex coefficients used to determine the endpoint states in the 11th-order PH curve are calculated. At the intermediate parameter point of the 11th-order PH curve, a tangential parallel constraint is established relative to the unit direction of the second straight line segment, and a distance constraint satisfying the preset upper limit of approximate error is established relative to the second straight line segment. Based on the displacement continuity constraint, tangential parallel constraint, and distance constraint, equations are established, and the two undetermined complex coefficients used to determine the internal shape of the 11th-order PH curve are solved in combination with the four initial complex coefficients to generate the complete 11th-order PH curve. The above technical solution can completely replace the intermediate straight line segment, fundamentally eliminate the interference risk of adjacent transition curves, reduce the peak curvature of the path, and effectively improve the corner transition speed and overall cutting efficiency of the machine tool. Attached Figure Description
[0016] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a schematic diagram illustrating the local smoothing of an embodiment using the present invention; Figure 2 It is a trajectory diagram of smoothing the embodiment using the single-corner pH curve method and the smoothing method of the present invention; Figure 3 It is a curvature distribution diagram of the smoothing curve obtained by using the single-corner PH curve method and the smoothing method of the present invention; Figure 4 This is a schematic diagram of the structure of the CNC machining equipment provided in the embodiment of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments; based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] In the field of CNC machining, when the tool moves along a linear path and encounters a tangential discontinuity at the junction point, the CNC machine tool must reduce its speed to zero at that point. This frequent start-stop operation significantly reduces machining efficiency and easily triggers machine tool chatter, making it difficult to leverage the advantages of CNC machine tools in high-speed, high-precision machining. Existing local corner smoothing methods typically only address a single corner, which easily leads to interference between adjacent transition curves, causing an abnormally large curvature extreme value in the actual transition curve, thus severely limiting the feed rate of the tool when passing through the corner. To solve the above technical problems, this invention provides a linear path smoothing method that constructs a continuous 11th-order PH curve (Pythagorean Hodograf curve) to replace the intermediate straight segment. This fundamentally eliminates the potential for interference between adjacent transition curves while reducing the peak curvature of the path, thereby effectively improving the corner transition speed and overall cutting efficiency of the machine tool.
[0019] This embodiment details the method for global smoothing and curvature optimization of linear paths based on pH curves. This method is primarily used to construct smoothing curves. Then, the polygonal path consisting of continuous straight lines in the toolpath is smoothed overall. This polygonal path specifically includes a first straight line segment, a second straight line segment, and a third straight line segment connected sequentially. The starting point of the first straight line segment is... The destination is The starting point of the second straight segment is The destination is The starting point of the third straight segment is The destination is Label The range of values is greater than or equal to 1 and less than or equal to 1. Integers, where This represents the total number of straight segments in the toolpath. The smooth curve constructed in this embodiment consists of a complete 11th-order PH curve; the entry point of this smooth curve is defined as... The exit point is defined as The smoothing process specifically involves replacing the local polyline path containing the first corner, the second straight line segment, and the second corner with a smooth curve, and then outputting the generated smooth curve as the actual machining path of the CNC machine tool. This method specifically includes the following five core steps.
[0020] The first step, based on the continuity conditions of the first and second derivatives, sets the first and second derivative parameters of the 11th-order pH smoothing curve at the inlet and outlet points, and analytically calculates the initial complex coefficients used to determine the state of the curve endpoints. The 11th-order pH curve constructed in this embodiment... It has a special algebraic geometric structure, and its curve derivative satisfies a specific condition, namely the first derivative of the curve. It is equal to a fifth-order complex polynomial, i.e., a pre-velocity polynomial. The square of the fifth-order pre-velocity polynomial. It consists of six undetermined complex coefficients, denoted as follows: , , , , and The specific algebraic expression of this fifth-order complex polynomial is: ;in, For curve parameters, It is a fifth-order complex polynomial. For the summation index, The fifth-order complex polynomial represents the first... Each complex coefficient Let represent the 5th-order Bernstein basis functions. For a pre-given entry point... The first-order derivative at the location and second-order derivative and export points The first-order derivative at the location and second-order derivative The complex coefficients of the four initial pre-velocity polynomials of the smooth curve can be directly determined.
[0021] The specific calculation process is as follows: initial complex coefficients In order to make The complex roots whose direction is consistent with the tangential direction at the entry point, and satisfy the following conditions: Initial complex coefficients equal to the initial complex coefficients With second-order derivative Divide by 10 times the initial complex coefficient The sum of the quotients; initial complex coefficients In order to make The complex roots whose direction is consistent with the tangential direction at the exit point, and satisfy the following conditions: Initial complex coefficients equal to the initial complex coefficients With second-order derivative Divide by 10 times the initial complex coefficient The difference between the quotients. By pre-anchoring these four initial complex coefficients, the smooth curve can meet the preset continuity requirements with the original linear path at both ends, thereby achieving a high-order smooth transition of the path curvature.
[0022] The second step is to set the entry point of the smooth curve based on the positional continuity constraint. and exit point The coordinates of the curve are used to determine its displacement conditions. The first straight segment intersects with the second straight segment to form the first corner, and the second straight segment intersects with the third straight segment to form the second corner. In this embodiment, the upper limit of the approximate error is determined based on the angle bisectors of the interior angles of the first and second corners, respectively. The offset distance is determined, and the entry point of the smooth curve is determined on the first and third straight segments, respectively. and exit point Once the endpoint positions are determined, the displacement parameters in complex form of the smooth curve can be calculated. Furthermore, the displacement constraint equation for the smooth curve was constructed. The specific form of this displacement constraint equation is as follows: .
[0023] All coefficients in the above equations are complex constants, and their specific values depend on the parameters determined in the preceding steps. equal ,coefficient equal ,coefficient equal .coefficient equal .coefficient equal constant term It is a specific quadratic combination of four initial complex coefficients minus 11 times the complex displacement parameter. The difference obtained; where, For the plural form of the exit point Complex form of entry point The complex displacements between the given points. This displacement equation macroscopically constrains the complex coefficients to be determined, ensuring that the final generated curve accurately connects the specified starting and ending positions.
[0024] The third step is to determine the smoothing curve in terms of parameters. midpoint Then, tangent direction constraints and perpendicular distance constraints are applied to the midpoint relative to the second straight line segment. Specifically, this step first sets the entry point... Convert to complex form The smoothing curve is set in parameters Point at Expand into a polynomial form containing the complex coefficients of each term. This point is specifically represented as... The constant coefficients in the above polynomials are respectively... , and The corresponding first-order coefficients are: ,and .
[0025] Polynomial constant term Represented as:
[0026] To ensure the curve closely follows the original path without excessive deviation, the tangent at the midpoint needs to be kept parallel to the original second straight line segment. Based on this, the first derivative of the smooth curve at that point is calculated. The specific formula for the first derivative here is:
[0027] Among them, internal variables Obtain the unit direction vector of the original second line segment. By letting the first derivative With unit direction vector The imaginary part of the product of the conjugate complex numbers is always equal to 0, thus constructing the tangential constraint equations. The tangential constraint equations are specifically expressed as:
[0028] Subsequently, based on the upper limit of approximation error Set the actual deviation distance from the midpoint to the second straight line segment to be equal to the specified distance. ,and The specified distance equal to vector difference Subtract the reference point Then multiply by the unit direction vector The imaginary part of the product of the conjugate complex numbers is used to establish the distance constraint equation. The final distance constraint equation can be expressed in detail as follows: The conversion coefficients involved are as follows: , Let the complex form of a reference point on the second straight segment be the form of the first corner, and preferably the complex form of the first corner. ,and ,and ,and ,and ;in, Represents the unit direction vector The conjugate of complex numbers, This represents the operator that takes the imaginary part of a complex number. These two constraints together ensure the high fidelity of the curve profile after the overall substitution.
[0029] The fourth step involves simultaneously solving the known conditions and various constraint equations into a system of quadratic equations in the real number domain. Since solving directly in the complex number domain is highly complex, this embodiment uses the complex coefficients to be determined... and Let them be complex numbers consisting of unknown real parts and unknown imaginary parts, respectively. Specifically, let them be... as well as ,in, The imaginary unit, , , and All are unknown real variables. At the same time, all known complex coefficients are separated into real and imaginary parts, i.e., set... , , , , , , , , , , , , as well as After algebraic simplification, we can obtain a column vector consisting of the four real unknowns. The four quadratic real equations specifically include the real part equations of displacement constraints separated from the displacement equations. Imaginary part equation of displacement constraint The tangential constraint equations derived above and distance constraint equations The above four equations can be uniformly expressed as a quadratic form with matrix parameters, namely: , , ,as well as .
[0030] Each quadratic equation can be expressed in the standard quadratic form, containing a real symmetric matrix with specific known parameters, a column vector of real coefficients, and a constant term. For the real part equation of the displacement constraint, its internal parameters are as follows: ,and ,and .
[0031] For the imaginary part equation of the displacement constraint, the internal parameters are as follows: ,and ,and .
[0032] For the tangential constraint equations, their internal parameters are as follows: ,and ,and .
[0033] For the distance constraint equation, the internal parameters are as follows: ,and ,and ,in express The imaginary part of the equation. Solving the system of real nonlinear equations simultaneously yields the column vector. The candidate solutions are selected, and the effective solutions that satisfy the preset upper limit of approximation error, endpoint continuity requirements, and minimum curvature peak conditions are chosen from the candidate solutions. This process is then used to determine the remaining two complex coefficients of the control curve's internal shape. and .
[0034] The fifth step involves generating a complete smooth curve based on all parameters obtained from solving the equations, and analytically calculating its curvature and arc length for real-time use by the CNC system. After obtaining... to After a total of six complete complex coefficients, let The 12 control points were then calculated sequentially using the standard pH curve recursive formula. to The specific analytical calculation formula for the control point sequence is as follows: , , , , , , , , , as well as By using the linear weighted summation of these 12 control points and 11 Bernstein basis functions, a complete 11th-order pH smoothing curve is constructed. The expression for a smooth curve is defined as follows: ;in, Curve parameters The corresponding smooth curve points, For the first One control point, It is an 11th-order Bernstein basis function. Based on the inherent properties of the PH curve, the curvature of this curve at any parameter point... and overall curve arc length Both can be calculated analytically. Specifically, the curvature at any parameter point is expressed as: The first derivative of the curve And the second derivative of the curve The derivative formula above All refer to The Bernstein basis function. The precise arc length calculation formula for the overall smooth curve is: ;in, and For the summation index, and The complex coefficients of a fifth-order complex polynomial. for The conjugate complex number. The analytical calculation formula directly relies on the derivatives of each order and the determined complex coefficients, without the need for complex numerical iterative integration; this not only avoids the truncation error that may be introduced by numerical calculation, but also significantly reduces the computational load of the control system, enabling the CNC machine tool to perform real-time interpolation motion based on the smoothed path. This high-order smoothing scheme based on arc length parameter expression and curvature analytical expression realizes online smooth cutting machining.
[0035] To further illustrate the practical application effect of the technical solution of the present invention, this embodiment provides a specific example of linear path smoothing. Addressing the issue that existing single-corner smoothing methods easily cause interference between adjacent transition curves when processing continuous short straight segments, leading to a sharp increase in curvature extrema, this embodiment employs the aforementioned linear path global smoothing and curvature optimization method based on the PH curve for rigorous comparative verification. Specifically, in a set two-dimensional machining coordinate system, eight continuous path points are obtained, i.e., points... To the point The original toolpath. The coordinates of these eight path points are as follows: , , , , , , as well as Based on this, an upper limit for the permissible approximate error in CNC machining is set. It is 50μm.
[0036] The overall path smoothing effect in this embodiment is as follows: The overall path smoothing method of this invention is used to smooth the continuous short line segments in the above path. Figure 1As shown in the figure. Because this method treats two adjacent corners and the connecting straight line segment as a whole and directly replaces them with a high-order continuous 11th-degree PH curve, it avoids the geometric interference problem caused by overlapping transition intervals when smoothing a single corner independently. Analysis of the curvature distribution data of the output smoothed curve shows that, compared to the traditional single-corner PH curve smoothing method, the smoothed curve generated in this embodiment not only ensures the continuity of the second derivative at the junction of each path segment but also reduces the peak curvature of the entire transition path. To more intuitively demonstrate this technical advantage, a comparison of the trajectories generated using the traditional single-corner PH curve method and the smoothing method of this embodiment is shown in the figure. Figure 2 As shown, the curvature distribution of the two is compared as follows: Figure 3 As shown in the diagram, comparative analysis reveals that the smooth curve generated in this embodiment possesses advantages such as higher continuity and effective suppression of curvature surges. Smaller curvature extrema imply a smaller normal acceleration requirement, effectively reducing transient torque impact on the machine tool feed axis drive motor, avoiding high-frequency chatter, and thus significantly improving overall machining efficiency while ensuring the precision of the part's machining contour. Simultaneously, since the entire 11th-order PH curve has analytical expressions for curvature and arc length, the CNC system does not need to consume significant system memory and computing resources for complex numerical integration iterations during speed planning and position interpolation, meeting the real-time requirements of the CNC system for control commands. This invention possesses advantages such as continuous second derivatives, controllable approximation errors, and analytical calculation of curvature and arc length. This analytical geometric calculation mechanism significantly reduces system computation time, facilitating the realization of online smooth interpolation motion.
[0037] To quickly apply the above smoothing calculation method to actual industrial manufacturing environments, such as... Figure 4As shown, in one implementation, the linear path global smoothing and curvature optimization method based on the PH curve can be executed by a CNC machining system including a controller, a memory, and a CNC machine tool. The CNC machining system internally configures a controller, a memory connected to the controller via high-speed communication, and the CNC machine tool. The memory stores a callable CNC machining control program. When the controller loads and runs the program, it specifically calls the internally built data parsing module to read the original toolpath input by the user using G-code and quickly extracts the endpoint parameters of each discrete straight line segment constituting the polyline trajectory. Subsequently, the controller triggers the trajectory smoothing module to execute the aforementioned smoothing calculation process based on the 11th order PH curve, obtaining the accurate complex coefficient matrix of each segment of the high-order smoothing curve that replaces the local polyline path, as well as the corresponding analytical curvature and arc length calculation functions. After completing the parameter solution, the trajectory smoothing module transmits this analytical data to the interpolation execution module via an internal bus. The interpolation execution module calculates discrete feed position commands according to the interpolation cycle based on the base machining feed rate set by the current process parameters, combined with the real-time acquired arc length and curvature parameters. These commands are then sent to the servo drive unit of the CNC machine tool, directly driving the spindle tool to complete a smooth cutting action along the smoothed 11-fold PH curve. This hardware and software integrated system architecture ensures high smoothness and dimensional stability of complex toolpaths under high-speed motion.
[0038] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Those skilled in the art can make appropriate modifications or substitutions to the above embodiments without departing from the technical concept of the present invention.
Claims
1. A method for global smoothing and curvature optimization of linear paths based on pH curves, characterized in that, Includes the following steps: Obtain the original toolpath for CNC machining. The original toolpath includes a first straight line segment, a second straight line segment, and a third straight line segment connected in sequence. The first straight line segment intersects the second straight line segment at a first corner, and the second straight line segment intersects the third straight line segment at a second corner. An 11th-order PH curve is constructed to replace the local polyline path containing the first corner, the second straight line segment, and the second corner, and the 11th-order PH curve is used as the actual machining trajectory of the CNC machine tool; wherein, the generation process of the 11th-order PH curve includes: Based on a preset upper limit for approximate error, the offset distances that satisfy the preset upper limit for approximate error are determined according to the angle bisectors of the interior angles of the first corner and the second corner, respectively, and the entry point and exit point of the 11th PH curve are determined on the first straight line segment and the third straight line segment, respectively. Based on the first derivative continuity and second derivative continuity constraints at the entry point and the exit point, calculate the four initial complex coefficients used to determine the endpoint states in the 11th degree PH curve. At the intermediate parameter point of the 11th PH curve, a tangential parallel constraint is established relative to the unit direction of the second straight line segment, and a distance constraint is established relative to the second straight line segment that satisfies the preset upper limit of approximate error. Equations are established based on the displacement continuity constraint between the entry point and the exit point, the tangential parallel constraint, and the distance constraint. The two undetermined complex coefficients used to determine the internal morphology of the 11th-order PH curve are then solved using the four initial complex coefficients to generate the complete 11th-order PH curve. The curvature parameters and arc length parameters corresponding to the 11th-order PH curve are input to the CNC system of the CNC machine tool. The CNC system generates interpolation commands based on the curvature parameters and arc length parameters, and drives the tool to perform machining along the 11th-order PH curve based on the interpolation commands.
2. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 1, characterized in that, The calculation of the four initial complex coefficients used to determine the endpoint states in the 11th-order PH curve, based on the first-order derivative continuity and second-order derivative continuity constraints at the entry and exit points, specifically includes: For a given first derivative at the aforementioned entry point Second-order derivative and the first derivative at the exit point Second-order derivative Determine the four initial complex coefficients. , , , The following relationship must be satisfied: ,and In order to make The complex root whose direction is consistent with the tangential direction at the entry point; ; ,and In order to make The complex root whose direction is consistent with the tangential direction at the exit point; 。 3. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 2, characterized in that, Obtain the complex form of the entry point. and the complex form of the exit point And obtain the displacement in complex form between the entry point and the exit point. The displacement equations for the 11th PH curves corresponding to the displacement continuity constraint are as follows: ; in, and These are the two complex coefficients to be determined; , and The coefficient of the quadratic term is , and , , ; ; ; ; in, , and These are the complex coefficients in the displacement equation; , , and These are the four initial complex coefficients; The entry point is in its complex form; The exit point is in complex form; The complex form of the exit point The complex form of the entry point Complex displacements between, and .
4. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 3, characterized in that, The intermediate parameter point is a curve parameter. The point at which the 11th pH curve is located, and the point at which the intermediate parameter point is located. Represented as: ; in, The curve parameter is located at the intermediate parameter point. ; The point on the 11th pH curve at the intermediate parameter point; For constant terms; and The coefficient of the linear term; , and The coefficient of the quadratic term is , and , , ; ; ; ; in, The entry point is in its complex form; , , and These are the four initial complex coefficients.
5. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 4, characterized in that, The establishment of a tangential parallel constraint relative to the unit direction of the second straight line segment specifically includes: The first derivative of the 11th pH curve at the intermediate parameter point Represented as: ; in, Let be the intermediate variable composed of the four initial complex coefficients, and ; , , and These are the four initial complex coefficients; and These are the two complex coefficients to be determined; Let be the complex number corresponding to the unit direction vector of the second line segment, and ; The operator represents the imaginary part of a complex number; by making the tangent of the curve at the intermediate parameter point parallel to the second line segment, the following tangential constraint equation is obtained: 。 6. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 5, characterized in that, The establishment of a distance constraint relative to the second straight line segment that satisfies the preset upper limit of approximate error specifically includes: The distance between the intermediate parameter point on the 11th pH curve and the second straight line segment is set to a specified distance. ,in , Given the preset upper limit of approximation error, the distance constraint equation is obtained: ; in, , Let the reference point on the second line segment be in complex form. , , , , , Representing vectors The conjugate of complex numbers, This represents an operator that takes the imaginary part of a complex number; and after generating the 11th-order PH curve, the maximum deviation distance of the 11th-order PH curve relative to the second straight line segment is calculated. When the maximum deviation distance is greater than the preset upper limit of approximation error, the specified distance is reduced. Alternatively, the entry point and the exit point can be adjusted along the first straight line segment and the third straight line segment respectively, and the two complex coefficients to be solved again until the maximum deviation distance is less than or equal to the preset upper limit of approximate error.
7. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 6, characterized in that, The process of solving for the two undetermined complex coefficients in the 11th pH curve, which are used to determine the internal morphology, by combining the four initial complex coefficients, specifically includes: The complex coefficients to be determined and Let each be a complex number consisting of an unknown real part and an unknown imaginary part, respectively. , ,in, The imaginary unit, , , and All are unknown real number variables; and an unknown real number vector is defined. ; Represent the known coefficients using their real and imaginary parts: , , , , , , , , , , , , , ,in and They represent The real and imaginary parts; The displacement equation, the tangential constraint equation, and the distance constraint equation are transformed into a function relating to the unknown real vector. Four quadratic real equations: Real part equation of displacement constraint: ; Imaginary part equation of displacement constraint: ; Tangential constraint equations: ; Distance constraint equations: ;in, , , and It is a real symmetric matrix. , , and It is a column vector of real coefficients. , , and For constant terms; Solving the four quadratic real equations simultaneously yields the unknown real vector. The solution is then used to determine the two complex coefficients to be determined. and .
8. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 7, characterized in that, The real symmetric matrix in the four quadratic real equations , , and They are represented as follows: ; ; ; ; The vectors and constants in the equation are expressed as follows: , ; , ; , ; , ,in express The imaginary part.
9. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 8, characterized in that, The generation of the complete 11 pH curves specifically includes: make And based on the four initial complex coefficients , , , and the two complex coefficients obtained by solving. , Calculate the 12 control points of the 11 pH curves. to Its recursive relation is expressed as: ; ; ; ; ; ; ; ; ; ; ; Based on the calculated 12 control points, construct the complete 11 pH curves. ;in, The 11 pH curves were obtained using the following curve parameters: The point in complex form at the location, For the first One control point, For 11th-order Bernstein basis functions, For control point indexes.
10. The method for global smoothing and curvature optimization of linear paths based on pH curves as described in claim 9, characterized in that, The method also includes: The curvature of the complete 11th pH curve generated by analytical calculation and arc length ; Wherein, the curvature ; In the formula, the first derivative of the curve Second derivative of the curve ;in, For curve parameters, and ; For the 11 pH curves at parameters Curvature at that point; The first derivative of the 11th pH curve; The second derivative of the 11th pH curve; for The conjugate of complex numbers; Operators that take the imaginary part of a complex number; , and These are the control points for the 11th pH curve; for Second-order Bernstein basis functions; For the index of the control point or Bernstein function, Represents the modulus of a complex number; The arc length ;in, The arc length of the 11th pH curve; and For summation index; and The complex coefficients of the fifth-order complex polynomial; for The conjugate of complex numbers; , and All are binomial coefficients. The sum of the subscripts of the binomial coefficients; The curvature and arc length obtained from the analytical calculation are input into the CNC system of the CNC machine tool for real-time machining command interpolation.