Skip to content

Commit

Permalink
modified the CALIBRATE macro to accept multiple bed sizes automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Frix-x committed Apr 16, 2023
1 parent f4359bc commit 490654b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions macros/calibration/calibrate.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,30 @@ description: Calibrate the printer flow or pressure advance
gcode:
# Type of calibration
{% set TYPE = params.TYPE|default("")|string|lower %}
# Define vars with safe default values for ABS (main material I'm using)

# Define print vars with safe default values
{% set BED_TEMP = params.BED_TEMP|default(printer["gcode_macro _USER_VARIABLES"].print_default_bed_temp)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(printer["gcode_macro _USER_VARIABLES"].print_default_extruder_temp)|float %}
{% set MATERIAL = params.MATERIAL|default("ABS")|string %}

{% set center_x = printer.toolhead.axis_maximum.x|float / 2 %}
{% set center_y = printer.toolhead.axis_maximum.y|float / 2 %}

{% if TYPE=="flow" %}
# No bed mesh needed for this one as it's a small center print so we compute the size manually (default flow size is 40mm)
{% set computed_size = (center_x - 20)|string + '_' + (center_y - 20)|string + '_' + (center_x + 20)|string + '_' + (center_y + 20)|string %}

# Call the standard START_PRINT with almost no soaking time and no chamber temp requirement (we want to go fast!)
# Also no bed mesh needed for this one as it's a small center print
START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE=130_130_170_170
START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE={computed_size}
FLOW_MULTIPLIER_CALIBRATION EXTRUSION_WIDTH=0.471
END_PRINT FILTER_TIME=0

{% elif TYPE=="pressure_advance" %}
# A bed mesh is needed for this one as it's a large print so we compute the size manually (default PA size is 120mm)
{% set computed_size = (center_x - 60)|string + '_' + (center_y - 60)|string + '_' + (center_x + 60)|string + '_' + (center_y + 60)|string %}

# Call the standard START_PRINT with almost no soaking time and no chamber temp requirement (we want to go fast!)
# A bed mesh is needed for this one as it's a large print (120mm sized square)
START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE=90_90_210_210
START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE={computed_size}
PRESSURE_ADVANCE_CALIBRATION
END_PRINT FILTER_TIME=0

Expand Down

0 comments on commit 490654b

Please sign in to comment.