Notifications
Clear all

Custom g-code for cutting filament?  

  RSS
GeeThreeDee
(@geethreedee)
Eminent Member
Custom g-code for cutting filament?

Hi

I just got the MMU2 and had some problems with the filament tip after a change. Is there any possibility to set a custom g-code for the MMU in the PrusaSlicer to do some movements?

I want to pull out a bit of the filament after the selector is out of the way and then cut it to get a nice tip.

Is that even possible?

Thanks

 

Publié : 07/06/2019 3:04 pm
gnat
 gnat
(@gnat)
Noble Member
RE: Custom g-code for cutting filament?

There are the T codes for moving the selector, but I don't see anything that would let you feed filament for anything other than the current tool.

MMU tips and troubleshooting
Publié : 07/06/2019 6:11 pm
vintagepc
(@vintagepc)
Membre
RE: Custom g-code for cutting filament?

I saw some commits recently that enabled a cut filament capability in the firmware github... so maybe soon?

 

Look at May 30 and 31:

https://github.com/prusa3d/Prusa-Firmware/commits/MK3

Publié : 07/06/2019 6:18 pm
gnat a aimé
gnat
 gnat
(@gnat)
Noble Member
RE: Custom g-code for cutting filament?

Thanks @vintagepc

https://github.com/prusa3d/Prusa-Firmware/blob/8bc4952f10df34e17c6391bcc620fb6673dda16f/Firmware/mmu.cpp#L1402

So based on that, if filament cutting is enabled it appears that there are undocumented K commands to perform the cut.

Actually, digging further it appears the K commands (as well as others I haven't seen documentation for) are supported and the compile flag is just if it is made available through the LCD menu: https://github.com/prusa3d/Prusa-Firmware/blob/04ac2599380a3bec21b079ceb6d5a1f9e5a8598d/Firmware/mmu.h#L34

The next question would be to look at the MMU firmware to see if the command is supported there.

MMU tips and troubleshooting
Publié : 07/06/2019 6:42 pm
gnat
 gnat
(@gnat)
Noble Member
RE: Custom g-code for cutting filament?

So it appears that the cut function is in the MMU firmware without a compile time conditional:

So it would seem that you could add the appropriate K command (K0 = tool 1 ... K4 = tool 5).

From that main.cpp we can also see the other gcode functions:

  • Tn: (documented) moves the selector to the given tool
  • Ln: loads the filament for the given tool
    • So this appears to be the answer to my original positing.
  • M0: sets normal mode
  • M1: sets stealth mode
  • Un: unloads the filament for the given tool
  • X0: resets the MMU
  • P0: reads the FINDA value
  • S0: simply returns OK
  • S1: reports the MMU firmware version
  • S2: reports the build number
  • S3: reports drive errors
  • Fn x: Something about setting a filament type
    • The default type values are -1 for all 5 tools and I don't see any code notes.
  • C0: Continue loading the current filament
    • There is a note "used after T-Code"
  • En: Eject filament for the given tool
  • R0: Recover after eject
  • W0: Wait for user click
  • Kn: Cut filament for the given tool 
MMU tips and troubleshooting
Publié : 07/06/2019 7:21 pm
Bendermk6 a aimé
GeeThreeDee
(@geethreedee)
Eminent Member
Topic starter answered:
RE: Custom g-code for cutting filament?

Thanks a lot for having such a deep look inside the code to figure that out!

I will try to test some of the codes, to see if it makes sense.... or to realize why Prusa did not implement it from the beginning on 😉

 

Publié : 11/06/2019 8:18 am
Pixel
(@pixel)
Trusted Member
RE: Custom g-code for cutting filament?
Posted by: geki

Thanks a lot for having such a deep look inside the code to figure that out!

I will try to test some of the codes, to see if it makes sense.... or to realize why Prusa did not implement it from the beginning on 😉

 

Filament cutting is enabled by default as the way the whole system is setup it will always cut off any stringing when it moves from extruder 5 back to a lower number.

this is also the reason why the MMU will always try to go from filament 5 back to filament one so it cuts of all the stringing in one move.

 

Publié : 11/06/2019 3:12 pm
GeeThreeDee
(@geethreedee)
Eminent Member
Topic starter answered:
RE: Custom g-code for cutting filament?

In this case, my default value is different 😉

It just goes from one filament to the other directly and I haven't changed anything so far. I guess there's an option somewhere in the menu. So I'll try that first.

In general, after changing some settings in the PrusaSlicer as recommended here in the forum and doing some improvements with the PTFE tubes (tubes were squeezed a bit and filament had troubles running through it) the MMU2 works much more reliable. So my hope is, that I don't need any cutting modifications, even if I would have liked to see the MMU cutting some filament 😋 

 

Publié : 12/06/2019 3:19 pm
Nikolai
(@nikolai)
Noble Member
RE: Custom g-code for cutting filament?

I would recommend to play with the settings and get the filament tip right. Cutting the filament is not really a permanent solution. Even with perfect working cuts, the blade will get dull pretty fast. 

Often linked posts:
Going small with MMU2
Real Multi Material
My prints on Instagram

Publié : 12/06/2019 4:36 pm
Pixel
(@pixel)
Trusted Member
RE: Custom g-code for cutting filament?
Posted by: geki

It just goes from one filament to the other directly and I haven't changed anything so far. I guess there's an option somewhere in the menu. So I'll try that first.

So for you if you print 5 colors it goes 1>2>3>4>5 and then backwards 5>4>3>2>1 ?

that would seem wrong to me.

Publié : 13/06/2019 2:53 pm
PJR
 PJR
(@pjr)
Antient Member Moderator
RE: Custom g-code for cutting filament?

The blade is oriented such that the rear of the blade and not the cutting edge is facing the filament just unloaded.

This means that if the filament is not fully retracted, any movement towards the next (higher numbered) filament will either jam on the blade or push the blade out.

Basically, the blade can only cut when moving to the left (lower numbered) filament which is usually too late and any "damage" that's going to happen will already have happened 🙁

The cutting blade is somewhat useless, and I removed mine after a couple of days (it jammed on an unretracted filament and tried to take my thumb off when I tried to assist the selector movement).

 

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Publié : 13/06/2019 3:02 pm
Pixel
(@pixel)
Trusted Member
RE: Custom g-code for cutting filament?

that the blade will only cut when moving to the left is exactly why they do the movements like they do, if you print 5 color and start with filament 1 it will go up to filament 5 and then all the way back to number one cutting of all the stringing thats sticking out.

if you had filament in the way while moving right there is something wrong your your unloading process as the filament should retract so much that nothing is sticking out unless there is some stringing at the tip of the filament.

Publié : 13/06/2019 6:52 pm
Partager :