A Transition Method Based On Bezier Curve For Trajectory Planning in Cartesian Space
A Transition Method Based On Bezier Curve For Trajectory Planning in Cartesian Space
Abstract
In order to smooth the trajectory of a robot and reduce dwell time,a transition curve is intro-
duced between two adjacent curves in three-dimensional space. G2 continuity is guaranteed to transit
smoothly. To minimize the amount of calculation,cubic and quartic Bezier curves are both ana-
lyzed. Furthermore,the contour curve is characterized by a transition parameter which defines the
distance to the corner of the deviation. How to define the transition points for different curves is
presented. A general move command interface is defined for receiving the curve limitations and tran-
sition parameters. Then,how to calculate the control points of the cubic and quartic Bezier curves is
analyzed and given. Different situations are discussed separately,including transition between two
lines,transition between a line and a circle,and transition between two circles. Finally,the experi-
ments are carried out on a six degree of freedom ( DOF) industrial robot to validate the proposed
method. Results of single transition and multiple transitions are presented. The trajectories in the
joint space are also analyzed. The results indicate that the method achieves G2 continuity within the
transition constraint and has good efficiency and adaptability.
Key words: transition method,Bezier curve,G2 continuity,transition constraint
① Supported by the National Natural Science Foundation of China ( No. 61573358) and Research and Development of Large Multi-function Demo-
lition Equipment in Disaster Site( No. 2015BAK06B00) .
② To whom correspondence should be addressed. E-mail: shuo. wang@ ia. ac. cn
Received on May 17,2016
142 HIGH TECHNOLOGY LETTERS | Vol. 23 No. 2 | June 2017
Algorithm 1. TP AB here is short for“Transition Parame- The Bezier curve is a weighted average of each
ter”parameter of the MovL ( line AB) command. The control point. It begins at P0 and ends at P n . The Bezi-
lengths of line P3 C and line CP4 are calculated similar- er curve has the convex hull property,which means
ly. that the curve does not“undulate”more than the poly-
If the length of line AB and line BC are both lar- gon of its control points. For cubic Bezier curve ( n =
ger than 2·TP AB ,the length of line P1 B and line BP2 3) ,four control points are needed. For higher-order
are equal to TP AB . Otherwise,they are defined in terms curves,the amount of computation will be larger and
of the length of line AB and line BC. So,line BC may more intermediate points are needed.
have two different transition points or two overlapping The derivatives for a Bezier curve at C( 0) and
points. More examples are shown in Fig. 5. C( 1) are
C'( 0) = n( P1 - P0 )
( 3)
Algorithm 1 Calculation of Length ( P1 B) and Length ( BP2 ) C'( 1) = n( P n - P n -1 )
Input: Length( AB) ,Length( BC) ,TP AB The second derivatives are
Output: Length ( P1 B) ,Length ( BP2 ) C″( 0) = n( n - 1) ( P2 - 2P1 + P0 )
( 4)
1: if C″( 1) = n( n - 1) ( P n - 2P n -1 + P n-2 )
Length( AB) > 2·TP AB For G2 continuity,the adjacent curves share a
Length( BC) > 2·TP AB common tangent direction and a common center of cur-
then vature at the join point[3]. The curvature at C( 0) and
2: Length( P1 B) = TP AB C( 1) should be
3: else | C'( u) × C″( u) |
κ = ,u = { 0, 1} ( 5)
4: Length( P1 B) = min( Length( AB) ,
Length( BC) ) /2 | C'( u) | 3
5. end if Substituting Eq. ( 3) and Eq. ( 4) into Eq. ( 5)
6. Length( BP2 ) = Length( P1 B) yields
( n - 1) | ( P1 - P0 ) × ( P2 - P1 ) |
κ = ,u = 0
n | ( P1 - P0 ) | 3
( 6)
( n - 1) | ( P n - P n -1 ) × ( P n -2 - P n -1 ) |
κ = ,
n | ( P n - P n -1 ) | 3
u = 1 ( 7)
κ = 0,u = 0 ( 9)
point P4 are the transition points set by Algorithm 1.
k = 0,u = 1 Point P1 ,point P2 and point P3 are given as follows:
From Eqs( 6) ~ ( 9) ,point P1 and point P2 should
overlap at point B. Then,the transition Bezier curve is
given by point P0 ,point P1 ,point P2 ,and point P3 .
1) Point P2
Intuitively,in order to track the given trajectory,
point P2 should be around line AB or circle BC. For the
simplicity of calculation,point P2 is set at point B.
2) Point P3
Similar to Eq. ( 11) ,there exists:
Fig. 7 The transition between a line and a circle → →
OP4 ·P3 P4 = 0
( cubic Bezier curve) → → → ( 14)
OP3 ·( OB × OP4 ) = 0
From Eq. ( 7) and Eq. ( 12) ,
1) The transition curve should be tangent with
3
line AB and circle BC. | P4 - P3 | 2 = r | P2 - P3 | sin( α)
4
From Eq. ( 3) ,control point P1 should be on line
3
AB,and control point P2 should be on the tangent line = r2 ( 1 - cos( θ) ) ( 15)
4
of circle BC at point P3 . where α = ∠P2P3P4,θ = ∠P2OP4,0 < θ < 2pi.
→ →
P0 B × P0 P1 = 0 ( 10)
→ →
OP3 ·P2 P3 = 0 From Eq. ( 14) and Eq. ( 15) ,point P3 is ob-
→ → → ( 11)
OP2 ·( OB × OP3 ) = 0 tained.
2) The transition curve should have the same cur- 3) Point P1
vature with line AB and circle BC. From Eq. ( 6) ,Eq. ( 10) and Eq. ( 12) ,there
κ = 0,u = 0 are multiple solutions for point P1 . An optimization in-
( 12)
k = 1 / r,u = 1 dex can be added to obtain the optimal solution. One
where r is the radius of circle BC. answer is to add a constraint as Eq. ( 16) . Approxi-
From Eqs( 6) ,( 7) and Eqs( 10) ~ ( 12) ,point mately,ε means a measure of curvature. Thus to get
P1 and point P2 are defined. If point A,point B,point C the minimum of ε makes the transition curve bend at
and point O are coplanar,the solution is given as fol- least[15].
1
lows. Otherwise,there is no solution.
1) Point P2 is the intersection of line P0 P1 and
ε = ∫ C″( u) ·C″( u) du
0
( 16)
1) Point P2
Similar to Section 2. 3,point P2 is set at point B.
2) Point P3
Similar to Eq. ( 19) ,there exists:
→ →
O2P4·P4P3 = 0
→ → → ( 21)
O2P3 ·( O2 B × O2P4) = 0
From Eq. ( 7) and Eq. ( 20) ,
3
Fig. 9 The transition between two circles | P4 - P3 | 2 = r2 | P2 - P3 | sin( α2 )
( cubic Bezier curve) 4
3
= r22 ( 1 - cos( θ2) ) ( 22)
1) The transition curve should be tangent with 4
circle AB and circle BC. where α2 = ∠P2P3P4,θ2 = ∠P2O2P4,0 < θ2 <
From Eq. ( 3) ,control point P1 should be on the 2pi.
From Eq. ( 21) and Eq. ( 22) ,point P3 is ob-
tangent line of circle AB at point P0 ,and control point
tained.
P2 should be on the tangent line of circle BC at point
3) Point P1
P3 .
→ → Similar to Eq. ( 21) and Eq. ( 22) ,there exist:
O1P0·P0P1 = 0 → →
→ → → ( 18) O1P0·P0P1 = 0
O1P1 ·( O1 B × O1P0) = 0 → → → ( 23)
→ → O1P1 ·( O1 B × O1P0) = 0
O2P3·P3P2 = 0 3
→ → → ( 19) | P1 - P0 | 2 = r1 | P2 - P1 | sin( α1)
O2P2 ·( O2 B × O2P3) = 0 4
2) The transition curve should have the same cur- 3
= r21 ( 1 - cos( θ1) ) ( 24)
vature with circle AB and circle BC. 4
κ1 = 1 / r1,u = 0 where α1 = ∠P0 P1 P2 ,θ1 = ∠P0 O1 P2 ,0 < θ1 <
( 20)
k2 = 1 / r2,u = 1 2pi.
where r1 is the radius of circle AB,and r2 is the radius From Eq. ( 23) and Eq. ( 24) ,point P1 is ob-
of circle BC. tained.
From Eqs( 6) ,( 7) and Eqs( 18) ~ ( 20) ,point Then,the transition Bezier curve is given by point
P1 and point P2 are defined. However,it is difficult to P0 ,point P1 ,point P2 ,point P3 and point P4 .
obtain the analytical solutions here. Numerical method Mark 1 Although Figs6 ~ 10 illustrate conditions
146 HIGH TECHNOLOGY LETTERS | Vol. 23 No. 2 | June 2017
3 Experiments
Fig. 11 The control system of a six DOF robot Fig. 13 The transition between a line and a circle
( quartic Bezier curve)
To verify the feasibility of the transition method,
experiments are organized as follows.
Fig. 16 The velocity and acceleration of the trajectory Fig. 18 The joint angle corresponding to the trajectory with
with transition transition in Fig. 15 ( axis 1; axis 2; axis 3; axis 4;
axis 5; axis 6)
Fig. 17 The velocity and acceleration of the trajectory Fig. 19 The joint angle velocity corresponding to the trajectory
without transition with transition in Fig. 15 ( axis 1; axis 2; axis 3; axis
4; axis 5; axis 6)
S-curve-type acceleration profile is adopted for the ve-
locity and acceleration planning. The maximum veloci-
ty for each curve is 50 mm / s,max acceleration is 100
mm / s2 and maximum jerk is set to 200 mm / s3 . The
whole trajectory takes about 3. 57s. The velocity and
acceleration of the original trajectory without transition
are shown in Fig. 17. It is tested with the same veloci-
ty,acceleration and jerk constraints,and takes about
5. 48s. Obviously,the velocity of the trajectory with
transition is smoother and takes less time.
3. 3 Velocities in the joint space Fig. 20 The joint angle corresponding to the trajectory without
Since the trajectory of a robot is finally realized in transition in Fig. 15 ( axis 1; axis 2; axis 3; axis 4;
axis 5; axis 6)
the joint space,the position and velocity of each joint
are tested. When the robot moves along the trajectory
shown in Fig. 15,the position of each joint can be got 4 Conclusions
by inverse kinematics,and the velocity is the differen-
tial of position. Figs18 ~ 19 show the joint angle and It has been demonstrated that a single Bezier
velocity when transition mode is set to blending,and curve can be utilized to transit between lines and cir-
cles in three-dimensional space. In the transition be-
Figs20 ~ 21 show those without transition. The same
tween two lines,a cubic Bezier curve could satisfy the
result can be got that the trajectory with transition
moves smoother and takes less time. G2 continuity. In the transition between a line and a
circle,if the line is coplanar with the circle,a cubic
Bezier curve is able to transit smoothly. Otherwise,a
quartic Bezier curve is needed. A curvature constraint
148 HIGH TECHNOLOGY LETTERS | Vol. 23 No. 2 | June 2017