-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebclient.cfg
160 lines (150 loc) · 6.27 KB
/
webclient.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
#####################################################################
# Macros
#####################################################################
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: BASE_PAUSE
variable_toolhead_z: 0
gcode:
##### Get user defines #####
{% set add_temp = printer["gcode_macro _USER_VARIABLE"].extruder_min_add|int %}
{% set retract = printer["gcode_macro _USER_VARIABLE"].retract_pause|float * -1 %}
{% set purge_pos = printer["gcode_macro _USER_VARIABLE"].purge %}
##### store min and current extrution temp in variable #####
{% set extruder_min = printer.configfile.config.extruder.min_extrude_temp|int + add_temp %}
{% set extruder_target = printer.extruder.target %}
##### either use brush bin position or user defined #####
{% set x_park = params.X|default(purge_pos[0]) %}
{% set y_park = params.Y|default(purge_pos[1]) %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=toolhead_z VALUE={act_z}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
##### added because of motion sensor #####
##### added because of motion sensor #####
{% if ena_neo == 'true' %} _LCD_KNOB COLOR=BLUE BLINK=1 {% endif %}
M117 Pause
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E{retract} F1800
{% endif%}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F18000 ; park nozzle at brush bin or user defined
UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=10
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: BASE_RESUME
gcode:
##### Get user defines #####
{% set add_temp = printer["gcode_macro _USER_VARIABLE"].extruder_min_add|int %}
{% set extrude = printer["gcode_macro _USER_VARIABLE"].retract_pause %}
{% set act_z = printer["gcode_macro PAUSE"].toolhead_z %}
##### store min and current extrution temp in variable #####
{% set extruder_min = printer.configfile.config.extruder.min_extrude_temp|int + add_temp %}
{% set extruder_target = printer.extruder.target %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if ena_neo == 'true' %} _LCD_KNOB COLOR=RED {% endif %}
M117 Printing
G90
G0 Z{act_z}
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E{extrude} F2100
{% endif %}
RESUME_BASE {get_params}
UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=10
[pause_resume]
recover_velocity = 200
[display_status]
[virtual_sdcard]
path: /home/pi/printer_data/gcodes
[gcode_arcs]
resolution: 0.1
[respond]
default_type: command
#####################################################################
# Macros
#####################################################################
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_execute: 'false'
gcode:
##### Get params and default #####
{% set park = params.PARK|default(1)|int %}
{% set error = params.ERROR|default(0)|int %}
##### Get user defines #####
{% set purge_pos = printer["gcode_macro _USER_VARIABLE"].purge %}
{% set add_temp = printer["gcode_macro _USER_VARIABLE"].extruder_min_add|int %}
{% set vent_on = printer["gcode_macro _USER_VARIABLE"].vent_on|int %}
{% set retreact = printer["gcode_macro _USER_VARIABLE"].retract_cancel|float * -1 %}
{% set fan_off = printer['gcode_macro _USER_VARIABLE'].fan_run_after_print|int * 60 %}
{% set vent_off = printer['gcode_macro _USER_VARIABLE'].fan_run_after_print|int * 60 + 5 %}
##### Get hardware enables #####
{% set ena_neo = printer['gcode_macro _USER_VARIABLE'].neo_display|lower %}
{% set ena_chamber = printer['gcode_macro _USER_VARIABLE'].chamber|lower %}
{% set ena_caselight = printer['gcode_macro _USER_VARIABLE'].caselight|lower %}
{% set ena_filter = printer['gcode_macro _USER_VARIABLE'].filter|lower %}
{% set ena_unload_sd = printer['gcode_macro _USER_VARIABLE'].print_end_unload_sd|lower %}
##### store min and current extrution temp in variable #####
{% set extruder_min = printer.configfile.config.extruder.min_extrude_temp|int + add_temp %}
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 10.0) %}
{% set z_safe = 10.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SET_GCODE_VARIABLE MACRO=CANCEL_PRINT VARIABLE=execute VALUE='"true"'
M117 Cancel
CANCEL_PRINT_BASE
{% if printer.extruder.can_extrude|lower == 'false' %}
{action_respond_info("Extruder Temp to low heat to %2dC" % extruder_min)}
{% else %}
M83
G1 E{retreact} F1800
{% endif %}
M104 S150
#M140 S105
#TURN_OFF_HEATERS ; turn off heaters
{% if park == 1 %}
G91
G1 Z{z_safe} F900
G90 ; move nozzle to z high first
G0 X{purge_pos[0]} Y{purge_pos[1]} F18000 ; home to get toolhead in the middle
{% endif %}
M107
#M84 ; turn off fan
##### set speed and extruder factor to default #####
M220 S100
M221 S100
{% if ena_chamber == 'fan' %} M141 S{vent_on} {% endif %} ; vent chamber (setting fan to below ambient)
_ADD_PRINT_TIME
{% if error == 1 %}
{% if ena_neo == 'true' %} _LCD_KNOB COLOR=RED BLINK=0.2 {% endif %}
_SD_PRINT_STATS R='abort'
{% else %}
{% if ena_neo == 'true' %} _LCD_KNOB COLOR=BLUE {% endif %}
_SD_PRINT_STATS R='canceled'
{% endif %}
_SD_PRINTER_STATS
{% if ena_caselight == 'true' %} _CASELIGHT_OFF {% endif %}
{% if ena_chamber == 'fan' %} UPDATE_DELAYED_GCODE ID=_DELAY_VENT_OFF DURATION={vent_off} {% endif %}
{% if ena_filter == 'true' %} UPDATE_DELAYED_GCODE ID=_DELAY_FILTER_OFF DURATION={fan_off} {% endif %}
{% if ena_unload_sd == 'true' %} UPDATE_DELAYED_GCODE ID=_DELAY_SDCARD_RESET_FILE DURATION=1 {% endif %}
UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=1