TMC5160 - Classic Constant Off Time Chopper with fast decay time

Hi folks,

I’m working on my CoreXY with a SKR 2 and TMC5160 stepper drivers.
Due to visible VFA (I think those are VFAs) I try to set up the TMC5160 into Classic Constant Off Time Chopper by setting chm=1.
As the motors are now horribly loud I want to change the fast decay time.
When I check the datasheet of the Trinamic driver (page 52 on https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC5160A_Datasheet_Rev1.14.pdf) it says:
“Fast decay time setting (MSB: fd3):”
But I feel too dump to get this configured as I don’t know how to pass the most significant bit (MSB).

Does Klipper support this mode with all settings and how can I properly set this up? :face_with_raised_eyebrow:

Or do you have other ideas on preventing VFAs? Custom MSLUT?

Thanks in Advance!

there is a command: driver_FD3: 1

image

the hstrt field is for the fast decay config when fd3=1 and chm=1

Oh man, thank you! :partying_face:
I overlooked this parameter and was looking for that TFD thing where I only found TPFD.
And I thought I have to somehow build TFD from FD3 and HSTRT by shifting bits and stuff.
Maybe I can try this tomorrow. Currently building a new canbus cable for my print head that hopefully eliminates my second resonance peak…

Now with clearer mind and a big cup of coffee I looked at this again. :coffee:

Like TPFD TFD is 4 bits wide as seen in the datasheet: %0000 ... %1111 but HSTRT only gets 3 bits assigned hence FD3 is needed as 4th bit.
In this case FD3 is the most significant bit as stated in the datasheet as well.

This means HSTRT gives us the TFD values 0-7 and with the 4th bit of FD3 it “enables” 8-15.

Just tried a tower for passive fast decay (TPFD) but while I was not in the room the filament broke… So currently reprinting to check for any influence of that parameter regarding to my VFA/2 mm ripples.

Then afterwards I’ll check if my little macro works and then I’ll rebuild the tower with CHM=1 and these new findings.

It looks like it worked as the steppers sounded different but unfortunately it did not affect the ripples in any way.
I printed a TPFD tower, a TFD tower and a sine wave offset tower with increasing values each 4 mm.
But at least Klipper let me configure the classic constant off time chopper mode with different fast decay times. :slight_smile:

i replaced my 2209 with 5160 and played a bit around with full step ( chm=1 )

i dont know your stepper motors, but you can give my settings a try:

  1. add the thigh field in tmc5160.py

nano /home/pi/klipper/klippy/extras/tmc5160.py

  1. set the register to i.e to 1 ( this is the switching speed ), i made it here ( a bit down in the same file ):

  2. ctrl + x to save the changes

  3. sudo service klipper restart

  4. try my tmc5160 settings ( adjust your current!! - pin settings are from skr3 ):

########################################
# TMC5160 configuration
########################################

[tmc5160 stepper_x]
diag1_pin: PC1
cs_pin: PD5
spi_software_miso_pin: PE15
spi_software_mosi_pin: PE13
spi_software_sclk_pin: PE14
sense_resistor: 0.075
interpolate: false
run_current: 1.414
hold_current: 1.414
driver_TBL: 2
driver_TOFF: 3
driver_HSTRT: 0
driver_HEND: 2
driver_FD3: 1
driver_TPFD: 4
driver_CHM: 1
driver_VHIGHCHM: 1

[tmc5160 stepper_y]
diag1_pin: PC3
cs_pin: PD0
spi_software_miso_pin: PE15
spi_software_mosi_pin: PE13
spi_software_sclk_pin: PE14
sense_resistor: 0.075
interpolate: false
run_current: 1.414
hold_current: 1.414
driver_TBL: 2
driver_TOFF: 3
driver_HSTRT: 0
driver_HEND: 2
driver_FD3: 1
driver_TPFD: 4
driver_CHM: 1
driver_VHIGHCHM: 1

tested with 256usteps for x and y ( needed because of VHIGHCHM )

/edit: forgot to set the driver_VHIGHCHM: 1 setting in tmc5160 printer.cfg section, as i edited it dircetly in the tmc5160.py by default - this is important

let me know if it helps you

forgot to set the driver_VHIGHCHM: 1 setting in tmc5160 printer.cfg section, as i edited it dircetly in the tmc5160.py by default - this is important

Oh nice, will test this tomorrow!
Thank you.

Currently I’m using StepperOnline 17HM19-2004S1 0.9° motors.
But apparently since changing the CANBus cable to the print head the printer randomly halts or whatever it does.
Have to work on this as well afterwards.

OK I have currently the same for x and y. So my test config will fit (hstart and hend hyst. ) . Im looking for the moons 0.9 2a nema 17 Motors but Hard to find in germany…

I don’t know why but in CHM=1 mode my stepper motors become quite hot even though only being set to 0,850 A at the moment.
If you have the same motors and run them with 1,4 A the should melt?!

When I run with native 256 msteps with speed of for example 200 mm/s the MCU resets… Maybe the OrangePi is not fast enough. Trying to check how fast I can go with 128 msteps but all those tests in the past did not change anything on the VFAs/ripple marks…

A friend tested some 0.9° moons and was quite disappointed.
If I remember correctly he tested Trinamic steppers as well and those were quite good.

As you are in full step Mode with chm=1 you always have the peak value. Strange because the Motors should handle 2a…

You have These right? https://www.omc-stepperonline.com/de/nema-17-bipolar-0-9-grad-46ncm-2a-2-8v-42x42x48mm-4-draehte-17hm19-2004s

My Motors are about 45 to 50 degree measured with infrared

i can only find 1,8° Trinamic stepper motors?

Moons were 0.9° and the Trinamics 1.8°.

actually im printing without VHIGHCHM and without VHIGHFS ( driver_VHIGHCHM: 0 & driver_VHIGHFS: 0 ) and with TPFD = 2 ( driver_TPFD: 2 )

[tmc5160 stepper_x]
diag1_pin: PC1
cs_pin: PD5
spi_software_miso_pin: PE15
spi_software_mosi_pin: PE13
spi_software_sclk_pin: PE14
sense_resistor: 0.075
interpolate: false
run_current: 1.414
hold_current: 1.414
driver_TBL: 2
driver_TOFF: 3
driver_HSTRT: 0
driver_HEND: 2
driver_FD3: 1
driver_TPFD: 2
driver_CHM: 1
driver_VHIGHCHM: 0
driver_VHIGHFS: 0

[tmc5160 stepper_y]
diag1_pin: PC3
cs_pin: PD0
spi_software_miso_pin: PE15
spi_software_mosi_pin: PE13
spi_software_sclk_pin: PE14
sense_resistor: 0.075
interpolate: false
run_current: 1.414
hold_current: 1.414
driver_TBL: 2
driver_TOFF: 3
driver_HSTRT: 0
driver_HEND: 2
driver_FD3: 1
driver_TPFD: 2
driver_CHM: 1
driver_VHIGHCHM: 0
driver_VHIGHFS: 0

best results so far in my case: regarding stepper motor noise and print surface - without VHIGHCHM and VHIGHFS set there is also no need to change the tmc5160.py to add the thigh field

With these ( fullstep aka CHM = 1 ) settings, im actually driving 15k acceleration and 800mm/s for travel moves via macro ( Custom Travel Acceleration ) - works great with 2A 0,9 stepper motors

Very strange why my motors are so loud and warm then.
Just swapping my OrangePi Zero with the RasPi 4 of my KP3S as the MCU always resets on high speeds and high msteps.

What is your motor voltage? 24V like I’m using?

Also 24v. Skr3 Board. Raspi4 oc to 2,5 GHz with Fan. Self compiled Python2 with arm optimized compiler flags for more Performance :

./configure --prefix=/usr --enable-unicode=ucs4 --with-threads --enable-shared --enable-optimizations --with-lto --with-ensurepip=install CFLAGS=" -mtune=cortex-a72 -march=armv8-a -mcpu=cortex-a72 -O3 " CPPFLAGS=" -mtune=cortex-a72 -march=armv8-a -mcpu=cortex-a72 -O3 "

Then recreate the klippy-env with the New Python2 Version if you want to give it a try

And here a print and travel move Video ( large travel move at the end of the Video )

/edit: in the Video it seems to be louder than in real life and the mic was directly at the printer window

Hmm it is as loud as my printer.
But this is too loud for me and it did not help on the ripple marks.

Just switched not to the RasPi 4 and at least I now can achieve much higher speeds than before. Just need to rewire a bit and find place for the RasPi.

Will TPFD even work if you are using CHM=1 with fast decay time being set?

sorry for the late reply. if its too loud for you, you can increase the driver_HSTRT to 4 or more until u get a noisy squeak ( important is to set fd3 to 0 until you want to go greater 7 for hstrt ) - you can try these settings:

[tmc5160 stepper_x]
diag1_pin: PC1
cs_pin: PD5
spi_software_miso_pin: PE15
spi_software_mosi_pin: PE13
spi_software_sclk_pin: PE14
sense_resistor: 0.075
interpolate: false
run_current: 1.414
hold_current: 1.414
driver_TBL: 1
driver_TOFF: 2
driver_HSTRT: 4
driver_FD3: 0
driver_HEND: 3
driver_CHM: 1

[tmc5160 stepper_y]
diag1_pin: PC3
cs_pin: PD0
spi_software_miso_pin: PE15
spi_software_mosi_pin: PE13
spi_software_sclk_pin: PE14
sense_resistor: 0.075
interpolate: false
run_current: 1.414
hold_current: 1.414
driver_TBL: 1
driver_TOFF: 2
driver_HSTRT: 4
driver_FD3: 0
driver_HEND: 3
driver_CHM: 1

I followed you steps, add ‘SHORT_CONF’ to tmc5160.py



image

but when I read it, it is still zero, what’s the problem, could you please help?
image