Manual multicolor printing: unnecessary M600 at start
 
Notifications
Clear all

[Solved] Manual multicolor printing: unnecessary M600 at start  

  RSS
AnneVanLeyden
(@annevanleyden)
Active Member
Manual multicolor printing: unnecessary M600 at start

I'm not sure why I couldn't find any posts on this subject. I must have been searching for the wrong thing, or the solution is staring me in the face...

I have a simple label with a text embedded in the top layer. I would expect it to start printing the label in the default color and then prompt me for a filament change near the end of the print to insert the second color.

My problem is that Prusaslicer always inserts an M600 between the intro line and the start of the print. Even though it shows the intro line and the skirt and the label in the same color:

Is there a way to get rid of that completely unnecessary tool change? 

(Not the subject of this post, but a firmware optimisation might be to have an option to skip a tool change. My Prusa now forces me to unload/load the same filament)

I would have liked to attach the 3mf file of the project. However, I get a 'Sorry, this file type is not permitted for security reasons' error when trying that.

Best Answer by FoxRun3D:

I actually just came across this thread: https://forum.prusa3d.com/forum/postid/562228/

The solution I found there is to make the M600 in the custom g-code conditional:

{if layer_num >= 0}
G0 X0 Y0
M600 ; change to filament for extruder {next_extruder + 1}
{endif}

🤦🏼🤦🏼🤦🏼 So simple, so logical, and it works. 

Posted : 18/05/2023 8:34 am
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: Manual multicolor printing: unnecessary M600 at start

I use the change to get the right colour in the extruder, ready for the first layer.
regards Joan

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 18/05/2023 3:18 pm
AnneVanLeyden
(@annevanleyden)
Active Member
Topic starter answered:
RE: Manual multicolor printing: unnecessary M600 at start

But most of the time, the correct filament is already loaded and I have to do the filament change dance nonetheless. 

Posted : 18/05/2023 4:02 pm
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: Manual multicolor printing: unnecessary M600 at start

you can edit the Gcode. to remove the M600

 

regards Joan

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 18/05/2023 5:51 pm
JimB
 JimB
(@jimb)
Estimable Member
RE: Manual multicolor printing: unnecessary M600 at start

I would have liked to attach the 3mf file of the project. However, I get a 'Sorry, this file type is not permitted for security reasons' error when trying that.

For reasons probably no one here understands, the forum is configured to reject most file types including then ones that are needed the most (like 3mf).  But it is happy with zip files, so just zip it and you should be able to post it just fine.

Posted : 18/05/2023 6:27 pm
AnneVanLeyden
(@annevanleyden)
Active Member
Topic starter answered:
RE: Manual multicolor printing: unnecessary M600 at start

I am already removing the M600 from the GCODE. But I'd like to prevent having to hand-edit gcode files. We have computers to do the repetitive work for us 😉 

This seems to be designed for automatic color changing only. If you want to do some simple dual color printing, like my example, a MMU is overkill (and brings its own set of challenges with it).

If your 2nd color is not the entire top layer(s), it seems I'm stuck with this kinda hacky workflow and post-processing the gcode.

On the upside... After some tinkering, I found out that best way to print this is use 0.4 mm line width for the base (fast) and 0.25 for the letters (sharp and detailed). And iron only the top surface of the base (and not the text!). It comes out beautifully. Way better than I could have hoped for.

Posted : 18/05/2023 8:05 pm
FoxRun3D
(@foxrun3d)
Famed Member
RE: Manual multicolor printing: unnecessary M600 at start

This is a long standing "feature" of the manual color swap procedure. As Joan suggested, either humor the software and reload the filament right away, or--what I do--use a text editor and remove the first occurrence of M600. I don't know of any other option short of modifying and recompiling the Prusaslicer source code.  

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 18/05/2023 8:30 pm
JimB
 JimB
(@jimb)
Estimable Member
RE: Manual multicolor printing: unnecessary M600 at start

You could probably creating a post-processing script (Print Settings -> Output options -> Post-processing scripts) that will make the modification automatically.

For example, if you are on a linux system, creating a script with the following contents and making it executable (chmod +x filename) and putting the path to it in the above mentioned setting in prusa-slicer will probably work (untested)

#!/bin/bash
sed -i '0,/^M600/{/^M600/d}' "$@"

Details of that command: sed is a stream editor. -i option means to modify the file in place.  0,/^M600/ means to apply the command between { and } to all lines from the beginning (0) to the line that starts with M600 (the '^' means match the beginning of the line).  The second /^M600/ will match any line in that previous range that starts with M600 (which is just the last line in that range, which is the first M600 line.  The 'd' says to delete the matching line.  The "$@" expands too all arguments given to the script (there should only be one -- the temporary .gcode filename).  So in summary, it will modify the give .gcode file in place by finding the first line that starts with M600 and removing it.

Posted : 18/05/2023 10:30 pm
FoxRun3D
(@foxrun3d)
Famed Member
RE: Manual multicolor printing: unnecessary M600 at start

You could probably creating a post-processing script (Print Settings -> Output options -> Post-processing scripts) that will make the modification automatically.

 

Good idea! Last time I used sed was 30 years ago…

What seems to make this a bit impractical for me is that the post-processing scripts are part of the print profiles, not the printer profile. I usually use my regular print profiles with a multi-extruder printer profile so creating another copy of each of print profiles with the post-processing step added sounds onerous.

Oh wait, if I use those print profiles with a normal printer profile there shouldn't be a M600 in the resulting gcode, so the postprocessing should just leave the file unchanged.

But then again… as soon as I'd add an Add Color Change for a layer-based color change it would now be there — and then get removed pronto by the script. Not what I want.

I guess I just keep editing the gcode file, takes ten seconds—and I don't have my head spinning 🙂

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 19/05/2023 12:34 am
Diem
 Diem
(@diem)
Illustrious Member

As the usual reason for manual multicolor printing is to put text labels on the bottom layer I keep a couple of print presets with altered elephant's foot settings and postprocess calls, labelled to suit, eg:  '0.20mm SPEED - MMMU - minimal e-foot'

- though my post process script is more extensive and as well as deleting the first change it writes a companion file listing all the filament changes and their timings.

Cheerio,

Posted : 19/05/2023 11:11 am
AnneVanLeyden
(@annevanleyden)
Active Member
Topic starter answered:
RE: Manual multicolor printing: unnecessary M600 at start

Thank you all for all the help and suggestions! At least I know this is 'as designed' and I can stop looking for a solution.

I think the best for now is JimB's workaround with a post processing script. I use Linux, so I can copy/paste the sed script.

Posted : 21/05/2023 6:06 am
Diem
 Diem
(@diem)
Illustrious Member
RE:

 If you are using Linux than this perl script should run out of the box:

#!/usr/bin/perl

# Prusa slicer manual MMU postprocess
# Remove first 'tool change' and
#    report all changes after that
#       - with times.
#
# Version 0.05

use strict;
my ($count,$done,$lctime,$ltime)=(0,0,0,0);

if(open my $OUT,">".%ENV{SLIC3R_PP_OUTPUT_NAME}.".changes.txt"){
  if(open my $OUTFIL,">",@ARGV[0].".tmp"){
	  
    print $OUT "Manual Multi Material Printing assistance:  post MMMUslice.pl\n\n";
    print $OUT "Filament changes; expressed as extruder selection, "
                        ."from gcode created for manual multicolour printing.\n\n";

    if(open( my $IN, @ARGV[0])){
      while (<$IN>){
		  if(/^M73 P(\d+) R(\d+)/){
			  $ltime=$2;
			  unless($lctime){
				  $lctime=$ltime;
			  }
			  print $OUTFIL  $_;
		  } elsif(/^M600/){
	        if ($done){
			 my $m=$lctime-$ltime;
			$lctime=$ltime;
            print $OUT "$m minutes  Change -> ";
            $count++;
            print $OUTFIL  $_;
          } else {
		    print $OUTFIL  ';',$_;
            $done++;
	      }
        } else {
	      print $OUTFIL  $_;
	   }
    
        if(/^T(\d)/){
          print $OUT "Extruder  ".($1+1)."\n";
        }
      }
      unless($count){
	    print $OUT "\nNo 'M600' filament changes detected.\n";
     } else{
       print  $OUT "\n$count 'M600' filament changes.\n";
     } 
 
    } else {
       print $OUT "Unable to open ".@ARGV[0]."\n";
    }
    rename @ARGV[0].".tmp",@ARGV[0];
  } else {
     print $OUT "Unable to change ".@ARGV[0]." InInitial unnecessary change still in place.";
  }
 # Come here if fail to open changes file - no point in doing anything.
}

 Save it somewhere sensible as 'postMMMUslice.pl', make it executable and insert the following into the post processing call - substituting your path:

/Your_Path_To/postMMMUslice.pl;

This will strip the first tool change and write a second file listing all the working tool changes and timings.

Cheerio,

Posted : 21/05/2023 11:09 am
FoxRun3D
(@foxrun3d)
Famed Member
RE:

I actually just came across this thread: https://forum.prusa3d.com/forum/postid/562228/

The solution I found there is to make the M600 in the custom g-code conditional:

{if layer_num >= 0}
G0 X0 Y0
M600 ; change to filament for extruder {next_extruder + 1}
{endif}

🤦🏼🤦🏼🤦🏼 So simple, so logical, and it works. 

This post was modified 1 year ago by

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 27/05/2023 11:54 am
Share: