I have a Prusa i3 that homes properly when you use the menu. After adjusting the bed and homing several times, it keeps the head at a reliable distance. However, when I try to print from an SD card, the printer buries the hot end in the heat bed.

What needs to be adjusted to fix this issue?

G-code from one of the 2 files

M190 S50.000000
M109 S200.000000
;Sliced at: Mon 13-06-2016 15:39:25
;Basic settings: Layer height: 0.2 Walls: 1.2 Fill: 20
;Print time: 3 hours 47 minutes
;Filament used: 11.435m 34.0g
;Filament cost: None
;M190 S50 ;Uncomment to add your own bed temperature line
;M109 S200 ;Uncomment to add your own temperature line
G21        ;metric values
G90        ;absolute positioning
M82        ;set extruder to absolute mode
M107       ;start with the fan off
G28 X0 Y0  ;move X/Y to min endstops
G28 Z0     ;move Z to min endstops
G1 Z15.0 F3000 ;move the platform down 15mm
G92 E0                  ;zero the extruded length
G1 F200 E3              ;extrude 3mm of feed stock
G92 E0                  ;zero the extruded length again
G1 F3000
;Put printing message on LCD screen
M117 Printing...

;Layer count: 446
M106 S127
G1 F2400 E-4.50000
G0 F3000 X81.474 Y58.603 Z0.300
G1 F2400 E0.00000
G1 F2220 X83.063 Y56.456 E0.06663
G1 X84.277 Y55.080 E0.11240
G1 X84.836 Y54.444 E0.13353
G1 X85.799 Y53.476 E0.16759
G1 X86.755 Y52.587 E0.20015
G1 X87.179 Y52.244 E0.21376
G1 X88.836 Y50.911 E0.26680
G1 X89.285 Y50.610 E0.28029
  • $\begingroup$ Can you share the beginning of your g-code (from the beginning until it starts getting into printing moves)? $\endgroup$
    – tjb1
    Feb 15, 2017 at 12:15

3 Answers 3


The correlation between the endstop switch -- or sensor -- and the surface of the bed is not known a priori . In your case, there are two possibilities. I'd say the more likely is that your g-code generator is not setting the Z-height offset from the bed correctly. The other is that your bed is tilted, so proper Z-home at one corner does not match the entire bed.

Try this: first manually move the extruder head to all four corners and adjust the bed screws until the separation is identical at all times. Then let your gcode start up -- and don't worry if the extruder depresses the bed during homing, as that doesn't matter. See where the extruder is once the print starts. Adjust the endstop switch up or down to compensate until the print head when printing is just off the surface and the first layer adheres well.

If all that doesn't work, then you may have the wrong printer profile settings in your slicing softwqre.

  • $\begingroup$ I did a leveling and prior to printing it properly stays at height. the gcode came with the printer as a test file from the manufacturer. I tried 2 of their files and with the same result. when it starts printing it mashes down on the switch untill it cant bend it any further. If i manually raise the nozel to the proper height and resume printing it seems to print normally. The other thing i noticed was in my instruction manual there is a z offset option in the marlin firmware but on my machine it does not have that option. the display shows z height as 0 from the beginning and raises. $\endgroup$
    – Kendrick
    Feb 15, 2017 at 21:11
  • $\begingroup$ Bad Gcode "G1 Z15.0 F3000 ;move the platform down 15mm" for some reason the manufacutrer put that in the startup of the profile for the machine in the slicing software as well as all there test prints. $\endgroup$
    – Kendrick
    Mar 20, 2017 at 19:31

You didn't share much details, which is problem with any question. But let me give some recommendations - I have Prusa i3 MK2 1.75mm.

The fact that it homes correctly does not at all mean that your Y axis is OK.

  • Verify that PINDA probe's bottom end is maximum 1 millimeter above the extruder head.
  • Double check that PINDA probe is correctly screwed and does not wiggle.
  • Manually check that the printer does not allow you to toutch heatbed with extruder, follow these steps:
    1. Wait for both heatbed and hot end to cool down.
    2. Put paper sheet on heatbed
    3. Go to Menu - Settings - Move Axis - Z Axis
    4. Move the axis down. If hot end toutches and presses on the paper, the calibration is not OK at all.
  • Updating your firmware can't hurt if you didn't do it already.

If this advice does not help you, please update the question to address the following questions:

  • How does your G-code beginning work? Ideally, share some short G-code, I could easily check whether it is correct with my printer.
  • Does XYZ calibration pass correctly in your printer?
  • Take a picture of your extruder so that both PINDA and extruder are visible
  • $\begingroup$ Z-axis is usually vertical. Typo on your part? $\endgroup$ Feb 15, 2017 at 18:58
  • $\begingroup$ BTW, Prusa i3 stock uses a limit switch, not a probe. $\endgroup$ Feb 15, 2017 at 18:59

I had the same issue: Z-axis correctly homing manually but not when printing.

What worked for me is disabling the following line in the Marlin configuration file:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .