-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.cfg
177 lines (151 loc) · 4.12 KB
/
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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
[gcode_macro ZUP]
gcode:
SET_GCODE_OFFSET Z_ADJUST=0.01 MOVE=1
[gcode_macro ZDOWN]
gcode:
SET_GCODE_OFFSET Z_ADJUST=-0.01 MOVE=1
#---------------------------------------------------
[servo extruder]
pin: PG12
maximum_servo_angle: 180
minimum_pulse_width: 0.0004
maximum_pulse_width: 0.0024
[output_pin servo_power]
#Set low to power off servo
pin: PD15
pwm: False
[gcode_macro ARM_INSTALL]
gcode:
SET_PIN PIN=servo_power VALUE=1 # Power on servo via fan controll
SET_SERVO SERVO=extruder ANGLE=90 # Set servo position to 90 degrees
[gcode_macro SERVO_OFF]
gcode:
SET_PIN PIN=servo_power VALUE=0 # Power down servo via fan controll
[gcode_macro ARM_POSITION]
gcode:
SET_PIN PIN=servo_power VALUE=1 # Power on servo via fan controll
{% set serv_angle=params.A|default(0)|float %}
SET_SERVO SERVO=extruder ANGLE={ serv_angle } # Move servo arm
G4 P1500 # Allow time to make move
SET_PIN PIN=servo_power VALUE=0 # Power down servo via fan controll
[gcode_macro T0]
gcode:
{% set svv = printer.save_variables.variables %} # Set svv to point to variable.cfg
ARM_POSITION A=175 # Switch to T0
{% if "xyz" in printer.toolhead.homed_axes %}
SET_GCODE_OFFSET X=0
SET_GCODE_OFFSET Y=0
{% endif %}
ACTIVATE_EXTRUDER EXTRUDER=extruder
G4 P1000
[gcode_macro T1]
gcode:
{% set svv = printer.save_variables.variables %} # Set svv to point to variable.cfg
ARM_POSITION A=10 # Switch to T1
{% if "xyz" in printer.toolhead.homed_axes %}
SET_GCODE_OFFSET X={svv.x_off} # Account for different X offset
SET_GCODE_OFFSET Y={svv.y_off} # Account for different X offset
{% endif %}
ACTIVATE_EXTRUDER EXTRUDER=extruder1
G4 P1000
# Use unload_filament to unload ABS
[gcode_macro unload_filament]
gcode:
G1 Z8
G1 X62 Y300 F8000
G1 Z0
M109 S245
M83
G1 E10 F300
G1 E-50 F2000
G1 E-20
M82
# Use load_filament to load ABS
[gcode_macro load_filament]
gcode:
M83
G1 Z8 f6000
G1 X60 Y300
G1 X62 Z0 F8000
G1 E35 F200
G1 E-10 F800
M106 S225
G4 S10
G1 X50 F10000
G1 X70
G1 X50
G1 X70
nozzle_clean
M106 S0
M82
# macro to level the gantry. use G32 in the terminal to call
[gcode_macro g32]
gcode:
G28
bed_mesh_clear
T0
Z_TILT_ADJUST
bed_mesh_calibrate
G28
[gcode_macro nozzle_clean]
gcode:
G1 Z12
G1 X60 Y300 F12000
G1 Z5
G1 X105
G1 X75
G1 X105
G1 X60
G1 X150
G1 Z12
[gcode_macro Nozzle_switch]
gcode:
M104 S240
G1 X150 Y80 Z245 F5000
[gcode_macro goto_center]
gcode:
G0 X150 Y150 Z50 F3500
[gcode_macro stop_motors]
gcode:
M18
#####################################################################
# Auxillary Fan setup for Orcaslicer
#####################################################################
[gcode_macro M106]
rename_existing: G106
gcode:
{% if params.P is defined %}
{% if params.P|int == 2 %}
{% if params.S is defined %}
{% if params.S|int == 255 %}
{% set realspeed = 1 %}
{% else %}
{% if params.S|int == 0 %}
{% set realspeed = 0 %}
{% else %}
{% set realspeed = params.S|float/255 %}
{% endif %}
{% endif %}
{% else %}
{% set realspeed = 1 %}
{% endif %}
SET_FAN_SPEED FAN=Aux_Fan SPEED={realspeed}
{% endif %}
{% else %}
{% if params.S is defined %}
G106 S{params.S}
{% else %}
G106 S255
{% endif %}
{% endif %}
[gcode_macro M107]
rename_existing: G107
gcode:
{% if params.P is defined %}
{% if params.P|int == 2 %}
SET_FAN_SPEED FAN=Aux_Fan SPEED=0
{% endif %}
{% else %}
SET_FAN_SPEED FAN=Aux_Fan SPEED=0
G107
{% endif %}