-
Notifications
You must be signed in to change notification settings - Fork 4
/
timelapse.cfg
101 lines (81 loc) · 2.7 KB
/
timelapse.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
[respond]
[gcode_macro TIMELAPSE_START]
gcode:
RESPOND PREFIX=timelapse MSG=start
[gcode_macro TIMELAPSE_END]
gcode:
RESPOND PREFIX=timelapse MSG=stop
RESPOND PREFIX=timelapse MSG=create
[gcode_macro TIMELAPSE_PAUSE]
gcode:
RESPOND PREFIX=timelapse MSG=pause
[gcode_macro TIMELAPSE_RESUME]
gcode:
RESPOND PREFIX=timelapse MSG=resume
[gcode_macro TIMELAPSE_PHOTO]
gcode:
RESPOND PREFIX=timelapse MSG=photo
[gcode_macro TIMELAPSE_CAPTURE]
variable_delay_before: 500
variable_delay_after: 1500
variable_pause: 0
variable_park: 0
gcode:
{% if park == 0 %}
TIMELAPSE_PHOTO
{% else %}
{% set max_y = printer.toolhead.axis_maximum.y|float %}
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_x = printer.gcode_move.gcode_position.x|float %}
{% set act_y = printer.gcode_move.gcode_position.y|float %}
{% set act_z = printer.gcode_move.gcode_position.z|float %}
{% set park_x = params.PARK_X|default(0)|float %}
{% set park_y = params.PARK_Y|default(max_y - 10)|float %}
{% set retract = params.RETRACT|default(1)|float %}
{% set retract_speed = params.RETRACT_SPEED|default(40)|float %}
{% set retract_fspeed = retract_speed * 60 %}
{% set travel_speed = printer.toolhead.max_velocity|int %}
{% set move_speed = params.MOVE_SPEED|default(travel_speed)|float %}
{% set move_fspeed = move_speed * 60 %}
{% set delay_after = printer["gcode_macro TIMELAPSE_CAPTURE"].delay_after|float %}
{% set delay_before = printer["gcode_macro TIMELAPSE_CAPTURE"].delay_before|float %}
G1 E-{retract} F{retract_fspeed}
{% if (act_z + 20) < max_z %}
{% set new_z = act_z + 20 %}
{% else %}
{% set new_z = max_z %}
{% endif %}
{% if pause == 1 %}
PAUSE_BASE
{% endif %}
G1 X{park_x} Y{park_y} Z{new_z} F{move_fspeed}
M400
{% if pause == 1 %}
G4 P{delay_before}
RESPOND PREFIX=timelapse MSG=photo_and_gcode
{% else %}
G4 P{delay_before}
RESPOND PREFIX=timelapse MSG=photo
G4 P{delay_after}
G1 X{act_x} Y{act_y} Z{act_z} F{move_fspeed}
G1 E{retract} F{retract_fspeed}
{% endif %}
{% endif %}
[gcode_macro TIMELAPSE_RESUME_PRINT]
gcode:
{% set travel_speed = printer.toolhead.max_velocity|int %}
{% set delay_after = printer["gcode_macro TIMELAPSE_CAPTURE"].delay_after|float %}
G4 P{delay_after}
BASE_RESUME VELOCITY={travel_speed}
[gcode_macro TIMELAPSE_SET_CAPTURE_PARAMS]
gcode:
{% for p in params %}
SET_GCODE_VARIABLE MACRO=TIMELAPSE_CAPTURE VARIABLE={p|lower} VALUE={params[p]}
RESPOND MSG="Set {p|lower} to {params[p]}"
{% endfor %}
[gcode_macro TIMELAPSE_SET_PARAMS]
gcode:
RESPOND PREFIX=set_timelapse_params MSG="{rawparams}"
[gcode_macro TIMELAPSE_SET_NOTIFY_PARAMS]
gcode:
RESPOND PREFIX=set_notify_params MSG="{rawparams}"