Ver código fonte

Use do_blocking_move_to where possible

Scott Lahteine 7 anos atrás
pai
commit
d4a1154c25

+ 4
- 7
Marlin/src/feature/bedlevel/bedlevel.cpp Ver arquivo

@@ -260,13 +260,10 @@ void reset_bed_level() {
260 260
 
261 261
     #if MANUAL_PROBE_HEIGHT > 0
262 262
       const float prev_z = current_position[Z_AXIS];
263
-      do_blocking_move_to_z(MANUAL_PROBE_HEIGHT, homing_feedrate(Z_AXIS));
264
-    #endif
265
-
266
-    do_blocking_move_to_xy(rx, ry, MMM_TO_MMS(XY_PROBE_SPEED));
267
-
268
-    #if MANUAL_PROBE_HEIGHT > 0
269
-      do_blocking_move_to_z(prev_z, homing_feedrate(Z_AXIS));
263
+      do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT);
264
+      do_blocking_move_to_z(prev_z);
265
+    #else
266
+      do_blocking_move_to_xy(rx, ry);
270 267
     #endif
271 268
 
272 269
     current_position[X_AXIS] = rx;

+ 10
- 18
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Ver arquivo

@@ -467,6 +467,7 @@
467 467
             //
468 468
             SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
469 469
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
470
+
470 471
             if (!g29_x_flag && !g29_y_flag) {
471 472
               /**
472 473
                * Use a good default location for the path.
@@ -910,12 +911,11 @@
910 911
 
911 912
     static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); }
912 913
 
913
-    float unified_bed_leveling::measure_business_card_thickness(float in_height) {
914
+    float unified_bed_leveling::measure_business_card_thickness(const float in_height) {
914 915
       has_control_of_lcd_panel = true;
915 916
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
916 917
 
917
-      do_blocking_move_to_z(in_height);
918
-      do_blocking_move_to_xy(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)));
918
+      do_blocking_move_to(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
919 919
         //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
920 920
       stepper.synchronize();
921 921
 
@@ -944,8 +944,6 @@
944 944
         SERIAL_PROTOCOLLNPGM("mm thick.");
945 945
       }
946 946
 
947
-      in_height = current_position[Z_AXIS]; // do manual probing at lower height
948
-
949 947
       has_control_of_lcd_panel = false;
950 948
 
951 949
       restore_ubl_active_state_and_leave();
@@ -958,8 +956,8 @@
958 956
       has_control_of_lcd_panel = true;
959 957
 
960 958
       save_ubl_active_state_and_disable();   // we don't do bed level correction because we want the raw data when we probe
961
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
962
-      do_blocking_move_to_xy(rx, ry);
959
+
960
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
963 961
 
964 962
       lcd_return_to_status();
965 963
 
@@ -974,11 +972,9 @@
974 972
 
975 973
         if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
976 974
 
977
-        do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
978
-
979 975
         LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
980 976
 
981
-        do_blocking_move_to_xy(xProbe, yProbe);
977
+        do_blocking_move_to(xProbe, yProbe, Z_CLEARANCE_BETWEEN_PROBES);
982 978
         do_blocking_move_to_z(z_clearance);
983 979
 
984 980
         KEEPALIVE_STATE(PAUSED_FOR_USER);
@@ -1035,8 +1031,7 @@
1035 1031
 
1036 1032
       restore_ubl_active_state_and_leave();
1037 1033
       KEEPALIVE_STATE(IN_HANDLER);
1038
-      do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
1039
-      do_blocking_move_to_xy(rx, ry);
1034
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE);
1040 1035
     }
1041 1036
 
1042 1037
   #endif // NEWPANEL
@@ -1486,8 +1481,7 @@
1486 1481
 
1487 1482
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
1488 1483
 
1489
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1490
-      do_blocking_move_to_xy(rx, ry);
1484
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
1491 1485
 
1492 1486
       uint16_t not_done[16];
1493 1487
       memset(not_done, 0xFF, sizeof(not_done));
@@ -1510,8 +1504,7 @@
1510 1504
         if (isnan(new_z)) // if the mesh point is invalid, set it to 0.0 so it can be edited
1511 1505
           new_z = 0.0;
1512 1506
 
1513
-        do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);    // Move the nozzle to where we are going to edit
1514
-        do_blocking_move_to_xy(rawx, rawy);
1507
+        do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point
1515 1508
 
1516 1509
         new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place
1517 1510
 
@@ -1571,9 +1564,8 @@
1571 1564
 
1572 1565
       if (do_ubl_mesh_map) display_map(g29_map_type);
1573 1566
       restore_ubl_active_state_and_leave();
1574
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1575 1567
 
1576
-      do_blocking_move_to_xy(rx, ry);
1568
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
1577 1569
 
1578 1570
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1579 1571
       SERIAL_ECHOLNPGM("Done Editing Mesh");

+ 3
- 0
Marlin/src/module/motion.cpp Ver arquivo

@@ -785,6 +785,9 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
785 785
  *
786 786
  * This may result in several calls to planner.buffer_line to
787 787
  * do smaller moves for DELTA, SCARA, mesh moves, etc.
788
+ *
789
+ * Make sure current_position[E] and destination[E] are good
790
+ * before calling or cold/lengthy extrusion may get missed.
788 791
  */
789 792
 void prepare_move_to_destination() {
790 793
   clamp_to_software_endstops(destination);

Carregando…
Cancelar
Salvar