Summary of the invention
Object of the present invention is intended at least solve one of described technological deficiency.
For this reason, the object of the invention is to propose a kind of space tracking smoothing method based on speed optimum control, the continuity of velocity attitude can be ensured, the end effector locus at any time of localization machine mechanical arm can be facilitated, be convenient to control.
To achieve these goals, embodiments of the invention provide a kind of space tracking smoothing method based on speed optimum control, comprise the steps:
Step S1, obtain starting point Ps, the mid point Pm of the space tracking that robot arm runs, terminal Pe, preset turning area radius r and parameter preset flag_dist, wherein, form the first simple track between described starting point Ps and mid point Pm, between described mid point Pm and terminal Pe, form the second simple track;
Step S2, the length of described default turning area radius r and the described first simple track and the described second simple track is compared, if described default turning area radius r does not exceed the half of the length of the described first simple track, and do not exceed the half of the length of the second described simple track, then perform step S3;
Step S3, the turning mode choosing described robot is that equal length is turned or equal time is turned, calculate the coordinate of the transition point M of the first and second simple intersection of locus formation, the described first and second simple tracks respectively with the coordinate of S and the E point of default circular intersection;
Step S4, the coordinate according to calculating S, M and E point sets up local coordinate system, calculates the equation of locus of the turning area of described space tracking under described local coordinate system, and wherein, described equation of locus is the conic section of level and smooth turning area.
Further, in described step S2, following formula is adopted to judge whether described default turning area radius r exceedes the half of the length of the described first simple track,
Wherein,
the vector being pointed to mid point Pm by starting point Ps,
it is the vector being pointed to terminal Pe by mid point Pm.
Further, in described step S3, when the turning mode chosen is equal length turning, calculates S, M and E point coordinates and comprise the steps:
According to equal length turning demand fulfillment
adopt vectorial stacking method, superposed respectively by the coordinate of mid point M
in both direction, length is the vector of r, starting point coordinate S, the terminal point coordinate E of turning area, wherein, mid point M is a Pm, calculates a S and E point coordinates as follows:
Further, in described step S3, when the turning mode chosen is equal time turning, comprise the steps:
According to equal time turning demand fulfillment t1=t2, wherein, t1 is SM section turning time, and t2 is ME section turning time,
t=mim(t
1,t
2),
Substitute into speed planning, calculate S, E point apart from M point distance dist
s, dist
e,
Further, in described step S4, the equation of locus of the turning area of the described space tracking of described calculating under described local coordinate system, comprises the steps:
Step S41, calculating coordinate change parameter θ and A, comprises the steps:
Wherein, θ is the angle that reference axis carries out rotation transformation, and A is spin matrix,
Step S42, derives vectorial coordinate
with
comprise the steps:
Wherein,
for
expression under described local coordinate system,
for
expression under described local coordinate system,
Step 43, the equation of locus y calculating the turning area of described space tracking under described local coordinate system is:
y=ax
2,
Wherein,
a is the parameter of the conic section that described equation of locus is corresponding,
o=S-As, O are the expression of coordinate originally under global coordinate system of described local coordinate system, are the translating sections in coordinate transformation process, s (x
s, y
s), m (xm, ym), e (x
e, y
e) be respectively starting point, intermediate point, the terminal point coordinate of turning area.
According to the space tracking smoothing method based on speed optimum control of the embodiment of the present invention, the conic section of robot arm running space track can be generated level and smooth turning area expression formula through coordinate transform, thus ensure the continuity of velocity attitude, by seamlessly transitting two straight paths, in conjunction with S type speed planning, obtain the turning scheme that acceleration, speed, displacement are level and smooth, track simple, intuitive, the end effector locus at any time of localization machine mechanical arm can be facilitated, be convenient to control.Simultaneously because track is simple conic section, therefore obstacle avoidance space easyly can be calculated.In addition, two kinds of turning demands when the present invention can adapt to equidistantly and wait, user according to actual conditions, can compare and chooses more excellent scheme easily.
The aspect that the present invention adds and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by practice of the present invention.
Detailed description of the invention
Be described below in detail embodiments of the invention, the example of embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Be exemplary below by the embodiment be described with reference to the drawings, be intended to for explaining the present invention, and can not limitation of the present invention be interpreted as.
The present invention carries a kind of space tracking smoothing method based on speed optimum control, utilize the smoothness properties of conic section, according to the radius of turn of two straight line path starting points, terminal and folded turning area, generate conic section, two straight line paths in smoothing junction, conic section is generated level and smooth turning area expression formula through coordinate transform, thus ensures the continuity of velocity attitude.
As shown in Figure 1, the space tracking smoothing method based on speed optimum control of the embodiment of the present invention, comprises the steps:
Step S1, obtains starting point Ps, the mid point Pm of the space tracking that robot arm runs, terminal Pe, presets turning area radius r and parameter preset flag_dist.Wherein, between starting point Ps and mid point Pm, form the first simple track, between mid point Pm and terminal Pe, form the second simple track.Parameter preset flag_dist takes equidistant parameter of turning when turning or wait, and turns when its value is 1 for equidistant, otherwise turning during for waiting.
Fig. 2 is the schematic diagram of the first and second simple tracks according to the embodiment of the present invention.
First the definition of turning area is described: the transition point M place formed at two simple intersection of locus take transition point as initial point, with a certain particular value R for radius does circle, intersect two simple tracks in S, E 2 point, by line segment SM, ME, the region that circular arc ES surrounds is turning area.With reference to figure 2, the starting point of the first simple track is Ps, and terminal is transition point M; The starting point of the second simple track is M, and terminal is Pe.First and second simple tracks are straight path.
Before starting to plan turning area track, the plane at simple track determination current path place need be intersected by two, and set up two dimensional surface and three-dimensional Coordinate Conversion equation, then determine the coordinate of each key point at two dimensional surface.Subsequent step carries out all on this plane.
Step S2, the length of default turning area radius r and the first simple track and the second simple track is compared, if preset the turning area radius r not half of the length of simple track more than first, and the half of the length of the do not exceed second simple track, then execution step S3.
In this step, following formula is adopted to judge to preset the turning area radius r whether half of the length of simple track more than first,
Wherein,
the vector being pointed to mid point Pm by starting point Ps, i.e. the simple track of first in former track,
the vector being pointed to terminal Pe by mid point Pm, i.e. the simple track of second in former track.
Step S3, the turning mode choosing robot is that equal length is turned or equal time is turned, calculate the coordinate of the transition point M of the first and second simple intersection of locus formation, the first and second simple tracks respectively with the coordinate of S and the E point of default circular intersection.
Particularly, according to starting point Ps, mid point Pm, terminal Pe, preset turning area radius r equidistantly plan or etc. time planning.Wherein, equidistant planning directly can be tried to achieve by radius of turn r.For planning when waiting, obtain the time of turning starting point to transition point by S type speed planning, calculate turning final position with this, obtain turning area starting and terminal point coordinate thus.That is, when the present invention can support to wait based on S type speed planning and simultaneously and equidistant two kinds of turning area algorithms planned.
Plan to equidistant planning with when waiting respectively below and be described.
When the turning mode chosen is equal length turning, calculates S, M and E point coordinates and comprise the steps:
Equal length mode is turned and is required that turning area starting point is equal to turning area terminal length to turning area intermediate point, turning area intermediate point, namely
according to equal length turning demand fulfillment
adopt vectorial stacking method, superposed respectively by the coordinate of mid point M (mid point M is a Pm)
in both direction, length is the vector of r, the coordinate of starting point S, the coordinate of terminal E of turning area.
When the turning mode chosen is equal time turning, comprise the steps:
Equal time turning mode requires that turning area starting point is equal to the turning area terminal used time to turning area intermediate point, turning area intermediate point, i.e. t1=t2, and wherein, t1 is SM section turning time, and t2 is ME section turning time,
t=min(t
1,t
2),(4)
Substitute into speed planning, calculate S, E point apart from M point distance dist
s, dist
s,
S, M, E tri-point coordinates calculated according to step S3, set up local coordinate system, solve under this problem being transferred to local coordinate system by coordinate transform, the equation of locus making the turning area of track under local coordinate system of trying to achieve is simple conic section.Below for calculating the solution procedure meeting the turning area curvilinear equation of smoothness condition.
Step S4, the coordinate according to calculating S, M and E point sets up local coordinate system, the equation of locus of the turning area of computer memory track under local coordinate system, i.e. turning area equation of locus.Wherein, equation of locus is the conic section of level and smooth turning area.
In algorithm flow, under local coordinate system is based upon to the statement of quadratic curve equation, mapped by linear transformation with global coordinate system.
Step S41, calculating coordinate change parameter θ and A, comprises the steps:
Wherein, θ is the angle that reference axis carries out rotation transformation, and A is spin matrix,
Step S42, derives vectorial coordinate
with
comprise the steps:
Wherein,
for
expression under local coordinate system,
for
expression under local coordinate system, coordinate transform can decoupling zero be translation and rotation two parts.For the conversion of vector, the translating sections of coordinate transform has been eliminated, only remaining rotating part, and the expression therefore under Two coordinate can be contacted directly by transformation matrix A.
Step S43, the equation of locus y of the turning area of computer memory track under local coordinate system is:
y=ax
2,
Wherein,
a is the parameter of the conic section that equation of locus is corresponding,
o=S-As, O are the expression of coordinate originally under global coordinate system of local coordinate system, are the translating sections in coordinate transformation process, s (x
s, y
s), m (x
m, y
m), e (x
e, y
e), be respectively the starting point of turning area, intermediate point, terminal point coordinate.
Fig. 3 is in accordance with another embodiment of the present invention based on the flow chart of the space tracking smoothing method of speed optimum control.
Step S301, input Ps, Pm, r, flag_dist.
Step S302, judges radius of turn, is no more than the half of arbitrary simple track.
Particularly, judge the turning area radius r not half of the length of simple track more than first, and the half of the length of the do not exceed second simple track,
Step S303, adopts equal length to turn tactful.
Equal length mode is turned and is required that turning area starting point is equal to turning area terminal length to turning area intermediate point, turning area intermediate point, namely
Step S304, adopts equal time to turn tactful.
Equal time turning mode requires that turning area starting point is equal to the turning area terminal used time to turning area intermediate point, turning area intermediate point, i.e. t1=t2.
It should be noted that, step S303 and step S304 can select an execution.
Step S305, obtains S, M, E tri-point coordinates.
Step S306, solves transformation matrix of coordinates.
Wherein,
Step S307, solves the local coordinate of SM, ME vector.
Wherein,
Step S308, derives parabola parameter by formula, each point coordinates, local coordinate system initial point relative coordinate.
Step S309, output trajectory parameter and coordinate conversion parameter.
y=·ax
2,
Wherein,
a is the parameter of the conic section that equation of locus is corresponding,
o=S-As, O are the expression of coordinate originally under global coordinate system of local coordinate system, are the translating sections in coordinate transformation process, s (x
s, y
s), m (x
m, y
m), e (x
e, y
e), be respectively the starting point of turning area, intermediate point, terminal point coordinate.
According to the space tracking smoothing method based on speed optimum control of the embodiment of the present invention, the conic section of robot arm running space track can be generated level and smooth turning area expression formula through coordinate transform, thus ensure the continuity of velocity attitude, by seamlessly transitting two straight paths, in conjunction with S type speed planning, obtain the turning scheme that acceleration, speed, displacement are level and smooth, track simple, intuitive, the end effector locus at any time of localization machine mechanical arm can be facilitated, be convenient to control.Simultaneously because track is simple conic section, therefore obstacle avoidance space easyly can be calculated.In addition, two kinds of turning demands when the present invention can adapt to equidistantly and wait, user according to actual conditions, can compare and chooses more excellent scheme easily.
In the description of this description, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, those of ordinary skill in the art can change above-described embodiment within the scope of the invention when not departing from principle of the present invention and aim, revising, replacing and modification.Scope of the present invention is by claims and equivalency thereof.