M915 X Y S3 R0 F0 ; stall detection G1 E-3 ; retract filament by 3 mm {if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move bed down G1 X50.0 Y250.0 M84 ; disable motors M104 S0 ; turn off temperature M140 S0 ; turn off heatbed M107 ; turn off layer fan ;; PLAY A TUNE M300 ;Beep G4 P1000 M300 S440 P400 G4 P500 M300 S660 P500 G4 P500 M300 S880 P600