-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprint_start_macro.txt
92 lines (78 loc) · 3.47 KB
/
print_start_macro.txt
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
# Add following to Machine G-Code section in your slicer
PRINT_START BED_TEMP=[first_layer_bed_temperature] EXTRUDER_TEMP=[nozzle_temperature_initial_layer] PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} MAX_PRINT_BED=[print_bed_max]
# Replace or comment out stock PRINT_START macro in printer.cfg and replace with the following
[gcode_macro PRINT_START]
gcode:
{% set BED_TEMP = params.BED_TEMP| float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP| float %}
{% set PRINT_MIN = params.PRINT_MIN | string %}
{% set MAX_PRINT_BED = params.MAX_PRINT_BED | float %}
{% set PRINT_MIN_COORDS = PRINT_MIN.split(',')|default(0,0)|map('float')|list %}
{% set X_LINE_START = PRINT_MIN_COORDS[0] - 1.5 |float %}
{% set Y_LINE_START = (PRINT_MIN_COORDS[1] + 60, MAX_PRINT_BED)|min|float %}
{% set X_LINE_END = (PRINT_MIN_COORDS[0] + 60, MAX_PRINT_BED)|min|float %}
{% set Y_LINE_END = (0, PRINT_MIN_COORDS[1]-1.5)|max|float %}
M118 Bed Temp {BED_TEMP}
M118 Extruder_Temp {EXTRUDER_TEMP}
M118 PRINT_MIN { PRINT_MIN_COORDS }
M118 MAX_PRINT_BED { MAX_PRINT_BED }
M118 X_LINE_START {X_LINE_START}
M118 Y_LINE_START {Y_LINE_START}
M118 X_LINE_END {X_LINE_END}
M118 Y_LINE_END {Y_LINE_END}
;wiping nozzle start
open_led
M106 P3 S0
clean_nozzle_position
;wiping nozzle end
;*************preheat nozzle and hotbed for Z_TILT_ADJUST*************
M140 S{BED_TEMP}
M104 S130
G1 X110 Y110 F6000
G4 P200
probe
SET_KINEMATIC_POSITION Z=0 ;Z homing
Z_TILT_ADJUST
;*************Z_TILT_ADJUST end*************
M140 S{BED_TEMP} ;heat hotbed temp set by user
G1 X5 Y5 F6000
G28
G1 X{X_LINE_START} Y{Y_LINE_START} F6000
G1 Z0.2 F600
M104 S{EXTRUDER_TEMP} ;heat nozzle temp set by user
M106 S100 ;close head_nozzle fan
G4 P3000
M106 S255 ;close head_nozzle fan
G4 P3000
M106 S100 ;close head_nozzle fan
;*************PRINT START*************
M109 S140
BED_MESH_CLEAR
# Uncomment if using stock klipper that came with printer
# BED_MESH_PROFILE LOAD=default # bedmesh load
# Use if running Klipper 12 and greater
BED_MESH_CALIBRATE ADAPTIVE=1
# Move to purge line
G1 X{X_LINE_START} Y{Y_LINE_START} F6000
M109 S{EXTRUDER_TEMP} ;heat nozzle temp set by user and wait
M190 S{BED_TEMP} ;heat bed temp set by user and wait
M106 S0 ;close head_nozzle fan
G92 E0 ;Reset Extruder
G1 Z4.0 F200 ;Move Z Axis up
G90 ;absolute position
; ; ; ; ; ; ; ; ; draw line along model
G92 E0 ;reset extruder
G1 E4 F300 ;extrude filament
G1 X{X_LINE_START} Y{Y_LINE_START} F6000
G1 Z0.22 F600
G1 X{X_LINE_START} Y{Y_LINE_END} F2000 E10
G1 Z0.22 F600
G1 X{X_LINE_END} F1200 E12
; ; ; ; ; ; ; ; ;draw line along model end
G4 P200
G1 Z2
G92 E0 ;Reset Extruder
CLEAR_PAUSE
;***********model start************