Guest User

Untitled

a guest
Oct 5th, 2024
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. [gcode_macro WIPE_NOZZLE]
  2. variable_default_homing: 1 # 1 is yes, home away
  3. variable_default_temp: 175
  4. gcode:
  5.  
  6. {% if 'gcode_macro PRINT_START' in printer and 'pre_home_on_wipe' in printer['gcode_macro PRINT_START']%} # needed for wipe_nozzle macro in klipper since start_print macro isn't called yet
  7. {% set PRE_HOME_STATE = printer['gcode_macro PRINT_START'].pre_home_on_wipe %}
  8. {% else %}
  9. {% set PRE_HOME_STATE = default_homing %}
  10. {% endif %}
  11.  
  12. {% if printer.extruder.temperature|int < default_temp %}
  13. RESPOND TYPE=echo MSG="Heating nozzle to {default_temp}C..."
  14. M104 S{default_temp} # non blocking heat up nozzle to luke warm, good for cleaning
  15. {% endif %}
  16.  
  17. {% if PRE_HOME_STATE == 1 %}
  18. G28 # home all axes
  19. G90 # absolute positioning
  20. {% endif %}
  21.  
  22. G1 X60 Y120 Z3 F9000 # move to first position before brush
  23.  
  24. {% if printer.extruder.temperature|int < default_temp %} # if only needed for isolated wipe_nozzle macro
  25. M109 S{default_temp} # blocking if did not finish heating after homing
  26. {% endif %}
  27.  
  28. G1 Z-1.5 F500 # lower down next to brush
  29. # -- START clean nozzle in X direction 3x -- #
  30. {% for i in range(5) %}
  31. G1 X18 F12000 # swipe left to clean nozzle
  32. G1 X60 F12000 # swipe right to clean nozzle
  33. {% endfor %}
  34. # -- END clean nozzle in X direction 3x -- #
  35.  
  36. # -- START clean nozzle in Y direction 12x -- #
  37. G1 X39 Y120 F1000 # move to middle of brush in X
  38. {% for i in range(12) %}
  39. G1 Y118 F12000
  40. G1 Y120 F12000
  41. {% endfor %}
  42. # -- END clean nozzle in Y direction 12x -- #
  43.  
  44. G1 X60 Y120 Z3 F500 # park nozzle safely where nozzle clean started
  45.  
  46. [gcode_macro PRINT_START]
  47. # Use PRINT_START for the slicer starting script - please customize for your slicer of choice
  48. variable_pre_home_on_wipe: 1
  49. gcode:
  50. {% set target_bed = params.BED|float %}
  51. {% set target_extruder = params.EXTRUDER|float %}
  52.  
  53. # --- start bed warmup --- #
  54. SET_LED LED=chamber_leds RED=1.0 GREEN=0.50 BLUE=0.0 # set color to orange to denote heating
  55. M140 S{target_bed} # non-blocking heat bed
  56. SET_FAN_SPEED FAN=nevermore_fans SPEED=1.0 # Turn on Nevermore Fan to 100%
  57. WIPE_NOZZLE
  58.  
  59. # --- heat chamber by blowing part cooling fan onto top of bed --- #
  60. M106 S255 # Turn on the PT-fan
  61. G1 X60 Y60 Z10 F500 # Go to center of the bed
  62. M190 S{target_bed} # Set target temp for the bed
  63.  
  64. # preheat before purge line
  65. M106 S0 # turn off part cooling fans, confirm this line is working
  66. G1 X60 Y120 Z3 F9000 ; move nozzle away from bed
  67. M109 S{target_extruder}
  68.  
  69. SET_LED LED=chamber_leds RED=1.0 GREEN=1.0 BLUE=1.0 # set LED color to white for better print monitoring
  70.  
  71. G92 E0 ; Reset the extruder to 0
  72. M82 ; set extruder to absolute mode
  73. G1 X60 Z0.2 E16 F500 ; Draw a priming line to the rear, extrude 16mm
  74. G92 E0 ; Zero the extruder
  75.  
  76. SET_GCODE_VARIABLE MACRO=PRINT_START VARIABLE=pre_home_on_wipe VALUE={0}
  77. WIPE_NOZZLE
Advertisement
Add Comment
Please, Sign In to add comment