Purge_line macro adjusted to print at the front of the bed; printer agnostic. Print_end adjusted to use safer speed.

This commit is contained in:
Bassam Husain
2023-04-02 18:31:58 -04:00
parent 39131e0d66
commit 98a1cd7fe6

View File

@@ -75,17 +75,32 @@ gcode:
{% endif %}
[gcode_macro PURGE_LINE]
# https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt
# https://github.com/VoronDesign/Voron-Switchwire/blob/200cdae033c59ef81f67c4235469da7ca66d53a1/Firmware/skr_mini_e3_v2_config.cfg
gcode:
{% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %}
ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1
G0 Y0 X0 F4000 ; go to tongue of print bed
G1 Z0.4 F500.0 ; move bed to nozzle
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
{% set extrudeAmount = 26.6 %}
{% set movementLength = 100 %}
{% set movementSpeed = 15 * 60 %}
# Set safe speeds
{% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %}
{% set maxVelocityAdjusted = (0.9 * maxVelocity * 60)|int %}
G92 E0.0 ; reset extruder
G90 ; Absolute positioning
G0 X0 Y0 F{maxVelocityAdjusted} ; move to purge position
G1 Z0.4 F500.0 ; move to purge height
M83 ; Relative extrusion mode
G1 E{PRE_PURGE_PRIME_LENGTH} F500 ; pre-purge prime LENGTH SHOULD MATCH YOUR PRINT_END RETRACT
G1 Y140 E35.0 F1200.0 ; intro line 1
G1 X{movementLength} E{extrudeAmount} F{movementSpeed} ; intro line 1
#G1 E-.5 F2100 # Retract
G92 E0.0 ; reset extruder
M82 ; Absolute extrusion mode
G1 Z5.0 ; move nozzle to prevent scratch
[gcode_macro CANCEL_PRINT]
@@ -125,11 +140,18 @@ gcode:
ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0
CONDITIONAL_BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print
{% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %}
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-{PRE_PURGE_PRIME_LENGTH} F400 ; retract filament
G91 ; relative positioning
# Set safe speeds
{% set zVelocity = printer.configfile.settings.printer.max_z_velocity|default(15)|int %}
{% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %}
{% set zVelocityAdjusted = (0.95 * zVelocity * 60)|int %}
{% set maxVelocityAdjusted = (0.95 * maxVelocity * 60)|int %}
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
@@ -155,8 +177,8 @@ gcode:
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
G0 Z{z_safe} F2000 ; move nozzle up
G0 X{x_safe} Y{y_safe} F9000 ; move nozzle to remove stringing
G0 Z{z_safe} F{zVelocityAdjusted} ; move nozzle up
G0 X{x_safe} Y{y_safe} F{maxVelocityAdjusted} ; move nozzle to remove stringing
TURN_OFF_HEATERS
M107 ; turn off fan
G90 ; absolute positioning