Skip to content

Instantly share code, notes, and snippets.

@alienboyxp
Last active May 22, 2023 11:13
Show Gist options
  • Save alienboyxp/8d93aec3888d361fdcdc77a8ce0faad7 to your computer and use it in GitHub Desktop.
Save alienboyxp/8d93aec3888d361fdcdc77a8ce0faad7 to your computer and use it in GitHub Desktop.
# Current Version v_202305221109
# Mas info - https://3dwork.gitbook.io/3dwork.io/klipper/mejoras/macros-mejoras/cambio-filamentos-m600
[gcode_macro MOVE_PARK]
description: Aparca el cabezal de impresion, se puede ajustar en _VAR_GLOBALS.
gcode:
{% set vg = printer["gcode_macro _VAR_GLOBALS"] %}
# Se realiza el calculo de la posicion Z, X e Y se definen en _VAR_GLOBALS.
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 20.0) %}
{% set z_safe = 20.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
NOTIFY TEXT="Aparcando cabezal de impresion"
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{vg.retract_length} F2100
{% else %}
NOTIFY TEXT="Temperatura baja, imposible extruir"
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F6000
G90
G1 X{vg.x_park} Y{vg.y_park} F6000
{% else %}
NOTIFY TEXT="Ejes no inicializados.(HOME_ALL)"
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment