Repetier Color Mixing

From RepRapWiki
Jump to: navigation, search

Crystal Clear action run.png
Repetier Color Mixing

Release status: working

RGV color wheel 1908.png
Description How-to
License GPL
Based-on Sui Generis
Categories Diamond Hotend
CAD Models none
External Link none

Using a single nozzle with at least two filament feeds like for instance the Diamond Hotend, it is possible to create a rainbow of colors.

For reference this guide was made using the genuine Diamond Hotend from on a bq Prusa i3 Hepestos 3D-printer setup as described on the Diamond Hotend page loaded with cyan, magenta and yellow filaments.

Multicolor #3DBenchy



In order to create a working setup it is possible to download a fresh copy of Repetier-Firmware from the v092 configurator

  1. Go to File:DiamondRepetierConfiguration.h and save the file as configuration.h
  2. Then upload it to the configurator mentioned above
  3. Optional: make appropriate changes to fit your specific printer
  4. Download the complete firmware at the end of the configurator

Since Ramps has only two on-board extruders drivers you physically need to attach a third extruder driver externally eg. Stepper Expander X1.

RUMBA boards already feature 6 stepper motor outputs so the below changes does not apply to that board.

In Pins.h (scroll down into the “RAMPS pin assignment” section or the board matching your setup) make sure the following lines are present, if not add them:

#define ORIG_E2_STEP_PIN        64
#define ORIG_E2_DIR_PIN         59
#define ORIG_E2_ENABLE_PIN      44


(pin numbers shown are the digital pins corresponding to a Ramps board with a Stepper Expander X1 connected as described on Adding more extruders)

If you have a board not mentioned here, please refer to the documentation of that board in order to obtain the necessary pin assignments.


  • A PC running Repetier-Host V1.6 or later (some earlier versions may work but these are not tested)
  • 3D-printer setup with Repetier-firmware v0.92 (or later) as specified above
  • Mixing extruder (one nozzle for all colors)
  • Filaments loaded:
    • Extruder 0: Cyan
    • Extruder 1: Magenta
    • Extruder 2: Yellow

Setting up colors in Repetier-Host

  • In Config -> Printer Settings select the Extruder pane
  • Adjust Number of Extruder to 16
  • Set a checkmark in the box Printer has a Mixing Extruder (one nozzle for all colors)
  • To enter a color representation in Repetier-Host of the mixed filament, for each of the extrudes below enter a name, then click the color rectangle, click Define Custom Colors >> and enter the following Red, Green and Blue values:
1 Cyan            R0   G255 B255
2 Ocean           R0   G191 B255
3 Blue            R0   G0   B255
4 Violet          R169 G0   B255
5 Magenta         R255 G0   B255
6 Raspberry       R255 G0   B169
7 Red             R255 G0   B0
8 Orange          R255 G159 B0
9 Yellow          R255 G255 B0
10 Spring Green   R191 G255 B0
11 Green          R0   G255 B0
12 Turquoise      R0   G255 B191
13 Cyan-Brown     R83  G106 B106
14 Magenta-Brown  R106 G83  B106
15 Yellow-Brown   R106 G106 B83
16 Brown          R83  G83  B83
  • Then click the tab Scripts
  • Click the drop down menu Scripts and select Script 1 (alternatively select Start Code in order to use this color scheme every time you slice)
  • In the text field below copy and paste the following script in order to setup a rainbow on virtual extruders 0 till 11 and grey-brownish colors on virtual extruders 12-15

Example printout of the color palette shown below
Example printout of the color palette shown below with the secondary colors Cyan, Magenta and Yellow in positions 1, 5 & 9 as seen from the left

Mixing the secondary colors produces the various colors including the primary colors red, green and blue, however because of imprecise cyan and magenta colors used here, the mixing outcome was not very accurate.

; Cyan
M163 S0 P1
M163 S1 P0
M163 S2 P0
M164 S0

; Ocean
M163 S0 P5
M163 S1 P1
M163 S2 P0
M164 S1

; Blue
M163 S0 P1
M163 S1 P1
M163 S2 P0
M164 S2

; Violet
M163 S0 P1
M163 S1 P5
M163 S2 P0
M164 S3

; Magenta
M163 S0 P0
M163 S1 P1
M163 S2 P0
M164 S4

; Raspberry
M163 S0 P0
M163 S1 P5
M163 S2 P1
M164 S5

; Red
M163 S0 P0
M163 S1 P5
M163 S2 P1
M164 S6

; Orange
M163 S0 P0
M163 S1 P1
M163 S2 P1
M164 S7

; Yellow
M163 S0 P0
M163 S1 P0
M163 S2 P1
M164 S8

; Spring Green
M163 S0 P1
M163 S1 P0
M163 S2 P5
M164 S9

; Green
M163 S0 P1
M163 S1 P0
M163 S2 P1
M164 S10

; Turquoise
M163 S0 P5
M163 S1 P0
M163 S2 P1
M164 S11

; Cyan-Brown
M163 S0 P2
M163 S1 P1
M163 S2 P1
M164 S12

; Magenta-Brown
M163 S0 P1
M163 S1 P2
M163 S2 P1
M164 S13

; Yellow-Brown
M163 S0 P1
M163 S1 P1
M163 S2 P2
M164 S14

; Brown
M163 S0 P1
M163 S1 P1
M163 S2 P1
M164 S15
  • In Config -> Preferences setup a slightly better lighting scheme by clicking 3D Visualization, then clicking Lights, enabling all the checkboxes and entering these numbers:
    • X-Direction: -1, 1, -1, 1
    • Y-Direction: 2, 2, -1, -1
    • Z-Direction: -2, -2, 2, 2
  • Then close the window

Retraction fine tuning

In order to avoid stringing it is important to let the firmware do the retraction.

  • In Slic3r's Printer Settings:
    • Go to General - Advanced - place a check mark next to "Use firmware retraction"
    • Go to Extruders (1, 2, etc) - Retraction - set Lift Z: 0 as this behaviour is already set via firmware retraction.
  • Open a connection to your printer via Repetier-Host and press Alt+E to edit "Repetier Firmware EEPROM Settings" and enter your desired values, the default values are as follows:
    • Retraction length [mm]: 5
    • Retraction length extruder switch [mm]: 5
    • Retraction speed [mm/s]: 50
    • Retraction z-lift [mm]: 0.3
    • Extra extrusion on undo retract [mm]: 0
    • Extra extrusion on undo switch retract [mm]: 1
    • Retraction undo speed [mm/s]: 20
  • Click OK to save settings to EEPROM and close the window

These settings are confirmed to be good on a system with 50 cm bowden tubes. You may want to fine tune your settings for optimal results. Also for a different setup changes to these parameters may be needed

Note: Although firmware retraction works perfectly for print jobs that does not actually use the colormixing feature of Repetier-Firmware, Slic3r 1.1.7 has a bug that sometimes G11 firmware unretract is not issued after a toolchange. Of course the colormixing functionality works with oldschool retraction, but on the cost of improper retraction.

This issue seems to be fixed in Slic3r 1.2.9 now with slightly better results (talk) 06:31, 10 February 2016 (PST)


Opposite to what is mentioned on the Diamond Hotend page section "Multi material printing with Repetier Host" you need to load your desired multi-material object (primary object) first and then the primetower (which corresponds to the number of color gradients used in the primary object), in order to set the sequence of colors according to the first object loaded.

Resize the primetower so that is has the same height as the primary object.

As usual the primetower has to be located behind the primary object in order to be printed first.


In Repetier-Host, slice the setup using Slic3r version 1.1.7 or later (other versions may work but remain untested)

If using Slic3r 1.1.7 there is a bug: when the slicing process is finished you must manually edit the gcode: (Note: this bug is fixed in Slic3r 1.2.9)

  • Scroll down to the line that reads
    M109 S200,200,200
    (your actual setup may specify a temperature different than 200, that is not the issue here).
  • Remove the last part of that line so that it reads just
    M109 S200
    (200, or whatever temperature you filament needs)
  • Save the gcode file or print directly.


After connection to the printer is established, in the right pane of the main window select the tab Manual Control and press the encircled number 1. This will send the specific color scheme to the firmware. Do this prior to printing or simply include the color setup gcodes in your start gcode in Slic3r.

Happy rainbow printing in CMY-color :-) (talk) 08:44, 9 February 2016 (PST)


Mixing extruder theory.txt
Repetier-Firmware v0.92 configurator
Repetier homepage Color mixing on Wikipedia
The CMYK Color Wheel

Cyan and Magenta filaments:
Yellow filament is quite easy to come around, however true cyan and magenta seems a little difficult to obtain at a fair price, so until true confirmed CMY colors have become commonly available here is a couple of suggestions for individual filaments that are considered "close matches". If you find a good match please feel free add it to the list so that others may benefit from that information.

  • Opaque Cyan PLA 1.75 mm
  • Opaque Magenta PLA 1.75 mm
  • Opaque Magenta PLA 1.75 mm & 3 mm
  • translucent Cyan PLA 1.75 mm
  • Still not identified: translucent Magenta PLA 1.75 mm