A curve fitting system and device for interpolation of a numerical control system based on an involute

By using an involute-based curve fitting system, the problem of numerous straight or circular segments in curve interpolation processing in CNC systems is solved, achieving efficient curve fitting and interpolation, reducing system load, and improving fitting accuracy and efficiency.

CN116339243BActive Publication Date: 2025-11-21NAMEI MACHINE TOOL (SHANDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211574656.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2025-11-21
Estimated Expiration
2042-12-08

AI Technical Summary

Technical Problem

When existing CNC systems perform speed planning and interpolation on curves, they require a large number of discrete straight or circular segments, which increases the system's processing load and computational burden.

Method used

An involute-based curve fitting system is adopted. By acquiring the G-code after post-processing by computer-aided manufacturing software, the curve is segmented and fitted. The coordinates and tangent vectors of each segment point are calculated using the involute equation, which reduces the number of straight or circular segments and improves fitting accuracy and interpolation efficiency.

Benefits of technology

It effectively reduces the processing volume and computational burden of the CNC system, improves the interpolation effect, ensures the fitting accuracy, reduces hardware requirements, and improves the fitting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339243B_ABST
    Figure CN116339243B_ABST
Patent Text Reader

Abstract

A kind of curve fitting system and equipment based on involute numerical control system interpolation, belong to numerical control system speed planning and interpolation technical field.To solve the problem that the number of discrete straight line or circular arc segment needed by existing numerical control system when carrying out speed planning and interpolation processing to curve is more, increase the processing capacity and calculation burden of numerical control system.The curve fitting system of the present application, comprising: curve parameter acquisition unit for obtaining G code and extracting curve parameters to be fitted, fitting curve segmentation and tangent vector acquisition unit for obtaining the coordinates of each segmented point and the tangent vector at each segmented point by segmenting the curve to be fitted, and curve fitting unit for carrying out curve fitting;Curve fitting unit reads in segmented points A and B, the intersection point of the perpendicular of tangent vector AG at point A and the perpendicular of tangent vector BH at point B of the curve to be fitted is point C, and then the first and last angles θ1, θ2 of involute are obtained, and fitting is carried out in combination with the equation formula of involute.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of speed planning and interpolation of numerical control system, and particularly relates to a curve fitting system and equipment based on involute. BACKGROUND

[0002] With the increase of modeling complexity, many product designs adopt curve surface modeling, and the main curve form is spline curve, such as nurbs curve (non-uniform rational B-spline curve), B-spline, Bezier curve, etc. First, tool path planning is performed by CAM (computer aided manufacturing) software, and then the post-processing is converted into G code that can be recognized by the numerical control system for processing. The CAM software often adopts two ways for curve processing. One is to directly output the curve, and input the curve value point, control point, weight and other information to the numerical control system, so that the numerical control system performs speed planning and interpolation of the curve. The other is to discretize the curve into linear segments or circular arc segments according to the fitting accuracy requirements set by the CAM software, and then the numerical control system performs speed planning and interpolation of the discretized linear or circular arc segments.

[0003] The numerical control system also has two methods for processing the speed planning and interpolation of the curve. One is similar to the CAM software, which discretizes the curve into linear segments or circular arc segments under the premise of meeting the fitting accuracy set by the numerical control system, and then performs speed planning and interpolation of the discretized linear or circular arc segments. Such processing method is because the numerical control system itself often supports linear and circular arc. The other is to directly perform speed planning and interpolation of the curve itself, which has the advantage of no fitting error, and the disadvantage is that the overall trend of such curve is often a high-order equation, which cannot be simply obtained by control point, value point and other information, and needs specific calculation, thereby causing more processing categories and larger calculation amount for online speed planning and interpolation, and the numerical control system has a large burden. Although some existing numerical control systems have provided the function of online interpolation of the curve, due to the complexity of the curve, the actual performance is still not ideal. Therefore, the mainstream processing method is still to discretize the curve into linear or circular arc, and then perform speed planning and interpolation. However, this process also has a problem, that is, in order to meet the fitting accuracy requirements, the number of discretized linear or circular arc segments is large, which also increases the processing amount and calculation burden of the numerical control system.

[0004] In summary, when the existing numerical control system performs speed planning and interpolation processing on the curve, there is a problem that the number of discretized linear or circular arc segments is large, thereby increasing the processing amount and calculation burden of the existing numerical control system. SUMMARY

[0005] The application aims to solve the problem that the existing numerical control system needs more discrete straight line or circular arc segments when planning and interpolating the curve, which increases the processing capacity and calculation burden of the numerical control system.

[0006] A curve fitting system based on the involute interpolation of a numerical control system, comprising:

[0007] A curve parameter acquisition unit is configured to acquire G code that can be recognized by the numerical control system after the post-processing of computer-aided manufacturing software, and to acquire parameters of a curve to be fitted from the G code;

[0008] A fitting curve segmentation and tangent vector acquisition unit is configured to segment the curve to be fitted according to a set number N of discrete segments, to obtain coordinates of each segmented point and a tangent vector at each segmented point;

[0009] A curve fitting unit is configured to perform curve fitting according to the parameters of the curve to be fitted, the coordinates of each segmented point, and the tangent vector at each segmented point; the specific fitting process includes the following steps:

[0010] Step one, read in the first segmented point and the second segmented point, in a spatial rectangular coordinate system, take the first segmented point as the starting point and mark it as point A(x A ,y A ,z A ), take the second segmented point as the ending point and mark it as point B(x B ,y B ,z B ), the intersection point of the tangent vector AG perpendicular at point A and the tangent vector BH perpendicular at point B of the curve to be fitted is point C(x C ,y C ,z C ); the included angle between CA and the x-axis is θ1, and the included angle between CB and the x-axis is θ2, i.e. the involute first and last angles θ1, θ2;

[0011] According to the equation formula of the involute: ρ=r0+r×θ, where θ∈[0,2×π], r0 is the initial radius when the angle θ=0, and r is the base circle radius;

[0012] Therefore, the coordinates of any point on the involute are:

[0013] x=ρ×cos(θ)+r×cos(α)+x D

[0014] y=ρ×sin(θ)+r×sin(α)+y D

[0015] Where (x D ,y D ) is the center coordinate value of the involute base circle,

[0016] The coordinates of the midpoint D of points A and B are calculated, and the coordinates of the point The distance from the midpoint D is calculated as the fitting error ε. The angle value obtained by adding the first and last angles θ1, θ2 of the involute is brought into the x and y coordinate values obtained by solving the above involute formula;

[0017] Step two, determine whether the fitting error ε meets the accuracy requirement, if yes, execute step three; otherwise, take the midpoint D as a new inserted segmentation point, take the point A as the first point and the midpoint D as the tail point to execute step one;

[0018] Step three, take the current tail point as the first point, determine whether there is a segmentation point to be read, if yes, output the speed and position obtained in the first step of this iteration, read the next segmentation point as the new tail point, and return to step one, if no, output the speed and position obtained in the first step of this iteration, and end the curve fitting process.

[0019] Further, the curve fitting unit needs to perform curve fitting according to the lengths of AC and BC and obtain the fitting error ε when the length of AC < the length of BC and the point A to B is clockwise rotation, DF is perpendicular to BC and DE is perpendicular to AC between the extension line of BC and the AC line segment, CF = CE, DF = DE = r;

[0020] Then ∠FDE = |θ1-θ2| = |Δθ|.

[0021] According to the involute equation, we have:

[0022]

[0023]

[0024] Solve for r, if r < 0, then solve for r0 according to the following formula:

[0025]

[0026] Then solve the lengths of AE and BF according to the following formula:

[0027]

[0028]

[0029] E and F points are on the straight lines AC and BC respectively, according to the straight line formula, the coordinates of E and F points are solved:

[0030]

[0031] DF⊥BC, then according to the vector relationship, the coordinates of point D are solved:

[0032]

[0033] Further, a complete involute formula is obtained: ρ=r0+r×θ, where θ∈[θ1, θ2], r0 is the initial radius when θ=0, and r is the base circle radius;

[0034] Then the coordinates of any point on the involute are P:

[0035] x=ρ×cos(θ)+r×cos(α)+x D

[0036] y=ρ×sin(θ)+r×sin(α)+y D

[0037] where

[0038] The coordinates of the midpoint D of points A and B are calculated, the distance between the coordinate point on the curve and the midpoint D is calculated, and the distance is taken as the fitting error ε.

[0039] Or,

[0040] When the length of AC is greater than the length of BC, and the A point is clockwise rotated to the B point, DF⊥BC and DE⊥AC are made between the line segments of BC and the extension line of AC, CF=CE, and DF=DE=r.

[0041] Then ∠FDE=|θ1-θ2|=|Δθ|.

[0042] According to the involute equation, we have:

[0043]

[0044] Solve the value of r. If r<0, then solve r0 according to the following formula:

[0045]

[0046] Then solve the lengths of AE and BF according to the following formula:

[0047]

[0048]

[0049] E and F points are on the straight lines AC and BC respectively. According to the straight line formula, the coordinates of E and F points are solved:

[0050]

[0051] DF⊥BC, then according to the vector relationship, the coordinates of point D are solved:

[0052]

[0053] Further, a complete involute formula is obtained: p = r0 + r x theta, wherein theta is in [theta1, theta2], r0 is the initial radius when the angle theta = 0, and r is the base circle radius;

[0054] The coordinates of any point on the involute are P:

[0055] x = p x cos(theta) + r x cos(alpha) + x D

[0056] y = p x sin(theta) + r x sin(alpha) + y D

[0057] Wherein

[0058] The coordinates of the midpoint D of points A and B are calculated, the distance between the coordinate point on the curve and the midpoint D is calculated, and the distance is taken as the fitting error epsilon.

[0059] Or,

[0060] When the length of AC is greater than the length of BC, and A to B point is counterclockwise rotation, DF is perpendicular to BC between the extension of AC and BC segment, DE is perpendicular to AC, CF = CE, DF = DE = r;

[0061] Then, angle FDE = |theta1 - theta2| = |delta theta|;

[0062] According to the involute equation, we get:

[0063]

[0064] Solve the value of r, if r < 0, then solve r0 according to the following formula:

[0065]

[0066] Then, the lengths of AE and BF are solved according to the following formula:

[0067]

[0068]

[0069] E, F points are on the straight line AC, BC respectively, according to the straight line formula, the coordinates of E, F points are solved: ​

[0070]

[0071] DF⊥BC, then according to the vector relationship, the coordinates of point D are solved:

[0072]

[0073] Further, a complete involute formula is obtained: p = r0 + r x θ, where θ ∈ [θ1, θ2], r0 is the initial radius when the angle θ = 0, and r is the base circle radius;

[0074] Then the coordinates of any point on the involute are P:

[0075] x = p x cos (θ) + r x cos (a) + x D

[0076] y = p x sin (θ) + r x sin (a) + y D

[0077] Where

[0078] The coordinates of the midpoint D of points A and B are calculated, the distance between the coordinate point P on the curve and the midpoint D is calculated, and the distance is taken as the fitting error ε. (θ1+θ2) / 2

[0079] Or,

[0080] When the length of AC is less than the length of BC, and the point A is counterclockwise rotated to the point B, DF is perpendicular to BC and DE is perpendicular to AC between the extension of BC and AC, CF = CE, DF = DE = r;

[0081] Then ∠FDE = |θ1-θ2| = |Δθ|;

[0082] According to the involute equation, we get:

[0083]

[0084] Solve for r, if r < 0, then solve for r0 according to the following formula:

[0085]

[0086] Then according to the following formula to solve the length of AE, BF:

[0087]

[0088]

[0089] ​E, F points are on the straight line AC, BC respectively, according to straight line formula, the coordinates of E, F points are solved out:

[0090]

[0091] DF is perpendicular to BC, then according to vector relationship, the coordinates of D point are solved out:

[0092]

[0093] Further, a complete involute formula is obtained: rho=r0+r*theta, wherein theta is in [theta1,theta2], r0 is initial radius when angle theta=0, and r is base circle radius;

[0094] Then the coordinates of any point on the involute are P:

[0095] x=rho*cos(theta)+r*cos(alpha)+x D

[0096] y=rho*sin(theta)+r*sin(alpha)+y D

[0097] Wherein

[0098] The coordinates of the midpoint D of point A and point B are calculated, the distance between the coordinate point on the curve and the midpoint D is calculated, and the distance is taken as fitting error epsilon.

[0099] A computer storage medium, the storage medium has at least one instruction, the at least one instruction is loaded and run by the processor to realize the one kind of curve fitting system of numerical control system interpolation based on involute.

[0100] A curve fitting device based on the numerical control system interpolation of involute, the device includes processor and memory, the memory has at least one instruction, the at least one instruction is loaded and run by the processor to realize the one kind of curve fitting system based on the numerical control system interpolation of involute.

[0101] Inventive effect:

[0102] By using the present application, the interpolation curve based on involute in numerical control system can be directly fitted, not only the fitting precision can be ensured, the subsequent interpolation effect can be effectively improved, but also the problem that the number of discrete straight line or circular arc segment is needed when the curve is processed by speed planning and interpolation in the existing numerical control system can be effectively solved, the processing amount and calculation burden of numerical control system can be greatly reduced, the hardware requirement of numerical control system can be reduced, and the fitting efficiency can be greatly improved. BRIEF DESCRIPTION OF DRAWINGS

[0103] ​Figure 1 A schematic diagram for one of the segments of the curve to be fitted.

[0104] Figure 2 A schematic diagram of the fitted graph corresponding to the case one when r < 0.

[0105] Figure 3 A schematic diagram of the fitted graph corresponding to the case two.

[0106] Figure 4 A schematic diagram of the fitted graph corresponding to the case two when r < 0.

[0107] Figure 5 A schematic diagram of the fitted graph corresponding to the case three.

[0108] Figure 6 A schematic diagram of the fitted graph corresponding to the case three when r < 0.

[0109] Figure 7 A schematic diagram of the fitted graph corresponding to the case four.

[0110] Figure 8 A schematic diagram of the fitted graph corresponding to the case four when r < 0.

[0111] Figure 9 A schematic diagram of the distance between the coordinate point on the curve and the midpoint D. A schematic diagram of the distance between the coordinate point on the curve and the midpoint D. DETAILED DESCRIPTION DETAILED DESCRIPTION

[0113] The embodiment is a curve fitting system for interpolation of a numerical control system based on involute. The system can be used as a component of an interpolation module in a numerical control system, and can be used as a whole with other curve fitting methods to form a curve fitting module, thereby assisting the interpolation of the numerical control system. The curve fitting system for interpolation of a numerical control system based on involute comprises:

[0114] A curve parameter acquisition unit is configured to acquire G codes that can be recognized by a numerical control system after post-processing of a computer aided manufacturing software, and to acquire parameters of a curve to be fitted from the G codes.

[0115] A fitted curve segmenting and tangent vector acquisition unit is configured to segment the curve to be fitted according to a set number N of discrete segments, to obtain coordinates of each segment point and tangent vectors at each segment point.

[0116] A curve fitting unit is configured to fit the curve to be fitted according to the parameters of the curve to be fitted, the coordinates of each segment point and the tangent vectors at each segment point. The specific fitting process comprises the following steps:

[0117] Step one, as shown in Figure 1As shown, read into the first segment point and the second segment point, the first segment point as the first point and recorded as point A(x A ,y A ,z A ), the second segment point as the tail point and recorded as point B(x B ,y B ,z B ), the intersection of the tangent vector AG perpendicular at point A and the tangent vector BH perpendicular at point B of the curve to be fitted is point C(x C ,y C ,z C ), wherein x, y, z are three coordinate axes of a space rectangular coordinate system, (x A ,y A ,z A ) is the coordinate of the first segment point, (x B ,y B ,z B ) is the coordinate of the second segment point; the angle between CA and the x-axis is θ1, and the angle between CB and the x-axis is θ2.

[0118] According to the equation formula of involute: ρ=r0+r×θ, wherein θ∈[0,2×π], r0 is the initial radius when the angle θ=0, and r is the base circle radius.

[0119] Therefore, the coordinates of any point on the involute are:

[0120] x=ρ×cos(θ)+r×cos(α)+x D

[0121] y=ρ×sin(θ)+r×sin(α)+y D

[0122] Wherein (x D ,y D ) is the center coordinate value of the involute base circle, When case one, three is When case two, four is

[0123] In order to ensure the uniqueness of the fitted involute, we need to compare the lengths of AC and BC, and the short part is retracted and the long part is extended. Specifically, it is divided into four cases:

[0124] Case one, as shown in Figure 1 , when the length of AC is less than the length of BC, and A to B point is clockwise rotation, then solve according to the following method:

[0125] Then make DF⊥BC, DE⊥AC between the extension line of BC and the line segment of AC, CF=CE, DF=DE=r

[0126] Then ∠FDE = |θ1-θ2| = |Δθ|.

[0127] According to the above involute equation, we can get:

[0128]

[0129] In the above formula, only r is unknown, so we can solve the value of r. If r < 0, the fitted graph becomes Figure 2 as shown in the following data processing process:

[0130] According to:

[0131] We can solve r0;

[0132] According to: (The formula here is directly represented by using the above formula, and does not actually directly represent the position relationship of each point in Figure 2 , which is directly adjusted according to the angle relationship in Figure 2 ; the other cases are also directly represented by using the above formula, and do not actually directly represent the position relationship of each point in the corresponding figure), the lengths of AE and BF are solved, and because points E and F are on straight lines AC and BC respectively, the coordinates of points E and F can be solved according to the straight line formula:

[0133] According to DF⊥BC, the coordinates of point D can be solved according to the vector relationship:

[0134] Thus we can get a complete involute formula: ρ = r0 + r × θ, where θ ∈ [θ1, θ2], r0 is the initial radius when θ = 0, and r is the base circle radius.

[0135] Then the coordinates of any point on the involute are P:

[0136] x = ρ × cos(θ) + r × cos(α) + x D

[0137] y = ρ × sin(θ) + r × sin(α) + y D

[0138] Where

[0139] The coordinates of the midpoint D of points A and B are calculated, as shown in the following figure: Figure 9 The coordinates of the point on the curve the distance from the midpoint D, and then take the distance as the fitting error ε; The angle value obtained by adding the first and last angles θ1, θ2 of the involute is brought into the xy coordinate value obtained by solving the above involute formula.

[0140] Step two, determine whether the fitting error ε meets the accuracy requirement, if yes, execute step three; otherwise, take the midpoint D as a new inserted segmentation point, take the point A as the first point and the midpoint D as the tail point to execute step one;

[0141] Step three, take the current tail point as the first point, determine whether there is a segmentation point to be read, if yes, output the speed and position obtained in this iteration step one, read the next segmentation point as the new tail point, and return to step one, if no, output the speed and position obtained in this iteration step one, and end the curve fitting process.

[0142] Case two, as shown in Figure 3 , when the length of AC > the length of BC, and the point A rotates clockwise to the point B, then solve according to the following method:

[0143] Then draw DF perpendicular to BC and DE perpendicular to AC between the line segments of BC and the extension of AC, CF = CE, DF = DE = r;

[0144] Then ∠FDE = |θ1-θ2| = |Δθ|.

[0145] According to the above involute equation, we can get:

[0146]

[0147] In the above formula, only r is unknown, so we can solve the value of r. If r < 0 in this case, the fitted graph becomes Figure 4 , and the subsequent data processing process is as follows:

[0148] According to:

[0149] We can solve r0;

[0150] According to:

[0151] Solve the lengths of AE and BF. Since points E and F are on straight lines AC and BC respectively, we can solve the coordinates of points E and F according to the straight line formula:

[0152] According to DF perpendicular to BC, we can solve the coordinates of point D according to the vector relationship:

[0153] Thus we can get a complete involute formula: p = r0 + r x theta, where theta e [theta1, theta2], r0 is the initial radius when theta = 0, and r is the base circle radius.

[0154] Then the coordinates of any point on the involute are P:

[0155] x = p x cos(theta) + r x cos(alpha) + x D

[0156] y = p x sin(theta) + r x sin(alpha) + y D

[0157] Where

[0158] Calculate the coordinates of the midpoint D of points A and B, calculate the distance between the coordinate point and the midpoint D, and take the distance as the fitting error e;

[0159] Step two, judge whether the fitting error e meets the accuracy requirement, if yes, execute step three; otherwise, take the midpoint D as a new inserted segmentation point, and take point A as the first point and the midpoint D as the tail point to execute step one;

[0160] Step three, take the current tail point as the first point, judge whether there is a segmentation point to be read, if yes, output the speed and position obtained in this iteration step one, read the next segmentation point as the new tail point, and return to step one, if no, output the speed and position obtained in this iteration step one, and end the curve fitting process.

[0161] Case three: as shown in the following figure, when the length of AC > the length of BC, and A to B point is counterclockwise rotation, then solve according to the following method: Figure 5

[0162] Then make DF perpendicular to BC and DE perpendicular to AC between the extension of AC and BC segment, CF = CE, DF = DE = r;

[0163] Then ∠FDE = |theta1 - theta2| = |delta theta|.

[0164] According to the involute equation above, we can get:

[0165]

[0166] In the above formula, only r is unknown, so we can solve r. If r < 0 in this case, the fitted graph becomes as shown in the following figure. Figure 6 The subsequent data processing process is as follows:​

[0167] According to the above, we can get the coordinates of point E and F as follows:

[0168] We can solve out r0;

[0169] According to the above, we can get the coordinates of point E and F as follows:

[0170] We can solve out the length of AE and BF, and because E and F points are on the straight lines AC and BC respectively, we can solve out the coordinates of E and F points according to the straight line formula as follows:

[0171] According to DF perpendicular to BC, we can solve out the coordinates of point D according to the vector relationship as follows:

[0172] Thus we can get a complete involute formula: p = r0 + r x theta, where theta is in the range of [theta1, theta2], r0 is the initial radius when theta = 0, and r is the base circle radius.

[0173] The coordinates of any point on the involute are P:

[0174] x = p x cos(theta) + r x cos(alpha) + x D

[0175] y = p x sin(theta) + r x sin(alpha) + y D

[0176] where

[0177] Calculate the coordinates of the midpoint D of points A and B, calculate the distance between the coordinate point on the curve and the midpoint D, and take the distance as the fitting error e; Step two, judge whether the fitting error e meets the accuracy requirement, if yes, execute step three, otherwise, take the midpoint D as a new inserted segmentation point, take point A as the first point and take the midpoint D as the tail point to execute step one;

[0178] Step three, take the current tail point as the first point, judge whether there is a segmentation point to be read, if yes, output the speed and position obtained in the first iteration step of this iteration, read the next segmentation point as the new tail point, and return to step one, if not, output the speed and position obtained in the first iteration step of this iteration, and end the curve fitting process.

[0179] Case four, as

[0180] Figure 7 ​As shown, when the length of AC < the length of BC, the point A to the point B is counterclockwise rotation, then the solution is as follows:

[0181] Then DF is perpendicular to BC, DE is perpendicular to AC, CF = CE, DF = DE = r on the extension of the line segment BC and the line segment AC between them;

[0182] Then ∠FDE = |θ1-θ2| = |Δθ}.

[0183] According to the previous involute equation can be obtained:

[0184]

[0185] In the above formula, only r is unknown, so the value of r can be solved. If r < 0 in this case, the fitting graph becomes Figure 8 As shown. The subsequent data processing process is as follows:

[0186] Also according to:

[0187] Can be solved out of r0;

[0188] Also according to:

[0189] Solve the length of AE, BF, and because E, F points are on the straight line AC, BC, respectively, according to the straight line formula, the coordinates of E, F points can be solved as:

[0190] Also according to DF is perpendicular to BC, according to the vector relationship, the coordinates of point D can be solved as:

[0191] Thus we can get a complete involute formula: ρ = r0 + r × θ, where θ ∈ [θ1, θ2], r0 is the initial radius when the angle θ = 0, r is the base circle radius.

[0192] Then the coordinates of any point on the involute are P:

[0193] x = ρ × cos(θ) + r × cos(α) + x D

[0194] y = ρ × sin(θ) + r × sin(α) + y D

[0195] Where

[0196] Calculate the coordinates of the midpoint D of points A and B, calculate the coordinates of the point on the curve the distance between the midpoint D, and then take the distance as the fitting error ε;

[0197] Step two, determine whether the fitting error ε meets the accuracy requirement, if yes, execute step three; otherwise, take the midpoint D as a new inserted segmentation point, take the point A as the first point, and take the midpoint D as the tail point to execute step one;

[0198] Step three, take the current tail point as the first point, determine whether there is a segmentation point to be read, if yes, output the speed and position obtained in step one of this iteration, read the next segmentation point as the new tail point, and return to step one, if no, output the speed and position obtained in step one of this iteration, and end the curve fitting process. Specific implementation two:

[0200] The embodiment is a computer storage medium, and the storage medium stores at least one instruction. The at least one instruction is loaded and run by a processor to implement the curve fitting system for interpolation of a numerical control system based on an involute.

[0201] It should be understood that any method described in the present application can be provided as a computer program product, software or computerized method, which can include a non-transitory machine-readable medium having instructions stored thereon, which can be used to program a computer system or other electronic device. The storage medium can include, but is not limited to, a magnetic storage medium, an optical storage medium, a magneto-optical storage medium, a read-only memory (ROM), a random access memory (RAM), an erasable programmable memory (such as an EPROM and an EEPROM), and a flash memory layer; or other types of media suitable for storing electronic instructions. Specific implementation three:

[0203] The embodiment is a curve fitting device for interpolation of a numerical control system based on an involute, and the device includes a processor and a memory. It should be understood that any device described in the present application includes a processor and a memory, and the device can also include other units, modules that display, interact, process, control, etc. through signals or instructions, and other functions; the device described in the embodiment can also be a numerical control system itself, or an interpolation module in the numerical control system.

[0204] The storage medium stores at least one instruction, and the at least one instruction is loaded and run by the processor to implement the curve fitting system for interpolation of a numerical control system based on an involute.

[0205] The above calculation examples of the present application are only used to illustrate the calculation model and calculation process of the present application, and are not used to limit the embodiments of the present application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art, and all the embodiments cannot be exhausted here. Any obvious changes or variations derived from the technical solutions of the present application are still within the protection scope of the present application.

Claims

1. A curve fitting system for CNC system interpolation based on involute curves, characterized in that, Comprising: A curve parameter acquisition unit, configured to acquire G-code that can be recognized by a numerical control system after post-processing of computer-aided manufacturing software; Obtain the parameters of the curve to be fitted from the G-code; A fitting curve segmentation and tangent vector acquisition unit, which segments the curve to be fitted according to the set number of discrete segments N, and obtains the coordinates of each segmentation point and the tangent vectors at each segmentation point; A curve fitting unit, which performs curve fitting according to the parameters of the curve to be fitted, the coordinates of each segmentation point, and the tangent vectors at each segmentation point; The specific fitting process includes the following steps: Step 1: Read in the first and second segment points. In the Cartesian coordinate system, take the first segment point as the starting point and denote it as point A(x). A ,y A ,z A The second segmentation point is taken as the tail point and denoted as point B(x). B ,y B ,z B The perpendicular line from the tangent vector AG to the curve to be fitted at point A and the perpendicular line from the tangent vector BH at point B intersect at point C(x). C ,y C ,z C ); The angle between CA and the x-axis is θ1, and the angle between CB and the x-axis is θ2, which are the involute's beginning and end angles θ1 and θ2. According to the equation formula of the involute: ρ = r0 + r×θ, where θ ∈ [0, 2×π], r0 is the initial radius when the angle θ = 0, and r is the base circle radius; Then the coordinates of any point on the involute are: x=ρ×cos(θ)+r×cos(α)+x D y=ρ×sin(θ)+r×sin(α)+y D Among them, (x D ,y D () represents the coordinates of the center of the base circle of the involute. Calculate the coordinates of the midpoint D between point A and point B, and calculate the coordinates of the point. The distance from the midpoint D is then used as the fitting error ε; The angle value obtained by summing the first and last angles θ1 and θ2 of the involute obtained above and taking half of them is substituted into the x and y coordinate values ​​obtained by solving the involute formula above; Step 2, determine whether the fitting error ε meets the accuracy requirement. If it meets, execute Step 3; otherwise, take the midpoint D as the newly inserted segmentation point, then take point A as the starting point and point D as the ending point to execute Step 1; Step 3, take the current ending point as the starting point, and determine whether there are still segmentation points to be read. If so, output the speed and position obtained in Step 1 of this iteration, read in the next segmentation point as the new ending point, and then return to Step 1. If not, output the speed and position obtained in Step 1 of this iteration and end the curve fitting process.

2. The curve fitting system for CNC system interpolation based on involute curves according to claim 1, characterized in that, When the curve fitting unit performs fitting, it needs to perform curve fitting according to the lengths of AC and BC and obtain the fitting error ε. When the length of AC < the length of BC and the rotation from point A to point B is clockwise, make DF⊥BC and DE⊥AC between the extension line of BC and the line segment AC, CF = CE, and DF = DE = r; Then ∠FDE = θ1 - θ2 = Δθ. According to the involute equation: Solve for the r value. If r < 0, then solve for r0 according to the following formula: Then solve for the lengths of AE and BF according to the following formula: Points E and F are on the lines AC and BC respectively. According to the line formula, solve for the coordinates of points E and F: Since DF⊥BC, then according to the vector relationship, solve for the coordinates of point D: Furthermore, obtain a complete involute formula: ρ = r0 + r×θ, where θ ∈ [θ1, θ2], r0 is the initial radius when the angle θ = 0, and r is the base circle radius; Then the coordinates of any point P on the involute are: x=ρ×cos(θ)+r×cos(α)+x D y=ρ×sin(θ)+r×sin(α)+y D in Calculate the coordinates of the midpoint D between points A and B, and calculate the coordinates of point P on the curve. (θ1+θ2) / 2 The distance from the midpoint D is then used as the fitting error ε.

3. The curve fitting system for CNC system interpolation based on involute curves according to claim 1, characterized in that, When the curve fitting unit performs fitting, it needs to perform curve fitting according to the lengths of AC and BC and obtain the fitting error ε. When the length of AC > the length of BC and the rotation from point A to point B is clockwise, make DF⊥BC and DE⊥AC between the line segment BC and the extension line of AC, CF = CE, and DF = DE = r; Then ∠FDE = θ1 - θ2 = Δθ; According to the involute equation: Solve for the r value. If r < 0, then solve for r0 according to the following formula: Then solve for the lengths of AE and BF according to the following formula: Points E and F are on the lines AC and BC respectively. According to the line formula, solve for the coordinates of points E and F: Since DF⊥BC, then according to the vector relationship, solve for the coordinates of point D: Thus, a complete involute formula is obtained: ρ = r0 + r×θ, where θ ∈ [θ1, θ2], r0 is the initial radius when the angle θ = 0, and r is the base circle radius; Then the coordinates of any point on the involute are P: x=ρ×cos(θ)+r×cos(α)+x D y=ρ×sin(θ)+r×sin(α)+y D in Calculate the coordinates of the midpoint D between points A and B, and calculate the coordinates of the points on the curve. The distance from the midpoint D is then used as the fitting error ε.

4. The curve fitting system for CNC system interpolation based on involute curves according to claim 1, characterized in that, When the curve fitting unit performs fitting, it needs to perform curve fitting based on the lengths of AC and BC and obtain the fitting error ε. When the length of AC > the length of BC and the rotation from point A to point B is counterclockwise, make DF⊥BC and DE⊥AC between the extension line of AC and the line segment BC, where CF = CE and DF = DE = r; Then ∠FDE = θ1 - θ2 = Δθ; According to the involute equation, we get: Solve for the value of r. If r < 0, then solve for r0 according to the following formula: Then solve for the lengths of AE and BF according to the following formula: Points E and F are respectively on the lines AC and BC. According to the line formula, solve for the coordinates of points E and F: Since DF⊥BC, then according to the vector relationship, solve for the coordinates of point D: Thus, a complete involute formula is obtained: ρ = r0 + r×θ, where θ ∈ [θ1, θ2], r0 is the initial radius when the angle θ = 0, and r is the base circle radius; Then the coordinates of any point on the involute are P: x=ρ×cos(θ)+r×cos(α)+x D y=ρ×sin(θ)+r×sin(α)+y D in Calculate the coordinates of the midpoint D between points A and B, and calculate the coordinates of the points on the curve. The distance from the midpoint D is then used as the fitting error ε.

5. A curve fitting system for CNC system interpolation based on involute curves according to claim 1, characterized in that, When the curve fitting unit performs fitting, it needs to perform curve fitting based on the lengths of AC and BC and obtain the fitting error ε. When the length of AC < the length of BC and the rotation from point A to point B is counterclockwise, make DF⊥BC and DE⊥AC between the extension line of BC and the line segment AC, where CF = CE and DF = DE = r; Then ∠FDE = θ1 - θ2 = Δθ; According to the involute equation, we get: Solve for the value of r. If r < 0, then solve for r0 according to the following formula: Then solve for the lengths of AE and BF according to the following formula: Points E and F are respectively on the lines AC and BC. According to the line formula, solve for the coordinates of points E and F: Since DF⊥BC, then according to the vector relationship, solve for the coordinates of point D: Thus, a complete involute formula is obtained: ρ = r0 + r×θ, where θ ∈ [θ1, θ2], r0 is the initial radius when the angle θ = 0, and r is the base circle radius; Then the coordinates of any point on the involute are P: x=ρ×cos(θ)+r×cos(α)+x D y=ρ×sin(θ)+r×sin(α)+y D in Calculate the coordinates of the midpoint D between points A and B, and calculate the coordinates of the points on the curve. The distance from the midpoint D is then used as the fitting error ε.

6. A computer storage medium, characterized in that, The storage medium stores at least one instruction, and the at least one instruction is loaded and run by a processor to implement a curve fitting system for interpolation of a numerically controlled system based on an involute as described in any one of claims 1 to 5.

7. A curve fitting device for CNC system interpolation based on involute curves, characterized in that, The device includes a processor and a memory. The memory stores at least one instruction, and the at least one instruction is loaded and run by a processor to implement a curve fitting system for interpolation of a numerically controlled system based on an involute as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for grinding / machining gear and machining device

    CN102947037A

  • Design method of tubular part spin forming spinning roller tracks

    CN109731978A