Browse Source

Add Planner::sync_from_steppers

Use to sync the planner after an interrupted move (when not overriding
the logical position).
pull/1/head
Scott Lahteine 8 years ago
parent
commit
6b9bf8e8fe
  1. 6
      Marlin/Marlin_main.cpp
  2. 7
      Marlin/planner.cpp
  3. 5
      Marlin/planner.h

6
Marlin/Marlin_main.cpp

@ -1996,12 +1996,12 @@ static void clean_up_after_endstop_or_probe_move() {
// Clear endstop flags
endstops.hit_on_purpose();
// Tell the planner where we actually are
planner.sync_from_steppers();
// Get Z where the steppers were interrupted
set_current_from_steppers_for_axis(Z_AXIS);
// Tell the planner where we actually are
SYNC_PLAN_POSITION_KINEMATIC();
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("<<< do_probe_move", current_position);
#endif

7
Marlin/planner.cpp

@ -1210,6 +1210,13 @@ void Planner::set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
LOOP_XYZE(i) previous_speed[i] = 0.0;
}
/**
* Sync from the stepper positions. (e.g., after an interrupted move)
*/
void Planner::sync_from_steppers() {
LOOP_XYZE(i) position[i] = stepper.position((AxisEnum)i);
}
/**
* Directly set the planner E position (hence the stepper E position).
*/

5
Marlin/planner.h

@ -242,6 +242,11 @@ class Planner {
*/
static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float& e);
/**
* Sync from the stepper positions. (e.g., after an interrupted move)
*/
static void sync_from_steppers();
/**
* Set the E position (mm) of the planner (and the E stepper)
*/

Loading…
Cancel
Save