Guest User

end g code

a guest
Mar 31st, 2026
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. ;======== P2S end gcode ==========
  2. ;===== 2026/03/13 =====
  3.  
  4. ;===== detect ABS/ASA ======
  5. {if filament_type[current_extruder] == "ASA" || filament_type[current_extruder] == "ABS"}
  6. M400 ; wait for buffer to clear
  7. G92 E0 ; zero the extruder
  8. G1 E-1.2 F1800 ; retract 1.2mm filament
  9. G91 ; relative positioning
  10. G1 Z30 F900 ; lift 30 mm above current layer
  11. G90 ; back to absolute positioning
  12. G1 X128 Y128 F12000 ; move nozzle to middle of bed
  13. M104 S200 ; drop nozzle temp to 200°C immediately
  14. M106 P2 S0 ; set fan to 0%
  15. M140 S100 ; set bed temp
  16. M400 S300 ; pause for 300 seconds
  17. M140 S95 ; set bed temp
  18. M104 S190 ; set nozzle temp
  19. M400 S300 ; pause for 300 seconds
  20. M140 S90 ; set bed temp
  21. M104 S180 ; set nozzle temp
  22. M400 S300 ; pause for 300 seconds
  23. M140 S85 ; set bed temp
  24. M104 S170 ; set nozzle temp
  25. M400 S300 ; pause for 300 seconds
  26. M140 S80 ; set bed temp
  27. M104 S160 ; set nozzle temp
  28. M400 S300 ; pause for 300 seconds
  29. M140 S75 ; set bed temp
  30. M104 S150 ; set nozzle temp
  31. M400 S300 ; pause for 300 seconds
  32. M140 S70 ; set bed temp
  33. M104 S140 ; set nozzle temp
  34. M400 S300 ; pause for 300 seconds
  35. M140 S65 ; set bed temp
  36. M104 S130 ; set nozzle temp
  37. M400 S300 ; pause for 300 seconds
  38. M140 S60 ; set bed temp
  39. M104 S120 ; set nozzle temp
  40. M400 S300 ; pause for 300 seconds
  41. M140 S55 ; set bed temp
  42. M104 S110 ; set nozzle temp
  43. M400 S300 ; pause for 300 seconds
  44. M140 S50 ; set bed temp
  45. M104 S100 ; set nozzle temp
  46. M400 S300 ; pause for 300 seconds
  47. M140 S45 ; set bed temp
  48. M104 S90 ; set nozzle temp
  49. M400 S300 ; pause for 300 seconds
  50. M140 S40 ; set bed temp
  51. M104 S80 ; set nozzle temp
  52. M400 S300 ; pause for 300 seconds
  53. M140 S35 ; set bed temp
  54. M104 S70 ; set nozzle temp
  55. M400 S300 ; pause for 300 seconds
  56. M140 S30 ; set bed temp
  57. M104 S60 ; set nozzle temp
  58. M400 S300 ; pause for 300 seconds
  59. M140 S20 ; set bed temp
  60. M104 S40 ; set nozzle temp
  61. M400 S300 ; pause for 300 seconds
  62. M140 S15 ; set bed temp
  63. M104 S30 ; set nozzle temp
  64. M400 S300 ; pause for 300 seconds
  65. M140 S0 ; turn off bed
  66. M104 S0 ; turn off nozzle
  67. {endif}
  68.  
  69.  
  70. M400 ; wait for buffer to clear
  71. G92 E0 ; zero the extruder
  72.  
  73. ; pull back filament to AMS
  74. M620 S65535
  75. T65535
  76. G150.2
  77. M621 S65535
  78.  
  79. G150.3
  80.  
  81. M400 ; wait all motion done
  82.  
  83. M1002 judge_flag timelapse_record_flag
  84. M622 J1
  85. M991 S0 P-1 ;end smooth timelapse at safe pos
  86. M400 S5 ;wait for last picture to be taken
  87. M623 ;end of "timelapse_record_flag"
  88.  
  89. M104 S0 ; turn off hotend
  90. M140 S0 ; turn off bed
  91. M106 S0 ; turn off fan
  92. M106 P2 S0 ; turn off remote part cooling fan
  93. M106 P3 S0 ; turn off chamber cooling fan
  94. M106 P10 S0 ; turn off left aux fan
  95.  
  96. M400 ; wait all motion done
  97. M17 S
  98. M17 Z0.4 ; lower z motor current to reduce impact if there is something in the bottom
  99. {if (80.0 - max_layer_z/2) > 0}
  100. {if (max_layer_z + 80.0 - max_layer_z/2) < 256}
  101. G1 Z{max_layer_z + 80.0 - max_layer_z/2} F600
  102. G1 Z{max_layer_z + 78.0 - max_layer_z/2}
  103. {else}
  104. G1 Z256 F600
  105. G1 Z256
  106. {endif}
  107. {else}
  108. {if (max_layer_z + 4.0) < 256}
  109. G1 Z{max_layer_z + 4.0} F600
  110. G1 Z{max_layer_z + 2.0}
  111. {else}
  112. G1 Z256 F600
  113. G1 Z256
  114. {endif}
  115. {endif}
  116. M400 P100
  117. M17 R ; restore z current
  118.  
  119.  
  120. M220 S100 ; Reset feedrate magnitude
  121. M201.2 K1.0 ; Reset acc magnitude
  122. M73.2 R1.0 ;Reset left time magnitude
  123. M1002 set_gcode_claim_speed_level : 0
  124.  
  125. M1015.3 S0 ;disable clog detect
  126. M1015.4 S0 K0 ;disable air printing detect
  127.  
  128. ;=====printer finish air purification=========
  129. M622.1 S0
  130. M1002 judge_flag print_finish_air_filt_flag
  131.  
  132. M622 J1
  133. M1002 gcode_claim_action : 66
  134. M145 P1
  135. M106 P2 S255
  136. M400 S180
  137. M106 P2 S0
  138. M623
  139.  
  140. M622 J2
  141. M1002 gcode_claim_action : 66
  142. M145 P0
  143. M106 P3 S255
  144. M400 S180
  145. M106 P3 S0
  146. M623
  147. ;=====printer finish air purification=========
  148.  
  149. ;=====printer finish sound=========
  150. M17
  151. M400 S1
  152. M1006 S1
  153. M1006 A53 B10 L50 C53 D10 M50 E53 F10 N50
  154. M1006 A57 B10 L50 C57 D10 M50 E57 F10 N50
  155. M1006 A0 B15 L0 C0 D15 M0 E0 F15 N0
  156. M1006 A53 B10 L50 C53 D10 M50 E53 F10 N50
  157. M1006 A57 B10 L50 C57 D10 M50 E57 F10 N50
  158. M1006 A0 B15 L0 C0 D15 M0 E0 F15 N0
  159. M1006 A48 B10 L50 C48 D10 M50 E48 F10 N50
  160. M1006 A0 B15 L0 C0 D15 M0 E0 F15 N0
  161. M1006 A60 B10 L50 C60 D10 M50 E60 F10 N50
  162. M1006 W
  163. ;=====printer finish sound=========
  164. M400
  165. M18
  166.  
Advertisement
Add Comment
Please, Sign In to add comment