Skip to content

Commit

Permalink
🔧 Tramming screw threads
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 5, 2024
1 parent 83cbed8 commit 45b9680
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 8 additions & 5 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1107,12 +1107,15 @@
//#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment
/**
* Screw thread:
* M3: 30 = Clockwise, 31 = Counter-Clockwise
* M4: 40 = Clockwise, 41 = Counter-Clockwise
* M5: 50 = Clockwise, 51 = Counter-Clockwise
* Screw Thread. Use one of the following defines:
*
* M3_CW = M3 Clockwise, M3_CCW = M3 Counter-Clockwise
* M4_CW = M3 Clockwise, M4_CCW = M4 Counter-Clockwise
* M5_CW = M3 Clockwise, M5_CCW = M5 Counter-Clockwise
*
* :{'M3_CW':'M3 Clockwise','M3_CCW':'M3 Counter-Clockwise','M4_CW':'M4 Clockwise','M4_CCW':'M4 Counter-Clockwise','M5_CW':'M5 Clockwise','M5_CCW':'M5 Counter-Clockwise'}
*/
#define TRAMMING_SCREW_THREAD 30
#define TRAMMING_SCREW_THREAD M3_CW

#endif

Expand Down
13 changes: 10 additions & 3 deletions Marlin/src/feature/tramming.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
#include "../inc/MarlinConfig.h"
#include "../module/probe.h"

#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1
#error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51."
#endif
enum TrammingThread : uint8_t {
M3_CW = 30, M3_CCW = 31,
M4_CW = 40, M4_CCW = 41,
M5_CW = 50, M5_CCW = 51
};

static_assert(
TRAMMING_SCREW_THREAD < 60 && TRAMMING_SCREW_THREAD % 10 < 2,
"TRAMMING_SCREW_THREAD must be M3_CW, M3_CCW, M4_CW, M4_CCW, M5_CW, or M5_CCW."
);

constexpr xy_pos_t tramming_points[] = TRAMMING_POINT_XY;

Expand Down

0 comments on commit 45b9680

Please sign in to comment.