CN113111404A - Fitting method for circular arc and straight line of small continuous spatial line segment - Google Patents
Fitting method for circular arc and straight line of small continuous spatial line segment Download PDFInfo
- Publication number
- CN113111404A CN113111404A CN202110342697.0A CN202110342697A CN113111404A CN 113111404 A CN113111404 A CN 113111404A CN 202110342697 A CN202110342697 A CN 202110342697A CN 113111404 A CN113111404 A CN 113111404A
- Authority
- CN
- China
- Prior art keywords
- point
- line segment
- fitting
- straight line
- eta
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 239000013598 vector Substances 0.000 claims abstract description 14
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000012937 correction Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 abstract description 8
- 238000004519 manufacturing process Methods 0.000 abstract description 2
- 238000003491 array Methods 0.000 abstract 1
- 238000003754 machining Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/18—Numerical 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/19—Numerical 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
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/30—Nc systems
- G05B2219/34—Director, elements to supervisory
- G05B2219/34098—Slope fitting, fairing contour, curve fitting, transition
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total 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 method for fitting circular arcs and straight lines of small continuous spatial line segments, which comprises the following steps: 1. importing continuous small line segment data point arrays, and solving a continuous small line segment data point array interval [0, i]Determining parameters Er delta, Erd, ErR and Erl; 2. calculating the coordinate vector of the first three points of the small line segmentAndan included angle delta; 3. if delta is smaller than Er delta, entering step 4 for space circular arc fitting, and otherwise entering step 6 for space straight line fitting; 4 the point PiTo P0、P1、P2Perpendicular distance d of the spatial planep< Erd, regionM [0, i ]]The difference value delta R between the distance from each point to the central point of the circular arc and the radiusj< ErR; if yes, continuously fitting the subsequent points into an arc; 6. calculating a point P0And point PiAre connected into a straight line segment P0PiThe included angle eta with the xoy plane and the straight line segment P0PiWhether the included angle theta between the projection of the xoy plane and the x axis meets the requirement or not; if yes, continuing to fit the next point; 7. until finishing fitting; according to the invention, the continuous small-line-segment track is fitted by using the circular arc and the straight line, so that the surface of the processed part is smoother, the processing efficiency is improved, and the production efficiency of an enterprise is improved.
Description
Technical Field
The invention relates to the technical field of numerical control machining, in particular to a fitting method of circular arcs and straight lines of small continuous spatial line segments.
Background
The tool path track in numerical control machining mainly has three forms: continuous small segment trajectories, circular arc trajectories, and NURBS curve trajectories. The continuous small line segment track is formed by connecting a series of data points through a continuous straight line, the motion track only approaches the contour of the original processing track from the shape of a workpiece, and the smoothness of the processed straight line or curved surface cannot be ensured. The NURBS curve is widely applied to surface modeling design, most numerical control systems do not support NURBS curve interpolation, and the NURBS curve track is usually dispersed into continuous small segment tracks for processing.
For the fitting of continuous small line segment tracks, the fitting of circular arcs or straight lines is mostly carried out in a two-dimensional manner, and the fitting of the circular arcs and the straight lines is carried out separately in most methods, so that certain tracks suitable for fitting into circular arcs are fitted into a plurality of short straight line segments, tracks suitable for fitting into long straight line segments are fitted into a plurality of short circular arcs, the fitting result has large errors, the method is not suitable for real-time processing of a motion control system, and most fitting methods are only suitable for two-dimensional planes.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a fitting method of a circular arc and a straight line of a spatially continuous small line segment, and the circular arc and the straight line are used for fitting a continuous small line segment track, so that the surface of a machined part is smoother, the machining efficiency is improved, and the production efficiency of an enterprise is improved.
In order to solve the technical problem, the invention provides a method for fitting a circular arc and a straight line of a spatially continuous small line segment, which comprises the following steps of:
step 2, the coordinates P of the first three points of the small line segment0(x0,y0,z0),P1(x1,y1,z1),P2(x2,y2,z2) Vector of motion(Vector)Computing vectorsAndthe included angle delta of;
step 3, if delta is smaller than Er delta, entering a space circular arc fitting process of the next step 4, and otherwise, entering a space straight line fitting process of the step 6;
and 4, the space circular arc fitting process comprises the following steps: for subsequent points P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n), and judges each point PiWhether the arc fitting error satisfies: the point PiTo P0(x0,y0,z0),P1(x1,y1,z1),P2(x2,y2,z2) Perpendicular distance d of the spatial planep< Erd, continuous small line data point column interval [0, i]Each point P0,P1,...,PiDifference value delta R between distance from central point of circular arc and radiusj< ErR; if yes, continuously fitting the subsequent points into an arc; otherwise, the previous arc is outputThe center of a circle and the radius parameter;
step 5, if the point PiIf the fitting requirement of the circular arc is not met, judging whether the number i of the fitted points is less than 4, if i is less than or equal to 4, not fitting the front 4 points into the circular arc, and entering the space straight line fitting process of the step 6; if i > 4, thenIs a fitted circular arc segment; point Pi-1As initial point of subsequent fitting, from point Pi-1Starting the next fitting;
step 6, the space straight line fitting method is that the initial point P of the small line segment is set0=(x0,y0,z0) For any point subsequent to the initial point of the small line segment, P isi=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiThe included angle eta with the xoy plane and the straight line segment P0PiWhether the included angle theta between the projection of the xoy plane and the x axis meets the following condition: eta belongs to [ eta ]min,ηmax]And theta is equal to thetamin,θmax](ii) a If yes, continuing to fit the next point, and if not, outputting the previous fitting straight-line segment P0Pi-1(ii) a Point Pi-1As initial point of subsequent fitting, from point Pi-1Starting the next fitting;
step 7, finishing the fitting until all the points are fitted;
δ=arccosδ。
preferably, in step 4, the method for fitting a spatial arc includes the following steps:
step 4.1, the first three points P on the small line segment0,P1,P2Coordinate value (x) of0,y0,z0),(x1,y1,z1),(x2,y2,z2) Calculating A, B, C, D the parameters of the spatial plane where the three points are located;
step 4.2, carrying out subsequent point P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n) and calculating the perpendicular distance d from this point to the spatial plane determined in step 4.1p;
Step 4.3, if d is obtained in said step 4.2p< Erd, proceed to the next stepStep 4.4, otherwise, outputting the previous circular arcThe circle center coordinates (a, b, c) and the radius r parameter;
step 4.4, selecting a first point P0(x0,y0,z0) Current point Pi(xi,yi,zi)、P0And PiMiddle point Pc(xc,yc,zc) Coordinates and the centers (a, b, c) of the combined circular arcs are positioned on the spatial plane of the step 4.1; (ii) a Calculating the circle centers (a, b and c) and the radius r of the spatial circular arcs and circular arc direction parameters;
step 4.5, solving a continuous small line segment data point column interval [0, i]Each point P0,P1,...,PiDifference value delta R between distance from central point of circular arc and radiusj;
Step 4.6, if Δ Rj< ErR, go on to step 4.2 to fit next point, otherwise output previous arcThe center of a circle and the radius parameter;
and 4.7, finishing the fitting until the fitting is finished at the last point.
Preferably, in step 6, the method for fitting a spatial straight line includes the steps of:
step 6.1, setting initial point P of small line segment0=(x0,y0,z0) Setting an initial parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θmin═ infinity; wherein, [ eta ]min,ηmax]Is fit to the range of the included angle between the straight line segment and the xoy plane, [ theta ]min,θmax]Fitting the range of the included angle between the projection straight line of the straight line segment on the xoy plane and the x axis;
step 6.2, carrying out subsequent arbitrary point P on the initial point of the small line segmenti=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segmentP0PiAngle eta with xoy plane and straight line segment P0PiAn included angle theta between the projection of the xoy plane and the x axis;
step 6.3, if the eta obtained in the step 6.2, theta is within the allowable range set in the step 6.1, namely eta epsilon [ eta ∈ [ eta ])min,ηmax]And theta is equal to thetamin,θmax]Then the calculation of the parameters continues with the following step 6.4
If eta, theta obtained in the step 6.2 is not within the allowable range set in the step 6.1, that is, eta < etaminOr eta > etamaxOr theta < thetaminOr theta > thetamaxThen the previous straight line segment P0Pi-1And outputting as a fitting straight line segment. A straight line segment P0Pi-1After the straight line segment is fitted, if a small line segment is not fitted, i is less than n, then the point P isi-1For the initial point of the next fitted straight line segment, go back to step 6.1 to start fitting the subsequent small line segment. If no small line segment remains subsequently, namely i is equal to n, finishing the fitting;
step 6.4, calculating parameters by the following formula(Respectively used as the interval [ eta ] in step 6.5min,ηmax]And interval [ theta ]min,θmax]Correction coefficient of (2):
step 6.5, correcting the parameter eta in the step 6.1 according to the following formulamax,ηmin,θmax,θmin:
Step 6.6, returning to the step 6.2, and continuously fitting the next point of the small line segment;
the invention provides a space straight line fitting method, which comprises the following steps:
step 2, setting an initial point P of a small line segment0=(x0,y0,z0) Setting an initial parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θmin═ infinity; wherein, [ eta ]min,ηmax]Is fit to the range of the included angle between the straight line segment and the xoy plane, [ theta ]min,θmax]Fitting the range of the included angle between the projection straight line of the straight line segment on the xoy plane and the x axis;
step 3, carrying out subsequent arbitrary point P of the initial point of the small line segmenti=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiAngle eta with xoy plane and straight line segment P0PiAn included angle theta between the projection of the xoy plane and the x axis;
step 4, if the eta obtained in the step 3 is within the allowable range set in the step 2, namely eta epsilon [ eta ∈ [ [ eta ]min,ηmax]And theta is equal to thetamin,θmax]Then the calculation of the parameters in the subsequent step 5 is continued
If eta, theta obtained in the step 3 is not within the allowable range set in the step 2, that is, eta < etaminOr eta > etamaxOr theta < thetaminOr theta > thetamaxThen the previous straight line segment P0Pi-1And outputting as a fitting straight line segment. A straight line segment is formedP0Pi-1After the straight line segment is fitted, if a small line segment is not fitted, i is less than n, then the point P isi-1And returning to the step 2 to start fitting the subsequent small line segments for the initial point of the next fitting straight line segment. If no small line segment remains subsequently, namely i is equal to n, finishing the fitting;
step 5, calculating parameters by the following formula(Respectively used as the interval [ eta ] in step 6min,ηmax]And interval [ theta ]min,θmax]Correction coefficient of (2):
step 6, correcting the parameter eta in the step 6.1 according to the following formulamax,ηmin,θmax,θmin:
And 7, returning to the step 3, and continuously fitting the next point of the small line segment.
The invention provides a space circular arc fitting method, which comprises the following steps:
step 2, the first three points P on the small line segment0,P1,P2Coordinate value (x) of0,y0,z0),(x1,y1,z1),(x2,y2,z2) Calculating A, B, C, D the parameters of the spatial plane where the three points are located;
step 3, carrying out subsequent point P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n), calculating the perpendicular distance d from the point to the space plane obtained in step 2p;
Step 4, if d is obtained in the step 3pIf < Erd, continue the next step 5, otherwise output the previous arcThe circle center coordinates (a, b, c) and the radius r parameter;
step 5, selecting a first point P0(x0,y0,z0) Current point Pi(xi,yi,zi)、P0And PiMiddle point Pc(xc,yc,zc) Coordinates and the centers (a, b, c) of the combined circular arcs are positioned on the spatial plane of the step 2; calculating the circle centers (a, b and c) and the radius r of the spatial circular arcs and circular arc direction parameters;
step 6, solving a continuous small line segment data point column interval [0, i]Each point P0,P1,...,PiDifference value delta R between distance from central point of circular arc and radiusj;
Step 7, if Δ Rj< ErR, go on to step 3 to fit next point, otherwise output previous arcThe center of a circle and the radius parameter;
and 8, finishing the fitting until the last point of the fitting is finished.
The invention relates to a method for fitting circular arcs and straight lines of small continuous spatial segments, which has the following advantages compared with the existing design: the algorithm of the space straight line fitting method is implanted into an open type motion controller based on RTX64, meanwhile, the communication between a soft controller and servo slave station equipment is realized by combining the real-time industrial Ethernet EtherCAT bus technology, the accurate control of the shaft is realized, the processing efficiency of a motion control system is improved under the condition of not increasing the hardware cost, the smoothness and the processing precision of a processing track are improved, and the application value is high. Meanwhile, the three-dimensional arc-straight line fitting provided by the application can also be applied to two-dimensional arc-straight line fitting.
Drawings
FIG. 1 is a schematic diagram of spatially continuous small line segments introduced by the present invention.
FIG. 2 is a schematic diagram of fitting a spatial arc to a continuous small line segment according to the present invention.
FIG. 3 is a schematic flow chart of the method for fitting a spatial straight line according to the present invention.
FIG. 4 is a schematic flow chart of a spatial curve fitting method according to the present invention.
FIG. 5 is a schematic flow chart of the fitting method of the spatial arc and the straight line according to the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and specific examples.
Example 1
The invention relates to a method for fitting a spatial straight line, which comprises the following steps as shown in figure 3:
Step 2, setting an initial point P of a small line segment0=(x0,y0,z0) Setting an initial parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θmin- ∞ (where, [ η [ ])min,ηmax]Is fit to the range of the included angle between the straight line segment and the xoy plane, [ theta ]min,θmax]The range of the included angle between the projection straight line of the fit straight line segment on the xoy plane and the x axis).
Initialization parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θminFor the initialization of the program, the interval [ η ] is set in step 6min,ηmax],[θmin,θmax]And correcting to ensure the convergence of the parameter interval.
Step 3, carrying out subsequent arbitrary point P of the initial point of the small line segmenti=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiAngle to xoy planeCalculating the straight line segment P0PiAngle between projection on xoy plane and x-axis
The convergence of the fitting space straight line is ensured by ensuring that the space straight line parameters eta and theta are always in the range of the convergence interval.
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 ] eta ∈min,ηmax]And theta is equal to thetamin,θmax]Then the calculation of the parameters in the subsequent step 5 is continued
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 space fitting straight line segment on the xoy plane and the x axis are limited in an interval [ eta ]min,ηmax]、[θmin,θmax]The range is to make the continuous small line segment points 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, that is, eta < etaminOr eta > etamaxOr theta < thetaminOr theta > thetamaxThen the previous straight line segment P0Pi-1As a simulationAnd combining the straight line segments and outputting. A straight line segment P0Pi-1After the straight line segment is fitted, if a small line segment is not fitted, i is less than n, then the point P isi-1And returning to the step 2 to start fitting the subsequent small line segments for the initial point of the next fitting straight line segment. And if no small line segment remains subsequently, namely i is equal to n, finishing the fitting.
When a large number of continuous small line segment points are introduced, not all small line segments are fit into one long straight line segment, but all small line segments are fit into a plurality of long straight line segments, so that when one long straight line segment is fit, straight line fitting needs to be continuously performed on the remaining continuous small line segment points.
Step 5, calculating parameters by the following formula(Respectively used as the interval [ eta ] in step 6min,ηmax]And interval [ theta ]min,θmax]Correction coefficient of (2):
from step 1, Erl is the set fitting precision, and is converted into the allowable angle deviation of the included angle between the space fitting straight line segment and the xoy planeConverting into the allowable angle deviation of the included angle between the projection straight line of the fitting straight line segment on the xoy plane and the x axis
Step 6, correcting the parameter eta in the step 2 according to the following formulamax,ηmin,θmax,θmin:
This step ensures that the range to which the angle η, θ of the fitted line belongs remains convergent.
And 7, returning to the step 3, and continuously fitting 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:
The spatial circle can be seen as a spatial sphere formed by intersecting a spatial plane passing through the center of the sphere. Therefore, whether the continuous small line segment points are on the plane where the space circular arc is located or not is considered, and the distance between the points and the space plane needs to be within an allowable error Erd range; secondly, whether the continuous small line segment points are positioned on the spherical surface where the circular arc is positioned is considered, and the difference between the distance from the points to the circle center and the radius needs to be within an allowable error ErRAnd (4) the following steps.
Step 2, the first three points P on the small line segment0,P1,P2Coordinate value (x) of0,y0,z0),(x1,y1,z1),(x2,y2,z2) The three non-collinear points can determine a plane equation, the coordinates of the three points are substituted into the plane equation Ax + By + Cz + D as 0, and the parameters A, B, C, D of the plane equation can be solved By a simultaneous formula, so that the space plane parameters A, B, C, D where the three points are located are obtained.
Step 3, carrying out subsequent point P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n), calculating the perpendicular distance d from the point to the space plane obtained in step 2p(ii) a D can be calculated according to a distance formula from a point to a space planep;
Step 4, considering whether the continuous small line segment points are on the plane where the space circular arc is located, and considering the distance d between the points and the space planepWithin the allowable error Erd. If d is obtained in said step 3pIf < Erd, continue the next step 5, otherwise output the previous arcAnd (4) parameters.
Step 5, selecting a first point P0(x0,y0,z0) Current point Pi(xi,yi,zi)、P0And PiMiddle point Pc(xc,yc,zc) Coordinates and the centers (a, b and c) of the combined circular arcs are positioned on the spatial plane obtained in the step 2. The center (a, b, c) and radius r of the spatial arc, as well as the arc direction parameters, are calculated by the following equations. The spatial circular arc is determined by three points which are not collinear in space, and a first point and a current point are selected so that the end point of the fitted long circular arc section is the starting point of the next fitted long circular arc section, so that continuity between the circular arc sections can be ensured, and the continuity of processing is ensured.
And 6, in order to judge whether the points of the continuous small line segments which are fitted at this time are all approximate to the fitted circular arcs, calculating the difference between the distances from each point to the central points of the circular arcs and the radius. Find continuous small line segment data point column interval [0, i]Each point P0,P1,...,PiDifference between distance to the center point of the arc and radius:
step 7, considering whether the continuous small line segment points are positioned on the space circular arc or not, and considering that the distance between the points and the circle center and the radius difference value delta RjNeed to be within an allowable error ErRAnd (4) the following steps. If Δ Rj< ErR, the method returns to the next point of the step 3 fitting, otherwise, the previous circular arc is outputThe parameter (c) of (c).
And 8, finishing the fitting until the last point of the fitting is finished.
Example 3
The invention provides a method for fitting a space circular arc and a straight line, which combines the fitting of the space circular arc and the straight line, the specific algorithm flow is shown in figure 5, and the scheme for fitting the space circular arc and the space straight line in front is combined, and the main technical scheme is as follows:
Step 2, calculating the coordinates P of the first three points0(x0,y0,z0),P1(x1,y1,z1),P2(x2,y2,z2) Vector of motion(Vector)Vector calculation by the following procedureAndangle δ:
δ=arccosδ;
by calculating vectorsSum vectorIs used for judging the point P0,P1,P2Whether or not in a straight line.
Step 3, if delta is less than Er delta, the point P can be considered as0,P1,P2And the points are positioned on the same straight line, so that straight line fitting can be carried out to continue fitting subsequent points. Step 6 is entered for spatial straight line fitting, otherwise, point P is entered0,P1,P2Not collinear, can be fitted into a circular arc segment, thus entering into the circular arc fitting process.
Step 4, for the subsequent point Pi=(xi,yi,zi) (i-4, 5, …, n), and judges each point PiWhether the arc fitting error meets the requirements, i.e. dp<Erd,ΔRj< ErR. Each point PiSatisfy the arc simulationAnd if the requirement is met, continuously fitting the subsequent points into a circular arc. The space circular arc fitting process is as follows:
step 4.1, the first three points P on the small line segment0,P1,P2Coordinate value (x) of0,y0,z0),(x1,y1,z1),(x2,y2,z2) The following equation is substituted to calculate the spatial plane parameters A, B, C, D at which the three points lie.
Step 4.2, carrying out subsequent point P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n) and calculating the perpendicular distance d from this point to the spatial plane determined in step 4.1p。
Step 4.3, if d is obtained in said step 4.2pIf Erd is less, the next step 4.4 is continued, otherwise, the previous circular arc is outputThe parameters (i.e. the centre coordinates (a, b, c) and the radius r).
Step 4.4, selecting a first point P0(x0,y0,z0) Current point Pi(xi,yi,zi)、P0And PiMiddle point Pc(xc,yc,zc) Coordinates, and in combination with the circle center (a, b, c) of the arc, lie on the spatial plane. The center (a, b, c) and radius r of the spatial arc, as well as the arc direction parameters, are calculated by the following equations.
Step 4.5, solving continuous small line segmentsData point column interval [0, i]Each point P0,P1,...,PiDifference between distance to the center point of the arc and radius:
step 4.6, if Δ Rj< ErR, go on to step 4.2 to fit next point, otherwise output previous arcThe center of a circle and the radius of the circle.
And 4.7, finishing the fitting until the fitting is finished at the last point.
Step 5, if the point PiAnd (4) not meeting the circular arc fitting requirement, judging whether the number i of the fitted points is less than 4, if i is less than or equal to 4, not fitting the previous 4 points into a circular arc, and entering the space straight line fitting process of the step (6). If i > 4, thenIs a fitted circular arc segment. Point Pi-1As initial point of subsequent fitting, from point Pi-1The next fit is started.
The fitted circular arc is less than 4 points, and the 4 points with high probability are positioned on the same straight line, so that more points can be fitted by entering the straight line fitting.
Step 6, the space straight line fitting method comprises the following steps that if space straight line fitting is carried out, parameters such as eta and theta and a point P are calculated according to the space straight line fitting step of the first technical schemeiIf the fitting requirement is met, the next point is continuously fitted, and if the fitting requirement is not met, the previous fitting straight line segment P is output0Pi-1. Point Pi-1As initial point of subsequent fitting, from point Pi-1The next fit is started.
Step 6.1, setting initial point P of small line segment0=(x0,y0,z0) Setting an initial parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θminIs defined as a group consisting of ═ infinity (wherein,[ηmax,ηmin]is fit to the range of the included angle between the straight line segment and the xoy plane, [ theta ]max,θmin]The range of the included angle between the projection straight line of the fit straight line segment on the xoy plane and the x axis).
Step 6.2, carrying out subsequent arbitrary point P on the initial point of the small line segmenti=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiAngle to xoy planeCalculating the straight line segment P0PiAngle between projection on xoy plane and x-axis
Step 6.3, if the eta obtained in the step 6.2, theta is within the allowable range set in the step 6.1, namely eta epsilon [ eta ∈ [ eta ])min,ηmax]And theta is equal to thetamin,θmax]Then the calculation of the parameters continues with the following step 6.4
If eta, theta obtained in the step 6.2 is not within the allowable range set in the step 6.1, that is, eta < etaminOr eta > etamaxOr theta < thetaminOr theta > thetamaxThen the previous straight line segment P0Pi-1And outputting as a fitting straight line segment. A straight line segment P0Pi-1After the straight line segment is fitted, if a small line segment is not fitted, i is less than n, then the point P isi-1For the initial point of the next fitted straight line segment, go back to step 6.1 to start fitting the subsequent small line segment. And if no small line segment remains subsequently, namely i is equal to n, finishing the fitting.
Step 6.4, calculating parameters by the following formula(Respectively used as the interval [ eta ] in step 6.5min,ηmax]And interval [ theta ]min,θmax]Correction coefficient of (2):
step 6.5, correcting the parameter eta in the step 6.1 according to the following formulamax,ηmin,θmax,θmin:
And 6.6, returning to the step 6.2, and continuously fitting the next point of the small line segment.
And 7, finishing the fitting until all the points are fitted.
Claims (6)
1. A fitting method of circular arcs and straight lines of small continuous spatial line segments is characterized by comprising the following steps:
step 1, importing continuous small-segment data point columns, solving a continuous small-segment data point column interval [0, i ], and determining parameters Er delta, Erd, ErR and Erl; the Er δ is a threshold value for judging whether the program enters straight line fitting or arc fitting, the Erd is an allowable distance from a point to a space plane where an arc is located, the ErR is an allowable error of a difference between a distance from the point to a circle center and a radius, and the Erl is fitting accuracy of the space straight line;
step 2, the coordinates P of the first three points of the small line segment0(x0,y0,z0),P1(x1,y1,z1),P2(x2,y2,z2) Vector of motion(Vector)Computing vectorsAndthe included angle delta of;
step 3, if delta is smaller than Er delta, entering a space circular arc fitting process of the next step 4, and otherwise, entering a space straight line fitting process of the step 6;
and 4, the space circular arc fitting process comprises the following steps: for subsequent points P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n), and judges each point PiWhether the arc fitting error satisfies: the point PiTo P0(x0,y0,z0),P1(x1,y1,z1),P2(x2,y2,z2) Perpendicular distance d of the spatial planep< Erd, continuous small line data point column interval [0, i]Each point P0,P1,...,PiDifference value delta R between distance from central point of circular arc and radiusj< ErR; if yes, continuously fitting the subsequent points into an arc; otherwise, the previous arc is outputThe center of a circle and the radius parameter;
step 5, if the point PiIf the fitting requirement of the circular arc is not met, judging whether the number i of the fitted points is less than 4, if i is less than or equal to 4, not fitting the front 4 points into the circular arc, and entering the space straight line fitting process of the step 6; if i > 4, thenIs a fitted circular arc segment; point Pi-1As a subsequent fitFrom point Pi-1Starting the next fitting;
step 6, the space straight line fitting method is that the initial point P of the small line segment is set0=(x0,y0,z0) For any point subsequent to the initial point of the small line segment, P isi=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiThe included angle eta with the xoy plane and the straight line segment P0PiWhether the included angle theta between the projection of the xoy plane and the x axis meets the following condition: eta belongs to [ eta ]min,ηmax]And theta is equal to thetamin,θmax](ii) a If yes, continuing to fit the next point, and if not, outputting the previous fitting straight-line segment P0Pi-1(ii) a Point Pi-1As initial point of subsequent fitting, from point Pi-1Starting the next fitting;
and 7, finishing the fitting until all the points are fitted.
3. the method for fitting the circular arc and the straight line of the spatially continuous small line segment according to claim 1, wherein in the step 4, the method for fitting the spatial circular arc comprises the following steps:
step 4.1, the first three points P on the small line segment0,P1,P2Coordinate value (x) of0,y0,z0),(x1,y1,z1),(x2,y2,z2) Calculating A, B, C, D the parameters of the spatial plane where the three points are located;
step 4.2, carrying out subsequent point P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n) and calculating the perpendicular distance d from this point to the spatial plane determined in step 4.1p;
Step 4.3, if d is obtained in said step 4.2pIf Erd is less, the next step 4.4 is continued, otherwise, the previous circular arc is outputThe circle center coordinates (a, b, c) and the radius r parameter;
step 4.4, selecting a first point P0(x0,y0,z0) Current point Pi(xi,yi,zi)、P0And PiMiddle point Pc(xc,yc,zc) Coordinates and the centers (a, b, c) of the combined circular arcs are positioned on the spatial plane of the step 4.1; (ii) a Calculating the circle centers (a, b and c) and the radius r of the spatial circular arcs and circular arc direction parameters;
step 4.5, solving a continuous small line segment data point column interval [0, i]Each point P0,P1,...,PiDifference between distance to center point of circular arc and radiusΔRj;
Step 4.6, if Δ Rj< ErR, go on to step 4.2 to fit next point, otherwise output previous arcThe center of a circle and the radius parameter;
and 4.7, finishing the fitting until the fitting is finished at the last point.
4. The method for fitting the circular arc and the straight line of the spatially continuous small line segment according to claim 1, wherein in the step 6, the method for fitting the spatially continuous small line segment comprises the following steps:
step 6.1, setting initial point P of small line segment0=(x0,y0,z0) Setting an initial parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θmin═ infinity; wherein, [ eta ]min,ηmax]Is fit to the range of the included angle between the straight line segment and the xoy plane, [ theta ]min,θmax]Fitting the range of the included angle between the projection straight line of the straight line segment on the xoy plane and the x axis;
step 6.2, carrying out subsequent arbitrary point P on the initial point of the small line segmenti=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiAngle eta with xoy plane and straight line segment P0PiAn included angle theta between the projection of the xoy plane and the x axis;
step 6.3, if the eta obtained in the step 6.2, theta is within the allowable range set in the step 6.1, namely eta epsilon [ eta ∈ [ eta ])min,ηmax]And theta is equal to thetamin,θmax]Then the calculation of the parameters continues with the following step 6.4
If eta, theta obtained in the step 6.2 is not within the allowable range set in the step 6.1, that is, eta < etaminOr eta > etamaxOr theta<θminOr theta > thetamaxThen the previous straight line segment P0Pi-1And outputting as a fitting straight line segment. A straight line segment P0Pi-1After the straight line segment is fitted, if a small line segment is not fitted, i is less than n, then the point P isi-1For the initial point of the next fitted straight line segment, go back to step 6.1 to start fitting the subsequent small line segment. If no small line segment remains subsequently, namely i is equal to n, finishing the fitting;
step 6.4, calculating parameters by the following formula(Respectively used as the interval [ eta ] in step 6.5min,ηmax]And interval [ theta ]min,θmax]Correction coefficient of (2):
step 6.5, correcting the parameter eta in the step 6.1 according to the following formulamax,ηmin,θmax,θmin:
And 6.6, returning to the step 6.2, and continuously fitting the next point of the small line segment.
5. A method for fitting a spatial straight line is characterized by comprising the following steps:
step 1, leading continuous small line segment points, and setting fitting precision Erl of a spatial straight line;
step 2, setting an initial point P of a small line segment0=(x0,y0,z0) Setting an initial parameter value etamax=+∞,ηmin=-∞,θmax=+∞,θmin═ infinity; wherein, [ eta ]min,ηmax]Is fit to the range of the included angle between the straight line segment and the xoy plane, [ theta ]min,θmax]Fitting the range of the included angle between the projection straight line of the straight line segment on the xoy plane and the x axis;
step 3, carrying out subsequent arbitrary point P of the initial point of the small line segmenti=(xi,yi,zi) (i ═ 1,2, …, n), calculating point P0And point PiConnected straight line segment P0PiAngle eta with xoy plane and straight line segment P0PiAn included angle theta between the projection of the xoy plane and the x axis;
step 4, if the eta obtained in the step 3 is within the allowable range set in the step 2, namely eta epsilon [ eta ∈ [ [ eta ]min,ηmax]And theta is equal to thetamin,θmax]Then the calculation of the parameters in the subsequent step 5 is continued
If eta, theta obtained in the step 3 is not within the allowable range set in the step 2, that is, eta < etaminOr eta > etamaxOr theta < thetaminOr theta > thetamaxThen the previous straight line segment P0Pi-1And outputting as a fitting straight line segment. A straight line segment P0Pi-1After the straight line segment is fitted, if a small line segment is not fitted, i is less than n, then the point P isi-1And returning to the step 2 to start fitting the subsequent small line segments for the initial point of the next fitting straight line segment. If no small line segment remains subsequently, namely i is equal to n, finishing the fitting;
step 5, calculating parameters by the following formula(Respectively used as the interval [ eta ] in step 6min,ηmax]And interval [ theta ]min,θmax]Correction coefficient of (2):
step 6, correcting the parameter eta in the step 6.1 according to the following formulamax,ηmin,θmax,θmin:
And 7, returning to the step 3, and continuously fitting the next point of the small line segment.
6. A space circular arc fitting method is characterized by comprising the following steps:
step 1, leading in continuous small line segment points, and determining set fitting precision Erd, ErR; erdIs the allowable distance from the point to the spatial plane in which the circular arc is located, ErRThe allowable error of the distance between the point and the circle center and the difference value of the radius is defined;
step 2, the first three points P on the small line segment0,P1,P2Coordinate value (x) of0,y0,z0),(x1,y1,z1),(x2,y2,z2) Calculating A, B, C, D the parameters of the spatial plane where the three points are located;
step 3, carrying out subsequent point P on the small line segmenti=(xi,yi,zi) (i-4, 5, …, n), calculating the perpendicular distance d from the point to the space plane obtained in step 2p;
Step 4, if d is obtained in the step 3pIf < Erd, continue the next step 5, otherwise output the previous arcThe circle center coordinates (a, b, c) and the radius r parameter;
step 5, selecting a first point P0(x0,y0,z0) Current point Pi(xi,yi,zi)、P0And PiMiddle point Pc(xc,yc,zc) Coordinates and the centers (a, b, c) of the combined circular arcs are positioned on the spatial plane of the step 2; calculating the circle centers (a, b and c) and the radius r of the spatial circular arcs and circular arc direction parameters;
step 6, solving a continuous small line segment data point column interval [0, i]Each point P0,P1,...,PiDifference value delta R between distance from central point of circular arc and radiusj;
Step 7, if Δ Rj< ErR, go on to step 3 to fit next point, otherwise output previous arcThe center of a circle and the radius parameter;
and 8, finishing the fitting until the last point of the fitting is finished.
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 true CN113111404A (en) | 2021-07-13 |
CN113111404B CN113111404B (en) | 2023-07-14 |
Family
ID=76712868
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
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 |
CN202310025796.5A Pending CN116627086A (en) | 2021-03-30 | 2021-03-30 | Space continuous small line segment arc fitting method |
Family Applications After (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) | CN113111404B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114850549A (en) * | 2022-04-28 | 2022-08-05 | 成都航空职业技术学院 | Method for machining blade based on four-axis linkage machining center |
CN115854832A (en) * | 2022-11-18 | 2023-03-28 | 国网四川省电力公司达州供电公司 | Method for calculating included angle error of workpieces forming two-dimensional included angles |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5793380A (en) * | 1995-02-09 | 1998-08-11 | Nec Corporation | Fitting parameter determination method |
CN107329458A (en) * | 2017-07-10 | 2017-11-07 | 深圳市旗众智能自动化有限公司 | A kind of dynamic self-adapting speed prediction control method of continuous small line segment track |
CN108062073A (en) * | 2016-11-08 | 2018-05-22 | 沈阳高精数控智能技术股份有限公司 | A kind of circular arc smooth compression interpolation algorithm for high quality processing |
US20180210981A1 (en) * | 2017-01-24 | 2018-07-26 | Tsinghua University | Method for designing hybrid surface optical system |
CN109270892A (en) * | 2018-08-31 | 2019-01-25 | 天津大学 | A kind of least square helix approximate algorithm of non-circular curve in NC machining |
CN109571473A (en) * | 2018-12-03 | 2019-04-05 | 武汉工程大学 | A kind of small line segment track method for fairing that error is controllable |
CN111310106A (en) * | 2020-01-19 | 2020-06-19 | 浙江工业大学 | B spline fitting optimization method based on successive approximation of original contour |
-
2021
- 2021-03-30 CN CN202110342697.0A patent/CN113111404B/en active Active
- 2021-03-30 CN CN202310025796.5A patent/CN116627086A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5793380A (en) * | 1995-02-09 | 1998-08-11 | Nec Corporation | Fitting parameter determination method |
CN108062073A (en) * | 2016-11-08 | 2018-05-22 | 沈阳高精数控智能技术股份有限公司 | A kind of circular arc smooth compression interpolation algorithm for high quality processing |
US20180210981A1 (en) * | 2017-01-24 | 2018-07-26 | Tsinghua University | Method for designing hybrid 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 |
CN109270892A (en) * | 2018-08-31 | 2019-01-25 | 天津大学 | A kind of least square helix approximate algorithm of non-circular curve in NC machining |
CN109571473A (en) * | 2018-12-03 | 2019-04-05 | 武汉工程大学 | A kind of small line segment track method for fairing that error is controllable |
CN111310106A (en) * | 2020-01-19 | 2020-06-19 | 浙江工业大学 | B spline fitting optimization method based on successive approximation of original contour |
Non-Patent Citations (5)
Title |
---|
LI JIANGANG ET AL.: "Fitting of Continuous Line Segments with Arc Paths", 《2018 37TH CHINESE CONTROL CONFERENCE (CCC)》 * |
东梁: "嵌入式运动控制器若干关键技术的研究与实现", 《中国优秀硕士学位论文全文数据库工程科技I辑》 * |
东梁等: "连续轨迹平滑过渡控制算法研究", 《电子设计工程》 * |
曹德列等: "双圆弧及直线拟合技术及其在数控切割中的应用", 《机械设计与制造》 * |
林峰等: "一种小线段平滑过渡轨迹控制算法的实现", 《成都大学学报(自然科学版)》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114850549A (en) * | 2022-04-28 | 2022-08-05 | 成都航空职业技术学院 | Method for machining blade based on four-axis linkage machining center |
CN114850549B (en) * | 2022-04-28 | 2024-02-23 | 成都航空职业技术学院 | Method for machining blades based on four-axis linkage machining center |
CN115854832A (en) * | 2022-11-18 | 2023-03-28 | 国网四川省电力公司达州供电公司 | Method for calculating included angle error of workpieces forming two-dimensional included angles |
CN115854832B (en) * | 2022-11-18 | 2024-01-26 | 国网四川省电力公司达州供电公司 | Included angle error calculation method for workpieces with two-dimensional included angles |
Also Published As
Publication number | Publication date |
---|---|
CN113111404B (en) | 2023-07-14 |
CN116627086A (en) | 2023-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109571473B (en) | Error-controllable small line segment trajectory fairing method | |
Bi et al. | A general, fast and robust B-spline fitting scheme for micro-line tool path under chord error constraint | |
US6044309A (en) | Three-dimensional machining method and recording medium stored with a three-dimensional machining control program | |
CN113111404A (en) | Fitting method for circular arc and straight line of small continuous spatial line segment | |
Sun et al. | A real-time and look-ahead interpolation methodology with dynamic B-spline transition scheme for CNC machining of short line segments | |
CN106826829A (en) | A kind of industrial robot fairing trace generator method of Controllable Error | |
CN109976262B (en) | Global curvature continuous fairing method for micro-line segment processing | |
CN108073138B (en) | Elliptical arc smooth compression interpolation algorithm suitable for high-speed high-precision machining | |
Li et al. | Generating tool-path with smooth posture change for five-axis sculptured surface machining based on cutter’s accessibility map | |
CN110716497B (en) | Registration method based on plane reference constraint and margin constraint | |
CN112525133B (en) | Method for converting normal tolerance into polar radius tolerance | |
CN112947298A (en) | Method, system and terminal for optimally generating curved surface machining track of robot | |
CN111633668B (en) | Motion control method for robot to process three-dimensional free-form surface | |
CN113276130A (en) | Free-form surface spraying path planning method and system based on point cloud slice | |
CN108196511B (en) | Error prediction method for turning track of spiral cutter | |
CN114019910A (en) | Real-time global fairing method for small-line-segment tool path | |
CN109491321B (en) | Contour error estimation method based on H-shaped precision motion platform | |
CN109697272B (en) | Simple quadratic B-spline curve fitting method | |
CN115937468A (en) | Automatic generation method for machining program of countless-module robot | |
CN113093645B (en) | Soft controller continuous small line segment track preprocessing method | |
CN114967597A (en) | Curve fitting method for guaranteeing numerical control machining tool path G2 continuity based on bidirectional Taylor | |
CN113515091B (en) | Real-time track interpolation method and device for corner smoothing spline | |
CN113467376B (en) | Multi-axis track compression method for multiple processing scenes | |
CN111880480B (en) | Milling cutter cutting path generation method and system based on CNC milling machine | |
CN112347585B (en) | Analytical calculation method for contact area between ball end mill and workpiece |
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 |