Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [gcode_macro PAUSE]
- description: Pause the actual running print
- rename_existing: PAUSE_BASE
- gcode:
- PAUSE_BASE
- _TOOLHEAD_PARK_PAUSE_CANCEL
- [gcode_macro RESUME]
- description: Resume the actual running print
- rename_existing: RESUME_BASE
- gcode:
- ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
- {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
- #### get VELOCITY parameter if specified ####
- {% if 'VELOCITY' in params|upper %}
- {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
- {%else %}
- {% set get_params = "" %}
- {% endif %}
- ##### end of definitions #####
- {% if printer.extruder.can_extrude|lower == 'true' %}
- M83
- G1 E{extrude} F2100
- {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- RESUME_BASE {get_params}
- [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
- description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
- variable_extrude: 1.0
- gcode:
- ##### set park positon for x and y #####
- # default is your max posion from your printer.cfg
- {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
- {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
- {% set z_park_delta = 2.0 %}
- ##### calculate save lift position #####
- {% set max_z = printer.toolhead.axis_maximum.z|float %}
- {% set act_z = printer.toolhead.position.z|float %}
- {% if act_z < (max_z - z_park_delta) %}
- {% set z_safe = z_park_delta %}
- {% else %}
- {% set z_safe = max_z - act_z %}
- {% endif %}
- ##### end of definitions #####
- {% if printer.extruder.can_extrude|lower == 'true' %}
- M83
- G1 E-{extrude} F2100
- {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- {% if "xyz" in printer.toolhead.homed_axes %}
- G91
- G1 Z{z_safe} F900
- G90
- G1 X{x_park} Y{y_park} F6000
- {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
- {% else %}
- {action_respond_info("Printer not homed")}
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement