Browse Source

Merge pull request #11196 from thinkyhead/bf2_fix_m914_sgt

[2.0.x] No M914 or SGT with non-sensorless axes
Scott Lahteine 7 years ago
parent
commit
6837252fba
No account linked to committer's email address

+ 10
- 10
Marlin/src/config/examples/SCARA/Configuration.h View File

522
 // Specify here all the endstop connectors that are connected to any endstop or probe.
522
 // Specify here all the endstop connectors that are connected to any endstop or probe.
523
 // Almost all printers will be using one per axis. Probes will use one or more of the
523
 // Almost all printers will be using one per axis. Probes will use one or more of the
524
 // extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
524
 // extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
525
-#define USE_XMIN_PLUG
526
-#define USE_YMIN_PLUG
525
+//#define USE_XMIN_PLUG
526
+//#define USE_YMIN_PLUG
527
 #define USE_ZMIN_PLUG
527
 #define USE_ZMIN_PLUG
528
-//#define USE_XMAX_PLUG
529
-//#define USE_YMAX_PLUG
528
+#define USE_XMAX_PLUG
529
+#define USE_YMAX_PLUG
530
 //#define USE_ZMAX_PLUG
530
 //#define USE_ZMAX_PLUG
531
 
531
 
532
 // Enable pullup for all endstops to prevent a floating state
532
 // Enable pullup for all endstops to prevent a floating state
533
 //#define ENDSTOPPULLUPS
533
 //#define ENDSTOPPULLUPS
534
 #if DISABLED(ENDSTOPPULLUPS)
534
 #if DISABLED(ENDSTOPPULLUPS)
535
   // Disable ENDSTOPPULLUPS to set pullups individually
535
   // Disable ENDSTOPPULLUPS to set pullups individually
536
-  //#define ENDSTOPPULLUP_XMAX
537
-  //#define ENDSTOPPULLUP_YMAX
538
-  #define ENDSTOPPULLUP_ZMAX  // open pin, inverted
539
-  #define ENDSTOPPULLUP_XMIN  // open pin, inverted
540
-  #define ENDSTOPPULLUP_YMIN  // open pin, inverted
541
-  //#define ENDSTOPPULLUP_ZMIN
536
+  #define ENDSTOPPULLUP_XMAX
537
+  #define ENDSTOPPULLUP_YMAX
538
+  //#define ENDSTOPPULLUP_ZMAX  // open pin, inverted
539
+  //#define ENDSTOPPULLUP_XMIN  // open pin, inverted
540
+  //#define ENDSTOPPULLUP_YMIN  // open pin, inverted
541
+  #define ENDSTOPPULLUP_ZMIN
542
   //#define ENDSTOPPULLUP_ZMIN_PROBE
542
   //#define ENDSTOPPULLUP_ZMIN_PROBE
543
 #endif
543
 #endif
544
 
544
 

+ 46
- 34
Marlin/src/gcode/feature/trinamic/M911-M915.cpp View File

268
       const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63);
268
       const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63);
269
       report = false;
269
       report = false;
270
       switch (i) {
270
       switch (i) {
271
+        #if X_SENSORLESS
272
+          case X_AXIS:
273
+            #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
274
+              if (index == 0) TMC_SET_SGT(X);
275
+            #endif
276
+            #if ENABLED(X2_IS_TMC2130)
277
+              if (index == 1) TMC_SET_SGT(X2);
278
+            #endif
279
+            break;
280
+        #endif
281
+        #if Y_SENSORLESS
282
+          case Y_AXIS:
283
+            #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
284
+              if (index == 0) TMC_SET_SGT(Y);
285
+            #endif
286
+            #if ENABLED(Y2_IS_TMC2130)
287
+              if (index == 1) TMC_SET_SGT(Y2);
288
+            #endif
289
+            break;
290
+        #endif
291
+        #if Z_SENSORLESS
292
+          case Z_AXIS:
293
+            #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
294
+              if (index == 0) TMC_SET_SGT(Z);
295
+            #endif
296
+            #if ENABLED(Z2_IS_TMC2130)
297
+              if (index == 1) TMC_SET_SGT(Z2);
298
+            #endif
299
+            break;
300
+        #endif
301
+      }
302
+    }
303
+
304
+    if (report) LOOP_XYZ(i) switch (i) {
305
+      #if X_SENSORLESS
271
         case X_AXIS:
306
         case X_AXIS:
272
           #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
307
           #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
273
-            if (index == 0) TMC_SET_SGT(X);
308
+            TMC_SAY_SGT(X);
274
           #endif
309
           #endif
275
           #if ENABLED(X2_IS_TMC2130)
310
           #if ENABLED(X2_IS_TMC2130)
276
-            if (index == 1) TMC_SET_SGT(X2);
311
+            TMC_SAY_SGT(X2);
277
           #endif
312
           #endif
278
           break;
313
           break;
314
+      #endif
315
+      #if Y_SENSORLESS
279
         case Y_AXIS:
316
         case Y_AXIS:
280
           #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
317
           #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
281
-            if (index == 0) TMC_SET_SGT(Y);
318
+            TMC_SAY_SGT(Y);
282
           #endif
319
           #endif
283
           #if ENABLED(Y2_IS_TMC2130)
320
           #if ENABLED(Y2_IS_TMC2130)
284
-            if (index == 1) TMC_SET_SGT(Y2);
321
+            TMC_SAY_SGT(Y2);
285
           #endif
322
           #endif
286
           break;
323
           break;
324
+      #endif
325
+      #if Z_SENSORLESS
287
         case Z_AXIS:
326
         case Z_AXIS:
288
           #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
327
           #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
289
-            if (index == 0) TMC_SET_SGT(Z);
328
+            TMC_SAY_SGT(Z);
290
           #endif
329
           #endif
291
           #if ENABLED(Z2_IS_TMC2130)
330
           #if ENABLED(Z2_IS_TMC2130)
292
-            if (index == 1) TMC_SET_SGT(Z2);
331
+            TMC_SAY_SGT(Z2);
293
           #endif
332
           #endif
294
           break;
333
           break;
295
-      }
296
-    }
297
-
298
-    if (report) LOOP_XYZ(i) switch (i) {
299
-      case X_AXIS:
300
-        #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
301
-          TMC_SAY_SGT(X);
302
-        #endif
303
-        #if ENABLED(X2_IS_TMC2130)
304
-          TMC_SAY_SGT(X2);
305
-        #endif
306
-        break;
307
-      case Y_AXIS:
308
-        #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
309
-          TMC_SAY_SGT(Y);
310
-        #endif
311
-        #if ENABLED(Y2_IS_TMC2130)
312
-          TMC_SAY_SGT(Y2);
313
-        #endif
314
-        break;
315
-      case Z_AXIS:
316
-        #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
317
-          TMC_SAY_SGT(Z);
318
-        #endif
319
-        #if ENABLED(Z2_IS_TMC2130)
320
-          TMC_SAY_SGT(Z2);
321
-        #endif
322
-        break;
334
+      #endif
323
     }
335
     }
324
   }
336
   }
325
 #endif // SENSORLESS_HOMING
337
 #endif // SENSORLESS_HOMING

+ 3
- 3
Marlin/src/module/stepper_indirection.cpp View File

249
 
249
 
250
     #if ENABLED(SENSORLESS_HOMING)
250
     #if ENABLED(SENSORLESS_HOMING)
251
       #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY);
251
       #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY);
252
-      #ifdef X_HOMING_SENSITIVITY
252
+      #if X_SENSORLESS
253
         #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
253
         #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
254
           stepperX.sgt(X_HOMING_SENSITIVITY);
254
           stepperX.sgt(X_HOMING_SENSITIVITY);
255
         #endif
255
         #endif
257
           stepperX2.sgt(X_HOMING_SENSITIVITY);
257
           stepperX2.sgt(X_HOMING_SENSITIVITY);
258
         #endif
258
         #endif
259
       #endif
259
       #endif
260
-      #ifdef Y_HOMING_SENSITIVITY
260
+      #if Y_SENSORLESS
261
         #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
261
         #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
262
           stepperY.sgt(Y_HOMING_SENSITIVITY);
262
           stepperY.sgt(Y_HOMING_SENSITIVITY);
263
         #endif
263
         #endif
265
           stepperY2.sgt(Y_HOMING_SENSITIVITY);
265
           stepperY2.sgt(Y_HOMING_SENSITIVITY);
266
         #endif
266
         #endif
267
       #endif
267
       #endif
268
-      #ifdef Z_HOMING_SENSITIVITY
268
+      #if Z_SENSORLESS
269
         #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
269
         #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
270
           stepperZ.sgt(Z_HOMING_SENSITIVITY);
270
           stepperZ.sgt(Z_HOMING_SENSITIVITY);
271
         #endif
271
         #endif

Loading…
Cancel
Save