Skip to content

TypQxQ/KTC

Repository files navigation

A Toolchenager

KTC - Klipper Toolchanger Code v.2

Universal Toolchanger helper for Klipper

Downloads Badge Stars Badge Forks Badge License Badge Codacy Badge

This adds logic to Klipper for layered, inherited ToolChanging functionality.

This is a complete rewrite of KTCC v.1 to be more versatile and have infinite levels of toolchangers. Inspiration comes mainly from how RRF enables toolchanging and from the HappyHare project.

I welcome any and all input and contributions. Don't be afraid to make a pull request :D

Complex code example is still under construction.

Thank you!

#f98b00 #fe3263 #0fefa9 #085afe Major features:

  • Support any type of toolchanger and any type of tool.
  • Infinite levels of nested changers and tools with inheritance.
  • Handles Tool temperature transfers on tool select/deselect with multiple heaters and offsets.
  • Standby temperatures for parked tools.
  • Handles multiple fans per tool and speed transfer between tools.
  • Wait to reach temperature with configurable tolerance for tool.
  • Unlimited parameters for each object, accesible by macros.
  • Tool number maping. Remap a tool to another, no need to reslice.
  • Persitance of state and statistics across restarts.

#f98b00 #fe3263 #0fefa9 #085afe Installation

The code requires Klipper to run on Python v.3 and is not compatible with Python v.2.

1. Automatic install with Moonraker autoupdate support

Connect to your klipper machine using SSH and run this one line command:

cd ~/ && git clone https://github.com/TypQxQ/KTC.git && bash ~/KTC/install.sh

Configure away inside printer.cfg or a file referenced by it.

2. Manual Install

Copy or link the python (*.py) files into the \klipper\klippy\extras directory.

Copy the macros inside the macros folder and reference them in printer.cfg.

#f98b00 #fe3263 #0fefa9 #085afe Minimum Configuration:

  • At least one tool needs to be defined, ex:

[ktc_tool 0]

#f98b00 #fe3263 #0fefa9 #085afe Help and community:

The discution forums here on Github

#f98b00 #fe3263 #0fefa9 #085afe Configuration Examples:

Configuration example can be found here:

And here are some configurations of working machines:

#f98b00 #fe3263 #0fefa9 #085afe References:

Configuation Reference
Explains all configurable options.

Command Reference
Lists all the commands available at runtime from Klipper.

Object state Reference
Lists all available object variables available to macros.

#f98b00 #fe3263 #0fefa9 #085afe Related projects

#f98b00 #fe3263 #0fefa9 #085afe Limitations

  • T commands need to be added by macros. Mainsail looks for [gcode_macros T#] inside the printer config. Adding a gcode_macro component for the tool at runtime will not work with current implementation of Mainsail and no button will show up. Therefore KTC_T should be manuly called by a corresponding T script as in the Macros for T# toolchange example.

  • Saving to configuration files does not work in Klipper when the section is not in printer.cfg. That is the reason of the persistent storage. This enables organized and distributable configuration files.