Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TMC5160 v1.2 Stepper motors are noisy/vibrate at low speeds when StealthChop is active #23248

Open
magnificu opened this issue Dec 2, 2021 · 23 comments

Comments

@magnificu
Copy link

magnificu commented Dec 2, 2021

Did you test the latest bugfix-2.0.x code?

No, but I will test it now!

Bug Description

Stepper motors are noisy/vibrate at low, medium and high speeds (30mm/s, 60mm/s, 80mm/s, 120mm/s) when StealthChop is active
The stepper divers are used in SPI mode.
If StealthChop is deactivated the motors are not vibrating anymore

Configuration_adv.h
#define TMC_USE_SW_SPI
#define STEALTHCHOP_XY
#define CHOPPER_TIMING CHOPPER_DEFAULT_24V

Updating the CHOPPER_TIMING is smoothing the noise when StealthChop is deactivated.
With the StealthChop active the motors are noisy/vibrating again
#define CHOPPER_TIMING_X {3, 6, 8}
#define CHOPPER_TIMING_Y {3, 6, 8}

Bug Timeline

No response

Expected behavior

When StealthChop is active the stepper motors should be quieter

Actual behavior

When StealthChop is active the stepper motors are very noisy/vibrating

Steps to Reproduce

Upload firmware Marlin 2.0.9.2 and print

Version of Marlin Firmware

Marlin 2.0.9.2

Printer model

coreXY custom

Electronics

Power supply 24V 16.5A, SKR2 board, BTT TMC5160 v1.2, X & Y Stepper motors: 1.8° QSH4218-47-28-040

Add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Prusa Slicer

Host Software

SD Card (headless)

Additional information & file uploads

I tested as well with a 12V power supply
I tested as well with stepper motors 17HM19-2004 (0.9° stepper motor with updated config to CHOPPER_09STEP_24V)
The results were worse.

The previous version I used was Marin 1.1.9
Ramps_v1.6
TMC2208
unknown 1.8° stepper motors
and the motors were very smooth/silent

@XDA-Bam
Copy link
Contributor

XDA-Bam commented Dec 2, 2021

Please attach your current configs, otherwise diagnostics will be difficult.

@magnificu
Copy link
Author

magnificu commented Dec 2, 2021

@XDA-Bam
Copy link
Contributor

XDA-Bam commented Dec 2, 2021

Did you test #define SQUARE_WAVE_STEPPING? May be worth a try.

@magnificu
Copy link
Author

I was skeptical because it's a beta feature, but I'll give it a try and let you know if something improves.

@magnificu
Copy link
Author

I test it and I did not noticed any difference in SpreadCycle (StealthChop disabled)
In StealthChop same noise/vibration of the motors is present.

@GhostlyCrowd
Copy link
Contributor

I test it and I did not noticed any difference in SpreadCycle (StealthChop disabled) In StealthChop same noise/vibration of the motors is present.

and this is on latest bugfix as well? have you tested that?

@magnificu
Copy link
Author

@GhostlyCrowd
I just checked the latest bugfix and the issue is the same.

@magnificu
Copy link
Author

magnificu commented Dec 5, 2021

Additional data that might help with the debug:
Yellow -> Current measured with a current clamp

Spread Cycle
Spread_Cycle

StealthChop
StealthChop
Purple -> Voltage measured on one coil of the stepper
StealthChop_yellow-Current_purple-CoilVoltage_1

@npmomchev
Copy link

I confirm the problem is present in the latest error correction. Board: BTT-SKR-pro with TMC5160 drivers Steppers: NEMA17 Moons. I tried NEMA17 with 0.9 degree step and NEMA17 with 1.8 degree step

@magnificu
Copy link
Author

At the moment I am using Marlin with StealthChop disabled, but of course this is a limitation.

@magnificu
Copy link
Author

Is anyone looking into this?

@github-actions
Copy link

This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2022
@thisiskeithb thisiskeithb reopened this Jun 28, 2023
@MarlinFirmware MarlinFirmware unlocked this conversation Jun 28, 2023
@magnificu magnificu changed the title [BUG] Stepper motors are noisy/vibrate at low speeds when StealthChop is active [BUG] TMC5160 v1.2 Stepper motors are noisy/vibrate at low speeds when StealthChop is active Jun 28, 2023
@magnificu
Copy link
Author

TMC5160 are becoming more and more popular and I hope with feedback from more users we can find a solution.
In my opinion, this is a software issue.

@thisiskeithb
Copy link
Member

Can you upload a video demonstrating the noise? I run BTT's 5160s on a couple boards here (STM32F4 based like the SKR 2 & BTT002) and I wouldn't consider the noise to be out of the norm.

@magnificu
Copy link
Author

It can also be seen from the oscilloscope that the sine wave is highly distorted in StealthChop compared to Spread Cycle.
I will do a video as well.

@magnificu
Copy link
Author

magnificu commented Jun 28, 2023

Here you can find the videos. As you can see it is recorded without the belts installed.
In case the browser does not show you the video you can download and play them with a local video player.

StealthChop - enabled (noise/vibration)
https://github.com/MarlinFirmware/Marlin/assets/63443841/b7ee0554-aa15-49b6-8263-9efda4c0bbef

StealthChop - disabled (Spread Cycle)
https://github.com/MarlinFirmware/Marlin/assets/63443841/b53b9c6e-1942-435c-b89a-fdb82afce452

@magnificu
Copy link
Author

Is anybody that can really help me with this topic?

@magnificu
Copy link
Author

magnificu commented Jul 2, 2023

Could it be a problem if the QSH4218-47-28-040 stepper motors have an ultra low phase inductance of 0.6mH?

@magnificu
Copy link
Author

I've changed the TCM5160 (SPI) drivers with TMC2208 (UART) and the noise is gone.
I think it is something wrong on how TMC5160 is coded in Marlin.

@Rincewind08
Copy link

Rincewind08 commented Jul 3, 2023 via email

@magnificu
Copy link
Author

magnificu commented Jul 3, 2023

In my case they are working, but noisy in StealthChop mode.
You can check the configuration I attached and compare it to yours using software like Meld.
BTT TMC5160 v1.2 with SKR2 does not require CK pin to be clipped. Read the documentation and check if you set the jumpers correctly.
Anyway the topic here is different.

@fjulian79
Copy link

Since I have reported the issue once again in #27403 and triggered reopening this one, I investigated further to figure out what happens when those drivers get initialized. I have learned that the TMC drivers in general perform an automatic tuning or lets call it adoption to the used motor and also the mechanical load driven by the motor. They even adopt to dynamic load conditions and speeds. What if the issue is caused by a faulty TMC tuning in some cases??

I would assume that magnificu and myself are not the only ones who bought TMC5160 drivers but the web isn't full of users reporting this issue so I must expect that is not a general issue. On the other side, there is black magic auto tuning which is definitely influenced by the particular machine. Maybe, if some factors add up, it might end up in the situation reported here.

There are also two old shorts on YouTube, see ..
https://www.youtube.com/shorts/TXC0VF2c5tE
https://www.youtube.com/shorts/jFp_4yF6a1Q
The guy who posted them writes about exchanging the sense resistor but nothing more to work with. Anyway .. this is a little bit more extreme example of what happens here. I also observe that the is issue is more dominant at the X axis.

When I lay my finger on the printhead during noisy movements I can feel each step of the motor. I take this as indicator for a to high current setting. But changing the current setting does not solve the issue .. 800mA was my start value, went down to 500mAh, there it was better but still not solved and the generated forces where just high enough to print with 60mm/s so this is not usable.

I have also checked the TMC Registers ..

After Power Up
Send: M122 V
Recv:         X        Y        Z        E
Recv: GCONF         0x00:00:00:04    0x00:00:00:04    0x00:00:00:04    0x00:00:00:04
Recv: IHOLD_IRUN    0x00:0A:0F:07    0x00:0A:0F:07    0x00:0A:0F:07    0x00:0A:0F:07
Recv: GSTAT         0x00:00:00:05    0x00:00:00:05    0x00:00:00:05    0x00:00:00:05
Recv: IOIN          0x30:00:00:52    0x30:00:00:52    0x30:00:00:52    0x30:00:00:50
Recv: TPOWERDOWN    0x00:00:00:80    0x00:00:00:80    0x00:00:00:80    0x00:00:00:80
Recv: TSTEP         0x00:0F:FF:FF    0x00:0F:FF:FF    0x00:0F:FF:FF    0x00:0F:FF:FF
Recv: TPWMTHRS      0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: TCOOLTHRS     0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: THIGH         0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: CHOPCONF      0x14:00:82:84    0x14:00:82:84    0x14:00:82:84    0x14:00:82:84
Recv: COOLCONF      0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: PWMCONF       0xC8:0D:0E:24    0xC8:0D:0E:24    0xC8:0D:0E:24    0xC8:0D:0E:24
Recv: PWM_SCALE     0x00:00:00:07    0x00:00:00:07    0x00:00:00:07    0x00:00:00:07
Recv: DRV_STATUS    0x80:07:40:00    0x80:07:40:00    0x80:07:40:00    0x80:07:40:00

After first auto home
Send: M122 V
Recv:         X        Y        Z        E
Recv: GCONF         0x00:00:00:04    0x00:00:00:04    0x00:00:00:04    0x00:00:00:04
Recv: IHOLD_IRUN    0x00:0A:0F:07    0x00:0A:0F:07    0x00:0A:0F:07    0x00:0A:0F:07
Recv: GSTAT         0x00:00:00:05    0x00:00:00:05    0x00:00:00:05    0x00:00:00:05
Recv: IOIN          0x30:00:00:42    0x30:00:00:40    0x30:00:00:42    0x30:00:00:50
Recv: TPOWERDOWN    0x00:00:00:80    0x00:00:00:80    0x00:00:00:80    0x00:00:00:80
Recv: TSTEP         0x00:0F:FF:FF    0x00:0F:FF:FF    0x00:0F:FF:FF    0x00:0F:FF:FF
Recv: TPWMTHRS      0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: TCOOLTHRS     0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: THIGH         0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: CHOPCONF      0x14:00:82:84    0x14:00:82:84    0x14:00:82:84    0x14:00:82:84
Recv: COOLCONF      0x00:00:00:00    0x00:00:00:00    0x00:00:00:00    0x00:00:00:00
Recv: PWMCONF       0xC8:0D:0E:24    0xC8:0D:0E:24    0xC8:0D:0E:24    0xC8:0D:0E:24
Recv: PWM_SCALE     0x00:01:00:0E    0x00:00:00:0E    0x00:00:00:0C    0x00:00:00:07
Recv: DRV_STATUS    0x80:07:40:00    0x80:07:40:00    0x80:07:40:00    0x80:07:40:00

You can see that something in PWM_SCALE has changed

Back to the auto tune magic: In the marlin code I have seen that it would be possible to disable the black unicorn TMC magic. See src/module/stepper/trinamic.cpp starting in line 833

TMC2160_n::PWMCONF_t pwmconf{0};
pwmconf.pwm_lim = 12;
pwmconf.pwm_reg = 8;
pwmconf.pwm_autograd = true;
pwmconf.pwm_autoscale = true;
pwmconf.pwm_freq = 0b01;
pwmconf.pwm_grad = 14;
pwmconf.pwm_ofs = 36;
st.PWMCONF(pwmconf.sr);

At the end I was not sure about what will happen if I force autograd and autoscale to false .. so I have not just tried it.

Maybe this input helps to clarify what is going on here .. maybe not.
My intention was not to take my input as final conclusion and close the issue again ;-)

I have ordered right now a set of TMC2209 drivers .. at first for a test and if this one here is not solved within a reasonable amount of time (which can be expected because of the non straight forward character) I will use them instead of my 5160's. However .. would be a pity to leave the 5160's behind as they are not usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants