fingerfunk99

macros.cfg

Jun 17th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. ######################################################################
  2. # Filament Change
  3. ######################################################################
  4.  
  5. # M600: Filament Change. This macro will pause the printer, move the
  6. # tool to the change position, and retract the filament 50mm. Adjust
  7. # the retraction settings for your own extruder. After filament has
  8. # been changed, the print can be resumed from its previous position
  9. # with the "RESUME" gcode.
  10.  
  11. [pause_resume]
  12. recover_velocity: 50
  13.  
  14. [filament_switch_sensor filasens]
  15. pause_on_runout: false
  16. runout_gcode:
  17. M117 OUT OF FILAMENT
  18. M600
  19. insert_gcode:
  20. M117 FILAMENT INSERTED
  21. LOAD_FILAMENT
  22. RESUME
  23. event_delay: 1.0
  24. switch_pin: !PD1
  25.  
  26. [gcode_macro M600]
  27. gcode:
  28. SAVE_GCODE_STATE NAME=filament_change
  29. PAUSE
  30. M83
  31. G1 E-5 F1000
  32. PARK
  33. UNLOAD_FILAMENT
  34. RESTORE_GCODE_STATE NAME=filament_change
  35.  
  36. [gcode_macro PARK]
  37. gcode:
  38. M117 PARKING
  39. G91
  40. G1 Z10 F200
  41. G90
  42. G1 X120 Y0 Z200 F1000
  43.  
  44. [gcode_macro M601]
  45. gcode:
  46. SAVE_GCODE_STATE NAME=hardware_change
  47. PAUSE
  48. G91
  49. G1 Z10 F200
  50. G90
  51. G1 Y200 F1000
  52. RESTORE_GCODE_STATE NAME=hardware_change
  53.  
  54. [gcode_macro PAUSE]
  55. description: Pause the print
  56. rename_existing: BASE_PAUSE
  57. gcode:
  58. M117 PAUSED..
  59. BASE_PAUSE
  60. SET_IDLE_TIMEOUT TIMEOUT=10000
  61. #Turn Off Nozzle Fan
  62. #M107 P1
  63.  
  64. [gcode_macro RESUME]
  65. rename_existing: BASE_RESUME
  66. gcode:
  67. M117 Resuming..
  68. BASE_RESUME
  69. #Turn On Nozzle Fan
  70. M106 S{ printer.fan.speed * 255} P1
  71.  
  72. [gcode_macro LOAD_PLA]
  73. gcode:
  74. M104 T0 S230
  75. PARK
  76. M109 T0 S230
  77. LOAD_FILAMENT
  78. G1 Z100 F2000
  79.  
  80. [gcode_macro LOAD_PETG]
  81. gcode:
  82. M104 T0 S250
  83. PARK
  84. M109 T0 S250
  85. LOAD_FILAMENT
  86. G1 Z100 F2000
  87.  
  88. [gcode_macro LOAD_FILAMENT]
  89. gcode:
  90. M117 Loading Filament...
  91. LOW_TEMP_CHECK
  92. M83
  93. G1 E80 F300
  94. G1 E15 F50
  95. M400
  96. M117 Load Complete
  97. G1 E-1.2 F50
  98.  
  99. [gcode_macro UNLOAD_FILAMENT]
  100. gcode:
  101. M117 Unloading Filament...
  102. LOW_TEMP_CHECK
  103. M83
  104. G1 E-100 F1000
  105. M400
  106. M117 Remove Filament Now!
  107. #M300 S300 P500
  108. #M300 S100 P500
  109.  
  110. [gcode_macro LOW_TEMP_CHECK]
  111. #default_parameter_T:230
  112. gcode:
  113. {% set TEMP = params.T|default(230)|int %}
  114. {% if printer.extruder.target != 0 %} # if there is a setpoint for extruder
  115. {% if printer.extruder.temperature < printer.extruder.target %} # if not reached, heat
  116. #M117 Heating from {printer.extruder.temperature} to {printer.extruder.target}.
  117. M109 S{printer.extruder.target|float}
  118. {% endif %}
  119. {% else %} # if no setpoint for extruder
  120. {% if printer.extruder.target < TEMP %} # heat to T.
  121. #M117 No setpoint, heating to {T}.
  122. M109 S{TEMP}
  123. {% endif %}
  124. {% endif %}
  125.  
  126. [gcode_macro M300]
  127. #default_parameter_S: 1000
  128. # Use a default 1kHz tone if S is omitted.
  129. #default_parameter_P: 100
  130. # Use a 10ms duration is P is omitted.
  131. gcode:
  132. {% set TONE = params.S|default(1000)|int %}
  133. {% set PULSE = params.P|default(100)|int %}
  134. SET_PIN PIN=BEEPER_pin VALUE={TONE}
  135. G4 P{PULSE}
  136. SET_PIN PIN=BEEPER_pin VALUE=0
  137.  
  138. ######################################################################
  139. # Start Print and End Print
  140. ######################################################################
  141. [gcode_macro START_PRINT]
  142. #default_parameter_BED_TEMP: 50
  143. #default_parameter_EXTRUDER_TEMP: 240
  144. gcode:
  145. {% set EXTRUDER_TEMP = params.E_TEMP|default(230)|int %}
  146. {% set BED_TEMP = params.B_TEMP|default(60)|int %}
  147. CLEAR_PAUSE
  148. SET_GCODE_OFFSET Z=0
  149. # Home the printer
  150. M117 HOMING...
  151. G28
  152. #####
  153. ## Warm the printer for calibrating
  154. #M117 WARMING...
  155. ## Warm bed
  156. #M140 S50
  157. ## Warm nozzle
  158. #M109 S160
  159. #M190 S50
  160. ## Calibrate Bed Mesh
  161. M117 CALIBRATING...
  162. BED_MESH_CALIBRATE
  163. G28
  164. #####
  165. # Use absolute coordinates
  166. G90
  167. # Move the nozzle near the bed
  168. G1 Z5 F3000
  169. # Move the nozzle very close to the bed
  170. G1 Z0.4 F300
  171. G92 E0.0
  172. # Start nozzle heating
  173. M117 HEATING...
  174. M104 S{EXTRUDER_TEMP}
  175. # Wait for bed to reach temperature
  176. M190 S{BED_TEMP}
  177. # Set and wait for nozzle to reach temperature
  178. M109 S{EXTRUDER_TEMP}
  179. M220 S100
  180. # Intro line
  181. G1 X60.0 E9.0 F1000.0
  182. # Intro line
  183. G1 X100.0 E15.0 F1000.0
  184. # reset extruder distance position
  185. G92 E0.0
  186. M117 PRINTING
  187.  
  188. [gcode_macro END_PRINT]
  189. gcode:
  190. # Turn off bed, extruder, and fan
  191. M140 S0
  192. M104 S0
  193. M107 S0
  194. M107 S1
  195. # Move nozzle away from print while retracting
  196. G91
  197. # Raise nozzle by 1mm
  198. G1 Z1 F3000
  199. # Present part
  200. G90
  201. G1 X0 Y210 F3000
  202. M117 FINISHED
  203. UNLOAD_FILAMENT
  204. SET_IDLE_TIMEOUT TIMEOUT=600
  205.  
  206. [exclude_object]
  207.  
  208. ####################################
  209. # Homing
  210. ####################################
  211. [gcode_macro HOME]
  212. gcode:
  213. {% if printer.toolhead.homed_axes != "xyz" %}
  214. G28
  215. #############G1 Z0.2
  216. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment