Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################################################################
- # Filament Change
- ######################################################################
- # M600: Filament Change. This macro will pause the printer, move the
- # tool to the change position, and retract the filament 50mm. Adjust
- # the retraction settings for your own extruder. After filament has
- # been changed, the print can be resumed from its previous position
- # with the "RESUME" gcode.
- [pause_resume]
- recover_velocity: 50
- [filament_switch_sensor filasens]
- pause_on_runout: false
- runout_gcode:
- M117 OUT OF FILAMENT
- M600
- insert_gcode:
- M117 FILAMENT INSERTED
- LOAD_FILAMENT
- RESUME
- event_delay: 1.0
- switch_pin: !PD1
- [gcode_macro M600]
- gcode:
- SAVE_GCODE_STATE NAME=filament_change
- PAUSE
- M83
- G1 E-5 F1000
- PARK
- UNLOAD_FILAMENT
- RESTORE_GCODE_STATE NAME=filament_change
- [gcode_macro PARK]
- gcode:
- M117 PARKING
- G91
- G1 Z10 F200
- G90
- G1 X120 Y0 Z200 F1000
- [gcode_macro M601]
- gcode:
- SAVE_GCODE_STATE NAME=hardware_change
- PAUSE
- G91
- G1 Z10 F200
- G90
- G1 Y200 F1000
- RESTORE_GCODE_STATE NAME=hardware_change
- [gcode_macro PAUSE]
- description: Pause the print
- rename_existing: BASE_PAUSE
- gcode:
- M117 PAUSED..
- BASE_PAUSE
- SET_IDLE_TIMEOUT TIMEOUT=10000
- #Turn Off Nozzle Fan
- #M107 P1
- [gcode_macro RESUME]
- rename_existing: BASE_RESUME
- gcode:
- M117 Resuming..
- BASE_RESUME
- #Turn On Nozzle Fan
- M106 S{ printer.fan.speed * 255} P1
- [gcode_macro LOAD_PLA]
- gcode:
- M104 T0 S230
- PARK
- M109 T0 S230
- LOAD_FILAMENT
- G1 Z100 F2000
- [gcode_macro LOAD_PETG]
- gcode:
- M104 T0 S250
- PARK
- M109 T0 S250
- LOAD_FILAMENT
- G1 Z100 F2000
- [gcode_macro LOAD_FILAMENT]
- gcode:
- M117 Loading Filament...
- LOW_TEMP_CHECK
- M83
- G1 E80 F300
- G1 E15 F50
- M400
- M117 Load Complete
- G1 E-1.2 F50
- [gcode_macro UNLOAD_FILAMENT]
- gcode:
- M117 Unloading Filament...
- LOW_TEMP_CHECK
- M83
- G1 E-100 F1000
- M400
- M117 Remove Filament Now!
- #M300 S300 P500
- #M300 S100 P500
- [gcode_macro LOW_TEMP_CHECK]
- #default_parameter_T:230
- gcode:
- {% set TEMP = params.T|default(230)|int %}
- {% if printer.extruder.target != 0 %} # if there is a setpoint for extruder
- {% if printer.extruder.temperature < printer.extruder.target %} # if not reached, heat
- #M117 Heating from {printer.extruder.temperature} to {printer.extruder.target}.
- M109 S{printer.extruder.target|float}
- {% endif %}
- {% else %} # if no setpoint for extruder
- {% if printer.extruder.target < TEMP %} # heat to T.
- #M117 No setpoint, heating to {T}.
- M109 S{TEMP}
- {% endif %}
- {% endif %}
- [gcode_macro M300]
- #default_parameter_S: 1000
- # Use a default 1kHz tone if S is omitted.
- #default_parameter_P: 100
- # Use a 10ms duration is P is omitted.
- gcode:
- {% set TONE = params.S|default(1000)|int %}
- {% set PULSE = params.P|default(100)|int %}
- SET_PIN PIN=BEEPER_pin VALUE={TONE}
- G4 P{PULSE}
- SET_PIN PIN=BEEPER_pin VALUE=0
- ######################################################################
- # Start Print and End Print
- ######################################################################
- [gcode_macro START_PRINT]
- #default_parameter_BED_TEMP: 50
- #default_parameter_EXTRUDER_TEMP: 240
- gcode:
- {% set EXTRUDER_TEMP = params.E_TEMP|default(230)|int %}
- {% set BED_TEMP = params.B_TEMP|default(60)|int %}
- CLEAR_PAUSE
- SET_GCODE_OFFSET Z=0
- # Home the printer
- M117 HOMING...
- G28
- #####
- ## Warm the printer for calibrating
- #M117 WARMING...
- ## Warm bed
- #M140 S50
- ## Warm nozzle
- #M109 S160
- #M190 S50
- ## Calibrate Bed Mesh
- M117 CALIBRATING...
- BED_MESH_CALIBRATE
- G28
- #####
- # Use absolute coordinates
- G90
- # Move the nozzle near the bed
- G1 Z5 F3000
- # Move the nozzle very close to the bed
- G1 Z0.4 F300
- G92 E0.0
- # Start nozzle heating
- M117 HEATING...
- M104 S{EXTRUDER_TEMP}
- # Wait for bed to reach temperature
- M190 S{BED_TEMP}
- # Set and wait for nozzle to reach temperature
- M109 S{EXTRUDER_TEMP}
- M220 S100
- # Intro line
- G1 X60.0 E9.0 F1000.0
- # Intro line
- G1 X100.0 E15.0 F1000.0
- # reset extruder distance position
- G92 E0.0
- M117 PRINTING
- [gcode_macro END_PRINT]
- gcode:
- # Turn off bed, extruder, and fan
- M140 S0
- M104 S0
- M107 S0
- M107 S1
- # Move nozzle away from print while retracting
- G91
- # Raise nozzle by 1mm
- G1 Z1 F3000
- # Present part
- G90
- G1 X0 Y210 F3000
- M117 FINISHED
- UNLOAD_FILAMENT
- SET_IDLE_TIMEOUT TIMEOUT=600
- [exclude_object]
- ####################################
- # Homing
- ####################################
- [gcode_macro HOME]
- gcode:
- {% if printer.toolhead.homed_axes != "xyz" %}
- G28
- #############G1 Z0.2
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment