Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
115e04c
Improve `Z_AFTER_PROBING`
classicrocker883 Dec 17, 2025
8fd0ace
add Aquila to build-test (updated platform use less memory)
classicrocker883 Dec 17, 2025
c57a82c
fix `Z_AFTER_HOMING` in Conditionals-3
classicrocker883 Dec 17, 2025
6f77dbc
revert pre-defining Z_AFTER_HOMING
classicrocker883 Dec 17, 2025
d643638
add to Z_AFTER_PROBING definition
classicrocker883 Dec 19, 2025
71baef2
define Z_AFTER_HOMING w/ UBL
classicrocker883 Dec 19, 2025
7c4180b
move ifndef add sanity fix
classicrocker883 Dec 20, 2025
9133d71
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-December4
classicrocker883 Dec 20, 2025
78fd3b0
fix no probe - trying to keep `move_z_after_probing` enabled like it had
classicrocker883 Dec 20, 2025
78559ad
Define Z_AFTER_PROBING if not already defined
classicrocker883 Dec 28, 2025
c435fd2
Update example configs for Voxelab Aquila
classicrocker883 Dec 28, 2025
0b69182
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-December4
classicrocker883 Dec 29, 2025
8766a77
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-December4
classicrocker883 Jan 22, 2026
0a6f5eb
use `Z_POST_CLEARANCE`
classicrocker883 Jan 22, 2026
3c7da32
NONE not exactly opposite of ALL (issue?)
classicrocker883 Jan 22, 2026
1ca27f4
use `!ALL`
classicrocker883 Jan 24, 2026
e786060
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Feb 4, 2026
a9d2a12
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-December4
classicrocker883 Feb 11, 2026
6747593
remove Z_POST_CLEARANCE handling in motion.cpp
classicrocker883 Feb 11, 2026
72ecd46
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x-December4
classicrocker883 May 14, 2026
8a96ae9
Remove default Z_AFTER_HOMING definition
classicrocker883 May 14, 2026
15aa845
re-Add Z_AFTER_HOMING
classicrocker883 May 14, 2026
3646d89
Change Z_AFTER_PROBING
classicrocker883 May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ jobs:

# GD32F1
- GD32F103RC_aquila_mfl
- GD32F103RC_voxelab_maple

# LPC176x - Lengthy tests
- LPC1768
Expand Down
4 changes: 2 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1806,10 +1806,10 @@
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes
#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET)
//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done

#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping

//#define Z_AFTER_PROBING // Enable move to Z_POST_CLEARANCE after probing is done

// For M851 provide ranges for adjusting the X, Y, and Z probe offsets
//#define PROBE_OFFSET_XMIN -50 // (mm)
//#define PROBE_OFFSET_XMAX 50 // (mm)
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float off
probe.stow();
TERN_(HAS_MARLINUI_MENU, ui.capture());

probe.move_z_after_probing();
TERN_(Z_AFTER_PROBING, probe.move_z_after_probing());

#if ENABLED(DWIN_LCD_PROUI)
bedlevel.smart_fill_mesh();
Expand Down Expand Up @@ -1585,7 +1585,7 @@ void unified_bed_leveling::smart_fill_mesh() {
}

probe.stow();
probe.move_z_after_probing();
TERN_(Z_AFTER_PROBING, probe.move_z_after_probing());

if (abort_flag) {
SERIAL_ECHOLNPGM("?Error probing point. Aborting operation.");
Expand Down Expand Up @@ -1671,7 +1671,7 @@ void unified_bed_leveling::smart_fill_mesh() {
}
}
probe.stow();
probe.move_z_after_probing();
TERN_(Z_AFTER_PROBING, probe.move_z_after_probing());

if (abort_flag || finish_incremental_LSF(&lsf_results)) {
SERIAL_ECHOLNPGM("Could not complete LSF!");
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ G29_TYPE GcodeSuite::G29() {
// Restore state after probing
if (!faux) motion.restore_feedrate_and_scaling();

probe.move_z_after_probing();
TERN_(Z_AFTER_PROBING, probe.move_z_after_probing());

#ifdef EVENT_GCODE_AFTER_G29
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("After G29 G-code: ", EVENT_GCODE_AFTER_G29);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ void GcodeSuite::G29() {
else {
// Move to the after probing position
motion.position.z = (
#ifdef Z_AFTER_PROBING
Z_AFTER_PROBING
#ifdef Z_POST_CLEARANCE
Z_POST_CLEARANCE
#else
Z_CLEARANCE_BETWEEN_MANUAL_PROBES
#endif
Expand Down
6 changes: 4 additions & 2 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ void GcodeSuite::G30() {
// Move the nozzle to the position of the probe
motion.blocking_move(probepos);

if (raise_after == PROBE_PT_STOW)
probe.move_z_after_probing();
#if ENABLED(Z_AFTER_PROBING)
if (raise_after == PROBE_PT_STOW)
probe.move_z_after_probing();
#endif

motion.report_position();
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/probe/M401_M402.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ void GcodeSuite::M401_report(const bool forReplay/*=true*/) {
*/
void GcodeSuite::M402() {
probe.stow(parser.boolval('R'));
#ifdef Z_AFTER_PROBING
motion.do_z_clearance(Z_AFTER_PROBING);
#if ENABLED(Z_AFTER_PROBING)
motion.do_z_clearance(Z_POST_CLEARANCE);
#endif
motion.report_position();
}
Expand Down
22 changes: 22 additions & 0 deletions Marlin/src/inc/Conditionals-3-etc.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,28 @@
#undef Z_CLEARANCE_MULTI_PROBE
#endif

/**
* Z_POST_CLEARANCE
*/
#if HAS_Z_AXIS && !ALL(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING, DWIN_LCD_PROUI)
#ifndef Z_POST_CLEARANCE // May be set by proui/dwin.h :-P
#ifdef Z_AFTER_HOMING
#define Z_POST_CLEARANCE Z_AFTER_HOMING
#else
#define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING
#endif
#endif
#endif

/**
* Z_AFTER_PROBING
*/
#if PROBE_SELECTED && ENABLED(AUTO_BED_LEVELING_UBL) && !Z_HOME_TO_MAX || ENABLED(ALLOW_Z_AFTER_HOMING)
#if DISABLED(Z_AFTER_PROBING)
#define Z_AFTER_PROBING
#endif
#endif

#if DISABLED(ENABLE_LEVELING_FADE_HEIGHT)
#undef DEFAULT_LEVELING_FADE_HEIGHT
#endif
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
#elif !defined(TOUCH_MI_RETRACT_Z)
#error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
#elif defined(Z_AFTER_PROBING)
#elif ENABLED(Z_AFTER_PROBING)
#error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
#elif Z_CLEARANCE_FOR_HOMING < 10
#error "TOUCH_MI_PROBE requires Z_CLEARANCE_FOR_HOMING >= 10."
Expand Down Expand Up @@ -1589,8 +1589,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#else
static_assert(Z_CLEARANCE_BETWEEN_PROBES >= 0, "Probes require Z_CLEARANCE_BETWEEN_PROBES >= 0.");
#endif
#ifdef Z_AFTER_PROBING
static_assert(Z_AFTER_PROBING >= 0, "Probes require Z_AFTER_PROBING >= 0.");
#if ENABLED(Z_AFTER_PROBING)
static_assert(Z_POST_CLEARANCE >= 0, "Probes with Z_AFTER_PROBING require Z_POST_CLEARANCE >= 0.");
#endif

#if DISABLED(DWIN_LCD_PROUI) && (MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/dwin/proui/dwin_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#endif

#ifndef Z_AFTER_HOMING
#define Z_AFTER_HOMING 0
#define Z_AFTER_HOMING 10
#endif

#define DEF_PIDCYCLES 5
Expand Down
10 changes: 4 additions & 6 deletions Marlin/src/lcd/menu/menu_probe_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@
//
void _lcd_level_bed_done() {
if (!ui.wait_for_move) {
#if DISABLED(MESH_BED_LEVELING) && defined(Z_AFTER_PROBING)
if (Z_AFTER_PROBING) {
// Display "Done" screen and wait for moves to complete
line_to_z(Z_AFTER_PROBING);
ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE));
}
#if DISABLED(MESH_BED_LEVELING) && ENABLED(Z_AFTER_PROBING)
// Display "Done" screen and wait for moves to complete
line_to_z(Z_POST_CLEARANCE);
ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE));
#endif
ui.goto_previous_screen_no_defer();
ui.completion_feedback();
Expand Down
18 changes: 5 additions & 13 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,30 +1103,22 @@ void Motion::blocking_move(const xy_pos_t &raw, const feedRate_t fr_mm_s/*=0.0f*
#endif

/**
* Move Z to Z_POST_CLEARANCE,
* The axis is allowed to move down.
* Move Z to the clearance height;
* the axis is allowed to move downward.
*/
void Motion::do_move_after_z_homing() {
DEBUG_SECTION(mzah, "do_move_after_z_homing", DEBUGGING(LEVELING));
#ifdef Z_POST_CLEARANCE
#if ENABLED(Z_AFTER_PROBING)
probe.move_z_after_probing();
#else
do_z_clearance(
Z_POST_CLEARANCE,
ALL(HOMING_Z_WITH_PROBE, HAS_STOWABLE_PROBE) && TERN0(HAS_BED_PROBE, endstops.z_probe_enabled),
true
);
#elif ENABLED(USE_PROBE_FOR_Z_HOMING)
probe.move_z_after_probing();
#endif
}

#ifndef Z_POST_CLEARANCE // May be set by proui/dwin.h :-P
#ifdef Z_AFTER_HOMING
#define Z_POST_CLEARANCE Z_AFTER_HOMING
#else
#define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING
#endif
#endif

void Motion::do_z_post_clearance() { do_z_clearance(Z_POST_CLEARANCE); }

#endif // HAS_Z_AXIS
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ class Probe {

static void use_probing_tool(const bool=true) IF_DISABLED(DO_TOOLCHANGE_FOR_PROBING, {});

static void move_z_after_probing() {
DEBUG_SECTION(mzah, "move_z_after_probing", DEBUGGING(LEVELING));
#ifdef Z_AFTER_PROBING
motion.do_z_clearance(Z_AFTER_PROBING, true, true); // Move down still permitted
#endif
}
#if ENABLED(Z_AFTER_PROBING)
static void move_z_after_probing() {
DEBUG_SECTION(mzah, "move_z_after_probing", DEBUGGING(LEVELING));
motion.do_z_clearance(Z_POST_CLEARANCE, true, true); // Move down still permitted
}
#endif

static bool can_reach(const xy_pos_t &pos, const bool probe_relative=true) { return can_reach(pos.x, pos.y, probe_relative); }

Expand Down
39 changes: 39 additions & 0 deletions buildroot/tests/GD32F103RC_voxelab_maple
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
#
# Build tests for MKS Robin (HAL/STM32)
#

# exit on first failure
set -e

use_example_configs "Creality/Ender-3 V2 Neo/CrealityV422"
opt_set MOTHERBOARD BOARD_VOXELAB_AQUILA MULTIPLE_PROBING 2 Z_IDLE_HEIGHT Z_HOME_POS Z_CLEARANCE_FOR_HOMING 10 \
BLTOUCH_DELAY 200 BLTOUCH_HS_MODE true BOOTSCREEN_TIMEOUT 1100 SDSORT_GCODE true LCD_BACKLIGHT_TIMEOUT_MINS 10
opt_disable THERMAL_PROTECTION_CHAMBER THERMAL_PROTECTION_COOLER PROBING_TOOL AUTO_BED_LEVELING_BILINEAR DWIN_CREALITY_LCD \
SDCARD_RATHERRECENTFIRST SD_MENU_CONFIRM_START NO_SD_HOST_DRIVE
opt_enable PID_EDIT_MENU PID_AUTOTUNE_MENU S_CURVE_ACCELERATION Z_AFTER_PROBING \
Z_MIN_PROBE_REPEATABILITY_TEST AUTO_BED_LEVELING_UBL LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE \
EDITABLE_HOMING_FEEDRATE EEPROM_CHITCHAT HOST_KEEPALIVE_FEATURE NOZZLE_PARK_FEATURE PRINTCOUNTER \
REVERSE_ENCODER_DIRECTION INDIVIDUAL_AXIS_HOMING_SUBMENU DWIN_LCD_PROUI HOTEND_IDLE_TIMEOUT STATUS_MESSAGE_SCROLLING \
SET_PROGRESS_MANUALLY M73_REPORT SHOW_REMAINING_TIME NO_SD_AUTOSTART LONG_FILENAME_HOST_SUPPORT LONG_FILENAME_WRITE_SUPPORT \
AUTO_REPORT_SD_STATUS BABYSTEP_WITHOUT_HOMING BABYSTEP_ALWAYS_AVAILABLE BABYSTEP_ZPROBE_OFFSET LIN_ADVANCE NONLINEAR_EXTRUSION \
ARC_P_CIRCLES EMERGENCY_PARSER ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE FILAMENT_LOAD_UNLOAD_GCODES
# opt_add
exec_test $1 $2 "Voxelab Aquila - ProUI (UBL)" "$3"

use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI"
opt_set MOTHERBOARD BOARD_VOXELAB_AQUILA BLTOUCH_DELAY 200 BLTOUCH_HS_MODE true BOOTSCREEN_TIMEOUT 1100 \
SDSORT_GCODE true LCD_BACKLIGHT_TIMEOUT_MINS 10
opt_disable THERMAL_PROTECTION_CHAMBER THERMAL_PROTECTION_COOLER PROBING_TOOL DWIN_CREALITY_LCD SDCARD_RATHERRECENTFIRST \
SD_MENU_CONFIRM_START NO_SD_HOST_DRIVE
opt_enable PID_EDIT_MENU PID_AUTOTUNE_MENU S_CURVE_ACCELERATION PROBE_MANUALLY MESH_BED_LEVELING LCD_BED_TRAMMING \
EDITABLE_HOMING_FEEDRATE EEPROM_CHITCHAT EEPROM_INIT_NOW HOST_KEEPALIVE_FEATURE NOZZLE_PARK_FEATURE PRINTCOUNTER \
REVERSE_ENCODER_DIRECTION INDIVIDUAL_AXIS_HOMING_SUBMENU DWIN_LCD_PROUI HOTEND_IDLE_TIMEOUT STATUS_MESSAGE_SCROLLING \
SET_PROGRESS_MANUALLY M73_REPORT SHOW_REMAINING_TIME NO_SD_AUTOSTART LONG_FILENAME_HOST_SUPPORT LONG_FILENAME_WRITE_SUPPORT \
AUTO_REPORT_SD_STATUS BABYSTEP_WITHOUT_HOMING BABYSTEP_ALWAYS_AVAILABLE LIN_ADVANCE NONLINEAR_EXTRUSION ARC_P_CIRCLES \
EMERGENCY_PARSER ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE FILAMENT_LOAD_UNLOAD_GCODES
# opt_add
exec_test $1 $2 "Voxelab Aquila - ProUI (Manual Mesh)" "$3"

# cleanup
restore_configs
4 changes: 4 additions & 0 deletions ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ board_build.ldscript = crealityPro.ld
#
[env:GD32F103RC_voxelab_maple]
extends = env:STM32F103RC_maple
platform = ststm32@~19.1.0
platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
board_build.address = 0x08007000
board_build.ldscript = creality256k.ld
Expand All @@ -165,6 +167,8 @@ upload_protocol = jlink

[env:N32G455RE_voxelab_maple]
extends = env:STM32F103RE_maple
platform = ststm32@~19.1.0
platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
build_flags = ${env:STM32F103RE_maple.build_flags} -DTEMP_TIMER_CHAN=4
-DVOXELAB_N32 -DSDCARD_FLASH_LIMIT_256K
board_build.address = 0x08007000
Expand Down
Loading