# TMC5160 - Classic Constant Off Time Chopper with fast decay time

**URL:** <https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359>\
**Category:** General Discussion\
**Created:** [October 6, 2022, 4:13pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359 "2022-10-06T16:13:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 6, 2022, 4:13pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/1 "2022-10-06T16:13:26Z")

</div>

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](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? 🤨

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

Thanks in Advance!

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 9, 2022, 5:19pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/3 "2022-10-09T17:19:04Z")

</div>

there is a command: driver\_FD3: 1

![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/c/c88bc3c6a5db007e9c341c0591fe4ffb79186281.png)

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

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 9, 2022, 8:49pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/4 "2022-10-09T20:49:57Z")

</div>

Oh man, thank you! 🥳  
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…

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 10, 2022, 7:52am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/5 "2022-10-10T07:52:02Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 10, 2022, 1:48pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/6 "2022-10-10T13:48:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 11, 2022, 8:09pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/7 "2022-10-11T20:09:38Z")

</div>

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

 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/9/9bcd29337437d92abcc111cc793c72cfdb9d4d54.png)

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 ):

```auto
########################################
# 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

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 11, 2022, 8:19pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/8 "2022-10-11T20:19:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 11, 2022, 9:14pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/9 "2022-10-11T21:14:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 12, 2022, 5:19am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/10 "2022-10-12T05:19:57Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 12, 2022, 9:30am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/11 "2022-10-12T09:30:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 12, 2022, 10:28am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/12 "2022-10-12T10:28:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 12, 2022, 1:05pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/13 "2022-10-12T13:05:01Z")

</div>

> [@LifeOfBrian](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 12, 2022, 1:06pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/14 "2022-10-12T13:06:00Z")

</div>

Moons were 0.9° and the Trinamics 1.8°.

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 13, 2022, 8:14am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/15 "2022-10-13T08:14:40Z")

</div>

actually im printing without VHIGHCHM and without VHIGHFS ( driver\_VHIGHCHM: 0 & driver\_VHIGHFS: 0 ) and with TPFD = 2 ( driver\_TPFD: 2 )

```auto
[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](https://klipper.discourse.group/t/custom-travel-acceleration/2789) ) - works great with 2A 0,9 stepper motors

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 13, 2022, 9:19am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/16 "2022-10-13T09:19:00Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 13, 2022, 11:55am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/17 "2022-10-13T11:55:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [October 13, 2022, 11:57am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/18 "2022-10-13T11:57:01Z")

</div>

> **[mp4: VID20221013135600.mp4](https://files.fm/u/ezr3bhkc5)**
>
> Visit this link to play the video: VID20221013135600.mp4

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

> **[mp4: VID20221013135753.mp4](https://files.fm/u/hzhj4qpdx)**
>
> Visit this link to play the video: VID20221013135753.mp4

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

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [October 13, 2022, 2:25pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/19 "2022-10-13T14:25:21Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Hundsbuah](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hundsbuah](https://klipper.discourse.group/u/Hundsbuah)\
**Post date:** [November 6, 2022, 3:38pm UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/21 "2022-11-06T15:38:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ltc](https://avatars.discourse-cdn.com/v4/letter/l/3be4f8/32.png) [@ltc](https://klipper.discourse.group/u/ltc)\
**Post date:** [June 17, 2023, 8:02am UTC](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359/22 "2023-06-17T08:02:22Z")

</div>

I followed you steps, add ‘SHORT\_CONF’ to tmc5160.py

 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/7/76e5cf3e4fb174b267afa60a5f27cdeeed18c9da.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/0/07789cdee604df3b8a29b73e0366179cdb2fc041.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/2/2e932241091a969914d15a5c33fcd375f18768c1.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/0/040122f417a37d4a65bb5eeccce15163a048c1da.png)  
but when I read it, it is still zero, what’s the problem, could you please help?  
 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/c/c00cd640328de66a1067af385116611db34ba2dd.png)

[Next page](https://klipper.discourse.group/t/tmc5160-classic-constant-off-time-chopper-with-fast-decay-time/4359.md?page=2)
