MM Print: How to show display message for next color
 
Notifications
Clear all

MM Print: How to show display message for next color  

  RSS
Mike_GKA
(@mike_gka)
Active Member
MM Print: How to show display message for next color

I want to print different colors in one layer and on every color change I want to display the next color.
What I have done:
- define several "virtual" extruders and assign the colors
- add tool change code

; eliminate first tool change
{if previous_extruder != -1}
; color notification
M117 Next color is {
  (extruder_colour[next_extruder] == "#00FF00" ? "GREEN" 
  :(extruder_colour[next_extruder] == "#FF0000" ? "RED"
  :(extruder_colour[next_extruder] == "#FFFF00" ? "YELLOW"
  :(extruder_colour[next_extruder] == "#0000FF" ? "BLUE"
  :(extruder_colour[next_extruder] == "#FFFFFF" ? "WHITE"
  :(extruder_colour[next_extruder] == "#000000" ? "BLACK"
  :(extruder_colour[next_extruder] == "#999999" ? "GRAY"
  :(extruder_colour[next_extruder] == "#D4AF37" ? "GOLD"
  :(extruder_colour[next_extruder] == "#C0C0C0" ? "SILVER"
  :(extruder_colour[next_extruder] == "#FF8000" ? "ORANGE"
  :(extruder_colour[next_extruder] == "#800080" ? "PURPLE"
  :(extruder_colour[next_extruder] == "#FF6600" ? "ORANGE"
  :(extruder_colour[next_extruder] == "#F0F0F0" ? "TRANSPARENT"
  :(extruder_colour[next_extruder] == "#800000" ? "BROWN"
  :extruder_colour[next_extruder]
  ))))))))))))))
};
M601
M600
{endif}

The idea behind this code: left a message on the display and pause and after that change the tool
- The generated gcode looks like

...
...
; Filament-specific end gcode
; eliminate first tool change

; color notification
M117 Next color is YELLOW;
M601
M600
T1
...
...

- which looks fine from point of view.

BUT

The message "Next color is YELLOW" is only shown for 1 or 2 seconds
AND the pause occurs after the tool change not before.

What is wrong???

Posted : 24/02/2023 5:48 pm
fuchsr
(@fuchsr)
Famed Member
RE: MM Print: How to show display message for next color

M117 is usually "wiped out" by just about anything, you'll have to add a G4 (dwell) command to wait. Why it appears after the tool change, I don't know, odd.

Posted : 24/02/2023 6:09 pm
Mike_GKA
(@mike_gka)
Active Member
Topic starter answered:
RE: MM Print: How to show display message for next color

Thanks @fuchsr
with G4 it works a little better, the message is displayed for a certain interval (e.g. G S4 for 4 seconds). I still have to sit in front of the printer and see what message comes up. And a pause (M601) leads to a pause after the tool change although the command is in the gcode before the tool change.

I would like to get the printer to pause when changing tools and show in the display what the next color will be.

Posted : 27/02/2023 12:26 pm
fuchsr
(@fuchsr)
Famed Member
RE: MM Print: How to show display message for next color

What happens when you put the M117 and G4 after the M601? I'm still confused why you're seeing it executed after the M600. 

Are you running the gcode from Octoprint or USB stick? I've seen reports of Octoprint not playing nice with M601.

 

Posted : 27/02/2023 12:47 pm
Mike_GKA
(@mike_gka)
Active Member
Topic starter answered:
RE: MM Print: How to show display message for next color [solved]

Thanks @fuchsr

I don’t use OctoPrint, everything is printed directly from USB-Stick.

What happens when you put the M117 and G4 after the M601?

is nearly the solution. In addition you need a M400 after M601 and before M117.

Now it works:

First you get a Pause, pressing continue you get the message what next color is needed, seconds later with M600 the tool change started.

Now my code in Tool change G-Code:

; eliminate first tool change
{if previous_extruder != -1}
M601 ; Pause
M400 ; wait until all moves are completed
; color notification
M117 Next color is {
  (extruder_colour[next_extruder] == "#00FF00" ? "GREEN" 
  :(extruder_colour[next_extruder] == "#FF0000" ? "RED"
  :(extruder_colour[next_extruder] == "#FFFF00" ? "YELLOW"
  :(extruder_colour[next_extruder] == "#0000FF" ? "BLUE"
  :(extruder_colour[next_extruder] == "#FFFFFF" ? "WHITE"
  :(extruder_colour[next_extruder] == "#000000" ? "BLACK"
  :(extruder_colour[next_extruder] == "#999999" ? "GRAY"
  :(extruder_colour[next_extruder] == "#D4AF37" ? "GOLD"
  :(extruder_colour[next_extruder] == "#C0C0C0" ? "SILVER"
  :(extruder_colour[next_extruder] == "#FF8000" ? "ORANGE"
  :(extruder_colour[next_extruder] == "#800080" ? "PURPLE"
  :(extruder_colour[next_extruder] == "#FF6600" ? "ORANGE"
  :(extruder_colour[next_extruder] == "#F0F0F0" ? "TRANSPARENT"
  :(extruder_colour[next_extruder] == "#800000" ? "BROWN"
  :extruder_colour[next_extruder]
  ))))))))))))))
};
G4 S4 ; wait 4 seconds
M600
{endif}

This results in gCode:

...
...
; eliminate first tool change

M601 ; Pause
M400 ; wait until all moves are completed
; color notification
M117 Next color is YELLOW;
G4 S4 ; wait 4 seconds
M600
T1
...
...

Thanks a lot!

Posted : 27/02/2023 3:13 pm
eoyilmaz
(@eoyilmaz)
Active Member
RE:

So following this thread and some issue tickets in Marlin I came up with the following that worked perfecty for me:

Prusa Slicer settings

  1. Printer Settings
    1. General -> Capabilities
      1. Set Extruder to the number of colors you want to print with
      2. Single Extruder Multi Material: Don't enable this even if we are printing with single material, I found that this is doing some weird stuff like depositing too much filament on to the start of the wipe tower
    2. Custom G-Code -> Tool Change G-Code:
      ; eliminate first tool change
      {if previous_extruder != -1}
      ; REMOVE_NEXT_LINE
      T[next_extruder]
      {if has_wipe_tower}
      G0 X{wipe_tower_x} Y{wipe_tower_y} F1800
      {else}
      G0 X20 Y200 F1800
      {endif}
      G0 Z{toolchange_z+10} F6000
      ; color notification
      ; beep to inform a color change
      M300 S2000 P100
      M0 Next color is{if extruder_colour[next_extruder] == "#000000"} BLACK
      {elsif extruder_colour[next_extruder] == "#0000FF"} BLUE
      {elsif extruder_colour[next_extruder] == "#800000"} BROWN
      {elsif extruder_colour[next_extruder] == "#0099FF"} CYAN
      {elsif extruder_colour[next_extruder] == "#999999"} GRAY
      {elsif extruder_colour[next_extruder] == "#D4AF37"} GOLD
      {elsif extruder_colour[next_extruder] == "#00FF00"} GREEN
      {elsif extruder_colour[next_extruder] == "#FF00FF"} MAGENTA
      {elsif extruder_colour[next_extruder] == "#FF8000"} ORANGE
      {elsif extruder_colour[next_extruder] == "#FF6600"} ORANGE
      {elsif extruder_colour[next_extruder] == "#FF3399"} PINK
      {elsif extruder_colour[next_extruder] == "#800080"} PURPLE
      {elsif extruder_colour[next_extruder] == "#FF0000"} RED
      {elsif extruder_colour[next_extruder] == "#C0C0C0"} SILVER
      {elsif extruder_colour[next_extruder] == "#F0F0F0"} TRANSPARENT
      {elsif extruder_colour[next_extruder] == "#FFFF00"} YELLOW
      {elsif extruder_colour[next_extruder] == "#FFFFFF"} WHITE
      {endif};
      M600 B0
      G0 Z{toolchange_z} F6000
      {endif}

      This is kind of similar to @mike_gka 's code. This code
      - Moves the head over the corner of the wipe tower
      - Beeps
      - Displays the next color message and waits indefinetely for the user click to the button. (This requires an update to Marlin to prevent the head to do a home move if you wait more than a couple of minutes at this stage, explained below).
      - Triggers M600 for the filmanet change
      - Returns to the corner of the wipe tower and continues to print

  2. Print Settings:
    1. Multiple Extruders -> Wipe Tower:
      1. Enable: Checked
      2. Position X & Position Y: Don't bother setting these as you can do it in the 3D view
      3. Width: I set mine to 60 mm and it seems to be a good dimension.
      4. Wipe tower brim width: 10 mm, this seems a little too much, but I don't want to tip the wipe tower down.
      5. Prime all printing extruders: Unchecked, as this adds unnecessary filament changes at the begining, and it was trying to print over the bed clips (in my ender 3 pro)
    2. Output Options -> Post Processing scripts:
      1. Add the following script (for Linux and MacOS, no idea what it needs to be for Windows), it is very important, otherwise your print will be ruined after a tool change:
        /usr/bin/sed -i -e '/REMOVE_NEXT_LINE/,+1d';
      2. What this does is to remote the T0, T1, T2... commands from the GCode. Unfortunatelly I don't know the Windows counterpart of this command, last resort is to open the GCode with a text editor search for M600 and remote the lines containing a T0, T1, T2 etc...
      3. I think a config change to Marlin to set all the extruders to the same tool etc. can fix this step, but I haven't tested it.
  3. Filament Settings:
    1. Advanced -> Wipe Tower Parameters -> Minimal purge on wipe tower: 60 mm3
      This defines how thick the wipe tower is going to be and the default value of 15 mm3 created too thin wipe towers, so try different values with this.

I think that's it for Prusa slicer. Next is to update some setting in Marlin

Marlin

There need to be some settings changed in the Marlin firmware for convenience (reduced filament disposal before and after M600 and disabling homing if waited for M0 too long).

  1. Configuration.h
    No changes reuquired
  2. Configuration_Adv.h
    #define FILAMENT_CHANGE_UNLOAD_LENGTH      50  // down from 100
    #define ADVANCED_PAUSE_PURGE_LENGTH          5  // down from 50 
    #define FILAMENT_UNLOAD_PURGE_DELAY       2000  // down from 5000
    #define FILAMENT_CHANGE_ALERT_BEEPS          5  // down from 10
    //#define HOME_BEFORE_FILAMENT_CHANGE.  // comment this out

And that should be it, have fun!

 

This post was modified 7 months ago by eoyilmaz
Posted : 03/08/2023 12:50 pm
Mike_GKA
(@mike_gka)
Active Member
Topic starter answered:
RE: MM Print: How to show display message for next color

Thanks @eoyilmaz, but this will not work on Prusa MINI. G-code M0 and also M1 is ot working correctly on Prusa MINI.

And an other "problem" occure: G-Code with "M400 ; wait until all moves are completed" can't deployed on printables. I get the reply "M400 is an illegal code". In all documents I found M400 is a valid code for Prusa MINI. In some documents it is stated that M400 and G4 is the same on Prusa, but tests shows me it is not.

Posted : 13/09/2023 1:44 pm
Share: