"Manual" multicolor  

Page 2 / 2
  RSS
michael.weston19
(@michael-weston19)
New Member

@joantabb

I love this solution. It's very clever and works great for the small jobs I typically print.

 

The only issue I'm having is the slicer (PrusaSlicer 2.2.0) puts a toolchange at the very beginning, so there's an unnecessary filament change that has to be edited out before printing. Not a big deal, but wondering if there's a way to get around it.

 

I'm still new at gcode and haven't found any parameter that might distinguish the first tool change to use in an IF expression. Has anyone else experienced this early toolchange and found a workaround other than manually editing the file?

 

Thanks,

Michael

Posted : 16/09/2020 2:30 pm
Bodo
 bodo
(@bodo)
Estimable Member

@michael-weston19 - I have experienced that as well.

My part has three tools, thus two tool changes as the first material is loaded before starting the print, as you would do with every single-tool-one-colour-print.

My workaround is to just comment out the first M600 line in the gcode file. This is what the first 76 rows of the file look like:

; generated by PrusaSlicer 2.2.0+win64 on 2020-09-21 at 06:53:08 UTC

;

; external perimeters extrusion width = 0.25mm
; perimeters extrusion width = 0.25mm
; infill extrusion width = 0.25mm
; solid infill extrusion width = 0.25mm
; top infill extrusion width = 0.25mm
; first layer extrusion width = 0.30mm

; external perimeters extrusion width = 0.25mm
; perimeters extrusion width = 0.25mm
; infill extrusion width = 0.25mm
; solid infill extrusion width = 0.25mm
; top infill extrusion width = 0.25mm
; first layer extrusion width = 0.30mm

; external perimeters extrusion width = 0.25mm
; perimeters extrusion width = 0.25mm
; infill extrusion width = 0.25mm
; solid infill extrusion width = 0.25mm
; top infill extrusion width = 0.25mm
; first layer extrusion width = 0.30mm

M73 P0 R555
M73 Q0 S556
M201 X1000 Y1000 Z1000 E5000 ; sets maximum accelerations, mm/sec^2
M203 X200 Y200 Z12 E120 ; sets maximum feedrates, mm/sec
M204 P1250 R1250 T1250 ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2
M205 X8.00 Y8.00 Z0.40 E1.50 ; sets the jerk limits, mm/sec
M205 S0 T0 ; sets the minimum extruding and travel feed rate, mm/sec
M107
M862.3 P "MK3S" ; printer model check
M862.1 P0.25 ; nozzle diameter check
M115 U3.8.1 ; tell printer latest fw version
G90 ; use absolute coordinates
M83 ; extruder relative mode
M104 S240 ; set extruder temp
M140 S105 ; set bed temp
M190 S105 ; wait for bed temp
M109 S240 ; wait for extruder temp
G28 W ; home all without mesh bed level
G80 ; mesh bed leveling
G1 Y-3.0 F1000.0 ; go outside print area
G92 E0.0
G1 X60.0 E8.0 F700.0 ; intro line
M73 Q0 S556
M73 P0 R555
G1 X100.0 E12.5 F700.0 ; intro line
G92 E0.0
M221 S95
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
; M600
T0
M900 K30; Filament gcode
;BEFORE_LAYER_CHANGE
G92 E0.0
;0.2


G1 E-0.80000 F2100.00000
G1 Z0.150 F10800.000
G1 Z0.200
;AFTER_LAYER_CHANGE
;0.2
G1 Z0.350
G1 X86.797 Y77.450
G1 Z0.200
G1 E0.80000 F2100.00000
M204 S500
G1 F1200.000
G1 X88.018 Y75.821 E0.04438
G1 X89.612 Y73.948 E0.05363

Everything above the last paragraph is just the header of the gcode; the last paragraph is the start of the geometry specific moves. The outcommented line is nine lines before the last paragraph, and starts with a semicolon that is the symbol for comment at the start of the line. The M600 is ignored, the print skips the redundant filament change. Works for me.

Obviously, the file has a lot more lines below that - ~500k in my case. There's two more M600 commands in the code further down to change the filament colour.

This post was modified 1 month ago by Bodo
Posted : 21/09/2020 10:46 am
Diem
 diem
(@diem)
Active Member

@michael-weston19 , @bodo

The following Perl script will comment out the first 'tool change' for you:

#!/usr/bin/perl
# Copy (gcode) file except comment out first line including 'M600' - toolchange.
use strict;
my $done=0;
while(<>){
if($done){
print $_;
} else {
if(/M600/){
print ';',$_;
$done++;
} else {
print $_;
}
}
}

Copy it as detool.pl , make it executable and use it from the command line like this:

#    detool.pl /path_to/slicer.gcode > /path_to/printer.gcode

It should work as-is on almost all Linux distros including Raspberry Pi, on Macs and on a great many other systems; if you have a very unusual setup you might need to change the first line to point to your Perl installation.  If you use Windows you will have to install Perl from somewhere and maybe pay for it.

Of course, if the printer is already loaded with the wrong filament, don't use this script; begin the print as usual and use the first change to load the one you prefer.

* * *

@joantabb

For some reason I hadn't seen this thread until now - you may have heard the clang of a very large penny dropping.

          Thank You.

I can now cannibalise my MMU for spare parts without that niggling doubt that some day I might want to re-fit it.

I presume that like me you found the MMU impractical for true multi-material printing and only really of use for colour changes - which, except for the odd label or scale marking, are of no interest to me.

Like you I had found it possible to change filaments manually but it was a real hassle - until now. Your blindingly simple ploy of limiting the second colour to two layers transforms the process and if you invert the print and label on the bed it's only a little more bother than watching the first layer go down as usual.

Does it work?

Attached is a picture of a pair of left-handed, 1mm scales that would have been almost impossible any other way.  Not perfect, but extremely good for a 0.4mm nozzle.

 

 

This post was modified 4 weeks ago by Diem
Posted : 29/09/2020 3:46 pm
Bodo liked
Bodo
 bodo
(@bodo)
Estimable Member

Thank you, @diem - script works well on Kubuntu 20.04!

Posted : 02/10/2020 12:11 am
Page 2 / 2
Share:

Please Login or Register