liba 0.1.15
An algorithm library based on C/C++
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
bell-shaped velocity trajectory
Collaboration diagram for bell-shaped velocity trajectory:

Data Structures

struct  a_trajbell
 instance structure for bell-shaped velocity trajectory More...
 

Typedefs

typedef struct a_trajbell a_trajbell
 

Functions

a_real a_trajbell_gen (a_trajbell *ctx, a_real jm, a_real am, a_real vm, a_real p0, a_real p1, a_real v0, a_real v1)
 generate for bell-shaped velocity trajectory
 
a_real a_trajbell_pos (a_trajbell const *ctx, a_real x)
 compute position for bell-shaped velocity trajectory
 
a_real a_trajbell_vel (a_trajbell const *ctx, a_real x)
 compute velocity for bell-shaped velocity trajectory
 
a_real a_trajbell_acc (a_trajbell const *ctx, a_real x)
 compute acceleration for bell-shaped velocity trajectory
 
a_real a_trajbell_jer (a_trajbell const *ctx, a_real x)
 compute jerk for bell-shaped velocity trajectory
 

Detailed Description

Function Documentation

◆ a_trajbell_acc()

a_real a_trajbell_acc ( a_trajbell const * ctx,
a_real x )

compute acceleration for bell-shaped velocity trajectory

p¨(t)={jmt,t[0,Taj]jmTaj=am,t[Taj,TaTaj]jm(Tat),t[TaTaj,Ta]0,t[Ta,Ta+Tv]jm(tT+Td),t[TTd,TTd+Tdj]jmTdj=dm,t[TTd+Tdj,TTdj]jm(Tt),t[TTdj,T]

Parameters
[in]ctxpoints to an instance of bell-shaped velocity trajectory
[in]xdifference between current time and initial time
Returns
acceleration output

◆ a_trajbell_gen()

a_real a_trajbell_gen ( a_trajbell * ctx,
a_real jm,
a_real am,
a_real vm,
a_real p0,
a_real p1,
a_real v0,
a_real v1 )

generate for bell-shaped velocity trajectory

If p0>p1, then

p0=p0p1=p1v0=v0v1=v1

  1. If (vmv0)jm<am2, the maximum acceleration is not reached, then

    Taj=vmv0jmTa=2Tajam=+jmTaj

    else

    Taj=amjmTa=Taj+vmv0amam=+am

  2. If (vmv1)jm<am2, the maximum deceleration is not reached, then

    Tdj=vmv1jmTd=2Tdjdm=jmTdj

    else

    Tdj=amjmTd=Tdj+vmv1amdm=am

  3. Calculate the constant velocity phase

    Tv=p1p0vmTa2(1+v0vm)Td2(1+v1vm)

    If Tv>0, then there is a constant velocity phase and the phase calculation ends.
  4. If Tv<=0, then Tv=0,

    Taj=Tdj=Tj=amjmTa=am2jm+Δ2v02amTd=am2jm+Δ2v12amΔ=am4jm2+2(v02+v12)+am(4(p1p0)2amjm(v0+v1))


    a. If Ta<0, there is only deceleration phase, then Ta=0, Taj=0,

    Td=2p1p0v1+v0Tdj=jm(p1p0)jm(jm(p1p0)2+(v1v0)(v1+v0)2)jm(v1+v0)

    b. If Td<0, there is only acceleration phase, then Td=0, Tdj=0,

    Ta=2p1p0v1+v0Taj=jm(p1p0)jm(jm(p1p0)2+(v0v1)(v1+v0)2)jm(v1+v0)

    c. If Ta2Tj, Td2Tj, then

    am=+jmTajdm=jmTdjvm=v0+(TaTaj)am=v1(TdTdj)dm

    d. If none of the above conditions are met, let am=αam,0<α<1, and then repeat step 4.
  5. Finally, use formulas to compute position, velocity and acceleration.
    Parameters
    [in,out]ctxpoints to an instance of bell-shaped velocity trajectory
    [in]jmdefines the maximum jerk during system operation
    [in]amdefines the maximum acceleration during system operation
    [in]vmdefines the maximum velocity during system operation
    [in]p0defines the initial position
    [in]p1defines the final position
    [in]v0defines the initial velocity
    [in]v1defines the final velocity
    Returns
    total duration

◆ a_trajbell_jer()

a_real a_trajbell_jer ( a_trajbell const * ctx,
a_real x )

compute jerk for bell-shaped velocity trajectory

p(3)(t)={jm,t[0,Taj]0,t[Taj,TaTaj]jm,t[TaTaj,Ta]0,t[Ta,Ta+Tv]jm,t[TTd,TTd+Tdj]0,t[TTd+Tdj,TTdj]jm,t[TTdj,T]

Parameters
[in]ctxpoints to an instance of bell-shaped velocity trajectory
[in]xdifference between current time and initial time
Returns
jerk output

◆ a_trajbell_pos()

a_real a_trajbell_pos ( a_trajbell const * ctx,
a_real x )

compute position for bell-shaped velocity trajectory

p(t)={p0+v0t+jmt36,t[0,Taj]p0+v0t+am6(3t33tTaj+Taj2),t[Taj,TaTaj]p0+(vm+v0)Ta2vm(Tat)+jm(Tat)36,t[TaTaj,Ta]p0+(vm+v0)Ta2+vm(tTa),t[Ta,Ta+Tv]p1(vm+v1)Td2+vm(tT+Td)jm(tT+Td)36,t[TTd,TTd+Tdj]p1(vm+v1)Td2+vm(tT+Td)+dm6(3(tT+Td)23(tT+Td)Tdj+Tdj2),t[TTd+Tdj,TTdj]p1v1(Tt)jm(Tt)36,t[TTdj,T]

Parameters
[in]ctxpoints to an instance of bell-shaped velocity trajectory
[in]xdifference between current time and initial time
Returns
position output

◆ a_trajbell_vel()

a_real a_trajbell_vel ( a_trajbell const * ctx,
a_real x )

compute velocity for bell-shaped velocity trajectory

p˙(t)={v0+jmt22,t[0,Taj]v0+am(tTaj2),t[Taj,TaTaj]vmjm(Tat)22,t[TaTaj,Ta]vm,t[Ta,Ta+Tv]vmjm(tT+Td)22,t[TTd,TTd+Tdj]vm+dm(tT+TdTdj2),t[TTd+Tdj,TTdj]v1+jm(Tt)22,t[TTdj,T]

Parameters
[in]ctxpoints to an instance of bell-shaped velocity trajectory
[in]xdifference between current time and initial time
Returns
velocity output