From c7ec6c68e7ea50b650e667fc59c8fb919cc32849 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 3 Jul 2018 20:08:14 -0500 Subject: [PATCH 1/2] Patch SCARA config to match 1.1.x --- .../src/config/examples/SCARA/Configuration.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h index 5a32db2a45..0014d865e1 100644 --- a/Marlin/src/config/examples/SCARA/Configuration.h +++ b/Marlin/src/config/examples/SCARA/Configuration.h @@ -522,23 +522,23 @@ // Specify here all the endstop connectors that are connected to any endstop or probe. // Almost all printers will be using one per axis. Probes will use one or more of the // extra connectors. Leave undefined any used for non-endstop and non-probe purposes. -#define USE_XMIN_PLUG -#define USE_YMIN_PLUG +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG #define USE_ZMIN_PLUG -//#define USE_XMAX_PLUG -//#define USE_YMAX_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG //#define USE_ZMAX_PLUG // Enable pullup for all endstops to prevent a floating state //#define ENDSTOPPULLUPS #if DISABLED(ENDSTOPPULLUPS) // Disable ENDSTOPPULLUPS to set pullups individually - //#define ENDSTOPPULLUP_XMAX - //#define ENDSTOPPULLUP_YMAX - #define ENDSTOPPULLUP_ZMAX // open pin, inverted - #define ENDSTOPPULLUP_XMIN // open pin, inverted - #define ENDSTOPPULLUP_YMIN // open pin, inverted - //#define ENDSTOPPULLUP_ZMIN + #define ENDSTOPPULLUP_XMAX + #define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX // open pin, inverted + //#define ENDSTOPPULLUP_XMIN // open pin, inverted + //#define ENDSTOPPULLUP_YMIN // open pin, inverted + #define ENDSTOPPULLUP_ZMIN //#define ENDSTOPPULLUP_ZMIN_PROBE #endif From 9c058091e936e3bec2900455ace27db2643ab565 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 3 Jul 2018 19:24:44 -0500 Subject: [PATCH 2/2] No M914 or SGT set for non-sensorless axes --- .../src/gcode/feature/trinamic/M911-M915.cpp | 80 +++++++++++-------- Marlin/src/module/stepper_indirection.cpp | 6 +- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp index 8a59837658..c351eeef35 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp @@ -268,58 +268,70 @@ void GcodeSuite::M912() { const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63); report = false; switch (i) { + #if X_SENSORLESS + case X_AXIS: + #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) + if (index == 0) TMC_SET_SGT(X); + #endif + #if ENABLED(X2_IS_TMC2130) + if (index == 1) TMC_SET_SGT(X2); + #endif + break; + #endif + #if Y_SENSORLESS + case Y_AXIS: + #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) + if (index == 0) TMC_SET_SGT(Y); + #endif + #if ENABLED(Y2_IS_TMC2130) + if (index == 1) TMC_SET_SGT(Y2); + #endif + break; + #endif + #if Z_SENSORLESS + case Z_AXIS: + #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) + if (index == 0) TMC_SET_SGT(Z); + #endif + #if ENABLED(Z2_IS_TMC2130) + if (index == 1) TMC_SET_SGT(Z2); + #endif + break; + #endif + } + } + + if (report) LOOP_XYZ(i) switch (i) { + #if X_SENSORLESS case X_AXIS: #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) - if (index == 0) TMC_SET_SGT(X); + TMC_SAY_SGT(X); #endif #if ENABLED(X2_IS_TMC2130) - if (index == 1) TMC_SET_SGT(X2); + TMC_SAY_SGT(X2); #endif break; + #endif + #if Y_SENSORLESS case Y_AXIS: #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) - if (index == 0) TMC_SET_SGT(Y); + TMC_SAY_SGT(Y); #endif #if ENABLED(Y2_IS_TMC2130) - if (index == 1) TMC_SET_SGT(Y2); + TMC_SAY_SGT(Y2); #endif break; + #endif + #if Z_SENSORLESS case Z_AXIS: #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) - if (index == 0) TMC_SET_SGT(Z); + TMC_SAY_SGT(Z); #endif #if ENABLED(Z2_IS_TMC2130) - if (index == 1) TMC_SET_SGT(Z2); + TMC_SAY_SGT(Z2); #endif break; - } - } - - if (report) LOOP_XYZ(i) switch (i) { - case X_AXIS: - #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) - TMC_SAY_SGT(X); - #endif - #if ENABLED(X2_IS_TMC2130) - TMC_SAY_SGT(X2); - #endif - break; - case Y_AXIS: - #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) - TMC_SAY_SGT(Y); - #endif - #if ENABLED(Y2_IS_TMC2130) - TMC_SAY_SGT(Y2); - #endif - break; - case Z_AXIS: - #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) - TMC_SAY_SGT(Z); - #endif - #if ENABLED(Z2_IS_TMC2130) - TMC_SAY_SGT(Z2); - #endif - break; + #endif } } #endif // SENSORLESS_HOMING diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index e1ac4a54ad..bf63e61b6d 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -249,7 +249,7 @@ #if ENABLED(SENSORLESS_HOMING) #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY); - #ifdef X_HOMING_SENSITIVITY + #if X_SENSORLESS #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) stepperX.sgt(X_HOMING_SENSITIVITY); #endif @@ -257,7 +257,7 @@ stepperX2.sgt(X_HOMING_SENSITIVITY); #endif #endif - #ifdef Y_HOMING_SENSITIVITY + #if Y_SENSORLESS #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) stepperY.sgt(Y_HOMING_SENSITIVITY); #endif @@ -265,7 +265,7 @@ stepperY2.sgt(Y_HOMING_SENSITIVITY); #endif #endif - #ifdef Z_HOMING_SENSITIVITY + #if Z_SENSORLESS #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) stepperZ.sgt(Z_HOMING_SENSITIVITY); #endif