-
Notifications
You must be signed in to change notification settings - Fork 0
/
wip_macros.cfg
61 lines (55 loc) · 2.2 KB
/
wip_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
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - please customize for your slicer of choice
gcode:
{% set BED_TEMP = params.BED|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER|default(210)|float %}
G92 E0
# Start bed heating
M140 S{BED_TEMP}
# Wait for bed to reach temperature
M104 S{EXTRUDER_TEMP}
G28 ; home all axes
G1 Z20 F3000 ; move nozzle away from bed
G1 X1 Y0 F1000
M190 S{BED_TEMP}
M104 S{EXTRUDER_TEMP} ; hotend temperature
M109 S{EXTRUDER_TEMP} ; hotend temperature
G92 E0 ; Reset Extruder
G1 Z0.2 X5 F720
G1 X50.0 E5.0 F300
G1 X100.0 E10.0 F700
G1 X120.0 E1.0 F700
G92 E0.0
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customize for your slicer of choice
gcode:
M400 ; wait for buffer to clear
G91 ; relative positioning
G92 E0 ; zero the extruder
G1 E-0.4 F3600 ; retract filament
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe direction to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
TURN_OFF_HEATERS
M107 ; turn off fan
G90 ; absolute positioning
G0 X60 Y{max_y} F3600 ; park nozzle at rear