# Z-offset nightmare

**URL:** <https://klipper.discourse.group/t/z-offset-nightmare/15766>\
**Category:** General Discussion\
**Created:** [April 14, 2024, 12:50pm UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766 "2024-04-14T12:50:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![twist-knight](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@twist-knight](https://klipper.discourse.group/u/twist-knight)\
**Post date:** [April 14, 2024, 12:50pm UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/1 "2024-04-14T12:50:47Z")

</div>

### Basic Information:

Printer Model: Tronxy xs5a-600 (modified to use a Voron stealthburner print head with a dragon UHF hotend)  
 MCU / Printerboard: octopus pro  
 Host / SBC: rpi  
 klippy.log

### Describe your issue:

[klippy.zip](https://klipper.discourse.group/uploads/short-url/c2vQxoDqVvUV7OiQQqy3lvuWs9t.zip) (1.1 MB)  
Hi everyone, I’ve been having trouble understanding how the z-offset works and is set. I’m sure I’m missing a step or have missed something in my config, but have no idea what it is.

Whenever I start a print, the bed raises up to the 0 position where it craches into the hot end and gouges the bed.

My setup procedure has been as follows:

- run manual\_probe doing the paper test and save\_config.
- repeat the same with probe\_calibrate
- I run bed\_mesh\_clear followed by bed\_mesh\_calibrate prior to starting my print.
- print starts and crashes into the bed.

Please can someone tell me the correct procedure? I upgraded to Klipper over a year ago and have always had this issue. The only workaround I’ve found that kind of works is to pass a g1 command at the start of the print to move the bed down, and sometimes even make live z adjustments while the first layer is going down.

---

<div class="post-metadata">

**Author:** ![TheFuzzyGiggler](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/thefuzzygiggler/32/12313_2.png) [@TheFuzzyGiggler](https://klipper.discourse.group/u/TheFuzzyGiggler)\
**Post date:** [April 14, 2024, 1:37pm UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/2 "2024-04-14T13:37:59Z")

</div>

I don’t see a start print macro in your Klippy.log, What is your gcode for the start print you’re using in your slicer?

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 14, 2024, 3:20pm UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/3 "2024-04-14T15:20:31Z")

</div>

According to your log you are homing with an endstop for Z, but you also have a BLTouch.

This works, but then you need to determine your z-offset with the endstop and, e.g., [Manual leveling - Klipper documentation](https://www.klipper3d.org/Manual_Level.html). Of course, your `position_endstop` must be in a way to stop the axis before it hits the bed. The fine tuning is done with the `Z_ENDSTOP_CALIBRATE` according to above link.  
If you do this, then you **must not mix** it with the probe.

If you want to home with the probe and do bed meshing with the probe, then you need to replace your Z-stepper endstop setting with:

```auto
[stepper_z]
...
endstop_pin: probe:z_virtual_endstop
...
position_min = -100 # --> Correct this to -2 
...
position_endstop = 16.918 # --> Remove this if you use the probe only

```

and then follow [Probe calibration - Klipper documentation](https://www.klipper3d.org/Probe_Calibrate.html)

I recommend going for “probe only”.

---

<div class="post-metadata">

**Author:** ![twist-knight](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@twist-knight](https://klipper.discourse.group/u/twist-knight)\
**Post date:** [April 15, 2024, 12:45am UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/4 "2024-04-15T00:45:37Z")

</div>

Interesting suggestion to just use the probe for the endstop but I don’t think it will work in my case. The printer has a large 600x600 bed with dual z motors, so it uses the z endstops to sync the 2 motors if they become out of since. I know of a hack to put a belt around the 2 to keep them in sync, but I’d rather not do that.

If I use z\_endstop\_calibrate with my current setup, what would be the steps? Is it:

- z\_endstop\_calibrate ;one off to set the end stop distance
- probe\_calibrate ;one off z offset between probe and print head

Then before print:  
-bed\_mesh\_clear ;clear any saved mesh  
-bed\_mesh\_calibrate ;generate a bed mesh

I feel this sequence will give me the same results I’m having now.

---

<div class="post-metadata">

**Author:** ![twist-knight](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@twist-knight](https://klipper.discourse.group/u/twist-knight)\
**Post date:** [April 15, 2024, 12:53am UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/5 "2024-04-15T00:53:58Z")

</div>

There’s not a lot in it:

G28

That’s it!

---

<div class="post-metadata">

**Author:** ![twist-knight](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@twist-knight](https://klipper.discourse.group/u/twist-knight)\
**Post date:** [April 15, 2024, 4:00am UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/6 "2024-04-15T04:00:02Z")

</div>

The more I think about this, I realise what I’d ideally like to do is run z\_endstop\_calibrate followed by some sort of calibration that gets the probe trigger point so that I can get the correct bed mesh and probe offset.

So is the right sequence:

- z\_endstop\_calibrate ; to get the z endstop point
- probe\_calibrate ; to get the trigger point and z offset

Is that all I need?

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [April 15, 2024, 5:56am UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/7 "2024-04-15T05:56:57Z")

</div>

> [@twist-knight](#):
>
> Interesting suggestion to just use the probe for the endstop but I don’t think it will work in my case. The printer has a large 600x600 bed with dual z motors, so it uses the z endstops to sync the 2 motors if they become out of since. I know of a hack to put a belt around the 2 to keep them in sync, but I’d rather not do that.

It works with the probe. To level the two z-axes, you use:

[https://www.klipper3d.org/Config\_Reference.html#z\_tilt](https://www.klipper3d.org/Config_Reference.html#z_tilt)

---

<div class="post-metadata">

**Author:** ![twist-knight](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@twist-knight](https://klipper.discourse.group/u/twist-knight)\
**Post date:** [April 18, 2024, 5:38am UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/8 "2024-04-18T05:38:19Z")

</div>

Just wanted to come back and say thanks! This has been far more reliable than anything else I have tried and finally makes it easier to start a print.

---

<div class="post-metadata">

**Author:** ![twist-knight](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@twist-knight](https://klipper.discourse.group/u/twist-knight)\
**Post date:** [April 18, 2024, 5:40am UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/9 "2024-04-18T05:40:27Z")

</div>

Thanks! I didn’t know about z\_tilt. This is working great for me now. Interestingly it also highlighted that I had my z & z1 steppers swapped around. Was causing all sort of issues when I first tried to correct with z\_tilt. All resolved now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [May 18, 2024, 3:40pm UTC](https://klipper.discourse.group/t/z-offset-nightmare/15766/10 "2024-05-18T15:40:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
