Commit Graph

91 Commits

Author SHA1 Message Date
Kevin O'Connor c5a9d7914b extruder: Make sure to flush steps during sync_stepper()
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>
2021-02-26 20:11:39 -05:00
Kevin O'Connor 611b76369f winch: Improve python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-17 22:54:16 -05:00
Kevin O'Connor c8434ec54b kinematics: Calculate axis_minimum/axis_maximum in advance
Calculate the get_status() axis_minimum and axis_maximum fields in
advance so that they don't need to be calculated on each get_status()
call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-08 11:52:28 -05:00
Janar Sööt e68cf08d15 kinematics: report all axis limits (min/max)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2020-12-28 10:19:57 -05:00
Kevin O'Connor 08adecd226 homing: Prefer printer.command_error() instead of homing.CommandError()
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>
2020-09-04 12:10:36 -04:00
Kevin O'Connor f6dd97b784 homing: Remove EndstopError
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>
2020-09-04 11:41:57 -04:00
Kevin O'Connor 1f3a160f47 toolhead: Add a move.move_error() helper
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>
2020-09-03 16:22:54 -04:00
Kevin O'Connor 4115a77342 gcode: Automatically call reset_last_position() on a toolhead set_position()
Generate a "toolhead:set_position" event on a call to
toolhead.set_position() and use that event to automatically call
gcode.reset_last_position().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-08-20 21:03:22 -04:00
Arksine 3eefc037c5 polar: fix limit_z default value
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-06 14:31:42 -04:00
Voron 9213646c63
corexz: Add CoreXZ kinematics (#3129)
Add a CoreXZ kinematics

Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
2020-07-30 12:42:23 -04:00
Kevin O'Connor 739e6e7396 extruder_stepper: Don't directly access extruder member variables
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>
2020-06-06 14:41:15 -04:00
Kevin O'Connor 787ed452c2 klippy: Rename try_load_module() to load_object()
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>
2020-05-08 11:05:14 -04:00
Kevin O'Connor 9b6010dc7b extruder: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 6869611147 cartesian: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor 17123889f6 heaters: Make heater.py an "extras" module
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>
2020-04-25 14:26:45 -04:00
Kevin O'Connor d858498a53 heater: Move M105 command handling from gcode.py to heater.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-25 14:26:28 -04:00
Kevin O'Connor 9e8c4770ed rotary_delta: The get_status() method should take eventtime parameter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-04-20 22:36:00 -04:00
Kevin O'Connor 77177582cd extruder: step_distance must be positive on SET_EXTRUDER_STEP_DISTANCE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-28 10:06:02 -04:00
Kevin O'Connor 336af2f28d stepper: No need to pass stepper_kinematics to set_step_dist()
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>
2020-03-28 10:06:02 -04:00
David Smith d4bf61262e
Extruder: Add g-code to set extruder step_distance (#2598)
Signed off by: David Smith <davidosmith@gmail.com>
2020-03-28 09:52:46 -04:00
David Smith c0f72a2c38
safe_z_home: Support note_z_not_homed() in kinematics (#2500)
Signed-off-by: David Smith <davidosmith@gmail.com>
2020-03-01 23:00:41 -05:00
Kevin O'Connor 2ea3631222 delta: Add print_radius option to customize valid XY radius
Add ability to override the default XY move checking radius.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-23 21:14:09 -05:00
Kevin O'Connor 8ed0f7c5c3 kinematics: Remove support for identifying Z steppers
The caller can now determine which steppers are connected to cartesian
Z movement via the new stepper.is_active_axis() method.  It is
therefore no longer necessary for the kinematic code to identify these
steppers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-23 20:47:01 -05:00
Kevin O'Connor ac863a95b6 rotary_delta: Initial support for rotary delta kinematics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:52:42 -05:00
Kevin O'Connor 97d976fc53 stepper: Track if using units of radians instead of millimeters
The STEPPER_BUZZ command needs to know if the axis is using radians
instead of millimeters so that it can move a more appropriate
distance.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:49:41 -05:00
Kevin O'Connor bcf10aa990 delta: Simplify DeltaCalibration state tracking
Limit the use of coordinate descent "params".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:41:09 -05:00
Kevin O'Connor 27e6b533bc delta: Move low-level delta calibration to delta.py
Move the linear delta specific calibration code from
delta_calibrate.py to delta.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:41:09 -05:00
Simo Apell 90bc1679a2 extruder_stepper: Initial support for synchronized extruder steppers
Signed-off-by: Simo Apell <simo.apell@live.fi>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:03:05 -05:00
Kevin O'Connor 4b6a65c1e0 heater: Do not flush look-ahead queue on a heater temperature update
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>
2020-01-03 18:13:57 -05:00
Kevin O'Connor d9cd524aec extruder: No need to track extrude_pos locally
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-17 02:01:54 -05:00
Kevin O'Connor 46e7027bc7 extruder: Flush step generation on ACTIVATE_EXTRUDER
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-17 01:59:06 -05:00
Kevin O'Connor f4c4de1a24 extruder: Move M104/M140 commands from gcode.py to extruder.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-16 20:16:21 -05:00
Kevin O'Connor fcee27fc19 gcode: Remove builtin T0/T1/T2/... command support
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>
2019-12-10 14:24:32 -05:00
Kevin O'Connor c06618193d extruder: Add an ACTIVATE_EXTRUDER command
Add support for an extended g-code command to change the currently
active extruder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-10 14:23:13 -05:00
Kevin O'Connor 080ee0b512 kin_extruder: Apply pressure advance in kin_extruder.c
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>
2019-12-08 20:41:35 -05:00
Kevin O'Connor 3683273936 toolhead: Report which axes are homed via get_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-24 20:21:13 -05:00
Kevin O'Connor 282af0220e toolhead: Report the current extruder from the get_status() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-24 20:21:13 -05:00
Kevin O'Connor 89d1ab7c04 extruder: Remove support for lookahead() method
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>
2019-11-21 13:18:21 -05:00
Kevin O'Connor 5f5896ad71 extruder: Add support for instantaneous corner velocity
Add mechanism to perform look-ahead between moves with different
extrusion ratios.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:18:21 -05:00
Kevin O'Connor 6d0c55b6c1 extruder: Initial support for "smoothed pressure advance"
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>
2019-11-21 13:18:19 -05:00
Kevin O'Connor d00023f3bb toolhead: Support step generation in lead up to and after stepper activity
Add support for kinematic functions that calculate step times based on
a range of the motion queue.  This requires adding additional pause
times when fully flushing the motion queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor 2843c85019 toolhead: Rename _full_flush() to flush_step_generation() and use globally
Update code that modifies the low-level kinematics handlers to first
call toolhead.flush_step_generation().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:17:45 -05:00
Kevin O'Connor d38aed0773 cartesian: Report dual_carriage_rails from get_steppers()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-15 12:32:04 -05:00
Kevin O'Connor 224574da4a stepper: Add get/set_tag_position() and convert calc_position()
Rename calc_position() to calc_tag_position() and have it calculate
the value of the position from the last stepper set_tag_position()
call.  This enables the calc_tag_position() code to be more flexible
as it can be run with arbitrary positions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:00:17 -05:00
Kevin O'Connor 0a39c339c7 gcode: Remove explicit active extruder tracking
There's no need to have special logic in gcode.py to track the active
extruder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 11:02:26 -05:00
Kevin O'Connor a4995c61c9 stepper: Remove add_to_endstop() method
Now that the PrinterStepper and MCU_stepper classes have been merged,
there is no need for the add_to_endstop() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 17:32:18 -05:00
Kevin O'Connor bfb34e0701 stepper_enable: Move motor_off() logic to stepper_enable.py
Directly disable all the stepper motors on a global motor_off() from
the StepperEnable() class in stepper_enable.py.  This simplifies the
toolhead and kinematic classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-12 17:32:18 -05:00
Kevin O'Connor ed610a6600 extruder: Consistently use "extruder" for the primary extruder
No longer allow the primary extruder to be named "extruder0".  This
avoids internal and external confusion between the printer objects and
config section names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 16:28:47 -05:00
Kevin O'Connor 5500538fc5 toolhead: Rename register_move_handler() to register_step_generator()
Rename the function so it is more clear what the step generation code
path is.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 10:59:35 -05:00
Kevin O'Connor 2981bd601b extruder: Treat extrude with Z only movement to be an "extrude only" move
Do not apply max_extrude_cross_section check, and do apply
extrude_only_xxx checks to Z only moves that also extrude.  Some
printer start scripts will prime the extruder while moving the Z.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 09:45:36 -05:00