Tired of manually tracking your filament changes? This improved M600 macro for Klipper not only pauses for color swaps but also keeps track of your filament changes and provides a prompt with which color to switch too. Easily swap colors mid-print without losing track of what comes next!
Filament Change Logging: Uses a combination of Python and Bash scripts to log each filament change automatically, so you can seamlessly print multicolor prints without having to keep track of which color comes next.
OrcaSlicer Integration: Works seamlessly with OrcaSlicer
Automatic Tool Color Updates: Automatically updates tool colors, so you can focus on printing rather than memorizing or writing down the color change order. Just use the color palette on Orca Slicer and select the color for your filament. (Must be done to know the exact color you will be switching too!!) Orca Slicer uses Hex data placed in the gcode to keep track of the color, the script will use that hex data to use CSS color library to match between 147 colors!
- Prerequisites
Klipper Firmware: Ensure Klipper is installed. (obviously)
Install Dynamic Macros
cd ~
git clone https://github.com/3DCoded/DynamicMacros
cd DynamicMacros
sh install.sh
sudo service klipper restartAdd to your moonraker.conf:
moonraker.conf
# DynamicMacros Update Manager
[update_manager DynamicMacros]
type: git_repo
path: ~/DynamicMacros
origin: https://github.com/3DCoded/DynamicMacros.git
primary_branch: main
is_system_service: False
install_script: install.shFirst, update via Moonraker's update manager. Then run in your terminal:
cd ~/DynamicMacros
sh install.sh
sudo service klipper restart(Klipper Installation And Update Helper): Install the Shell Command Add-on via KIAUH if it's not already installed.
Install jq
sudo apt-get install jq- Download the Repository
Clone or download this repository to your local machine:
git clone https://github.com/CodeMasterCody3D/Manual-filament-Change-Tracking.git
cd Manual-filament-Change-Tracking- Replace Hardcoded Username
If you don't know your username run this in the terminal.
whoamiThis repository uses cody as a placeholder. Run the provided script to replace all occurrences of cody with your username--(HINT:VERY COMMONLY THE USERNAME IS ( pi ) IF YOUR RUNNING ON A RASPBERRY PI):
chmod +x replace_username.sh
./replace_username.shNote: This script scans all files in the repository folder and only modifies files within that folder.
- Install the Scripts
Copy the following scripts to your home directory (e.g., /home/$USER/):
get_tool_change_status.sh tool_change_tracker.py update_tool_change.py generate_filament_prompt_macro.py
Copy the files with this command:
cp get_tool_change_status.sh tool_change_tracker.py update_tool_change.py generate_filament_prompt_macro.py ~/
chmod +x ~/get_tool_change_status.sh ~/tool_change_tracker.py ~/update_tool_change.py generate_filament_prompt_macro.py- Update Your printer.cfg using add_to_printer.cfg
Copy and paste the provided macros that are inside add_to_printer.cfg and shell command definitions into your printer.cfg, replacing the resume and pause with the ones I provided in add_to_printer.cfg
Insert them above the auto-generated section that gets created when setting z offset(look for the marker #*# <---------------------- SAVE_CONFIG in your printer.cfg). It's at the bottom just make sure all of the macros are above it.
(alternatively, you can just add it to the dynamic macros section in your printer.cfg.)
you should comment out your current resume, pause and any m600 macros you have.
[dynamicmacros]
configs: dynamic.cfg, dynamic_prompt.cfg, add_to_printer.cfg- Set Up OrcaSlicer
Filament Change G-code: In OrcaSlicer, add the M600 command in the Filament Change G-code section.
Start G-code: Insert the PRE_SCAN_TOOL_CHANGES macro at the beginning of your Start G-code.
Why This Is Useful
I built this solution for my Ender 3 Pro to simplify multi-color printing. It eliminates the hassle of manually tracking filament changes and ensures smooth color transitions during prints.
Feel free to contribute, suggest improvements, or report issues via the repository's issue tracker. Enjoy your effortless multi-color printing! (Manually of course)