Guest User

Untitled

a guest
Jun 9th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. #####################################################################
  2. # A better print_start macro for v2/trident
  3. #####################################################################
  4.  
  5. ## *** THINGS TO UNCOMMENT: ***
  6. ## Bed mesh (2 lines at 2 locations)
  7. ## Nevermore (if you have one)
  8. ## Z_TILT_ADJUST (For Trident only)
  9. ## QUAD_GANTRY_LEVEL (For V2.4 only)
  10. ## Beacon Contact logic (if you have one. 4 lines at 4 locations)
  11.  
  12. [gcode_macro PRINT_START]
  13. gcode:
  14.  
  15. # This part fetches data from your slicer. Such as bed, extruder, and chamber temps and size of your printer.
  16. {% set target_bed = params.BED|int %}
  17. {% set target_extruder = params.EXTRUDER|int %}
  18. {% set target_chamber = params.CHAMBER|default("45")|int %}
  19. {% set x_wait = printer.toolhead.axis_maximum.x|float / 2 %}
  20. {% set y_wait = printer.toolhead.axis_maximum.y|float / 2 %}
  21.  
  22. ## Uncomment for Beacon Contact (1 of 4 for beacon contact)
  23. SET_GCODE_OFFSET Z=0 # Set offset to 0
  24.  
  25. # Home the printer, set absolute positioning and update the Stealthburner LEDs.
  26. # STATUS_HOMING # Set LEDs to homing-mode
  27. G28 Y
  28. G28 # Full home (XYZ)
  29. G90 # Absolute position
  30. SYNC_MOTORS
  31.  
  32. ## Uncomment for bed mesh (1 of 2 for bed mesh)
  33. BED_MESH_CLEAR # Clear old saved bed mesh (if any)
  34.  
  35. # Check if the bed temp is higher than 90c - if so then trigger a heatsoak.
  36. {% if params.BED|int > 90 %}
  37. SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Display info on display
  38. # STATUS_HEATING # Set LEDs to heating-mode
  39. M106 S255 # Turn on the PT-fan
  40.  
  41. ## Uncomment if you have a Nevermore.
  42. #SET_PIN PIN=nevermore VALUE=1 # Turn on the nevermore
  43.  
  44. G1 X{x_wait} Y{y_wait} Z15 F9000 # Go to center of the bed
  45. M190 S{target_bed} # Set the target temp for the bed
  46. SET_DISPLAY_TEXT MSG="Heatsoak: {target_chamber}c" # Display info on display
  47. #TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={target_chamber} # Waits for chamber temp
  48.  
  49. # If the bed temp is not over 90c, then skip the heatsoak and just heat up to set temp with a 5 min soak
  50. {% else %}
  51. SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Display info on display
  52. STATUS_HEATING # Set LEDs to heating-mode
  53. G1 X{x_wait} Y{y_wait} Z15 F9000 # Go to center of the bed
  54. M190 S{target_bed} # Set the target temp for the bed
  55. SET_DISPLAY_TEXT MSG="Soak for 5 min" # Display info on display
  56. G4 P300000 # Wait 5 min for the bedtemp to stabilize
  57. {% endif %}
  58.  
  59. # Heat hotend to 150c. This helps with getting a correct Z-home.
  60. SET_DISPLAY_TEXT MSG="Hotend: 150c" # Display info on display
  61. M109 S150 # Heat hotend to 150c
  62.  
  63. ## Uncomment for Beacon contact (2 of 4 for beacon contact)
  64. G28 Z METHOD=CONTACT CALIBRATE=1 # Calibrate z offset and beacon model
  65.  
  66. ## Uncomment for Trident (Z_TILT_ADJUST)
  67. SET_DISPLAY_TEXT MSG="Leveling" # Display info on display
  68. STATUS_LEVELING # Set LEDs to leveling-mode
  69. #z_tilt_ng
  70. Z_TILT_ADJUST # Level the printer via Z_TILT_ADJUST
  71. G28 Z # Home Z again after Z_TILT_ADJUST
  72.  
  73.  
  74.  
  75. ## Uncomment for bed mesh (2 of 2 for bed mesh)
  76. SET_DISPLAY_TEXT MSG="Bed mesh" # Display info on display
  77. STATUS_MESHING # Set LEDs to bed mesh-mode
  78. BED_MESH_CALIBRATE # Start the bed mesh (add ADAPTIVE=1) for adaptive bed mesh
  79.  
  80. ## Uncomment for Beacon Contact (3 of 4 for beacon contact)
  81. G28 Z METHOD=CONTACT CALIBRATE=0 # Calibrate z offset only with hot nozzle
  82.  
  83. # Heat up the hotend up to target via data from slicer
  84. SET_DISPLAY_TEXT MSG="Hotend: {target_extruder}c" # Display info on display
  85. STATUS_HEATING # Set LEDs to heating-mode
  86. G1 X{x_wait} Y{y_wait} Z15 F9000 # Go to center of the bed
  87. M107 # Turn off partcooling fan
  88. M109 S{target_extruder} # Heat the hotend to set temp
  89.  
  90. ## Uncomment for Beacon Contact (4 of 4 for beacon contact)
  91. #SET_GCODE_OFFSET Z=0.06 # Add a little offset for hotend thermal expansion
  92.  
  93. # Get ready to print by doing a primeline and updating the LEDs
  94. SET_DISPLAY_TEXT MSG="Printer goes brr" # Display info on display
  95. STATUS_PRINTING # Set LEDs to printing-mode
  96. G0 X{x_wait - 50} Y4 F10000 # Go to starting point
  97. G0 Z0.4 # Raise Z to 0.4
  98. G91 # Incremental positioning
  99. G1 X100 E20 F1000 # Primeline
  100. G90
Add Comment
Please, Sign In to add comment