prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.72k stars 1.93k forks source link

Add possibility to add more custom G-Code #7892

Open U-B-Glade opened 2 years ago

U-B-Glade commented 2 years ago

Version

V2.4.0+win64

Operating system type + version

W10 20H2

3D printer brand / version + firmware version (if known)

MK3s MMU2 3.10.1 1.0.6

Behavior

I like to insert more custom G-Code e.g. at: ; CP TOOLCHANGE UNLOAD -> e.g. M109 S{temperature[0]-10} ; CP TOOLCHANGE LOAD ; CP TOOLCHANGE END

Is this a new feature request? Yes

It would offer the possibility to use MMU with Multi Material instead of Multi-Color. And it would solve the issue, that filament tips are sometimes to hot (Stringing), in particular if I like to print with the max temp for strongness.

fe60 commented 2 years ago

PrusaSlicer 2.4.1 will offer G-code substitutions (already available in 2.4.1-beta1). Does this help?

U-B-Glade commented 2 years ago

Hi fe60,

thanks for the info. I've tried it, but I get not familiar with it. The new substitution like to get Perl regular expressions like "${1}M221 S98n${2}M221 S95n${3}" That is not wat I'm looking for. I mean real Custom G-Code like the existing in Printer Settings. There are eight Fields now, so it is IMHO simple to generate three more. I'm wrong?

fe60 commented 2 years ago

Feature request: I don't know how the development team decides to implement new features. But I guess it's not only about the efforts required to do so. I think the relevance to (the majority of) the users and usability do matter too. For rather special use cases the substitution feature has been added. Some users (incl. me) do such replacements already using text editors or (post-processing) scripts.

Using substitutions instead: :warning: I don't own a MMU. I checked the related gcode for the first time and did not try out my proposal. Your idea to pause the print and wait for the nozzle to cool down sounds problematic to me. At `; CP TOOLCHANGE UNLOAD` the nozzle seems to be close to the wipe tower. Instead of stopping you could slow down the wiping in the wipe tower. As the wiping of the "old" filament is pretty short, the example below slows down the wiping the new "new" filament. Activate `Regular expression` for the substitution Find: `(; CP TOOLCHANGE WIPE)` Replace with: `\1\n; slow down\nM220 S60` (slow down to 60% speed) There is no need to switch back to the default speed, as this is done by `M220 B` and `M220 R` commands already present in the generated gcode. ``` ... ; CP TOOLCHANGE START ; toolchange #2 ; material : PLA -> PETG ;-------------------- M220 B M220 S100 ; CP TOOLCHANGE UNLOAD ... ; select tool T2 ... ; CP TOOLCHANGE WIPE ; slow down M220 S60 ... M220 R G1 F10800 G4 S0 G92 E0 ; CP TOOLCHANGE END ... ``` https://marlinfw.org/docs/gcode/M220.html
bubnikv commented 2 years ago

But I guess it's not only about the efforts required to do so. I think the relevance to (the majority of) the users and usability do matter too.

Usability, maintainability and testing effort.

It would be lovely to have a user curated repository of post-processing scripts and regular expression replacements fitting various tasks.

traderhut commented 2 years ago

(FYI: I updated the 8113 request, to show why it won't be solved by this request)