Procházet zdrojové kódy

Merge pull request #8343 from thinkyhead/bf2_movement_fixes

[2.0] Fix PROBE_MANUALLY on kinematic bots
Scott Lahteine před 7 roky
rodič
revize
02e91ffa02
No account linked to committer's email address

+ 2
- 2
Marlin/src/feature/bedlevel/abl/abl.cpp Zobrazit soubor

@@ -377,7 +377,7 @@ float bilinear_z_offset(const float raw[XYZ]) {
377 377
 
378 378
     if (cx1 == cx2 && cy1 == cy2) {
379 379
       // Start and end on same mesh square
380
-      line_to_destination(fr_mm_s);
380
+      buffer_line_to_destination(fr_mm_s);
381 381
       set_current_from_destination();
382 382
       return;
383 383
     }
@@ -404,7 +404,7 @@ float bilinear_z_offset(const float raw[XYZ]) {
404 404
     }
405 405
     else {
406 406
       // Already split on a border
407
-      line_to_destination(fr_mm_s);
407
+      buffer_line_to_destination(fr_mm_s);
408 408
       set_current_from_destination();
409 409
       return;
410 410
     }

+ 7
- 14
Marlin/src/feature/bedlevel/bedlevel.cpp Zobrazit soubor

@@ -27,7 +27,7 @@
27 27
 #include "bedlevel.h"
28 28
 
29 29
 #if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY)
30
-  #include "../../module/stepper.h"
30
+  #include "../../module/motion.h"
31 31
 #endif
32 32
 
33 33
 #if PLANNER_LEVELING
@@ -257,27 +257,20 @@ void reset_bed_level() {
257 257
 #if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY)
258 258
 
259 259
   void _manual_goto_xy(const float &rx, const float &ry) {
260
-    const float old_feedrate_mm_s = feedrate_mm_s;
260
+
261 261
     #if MANUAL_PROBE_HEIGHT > 0
262 262
       const float prev_z = current_position[Z_AXIS];
263
-      feedrate_mm_s = homing_feedrate(Z_AXIS);
264
-      current_position[Z_AXIS] = MANUAL_PROBE_HEIGHT;
265
-      line_to_current_position();
263
+      do_blocking_move_to_z(MANUAL_PROBE_HEIGHT, homing_feedrate(Z_AXIS));
266 264
     #endif
267 265
 
268
-    feedrate_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
269
-    current_position[X_AXIS] = rx;
270
-    current_position[Y_AXIS] = ry;
271
-    line_to_current_position();
266
+    do_blocking_move_to_xy(rx, ry, MMM_TO_MMS(XY_PROBE_SPEED));
272 267
 
273 268
     #if MANUAL_PROBE_HEIGHT > 0
274
-      feedrate_mm_s = homing_feedrate(Z_AXIS);
275
-      current_position[Z_AXIS] = prev_z; // move back to the previous Z.
276
-      line_to_current_position();
269
+      do_blocking_move_to_z(prev_z, homing_feedrate(Z_AXIS));
277 270
     #endif
278 271
 
279
-    feedrate_mm_s = old_feedrate_mm_s;
280
-    stepper.synchronize();
272
+    current_position[X_AXIS] = rx;
273
+    current_position[Y_AXIS] = ry;
281 274
 
282 275
     #if ENABLED(PROBE_MANUALLY) && ENABLED(LCD_BED_LEVELING)
283 276
       lcd_wait_for_move = false;

+ 2
- 2
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp Zobrazit soubor

@@ -68,7 +68,7 @@
68 68
 
69 69
     if (cx1 == cx2 && cy1 == cy2) {
70 70
       // Start and end on same mesh square
71
-      line_to_destination(fr_mm_s);
71
+      buffer_line_to_destination(fr_mm_s);
72 72
       set_current_from_destination();
73 73
       return;
74 74
     }
@@ -95,7 +95,7 @@
95 95
     }
96 96
     else {
97 97
       // Already split on a border
98
-      line_to_destination(fr_mm_s);
98
+      buffer_line_to_destination(fr_mm_s);
99 99
       set_current_from_destination();
100 100
       return;
101 101
     }

+ 1
- 1
Marlin/src/feature/pause.cpp Zobrazit soubor

@@ -99,7 +99,7 @@ void do_pause_e_move(const float &length, const float fr) {
99 99
   #if IS_KINEMATIC
100 100
     planner.buffer_line_kinematic(destination, fr, active_extruder);
101 101
   #else
102
-    line_to_destination(fr);
102
+    buffer_line_to_destination(fr);
103 103
   #endif
104 104
   stepper.synchronize();
105 105
 }

+ 1
- 1
Marlin/src/gcode/bedlevel/mbl/G29.cpp Zobrazit soubor

@@ -48,7 +48,7 @@ void mesh_probing_done() {
48 48
   #if ENABLED(MESH_G28_REST_ORIGIN)
49 49
     current_position[Z_AXIS] = Z_MIN_POS;
50 50
     set_destination_from_current();
51
-    line_to_destination(homing_feedrate(Z_AXIS));
51
+    buffer_line_to_destination(homing_feedrate(Z_AXIS));
52 52
     stepper.synchronize();
53 53
   #endif
54 54
 }

+ 1
- 1
Marlin/src/inc/SanityCheck.h Zobrazit soubor

@@ -819,7 +819,7 @@ static_assert(1 >= 0
819 819
    */
820 820
 
821 821
   #if ENABLED(DELTA)
822
-    #error "MESH_BED_LEVELING does not yet support DELTA printers."
822
+    #error "MESH_BED_LEVELING is not compatible with DELTA printers."
823 823
   #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
824 824
     #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
825 825
   #endif

+ 6
- 6
Marlin/src/module/motion.cpp Zobrazit soubor

@@ -70,16 +70,16 @@ bool relative_mode = false;
70 70
 /**
71 71
  * Cartesian Current Position
72 72
  *   Used to track the native machine position as moves are queued.
73
- *   Used by 'line_to_current_position' to do a move after changing it.
73
+ *   Used by 'buffer_line_to_current_position' to do a move after changing it.
74 74
  *   Used by 'SYNC_PLAN_POSITION_KINEMATIC' to update 'planner.position'.
75 75
  */
76 76
 float current_position[XYZE] = { 0.0 };
77 77
 
78 78
 /**
79 79
  * Cartesian Destination
80
- *   A temporary position, usually applied to 'current_position'.
81
- *   Set with 'get_destination_from_command' or 'set_destination_from_current'.
82
- *   'line_to_destination' sets 'current_position' to 'destination'.
80
+ *   The destination for a move, filled in by G-code movement commands,
81
+ *   and expected by functions like 'prepare_move_to_destination'.
82
+ *   Set with 'gcode_get_destination' or 'set_destination_from_current'.
83 83
  */
84 84
 float destination[XYZE] = { 0.0 };
85 85
 
@@ -235,7 +235,7 @@ void line_to_current_position() {
235 235
  * Move the planner to the position stored in the destination array, which is
236 236
  * used by G0/G1/G2/G3/G5 and many other functions to set a destination.
237 237
  */
238
-void line_to_destination(const float fr_mm_s) {
238
+void buffer_line_to_destination(const float fr_mm_s) {
239 239
   planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], fr_mm_s, active_extruder);
240 240
 }
241 241
 
@@ -667,7 +667,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
667 667
       }
668 668
     #endif // HAS_MESH
669 669
 
670
-    line_to_destination(MMS_SCALED(feedrate_mm_s));
670
+    buffer_line_to_destination(MMS_SCALED(feedrate_mm_s));
671 671
     return false;
672 672
   }
673 673
 

+ 1
- 3
Marlin/src/module/motion.h Zobrazit soubor

@@ -138,9 +138,7 @@ void line_to_current_position();
138 138
  * Move the planner to the position stored in the destination array, which is
139 139
  * used by G0/G1/G2/G3/G5 and many other functions to set a destination.
140 140
  */
141
-void line_to_destination(const float fr_mm_s);
142
-
143
-inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
141
+void buffer_line_to_destination(const float fr_mm_s);
144 142
 
145 143
 #if IS_KINEMATIC
146 144
   void prepare_uninterpolated_move_to_destination(const float fr_mm_s=0.0);

+ 7
- 7
Marlin/src/module/planner.h Zobrazit soubor

@@ -376,18 +376,18 @@ class Planner {
376 376
      *  fr_mm_s  - (target) speed of the move (mm/s)
377 377
      *  extruder - target extruder
378 378
      */
379
-    static FORCE_INLINE void buffer_line_kinematic(const float rtarget[XYZE], const float &fr_mm_s, const uint8_t extruder) {
379
+    static FORCE_INLINE void buffer_line_kinematic(const float cart[XYZE], const float &fr_mm_s, const uint8_t extruder) {
380 380
       #if PLANNER_LEVELING
381
-        float lpos[XYZ] = { rtarget[X_AXIS], rtarget[Y_AXIS], rtarget[Z_AXIS] };
382
-        apply_leveling(lpos);
381
+        float raw[XYZ] = { cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS] };
382
+        apply_leveling(raw);
383 383
       #else
384
-        const float * const lpos = rtarget;
384
+        const float * const raw = cart;
385 385
       #endif
386 386
       #if IS_KINEMATIC
387
-        inverse_kinematics(lpos);
388
-        _buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], rtarget[E_AXIS], fr_mm_s, extruder);
387
+        inverse_kinematics(raw);
388
+        _buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder);
389 389
       #else
390
-        _buffer_line(lpos[X_AXIS], lpos[Y_AXIS], lpos[Z_AXIS], rtarget[E_AXIS], fr_mm_s, extruder);
390
+        _buffer_line(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder);
391 391
       #endif
392 392
     }
393 393
 

Loading…
Zrušit
Uložit