Skip to content

Commit

Permalink
Add setting TOOLS to Configuration.h
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndere1 committed Jan 21, 2025
1 parent faecd7d commit 31a86a8
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 16 deletions.
9 changes: 9 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@

// @section extruder

/**
* This defines the number of tools, including extruders, laser and spindle tools.
* Tool indices, starting with 0, must be assigned in the following order: opional extruders (requires EXTRUDERS > 0),
* an optional laser (requires LASER_FEATURE), and finally optional tools for a spindle (requires SPINDLE_FEATURE).
* Offsets of each tool from tool 0 must be defined with HOTEND_OFFSET_X, HOTEND_OFFSET_Y and HOTEND_OFFSET_Z
*/
// :[0, 1, 2, ..., 127]
//#define TOOLS 1

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
Expand Down
12 changes: 4 additions & 8 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -897,11 +897,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
*/
#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
constexpr float thpx[] = SWITCHING_TOOLHEAD_X_POS;
#if HAS_TOOL_LENGTH_COMPENSATION
static_assert(COUNT(thpx) == TOOLS, "SWITCHING_TOOLHEAD_X_POS must be an array TOOLS long.");
#else
static_assert(COUNT(thpx) == EXTRUDERS, "SWITCHING_TOOLHEAD_X_POS must be an array EXTRUDERS long.");
#endif
static_assert(COUNT(thpx) == TOOLS, "SWITCHING_TOOLHEAD_X_POS must be an array TOOLS long.");
#endif

/**
Expand All @@ -910,10 +906,10 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#if ENABLED(SWITCHING_TOOLHEAD)
#ifndef SWITCHING_TOOLHEAD_SERVO_NR
#error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
#elif HAS_TOOL_LENGTH_COMPENSATION && (TOOLS < 2)
#error "SWITCHING_TOOLHEAD requires at least 2 TOOLS."
#elif (!HAS_TOOL_LENGTH_COMPENSATION) && (EXTRUDERS < 2)
#elif !defined(TOOLS) && EXTRUDERS < 2
#error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
#elif defined(TOOLS) && TOOLS < 2
#error "SWITCHING_TOOLHEAD requires at least 2 TOOLS."
#elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
#if SWITCHING_TOOLHEAD_SERVO_NR == 0
#error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
Expand Down
9 changes: 9 additions & 0 deletions config/default/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@

// @section extruder

/**
* This defines the number of tools, including extruders, laser and spindle tools.
* Tool indices, starting with 0, must be assigned in the following order: opional extruders (requires EXTRUDERS > 0),
* an optional laser (requires LASER_FEATURE), and finally optional tools for a spindle (requires SPINDLE_FEATURE).
* Offsets of each tool from tool 0 must be defined with HOTEND_OFFSET_X, HOTEND_OFFSET_Y and HOTEND_OFFSET_Z
*/
// :[0, 1, 2, ..., 127]
//#define TOOLS 1

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@

// @section extruder

/**
* This defines the number of tools, including extruders, laser and spindle tools.
* Tool indices, starting with 0, must be assigned in the following order: opional extruders (requires EXTRUDERS > 0),
* an optional laser (requires LASER_FEATURE), and finally optional tools for a spindle (requires SPINDLE_FEATURE).
* Offsets of each tool from tool 0 must be defined with HOTEND_OFFSET_X, HOTEND_OFFSET_Y and HOTEND_OFFSET_Z
*/
// :[0, 1, 2, ..., 127]
//#define TOOLS 1

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
Expand Down Expand Up @@ -1139,7 +1148,6 @@
*/
//#define PENTA_AXIS_TRT
#if ENABLED(PENTA_AXIS_TRT)
#define TOOLS 1 // Number of tools;

// Machine rotary zero point offsets
// The distance along the X axis from machine zero point to the center of rotation. The center of rotation is
Expand Down Expand Up @@ -1185,7 +1193,6 @@
*/
//#define PENTA_AXIS_HT
#if ENABLED(PENTA_AXIS_HT)
#define TOOLS 1 // Number of tools;

// Machine rotary zero point offset is the distance from the gage line at the tool head (tip of the nozzle of tool 0) to the horizontal
// centerline of the joint that tilts the tool head. Measured when all axes are at machine position 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@

// @section extruder

/**
* This defines the number of tools, including extruders, laser and spindle tools.
* Tool indices, starting with 0, must be assigned in the following order: opional extruders (requires EXTRUDERS > 0),
* an optional laser (requires LASER_FEATURE), and finally optional tools for a spindle (requires SPINDLE_FEATURE).
* Offsets of each tool from tool 0 must be defined with HOTEND_OFFSET_X, HOTEND_OFFSET_Y and HOTEND_OFFSET_Z
*/
// :[0, 1, 2, ..., 127]
//#define TOOLS 1

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
Expand Down Expand Up @@ -1139,7 +1148,6 @@
*/
#define PENTA_AXIS_TRT
#if ENABLED(PENTA_AXIS_TRT)
#define TOOLS 1 // Number of tools;

// Machine rotary zero point offsets
// The distance along the X axis from machine zero point to the center of rotation. The center of rotation is
Expand Down Expand Up @@ -1185,7 +1193,6 @@
*/
//#define PENTA_AXIS_HT
#if ENABLED(PENTA_AXIS_HT)
#define TOOLS 1 // Number of tools;

// Machine rotary zero point offset is the distance from the gage line at the tool head (tip of the nozzle of tool 0) to the horizontal
// centerline of the joint that tilts the tool head. Measured when all axes are at machine position 0.
Expand Down
11 changes: 9 additions & 2 deletions config/examples/DerAndere/HendrikJan5D_TRT_test/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@

// @section extruder

/**
* This defines the number of tools, including extruders, laser and spindle tools.
* Tool indices, starting with 0, must be assigned in the following order: opional extruders (requires EXTRUDERS > 0),
* an optional laser (requires LASER_FEATURE), and finally optional tools for a spindle (requires SPINDLE_FEATURE).
* Offsets of each tool from tool 0 must be defined with HOTEND_OFFSET_X, HOTEND_OFFSET_Y and HOTEND_OFFSET_Z
*/
// :[0, 1, 2, ..., 127]
#define TOOLS 3

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
Expand Down Expand Up @@ -1139,7 +1148,6 @@
*/
#define PENTA_AXIS_TRT
#if ENABLED(PENTA_AXIS_TRT)
#define TOOLS 3 // Number of tools;

// Machine rotary zero point offsets
// The distance along the X axis from machine zero point to the center of rotation. The center of rotation is
Expand Down Expand Up @@ -1185,7 +1193,6 @@
*/
//#define PENTA_AXIS_HT
#if ENABLED(PENTA_AXIS_HT)
#define TOOLS 1 // Number of tools;

// Machine rotary zero point offset is the distance from the gage line at the tool head (tip of the nozzle of tool 0) to the horizontal
// centerline of the joint that tilts the tool head. Measured when all axes are at machine position 0.
Expand Down
11 changes: 9 additions & 2 deletions config/examples/DerAndere/XYZBC_TRT_SKR-A8/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@

// @section extruder

/**
* This defines the number of tools, including extruders, laser and spindle tools.
* Tool indices, starting with 0, must be assigned in the following order: opional extruders (requires EXTRUDERS > 0),
* an optional laser (requires LASER_FEATURE), and finally optional tools for a spindle (requires SPINDLE_FEATURE).
* Offsets of each tool from tool 0 must be defined with HOTEND_OFFSET_X, HOTEND_OFFSET_Y and HOTEND_OFFSET_Z
*/
// :[0, 1, 2, ..., 127]
#define TOOLS 3

// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 0
Expand Down Expand Up @@ -1107,7 +1116,6 @@
*/
#define PENTA_AXIS_TRT
#if ENABLED(PENTA_AXIS_TRT)
#define TOOLS 3 // Number of tools;

// Machine rotary zero point offsets
// The distance along the X axis from machine zero point to the center of rotation. The center of rotation is
Expand Down Expand Up @@ -1150,7 +1158,6 @@
// This machine has a swivel head and a horizontal rotary table.
//#define PENTA_AXIS_HT
#if ENABLED(PENTA_AXIS_HT)
#define TOOLS 3 // Number of tools;

// Machine rotary zero point offset is the distance from the gauge line at the tool head to the horizontal
// centerline of the joint that tilts the tool head.
Expand Down

0 comments on commit 31a86a8

Please sign in to comment.