Summary of the invention
The object of the invention is to overcome the defect that existing trace tracking method amount of calculation is large, computational speed is slow, thereby a kind of robot mechanical arm end orbit tracking of high speed is provided.
To achieve these goals, the invention provides a kind of tracking method for mechanical arm tail end trajectory of robot, comprising:
Step 1), the arm end movement locus of the predefined robot of user is represented by mathematical form; This movement locus representing by mathematical form is arranged in joint space;
Step 2), according to application scenarios and the step 1 of the kinetics equation of robot, robot) in the predefined arm end movement locus of user set up object function and constraint equation; Function in described object function, constraint equation can be converted into convex function;
Step 3), by by step 2) function in the object function, the constraint equation that obtain is all converted to convex function, form the Optimized model of a convex programming, after the Optimized model of described convex programming is done to discretization, solve, obtain the amount of exercise in each joint of robot;
Step 4), by step 3) each joint motions amount driven machine people of robot of obtaining.
In technique scheme, described 1) comprising:
Step 1-1), the arm end movement locus of the predefined robot of user is represented by the arc length parameters in cartesian space:
Step 1-2), end orbit in cartesian space that arc length parameters is represented is converted to the joint motions track that arc length parameters represents.
In technique scheme, described object function is:
Wherein, s represents arc length parameters, and L+1 represents the quantity of key point, p
lrepresent l key point,
be illustrated in p
lon the value of arc length parameters s,
represent to expect that robot end is arrived the time of l key point by l-1 key point,
be respectively first derivative and the second dervative of s;
Described constraint equation is:
τ(s)=M(s)a(s)+C(s)b(s)+G(s)
b′(s)=2a(s)
b(s)≥0
The s span of above-mentioned formula is [0,1]
Wherein, τ is joint power,
τ(s),
represent respectively minimum, maximum that joint power allows; M is the mass matrix of positive definite; C is the matrix relevant to Coriolis force and centrifugal force; G represents gravity;
f(s),
represent respectively the maximum of angular speed square, minimum of a value and the maximum of joint angle acceleration; F (s), h (s) are two functions about s.
In technique scheme, in described step 3) in, described object function is converted to convex function and comprises:
Step 3-1-1), described object function is converted to an object function and a constraint equation:
Step 3-1-2), by step 3-1-1) object function that obtains combines with constraint equation and other existing constraint equation, the Optimized model of composition one convex programming.
In technique scheme, in described step 3) in, the Optimized model of described convex programming is done after discretization and solves and comprise:
Step 3-2-1), arc length parameters s is carried out to uniform sampling, obtain discrete variable (s
0, s
1... s
k);
Step 3-2-2), according to step 3-2-1) function relevant with arc length parameters s carries out discretization in K+1 discrete variable the obtaining Optimized model that is described convex programming, forms the Optimized model of the convex programming after discretization.
In technique scheme, in described step 3) in, adopt a kind of Optimized model to the convex programming after discretization in second order cone planning, Subgradient sciagraphy, interior point method to solve.
In technique scheme, described amount of exercise comprises discrete speed, acceleration and the moment in joint.
The invention has the advantages that:
1, computational speed is fast, efficiency is high.
2, simple to user's demand, user-friendly.
3, there is good autgmentability.
Detailed description of the invention
Below in conjunction with the drawings and specific embodiments, the present invention is illustrated.
Because the shooting industry practitioners such as director generally do not possess the professional knowledge of robot motion's control field, therefore user can only provide rough essential information conventionally, these information comprise that the predefined robot mechanical arm end of user is (for shooting robot, the end of its manipulator is video camera) running orbit, comprise: the key point that video camera will arrive in the time of motion, arrive the time of these key points, and the attitude of video camera on key point position etc.Before shooting, be the schematic diagram of the predefined movement locus of shooting robot as provided user in Fig. 1.Utilize these information can not directly control shooting robot according to predefined orbiting motion, what method of the present invention will be done is exactly the running orbit according to predefined robot mechanical arm, the acceleration in each joint of robot obtains making a video recording, in meeting the constraint of each joint and the key point constraint time of advent, make the movement locus of actual motion under the control of these joint acceleration as far as possible consistent with movement locus given in advance.This arm end that how to make robot moves along path given in advance with specific attitude, and the problem of specified point is exactly the track following problem of mentioning in the application in specific time point arrives path given in advance.Before the present invention is elaborated, first basic concepts involved in the present invention is described.
Convex programming: convex programming is that a class is fairly simple, and there is the Non-Linear Programming of some good natures.The feasible zone of convex programming is convex set, and its local minimum point is exactly global minimum point, and convex set of all formations of local minimum point.In the time that the object function of convex programming is strictly convex function, its global minimum point is unique.
The canonical form of convex programming is:
s.t.g
i(x)≤0,i=1,…m
h
i(x)=0,i=1,…p
Wherein, f (x), g
i(x) be convex function, h
i(x) be affine function.
The related content of convex programming can be referring to:
http://en.wikipedia.org/wiki/Convex_optimization。
Joint space and cartesian space: in industrial robot, be useful on the joint coordinate system of describing joint motions, be useful on and describe the position of robot end and the end cartesian coordinate system of attitude.Suppose that robot has n the free degree, joint of robot coordinate is n-dimensional space so, is referred to as joint space.Generally, end cartesian coordinate system is described by three-dimensional translating and Three dimensional rotation, is referred to as cartesian space.
The related notion in the present invention being done on the basis of above-mentioned explanation, below in conjunction with Fig. 2, just describe for the related embodiment that realizes the inventive method.
Step 1), predefined user movement locus is represented by mathematical form.
In general, the shooting robot that is applicable to the inventive method can provide a personal-machine interactive interface to user, and as touch-screen, user can draw needed movement locus on this Man Machine Interface.The movement locus that this interface receives is illustrated in cartesian space, in the present embodiment, the movement locus of these cartesian spaces is converted into the mathematical form representing by arc length parameters, as B-spline curves, and Bei Saier curve.
How movement locus is expressed as to general knowledge known in this field with mathematical way, at bibliography 1: in " Xiao Shutie chief editor " algebraically and how much " (Higher Education Publishing House, 2003 July the 2nd edition) ", this is also described in detail.
Step 2), movement locus according to the predefined moving track calculation of user shooting robot in joint space.
In robot kinematics, to the mapping robot end's position and attitude, be called the direct kinematics of robot by the coordinate of joint of robot coordinate system.To the mapping the coordinate of joint of robot coordinate system, be called inverse kinematics by robot end's position and attitude.Obviously, the predefined movement locus of user is exactly shooting robot position and attitude endways, and therefore by the predefined moving track calculation shooting of user robot, the movement locus in joint space belongs to inverse kinematics.Predefined user movement locus can be transformed into joint space from cartesian space according to inverse kinematics method well known in the prior art, thus the movement locus that obtains being represented by arc length parameters in joint space.
How utilizing inverse kinematics method to solve joint space movement locus can be referring to bibliography 2: " " sophisticated machine people's control " that Tan Min etc. write (Higher Education Publishing House, 2007 May the 1st edition) ".
Step 3), set up the kinetics equation of this robot according to the structure of robot.
The free degree of supposing shooting robot is n; The joint angles of shooting robot is q, and joint angle speed is
joint angle acceleration is
(R
nrepresent n dimension real number space); Joint power is τ, τ ∈ R
n; The kinetics equation of robot is expressed as follows:
Wherein, M (q) ∈ R
n × nfor the mass matrix of positive definite,
for the matrix relevant to Coriolis force and centrifugal force, F
s(q) ∈ R
n × nfor frictional force, G (q) represents gravity.In this application, frictional force is ignored.
In this step, the related implementation method of setting up robot dynamics's equation is also known in those skilled in the art, at bibliography 3: have a detailed description in " L.Sciavicco and B.Siciliano; Modeling and Control of Robot Manipulators.New York:McGraw-Hill, 1996 ".
Step 4), according to step 2) movement locus of the predefined robot mechanical arm end of user that obtains, and the Optimized model being made up of object function and constraint equation is set up in constraint and the constraint of each mechanics of the constraint of the motion initial point being obtained by the application scenarios of robot, motion distal point.In this step, the constraint of related mechanics comprises step 3) robot dynamics's equation of setting up, each joint velocity max min, acceleration max min, the max min of each joint drive power.
Step 5), by step 4) generate Optimized model be converted into convex programming, then it is solved, to obtain the amount of exercise in each joint of robot.
Because the conventional method for solving to the Optimized model being generated by object function and constraints is slower, and the solution of trying to achieve may not necessarily ensure global optimum, therefore, solves after needing that in this step described Optimized model is converted into convex programming again.
Step 6), using step 5) amount of exercise in each joint of obtaining is as input, actuated camera device people motion, can obtain the manipulator track that user requires.
Below to step 4) in particular content be described further.
Step 41), set up optimized object function.
Because the manipulator running orbit of shooting robot need to arrive given critical path point in the given time.So in optimizing process using the error of each key point time of advent as the object function of optimizing.When optimization, make object function optimization, just should make this object function as much as possible close to zero.Object function, close to zero, illustrates that running orbit conformed to expection through the time of each path key point.
Step 42), add constraints.
Each joint motions speed, acceleration constraint and each joint moment of considering the manipulator of shooting robot all have certain limit, therefore add these contents as the constraints of optimizing in Optimized model, obtain constraint equation.In addition, the motion of shooting robot need to meet kinetics equation, and therefore the kinetics equation of robot also will join in the middle of constraint equation.
According to step 41) and step 42) object function and the constraints set up, can obtain following Optimized model, the mathematic(al) representation of described Optimized model is as follows:
τ(s)=M(s)a(s)+C(s)b(s)+G(s) (3)
b′(s)=2a(s) (6)
b(s)≥0 (7)
The s span of above-mentioned formula is [0,1]
Wherein, s represents arc length parameters,
the first derivative and the second dervative that are respectively s, L+1 represents the quantity of key point, p
lrepresent l key point,
be illustrated in p
lon the value of arc length parameters s,
represent to expect that robot end is arrived the time of l key point by l-1 key point,
τ(s),
represent respectively minimum, maximum that joint power allows.
f(s),
represent respectively the maximum of angular speed square, minimum of a value and the maximum of joint angle acceleration.F (s), h (s) are two functions about s.
In each mathematic(al) representation of above-mentioned Optimized model, the object function that mathematic(al) representation (2) is mentioned before representing; Mathematic(al) representation (3) is the robot dynamics's equation as constraints; Mathematic(al) representation (4), (5) are the constraint of velocity of robot initial point, distal point; Mathematic(al) representation (6), (7) can be by
derivation obtains:
be b (s)>=0.The constraint that mathematic(al) representation (8), (9) they are the shooting each joint velocity of robot and acceleration, and derivation is as follows:
The angular speed constraint in i joint is:
Order
by the angular speed constraint writing vector form in each joint, just can obtain Mathematical representation (8).
The angular acceleration in i joint is constrained to:
Order
by the angular speed constraint writing vector form in each joint, just can obtain Mathematical representation (9).
In the above-mentioned derivation of equation, b ' (s),
represent that respectively b (s) asks single order partial derivative and t is differentiated s; q
i(s),
represent respectively angle, angular speed and the angular acceleration in i joint;
represent minimum of a value, the maximum of i joint angle speed,
represent respectively minimum of a value, the maximum of i joint angle acceleration; q
i '(s), q
i "(s) represent q
i(s) s is asked to single order, second-order partial differential coefficient.
Above-mentioned Optimized model is unconverted front Optimized model, is therefore labeled as Optimized model (I).
Because the object function in Optimized model (I) is non-convex function, so Optimized model (I) belongs to nonconvex programming.In view of the advantage of the convex programming mentioned before, in step 5) in need Optimized model to be converted into convex programming, then carry out discretization and obtain discrete Convex Programming Model.Below this step is described further.
Step 51), first, the object function of above-mentioned optimization is replaced as follows
Thereby obtain new Optimized model
τ(s)=M(s)a(s)+C(s)b(s)+G(s)
In above-mentioned formula, l gets respectively following numerical value: 1 ... L
b′(s)=2a(s)
b(s)≥0
In above-mentioned formula, s span is [0,1]
Function in object function and constraint equation in Optimized model after above-mentioned conversion is all convex function, so above-mentioned Optimized model is convex programming.This Optimized model is designated as to Optimized model (II).
Step 52), Optimized model is converted into after convex programming, Optimized model (II) is carried out to discretization below.
First, be K section by the running orbit uniform discrete of shooting robot, obtain K+1 discrete variable.Mention, in the present embodiment, the running orbit of shooting robot represents with arc length parameters s, (the s for discrete variable that therefore generated before
0, s
1... s
k) represent.
Then, in the Optimized model (II) that is aforementioned convex programming according to the K+1 that obtained a before discrete variable, the function relevant with arc length parameters s carries out discretization, forms the Optimized model of the convex programming after discretization.
Specifically, the function relevant with arc length parameters s being carried out to discretization comprises:
A), to object function
use trapezoid formula to calculate definite integral, obtain
this result of calculation is equivalent to
Trapezoid formula calculates definite integral can be referring to document 4: " Guan Ye Lu Jin Pu compiles " foundation of numerical analysis " (Higher Education Publishing House, 1998 May the 1st edition) ".
B), mention before,
it represents the input signal for controlling shooting robot motion, thus suppose that it is jump function as shown in Figure 3, and
for piecewise linear function as shown in Figure 4, therefore b (s) sectional is expressed as following linear function:
Further, constraint in Optimized model (II)
in integration item at [s
k, s
k+1] can analytical Calculation obtain:
Based on foregoing description, after Optimized model (II) discretization, obtain following convex programming:
s.t.τ
k=m(s
k)a
k+c(s
k)s
k+g(s
k) (15)
(b
k+1-b
k)=2a
k(s
k+1-s
k) (18)
b
k≥0andb
K≥0 (19)
f(s
k+1/2)≤f(s
k+1/2)a
k+h(s
k+1/2)b
k+1/2 (21)
In above-mentioned formula, k gets respectively following numerical value: 0 ... K-1
In above-mentioned formula, l gets respectively following numerical value: 0 ... L-1
In above-mentioned formula, x
k(x can be a, b, τ, s), x
k+1represent respectively the value of x at k, a k+1 discrete point, use x
k+1/2represent the value of x at k, k+1 discrete point intermediate point, x
0, x
krepresent the value of x at initial point, distal point place; k
lik
lefor
,
corresponding discrete series number.The above-mentioned Convex Programming Model through discretization is designated as Optimized model (III).
Step 53), the Optimized model of convex programming is solved.
Owing to being Convex Programming Model through the Optimized model of changing, therefore can adopt the general non-linear instrument that solves to solve to this model.In the present embodiment, above-mentioned Optimized model can be converted into second order cone planning, then use the solver realization that solves specially second order cone planning to solve more effectively and rapidly.But in other embodiments, also can adopt methods such as Subgradient sciagraphy, interior point method the Optimized model that is converted into Convex Programming Model is solved.Optimized model is solved to discrete speed b, acceleration a, the moment τ that obtained result is each joint.
In the above-mentioned embodiment about shooting robot, function in object function and constraint equation can be converted to convex function, therefore the Optimized model being formed by object function and constraint equation can be converted to Convex Programming Model, then utilize the characteristic of Convex Programming Model to carry out rapid solving.In other embodiments, method of the present invention also goes for the arm end track following of other types robot, as long as the constraint function in object function and the constraint equation of these robots also can be converted to convex function.
The invention has the advantages that:
1, the inventive method, in Optimization Solution process, is converted into Convex Programming Model by Optimized model, utilizes the feature of Convex Programming Model to realize effectively, solution procedure efficiently.
2, the inventive method is used simply, as long as user provides a manipulator track can realize track following.
3, the inventive method has good autgmentability, can in Optimized model, add other constraint function and object function.As long as constraint function and object function are convex functions, so new problem also can be solved effectively efficiently.
Based on above-mentioned advantage, utilize the method disclosed in the present, can solve effectively rapidly and obtain acceleration in each joint space, thereby control each joint motions, obtain accurate tracking director given trace, and meet each Joint mechanics constraint.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described.Although the present invention is had been described in detail with reference to embodiment, those of ordinary skill in the art is to be understood that, technical scheme of the present invention is modified or is equal to replacement, do not depart from the spirit and scope of technical solution of the present invention, it all should be encompassed in the middle of claim scope of the present invention.