forked from TypQxQ/Klipper_ToolChanger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNEW_TOOLS.cfg
250 lines (204 loc) · 14.2 KB
/
NEW_TOOLS.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# Config order: ToolGroups must come before tools that use them. Tool that are used as physical_parent must be configured before other virtual tools that use that as parent.
# Enables saving of variables between powerdown of machine. Must be configured before [toollock].
[save_variables]
filename: ~/variables.cfg
[toollock]
purge_on_toolchange = True # Here we can disable all purging. When disabled it overrides all other purge options. Defaults to true. This can be turned off by a macro for automatic probing hot tools without probing them. For example when doing TAMV or ZTATP.
#init_printer_to_last_tool = True #Initialise as it was turned off, unlock tool if none was loaded or lock if one was loaded. Defaults to True
#wipetype: 0 # WipeType number as defined by [toolwipetype n]. Overwrites setting in [toolgroup n] defaults to -1 which is No Wipe if not defined anywhere.
tool_lock_gcode:
SAVE_GCODE_STATE NAME=tool_unlock_state # Save gcode state
MANUAL_STEPPER STEPPER=tool_lock SET_POSITION=0 # Set assumed possition as rotated to min
MANUAL_STEPPER STEPPER=tool_lock Move=1 SPEED=30 STOP_ON_ENDSTOP=-1 SYNC=1 # Move until no longer endstop is triggered, max 1degree. If Endstop is not untriggered then raise an error. Wait for the movement before continuing.
SET_TMC_CURRENT STEPPER=tool_lock CURRENT=1.0 # Raise current of stepper temporarily
MANUAL_STEPPER STEPPER=tool_lock Move=150 SPEED=50 STOP_ON_ENDSTOP=1 SYNC=1 # Move to max and stop on endstop. If Endstop is not triggered then raise an error. Wait for the movement before continuing.
M400
MANUAL_STEPPER STEPPER=tool_lock SET_POSITION=0 # Set manual extruder position as 0
SET_TMC_CURRENT STEPPER=tool_lock CURRENT=0.7 # Decrease current to standard current.
RESTORE_GCODE_STATE NAME=tool_unlock_state MOVE=0 # Restore gcode state
M117 "Unknown tool Loaded" # Tool Loaded Message that stays on display.
tool_unlock_gcode:
SAVE_GCODE_STATE NAME=tool_lock_state # Save gcode state
MANUAL_STEPPER STEPPER=tool_lock SET_POSITION=180 # Set assumed possition as rotated to max
MANUAL_STEPPER STEPPER=tool_lock Move=179 SPEED=30 STOP_ON_ENDSTOP=-1 SYNC=1 # Move until no longer endstop is triggered, max 1degree. If Endstop is not untriggered then raise an error. Wait for the movement before continuing.
MANUAL_STEPPER STEPPER=tool_lock Move=0 SPEED=100 STOP_ON_ENDSTOP=1 SYNC=1 # Move to min and stop on endstop. If Endstop is not triggered then raise an error. Wait for the movement before continuing.
M400
MANUAL_STEPPER STEPPER=tool_lock SET_POSITION=0 # Set manual extruder position as 0
MANUAL_STEPPER STEPPER=tool_lock ENABLE=0 # Turn off the stepper while unlocked so it can rest without triggering the endswitch
RESTORE_GCODE_STATE NAME=tool_lock_state MOVE=0 # Restore gcode state
M117 Tool Unloaded # Tool UnLoaded Message that stays on display.
[toolgroup 0]
is_virtual: True # If True then must have a physical_parent declared and shares extruder, hotend and fan with the physical_parent
physical_parent: 0 # Tool used as a Physical parent for all toos of this group. Only used if the tool i virtual.
#idle_to_standby_time: 30
#idle_to_powerdown_time: 600
# Used to group several tools with similar settings.
[toolgroup 1]
is_virtual: False # If True then must have a physical_parent declared and shares extruder, hotend and fan with the physical_parent
pickup_gcode:
SUB_TOOL_PICKUP_START T={myself.name}
SUB_TOOL_PICKUP_END T={myself.name}
dropoff_gcode:
SUB_TOOL_DROPOFF_START T={myself.name}
SUB_TOOL_DROPOFF_END T={myself.name}
##### Selectable tool. Must be configured after [toolgroup n].
[tool 0]
tool_group: 0 # Must be used and configured before this tool
##### Following can be inherited from Physical parent if not specified for this tool. Needed only by physical tools.
extruder: extruder
fan: partfan_t0
zone: 550,5
park: 598,5
offset: 10.79,4.86,3.41
#####
##### Following can be inherited from ToolGroup if not specified for this tool or inherited from a Physical parent.
#physical_parent: # Defaults to None.
#is_virtual: False # Defaults to False
meltzonelength: 18 # Defaults to 0
#####
##### Options below have no effect on Virtual tools.
#idle_to_standby_time: 30 # Time in seconds from being parked to setting temperature to standby the temperature above. Use 0.1 to change imediatley to standby temperature. Defaults to 30
#idle_to_powerdown_time: 600 # Time in seconds from being parked to setting temperature to 0. Use something like 86400 to wait 24h if you want to disable. Defaults to 600
lazy_home_when_parking: 1 # (default: 0 - disabled) - 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.
#pickup_gcode= The code that is run when picking up the physical tool. Variable {myself} refers to the tool calling this code.
pickup_gcode:
SUB_TOOL_PICKUP_START T={myself.name}
SUB_TOOL_PICKUP_END T={myself.name}
dropoff_gcode:
RESPOND MSG="dropoff_gcode. in t0"
SUB_TOOL_DROPOFF_START T={myself.name}
SUB_TOOL_DROPOFF_END T={myself.name}
#[tool 1]
#tool_group: 0
#[tool 2]
#tool_group: 0
[tool 9]
tool_group: 1
extruder: extruder1
fan: partfan_t9
zone: 550,100
park: 598,100
offset: 3.55,0.87,0.06
meltzonelength: 18
[tool 10]
tool_group: 1
extruder: extruder2
fan: partfan_t10
zone: 550,200
park: 598,200
offset: 10.79,4.86,3.41
meltzonelength: 18
[tool 49]
tool_group: 1
zone: 560,515
park: 598,515
offset: 0,0,0
[gcode_macro SUB_TOOL_PICKUP_START]
description: Internal subroutine. Do not use!
# Tnnn: Tool to pickup
gcode:
{%set myself = printer['tool '~params.T]%}
M568 P{myself.name} A2 # Put tool heater in Active mode
SAVE_GCODE_STATE NAME=TOOL_PICKUP # Save GCODE state. Will be restored at the end of SUB_TOOL_PICKUP_END
SET_GCODE_VARIABLE MACRO=HOMING_STATUS VARIABLE=maxx VALUE=0 # Don't use the X-max endstop as EmergencyStop.
G90
############## Move in to zone ##############
{% if printer.toolhead.position.x < 500 %} # If Printer inside safezone:
G0 X500 Y{myself.zone[1]} F40000 # Fast move XY inside the safezone.
{% else %} # Else, outside of safezone:
G0 X500 F40000 # Fast move X inside the safezone, so we don't crash into other tools.
G0 Y{myself.zone[1]} F40000 # Fast move Y in front of parking spot.
{% endif %} # /
############## Move in to parking spot ##############
G0 X{myself.park[0]|int - 15} F40000 # Fast Move near the pickup position for tool.
G0 X{myself.park[0]} F3000 # Slow Move to the pickup position for tool.
############## Lock Tool ##############
M400 # Wait for all moves to finish.
TOOL_LOCK # Lock the tool.
SET_GCODE_OFFSET Z={myself.offset[2]} MOVE=1 # Set and move the Z offset. Avoid crashing into bed when moving out later.
############## Wait for heater ##############
{% if myself.extruder|default("none")|lower !="none" %} # If the tool has an extruder:
M116 P{myself.name} # Wait for tool to reach target temperature.
{% endif %} # /
############## Move out to zone ##############
G0 X{myself.zone[0]} F6000 # Slow Move to the zone position for tool.
[gcode_macro SUB_TOOL_PICKUP_END]
description: Internal subroutine. Do not use!
# Tnnn: Tool to pickup
gcode:
{%set myself = printer['tool '~params.T]%}
############## Move out to Safe position ##############
G0 X500 F40000 # Fast Move to the safe position for tools.
############## Check Tool Lock ##############
TOOL_LOCK_CHECK # MAcro to check so the tool is mounted by slightly advancing the lock again until hit endstop, only if endstop not already hit. Do not wait for it to finish.
# SUB_TOOL_PICKUP_DEPRESURIZE_HOTEND
############## Finnish up ##############
M400 # Wait for current moves to finish.
SET_GCODE_VARIABLE MACRO=HOMING_STATUS VARIABLE=maxx VALUE=1 # Use the X max as EmergencyStop.
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.
# Set the toolhead offsets. Z is set and moved before any moves in SUB_TOOL_PICKUP_START. Needs to be after any RESTORE_GCODE_STATE!
SET_GCODE_OFFSET X={myself.offset[0]} Y={myself.offset[1]} Z={myself.offset[2]} MOVE=0 # Set X and Y offsets,
SAVE_GCODE_STATE NAME=TOOL_PICKUP2 # Save state for priming nozzle
RESPOND MSG="First if:{myself.extruder|default("none")|lower}"
############## Prime the filament, asume it was retracted as per e3d Revo documentation ##############
{% if myself.extruder|default("none")|lower !="none" %} # If the tool has an extruder:
RESPOND MSG="First if1:{myself.extruder|default("none")|lower}"
RESPOND MSG="Second if:{printer[myself.extruder].can_extrude|default("false")|lower}"
RESPOND MSG="Second if1:{printer.toollock.purge_on_toolchange}"
# If can extrude and global purge is active:
{% if printer[myself.extruder].can_extrude|default("false")|lower == 'true' and printer.toollock.purge_on_toolchange %}
RESPOND MSG="Second if2:{printer[myself.extruder].can_extrude|default("false")|lower}"
RESPOND MSG="Second if3:{printer.toollock.purge_on_toolchange}"
M83 # Relative extrusion
G1 E{myself.meltzonelength|int - 2} F1300 # DeRetract filament from meltzone
G1 E2 F400 # DeRetract filament from meltzone
{% endif %}
{% endif %}
RESTORE_GCODE_STATE NAME=TOOL_PICKUP2 # Restore state after priming nozzle
G1 F30000
[gcode_macro SUB_TOOL_DROPOFF_START]
description: Internal subroutine. Do not use!
# Tnnn: Tool to pickup
gcode:
{%set myself = printer['tool '~params.T]%}
{% if myself.name|int != printer.toollock.tool_current|int %}
{ action_raise_error("SUB_TOOL_DROPOFF_START: Wrong tool. Asked to dropoff T" ~ myself.name ~ " while current is T" ~ printer.toollock.tool_current ~ ".") }
{% endif %}
RESPOND MSG="Will drop off T{myself.name} at X{myself.park[0]} Y{myself.park[1]}"
############## Retract the filament as per e3d Revo documentation ##############
{% if myself.extruder|default("none")|lower !="none" %} # If the tool has an extruder:
M568 P{myself.name} A1 # Put tool heater in standby
# If can extrude and global purge is active:
{% if printer[myself.extruder].can_extrude|default("false")|lower == 'true' and printer.toollock.purge_on_toolchange %}
M83 # Relative extrusion
G1 E-4 F2700 # retract filament from meltzone
G1 E2 F800 # Extrude slightly to form a tip
G1 E-{myself.meltzonelength|int - 2} F800 # Retract filament from meltzone
{% endif %}
{% endif %}
SET_GCODE_OFFSET X=0 Y=0 # Set XY offset to 0 so we park the tool right.
SAVE_GCODE_STATE NAME=TOOL_DROPOFF_002 # Save GCode state.
G90 # Absolute positions
SET_GCODE_VARIABLE MACRO=HOMING_STATUS VARIABLE=maxx VALUE=0 # Don't use the X max as EmergencyStop.
# Fast Move to the general pickup position for tools.
{% if printer.toolhead.position.x|int < 500 %}
G0 X500 Y{myself.zone[1]} F40000 # Move near pickup and lift z so we don't crash the bed later.
{% else %}
G0 X500 F40000 # Move X and lift z so we don't crash the bed or into other tools.
G0 Y{myself.zone[1]} F40000 # Move Y after X and Z
{% endif %}
M400 # Wait for current moves to finish
G0 X{myself.zone[0]} F40000 # Fast Move near the dropoff position for tool.
G0 X{myself.park[0]} F3000 # Slow Move to the dropoff position for tool.
[gcode_macro SUB_TOOL_DROPOFF_END]
description: Internal subroutine. Do not use!
# Tnnn: Tool to pickup
gcode:
{%set myself = printer['tool '~params.T]%}
M400 # Wait for current moves to finish
TOOL_UNLOCK # Unlock the tool
G0 X{myself.park[0]|int - 15} F6000 # Slow Move to the pickup position for tool.
G0 X500 F40000 # Fast Move to the general pickup position for tools.
M400
SET_GCODE_VARIABLE MACRO=HOMING_STATUS VARIABLE=maxx VALUE=1 # Use the X max as EmergencyStop.
RESTORE_GCODE_STATE NAME=TOOL_DROPOFF_002 MOVE=0 # Restore Gcode state