Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2024
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.77 KB | None | 0 0
  1. # ================================================================================
  2. # GCode Macro: START_PRINT
  3. # Aggiungi START_PRINT nello script di avvio dello Slicer.
  4. # ================================================================================
  5. [gcode_macro START_PRINT]
  6. gcode:
  7. G28 ; Home di tutti gli assi
  8. BED_MESH_CALIBRATE ; Calibrazione del Bed
  9. G92 E0 ; Reset dell'estrusore
  10. G1 Z5.0 F3000 ; Muove l'asse Z un po' in alto per evitare di graffiare il Bed
  11. G1 X7.1 Y40 Z0.3 F5000.0 ; Spostamento alla posizione iniziale
  12. G1 X7.1 Y215.0 Z0.3 F1500.0 E15 ; Disegna la prima linea
  13. G1 X7.4 Y215.0 Z0.3 F5000.0 ; Spostamento laterale
  14. G1 X7.4 Y40 Z0.3 F1500.0 E30 ; Disegna la seconda linea
  15. G92 E0 ; Reset dell'estrusore
  16. G1 Z5.0 F3000 ; Muove l'asse Z un po' in alto per evitare di graffiare il Bed
  17.  
  18. # ================================================================================
  19. # GCode Macro: END_PRINT
  20. # Aggiungi END_PRINT nello script di fine dello Slicer.
  21. # ================================================================================
  22. #[gcode_macro END_PRINT]
  23. #gcode:
  24. # G1 Y190 F1500; Sposta Y davanti
  25. # G10 ; Imposta l'offset? O ritrae?
  26. # G91 ; Posizionamento relativo
  27. #G1 Z+10 ; Muove Z in alto per non colpire nulla
  28. #G1 E-10 F300 ; Ritrae -10
  29. #G90 ; Posizionamento assoluto
  30. #G1 X10 Y220 F2000 ; Muove X10, Y220
  31. #M104 S0 ; Spegne l'estrusore (lo imposta a 0)
  32. #M140 S0 ; Spegne il Bed (lo imposta a 0)
  33. #M106 S0 ; Spegne le ventole di raffreddamento
  34. #M84 ; Disabilita gli stepper motors
  35.  
  36. [gcode_macro END_PRINT]
  37. gcode:
  38.  
  39. #Fix-up extruder
  40. RESPOND MSG="Print Finished"
  41. G91
  42. G1 E-.5 Z0.2 F2400
  43. G1 X5 Y5 F6000
  44. G1 Z10
  45. G90
  46.  
  47. #Present print
  48. G1 Z{printer.toolhead.position.z + 10} F600
  49. G1 X0 Y220 F6000
  50. M106 S0
  51. M104 S0
  52. M140 S0
  53.  
  54. #Disable Steppers
  55. M84 X Y E
  56.  
  57. [gcode_macro BED_MESH_CALIBRATE]
  58. rename_existing: BASE_BED_MESH_CALIBRATE
  59. gcode:
  60. #before the original gcode
  61. BED_MESH_CLEAR
  62. QUAD_GANTRY_LEVEL
  63. G1 X125 Y125 Z5 F6000
  64. #the original gcode
  65. BASE_BED_MESH_CALIBRATE
  66. #after the original gcode
  67.  
  68. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  69. description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
  70. variable_extrude: 1.0
  71. gcode:
  72. ##### set park positon for x and y #####
  73. # default is your max posion from your printer.cfg
  74.  
  75. {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  76. {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  77. {% set z_park_delta = 2.0 %}
  78. ##### calculate save lift position #####
  79. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  80. {% set act_z = printer.toolhead.position.z|float %}
  81. {% if act_z < (max_z - z_park_delta) %}
  82. {% set z_safe = z_park_delta %}
  83. {% else %}
  84. {% set z_safe = max_z - act_z %}
  85. {% endif %}
  86. ##### end of definitions #####
  87. {% if printer.extruder.can_extrude|lower == 'true' %}
  88. M83
  89. G1 E-{extrude} F2100
  90. {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  91. {% else %}
  92. {action_respond_info("Extruder not hot enough")}
  93. {% endif %}
  94. {% if "xyz" in printer.toolhead.homed_axes %}
  95. G91
  96. G1 Z{z_safe} F900
  97. G90
  98. G1 X{x_park} Y{y_park} F6000
  99. {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
  100. {% else %}
  101. {action_respond_info("Printer not homed")}
  102. {% endif %}
  103.  
  104. [gcode_macro CANCEL_PRINT]
  105. description: Cancel the actual running print
  106. rename_existing: CANCEL_PRINT_BASE
  107. variable_park: True
  108. gcode:
  109. ## Move head and retract only if not already in the pause state and park set to true
  110.  
  111. {% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
  112. _TOOLHEAD_PARK_PAUSE_CANCEL
  113. {% endif %}
  114.  
  115.  
  116.  
  117. TURN_OFF_HEATERS
  118. CANCEL_PRINT_BASE
  119.  
  120. [gcode_macro RESUME]
  121. description: Resume the actual running print
  122. rename_existing: RESUME_BASE
  123. gcode:
  124. ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
  125.  
  126. {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
  127. #### get VELOCITY parameter if specified ####
  128. {% if 'VELOCITY' in params|upper %}
  129. {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
  130. {%else %}
  131. {% set get_params = "" %}
  132. {% endif %}
  133. ##### end of definitions #####
  134. {% if printer.extruder.can_extrude|lower == 'true' %}
  135. M83
  136. G1 E{extrude} F2100
  137. {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  138. {% else %}
  139. {action_respond_info("Extruder not hot enough")}
  140. {% endif %}
  141.  
  142.  
  143.  
  144. RESUME_BASE {get_params}
  145.  
  146. [gcode_macro PAUSE]
  147. description: Pause the actual running print
  148. rename_existing: PAUSE_BASE
  149. gcode:
  150. PAUSE_BASE
  151. _TOOLHEAD_PARK_PAUSE_CANCEL
  152.  
  153.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement