MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.22k stars 19.22k forks source link

[BUG] Motor stuttering with linear advance on TMC2208 since Marlin 2.0 #16155

Closed Schild0r closed 4 years ago

Schild0r commented 4 years ago

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

Scope666 commented 4 years ago

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 commented 4 years ago

Dang

thinkyhead commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

jorgenagel commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

Cirromulus commented 4 years ago

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

jorgenagel commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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[bot] commented 4 years ago

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.