Guest User

X1C start GCode mod

a guest
Apr 29th, 2023
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | Science | 0 0
  1. ;===== machine: X1 =========================
  2. ;===== date: 20230130 =====================
  3. ;===== reset machine status =================
  4. G91
  5. M17 Z0.4 ; lower the z-motor current
  6. G0 Z12 F300 ; lower the hotbed , to prevent the nozzle is below the hotbed
  7. G0 Z-6;
  8. G90
  9. M17 X1.2 Y1.2 Z0.75 ; reset motor current to default
  10. M960 S5 P1 ; turn on logo lamp
  11. G90
  12. M220 S100 ;Reset Feedrate
  13. M221 S100 ;Reset Flowrate
  14. M73.2 R1.0 ;Reset left time magnitude
  15. M1002 set_gcode_claim_speed_level : 5
  16. M221 X0 Y0 Z0 ; turn off soft endstop to prevent protential logic problem
  17. G29.1 Z{+0.0} ; clear z-trim value first
  18.  
  19. ;===== heatbed preheat ====================
  20. M1002 gcode_claim_action : 2
  21. M140 S[bed_temperature_initial_layer_single] ;set bed temp
  22. M190 S[bed_temperature_initial_layer_single] ;wait for bed temp
  23.  
  24. {if scan_first_layer}
  25. ;=========register first layer scan=====
  26. M977 S1 P60
  27. {endif}
  28.  
  29. ;=============turn on fans to prevent PLA jamming=================
  30. {if filament_type[initial_tool]=="PLA"}
  31. {if (bed_temperature[current_extruder] >45)||(bed_temperature_initial_layer[current_extruder] >45)}
  32. M106 P3 S0 ; mch Fan off - stock S180
  33. {elsif (bed_temperature[current_extruder] >50)||(bed_temperature_initial_layer[current_extruder] >50)}
  34. M106 P3 S0 ; mch Fan off - stock S255
  35. {endif};Prevent PLA from jamming
  36. {endif}
  37. M106 P2 S100 ; turn on big fan ,to cool down toolhead
  38.  
  39. ;===== prepare print temperature and material ==========
  40. M104 S[nozzle_temperature_initial_layer] ;set extruder temp
  41. G91
  42. G0 Z10 F1200
  43. G90
  44. G28 X
  45. M975 S1 ; turn on
  46. G1 X60 F12000
  47. G1 Y245
  48. G1 Y265 F3000
  49. M620 M
  50. M620 S[initial_tool]A ; switch material if AMS exist
  51. M109 S[nozzle_temperature_initial_layer]
  52. G1 X120 F12000
  53.  
  54. G1 X20 Y50 F12000
  55. G1 Y-3
  56. T[initial_tool]
  57. G1 X54 F12000
  58. G1 Y265
  59. M400
  60. M621 S[initial_tool]A
  61.  
  62. M412 S1 ; ===turn on filament runout detection===
  63.  
  64. M109 S250 ;set nozzle to common flush temp
  65. M106 P1 S0
  66. G92 E0
  67. G1 E40 F200 ; mch E50 stock
  68. M400
  69. M104 S[nozzle_temperature_initial_layer]
  70. G92 E0
  71. G1 E40 F200 ; mch E50 stock
  72. M400
  73. M106 P1 S255
  74. G92 E0
  75. G1 E5 F300
  76. M109 R{nozzle_temperature_initial_layer[initial_extruder]-30} ; mch S to R - drop nozzle temp, make filament shink a bit
  77. G92 E0
  78. G1 E-1.0 F300 ; mch E-0.5 stock
  79.  
  80. G1 X70 F9000
  81. G1 X76 F15000
  82. G1 X65 F15000
  83. G1 X76 F15000
  84. G1 X65 F15000; shake to put down garbage
  85. G1 X80 F6000
  86. G1 X95 F15000
  87. G1 X80 F15000
  88. G1 X165 F15000; wipe and shake
  89. M400
  90. M106 P1 S0
  91. ;===== prepare print temperature and material end =====
  92.  
  93.  
  94. ;===== wipe nozzle ===============================
  95. M1002 gcode_claim_action : 14
  96. M975 S1
  97. M106 S255
  98. G1 X65 Y230 F18000
  99. G1 Y264 F6000
  100. M109 R{nozzle_temperature_initial_layer[initial_extruder]-30} ; mch S to R / from -20 to -30
  101. G1 X100 F18000 ; first wipe mouth
  102.  
  103. G0 X135 Y253 F20000 ; move to exposed steel surface edge
  104. G28 Z P0 T300; home z with low precision,permit 300deg temperature
  105. G29.2 S0 ; turn off ABL
  106. G0 Z5 F20000
  107.  
  108. G1 X60 Y265
  109. G92 E0
  110. G1 E-1.0 F300 ; mch retrack more
  111. G1 X100 F5000; second wipe mouth
  112. G1 X70 F15000
  113. G1 X100 F5000
  114. G1 X70 F15000
  115. G1 X100 F5000
  116. G1 X70 F15000
  117. G1 X100 F5000
  118. G1 X70 F15000
  119. G1 X100 F5000 ; mch extra wipe move more
  120. G1 X70 F15000 ; mch extra wipe move more
  121. G1 X100 F5000 ; mch extra wipe move more
  122. G1 X70 F15000 ; mch extra wipe move more
  123. G1 X90 F5000
  124. G0 X128 Y261 Z-1.5 F20000 ; move to exposed steel surface and stop the nozzle
  125. M104 S140 ; set temp down to heatbed acceptable
  126. M106 S255 ; turn on fan (G28 has turn off fan)
  127. M221 S; push soft endstop status
  128. M221 Z0 ;turn off Z axis endstop
  129. G0 Z0.5 F20000
  130. G0 X125 Y259.5 Z-1.01
  131. G0 X131 F211
  132. G0 X124
  133. G0 Z0.5 F20000
  134. G0 X125 Y262.5
  135. G0 Z-1.01
  136. G0 X131 F211
  137. G0 X124
  138. G0 Z0.5 F20000
  139. G0 X125 Y260.0
  140. G0 Z-1.01
  141. G0 X131 F211
  142. G0 X124
  143. G0 Z0.5 F20000
  144. G0 X125 Y262.0
  145. G0 Z-1.01
  146. G0 X131 F211
  147. G0 X124
  148. G0 Z0.5 F20000
  149. G0 X125 Y260.5
  150. G0 Z-1.01
  151. G0 X131 F211
  152. G0 X124
  153. G0 Z0.5 F20000
  154. G0 X125 Y261.5
  155. G0 Z-1.01
  156. G0 X131 F211
  157. G0 X124
  158. G0 Z0.5 F20000
  159. G0 X125 Y261.0
  160. G0 Z-1.01
  161. G0 X131 F211
  162. G0 X124
  163. G0 X128
  164. G2 I0.5 J0 F300
  165. G2 I0.5 J0 F300
  166. G2 I0.5 J0 F300
  167. G2 I0.5 J0 F300
  168.  
  169. M109 S140 ; wait nozzle temp down to heatbed acceptable
  170. G2 I0.5 J0 F3000
  171. G2 I0.5 J0 F3000
  172. G2 I0.5 J0 F3000
  173. G2 I0.5 J0 F3000
  174.  
  175. M221 R; pop softend status
  176. G1 Z10 F1200
  177. M400
  178. G1 Z10
  179. G1 F30000
  180. G1 X128 Y128
  181. G29.2 S1 ; turn on ABL
  182. ;G28 ; home again after hard wipe mouth
  183. M106 S0 ; turn off fan , too noisy
  184. ;===== wipe nozzle end ================================
  185.  
  186. ;===== check scanner clarity ===========================
  187. G1 X128 Y128 F24000
  188. G28 Z P0
  189. M972 S5 P0
  190. G1 X230 Y15 F24000
  191. ;===== check scanner clarity end =======================
  192.  
  193. ;===== bed leveling ==================================
  194. M1002 judge_flag g29_before_print_flag
  195. M622 J1
  196.  
  197. M1002 gcode_claim_action : 1
  198. G29 A X{first_layer_print_min[0]} Y{first_layer_print_min[1]} I{first_layer_print_size[0]} J{first_layer_print_size[1]}
  199. M400
  200. M500 ; save cali data
  201.  
  202. M623
  203. ;===== bed leveling end ================================
  204.  
  205. ;===== home after wipe mouth============================
  206. M1002 judge_flag g29_before_print_flag
  207. M622 J0
  208.  
  209. M1002 gcode_claim_action : 13
  210. G28
  211.  
  212. M623
  213. ;===== home after wipe mouth end =======================
  214.  
  215. M975 S1 ; turn on vibration supression
  216.  
  217. ;=============turn on fans to prevent PLA jamming=================
  218. {if filament_type[initial_tool]=="PLA"}
  219. {if (bed_temperature[current_extruder] >45)||(bed_temperature_initial_layer[current_extruder] >45)}
  220. M106 P3 S0 ; mch Fan off - stock S180
  221. {elsif (bed_temperature[current_extruder] >50)||(bed_temperature_initial_layer[current_extruder] >50)}
  222. M106 P3 S0 ; mch Fan off - stock S255
  223. {endif};Prevent PLA from jamming
  224. {endif}
  225. M106 P2 S100 ; turn on big fan ,to cool down toolhead
  226.  
  227. M104 S{nozzle_temperature_initial_layer[initial_extruder]} ; set extrude temp earlier, to reduce wait time
  228.  
  229. ;===== mech mode fast check============================
  230. G1 X128 Y128 Z10 F20000
  231. M400 P200
  232. M970.3 Q1 A7 B30 C80 H15 K0
  233. M974 Q1 S2 P0
  234.  
  235. G1 X128 Y128 Z10 F20000
  236. M400 P200
  237. M970.3 Q0 A7 B30 C90 Q0 H15 K0
  238. M974 Q0 S2 P0
  239.  
  240. M975 S1
  241. G1 F30000
  242. G1 X230 Y15
  243. G28 X ; re-home XY
  244. ;===== mech mode fast check============================
  245.  
  246. {if scan_first_layer}
  247. ;start heatbed scan====================================
  248. M976 S2 P1
  249. G90
  250. G1 X128 Y128 F20000
  251. M976 S3 P2 ;register void printing detection
  252. {endif}
  253.  
  254. ;===== noozle load line ===============================
  255. M975 S1 ;turn ON vibration supression
  256. G90
  257. M83 ;put the extruder motor into relative mode
  258. T1000
  259. G1 X18.0 Y1.0 Z0.8 F18000;Move to start position
  260. M109 S{nozzle_temperature[initial_extruder]}
  261. G1 Z0.2
  262. G0 E2 F300
  263. G0 X240 E15 F{outer_wall_volumetric_speed/(0.3*0.5) * 60}
  264. G0 Y11 E0.700 F{outer_wall_volumetric_speed/(0.3*0.5)/ 4 * 60}
  265. G0 X239.5
  266. G0 E0.2
  267. G0 Y1.5 E0.700
  268. G0 X18 E15 F{outer_wall_volumetric_speed/(0.3*0.5) * 60}
  269. M400
  270.  
  271. ;===== for Textured PEI Plate , lower the nozzle as the nozzle was touching topmost of the texture when homing ==
  272. ;curr_bed_type={curr_bed_type}
  273. {if curr_bed_type=="Textured PEI Plate"}
  274. G29.1 Z{-0.04} ; for Textured PEI Plate
  275. {endif}
  276.  
  277. ;===== removed the whole code for "draw extrinsic para cali paint" mch ===============================
  278. ;===== 2nd noozle load line on the back side mch ===============================
  279.  
  280. M975 S1 ; turn on mech mode supression
  281. G90
  282. M83
  283. T1000
  284. G1 E{-retraction_length[initial_extruder]} F1800
  285. G1 X128.0 Y253.0 Z0.2 F24000.0;Move to start position
  286. G1 E{retraction_length[initial_extruder]} F1800
  287. M109 S{nozzle_temperature_initial_layer[initial_extruder]}
  288. G0 X253 E6.4 F{outer_wall_volumetric_speed/(0.3*0.6) * 60}
  289. G0 Y128 E6.4
  290. G0 X252.5
  291. G0 Y252.5 E6.4
  292. G0 X128 E6.4
  293. G0 Z0.4f-
Advertisement
Add Comment
Please, Sign In to add comment