Module liba.trajtrap
trapezoidal velocity trajectory
Functions
new () | constructor for trapezoidal velocity trajectory |
gen (ctx, vm, ac, de, p0, p1[, v0[, v1]]) | generate for trapezoidal velocity trajectory |
pos (ctx, x) | calculate position for trapezoidal velocity trajectory |
vel (ctx, x) | calculate velocity for trapezoidal velocity trajectory |
acc (ctx, x) | calculate acceleration for trapezoidal velocity trajectory |
Functions
- new ()
-
constructor for trapezoidal velocity trajectory
Returns:
-
a.trajtrap
trapezoidal velocity trajectory userdata
- gen (ctx, vm, ac, de, p0, p1[, v0[, v1]])
-
generate for trapezoidal velocity trajectory
Parameters:
- ctx a.trajtrap trapezoidal velocity trajectory userdata
- vm number defines the maximum velocity during system operation
- ac number defines the acceleration before constant velocity
- de number defines the acceleration after constant velocity
- p0 number defines the initial position
- p1 number defines the final position
- v0 number defines the initial velocity (optional)
- v1 number defines the final velocity (optional)
Returns:
-
number
total duration
- pos (ctx, x)
-
calculate position for trapezoidal velocity trajectory
Parameters:
- ctx a.trajtrap trapezoidal velocity trajectory userdata
- x number difference between current time and initial time
Returns:
-
number
position output
- vel (ctx, x)
-
calculate velocity for trapezoidal velocity trajectory
Parameters:
- ctx a.trajtrap trapezoidal velocity trajectory userdata
- x number difference between current time and initial time
Returns:
-
number
velocity output
- acc (ctx, x)
-
calculate acceleration for trapezoidal velocity trajectory
Parameters:
- ctx a.trajtrap trapezoidal velocity trajectory userdata
- x number difference between current time and initial time
Returns:
-
number
acceleration output