G21 ; set units to millimeters G90 ; use absolute coordinates M83 ; extruder relative mode M104 S[first_layer_temperature] ; set extruder temp M140 S[first_layer_bed_temperature] ; set bed temp G28; HOME ALL G32 ; MESH BED LEVELLING M109 S[first_layer_temperature] ; wait for extruder temp M190 S[first_layer_bed_temperature] ; wait for bed temp G4 S20 ;wait Sx seconds for temp to soak through the bed G28 Z ; Home Z axes again now that the bed is at temperature. G29 S1 ;Load the height map from file and activate mesh bed compensation M376 H5 ;Taper off bed compensation after Hx mm M572 D0 S0.04 ;set PRESSURE ADVANCE ;PRIME LINE G4 P100; Brief pause M300 S500 P800; Beep and we're off! G4 P100; Brief pause G1 X230.0 Y1.0 Z0.3 F6000.0 ; go to start of prime line G92 E0.0 ; set extruder position G1 X115.0 E20.0 F1000.0 ; prime line G1 E-0.5; retract G92 E0.0; reset extruder M915 X Y S3 R1 F1 ;stall detection