Pārlūkot izejas kodu

Make USE_DELTA_IK_INTERPOLATION compatible with ABL

Scott Lahteine 8 gadus atpakaļ
vecāks
revīzija
a4a7ca10ca
2 mainītis faili ar 23 papildinājumiem un 4 dzēšanām
  1. 21
    2
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/SanityCheck.h

+ 21
- 2
Marlin/Marlin_main.cpp Parādīt failu

456
   #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE()
456
   #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE()
457
 #endif
457
 #endif
458
 
458
 
459
+#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
460
+  #define ADJUST_DELTA(V) \
461
+    if (planner.abl_enabled) { \
462
+      const float zadj = bilinear_z_offset(V); \
463
+      delta[A_AXIS] += zadj; \
464
+      delta[B_AXIS] += zadj; \
465
+      delta[C_AXIS] += zadj; \
466
+    }
467
+#elif IS_KINEMATIC
468
+  #define ADJUST_DELTA(V) NOOP
469
+#endif
470
+
459
 #if ENABLED(Z_DUAL_ENDSTOPS)
471
 #if ENABLED(Z_DUAL_ENDSTOPS)
460
   float z_endstop_adj = 0;
472
   float z_endstop_adj = 0;
461
 #endif
473
 #endif
8758
       #define DELTA_NEXT(ADDEND) LOOP_XYZ(i) DELTA_VAR[i] += ADDEND;
8770
       #define DELTA_NEXT(ADDEND) LOOP_XYZ(i) DELTA_VAR[i] += ADDEND;
8759
 
8771
 
8760
       // Get the starting delta if interpolation is possible
8772
       // Get the starting delta if interpolation is possible
8761
-      if (segments >= 2) DELTA_IK();
8773
+      if (segments >= 2) {
8774
+        DELTA_IK();
8775
+        ADJUST_DELTA(DELTA_VAR); // Adjust Z if bed leveling is enabled
8776
+      }
8762
 
8777
 
8763
       // Loop using decrement
8778
       // Loop using decrement
8764
       for (uint16_t s = segments + 1; --s;) {
8779
       for (uint16_t s = segments + 1; --s;) {
8775
 
8790
 
8776
           // Get the exact delta for the move after this
8791
           // Get the exact delta for the move after this
8777
           DELTA_IK();
8792
           DELTA_IK();
8793
+          ADJUST_DELTA(DELTA_VAR); // Adjust Z if bed leveling is enabled
8778
 
8794
 
8779
           // Move to the interpolated delta position first
8795
           // Move to the interpolated delta position first
8780
           planner.buffer_line(
8796
           planner.buffer_line(
8795
           DELTA_NEXT(segment_distance[i]);
8811
           DELTA_NEXT(segment_distance[i]);
8796
           DELTA_VAR[E_AXIS] += segment_distance[E_AXIS];
8812
           DELTA_VAR[E_AXIS] += segment_distance[E_AXIS];
8797
           DELTA_IK();
8813
           DELTA_IK();
8814
+          ADJUST_DELTA(DELTA_VAR); // Adjust Z if bed leveling is enabled
8798
         }
8815
         }
8799
 
8816
 
8800
         // Move to the non-interpolated position
8817
         // Move to the non-interpolated position
8808
       // For non-interpolated delta calculate every segment
8825
       // For non-interpolated delta calculate every segment
8809
       for (uint16_t s = segments + 1; --s;) {
8826
       for (uint16_t s = segments + 1; --s;) {
8810
         DELTA_NEXT(segment_distance[i]);
8827
         DELTA_NEXT(segment_distance[i]);
8811
-        planner.buffer_line_kinematic(DELTA_VAR, _feedrate_mm_s, active_extruder);
8828
+        DELTA_IK();
8829
+        ADJUST_DELTA(DELTA_VAR);
8830
+        planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], DELTA_VAR[E_AXIS], _feedrate_mm_s, active_extruder);
8812
       }
8831
       }
8813
 
8832
 
8814
     #endif
8833
     #endif

+ 2
- 2
Marlin/SanityCheck.h Parādīt failu

518
  */
518
  */
519
 #if HAS_ABL
519
 #if HAS_ABL
520
 
520
 
521
-  #if ENABLED(USE_RAW_KINEMATICS) || ENABLED(USE_DELTA_IK_INTERPOLATION)
522
-    #error "USE_RAW_KINEMATICS and USE_DELTA_IK_INTERPOLATION are not compatible with AUTO_BED_LEVELING"
521
+  #if ENABLED(USE_RAW_KINEMATICS)
522
+    #error "USE_RAW_KINEMATICS is not compatible with AUTO_BED_LEVELING"
523
   #endif
523
   #endif
524
 
524
 
525
   /**
525
   /**

Notiek ielāde…
Atcelt
Saglabāt