浏览代码

Use do_blocking_move_to where possible

Scott Lahteine 7 年前
父节点
当前提交
d4a1154c25
共有 3 个文件被更改,包括 17 次插入25 次删除
  1. 4
    7
      Marlin/src/feature/bedlevel/bedlevel.cpp
  2. 10
    18
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  3. 3
    0
      Marlin/src/module/motion.cpp

+ 4
- 7
Marlin/src/feature/bedlevel/bedlevel.cpp 查看文件

260
 
260
 
261
     #if MANUAL_PROBE_HEIGHT > 0
261
     #if MANUAL_PROBE_HEIGHT > 0
262
       const float prev_z = current_position[Z_AXIS];
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
     #endif
267
     #endif
271
 
268
 
272
     current_position[X_AXIS] = rx;
269
     current_position[X_AXIS] = rx;

+ 10
- 18
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp 查看文件

467
             //
467
             //
468
             SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
468
             SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
469
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
469
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
470
+
470
             if (!g29_x_flag && !g29_y_flag) {
471
             if (!g29_x_flag && !g29_y_flag) {
471
               /**
472
               /**
472
                * Use a good default location for the path.
473
                * Use a good default location for the path.
910
 
911
 
911
     static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); }
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
       has_control_of_lcd_panel = true;
915
       has_control_of_lcd_panel = true;
915
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
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
         //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
919
         //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
920
       stepper.synchronize();
920
       stepper.synchronize();
921
 
921
 
944
         SERIAL_PROTOCOLLNPGM("mm thick.");
944
         SERIAL_PROTOCOLLNPGM("mm thick.");
945
       }
945
       }
946
 
946
 
947
-      in_height = current_position[Z_AXIS]; // do manual probing at lower height
948
-
949
       has_control_of_lcd_panel = false;
947
       has_control_of_lcd_panel = false;
950
 
948
 
951
       restore_ubl_active_state_and_leave();
949
       restore_ubl_active_state_and_leave();
958
       has_control_of_lcd_panel = true;
956
       has_control_of_lcd_panel = true;
959
 
957
 
960
       save_ubl_active_state_and_disable();   // we don't do bed level correction because we want the raw data when we probe
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
       lcd_return_to_status();
962
       lcd_return_to_status();
965
 
963
 
974
 
972
 
975
         if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
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
         LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
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
         do_blocking_move_to_z(z_clearance);
978
         do_blocking_move_to_z(z_clearance);
983
 
979
 
984
         KEEPALIVE_STATE(PAUSED_FOR_USER);
980
         KEEPALIVE_STATE(PAUSED_FOR_USER);
1035
 
1031
 
1036
       restore_ubl_active_state_and_leave();
1032
       restore_ubl_active_state_and_leave();
1037
       KEEPALIVE_STATE(IN_HANDLER);
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
   #endif // NEWPANEL
1037
   #endif // NEWPANEL
1486
 
1481
 
1487
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
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
       uint16_t not_done[16];
1486
       uint16_t not_done[16];
1493
       memset(not_done, 0xFF, sizeof(not_done));
1487
       memset(not_done, 0xFF, sizeof(not_done));
1510
         if (isnan(new_z)) // if the mesh point is invalid, set it to 0.0 so it can be edited
1504
         if (isnan(new_z)) // if the mesh point is invalid, set it to 0.0 so it can be edited
1511
           new_z = 0.0;
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
         new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place
1509
         new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place
1517
 
1510
 
1571
 
1564
 
1572
       if (do_ubl_mesh_map) display_map(g29_map_type);
1565
       if (do_ubl_mesh_map) display_map(g29_map_type);
1573
       restore_ubl_active_state_and_leave();
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
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1570
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1579
       SERIAL_ECHOLNPGM("Done Editing Mesh");
1571
       SERIAL_ECHOLNPGM("Done Editing Mesh");

+ 3
- 0
Marlin/src/module/motion.cpp 查看文件

785
  *
785
  *
786
  * This may result in several calls to planner.buffer_line to
786
  * This may result in several calls to planner.buffer_line to
787
  * do smaller moves for DELTA, SCARA, mesh moves, etc.
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
 void prepare_move_to_destination() {
792
 void prepare_move_to_destination() {
790
   clamp_to_software_endstops(destination);
793
   clamp_to_software_endstops(destination);

正在加载...
取消
保存