Fix: Calibrate all test patterns for Neptune 4 Plus bed dimensions

All test patterns now print in the CENTER of the bed (150, 165) instead
of the front-left corner. Fixed patterns:

1. PA_TEST_PATTERN:
   - Centered at X150 Y165 (bed center)
   - Squares: 25mm with 10mm spacing
   - 5 squares per row, auto-calculated positions
   - Proper extrusion amounts

2. FLOW_TEST_CUBE:
   - Centered at X150 Y165
   - 20mm cube, centered coordinates
   - Proper flow-multiplied extrusion

3. RETRACT_TEST_PATTERN:
   - Towers centered on bed
   - 10mm towers with 30mm spacing
   - 4 towers per row
   - Proper stringing travel moves

4. TEMP_TOWER:
   - 20mm tower centered at X150 Y165
   - Proper bridge moves to center
   - Park at front after completion

All patterns now:
- Use BED_CENTER_X=150, BED_CENTER_Y=165 (N4 Plus center)
- Auto-calculate positions based on pattern dimensions
- Park at front of bed after completion
- Show position info in console messages
This commit is contained in:
root 2026-03-13 16:14:48 +00:00
parent becc1794d5
commit ca8590c925

View file

@ -8,13 +8,17 @@
# Prints squares with varying PA values
# ----------------------------------------------------------------------------
[gcode_macro PA_TEST_PATTERN]
description: Print Pressure Advance test pattern
description: Print Pressure Advance test pattern (Neptune 4 Plus optimized)
gcode:
{% set START_PA = params.START|default(0.01)|float %}
{% set END_PA = params.END|default(0.05)|float %}
{% set STEPS = params.STEPS|default(10)|int %}
{% set TEMP = params.TEMP|default(205)|int %}
# Neptune 4 Plus bed dimensions
{% set BED_CENTER_X = 150 %}
{% set BED_CENTER_Y = 165 %}
# Heat up
M104 S{TEMP}
M190 S60
@ -31,47 +35,64 @@ gcode:
G92 E0
{% set step_size = (END_PA - START_PA) / STEPS %}
{% set square_size = 20 %}
{% set spacing = 5 %}
{% set square_size = 25 %}
{% set spacing = 10 %}
{% set squares_per_row = 5 %}
# Calculate starting position to center the pattern
{% set pattern_width = (squares_per_row * (square_size + spacing)) - spacing %}
{% set start_x = BED_CENTER_X - (pattern_width / 2) %}
{% set start_y = BED_CENTER_Y - (pattern_width / 2) %}
RESPOND MSG="Printing {STEPS} squares with PA from {START_PA} to {END_PA}"
RESPOND MSG="Pattern centered at X{BED_CENTER_X} Y{BED_CENTER_Y}"
{% for step in range(STEPS) %}
{% set current_pa = START_PA + (step * step_size) %}
{% set x_pos = 50 + (step % 5) * (square_size + spacing) %}
{% set y_pos = 50 + (step // 5) * (square_size + spacing) %}
{% set col = step % squares_per_row %}
{% set row = (step // squares_per_row)|int %}
{% set x_pos = start_x + col * (square_size + spacing) %}
{% set y_pos = start_y + row * (square_size + spacing) %}
RESPOND MSG="Square {step + 1}/{STEPS}: PA={current_pa}"
RESPOND MSG="Square {step + 1}/{STEPS}: PA={current_pa:.3f} at X{x_pos} Y{y_pos}"
SET_PRESSURE_ADVANCE ADVANCE={current_pa}
# Move to position
G1 X{x_pos} Y{y_pos} Z0.2 F3000
# Print square
G1 X{x_pos + square_size} E10 F1800
G1 Y{y_pos + square_size} E10 F1800
G1 X{x_pos} E10 F1800
G1 Y{y_pos} E10 F1800
# Print square (counter-clockwise)
G1 X{x_pos + square_size} E{square_size * 0.04} F1800
G1 Y{y_pos + square_size} E{square_size * 0.04} F1800
G1 X{x_pos} E{square_size * 0.04} F1800
G1 Y{y_pos} E{square_size * 0.04} F1800
# Lift Z
# Lift Z and travel to next
G1 Z5 F600
{% endfor %}
# Park at front
G1 X{BED_CENTER_X} Y{20} Z50 F6000
RESPOND MSG="PA Test Pattern complete!"
RESPOND MSG="Examine squares and find best corner quality"
# ----------------------------------------------------------------------------
# FLOW RATE TEST CUBE
# Prints cube with varying flow rates
# Prints cube with varying flow rates - Neptune 4 Plus optimized
# ----------------------------------------------------------------------------
[gcode_macro FLOW_TEST_CUBE]
description: Print flow rate calibration cube
description: Print flow rate calibration cube (centered on bed)
gcode:
{% set START_FLOW = params.START|default(0.90)|float %}
{% set END_FLOW = params.END|default(1.10)|float %}
{% set STEPS = params.STEPS|default(5)|int %}
{% set TEMP = params.TEMP|default(205)|int %}
# Neptune 4 Plus bed center
{% set BED_CENTER_X = 150 %}
{% set BED_CENTER_Y = 165 %}
{% set CUBE_SIZE = 20 %}
# Heat up
M104 S{TEMP}
M190 S60
@ -91,14 +112,21 @@ gcode:
{% set cube_height = 20 %}
{% set wall_thickness = 0.4 %}
# Calculate cube corner positions (centered)
{% set cube_x_min = BED_CENTER_X - (CUBE_SIZE / 2) %}
{% set cube_y_min = BED_CENTER_Y - (CUBE_SIZE / 2) %}
{% set cube_x_max = BED_CENTER_X + (CUBE_SIZE / 2) %}
{% set cube_y_max = BED_CENTER_Y + (CUBE_SIZE / 2) %}
RESPOND MSG="Printing flow cube with {STEPS} sections"
RESPOND MSG="Flow range: {START_FLOW} to {END_FLOW}"
RESPOND MSG="Cube centered at X{BED_CENTER_X} Y{BED_CENTER_Y}"
{% for step in range(STEPS) %}
{% set current_flow = START_FLOW + (step * step_size) %}
{% set z_start = step * cube_height %}
RESPOND MSG="Section {step + 1}/{STEPS}: Flow={current_flow}"
RESPOND MSG="Section {step + 1}/{STEPS}: Flow={current_flow:.2f}"
# Set flow rate (via extrusion multiplier simulation)
{% set flow_multiplier = current_flow %}
@ -108,39 +136,44 @@ gcode:
{% set z_height = z_start + (layer * 0.2) %}
G1 Z{z_height} F600
# Wall 1
G1 X50 Y50 F3000
G1 X70 E{10 * flow_multiplier} F1800
# Wall 1 (front)
G1 X{cube_x_min} Y{cube_y_min} F3000
G1 X{cube_x_max} E{CUBE_SIZE * 0.04 * flow_multiplier} F1800
# Wall 2
G1 Y70 E{10 * flow_multiplier} F1800
# Wall 2 (right)
G1 Y{cube_y_max} E{CUBE_SIZE * 0.04 * flow_multiplier} F1800
# Wall 3
G1 X50 E{10 * flow_multiplier} F1800
# Wall 3 (back)
G1 X{cube_x_min} E{CUBE_SIZE * 0.04 * flow_multiplier} F1800
# Wall 4
G1 Y50 E{10 * flow_multiplier} F1800
# Wall 4 (left)
G1 Y{cube_y_min} E{CUBE_SIZE * 0.04 * flow_multiplier} F1800
{% endfor %}
{% endfor %}
# Lift Z
# Lift Z and park
G1 Z50 F600
G1 X{BED_CENTER_X} Y{20} F6000
RESPOND MSG="Flow Test Cube complete!"
RESPOND MSG="Measure walls with calipers and calculate optimal flow"
# ----------------------------------------------------------------------------
# RETRACTION TEST PATTERN
# Prints towers with varying retraction lengths
# Prints towers with varying retraction lengths - Neptune 4 Plus optimized
# ----------------------------------------------------------------------------
[gcode_macro RETRACT_TEST_PATTERN]
description: Print retraction test pattern
description: Print retraction test pattern (centered on bed)
gcode:
{% set START_RETRACT = params.START|default(1.0)|float %}
{% set END_RETRACT = params.END|default(4.0)|float %}
{% set STEPS = params.STEPS|default(8)|int %}
{% set TEMP = params.TEMP|default(205)|int %}
# Neptune 4 Plus bed center
{% set BED_CENTER_X = 150 %}
{% set BED_CENTER_Y = 165 %}
# Heat up
M104 S{TEMP}
M190 S60
@ -158,16 +191,27 @@ gcode:
{% set step_size = (END_RETRACT - START_RETRACT) / STEPS %}
{% set tower_height = 15 %}
{% set layers_per_tower = 75 %}
{% set tower_size = 10 %}
{% set tower_spacing = 30 %}
{% set towers_per_row = 4 %}
# Calculate starting position to center the pattern
{% set pattern_width = ((towers_per_row - 1) * tower_spacing) %}
{% set start_x = BED_CENTER_X - (pattern_width / 2) %}
{% set start_y = BED_CENTER_Y - (pattern_width / 4) %}
RESPOND MSG="Printing retraction test with {STEPS} towers"
RESPOND MSG="Retraction range: {START_RETRACT}mm to {END_RETRACT}mm"
RESPOND MSG="Pattern centered at X{BED_CENTER_X} Y{BED_CENTER_Y}"
{% for step in range(STEPS) %}
{% set current_retract = START_RETRACT + (step * step_size) %}
{% set x_pos = 30 + (step % 4) * 25 %}
{% set y_pos = 30 + (step // 4) * 25 %}
{% set col = step % towers_per_row %}
{% set row = (step // towers_per_row)|int %}
{% set x_pos = start_x + col * tower_spacing %}
{% set y_pos = start_y + row * tower_spacing %}
RESPOND MSG="Tower {step + 1}/{STEPS}: Retract={current_retract}mm"
RESPOND MSG="Tower {step + 1}/{STEPS}: Retract={current_retract:.1f}mm at X{x_pos} Y{y_pos}"
# Print tower
{% for layer in range(layers_per_tower) %}
@ -182,8 +226,10 @@ gcode:
# Travel to next tower position (simulates stringing test)
{% if step < STEPS - 1 %}
{% set next_x = 30 + ((step + 1) % 4) * 25 %}
{% set next_y = 30 + ((step + 1) // 4) * 25 %}
{% set next_col = (step + 1) % towers_per_row %}
{% set next_row = ((step + 1) // towers_per_row)|int %}
{% set next_x = start_x + next_col * tower_spacing %}
{% set next_y = start_y + next_row * tower_spacing %}
G1 X{next_x} Y{next_y} F3000
# De-retract
@ -191,31 +237,45 @@ gcode:
{% endif %}
# Small square for this layer
G1 X{x_pos + 10} E2 F1800
G1 Y{y_pos + 10} E2 F1800
G1 X{x_pos} E2 F1800
G1 Y{y_pos} E2 F1800
G1 X{x_pos + tower_size} E{tower_size * 0.04} F1800
G1 Y{y_pos + tower_size} E{tower_size * 0.04} F1800
G1 X{x_pos} E{tower_size * 0.04} F1800
G1 Y{y_pos} E{tower_size * 0.04} F1800
{% endfor %}
# Lift Z
G1 Z20 F600
{% endfor %}
# Park at front
G1 X{BED_CENTER_X} Y{20} Z50 F6000
RESPOND MSG="Retraction Test Pattern complete!"
RESPOND MSG="Find tower with least stringing"
# ----------------------------------------------------------------------------
# TEMPERATURE TOWER
# Prints tower with varying temperatures
# Prints tower with varying temperatures - Neptune 4 Plus optimized
# ----------------------------------------------------------------------------
[gcode_macro TEMP_TOWER]
description: Print temperature tower
description: Print temperature tower (centered on bed)
gcode:
{% set START_TEMP = params.START|default(195)|int %}
{% set END_TEMP = params.END|default(225)|int %}
{% set STEP = params.STEP|default(5)|int %}
{% set BED_TEMP = params.BED|default(60)|int %}
# Neptune 4 Plus bed center
{% set BED_CENTER_X = 150 %}
{% set BED_CENTER_Y = 165 %}
{% set TOWER_SIZE = 20 %}
# Calculate tower corner positions (centered)
{% set tower_x_min = BED_CENTER_X - (TOWER_SIZE / 2) %}
{% set tower_y_min = BED_CENTER_Y - (TOWER_SIZE / 2) %}
{% set tower_x_max = BED_CENTER_X + (TOWER_SIZE / 2) %}
{% set tower_y_max = BED_CENTER_Y + (TOWER_SIZE / 2) %}
# Heat bed
M190 S{BED_TEMP}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED_TEMP-5}
@ -236,6 +296,7 @@ gcode:
RESPOND MSG="Printing temperature tower"
RESPOND MSG="Temp range: {START_TEMP}°C to {END_TEMP}°C"
RESPOND MSG="Sections: {sections}"
RESPOND MSG="Tower centered at X{BED_CENTER_X} Y{BED_CENTER_Y}"
{% for section in range(sections) %}
{% set current_temp = START_TEMP + (section * STEP) %}
@ -255,23 +316,24 @@ gcode:
{% set z_height = z_start + (layer * 0.2) %}
G1 Z{z_height} F600
# Print square
G1 X100 Y100 F3000
G1 X120 E10 F1800
G1 Y120 E10 F1800
G1 X100 E10 F1800
G1 Y100 E10 F1800
# Print square (centered)
G1 X{tower_x_min} Y{tower_y_min} F3000
G1 X{tower_x_max} E{TOWER_SIZE * 0.04} F1800
G1 Y{tower_y_max} E{TOWER_SIZE * 0.04} F1800
G1 X{tower_x_min} E{TOWER_SIZE * 0.04} F1800
G1 Y{tower_y_min} E{TOWER_SIZE * 0.04} F1800
# Bridging test every 10 layers
{% if layer % 10 == 0 and layer > 0 %}
G1 X110 Y110 E5 F2000 ; Bridge
G1 X{BED_CENTER_X} Y{BED_CENTER_Y} E{TOWER_SIZE * 0.015} F2000 ; Bridge
{% endif %}
{% endfor %}
{% endfor %}
# Cool down
# Cool down and park
M104 S0
G1 Z50 F600
G1 X{BED_CENTER_X} Y{20} F6000
RESPOND MSG="Temperature Tower complete!"
RESPOND MSG="Examine sections for best quality"