Notifications
Clear all

Cleaning/purging gcode?  

  RSS
martin.m25
(@martin-m25)
Estimable Member
Cleaning/purging gcode?

Hi all,

 

when switching from PETG to PLA, I'd like to run a healthy amount of cleaning filament through the extruder. For my non-MMU2s-MK3 I made a gcode which did:

  1. Heat up to 230°
  2. Unload filament (from last print run)
  3. Wait for button press
  4. load filament (cleaning)
  5. run 400 mm
  6. eject+cooldown

which worked OK. Now with the MMU2S this does not work anymore. Does anyone have a suggestion how to put together a gcode which loads the cleaning filament, extrudes a certain amount and then unloads it. I have looked at the generated code for a normal print and there's tons of stuff in there I don't know what it does. Now I could go through every line and find out what it does - or ask here if someone has a good idea?

Thanks!

 

 

- Martin

Posted : 15/06/2019 4:32 pm
gnat
 gnat
(@gnat)
Noble Member
RE: Cleaning/purging gcode?

Here is info from another thread about MMU specific gcode commands. I have only played with the T commands (moving the selector).

I expect that you gcode would need to select the desired tool (T) and then load the filament (L). Then you should be able to continue using your original gcode. When you are ready to unload, use the U command. That's theory though as I have not tested such commands. Also note that the T command is the only MMU commands that is documented.

Posted by: gnat

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
Posted : 15/06/2019 6:54 pm
davidsteinman
(@davidsteinman)
Active Member
RE: Cleaning/purging gcode?

You shouldn't need to unload the previous filament, that should be done unless you run non-MMU2 gcode.  Then I just remove the PTFE tube from the extruder and put the cleaning filament in directly.  I just move the extruder manually, but you should be able to use your gcode.

David

Posted : 15/06/2019 7:07 pm
martin.m25
(@martin-m25)
Estimable Member
Topic starter answered:
RE: Cleaning/purging gcode?

@David - you are right, if I remove the tube from the extruder, it works perfectly... thanks! BTW here's what I use:

M107 ; Fan off
M83 ; extruder relative mode
M104 S230 ; set extruder temp
M109 S230 ; wait for extruder temp
G1 E-100 F5000 ; unload filament
M0 ; wait for user
G1 E70 F400
G1 E400 F150
G1 E-80 F7000

G4 ; wait
M221 S100
M104 S0 ; turn off temperature
M107 ; turn off fan
M84 ; disable motors

Martin

- Martin

Posted : 15/06/2019 7:22 pm
davidsteinman
(@davidsteinman)
Active Member
RE: Cleaning/purging gcode?

Thanks, I will try it.

My problem is forgetting to purge PETG before starting a PLA print.  If I notice, I will quickly raise the temperature. 

Before the MMU2 it was not a problem since the filament was still in the extruder.  Since I use PLA at 215 even for multicolor prints, it is not much of a problem since the PETG will still extrude.

David

Posted : 15/06/2019 10:05 pm
Share: