-
Notifications
You must be signed in to change notification settings - Fork 0
/
kiauh_macros.cfg
79 lines (73 loc) · 3.01 KB
/
kiauh_macros.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
#########################################################################################
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AUTOCREATED WITH KIAUH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
#########################################################################################
# Those are the recommended macros and config entries if you use Mainsail or Fluidd! #
# Feel free to edit or delete those macros if you already have them defined elsewhere! #
#########################################################################################
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TIMELAPSE_END
{% set z_lift = params.Z_LIFT|default(10)|float %}
{% set extrude_speed = params.E_SPEED|default(40)|float %}
##### read E from pause macro #####
{% set e = printer["gcode_macro PAUSE"].extrude|float %}
{% set x_park = printer.toolhead.axis_minimum.x|float + 5 %}
{% set y_park = printer.toolhead.axis_maximum.y|float %}
{% set travel_speed = printer.toolhead.max_velocity|int %}
{% set z_speed = printer.configfile.config['printer'].max_z_velocity|int %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = act_z + 2.0 %}
{% else %}
{% set z_safe = max_z %}
{% endif %}
##### end of definitions #####
G1 E-{e} F{extrude_speed * 60}
TURN_OFF_HEATERS
M107 ; turn off fan
G1 z{z_safe} F{z_speed * 60}
G1 X{x_park} Y{y_park} F{travel_speed * 60}
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
variable_extrude: 2.0
gcode:
##### read E from pause macro #####
{% set e = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_minimum.x|float + 5 %}
{% set y_park = printer.toolhead.axis_minimum.y|float %}
{% set travel_speed = printer.toolhead.max_velocity|int %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 30.0) %}
{% set z_safe = act_z + 30.0 %}
{% else %}
{% set z_safe = max_z %}
{% endif %}
##### end of definitions #####
TIMELAPSE_PAUSE
BASE_PAUSE
G1 E-{e} F2400
G1 X{x_park} Y{y_park} Z{z_safe} F{travel_speed * 60}
UNLOAD_FILAMENT
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
##### read E from pause macro #####
{% set e = printer["gcode_macro PAUSE"].extrude|float %}
##### end of definitions #####
BASE_RESUME {rawparams}
G1 E{e} F2400
TIMELAPSE_RESUME
#########################################################################################
#########################################################################################