Commit Graph

11 Commits

Author SHA1 Message Date
Kevin O'Connor 45c232b2c7 trapq: Keep history of recent trapq moves
Store trapq moves in a separate "history" list after each move is
nominally expired.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor e2f483aea3 trapq: Rename trapq_free_moves() to trapq_finalize_moves()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor 730a6d868b kin_extruder: Move integration code from trapq.c to kin_extruder.c
Move the code that calculates the definitive integral to the
kin_extruder.c file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-08 18:30:42 -05:00
Kevin O'Connor da06e185fb trapq: Add trapq_find_move() function
Add support for finding a move by time in the trapezoidal velocity
move list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor a28b29993a trapq: Add code to calculate definitive integral
Support calculating the definitive integral of a cartesian axis
position over a time range of the movement queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor 4dbe795ac2 trapq: Implement sentinel nodes on the trapq list
Use sentinels to make list traversal code simpler.  Also add in null
moves so that there are no time gaps in the list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor 86121ff79e toolhead: Calculate and store axes_r in move class
Calculate the ratio of axis distance to total move distance (axis_d /
move_d) and store in a new member variable axes_r.  This avoids
needing to recalculate the value in other code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 076a66f791 trapq: Use separate 'move' entries for accel, cruise, and decel phases
Only track a single acceleration movement in a 'struct move' instance.
Break the classic trapezoid movement (accel, cruise, decel) into three
separate movements.  This simplifies the calculation logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 1acaaa98c2 trapq: Remove move_fill()
Now that all callers use the trapq system to queue moves, it is no
longer necessary to individually allocate and fill a 'struct move'.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor d3afe4f1d8 trapq: Initial support for building a queue of trapezoidal velocity moves
Add support for building a list of moves in the trapq.c code.  Update
the toolhead code so that moves generated from the look-ahead code are
added to that list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor fdbdb3c707 trapq: Add new trapq.c file with code for trapezoidal velocity handling
Move the "struct move" code from itersolve.c to new file trapq.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00