Browse Source

Merge pull request #3127 from thinkyhead/rc_core_babystepping

Implement BABYSTEPPING for COREXY and COREXZ
pull/1/head
Scott Lahteine 9 years ago
parent
commit
9bf87aac6a
  1. 11
      Marlin/Conditionals.h
  2. 2
      Marlin/Configuration_adv.h
  3. 4
      Marlin/SanityCheck.h
  4. 2
      Marlin/example_configurations/Felix/Configuration_adv.h
  5. 2
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  6. 2
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  7. 2
      Marlin/example_configurations/K8200/Configuration_adv.h
  8. 2
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  9. 2
      Marlin/example_configurations/SCARA/Configuration_adv.h
  10. 2
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  11. 2
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  12. 2
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  13. 2
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  14. 2
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  15. 2
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  16. 2
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  17. 2
      Marlin/example_configurations/makibox/Configuration_adv.h
  18. 2
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  19. 6
      Marlin/stepper.cpp
  20. 32
      Marlin/ultralcd.cpp

11
Marlin/Conditionals.h

@ -268,6 +268,17 @@
#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS)) #define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_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 * SCARA
*/ */

2
Marlin/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

4
Marlin/SanityCheck.h

@ -32,8 +32,8 @@
* Babystepping * Babystepping
*/ */
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#if ENABLED(COREXY) && ENABLED(BABYSTEP_XY) #if DISABLED(ULTRA_LCD)
#error BABYSTEPPING only implemented for Z axis on CoreXY. #error BABYSTEPPING requires an LCD controller.
#endif #endif
#if ENABLED(SCARA) #if ENABLED(SCARA)
#error BABYSTEPPING is not implemented for SCARA yet. #error BABYSTEPPING is not implemented for SCARA yet.

2
Marlin/example_configurations/Felix/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/Hephestos/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/Hephestos_2/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/K8200/Configuration_adv.h

@ -375,7 +375,7 @@
#define BABYSTEPPING #define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/RigidBot/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/SCARA/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/TAZ4/Configuration_adv.h

@ -378,7 +378,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/WITBOX/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h

@ -372,7 +372,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/delta/generic/Configuration_adv.h

@ -372,7 +372,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h

@ -371,7 +371,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h

@ -375,7 +375,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/makibox/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

2
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

@ -370,7 +370,7 @@
//#define BABYSTEPPING //#define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_MULTIPLICATOR 1 //faster movements #define BABYSTEP_MULTIPLICATOR 1 //faster movements
#endif #endif

6
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; } void enable_endstops(bool check) { check_endstops = check; }
// Check endstops - Called from ISR! // Check endstops - Called from ISR!

32
Marlin/ultralcd.cpp

@ -483,21 +483,47 @@ void lcd_set_home_offsets() {
lcd_return_to_status(); lcd_return_to_status();
} }
#if ENABLED(BABYSTEPPING) #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(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition != 0) { if (encoderPosition != 0) {
babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition;
encoderPosition = 0; encoderPosition = 0;
lcdDrawUpdate = 1; 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 (lcdDrawUpdate) lcd_implementation_drawedit(msg, (char*)"");
if (LCD_CLICKED) lcd_goto_previous_menu(); if (LCD_CLICKED) lcd_goto_previous_menu();
} }
#if ENABLED(BABYSTEP_XY)
static void lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } 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)); } 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)); } static void lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
#endif //BABYSTEPPING #endif //BABYSTEPPING

Loading…
Cancel
Save