From f12e2f33821a9be26e359af077ccc6823754f908 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sun, 26 Mar 2023 14:16:24 -0400 Subject: [PATCH] Adjusted print_end to use speeds pulled from config. --- cfgs/misc-macros.cfg | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index c32bc88..b341cc1 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -80,6 +80,7 @@ gcode: 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 G92 E0.0 ; reset extruder @@ -125,11 +126,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.85 * zVelocity)|int %} + {% set maxVelocityAdjusted = (0.85 * maxVelocity)|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 +163,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