CN113791577B - Curve fitting method based on numerical control machining system, electronic equipment and storage medium - Google Patents

Curve fitting method based on numerical control machining system, electronic equipment and storage medium Download PDF

Info

Publication number
CN113791577B
CN113791577B CN202110954971.XA CN202110954971A CN113791577B CN 113791577 B CN113791577 B CN 113791577B CN 202110954971 A CN202110954971 A CN 202110954971A CN 113791577 B CN113791577 B CN 113791577B
Authority
CN
China
Prior art keywords
endpoint
curve
current
representing
line segment
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
CN202110954971.XA
Other languages
Chinese (zh)
Other versions
CN113791577A (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.)
Guangzhou Sihe Innovation Technology Co.,Ltd.
Original Assignee
Wuyi University
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 Wuyi University filed Critical Wuyi University
Priority to CN202110954971.XA priority Critical patent/CN113791577B/en
Priority to PCT/CN2021/128422 priority patent/WO2023019751A1/en
Publication of CN113791577A publication Critical patent/CN113791577A/en
Application granted granted Critical
Publication of CN113791577B publication Critical patent/CN113791577B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/35Nc in input of data, input till input file format
    • G05B2219/35349Display part, programmed locus and tool path, traject, dynamic locus
    • 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)

Abstract

The invention discloses a curve fitting method based on a numerical control machining system, electronic equipment and a storage medium, wherein the curve fitting method based on the numerical control machining system comprises the following steps: acquiring a line segment to be fitted, wherein the line segment to be fitted comprises a plurality of linear line segments which are connected in sequence; generating a first spiral line and a second spiral line based on a least square method for each pair of adjacent straight line segments, wherein the first spiral line and the second spiral line have partial overlapping curves; and carrying out smooth transition treatment on the partial overlapped curves to obtain fitted curve line segments. According to the technical scheme provided by the embodiment of the invention, the quick fitting of the curve can be realized under the condition of smooth transition of the speed and the acceleration.

Description

Curve fitting method based on numerical control machining system, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of numerical control machining, in particular to a curve fitting method based on a numerical control machining system, electronic equipment and a computer readable storage medium.
Background
The numerical control system is a special computer system which executes a part or all of numerical control functions according to a control program stored in a computer memory and is provided with an interface circuit and a servo driving device. Generally, a numerical control system and related automation products are mainly matched with a numerical control machine tool. The existing numerical control machine tool can be divided into a three-axis machining center, a four-axis machining center and a five-axis machining center according to the number of control axes, wherein input data of a three-axis numerical control system are mostly straight lines and circular arcs, and input data of the four-axis numerical control system and the five-axis numerical control system are straight lines. However, when a large number of continuous small straight lines exist in the input data, frequent acceleration and deceleration can occur by directly applying the existing straight line processing mode, so that the processing efficiency is affected, and the processing effect is also affected.
In the related art, for such a large number of continuous small straight lines, a curve fitting manner is generally adopted to improve the processing efficiency and the processing effect. The existing curve fitting technology mainly adopts an A spline, a B spline, a C spline and a NURBS spline, but the A spline cannot realize smooth acceleration, the B, C, NURBS spline is not smooth in fitting curve transition, or the time consumption of real-time calculation is high, the hardware requirement is high, and inconvenience is brought to a user.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides a curve fitting method based on a numerical control machining system, electronic equipment and a computer readable storage medium, which can realize quick fitting of a curve under the condition of smooth transition of speed and acceleration.
In a first aspect, an embodiment of the present invention provides a curve fitting method based on a numerical control machining system, including:
acquiring a line segment to be fitted, wherein the line segment to be fitted comprises a plurality of linear line segments which are connected in sequence;
generating a first spiral line and a second spiral line based on a least square method for each pair of adjacent straight line segments, wherein the first spiral line and the second spiral line have partial overlapping curves;
and carrying out smooth transition treatment on the partial overlapped curves to obtain fitted curve line segments.
According to some embodiments of the first aspect of the present invention, the adjacent straight line segments include a first adjacent line segment and a second adjacent line segment, the first adjacent line segment partially overlaps the second adjacent line segment, the generating a first spiral and a second spiral based on a least square method includes:
acquiring a first current endpoint, a first starting endpoint and a first tail endpoint of the first adjacent line segment, and acquiring a second current endpoint, a second starting endpoint and a second tail endpoint of the second adjacent line segment;
obtaining a first rotation direction and a first rotation center according to the first current endpoint, the first starting endpoint and the first ending endpoint, and obtaining a second rotation direction and a second rotation center according to the second current endpoint, the second starting endpoint and the second ending endpoint;
the first spiral line is obtained according to the first initial endpoint, the first current endpoint, the first rotation direction and the first rotation center, and the second spiral line is obtained according to the second initial endpoint, the second current endpoint, the second rotation direction and the second rotation center.
According to some embodiments of the first aspect of the invention, the first rotational direction and the second rotational direction are obtained by the following formula:
wherein the V is 0 Representing the first and second rotational directions, the p 0 Representing the first current endpoint and the second current endpoint, the p -1 Representing the first and second starting points, the p 1 Representing the first end endpoint and the second end endpoint, the x representing three-dimensional vector cross-over, the p 0 -p -1 The expression of three-dimensional vector p -1 And p is as follows 0 The Euclidean distance of (p) 1 -p 0 The expression of three-dimensional vector p 0 And p is as follows 1 Is a euclidean distance of (c).
According to some embodiments of the first aspect of the invention, the first rotation center and the second rotation center are obtained by the following formula:
wherein C represents the first rotation center and the second rotation center, V 0 Representing the first and second rotational directions, the p 0 Representing the first current endpoint and the second current endpoint, the p -1 Representing the first starting end point and the second starting end point, wherein n represents a preset constant and n is more than or equal to 1,the i represents the maximum constant satisfying 1.ltoreq.i.ltoreq.n, and the j represents the maximum constant satisfying 2.ltoreq.j.ltoreq.n.
According to some embodiments of the first aspect of the present invention, after the obtaining a first rotation direction and a first rotation center according to the first current endpoint, the first start endpoint, and the first end endpoint, and obtaining a second rotation direction and a second rotation center according to the second current endpoint, the second start endpoint, and the second end endpoint, the method further includes:
and determining whether the first adjacent line segment can be fitted according to a preset error value, the first rotation direction, the first current endpoint, the first starting endpoint and the first ending endpoint, and determining whether the second adjacent line segment can be fitted according to the preset error value, the second rotation direction, the second current endpoint, the second starting endpoint and the second ending endpoint.
According to some embodiments of the first aspect of the present invention, the determining whether the first adjacent line segment can be fitted according to a preset error value, the first rotation direction, the first current endpoint, the first start endpoint, and the first end endpoint, and determining whether the second adjacent line segment can be fitted according to the preset error value, the second rotation direction, the second current endpoint, the second start endpoint, and the second end endpoint includes:
judging whether the preset error value, the first rotation direction, the first current endpoint, the first starting endpoint and the first ending endpoint meet a preset fitting judgment formula, and if so, fitting the first adjacent line segment;
judging whether the preset error value, the second rotation direction, the second current endpoint, the second starting endpoint and the second ending endpoint meet the preset fitting judgment formula, and if so, fitting the second adjacent line segments;
the preset fitting judgment formula is as follows:
said epsilon max Representing the preset error value, the V 0 Representing the first and second rotational directions, the p 0 Representing the first current endpoint and the second current endpoint, the p -1 Representing the first and second starting points, the p 1 Representing the first end endpoint and the second end endpoint, the p 1 -p -1 The expression of three-dimensional vector p -1 And p is as follows 1 The Euclidean distance of (p) 0 -p -1 The expression of three-dimensional vector p -1 And p is as follows 0 The Euclidean distance of (p) 1 -p 0 The expression of three-dimensional vector p 0 And p is as follows 1 Is a euclidean distance of (c).
According to some embodiments of the first aspect of the present invention, the performing a smooth transition process on the partially overlapped curves to obtain fitted curve segments includes:
taking a first three-dimensional position of the first spiral line and a second three-dimensional position of the second spiral line under the condition that the first spiral line and the second spiral line are positioned at the same preset rotation angle;
generating a smooth curve corresponding to the partial overlap curve according to the first three-dimensional position and the second three-dimensional position;
the smooth curve is used instead of the partially overlapping curve.
According to some embodiments of the first aspect of the invention, the smoothed curve is obtained by the following formula:
wherein f (u) represents the smooth curve, theRepresenting the first screwThree-dimensional position of the rotation line when the preset rotation angle is theta, the +.>And representing the three-dimensional position of the second spiral line when the preset rotation angle is theta, wherein u is more than or equal to 0 and less than or equal to 1.
In a second aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, and when the processor executes the computer program, the processor implements the curve fitting method based on the numerical control machining system according to any one of the embodiments of the first aspect.
In a third aspect, an embodiment of the present invention further provides a computer readable storage medium, where computer executable instructions are stored, where the computer executable instructions are configured to cause a computer to perform the curve fitting method based on the nc processing system according to any one of the embodiments of the first aspect.
The one or more technical solutions provided in the embodiments of the present application have at least the following beneficial effects: the method comprises the steps of obtaining line segments to be fitted comprising a plurality of line segments which are connected in sequence, generating a first spiral line and a second spiral line with partial overlapped curves based on a least square method for each pair of adjacent line segments, and carrying out smooth transition treatment on the partial overlapped curves, so that the fitted line segments can be obtained according to the first spiral line, the partial overlapped curves after the smooth transition treatment and the second spiral lines. According to the technical scheme provided by the embodiment of the invention, the line segments to be fitted can be fitted into the first spiral line and the second spiral line, and the partially overlapped curve of the first spiral line after smooth transition treatment is smoothly transited to the second spiral line, so that the rapid fitting of the curve is completed under the condition that both the speed and the acceleration are smoothly transited.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
Additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of steps of a curve fitting method based on a numerical control machining system according to one embodiment of the present invention;
FIG. 2 is a flow chart of steps of a curve fitting method based on a numerical control machining system according to another embodiment of the present invention;
FIG. 3 is a flow chart illustrating steps of a curve fitting method based on a numerical control machining system according to another embodiment of the present invention;
FIG. 4 is a flow chart illustrating steps of a curve fitting method based on a numerical control machining system according to another embodiment of the present invention;
FIG. 5 is a flow chart illustrating steps of a curve fitting method based on a numerical control machining system according to another embodiment of the present invention;
fig. 6 is a schematic block diagram of an electronic device according to an embodiment of the invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
In the description of the present invention, a number means one or more, a number means two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and above, below, within, etc. are understood to include the present number. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, it should be understood that references to orientation descriptions such as upper, lower, front, rear, left, right, etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description of the present invention and to simplify the description, and do not indicate or imply that the apparatus or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present invention.
In the description of the present invention, the description of the first and second is only for the purpose of distinguishing technical features, and should not be construed as indicating or implying relative importance or implying the number of technical features indicated or the precedence of the technical features indicated.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement, mounting, connection, etc. should be construed broadly and the specific meaning of the terms in the present invention can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical scheme.
In the description of embodiments of the present invention, reference to the terms "one embodiment/implementation," "another embodiment/implementation," or "some embodiments/implementations," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or examples is included in at least two embodiments or implementations of the present disclosure, and the schematic representation of the above terms does not necessarily refer to the same illustrated embodiment or implementation. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or implementations.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Embodiments of the present invention will be further described below with reference to the accompanying drawings.
In a first aspect, an embodiment of the present invention provides a curve fitting method based on a numerical control machining system.
Referring to fig. 1, the curve fitting method based on the numerical control machining system specifically includes, but is not limited to, the following steps S100, S200 and S300.
Step S100: acquiring a line segment to be fitted, wherein the line segment to be fitted comprises a plurality of linear line segments which are connected in sequence;
it should be noted that, in general, the line segment to be fitted includes a large number of continuous small straight lines, and it is to be understood that the number and the length of the straight line segments are not limited in this embodiment.
Step S200: for each pair of adjacent linear line segments, generating a first spiral line and a second spiral line based on a least square method, wherein the first spiral line and the second spiral line have partial overlapping curves;
it should be noted that the part of the overlapping curve is the transition portion between the first spiral and the second spiral, and thus the part of the overlapping curve may be represented by the first spiral or the second spiral.
Step S300: and carrying out smooth transition treatment on the partially overlapped curves to obtain fitted curve line segments.
It should be noted that, since the first spiral line and the second spiral line are smooth line segments, and the part of the overlapped curve is the transition part of the first spiral line and the second spiral line, after the part of the overlapped curve is smoothed, a smooth curve line segment after fitting can be obtained.
It can be understood that, through the steps S100, S200 and S300, a line segment to be fitted including a plurality of line segments connected in sequence is obtained first, then, for each pair of adjacent line segments, a first spiral line and a second spiral line with partially overlapped curves are generated based on a least square method, and then, the partially overlapped curves are subjected to smooth transition processing, so that a fitted curve segment can be obtained according to the first spiral line, the partially overlapped curves after the smooth transition processing, and the second spiral line. According to the technical scheme provided by the embodiment of the invention, the line segments to be fitted can be fitted into the first spiral line and the second spiral line, and the partially overlapped curve of the first spiral line after smooth transition treatment is smoothly transited to the second spiral line, so that the rapid fitting of the curve is completed under the condition that both the speed and the acceleration are smoothly transited.
Referring to fig. 2, exemplary adjacent straight line segments include a first adjacent line segment and a second adjacent line segment, the first adjacent line segment partially overlapping the second adjacent line segment, and with respect to the above-described step S200, the following steps S210, S220 and S230 may be specifically included but are not limited thereto.
Step S210: acquiring a first current endpoint, a first starting endpoint and a first end endpoint of a first adjacent line segment, and acquiring a second current endpoint, a second starting endpoint and a second end endpoint of a second adjacent line segment;
step S220: obtaining a first rotation direction and a first rotation center according to the first current endpoint, the first starting endpoint and the first ending endpoint, and obtaining a second rotation direction and a second rotation center according to the second current endpoint, the second starting endpoint and the second ending endpoint;
step S230: and obtaining a first spiral line according to the first starting end point, the first current end point, the first rotating direction and the first rotating center, and obtaining a second spiral line according to the second starting end point, the second current end point, the second rotating direction and the second rotating center.
Specifically, a first rotation direction and a first rotation center can be calculated by a first current endpoint, a first starting endpoint and a first ending endpoint of the first adjacent line segment, and then a first spiral line corresponding to the first adjacent line segment can be calculated by the first starting endpoint, the first current endpoint, the first rotation direction and the first rotation center; the second rotation direction and the second rotation center can be calculated by the second current end point, the second initial end point and the second tail end point of the second adjacent line segment, and the second spiral line corresponding to the second adjacent line segment can be calculated by the second initial end point, the second current end point, the second rotation direction and the second rotation center.
Illustratively, the first rotational direction and the second rotational direction are obtained by the following formula:
wherein V is 0 Representing a first rotational direction and a second rotational direction, p 0 Representing a first current endpoint and a second current endpoint, p -1 Representing a first starting point and a second starting point, p 1 Represents a first end endpoint and a second end endpoint, x represents three-dimensional vector cross-multiplication, ||p 0 -p -1 The expression of three-dimensional vector p -1 And p is as follows 0 Is, ||p 1 -p 0 The expression of three-dimensional vector p 0 And p is as follows 1 Is a euclidean distance of (c).
Specifically, substituting a first current endpoint, a first starting endpoint and a first ending endpoint of a first adjacent line segment into the above formula to obtain a first rotation direction; and similarly, substituting the second current end point, the second starting end point and the second tail end point of the second adjacent line segment into the formula to obtain the second rotation direction.
Illustratively, the first center of rotation and the second center of rotation are obtained by the following formulas:
wherein C represents a first rotation center and a second rotation center, V 0 Representing a first rotational direction and a second rotational direction, p 0 Representing a first current endpoint and a second current endpoint, p -1 The first starting end point and the second starting end point are represented, n represents a preset constant, n is equal to or larger than 1, i represents a maximum constant satisfying 1.ltoreq.i.ltoreq.n, and j represents a maximum constant satisfying 2.ltoreq.j.ltoreq.n.
Specifically, substituting the first current endpoint, the first starting endpoint and the first rotation direction of the first adjacent line segment into the above formula to obtain a first rotation center; and similarly, substituting the second current end point, the second initial end point and the second rotation direction of the second adjacent line segment into the formula to obtain a second rotation center.
Exemplary, specifically, the largest i, j is found first, satisfying 1.ltoreq.i.ltoreq.n, 2.ltoreq.j.ltoreq.n, n.gtoreq.1 is given as a constant, and p -i 、p -i+1 、……,p -1 Is p 0 Is the end point of the sequential forward query of p 1 、p 2 、……,p j Are endpoints that query backwards in sequence.
Then, the rotation center C is solved as follows.
Then, for all the endpoints searched, the distance between each endpoint and the rotation center is calculated according to the following formula.
L t =||p t -C||,t∈(-i,j)
Then, the average distance was found as follows.
The absolute values of the errors of all endpoints from the average distance are then calculated as follows.
e t =|L t -L|
Then, an endpoint fitting error ε is defined if all e t < ε, point p is shown -i ,p -i+1 ,…,p -1 ,p 0 ,p 1 ,p 2 ,…,p j All meet the fitting requirement, C is the rotation center of the solution, otherwise e is calculated t T corresponding to the maximum value of (1), if t < 0, then p is indicated 0 Forward endpoint p -i ,p -i+1 ,…,p -1 Fitting error is greater than backward p 1 ,p 2 ,…,p j At this time if i>1, i=i-1, if i=1, j=j-1; if t>0, if j>1, j=j-1, if j=1, i=i-1; if t=0, then if i>j, then i=i-1, otherwise j=j-1.
Finally, repeating the steps until the end points p-i, p-i+1, … and p meeting the fitting requirement are found -1 ,p 0 ,p 1 ,p 2 ,…,p j And a rotation center C.
It can be understood that the first rotation center and the second rotation center are obtained by substituting the above steps into the calculation.
Referring to fig. 3, illustratively, after step S220 described above, the method further includes, but is not limited to, step S240 below.
Step S240: and determining whether the first adjacent line segment can be fitted according to the preset error value, the first rotation direction, the first current endpoint, the first starting endpoint and the first ending endpoint, and determining whether the second adjacent line segment can be fitted according to the preset error value, the second rotation direction, the second current endpoint, the second starting endpoint and the second ending endpoint.
Specifically, before the first adjacent line segment is fitted into the first spiral line, judging whether the first adjacent line segment can be fitted or not, so that the fit between the fitted first spiral line and the first adjacent line segment is ensured; and similarly, before the second adjacent line segments are fitted into the second spiral line, judging whether the second adjacent line segments can be fitted or not, so that the fit between the fitted second spiral line segments and the second adjacent line segments is ensured.
Referring to fig. 4, as for the above step S240, it is exemplified that the following steps S241 and S242 may be specifically included but not limited thereto.
Step S241: judging whether a preset error value, a first rotation direction, a first current endpoint, a first starting endpoint and a first ending endpoint meet a preset fitting judgment formula, and if so, fitting a first adjacent line segment;
step S242: judging whether a preset error value, a second rotation direction, a second current endpoint, a second starting endpoint and a second ending endpoint meet a preset fitting judgment formula, and if so, fitting a second adjacent line segment;
it should be noted that the preset fitting judgment formula is as follows:
ε max representing a preset error value, V 0 Represent the firstOne direction of rotation and a second direction of rotation, p 0 Representing a first current endpoint and a second current endpoint, p -1 Representing a first starting point and a second starting point, p 1 Represents a first end point and a second end point, ||p 1 -p -1 The expression of three-dimensional vector p -1 And p is as follows 1 Is, ||p 0 -p -1 The expression of three-dimensional vector p -1 And p is as follows 0 Is, ||p 1 -p 0 The expression of three-dimensional vector p 0 And p is as follows 1 Is a euclidean distance of (c).
Referring to fig. 5, as for the above step S300, it may include, but is not limited to, the following steps S310, S320 and S330 in particular.
Step S310: under the condition that the first spiral line and the second spiral line are positioned at the same preset rotation angle, taking a first three-dimensional position of the first spiral line and a second three-dimensional position of the second spiral line;
step S320: generating a smooth curve corresponding to the partial overlapping curve according to the first three-dimensional position and the second three-dimensional position;
step S330: a smooth curve is used instead of a partially overlapping curve.
Specifically, assume p 0 The points may form a first helixp 1 The dots can also form a second spiral +.>Then p is 0 Pointing to p 1 May be formed by either of the two spirals. Due toAnd->With different C, V 0 The transition between them cannot be smoothed, for which reason +.>Respectively represent a first spiral +.>Is +_with the second spiral line>At a three-dimensional position at a rotation angle θ, p 0 Pointing to p 1 The current three-dimensional position of the double helix line can be calculated according to a formula, so that a smooth curve is generated.
Illustratively, the smoothed curve is obtained by the following formula:
wherein f (u) represents a smooth curve,representing the three-dimensional position of the first spiral at a predetermined rotation angle θ, < >>And the three-dimensional position of the second spiral line when the preset rotation angle is theta is represented, and u is more than or equal to 0 and less than or equal to 1.
When u is changed from 0 to 1, the first spiral is smoothed fromTransition to the second spiral->
Illustratively, the relative speed values for machining the first and second spirals may be obtained in a manner that further facilitates use of the numerical control system.
Let the centripetal maximum acceleration of the smooth curve be a max Maximum speed of F, p 0 Pointing to p 1 The starting point, the ending point and the maximum speed of the fitted smooth curve of (a) are obtained by the following formulas, respectively.
v max =max(v p0 ,v p1 ,F)
Based on the curve fitting method based on the numerical control machining system in the embodiment of the first aspect, the electronic equipment in each embodiment of the second aspect of the invention is provided.
Referring to fig. 6, the electronic device includes a memory 100, a processor 200, and a computer program stored on the memory 100 and executable on the processor 200; the computer program when executed by the processor 200 implements a curve fitting method based on a numerical control machining system as described in any one of the embodiments of the first aspect above.
It should be noted that the electronic device may be a router, a switch, a server, or other data processing and transmitting device.
It will be appreciated that the processor 200 and the memory 100 may be connected by a bus or other means.
It should be noted that, the non-transitory software program and instructions required to implement the curve fitting method based on the nc processing system of the above embodiment are stored in the memory 100, and when executed by the processor 200, the curve fitting method based on the nc processing system in the above embodiment is performed, for example, the method steps S100 to S300 in fig. 1, the method steps S210 to S230 in fig. 2, the method step S240 in fig. 3, the method steps S241 to S242 in fig. 4, and the method steps S310 to S330 in fig. 5 are performed.
It can be understood that, since the data monitoring device for internet of things according to the second embodiment of the present invention performs the curve fitting method based on the numerical control processing system including any one of the embodiments of the first aspect, specific embodiments and technical effects of the electronic device according to the second embodiment of the present invention may refer to specific embodiments and technical effects of the curve fitting method based on the numerical control processing system according to any one of the embodiments of the first aspect, which are not described herein.
The above described embodiments of the electronic device are only illustrative, wherein the units described as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Based on the curve fitting method based on the nc processing system according to the embodiment of the first aspect, the computer-readable storage medium according to each embodiment of the third aspect of the present invention is provided, and the computer-executable instructions are stored in the computer-readable storage medium, and the computer-executable instructions are executed by one processor 200 or a controller, for example, by one processor 200 in the embodiment of the electronic device, and may cause the processor 200 to execute the curve fitting method based on the nc processing system in the embodiment, for example, execute the method steps S100 to S300 in fig. 1, the method steps S210 to S230 in fig. 2, the method steps S240 in fig. 3, the method steps S241 to S242 in fig. 4, and the method steps S310 to S330 in fig. 5.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor 200, such as a central processor 200, a digital signal processor 200, or a microprocessor 200, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory 100 technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present invention.

Claims (5)

1. The curve fitting method based on the numerical control machining system is characterized by comprising the following steps of:
acquiring a line segment to be fitted, wherein the line segment to be fitted comprises a plurality of linear line segments which are connected in sequence;
generating a first spiral line and a second spiral line based on a least square method for each pair of adjacent straight line segments, wherein the first spiral line and the second spiral line have partial overlapping curves, and the adjacent straight line segments comprise a first adjacent line segment and a second adjacent line segment, the first adjacent line segment is partially overlapped with the second adjacent line segment, and the generating the first spiral line and the second spiral line based on the least square method comprises:
acquiring a first current endpoint, a first starting endpoint and a first tail endpoint of the first adjacent line segment, and acquiring a second current endpoint, a second starting endpoint and a second tail endpoint of the second adjacent line segment;
obtaining a first rotation direction and a first rotation center according to the first current endpoint, the first starting endpoint and the first ending endpoint, and obtaining a second rotation direction and a second rotation center according to the second current endpoint, the second starting endpoint and the second ending endpoint, wherein the first rotation direction and the second rotation direction are obtained through the following formulas:
wherein the V is 0 Representing the first and second rotational directions, the p 0 Representing the first current endpoint and the second current endpoint, the p -1 Representing the first and second starting points, the p 1 Representing the first end endpoint and the second end endpoint, the x representing three-dimensional vector cross-over, the p 0 -p -1 The expression of three-dimensional vector p -1 And p is as follows 0 The Euclidean distance of (p) 1 -p 0 The expression of three-dimensional vector p 0 And p is as follows 1 Is the euclidean distance of (2);
obtaining the first spiral line according to the first initial endpoint, the first current endpoint, the first rotation direction and the first rotation center, and obtaining the second spiral line according to the second initial endpoint, the second current endpoint, the second rotation direction and the second rotation center, wherein the first rotation center and the second rotation center are obtained through the following formula:
wherein C represents the first rotation center and the second rotation center, V 0 Representing the first and second rotational directions, the p 0 Representing the first current endpoint and the second current endpoint, the p -1 Representation houseThe first starting end point and the second starting end point, n represents a preset constant, n is more than or equal to 1, i represents a maximum constant which satisfies 1.ltoreq.i.ltoreq.n, and j represents a maximum constant which satisfies 2.ltoreq.j.ltoreq.n;
performing smooth transition processing on the partially overlapped curve to obtain a fitted curve segment, wherein the performing smooth transition processing on the partially overlapped curve to obtain the fitted curve segment comprises the following steps:
taking a first three-dimensional position of the first spiral line and a second three-dimensional position of the second spiral line under the condition that the first spiral line and the second spiral line are positioned at the same preset rotation angle;
generating a smooth curve corresponding to the partial overlap curve according to the first three-dimensional position and the second three-dimensional position;
replacing the partially overlapping curve with the smoothed curve, the smoothed curve being obtained by the formula:
wherein f (u) represents the smooth curve, theRepresenting the three-dimensional position of said first spiral at said preset rotation angle θ, said +.>And representing the three-dimensional position of the second spiral line when the preset rotation angle is theta, wherein u is more than or equal to 0 and less than or equal to 1.
2. The method of claim 1, further comprising, after said deriving a first direction of rotation and a first center of rotation from said first current endpoint, said first start endpoint, and said first end endpoint, and deriving a second direction of rotation and a second center of rotation from said second current endpoint, said second start endpoint, and said second end endpoint:
and determining whether the first adjacent line segment can be fitted according to a preset error value, the first rotation direction, the first current endpoint, the first starting endpoint and the first ending endpoint, and determining whether the second adjacent line segment can be fitted according to the preset error value, the second rotation direction, the second current endpoint, the second starting endpoint and the second ending endpoint.
3. The method of claim 2, wherein the determining whether the first adjacent line segment is fittable based on the preset error value, the first rotation direction, the first current endpoint, the first start endpoint, and the first end endpoint, and determining whether the second adjacent line segment is fittable based on the preset error value, the second rotation direction, the second current endpoint, the second start endpoint, and the second end endpoint comprises:
judging whether the preset error value, the first rotation direction, the first current endpoint, the first starting endpoint and the first ending endpoint meet a preset fitting judgment formula, and if so, fitting the first adjacent line segment;
judging whether the preset error value, the second rotation direction, the second current endpoint, the second starting endpoint and the second ending endpoint meet the preset fitting judgment formula, and if so, fitting the second adjacent line segments;
the preset fitting judgment formula is as follows:
said epsilon max Representing the preset error value, the V 0 Representing the first and second rotational directions, the p 0 Representing the first current endPoint and the second current endpoint, p -1 Representing the first and second starting points, the p 1 Representing the first end endpoint and the second end endpoint, the p 1 -p -1 The expression of three-dimensional vector p -1 And p is as follows 1 The Euclidean distance of (p) 0 -p -1 The expression of three-dimensional vector p -1 And p is as follows 0 The Euclidean distance of (p) 1 -p 0 The expression of three-dimensional vector p 0 And p is as follows 1 Is a euclidean distance of (c).
4. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the curve fitting method based on a numerical control machining system as claimed in any one of claims 1 to 3 when executing the computer program.
5. A computer-readable storage medium, characterized by: computer executable instructions for performing the numerical control machining system based curve fitting method according to any one of claims 1 to 3 are stored.
CN202110954971.XA 2021-08-19 2021-08-19 Curve fitting method based on numerical control machining system, electronic equipment and storage medium Active CN113791577B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110954971.XA CN113791577B (en) 2021-08-19 2021-08-19 Curve fitting method based on numerical control machining system, electronic equipment and storage medium
PCT/CN2021/128422 WO2023019751A1 (en) 2021-08-19 2021-11-03 Numerical control processing system-based curve fitting method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110954971.XA CN113791577B (en) 2021-08-19 2021-08-19 Curve fitting method based on numerical control machining system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113791577A CN113791577A (en) 2021-12-14
CN113791577B true CN113791577B (en) 2023-07-21

Family

ID=79181851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110954971.XA Active CN113791577B (en) 2021-08-19 2021-08-19 Curve fitting method based on numerical control machining system, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113791577B (en)
WO (1) WO2023019751A1 (en)

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS642107A (en) * 1987-06-24 1989-01-06 Fanuc Ltd Involute interpolating system
US6434849B1 (en) * 2000-01-24 2002-08-20 Pruftechnik Dieter Busch Ag Method for determining a lateral and/or angular offset between two rotatable parts
CN104678894B (en) * 2015-02-11 2017-10-03 北京配天技术有限公司 Planing method, digital-control processing system and the method for Machining Path
CN109270892B (en) * 2018-08-31 2020-10-02 天津大学 Least square spiral line approximation algorithm of non-circular curve in numerical control machining
CN111176209B (en) * 2019-10-09 2022-09-23 上海交通大学 Off-line planning method for feeding rate and rotating speed of cavity spiral milling
CN110823238A (en) * 2019-11-05 2020-02-21 湖南大学 Improved cubic spline interpolation curve path point fitting method
CN111571316B (en) * 2020-04-30 2021-10-26 科德数控股份有限公司 Grinding track optimization method and system for screw tap thread machining
CN112015142A (en) * 2020-08-26 2020-12-01 无锡信捷电气股份有限公司 NURBS-based small segment processing method
CN112729086B (en) * 2020-12-28 2022-03-08 西安交通大学 Vortex disc body error on-machine measurement method based on four-axis numerical control milling machine

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种基于最小二乘法的离散点螺旋线式拟合算法;尤中桐;王太勇;刘清建;辛全琦;;中国机械工程(20);全文 *
数控加工中非圆曲线的最小二乘圆弧逼近;乐英;韩庆瑶;王璋奇;;华北电力大学学报(自然科学版)(06);全文 *
最小二乘法拟合变导程螺杆螺旋曲线;余雷;机电工程(04);全文 *

Also Published As

Publication number Publication date
CN113791577A (en) 2021-12-14
WO2023019751A1 (en) 2023-02-23

Similar Documents

Publication Publication Date Title
CN114791288B (en) Method and device for planning driving path of mine vehicle and computer equipment
CN113190021B (en) Industrial robot small line segment track planning method
CN109496286B (en) Numerical control system, path planning method thereof and computer-readable storage medium
CN113791577B (en) Curve fitting method based on numerical control machining system, electronic equipment and storage medium
CN111604905A (en) Method, device and system for joint trajectory planning and storage medium
CN116738579A (en) Automatic construction method and system for parting line of automobile panel
CN111624988A (en) Planning method and device for U-turn path
CN111259496A (en) Curve reconstruction method based on discrete points
CN113126607B (en) Robot and motion control method and device thereof
CN111633668A (en) Motion control method for robot to process three-dimensional free-form surface
CN114815743A (en) Curve interpolation method and system of numerical control machine tool and storage medium
CN113312872B (en) Gong belt manufacturing method and device, gong belt manufacturing equipment and storage medium
CN111192216B (en) Lane line smoothing method and system
CN114488941A (en) Trace fairing method and medium for micro line segments and machine tool numerical control equipment
WO2023019750A1 (en) Method, apparatus, and device for local smoothing and transitioning between trajectories, and storage medium
CN116167166A (en) Method and device for scheduling algorithm of chassis model, electronic equipment and storage medium
CN113085840B (en) Parking path determination method and device, vehicle and storage medium
WO2022142228A1 (en) Speed segmentation method and apparatus, and electronic device and storage medium
CN115562183A (en) Motion control system high-precision circular interpolation method based on direct function method
CN114839927A (en) S-shaped curve acceleration and deceleration planning method and system and storage medium
CN111714031B (en) Sweeping method and device for sweeping equipment and electronic equipment
CN111661197A (en) AGV instruction setting system, method, computer equipment and storage medium thereof
CN113341886B (en) Smooth feed speed planning method, device and computer readable storage medium
CN113791578B (en) Track filtering method and device based on numerical control machining system and electronic equipment
CN115556104B (en) Control method and system for single joint position of robot and related equipment

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231110

Address after: Room B221, 2nd Floor, Unit 2, Building 2, No. 24, Jishan New Road Street, Tianhe District, Guangzhou City, Guangdong Province, 510630

Patentee after: Guangzhou Sihe Innovation Technology Co.,Ltd.

Address before: No.22, Dongcheng village, Pengjiang district, Jiangmen City, Guangdong Province

Patentee before: WUYI University