Skip to content

Commit b164e77

Browse files
authored
Merge pull request #21 from TypQxQ/dev
Dev
2 parents f18fe4f + 08a89cc commit b164e77

File tree

3 files changed

+108
-9
lines changed

3 files changed

+108
-9
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ This helps [Klipper](https://github.com/Klipper3d/klipper) with ToolChanging fun
2929

3030
This is a complete rewrite of [KTCC v.1](https://github.com/TypQxQ/Klipper_ToolChanger) to be more versatile and have indefinite levels of toolchangers. Inspiration comes mainly from how RRF enables toolchanging and from the HappyHare project.
3131

32-
# !!!!!!!!!!!!!!!!!!!!!!!!!!
33-
# This is still under development
34-
Published for preview.
35-
The code works but the documentation is not finished yet.
36-
# !!!!!!!!!!!!!!!!!!!!!!!!!!
37-
3832
I welcome any and all input and contributions. Don't be afraid to make a pull request :D
3933

34+
Complex code example is still under construction.
35+
4036
Thank you!
4137

4238
## ![#f98b00](/doc/f98b00.png) ![#fe3263](/doc/fe3263.png) ![#0fefa9](/doc/0fefa9.png) ![#085afe](/doc/085afe.png) Table of Contents
@@ -177,5 +173,12 @@ States can be set like: `KTC_SET_STATE TOOLCHANGER={myself.name} STATE=READY`
177173
- `ACTIVE` - Tool is active as main engaged tool for ktc.
178174

179175
## ![#f98b00](/doc/f98b00.png) ![#fe3263](/doc/fe3263.png) ![#0fefa9](/doc/0fefa9.png) ![#085afe](/doc/085afe.png) Example configuration
180-
My corrent configuration is for v.2 where work progresses fast.
176+
My current configuration can be refferenced here: https://github.com/TypQxQ/DuetBackup/tree/main/qTC-Klipper
177+
178+
## ![#f98b00](/doc/f98b00.png) ![#fe3263](/doc/fe3263.png) ![#0fefa9](/doc/0fefa9.png) ![#085afe](/doc/085afe.png) Related projects
179+
- [kTAMV - Klipper Tool Alignment (using) Machine Vision](https://github.com/TypQxQ/kTAMV) allows X and Y allignment betwween multiple tools on a 3D printer using a camera that points up towards the nozzle from inside Klipper.
180+
181+
- [KnobProbe](https://github.com/TypQxQ/KnobProbe_Klipper) allows Z allignment between multiple tools.
182+
183+
- [Query Endstop Continuesly in Klipper](https://github.com/TypQxQ/Query-Endstop-Continuesly-in-Klipper) Klipper module that adds a G-code command so Klipper will pause until specified endstop is in selected state, triggered or not triggered. Alternativley it can query a specified amount of times.
181184

config/example_config/complete/complete_example.cfg

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# Under development
22

3-
[ktc]
3+
# Example of a KTC configuration file for a 5 tool printer and 2 toolchangers.
4+
# This assumes that the printer is configured with 2 extruders and 2 part cooling fans:
5+
# - [extruder0] and [fan_generic partfan_t0] for the first extruder and part cooling fan
6+
# - [extruder1] and [fan_generic partfan_t1] for the second extruder and part cooling fan
7+
# - This asumes that the printer also has a ERCF MMU unit with 3 gates configured with HappyHare.
8+
9+
# Object tree inheritance:
10+
# - KTC
11+
# Jubilee
12+
# Tool 0
13+
# ERCF
14+
# Tool 2
15+
# Tool 3
16+
# Tool 4
17+
# Tool 1
18+
19+
20+
[ktc_toolchanger Jubilee]
421

522
[ktc_tool 0]
623
tool_number: 0
@@ -13,3 +30,81 @@ tool_number: 1
1330
heater: extruder1
1431
fans: partfan_t1
1532
params_park:198,150, 0
33+
34+
[ktc_toolchanger ERCF]
35+
parent_tool: 0
36+
tool_deselect_gcode:
37+
# This code will be inherited by ktc_tool 2, 3 and 4.
38+
MMU_EJECT
39+
40+
[ktc_tool 2]
41+
tool_select_gcode:
42+
# This code will not be inherited.
43+
MMU_CHANGE_TOOL TOOL=0 STANDALONE=1
44+
45+
[ktc_tool 3]
46+
tool_select_gcode:
47+
MMU_CHANGE_TOOL TOOL=1 STANDALONE=1
48+
49+
[ktc_tool 4]
50+
tool_select_gcode:
51+
MMU_CHANGE_TOOL TOOL=2 STANDALONE=1
52+
53+
[ktc]
54+
default_toolchanger = Jubilee
55+
56+
# Tool change gcode that will be inherited by all tools not overriding it.
57+
tool_select_gcode:
58+
# myself will be replaced with the tool that is selected
59+
# This code will be inherited by Jubillee and on untill overriden by tool 2, 3 or 4.
60+
KTC_TOOL_SET_TEMPERATURE TOOL={myself.name} CHNG_STATE=2 # Put tool heater in Active mode so heating while moving
61+
62+
SAVE_GCODE_STATE NAME=TOOL_PICKUP # Save GCODE state. Will be restored at the end of pickup code
63+
G90
64+
65+
############## Move in to parking spot ##############
66+
G0 X150 F40000 # Fast move X inside the safezone, so we don't crash into other tools.
67+
G0 Y{myself.zone[1]} F40000 # Fast move Y in front of parking spot.
68+
G0 X{myself.params_park[0]} F3000 # Slow Move to the pickup position for tool.
69+
70+
############## Atach Tool ##############
71+
# Asume attached
72+
73+
############## Tool Z Offset ##############
74+
SET_GCODE_OFFSET Z={myself.offset[2]} MOVE=1 # Set and move the Z offset. Avoid crashing into bed when moving out later.
75+
76+
############## Wait for heater ##############
77+
{% if myself.heater_names|length > 0 %} # If the tool has an extruder:
78+
ACTIVATE_EXTRUDER EXTRUDER={myself.heater_names[0]} # Activate the extruder
79+
KTC_TEMPERATURE_WAIT_WITH_TOLERANCE TOOL={myself.name} # Wait for tool to reach target temperature.
80+
{% endif %} # /
81+
82+
############## Move out ##############
83+
G0 X150 F6000 # Slow Move to the zone position for tool.
84+
85+
############## Finnish up ##############
86+
M400 # Wait for current moves to finish.
87+
RESTORE_GCODE_STATE NAME=TOOL_PICKUP MOVE=0 # Restore GCODE state. Was saved at thebegining of SUB_TOOL_PICKUP_START. Move fast to last location.
88+
# Set the toolhead offsets. Needs to be after any RESTORE_GCODE_STATE!
89+
SET_GCODE_OFFSET X={myself.offset[0]} Y={myself.offset[1]} Z={myself.offset[2]} MOVE=0
90+
91+
tool_deselect_gcode:
92+
# myself will be replaced with the tool that is deselected
93+
# This code will be inherited by Jubillee and on untill overriden by ERCF.
94+
95+
SET_GCODE_OFFSET X=0 Y=0 # Set XY offset to 0 so we park the tool right.
96+
SAVE_GCODE_STATE NAME=TOOL_DROPOFF # Save GCode state.
97+
G90 # Absolute positions
98+
99+
############## Move in to parking spot ##############
100+
G0 X150 F40000 # Move X and
101+
G0 Y{myself.zone[1]} F40000 # Fast move Y in front of parking spot.
102+
G0 X{myself.park[0]} F3000 # Slow Move to the dropoff position for tool.
103+
104+
############## Detach Tool ##############
105+
G0 Y{myself.zone[1]|float - 15} F40000 # Detach tool
106+
107+
G0 X150 F40000 # Fast Move to the general pickup position for tools.
108+
109+
RESTORE_GCODE_STATE NAME=TOOL_DROPOFF MOVE=0 # Restore Gcode state
110+
SET_GCODE_OFFSET Z=0 # Set Z offset to 0 after too is parked.

doc/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ The topmost object contains inheritable options that will be inherited by all ot
9595
```
9696
[ktc]
9797
#propagate_state = True
98-
# Propa
98+
# Propagate state when changed on a tool, down through the tree to the ktc object.
99+
# For example setting a tool state as selected will set it's changer to engaged.
99100
#default_toolchanger = <name of the only ktc_toolchanger object>
100101
# This is required when specifying more than one ktc_toolchanger section.
101102
# Otherwise it will default to the name of the only

0 commit comments

Comments
 (0)