Implemented the use of PRE_PURGE_PRIME_LENGTH in purge_line and print_end macros.

This commit is contained in:
Bassam Husain
2023-01-13 15:08:52 -05:00
parent 22190a86b3
commit da5318c6c8

View File

@@ -1,13 +1,22 @@
[pause_resume] [pause_resume]
[display_status] [display_status]
[gcode_macro _globals]
variable_pre_purge_prime_length: 1.4
gcode:
SET_GCODE_VARIABLE MACRO=_globals VARIABLE=pre_purge_prime_length VALUE={ variable_pre_purge_prime_length }
[gcode_macro PURGE_LINE] [gcode_macro PURGE_LINE]
# https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt # https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt
gcode: gcode:
{% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %}
{% if not PRE_PURGE_PRIME_LENGTH %}
{action_raise_error('Pre purge prime length not found')}
{% endif %}
G0 Y0 X40 F4000 ; go to tongue of print bed G0 Y0 X40 F4000 ; go to tongue of print bed
G1 Z0.2 F500.0 ; move bed to nozzle G1 Z0.2 F500.0 ; move bed to nozzle
G92 E0.0 ; reset extruder G92 E0.0 ; reset extruder
G1 E1.40 F500 ; pre-purge prime LENGTH SHOULD MATCH YOUR PRINT_END RETRACT G1 E{PRE_PURGE_PRIME_LENGTH} F500 ; pre-purge prime LENGTH SHOULD MATCH YOUR PRINT_END RETRACT
G1 X80 E8.0 F500.0 ; intro line 1 G1 X80 E8.0 F500.0 ; intro line 1
G1 Y0.3 ; move in a little G1 Y0.3 ; move in a little
G1 X40 E8.0 F500.0 ; second line G1 X40 E8.0 F500.0 ; second line
@@ -58,9 +67,13 @@ gcode:
[gcode_macro PRINT_END] [gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customize for your slicer of choice # Use PRINT_END for the slicer ending script - please customize for your slicer of choice
gcode: gcode:
{% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %}
{% if not PRE_PURGE_PRIME_LENGTH %}
{action_raise_error('Pre purge prime length not found')}
{% endif %}
M400 ; wait for buffer to clear M400 ; wait for buffer to clear
G92 E0 ; zero the extruder G92 E0 ; zero the extruder
G1 E-1.40 F400 ; retract filament G1 E-{PRE_PURGE_PRIME_LENGTH} F400 ; retract filament
G91 ; relative positioning G91 ; relative positioning
# Get Boundaries # Get Boundaries