Skip to content

Commit

Permalink
✨ XY_AFTER_HOMING, EVENT_GCODE_AFTER_HOMING (#26469)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
mikemerryguy and thinkyhead committed Nov 28, 2023
1 parent dabcd65 commit f4228cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1758,10 +1758,13 @@
*/
//#define Z_IDLE_HEIGHT Z_HOME_POS

//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.
//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
// You'll need this much clearance above Z_MAX_POS to avoid grinding.

//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed)
//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed)
//#define XY_AFTER_HOMING { 10, 10 } // (mm) Move to an XY position after homing (and raising Z)

//#define EVENT_GCODE_AFTER_HOMING "M300 P440 S200" // Commands to run after G28 (and move to XY_AFTER_HOMING)

// Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
Expand Down Expand Up @@ -2246,8 +2249,8 @@
//#define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing
#define Z_SAFE_HOMING_X_POINT X_CENTER // (mm) X point for Z homing
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // (mm) Y point for Z homing
//#define Z_SAFE_HOMING_POINT_ABSOLUTE // Ignore home offsets (M206) for Z homing position
#endif

Expand Down
9 changes: 9 additions & 0 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ void GcodeSuite::G28() {
tool_change(old_tool_index, TERN(PARKING_EXTRUDER, !pe_final_change_must_unpark, DISABLED(DUAL_X_CARRIAGE))); // Do move if one of these
#endif

#ifdef XY_AFTER_HOMING

This comment has been minimized.

Copy link
@classicrocker883

classicrocker883 Nov 29, 2023

Contributor

is there anything called XY_AFTER_HOMING? maybe Z_?

This comment has been minimized.

Copy link
@thisiskeithb

thisiskeithb Nov 29, 2023

Member

is there anything called XY_AFTER_HOMING? maybe Z_?

@classicrocker883: Yes. Scroll up. It's a new feature:

//#define XY_AFTER_HOMING { 10, 10 } // (mm) Move to an XY position after homing (and raising Z)

constexpr xy_pos_t xy_after XY_AFTER_HOMING;
do_blocking_move_to(xy_after);
#endif

restore_feedrate_and_scaling();

if (ENABLED(NANODLP_Z_SYNC) && (ENABLED(NANODLP_ALL_AXIS) || TERN0(HAS_Z_AXIS, doZ)))
Expand All @@ -654,4 +659,8 @@ void GcodeSuite::G28() {

TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(old_grblstate));

#ifdef EVENT_GCODE_AFTER_HOMING
gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_HOMING));
#endif

}
1 change: 1 addition & 0 deletions buildroot/tests/mega2560
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO MIXING_STEPPERS 5 LCD_LANGUAGE ru \
FIL_RUNOUT2_PIN 16 FIL_RUNOUT3_PIN 17 FIL_RUNOUT4_PIN 4 FIL_RUNOUT5_PIN 5
opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY \
USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_IGNORE_Z \
XY_AFTER_HOMING EVENT_GCODE_AFTER_HOMING \
FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE INPUT_SHAPING_X INPUT_SHAPING_Y
opt_disable DISABLE_OTHER_EXTRUDERS
exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Input Shaping | Greek" "$3"
Expand Down

0 comments on commit f4228cc

Please sign in to comment.