; modified 2025-08-28 by DHB to turn off nozzle heater when loadcell will be read (homing, cleaning, probing) M17 ; enable steppers M862.1 P[nozzle_diameter] A{(filament_abrasive[0] ? 1 : 0)} F{(nozzle_high_flow[0] ? 1 : 0)} ; nozzle check M862.3 P "COREONE" ; printer model check M862.5 P2 ; g-code level check M862.6 P"Input shaper" ; FW feature check M115 U6.3.4+10511 M555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))} G90 ; use absolute coordinates M83 ; extruder relative mode {if chamber_minimal_temperature[initial_tool]!=0} M140 S115 ; set bed temp for chamber heating {else} M140 S[first_layer_bed_temperature] ; set bed temp {endif} M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : 170)} ; wait for temp M84 E ; turn off E motor M104 S0 ; loadcell noise reduction G28 ; home all without mesh bed level {if chamber_minimal_temperature[initial_tool]!=0} ; Min chamber temp section M104 S{idle_temperature[initial_tool]} ; set idle temp G1 Z10 F720 ; set bed position G1 X242 Y-9 F4800 ; set print head position M191 S{chamber_minimal_temperature[initial_tool]} ; wait for minimal chamber temp M141 S{chamber_temperature[initial_tool]} ; set nominal chamber temp M107 M140 S[first_layer_bed_temperature] ; set bed temp {else} M141 S{chamber_temperature[initial_tool]} ; set nominal chamber temp {endif} {if first_layer_bed_temperature[initial_tool]<=60}M106 S70{endif} G0 Z40 F10000 M104 T{initial_tool} S{if is_nil(idle_temperature[initial_tool])}100{else}{idle_temperature[initial_tool]}{endif} M190 R[first_layer_bed_temperature] ; wait for bed temp M107 G29 G ; absorb heat M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : 170)} ; wait for MBL temp M302 S155 ; lower cold extrusion limit to 155C {if filament_type[initial_tool]=="FLEX"} G1 E-4 F2400 ; retraction {else} G1 E-2 F2400 ; retraction {endif} M84 E ; turn off E motor M104 S0 ; loadcell noise reduction ; this is the nozzle cleaning routine: G29 P9 X208 Y-2.5 W32 H4 ; Loadcell noise reduction: nozzle cleaning leaves nozzle touching, so before waiting for nozzle temp, drop the bed a little G0 Z10 F720 ; set bed position ; ; MBL ; M84 E ; turn off E motor ; Loadcell noise reduction: let the nozzle get back up to temp, then turn it off again M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : 170)} ; wait for MBL temp M104 S0 G29 P1 ; invalidate mbl & probe print area ; Loadcell noise reduction: let the nozzle get back up to temp, then turn it off again M109 R{((filament_notes[0]=~/.*MBL160.*/) ? 160 : (filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : 170)} ; wait for MBL temp M104 S0 G29 P1 X150 Y0 W100 H20 C ; probe near purge place G29 P3.2 ; interpolate mbl probes G29 P3.13 ; extrapolate mbl outside probe area G29 A ; activate mbl ; prepare for purge M104 S{first_layer_temperature[0]} G0 X249 Y-2.5 Z15 F4800 ; move away and ready for the purge M109 S{first_layer_temperature[0]} G92 E0 M569 S0 E ; set spreadcycle mode for extruder ; ; Extrude purge line ; G92 E0 ; reset extruder position G1 E{(filament_type[0] == "FLEX" ? 4 : 2)} F2400 ; deretraction after the initial one G0 E5 X235 Z0.2 F500 ; purge G0 X225 E4 F500 ; purge G0 X215 E4 F650 ; purge G0 X205 E4 F800 ; purge G0 X202 Z0.05 F8000 ; wipe, move close to the bed G0 X199 Z0.2 F8000 ; wipe, move quickly away from the bed G92 E0 M221 S100 ; set flow to 100%