🔧 Up to 9 tramming points (#25293)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@@ -1034,7 +1034,7 @@
|
|||||||
//#define ASSISTED_TRAMMING
|
//#define ASSISTED_TRAMMING
|
||||||
#if ENABLED(ASSISTED_TRAMMING)
|
#if ENABLED(ASSISTED_TRAMMING)
|
||||||
|
|
||||||
// Define positions for probe points.
|
// Define from 3 to 9 points to probe.
|
||||||
#define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } }
|
#define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } }
|
||||||
|
|
||||||
// Define position names for probe points.
|
// Define position names for probe points.
|
||||||
|
@@ -717,6 +717,19 @@
|
|||||||
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
|
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
|
||||||
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
|
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
|
||||||
|
|
||||||
|
// Emit a list of N OP(I) items with ascending counter.
|
||||||
|
#define _REPLIST(_RPT_I,_RPT_N,_RPT_OP) \
|
||||||
|
_RPT_OP(_RPT_I) \
|
||||||
|
IF_ELSE(SUB1(_RPT_N)) \
|
||||||
|
( , DEFER2(__REPLIST)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP) ) \
|
||||||
|
( /* Do nothing */ )
|
||||||
|
#define __REPLIST() _REPLIST
|
||||||
|
|
||||||
|
// Repeat a macro, comma-separated, passing S...N-1.
|
||||||
|
#define REPLIST_S(S,N,OP) EVAL(_REPLIST(S,SUB##S(N),OP))
|
||||||
|
#define REPLIST(N,OP) REPLIST_S(0,N,OP)
|
||||||
|
#define REPLIST_1(N,OP) REPLIST_S(1,INCREMENT(N),OP)
|
||||||
|
|
||||||
// Call OP(A) with each item as an argument
|
// Call OP(A) with each item as an argument
|
||||||
#define _MAP(_MAP_OP,A,V...) \
|
#define _MAP(_MAP_OP,A,V...) \
|
||||||
_MAP_OP(A) \
|
_MAP_OP(A) \
|
||||||
|
@@ -29,31 +29,11 @@
|
|||||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
#include "../core/debug_out.h"
|
#include "../core/debug_out.h"
|
||||||
|
|
||||||
PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
|
#define _TRAM_NAME_DEF(N) PGMSTR(point_name_##N, TRAMMING_POINT_NAME_##N);
|
||||||
PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
|
#define _TRAM_NAME_ITEM(N) point_name_##N
|
||||||
PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
|
REPEAT_1(_NR_TRAM_NAMES, _TRAM_NAME_DEF)
|
||||||
#ifdef TRAMMING_POINT_NAME_4
|
|
||||||
PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
|
|
||||||
#ifdef TRAMMING_POINT_NAME_5
|
|
||||||
PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
|
|
||||||
#ifdef TRAMMING_POINT_NAME_6
|
|
||||||
PGMSTR(point_name_6, TRAMMING_POINT_NAME_6);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PGM_P const tramming_point_name[] PROGMEM = {
|
PGM_P const tramming_point_name[] PROGMEM = { REPLIST_1(_NR_TRAM_NAMES, _TRAM_NAME_ITEM) };
|
||||||
point_name_1, point_name_2, point_name_3
|
|
||||||
#ifdef TRAMMING_POINT_NAME_4
|
|
||||||
, point_name_4
|
|
||||||
#ifdef TRAMMING_POINT_NAME_5
|
|
||||||
, point_name_5
|
|
||||||
#ifdef TRAMMING_POINT_NAME_6
|
|
||||||
, point_name_6
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef ASSISTED_TRAMMING_WAIT_POSITION
|
#ifdef ASSISTED_TRAMMING_WAIT_POSITION
|
||||||
|
|
||||||
|
@@ -31,43 +31,34 @@
|
|||||||
constexpr xy_pos_t tramming_points[] = TRAMMING_POINT_XY;
|
constexpr xy_pos_t tramming_points[] = TRAMMING_POINT_XY;
|
||||||
|
|
||||||
#define G35_PROBE_COUNT COUNT(tramming_points)
|
#define G35_PROBE_COUNT COUNT(tramming_points)
|
||||||
static_assert(WITHIN(G35_PROBE_COUNT, 3, 6), "TRAMMING_POINT_XY requires between 3 and 6 XY positions.");
|
static_assert(WITHIN(G35_PROBE_COUNT, 3, 9), "TRAMMING_POINT_XY requires between 3 and 9 XY positions.");
|
||||||
|
|
||||||
#define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(tramming_points[N]), \
|
#ifdef TRAMMING_POINT_NAME_9
|
||||||
"TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
|
#define _NR_TRAM_NAMES 9
|
||||||
VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4); VALIDATE_TRAMMING_POINT(5);
|
#elif defined(TRAMMING_POINT_NAME_8)
|
||||||
|
#define _NR_TRAM_NAMES 8
|
||||||
extern const char point_name_1[], point_name_2[], point_name_3[]
|
#elif defined(TRAMMING_POINT_NAME_7)
|
||||||
#ifdef TRAMMING_POINT_NAME_4
|
#define _NR_TRAM_NAMES 7
|
||||||
, point_name_4[]
|
#elif defined(TRAMMING_POINT_NAME_6)
|
||||||
#ifdef TRAMMING_POINT_NAME_5
|
#define _NR_TRAM_NAMES 6
|
||||||
, point_name_5[]
|
#elif defined(TRAMMING_POINT_NAME_5)
|
||||||
#ifdef TRAMMING_POINT_NAME_6
|
#define _NR_TRAM_NAMES 5
|
||||||
, point_name_6[]
|
#elif defined(TRAMMING_POINT_NAME_4)
|
||||||
#endif
|
#define _NR_TRAM_NAMES 4
|
||||||
#endif
|
#elif defined(TRAMMING_POINT_NAME_3)
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
#define _NR_TRAM_NAMES 2
|
|
||||||
#ifdef TRAMMING_POINT_NAME_3
|
|
||||||
#undef _NR_TRAM_NAMES
|
|
||||||
#define _NR_TRAM_NAMES 3
|
#define _NR_TRAM_NAMES 3
|
||||||
#ifdef TRAMMING_POINT_NAME_4
|
#else
|
||||||
#undef _NR_TRAM_NAMES
|
#define _NR_TRAM_NAMES 0
|
||||||
#define _NR_TRAM_NAMES 4
|
|
||||||
#ifdef TRAMMING_POINT_NAME_5
|
|
||||||
#undef _NR_TRAM_NAMES
|
|
||||||
#define _NR_TRAM_NAMES 5
|
|
||||||
#ifdef TRAMMING_POINT_NAME_6
|
|
||||||
#undef _NR_TRAM_NAMES
|
|
||||||
#define _NR_TRAM_NAMES 6
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_NAME_s for all TRAMMING_POINT_XY entries.");
|
static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_NAME_s for all TRAMMING_POINT_XY entries.");
|
||||||
#undef _NR_TRAM_NAMES
|
|
||||||
|
#define _TRAM_NAME_PTR(N) point_name_##N[]
|
||||||
|
extern const char REPLIST_1(_NR_TRAM_NAMES, _TRAM_NAME_PTR);
|
||||||
|
|
||||||
|
#define _CHECK_TRAM_POINT(N) static_assert(Probe::build_time::can_reach(tramming_points[N]), "TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.");
|
||||||
|
REPEAT(_NR_TRAM_NAMES, _CHECK_TRAM_POINT)
|
||||||
|
#undef _CHECK_TRAM_POINT
|
||||||
|
|
||||||
extern PGM_P const tramming_point_name[];
|
extern PGM_P const tramming_point_name[];
|
||||||
|
|
||||||
|
@@ -12,7 +12,8 @@ opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB \
|
|||||||
TEMP_SENSOR_0 -2 TEMP_SENSOR_BED 2 \
|
TEMP_SENSOR_0 -2 TEMP_SENSOR_BED 2 \
|
||||||
GRID_MAX_POINTS_X 16 \
|
GRID_MAX_POINTS_X 16 \
|
||||||
E0_AUTO_FAN_PIN 8 FANMUX0_PIN 53 EXTRUDER_AUTO_FAN_SPEED 100 \
|
E0_AUTO_FAN_PIN 8 FANMUX0_PIN 53 EXTRUDER_AUTO_FAN_SPEED 100 \
|
||||||
TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 6 HEATER_CHAMBER_PIN 45
|
TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 6 HEATER_CHAMBER_PIN 45 \
|
||||||
|
TRAMMING_POINT_XY '{{20,20},{20,20},{20,20},{20,20},{20,20}}' TRAMMING_POINT_NAME_5 '"Point 5"'
|
||||||
opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \
|
opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \
|
||||||
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \
|
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \
|
||||||
ASSISTED_TRAMMING REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
ASSISTED_TRAMMING REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
||||||
|
Reference in New Issue
Block a user