knutwurst / Marlin-2-0-x-Anycubic-i3-MEGA-S

Marlin 2.0.x Version for Anycubic i3 MEGA M/S/P/X/CHIRON and 4MAX with Anycubic TFT or the "new" DGUS Clone TFT - Now also with BLTouch!
GNU General Public License v3.0
787 stars 187 forks source link

MEGA_P_DGUS_BLT_10_v1.5.2 with input shaping #482

Closed djepsylon closed 5 months ago

djepsylon commented 1 year ago

Description

I ve compiled a build of the MEGA_P_DGUS_BLT_10_v1.5.2 with the input shaping function but is there a little problem, there is 102% of ram used and how can i reduce usage ram correctly? what options i can coment for keep input shaping and don't loss a lot of other things who is utile? what is the best compromise?

knutwurst commented 1 year ago

You can simply reduce the usb/serial input buffer sizes: https://github.com/knutwurst/Marlin-2-0-x-Anycubic-i3-MEGA-S/blob/97c3391cd9c3f9e12983ebe618891c65b2f95e9e/Marlin/Configuration_adv.h#L2417

Also you can disable the sd card file sorting to save more ram: https://github.com/knutwurst/Marlin-2-0-x-Anycubic-i3-MEGA-S/blob/97c3391cd9c3f9e12983ebe618891c65b2f95e9e/Marlin/Configuration_adv.h#L1614

I haven't had time to work with InputShaping before, but would appreciate your results

djepsylon commented 1 year ago

thanks a lot i will try this changes and i tell you if i work or not i ve not a lot of time too i think i do that this week end or last week

schmttc commented 1 year ago

Be aware, I compiled and flashed 1.5.2 with added input shaping on a Mega S Trigorilla 0.0.2 (code: https://github.com/schmttc/Marlin-2-0-x-Anycubic-i3-MEGA-S/tree/local) . The compiler advised 99.4% RAM use. The LCD came up, but I could not connect over serial USB, and it kept beeping as if the board was resetting in the background. But there is also a chance that Cura did a bad upgrade for me, as the machine did not self-restart after the upgrade process. Also the SD card did not list contents in the menu, but that may be a separate issue #486

I had to recover my board by re-flashing the bootloader and uploading an older firmware, I used this guide https://cyburdine.wordpress.com/2022/07/18/trigorilla-bootloader-and-firmware-install-process/

The author of Input Shaping advises to have ~1Kb RAM free https://reprap.org/forum/read.php?415,891975,892852#msg-892852 And so we will need to disable some other features to use Input Shaping on boards with ATMEGA2560

djepsylon commented 1 year ago

@schmttc hi, yes this is what i ve see too. impossible to put input shaping in he trigorilla bord due to under memory space. i think if we want to use this option with i3mega series, we must change the motherboard, no other choices. after comment all other fuctions for can compile input shaping results in there is only input shaping active lollll ==>>no benefits.

schmttc commented 1 year ago

Hey @djepsylon , try leaving all features enabled, enable Input Shaping, and uncomment "#define SHAPING_MAX_STEPRATE 10000" in Configuration_adv.h. My compiler then says 7018 of 8192 bytes RAM, which may be enough overhead to allow things to run correctly. I won't have time to test this until the weekend.

djepsylon commented 1 year ago

hi @schmttc , thanks to you i ve truied your solution it works fine but it seems there is some problems for set input shaping correctly, i don't know why for the moment i don't have tme to test more deepest for now, maybe next week if you don't have test yourself in this time or another poeple

schmttc commented 1 year ago

The firmware compiles and runs fine, @knutwurst let me know if you'd like me to raise a PR for the functionality.

I spent more time than I wanted to testing and trying to dial it in, but I am starting to agree with @djepsylon that the MEGA2560 is too limited to take advantage of this feature. I couldn't get a substantial speed increase without a substantial decrease in quality.

djepsylon commented 1 year ago

Effectively, due to lot of memory used, the motherboard seems to pain to do work correctly and don't give good results. the benefits are to small or not present. i think that, with the mega2560, the print results are very good without input shaping and activate this option make the performances lower and print quality too. like @schmttc says, this mainboard seems to be too limited for use input shaping but the printer already make very good prints without it

sboehle commented 1 year ago

I use the I3 Mega with a hardware solution for Input Shaping. Shortly after I bought it, I heard the news that Input Shaping will be introduced to Marlin, and I thought "Oh no, now the HW solution is not necessary anymore - money wasted." But now it looks like that it is not easy to get Input Shaping running using the Marlin solution. I'm quite happy with the HW solution. No more ghosting and higher print speeds with no quality loss.

I don't want to advertise with this comment, it is meant only as a hint, if you like to use input shaping when the mainboard is not capable of using the marlin solution. If this comment is not adequate or break any rules, please leave a comment and I delete it.

I use the HW solution from GH Enterprise where you swap the drivers for x and y. You have to print a test model, measure distances, enter that in a special calculator and gets special start gcodes. These are necessary to "program" the drivers each time you start a print. I had issues when I swapped the drivers. Dimensions not accurate and "Input Step Rate too high" Error. After contacting gh support, we fixed the issues together and the documentation was extended also. The issues I had were: Pin differences between 2208 and 2225 - I had to cut one pin. That fixed the microstep 1/16 issue. FW adjustment via defining MAXIMUM_STEPPER_RATE value equal to 64000 in Configuration_adv.h - that fixed the "Input Step Rate too high" issue. It is also not a perfect solution, and not convenient (measurement of resonance frequencies), but for me ghosting is gone, and I can print at a little bit higher speeds without quality loss. I own a voron 2.4, there input shaping is much easier to control.