Ver código fonte

Corner Leveling: Add inset for each side (#16759)

Scott Lahteine 4 anos atrás
pai
commit
7f9c62437e
Nenhuma conta vinculada ao e-mail do autor do commit

+ 4
- 4
Marlin/Configuration.h Ver arquivo

@@ -1313,10 +1313,10 @@
1313 1313
 //#define LEVEL_BED_CORNERS
1314 1314
 
1315 1315
 #if ENABLED(LEVEL_BED_CORNERS)
1316
-  #define LEVEL_CORNERS_INSET 30    // (mm) An inset for corner leveling
1317
-  #define LEVEL_CORNERS_Z_HOP  4.0  // (mm) Move nozzle up before moving between corners
1318
-  #define LEVEL_CORNERS_HEIGHT 0.0  // (mm) Z height of nozzle at leveling points
1319
-  //#define LEVEL_CENTER_TOO        // Move to the center after the last corner
1316
+  #define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
1317
+  #define LEVEL_CORNERS_HEIGHT      0.0   // (mm) Z height of nozzle at leveling points
1318
+  #define LEVEL_CORNERS_Z_HOP       4.0   // (mm) Z height of nozzle between leveling points
1319
+  //#define LEVEL_CENTER_TOO              // Move to the center after the last corner
1320 1320
 #endif
1321 1321
 
1322 1322
 /**

+ 1
- 1
Marlin/src/feature/joystick.cpp Ver arquivo

@@ -164,7 +164,7 @@ Joystick joystick;
164 164
     LOOP_XYZ(i) if (norm_jog[i]) {
165 165
       move_dist[i] = seg_time * norm_jog[i] *
166 166
         #if ENABLED(EXTENSIBLE_UI)
167
-          MMM_TO_MMS(manual_feedrate_mm_m[i]);
167
+          manual_feedrate_mm_s[i];
168 168
         #else
169 169
           planner.settings.max_feedrate_mm_s[i];
170 170
         #endif

+ 4
- 2
Marlin/src/inc/SanityCheck.h Ver arquivo

@@ -312,8 +312,10 @@
312 312
   #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
313 313
 #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
314 314
   #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration."
315
-#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET)
316
-  #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h."
315
+#elif defined(LEVEL_CORNERS_INSET)
316
+  #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB . Please update your Configuration.h."
317
+#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB)
318
+  #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values. Please update your Configuration.h."
317 319
 #elif defined(BEZIER_JERK_CONTROL)
318 320
   #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
319 321
 #elif DISABLED(CLASSIC_JERK) && defined(JUNCTION_DEVIATION_FACTOR)

+ 2
- 2
Marlin/src/lcd/extensible_ui/ui_api.cpp Ver arquivo

@@ -389,14 +389,14 @@ namespace ExtUI {
389 389
     #endif
390 390
 
391 391
     current_position[axis] = constrain(position, min, max);
392
-    line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m[axis]));
392
+    line_to_current_position(manual_feedrate_mm_s[axis]);
393 393
   }
394 394
 
395 395
   void setAxisPosition_mm(const float position, const extruder_t extruder) {
396 396
     setActiveTool(extruder, true);
397 397
 
398 398
     current_position.e = position;
399
-    line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.e));
399
+    line_to_current_position(manual_feedrate_mm_s.e);
400 400
   }
401 401
 
402 402
   void setActiveTool(const extruder_t extruder, bool no_move) {

+ 1
- 1
Marlin/src/lcd/menu/menu.cpp Ver arquivo

@@ -384,7 +384,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
384 384
 
385 385
   void line_to_z(const float &z) {
386 386
     current_position.z = z;
387
-    line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.z));
387
+    line_to_current_position(manual_feedrate_mm_s.z);
388 388
   }
389 389
 
390 390
 #endif

+ 11
- 18
Marlin/src/lcd/menu/menu_bed_corners.cpp Ver arquivo

@@ -55,33 +55,26 @@ static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Pleas
55 55
  */
56 56
 static int8_t bed_corner;
57 57
 static inline void _lcd_goto_next_corner() {
58
+  constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB;
59
+  constexpr xy_pos_t lf { (X_MIN_BED) + lfrb[0], (Y_MIN_BED) + lfrb[1] },
60
+                     rb { (X_MAX_BED) - lfrb[2], (Y_MAX_BED) - lfrb[3] };
58 61
   line_to_z(LEVEL_CORNERS_Z_HOP);
59 62
   switch (bed_corner) {
60
-    case 0:
61
-      current_position.set(X_MIN_BED + LEVEL_CORNERS_INSET, Y_MIN_BED + LEVEL_CORNERS_INSET);
62
-      break;
63
-    case 1:
64
-      current_position.x = X_MAX_BED - (LEVEL_CORNERS_INSET);
65
-      break;
66
-    case 2:
67
-      current_position.y = Y_MAX_BED - (LEVEL_CORNERS_INSET);
68
-      break;
69
-    case 3:
70
-      current_position.x = X_MIN_BED + LEVEL_CORNERS_INSET;
71
-      break;
63
+    case 0: current_position   = lf;   break; // copy xy
64
+    case 1: current_position.x = rb.x; break;
65
+    case 2: current_position.y = rb.y; break;
66
+    case 3: current_position.x = lf.x; break;
72 67
     #if ENABLED(LEVEL_CENTER_TOO)
73
-      case 4:
74
-        current_position.set(X_CENTER, Y_CENTER);
75
-        break;
68
+      case 4: current_position.set(X_CENTER, Y_CENTER); break;
76 69
     #endif
77 70
   }
78
-  line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.x));
71
+  line_to_current_position(manual_feedrate_mm_s.x);
79 72
   line_to_z(LEVEL_CORNERS_HEIGHT);
80
-  if (++bed_corner > 3
73
+  if (++bed_corner > (3
81 74
     #if ENABLED(LEVEL_CENTER_TOO)
82 75
       + 1
83 76
     #endif
84
-  ) bed_corner = 0;
77
+  )) bed_corner = 0;
85 78
 }
86 79
 
87 80
 static inline void _lcd_level_bed_corners_homing() {

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp Ver arquivo

@@ -673,7 +673,7 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
673 673
 
674 674
     if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) {
675 675
 
676
-      const feedRate_t fr_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]);
676
+      const feedRate_t fr_mm_s = manual_feedrate_mm_s[manual_move_axis];
677 677
       #if IS_KINEMATIC
678 678
 
679 679
         #if EXTRUDERS > 1

+ 2
- 1
Marlin/src/module/planner.h Ver arquivo

@@ -57,7 +57,8 @@
57 57
 
58 58
 // Feedrate for manual moves
59 59
 #ifdef MANUAL_FEEDRATE
60
-  constexpr xyze_feedrate_t manual_feedrate_mm_m = MANUAL_FEEDRATE;
60
+  constexpr xyze_feedrate_t _mf = MANUAL_FEEDRATE,
61
+                            manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f };
61 62
 #endif
62 63
 
63 64
 enum BlockFlagBit : char {

Carregando…
Cancelar
Salvar