Layer Shift when using Klipper

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?!

.zip contains klipper.log and printer.cfg:
Klipper_log_printer_cfg.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. :slight_smile:
btw. im german, i hope my english is passable :wink:

Hello @TheDuke !

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

Do you hear some clicking when the layer shifts happen?

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

Is there a reason to use relative_reference_index?

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.

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.

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.

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)

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

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 carefully before doing any other steps

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.

step_pulse_duration = 0.000000100
square_corner_velocity = 10.0

Remove these settings

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.

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 :frowning: I really hope ther is a solution, or I have to roll back and stick with Marlin.

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.

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.

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

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 (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.

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

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

block.

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.

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.