aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* stepcompress: Allow stepcompress_alloc() to be called earlyKevin O'Connor2018-06-201-3/+4
| | | | | | Don't require an mcu connection to allocate the stepcompress object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Move cartesian and delta kinematics code to their own C filesKevin O'Connor2018-06-201-12/+24
| | | | | | | Move the cartesian and delta specific code to new files kin_cartesian.c and kin_delta.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Compile with gcc -fwhole-program optionKevin O'Connor2018-06-201-4/+3
| | | | | | | Use the -fwhole-program option when compiling the host C code. This makes it easier to support inlining across C files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Limit message transmission to available receive buffer sizeKevin O'Connor2018-05-281-1/+4
| | | | | | | | | If the mcu is using a traditional serial port, then only send a new message block if there is space available in the mcu receive buffer. This should make it significantly less likely that high load on the mcu will result in retransmits. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Fix hub-ctrl compilationcruwaller2018-05-051-1/+1
| | | | Signed-off-by: Petri Honkala <cruwaller@gmail.com>
* chelper: Move the host C code to a new klippy/chelper/ directoryKevin O'Connor2018-04-301-0/+137
Move the C code out of the main klippy/ directory and into its own directory. This reduces the clutter in the main klippy directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>