Universal Toolchanger driver for Klipper
This are python modules, macros and example config for the Klipper 3D printer firmware to be able to work as a toolchanger.
Klipper Tool Changer code v.2 is now released for preview: https://github.com/TypQxQ/KTC
At it's simplest you need to specify extruder, fan, offset for each extruder tool. Then add your macros for pickup, dropoff, toollock and toolunlock.
It doesn't matter if you lock the tool by a servo, stepper or moving the toolhead in a special way. Just as long as it can be written in GCODE. Pickups are also custom Gcode. You can uses the parameters stored for each tool to aproach he ZONE fast, slow in to PARKING place and lock. Or it have a robotic arm place the tool. It's all posible. :D
This is a more complex example of it running on a toolchanger with an aditional ERCF under one tool. T0-8 uses first tool with virtual tools for the ERCF, calling the toolchanges recursively.
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
Thank you!
Major feature
Installation
- 1-Install with Moonraker Autoupdate Support
- 2-Manual Install
Configuration requirements
G-Code commands
Values accesible from Macro for each object
Example configuration
Command Reference
Required and Optional Macros
Configuration Reference
This plugin assumes that you installed Klipper into your home directory (usually /home/pi
).
1) Clone this repo into your home directory where Klipper is installed:
cd ~
git clone https://github.com/TypQxQ/Klipper_ToolChanger.git
2) Edit moonraker.conf
by adding the following entry:
[update_manager client klipper_toolchanger]
type: git_repo
path: ~/Klipper_ToolChanger
origin: https://github.com/TypQxQ/Klipper_ToolChanger.git
install_script: install.sh
is_system_service: False
3) Run the install.sh
script
~/Klipper_ToolChanger/install.sh
Klipper_ToolChanger will show up in the update the next time you restart moonraker, or you can restart mooraker right away with: sudo systemctl restart moonraker
.
If you encouter errors after an automatic Klipper update you can safetly run the install.sh
scipt again to repair the links to the extension.
Copy the python (*.py
) files into the \klipper\klipper\extras
directory. Assuming Klipper is installed in your home directory:
cp ./*.py ~/klipper/klippy/extras/
Then restart Klipper to pick up the extensions.
[input_shaper]
needs to be used for input shaper to wordk.Reffer to the Command Reference.
global_offset
- Global offset.tool_current
- -2: Unknown tool locked, -1: No tool locked, 0: and up are toolnames.saved_fan_speed
- Speed saved at each fanspeedchange to be recovered at Toolchange.purge_on_toolchange
- For use in macros to enable/disable purge/wipe code globaly.restore_axis_on_toolchange
- The axis to restore position:saved_position
- The position saved when the latest T# command had a RESTORE_POSITION parameter to other than 0myself
in macros. When running for example T3
to pickup the physical tool, in pickup_gcode:
of one can write {myself.name}
which would return 3
.
name
- id. 0, 1, 2, etc.is_virtual
- If this tool has another layer of toolchange possible.physical_parent_id
- Parent physical tool that holds tool coordinates. Can be same as this.extruder
- extruder name as configured.fan
- fan name.lazy_home_when_parking
- When set to 1, will home unhomed XY axes if needed and will not move any axis if already homed and parked. 2 Will also home Z if not homed.meltzonelength
- Meltzonelength to unload/load filament at toolpak. See e3d documentation.zone
- Fast aproach coordinates when parkingpark
- Parking spot, slow aproach.offset
- Tool offset.heater_state
- 0 = off, 1 = standby temperature, 2 = active temperature. Placeholder.heater_active_temp
- Temperature to set when in active mode.heater_standby_temp
- Temperature to set when in standby mode.idle_to_standby_time
- Time in seconds from being parked to setting temperature to standby the temperature above. Use 0.1 to change imediatley to standby temperature.idle_to_powerdown_time
- Time in seconds from being parked to setting temperature to 0. Use something like 86400 to wait 24h if you want to disable. Requred on Physical tool.is_virtual
- As abovephysical_parent_id
- As abovelazy_home_when_parking
- As aboveMy corrent configuration is for v.2 where work progresses fast.
Added individual axis to position saving and restoring commands. Commited by viesturz.
Added Tool Remap. Point one or more tools to another one. Including fan and temperature. This is persistent at reboot.
KTCC_DISPLAY_TOOL_MAP
- Display the current mapping of tools to other KTCC tools.KTCC_REMAP_TOOL
- The command to remap a tool or reset the remaping.KTCC_CHECK_TOOL_REMAP
- Display all tool remaps.Added per print statistics and a wrapper around G28 to disable saving statistics while homing. The latter led to MCU Timer to close error when loading a tool at homing.
KTCC_INIT_PRINT_STATS
- Run at start of a print to reset the KTCC print statistics.KTCC_DUMP_PRINT_STATS
- Run at end of a print to list statistics since last print reset.This is not a simple upgrade, it has some configuration updates. A namechange to KTCC (Klipper Tool Changer Code) is also in the works).
News:
Changes to Configuration:
[ktcclog]
before all other Toollock, tool, and the others..`virtual_toolload_gcode:
parameter to tools.`virtual_toolunload_gcode:
parameter to tools.Changes to commands:
New commands: