Skip to content

Commit b7f86bf

Browse files
Alltedthinkyhead
authored andcommitted
Arc segment radius scaling (MarlinFirmware#16551)
1 parent 79810b7 commit b7f86bf

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Marlin/Configuration_adv.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -1567,14 +1567,15 @@
15671567
//
15681568
// G2/G3 Arc Support
15691569
//
1570-
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
1570+
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
15711571
#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
15741575
//#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
15781579
#endif
15791580

15801581
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.

Marlin/src/gcode/motion/G2_G3.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ void plan_arc(
105105

106106
const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
107107

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
109112
float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC);
110113
NOLESS(seg_length, MM_PER_ARC_SEGMENT);
111114
#else

0 commit comments

Comments
 (0)