aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/trapq.c
Commit message (Collapse)AuthorAgeFilesLines
* toolhead: Keep stepcompress move history relative to current time (#6439)Francois Chagnon2023-12-301-6/+4
| | | | | Expire history relative to current time rather than last move in history queue Signed-off-by: Francois Chagnon <fc@francoischagnon.net>
* trapq: Minor code movement in trapq.cKevin O'Connor2023-01-071-48/+48
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Prune interrupted moves from history on trapq_set_position()Kevin O'Connor2021-08-061-1/+16
| | | | | | | | It is possible for a homing move to not fully complete. Fixup the trapq history to make processing of the history easier for callers. Similarly, do not add artificial "null" moves to the trapq history. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Store toolhead.set_position() updates in trapq historyKevin O'Connor2021-07-291-0/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Keep history of recent trapq movesKevin O'Connor2021-07-291-3/+52
| | | | | | | Store trapq moves in a separate "history" list after each move is nominally expired. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Rename trapq_free_moves() to trapq_finalize_moves()Kevin O'Connor2021-07-291-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Limit the duration of "null" sentinal moves on the trapqKevin O'Connor2019-12-201-1/+7
| | | | | | | | | If a null move is added as the first move on the trapezoid motion queue then it could have a very large move->move_t value. This could cause numerical stability issues with some advanced kinematic formulas. Place a limit on the move_t value to avoid this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_extruder: Move integration code from trapq.c to kin_extruder.cKevin O'Connor2019-12-081-65/+0
| | | | | | | Move the code that calculates the definitive integral to the kin_extruder.c file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Add trapq_find_move() functionKevin O'Connor2019-11-211-0/+21
| | | | | | | Add support for finding a move by time in the trapezoidal velocity move list. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Add code to calculate definitive integralKevin O'Connor2019-11-211-0/+44
| | | | | | | 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>
* trapq: Implement sentinel nodes on the trapq listKevin O'Connor2019-11-211-3/+45
| | | | | | | 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>
* trapq: Use C99 method for declaring struct members in trapq_append()Kevin O'Connor2019-11-071-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Calculate and store axes_r in move classKevin O'Connor2019-11-061-11/+3
| | | | | | | | 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>
* trapq: Use separate 'move' entries for accel, cruise, and decel phasesKevin O'Connor2019-11-061-41/+43
| | | | | | | | 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>
* trapq: Remove move_fill()Kevin O'Connor2019-11-061-11/+13
| | | | | | | 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>
* trapq: Initial support for building a queue of trapezoidal velocity movesKevin O'Connor2019-11-061-0/+46
| | | | | | | | 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>
* trapq: Add new trapq.c file with code for trapezoidal velocity handlingKevin O'Connor2019-11-061-0/+87
Move the "struct move" code from itersolve.c to new file trapq.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>