|
|
@ -1624,86 +1624,86 @@ static void clean_up_after_endstop_or_probe_move() {
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Calculate delta, start a line, and set current_position to destination
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void prepare_move_to_destination_raw() {
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
|
|
|
|
calculate_delta(destination);
|
|
|
|
|
|
|
|
planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
|
|
|
|
|
|
|
|
set_current_to_destination();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Plan a move to (X, Y, Z) and set the current_position
|
|
|
|
* Calculate delta, start a line, and set current_position to destination
|
|
|
|
* The final current_position may not be the one that was requested
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) {
|
|
|
|
void prepare_move_to_destination_raw() {
|
|
|
|
float old_feedrate = feedrate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
|
|
|
|
calculate_delta(destination);
|
|
|
|
|
|
|
|
planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
|
|
|
|
|
|
|
|
set_current_to_destination();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Plan a move to (X, Y, Z) and set the current_position
|
|
|
|
|
|
|
|
* The final current_position may not be the one that was requested
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) {
|
|
|
|
|
|
|
|
float old_feedrate = feedrate;
|
|
|
|
|
|
|
|
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
|
|
|
|
if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
destination[X_AXIS] = x;
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
destination[Y_AXIS] = y;
|
|
|
|
|
|
|
|
destination[Z_AXIS] = z;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
|
|
|
prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
prepare_move_to_destination(); // this will also set_current_to_destination
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
destination[X_AXIS] = x;
|
|
|
|
|
|
|
|
destination[Y_AXIS] = y;
|
|
|
|
|
|
|
|
destination[Z_AXIS] = z;
|
|
|
|
|
|
|
|
|
|
|
|
// If Z needs to raise, do it before moving XY
|
|
|
|
if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
|
|
|
|
if (current_position[Z_AXIS] < z) {
|
|
|
|
prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
|
|
|
else
|
|
|
|
current_position[Z_AXIS] = z;
|
|
|
|
prepare_move_to_destination(); // this will also set_current_to_destination
|
|
|
|
line_to_current_position();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
|
|
|
#else
|
|
|
|
current_position[X_AXIS] = x;
|
|
|
|
|
|
|
|
current_position[Y_AXIS] = y;
|
|
|
|
// If Z needs to raise, do it before moving XY
|
|
|
|
|
|
|
|
if (current_position[Z_AXIS] < z) {
|
|
|
|
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
|
|
|
|
|
|
|
current_position[Z_AXIS] = z;
|
|
|
|
line_to_current_position();
|
|
|
|
line_to_current_position();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If Z needs to lower, do it after moving XY
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
|
|
|
if (current_position[Z_AXIS] > z) {
|
|
|
|
current_position[X_AXIS] = x;
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
|
|
|
current_position[Y_AXIS] = y;
|
|
|
|
current_position[Z_AXIS] = z;
|
|
|
|
line_to_current_position();
|
|
|
|
line_to_current_position();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// If Z needs to lower, do it after moving XY
|
|
|
|
|
|
|
|
if (current_position[Z_AXIS] > z) {
|
|
|
|
|
|
|
|
feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
|
|
|
|
|
|
|
current_position[Z_AXIS] = z;
|
|
|
|
|
|
|
|
line_to_current_position();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
stepper.synchronize();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
feedrate = old_feedrate;
|
|
|
|
stepper.synchronize();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) {
|
|
|
|
feedrate = old_feedrate;
|
|
|
|
do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void do_blocking_move_to_y(float y) {
|
|
|
|
inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) {
|
|
|
|
do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]);
|
|
|
|
do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
|
|
|
|
inline void do_blocking_move_to_y(float y) {
|
|
|
|
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
|
|
|
|
do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
|
|
|
|
|
|
|
|
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Raise Z to a minimum height to make room for a probe to move
|
|
|
|
* Raise Z to a minimum height to make room for a probe to move
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|