aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* input_shaper: Factored out AxisInputShaper classDmitry Butyugin2021-10-261-3/+2
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* input_shaper: Define input shapers in a single place in Python codeDmitry Butyugin2021-10-261-14/+4
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* stepcompress: Pass clock to stepcompress_set_last_position()Kevin O'Connor2021-08-061-1/+1
| | | | | | | | | Using sc->last_step_clock for the last position marker does not work properly, because the stepper.py code calls stepcompress_reset() prior to calling stepcompress_set_last_position(). Fix by passing an explicit clock to stepcompress_set_last_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Support extracting stepcompress historyKevin O'Connor2021-07-291-0/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Store toolhead.set_position() updates in trapq historyKevin O'Connor2021-07-291-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Keep history of recent trapq movesKevin O'Connor2021-07-291-0/+9
| | | | | | | 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-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kinematics: Add dual_carriage to hybrid-corexyz (#4296)Tircown2021-06-271-0/+1
| | | | | | | - Add dual_carriage abilities for hybrid-corexy and hybrid-corexz - Introduce the module idex_mode - Fix add_stepper to the correct rail in hybrid-corexy Signed-off-by: Fabrice GALLET <tircown@gmail.com>
* trdispatch: Support fast responses to trsync_state messagesKevin O'Connor2021-06-091-4/+18
| | | | | | | Add C code that can process trsync_state messages and dispatch responses with low-latency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgblock: Add clock estimation helper functionsKevin O'Connor2021-06-091-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgblock: Move message manipulation code from serialqueue.c to new msgblock.cKevin O'Connor2021-06-091-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pollreactor: Move C pollreactor code from serialqueue.c to its own fileKevin O'Connor2021-06-091-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Add support for tracking history of queue_step commandsKevin O'Connor2021-03-131-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Support sending messages over a CAN busKevin O'Connor2021-03-131-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Move logging_callback() to global scopeKevin O'Connor2021-03-011-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Extend number of available mcu messages from 96 to 128Kevin O'Connor2021-02-181-3/+3
| | | | | | | | | | | Some internal code treats the message ids as encoded "variable length quantities", while other internal code assumes the message id is always one byte long. Continue using this scheme, but convert the VLQ users to use the name "msgtag" while the 1-byte users use "msgid". Increase the number of available msgids from 96 to 127 - the higher values get encoded as negative "msgtags". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Fix check for failed code buildKevin O'Connor2021-02-071-2/+11
| | | | | | | Commit 73b78af6 inadvertently removed the check for a successful gcc compilation. Add the check back in. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Use standard C type definition for pyhelper_logging_callbackKevin O'Connor2020-09-261-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Rework check for building C codeKevin O'Connor2020-09-261-22/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Set compiler flags to never use "x387" floating point mathKevin O'Connor2020-09-151-7/+18
| | | | | | | | | The default on X86 32bit machines is to use 80bit floating point math (as found in the ancient "387 coprocessor"). This can cause numerical stability problems. Set the compiler flags to make sure the newer SSE math is always used on X86. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* corexz: Add CoreXZ kinematics (#3129)Voron2020-07-301-7/+11
| | | | | Add a CoreXZ kinematics Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
* input_shaper: Initial support of input shaping (#3032)Dmitry Butyugin2020-07-051-2/+24
| | | | | | Input shaping can help to reduce printer vibrations due to resonances and eliminate or reduce ghosting in prints. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* serialqueue: Support notification of when a command is processedKevin O'Connor2020-02-201-1/+3
| | | | | | | | | 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>
* itersolve: Add ability to query the active_flags stateKevin O'Connor2020-01-231-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rotary_delta: Initial support for rotary delta kinematicsKevin O'Connor2020-01-061-2/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Export itersolve_calc_position_from_coord()Kevin O'Connor2020-01-061-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_extruder: Apply pressure advance in kin_extruder.cKevin O'Connor2019-12-081-2/+2
| | | | | | | | 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>
* extruder: Initial support for "smoothed pressure advance"Kevin O'Connor2019-11-211-4/+2
| | | | | | | 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>
* stepper: Remove set_commanded_position() callKevin O'Connor2019-11-131-2/+1
| | | | | | | | 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>
* 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-061-1/+1
| | | | | | | | 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-1/+1
| | | | | | | | 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-4/+2
| | | | | | | 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-061-1/+0
| | | | | | | 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>
* itersolve: Add support for generating steps from a trapqKevin O'Connor2019-11-061-0/+5
| | | | | | | 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-061-0/+4
| | | | | | | | 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-9/+13
| | | | | | Move the "struct move" code from itersolve.c to new file trapq.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Remove no longer needed stepcompress_set_homing()Kevin O'Connor2019-07-101-1/+0
| | | | | | | 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>
* 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-241-2/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* polar: Experimental support for polar kinematicsKevin O'Connor2018-12-241-2/+8
| | | | 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>
* itersolve: Support calculating a stepper position from a cartesian coordinateKevin O'Connor2018-07-181-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Support setting the stepper position via a cartesian coordinateKevin O'Connor2018-06-221-0/+2
| | | | | | | | | Add support for an itersolve_set_position() function that sets a stepper position from a cartesian coordinate. This eliminates the need for both the python and C code to be able to translate from a cartesian coordinate to a stepper position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Move tracking of commanded position to itersolve codeKevin O'Connor2018-06-201-1/+2
| | | | | | | Track the commanded position in just the itersolve.c code instead of in mcu.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_cartesian: Remove stepcompress_push_const()Kevin O'Connor2018-06-201-4/+0
| | | | | | | All the kinematic code now uses the iterative solver to generate steps. Remove the old stepcompress_push_const() mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Convert to using iterative solverKevin O'Connor2018-06-201-2/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* corexy: Convert corexy to use the iterative solverKevin O'Connor2018-06-201-4/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Convert delta kinematics to use iterative solverKevin O'Connor2018-06-201-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Add kinematic iterative solver codeKevin O'Connor2018-06-201-4/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>