From 98ca46006c1c94680d8376ba9c63aab17c366c35 Mon Sep 17 00:00:00 2001 From: Steve Kelly Date: Wed, 22 Apr 2015 16:34:55 -0400 Subject: [PATCH] Allow Y to home before X with option in Configuration_adv.h. This addresses comments in #1956 and #1079. In particular, this is useful when both endstops are stationary on a CoreXY system, and the Y axis needs to be homed before the X so the flags are aligned. --- Marlin/Configuration_adv.h | 3 +++ Marlin/Marlin_main.cpp | 11 +++++++++-- Marlin/configurator/config/Configuration_adv.h | 3 +++ .../example_configurations/Felix/Configuration_adv.h | 3 +++ .../Hephestos/Configuration_adv.h | 3 +++ .../example_configurations/K8200/Configuration_adv.h | 3 +++ .../example_configurations/SCARA/Configuration_adv.h | 3 +++ .../example_configurations/WITBOX/Configuration_adv.h | 3 +++ .../delta/generic/Configuration_adv.h | 3 +++ .../delta/kossel_mini/Configuration_adv.h | 3 +++ .../makibox/Configuration_adv.h | 3 +++ .../tvrrug/Round2/Configuration_adv.h | 3 +++ 12 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6478eb923e..bdf856e7ed 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 64d3d1f350..eba95e21b5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1924,6 +1924,11 @@ inline void gcode_G28() { #endif // QUICK_HOME + #ifdef HOME_Y_BEFORE_X + // Home Y + if (home_all_axis || homeY) HOMEAXIS(Y); + #endif + // Home X if (home_all_axis || homeX) { #ifdef DUAL_X_CARRIAGE @@ -1943,8 +1948,10 @@ inline void gcode_G28() { #endif } - // Home Y - if (home_all_axis || homeY) HOMEAXIS(Y); + #ifndef HOME_Y_BEFORE_X + // Home Y + if (home_all_axis || homeY) HOMEAXIS(Y); + #endif // Set the X position, if included if (code_seen(axis_codes[X_AXIS]) && code_has_value()) diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index 6478eb923e..bdf856e7ed 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index a80790b957..17649a9b3f 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 84536d044e..d9cd7c468a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index a80790b957..17649a9b3f 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index edc2445af6..c97b03f710 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 15c5232848..a37f9edf5b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 88b76c66e1..33969ba4c5 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 9b52ede7b7..34426b81d1 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 7b63732a69..85a8eef803 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index d221f080b4..4276d9aebf 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -195,6 +195,9 @@ #define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +// When G28 is called, this option will make Y home before X +// #define HOME_Y_BEFORE_X + // @section machine #define AXIS_RELATIVE_MODES {false, false, false, false}