# Layer Shift when using Klipper

**URL:** <https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773>\
**Category:** General Discussion\
**Created:** [August 8, 2022, 11:00pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773 "2022-08-08T23:00:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 8, 2022, 11:00pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/1 "2022-08-08T23:00:23Z")

</div>

Hello,

I’m new to Klipper, so far I managed to get everything “working” but when printing a simple XYZ cube I’m getting consisting layer shifts. I already tried to play with the stepper currents, accelerations, speeds, TMC debbuging showed no overheating issues, no preasure advanced or inputshaping is used and checked all mechanical parts, which seems to be fine, in fact, when reflashing Marlin and printing the cube, I have absolutely no issues, so it’s seems to be a problem with klipper. Also, my Heightmap is all over the place, because of it … I guess.  
All values I used in Marlin I have converted to klipper. So I don’t know which values should be the problem, maybe missing stuff in printer.cfg,  
Currently i have no clue what to do now, and need some help.

But first some printerInfos:  
Printer: Anycubic Predator (D) Delta Printer  
Board: SKR 1.4 Turbo and Raspberry Pi 4B 8gb  
Drivers: TMC 2209 with UART  
Stepper: Wantei Nema 17, 1.7A, 1.8° stepangle  
OS: MainsailOS (latest version)  
Display: BTT PI TFT50 with Klipperscreen  
Probe: BLTouch v3.1 using pin 1.0 (PWRDET) because pin 0.1 (Probe) not working in klipper?!

 ![Screenshot 2022-08-09 005941](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/c/cd853c48eb13fe6b4f32e1f086deb8548b7e7b85.png)

.zip contains klipper.log and printer.cfg:  
[Klipper\_log\_printer\_cfg.zip](https://klipper.discourse.group/uploads/short-url/k0dDmA9tgParf14HYO8pcjKOexb.zip) (1.2 MB)

just a side note:  
Honestly, so far I am very disappointed in Klipper, the usage and feature set is awesome, but does really matter if it’s not working as supposed and It was a real hassle to get so far and the results is … meh … but I would really like to get it working. 🙂  
btw. im german, i hope my english is passable 😉

---

<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:** [August 9, 2022, 5:22am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/2 "2022-08-09T05:22:06Z")

</div>

Hello @TheDuke !

How did it work with the current set to 1A?

Do you hear some clicking when the layer shifts happen?

---

<div class="post-metadata">

**Author:** ![Arakon](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@Arakon](https://klipper.discourse.group/u/Arakon)\
**Post date:** [August 9, 2022, 6:07am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/3 "2022-08-09T06:07:06Z")

</div>

With your mesh looking like that, it’s very possible that the nozzle is hitting the print and loosing position.

---

<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:** [August 9, 2022, 6:43am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/4 "2022-08-09T06:43:34Z")

</div>

Is there a reason to use `relative_reference_index`?

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 8:46am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/5 "2022-08-09T08:46:10Z")

</div>

Usually I have it at 0.950, I have Nema 17 steppers with 1.7A.  
I read in other post it could be too low, so I bumped it up a notch, other post suggested it’s too high, it could be overheating, so I tried 0.8, but the layer shifting issue stayed unchanged.  
I cannot hear any clicking while printing, everything sounds normal.

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 8:49am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/6 "2022-08-09T08:49:01Z")

</div>

I also had this in mind, but I watched it, and it wasn’t the case.  
While printing the XYZ cube it is using a small area anyway, first layer looked good.  
Also, because it’s a Delta, I have my Probe sitting centered below the nozzle, and I remove it after probing.

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 8:52am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/7 "2022-08-09T08:52:44Z")

</div>

I read about it in a post, that using `relative_reference_index` can help for better meshes, also because im using the middle of my bed as reference, and it’s my most printed at area, having 15x15 probe points, relative\_reference\_index: 74 is my probe point in the center of my bed.  
I tried with and without, and it made no difference.

---

<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:** [August 9, 2022, 8:59am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/8 "2022-08-09T08:59:50Z")

</div>

`relative_reference_index` “clamps” you mesh to a certain value and is only used when you have a Z-Endstop as “absolute” reference point.  
Remove it and redo your mesh. A mesh +/- 0.4 is certainly not correct or you ran over your bed with a tank.

With max 1.7A steppers, you can go up to around 0.96A → 1.7 / sqrt(2) \* 0.8  
Although 0.8 should not lead to shifts provided your mechanics are proper)

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 9:15am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/9 "2022-08-09T09:15:43Z")

</div>

Oh, ok, ill better remove it. btw, the setting `relative_reference_index` was my last addition to my [bed\_mesh], before that I played with different `round_probe_count` and  
`mesh_pps`, but my bed mesh result stayed the same.  
That’s what I thought too, that my mesh is not correct … could the layershifts be, because of the compensation, based on the created bed mesh?

Ok, motor\_current back to 0.96A, same value I used in Marlin, worked flawlessly

---

<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:** [August 9, 2022, 9:25am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/10 "2022-08-09T09:25:50Z")

</div>

I never used a delta but I would assume that improper tuning of the delta parameters could also lead to strange z-values. Be sure to have followed [Delta calibration - Klipper documentation](https://www.klipper3d.org/Delta_Calibrate.html) carefully before doing any other steps

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 9:46am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/11 "2022-08-09T09:46:33Z")

</div>

Currently, I’m releveling and calibrating without `relative_reference_index`.  
I’ll try to print without a bed mesh too, and see what’s happening, haven’t tried it yet.  
I followed the Delta calibration - Klipper documentation closely, but haven’t tried the Endstop phase calibration yet.

Btw, I have an ADXL345 installed, and also tried the calibration, but I don’t use it in my printer.cfg yet. But I noticed during the calibration, my print head didn’t stay in one place, it started to move slightly to the side, I mean not the back and forth movement, I mean at the end the printhead isn’t centered anymore, it’s like halfway to the edge of the print bed  
Also, when doing the mesh bed calibration, my first probe point is closer to the edge than it should be.

---

<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:** [August 9, 2022, 10:02am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/12 "2022-08-09T10:02:41Z")

</div>

`step_pulse_duration = 0.000000100`  
`square_corner_velocity = 10.0`

Remove these settings

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 11:45am UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/13 "2022-08-09T11:45:34Z")

</div>

I printed now 3 new xyz cubes.  
The first one is without `relative_reference_index`  
The second one is with `endstop phase calibration`  
The third one is without an `bed_mesh`  
All cubes have the same amount of layer shift.

I noticed in the auto-generated section, the entry “angle” under [stepper\_a b and c]  
and those values are quite different from each other, I don’t know what the value is for.  
I guess it’s the tower angle, in Marlin my M503 say:

Delta L: diagonal-rod, R: radius H: height, S: seg-per-sec XYZ: tower-angle-trim ABC: rod-trim:  
M665 L440.00 R214.25 H375.94 S200.00 X-0.23 Y0.20 Z0.03 A0.00 B0.00 C0.00  
vs Klipper:  
[stepper\_a] angle = 210.111215, [stepper\_a] angle = 330.053746, [stepper\_c] angle = 90.000000

The tower angle or rod trim values are very, very little in Marlin, and not so different from each other. Dunno if I’m on the right track here. I’m going to try to print without even the delta calibration, just trying to get the Z-Height right, and start printing and see what happens.

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 2:11pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/14 "2022-08-09T14:11:13Z")

</div>

I have printed another cube without any `Delta_Calibration`, or `Bed_Mesh`, I have removed the entire auto-generated section and removed the suggested settings and still the Cube come out with layershifts, and it didn’t get any better or worse.

The way I currently see and assume it is:  
Printing with Marlin works flawlessly, so it’s not a mechanical, electrical or gcode issue.  
Using the same essential and working values from Marlin and the printer printing tells me my printer.cfg is probably not at fault here too.  
Printing without any calibration, leveling or compensation, with succeeding print, and still have layershifting issues tells me the following:

Either, it’s a fundamental problem with Klipper, being an unreliable software/3DPrinterOS which may or may not work, depending on luck or whatever, or It’s an incompatibility with Klipper and my Hardware, which isn’t any better because my Hardware from Bigtreetech is well-known and widespread, and should be supported, but since other people using Klipper with the same Hardware, incompatibility isn’t the case.

I hope it doesn’t sound like a rant, it is not supposed to be one, but wasting a week on this doesn’t make me happy ☹ I really hope ther is a solution, or I have to roll back and stick with Marlin.

---

<div class="post-metadata">

**Author:** ![ReXT3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/rext3d/32/200_2.png) [@ReXT3D](https://klipper.discourse.group/u/ReXT3D)\
**Post date:** [August 9, 2022, 2:17pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/15 "2022-08-09T14:17:24Z")

</div>

> [@TheDuke](#):
>
> But I noticed during the calibration, my print head didn’t stay in one place, it started to move slightly to the side, I mean not the back and forth movement, I mean at the end the printhead isn’t centered anymore, it’s like halfway to the edge of the print bed

Disclaimer - I have not looked at your logs. My thoughts are that your steppers are either skipping steps or your stepper pulleys are loose & shifting.

Skipping steps: one possibility is that your sense resistor value is configured incorrectly and you are not supplying the current that you think you are.

Loose pulleys: it’s possible that they were marginally loose and moving to Klipper “shook them loose” while you were experimenting with configuration.

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 2:32pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/16 "2022-08-09T14:32:16Z")

</div>

> I have not looked at your logs. My thoughts are that your steppers are either skipping steps or your stepper pulleys are loose & shifting.  
> Loose pulleys: it’s possible that they were marginally loose and moving to Klipper “shook them loose” while you were experimenting with configuration.

I dont have Pullys, I have linear rails, ther is nothing lose, only thing i can check is belt tension, and screws holding everything togehter, but on that side everything is correct.  
I just have to switch SD cards, disconnect the USB cable, run Marlin, and it works, if its a mechanical issue, it would affekt my prints in Marlin too. I switched a few times back and forth and only Klipper shows this flaws, ther is nothing shooked loose.

> Skipping steps: one possibility is that your sense resistor value is configured incorrectly and you are not supplying the current that you think you are.

I hope its as simple as a false entry in my configuration but i dont know where or what is at false.

---

<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:** [August 9, 2022, 2:41pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/17 "2022-08-09T14:41:09Z")

</div>

> [@TheDuke](#):
>
> Either, it’s a fundamental problem with Klipper, being an unreliable software/3DPrinterOS which may or may not work, depending on luck or whatever, or It’s an incompatibility with Klipper and my Hardware, which isn’t any better because my Hardware from Bigtreetech is well-known and widespread, and should be supported, but since other people using Klipper with the same Hardware, incompatibility isn’t the case.

Puh, really hard to remain in a helpful attitude.

- You managed to run a precompiled Marlin bin. Nice.
- Your Klipper config clearly shows a wild combination of settings that you apparently do not understand
- Now you start philosophizing about a fundamental Klipper issue where probably thousands of Klipper delta instances are running without issue

Having said this, lets get back to problem solving:

1. Post a fresh klippy. log
2. As far as my understanding of a delta goes, you do not even have to try printing without a proper and very careful calibration.
  - Each positioning move in a delta needs X,Y and Z axis to define the intended position.
  - If any value is wrong you will get strange effects and these are “positional effects”, meaning you will have a different effect in the lower left corner, compared to the upper right. It will be different at Z=0 compared to Z=10 etc

---

<div class="post-metadata">

**Author:** ![TheDuke](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@TheDuke](https://klipper.discourse.group/u/TheDuke)\
**Post date:** [August 9, 2022, 3:03pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/18 "2022-08-09T15:03:09Z")

</div>

> [@Sineos](#):
>
> - You managed to run a precompiled Marlin bin. Nice.
> - Your Klipper config clearly shows a wild combination of settings that you apparently do not understand
> - Now you start philosophizing about a fundamental Klipper issue where probably thousands of Klipper delta instances are running without issue

You are right, I’m sorry, sometimes, it’s just frustrating for me after a week of research, trying and failing.

Here is a fresh klipper.log:  
[klippy\_09082022\_1643.log](https://klipper.discourse.group/uploads/short-url/lkSlAeoKx7aA3EQLlDjaIhqiQj2.log) (6.8 MB)

> As far as my understanding of a delta goes, you do not even have to try printing without a proper and very careful calibration.

Correct, would mean the calibration I did is as good as having no calibration, but I honestly don’t know what I’ve done wrong.  
I assume the Delta Kinematic in Klipper is not different from the Delta Kinematics in Marlin, I don’t know which values I’ve got wrong, since they worked in marlin.

---

<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:** [August 9, 2022, 3:20pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/19 "2022-08-09T15:20:24Z")

</div>

> [@TheDuke](#):
>
> I assume the Delta Kinematic in Klipper is not different from the Delta Kinematics in Marlin, I don’t know which values I’ve got wrong, since they worked in marlin.

I would not rely on the fact that these values are interchangeable between Marlin and Klipper.  
`delta_radius`, `angle`, and `arm_length` **must** be calibrated via the instructions provided in the documentation. When this is done properly they will automatically be moved from your manually edited config into the

```auto
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.

```

block.

---

<div class="post-metadata">

**Author:** ![ReXT3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/rext3d/32/200_2.png) [@ReXT3D](https://klipper.discourse.group/u/ReXT3D)\
**Post date:** [August 9, 2022, 3:20pm UTC](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773/20 "2022-08-09T15:20:29Z")

</div>

> [@TheDuke](#):
>
> I dont have Pullys, I have linear rails, ther is nothing lose, only thing i can check is belt tension, and screws holding everything togehter, but on that side everything is correct.

Your stepper moves the belt with a pulley attached to its shaft. A pulley slipping on the shaft will cause layer shifts. If your configuration in Klipper were to use higher accelerations, it can slip the pulleys while they may not slip in Marlin. I am not suggesting this is a root cause, just one possibility.

> [@TheDuke](#):
>
> Here is a fresh klipper.log:  
> [klippy\_09082022\_1643.log](https://klipper.discourse.group/uploads/short-url/lkSlAeoKx7aA3EQLlDjaIhqiQj2.log) (6.8 MB)

Your log shows that your `[tmc2209]` sections do not define `sense_resistor` value. If your step sticks sense resistors are not the default 0.110 Ohm then you are pushing incorrect current through your steppers. This is to my earlier point.

[Next page](https://klipper.discourse.group/t/layer-shift-when-using-klipper/3773.md?page=2)
