From c462eb819c825a8ca11b0cb07b7c89b98f066894 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 26 Mar 2023 15:04:35 -0400 Subject: [PATCH] Adjust purge_line. --- cfgs/misc-macros.cfg | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index e0a245f..cb90059 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -81,12 +81,25 @@ 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 safe speeds + {% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %} + {% set maxVelocityAdjusted = (0.85 * 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 Y{max_y / 3 * 2} E35.0 F1200.0 ; 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]