Advertisement
cyborgninja

Mainsail.cfg

Jul 30th, 2022
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. [gcode_macro PAUSE]
  2. description: Pause the actual running print
  3. rename_existing: PAUSE_BASE
  4. gcode:
  5. PAUSE_BASE
  6. _TOOLHEAD_PARK_PAUSE_CANCEL
  7.  
  8. [gcode_macro RESUME]
  9. description: Resume the actual running print
  10. rename_existing: RESUME_BASE
  11. gcode:
  12. ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
  13. {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
  14. #### get VELOCITY parameter if specified ####
  15. {% if 'VELOCITY' in params|upper %}
  16. {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
  17. {%else %}
  18. {% set get_params = "" %}
  19. {% endif %}
  20. ##### end of definitions #####
  21. {% if printer.extruder.can_extrude|lower == 'true' %}
  22. M83
  23. G1 E{extrude} F2100
  24. {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  25. {% else %}
  26. {action_respond_info("Extruder not hot enough")}
  27. {% endif %}
  28. RESUME_BASE {get_params}
  29.  
  30. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  31. description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
  32. variable_extrude: 1.0
  33. gcode:
  34. ##### set park positon for x and y #####
  35. # default is your max posion from your printer.cfg
  36. {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  37. {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  38. {% set z_park_delta = 2.0 %}
  39. ##### calculate save lift position #####
  40. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  41. {% set act_z = printer.toolhead.position.z|float %}
  42. {% if act_z < (max_z - z_park_delta) %}
  43. {% set z_safe = z_park_delta %}
  44. {% else %}
  45. {% set z_safe = max_z - act_z %}
  46. {% endif %}
  47. ##### end of definitions #####
  48. {% if printer.extruder.can_extrude|lower == 'true' %}
  49. M83
  50. G1 E-{extrude} F2100
  51. {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  52. {% else %}
  53. {action_respond_info("Extruder not hot enough")}
  54. {% endif %}
  55. {% if "xyz" in printer.toolhead.homed_axes %}
  56. G91
  57. G1 Z{z_safe} F900
  58. G90
  59. G1 X{x_park} Y{y_park} F6000
  60. {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
  61. {% else %}
  62. {action_respond_info("Printer not homed")}
  63. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement