Browse Source

Arc segment radius scaling (#16551)

pull/1/head
Ryan 5 years ago
committed by Scott Lahteine
parent
commit
b7f86bffd5
  1. 1
      Marlin/Configuration_adv.h
  2. 5
      Marlin/src/gcode/motion/G2_G3.cpp

1
Marlin/Configuration_adv.h

@ -1570,6 +1570,7 @@
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes #define ARC_SUPPORT // Disable this feature to save ~3226 bytes
#if ENABLED(ARC_SUPPORT) #if ENABLED(ARC_SUPPORT)
#define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment #define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
#define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle #define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
//#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum) //#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
#define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections

5
Marlin/src/gcode/motion/G2_G3.cpp

@ -105,7 +105,10 @@ void plan_arc(
const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
#ifdef ARC_SEGMENTS_PER_SEC #ifdef ARC_SEGMENTS_PER_R
float seg_length = MM_PER_ARC_SEGMENT * radius;
LIMIT(seg_length, MM_PER_ARC_SEGMENT, ARC_SEGMENTS_PER_R);
#elif ARC_SEGMENTS_PER_SEC
float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC); float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC);
NOLESS(seg_length, MM_PER_ARC_SEGMENT); NOLESS(seg_length, MM_PER_ARC_SEGMENT);
#else #else

Loading…
Cancel
Save