The trajectory planner calculates incrementally (recursive). Each cycle (sample time) it calculates next point, so it never knows the time needed for the travel.
To know that, the generator should calculate the entire trajectory before outputing the first point (a priori), this is computational time and memory consuming, so not implemented.
Suppose you have a long travel (for example 10s) and very high sampling rate (1ms), then you would require to store 10000 points in memory.
Now let's suppose, you calculate just the travel time, and then you calculate the entire trajectory again, recursively. This would take a lot of time to calculate, so making synchronised moves for multi axis system is not possible anymore.
A synchronised move has at least two axis, that you have to synchronise. Each axis has a dedicated traj, planner. The input setpoints are:
- target position
- at the very first time it also needs the axis actual position that is copied as planner actual position. Note that planner actual position \$\neq\$ axis position. The planner is calculated open loop, no physical feedback is allowed except for starting point.
- setpoint velocity
- setpoint acceleration/deceleration
The planner outputs :
- done signal (when position = target position)
The planner has to retain values for position and actual velocity, next position point is calculated with regard to constraints of setpoint velocity and setpoint acc/dec. For each recursion it has also to calculate the distance to go (target position - actual position) and required path for coast to a standstill = breaking distance. If the breaking distance => distance to go, then the planner starts to compute the coasting trajectory.
At each recursion you begin with actual position = position