Last active
July 8, 2021 08:59
-
-
Save NameOfTheDragon/8957f1c5a749de90502b73fbf60dc5a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User defined macros | |
[include input_shaper_tuning.cfg] | |
[gcode_macro START_PRINT] | |
default_parameter_BED_TEMPERATURE: 60 | |
default_parameter_EXTRUDER_STANDBY_TEMPERATURE: 170 | |
default_parameter_EXTRUDER_TEMPERATURE: 210 | |
default_parameter_CHAMBER_TEMPERATURE: 20 | |
gcode: | |
#LED_STARTING | |
KINEMATICS_SAFE_DEFAULTS | |
CLEAR_PAUSE | |
G90 ; use absolute coordinates | |
M83 ; extruder relative mode | |
M106 S50 ; Fan on approx. 20% to protect cooling ducts | |
M140 S{BED_TEMPERATURE} ; set bed temp | |
M104 S{EXTRUDER_STANDBY_TEMPERATURE} ; set standby extruder temp | |
M141 S{CHAMBER_TEMPERATURE} ; set target chamber temperature | |
M190 S{BED_TEMPERATURE} ; wait for bed temp | |
M106 S25 ; Part cooling fan 10% to protect ducts | |
; M109 S170 ; wait for extruder temp | |
;BED_MESH_CLEAR | |
G28 ; home all | |
QUAD_GANTRY_LEVEL | |
G28 Z ; re-home Z because gantry levelling potentially alters the Z offset. | |
move_to_purge_bucket ; while we wait for the hot end to heat up | |
M104 S{EXTRUDER_TEMPERATURE} ; set first layer extruder temp | |
M109 S{EXTRUDER_TEMPERATURE} ; wait for extruder temp | |
CLEAN_NOZZLE ; Purge and wipe | |
G28 Z ; Re-home Z after cleaning because grunge on the nozzle can throw the Z-offset off. | |
CENTER | |
G1 E2 ; Prime nozzle (cleaning leaves filament retracted 2mm) | |
G92 E0.0 | |
#LED_PRINTING | |
# Uncomment for input shaper tuning | |
# INPUT_SHAPER_TUNING_TOWER | |
[gcode_macro CANCEL_PRINT] | |
rename_existing: BASE_CANCEL_PRINT | |
gcode: | |
TURN_OFF_HEATERS | |
CLEAR_PAUSE | |
SDCARD_RESET_FILE | |
SET_FAN_SPEED SPEED=0.25 | |
KINEMATICS_SAFE_DEFAULTS | |
#LED_FAIL | |
BASE_CANCEL_PRINT | |
[gcode_macro PAUSE] | |
rename_existing: BASE_PAUSE | |
default_parameter_E: 1.7 | |
gcode: | |
#LED_PAUSED | |
{% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} | |
{% set y_park = printer.toolhead.axis_maximum.y|float - 15.0 %} | |
{% set max_z = printer.toolhead.axis_maximum.z|float %} | |
{% set act_z = printer.toolhead.position.z|float %} | |
{% if act_z < (max_z - 40) %} | |
{% set z_safe = 40 %} | |
{% else %} | |
{% set z_safe = max_z - act_z %} | |
{% endif %} | |
SAVE_GCODE_STATE NAME=PAUSE_state | |
BASE_PAUSE | |
G91 | |
G1 E-{E} F2100 | |
G1 Z{z_safe} F900 | |
G90 | |
G0 X{x_park} Y{y_park} F6000 | |
[gcode_macro TURN_OFF_HEATERS] | |
rename_existing: BASE_TURN_OFF_HEATERS | |
gcode: | |
M141 S35 ; Cool chamber to something approaching room temperature | |
BASE_TURN_OFF_HEATERS | |
[gcode_macro RESUME] | |
rename_existing: BASE_RESUME | |
default_parameter_E: 1.7 | |
gcode: | |
#LED_PRINTING | |
G91 | |
G1 E{E} F2100 | |
RESTORE_GCODE_STATE NAME=PAUSE_state | |
BASE_RESUME | |
[gcode_macro KINEMATICS_SAFE_DEFAULTS] | |
gcode: | |
SET_VELOCITY_LIMIT VELOCITY=400 ACCEL=9000 ACCEL_TO_DECEL=1050 SQUARE_CORNER_VELOCITY=7.5 | |
SET_PRESSURE_ADVANCE ADVANCE=0.04 SMOOTH_TIME=0.040 | |
[gcode_macro END_PRINT] | |
gcode: | |
#LED_SUCCESS | |
KINEMATICS_SAFE_DEFAULTS | |
# Move nozzle away from print while retracting | |
M83 ; Relative E | |
G91 ; Relative XYZ | |
G1 X-2 Y-2 Z+5 E-3 F300 | |
G90 ; Absolute XYZ | |
M82 ; Absolute E | |
TURN_OFF_HEATERS | |
M106 S50 ; Leave fan running to protect cooling ducts. | |
PRESENT_PLATE | |
[gcode_macro G29] | |
gcode: | |
QGL_HOME_AND_CENTER | |
[gcode_macro G32] | |
gcode: | |
QGL_HOME_AND_CENTER | |
[gcode_macro QGL_HOME_AND_CENTER] | |
gcode: | |
;BED_MESH_CLEAR | |
G28 | |
QUAD_GANTRY_LEVEL | |
G28 Z | |
CENTER | |
[gcode_macro CENTER] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set posy = printer.toolhead.axis_maximum.y|float / 2.0 %} | |
{% set posx = printer.toolhead.axis_maximum.x|float / 2.0 %} | |
G0 X{posx} Y{posy} F{FEED_RATE} | |
# Moves the print head to a position over the centre of the bed and no lower than Z=200. | |
# If the print is higher than 200 mm, tries to raise Z by at least 50 mm, limited by the axis maximum. | |
[gcode_macro PRESENT_PLATE] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set posy = printer.toolhead.axis_maximum.y|float / 2.0 %} | |
{% set posx = printer.toolhead.axis_maximum.x|float / 2.0 %} | |
{% set max_z = printer.toolhead.axis_maximum.z|float %} | |
{% set min_z = 200.0 %} | |
{% set toolhead_z = printer.toolhead.position.z|float %} | |
{% set target_z = toolhead_z + 50 %} | |
{% if target_z > max_z %} | |
{% set target_z = max_z %} | |
{% endif %} | |
{% if target_z < min_z %} | |
{% set target_z = min_z %} | |
{% endif %} | |
G0 X{posx} Y{posy} Z{target_z} F{FEED_RATE} | |
[gcode_macro LOAD_FILAMENT] | |
default_parameter_SPEED: 1800 | |
default_parameter_PRIME_SPEED: 400 | |
default_parameter_PURGE_LENGTH: 55 | |
gcode: | |
; TODO - this may not work if changing filament in the middle of a print. | |
SAVE_GCODE_STATE NAME=__filament__load | |
M83 | |
G1 E5 F75 | |
G1 E50 F{SPEED} | |
clean_nozzle PURGE_SPEED={PRIME_SPEED} PURGE_LENGTH={PURGE_LENGTH} | |
;G1 E35 F{PRIME_SPEED} | |
;G1 E20 F{PRIME_SPEED} | |
;G1 E-1 F{SPEED} | |
RESTORE_GCODE_STATE NAME=__filament__load | |
[gcode_macro UNLOAD_FILAMENT] | |
default_parameter_SPEED: 1500 | |
default_parameter_RAMMING_SPEED: 400 | |
gcode: | |
SAVE_GCODE_STATE NAME=__filament__load | |
M83 | |
G1 E-13 F{SPEED} | |
G1 E17 F{RAMMING_SPEED} | |
G1 E-13 F{SPEED} | |
G1 E17 F{RAMMING_SPEED} | |
G1 E-13 F{SPEED} | |
G1 E17 F{RAMMING_SPEED} | |
G1 E-50 F{SPEED} | |
G1 E-50 F{SPEED} | |
RESTORE_GCODE_STATE NAME=__filament__load | |
[gcode_macro M600] | |
gcode: | |
CHANGE_FILAMENT | |
[gcode_macro M601] | |
gcode: | |
CHANGE_FILAMENT | |
[gcode_macro CHANGE_FILAMENT] | |
default_parameter_RESUME_SPEED: 80 | |
gcode: | |
M117 Change Filament | |
PAUSE | |
M117 | |
[gcode_macro EXERCISE_KINEMATICS] | |
default_parameter_SPEED: 10000 | |
gcode: | |
G28 | |
G0 X50 Y50 Z50 F{SPEED} | |
G0 X300 | |
G0 Y300 | |
G0 X50 | |
G0 Y50 | |
G0 X300 Y300 Z300 | |
G0 X50 | |
G0 Y50 | |
G0 X300 | |
G0 Y300 | |
G0 X175 Y175 Z175 | |
G0 X50 Y50 Z50 F{SPEED} | |
G0 X300 | |
G0 Y300 | |
G0 X50 | |
G0 Y50 | |
G0 X300 Y300 Z50 F6000 | |
M84 ; Motors off (forces re-home in case of lost steps) | |
[gcode_macro FRONT_RIGHT] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set x_park = printer.toolhead.axis_maximum.x|float - 15.0 %} | |
{% set y_park = printer.toolhead.axis_minimum.y|float + 15.0 %} | |
G0 X{x_park} Y{y_park} F{FEED_RATE} | |
[gcode_macro FRONT_CENTER] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set x_park = printer.toolhead.axis_maximum.x|float / 2.0 %} | |
{% set y_park = printer.toolhead.axis_minimum.y|float + 15.0 %} | |
G0 X{x_park} Y{y_park} F{FEED_RATE} | |
[gcode_macro TOP] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set z_park = printer.toolhead.axis_maximum.z|float - 50.0 %} | |
G0 Z{z_park} F{FEED_RATE} | |
[gcode_macro CUBE_CENTRE] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set x_centre = printer.toolhead.axis_maximum.x|float / 2.0 %} | |
{% set y_centre = printer.toolhead.axis_maximum.y|float / 2.0 %} | |
{% set z_centre = printer.toolhead.axis_maximum.z|float / 2.0 %} | |
G0 X{x_centre} Y{y_centre} Z{z_centre} F{FEED_RATE} | |
[gcode_macro HOME_CORNER] | |
default_parameter_FEED_RATE: 12000 | |
gcode: | |
{% set x_park = printer.toolhead.axis_maximum.x|float - 20.0 %} | |
{% set y_park = printer.toolhead.axis_maximum.y|float - 20.0 %} | |
{% set z_park = printer.toolhead.axis_minimum.z|float + 50.0 %} | |
CUBE_CENTRE FEED_RATE={FEED_RATE} | |
G0 X{x_park} Y{y_park} Z{z_park} F{FEED_RATE} | |
[gcode_macro PID_TUNE_EXTRUDER] | |
gcode: | |
PID_CALIBRATE HEATER=extruder TARGET=250 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M109 S0 ; uncomment to remove set&wait temp gcode added automatically after this start gcode | |
START_PRINT EXTRUDER_TEMPERATURE={first_layer_temperature[initial_extruder] + extruder_temperature_offset[initial_extruder]} BED_TEMPERATURE=[first_layer_bed_temperature] CHAMBER_TEMPERATURE=[chamber_temperature] EXTRUDER_STANDBY_TEMPERATURE={first_layer_temperature[initial_extruder] - 40} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment