How to Fix Prusa MK4 Printing in Mid-Air

December 4, 2024

Watching your MK4 start printing in mid-air is more than just frustrating - it's a waste of time and materials. After lots of testing and head-scratching, we've discovered why it happens and how to fix it reliably. In this blog we'll share how we discovered it, our approach to solving the issue, and give you what you need to fix it on your own MK4 printers.

Watching your MK4 start printing in mid-air is more than just frustrating - it's a waste of time and materials. This issue has been discussed on a number of forums*, and we discovered it for ourselves while developing automatic part ejection for the MK4. After lots of testing and head-scratching, we've discovered why it happens and how to fix it reliably. In this blog we'll share how we discovered it, our approach to solving the issue, and give you what you need to fix it on your own MK4 printers.

Contents:

What's Actually Happening?

The MK4 uses a force sensor in the extruder to detect when the nozzle touches the build plate. In theory, this is great for precise homing. In practice, we found that this sensitive sensor can be triggered too early by something seemingly unrelated - tension from your filament spool.

This issue typically shows up as your first layer starting to print in mid-air, because your printer seemingly thinks it has reached the bed when it clearly hasn’t. 

Why It Happens

Through our testing, we found this happens most often when:

  • You've just finished printing a tall part
  • You're using a fresh, spool of filament (especially a 5kg spool)
  • Your spool is mounted in certain positions around the printer

We also found that when manually printing, pulling slack into the filament line before the print started would allow the nozzle to properly meet the bed.

The occurrence of the issue combined with our temporary solution confirmed that the issue comes down to filament tension. When the printer needs to move down a long distance to home, or when a heavy spool is pulling on the filament line, it can fool that sensitive force sensor into thinking it's touched the bed when it hasn't.

Finding the Right Fix

We went through several solutions before finding the combination that really works.

Solution Attempt #1

As mentioned above, we tried manually pulling slack into the filament line, but doing this every print would be disruptive and time-consuming. Not to mention it wouldn’t work with automatic part ejection.

Solution Attempt #2

Next, we tried altering the start gcode so it would tell the nozzle to move very close to the bed, then activate the force sensor and home the printer. This didn't always work because when the MK4 is restarted, it doesn't always know how close to the bed it is. It also doesn't relieve the filament from any residual tension that built up when the extruder was pulling filament from the last print.

Solution Attempt #3

Next, we tried a more aggressive approach, adding start gcode that would add a rapid back and forth movement of the nozzle before homing. This would cause the printer to "jerk" the filament forward and create some slack. It worked, but was inconsistent, because the amount of pull required depended on the position of the spool.

The Solution That Works

Since the previous solutions were all unreliable, we kept going, and after extensive testing, we found that combining two simple changes creates a reliable fix:

Final Solution #1

We added start gcode that instructed the printer to retract 50mm of filament before homing, so right before auto leveling, the printer would back up filament that was inside the nozzle to create 50mm of slack. This provided sufficient slack in the filament line to prevent it from tugging on the print head while it was tapping the build plate.

Final Solution #2

To make sure that our previous solution held up regardless of the spool position, we added a fixed length bowden tube to the printer. This bowden tube was fixed between the top of the printer and the extruder, which forced a constant amount of slack to always be present in the filament path and ensured that the filament always entered the machine from a fixed position. This second part of the solution was especially important for big spools, which can't be put on top of the machine. An extra bonus is that the bowden tube would also guide the filament consistently into the extruder, resulting in better quality prints regardless of where the spool is mounted.

Making It Work For You

While we've built the start gcode into AutoFarm3D™ for Mk4, we believe in sharing solutions with the community. To implement this fix yourself, you can use the following start gcode:

M73 P0 ; Set progress to 0
M17 ; enable steppers
M906 X900 Y900
M914 Y-6
M862.1 P[nozzle_diameter] ; nozzle diameter check
M862.3 P "MK4" ; printer model check
M862.5 P2 ; g-code level check
M862.6 P"Input shaper" ; FW feature check
M115 U5.1.2+13478

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

M140 S[first_layer_bed_temperature] ; Start warming bed

G1 Z1 ; Move nozzle down to prevent filament tightness before first home
G1 Y20 F6000
G1 X0 F12000 ; Get X ready for home and pull tension
G92 E0 ; Reset extruder coord
G28 X
G28 Y
G1 X250 F12000 ; Fast swipe to pull tension
G1 X40 ; Where nozzle will touch bed
G1 Y-4 ; Where nozzle will touch bed
M106 S255 ; Try to prevent oozing
M109 S190 ; Wait to Warm Extruder and soften filament without oozing
M107
M84 E ; Turn off E motor
G1 Z0 ; Smoosh nozzle into bed while warm
M106 S255 ; Blast fan
M109 R170 ; Wait to cool to 150
M302 S140 ; lower cold extrusion limit to 140C
M107 ; Fan off
G1 E-20 F1200 ; Retract to create slack for homing
M84 E ; turn off E motor
G28 C ; home Z without mesh bed level
G1 X0 Y-3.5 Z1.5 F4800 ; Prepare for purge

; Huge purge
M190 S[first_layer_bed_temperature] ; Wait bed temp
;M109 S[first_layer_temperature] ; Wait extruder temp (should be 240)
M109 S240
G92 E0
G1 X95 Y2 Z4.5 F4800; Go to front of bed to begin purge line
G1 E30 F1600 ; Un-Retract homing slack plus 10mm retraction from previous print
G92 E0
M104 T0 S150 ; Drop hotend temp
M302 S110 ; lower cold extrusion limit to 110C
M106 S255 ; Blast fan
G4 S3 ; Wait a sec
G1 Y-4 Z2.5 E6 F800
G1 X120 Z0.8 E20 F1000 ; Fast first layer
G1 X145 E20 F900; Draw purge line
G1 Y-2 E1 F800;    Move back for second line
G1 X110 E26 F800;  Draw second purge line
G1 Y0 E1 F800;     Move back for third line
G1 X145 E26 F800;  Draw third purge line
G1 Z1.6;           Lift nozzle for second layer
G1 X110 E28 F500;  Draw first second layer
G1 Y-2 E1 F500;    Move forward
G1 X145 E28 F500;  Draw second second layer
G1 Y-4 E1 F500;    Move back for third line
G1 X110 E28 F500;  Draw third second layer
G1 Y-1;            Move back over second/third purge line
G1 X125 E-10 F1200 ; retraction and wipe nozzle
G0 X200 F4800; Move quickly away
G0 Z5

; Use purge as wipe area
M109 R140 ; Wait cool nozzle to 150 and ooze to come out
M107 ; Disable fan
G0 Z1.25 ; Rub purge at -0.35 height deficit
G0 X112 F4800; Rub nozzle over purge 1 (fast)
G0 X138 ; Rub nozzle over purge 2
G0 X112 ; Rub nozzle over purge 3
G0 Z2 F4800; Move nozzle up
M106 S255 ; Blast fan to prevent ooze
G1 E-50 F1600; Retract 50mm more to produce filament slack (60mm total)

M104 T0 R120 ; Start cooling nozzle

; Clear stuck purge lines
G0 Z0.3 Y14 X250 F12000
G0 Z0.1 X0 F12000
G0 Y12 F6000
G0 X250 F12000
G0 Y10 F6000
G0 X0 F12000
G0 Y8 F6000
G0 X250 F12000
G0 Y6 F6000
G0 X0 F12000
G0 Y4 F6000

M109 T0 R120 ; Wait for 120 prevent any ooze before / while homing

M84 E ; turn off E motor
G28 ; home all without mesh bed level
M302 S160 ; Raise cold extrusion limit to 160C
M107 ; Turn off fan so any residue can squish during auto level
G29 P9 X10 Y-4 W32 H4
{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}

G0 Z40 F10000
M107

;
; MBL
;
M84 E ; turn off E motor
G29 P1 ; invalidate mbl & probe print area
G29 P1 X0 Y2 W50 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 nozzle prime
M104 S{first_layer_temperature[0]}
G0 X0 Y20 Z2 F4800 ; move away and ready for the purge
G0 Z0 ; Get near bed
M109 S{first_layer_temperature[0]}

M84 S0 ; Disable stepper idle timeout

; Re-extrude material
G92 E0
G1 E60 F1200 ; re-extrude to pull slack back in
G1 Z4 F4800
G1 E2 F1200 ; Prime with 2mm of filament
G92 E0
M569 S0 E ; set spreadcycle mode for extruder
G0 X40 F12000

G92 E0
M221 S100 ; set flow to 100%
M104 S{first_layer_temperature[0]}
M906 X900 Y900

We also recommend adding a bowden tube to your printer alongside using this start gcode.

What's Next?

Have you experienced this homing issue with your MK4? We'd love to hear about your experiences or answer any questions about implementing this fix.

*Forum posts about this issue: