diff options
author | Frank Tackitt <im@frank.af> | 2022-03-01 13:04:08 -0700 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2022-06-03 14:12:04 -0400 |
commit | 89c59b035e93e87d2fc22010d7030dc86434ce03 (patch) | |
tree | a9c4f9573c19cf555c2dfd6eb6b5023158ec10ec /test | |
parent | 04952db1e8806a5efe27771d568ce66e9eb126f9 (diff) | |
download | kutter-89c59b035e93e87d2fc22010d7030dc86434ce03.tar.gz kutter-89c59b035e93e87d2fc22010d7030dc86434ce03.tar.xz kutter-89c59b035e93e87d2fc22010d7030dc86434ce03.zip |
exclude_objects: initial implementation
Adding Klipper functionality to support cancelling objects while
printing.
This module keeps track of motion in and out of objects and adjusts
movements as needed. It also tracks object status and provides that to
clients.
The Klipper module is relatively simple, and only provides one piece of
the workflow. Moonraker already supports processing uploaded files to
insert the required gcode markers for cancelling objects, using
https://github.com/kageurufu/cancelobject-preprocessor. This library is
also available as an executable for use in slicers, and pip
installations also include the script as a callable.
Mainsail has integrated support, and code changes for Fluidd are
available. Support in other interfaces is planned, and we've spoken to
several other developers about integrating frontend support in their
projects.
Signed-off-by: Troy Jacobson <troy.d.jacobson@gmail.com>
Co-authored-by: Franklyn Tackitt <git@frank.af>
Co-authored-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/klippy/exclude_object.cfg | 117 | ||||
-rw-r--r-- | test/klippy/exclude_object.test | 126 |
2 files changed, 243 insertions, 0 deletions
diff --git a/test/klippy/exclude_object.cfg b/test/klippy/exclude_object.cfg new file mode 100644 index 00000000..54041fa2 --- /dev/null +++ b/test/klippy/exclude_object.cfg @@ -0,0 +1,117 @@ +[stepper_x] +step_pin: PF0 +dir_pin: PF1 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^PE5 +position_endstop: 0 +position_max: 200 +homing_speed: 50 + +[stepper_y] +step_pin: PF6 +dir_pin: !PF7 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^PJ1 +position_endstop: 0 +position_max: 200 +homing_speed: 50 + +[stepper_z] +step_pin: PL3 +dir_pin: PL1 +enable_pin: !PK0 +microsteps: 16 +rotation_distance: 8 +endstop_pin: ^PD3 +position_endstop: 0.5 +position_max: 200 + +[extruder] +step_pin: PA4 +dir_pin: PA6 +enable_pin: !PA2 +microsteps: 16 +rotation_distance: 33.5 +nozzle_diameter: 0.500 +filament_diameter: 3.500 +heater_pin: PB4 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK5 +control: pid +pid_Kp: 22.2 +pid_Ki: 1.08 +pid_Kd: 114 +min_temp: 0 +max_temp: 210 + +[heater_bed] +heater_pin: PH5 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK6 +control: watermark +min_temp: 0 +max_temp: 110 + +[mcu] +serial: /dev/ttyACM0 + +[printer] +kinematics: cartesian +max_velocity: 300 +max_accel: 3000 +max_z_velocity: 5 +max_z_accel: 100 + +# Test config for exclude_object +[exclude_object] + +[gcode_macro M486] +gcode: + # Parameters known to M486 are as follows: + # [C<flag>] Cancel the current object + # [P<index>] Cancel the object with the given index + # [S<index>] Set the index of the current object. + # If the object with the given index has been canceled, this will cause + # the firmware to skip to the next object. The value -1 is used to + # indicate something that isn’t an object and shouldn’t be skipped. + # [T<count>] Reset the state and set the number of objects + # [U<index>] Un-cancel the object with the given index. This command will be + # ignored if the object has already been skipped + + {% if 'exclude_object' not in printer %} + {action_raise_error("[exclude_object] is not enabled")} + {% endif %} + + {% if 'T' in params %} + EXCLUDE_OBJECT RESET=1 + + {% for i in range(params.T | int) %} + EXCLUDE_OBJECT_DEFINE NAME={i} + {% endfor %} + {% endif %} + + {% if 'C' in params %} + EXCLUDE_OBJECT CURRENT=1 + {% endif %} + + {% if 'P' in params %} + EXCLUDE_OBJECT NAME={params.P} + {% endif %} + + {% if 'S' in params %} + {% if params.S == '-1' %} + {% if printer.exclude_object.current_object %} + EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object} + {% endif %} + {% else %} + EXCLUDE_OBJECT_START NAME={params.S} + {% endif %} + {% endif %} + + {% if 'U' in params %} + EXCLUDE_OBJECT RESET=1 NAME={params.U} + {% endif %} diff --git a/test/klippy/exclude_object.test b/test/klippy/exclude_object.test new file mode 100644 index 00000000..9abcc45e --- /dev/null +++ b/test/klippy/exclude_object.test @@ -0,0 +1,126 @@ +DICTIONARY atmega2560.dict +CONFIG exclude_object.cfg + + +G28 +M83 + +M486 T3 + +M486 S0 + G0 X10 + +M486 S-1 + G0 X0 + +M486 S1 + G0 X11 +M486 C + +# "Prime" the transform +G1 X140 E0.5 +G1 X160 E0.5 +G1 X140 E0.5 +G1 X160 E0.5 +G1 X140 E0.5 +G1 X160 E0.5 +G1 X140 E0.5 + +M486 S-1 + G0 X0 + +M486 S2 + G0 X13 + +M486 S0 + G0 X10 + +M486 S-1 + G0 X0 + +M486 S1 + G0 X-11 + +M486 S-1 + G0 X0 + +M486 S2 + G0 X13 + +M486 P2 +EXCLUDE_OBJECT + +M486 S0 + G0 X10 + +M486 S-1 + G0 X0 + +M486 S1 + G0 X-11 + +M486 S-1 + G0 X0 + +M486 S2 + G0 X-13 + +M486 U2 +EXCLUDE_OBJECT + +M486 S0 + G0 X10 + +M486 S-1 + G0 X0 + +M486 S1 + G0 X-11 + +M486 S-1 + G0 X0 + +M486 S2 + G0 X13 + +M486 P0 +M486 P1 +M486 P2 +EXCLUDE_OBJECT + +M486 S0 + G0 X-10 + +M486 S-1 + G0 X0 + +M486 S1 + G0 X-11 + +M486 S-1 + G0 X0 + +M486 S2 + G0 X-13 + + +M486 S66 + G0 X66 + +M486 S-1 + G0 X0 + M486 P66 + +M486 S66 + G0 X-66 + +M486 T3 + +M486 S0 + G0 X10 + +M486 S1 + G0 X11 + +M486 S2 + G0 X13 |