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] Knocking noise when moving TMC2208 (UART) #14183

Closed
oechslein opened this issue May 29, 2019 · 64 comments
Closed

[BUG] Knocking noise when moving TMC2208 (UART) #14183

oechslein opened this issue May 29, 2019 · 64 comments

Comments

@oechslein
Copy link
Contributor

Description

I switched from Marlin 1.1 (bugfix_1.1.x - 7cc1410) to (bugfix_2.0.x 8e8e48f).
Without changing HW I'm now hearing always a knocking noise (slow or fast moves) on X, Y, Z. This noise wasn't there before.

I do have an Ender 3 with an MKS Gen L board, TMC2208 UART on X, Y, E and a ST820 on E (and BLTOUCH).

Steps to Reproduce

Use my config and probably also my printer...

Expected behavior: Same noise level as with 1.1
Actual behavior: Knocking noise

Additional Information

20190529_Bug_Report_Noise.zip

Videos are here: https://www.dropbox.com/sh/ip6kgwu06ekkdgu/AAAhQOQFqq-Jsm_XOYGWIPZga?dl=0

@jokejoke
Copy link

jokejoke commented May 30, 2019

I have the similar problem (maybe the same). Could you try to change in Configuration_adv.h:

#define MONITOR_DRIVER_STATUS
to:
//#define MONITOR_DRIVER_STATUS

After this change the strange "grinding/koncking" noise are gone.

My configuration:

@oechslein
Copy link
Contributor Author

Thanks, that helps!

It looks like I'm hearing the calls to "monitor_tmc_driver()".
After I doubled (internal value) MONITOR_DRIVER_STATUS_INTERVAL_MS the noise frequency is halved.
Maybe the Arduino is not fast enough for that feature?

If this isn't a bug we should add a comment to MONITOR_DRIVER_STATUS that it could lead to "grinding/knocking" noise.

@jokejoke
Copy link

jokejoke commented May 31, 2019

It has bothered me last 5 days, before I found this "lucky" settings :) What do you think @teemuatlut? Is it bug?

@teemuatlut
Copy link
Member

Sounds plausible as the AVR SoftwareSerial disables interrupts when receiving data.
I won't consider it a bug, but maybe at some I can take a look if the read commands can be fewer in TMC monitoring.

@vadsh
Copy link

vadsh commented May 31, 2019

I have exactly the same symptoms.

@viper93458
Copy link

I have noticed a random knock as well, I will test disabling the MONITOR_DRIVER_STATUS to see if it helps.

-William

@vadsh
Copy link

vadsh commented Jun 1, 2019

I've noticed also that if m122 command sent to terminal during the print - the same noise happens

@vadsh
Copy link

vadsh commented Jun 2, 2019

commenting //#define MONITOR_DRIVER_STATUS worked for me too. But I'd like to be able to use this function.
v1.1.9 was ok with this option uncommented.

@vadsh
Copy link

vadsh commented Jun 9, 2019

noise disappeared when I switched the board to 32 bit skr 1.3. Marlin code is almost identical (copy-paste config mostly). Old card (mks gen 1.4) was working at the edge of its performance.

I believe the noise appears as a result of card's inability to send step pulses at constant speed as m122 command uses a lot of resources.

@xeddog
Copy link

xeddog commented Jun 20, 2019

This sounds like the same problem I had with my CR-10S using a MKS GEN 1.4 controller flashed with Marlin 2.0. I had 2208s on X,Y,Z,and E, with X and Y using stealthchop2, and Z and E in spreadcycle. I have been having issues with extrusions so I tried swapping back to a DRV8825 for E and after a fresh pull, and then re-flashing the noise was there. Going back to the 2208 for E. . . still there. Tried 8825's on Z and E . . . still there. Put all 8825 in and noise gone.

It has been a week since I put the 8825's in, so is this still a problem, or has it been resolved yet.

@Grogyan
Copy link
Contributor

Grogyan commented Jun 20, 2019

Please, try this again, as the TMC library has recently been updated

@OneOfEleven
Copy link

I get a loud knocking noise as the TMC2208's switch down from spead-cycle to stealth-chop mode every time. The only solution I've so far found is to set the max feedrate just low enough to remain in stealth-chop mode (or just disable hybrid_threshold).

@TheFlash12314
Copy link

TheFlash12314 commented Jun 22, 2019

Sounds plausible as the AVR SoftwareSerial disables interrupts when receiving data.
I won't consider it a bug, but maybe at some I can take a look if the read commands can be fewer in TMC monitoring.

@teemuatlut but the malin version 1.1.9 does not have this problem while monitor_driver_status enabled

@xeddog
Copy link

xeddog commented Jun 22, 2019

I finally got my platformio issues resolved, at least enough to load firmware. SO I re-installed my 2208's, re-flashed the firmware, and I see no improvement. I still get that noise while X and Y are moving.

Wayne

Please, try this again, as the TMC library has recently been updated

Well, I would really like to try this again, but now I am having another problem compiling Marlin using platformio with Atom. I will definitely try again when I can get it to compile.

@gmg23
Copy link

gmg23 commented Jun 23, 2019

I am having the same problem after updating from 1.1.x to 2.0.x. With no other changes, the steppers have a most awful knocking sound. I would love to be able to get rid of this. ]

Quick Update: the previous posters are correct, MONITOR_DRIVER_STATUS_INTERVAL_MS in tmc_util.h has a direct effect on the noise. The higher the interval, the less frequent the noise. I am running at 2000 currently and it's not too bad. Hoping reducing the polling interval this much doesn't create an issue.

@michaelsheridan23
Copy link

Any new news on this issue?

I just loaded 2.0 onto my MKS Gen L with TMC2208 in UART and I am getting the knocking noise with all axiis. I also verified that with Marlin 1.1.9 the knocking noise goes away. I’m wondering if something changed in the TMC library because with 1.1.x you have to use the TMC2208 specific library where as with 2.0 you use the more generic TMCSteppers library. Not sure what the difference is that causing the problem.

@xeddog
Copy link

xeddog commented Aug 10, 2019

Any new news on this issue?

I just loaded 2.0 onto my MKS Gen L with TMC2208 in UART and I am getting the knocking noise with all axiis. I also verified that with Marlin 1.1.9 the knocking noise goes away. I’m wondering if something changed in the TMC library because with 1.1.x you have to use the TMC2208 specific library where as with 2.0 you use the more generic TMCSteppers library. Not sure what the difference is that causing the problem.

You can disable MONITOR_DRIVER_STATUS in configuration.adv.h and the chopping sound goes away, but the issue with the 2208 and Linear Advance is still there. I wound up swapping the 2208 on E for a LV8729 so I could use Linear Advance.

@michaelsheridan23
Copy link

I did that and it does go away but so does the ability to monitor the serial lines. I managed to get linear advance to work with my 2208 by setting my E axis to SpreadCycle. But I'm having some serious over heating on my extruder so I’m planning swap for a different driver anyway.

@porlock
Copy link

porlock commented Sep 3, 2019

same for me, any luck with this one ?

@teemuatlut
Copy link
Member

You can try the test branch of the library which reverts UART changes back to what it is in TMC2208Stepper which is used by Marlin 1.1.9.
https://github.com/teemuatlut/TMCStepper/tree/revert_uart
If that helps, then I know the issue is with the library code. If not, then I need to look into the Marlin monitoring code which was reworked some time ago.

In any case the M122 needs to be better optimized to cache register values and reduce the number of reads from the drivers.

@gmg23
Copy link

gmg23 commented Sep 5, 2019 via email

@thinkyhead
Copy link
Member

If it is confirmed that the revert_uart branch resolves it, a patch will follow soon.

@xeddog
Copy link

xeddog commented Sep 7, 2019

If it is confirmed that the revert_uart branch resolves it, a patch will follow soon.

I am very new to all of this, so how do I revert to the test branch? I use VSCode/Platformio.

@porlock
Copy link

porlock commented Sep 11, 2019

Reverting to tree/revert_uart lib does not help for me, but connection issues that i describe in #15096 get back.

@jacekk015
Copy link

jacekk015 commented Oct 3, 2019

If someone is interested I've had Marlin 2.0 package configured for MKS GEN L from April 2019 which works without knocking.
Marlin-bugfix-2.0.x_Knocking_recent_30_09_2019.zip
Marlin-bugfix-2.0.x_OK_April_2019.zip
Someone could compare files to find some bugs.
teemuatlut/TMCStepper#61 (comment)

@michaelsheridan23
Copy link

I can confirm with @jacekk015 the April 12, 2019 commit, Tree #57aaa9110b, does not exhibit the knocking noise with the latest version for TMCStepper, 0.5.1. Here are the files configured for my ender 3 with an MKS Gen L and TMC2208s for X, Y, and Z. This does appear to be a bug with Marlin that developed between April of this year and now.

Marlin-bugfix-2.0.x - MKSv1 Ender 3 - 2019-04-12.zip

@boelle
Copy link
Contributor

boelle commented Oct 26, 2019

now that many updates has passed is this one still the same?

@jacekk015
Copy link

jacekk015 commented Oct 29, 2019

No difference. Still knocks like before.
Newest Marlin + newest TMCStepper library v.0.5.2

@boelle boelle changed the title [BUG] Knocking noise when moving TMC2208 (UART) [BUG] [Bugfix 2.0.x] Knocking noise when moving TMC2208 (UART) Nov 24, 2019
@michaelsheridan23
Copy link

michaelsheridan23 commented Dec 1, 2019

Has anyone tried the latest release of marlin yet to see if this issue is fixed? The list of updates references TMC2208s.

@boelle
Copy link
Contributor

boelle commented Dec 2, 2019

@michaelsheridan23 looks like you could take the plunge and try?

@boelle boelle changed the title [BUG] [Bugfix 2.0.x] Knocking noise when moving TMC2208 (UART) [BUG] Knocking noise when moving TMC2208 (UART) Dec 4, 2019
@tobecwb
Copy link

tobecwb commented Dec 6, 2019

Tested today. The knocking noise still exists on latest release version (marlin and tmc library).
Going back to marlin 1.1.9, the sound dissapear

@tobecwb
Copy link

tobecwb commented Dec 6, 2019

Tried again with latest version (commit 5103cdc)... still the same knocking sound.
if I disable MONITOR_DRIVER_STATUS, the sound dissapear.

looking at the April release seended by @jacekk015 , I see several differences when compared with latest release...

on tmc_util.cpp file, function TMC_driver_data get_driver_data(TMC2208Stepper &st), I see some changes... copied everything from April release to latest release, and the knocking sound persist.

one thing that I tried too, is use a hardware serial on TMC2208 instead of software serial... I don't even know if this is possible, but if enable the option #define Y_HARDWARE_SERIAL Serial1 on pins_ramps.h, the knocking sound dissapear (but the MONITOR_DRIVER_STATUS don't work...)

like some users said before, I think the Arduino it's not fast enough for this with Marlin 2.0 (that I believe consumes more resources)

anybody with a overclocked arduino? :P

@sjasonsmith
Copy link
Contributor

MONITOR_DRIVER_STATUS with SoftwareSerial on an AVR will interfere with stepper timing in very large ways. Reading or writing a single byte will cause about 90 microseconds of jitter to the stepper timing, because interrupts have to be disabled for an entire byte duration.

@thisiskeithb
Copy link
Member

MONITOR_DRIVER_STATUS with SoftwareSerial on an AVR will interfere with stepper timing in very large ways. Reading or writing a single byte will cause about 90 microseconds of jitter to the stepper timing, because interrupts have to be disabled for an entire byte duration.

Should a sanity check be added for this combination?

@boelle
Copy link
Contributor

boelle commented Dec 6, 2019

would not be a bad thing :-)

@token47
Copy link
Contributor

token47 commented Dec 16, 2019

MONITOR_DRIVER_STATUS with SoftwareSerial on an AVR will interfere with stepper timing in very large ways. Reading or writing a single byte will cause about 90 microseconds of jitter to the stepper timing, because interrupts have to be disabled for an entire byte duration.

Point is that it worked before (2.0.x april and 1.1.9). Or was it lacking any new feature?

@rado79
Copy link
Contributor

rado79 commented Dec 25, 2019

switching to Marlin 2.0.1 did it for me - no more continuous knocking with or without MONITOR_DRIVER_STATUS.
SKR 1.3, TMC2208/2209, 24V, latest TMC library.

@jacekk015
Copy link

Unfortunately no-go for me on Ender3
https://youtu.be/i_z30hmofRw

@rado79 Could you post your config files? Configuration.h and Configuration_adv.h

@michaelsheridan23
Copy link

@rado79 the SKR is a 32 bit board. This problem is only known to exist on 8-bit boards like the MKS gen l. Did you experience the knocking noise with the SKR on an earlier build?

@rjaros87
Copy link

2.0.1 MKS Gen L1.0 + TMC2208 still knocking.
Do we have trouble to find the commit that caused knocking?

@rjaros87
Copy link

rjaros87 commented Dec 29, 2019

So I think I found useful information.
Tested with TMCStepper 0.6.1.

This commit was last without knocking:
2019-05-26 | 74f4478 | ESP32 servo support (#14109)

This commit introduce knocking :(
2019-05-26 | 1c86fbc | TMC updates, capture LCD changes (#14074)
with fix (cherry-picked): 2019-05-28| bf4a0db | TMC LCD followup (#14134)

@teemuatlut could you take a look what could cause knocking?

@teemuatlut
Copy link
Member

teemuatlut commented Dec 29, 2019

Originally monitoring skipped drivers that used SW UART, so obviously there wouldn't be an issue if no drivers were checked.

@sjasonsmith
Copy link
Contributor

I think we need to add a sanity check to prevent using MONITOR_DRIVER_STATUS on AVR with software serial. Every check will consume the CPU for hundreds of microseconds, which just doesn’t seem viable to me.

@WieFel
Copy link

WieFel commented Dec 29, 2019

I am facing the issue of knocking steppers on my Ender 3 Pro regardless of which version of Marlin I use.

I tried versions 1.1.9, 2.0.0 and the latest 2.0.1. The line #define MONITOR_DRIVER_STATUS is commented out (disabled) for me in all three versions by default. Enabling it doesn't change anything.

Even when I move the steppers using the "Move axis" option of the printer, the knocking appears, but only on the X and Y axis.

@rado79
Copy link
Contributor

rado79 commented Dec 30, 2019

@rado79 the SKR is a 32 bit board. This problem is only known to exist on 8-bit boards like the MKS gen l. Did you experience the knocking noise with the SKR on an earlier build?

Yes, confirm. Had the same knocking as in the video above.
has disappeared with xmas relaese.

@rado79
Copy link
Contributor

rado79 commented Dec 30, 2019

Unfortunately no-go for me on Ender3
https://youtu.be/i_z30hmofRw

@rado79 Could you post your config files? Configuration.h and Configuration_adv.h

Configuration.zip
Configuration_adv.zip

@boelle
Copy link
Contributor

boelle commented Jan 24, 2020

@oechslein when you get time please have a retest

and as bugfix 2.0.x is updated daily please retest say every 14 days or so

@oechslein
Copy link
Contributor Author

@boelle Sorry I switched to a 32bit board (with HW Serial) and this only happens with 8bit boards/ SW Serial. However looking at the linked merged commit, the problem mentioned here can no longer occur since MONITOR_DRIVER_STATUS is now disallowed.

@github-actions
Copy link

github-actions bot commented Jul 3, 2020

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 Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests