Skip to content

Instantly share code, notes, and snippets.

@ChainsDD
Last active April 21, 2022 21:22
Show Gist options
  • Save ChainsDD/6793c0128d5d05f41e10235a8c2710a4 to your computer and use it in GitHub Desktop.
Save ChainsDD/6793c0128d5d05f41e10235a8c2710a4 to your computer and use it in GitHub Desktop.
macros
[idle_timeout]
gcode:
TURN_OFF_HEATERS
M84
M106 S0
BED_LIGHT_OFF
[homing_override]
set_position_z: 0
gcode:
G91
G1 Z5
G90
G28 X Y
# {% set x_center = ((printer.toolhead.axis_maximum.x - printer.toolhead.axis_minimum.x) / 2) - printer.configfile.config.bltouch.x_offset|float %}
# {% set y_center = ((printer.toolhead.axis_maximum.y - printer.toolhead.axis_minimum.y) / 2) - printer.configfile.config.bltouch.y_offset|float %}
# G91
# G1 X{x_center} Y-{y_center} F6000
G1 X0 Y192
G90
G28 Z
G1 X{printer.toolhead.axis_minimum.x} Y{printer.toolhead.axis_maximum.y} Z5 F6000
[gcode_macro START_PRINT]
gcode:
BED_LIGHT_ON
{% set bed_temp = params.BED_TEMP|default(70)|float %}
{% if bed_temp > 0 %}
BED_MESH_PROFILE LOAD={((bed_temp|int/10)|round * 10)|int}
# Start Bed Heating
M190 S{bed_temp}
# Let the bed heat soak
G4 P120000
{% endif %}
G28
G1 X0 Y215 Z0.4 F3000
{% set extruder_temp = params.EXTRUDER_TEMP|default(190)|float %}
M109 S{extruder_temp}
WIPE_PRIME
[gcode_macro END_PRINT]
gcode:
TURN_OFF_HEATERS
M106 S0
G92 E0
G1 E-1 F2400
CLAMP_MOVE Z={printer.toolhead.position.z|float + 2}
CLAMP_MOVE X=0 Y={printer.toolhead.axis_maximum.y} Z={printer.toolhead.position.z|float + 12}
M18
[gcode_macro WIPE_PRIME]
gcode:
{% set x_min = printer.toolhead.axis_minimum.x %}
{% set y_max = printer.toolhead.axis_maximum.y %}
G0 X{x_min} Y{y_max} Z2 F3000
G0 X{x_min} Y{y_max - 2} Z0.2 F3000
G92 E0
G1 Y60 E15 F600
G1 Y40 F5000
G92 E0
[gcode_macro M108]
gcode:
TURN_OFF_HEATERS
[gcode_macro CLAMP_MOVE]
gcode:
{% set dest_x = [[printer.toolhead.axis_minimum.x|float, params.X|default(printer.toolhead.position.x)|float]|max, printer.toolhead.axis_maximum.x|float]|min %}
{% set dest_y = [[printer.toolhead.axis_minimum.y|float, params.Y|default(printer.toolhead.position.y)|float]|max, printer.toolhead.axis_maximum.y|float]|min %}
{% set dest_z = [[printer.toolhead.axis_minimum.z|float, params.Z|default(printer.toolhead.position.z)|float]|max, printer.toolhead.axis_maximum.z|float]|min %}
SAVE_GCODE_STATE NAME=clamp_move_state
G90
G1 X{dest_x} Y{dest_y} Z{dest_z} F{params.F|default(3000)|float}
RESTORE_GCODE_STATE NAME=clamp_move_state
[gcode_macro T0]
gcode:
[gcode_macro BED_LIGHT_ON]
gcode:
SET_LED LED=bed RED=1.0 BLUE=1.0 GREEN=1.0
[gcode_macro BED_LIGHT_OFF]
gcode:
SET_LED LED=bed RED=0 BLUE=0 GREEN=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment