CN113111404B - Space continuous small line segment arc and straight line fitting method for processing track - Google Patents

Space continuous small line segment arc and straight line fitting method for processing track Download PDF

Info

Publication number
CN113111404B
CN113111404B CN202110342697.0A CN202110342697A CN113111404B CN 113111404 B CN113111404 B CN 113111404B CN 202110342697 A CN202110342697 A CN 202110342697A CN 113111404 B CN113111404 B CN 113111404B
Authority
CN
China
Prior art keywords
point
line segment
fitting
straight line
arc
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110342697.0A
Other languages
Chinese (zh)
Other versions
CN113111404A (en
Inventor
邝应炜
东梁
董志劼
蔡四雄
向龙
马树华
严昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen City Flag Public Intelligence Technology Co ltd
Original Assignee
Shenzhen City Flag Public Intelligence Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen City Flag Public Intelligence Technology Co ltd filed Critical Shenzhen City Flag Public Intelligence Technology Co ltd
Priority to CN202110342697.0A priority Critical patent/CN113111404B/en
Priority to CN202310025796.5A priority patent/CN116627086A/en
Publication of CN113111404A publication Critical patent/CN113111404A/en
Application granted granted Critical
Publication of CN113111404B publication Critical patent/CN113111404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/19Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by positioning or contouring control systems, e.g. to control position from one programmed point to another or to control movement along a programmed continuous path
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/34Director, elements to supervisory
    • G05B2219/34098Slope fitting, fairing contour, curve fitting, transition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a space continuous small line segment arc and straight line fitting method of a processing track, which comprises the following steps: 1. continuous small line segment data point column is imported, and continuous small line segment data point column interval [0, i ] is calculated]Determining parameters Er delta and Erd, erR, erl; 2. calculating vectors of coordinates of the first three points of the small line segment
Figure DDA0004161820400000011
And
Figure DDA0004161820400000012
an included angle delta; 3. if delta is less than Erdelta, performing space arc fitting in the step 4, otherwise performing space straight line fitting in the step 6; 4 the point P i To P 0 、P 1 、P 2 Vertical distance d of the space plane p < Erd, interval [0, i ]]Difference delta R between distance from each point to circle center point of arc and radius j < ErR; if yes, continuing to fit the subsequent points into an arc; 6. calculate point P 0 And point P i Is connected into straight line segment P 0 P i Included angle eta with xoy plane and straight line segment P 0 P i Whether the included angle theta between the projection of the xoy plane and the x axis meets the requirement or not; if yes, continuing fitting the next point; 7. until finishing fitting; according to the invention, the arc and the straight line are utilized to fit the continuous small line segment track, so that the surface of the processed part is smoother, the processing efficiency is improved, and the production efficiency of enterprises is improved.

Description

Space continuous small line segment arc and straight line fitting method for processing track
Technical Field
The invention relates to the technical field of numerical control machining, in particular to a space continuous small line segment arc and straight line fitting method of a machining track.
Background
The tool path track in numerical control machining mainly has three forms: continuous small line segment tracks, circular arc tracks and NURBS curve tracks. The continuous small line segment track is formed by connecting a series of data points through a continuous straight line, the motion track only approximates to the original processing track outline from the shape of the workpiece, and the smoothness of the processed straight line or curved surface cannot be ensured. The NURBS curve is widely applied to curved surface modeling design, and most numerical control systems do not support NURBS curve interpolation, and normally, the NURBS curve track is scattered into a continuous small line segment track for processing.
For continuous small line segment track fitting, the circular arc or straight line fitting is carried out in a two-dimensional problem, and most of the methods are carried out by the circular arc and straight line fitting separately, so that certain tracks suitable for fitting the circular arc are fitted into a plurality of short straight line segments, tracks suitable for fitting the long straight line segments are fitted into a plurality of short circular arcs, larger errors exist in the fitting result, the real-time processing of a motion control system is not suitable, and most of the fitting methods are only suitable for two-dimensional planes.
Disclosure of Invention
The invention aims to solve the technical problem of providing a space continuous small line segment arc and straight line fitting method for a processing track, which utilizes arc+straight line to fit the continuous small line segment track, so that the surface of a processed part is smoother, the processing efficiency is improved, and the production efficiency of enterprises is improved.
In order to solve the technical problems, the invention provides a method for fitting a small segment arc and a straight line of a processing track in a space continuous mode, which comprises the following steps:
step 1, importing continuous small line segment data point columns, solving continuous small line segment data point column intervals [0, i ], and determining parameters Er delta, erd, erR and Erl; the Erdelta is a threshold value for judging whether a program enters straight line fitting or circular arc fitting, the Erd is an allowable distance from a point to a space plane where a circular arc is located, the ErR is an allowable error of a difference value between the point-to-circle center distance and the radius, and the Erl is the fitting precision of a space straight line;
step 2, the coordinates P of the first three points of the small line segment 0 (x 0 ,y 0 ,z 0 ),P 1 (x 1 ,y 1 ,z 1 ),P 2 (x 2 ,y 2 ,z 2 ) Vector quantity
Figure GDA0004161820390000021
Vector->
Figure GDA0004161820390000022
Calculate vector +.>
Figure GDA0004161820390000023
And->
Figure GDA0004161820390000024
An included angle delta;
step 3, if delta is less than Erdelta, entering a space arc fitting process of the next step 4, otherwise, entering a space straight line fitting process of the step 6;
and 4, the spatial arc fitting process is as follows: for subsequent points P on the small line segment i =(x i ,y i ,z i ) (i=4, 5, …, n), each point P is judged i Whether the arc fitting error meets the following conditions: the point P i To P 0 (x 0 ,y 0 ,z 0 ),P 1 (x 1 ,y 1 ,z 1 ),P 2 (x 2 ,y 2 ,z 2 ) Vertical distance d of the space plane p < Erd, continuous small line segment data point column interval [0, i ]]Each point P 0 ,P 1 ,...,P i Difference delta R between distance and radius from circle center point of arc j < ErR; if yes, continuing to fit the subsequent points into an arc; otherwise, outputting the previous arc
Figure GDA0004161820390000025
Center and radius parameters of (a);
step 5, if point P i Judging whether the number i of points which are already fitted is smaller than 4 or not without meeting the requirement of arc fitting, if i is smaller than or equal to 4, the front 4 points are not fitted into an arc, and entering a space straight line fitting process in the step 6; if i > 4, then
Figure GDA0004161820390000026
Fitting into a circular arc section; point P i-1 As an initial point of the subsequent fitting, from point P i-1 Starting the next fitting;
step 6, the space straight line fitting method is that the initial point P of the small line segment is set 0 =(x 0 ,y 0 ,z 0 ) For the subsequent arbitrary point of the initial point of the small line segment, P is i =(x i ,y i ,z i ) (i=1, 2, …, n), the point P is calculated 0 And point P i Connected straight line segment P 0 P i Included angle eta with xoy plane and straight line segment P 0 P i Whether the projection in the xoy plane and the included angle theta of the x axis meet the following conditions: eta e [ eta ] minmax ]And theta is E [ theta ] minmax ]The method comprises the steps of carrying out a first treatment on the surface of the If yes, continuing to fit the next point, and if not, outputting a previously fitted straight line segment P 0 P i-1 The method comprises the steps of carrying out a first treatment on the surface of the Point P i-1 As an initial point of the subsequent fitting, from point P i-1 Starting the next fitting;
step 7, finishing fitting until all the points are fitted;
preferably, in the step 2, the vector is calculated by the following procedure
Figure GDA0004161820390000031
And->
Figure GDA0004161820390000032
Is included in the angle delta:
Figure GDA0004161820390000033
Figure GDA0004161820390000034
Figure GDA0004161820390000035
Figure GDA0004161820390000036
δ=arccosδ。
preferably, in the step 4, the spatial arc fitting method includes the following steps:
step 4.1, from the first three points P on the small line segment 0 ,P 1 ,P 2 Coordinate value (x) 0 ,y 0 ,z 0 ),(x 1 ,y 1 ,z 1 ),(x 2 ,y 2 ,z 2 ) Calculating a space plane parameter A, B, C, D where three points are located;
step 4.2, for the subsequent point P on the small line segment i =(x i ,y i ,z i ) (i=4, 5, …, n), the vertical distance d of this point to the spatial plane calculated in step 4.1 is calculated p
Step 4.3 if d is obtained in said step 4.2 p If less than Erd, continuing to the next step 4.4, otherwise outputting the previous arc
Figure GDA0004161820390000037
Center coordinates (a, b, c) and radius r parameters;
step 4.4, selecting the initial point P 0 (x 0 ,y 0 ,z 0 ) Current point P i (x i ,y i ,z i )、P 0 And P i Middle point P c (x c ,y c ,z c ) Coordinates and the centers (a, b, c) of the combined circular arcs are positioned on the space plane of the step 4.1; calculating circle centers (a, b, c) and radius r of the space circular arcs and circular arc direction parameters;
step 4.5, solving continuous small linesSegment data point column interval [0, i ]]Each point P 0 ,P 1 ,...,P i Difference delta R between distance and radius from circle center point of arc j
Step 4.6, if DeltaR j And (5) continuing to return to the step 4.2 to fit the next point if the number of the points is less than ErR, otherwise outputting the previous arc
Figure GDA0004161820390000041
Center and radius parameters of (a);
and 4.7, finishing fitting until the last point is fitted.
Preferably, in the step 6, the spatial straight line fitting method includes the following steps:
step 6.1, setting an initial point P of a small line segment 0 =(x 0 ,y 0 ,z 0 ) Setting initial parameter value eta max =+∞,η min =-∞,θ max =+∞,θ min = - ≡; wherein, [ eta ] minmax ]To fit the range of the included angle interval between the straight line segment and the xoy plane, [ theta ] minmax ]An included angle interval range between a projection straight line of the straight line segment in the xoy plane and the x axis is fitted;
step 6.2, for the subsequent arbitrary point P of the initial point of the small line segment i =(x i ,y i ,z i ) (i=1, 2, …, n), the point P is calculated 0 And point P i Connected straight line segment P 0 P i Included angle eta with xoy plane and straight line segment P 0 P i An included angle theta between the projection on the xoy plane and the x axis;
step 6.3, if the eta obtained in the step 6.2 is within the allowable range set in the step 6.1, namely eta e [ eta ] minmax ]And theta is E [ theta ] minmax ]Then the parameter calculation in the following step 6.4 is continued
Figure GDA0004161820390000045
If eta obtained in the step 6.2 is not within the allowable range set in the step 6.1, namely eta < eta min Or eta > eta max Or θ < θ min Or θ >θ max Then the previous straight line segment P 0 P i-1 Outputting as a fitting straight line segment; straight line segment P 0 P i-1 After being used as the fitted straight line segment, if the following small line segment is not fitted, i is less than n, the point P is i-1 Returning to the step 6.1 to start fitting the subsequent small line segments for the initial point of the next fitted straight line segment; if no small line segment exists in the follow-up sequence, i.e. i=n, finishing fitting;
step 6.4, calculating parameters by the following formula
Figure GDA0004161820390000042
(/>
Figure GDA0004161820390000043
Respectively used as interval [ eta ] in step 6.5 minmax ]Sum section [ theta ] minmax ]Correction coefficient of (c):
Figure GDA0004161820390000044
step 6.5, correcting the parameter eta in step 6.1 according to the following formula maxminmaxmin
Figure GDA0004161820390000052
Figure GDA0004161820390000051
And 6.6, returning to the step 6.2, and continuing to fit the next point of the small line segment.
The invention relates to a space continuous small line segment arc and straight line fitting method, which has the advantages that compared with the prior design: the spatial straight line fitting method provided by the application has the advantages that the algorithm complexity is low, the algorithm time is short, the efficiency of the spatial arc fitting method is higher than that of other methods, the combination mode of the spatial arc fitting method and the spatial straight line method is suitable for real-time processing of a motion control system, the algorithm is implanted into an open motion controller based on RTX64, meanwhile, the communication between a soft controller and a servo slave station device is realized by combining a real-time industrial Ethernet EtherCAT bus technology, the accurate control of a shaft is realized, the processing efficiency of the motion control system is improved under the condition that the hardware cost is not increased, the smoothness and the processing precision of a processing track are improved, and the application value is higher. Meanwhile, the three-dimensional arc-straight line fitting provided by the application can be applied to two-dimensional arc-straight line fitting.
Drawings
FIG. 1 is a schematic illustration of a spatially continuous small segment introduced in the present invention.
Fig. 2 is a schematic diagram of a spatial circular arc fit continuous small line segment of the present invention.
Fig. 3 is a schematic flow chart of the spatial straight line fitting method of the present invention.
FIG. 4 is a flow chart of a method of spatial curve fitting according to the present invention.
Fig. 5 is a schematic flow chart of the spatial arc and straight line fitting method of the present invention.
Detailed Description
The invention is described in detail below with reference to the drawings and the specific embodiments of the invention.
Example 1
The invention relates to a space straight line fitting method of a processing track, which is shown in fig. 3 and comprises the following steps:
step 1, continuous small line segment points as shown in fig. 1 are introduced, and the fitting accuracy Erl of the space straight line is set.
Step 2, setting an initial point P of a small line segment 0 =(x 0 ,y 0 ,z 0 ) Setting initial parameter value eta max =+∞,η min =-∞,θ max =+∞,θ min = - ≡ (wherein [. Eta. ] minmax ]To fit the range of the included angle interval between the straight line segment and the xoy plane, [ theta ] minmax ]The range of the included angle interval between the projection straight line of the straight line segment in the xoy plane and the x axis is fit).
Initialization ofParameter value eta max =+∞,η min =-∞,θ max =+∞,θ min The = - ≡is to initialize the program, and the interval [. Eta. minmax ],[θ minmax ]And (5) correcting to ensure the convergence of the parameter interval.
Step 3, for the subsequent arbitrary point P of the initial point of the small line segment i =(x i ,y i ,z i ) (i=1, 2, …, n), the point P is calculated 0 And point P i Connected straight line segment P 0 P i Included angle with xoy plane
Figure GDA0004161820390000061
Calculating straight line segment P 0 P i Projection in the xoy plane at an angle to the x-axis +.>
Figure GDA0004161820390000062
By ensuring that the spatial straight line parameters eta, theta are always in a convergent interval range, the convergence of the fitting spatial straight line is ensured.
Step 4, if the eta obtained in the step 3 is within the allowable range set in the step 2 and the step 6, namely eta epsilon eta minmax ]And theta is E [ theta ] minmax ]Continuing to calculate parameters in the subsequent step 5
Figure GDA0004161820390000063
The included angle eta between the space fitting straight line segment and the xoy plane and the included angle between the projection straight line of the fitting straight line segment on the xoy plane and the x axis are limited in the interval eta minmax ]、[θ minmax ]The range is to make the continuous small line segment points to be located on the fitted space straight line segment as much as possible.
If eta, theta obtained in the step 3 is not within the allowable range set in the step 2, namely eta < eta min Or eta > eta max Or θ < θ min Or θ > θ max Then the previous straight line segment P 0 P i-1 And outputting the result as a fitting straight line segment. Straight line segment P 0 P i-1 After being used as the fitted straight line segment, if the following small line segment is not fitted, i is less than n, the point P is i-1 For the initial point of the next fitted straight line segment, the process returns to the step 2 to start fitting the subsequent small line segment. If there is no remaining small line segment, i.e., i= =n, then the fitting is ended.
When the number of the continuous small line segment points is large, not all small line segments are fitted into one long straight line segment, and a plurality of long straight line segments are generally fitted, so that when the long straight line segment is fitted, straight line fitting is further needed to be continuously carried out on the remaining continuous small line segment points.
Step 5, calculating parameters according to the following formula
Figure GDA0004161820390000071
(/>
Figure GDA0004161820390000072
Respectively used as interval [ eta ] in step 6 minmax ]Sum section [ theta ] minmax ]Correction coefficient of (c):
from step 1, erl is the set fitting precision, and is converted into the allowable angle deviation of the included angle between the spatial fitting straight line segment and the xoy plane
Figure GDA0004161820390000073
Conversion into an angle deviation permissible by the angle between the projection straight line of the fitting straight line segment in the xoy plane and the x axis>
Figure GDA0004161820390000074
Figure GDA0004161820390000075
Step 6, correcting the parameter eta in the step 2 according to the following formula maxminmaxmin
Figure GDA0004161820390000076
Figure GDA0004161820390000077
This step ensures that the angle η, θ of the fitting line, the interval range to which θ belongs, remains convergent.
And 7, returning to the step 3, and continuing to fit the next point of the small line segment.
Example 2
The invention relates to a space circular arc fitting method, as shown in fig. 4, comprising the following steps:
step 1, continuous small line segment points shown in fig. 2 are introduced, and the fitting accuracy Erd, erR (wherein E is determined rd E is the allowable distance from the point to the space plane where the arc is located rR Is the allowable error of the difference between the point-to-center distance and the radius).
The space circle can be regarded as a space sphere which is intersected with a space plane passing through the center of the sphere. Therefore, firstly, whether the continuous small line segment points are on the plane where the space arc is located or not is considered, and the distance from the points to the space plane needs to be within the range of the allowable error Erd; secondly, considering whether the continuous small line segment points are positioned on the sphere where the circular arc is positioned, wherein the difference value between the point-to-circle center distance and the radius is required to be in an allowable error E rR And (3) inner part.
Step 2, from the first three points P on the small line segment 0 ,P 1 ,P 2 Coordinate value (x) 0 ,y 0 ,z 0 ),(x 1 ,y 1 ,z 1 ),(x 2 ,y 2 ,z 2 ) Three non-collinear points can determine a plane equation, coordinates of the three points are brought into the plane equation ax+by+cz+d=0, and the simultaneous equations can solve the parameters A, B, C, D of the plane equation, so that the spatial plane parameters A, B, C, D where the three points are located are obtained.
Figure GDA0004161820390000081
Step 3, for the subsequent point P on the small line segment i =(x i ,y i ,z i ) (i=4, 5, …, n), calculating the vertical distance d of the point to the spatial plane calculated in step 2 p The method comprises the steps of carrying out a first treatment on the surface of the D can be calculated according to the distance formula from the point to the space plane p
Figure GDA0004161820390000082
Step 4, considering whether the continuous small line segment points are on the plane where the space arc is located, and the distance d from the points to the space plane p The allowable error Erd is required to be within. If d is obtained in the step 3 p If less than Erd, continuing to the next step 5, otherwise outputting the previous arc
Figure GDA0004161820390000083
Parameters.
Step 5, selecting a first point P 0 (x 0 ,y 0 ,z 0 ) Current point P i (x i ,y i ,z i )、P 0 And P i Middle point P c (x c ,y c ,z c ) Coordinates and the circle centers (a, b, c) of the combined circular arcs are positioned on the space plane required by the step 2. The center (a, b, c) and radius r of the spatial arc, and the arc direction parameters are calculated from the following formulas. The space arc is determined by three points which are not collinear in space, and the first point and the current point are selected, so that the end point of the fitted long arc segment is the start point of the next fitted long arc segment, thereby ensuring continuity between the arc segments and ensuring processing continuity.
Figure GDA0004161820390000084
And 6, in order to judge whether the continuous small line segment points fitted at the time are all approximate to the fitted circular arc, calculating the difference value between the distance from each point to the center point of the circular arc and the radius. Solving continuous small line segment data point column interval [0, i ]]Each point P 0 ,P 1 ,...,P i Difference between distance and radius from circular arc center point:
Figure GDA0004161820390000091
step 7, considering whether the continuous small line segment points are positioned on the space circular arc, and the difference delta R between the point-to-circle center distance and the radius j Is required to be within the allowable error E rR And (3) inner part. If DeltaR j And (5) continuing to return to the step (3) to fit the next point if the number of the points is less than ErR, otherwise outputting the previous arc
Figure GDA0004161820390000092
Is a parameter of (a).
And 8, finishing fitting until the last point is fitted.
Example 3
The invention provides a space arc and straight line fitting method, which combines space arc and straight line fitting, a specific algorithm flow is shown in figure 5, and a front space arc and space straight line fitting scheme is combined, and the main technical scheme is as follows:
step 1, importing continuous small line segment data point columns and solving continuous small line segment data point column intervals [0, i ]]Parameters Er delta, erd, erR, erl (where Er delta is the threshold to determine whether the program is going into straight line fit or circular arc fit, E rd E is the allowable distance from the point to the space plane where the arc is located rR The Erl is the fitting accuracy of the spatial line, which is the allowable error of the difference between the point-to-center distance and the radius).
Step 2, the first three point coordinates P 0 (x 0 ,y 0 ,z 0 ),P 1 (x 1 ,y 1 ,z 1 ),P 2 (x 2 ,y 2 ,z 2 ) Vector quantity
Figure GDA0004161820390000093
Vector->
Figure GDA0004161820390000094
The vector is calculated by the following procedure>
Figure GDA0004161820390000095
And
Figure GDA0004161820390000096
is included in the angle delta:
Figure GDA0004161820390000097
Figure GDA0004161820390000098
Figure GDA0004161820390000099
Figure GDA00041618203900000910
δ=arccosδ;
by calculating vectors
Figure GDA00041618203900000911
Sum vector->
Figure GDA00041618203900000912
For determining the point P 0 ,P 1 ,P 2 Whether in a straight line.
Step 3, if delta is less than Er delta, it can be considered as point P 0 ,P 1 ,P 2 Lie in the same straight line, so that straight line fitting can be entered to continue fitting subsequent points. Then enter step 6 space straight line fitting process, otherwise, point P 0 ,P 1 ,P 2 Not collinear, can be fitted into arc segments, thus entering into an arc fitting process.
Step 4, for the subsequent point P i =(x i ,y i ,z i ) (i=4, 5, …, n), each point P is judged i Whether the arc fitting error meets the requirement, i.e. d p <Erd,ΔR j < ErR. Each point P i If the arc fitting requirement is met, continuing to applyThe subsequent points are fitted to an arc. The spatial arc fitting process comprises the following steps:
step 4.1, from the first three points P on the small line segment 0 ,P 1 ,P 2 Coordinate value (x) 0 ,y 0 ,z 0 ),(x 1 ,y 1 ,z 1 ),(x 2 ,y 2 ,z 2 ) The following equations are taken to calculate the spatial plane parameters A, B, C, D where the three points lie.
Figure GDA0004161820390000101
Step 4.2, for the subsequent point P on the small line segment i =(x i ,y i ,z i ) (i=4, 5, …, n), the vertical distance d of this point to the spatial plane calculated in step 4.1 is calculated p
Figure GDA0004161820390000102
Step 4.3 if d is obtained in said step 4.2 p If less than Erd, continuing to the next step 4.4, otherwise outputting the previous arc
Figure GDA0004161820390000103
Parameters (i.e., center coordinates (a, b, c) and radius r).
Step 4.4, selecting the initial point P 0 (x 0 ,y 0 ,z 0 ) Current point P i (x i ,y i ,z i )、P 0 And P i Middle point P c (x c ,y c ,z c ) Coordinates and is located on a spatial plane in combination with the circle centers (a, b, c) of the circular arcs. The center (a, b, c) and radius r of the spatial arc, and the arc direction parameters are calculated from the following formulas.
Figure GDA0004161820390000104
Step 4.5, calculating the continuous small line segment data point column interval [0, i ]]Each point P 0 ,P 1 ,...,P i Difference between distance and radius from circular arc center point:
Figure GDA0004161820390000105
step 4.6, if DeltaR j And (5) continuing to return to the step 4.2 to fit the next point if the number of the points is less than ErR, otherwise outputting the previous arc
Figure GDA0004161820390000111
Center of circle and radius parameters of (c).
And 4.7, finishing fitting until the last point is fitted.
Step 5, if point P i And (3) judging whether the number i of the fitted points is smaller than 4 or not without meeting the requirement of arc fitting, if i is smaller than or equal to 4, not fitting the previous 4 points into an arc, and entering the space straight line fitting process of the step (6). If i > 4, then
Figure GDA0004161820390000112
Is a fitted circular arc segment. Point P i-1 As an initial point of the subsequent fitting, from point P i-1 The next fitting is started.
The number of the fitted circular arcs is less than 4 points, and the 4 points are on the same straight line with high probability, so that more points can be fitted due to the fact that straight line fitting is entered.
Step 6, a space straight line fitting method comprises the following steps that if space straight line fitting is carried out, parameters such as eta, theta and the like are calculated according to the space straight line fitting step of the first technical scheme, and the point P is calculated i If the fitting requirement is met, continuing to fit the next point, and if the fitting requirement is not met, outputting a previous fitting straight line segment P 0 P i-1 . Point P i-1 As an initial point of the subsequent fitting, from point P i-1 The next fitting is started.
Step 6.1, setting an initial point P of a small line segment 0 =(x 0 ,y 0 ,z 0 ) Setting initial parameter value eta max =+∞,η min =-∞,θ max =+∞,θ min = - ≡ (wherein [. Eta. ] maxmin ]To fit the range of the included angle interval between the straight line segment and the xoy plane, [ theta ] maxmin ]The range of the included angle interval between the projection straight line of the straight line segment in the xoy plane and the x axis is fit).
Step 6.2, for the subsequent arbitrary point P of the initial point of the small line segment i =(x i ,y i ,z i ) (i=1, 2, …, n), the point P is calculated 0 And point P i Connected straight line segment P 0 P i Included angle with xoy plane
Figure GDA0004161820390000113
Calculating straight line segment P 0 P i Projection in the xoy plane at an angle to the x-axis +.>
Figure GDA0004161820390000114
Step 6.3, if the eta obtained in the step 6.2 is within the allowable range set in the step 6.1, namely eta e [ eta ] minmax ]And theta is E [ theta ] minmax ]Then the parameter calculation in the following step 6.4 is continued
Figure GDA0004161820390000115
If eta obtained in the step 6.2 is not within the allowable range set in the step 6.1, namely eta < eta min Or eta > eta max Or θ < θ min Or θ > θ max Then the previous straight line segment P 0 P i-1 And outputting the result as a fitting straight line segment. Straight line segment P 0 P i-1 After being used as the fitted straight line segment, if the following small line segment is not fitted, i is less than n, the point P is i-1 For the initial point of the next fitted straight line segment, the process returns to step 6.1 to start fitting the subsequent small line segment. If there is no remaining small line segment, i.e., i= =n, then the fitting is ended.
Step 6.4, calculating parameters by the following formula
Figure GDA0004161820390000121
(/>
Figure GDA0004161820390000122
Respectively used as interval [ eta ] in step 6.5 minmax ]Sum section [ theta ] minmax ]Correction coefficient of (c):
Figure GDA0004161820390000123
step 6.5, correcting the parameter eta in step 6.1 according to the following formula maxminmaxmin
Figure GDA0004161820390000124
Figure GDA0004161820390000125
And 6.6, returning to the step 6.2, and continuing to fit the next point of the small line segment.
And 7, finishing fitting until all the points are fitted.

Claims (4)

1. A method for fitting a small segment of a spatially continuous arc with a straight line of a processing track is characterized by comprising the following steps:
step 1, importing continuous small line segment data point columns, solving continuous small line segment data point column intervals [0, i ], and determining parameters Er delta, erd, erR and Erl; the Erdelta is a threshold value for judging whether a program enters straight line fitting or circular arc fitting, the Erd is an allowable distance from a point to a space plane where a circular arc is located, the ErR is an allowable error of a difference value between the point-to-circle center distance and the radius, and the Erl is the fitting precision of a space straight line;
step 2, the coordinates P of the first three points of the small line segment 0 (x 0 ,y 0 ,z 0 ),P 1 (x 1 ,y 1 ,z 1 ),P 2 (x 2 ,y 2 ,z 2 ) Vector quantity
Figure FDA0004161820380000011
Vector->
Figure FDA0004161820380000012
Calculate vector +.>
Figure FDA0004161820380000013
And->
Figure FDA0004161820380000014
An included angle delta;
step 3, if delta is less than Erdelta, entering a space arc fitting process of the next step 4, otherwise, entering a space straight line fitting process of the step 6;
and 4, the spatial arc fitting process is as follows: for subsequent points P on the small line segment i =(x i ,y i ,z i ) (i=4, 5, …, n), each point P is judged i Whether the arc fitting error meets the following conditions: the point P i To P 0 (x 0 ,y 0 ,z 0 ),P 1 (x 1 ,y 1 ,z 1 ),P 2 (x 2 ,y 2 ,z 2 ) Vertical distance d of the space plane p < Erd, continuous small line segment data point column interval [0, i ]]Each point P 0 ,P 1 ,...,P i Difference delta R between distance and radius from circle center point of arc j < ErR; if yes, continuing to fit the subsequent points into an arc; otherwise, outputting the previous arc
Figure FDA0004161820380000015
Center and radius parameters of (a);
step 5, if point P i Judging whether the number i of points which are already fitted is smaller than 4 or not without meeting the requirement of arc fitting, if i is smaller than or equal to 4, the front 4 points are not fitted into an arc, and entering a space straight line fitting process in the step 6; if i > 4, then
Figure FDA0004161820380000016
Fitting into a circular arc section; point P i-1 As a means ofInitial point of subsequent fitting, from point P i-1 Starting the next fitting;
step 6, the space straight line fitting method is that the initial point P of the small line segment is set 0 =(x 0 ,y 0 ,z 0 ) For the subsequent arbitrary point of the initial point of the small line segment, P is i =(x i ,y i ,z i ) (i=1, 2, …, n), the point P is calculated 0 And point P i Connected straight line segment P 0 P i Included angle eta with xoy plane and straight line segment P 0 P i Whether the projection in the xoy plane and the included angle theta of the x axis meet the following conditions: eta e [ eta ] minmax ]And theta is E [ theta ] minmax ]The method comprises the steps of carrying out a first treatment on the surface of the If yes, continuing to fit the next point, and if not, outputting a previously fitted straight line segment P 0 P i-1 The method comprises the steps of carrying out a first treatment on the surface of the Point P i-1 As an initial point of the subsequent fitting, from point P i-1 Starting the next fitting;
and 7, finishing fitting until all the points are fitted.
2. The method for fitting a spatially continuous small segment arc to a straight line of a processing trajectory according to claim 1, wherein in step 2, the vector is calculated by the following procedure
Figure FDA0004161820380000021
And->
Figure FDA0004161820380000022
Is included in the angle delta:
Figure FDA0004161820380000023
Figure FDA0004161820380000024
Figure FDA0004161820380000025
Figure FDA0004161820380000026
δ=arccosδ。
3. the method for fitting a spatially continuous small segment arc to a straight line of a processing track according to claim 1, wherein in the step 4, the method for fitting a spatially continuous small segment arc comprises the steps of:
step 4.1, from the first three points P on the small line segment 0 ,P 1 ,P 2 Coordinate value (x) 0 ,y 0 ,z 0 ),(x 1 ,y 1 ,z 1 ),(x 2 ,y 2 ,z 2 ) Calculating a space plane parameter A, B, C, D where three points are located;
step 4.2, for the subsequent point P on the small line segment i =(x i ,y i ,z i ) (i=4, 5, …, n), the vertical distance d of this point to the spatial plane calculated in step 4.1 is calculated p
Step 4.3 if d is obtained in said step 4.2 p If less than Erd, continuing to the next step 4.4, otherwise outputting the previous arc
Figure FDA0004161820380000027
Center coordinates (a, b, c) and radius r parameters;
step 4.4, selecting the initial point P 0 (x 0 ,y 0 ,z 0 ) Current point P i (x i ,y i ,z i )、P 0 And P i Middle point P c (x c ,y c ,z c ) Coordinates and the centers (a, b, c) of the combined circular arcs are positioned on the space plane of the step 4.1; calculating circle centers (a, b, c) and radius r of the space circular arcs and circular arc direction parameters;
step 4.5, calculating the continuous small line segment data point column interval [0, i ]]Each point P 0 ,P 1 ,...,P i Difference delta R between distance and radius from circle center point of arc j
Step 4.6, if DeltaR j And (5) continuing to return to the step 4.2 to fit the next point if the number of the points is less than ErR, otherwise outputting the previous arc
Figure FDA0004161820380000031
Center and radius parameters of (a);
and 4.7, finishing fitting until the last point is fitted.
4. The method for fitting a spatially continuous small segment arc to a straight line of a processing track according to claim 1, wherein in the step 6, the method for fitting a spatially straight line comprises the steps of:
step 6.1, setting an initial point P of a small line segment 0 =(x 0 ,y 0 ,z 0 ) Setting initial parameter value eta max =+∞,η min =-∞,θ max =+∞,θ min = - ≡; wherein, [ eta ] minmax ]To fit the range of the included angle interval between the straight line segment and the xoy plane, [ theta ] minmax ]An included angle interval range between a projection straight line of the straight line segment in the xoy plane and the x axis is fitted;
step 6.2, for the subsequent arbitrary point P of the initial point of the small line segment i =(x i ,y i ,z i ) (i=1, 2, …, n), the point P is calculated 0 And point P i Connected straight line segment P 0 P i Included angle eta with xoy plane and straight line segment P 0 P i An included angle theta between the projection on the xoy plane and the x axis;
step 6.3, if the eta obtained in the step 6.2 is within the allowable range set in the step 6.1, namely eta e [ eta ] minmax ]And theta is E [ theta ] minmax ]Then the parameter calculation in the following step 6.4 is continued
Figure FDA0004161820380000032
If eta, theta obtained in the step 6.2 is not allowed in the step 6.1Xu Fanwei, i.e. eta < eta min Or eta > eta max Or θ < θ min Or θ > θ max Then the previous straight line segment P 0 P i-1 Outputting as a fitting straight line segment; straight line segment P 0 P i-1 After being used as the fitted straight line segment, if the following small line segment is not fitted, i is less than n, the point P is i-1 Returning to the step 6.1 to start fitting the subsequent small line segments for the initial point of the next fitted straight line segment; if no small line segment exists in the follow-up sequence, i.e. i=n, finishing fitting;
step 6.4, calculating parameters by the following formula
Figure FDA0004161820380000033
Figure FDA0004161820380000034
Respectively used as interval [ eta ] in step 6.5 minmax ]Sum section [ theta ] minmax ]Is a correction coefficient of (a):
Figure FDA0004161820380000035
step 6.5, correcting the parameter eta in step 6.1 according to the following formula maxminmaxmin
Figure FDA0004161820380000041
Figure FDA0004161820380000042
And 6.6, returning to the step 6.2, and continuing to fit the next point of the small line segment.
CN202110342697.0A 2021-03-30 2021-03-30 Space continuous small line segment arc and straight line fitting method for processing track Active CN113111404B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110342697.0A CN113111404B (en) 2021-03-30 2021-03-30 Space continuous small line segment arc and straight line fitting method for processing track
CN202310025796.5A CN116627086A (en) 2021-03-30 2021-03-30 Space continuous small line segment arc fitting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110342697.0A CN113111404B (en) 2021-03-30 2021-03-30 Space continuous small line segment arc and straight line fitting method for processing track

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310025796.5A Division CN116627086A (en) 2021-03-30 2021-03-30 Space continuous small line segment arc fitting method

Publications (2)

Publication Number Publication Date
CN113111404A CN113111404A (en) 2021-07-13
CN113111404B true CN113111404B (en) 2023-07-14

Family

ID=76712868

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310025796.5A Pending CN116627086A (en) 2021-03-30 2021-03-30 Space continuous small line segment arc fitting method
CN202110342697.0A Active CN113111404B (en) 2021-03-30 2021-03-30 Space continuous small line segment arc and straight line fitting method for processing track

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310025796.5A Pending CN116627086A (en) 2021-03-30 2021-03-30 Space continuous small line segment arc fitting method

Country Status (1)

Country Link
CN (2) CN116627086A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114850549B (en) * 2022-04-28 2024-02-23 成都航空职业技术学院 Method for machining blades based on four-axis linkage machining center
CN115854832B (en) * 2022-11-18 2024-01-26 国网四川省电力公司达州供电公司 Included angle error calculation method for workpieces with two-dimensional included angles

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062073A (en) * 2016-11-08 2018-05-22 沈阳高精数控智能技术股份有限公司 A kind of circular arc smooth compression interpolation algorithm for high quality processing

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08221388A (en) * 1995-02-09 1996-08-30 Nec Corp Fitting parameter decision method
CN108345106B (en) * 2017-01-24 2020-04-28 清华大学 Design method of mixed surface optical system
CN107329458A (en) * 2017-07-10 2017-11-07 深圳市旗众智能自动化有限公司 A kind of dynamic self-adapting speed prediction control method of continuous small line segment track
CN109270892B (en) * 2018-08-31 2020-10-02 天津大学 Least square spiral line approximation algorithm of non-circular curve in numerical control machining
CN109571473B (en) * 2018-12-03 2021-10-12 武汉工程大学 Error-controllable small line segment trajectory fairing method
CN111310106B (en) * 2020-01-19 2024-02-06 浙江工业大学 Cutting contour fitting optimization method based on successive approximation of original contour

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062073A (en) * 2016-11-08 2018-05-22 沈阳高精数控智能技术股份有限公司 A kind of circular arc smooth compression interpolation algorithm for high quality processing

Also Published As

Publication number Publication date
CN113111404A (en) 2021-07-13
CN116627086A (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN113111404B (en) Space continuous small line segment arc and straight line fitting method for processing track
CN106826829B (en) A kind of industrial robot fairing motion profile generation method of Controllable Error
CN106527351B (en) A kind of small line segment Real-time Interpolation that easement curve length is dynamically determined
Sun et al. A real-time and look-ahead interpolation methodology with dynamic B-spline transition scheme for CNC machining of short line segments
CN107608344B (en) Vehicle motion control method and device based on trajectory planning and related equipment
JPH0252283B2 (en)
CN109814496B (en) Multi-axis time synchronization method in S-type acceleration and deceleration trajectory planning
CN108073138B (en) Elliptical arc smooth compression interpolation algorithm suitable for high-speed high-precision machining
CN108472808B (en) Synchronization of multiple robots
CN109828535B (en) NURBS curve interpolation method based on fourth-order Runge-Kutta algorithm
CN112223290B (en) Joint space continuous point track transition method and device
CN111633668B (en) Motion control method for robot to process three-dimensional free-form surface
CN113119109A (en) Industrial robot path planning method and system based on pseudo-distance function
CN115113582A (en) Five-axis position loop gain offline correction method for part contour error
CN116430796A (en) Machining path local fairing method based on geometric clipping
CN113093645B (en) Soft controller continuous small line segment track preprocessing method
CN111283683A (en) Servo tracking accelerated convergence method for robot visual feature planning track
CN114115112B (en) Numerical control machining method and device
CN105607577B (en) A kind of small line segment transition method based on axial precision
CN109491321B (en) Contour error estimation method based on H-shaped precision motion platform
CN114019911B (en) Curve fitting method based on speed planning
CN113835397A (en) Linear numerical control machining path smoothing method based on B spline curve and path integral
CN111880480B (en) Milling cutter cutting path generation method and system based on CNC milling machine
JP2000311010A (en) Track controller, program generation device and program conversion device
CN107885166B (en) Universal interpolation method for space conic section

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant