Option to set manual Babystepping distance in mm (#18503)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
cbteeple 2020-07-03 10:24:41 -04:00 committed by GitHub
parent 097347b575
commit 2c15a787c7
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View file

@ -1553,8 +1553,9 @@
//#define BABYSTEP_WITHOUT_HOMING
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
#define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way
#define BABYSTEP_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion.
#define BABYSTEP_MULTIPLICATOR_XY 1
//#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
#define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep
//#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)

View file

@ -343,7 +343,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
ui.defer_status_screen();
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
if (ui.encoderPosition) {
const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR_Z);
const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_SIZE_Z);
ui.encoderPosition = 0;
const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,

View file

@ -587,6 +587,17 @@ void _lcd_draw_homing();
#else
void lcd_babystep_z();
#endif
#if ENABLED(BABYSTEP_MILLIMETER_UNITS)
#define BABYSTEP_SIZE_X int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[X_AXIS])
#define BABYSTEP_SIZE_Y int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[Y_AXIS])
#define BABYSTEP_SIZE_Z int32_t((BABYSTEP_MULTIPLICATOR_Z) * planner.settings.axis_steps_per_mm[Z_AXIS])
#else
#define BABYSTEP_SIZE_X BABYSTEP_MULTIPLICATOR_XY
#define BABYSTEP_SIZE_Y BABYSTEP_MULTIPLICATOR_XY
#define BABYSTEP_SIZE_Z BABYSTEP_MULTIPLICATOR_Z
#endif
#endif
#if ENABLED(POWER_LOSS_RECOVERY)

View file

@ -55,9 +55,10 @@
if (ui.encoderPosition) {
const int16_t steps = int16_t(ui.encoderPosition) * (
#if ENABLED(BABYSTEP_XY)
axis != Z_AXIS ? BABYSTEP_MULTIPLICATOR_XY :
axis == X_AXIS ? BABYSTEP_SIZE_X :
axis == Y_AXIS ? BABYSTEP_SIZE_Y :
#endif
BABYSTEP_MULTIPLICATOR_Z
BABYSTEP_SIZE_Z
);
ui.encoderPosition = 0;
ui.refresh(LCDVIEW_REDRAW_NOW);