Quellcode durchsuchen

Add Planner::sync_from_steppers

Use to sync the planner after an interrupted move (when not overriding
the logical position).
Scott Lahteine vor 8 Jahren
Ursprung
Commit
6b9bf8e8fe
3 geänderte Dateien mit 15 neuen und 3 gelöschten Zeilen
  1. 3
    3
      Marlin/Marlin_main.cpp
  2. 7
    0
      Marlin/planner.cpp
  3. 5
    0
      Marlin/planner.h

+ 3
- 3
Marlin/Marlin_main.cpp Datei anzeigen

1996
     // Clear endstop flags
1996
     // Clear endstop flags
1997
     endstops.hit_on_purpose();
1997
     endstops.hit_on_purpose();
1998
 
1998
 
1999
+    // Tell the planner where we actually are
2000
+    planner.sync_from_steppers();
2001
+
1999
     // Get Z where the steppers were interrupted
2002
     // Get Z where the steppers were interrupted
2000
     set_current_from_steppers_for_axis(Z_AXIS);
2003
     set_current_from_steppers_for_axis(Z_AXIS);
2001
 
2004
 
2002
-    // Tell the planner where we actually are
2003
-    SYNC_PLAN_POSITION_KINEMATIC();
2004
-
2005
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2005
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2006
       if (DEBUGGING(LEVELING)) DEBUG_POS("<<< do_probe_move", current_position);
2006
       if (DEBUGGING(LEVELING)) DEBUG_POS("<<< do_probe_move", current_position);
2007
     #endif
2007
     #endif

+ 7
- 0
Marlin/planner.cpp Datei anzeigen

1211
 }
1211
 }
1212
 
1212
 
1213
 /**
1213
 /**
1214
+ * Sync from the stepper positions. (e.g., after an interrupted move)
1215
+ */
1216
+void Planner::sync_from_steppers() {
1217
+  LOOP_XYZE(i) position[i] = stepper.position((AxisEnum)i);
1218
+}
1219
+
1220
+/**
1214
  * Directly set the planner E position (hence the stepper E position).
1221
  * Directly set the planner E position (hence the stepper E position).
1215
  */
1222
  */
1216
 void Planner::set_e_position_mm(const float& e) {
1223
 void Planner::set_e_position_mm(const float& e) {

+ 5
- 0
Marlin/planner.h Datei anzeigen

243
     static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float& e);
243
     static void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float& e);
244
 
244
 
245
     /**
245
     /**
246
+     * Sync from the stepper positions. (e.g., after an interrupted move)
247
+     */
248
+    static void sync_from_steppers();
249
+
250
+    /**
246
      * Set the E position (mm) of the planner (and the E stepper)
251
      * Set the E position (mm) of the planner (and the E stepper)
247
      */
252
      */
248
     static void set_e_position_mm(const float& e);
253
     static void set_e_position_mm(const float& e);

Laden…
Abbrechen
Speichern