Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions meta-opencentauri/recipes-apps/klipper/files/macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ gcode:
gcode:
{% set global = printer['gcode_macro _global_var'] %}

{% if "xyz" not in printer.toolhead.homed_axes %}
G28 ; Home if necessary
{% if "xy" not in printer.toolhead.homed_axes %}
G28 XY ; Home if necessary
{% endif %}
# Move to purge position
MOVE_TO_TRAY
Expand Down Expand Up @@ -261,8 +261,8 @@ gcode:
{% set toolhead_target = printer.extruder.target|int %}
BED_MESH_CLEAR
M104 S{global.extruder_temp.cleaning}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% if "xy" not in printer.toolhead.homed_axes %}
G28 XY ; Home if necessary
{% endif %}
G90

Expand Down Expand Up @@ -305,8 +305,8 @@ gcode:

[gcode_macro MOVE_TO_TRAY]
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28 ; Home if necessary
{% if "xy" not in printer.toolhead.homed_axes %}
G28 XY ; Home if necessary
{% endif %}

{% if printer.gcode_move.position.x > 201.5 and printer.gcode_move.position.x < 202.5 and printer.gcode_move.position.y > 264.5 and printer.gcode_move.position.y < 265.5 %}
Expand Down Expand Up @@ -398,8 +398,8 @@ gcode:
RESPOND TYPE=command MSG="action:prompt_text Wait for hotend to heat up"
RESPOND TYPE=command MSG="action:prompt_show"

{% if "xyz" not in printer.toolhead.homed_axes %}
G28 ; Home if necessary
{% if "xy" not in printer.toolhead.homed_axes %}
G28 XY ; Home if necessary
{% endif %}

MOVE_TO_TRAY ; Move to the tray
Expand All @@ -416,23 +416,23 @@ gcode:

[gcode_macro UNLOAD_FILAMENT]
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28 ; Home if necessary
{% if "xy" not in printer.toolhead.homed_axes %}
G28 XY ; Home if necessary
{% endif %}
; Absolute positioning
CUT_FILAMENT ; Wait for movements to complete

MOVE_TO_TRAY
COLD_EXTRUDE HEATER=extruder ENABLE=1 ; Move to the tray
CUT_FILAMENT

MOVE_TO_TRAY ; Move to the tray
COLD_EXTRUDE HEATER=extruder ENABLE=1
G1 E-30 F600
COLD_EXTRUDE HEATER=extruder ENABLE=0
G0 Y250
M400 ; Wait for movements to complete

[gcode_macro CUT_FILAMENT]
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28 ; Home if necessary
{% if "xy" not in printer.toolhead.homed_axes %}
G28 XY ; Home if necessary
{% endif %}

G90
Expand All @@ -455,11 +455,18 @@ gcode:
G28 Y
G0 X128 Y128 F4800
G28 Z
{% elif 'X' in rawparams and 'Y' in rawparams %}
G28 Y
G28 X
G28 Y
{% if 'Z' in rawparams %}
G0 X128 Y128 F4800
G28 Z
{% endif %}
{% else %}
{% if 'X' in rawparams %}
G28 X
{% endif %}
{% if 'Y' in rawparams %}
{% elif 'Y' in rawparams %}
G28 Y
{% endif %}
{% if 'Z' in rawparams %}
Expand Down
Loading