diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index bb17924a64..1903104bf8 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -268,6 +268,17 @@ #define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS)) #define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS)) + /** + * CoreXY and CoreXZ + */ + #if ENABLED(COREXY) + #define CORE_AXIS_2 B_AXIS + #define CORE_AXIS_3 Z_AXIS + #elif ENABLED(COREXZ) + #define CORE_AXIS_2 C_AXIS + #define CORE_AXIS_3 Y_AXIS + #endif + /** * SCARA */ diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index debd9f0d0f..691fc3563e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 464a298bc3..80fdefbfb8 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -32,9 +32,6 @@ * Babystepping */ #if ENABLED(BABYSTEPPING) - #if ENABLED(COREXY) && ENABLED(BABYSTEP_XY) - #error BABYSTEPPING only implemented for Z axis on CoreXY. - #endif #if ENABLED(SCARA) #error BABYSTEPPING is not implemented for SCARA yet. #endif diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index c4e3b22f44..97c9b03b29 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 5ed1b403ad..636c126ad9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 493bb464c3..baa03581dc 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 18ee6d85a5..1d5d68de29 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -375,7 +375,7 @@ #define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index d1dfbd2e97..137b2ab53d 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index d097fdad80..e6f33205e8 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index e36317b6c6..2a2b421ed1 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -378,7 +378,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 5ed1b403ad..636c126ad9 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index ba5bbfbe8a..8fcb3cdd22 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -372,7 +372,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 8990a269e9..996a38017e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -372,7 +372,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index e6f0d753dd..5be02da9d7 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -371,7 +371,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index d0eb1fcd4a..d5c126150c 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -375,7 +375,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 18d4589968..87c97a0b9a 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 96861bc749..7da39798d8 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 0f56db9940..a35bbe1f4a 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -370,7 +370,7 @@ //#define BABYSTEPPING #if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions - //not implemented for CoreXY and deltabots! + //not implemented for deltabots! #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_MULTIPLICATOR 1 //faster movements #endif diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 72ee0dfa9e..9806b8cbb1 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -289,12 +289,6 @@ void checkHitEndstops() { } } -#if ENABLED(COREXY) - #define CORE_AXIS_2 B_AXIS -#elif ENABLED(COREXZ) - #define CORE_AXIS_2 C_AXIS -#endif - void enable_endstops(bool check) { check_endstops = check; } // Check endstops - Called from ISR! diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 6f9fce382e..e08dc9322d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -483,21 +483,47 @@ void lcd_set_home_offsets() { lcd_return_to_status(); } - #if ENABLED(BABYSTEPPING) - static void _lcd_babystep(int axis, const char* msg) { + static void _lcd_babystep(const int axis, const char* msg) { ENCODER_DIRECTION_NORMAL(); if (encoderPosition != 0) { - babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition; encoderPosition = 0; lcdDrawUpdate = 1; + int distance = (int)encoderPosition * BABYSTEP_MULTIPLICATOR; + #if ENABLED(COREXY) || ENABLED(COREXZ) + #if ENABLED(BABYSTEP_XY) + switch(axis) { + case X_AXIS: // X on CoreXY and CoreXZ + babystepsTodo[A_AXIS] += distance * 2; + babystepsTodo[CORE_AXIS_2] += distance * 2; + break; + case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ + babystepsTodo[A_AXIS] += distance * 2; + babystepsTodo[CORE_AXIS_2] -= distance * 2; + break; + case CORE_AXIS_3: // Z on CoreXY, Y on CoreXZ + babystepsTodo[CORE_AXIS_3] += distance; + break; + } + #elif ENABLED(COREXZ) + babystepsTodo[A_AXIS] += distance * 2; + babystepsTodo[C_AXIS] -= distance * 2; + #else + babystepsTodo[Z_AXIS] += distance; + #endif + #else + babystepsTodo[axis] += distance; + #endif } if (lcdDrawUpdate) lcd_implementation_drawedit(msg, (char*)""); if (LCD_CLICKED) lcd_goto_previous_menu(); } - static void lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } - static void lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); } + + #if ENABLED(BABYSTEP_XY) + static void lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } + static void lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); } + #endif static void lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); } #endif //BABYSTEPPING