Merge pull request #4584 from thinkyhead/rc_delta_cal_more

Use configured feedrates, center in DELTA_CALIBRATION_MENU
This commit is contained in:
Scott Lahteine 2016-08-11 14:04:05 -07:00 committed by GitHub
commit d6a7ca6553
4 changed files with 17 additions and 15 deletions

View File

@ -79,7 +79,7 @@
#endif #endif
#else #else
#if ENABLED(DELTA) #if ENABLED(DELTA)
#define X_HOME_POS ((X_MAX_LENGTH) * 0.5) #define X_HOME_POS (X_MIN_POS + (X_MAX_LENGTH) * 0.5)
#else #else
#define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS) #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
#endif #endif
@ -95,7 +95,7 @@
#endif #endif
#else #else
#if ENABLED(DELTA) #if ENABLED(DELTA)
#define Y_HOME_POS ((Y_MAX_LENGTH) * 0.5) #define Y_HOME_POS (Y_MIN_POS + (Y_MAX_LENGTH) * 0.5)
#else #else
#define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS) #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
#endif #endif

View File

@ -390,9 +390,9 @@ void calculate_volumetric_multipliers();
/** /**
* Blocking movement and shorthand functions * Blocking movement and shorthand functions
*/ */
inline void do_blocking_move_to(float x, float y, float z, float fr_mm_s=0.0); void do_blocking_move_to(const float &x, const float &y, const float &z, const float &fr_mm_s=0.0);
inline void do_blocking_move_to_x(float x, float fr_mm_s=0.0); void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0);
inline void do_blocking_move_to_z(float z, float fr_mm_s=0.0); void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0);
inline void do_blocking_move_to_xy(float x, float y, float fr_mm_s=0.0); void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0);
#endif //MARLIN_H #endif //MARLIN_H

View File

@ -1673,7 +1673,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
* Plan a move to (X, Y, Z) and set the current_position * Plan a move to (X, Y, Z) and set the current_position
* The final current_position may not be the one that was requested * The final current_position may not be the one that was requested
*/ */
void do_blocking_move_to(float x, float y, float z, float fr_mm_s /*=0.0*/) { void do_blocking_move_to(const float &x, const float &y, const float &z, const float &fr_mm_s /*=0.0*/) {
float old_feedrate_mm_s = feedrate_mm_s; float old_feedrate_mm_s = feedrate_mm_s;
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
@ -1765,13 +1765,13 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_s /*=0.0*/) {
feedrate_mm_s = old_feedrate_mm_s; feedrate_mm_s = old_feedrate_mm_s;
} }
void do_blocking_move_to_x(float x, float fr_mm_s/*=0.0*/) { void do_blocking_move_to_x(const float &x, const float &fr_mm_s/*=0.0*/) {
do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s); do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s);
} }
void do_blocking_move_to_z(float z, float fr_mm_s/*=0.0*/) { void do_blocking_move_to_z(const float &z, const float &fr_mm_s/*=0.0*/) {
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_s); do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_s);
} }
void do_blocking_move_to_xy(float x, float y, float fr_mm_s/*=0.0*/) { void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s/*=0.0*/) {
do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_s); do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_s);
} }

View File

@ -1261,15 +1261,17 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(DELTA_CALIBRATION_MENU) #if ENABLED(DELTA_CALIBRATION_MENU)
static void _goto_tower_pos(const float &a) { static void _goto_tower_pos(const float &a) {
char cmd[26]; do_blocking_move_to(
sprintf_P(cmd, PSTR("G1 F4000 X%i Y%i"), int(-(DELTA_PRINTABLE_RADIUS) * sin(a)), int((DELTA_PRINTABLE_RADIUS) * cos(a))); a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS),
enqueue_and_echo_commands_P(PSTR("G1 F8000 Z4")); a < 0 ? Y_HOME_POS : cos(a) * (DELTA_PRINTABLE_RADIUS),
enqueue_and_echo_command(cmd); 4
);
} }
static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); } static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); } static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
static void _goto_tower_z() { _goto_tower_pos(0); } static void _goto_tower_z() { _goto_tower_pos(0); }
static void _goto_center() { _goto_tower_pos(-1); }
static void lcd_delta_calibrate_menu() { static void lcd_delta_calibrate_menu() {
START_MENU(); START_MENU();
@ -1278,7 +1280,7 @@ void kill_screen(const char* lcd_msg) {
MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x); MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y); MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z); MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G1 F8000 Z4\nG1 F4000 X0 Y0")); MENU_ITEM(function, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
END_MENU(); END_MENU();
} }