Skip to content

Commit

Permalink
more general option
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 28, 2023
1 parent e1286fe commit 7f169e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 4 additions & 7 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,8 @@

//#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)

// Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
#define X_HOME_DIR -1
Expand Down Expand Up @@ -2246,14 +2248,9 @@
//#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
//#define MOVE_TO_CUSTOM_XY_POINT // Move nozzle to custom X/Y position after homing Z
#if ENABLED(MOVE_TO_CUSTOM_XY_POINT)
//#define CUSTOM_POS_X_POINT 0
//#define CUSTOM_POS_Y_POINT 0
#endif
#endif

// Homing speeds (linear=mm/min, rotational=°/min)
Expand Down
8 changes: 5 additions & 3 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@

do_blocking_move_to_xy(destination);
homeaxis(Z_AXIS);
#ifdef MOVE_TO_CUSTOM_XY_POINT
do_blocking_move_to_xy(CUSTOM_POS_X_POINT, CUSTOM_POS_Y_POINT);
#endif
}
else {
LCD_MESSAGE(MSG_ZPROBE_OUT);
Expand Down Expand Up @@ -641,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
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 Down

0 comments on commit 7f169e9

Please sign in to comment.