-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnozzle_wipe.cfg
144 lines (128 loc) · 6.85 KB
/
nozzle_wipe.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
# Configuration:
#
# Mount the Wipe & Tap es descript
# 1) Find the Stamp coordinates:
# - Jog the nozzle direct over the Stamp (Chicago bolt)
# - Carefully jog down until you firmly press against the Stamp
# - Update your [stamp_x, stamp_y, stamp_z] variables with the x,y,z coordinates you see in your UI
# 2) Find the Wipe coordinates:
# - Jog the nozzle direct over the Wipe
# - Carefully jog down until you firmly touch the Wipe
# - Update your [ wipe_x, wipe_y, wipe_z] variables with the x,y,z coordinates you see in your UI
# z will be reduced by wipe_dz (default 0.5mm) automatically.
#Usage: POOP_WIPE_AND_PRESS [S=<temp>] [P=<temp>]
# POOP_WIPE_AND_PRESS S=190 P=240 will check the current target, heat to 240C to purge, then cool to 190 to wipe
# POOP_WIPE_AND_PRESS will check the current target and use min_extrude_temp + 5.0 as target
[gcode_macro POOP_WIPE_AND_PRESS]
description: Scrub the nozzle and stamp it for tap
variable_poop_x : 310 ; X position for purge. See Configuration
variable_poop_y : 357 ; Y position for purge. See Configuration
variable_poop_z : 5 ; Z position for purge. See Configuration
variable_poop : True ; do a purge extrude prior to wiping
variable_poop_extrude : 50 ; amount of filmanet to extrude for purge
variable_wipe_x : 256 ; X position of wipe. See Configuration
variable_wipe_y : 357 ; Y position of wipe. See Configuration
variable_wipe_z : 1.3 ; Z position of wipe. See Configuration
variable_wipe_dx : 5 ; dX is way in mm that the head will move left and right
variable_wipe_dz : 1 ; dZ is the value the nozzle will go down to touch the wiper
variable_wipe_cnt : 5 ; number of wipe moves. Should be an odd number to end next to the stamp
variable_wipe_sp : 50 ; move speed for wiping in mm/s
variable_extrude_before_wipe_move: False ; define if extrude should happen before or while the wipe move [True|False]
variable_sp_extrude_only : 5 ; extrusion speed for extrusion only moves
variable_wipe_extrude : 10 ; amout of filament extruded for the wipe
variable_stamp_x : 239 ; X position of stamp. See Configuration
variable_stamp_y : 357 ; Y position of stamp. See Configuration
variable_stamp_z : 0.3 ; Z position of stamp. See Configuration
variable_stamp_tap : True ; If True, use tap to contact stamp instead of stamp_z
variable_stamp_temp : 130 ; temperature to cool down while pressing on the stamp
variable_move_z : 5.0 ; height to use while moving
variable_move_sp_z : 15 ; move speed for z only in mm/s
variable_move_sp : 100 ; move speed in mm/s
gcode:
# get expect wipe temp; calc min and max for TEMPERATURE_WAIT
{% set wipe_temp = params.S|default(printer.configfile.settings.extruder.min_extrude_temp + 5.0)|float %}
{% set poop_temp = params.P|default(printer.configfile.settings.extruder.min_extrude_temp + 5.0)|float %}
{% set stamp_temp_min, stamp_temp_max = stamp_temp - 0.5, stamp_temp + 0.5 %}
# home if needed
{% if "xyz" not in printer.toolhead.homed_axes %} G28 {% endif %}
G90 ; use absolute position
M83 ; use relative extrusion
G92 E0 ; reset the extruder
{% if poop_temp < printer.configfile.settings.extruder.min_extrude_temp %}
_AR T="{"Poop temp %.1fC too low, setting to %.1fC" % (poop_temp, printer.configfile.settings.extruder.min_extrude_temp)}"
{% set poop_temp = printer.configfile.settings.extruder.min_extrude_temp %}
{% endif %}
{% if wipe_temp < printer.configfile.settings.extruder.min_extrude_temp %}
_AR T="{"Wipe temp %.1fC too low, setting to %.1fC" % (wipe_temp, printer.configfile.settings.extruder.min_extrude_temp + 1.0)}"
{% set wipe_temp = printer.configfile.settings.extruder.min_extrude_temp + 1.0 %}
{% endif %}
{% set wipe_temp_min , wipe_temp_max = wipe_temp - 0.5 , wipe_temp + 0.5 %}
{% set poop_temp_min , poop_temp_max = poop_temp - 0.5 , poop_temp + 0.5 %}
# move up to a safe height to move
{% if printer.gcode_move.gcode_position.z < move_z %} G0 Z{move_z} F{move_sp_z * 60} {% endif %}
# move to start position
{% if poop %}
# set poop temp
M104 S{poop_temp} ; set new temperature
# move to poop position
G0 X{poop_x} Y{poop_y} F{move_sp * 60}
G0 Z{poop_z} F{move_sp_z * 60}
# wait for temp
_AR T="{"Wait to reach temperature window (%.1fC - %.1fC)" % (poop_temp_min, poop_temp_max)}"
TEMPERATURE_WAIT SENSOR={printer.toolhead.extruder} MINIMUM={poop_temp_min}
# poop
G0 E{poop_extrude} F{sp_extrude_only * 60}
G92 E0 ; reset the extruder
{% endif %}
### Wipe
# set wipe temp
M104 S{wipe_temp} ; set new temperature
# turn on part fan
M106 S255
# move to safe height
{% if printer.gcode_move.gcode_position.z < move_z %} G0 Z{move_z} F{move_sp_z * 60} {% endif %}
# move to wipe position
G0 X{wipe_x + wipe_dx} Y{wipe_y} F{move_sp * 60}
G0 Z{wipe_z - wipe_dz} F{move_sp_z * 60}
# wait to reach temperature window
_AR T="{"Wait to reach temperature window (%.1fC - %.1fC)" % (wipe_temp_min, wipe_temp_max)}"
TEMPERATURE_WAIT SENSOR={printer.toolhead.extruder} MAXIMUM={wipe_temp_max}
# do wipe moves
{% for moves in range(0, wipe_cnt) %}
{% set move_x = loop.cycle(wipe_x - wipe_dx, wipe_x + wipe_dx) %}
{% if not extrude_before_wipe_move %}
G0 X{move_x} E{wipe_extrude} F{wipe_sp * 60}
{% else %}
G0 E{wipe_extrude} F{sp_extrude_only * 60}
G4 P500 ; let it cool down a little
G0 X{move_x} F{wipe_sp * 60}
{% endif %}
{% endfor %}
G92 E0 ; reset the extruder
# move to stamp
G0 Z{move_z} F{move_sp_z * 60}
G0 X{stamp_x} Y{stamp_y} F{move_sp * 60}
# cool down and press against the stamp
M400 ; wait until all moves are finished
_AR T="{"Press toolhead at stamp and cool down to %.1fC" % (stamp_temp)}"
M104 S{stamp_temp}
{% if stamp_tap %}
PROBE_TEMP MAX_TEMP={printer.extruder.temperature} SAMPLES=1
{% else %}
G0 Z{stamp_z} F{move_sp_z * 60}
{% endif %}
TEMPERATURE_WAIT SENSOR={printer.toolhead.extruder} MAXIMUM={stamp_temp_max}
G4 P1000 ; wait for one sec
# turn off part fan
M106 S255
# move up to safe height
G0 Z{move_z} F{move_sp_z * 60}
# restore system
{% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} ; set it back to relativ
{% if printer.gcode_move.absolute_extrude %} M82 {% endif %} ; set it back to absolute
[gcode_macro _AR]
description: Helper: Action response
gcode: {action_respond_info(params.T)}
[gcode_macro CLEAN_NOZZLE]
gcode:
POOP_WIPE_AND_PRESS P=240 S=180