Fix: Calibration macros now call actual print patterns

- CALIBRATE_PRESSURE_ADVANCE -> calls PA_TEST_PATTERN
- CALIBRATE_FLOW_RATE -> calls FLOW_TEST_CUBE
- CALIBRATE_TEMPERATURE -> calls TEMP_TOWER
- CALIBRATE_RETRACTION -> calls RETRACT_TEST_PATTERN

Previously these macros only printed instructions but didn't execute
the actual calibration prints. Now they properly delegate to the
real pattern macros in test_patterns.cfg.
This commit is contained in:
root 2026-03-14 13:15:45 +00:00
parent a93018b38f
commit 0c561e5054

View file

@ -109,53 +109,22 @@ gcode:
description: Calibrate Pressure Advance for optimal corners
gcode:
{% set FILAMENT = params.FILAMENT|default("PLA")|upper %}
{% set START_PA = params.START|default(0.01)|float %}
{% set END_PA = params.END|default(0.05)|float %}
{% set STEP = params.STEP|default(0.002)|float %}
{% set START = params.START|default(0.01)|float %}
{% set END = params.END|default(0.05)|float %}
{% set STEPS = params.STEPS|default(10)|int %}
{% set TEMP = params.TEMP|default(205)|int %}
RESPOND MSG="Starting Pressure Advance Calibration..."
RESPOND MSG="Filament: {FILAMENT}"
RESPOND MSG="PA Range: {START_PA} - {END_PA}"
RESPOND MSG="PA Range: {START} to {END} in {STEPS} steps"
RESPOND MSG=""
# Heat up based on filament type
{% if FILAMENT == "PLA" %}
{% set TEMP = 205 %}
{% elif FILAMENT == "PETG" %}
{% set TEMP = 240 %}
{% elif FILAMENT == "ABS" %}
{% set TEMP = 250 %}
{% elif FILAMENT == "TPU" %}
{% set TEMP = 225 %}
{% else %}
{% set TEMP = 205 %}
{% endif %}
RESPOND MSG="Step 1: Heating to {TEMP}°C..."
M104 S{TEMP}
M190 S60
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={TEMP-5}
RESPOND MSG="Step 2: Homing..."
G28
RESPOND MSG="Step 3: Starting PA calibration pattern..."
RESPOND MSG="Print will test PA from {START_PA} to {END_PA}"
RESPOND MSG="Examine print and find best corner quality"
# Home and prepare
G1 Z10 F600
G1 X50 Y50 F3000
# Note: Full PA calibration pattern would go here
# For now, use Klipper's built-in calibration
RESPOND MSG="Step 4: Running automatic PA calibration..."
PRESSURE_ADVANCE_CALIBRATE
# Call the actual print pattern
PA_TEST_PATTERN START={START} END={END} STEPS={STEPS} TEMP={TEMP}
RESPOND MSG=""
RESPOND MSG="Pressure Advance calibration complete!"
RESPOND MSG="Check console for recommended PA value"
RESPOND MSG="Add to [extruder] section and run SAVE_CONFIG"
RESPOND MSG="Examine squares and find best corner quality"
# ----------------------------------------------------------------------------
# 4. FLOW RATE CALIBRATION
@ -164,49 +133,22 @@ gcode:
description: Calibrate flow rate for exact wall dimensions
gcode:
{% set FILAMENT = params.FILAMENT|default("PLA")|upper %}
{% set START = params.START|default(0.90)|float %}
{% set END = params.END|default(1.10)|float %}
{% set STEPS = params.STEPS|default(5)|int %}
{% set TEMP = params.TEMP|default(205)|int %}
RESPOND MSG="Starting Flow Rate Calibration..."
RESPOND MSG="Filament: {FILAMENT}"
RESPOND MSG="Flow range: {START} to {END} in {STEPS} sections"
RESPOND MSG=""
# Heat up based on filament type
{% if FILAMENT == "PLA" %}
{% set TEMP = 205 %}
{% elif FILAMENT == "PETG" %}
{% set TEMP = 240 %}
{% elif FILAMENT == "ABS" %}
{% set TEMP = 250 %}
{% else %}
{% set TEMP = 205 %}
{% endif %}
RESPOND MSG="Step 1: Heating to {TEMP}°C..."
M104 S{TEMP}
M190 S60
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={TEMP-5}
RESPOND MSG="Step 2: Homing..."
G28
RESPOND MSG="Step 3: Printing flow test cube..."
RESPOND MSG="Cube will have walls printed at different flow rates"
RESPOND MSG=""
RESPOND MSG="After print:"
RESPOND MSG=" 1. Measure wall thickness with calipers"
RESPOND MSG=" 2. Find which section matches nominal wall width"
RESPOND MSG=" 3. Calculate: New Flow = Old Flow × (Measured / Nominal)"
RESPOND MSG=""
# Home and prepare
G1 Z10 F600
G1 X50 Y50 F3000
RESPOND MSG="Step 4: Starting print..."
# Flow calibration pattern would be printed here
# Call the actual print pattern
FLOW_TEST_CUBE START={START} END={END} STEPS={STEPS} TEMP={TEMP}
RESPOND MSG=""
RESPOND MSG="Flow Rate calibration pattern complete!"
RESPOND MSG="Update flow_ratio in filament profile and run SAVE_CONFIG"
RESPOND MSG="Measure walls with calipers and calculate optimal flow"
# ----------------------------------------------------------------------------
# 5. TEMPERATURE TOWER
@ -215,42 +157,22 @@ gcode:
description: Print temperature tower to find optimal temp
gcode:
{% set FILAMENT = params.FILAMENT|default("PLA")|upper %}
{% set START_TEMP = params.START|default(195)|int %}
{% set END_TEMP = params.END|default(225)|int %}
{% set START = params.START|default(195)|int %}
{% set END = params.END|default(225)|int %}
{% set STEP = params.STEP|default(5)|int %}
{% set BED = params.BED|default(60)|int %}
RESPOND MSG="Starting Temperature Tower..."
RESPOND MSG="Filament: {FILAMENT}"
RESPOND MSG="Temperature Range: {START_TEMP}°C - {END_TEMP}°C"
RESPOND MSG="Temperature Range: {START}°C - {END}°C (step: {STEP}°C)"
RESPOND MSG=""
RESPOND MSG="Step 1: Heating bed..."
M190 S60
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM=55
RESPOND MSG="Step 2: Homing..."
G28
RESPOND MSG="Step 3: Printing temperature tower..."
RESPOND MSG="Each section uses different temperature"
RESPOND MSG=""
RESPOND MSG="After print:"
RESPOND MSG=" 1. Check for stringing (too hot)"
RESPOND MSG=" 2. Check for poor layer adhesion (too cold)"
RESPOND MSG=" 3. Check bridging quality"
RESPOND MSG=" 4. Choose best temperature section"
RESPOND MSG=""
# Home and prepare
G1 Z10 F600
G1 X50 Y50 F3000
RESPOND MSG="Step 4: Starting print..."
# Temperature tower pattern would be printed here
# Call the actual print pattern
TEMP_TOWER START={START} END={END} STEP={STEP} BED={BED}
RESPOND MSG=""
RESPOND MSG="Temperature Tower complete!"
RESPOND MSG="Update nozzle_temperature in filament profile"
RESPOND MSG="Examine sections for best quality"
# ----------------------------------------------------------------------------
# 6. RETRACTION TEST
@ -259,60 +181,22 @@ gcode:
description: Test retraction settings to minimize stringing
gcode:
{% set FILAMENT = params.FILAMENT|default("PLA")|upper %}
{% set HOTEND = params.HOTEND|default("ORIGINAL")|upper %}
{% set START = params.START|default(1.5)|float %}
{% set END = params.END|default(3.5)|float %}
{% set STEPS = params.STEPS|default(8)|int %}
{% set TEMP = params.TEMP|default(205)|int %}
RESPOND MSG="Starting Retraction Test..."
RESPOND MSG="Filament: {FILAMENT}"
RESPOND MSG="Hotend: {HOTEND}"
RESPOND MSG="Retraction range: {START}mm to {END}mm in {STEPS} towers"
RESPOND MSG=""
# Set defaults based on hotend type
{% if HOTEND == "BAMBU" or HOTEND == "BAMBU_LAB" %}
{% set START_RETRACT = 1.2 %}
{% set END_RETRACT = 2.5 %}
{% else %}
{% set START_RETRACT = 1.5 %}
{% set END_RETRACT = 3.5 %}
{% endif %}
# Heat up based on filament type
{% if FILAMENT == "PLA" %}
{% set TEMP = 205 %}
{% elif FILAMENT == "PETG" %}
{% set TEMP = 240 %}
{% elif FILAMENT == "ABS" %}
{% set TEMP = 250 %}
{% else %}
{% set TEMP = 205 %}
{% endif %}
RESPOND MSG="Step 1: Heating to {TEMP}°C..."
M104 S{TEMP}
M190 S60
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={TEMP-5}
RESPOND MSG="Step 2: Homing..."
G28
RESPOND MSG="Step 3: Printing retraction test..."
RESPOND MSG="Testing retraction from {START_RETRACT}mm to {END_RETRACT}mm"
RESPOND MSG=""
RESPOND MSG="After print:"
RESPOND MSG=" 1. Find section with least stringing"
RESPOND MSG=" 2. Ensure no underextrusion"
RESPOND MSG=" 3. Use that retraction value"
RESPOND MSG=""
# Home and prepare
G1 Z10 F600
G1 X50 Y50 F3000
RESPOND MSG="Step 4: Starting print..."
# Retraction test pattern would be printed here
# Call the actual print pattern
RETRACT_TEST_PATTERN START={START} END={END} STEPS={STEPS} TEMP={TEMP}
RESPOND MSG=""
RESPOND MSG="Retraction Test complete!"
RESPOND MSG="Update retract_length in filament profile"
RESPOND MSG="Find tower with least stringing"
# ----------------------------------------------------------------------------
# 7. BED MESH CALIBRATION