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] Motor stuttering with linear advance on TMC2208 since Marlin 2.0 #16155

Closed
Schild0r opened this issue Dec 8, 2019 · 68 comments
Closed

Comments

@Schild0r
Copy link

Schild0r commented Dec 8, 2019

Hey there, in the past I often tried to switch to Marlin 2.0 from 1.1.9 but there was always some hinderance.
Eventually I managed to sort out most of it (last was the motor knocking noise where you have to disable monitor_driver_status but I digress)

Bug Description

So I ported all the settings from my working 1.1.9 configuration to Marlin 2 (running an MKS Gen L with 5x TMC2208 in UART mode, dual BMG bowden extruder).
In 1.1.9 I made use of linear advance and dialed in my K factor at 1.45 Now with Marlin 2 I get this weird stuttering on my extruder motor when linear advance is used (no stutter when I set K = 0)
Any ideas why this is?
(Here's also a video of that symptom: https://www.reddit.com/r/3Dprinting/comments/e73s9h/marlin_2_tmc2208_stutter_with_linear_advance/ )

Already tried

I already tried using square wave stepping or setting the minimum stepper pulse to 1 or 2 (with TMC2209s installed you would get an error which tells you to do so with linear advance enabled and Trinamic drivers however with TMC2208 drivers you don't get that error message but I tried it anyways).
Also it makes no difference whether I use stealthchop or spreadcycle or make use of hybrid_threshold.
Running the driver in standalone mode or changing a TMC2209 driver and running that one in standalone mode makes no difference either

also see the attached configuration files (only changes I made are in these two files and always denoted with "//MS" in that line )
Schild0r_Marlin2.0_config.zip

@randellhodges
Copy link
Contributor

Try disabling stealthchop on E. From everything that I read, TMC2208, linear advance and stealthchopped e don't mix.

@Schild0r
Copy link
Author

Schild0r commented Dec 9, 2019

Try disabling stealthchop on E. From everything that I read, TMC2208, linear advance and stealthchopped e don't mix.

As stated above this does not fix it. It only makes the stutter a little bit quieter (or it may only seem like it due to increased overall noise of the extruder motor/driver)

@ManuelMcLure
Copy link
Contributor

This seems like another instance of #10272 - there's a problem with Linear Advance in 2.0 that causes extruder rattling but I don't think anyone knows why yet.

@Schild0r
Copy link
Author

Schild0r commented Dec 10, 2019

This seems like another instance of #10272 - there's a problem with Linear Advance in 2.0 that causes extruder rattling but I don't think anyone knows why yet.

Agreed. Might be the same cause. But didn't you say in that post that using CLASSIC_JERK would mitigate the rattling? I will try that with my setup today and if it helps maybe print a set of benchy and calibration cube with JD and noLA vs JERK and LA

Edit

So
Finding No. 1: enabling classic jerk indeed does eliminate the stuttering (i.e. sudden direction changes on the extruder which is creating vibration and noise) and linear advance does work with jerk enabled.
Finding No. 2: However linear advance will still cause noise from the extruder motor but it is not a rattling but a low pitched whine (similar like if you run A4988 drivers but not quite it)
Finding No. 3: running linear advance with jerk (x6, y6, z0.3, e4) and a minimum stepper pulse of 2 results in worse quality (greater corner buldge: 0,27mm vs 0,135mm) and slower prints (50min vs 32 min) than running no linear advance with junction deviation (0.013) and a minimum stepper pulse of 0 as seen below.
IMG_20191210_120939
it is likely though that the slower print speed has a negative effect on corner buldge (i.e. greater buldge) as well BUT I rather take better quality in less time anyway...

@boelle
Copy link
Contributor

boelle commented Dec 11, 2019

@Schild0r
Copy link
Author

Schild0r commented Dec 11, 2019

btw is JD calculated correctly?

if you are referring to the values I used above: No I didn't translate them since I did not know the formula. I just used the standard value of the basic config.h file.

So if I translated the Jerk values, my JD would be even lower. But again, I won't complain when I get better quality in less time.

EDIT:
Did someone already try setting the JD to 4.1421 and printing a 20x20x20 cube??
A JD of 4.1421 would result in a Junction radius of 10 so would said cube turn to a circle then?

@boelle
Copy link
Contributor

boelle commented Dec 11, 2019

better quality in less time migt be impossible

the faster you print the quality will suffer, itsa just a matter of printing fast enough

@YAost
Copy link

YAost commented Dec 15, 2019

This issue is simillar to another request
#16184
You have S-curved acceleration enabled as well, worth checking without it.

@ManuelMcLure
Copy link
Contributor

In my testing S-curve seemed to make no difference, but your mileage may vary.

@robustini
Copy link

robustini commented Dec 17, 2019

Same issue here with TMC2130, damn.

@Vertabreak
Copy link
Contributor

does that say linear advance k = 1.45 holy cow that's high never seen a working valid k over 0.5 even with over a foot of bowden tube.

@robustini
Copy link

robustini commented Dec 17, 2019

There's a confict with Linear Advance and Junction Deviation, i disable the second one and the L.A. work fine here.
This is probably a bug that needs fixing.

@sjasonsmith
Copy link
Contributor

Yesterday I noticed unexpected (to me) timing on the extruder with linear advance enabled. Perhaps it is related to this issue. I am only timing signals, I don't actually have a driver connected, so I can't be sure that this is related to the stuttering described.

image

In this image you can see a steady frequency, which corresponds to the Linear Advance interrupt rate. This is with square-wave stepping, so the narrow "glitches" correspond to two or three steps taken in a single Linear Advance ISR.

I suspect this could be causing the stuttering, and might even cause TMC2208 motors to shut down, based on past behavior I have observed.

@ManuelMcLure
Copy link
Contributor

When I turned on LA_DEBUG I was seeing a lot of instances of

More than 2 steps per eISR loop executed.

which matches up with what you're seeing in the stepper timing.

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

@Schild0r is the issue still the same with all the updates in the last 13 days?

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

btw, who can confirm there is an issue? use the same configs as OP and the same hardware if possible

@sjasonsmith
Copy link
Contributor

I have reproduced 2208 drivers turning off related to the picture I posted. I don’t know whether that is the root cause of this or not, but it seems possible.

@Schild0r
Copy link
Author

Schild0r commented Dec 24, 2019

@Schild0r is the issue still the same with all the updates in the last 13 days?

Will test with the latest marlin build and stuff like s-curve turned off etc once I am home in the next few days. Happy holidays to y'all :)

EDIT: Didnt work.

@Lord-Quake
Copy link
Contributor

Using search I came to this open issue thread

Today I started to design a K-Calibration tower that I want to post on Thingiverse.
I'm working on a real life calibration object as the values coming from the K-factor Calibration Pattern didn't corollate with the quality I was expecting.
This how the prototype tower looks like:
K-Test_Tower_Proto_Leo_N
Here the G-Code file for internal use only: K-Tower_Calibration_Leo_N.zip
(Edit the header to your setup accordingly)

I'm posting here because when K was at 0.04 I received the following debug output:
More than 2 steps per eISR loop executed.
At 0.4 and 0.0 all was fine again.

Marlin 2.0.1 was used.
Config files: K-Configurations_Leo_N.zip

I can test if needed......

@ManuelMcLure
Copy link
Contributor

Can you check out @sjasonsmith 's fork linked from #15473 (comment) and see if that affects the behavior? This is not ready for prime time, although I myself have tested it and it seems to work well.

@Lord-Quake
Copy link
Contributor

Test completed. No change, same outcome.

I compiled the FW from @sjasonsmith using my configs from above.

On another note:
For this test I mistakenly used the gcode from the K-Pattern script instead of my cal. tower.
When the printer drew the very first K line the console gave out "More than 2 steps per eISR loop executed." from the get-go and when the print head came to the end of the first line it paused for a brief period before it moved on to print the second K line. I don't recall this happening with the 2.0.1 FW.

@qwewer0
Copy link
Contributor

qwewer0 commented Jan 3, 2020

I have this problem too, thought it was normal even if it's annoying.
Ender 3, SKR Mini E3 v1.2, TMC2209, Marlin 2.0.0/2.0.1, LA K 0.4 - 1.4, S-Curve, Junction deviation on/off

@boelle
Copy link
Contributor

boelle commented Jan 10, 2020

@Schild0r is this still an issue when using bugfix 2.0.x ?

@qwewer0
Copy link
Contributor

qwewer0 commented Jan 10, 2020

Compiled a fresh bugfix 2.0.x, the problem is still there.

@boelle
Copy link
Contributor

boelle commented Jan 23, 2020

how often do you update? bugfix is updated almost daily

@qwewer0
Copy link
Contributor

qwewer0 commented Jan 24, 2020

Recompiled the latest bugfix build [2020.01.24.], the problem is still here.
Ender 3, SKR Mini E3 v1.2, TMC2209.

@boelle
Copy link
Contributor

boelle commented Jan 28, 2020

i just got TMC2209 and dont have the problem, so the issue is likely to be the SKR Mini E3 v1.2 (or MKS Gen L which is what @Schild0r uses) as that is the only difference

@kingofmonkeys
Copy link

Ok after a bunch of testing I found that my issue is NOT the same as this issue and not related to the firmware, sorry for the false alarm. I had a belt mount that was giving out and causing minor vibrations that I could see in the print. I just happened to notice the defects after I updated the firmware.

@Lord-Quake
Copy link
Contributor

Using your g-code I wasn't able to reproduce the issue as well.

@kingofmonkeys
Copy link

yeah it was definitely the faulty bracket, after i found and replaced it no more vibration and no more pattern on the print. again sorry about that.

@Scope666
Copy link

Scope666 commented Feb 10, 2020

Myself and a few others have a similar bug, but it's not Marlin's fault. I believe it's an actual hardware bug with the TMC2209s on the SKR E3 Mini 1.2. The symptoms are louder than normal motors, INSANELY hotter than normal motor temps, and missed steps. It would happen maybe once in 10-20 times powering on the machine. Power cycling would fix it. Crank the volume to hear it:

https://www.youtube.com/watch?v=rcYc3-wiAYw

TMC debug of the bad X motor while the bug is happening: (1F instead of 11)

image

@thinkyhead
Copy link
Member

Duplicate of #10272

@thinkyhead thinkyhead marked this as a duplicate of #10272 Feb 10, 2020
@qwewer0
Copy link
Contributor

qwewer0 commented Feb 10, 2020

I believe it's an actual hardware bug with the TMC2209s on the SKR E3 Mini 1.2.

Could you upload your config files? I have the same board and I had never experienced that you did,
I want to make sure that it is not something in the firmware.

@Schild0r
Copy link
Author

Why is this issue closed now?
I see that this might be a duplicate of above mentioned issue but that one is also closed without any solution to the problem and since that conversation moved to discord the conversation gets split even more without anybody knowing if there is someone working on that, what a possible solution could be etc

@Scope666
Copy link

Scope666 commented Feb 10, 2020

I believe it's an actual hardware bug with the TMC2209s on the SKR E3 Mini 1.2.

Could you upload your config files? I have the same board and I had never experienced that you did,
I want to make sure that it is not something in the firmware.

Sure, I'm not using the E3 anymore (on SKR 1.4 now) but my last config was this:

configuration.h: https://pastebin.com/6vZSZWLi

configuration_adv.h: https://pastebin.com/KkJfE0KY

@qwewer0
Copy link
Contributor

qwewer0 commented Feb 10, 2020

Didn't find any unusual in your configs, but can SQUARE_WAVE_STEPPING have this kind of unexpected effect?

@Scope666
Copy link

Didn't find any unusual in your configs, but can SQUARE_WAVE_STEPPING have this kind of unexpected effect?

When I first ran into the issue I tried disabling that, no difference. I even went so far as to run Klipper for a few weeks, the bug remained... that's how I figured out it was a hardware issue.

@qwewer0
Copy link
Contributor

qwewer0 commented Feb 10, 2020

Dang

@thinkyhead
Copy link
Member

Methinks in your case @Schild0r we may be seeing a limitation of the MKS Gen L board in keeping up with the demands of so many enabled features and high stepping rates. If the eISR is hitting its limit, it means that Linear Advance is best not used. And then you kind of have to tune from there until performance becomes more acceptable.

We are chasing various things related to stepper timing and the relatively new STM32 boards, and so on, and something will shake out of that. But we are not seeing anything that we can take action on from this meandering thread.

@axl12ap
Copy link

axl12ap commented Feb 12, 2020

Hello,
what's the situation in the current bugfix 2.0.x of Marlin?? Is still present the LA problem or solved?

I'm using an SKR1.3 with TMC2208 in uart mode, and firmware with s-curve and JD enabled.

I'd like to use also LA but last time (2 month ago) I was having lot of ruttles from extruder motors and leave the function disabled.

Thanks guys

@hazedav
Copy link

hazedav commented Feb 23, 2020

I also have LIN_ADVANCE extruder jerky/jittering with TMC 2209 (board SKR mini E3) on my ender 3. Marlin 2.0-bugfix (2.0.3). I notice this issue is closed, but it still seems like a thing.

Please advise.

@onek24
Copy link

onek24 commented Mar 26, 2020

SKR Mini E3 with TMC2209 on an Ender 3.
Lin Advance configured at 1.2 and using classic jerk.
Version 2.0.5.1 still has this issue, didn't test the newest bugfix.

The noise sounds almost like someone trying to scratch glass with silicone gloves or with a soapy hand. Or perhaps metal scratching at metal.

@dan-and
Copy link
Contributor

dan-and commented Mar 26, 2020

Same for me with TMC2209 on SKR v1.3 and Marlin bugfix-2.0.x commit 0aeee64 (2020-03-25).
My k-value is 0.06

@jorgenagel
Copy link

jorgenagel commented Apr 5, 2020

Having this issue since I started using Linear Advance.
Marlin 2.0_DW3, otherwise stock Ender 5plus
Can't seem to get rid of it even with setting k=0 (was using 0.08 when tuned)

Send: M503
Recv: echo:  G21    ; Units in mm (mm)
Recv: 
Recv: echo:Filament settings: Disabled
Recv: echo:  M200 D1.75
Recv: echo:  M200 D0
Recv: echo:Steps per unit:
Recv: echo: M92 X80.00 Y80.00 Z800.00 E97.18
Recv: echo:Maximum feedrates (units/s):
Recv: echo:  M203 X500.00 Y500.00 Z10.00 E50.00
Recv: echo:Maximum Acceleration (units/s2):
Recv: echo:  M201 X500.00 Y500.00 Z100.00 E5000.00
Recv: echo:Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
Recv: echo:  M204 P500.00 R1000.00 T500.00
Recv: echo:Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
Recv: echo:  M205 B20000.00 S0.00 T0.00 J0.08
Recv: echo:Home offset:
Recv: echo:  M206 X0.00 Y0.00 Z0.00
Recv: echo:Unified Bed Leveling:
Recv: echo:  M420 S1 Z2.00
Recv: 
Recv: Unified Bed Leveling System v1.01 active
Recv: 
Recv: Active Mesh Slot: 0
Recv: EEPROM can hold 22 meshes.
Recv: 
Recv: echo:PID settings:
Recv: echo:  M301 P14.72 I0.89 D61.22
Recv: echo:  M304 P690.34 I111.47 D1068.83
Recv: echo:Z-Probe Offset (mm):
Recv: echo:  M851 X-45.00
Recv:   M851 Y-4.00
Recv:   M851 Z-3.32
Recv: echo:Linear Advance:
Recv: echo:  M900 K0.00
Recv: echo:Filament load/unload lengths:
Recv: echo:  M603 L600.00 U700.00
Recv: echo:Filament runout sensor:
Recv: echo:  M412 S1 D5.00
Recv: ok P15 B3

@jshph
Copy link

jshph commented Apr 13, 2020

Hello, any progress on this? I have the same issues, TMC2209 on SKR v1.2 (Mini E3) and Marlin 2.0.5.3, with k-value of 0.3 and classic jerk. I have experimented with extruder / retractor acceleration and hybrid threshold value for the extruder, no dice. Really want to make use of linear advance and faster print speeds but it's too noisy at the moment.

@Cirromulus
Copy link

Same here.
It seems that linear advance tries to load/unload pressure in a corner for every (small) segment, thus creating vibration and overloading the extruder

@zvoniimiir
Copy link

I am still having this issue on ender 3 pro with skr mini e3.

@Cirromulus
Copy link

This is among the things why I switched to Klipper. No problems there.

@jorgenagel
Copy link

@Cirromulus Looking at Klipper currently because of this. Any advise in general? Planning on doing it with a Pi4, currently have an Ender 5+ but have an SKR 1.4 turbo on the way. Was hoping that by going to a more powerful board the problem would be solved but judging by @zvoniimiir 's comments it doesn't look good... hence Klipper

@Cirromulus
Copy link

@Cirromulus Looking at Klipper currently because of this. Any advise in general? Planning on doing it with a Pi4, currently have an Ender 5+ but have an SKR 1.4 turbo on the way. Was hoping that by going to a more powerful board the problem would be solved but judging by @zvoniimiir 's comments it doesn't look good... hence Klipper

Advice is that you should stick through the relatively long installation procedure. The SKR is pretty good, the TMC communication should work out of the box from default config. After you got normal business working, you might have a look at pressure_advance and square_corner_velocity. These are the two things that Marlin keeps on failing to implement correctly.

@JayceeB1
Copy link

Same here.
It seems that linear advance tries to load/unload pressure in a corner for every (small) segment, thus creating vibration and overloading the extruder

Got the same problem with 2209 :/

@iz3man
Copy link

iz3man commented Jun 28, 2020

Problems here as well. Using the same hardware on an i3plus with Marlin from around 1 year ago and all is fine, but now with my Ender3, MKS-GEN-L and TMC2130 SPI it's making this twittering noise on fast changes. The printer as such is super silent, and the extruder is for most of time as well, but eg hexagon infill makes it twitter - marlin code from 3 weeks ago.

@thinkyhead
Copy link
Member

This is a duplicate of other issues. When time allows, the attempt at a solution will be to port the linear advance code from Prusa Firmware. There's no other path to knowledge for us at this time.

@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 Sep 16, 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