aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper
Commit message (Collapse)AuthorAgeFilesLines
...
* stepcompress: Remove "queue append" abstractionKevin O'Connor2020-03-043-88/+35
| | | | | | | | | | The queue_append system predates the iterative solver - it was useful when many different kinematic functions directly added steps to the step compression queues. With the iterative solver being the only source of step generation, it is simpler to directly add steps from the iterative solver code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Support notification of when a command is processedKevin O'Connor2020-02-203-13/+52
| | | | | | | | | Add ability for the host code to get a notification when the ack for a command sent to the micro-controller is received. This is in preparation for improved detection of message loss between mcu and host. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Remove unused serialqueue_encode_and_send() functionKevin O'Connor2020-02-202-19/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Fix rounding error when interval=0Kevin O'Connor2020-01-251-2/+2
| | | | | | | | | In the rare case where the step generation code finds an interval of zero, it was possible for an integer division of a negative number to cause an incorrect result. Fix that by using the idiv_up() and idiv_down() helpers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Add ability to query the active_flags stateKevin O'Connor2020-01-233-0/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rotary_delta: Initial support for rotary delta kinematicsKevin O'Connor2020-01-062-2/+81
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Export itersolve_calc_position_from_coord()Kevin O'Connor2020-01-063-1/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_extruder: Convert pressure advance to use "weighted average"Kevin O'Connor2019-12-201-19/+54
| | | | 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>
* itersolve: Improve numerical stability of gen_steps_pre_active checkKevin O'Connor2019-12-101-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Rename scan_pre/_post to gen_steps_pre/post_activeKevin O'Connor2019-12-103-9/+10
| | | | | | Rename the variables to make it a little more clear what they do. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_extruder: Apply pressure advance in kin_extruder.cKevin O'Connor2019-12-082-60/+25
| | | | | | | | Implement the pressure advance calculations while performing the definitive integral calculations. This simplifies both the extruder.py and kin_extruder.c code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_extruder: Move integration code from trapq.c to kin_extruder.cKevin O'Connor2019-12-083-67/+65
| | | | | | | Move the code that calculates the definitive integral to the kin_extruder.c file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Fix potential backwards time in itersolve_gen_steps_range()Kevin O'Connor2019-12-021-2/+4
| | | | | | | Make sure that a newly choosen "high" bound is always greater than the "low" bound. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Initial support for "smoothed pressure advance"Kevin O'Connor2019-11-212-60/+47
| | | | | | | Support averaging the extruder position over a time range to "smooth out" the velocity changes that occur during pressure advance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Add trapq_find_move() functionKevin O'Connor2019-11-212-0/+22
| | | | | | | 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-212-1/+51
| | | | | | | 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>
* itersolve: Support step generation in lead up to and after stepper activityKevin O'Connor2019-11-212-6/+28
| | | | | | | | | | | Add support for generating steps from kinematic functions that calculate step times based on a range of the motion queue. It requires scanning for step generation during the lead up to stepper activity (when the stepper would nominally be idle). And it requires scanning for step generation just after a stepper has nominally become idle. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Implement sentinel nodes on the trapq listKevin O'Connor2019-11-213-17/+55
| | | | | | | 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>
* stepper: Remove set_commanded_position() callKevin O'Connor2019-11-133-8/+7
| | | | | | | | Now that the only caller to set_commanded_position() is set_position(), remove the set_commanded_position() method and pass the set_position() call directly to the itersolve.c code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Improve numerical stability of itersolve_generate_steps() loopKevin O'Connor2019-11-081-11/+10
| | | | | | | Minor rework of the loop to reduce the chance that numerical stability could cause an infinite loop. 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>
* chelper: Report an error if the C host code does not compileKevin O'Connor2019-11-071-1/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Calculate and store axes_r in move classKevin O'Connor2019-11-063-13/+5
| | | | | | | | 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-064-70/+84
| | | | | | | | 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-065-30/+35
| | | | | | | 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>
* itersolve: Remove unused gen_steps()Kevin O'Connor2019-11-063-11/+1
| | | | | | | Eliminate the old gen_steps() call now that all callers have been converted to the newer trapq based generate_steps(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Convert step generation to use trapq systemKevin O'Connor2019-11-061-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* winch: Convert step generation to use trapq systemKevin O'Connor2019-11-061-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* polar: Convert step generation to use trapq systemKevin O'Connor2019-11-061-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Convert step generation to use trapq systemKevin O'Connor2019-11-061-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* corexy: Convert step generation to use trapq systemKevin O'Connor2019-11-061-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Convert step generation to use trapq systemKevin O'Connor2019-11-061-4/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Add support for generating steps from a trapqKevin O'Connor2019-11-063-7/+109
| | | | | | | Support associating a stepper_kinematics with a trapq. Support generating steps from a time range on the given trapq. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Initial support for building a queue of trapezoidal velocity movesKevin O'Connor2019-11-063-0/+63
| | | | | | | | 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>
* list: Add additional list helper functionsKevin O'Connor2019-11-061-0/+18
| | | | | | | Add list_is_first, list_is_last, list_last_entry, and list_prev_entry helper functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Add new trapq.c file with code for trapezoidal velocity handlingKevin O'Connor2019-11-0611-126/+142
| | | | | | Move the "struct move" code from itersolve.c to new file trapq.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* polar: Implement bed angle wrapping adjustments in chelper codeKevin O'Connor2019-11-063-2/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Rename calc_position to calc_position_cbKevin O'Connor2019-11-068-20/+20
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Fix possible infinite loop in itersolve_gen_steps()Kevin O'Connor2019-11-061-1/+3
| | | | | | | | If the kinematic position calculation function had an error in it (if it produces sudden position changes) then it could lead to an infinite loop in itersolve_gen_steps(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Remove no longer needed stepcompress_set_homing()Kevin O'Connor2019-07-103-22/+3
| | | | | | | Now that homing is implemented via "drip moves", it is no longer necessary for the stepcompress code to have special homing logic. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* polar: Add initial support for multiple bed rotationsKevin O'Connor2019-06-281-3/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Wrap code to 80 columnsKevin O'Connor2019-02-272-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Wrap code to 80 columnsKevin O'Connor2019-02-271-3/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Wrap code to 80 columnsKevin O'Connor2019-02-271-3/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* winch: Add experimental support for cable winch kinematicsKevin O'Connor2018-12-242-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* polar: Experimental support for polar kinematicsKevin O'Connor2018-12-242-2/+49
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Add a quick __main__ to compile c helper (#782)lf2018-10-161-0/+4
| | | Signed-off-by: Lucas Fink <software@lfcode.ca>
* serialqueue: Increase receive message debug queue to 100 messagesKevin O'Connor2018-09-021-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Support calculating a stepper position from a cartesian coordinateKevin O'Connor2018-07-183-8/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>