Skip to content
Palette2 Post Processing tool for Slic3r
Branch: master
Clone or download
Latest commit ada9a20 Mar 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
docs
p2pp Updated G28 fileter Mar 17, 2019
screenshots
slic3r_templates Added M400 to force sync between extrusion and movements during the … Jan 8, 2019
P2PP.py
README.md
appicon.gif Refactor 27012019 Jan 27, 2019
favicon.ico Added small GUI for error processing Dec 28, 2018
p2pp.bat Add files via upload Mar 16, 2019
p2pp.sh
version.py Version 3.00 Mar 9, 2019

README.md

p2pp - Palette2 Post Processing tool for Slic3r PE

Tested with version 1.41.2 and 1.42.0 Alpha 1/2/3/5/7 earlier versions may generate different code patterns and may not work correctly. When using alpha versions of the slicer, please check the associated version bug logs to make sure it is not a slic3r pe known issue prior to reporting here. The alpha versions seem to work well, but they are not fnal release and still could hold issues affecting the p2pp script or the p2 functionality as a whole.

Purpose

Allow Palette 2 users to exploit all features and functionality of the palette 2 (Pro) with the Slic3r PE functionality for multi material printing including:

  • use of variable layers without bloating the wipe tower
  • wipe to waste object
  • wipe to infill
  • configurable option to create more filament at the end of the print

IMPORTANT:

P2pp currently only works for devices in a connected setup. It does not generate the required sequences to meet the Pause-based pings in accessory mode.

Functionality

P2pp is a python script with a shell script/batch file wrapper.

P22pp works as a post processor to GCode files generated by Splic3r PE, just like Chroma does. If does however not create any new code for wipe towers etc, it just adds Palette 2 MCF information codes to the file. The script is triggered automatically when exporting GCode or when sending information to the printer so no manual additional step is required.

IMPORTANT

Prior to using the script it is imperative that you setup the printer/Slicer PE according to the specifications set by Mosaic( this includes full calibration using canvas or Chroma). Follow the guide(s) below and create a new Printer profile as there are some settings that contradict the Mosiac Guide for slicing with Chroma. In addition, it's important that your printers extruder is calibrated and working correctly.

WINDOWS INSTALLATION

When updating p2pp to a new version all configuration in the .bat file is overwritten. Make sure to put the .bat file aside before replacing the directory content. Copy the file over the newly unzipped file to complete the installation.

  1. Clone this Github repository to a zip file and extract this zipfile to a location of your choice.
  2. Download and Install Python. P2PP is currently compatible with both Python 2.7 and 3.7. https://www.python.org/downloads/windows/
  3. In the .bat file change the following.
  • Change "c:\python27\python.exe" to your python.exe path
c:\python27\python.exe %MYPATH%\p2pp.py -i %1

Unix / Mac OSX INSTALLATION

When updating p2pp to a new version all configuration in the .bat file is overwritten. Make sure to put the .bat file aside before replacing the directory content. Copy the file over the newly unzipped file to complete the installation.

  1. Clone this Github repository to a zip file and extract this zipfile to a location of your choice.
  2. You will need either python 2.7 or python 3 to be installed on your machine.
  3. Further when running on a unix-flavoured system (Mac OSX or Linux), you will need to make the script p2pp.sh executable:
cd place_where_you_extracted_the_zip_file
chmod 755 p2pp.sh

Test your work by typing ./p2pp.sh and this should result in the following error:

usage: P2PP.py [-h] -i INPUT_FILE [-d OUTPUT_FILE] [-o SPLICE_OFFSET] [-g GUI]
               [-p PRINTER_PROFILE] [-s SILENT]
P2PP.py: error: argument -i/--input-file: expected one argument

This indicates all files are properly setup and has executed correctly. The remainder of the configuration is done in Slic3r PE

Configuration of Slic3r PE:

NOTE:

For now, there is no error checking on some of the P2PP codes. You need to ensure that they are followed exactly. They are CaSe SeNSiTiVE!

If you want a head-start, you can import the configuration file in the splic3r_templates subfolder. This file contains PLA Filament, print and printer definitions.

MANDATORY STEPS:

  1. Open one of the .mcf.gcode you recently sliced with Canvas or Chroma. It's important that you use a file that has been printed and or previously calibrated with to save manual additional steps. A mistake here will trigger recalibration with your printer for a new printer profile.
  2. Near the top of the gcode there should be a line starting with "O22 Dxxxxxxxxxxxxxxxxxxxx".
  3. Copy everything after the "D". This is your Printer Profile ID. Note this down and have it ready for the next steps. (Copy and paste, don't type it). E.G. If your O22 line reads "O22 De827315ff39aaaaa", then your printer profile is: e827315ff39aaaaa

Printer Settings

  1. In Slic3r, Click the "Printer Settings Tab".
  2. Click the "Custom G-code" menu item.
  3. Locate the "Start G-code" input box at the top.
  4. INSERT (not overwrite) the following lines at the TOP of the Start G-code. You'll note that they are all commented out and are in no way going to interfere with the print.
    ;P2PP PRINTERPROFILE=REPLACE_WITH_YOUR_PRINTER_PROFILE_ID_OBTAINED_FROM_ABOVE
    ;P2PP SPLICEOFFSET=30
    ;P2PP MINSTARTSPLICE=100
    ;P2PP MINSPLICE=80
    ;P2PP MATERIAL_DEFAULT_0_0_0
    ;P2PP MATERIAL_PVA_PVA_0_0_0
    ;P2PP MATERIAL_PVA_PLA_0_0_0
    ;P2PP MATERIAL_PLA_PLA_0_0_0
    ;P2PP MATERIAL_PET_PET_0_0_0
    
    ; Following settings are optional (see description below)
    
    ;P2PP LINEARPING
    ;P2PP EXTRAENDFILAMENT=150
    
    ; Following optional settings control the SIDE TRANSITIONING (see description below)
    ;P2PP BEDORIGINX=0
    ;P2PP BEDORIGINY=-10
    ;P2PP BEDSIZEX=250
    ;P2PP BEDSIZEY=220
    ;P2PP SIDEWIPELOC=X253.9
    ;P2PP SIDEWIPEMINY=45
    ;P2PP SIDEWIPEMAXY=195
    ;P2PP SIDEWIPECORRECTION=1.0
    
    ;P2PP BEFORESIDEWIPEGCODE ;--ENTER GCODE TO BE EXECUTED BEFORE SIDEWIPE (one coomand per line,can be multiple lines)
    ;P2PP AFTERSIDEWIPEGCODE ;--- ENTER GCODE TO BE EXECUTED AFTER SIDEWIPE (one coomand per line,can be multiple lines)
    
    

splice offset

  1. In the "After layer change G-code" INSERT (not overwrite) the following line.
    ;LAYER [layer_num]
    
  2. Click the "General" menu item.
  3. Locate "Capabilities".
  4. Change Extruders to "4".
  5. ENABLE "Single Extruder Multi Material" (Contradicts Mosaic Instructions).
  6. Click "Single Extruder MM Setup" menu item.
  7. Change ALL entries within "Single Extruder MM Setup" to 0.
  8. Click Each of the Extruders (1,2,3 & 4) and ensure their settings are Identical to each other (except the extruder colour)
  9. Click the floppy-disk icon, and append "Palette P2PP" to the end of the Printer Settings profile name.

SPLICEOFFSET Is the amount of mm added to the first splice. It works in a similar way to the transition position % from Chroma and Canvas. Here the value is a fixed length. In our testing, 30mm seemed to be a good position resulting in perfect prints. You may want to tweak this value if you find the transition happens too early or too late.

;P2PP SPLICEOFFSET=30

splice offset

MATERIAL_XXX_XXX_#_#_# This is used to to define heat/compression/cooling settings for the splice between materials. The MATERIAL_DEFAULT setting provides a configurable fallback in case no profile is defined for the material combination. Please be aware that entries are not symmetrical and you need to define the settings for both directions in order to specify a complete process. The definition is as per standard Chroma and Canvas profiles. Order of parameters is CURRENT-MATERIAL/NEW-MATERIAL/HEAT/COMPRESSION/COOLING. Default is all 0 as per standard in Chroma and Canvas.

;P2PP MATERIAL_PLA_PLA_0_0_0

LINEARPING [OPTIONAL] LINEARPING=# [OPTIONAL] This is used to keep the filament disctance between pings constant to 350mm (user can specify another base distance using the optional parameter. When tnot using linearping, ping distances grow exponentially thoughout the print. The distance between pings can mount up to 3m in large prints. The value specified with linearping is limited to 300mm and above. Problems have been reported with lower values.

;P2PP LINEARPING  
;P2PP LINEARPING=350

splice offset

EXTRAENDFILAMENT=# [OPTIONAL] This parameter is used to configure the extra length (in mm) of filament P2 will generate at the end of the print. The default parameter value is defined as 150mm. The value should at least be the length between the extruder motor to the nozzle.

;P2PP EXTRAENDFILAMENT=150

BEDORIGINX=nnn and BEDORIGINY=nnn#

Sets the origin of the bed. The default value is as defined below and should suite MK3 users. Users of other printers can override the defaults by using the below lines with the correct values in the printer Startup GCode sectio. These parameters are used to determine if the purge tower is located on the bed or not.

;P2PP BEDORIGINX=0.0
;P2PP BEDORIGINY=-1.0

BEDSIZEX=nnn and BEDSIZEY=nnn#

  Sets the size of the bed.  The default value is as defined below and should suite MK3 users.  Users of other printers can override the defaults by using the below lines with the correct values in the printer Startup GCode section.   These parameters are used to determine if the purge tower is located on the bed or not.
;P2PP BEDSIZEX=250
;P2PP BEDSIZEY=220

SIDEWIPELOC=X# [EXPERIMENTAL] This is used to define the location on the X-Axis the printer needs to go to to do a side transition instead of doing a tower purge. In Slic3r all still needs to be setup with a purge, tower, but the tower needs to be MOVE COMPLETELY OFF THE BED to enable the SIDE WIPE . p2pp will convert the tower purges into side wipes and fileter out all purges that are not necessary (i.e. empty towe shells). If you want to perform a side wipe on the MK3 use the following line.

;P2PP SIDEWIPELOC=X254

SIDEWIPEMINY=nnnn and SIDEWIPEMAXY=nnnn These values allow control over the Y movement during the wipe. Default values are 45 for the minimal value, 195 for the maximal value. The user can extend/restrict these values if needed. Setting these parameters does not affect the speed at which the extrusion takes place.

;P2PP SIDEWIPMINY=45
;P2PP SIDEWIPEMAXY=195

SIDEWIPECORRECTION= This parameter is introduced to correct for inconsistent extrusion that may occur when doing side transitions. If you notice that during the side transition, the printer over or underextrudes for some reason, you can enter a value here between 0.9 and 1.1 that acts as a local extrusion multiplier DURING the extrusion. Default value is 1.0

;P2PP SIDEWIPECORRECTION=1.0

;P2PP BEFORESIDEWIPEGCODE and ;P2PP AFTERSIDEWIPEGCODE These parameters allow the user to insert blocks of GCode right before or after the side wipe purge block is executed. There can be only one GCode command per line but you can include multiple BEFORE/AFTERSIDEWIPEGCODE commands in the section. The commands are always executed in the given order.

Print Settings

  1. In Slic3r, Click the "Print Settings Tab"
  2. Click the "Multiple Extruders" menu item
  3. Locate "Wipe tower"
  4. Ensure "Wipe tower" IS ENABLED (Contradicts Mosaic Instructions)
  5. Ensure "Prime all printing extruders" is DISABLED
  6. Click the "Output Options" menu item
  7. Locate the "Post-processing scripts" input box at the bottom
  8. Put the full name of the .sh (unix/Mac OSX) or .bat (Windows) in this input box. Include the full path (don't use ~ for OSX). Add no parameters.
    For Windows: c:\yourpath\p2pp.bat
    For Mac/Unix: /yourpath/p2pp.sh
    
  9. Click the floppy-disk icon, and append "Palette P2PP" to the end of the Print Settings profile name.

NOTE:

The minimal first slice length is 100mm. This is required to make the filament reach the outgoing drive. Minimum slice distance for following slices can be set as low as 40, however this will impact the speed at which filament can be created and so print speed may have to be adjusted accordingly

Filament Settings (!!!)

  1. In Slic3r, Click the "Filament Settings Tab"
  2. Each filament should define a linear advance factor of greater than 0 (nn value).
    Normally filament has this value defined based on bowden or direct drive so no action is required.
M900 Knn
  1. Remember to click the floppy-disk icon to save!

Usage

When setup correctly the script will be triggered automatically from Slic3r PE and exported files will contain the mcf header required for palette operation. This functionality will only be enabled when selecting the right print/filament and printer profiles so when selecting any other profiles, single filament file generation will happen as before.

During the conversion the script may come up with a window stating possible warninngs.

The purge settings in Slic3r PE are defined under the purge volumes settings. This button is only visible on the "Plater Tab" and only when a Multi-Material Printer Profile is selected when "Multi Material, Single Extruder" is enabled.
purgelengths

SLIC3R PE uses volume instead of length in the purge settings. For 1.75mm filament, 1mm of filament repesents a volume of approx 2.4mm3. In order to relate to values used in Chroma or Canvas from previous successful prints, you have to divide the Slic3r PE values by a factor 2.4.

The default is "70" unload and "70" load in Slic3r PE. The output of this and how it controls the purge lengths to prevent bleeding and rogue lines is demonstrated below: purgelengths_overview

The numbers in the boxes are added together using the following formula: "Unloaded Old filament" + "Loaded New Filament" = Purge Length in mm3. A good starting point is to enter "100 Unloaded / 180 Loaded" for STRONG coloured filaments (Red, Black, Blue) and use "0 Unloaded / 180 Loaded" for Light coloured filaments. This will get you pretty close but may require additional purge from the strong colours to the light colours.

On your first prints make sure you review the output file to make sure it contains the Omega header. (bunch of commands starting with capital letter O (oh))

If slices are too short:

Increase the purge volumes until the required length is met (or lower the P2PP_MINSPLICE setting). If the start slice is too short, you can add a brim or skirt to use more filament in the first color.

Extrusion Multipliers with P2PP

Extrusion multipliers increase or decrease the effective extrusion by a factor defined in the M221 Gcode command. Prusa MK3 users may know the following piece of text appearing in their startup Gcode:

	M221 S{if layer_height==0.05}100{else}95{endif}

This piece of code sets a specific extruder mulpiplier depending on the chosen layer height.

So…. What does this mean in real life?

When you issue M221 M95 (standard on a Prusa, 0.20mm layer), you will tell the printer to use only 95% of the material specified in the Gcode file. G1 E100 - the command to extrude 100mm of filament - will make the printer consume only 95mm of filament…

In this examply, when you calibrate yur P2 or P2Pro using an extrusion multiplier, P2/P2Pro will assume your printer is underconsuming filament. On a standard Prusa MK3 with a keychain sliced using SLic3R PE it would not be uncommon to see PINGS in range of 95%.

For good measure, it is therefor important to make sure your extrusion multiplier is set to 100% during the first calibration print. You can achieve this by (temporarely) adding the following line at the end of your startup GCODE:

	M221 S100

For all future prints using Chroma or Canvas, make sure to keep the same line in the code! Removing the line will potentially generate a gap that P2/P2P will not be able to correct for....

P2PP however takes the extrusion multiplier into consideration when calculating splice lengths and the ping locations, so even when the printer was calibrated with a value of 100, it will happily print with any other extrusion multiplier (like the 95 on prusa). Important though to also here use 100% extrusion during the Calibration.

One big exception: Extrusion multiplication settings in Octoprint or on the Printer control panel should be left at 100% AT ALL TIMES. P2 and the printer have filament lengths defined during the GCode-processing. After the GCode is generated, all actions that affect the amount of filament used will make the printer wander off from its set path.... P2 will try to correct for the error and it may succeed but it puts yout print at risk....

Acknowledgements

Thanks to Tim Brookman for the co-development of this plugin.

Many thanks also to Klaus Knute, Khalil Nurullah, Casey Eberle (and all others) for the endless testing and valuable feedback...it's them driving the improvements...

Good luck & happy printing !!!

You can’t perform that action at this time.