diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index bb17924a643cb143d0628ca5be90239ca4ce0c6b..1903104bf87e66a651330154211d8d4d8c4663d1 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 debd9f0d0fba097c7efdbb9f541e235d0be25470..691fc3563eb96a16949a9788cb4a39085fabe9ad 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 464a298bc31c578e377522f18cf3fab3e5cf1d6b..80fdefbfb878e87f3bbefaf470c678f3f27e9231 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 c4e3b22f44ceb71699efbe36f497f5072d3e0b92..97c9b03b290bc5d6806f1643f038e5e183fd8ec1 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 5ed1b403ad410f7d0357da158a41e21c585d65e5..636c126ad9a6778eaa5172395eb5ea52d4717cd5 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 493bb464c3896a529be68440bd910c21439d176f..baa03581dc7d296479af410efcc2b42fd2cebf7b 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 18ee6d85a54cef4ecb294e066423688591049759..1d5d68de29b53caca727fdc54593321cddb0fe3c 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 d1dfbd2e97a4079151713f817553203b11b96588..137b2ab53dd30ad961f6ecb83a52f31dd2c6d314 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 d097fdad80fcc5e7bee614d65463c34b227a97e1..e6f33205e8ef2b44ec20b9759a0929d4bb1b7975 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 e36317b6c65fd0e104af3ec553189a1282ac1607..2a2b421ed15a4a60b8b16f6de85bb21c91901908 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 5ed1b403ad410f7d0357da158a41e21c585d65e5..636c126ad9a6778eaa5172395eb5ea52d4717cd5 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 ba5bbfbe8aa70343529163083020fcb9c1222f2e..8fcb3cdd227fff71ad187213f1cc6299bbfb1e4c 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 8990a269e9a50fb74561cdb2747b12df755ccba1..996a38017edb6b403e2e893a23b23e698c0a34ea 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 e6f0d753dd79efb76b5915afbc03ddc7a3798a6f..5be02da9d7ba08f77e88ab6c5353f97d40ddfac8 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 d0eb1fcd4a6a382d17fb2ff81d2b4f8916254b22..d5c126150c0e80e28900977d31b4db320609eb9d 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 18d4589968c076686bb59d5aadb42c1b1315d9c5..87c97a0b9a401e882a7cc51a850979991a7564a8 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 96861bc7493aa2cc29335833c477990c0ac6328e..7da39798d83e96cb497c1659cb95ce1f7de24a25 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 0f56db994058732d6069c4b3d3eba9f55fe0858d..a35bbe1f4aa195cce6b680775e04c99291a2c36a 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 72ee0dfa9e8df32b137cebc0fe1693915d212880..9806b8cbb126eb43bb3bff0c0923cf1ad6367a35 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 6f9fce382e059c619514beaf291b389af2ca8158..e08dc9322d7f096c6f63ea053b841bd8d7859b3f 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