Skip to content

Commit

Permalink
Merge branch 'dev' into noTipShaping
Browse files Browse the repository at this point in the history
  • Loading branch information
tehniemer authored Nov 22, 2023
2 parents a6b0859 + 90d310c commit 8f4e16a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion macros/base/cancel_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gcode:
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
{% set retract_length = printer["gcode_macro _USER_VARIABLES"].retract_length|default(10)|float %}

PARK

Expand All @@ -21,7 +22,7 @@ gcode:
{% else %}
# pull back the filament a little bit
G92 E0
G1 E-10 F2100
G1 E-{retract_length} F3600
{% endif %}

{% if turn_off_heaters_in_end_print %}
Expand Down
3 changes: 2 additions & 1 deletion macros/base/end_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gcode:
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
{% set filter_default_time = printer["gcode_macro _USER_VARIABLES"].filter_default_time_on_end_print|default(600)|int %}
{% set retract_length = printer["gcode_macro _USER_VARIABLES"].retract_length|default(10)|float %}

PARK

Expand All @@ -23,7 +24,7 @@ gcode:
{% else %}
# pull back the filament a little bit
G92 E0
G1 E-10 F2100
G1 E-{retract_length} F3600
{% endif %}

{% if turn_off_heaters_in_end_print %}
Expand Down
8 changes: 4 additions & 4 deletions macros/helpers/nozzle_cleaning.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ gcode:
[gcode_macro PURGE]
description: Purge a specific amount of filament ontop of the purge bucket
gcode:
{% set DISTANCE = params.DISTANCE|default(printer["gcode_macro _USER_VARIABLES"].purge_distance)|int %}
{% set DISTANCE = params.DISTANCE|default(printer["gcode_macro _USER_VARIABLES"].purge_distance)|float %}
{% set RETRACT = params.RETRACT|default(printer["gcode_macro _USER_VARIABLES"].purge_retract_length)|float %}
{% set OOZE_TIME = params.OOZE_TIME|default(printer["gcode_macro _USER_VARIABLES"].purge_ooze_time)|int %}
{% set TEMP = params.TEMP|default(printer["gcode_macro _USER_VARIABLES"].print_default_extruder_temp)|float %}
{% set Z_DROP = params.Z_DROP|default(1)|int %}
Expand Down Expand Up @@ -102,12 +103,11 @@ gcode:
# Heat if needed and purge
_LOW_TEMP_CHECK T={TEMP}
G92 E0
G1 E{DISTANCE|float} F150
G1 E{DISTANCE} F150

# Retract
G92 E0
G1 E-1.7 F2100
G1 E-18.3 F150
G1 E-{RETRACT} F3600
G92 E0

# Wait some time to let the nozzle ooze before cleaning
Expand Down
7 changes: 6 additions & 1 deletion macros/helpers/prime_line.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gcode:
{% set prime_line_length = params.LINE_LENGTH|default(printer["gcode_macro _USER_VARIABLES"].prime_line_length)|float %}
{% set prime_line_purge_distance = params.PURGE_LENGTH|default(printer["gcode_macro _USER_VARIABLES"].prime_line_purge_distance)|float %}
{% set prime_line_flowrate = params.FLOWRATE|default(printer["gcode_macro _USER_VARIABLES"].prime_line_flowrate)|float %}
{% set charge_length = params.CHARGE_LENGTH|default(printer["gcode_macro _USER_VARIABLES"].charge_length)|float %}

# Set internal macro vars
{% set prime_line_x, prime_line_y = printer["gcode_macro _USER_VARIABLES"].prime_line_xy|map('float') %}
Expand All @@ -21,6 +22,8 @@ gcode:

{% set line_height = 0.6 %}

{% set wipe_length = prime_line_length * 0.8 %}

# some more Macro parameters after retrieving defaults
{% set prime_line_x = params.START_X|default(prime_line_x)|float %}
{% set prime_line_y = params.START_Y|default(prime_line_y)|float %}
Expand Down Expand Up @@ -82,14 +85,16 @@ gcode:

# Add pressure in the nozzle
G92 E0
G1 E18 F300
G1 E{charge_length} F300

# Prime line
G92 E0
{% if prime_line_direction == "X" %}
G1 X{prime_line_x + prime_line_length} E{prime_line_purge_distance} F{speed}
G1 X{prime_line_x + wipe_length} F{St}
{% elif prime_line_direction == "Y" %}
G1 Y{prime_line_y + prime_line_length} E{prime_line_purge_distance} F{speed}
G1 Y{prime_line_y + wipe_length} F{St}
{% else %}
{ action_respond_error("Prime line direction is not valid. Choose either X or Y in the variables.cfg file!") }
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions user_templates/variables.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ variable_prime_line_direction: "X" # can also be set to "Y"
variable_prime_line_length: 40 # length of the prime line on the bed (in mm)
variable_prime_line_purge_distance: 30 # length of filament to purge (in mm)
variable_prime_line_flowrate: 10 # mm3/s used for the prime line
variable_charge_length: 18 # length of filament to pressurize the nozzle before starting the move

## Length of filament to retract to reduce oozing after end of print (in mm)
variable_retract_length: 10

## Park position used when pause, end_print, etc...
variable_park_position_xy: -1, -1
Expand Down Expand Up @@ -202,6 +206,7 @@ variable_brush_over_y_axis: True # Cleanup is done moving the extruder along the
variable_brush_xyz: -1, -1, -1 # Position of the brush center for nozzle cleaning
variable_purge_bucket_xyz: -1, -1, -1 # Purge bucket position
variable_purge_distance: 30 # Amount to purge (in mm)
variable_purge_retract_length: 5 # Length of filament to retract to reduce oozing (in mm)
variable_purge_ooze_time: 10 # Time (in seconds) to wait after the purge to let the nozzle ooze before going to the brush

## Servo angles used to define the retracted and deployed positions
Expand Down

0 comments on commit 8f4e16a

Please sign in to comment.