Pārlūkot izejas kodu

Arc segment radius scaling (#16551)

Ryan 5 gadus atpakaļ
vecāks
revīzija
b7f86bffd5
2 mainītis faili ar 11 papildinājumiem un 7 dzēšanām
  1. 7
    6
      Marlin/Configuration_adv.h
  2. 4
    1
      Marlin/src/gcode/motion/G2_G3.cpp

+ 7
- 6
Marlin/Configuration_adv.h Parādīt failu

1567
 //
1567
 //
1568
 // G2/G3 Arc Support
1568
 // G2/G3 Arc Support
1569
 //
1569
 //
1570
-#define ARC_SUPPORT               // Disable this feature to save ~3226 bytes
1570
+#define ARC_SUPPORT                 // Disable this feature to save ~3226 bytes
1571
 #if ENABLED(ARC_SUPPORT)
1571
 #if ENABLED(ARC_SUPPORT)
1572
-  #define MM_PER_ARC_SEGMENT    1 // (mm) Length (or minimum length) of each arc segment
1573
-  #define MIN_ARC_SEGMENTS     24 // Minimum number of segments in a complete circle
1572
+  #define MM_PER_ARC_SEGMENT      1 // (mm) Length (or minimum length) of each arc segment
1573
+  //#define ARC_SEGMENTS_PER_R    1 // Max segment length, MM_PER = Min
1574
+  #define MIN_ARC_SEGMENTS       24 // Minimum number of segments in a complete circle
1574
   //#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
1575
   //#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
1575
-  #define N_ARC_CORRECTION     25 // Number of interpolated segments between corrections
1576
-  //#define ARC_P_CIRCLES         // Enable the 'P' parameter to specify complete circles
1577
-  //#define CNC_WORKSPACE_PLANES  // Allow G2/G3 to operate in XY, ZX, or YZ planes
1576
+  #define N_ARC_CORRECTION       25 // Number of interpolated segments between corrections
1577
+  //#define ARC_P_CIRCLES           // Enable the 'P' parameter to specify complete circles
1578
+  //#define CNC_WORKSPACE_PLANES    // Allow G2/G3 to operate in XY, ZX, or YZ planes
1578
 #endif
1579
 #endif
1579
 
1580
 
1580
 // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
1581
 // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.

+ 4
- 1
Marlin/src/gcode/motion/G2_G3.cpp Parādīt failu

105
 
105
 
106
   const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
106
   const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
107
 
107
 
108
-  #ifdef ARC_SEGMENTS_PER_SEC
108
+  #ifdef ARC_SEGMENTS_PER_R
109
+    float seg_length = MM_PER_ARC_SEGMENT * radius;
110
+    LIMIT(seg_length, MM_PER_ARC_SEGMENT, ARC_SEGMENTS_PER_R);
111
+  #elif ARC_SEGMENTS_PER_SEC
109
     float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC);
112
     float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC);
110
     NOLESS(seg_length, MM_PER_ARC_SEGMENT);
113
     NOLESS(seg_length, MM_PER_ARC_SEGMENT);
111
   #else
114
   #else

Notiek ielāde…
Atcelt
Saglabāt