aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics/extruder.py
Commit message (Collapse)AuthorAgeFilesLines
* extruder: Allow dynamic adjustment of pressure advance (#6635)Dmitry Butyugin2024-07-111-4/+7
| | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* extruder: Remove deprecated commands and configKevin O'Connor2024-02-151-30/+1
| | | | | | | | Remove the deprecated SET_EXTRUDER_STEP_DISTANCE and SYNC_STEPPER_TO_EXTRUDER commands. Remove the deprecated shared_heater config option. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Keep stepcompress move history relative to current time (#6439)Francois Chagnon2023-12-301-3/+3
| | | | | Expire history relative to current time rather than last move in history queue Signed-off-by: Francois Chagnon <fc@francoischagnon.net>
* Revert "toolhead: Use dict for step generation flush times. (#6303)"Kevin O'Connor2023-10-211-1/+5
| | | | | | | | | | This reverts commit 6749985302fe002a9cb5672dab9badb11e4e3c36. A defect was found in the above commit (the input shaper code calls note_step_generateion_scan_time() for many steppers, so the input_shaper class can't be used as the index). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Use dict for step generation flush times. (#6303)Viesturs Zariņš2023-10-191-5/+1
| | | | | Makes the API to extruder and input shaper more robust, avoiding the need to track the old delay. Signed-off-by: Viesturs Zariņš <viesturz@gmail.com>
* extruder: store currently sync'ed motion queue namePedro Lamas2023-02-091-1/+5
| | | | Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* extruder: Add extruder name to extruder_stepper respond message (#6020)CODeRUS2023-02-031-2/+4
| | | Signed-off-by: Andrei Kozhevnikov <coderusinbox@gmail.com>
* extruder_stepper: Support configuring pressure advance from configDmitry Butyugin2022-09-011-4/+4
| | | | | | | Also added status report for extruder_stepper objects with the current pressure advance parameters values. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* extruder: Verify trapq is unmodified on default SET_PRESSURE_ADVANCEKevin O'Connor2022-03-041-0/+3
| | | | | | | | | Check that a SET_PRESSURE_ADVANCE without an explicit EXTRUDER parameter isn't done after the user disables or reassociates the extruder stepper motor (via SYNC_EXTRUDER_MOTION). Otherwise, it could lead to very confusing results. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Allow an extruder object to be created without a stepperKevin O'Connor2022-03-041-7/+16
| | | | | | | This may be useful for dual hotend printers that have only one stepper. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Deprecate old extruder commands and shared_heater config optionKevin O'Connor2022-02-101-0/+1
| | | | | | | | | | | Deprecate SET_EXTRUDER_STEP_DISTANCE and SYNC_STEPPER_TO_EXTRUDER. Recommend using SET_EXTRUDER_ROTATION_DISTANCE and SYNC_EXTRUDER_MOTION. Deprecate the extruder "shared_heater" option and reocmmend using extruder_stepper config sections to obtain the same functionality. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add new SYNC_EXTRUDER_MOTION commandKevin O'Connor2022-02-101-0/+8
| | | | | | | This command is a rename of SYNC_STEPPER_TO_EXTRUDER. This change is in preparation for the removal of SYNC_STEPPER_TO_EXTRUDER. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add support for reversing the direction of extruder stepper movementKevin O'Connor2022-02-101-1/+12
| | | | | | | Extend SET_EXTRUDER_ROTATION_DISTANCE to support reversing the direction of extruder movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add a SET_EXTRUDER_ROTATION_DISTANCE commandKevin O'Connor2022-02-101-9/+22
| | | | | | | | Support altering the extruder distance using the higher-level rotation_distance. This is in preparation for removal of the SET_EXTRUDER_STEP_DISTANCE command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Support disassociating a stepper from all extrudersKevin O'Connor2022-01-161-2/+5
| | | | | | | Support SYNC_STEPPER_TO_EXTRUDER commands with an EXTRUDER parameter set to an empty string. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Support SYNC_STEPPER_TO_EXTRUDER on extruder objectsKevin O'Connor2022-01-161-8/+23
| | | | | | | | | | Refactor the extruder_stepper support so that it uses the ExtruderStepper class defined in extruder.py. Support the SYNC_STEPPER_TO_EXTRUDER command on steppers defined in either extruder_stepper or extruder config sections. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Separate extruder stepper tracking to new ExtruderStepper classKevin O'Connor2022-01-161-75/+97
| | | | | | | Move the stepper handling (including pressure advance handling) to a new class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Don't store pressure_advance value in trapq movesKevin O'Connor2022-01-161-6/+7
| | | | | | | | | Store the pressure_advance value in "struct extruder_stepper" instead of in the trapq's "struct move". This makes it possible for multiple stepper motors to have different pressure advance values while still using the same trapq. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add mcu_to_commanded_position() methodKevin O'Connor2021-08-221-1/+2
| | | | | | | Convert stepper.get_past_commanded_position() to the more general stepper.mcu_to_commanded_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add get_trapq() methodKevin O'Connor2021-07-291-0/+4
| | | | 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>
* extruder: expose `can_extrude` flag based on temperatureKamil Trzcinski2021-06-141-0/+1
| | | | | | | | | Sometimes an automated filament load is implemented, but extruder might not always extrude filament. This adds a flag to check if this operation is possible. Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
* stepper: Improve get_past_commanded_position()Kevin O'Connor2021-05-291-3/+1
| | | | | | | | Pass a print_time instead of a clock to get_past_commanded_position(). Fix calculation on steppers that home and use an inverted direction pin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Do not set min_stop_interval in micro-controllerKevin O'Connor2021-04-301-1/+0
| | | | | | | | The min_stop_interval safety check is fragile and leads to a notable amount of complexity. Avoid these issues by not programming this safety check. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Support looking up an extruder position from a past timeKevin O'Connor2021-03-131-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Make sure set_temp() command wakes up the idle_timeoutKevin O'Connor2021-03-051-4/+2
| | | | | | | | | Introduce a heaters.set_temperature() command and call that from commands that set a heater temperature. This new function calls toolhead.register_lookahead_callback() so that the idle_timeout gets notification that activity has occurred. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Make sure to flush steps during sync_stepper()Kevin O'Connor2021-02-261-0/+2
| | | | | | | | The stepper positions will only be in sync after the step generation code has been flushed. This fixes an "internal error in stepcompress" error during a SYNC_STEPPER_TO_EXTRUDER command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Prefer printer.command_error() instead of homing.CommandError()Kevin O'Connor2020-09-041-2/+4
| | | | | | | Update callers to use the printer.command_error reference instead of directly using homing.CommandError() when raising or catching errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Remove EndstopErrorKevin O'Connor2020-09-041-3/+3
| | | | | | | There's no reason to distinguish between an EndstopError and a CommandError, so just use CommandError. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Add a move.move_error() helperKevin O'Connor2020-09-031-2/+1
| | | | | | | Move the EndstopMoveError() code from homing.py to a new method in the toolhead Move class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder_stepper: Don't directly access extruder member variablesKevin O'Connor2020-06-061-2/+4
| | | | | | | | Rework extruder.get_trapq() into extruder.sync_stepper() so that extruder_stepper.py does not need to directly access the extruder internals. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Rename try_load_module() to load_object()Kevin O'Connor2020-05-081-1/+1
| | | | | | | | Rename try_load_module() so that it uses consistent naming for "printer objects". Change the function to raise an error by default if the specified module does not exist. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-32/+28
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Make heater.py an "extras" moduleKevin O'Connor2020-04-251-4/+4
| | | | | | | The heater logic is an independent module that does not need to be treated as part of the "core" klipper code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Move M105 command handling from gcode.py to heater.pyKevin O'Connor2020-04-251-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: step_distance must be positive on SET_EXTRUDER_STEP_DISTANCEKevin O'Connor2020-03-281-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: No need to pass stepper_kinematics to set_step_dist()Kevin O'Connor2020-03-281-5/+5
| | | | | | | Also, no need to log in stepper.py as the update is already logged in extruder.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Extruder: Add g-code to set extruder step_distance (#2598)David Smith2020-03-281-0/+17
| | | Signed off by: David Smith <davidosmith@gmail.com>
* extruder_stepper: Initial support for synchronized extruder steppersSimo Apell2020-01-061-0/+2
| | | | | Signed-off-by: Simo Apell <simo.apell@live.fi> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heater: Do not flush look-ahead queue on a heater temperature updateKevin O'Connor2020-01-031-4/+2
| | | | | | | | | The print_time parameter of heater.set_temp() is not currently used and it isn't necessary to flush the look-ahead queue just get the print_time. Remove the parameter from heater.set_temp() to avoid flushing the look-ahead queue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: No need to track extrude_pos locallyKevin O'Connor2019-12-171-4/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Flush step generation on ACTIVATE_EXTRUDERKevin O'Connor2019-12-171-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Move M104/M140 commands from gcode.py to extruder.pyKevin O'Connor2019-12-161-1/+28
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Remove builtin T0/T1/T2/... command supportKevin O'Connor2019-12-101-13/+0
| | | | | | | | The builtin Tn command is not sufficiently flexible to control some multi-extruder printers. Remove the command and encourage users to define individual gcode_macros for each Tn instance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add an ACTIVATE_EXTRUDER commandKevin O'Connor2019-12-101-0/+13
| | | | | | | Add support for an extended g-code command to change the currently active extruder. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_extruder: Apply pressure advance in kin_extruder.cKevin O'Connor2019-12-081-15/+12
| | | | | | | | 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>
* toolhead: Report the current extruder from the get_status() methodKevin O'Connor2019-11-241-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Remove support for lookahead() methodKevin O'Connor2019-11-211-4/+0
| | | | | | | Now that the extruder lookahead method is no longer used it can be removed from the toolhead and extruder classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add support for instantaneous corner velocityKevin O'Connor2019-11-211-22/+13
| | | | | | | Add mechanism to perform look-ahead between moves with different extrusion ratios. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Initial support for "smoothed pressure advance"Kevin O'Connor2019-11-211-90/+46
| | | | | | | 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>