Add 'blocking move' comments

This commit is contained in:
Scott Lahteine 2021-04-12 20:15:41 -05:00 committed by Scott Lahteine
parent fb7bdabb70
commit 49fba5a82a

View file

@ -367,12 +367,13 @@ void _internal_move_to_destination(const_feedRate_t fr_mm_s/*=0.0f*/
planner.e_factor[active_extruder] = 1.0f; planner.e_factor[active_extruder] = 1.0f;
#endif #endif
#if IS_KINEMATIC #if !IS_KINEMATIC
if (is_fast) constexpr bool is_fast = false;
prepare_fast_move_to_destination();
else
#endif #endif
prepare_line_to_destination(); if (is_fast)
prepare_fast_move_to_destination();
else
prepare_line_to_destination();
feedrate_mm_s = old_feedrate; feedrate_mm_s = old_feedrate;
feedrate_percentage = old_pct; feedrate_percentage = old_pct;
@ -382,7 +383,12 @@ void _internal_move_to_destination(const_feedRate_t fr_mm_s/*=0.0f*/
} }
/** /**
* Plan a move to (X, Y, Z) and set the current_position * Plan a move to (X, Y, Z) with separation of the XY and Z components.
*
* - If Z is moving up, the Z move is done before XY.
* - If Z is moving down, the Z move is done after XY.
* - Delta may lower Z first to get into the free motion zone.
* - Before returning, wait for the planner buffer to empty.
*/ */
void do_blocking_move_to(const float rx, const float ry, const float rz, const_feedRate_t fr_mm_s/*=0.0*/) { void do_blocking_move_to(const float rx, const float ry, const float rz, const_feedRate_t fr_mm_s/*=0.0*/) {
DEBUG_SECTION(log_move, "do_blocking_move_to", DEBUGGING(LEVELING)); DEBUG_SECTION(log_move, "do_blocking_move_to", DEBUGGING(LEVELING));
@ -391,20 +397,21 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const_f
const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS), const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS),
xy_feedrate = fr_mm_s ?: feedRate_t(XY_PROBE_FEEDRATE_MM_S); xy_feedrate = fr_mm_s ?: feedRate_t(XY_PROBE_FEEDRATE_MM_S);
#if EITHER(DELTA, IS_SCARA)
if (!position_is_reachable(rx, ry)) return;
destination = current_position; // sync destination at the start
#endif
#if ENABLED(DELTA) #if ENABLED(DELTA)
if (!position_is_reachable(rx, ry)) return;
REMEMBER(fr, feedrate_mm_s, xy_feedrate); REMEMBER(fr, feedrate_mm_s, xy_feedrate);
destination = current_position; // sync destination at the start
if (DEBUGGING(LEVELING)) DEBUG_POS("destination = current_position", destination); if (DEBUGGING(LEVELING)) DEBUG_POS("destination = current_position", destination);
// when in the danger zone // when in the danger zone
if (current_position.z > delta_clip_start_height) { if (current_position.z > delta_clip_start_height) {
if (rz > delta_clip_start_height) { // staying in the danger zone if (rz > delta_clip_start_height) { // staying in the danger zone
destination.set(rx, ry, rz); // move directly (uninterpolated) destination.set(rx, ry, rz); // move directly (uninterpolated)
prepare_internal_fast_move_to_destination(); // set current_position from destination prepare_internal_fast_move_to_destination(); // set current_position from destination
if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
return; return;
@ -432,10 +439,6 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const_f
#elif IS_SCARA #elif IS_SCARA
if (!position_is_reachable(rx, ry)) return;
destination = current_position;
// If Z needs to raise, do it before moving XY // If Z needs to raise, do it before moving XY
if (destination.z < rz) { if (destination.z < rz) {
destination.z = rz; destination.z = rz;