Layer shifts? TMC2209 - Klipper needs higher current than Marlin for Y-axis?

Basic Information:

Printer Model: Artillery Sidewinder X1
MCU / Printerboard: BTT SKR 1.4 Turbo / TMC2209
klippy.log
klippy.zip (289.4 KB)

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Been struggling with Klipper for a week now, and it seems that I can’t get it working with stealthChop enabled without extreme current on Y-axis.

The image is the same file, sliced with the same profile on the same printer.
(ignore stringing and stuff, it’s random old PLA, probably quite wet).

Started from Clanks’ config, which was a great starting point!
My config below.
Sidewinder_X1_SKR_1_4_Turbo_TMC2209_BLTouch.cfg (8.0 KB)

Here is what I tried:

  1. Default settings: 0.650 A, stealthChop on. massive Y-axis only layer shifts.
  2. Increase current to 0.800 A (same as Marlin). massive layer shifts (slightly better)
  3. Increase current to 0.900 A, still layer shifts
  4. Wondering if it’s my BTT Pad 7, setup new Klipper on a P4. Still happened.
  5. Wonder if it’s my Y-axis TMC2209 driver, swapped for a spare one. Still happened.
  6. Looked up specs on BTT 2209, peak current limit is 2.9 A. Nothing potentially interesting in the specs.
  7. Looked up the TMC config in Marlin, confirmed that stealthChop is on my default.
  8. Tried 1000 ma w/stealthchop On, still happened (but a little better again).
  9. Tried turning off stealthChop on Y-axis stepper, got marlin-equivalent print! So it must be stealthChop related!

I compared my settings to the default sidewinder configs and the skr1.4 configs, nothing seemed out of place.

Things I’m worried/wondering about:

  1. why would stealthchop only cause this problem on Y-axis?
  2. I started a print with Y-axis TMC at 1.2 A and was printing fine, but I bailed after 25%. There is no good reason to run current that high, no logic behind it.

So I’m lost. Please help me figure this out so I can move to klipper!
Thanks in advance for any help you can provide.

Do you use the same acceleration, micro steps, speeds and stuff as with Marlin?
Y axis is the heavy bed but should not be such a problem.
How warm/hot is the Y motor when under load?

I’ve SKR1.4 Turbo Modified base on a Alfawise U30 Pro with Linear Bearing and Dual Z.

First step, remove or increase Hold Current and stealthchop_threshold.
And you can disable interpolation of microsteps and set it to 128 or 256.

I reach 200mm/s with this settings (I use it only for travel but I print @140mm/s without problem.

My configuration : for Y

[stepper_y]
step_pin: P0.19
dir_pin: !P0.20
enable_pin: !P2.8
microsteps: 256
rotation_distance: 40.11144415

endstop_pin: !P1.28
position_endstop: -7
position_min: -7
position_max: 230
homing_speed: 50

[tmc2209 stepper_y]
uart_pin: P1.9
run_current: 1.200
hold_current: 0.950
interpolate: False

TMC2130: Missing steps when reaching "Stealthchop threshold"? · Issue #1363 · Klipper3d/klipper · GitHub

stealthchop_threshold: 999999

Might be a bit too much and cause high load on the system for no reason except noise.

Yes 128 work.
The printer is next to 2 bedrooms and since switching to 256 the printer has made less noise.

As for the load, I really had to put a 5V fan on the RPI4 but since then no more worries.

Without the fan, I had throttling alarms at 1.2Ghz.

But it work really good.

Why no interpolation with less micro steps?
But that is offtopic. :smiley:

1 Like

First thing I was reduce acceleration to match what I was doing with marlin. Its not the bed, marlin can it and I have faith that klipper can to at 800ma

Thanks… But why 1.2A for Y-axis when Marlin can do it with 800.ma?

Do you have a link to the Marlin source of the firmware?

Thanks for the reply.

Sure. Here’s a link to my marlin configs

More specifically, from configuration_adv.h:

/**

  • TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only
  • Use Trinamic’s ultra quiet stepping mode.
  • When disabled, Marlin will use spreadCycle stepping mode.
    */
    #if HAS_STEALTHCHOP
    #define STEALTHCHOP_XY
    #define STEALTHCHOP_Z
    #define STEALTHCHOP_I
    #define STEALTHCHOP_J
    #define STEALTHCHOP_K
    #define STEALTHCHOP_U
    #define STEALTHCHOP_V
    #define STEALTHCHOP_W
    #define STEALTHCHOP_E
    #endif

And…

#if AXIS_IS_TMC_CONFIG(Y)
#define Y_CURRENT 800
#define Y_CURRENT_HOME Y_CURRENT
#define Y_MICROSTEPS 16
#define Y_RSENSE 0.11
#define Y_CHAIN_POS -1
//#define Y_INTERPOLATE true
//#define Y_HOLD_MULTIPLIER 0.5
#endif

Let me know if you need anything else

If the hybrid thresholds in Marlin are still 100 for X and Y and you are printing slower or equally then it should be in StealthChop as Klipper is.
However the Marlin config seems to have a default acceleration of 800 whereas your Klipper config is at 1000. This can make a difference already and Marlin has interpolation disabled in your snippet above.

Otherwise TMC drivers are not only defined by their operation mode and current.
There are many more parameters set behind the scene and I do not know where or not the defaults are the same for Marlin and Klipper.

Best would be to have a TMC dump from Marlin and Klipper.
Personally I find 800 mA quite low for StealthChop and the bed-axis even if it seems to work with Marlin. I even have 900 mA for my KP3S that is much smaller. But it has an acceleration of 3500… :smiley:

Extruder in StealthChop however is not a good choice but that is up to you.

Thanks for the reply.
From what I’m seeing, I’ll try these modifications out:

stealthchop_threshold: 100
max_accel: 800
and for kick: microsteps: 256

I’m leaving current as 0.800, again because this is what should work and I don’t have a good reason to believe higher current is necessary. I’m assuming klipper is at least as good as marlin here. If not, then hopefully someone can help me understand why I would need that current set as high as 1.2 A rms (peak about ~1.7A, I know BTT TMC2209 can do up to ~2.9, but still…)

Any other suggestions?

Well that didn’t work. I’ll try again with 1.2 A.

Just a suggestion - which probably won’t actually help THIS problem - but I found with my default config that models could become detached but look like they were still in place even though they swivelled around. I reduced the “brim separation” to 0.1mm and this fixed my poor quality. Even if you attach the brim to the model till you eliminate all other problems, you cat still easily cut it off. Admittedly even your brim appears to have problems of it own.

Why do you not just run with 16 microsteps?
The higher the microsteps number is, the lower is the the torque per step.
My settings for Y with a massive 400x400mm² and a glass bed are :

# ==================== Y-Axis ===============================

[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 39.83
endstop_pin: ^!PJ0
position_endstop: 400
position_max: 400
homing_speed: 50.0
second_homing_speed: 10.0

[tmc2209 stepper_y]
uart_pin: PB2   
uart_address: 3
interpolate: True
run_current: 1.15  
stealthchop_threshold: 999999 

He uses 16 micro steps.
The code snippet with more is from another user.

1 Like

Hey @JassMan23 . Thanks for the reply. I have actually had that exact issue happen before, but this currently not the case. The first layer is stuck on there good (too good, I have to back off a bit on z-offset).

I don’t have a brim there, but what you are seeing is a skirt. I usually do 4-5 laps around to make sure the filament is running good and pressure has stabilized. Maybe not longer necessary, but old habits die hard :slight_smile:

Ok, so 1.2 A works. No layer shifts! Both at reg speed (60 mm for peremeters and at 80). Nice ringing at higher speeds (had that with Marlin as well), but Klipper has a way to fix that. Also that spool of filament is now dead so moving on to something dry that I work on to improve quality.

I still want an answer to as why higher current is needed from Klipper than Marlin.

Below is a TMC dump on my Y axis. I’m have an idea that marlin and klipper are somehow responding to load differently. I’m guessing something related to hybridthreshold or something.

SG_RESULT: 00000090 sg_result=144
PWM_AUTO: 00190042 pwm_ofs_auto=66 pwm_grad_auto=25
PWM_SCALE: 0000002d pwm_scale_sum=45
PWMCONF: c80d0e24 pwm_ofs=36 pwm_grad=14 pwm_freq=1 pwm_autoscale=1 pwm_autograd=1 pwm_reg=8 pwm_lim=12
DRV_STATUS: c0150000 cs_actual=21 stealth=1 stst=1
CHOPCONF: 24010053 toff=3 hstrt=5 tbl=2 mres=4(16usteps) dedge=1
MSCURACT: 0197011f cur_a=-225 cur_b=-105
MSCNT: 000002b8 mscnt=696
TSTEP: 000fffff tstep=1048575
FACTORY_CONF: 0000000e fclktrim=14
IOIN: 210000c1 enn=1 pdn_uart=1 step=1 version=0x21
OTP_READ: 0000000e otp_fclktrim=14
IFCNT: 00000019 ifcnt=25
GSTAT: 00000000
GCONF: 000001c0 pdn_disable=1 mstep_reg_select=1 multistep_filt=1
========== Queried registers ==========
SGTHRS: 00000000
TPOWERDOWN: 00000014 tpowerdown=20
TPWMTHRS: 00000000
IHOLD_IRUN: 00081515 ihold=21 irun=21 iholddelay=8
SLAVECONF: 00000200 senddelay=2

I’m actually not sure what you are hunting, but I typically set my currents according to the used stepper motor and not according to the used firmware.

A quick search suggests that the X1 uses different steppers for X and Y, where the X one is rated at 1.5A (run_current ~0.85 to 1.06) and the Y at 1.7A (run_current ~0.96 to 1.20).

2 Likes

I already mentioned the hybrid threshold somewhere above.

You are comparing apples with pears.
Just do as @Sineos wrote and be happy with it.

2 Likes