Skip to content

Commit

Permalink
Additional logging of do_blocking_move_to
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and CONSULitAS committed Aug 18, 2016
1 parent 89907eb commit b40de31
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {
float old_feedrate_mm_m = feedrate_mm_m;

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), NULL, x, y, z);
if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, x, y, z);
#endif

#if ENABLED(DELTA)
Expand All @@ -1676,35 +1676,58 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {

set_destination_to_current(); // sync destination at the start

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("set_destination_to_current"), destination);
#endif

// when in the danger zone
if (current_position[Z_AXIS] > delta_clip_start_height) {
if (z > delta_clip_start_height) { // staying in the danger zone
destination[X_AXIS] = x; // move directly (uninterpolated)
destination[Y_AXIS] = y;
destination[Z_AXIS] = z;
prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("danger zone move"), current_position);
#endif
return;
}
else {
destination[Z_AXIS] = delta_clip_start_height;
prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("zone border move"), current_position);
#endif
}
}

if (z > current_position[Z_AXIS]) { // raising?
destination[Z_AXIS] = z;
prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("z raise move"), current_position);
#endif
}

destination[X_AXIS] = x;
destination[Y_AXIS] = y;
prepare_move_to_destination(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("xy move"), current_position);
#endif

if (z < current_position[Z_AXIS]) { // lowering?
destination[Z_AXIS] = z;
prepare_move_to_destination_raw(); // set_current_to_destination
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS(PSTR("z lower move"), current_position);
#endif
}

#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to");
#endif

#else

// If Z needs to raise, do it before moving XY
Expand Down

0 comments on commit b40de31

Please sign in to comment.